authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-14 14:41:57-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-14 14:41:57-07:00
log5a3ea9beced660c9cc463b921a1581cc07855dd6
tree7e622bd133adcdbcc0c8d854deaac97f345c4c8c
parent1fada3746606b3a83d4c56213de93a1017753c96
parentcc186dac65d84ecbf29b5f8704beb2dfd00d76bb

Merge remote-tracking branch 'origin/llvm12'

Happy LLVM 12 Release Day. Please note that the llvm 12 tag does not include the latest commit in the release/12.x branch, which is in fact a bug fix for a regression that is causing a failure in Zig's test suite. Zig master branch is tracking release/12.x, and will be enabling the test that is fixed by that commit.

268 files changed, 25564 insertions(+), 16178 deletions(-)

cmake/Findclang.cmake+17-17
...@@ -9,27 +9,27 @@...@@ -9,27 +9,27 @@
99
10find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h10find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
11 PATHS11 PATHS
12 /usr/lib/llvm/11/include12 /usr/lib/llvm/12/include
13 /usr/lib/llvm-11/include13 /usr/lib/llvm-12/include
14 /usr/lib/llvm-11.0/include14 /usr/lib/llvm-12.0/include
15 /usr/local/llvm110/include15 /usr/local/llvm120/include
16 /usr/local/llvm11/include16 /usr/local/llvm12/include
17 /mingw64/include17 /mingw64/include
18)18)
1919
20if(ZIG_PREFER_CLANG_CPP_DYLIB)20if(ZIG_PREFER_CLANG_CPP_DYLIB)
21 find_library(CLANG_LIBRARIES21 find_library(CLANG_LIBRARIES
22 NAMES22 NAMES
23 clang-cpp-11.023 clang-cpp-12.0
24 clang-cpp11024 clang-cpp120
25 clang-cpp25 clang-cpp
26 PATHS26 PATHS
27 ${CLANG_LIBDIRS}27 ${CLANG_LIBDIRS}
28 /usr/lib/llvm/11/lib28 /usr/lib/llvm/12/lib
29 /usr/lib/llvm/11/lib6429 /usr/lib/llvm/12/lib64
30 /usr/lib/llvm-11/lib30 /usr/lib/llvm-12/lib
31 /usr/local/llvm110/lib31 /usr/local/llvm120/lib
32 /usr/local/llvm11/lib32 /usr/local/llvm12/lib
33 )33 )
34endif()34endif()
3535
...@@ -39,11 +39,11 @@ if(NOT CLANG_LIBRARIES)...@@ -39,11 +39,11 @@ if(NOT CLANG_LIBRARIES)
39 find_library(CLANG_${_prettylibname_}_LIB NAMES ${_libname_}39 find_library(CLANG_${_prettylibname_}_LIB NAMES ${_libname_}
40 PATHS40 PATHS
41 ${CLANG_LIBDIRS}41 ${CLANG_LIBDIRS}
42 /usr/lib/llvm/11/lib42 /usr/lib/llvm/12/lib
43 /usr/lib/llvm-11/lib43 /usr/lib/llvm-12/lib
44 /usr/lib/llvm-11.0/lib44 /usr/lib/llvm-12.0/lib
45 /usr/local/llvm110/lib45 /usr/local/llvm120/lib
46 /usr/local/llvm11/lib46 /usr/local/llvm12/lib
47 /mingw64/lib47 /mingw64/lib
48 /c/msys64/mingw64/lib48 /c/msys64/mingw64/lib
49 c:\\msys64\\mingw64\\lib49 c:\\msys64\\mingw64\\lib
cmake/Findlld.cmake+10-10
...@@ -8,16 +8,16 @@...@@ -8,16 +8,16 @@
88
9find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h9find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
10 PATHS10 PATHS
11 /usr/lib/llvm-11/include11 /usr/lib/llvm-12/include
12 /usr/local/llvm110/include12 /usr/local/llvm120/include
13 /usr/local/llvm11/include13 /usr/local/llvm12/include
14 /mingw64/include)14 /mingw64/include)
1515
16find_library(LLD_LIBRARY NAMES lld-11.0 lld110 lld16find_library(LLD_LIBRARY NAMES lld-12.0 lld120 lld
17 PATHS17 PATHS
18 /usr/lib/llvm-11/lib18 /usr/lib/llvm-12/lib
19 /usr/local/llvm110/lib19 /usr/local/llvm120/lib
20 /usr/local/llvm11/lib20 /usr/local/llvm12/lib
21)21)
22if(EXISTS ${LLD_LIBRARY})22if(EXISTS ${LLD_LIBRARY})
23 set(LLD_LIBRARIES ${LLD_LIBRARY})23 set(LLD_LIBRARIES ${LLD_LIBRARY})
...@@ -27,9 +27,9 @@ else()...@@ -27,9 +27,9 @@ else()
27 find_library(LLD_${_prettylibname_}_LIB NAMES ${_libname_}27 find_library(LLD_${_prettylibname_}_LIB NAMES ${_libname_}
28 PATHS28 PATHS
29 ${LLD_LIBDIRS}29 ${LLD_LIBDIRS}
30 /usr/lib/llvm-11/lib30 /usr/lib/llvm-12/lib
31 /usr/local/llvm110/lib31 /usr/local/llvm120/lib
32 /usr/local/llvm11/lib32 /usr/local/llvm12/lib
33 /mingw64/lib33 /mingw64/lib
34 /c/msys64/mingw64/lib34 /c/msys64/mingw64/lib
35 c:/msys64/mingw64/lib)35 c:/msys64/mingw64/lib)
cmake/Findllvm.cmake+92-88
...@@ -9,37 +9,37 @@...@@ -9,37 +9,37 @@
99
10find_path(LLVM_INCLUDE_DIRS NAMES llvm/IR/IRBuilder.h10find_path(LLVM_INCLUDE_DIRS NAMES llvm/IR/IRBuilder.h
11 PATHS11 PATHS
12 /usr/lib/llvm/11/include12 /usr/lib/llvm/12/include
13 /usr/lib/llvm-11/include13 /usr/lib/llvm-12/include
14 /usr/lib/llvm-11.0/include14 /usr/lib/llvm-12.0/include
15 /usr/local/llvm11/include15 /usr/local/llvm12/include
16 /usr/local/llvm110/include16 /usr/local/llvm120/include
17 /mingw64/include17 /mingw64/include
18)18)
1919
20if(ZIG_PREFER_CLANG_CPP_DYLIB)20if(ZIG_PREFER_CLANG_CPP_DYLIB)
21 find_library(LLVM_LIBRARIES21 find_library(LLVM_LIBRARIES
22 NAMES22 NAMES
23 LLVM-11.023 LLVM-12.0
24 LLVM-1124 LLVM-12
25 LLVM-11025 LLVM-120
26 LLVM26 LLVM
27 PATHS27 PATHS
28 ${LLVM_LIBDIRS}28 ${LLVM_LIBDIRS}
29 /usr/lib/llvm/11/lib29 /usr/lib/llvm/12/lib
30 /usr/lib/llvm/11/lib6430 /usr/lib/llvm/12/lib64
31 /usr/lib/llvm-11/lib31 /usr/lib/llvm-12/lib
32 /usr/local/llvm11/lib32 /usr/local/llvm12/lib
33 /usr/local/llvm110/lib33 /usr/local/llvm120/lib
34 )34 )
3535
36 find_program(LLVM_CONFIG_EXE36 find_program(LLVM_CONFIG_EXE
37 NAMES llvm-config-11 llvm-config-11.0 llvm-config110 llvm-config11 llvm-config37 NAMES llvm-config-12 llvm-config-12.0 llvm-config120 llvm-config12 llvm-config
38 PATHS38 PATHS
39 "/mingw64/bin"39 "/mingw64/bin"
40 "/c/msys64/mingw64/bin"40 "/c/msys64/mingw64/bin"
41 "c:/msys64/mingw64/bin"41 "c:/msys64/mingw64/bin"
42 "C:/Libraries/llvm-11.0.0/bin")42 "C:/Libraries/llvm-12.0.0/bin")
4343
44 if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")44 if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
45 message(FATAL_ERROR "unable to find llvm-config")45 message(FATAL_ERROR "unable to find llvm-config")
...@@ -54,23 +54,23 @@ if(ZIG_PREFER_CLANG_CPP_DYLIB)...@@ -54,23 +54,23 @@ if(ZIG_PREFER_CLANG_CPP_DYLIB)
54 OUTPUT_VARIABLE LLVM_CONFIG_VERSION54 OUTPUT_VARIABLE LLVM_CONFIG_VERSION
55 OUTPUT_STRIP_TRAILING_WHITESPACE)55 OUTPUT_STRIP_TRAILING_WHITESPACE)
5656
57 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 11)57 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 12)
58 message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")58 message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
59 endif()59 endif()
60 if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 12)60 if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 13)
61 message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")61 message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
62 endif()62 endif()
63 if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 12)63 if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 13)
64 message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")64 message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
65 endif()65 endif()
66elseif(ZIG_USE_LLVM_CONFIG)66elseif(ZIG_USE_LLVM_CONFIG)
67 find_program(LLVM_CONFIG_EXE67 find_program(LLVM_CONFIG_EXE
68 NAMES llvm-config-11 llvm-config-11.0 llvm-config110 llvm-config11 llvm-config68 NAMES llvm-config-12 llvm-config-12.0 llvm-config120 llvm-config12 llvm-config
69 PATHS69 PATHS
70 "/mingw64/bin"70 "/mingw64/bin"
71 "/c/msys64/mingw64/bin"71 "/c/msys64/mingw64/bin"
72 "c:/msys64/mingw64/bin"72 "c:/msys64/mingw64/bin"
73 "C:/Libraries/llvm-11.0.0/bin")73 "C:/Libraries/llvm-12.0.0/bin")
7474
75 if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")75 if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
76 message(FATAL_ERROR "unable to find llvm-config")76 message(FATAL_ERROR "unable to find llvm-config")
...@@ -85,14 +85,14 @@ elseif(ZIG_USE_LLVM_CONFIG)...@@ -85,14 +85,14 @@ elseif(ZIG_USE_LLVM_CONFIG)
85 OUTPUT_VARIABLE LLVM_CONFIG_VERSION85 OUTPUT_VARIABLE LLVM_CONFIG_VERSION
86 OUTPUT_STRIP_TRAILING_WHITESPACE)86 OUTPUT_STRIP_TRAILING_WHITESPACE)
8787
88 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 11)88 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 12)
89 message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")89 message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
90 endif()90 endif()
91 if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 12)91 if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 13)
92 message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")92 message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
93 endif()93 endif()
94 if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 12)94 if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 13)
95 message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")95 message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
96 endif()96 endif()
9797
98 execute_process(98 execute_process(
...@@ -166,7 +166,7 @@ elseif(ZIG_USE_LLVM_CONFIG)...@@ -166,7 +166,7 @@ elseif(ZIG_USE_LLVM_CONFIG)
166 set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS})166 set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS})
167167
168 if(NOT LLVM_LIBRARIES)168 if(NOT LLVM_LIBRARIES)
169 find_library(LLVM_LIBRARIES NAMES LLVM LLVM-11 LLVM-11.0)169 find_library(LLVM_LIBRARIES NAMES LLVM LLVM-12 LLVM-12.0)
170 endif()170 endif()
171171
172 link_directories("${CMAKE_PREFIX_PATH}/lib")172 link_directories("${CMAKE_PREFIX_PATH}/lib")
...@@ -180,11 +180,11 @@ else()...@@ -180,11 +180,11 @@ else()
180 find_library(LLVM_${_prettylibname_}_LIB NAMES ${_libname_}180 find_library(LLVM_${_prettylibname_}_LIB NAMES ${_libname_}
181 PATHS181 PATHS
182 ${LLVM_LIBDIRS}182 ${LLVM_LIBDIRS}
183 /usr/lib/llvm/11/lib183 /usr/lib/llvm/12/lib
184 /usr/lib/llvm-11/lib184 /usr/lib/llvm-12/lib
185 /usr/lib/llvm-11.0/lib185 /usr/lib/llvm-12.0/lib
186 /usr/local/llvm110/lib186 /usr/local/llvm120/lib
187 /usr/local/llvm11/lib187 /usr/local/llvm12/lib
188 /mingw64/lib188 /mingw64/lib
189 /c/msys64/mingw64/lib189 /c/msys64/mingw64/lib
190 c:\\msys64\\mingw64\\lib)190 c:\\msys64\\mingw64\\lib)
...@@ -194,78 +194,57 @@ else()...@@ -194,78 +194,57 @@ else()
194 # This list can be re-generated with `llvm-config --libfiles` and then194 # This list can be re-generated with `llvm-config --libfiles` and then
195 # reformatting using your favorite text editor. Note we do not execute195 # reformatting using your favorite text editor. Note we do not execute
196 # `llvm-config` here because we are cross compiling.196 # `llvm-config` here because we are cross compiling.
197 FIND_AND_ADD_LLVM_LIB(LLVMXRay)
198 FIND_AND_ADD_LLVM_LIB(LLVMWindowsManifest)197 FIND_AND_ADD_LLVM_LIB(LLVMWindowsManifest)
199 FIND_AND_ADD_LLVM_LIB(LLVMSymbolize)198 FIND_AND_ADD_LLVM_LIB(LLVMXRay)
200 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoPDB)
201 FIND_AND_ADD_LLVM_LIB(LLVMOrcJIT)
202 FIND_AND_ADD_LLVM_LIB(LLVMOrcError)
203 FIND_AND_ADD_LLVM_LIB(LLVMJITLink)
204 FIND_AND_ADD_LLVM_LIB(LLVMObjectYAML)
205 FIND_AND_ADD_LLVM_LIB(LLVMMCA)
206 FIND_AND_ADD_LLVM_LIB(LLVMLTO)
207 FIND_AND_ADD_LLVM_LIB(LLVMPasses)
208 FIND_AND_ADD_LLVM_LIB(LLVMCoroutines)
209 FIND_AND_ADD_LLVM_LIB(LLVMObjCARCOpts)
210 FIND_AND_ADD_LLVM_LIB(LLVMExtensions)
211 FIND_AND_ADD_LLVM_LIB(LLVMLineEditor)
212 FIND_AND_ADD_LLVM_LIB(LLVMLibDriver)199 FIND_AND_ADD_LLVM_LIB(LLVMLibDriver)
213 FIND_AND_ADD_LLVM_LIB(LLVMInterpreter)
214 FIND_AND_ADD_LLVM_LIB(LLVMFuzzMutate)
215 FIND_AND_ADD_LLVM_LIB(LLVMMCJIT)
216 FIND_AND_ADD_LLVM_LIB(LLVMExecutionEngine)
217 FIND_AND_ADD_LLVM_LIB(LLVMRuntimeDyld)
218 FIND_AND_ADD_LLVM_LIB(LLVMDWARFLinker)
219 FIND_AND_ADD_LLVM_LIB(LLVMDlltoolDriver)200 FIND_AND_ADD_LLVM_LIB(LLVMDlltoolDriver)
220 FIND_AND_ADD_LLVM_LIB(LLVMOption)
221 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoGSYM)
222 FIND_AND_ADD_LLVM_LIB(LLVMCoverage)201 FIND_AND_ADD_LLVM_LIB(LLVMCoverage)
202 FIND_AND_ADD_LLVM_LIB(LLVMLineEditor)
223 FIND_AND_ADD_LLVM_LIB(LLVMXCoreDisassembler)203 FIND_AND_ADD_LLVM_LIB(LLVMXCoreDisassembler)
224 FIND_AND_ADD_LLVM_LIB(LLVMXCoreCodeGen)204 FIND_AND_ADD_LLVM_LIB(LLVMXCoreCodeGen)
225 FIND_AND_ADD_LLVM_LIB(LLVMXCoreDesc)205 FIND_AND_ADD_LLVM_LIB(LLVMXCoreDesc)
226 FIND_AND_ADD_LLVM_LIB(LLVMXCoreInfo)206 FIND_AND_ADD_LLVM_LIB(LLVMXCoreInfo)
227 FIND_AND_ADD_LLVM_LIB(LLVMX86Disassembler)207 FIND_AND_ADD_LLVM_LIB(LLVMX86Disassembler)
228 FIND_AND_ADD_LLVM_LIB(LLVMX86CodeGen)
229 FIND_AND_ADD_LLVM_LIB(LLVMX86AsmParser)208 FIND_AND_ADD_LLVM_LIB(LLVMX86AsmParser)
209 FIND_AND_ADD_LLVM_LIB(LLVMX86CodeGen)
230 FIND_AND_ADD_LLVM_LIB(LLVMX86Desc)210 FIND_AND_ADD_LLVM_LIB(LLVMX86Desc)
231 FIND_AND_ADD_LLVM_LIB(LLVMX86Info)211 FIND_AND_ADD_LLVM_LIB(LLVMX86Info)
232 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyDisassembler)212 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyDisassembler)
213 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyAsmParser)
233 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyCodeGen)214 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyCodeGen)
234 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyDesc)215 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyDesc)
235 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyAsmParser)
236 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyInfo)216 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyInfo)
237 FIND_AND_ADD_LLVM_LIB(LLVMSystemZDisassembler)217 FIND_AND_ADD_LLVM_LIB(LLVMSystemZDisassembler)
238 FIND_AND_ADD_LLVM_LIB(LLVMSystemZCodeGen)
239 FIND_AND_ADD_LLVM_LIB(LLVMSystemZAsmParser)218 FIND_AND_ADD_LLVM_LIB(LLVMSystemZAsmParser)
219 FIND_AND_ADD_LLVM_LIB(LLVMSystemZCodeGen)
240 FIND_AND_ADD_LLVM_LIB(LLVMSystemZDesc)220 FIND_AND_ADD_LLVM_LIB(LLVMSystemZDesc)
241 FIND_AND_ADD_LLVM_LIB(LLVMSystemZInfo)221 FIND_AND_ADD_LLVM_LIB(LLVMSystemZInfo)
242 FIND_AND_ADD_LLVM_LIB(LLVMSparcDisassembler)222 FIND_AND_ADD_LLVM_LIB(LLVMSparcDisassembler)
243 FIND_AND_ADD_LLVM_LIB(LLVMSparcCodeGen)
244 FIND_AND_ADD_LLVM_LIB(LLVMSparcAsmParser)223 FIND_AND_ADD_LLVM_LIB(LLVMSparcAsmParser)
224 FIND_AND_ADD_LLVM_LIB(LLVMSparcCodeGen)
245 FIND_AND_ADD_LLVM_LIB(LLVMSparcDesc)225 FIND_AND_ADD_LLVM_LIB(LLVMSparcDesc)
246 FIND_AND_ADD_LLVM_LIB(LLVMSparcInfo)226 FIND_AND_ADD_LLVM_LIB(LLVMSparcInfo)
247 FIND_AND_ADD_LLVM_LIB(LLVMRISCVDisassembler)227 FIND_AND_ADD_LLVM_LIB(LLVMRISCVDisassembler)
248 FIND_AND_ADD_LLVM_LIB(LLVMRISCVCodeGen)
249 FIND_AND_ADD_LLVM_LIB(LLVMRISCVAsmParser)228 FIND_AND_ADD_LLVM_LIB(LLVMRISCVAsmParser)
229 FIND_AND_ADD_LLVM_LIB(LLVMRISCVCodeGen)
250 FIND_AND_ADD_LLVM_LIB(LLVMRISCVDesc)230 FIND_AND_ADD_LLVM_LIB(LLVMRISCVDesc)
251 FIND_AND_ADD_LLVM_LIB(LLVMRISCVUtils)
252 FIND_AND_ADD_LLVM_LIB(LLVMRISCVInfo)231 FIND_AND_ADD_LLVM_LIB(LLVMRISCVInfo)
253 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCDisassembler)232 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCDisassembler)
254 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCCodeGen)
255 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCAsmParser)233 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCAsmParser)
234 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCCodeGen)
256 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCDesc)235 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCDesc)
257 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCInfo)236 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCInfo)
258 FIND_AND_ADD_LLVM_LIB(LLVMNVPTXCodeGen)237 FIND_AND_ADD_LLVM_LIB(LLVMNVPTXCodeGen)
259 FIND_AND_ADD_LLVM_LIB(LLVMNVPTXDesc)238 FIND_AND_ADD_LLVM_LIB(LLVMNVPTXDesc)
260 FIND_AND_ADD_LLVM_LIB(LLVMNVPTXInfo)239 FIND_AND_ADD_LLVM_LIB(LLVMNVPTXInfo)
261 FIND_AND_ADD_LLVM_LIB(LLVMMSP430Disassembler)240 FIND_AND_ADD_LLVM_LIB(LLVMMSP430Disassembler)
262 FIND_AND_ADD_LLVM_LIB(LLVMMSP430CodeGen)
263 FIND_AND_ADD_LLVM_LIB(LLVMMSP430AsmParser)241 FIND_AND_ADD_LLVM_LIB(LLVMMSP430AsmParser)
242 FIND_AND_ADD_LLVM_LIB(LLVMMSP430CodeGen)
264 FIND_AND_ADD_LLVM_LIB(LLVMMSP430Desc)243 FIND_AND_ADD_LLVM_LIB(LLVMMSP430Desc)
265 FIND_AND_ADD_LLVM_LIB(LLVMMSP430Info)244 FIND_AND_ADD_LLVM_LIB(LLVMMSP430Info)
266 FIND_AND_ADD_LLVM_LIB(LLVMMipsDisassembler)245 FIND_AND_ADD_LLVM_LIB(LLVMMipsDisassembler)
267 FIND_AND_ADD_LLVM_LIB(LLVMMipsCodeGen)
268 FIND_AND_ADD_LLVM_LIB(LLVMMipsAsmParser)246 FIND_AND_ADD_LLVM_LIB(LLVMMipsAsmParser)
247 FIND_AND_ADD_LLVM_LIB(LLVMMipsCodeGen)
269 FIND_AND_ADD_LLVM_LIB(LLVMMipsDesc)248 FIND_AND_ADD_LLVM_LIB(LLVMMipsDesc)
270 FIND_AND_ADD_LLVM_LIB(LLVMMipsInfo)249 FIND_AND_ADD_LLVM_LIB(LLVMMipsInfo)
271 FIND_AND_ADD_LLVM_LIB(LLVMLanaiDisassembler)250 FIND_AND_ADD_LLVM_LIB(LLVMLanaiDisassembler)
...@@ -279,44 +258,73 @@ else()...@@ -279,44 +258,73 @@ else()
279 FIND_AND_ADD_LLVM_LIB(LLVMHexagonDesc)258 FIND_AND_ADD_LLVM_LIB(LLVMHexagonDesc)
280 FIND_AND_ADD_LLVM_LIB(LLVMHexagonInfo)259 FIND_AND_ADD_LLVM_LIB(LLVMHexagonInfo)
281 FIND_AND_ADD_LLVM_LIB(LLVMBPFDisassembler)260 FIND_AND_ADD_LLVM_LIB(LLVMBPFDisassembler)
282 FIND_AND_ADD_LLVM_LIB(LLVMBPFCodeGen)
283 FIND_AND_ADD_LLVM_LIB(LLVMBPFAsmParser)261 FIND_AND_ADD_LLVM_LIB(LLVMBPFAsmParser)
262 FIND_AND_ADD_LLVM_LIB(LLVMBPFCodeGen)
284 FIND_AND_ADD_LLVM_LIB(LLVMBPFDesc)263 FIND_AND_ADD_LLVM_LIB(LLVMBPFDesc)
285 FIND_AND_ADD_LLVM_LIB(LLVMBPFInfo)264 FIND_AND_ADD_LLVM_LIB(LLVMBPFInfo)
286 FIND_AND_ADD_LLVM_LIB(LLVMAVRDisassembler)265 FIND_AND_ADD_LLVM_LIB(LLVMAVRDisassembler)
287 FIND_AND_ADD_LLVM_LIB(LLVMAVRCodeGen)
288 FIND_AND_ADD_LLVM_LIB(LLVMAVRAsmParser)266 FIND_AND_ADD_LLVM_LIB(LLVMAVRAsmParser)
267 FIND_AND_ADD_LLVM_LIB(LLVMAVRCodeGen)
289 FIND_AND_ADD_LLVM_LIB(LLVMAVRDesc)268 FIND_AND_ADD_LLVM_LIB(LLVMAVRDesc)
290 FIND_AND_ADD_LLVM_LIB(LLVMAVRInfo)269 FIND_AND_ADD_LLVM_LIB(LLVMAVRInfo)
291 FIND_AND_ADD_LLVM_LIB(LLVMARMDisassembler)270 FIND_AND_ADD_LLVM_LIB(LLVMARMDisassembler)
292 FIND_AND_ADD_LLVM_LIB(LLVMARMCodeGen)
293 FIND_AND_ADD_LLVM_LIB(LLVMARMAsmParser)271 FIND_AND_ADD_LLVM_LIB(LLVMARMAsmParser)
272 FIND_AND_ADD_LLVM_LIB(LLVMARMCodeGen)
294 FIND_AND_ADD_LLVM_LIB(LLVMARMDesc)273 FIND_AND_ADD_LLVM_LIB(LLVMARMDesc)
295 FIND_AND_ADD_LLVM_LIB(LLVMARMUtils)274 FIND_AND_ADD_LLVM_LIB(LLVMARMUtils)
296 FIND_AND_ADD_LLVM_LIB(LLVMARMInfo)275 FIND_AND_ADD_LLVM_LIB(LLVMARMInfo)
297 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUDisassembler)276 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUDisassembler)
298 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUCodeGen)
299 FIND_AND_ADD_LLVM_LIB(LLVMMIRParser)
300 FIND_AND_ADD_LLVM_LIB(LLVMipo)
301 FIND_AND_ADD_LLVM_LIB(LLVMInstrumentation)
302 FIND_AND_ADD_LLVM_LIB(LLVMVectorize)
303 FIND_AND_ADD_LLVM_LIB(LLVMLinker)
304 FIND_AND_ADD_LLVM_LIB(LLVMIRReader)
305 FIND_AND_ADD_LLVM_LIB(LLVMAsmParser)
306 FIND_AND_ADD_LLVM_LIB(LLVMFrontendOpenMP)
307 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUAsmParser)277 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUAsmParser)
278 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUCodeGen)
308 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUDesc)279 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUDesc)
309 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUUtils)280 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUUtils)
310 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUInfo)281 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUInfo)
311 FIND_AND_ADD_LLVM_LIB(LLVMAArch64Disassembler)282 FIND_AND_ADD_LLVM_LIB(LLVMAArch64Disassembler)
312 FIND_AND_ADD_LLVM_LIB(LLVMMCDisassembler)283 FIND_AND_ADD_LLVM_LIB(LLVMAArch64AsmParser)
313 FIND_AND_ADD_LLVM_LIB(LLVMAArch64CodeGen)284 FIND_AND_ADD_LLVM_LIB(LLVMAArch64CodeGen)
285 FIND_AND_ADD_LLVM_LIB(LLVMAArch64Desc)
286 FIND_AND_ADD_LLVM_LIB(LLVMAArch64Utils)
287 FIND_AND_ADD_LLVM_LIB(LLVMAArch64Info)
288 FIND_AND_ADD_LLVM_LIB(LLVMOrcJIT)
289 FIND_AND_ADD_LLVM_LIB(LLVMMCJIT)
290 FIND_AND_ADD_LLVM_LIB(LLVMJITLink)
291 FIND_AND_ADD_LLVM_LIB(LLVMOrcTargetProcess)
292 FIND_AND_ADD_LLVM_LIB(LLVMOrcShared)
293 FIND_AND_ADD_LLVM_LIB(LLVMInterpreter)
294 FIND_AND_ADD_LLVM_LIB(LLVMExecutionEngine)
295 FIND_AND_ADD_LLVM_LIB(LLVMRuntimeDyld)
296 FIND_AND_ADD_LLVM_LIB(LLVMSymbolize)
297 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoPDB)
298 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoGSYM)
299 FIND_AND_ADD_LLVM_LIB(LLVMOption)
300 FIND_AND_ADD_LLVM_LIB(LLVMObjectYAML)
301 FIND_AND_ADD_LLVM_LIB(LLVMMCA)
302 FIND_AND_ADD_LLVM_LIB(LLVMMCDisassembler)
303 FIND_AND_ADD_LLVM_LIB(LLVMLTO)
304 FIND_AND_ADD_LLVM_LIB(LLVMPasses)
314 FIND_AND_ADD_LLVM_LIB(LLVMCFGuard)305 FIND_AND_ADD_LLVM_LIB(LLVMCFGuard)
306 FIND_AND_ADD_LLVM_LIB(LLVMCoroutines)
307 FIND_AND_ADD_LLVM_LIB(LLVMObjCARCOpts)
308 FIND_AND_ADD_LLVM_LIB(LLVMHelloNew)
309 FIND_AND_ADD_LLVM_LIB(LLVMipo)
310 FIND_AND_ADD_LLVM_LIB(LLVMVectorize)
311 FIND_AND_ADD_LLVM_LIB(LLVMLinker)
312 FIND_AND_ADD_LLVM_LIB(LLVMInstrumentation)
313 FIND_AND_ADD_LLVM_LIB(LLVMFrontendOpenMP)
314 FIND_AND_ADD_LLVM_LIB(LLVMFrontendOpenACC)
315 FIND_AND_ADD_LLVM_LIB(LLVMExtensions)
316 FIND_AND_ADD_LLVM_LIB(LLVMDWARFLinker)
315 FIND_AND_ADD_LLVM_LIB(LLVMGlobalISel)317 FIND_AND_ADD_LLVM_LIB(LLVMGlobalISel)
316 FIND_AND_ADD_LLVM_LIB(LLVMSelectionDAG)318 FIND_AND_ADD_LLVM_LIB(LLVMMIRParser)
317 FIND_AND_ADD_LLVM_LIB(LLVMAsmPrinter)319 FIND_AND_ADD_LLVM_LIB(LLVMAsmPrinter)
318 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoDWARF)320 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoDWARF)
321 FIND_AND_ADD_LLVM_LIB(LLVMSelectionDAG)
319 FIND_AND_ADD_LLVM_LIB(LLVMCodeGen)322 FIND_AND_ADD_LLVM_LIB(LLVMCodeGen)
323 FIND_AND_ADD_LLVM_LIB(LLVMIRReader)
324 FIND_AND_ADD_LLVM_LIB(LLVMAsmParser)
325 FIND_AND_ADD_LLVM_LIB(LLVMInterfaceStub)
326 FIND_AND_ADD_LLVM_LIB(LLVMFileCheck)
327 FIND_AND_ADD_LLVM_LIB(LLVMFuzzMutate)
320 FIND_AND_ADD_LLVM_LIB(LLVMTarget)328 FIND_AND_ADD_LLVM_LIB(LLVMTarget)
321 FIND_AND_ADD_LLVM_LIB(LLVMScalarOpts)329 FIND_AND_ADD_LLVM_LIB(LLVMScalarOpts)
322 FIND_AND_ADD_LLVM_LIB(LLVMInstCombine)330 FIND_AND_ADD_LLVM_LIB(LLVMInstCombine)
...@@ -327,19 +335,15 @@ else()...@@ -327,19 +335,15 @@ else()
327 FIND_AND_ADD_LLVM_LIB(LLVMProfileData)335 FIND_AND_ADD_LLVM_LIB(LLVMProfileData)
328 FIND_AND_ADD_LLVM_LIB(LLVMObject)336 FIND_AND_ADD_LLVM_LIB(LLVMObject)
329 FIND_AND_ADD_LLVM_LIB(LLVMTextAPI)337 FIND_AND_ADD_LLVM_LIB(LLVMTextAPI)
330 FIND_AND_ADD_LLVM_LIB(LLVMBitReader)
331 FIND_AND_ADD_LLVM_LIB(LLVMCore)
332 FIND_AND_ADD_LLVM_LIB(LLVMRemarks)
333 FIND_AND_ADD_LLVM_LIB(LLVMBitstreamReader)
334 FIND_AND_ADD_LLVM_LIB(LLVMAArch64AsmParser)
335 FIND_AND_ADD_LLVM_LIB(LLVMMCParser)338 FIND_AND_ADD_LLVM_LIB(LLVMMCParser)
336 FIND_AND_ADD_LLVM_LIB(LLVMAArch64Desc)
337 FIND_AND_ADD_LLVM_LIB(LLVMMC)339 FIND_AND_ADD_LLVM_LIB(LLVMMC)
338 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoCodeView)340 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoCodeView)
339 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoMSF)341 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoMSF)
342 FIND_AND_ADD_LLVM_LIB(LLVMBitReader)
343 FIND_AND_ADD_LLVM_LIB(LLVMCore)
344 FIND_AND_ADD_LLVM_LIB(LLVMRemarks)
345 FIND_AND_ADD_LLVM_LIB(LLVMBitstreamReader)
340 FIND_AND_ADD_LLVM_LIB(LLVMBinaryFormat)346 FIND_AND_ADD_LLVM_LIB(LLVMBinaryFormat)
341 FIND_AND_ADD_LLVM_LIB(LLVMAArch64Utils)
342 FIND_AND_ADD_LLVM_LIB(LLVMAArch64Info)
343 FIND_AND_ADD_LLVM_LIB(LLVMSupport)347 FIND_AND_ADD_LLVM_LIB(LLVMSupport)
344 FIND_AND_ADD_LLVM_LIB(LLVMDemangle)348 FIND_AND_ADD_LLVM_LIB(LLVMDemangle)
345endif()349endif()
lib/include/__clang_cuda_builtin_vars.h+9
...@@ -55,7 +55,9 @@ struct __cuda_builtin_threadIdx_t {...@@ -55,7 +55,9 @@ struct __cuda_builtin_threadIdx_t {
55 __CUDA_DEVICE_BUILTIN(z,__nvvm_read_ptx_sreg_tid_z());55 __CUDA_DEVICE_BUILTIN(z,__nvvm_read_ptx_sreg_tid_z());
56 // threadIdx should be convertible to uint3 (in fact in nvcc, it *is* a56 // threadIdx should be convertible to uint3 (in fact in nvcc, it *is* a
57 // uint3). This function is defined after we pull in vector_types.h.57 // uint3). This function is defined after we pull in vector_types.h.
58 __attribute__((device)) operator dim3() const;
58 __attribute__((device)) operator uint3() const;59 __attribute__((device)) operator uint3() const;
60
59private:61private:
60 __CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_threadIdx_t);62 __CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_threadIdx_t);
61};63};
...@@ -66,7 +68,9 @@ struct __cuda_builtin_blockIdx_t {...@@ -66,7 +68,9 @@ struct __cuda_builtin_blockIdx_t {
66 __CUDA_DEVICE_BUILTIN(z,__nvvm_read_ptx_sreg_ctaid_z());68 __CUDA_DEVICE_BUILTIN(z,__nvvm_read_ptx_sreg_ctaid_z());
67 // blockIdx should be convertible to uint3 (in fact in nvcc, it *is* a69 // blockIdx should be convertible to uint3 (in fact in nvcc, it *is* a
68 // uint3). This function is defined after we pull in vector_types.h.70 // uint3). This function is defined after we pull in vector_types.h.
71 __attribute__((device)) operator dim3() const;
69 __attribute__((device)) operator uint3() const;72 __attribute__((device)) operator uint3() const;
73
70private:74private:
71 __CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_blockIdx_t);75 __CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_blockIdx_t);
72};76};
...@@ -78,6 +82,8 @@ struct __cuda_builtin_blockDim_t {...@@ -78,6 +82,8 @@ struct __cuda_builtin_blockDim_t {
78 // blockDim should be convertible to dim3 (in fact in nvcc, it *is* a82 // blockDim should be convertible to dim3 (in fact in nvcc, it *is* a
79 // dim3). This function is defined after we pull in vector_types.h.83 // dim3). This function is defined after we pull in vector_types.h.
80 __attribute__((device)) operator dim3() const;84 __attribute__((device)) operator dim3() const;
85 __attribute__((device)) operator uint3() const;
86
81private:87private:
82 __CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_blockDim_t);88 __CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_blockDim_t);
83};89};
...@@ -89,6 +95,8 @@ struct __cuda_builtin_gridDim_t {...@@ -89,6 +95,8 @@ struct __cuda_builtin_gridDim_t {
89 // gridDim should be convertible to dim3 (in fact in nvcc, it *is* a95 // gridDim should be convertible to dim3 (in fact in nvcc, it *is* a
90 // dim3). This function is defined after we pull in vector_types.h.96 // dim3). This function is defined after we pull in vector_types.h.
91 __attribute__((device)) operator dim3() const;97 __attribute__((device)) operator dim3() const;
98 __attribute__((device)) operator uint3() const;
99
92private:100private:
93 __CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_gridDim_t);101 __CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_gridDim_t);
94};102};
...@@ -108,5 +116,6 @@ __attribute__((device)) const int warpSize = 32;...@@ -108,5 +116,6 @@ __attribute__((device)) const int warpSize = 32;
108#undef __CUDA_DEVICE_BUILTIN116#undef __CUDA_DEVICE_BUILTIN
109#undef __CUDA_BUILTIN_VAR117#undef __CUDA_BUILTIN_VAR
110#undef __CUDA_DISALLOW_BUILTINVAR_ACCESS118#undef __CUDA_DISALLOW_BUILTINVAR_ACCESS
119#undef __DELETE
111120
112#endif /* __CUDA_BUILTIN_VARS_H */121#endif /* __CUDA_BUILTIN_VARS_H */
lib/include/__clang_cuda_cmath.h+46-4
...@@ -66,10 +66,38 @@ __DEVICE__ float frexp(float __arg, int *__exp) {...@@ -66,10 +66,38 @@ __DEVICE__ float frexp(float __arg, int *__exp) {
66}66}
6767
68// For inscrutable reasons, the CUDA headers define these functions for us on68// For inscrutable reasons, the CUDA headers define these functions for us on
69// Windows. For OpenMP we omit these as some old system headers have69// Windows.
70// non-conforming `isinf(float)` and `isnan(float)` implementations that return70#if !defined(_MSC_VER) || defined(__OPENMP_NVPTX__)
71// an `int`. The system versions of these functions should be fine anyway.71
72#if !defined(_MSC_VER) && !defined(__OPENMP_NVPTX__)72// For OpenMP we work around some old system headers that have non-conforming
73// `isinf(float)` and `isnan(float)` implementations that return an `int`. We do
74// this by providing two versions of these functions, differing only in the
75// return type. To avoid conflicting definitions we disable implicit base
76// function generation. That means we will end up with two specializations, one
77// per type, but only one has a base function defined by the system header.
78#if defined(__OPENMP_NVPTX__)
79#pragma omp begin declare variant match( \
80 implementation = {extension(disable_implicit_base)})
81
82// FIXME: We lack an extension to customize the mangling of the variants, e.g.,
83// add a suffix. This means we would clash with the names of the variants
84// (note that we do not create implicit base functions here). To avoid
85// this clash we add a new trait to some of them that is always true
86// (this is LLVM after all ;)). It will only influence the mangled name
87// of the variants inside the inner region and avoid the clash.
88#pragma omp begin declare variant match(implementation = {vendor(llvm)})
89
90__DEVICE__ int isinf(float __x) { return ::__isinff(__x); }
91__DEVICE__ int isinf(double __x) { return ::__isinf(__x); }
92__DEVICE__ int isfinite(float __x) { return ::__finitef(__x); }
93__DEVICE__ int isfinite(double __x) { return ::__isfinited(__x); }
94__DEVICE__ int isnan(float __x) { return ::__isnanf(__x); }
95__DEVICE__ int isnan(double __x) { return ::__isnan(__x); }
96
97#pragma omp end declare variant
98
99#endif
100
73__DEVICE__ bool isinf(float __x) { return ::__isinff(__x); }101__DEVICE__ bool isinf(float __x) { return ::__isinff(__x); }
74__DEVICE__ bool isinf(double __x) { return ::__isinf(__x); }102__DEVICE__ bool isinf(double __x) { return ::__isinf(__x); }
75__DEVICE__ bool isfinite(float __x) { return ::__finitef(__x); }103__DEVICE__ bool isfinite(float __x) { return ::__finitef(__x); }
...@@ -79,6 +107,11 @@ __DEVICE__ bool isfinite(float __x) { return ::__finitef(__x); }...@@ -79,6 +107,11 @@ __DEVICE__ bool isfinite(float __x) { return ::__finitef(__x); }
79__DEVICE__ bool isfinite(double __x) { return ::__isfinited(__x); }107__DEVICE__ bool isfinite(double __x) { return ::__isfinited(__x); }
80__DEVICE__ bool isnan(float __x) { return ::__isnanf(__x); }108__DEVICE__ bool isnan(float __x) { return ::__isnanf(__x); }
81__DEVICE__ bool isnan(double __x) { return ::__isnan(__x); }109__DEVICE__ bool isnan(double __x) { return ::__isnan(__x); }
110
111#if defined(__OPENMP_NVPTX__)
112#pragma omp end declare variant
113#endif
114
82#endif115#endif
83116
84__DEVICE__ bool isgreater(float __x, float __y) {117__DEVICE__ bool isgreater(float __x, float __y) {
...@@ -142,6 +175,15 @@ __DEVICE__ float sqrt(float __x) { return ::sqrtf(__x); }...@@ -142,6 +175,15 @@ __DEVICE__ float sqrt(float __x) { return ::sqrtf(__x); }
142__DEVICE__ float tan(float __x) { return ::tanf(__x); }175__DEVICE__ float tan(float __x) { return ::tanf(__x); }
143__DEVICE__ float tanh(float __x) { return ::tanhf(__x); }176__DEVICE__ float tanh(float __x) { return ::tanhf(__x); }
144177
178// There was a redefinition error for this this overload in CUDA mode.
179// We restrict it to OpenMP mode for now, that is where it is actually needed
180// anyway.
181#ifdef __OPENMP_NVPTX__
182__DEVICE__ float remquo(float __n, float __d, int *__q) {
183 return ::remquof(__n, __d, __q);
184}
185#endif
186
145// Notably missing above is nexttoward. We omit it because187// Notably missing above is nexttoward. We omit it because
146// libdevice doesn't provide an implementation, and we don't want to be in the188// libdevice doesn't provide an implementation, and we don't want to be in the
147// business of implementing tricky libm functions in this header.189// business of implementing tricky libm functions in this header.
lib/include/__clang_cuda_complex_builtins.h+28-2
...@@ -41,6 +41,27 @@...@@ -41,6 +41,27 @@
41#define _ABSf std::abs41#define _ABSf std::abs
42#define _LOGBd std::logb42#define _LOGBd std::logb
43#define _LOGBf std::logb43#define _LOGBf std::logb
44// Rather than pulling in std::max from algorithm everytime, use available ::max.
45#define _fmaxd max
46#define _fmaxf max
47#else
48#ifdef __AMDGCN__
49#define _ISNANd __ocml_isnan_f64
50#define _ISNANf __ocml_isnan_f32
51#define _ISINFd __ocml_isinf_f64
52#define _ISINFf __ocml_isinf_f32
53#define _ISFINITEd __ocml_isfinite_f64
54#define _ISFINITEf __ocml_isfinite_f32
55#define _COPYSIGNd __ocml_copysign_f64
56#define _COPYSIGNf __ocml_copysign_f32
57#define _SCALBNd __ocml_scalbn_f64
58#define _SCALBNf __ocml_scalbn_f32
59#define _ABSd __ocml_fabs_f64
60#define _ABSf __ocml_fabs_f32
61#define _LOGBd __ocml_logb_f64
62#define _LOGBf __ocml_logb_f32
63#define _fmaxd __ocml_fmax_f64
64#define _fmaxf __ocml_fmax_f32
44#else65#else
45#define _ISNANd __nv_isnand66#define _ISNANd __nv_isnand
46#define _ISNANf __nv_isnanf67#define _ISNANf __nv_isnanf
...@@ -56,6 +77,9 @@...@@ -56,6 +77,9 @@
56#define _ABSf __nv_fabsf77#define _ABSf __nv_fabsf
57#define _LOGBd __nv_logb78#define _LOGBd __nv_logb
58#define _LOGBf __nv_logbf79#define _LOGBf __nv_logbf
80#define _fmaxd __nv_fmax
81#define _fmaxf __nv_fmaxf
82#endif
59#endif83#endif
6084
61#if defined(__cplusplus)85#if defined(__cplusplus)
...@@ -167,7 +191,7 @@ __DEVICE__ double _Complex __divdc3(double __a, double __b, double __c,...@@ -167,7 +191,7 @@ __DEVICE__ double _Complex __divdc3(double __a, double __b, double __c,
167 // Can't use std::max, because that's defined in <algorithm>, and we don't191 // Can't use std::max, because that's defined in <algorithm>, and we don't
168 // want to pull that in for every compile. The CUDA headers define192 // want to pull that in for every compile. The CUDA headers define
169 // ::max(float, float) and ::max(double, double), which is sufficient for us.193 // ::max(float, float) and ::max(double, double), which is sufficient for us.
170 double __logbw = _LOGBd(max(_ABSd(__c), _ABSd(__d)));194 double __logbw = _LOGBd(_fmaxd(_ABSd(__c), _ABSd(__d)));
171 if (_ISFINITEd(__logbw)) {195 if (_ISFINITEd(__logbw)) {
172 __ilogbw = (int)__logbw;196 __ilogbw = (int)__logbw;
173 __c = _SCALBNd(__c, -__ilogbw);197 __c = _SCALBNd(__c, -__ilogbw);
...@@ -200,7 +224,7 @@ __DEVICE__ double _Complex __divdc3(double __a, double __b, double __c,...@@ -200,7 +224,7 @@ __DEVICE__ double _Complex __divdc3(double __a, double __b, double __c,
200224
201__DEVICE__ float _Complex __divsc3(float __a, float __b, float __c, float __d) {225__DEVICE__ float _Complex __divsc3(float __a, float __b, float __c, float __d) {
202 int __ilogbw = 0;226 int __ilogbw = 0;
203 float __logbw = _LOGBf(max(_ABSf(__c), _ABSf(__d)));227 float __logbw = _LOGBf(_fmaxf(_ABSf(__c), _ABSf(__d)));
204 if (_ISFINITEf(__logbw)) {228 if (_ISFINITEf(__logbw)) {
205 __ilogbw = (int)__logbw;229 __ilogbw = (int)__logbw;
206 __c = _SCALBNf(__c, -__ilogbw);230 __c = _SCALBNf(__c, -__ilogbw);
...@@ -249,6 +273,8 @@ __DEVICE__ float _Complex __divsc3(float __a, float __b, float __c, float __d) {...@@ -249,6 +273,8 @@ __DEVICE__ float _Complex __divsc3(float __a, float __b, float __c, float __d) {
249#undef _ABSf273#undef _ABSf
250#undef _LOGBd274#undef _LOGBd
251#undef _LOGBf275#undef _LOGBf
276#undef _fmaxd
277#undef _fmaxf
252278
253#ifdef __OPENMP_NVPTX__279#ifdef __OPENMP_NVPTX__
254#pragma omp end declare target280#pragma omp end declare target
lib/include/__clang_cuda_math.h+5-4
...@@ -195,8 +195,8 @@ __DEVICE__ int max(int __a, int __b) { return __nv_max(__a, __b); }...@@ -195,8 +195,8 @@ __DEVICE__ int max(int __a, int __b) { return __nv_max(__a, __b); }
195__DEVICE__ int min(int __a, int __b) { return __nv_min(__a, __b); }195__DEVICE__ int min(int __a, int __b) { return __nv_min(__a, __b); }
196__DEVICE__ double modf(double __a, double *__b) { return __nv_modf(__a, __b); }196__DEVICE__ double modf(double __a, double *__b) { return __nv_modf(__a, __b); }
197__DEVICE__ float modff(float __a, float *__b) { return __nv_modff(__a, __b); }197__DEVICE__ float modff(float __a, float *__b) { return __nv_modff(__a, __b); }
198__DEVICE__ double nearbyint(double __a) { return __nv_nearbyint(__a); }198__DEVICE__ double nearbyint(double __a) { return __builtin_nearbyint(__a); }
199__DEVICE__ float nearbyintf(float __a) { return __nv_nearbyintf(__a); }199__DEVICE__ float nearbyintf(float __a) { return __builtin_nearbyintf(__a); }
200__DEVICE__ double nextafter(double __a, double __b) {200__DEVICE__ double nextafter(double __a, double __b) {
201 return __nv_nextafter(__a, __b);201 return __nv_nextafter(__a, __b);
202}202}
...@@ -249,8 +249,9 @@ __DEVICE__ double rhypot(double __a, double __b) {...@@ -249,8 +249,9 @@ __DEVICE__ double rhypot(double __a, double __b) {
249__DEVICE__ float rhypotf(float __a, float __b) {249__DEVICE__ float rhypotf(float __a, float __b) {
250 return __nv_rhypotf(__a, __b);250 return __nv_rhypotf(__a, __b);
251}251}
252__DEVICE__ double rint(double __a) { return __nv_rint(__a); }252// __nv_rint* in libdevice is buggy and produces incorrect results.
253__DEVICE__ float rintf(float __a) { return __nv_rintf(__a); }253__DEVICE__ double rint(double __a) { return __builtin_rint(__a); }
254__DEVICE__ float rintf(float __a) { return __builtin_rintf(__a); }
254__DEVICE__ double rnorm(int __a, const double *__b) {255__DEVICE__ double rnorm(int __a, const double *__b) {
255 return __nv_rnorm(__a, __b);256 return __nv_rnorm(__a, __b);
256}257}
lib/include/__clang_cuda_math_forward_declares.h+3
...@@ -160,6 +160,9 @@ __DEVICE__ double scalbln(double, long);...@@ -160,6 +160,9 @@ __DEVICE__ double scalbln(double, long);
160__DEVICE__ float scalbln(float, long);160__DEVICE__ float scalbln(float, long);
161__DEVICE__ double scalbn(double, int);161__DEVICE__ double scalbn(double, int);
162__DEVICE__ float scalbn(float, int);162__DEVICE__ float scalbn(float, int);
163#ifdef _MSC_VER
164__DEVICE__ bool signbit(long double);
165#endif
163__DEVICE__ bool signbit(double);166__DEVICE__ bool signbit(double);
164__DEVICE__ bool signbit(float);167__DEVICE__ bool signbit(float);
165__DEVICE__ double sin(double);168__DEVICE__ double sin(double);
lib/include/__clang_cuda_runtime_wrapper.h+18-10
...@@ -377,30 +377,38 @@ __device__ static inline void *malloc(size_t __size) {...@@ -377,30 +377,38 @@ __device__ static inline void *malloc(size_t __size) {
377// Out-of-line implementations from __clang_cuda_builtin_vars.h. These need to377// Out-of-line implementations from __clang_cuda_builtin_vars.h. These need to
378// come after we've pulled in the definition of uint3 and dim3.378// come after we've pulled in the definition of uint3 and dim3.
379379
380__device__ inline __cuda_builtin_threadIdx_t::operator dim3() const {
381 return dim3(x, y, z);
382}
383
380__device__ inline __cuda_builtin_threadIdx_t::operator uint3() const {384__device__ inline __cuda_builtin_threadIdx_t::operator uint3() const {
381 uint3 ret;385 return {x, y, z};
382 ret.x = x;386}
383 ret.y = y;387
384 ret.z = z;388__device__ inline __cuda_builtin_blockIdx_t::operator dim3() const {
385 return ret;389 return dim3(x, y, z);
386}390}
387391
388__device__ inline __cuda_builtin_blockIdx_t::operator uint3() const {392__device__ inline __cuda_builtin_blockIdx_t::operator uint3() const {
389 uint3 ret;393 return {x, y, z};
390 ret.x = x;
391 ret.y = y;
392 ret.z = z;
393 return ret;
394}394}
395395
396__device__ inline __cuda_builtin_blockDim_t::operator dim3() const {396__device__ inline __cuda_builtin_blockDim_t::operator dim3() const {
397 return dim3(x, y, z);397 return dim3(x, y, z);
398}398}
399399
400__device__ inline __cuda_builtin_blockDim_t::operator uint3() const {
401 return {x, y, z};
402}
403
400__device__ inline __cuda_builtin_gridDim_t::operator dim3() const {404__device__ inline __cuda_builtin_gridDim_t::operator dim3() const {
401 return dim3(x, y, z);405 return dim3(x, y, z);
402}406}
403407
408__device__ inline __cuda_builtin_gridDim_t::operator uint3() const {
409 return {x, y, z};
410}
411
404#include <__clang_cuda_cmath.h>412#include <__clang_cuda_cmath.h>
405#include <__clang_cuda_intrinsics.h>413#include <__clang_cuda_intrinsics.h>
406#include <__clang_cuda_complex_builtins.h>414#include <__clang_cuda_complex_builtins.h>
lib/include/__clang_hip_cmath.h created+664
...@@ -0,0 +1,664 @@
1/*===---- __clang_hip_cmath.h - HIP cmath decls -----------------------------===
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_HIP_CMATH_H__
11#define __CLANG_HIP_CMATH_H__
12
13#if !defined(__HIP__)
14#error "This file is for HIP and OpenMP AMDGCN device compilation only."
15#endif
16
17#if defined(__cplusplus)
18#include <limits>
19#include <type_traits>
20#include <utility>
21#endif
22#include <limits.h>
23#include <stdint.h>
24
25#pragma push_macro("__DEVICE__")
26#define __DEVICE__ static __device__ inline __attribute__((always_inline))
27
28// Start with functions that cannot be defined by DEF macros below.
29#if defined(__cplusplus)
30__DEVICE__ double abs(double __x) { return ::fabs(__x); }
31__DEVICE__ float abs(float __x) { return ::fabsf(__x); }
32__DEVICE__ long long abs(long long __n) { return ::llabs(__n); }
33__DEVICE__ long abs(long __n) { return ::labs(__n); }
34__DEVICE__ float fma(float __x, float __y, float __z) {
35 return ::fmaf(__x, __y, __z);
36}
37__DEVICE__ int fpclassify(float __x) {
38 return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL,
39 FP_ZERO, __x);
40}
41__DEVICE__ int fpclassify(double __x) {
42 return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL,
43 FP_ZERO, __x);
44}
45__DEVICE__ float frexp(float __arg, int *__exp) {
46 return ::frexpf(__arg, __exp);
47}
48__DEVICE__ bool isfinite(float __x) { return ::__finitef(__x); }
49__DEVICE__ bool isfinite(double __x) { return ::__finite(__x); }
50__DEVICE__ bool isgreater(float __x, float __y) {
51 return __builtin_isgreater(__x, __y);
52}
53__DEVICE__ bool isgreater(double __x, double __y) {
54 return __builtin_isgreater(__x, __y);
55}
56__DEVICE__ bool isgreaterequal(float __x, float __y) {
57 return __builtin_isgreaterequal(__x, __y);
58}
59__DEVICE__ bool isgreaterequal(double __x, double __y) {
60 return __builtin_isgreaterequal(__x, __y);
61}
62__DEVICE__ bool isinf(float __x) { return ::__isinff(__x); }
63__DEVICE__ bool isinf(double __x) { return ::__isinf(__x); }
64__DEVICE__ bool isless(float __x, float __y) {
65 return __builtin_isless(__x, __y);
66}
67__DEVICE__ bool isless(double __x, double __y) {
68 return __builtin_isless(__x, __y);
69}
70__DEVICE__ bool islessequal(float __x, float __y) {
71 return __builtin_islessequal(__x, __y);
72}
73__DEVICE__ bool islessequal(double __x, double __y) {
74 return __builtin_islessequal(__x, __y);
75}
76__DEVICE__ bool islessgreater(float __x, float __y) {
77 return __builtin_islessgreater(__x, __y);
78}
79__DEVICE__ bool islessgreater(double __x, double __y) {
80 return __builtin_islessgreater(__x, __y);
81}
82__DEVICE__ bool isnan(float __x) { return ::__isnanf(__x); }
83__DEVICE__ bool isnan(double __x) { return ::__isnan(__x); }
84__DEVICE__ bool isnormal(float __x) { return __builtin_isnormal(__x); }
85__DEVICE__ bool isnormal(double __x) { return __builtin_isnormal(__x); }
86__DEVICE__ bool isunordered(float __x, float __y) {
87 return __builtin_isunordered(__x, __y);
88}
89__DEVICE__ bool isunordered(double __x, double __y) {
90 return __builtin_isunordered(__x, __y);
91}
92__DEVICE__ float modf(float __x, float *__iptr) { return ::modff(__x, __iptr); }
93__DEVICE__ float pow(float __base, int __iexp) {
94 return ::powif(__base, __iexp);
95}
96__DEVICE__ double pow(double __base, int __iexp) {
97 return ::powi(__base, __iexp);
98}
99__DEVICE__ float remquo(float __x, float __y, int *__quo) {
100 return ::remquof(__x, __y, __quo);
101}
102__DEVICE__ float scalbln(float __x, long int __n) {
103 return ::scalblnf(__x, __n);
104}
105__DEVICE__ bool signbit(float __x) { return ::__signbitf(__x); }
106__DEVICE__ bool signbit(double __x) { return ::__signbit(__x); }
107
108// Notably missing above is nexttoward. We omit it because
109// ocml doesn't provide an implementation, and we don't want to be in the
110// business of implementing tricky libm functions in this header.
111
112// Other functions.
113__DEVICE__ _Float16 fma(_Float16 __x, _Float16 __y, _Float16 __z) {
114 return __ocml_fma_f16(__x, __y, __z);
115}
116__DEVICE__ _Float16 pow(_Float16 __base, int __iexp) {
117 return __ocml_pown_f16(__base, __iexp);
118}
119
120// BEGIN DEF_FUN and HIP_OVERLOAD
121
122// BEGIN DEF_FUN
123
124#pragma push_macro("__DEF_FUN1")
125#pragma push_macro("__DEF_FUN2")
126#pragma push_macro("__DEF_FUN2_FI")
127
128// Define cmath functions with float argument and returns __retty.
129#define __DEF_FUN1(__retty, __func) \
130 __DEVICE__ \
131 __retty __func(float __x) { return __func##f(__x); }
132
133// Define cmath functions with two float arguments and returns __retty.
134#define __DEF_FUN2(__retty, __func) \
135 __DEVICE__ \
136 __retty __func(float __x, float __y) { return __func##f(__x, __y); }
137
138// Define cmath functions with a float and an int argument and returns __retty.
139#define __DEF_FUN2_FI(__retty, __func) \
140 __DEVICE__ \
141 __retty __func(float __x, int __y) { return __func##f(__x, __y); }
142
143__DEF_FUN1(float, acos)
144__DEF_FUN1(float, acosh)
145__DEF_FUN1(float, asin)
146__DEF_FUN1(float, asinh)
147__DEF_FUN1(float, atan)
148__DEF_FUN2(float, atan2)
149__DEF_FUN1(float, atanh)
150__DEF_FUN1(float, cbrt)
151__DEF_FUN1(float, ceil)
152__DEF_FUN2(float, copysign)
153__DEF_FUN1(float, cos)
154__DEF_FUN1(float, cosh)
155__DEF_FUN1(float, erf)
156__DEF_FUN1(float, erfc)
157__DEF_FUN1(float, exp)
158__DEF_FUN1(float, exp2)
159__DEF_FUN1(float, expm1)
160__DEF_FUN1(float, fabs)
161__DEF_FUN2(float, fdim)
162__DEF_FUN1(float, floor)
163__DEF_FUN2(float, fmax)
164__DEF_FUN2(float, fmin)
165__DEF_FUN2(float, fmod)
166__DEF_FUN2(float, hypot)
167__DEF_FUN1(int, ilogb)
168__DEF_FUN2_FI(float, ldexp)
169__DEF_FUN1(float, lgamma)
170__DEF_FUN1(float, log)
171__DEF_FUN1(float, log10)
172__DEF_FUN1(float, log1p)
173__DEF_FUN1(float, log2)
174__DEF_FUN1(float, logb)
175__DEF_FUN1(long long, llrint)
176__DEF_FUN1(long long, llround)
177__DEF_FUN1(long, lrint)
178__DEF_FUN1(long, lround)
179__DEF_FUN1(float, nearbyint)
180__DEF_FUN2(float, nextafter)
181__DEF_FUN2(float, pow)
182__DEF_FUN2(float, remainder)
183__DEF_FUN1(float, rint)
184__DEF_FUN1(float, round)
185__DEF_FUN2_FI(float, scalbn)
186__DEF_FUN1(float, sin)
187__DEF_FUN1(float, sinh)
188__DEF_FUN1(float, sqrt)
189__DEF_FUN1(float, tan)
190__DEF_FUN1(float, tanh)
191__DEF_FUN1(float, tgamma)
192__DEF_FUN1(float, trunc)
193
194#pragma pop_macro("__DEF_FUN1")
195#pragma pop_macro("__DEF_FUN2")
196#pragma pop_macro("__DEF_FUN2_FI")
197
198// END DEF_FUN
199
200// BEGIN HIP_OVERLOAD
201
202#pragma push_macro("__HIP_OVERLOAD1")
203#pragma push_macro("__HIP_OVERLOAD2")
204
205// __hip_enable_if::type is a type function which returns __T if __B is true.
206template <bool __B, class __T = void> struct __hip_enable_if {};
207
208template <class __T> struct __hip_enable_if<true, __T> { typedef __T type; };
209
210// decltype is only available in C++11 and above.
211#if __cplusplus >= 201103L
212// __hip_promote
213namespace __hip {
214
215template <class _Tp> struct __numeric_type {
216 static void __test(...);
217 static _Float16 __test(_Float16);
218 static float __test(float);
219 static double __test(char);
220 static double __test(int);
221 static double __test(unsigned);
222 static double __test(long);
223 static double __test(unsigned long);
224 static double __test(long long);
225 static double __test(unsigned long long);
226 static double __test(double);
227 // No support for long double, use double instead.
228 static double __test(long double);
229
230 typedef decltype(__test(std::declval<_Tp>())) type;
231 static const bool value = !std::is_same<type, void>::value;
232};
233
234template <> struct __numeric_type<void> { static const bool value = true; };
235
236template <class _A1, class _A2 = void, class _A3 = void,
237 bool = __numeric_type<_A1>::value &&__numeric_type<_A2>::value
238 &&__numeric_type<_A3>::value>
239class __promote_imp {
240public:
241 static const bool value = false;
242};
243
244template <class _A1, class _A2, class _A3>
245class __promote_imp<_A1, _A2, _A3, true> {
246private:
247 typedef typename __promote_imp<_A1>::type __type1;
248 typedef typename __promote_imp<_A2>::type __type2;
249 typedef typename __promote_imp<_A3>::type __type3;
250
251public:
252 typedef decltype(__type1() + __type2() + __type3()) type;
253 static const bool value = true;
254};
255
256template <class _A1, class _A2> class __promote_imp<_A1, _A2, void, true> {
257private:
258 typedef typename __promote_imp<_A1>::type __type1;
259 typedef typename __promote_imp<_A2>::type __type2;
260
261public:
262 typedef decltype(__type1() + __type2()) type;
263 static const bool value = true;
264};
265
266template <class _A1> class __promote_imp<_A1, void, void, true> {
267public:
268 typedef typename __numeric_type<_A1>::type type;
269 static const bool value = true;
270};
271
272template <class _A1, class _A2 = void, class _A3 = void>
273class __promote : public __promote_imp<_A1, _A2, _A3> {};
274
275} // namespace __hip
276#endif //__cplusplus >= 201103L
277
278// __HIP_OVERLOAD1 is used to resolve function calls with integer argument to
279// avoid compilation error due to ambibuity. e.g. floor(5) is resolved with
280// floor(double).
281#define __HIP_OVERLOAD1(__retty, __fn) \
282 template <typename __T> \
283 __DEVICE__ typename __hip_enable_if<std::numeric_limits<__T>::is_integer, \
284 __retty>::type \
285 __fn(__T __x) { \
286 return ::__fn((double)__x); \
287 }
288
289// __HIP_OVERLOAD2 is used to resolve function calls with mixed float/double
290// or integer argument to avoid compilation error due to ambibuity. e.g.
291// max(5.0f, 6.0) is resolved with max(double, double).
292#if __cplusplus >= 201103L
293#define __HIP_OVERLOAD2(__retty, __fn) \
294 template <typename __T1, typename __T2> \
295 __DEVICE__ typename __hip_enable_if< \
296 std::numeric_limits<__T1>::is_specialized && \
297 std::numeric_limits<__T2>::is_specialized, \
298 typename __hip::__promote<__T1, __T2>::type>::type \
299 __fn(__T1 __x, __T2 __y) { \
300 typedef typename __hip::__promote<__T1, __T2>::type __result_type; \
301 return __fn((__result_type)__x, (__result_type)__y); \
302 }
303#else
304#define __HIP_OVERLOAD2(__retty, __fn) \
305 template <typename __T1, typename __T2> \
306 __DEVICE__ \
307 typename __hip_enable_if<std::numeric_limits<__T1>::is_specialized && \
308 std::numeric_limits<__T2>::is_specialized, \
309 __retty>::type \
310 __fn(__T1 __x, __T2 __y) { \
311 return __fn((double)__x, (double)__y); \
312 }
313#endif
314
315__HIP_OVERLOAD1(double, abs)
316__HIP_OVERLOAD1(double, acos)
317__HIP_OVERLOAD1(double, acosh)
318__HIP_OVERLOAD1(double, asin)
319__HIP_OVERLOAD1(double, asinh)
320__HIP_OVERLOAD1(double, atan)
321__HIP_OVERLOAD2(double, atan2)
322__HIP_OVERLOAD1(double, atanh)
323__HIP_OVERLOAD1(double, cbrt)
324__HIP_OVERLOAD1(double, ceil)
325__HIP_OVERLOAD2(double, copysign)
326__HIP_OVERLOAD1(double, cos)
327__HIP_OVERLOAD1(double, cosh)
328__HIP_OVERLOAD1(double, erf)
329__HIP_OVERLOAD1(double, erfc)
330__HIP_OVERLOAD1(double, exp)
331__HIP_OVERLOAD1(double, exp2)
332__HIP_OVERLOAD1(double, expm1)
333__HIP_OVERLOAD1(double, fabs)
334__HIP_OVERLOAD2(double, fdim)
335__HIP_OVERLOAD1(double, floor)
336__HIP_OVERLOAD2(double, fmax)
337__HIP_OVERLOAD2(double, fmin)
338__HIP_OVERLOAD2(double, fmod)
339__HIP_OVERLOAD1(int, fpclassify)
340__HIP_OVERLOAD2(double, hypot)
341__HIP_OVERLOAD1(int, ilogb)
342__HIP_OVERLOAD1(bool, isfinite)
343__HIP_OVERLOAD2(bool, isgreater)
344__HIP_OVERLOAD2(bool, isgreaterequal)
345__HIP_OVERLOAD1(bool, isinf)
346__HIP_OVERLOAD2(bool, isless)
347__HIP_OVERLOAD2(bool, islessequal)
348__HIP_OVERLOAD2(bool, islessgreater)
349__HIP_OVERLOAD1(bool, isnan)
350__HIP_OVERLOAD1(bool, isnormal)
351__HIP_OVERLOAD2(bool, isunordered)
352__HIP_OVERLOAD1(double, lgamma)
353__HIP_OVERLOAD1(double, log)
354__HIP_OVERLOAD1(double, log10)
355__HIP_OVERLOAD1(double, log1p)
356__HIP_OVERLOAD1(double, log2)
357__HIP_OVERLOAD1(double, logb)
358__HIP_OVERLOAD1(long long, llrint)
359__HIP_OVERLOAD1(long long, llround)
360__HIP_OVERLOAD1(long, lrint)
361__HIP_OVERLOAD1(long, lround)
362__HIP_OVERLOAD1(double, nearbyint)
363__HIP_OVERLOAD2(double, nextafter)
364__HIP_OVERLOAD2(double, pow)
365__HIP_OVERLOAD2(double, remainder)
366__HIP_OVERLOAD1(double, rint)
367__HIP_OVERLOAD1(double, round)
368__HIP_OVERLOAD1(bool, signbit)
369__HIP_OVERLOAD1(double, sin)
370__HIP_OVERLOAD1(double, sinh)
371__HIP_OVERLOAD1(double, sqrt)
372__HIP_OVERLOAD1(double, tan)
373__HIP_OVERLOAD1(double, tanh)
374__HIP_OVERLOAD1(double, tgamma)
375__HIP_OVERLOAD1(double, trunc)
376
377// Overload these but don't add them to std, they are not part of cmath.
378__HIP_OVERLOAD2(double, max)
379__HIP_OVERLOAD2(double, min)
380
381// Additional Overloads that don't quite match HIP_OVERLOAD.
382#if __cplusplus >= 201103L
383template <typename __T1, typename __T2, typename __T3>
384__DEVICE__ typename __hip_enable_if<
385 std::numeric_limits<__T1>::is_specialized &&
386 std::numeric_limits<__T2>::is_specialized &&
387 std::numeric_limits<__T3>::is_specialized,
388 typename __hip::__promote<__T1, __T2, __T3>::type>::type
389fma(__T1 __x, __T2 __y, __T3 __z) {
390 typedef typename __hip::__promote<__T1, __T2, __T3>::type __result_type;
391 return ::fma((__result_type)__x, (__result_type)__y, (__result_type)__z);
392}
393#else
394template <typename __T1, typename __T2, typename __T3>
395__DEVICE__
396 typename __hip_enable_if<std::numeric_limits<__T1>::is_specialized &&
397 std::numeric_limits<__T2>::is_specialized &&
398 std::numeric_limits<__T3>::is_specialized,
399 double>::type
400 fma(__T1 __x, __T2 __y, __T3 __z) {
401 return ::fma((double)__x, (double)__y, (double)__z);
402}
403#endif
404
405template <typename __T>
406__DEVICE__
407 typename __hip_enable_if<std::numeric_limits<__T>::is_integer, double>::type
408 frexp(__T __x, int *__exp) {
409 return ::frexp((double)__x, __exp);
410}
411
412template <typename __T>
413__DEVICE__
414 typename __hip_enable_if<std::numeric_limits<__T>::is_integer, double>::type
415 ldexp(__T __x, int __exp) {
416 return ::ldexp((double)__x, __exp);
417}
418
419template <typename __T>
420__DEVICE__
421 typename __hip_enable_if<std::numeric_limits<__T>::is_integer, double>::type
422 modf(__T __x, double *__exp) {
423 return ::modf((double)__x, __exp);
424}
425
426#if __cplusplus >= 201103L
427template <typename __T1, typename __T2>
428__DEVICE__
429 typename __hip_enable_if<std::numeric_limits<__T1>::is_specialized &&
430 std::numeric_limits<__T2>::is_specialized,
431 typename __hip::__promote<__T1, __T2>::type>::type
432 remquo(__T1 __x, __T2 __y, int *__quo) {
433 typedef typename __hip::__promote<__T1, __T2>::type __result_type;
434 return ::remquo((__result_type)__x, (__result_type)__y, __quo);
435}
436#else
437template <typename __T1, typename __T2>
438__DEVICE__
439 typename __hip_enable_if<std::numeric_limits<__T1>::is_specialized &&
440 std::numeric_limits<__T2>::is_specialized,
441 double>::type
442 remquo(__T1 __x, __T2 __y, int *__quo) {
443 return ::remquo((double)__x, (double)__y, __quo);
444}
445#endif
446
447template <typename __T>
448__DEVICE__
449 typename __hip_enable_if<std::numeric_limits<__T>::is_integer, double>::type
450 scalbln(__T __x, long int __exp) {
451 return ::scalbln((double)__x, __exp);
452}
453
454template <typename __T>
455__DEVICE__
456 typename __hip_enable_if<std::numeric_limits<__T>::is_integer, double>::type
457 scalbn(__T __x, int __exp) {
458 return ::scalbn((double)__x, __exp);
459}
460
461#pragma pop_macro("__HIP_OVERLOAD1")
462#pragma pop_macro("__HIP_OVERLOAD2")
463
464// END HIP_OVERLOAD
465
466// END DEF_FUN and HIP_OVERLOAD
467
468#endif // defined(__cplusplus)
469
470// Define these overloads inside the namespace our standard library uses.
471#ifdef _LIBCPP_BEGIN_NAMESPACE_STD
472_LIBCPP_BEGIN_NAMESPACE_STD
473#else
474namespace std {
475#ifdef _GLIBCXX_BEGIN_NAMESPACE_VERSION
476_GLIBCXX_BEGIN_NAMESPACE_VERSION
477#endif
478#endif
479
480// Pull the new overloads we defined above into namespace std.
481// using ::abs; - This may be considered for C++.
482using ::acos;
483using ::acosh;
484using ::asin;
485using ::asinh;
486using ::atan;
487using ::atan2;
488using ::atanh;
489using ::cbrt;
490using ::ceil;
491using ::copysign;
492using ::cos;
493using ::cosh;
494using ::erf;
495using ::erfc;
496using ::exp;
497using ::exp2;
498using ::expm1;
499using ::fabs;
500using ::fdim;
501using ::floor;
502using ::fma;
503using ::fmax;
504using ::fmin;
505using ::fmod;
506using ::fpclassify;
507using ::frexp;
508using ::hypot;
509using ::ilogb;
510using ::isfinite;
511using ::isgreater;
512using ::isgreaterequal;
513using ::isless;
514using ::islessequal;
515using ::islessgreater;
516using ::isnormal;
517using ::isunordered;
518using ::ldexp;
519using ::lgamma;
520using ::llrint;
521using ::llround;
522using ::log;
523using ::log10;
524using ::log1p;
525using ::log2;
526using ::logb;
527using ::lrint;
528using ::lround;
529using ::modf;
530// using ::nan; - This may be considered for C++.
531// using ::nanf; - This may be considered for C++.
532// using ::nanl; - This is not yet defined.
533using ::nearbyint;
534using ::nextafter;
535// using ::nexttoward; - Omit this since we do not have a definition.
536using ::pow;
537using ::remainder;
538using ::remquo;
539using ::rint;
540using ::round;
541using ::scalbln;
542using ::scalbn;
543using ::signbit;
544using ::sin;
545using ::sinh;
546using ::sqrt;
547using ::tan;
548using ::tanh;
549using ::tgamma;
550using ::trunc;
551
552// Well this is fun: We need to pull these symbols in for libc++, but we can't
553// pull them in with libstdc++, because its ::isinf and ::isnan are different
554// than its std::isinf and std::isnan.
555#ifndef __GLIBCXX__
556using ::isinf;
557using ::isnan;
558#endif
559
560// Finally, pull the "foobarf" functions that HIP defines into std.
561using ::acosf;
562using ::acoshf;
563using ::asinf;
564using ::asinhf;
565using ::atan2f;
566using ::atanf;
567using ::atanhf;
568using ::cbrtf;
569using ::ceilf;
570using ::copysignf;
571using ::cosf;
572using ::coshf;
573using ::erfcf;
574using ::erff;
575using ::exp2f;
576using ::expf;
577using ::expm1f;
578using ::fabsf;
579using ::fdimf;
580using ::floorf;
581using ::fmaf;
582using ::fmaxf;
583using ::fminf;
584using ::fmodf;
585using ::frexpf;
586using ::hypotf;
587using ::ilogbf;
588using ::ldexpf;
589using ::lgammaf;
590using ::llrintf;
591using ::llroundf;
592using ::log10f;
593using ::log1pf;
594using ::log2f;
595using ::logbf;
596using ::logf;
597using ::lrintf;
598using ::lroundf;
599using ::modff;
600using ::nearbyintf;
601using ::nextafterf;
602// using ::nexttowardf; - Omit this since we do not have a definition.
603using ::powf;
604using ::remainderf;
605using ::remquof;
606using ::rintf;
607using ::roundf;
608using ::scalblnf;
609using ::scalbnf;
610using ::sinf;
611using ::sinhf;
612using ::sqrtf;
613using ::tanf;
614using ::tanhf;
615using ::tgammaf;
616using ::truncf;
617
618#ifdef _LIBCPP_END_NAMESPACE_STD
619_LIBCPP_END_NAMESPACE_STD
620#else
621#ifdef _GLIBCXX_BEGIN_NAMESPACE_VERSION
622_GLIBCXX_END_NAMESPACE_VERSION
623#endif
624} // namespace std
625#endif
626
627// Define device-side math functions from <ymath.h> on MSVC.
628#if defined(_MSC_VER)
629
630// Before VS2019, `<ymath.h>` is also included in `<limits>` and other headers.
631// But, from VS2019, it's only included in `<complex>`. Need to include
632// `<ymath.h>` here to ensure C functions declared there won't be markded as
633// `__host__` and `__device__` through `<complex>` wrapper.
634#include <ymath.h>
635
636#if defined(__cplusplus)
637extern "C" {
638#endif // defined(__cplusplus)
639__DEVICE__ __attribute__((overloadable)) double _Cosh(double x, double y) {
640 return cosh(x) * y;
641}
642__DEVICE__ __attribute__((overloadable)) float _FCosh(float x, float y) {
643 return coshf(x) * y;
644}
645__DEVICE__ __attribute__((overloadable)) short _Dtest(double *p) {
646 return fpclassify(*p);
647}
648__DEVICE__ __attribute__((overloadable)) short _FDtest(float *p) {
649 return fpclassify(*p);
650}
651__DEVICE__ __attribute__((overloadable)) double _Sinh(double x, double y) {
652 return sinh(x) * y;
653}
654__DEVICE__ __attribute__((overloadable)) float _FSinh(float x, float y) {
655 return sinhf(x) * y;
656}
657#if defined(__cplusplus)
658}
659#endif // defined(__cplusplus)
660#endif // defined(_MSC_VER)
661
662#pragma pop_macro("__DEVICE__")
663
664#endif // __CLANG_HIP_CMATH_H__
lib/include/__clang_hip_libdevice_declares.h+17-9
...@@ -10,7 +10,9 @@...@@ -10,7 +10,9 @@
10#ifndef __CLANG_HIP_LIBDEVICE_DECLARES_H__10#ifndef __CLANG_HIP_LIBDEVICE_DECLARES_H__
11#define __CLANG_HIP_LIBDEVICE_DECLARES_H__11#define __CLANG_HIP_LIBDEVICE_DECLARES_H__
1212
13#ifdef __cplusplus
13extern "C" {14extern "C" {
15#endif
1416
15// BEGIN FLOAT17// BEGIN FLOAT
16__device__ __attribute__((const)) float __ocml_acos_f32(float);18__device__ __attribute__((const)) float __ocml_acos_f32(float);
...@@ -78,6 +80,7 @@ __device__ __attribute__((const)) float __ocml_len4_f32(float, float, float,...@@ -78,6 +80,7 @@ __device__ __attribute__((const)) float __ocml_len4_f32(float, float, float,
78__device__ __attribute__((pure)) float __ocml_ncdf_f32(float);80__device__ __attribute__((pure)) float __ocml_ncdf_f32(float);
79__device__ __attribute__((pure)) float __ocml_ncdfinv_f32(float);81__device__ __attribute__((pure)) float __ocml_ncdfinv_f32(float);
80__device__ __attribute__((pure)) float __ocml_pow_f32(float, float);82__device__ __attribute__((pure)) float __ocml_pow_f32(float, float);
83__device__ __attribute__((pure)) float __ocml_pown_f32(float, int);
81__device__ __attribute__((pure)) float __ocml_rcbrt_f32(float);84__device__ __attribute__((pure)) float __ocml_rcbrt_f32(float);
82__device__ __attribute__((const)) float __ocml_remainder_f32(float, float);85__device__ __attribute__((const)) float __ocml_remainder_f32(float, float);
83__device__ float __ocml_remquo_f32(float, float,86__device__ float __ocml_remquo_f32(float, float,
...@@ -126,10 +129,10 @@ __device__ __attribute__((const)) float __ocml_div_rte_f32(float, float);...@@ -126,10 +129,10 @@ __device__ __attribute__((const)) float __ocml_div_rte_f32(float, float);
126__device__ __attribute__((const)) float __ocml_div_rtn_f32(float, float);129__device__ __attribute__((const)) float __ocml_div_rtn_f32(float, float);
127__device__ __attribute__((const)) float __ocml_div_rtp_f32(float, float);130__device__ __attribute__((const)) float __ocml_div_rtp_f32(float, float);
128__device__ __attribute__((const)) float __ocml_div_rtz_f32(float, float);131__device__ __attribute__((const)) float __ocml_div_rtz_f32(float, float);
129__device__ __attribute__((const)) float __ocml_sqrt_rte_f32(float, float);132__device__ __attribute__((const)) float __ocml_sqrt_rte_f32(float);
130__device__ __attribute__((const)) float __ocml_sqrt_rtn_f32(float, float);133__device__ __attribute__((const)) float __ocml_sqrt_rtn_f32(float);
131__device__ __attribute__((const)) float __ocml_sqrt_rtp_f32(float, float);134__device__ __attribute__((const)) float __ocml_sqrt_rtp_f32(float);
132__device__ __attribute__((const)) float __ocml_sqrt_rtz_f32(float, float);135__device__ __attribute__((const)) float __ocml_sqrt_rtz_f32(float);
133__device__ __attribute__((const)) float __ocml_fma_rte_f32(float, float, float);136__device__ __attribute__((const)) float __ocml_fma_rte_f32(float, float, float);
134__device__ __attribute__((const)) float __ocml_fma_rtn_f32(float, float, float);137__device__ __attribute__((const)) float __ocml_fma_rtn_f32(float, float, float);
135__device__ __attribute__((const)) float __ocml_fma_rtp_f32(float, float, float);138__device__ __attribute__((const)) float __ocml_fma_rtp_f32(float, float, float);
...@@ -205,6 +208,7 @@ __device__ __attribute__((const)) double __ocml_len4_f64(double, double, double,...@@ -205,6 +208,7 @@ __device__ __attribute__((const)) double __ocml_len4_f64(double, double, double,
205__device__ __attribute__((pure)) double __ocml_ncdf_f64(double);208__device__ __attribute__((pure)) double __ocml_ncdf_f64(double);
206__device__ __attribute__((pure)) double __ocml_ncdfinv_f64(double);209__device__ __attribute__((pure)) double __ocml_ncdfinv_f64(double);
207__device__ __attribute__((pure)) double __ocml_pow_f64(double, double);210__device__ __attribute__((pure)) double __ocml_pow_f64(double, double);
211__device__ __attribute__((pure)) double __ocml_pown_f64(double, int);
208__device__ __attribute__((pure)) double __ocml_rcbrt_f64(double);212__device__ __attribute__((pure)) double __ocml_rcbrt_f64(double);
209__device__ __attribute__((const)) double __ocml_remainder_f64(double, double);213__device__ __attribute__((const)) double __ocml_remainder_f64(double, double);
210__device__ double __ocml_remquo_f64(double, double,214__device__ double __ocml_remquo_f64(double, double,
...@@ -252,10 +256,10 @@ __device__ __attribute__((const)) double __ocml_div_rte_f64(double, double);...@@ -252,10 +256,10 @@ __device__ __attribute__((const)) double __ocml_div_rte_f64(double, double);
252__device__ __attribute__((const)) double __ocml_div_rtn_f64(double, double);256__device__ __attribute__((const)) double __ocml_div_rtn_f64(double, double);
253__device__ __attribute__((const)) double __ocml_div_rtp_f64(double, double);257__device__ __attribute__((const)) double __ocml_div_rtp_f64(double, double);
254__device__ __attribute__((const)) double __ocml_div_rtz_f64(double, double);258__device__ __attribute__((const)) double __ocml_div_rtz_f64(double, double);
255__device__ __attribute__((const)) double __ocml_sqrt_rte_f64(double, double);259__device__ __attribute__((const)) double __ocml_sqrt_rte_f64(double);
256__device__ __attribute__((const)) double __ocml_sqrt_rtn_f64(double, double);260__device__ __attribute__((const)) double __ocml_sqrt_rtn_f64(double);
257__device__ __attribute__((const)) double __ocml_sqrt_rtp_f64(double, double);261__device__ __attribute__((const)) double __ocml_sqrt_rtp_f64(double);
258__device__ __attribute__((const)) double __ocml_sqrt_rtz_f64(double, double);262__device__ __attribute__((const)) double __ocml_sqrt_rtz_f64(double);
259__device__ __attribute__((const)) double __ocml_fma_rte_f64(double, double,263__device__ __attribute__((const)) double __ocml_fma_rte_f64(double, double,
260 double);264 double);
261__device__ __attribute__((const)) double __ocml_fma_rtn_f64(double, double,265__device__ __attribute__((const)) double __ocml_fma_rtn_f64(double, double,
...@@ -290,6 +294,7 @@ __device__ __attribute__((const)) _Float16 __ocml_rsqrt_f16(_Float16);...@@ -290,6 +294,7 @@ __device__ __attribute__((const)) _Float16 __ocml_rsqrt_f16(_Float16);
290__device__ _Float16 __ocml_sin_f16(_Float16);294__device__ _Float16 __ocml_sin_f16(_Float16);
291__device__ __attribute__((const)) _Float16 __ocml_sqrt_f16(_Float16);295__device__ __attribute__((const)) _Float16 __ocml_sqrt_f16(_Float16);
292__device__ __attribute__((const)) _Float16 __ocml_trunc_f16(_Float16);296__device__ __attribute__((const)) _Float16 __ocml_trunc_f16(_Float16);
297__device__ __attribute__((pure)) _Float16 __ocml_pown_f16(_Float16, int);
293298
294typedef _Float16 __2f16 __attribute__((ext_vector_type(2)));299typedef _Float16 __2f16 __attribute__((ext_vector_type(2)));
295typedef short __2i16 __attribute__((ext_vector_type(2)));300typedef short __2i16 __attribute__((ext_vector_type(2)));
...@@ -313,14 +318,17 @@ __device__ __attribute__((pure)) __2f16 __ocml_log2_2f16(__2f16);...@@ -313,14 +318,17 @@ __device__ __attribute__((pure)) __2f16 __ocml_log2_2f16(__2f16);
313__device__ inline __2f16318__device__ inline __2f16
314__llvm_amdgcn_rcp_2f16(__2f16 __x) // Not currently exposed by ROCDL.319__llvm_amdgcn_rcp_2f16(__2f16 __x) // Not currently exposed by ROCDL.
315{320{
316 return __2f16{__llvm_amdgcn_rcp_f16(__x.x), __llvm_amdgcn_rcp_f16(__x.y)};321 return (__2f16)(__llvm_amdgcn_rcp_f16(__x.x), __llvm_amdgcn_rcp_f16(__x.y));
317}322}
318__device__ __attribute__((const)) __2f16 __ocml_rint_2f16(__2f16);323__device__ __attribute__((const)) __2f16 __ocml_rint_2f16(__2f16);
319__device__ __attribute__((const)) __2f16 __ocml_rsqrt_2f16(__2f16);324__device__ __attribute__((const)) __2f16 __ocml_rsqrt_2f16(__2f16);
320__device__ __2f16 __ocml_sin_2f16(__2f16);325__device__ __2f16 __ocml_sin_2f16(__2f16);
321__device__ __attribute__((const)) __2f16 __ocml_sqrt_2f16(__2f16);326__device__ __attribute__((const)) __2f16 __ocml_sqrt_2f16(__2f16);
322__device__ __attribute__((const)) __2f16 __ocml_trunc_2f16(__2f16);327__device__ __attribute__((const)) __2f16 __ocml_trunc_2f16(__2f16);
328__device__ __attribute__((const)) __2f16 __ocml_pown_2f16(__2f16, __2i16);
323329
330#ifdef __cplusplus
324} // extern "C"331} // extern "C"
332#endif
325333
326#endif // __CLANG_HIP_LIBDEVICE_DECLARES_H__334#endif // __CLANG_HIP_LIBDEVICE_DECLARES_H__
lib/include/__clang_hip_math.h+619-529
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/*===---- __clang_hip_math.h - HIP math decls -------------------------------===1/*===---- __clang_hip_math.h - Device-side HIP math support ----------------===
2 *2 *
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.4 * See https://llvm.org/LICENSE.txt for license information.
...@@ -6,24 +6,57 @@...@@ -6,24 +6,57 @@
6 *6 *
7 *===-----------------------------------------------------------------------===7 *===-----------------------------------------------------------------------===
8 */8 */
9
10#ifndef __CLANG_HIP_MATH_H__9#ifndef __CLANG_HIP_MATH_H__
11#define __CLANG_HIP_MATH_H__10#define __CLANG_HIP_MATH_H__
1211
12#if !defined(__HIP__)
13#error "This file is for HIP and OpenMP AMDGCN device compilation only."
14#endif
15
16#if defined(__cplusplus)
13#include <algorithm>17#include <algorithm>
18#endif
14#include <limits.h>19#include <limits.h>
15#include <limits>
16#include <stdint.h>20#include <stdint.h>
1721
18#pragma push_macro("__DEVICE__")22#pragma push_macro("__DEVICE__")
19#pragma push_macro("__RETURN_TYPE")23#define __DEVICE__ static __device__ inline __attribute__((always_inline))
2024
21// to be consistent with __clang_cuda_math_forward_declares25// A few functions return bool type starting only in C++11.
22#define __DEVICE__ static __device__26#pragma push_macro("__RETURN_TYPE")
27#if defined(__cplusplus)
23#define __RETURN_TYPE bool28#define __RETURN_TYPE bool
29#else
30#define __RETURN_TYPE int
31#endif
32
33#if defined (__cplusplus) && __cplusplus < 201103L
34// emulate static_assert on type sizes
35template<bool>
36struct __compare_result{};
37template<>
38struct __compare_result<true> {
39 static const bool valid;
40};
41
42__DEVICE__
43void __suppress_unused_warning(bool b){};
44template <unsigned int S, unsigned int T>
45__DEVICE__ void __static_assert_equal_size() {
46 __suppress_unused_warning(__compare_result<S == T>::valid);
47}
48
49#define __static_assert_type_size_equal(A, B) \
50 __static_assert_equal_size<A,B>()
51
52#else
53#define __static_assert_type_size_equal(A,B) \
54 static_assert((A) == (B), "")
55
56#endif
2457
25__DEVICE__58__DEVICE__
26inline uint64_t __make_mantissa_base8(const char *__tagp) {59uint64_t __make_mantissa_base8(const char *__tagp) {
27 uint64_t __r = 0;60 uint64_t __r = 0;
28 while (__tagp) {61 while (__tagp) {
29 char __tmp = *__tagp;62 char __tmp = *__tagp;
...@@ -40,7 +73,7 @@ inline uint64_t __make_mantissa_base8(const char *__tagp) {...@@ -40,7 +73,7 @@ inline uint64_t __make_mantissa_base8(const char *__tagp) {
40}73}
4174
42__DEVICE__75__DEVICE__
43inline uint64_t __make_mantissa_base10(const char *__tagp) {76uint64_t __make_mantissa_base10(const char *__tagp) {
44 uint64_t __r = 0;77 uint64_t __r = 0;
45 while (__tagp) {78 while (__tagp) {
46 char __tmp = *__tagp;79 char __tmp = *__tagp;
...@@ -57,7 +90,7 @@ inline uint64_t __make_mantissa_base10(const char *__tagp) {...@@ -57,7 +90,7 @@ inline uint64_t __make_mantissa_base10(const char *__tagp) {
57}90}
5891
59__DEVICE__92__DEVICE__
60inline uint64_t __make_mantissa_base16(const char *__tagp) {93uint64_t __make_mantissa_base16(const char *__tagp) {
61 uint64_t __r = 0;94 uint64_t __r = 0;
62 while (__tagp) {95 while (__tagp) {
63 char __tmp = *__tagp;96 char __tmp = *__tagp;
...@@ -78,7 +111,7 @@ inline uint64_t __make_mantissa_base16(const char *__tagp) {...@@ -78,7 +111,7 @@ inline uint64_t __make_mantissa_base16(const char *__tagp) {
78}111}
79112
80__DEVICE__113__DEVICE__
81inline uint64_t __make_mantissa(const char *__tagp) {114uint64_t __make_mantissa(const char *__tagp) {
82 if (!__tagp)115 if (!__tagp)
83 return 0u;116 return 0u;
84117
...@@ -95,78 +128,124 @@ inline uint64_t __make_mantissa(const char *__tagp) {...@@ -95,78 +128,124 @@ inline uint64_t __make_mantissa(const char *__tagp) {
95}128}
96129
97// BEGIN FLOAT130// BEGIN FLOAT
131#if defined(__cplusplus)
98__DEVICE__132__DEVICE__
99inline float abs(float __x) { return __ocml_fabs_f32(__x); }133int abs(int __x) {
134 int __sgn = __x >> (sizeof(int) * CHAR_BIT - 1);
135 return (__x ^ __sgn) - __sgn;
136}
100__DEVICE__137__DEVICE__
101inline float acosf(float __x) { return __ocml_acos_f32(__x); }138long labs(long __x) {
139 long __sgn = __x >> (sizeof(long) * CHAR_BIT - 1);
140 return (__x ^ __sgn) - __sgn;
141}
102__DEVICE__142__DEVICE__
103inline float acoshf(float __x) { return __ocml_acosh_f32(__x); }143long long llabs(long long __x) {
144 long long __sgn = __x >> (sizeof(long long) * CHAR_BIT - 1);
145 return (__x ^ __sgn) - __sgn;
146}
147#endif
148
104__DEVICE__149__DEVICE__
105inline float asinf(float __x) { return __ocml_asin_f32(__x); }150float acosf(float __x) { return __ocml_acos_f32(__x); }
151
106__DEVICE__152__DEVICE__
107inline float asinhf(float __x) { return __ocml_asinh_f32(__x); }153float acoshf(float __x) { return __ocml_acosh_f32(__x); }
154
108__DEVICE__155__DEVICE__
109inline float atan2f(float __x, float __y) { return __ocml_atan2_f32(__x, __y); }156float asinf(float __x) { return __ocml_asin_f32(__x); }
157
110__DEVICE__158__DEVICE__
111inline float atanf(float __x) { return __ocml_atan_f32(__x); }159float asinhf(float __x) { return __ocml_asinh_f32(__x); }
160
112__DEVICE__161__DEVICE__
113inline float atanhf(float __x) { return __ocml_atanh_f32(__x); }162float atan2f(float __x, float __y) { return __ocml_atan2_f32(__x, __y); }
163
114__DEVICE__164__DEVICE__
115inline float cbrtf(float __x) { return __ocml_cbrt_f32(__x); }165float atanf(float __x) { return __ocml_atan_f32(__x); }
166
116__DEVICE__167__DEVICE__
117inline float ceilf(float __x) { return __ocml_ceil_f32(__x); }168float atanhf(float __x) { return __ocml_atanh_f32(__x); }
169
118__DEVICE__170__DEVICE__
119inline float copysignf(float __x, float __y) {171float cbrtf(float __x) { return __ocml_cbrt_f32(__x); }
120 return __ocml_copysign_f32(__x, __y);172
121}
122__DEVICE__173__DEVICE__
123inline float cosf(float __x) { return __ocml_cos_f32(__x); }174float ceilf(float __x) { return __ocml_ceil_f32(__x); }
175
124__DEVICE__176__DEVICE__
125inline float coshf(float __x) { return __ocml_cosh_f32(__x); }177float copysignf(float __x, float __y) { return __ocml_copysign_f32(__x, __y); }
178
126__DEVICE__179__DEVICE__
127inline float cospif(float __x) { return __ocml_cospi_f32(__x); }180float cosf(float __x) { return __ocml_cos_f32(__x); }
181
128__DEVICE__182__DEVICE__
129inline float cyl_bessel_i0f(float __x) { return __ocml_i0_f32(__x); }183float coshf(float __x) { return __ocml_cosh_f32(__x); }
184
130__DEVICE__185__DEVICE__
131inline float cyl_bessel_i1f(float __x) { return __ocml_i1_f32(__x); }186float cospif(float __x) { return __ocml_cospi_f32(__x); }
187
132__DEVICE__188__DEVICE__
133inline float erfcf(float __x) { return __ocml_erfc_f32(__x); }189float cyl_bessel_i0f(float __x) { return __ocml_i0_f32(__x); }
190
134__DEVICE__191__DEVICE__
135inline float erfcinvf(float __x) { return __ocml_erfcinv_f32(__x); }192float cyl_bessel_i1f(float __x) { return __ocml_i1_f32(__x); }
193
136__DEVICE__194__DEVICE__
137inline float erfcxf(float __x) { return __ocml_erfcx_f32(__x); }195float erfcf(float __x) { return __ocml_erfc_f32(__x); }
196
138__DEVICE__197__DEVICE__
139inline float erff(float __x) { return __ocml_erf_f32(__x); }198float erfcinvf(float __x) { return __ocml_erfcinv_f32(__x); }
199
140__DEVICE__200__DEVICE__
141inline float erfinvf(float __x) { return __ocml_erfinv_f32(__x); }201float erfcxf(float __x) { return __ocml_erfcx_f32(__x); }
202
142__DEVICE__203__DEVICE__
143inline float exp10f(float __x) { return __ocml_exp10_f32(__x); }204float erff(float __x) { return __ocml_erf_f32(__x); }
205
144__DEVICE__206__DEVICE__
145inline float exp2f(float __x) { return __ocml_exp2_f32(__x); }207float erfinvf(float __x) { return __ocml_erfinv_f32(__x); }
208
146__DEVICE__209__DEVICE__
147inline float expf(float __x) { return __ocml_exp_f32(__x); }210float exp10f(float __x) { return __ocml_exp10_f32(__x); }
211
148__DEVICE__212__DEVICE__
149inline float expm1f(float __x) { return __ocml_expm1_f32(__x); }213float exp2f(float __x) { return __ocml_exp2_f32(__x); }
214
150__DEVICE__215__DEVICE__
151inline float fabsf(float __x) { return __ocml_fabs_f32(__x); }216float expf(float __x) { return __ocml_exp_f32(__x); }
217
152__DEVICE__218__DEVICE__
153inline float fdimf(float __x, float __y) { return __ocml_fdim_f32(__x, __y); }219float expm1f(float __x) { return __ocml_expm1_f32(__x); }
220
154__DEVICE__221__DEVICE__
155inline float fdividef(float __x, float __y) { return __x / __y; }222float fabsf(float __x) { return __ocml_fabs_f32(__x); }
223
156__DEVICE__224__DEVICE__
157inline float floorf(float __x) { return __ocml_floor_f32(__x); }225float fdimf(float __x, float __y) { return __ocml_fdim_f32(__x, __y); }
226
158__DEVICE__227__DEVICE__
159inline float fmaf(float __x, float __y, float __z) {228float fdividef(float __x, float __y) { return __x / __y; }
229
230__DEVICE__
231float floorf(float __x) { return __ocml_floor_f32(__x); }
232
233__DEVICE__
234float fmaf(float __x, float __y, float __z) {
160 return __ocml_fma_f32(__x, __y, __z);235 return __ocml_fma_f32(__x, __y, __z);
161}236}
237
162__DEVICE__238__DEVICE__
163inline float fmaxf(float __x, float __y) { return __ocml_fmax_f32(__x, __y); }239float fmaxf(float __x, float __y) { return __ocml_fmax_f32(__x, __y); }
240
164__DEVICE__241__DEVICE__
165inline float fminf(float __x, float __y) { return __ocml_fmin_f32(__x, __y); }242float fminf(float __x, float __y) { return __ocml_fmin_f32(__x, __y); }
243
166__DEVICE__244__DEVICE__
167inline float fmodf(float __x, float __y) { return __ocml_fmod_f32(__x, __y); }245float fmodf(float __x, float __y) { return __ocml_fmod_f32(__x, __y); }
246
168__DEVICE__247__DEVICE__
169inline float frexpf(float __x, int *__nptr) {248float frexpf(float __x, int *__nptr) {
170 int __tmp;249 int __tmp;
171 float __r =250 float __r =
172 __ocml_frexp_f32(__x, (__attribute__((address_space(5))) int *)&__tmp);251 __ocml_frexp_f32(__x, (__attribute__((address_space(5))) int *)&__tmp);
...@@ -174,24 +253,31 @@ inline float frexpf(float __x, int *__nptr) {...@@ -174,24 +253,31 @@ inline float frexpf(float __x, int *__nptr) {
174253
175 return __r;254 return __r;
176}255}
256
177__DEVICE__257__DEVICE__
178inline float hypotf(float __x, float __y) { return __ocml_hypot_f32(__x, __y); }258float hypotf(float __x, float __y) { return __ocml_hypot_f32(__x, __y); }
259
179__DEVICE__260__DEVICE__
180inline int ilogbf(float __x) { return __ocml_ilogb_f32(__x); }261int ilogbf(float __x) { return __ocml_ilogb_f32(__x); }
262
181__DEVICE__263__DEVICE__
182inline __RETURN_TYPE isfinite(float __x) { return __ocml_isfinite_f32(__x); }264__RETURN_TYPE __finitef(float __x) { return __ocml_isfinite_f32(__x); }
265
183__DEVICE__266__DEVICE__
184inline __RETURN_TYPE isinf(float __x) { return __ocml_isinf_f32(__x); }267__RETURN_TYPE __isinff(float __x) { return __ocml_isinf_f32(__x); }
268
185__DEVICE__269__DEVICE__
186inline __RETURN_TYPE isnan(float __x) { return __ocml_isnan_f32(__x); }270__RETURN_TYPE __isnanf(float __x) { return __ocml_isnan_f32(__x); }
271
187__DEVICE__272__DEVICE__
188inline float j0f(float __x) { return __ocml_j0_f32(__x); }273float j0f(float __x) { return __ocml_j0_f32(__x); }
274
189__DEVICE__275__DEVICE__
190inline float j1f(float __x) { return __ocml_j1_f32(__x); }276float j1f(float __x) { return __ocml_j1_f32(__x); }
277
191__DEVICE__278__DEVICE__
192inline float jnf(int __n,279float jnf(int __n, float __x) { // TODO: we could use Ahmes multiplication
193 float __x) { // TODO: we could use Ahmes multiplication280 // and the Miller & Brown algorithm
194 // and the Miller & Brown algorithm
195 // for linear recurrences to get O(log n) steps, but it's unclear if281 // for linear recurrences to get O(log n) steps, but it's unclear if
196 // it'd be beneficial in this case.282 // it'd be beneficial in this case.
197 if (__n == 0)283 if (__n == 0)
...@@ -209,50 +295,61 @@ inline float jnf(int __n,...@@ -209,50 +295,61 @@ inline float jnf(int __n,
209295
210 return __x1;296 return __x1;
211}297}
298
212__DEVICE__299__DEVICE__
213inline float ldexpf(float __x, int __e) { return __ocml_ldexp_f32(__x, __e); }300float ldexpf(float __x, int __e) { return __ocml_ldexp_f32(__x, __e); }
301
214__DEVICE__302__DEVICE__
215inline float lgammaf(float __x) { return __ocml_lgamma_f32(__x); }303float lgammaf(float __x) { return __ocml_lgamma_f32(__x); }
304
216__DEVICE__305__DEVICE__
217inline long long int llrintf(float __x) { return __ocml_rint_f32(__x); }306long long int llrintf(float __x) { return __ocml_rint_f32(__x); }
307
218__DEVICE__308__DEVICE__
219inline long long int llroundf(float __x) { return __ocml_round_f32(__x); }309long long int llroundf(float __x) { return __ocml_round_f32(__x); }
310
220__DEVICE__311__DEVICE__
221inline float log10f(float __x) { return __ocml_log10_f32(__x); }312float log10f(float __x) { return __ocml_log10_f32(__x); }
313
222__DEVICE__314__DEVICE__
223inline float log1pf(float __x) { return __ocml_log1p_f32(__x); }315float log1pf(float __x) { return __ocml_log1p_f32(__x); }
316
224__DEVICE__317__DEVICE__
225inline float log2f(float __x) { return __ocml_log2_f32(__x); }318float log2f(float __x) { return __ocml_log2_f32(__x); }
319
226__DEVICE__320__DEVICE__
227inline float logbf(float __x) { return __ocml_logb_f32(__x); }321float logbf(float __x) { return __ocml_logb_f32(__x); }
322
228__DEVICE__323__DEVICE__
229inline float logf(float __x) { return __ocml_log_f32(__x); }324float logf(float __x) { return __ocml_log_f32(__x); }
325
230__DEVICE__326__DEVICE__
231inline long int lrintf(float __x) { return __ocml_rint_f32(__x); }327long int lrintf(float __x) { return __ocml_rint_f32(__x); }
328
232__DEVICE__329__DEVICE__
233inline long int lroundf(float __x) { return __ocml_round_f32(__x); }330long int lroundf(float __x) { return __ocml_round_f32(__x); }
331
234__DEVICE__332__DEVICE__
235inline float modff(float __x, float *__iptr) {333float modff(float __x, float *__iptr) {
236 float __tmp;334 float __tmp;
237 float __r =335 float __r =
238 __ocml_modf_f32(__x, (__attribute__((address_space(5))) float *)&__tmp);336 __ocml_modf_f32(__x, (__attribute__((address_space(5))) float *)&__tmp);
239 *__iptr = __tmp;337 *__iptr = __tmp;
240
241 return __r;338 return __r;
242}339}
340
243__DEVICE__341__DEVICE__
244inline float nanf(const char *__tagp) {342float nanf(const char *__tagp) {
245 union {343 union {
246 float val;344 float val;
247 struct ieee_float {345 struct ieee_float {
248 uint32_t mantissa : 22;346 unsigned int mantissa : 22;
249 uint32_t quiet : 1;347 unsigned int quiet : 1;
250 uint32_t exponent : 8;348 unsigned int exponent : 8;
251 uint32_t sign : 1;349 unsigned int sign : 1;
252 } bits;350 } bits;
253
254 static_assert(sizeof(float) == sizeof(ieee_float), "");
255 } __tmp;351 } __tmp;
352 __static_assert_type_size_equal(sizeof(__tmp.val), sizeof(__tmp.bits));
256353
257 __tmp.bits.sign = 0u;354 __tmp.bits.sign = 0u;
258 __tmp.bits.exponent = ~0u;355 __tmp.bits.exponent = ~0u;
...@@ -261,28 +358,34 @@ inline float nanf(const char *__tagp) {...@@ -261,28 +358,34 @@ inline float nanf(const char *__tagp) {
261358
262 return __tmp.val;359 return __tmp.val;
263}360}
361
264__DEVICE__362__DEVICE__
265inline float nearbyintf(float __x) { return __ocml_nearbyint_f32(__x); }363float nearbyintf(float __x) { return __ocml_nearbyint_f32(__x); }
364
266__DEVICE__365__DEVICE__
267inline float nextafterf(float __x, float __y) {366float nextafterf(float __x, float __y) {
268 return __ocml_nextafter_f32(__x, __y);367 return __ocml_nextafter_f32(__x, __y);
269}368}
369
270__DEVICE__370__DEVICE__
271inline float norm3df(float __x, float __y, float __z) {371float norm3df(float __x, float __y, float __z) {
272 return __ocml_len3_f32(__x, __y, __z);372 return __ocml_len3_f32(__x, __y, __z);
273}373}
374
274__DEVICE__375__DEVICE__
275inline float norm4df(float __x, float __y, float __z, float __w) {376float norm4df(float __x, float __y, float __z, float __w) {
276 return __ocml_len4_f32(__x, __y, __z, __w);377 return __ocml_len4_f32(__x, __y, __z, __w);
277}378}
379
278__DEVICE__380__DEVICE__
279inline float normcdff(float __x) { return __ocml_ncdf_f32(__x); }381float normcdff(float __x) { return __ocml_ncdf_f32(__x); }
382
280__DEVICE__383__DEVICE__
281inline float normcdfinvf(float __x) { return __ocml_ncdfinv_f32(__x); }384float normcdfinvf(float __x) { return __ocml_ncdfinv_f32(__x); }
385
282__DEVICE__386__DEVICE__
283inline float387float normf(int __dim,
284normf(int __dim,388 const float *__a) { // TODO: placeholder until OCML adds support.
285 const float *__a) { // TODO: placeholder until OCML adds support.
286 float __r = 0;389 float __r = 0;
287 while (__dim--) {390 while (__dim--) {
288 __r += __a[0] * __a[0];391 __r += __a[0] * __a[0];
...@@ -291,16 +394,23 @@ normf(int __dim,...@@ -291,16 +394,23 @@ normf(int __dim,
291394
292 return __ocml_sqrt_f32(__r);395 return __ocml_sqrt_f32(__r);
293}396}
397
294__DEVICE__398__DEVICE__
295inline float powf(float __x, float __y) { return __ocml_pow_f32(__x, __y); }399float powf(float __x, float __y) { return __ocml_pow_f32(__x, __y); }
400
401__DEVICE__
402float powif(float __x, int __y) { return __ocml_pown_f32(__x, __y); }
403
296__DEVICE__404__DEVICE__
297inline float rcbrtf(float __x) { return __ocml_rcbrt_f32(__x); }405float rcbrtf(float __x) { return __ocml_rcbrt_f32(__x); }
406
298__DEVICE__407__DEVICE__
299inline float remainderf(float __x, float __y) {408float remainderf(float __x, float __y) {
300 return __ocml_remainder_f32(__x, __y);409 return __ocml_remainder_f32(__x, __y);
301}410}
411
302__DEVICE__412__DEVICE__
303inline float remquof(float __x, float __y, int *__quo) {413float remquof(float __x, float __y, int *__quo) {
304 int __tmp;414 int __tmp;
305 float __r = __ocml_remquo_f32(415 float __r = __ocml_remquo_f32(
306 __x, __y, (__attribute__((address_space(5))) int *)&__tmp);416 __x, __y, (__attribute__((address_space(5))) int *)&__tmp);
...@@ -308,25 +418,26 @@ inline float remquof(float __x, float __y, int *__quo) {...@@ -308,25 +418,26 @@ inline float remquof(float __x, float __y, int *__quo) {
308418
309 return __r;419 return __r;
310}420}
421
311__DEVICE__422__DEVICE__
312inline float rhypotf(float __x, float __y) {423float rhypotf(float __x, float __y) { return __ocml_rhypot_f32(__x, __y); }
313 return __ocml_rhypot_f32(__x, __y);424
314}
315__DEVICE__425__DEVICE__
316inline float rintf(float __x) { return __ocml_rint_f32(__x); }426float rintf(float __x) { return __ocml_rint_f32(__x); }
427
317__DEVICE__428__DEVICE__
318inline float rnorm3df(float __x, float __y, float __z) {429float rnorm3df(float __x, float __y, float __z) {
319 return __ocml_rlen3_f32(__x, __y, __z);430 return __ocml_rlen3_f32(__x, __y, __z);
320}431}
321432
322__DEVICE__433__DEVICE__
323inline float rnorm4df(float __x, float __y, float __z, float __w) {434float rnorm4df(float __x, float __y, float __z, float __w) {
324 return __ocml_rlen4_f32(__x, __y, __z, __w);435 return __ocml_rlen4_f32(__x, __y, __z, __w);
325}436}
437
326__DEVICE__438__DEVICE__
327inline float439float rnormf(int __dim,
328rnormf(int __dim,440 const float *__a) { // TODO: placeholder until OCML adds support.
329 const float *__a) { // TODO: placeholder until OCML adds support.
330 float __r = 0;441 float __r = 0;
331 while (__dim--) {442 while (__dim--) {
332 __r += __a[0] * __a[0];443 __r += __a[0] * __a[0];
...@@ -335,59 +446,74 @@ rnormf(int __dim,...@@ -335,59 +446,74 @@ rnormf(int __dim,
335446
336 return __ocml_rsqrt_f32(__r);447 return __ocml_rsqrt_f32(__r);
337}448}
449
338__DEVICE__450__DEVICE__
339inline float roundf(float __x) { return __ocml_round_f32(__x); }451float roundf(float __x) { return __ocml_round_f32(__x); }
452
340__DEVICE__453__DEVICE__
341inline float rsqrtf(float __x) { return __ocml_rsqrt_f32(__x); }454float rsqrtf(float __x) { return __ocml_rsqrt_f32(__x); }
455
342__DEVICE__456__DEVICE__
343inline float scalblnf(float __x, long int __n) {457float scalblnf(float __x, long int __n) {
344 return (__n < INT_MAX) ? __ocml_scalbn_f32(__x, __n)458 return (__n < INT_MAX) ? __ocml_scalbn_f32(__x, __n)
345 : __ocml_scalb_f32(__x, __n);459 : __ocml_scalb_f32(__x, __n);
346}460}
461
347__DEVICE__462__DEVICE__
348inline float scalbnf(float __x, int __n) { return __ocml_scalbn_f32(__x, __n); }463float scalbnf(float __x, int __n) { return __ocml_scalbn_f32(__x, __n); }
464
349__DEVICE__465__DEVICE__
350inline __RETURN_TYPE signbit(float __x) { return __ocml_signbit_f32(__x); }466__RETURN_TYPE __signbitf(float __x) { return __ocml_signbit_f32(__x); }
467
351__DEVICE__468__DEVICE__
352inline void sincosf(float __x, float *__sinptr, float *__cosptr) {469void sincosf(float __x, float *__sinptr, float *__cosptr) {
353 float __tmp;470 float __tmp;
354
355 *__sinptr =471 *__sinptr =
356 __ocml_sincos_f32(__x, (__attribute__((address_space(5))) float *)&__tmp);472 __ocml_sincos_f32(__x, (__attribute__((address_space(5))) float *)&__tmp);
357 *__cosptr = __tmp;473 *__cosptr = __tmp;
358}474}
475
359__DEVICE__476__DEVICE__
360inline void sincospif(float __x, float *__sinptr, float *__cosptr) {477void sincospif(float __x, float *__sinptr, float *__cosptr) {
361 float __tmp;478 float __tmp;
362
363 *__sinptr = __ocml_sincospi_f32(479 *__sinptr = __ocml_sincospi_f32(
364 __x, (__attribute__((address_space(5))) float *)&__tmp);480 __x, (__attribute__((address_space(5))) float *)&__tmp);
365 *__cosptr = __tmp;481 *__cosptr = __tmp;
366}482}
483
367__DEVICE__484__DEVICE__
368inline float sinf(float __x) { return __ocml_sin_f32(__x); }485float sinf(float __x) { return __ocml_sin_f32(__x); }
486
369__DEVICE__487__DEVICE__
370inline float sinhf(float __x) { return __ocml_sinh_f32(__x); }488float sinhf(float __x) { return __ocml_sinh_f32(__x); }
489
371__DEVICE__490__DEVICE__
372inline float sinpif(float __x) { return __ocml_sinpi_f32(__x); }491float sinpif(float __x) { return __ocml_sinpi_f32(__x); }
492
373__DEVICE__493__DEVICE__
374inline float sqrtf(float __x) { return __ocml_sqrt_f32(__x); }494float sqrtf(float __x) { return __ocml_sqrt_f32(__x); }
495
375__DEVICE__496__DEVICE__
376inline float tanf(float __x) { return __ocml_tan_f32(__x); }497float tanf(float __x) { return __ocml_tan_f32(__x); }
498
377__DEVICE__499__DEVICE__
378inline float tanhf(float __x) { return __ocml_tanh_f32(__x); }500float tanhf(float __x) { return __ocml_tanh_f32(__x); }
501
379__DEVICE__502__DEVICE__
380inline float tgammaf(float __x) { return __ocml_tgamma_f32(__x); }503float tgammaf(float __x) { return __ocml_tgamma_f32(__x); }
504
381__DEVICE__505__DEVICE__
382inline float truncf(float __x) { return __ocml_trunc_f32(__x); }506float truncf(float __x) { return __ocml_trunc_f32(__x); }
507
383__DEVICE__508__DEVICE__
384inline float y0f(float __x) { return __ocml_y0_f32(__x); }509float y0f(float __x) { return __ocml_y0_f32(__x); }
510
385__DEVICE__511__DEVICE__
386inline float y1f(float __x) { return __ocml_y1_f32(__x); }512float y1f(float __x) { return __ocml_y1_f32(__x); }
513
387__DEVICE__514__DEVICE__
388inline float ynf(int __n,515float ynf(int __n, float __x) { // TODO: we could use Ahmes multiplication
389 float __x) { // TODO: we could use Ahmes multiplication516 // and the Miller & Brown algorithm
390 // and the Miller & Brown algorithm
391 // for linear recurrences to get O(log n) steps, but it's unclear if517 // for linear recurrences to get O(log n) steps, but it's unclear if
392 // it'd be beneficial in this case. Placeholder until OCML adds518 // it'd be beneficial in this case. Placeholder until OCML adds
393 // support.519 // support.
...@@ -408,290 +534,343 @@ inline float ynf(int __n,...@@ -408,290 +534,343 @@ inline float ynf(int __n,
408}534}
409535
410// BEGIN INTRINSICS536// BEGIN INTRINSICS
537
411__DEVICE__538__DEVICE__
412inline float __cosf(float __x) { return __ocml_native_cos_f32(__x); }539float __cosf(float __x) { return __ocml_native_cos_f32(__x); }
540
413__DEVICE__541__DEVICE__
414inline float __exp10f(float __x) { return __ocml_native_exp10_f32(__x); }542float __exp10f(float __x) { return __ocml_native_exp10_f32(__x); }
543
415__DEVICE__544__DEVICE__
416inline float __expf(float __x) { return __ocml_native_exp_f32(__x); }545float __expf(float __x) { return __ocml_native_exp_f32(__x); }
546
417#if defined OCML_BASIC_ROUNDED_OPERATIONS547#if defined OCML_BASIC_ROUNDED_OPERATIONS
418__DEVICE__548__DEVICE__
419inline float __fadd_rd(float __x, float __y) {549float __fadd_rd(float __x, float __y) { return __ocml_add_rtn_f32(__x, __y); }
420 return __ocml_add_rtn_f32(__x, __y);
421}
422#endif
423__DEVICE__550__DEVICE__
424inline float __fadd_rn(float __x, float __y) { return __x + __y; }551float __fadd_rn(float __x, float __y) { return __ocml_add_rte_f32(__x, __y); }
425#if defined OCML_BASIC_ROUNDED_OPERATIONS
426__DEVICE__552__DEVICE__
427inline float __fadd_ru(float __x, float __y) {553float __fadd_ru(float __x, float __y) { return __ocml_add_rtp_f32(__x, __y); }
428 return __ocml_add_rtp_f32(__x, __y);
429}
430__DEVICE__554__DEVICE__
431inline float __fadd_rz(float __x, float __y) {555float __fadd_rz(float __x, float __y) { return __ocml_add_rtz_f32(__x, __y); }
432 return __ocml_add_rtz_f32(__x, __y);556#else
433}
434__DEVICE__557__DEVICE__
435inline float __fdiv_rd(float __x, float __y) {558float __fadd_rn(float __x, float __y) { return __x + __y; }
436 return __ocml_div_rtn_f32(__x, __y);
437}
438#endif559#endif
439__DEVICE__560
440inline float __fdiv_rn(float __x, float __y) { return __x / __y; }
441#if defined OCML_BASIC_ROUNDED_OPERATIONS561#if defined OCML_BASIC_ROUNDED_OPERATIONS
442__DEVICE__562__DEVICE__
443inline float __fdiv_ru(float __x, float __y) {563float __fdiv_rd(float __x, float __y) { return __ocml_div_rtn_f32(__x, __y); }
444 return __ocml_div_rtp_f32(__x, __y);
445}
446__DEVICE__564__DEVICE__
447inline float __fdiv_rz(float __x, float __y) {565float __fdiv_rn(float __x, float __y) { return __ocml_div_rte_f32(__x, __y); }
448 return __ocml_div_rtz_f32(__x, __y);566__DEVICE__
449}567float __fdiv_ru(float __x, float __y) { return __ocml_div_rtp_f32(__x, __y); }
568__DEVICE__
569float __fdiv_rz(float __x, float __y) { return __ocml_div_rtz_f32(__x, __y); }
570#else
571__DEVICE__
572float __fdiv_rn(float __x, float __y) { return __x / __y; }
450#endif573#endif
574
451__DEVICE__575__DEVICE__
452inline float __fdividef(float __x, float __y) { return __x / __y; }576float __fdividef(float __x, float __y) { return __x / __y; }
577
453#if defined OCML_BASIC_ROUNDED_OPERATIONS578#if defined OCML_BASIC_ROUNDED_OPERATIONS
454__DEVICE__579__DEVICE__
455inline float __fmaf_rd(float __x, float __y, float __z) {580float __fmaf_rd(float __x, float __y, float __z) {
456 return __ocml_fma_rtn_f32(__x, __y, __z);581 return __ocml_fma_rtn_f32(__x, __y, __z);
457}582}
458#endif
459__DEVICE__583__DEVICE__
460inline float __fmaf_rn(float __x, float __y, float __z) {584float __fmaf_rn(float __x, float __y, float __z) {
461 return __ocml_fma_f32(__x, __y, __z);585 return __ocml_fma_rte_f32(__x, __y, __z);
462}586}
463#if defined OCML_BASIC_ROUNDED_OPERATIONS
464__DEVICE__587__DEVICE__
465inline float __fmaf_ru(float __x, float __y, float __z) {588float __fmaf_ru(float __x, float __y, float __z) {
466 return __ocml_fma_rtp_f32(__x, __y, __z);589 return __ocml_fma_rtp_f32(__x, __y, __z);
467}590}
468__DEVICE__591__DEVICE__
469inline float __fmaf_rz(float __x, float __y, float __z) {592float __fmaf_rz(float __x, float __y, float __z) {
470 return __ocml_fma_rtz_f32(__x, __y, __z);593 return __ocml_fma_rtz_f32(__x, __y, __z);
471}594}
595#else
472__DEVICE__596__DEVICE__
473inline float __fmul_rd(float __x, float __y) {597float __fmaf_rn(float __x, float __y, float __z) {
474 return __ocml_mul_rtn_f32(__x, __y);598 return __ocml_fma_f32(__x, __y, __z);
475}599}
476#endif600#endif
477__DEVICE__601
478inline float __fmul_rn(float __x, float __y) { return __x * __y; }
479#if defined OCML_BASIC_ROUNDED_OPERATIONS602#if defined OCML_BASIC_ROUNDED_OPERATIONS
480__DEVICE__603__DEVICE__
481inline float __fmul_ru(float __x, float __y) {604float __fmul_rd(float __x, float __y) { return __ocml_mul_rtn_f32(__x, __y); }
482 return __ocml_mul_rtp_f32(__x, __y);
483}
484__DEVICE__605__DEVICE__
485inline float __fmul_rz(float __x, float __y) {606float __fmul_rn(float __x, float __y) { return __ocml_mul_rte_f32(__x, __y); }
486 return __ocml_mul_rtz_f32(__x, __y);
487}
488__DEVICE__607__DEVICE__
489inline float __frcp_rd(float __x) { return __llvm_amdgcn_rcp_f32(__x); }608float __fmul_ru(float __x, float __y) { return __ocml_mul_rtp_f32(__x, __y); }
490#endif609__DEVICE__
610float __fmul_rz(float __x, float __y) { return __ocml_mul_rtz_f32(__x, __y); }
611#else
491__DEVICE__612__DEVICE__
492inline float __frcp_rn(float __x) { return __llvm_amdgcn_rcp_f32(__x); }613float __fmul_rn(float __x, float __y) { return __x * __y; }
614#endif
615
493#if defined OCML_BASIC_ROUNDED_OPERATIONS616#if defined OCML_BASIC_ROUNDED_OPERATIONS
494__DEVICE__617__DEVICE__
495inline float __frcp_ru(float __x) { return __llvm_amdgcn_rcp_f32(__x); }618float __frcp_rd(float __x) { return __ocml_div_rtn_f32(1.0f, __x); }
496__DEVICE__619__DEVICE__
497inline float __frcp_rz(float __x) { return __llvm_amdgcn_rcp_f32(__x); }620float __frcp_rn(float __x) { return __ocml_div_rte_f32(1.0f, __x); }
498#endif
499__DEVICE__621__DEVICE__
500inline float __frsqrt_rn(float __x) { return __llvm_amdgcn_rsq_f32(__x); }622float __frcp_ru(float __x) { return __ocml_div_rtp_f32(1.0f, __x); }
501#if defined OCML_BASIC_ROUNDED_OPERATIONS623__DEVICE__
624float __frcp_rz(float __x) { return __ocml_div_rtz_f32(1.0f, __x); }
625#else
502__DEVICE__626__DEVICE__
503inline float __fsqrt_rd(float __x) { return __ocml_sqrt_rtn_f32(__x); }627float __frcp_rn(float __x) { return 1.0f / __x; }
504#endif628#endif
629
505__DEVICE__630__DEVICE__
506inline float __fsqrt_rn(float __x) { return __ocml_native_sqrt_f32(__x); }631float __frsqrt_rn(float __x) { return __llvm_amdgcn_rsq_f32(__x); }
632
507#if defined OCML_BASIC_ROUNDED_OPERATIONS633#if defined OCML_BASIC_ROUNDED_OPERATIONS
508__DEVICE__634__DEVICE__
509inline float __fsqrt_ru(float __x) { return __ocml_sqrt_rtp_f32(__x); }635float __fsqrt_rd(float __x) { return __ocml_sqrt_rtn_f32(__x); }
510__DEVICE__636__DEVICE__
511inline float __fsqrt_rz(float __x) { return __ocml_sqrt_rtz_f32(__x); }637float __fsqrt_rn(float __x) { return __ocml_sqrt_rte_f32(__x); }
512__DEVICE__638__DEVICE__
513inline float __fsub_rd(float __x, float __y) {639float __fsqrt_ru(float __x) { return __ocml_sqrt_rtp_f32(__x); }
514 return __ocml_sub_rtn_f32(__x, __y);640__DEVICE__
515}641float __fsqrt_rz(float __x) { return __ocml_sqrt_rtz_f32(__x); }
516#endif642#else
517__DEVICE__643__DEVICE__
518inline float __fsub_rn(float __x, float __y) { return __x - __y; }644float __fsqrt_rn(float __x) { return __ocml_native_sqrt_f32(__x); }
645#endif
646
519#if defined OCML_BASIC_ROUNDED_OPERATIONS647#if defined OCML_BASIC_ROUNDED_OPERATIONS
520__DEVICE__648__DEVICE__
521inline float __fsub_ru(float __x, float __y) {649float __fsub_rd(float __x, float __y) { return __ocml_sub_rtn_f32(__x, __y); }
522 return __ocml_sub_rtp_f32(__x, __y);
523}
524__DEVICE__650__DEVICE__
525inline float __fsub_rz(float __x, float __y) {651float __fsub_rn(float __x, float __y) { return __ocml_sub_rte_f32(__x, __y); }
526 return __ocml_sub_rtz_f32(__x, __y);652__DEVICE__
527}653float __fsub_ru(float __x, float __y) { return __ocml_sub_rtp_f32(__x, __y); }
654__DEVICE__
655float __fsub_rz(float __x, float __y) { return __ocml_sub_rtz_f32(__x, __y); }
656#else
657__DEVICE__
658float __fsub_rn(float __x, float __y) { return __x - __y; }
528#endif659#endif
660
529__DEVICE__661__DEVICE__
530inline float __log10f(float __x) { return __ocml_native_log10_f32(__x); }662float __log10f(float __x) { return __ocml_native_log10_f32(__x); }
663
531__DEVICE__664__DEVICE__
532inline float __log2f(float __x) { return __ocml_native_log2_f32(__x); }665float __log2f(float __x) { return __ocml_native_log2_f32(__x); }
666
533__DEVICE__667__DEVICE__
534inline float __logf(float __x) { return __ocml_native_log_f32(__x); }668float __logf(float __x) { return __ocml_native_log_f32(__x); }
669
535__DEVICE__670__DEVICE__
536inline float __powf(float __x, float __y) { return __ocml_pow_f32(__x, __y); }671float __powf(float __x, float __y) { return __ocml_pow_f32(__x, __y); }
672
537__DEVICE__673__DEVICE__
538inline float __saturatef(float __x) {674float __saturatef(float __x) { return (__x < 0) ? 0 : ((__x > 1) ? 1 : __x); }
539 return (__x < 0) ? 0 : ((__x > 1) ? 1 : __x);675
540}
541__DEVICE__676__DEVICE__
542inline void __sincosf(float __x, float *__sinptr, float *__cosptr) {677void __sincosf(float __x, float *__sinptr, float *__cosptr) {
543 *__sinptr = __ocml_native_sin_f32(__x);678 *__sinptr = __ocml_native_sin_f32(__x);
544 *__cosptr = __ocml_native_cos_f32(__x);679 *__cosptr = __ocml_native_cos_f32(__x);
545}680}
681
546__DEVICE__682__DEVICE__
547inline float __sinf(float __x) { return __ocml_native_sin_f32(__x); }683float __sinf(float __x) { return __ocml_native_sin_f32(__x); }
684
548__DEVICE__685__DEVICE__
549inline float __tanf(float __x) { return __ocml_tan_f32(__x); }686float __tanf(float __x) { return __ocml_tan_f32(__x); }
550// END INTRINSICS687// END INTRINSICS
551// END FLOAT688// END FLOAT
552689
553// BEGIN DOUBLE690// BEGIN DOUBLE
554__DEVICE__691__DEVICE__
555inline double abs(double __x) { return __ocml_fabs_f64(__x); }692double acos(double __x) { return __ocml_acos_f64(__x); }
556__DEVICE__693
557inline double acos(double __x) { return __ocml_acos_f64(__x); }
558__DEVICE__694__DEVICE__
559inline double acosh(double __x) { return __ocml_acosh_f64(__x); }695double acosh(double __x) { return __ocml_acosh_f64(__x); }
696
560__DEVICE__697__DEVICE__
561inline double asin(double __x) { return __ocml_asin_f64(__x); }698double asin(double __x) { return __ocml_asin_f64(__x); }
699
562__DEVICE__700__DEVICE__
563inline double asinh(double __x) { return __ocml_asinh_f64(__x); }701double asinh(double __x) { return __ocml_asinh_f64(__x); }
702
564__DEVICE__703__DEVICE__
565inline double atan(double __x) { return __ocml_atan_f64(__x); }704double atan(double __x) { return __ocml_atan_f64(__x); }
705
566__DEVICE__706__DEVICE__
567inline double atan2(double __x, double __y) {707double atan2(double __x, double __y) { return __ocml_atan2_f64(__x, __y); }
568 return __ocml_atan2_f64(__x, __y);708
569}
570__DEVICE__709__DEVICE__
571inline double atanh(double __x) { return __ocml_atanh_f64(__x); }710double atanh(double __x) { return __ocml_atanh_f64(__x); }
711
572__DEVICE__712__DEVICE__
573inline double cbrt(double __x) { return __ocml_cbrt_f64(__x); }713double cbrt(double __x) { return __ocml_cbrt_f64(__x); }
714
574__DEVICE__715__DEVICE__
575inline double ceil(double __x) { return __ocml_ceil_f64(__x); }716double ceil(double __x) { return __ocml_ceil_f64(__x); }
717
576__DEVICE__718__DEVICE__
577inline double copysign(double __x, double __y) {719double copysign(double __x, double __y) {
578 return __ocml_copysign_f64(__x, __y);720 return __ocml_copysign_f64(__x, __y);
579}721}
722
580__DEVICE__723__DEVICE__
581inline double cos(double __x) { return __ocml_cos_f64(__x); }724double cos(double __x) { return __ocml_cos_f64(__x); }
725
582__DEVICE__726__DEVICE__
583inline double cosh(double __x) { return __ocml_cosh_f64(__x); }727double cosh(double __x) { return __ocml_cosh_f64(__x); }
728
584__DEVICE__729__DEVICE__
585inline double cospi(double __x) { return __ocml_cospi_f64(__x); }730double cospi(double __x) { return __ocml_cospi_f64(__x); }
731
586__DEVICE__732__DEVICE__
587inline double cyl_bessel_i0(double __x) { return __ocml_i0_f64(__x); }733double cyl_bessel_i0(double __x) { return __ocml_i0_f64(__x); }
734
588__DEVICE__735__DEVICE__
589inline double cyl_bessel_i1(double __x) { return __ocml_i1_f64(__x); }736double cyl_bessel_i1(double __x) { return __ocml_i1_f64(__x); }
737
590__DEVICE__738__DEVICE__
591inline double erf(double __x) { return __ocml_erf_f64(__x); }739double erf(double __x) { return __ocml_erf_f64(__x); }
740
592__DEVICE__741__DEVICE__
593inline double erfc(double __x) { return __ocml_erfc_f64(__x); }742double erfc(double __x) { return __ocml_erfc_f64(__x); }
743
594__DEVICE__744__DEVICE__
595inline double erfcinv(double __x) { return __ocml_erfcinv_f64(__x); }745double erfcinv(double __x) { return __ocml_erfcinv_f64(__x); }
746
596__DEVICE__747__DEVICE__
597inline double erfcx(double __x) { return __ocml_erfcx_f64(__x); }748double erfcx(double __x) { return __ocml_erfcx_f64(__x); }
749
598__DEVICE__750__DEVICE__
599inline double erfinv(double __x) { return __ocml_erfinv_f64(__x); }751double erfinv(double __x) { return __ocml_erfinv_f64(__x); }
752
600__DEVICE__753__DEVICE__
601inline double exp(double __x) { return __ocml_exp_f64(__x); }754double exp(double __x) { return __ocml_exp_f64(__x); }
755
602__DEVICE__756__DEVICE__
603inline double exp10(double __x) { return __ocml_exp10_f64(__x); }757double exp10(double __x) { return __ocml_exp10_f64(__x); }
758
604__DEVICE__759__DEVICE__
605inline double exp2(double __x) { return __ocml_exp2_f64(__x); }760double exp2(double __x) { return __ocml_exp2_f64(__x); }
761
606__DEVICE__762__DEVICE__
607inline double expm1(double __x) { return __ocml_expm1_f64(__x); }763double expm1(double __x) { return __ocml_expm1_f64(__x); }
764
608__DEVICE__765__DEVICE__
609inline double fabs(double __x) { return __ocml_fabs_f64(__x); }766double fabs(double __x) { return __ocml_fabs_f64(__x); }
767
610__DEVICE__768__DEVICE__
611inline double fdim(double __x, double __y) { return __ocml_fdim_f64(__x, __y); }769double fdim(double __x, double __y) { return __ocml_fdim_f64(__x, __y); }
770
612__DEVICE__771__DEVICE__
613inline double floor(double __x) { return __ocml_floor_f64(__x); }772double floor(double __x) { return __ocml_floor_f64(__x); }
773
614__DEVICE__774__DEVICE__
615inline double fma(double __x, double __y, double __z) {775double fma(double __x, double __y, double __z) {
616 return __ocml_fma_f64(__x, __y, __z);776 return __ocml_fma_f64(__x, __y, __z);
617}777}
778
618__DEVICE__779__DEVICE__
619inline double fmax(double __x, double __y) { return __ocml_fmax_f64(__x, __y); }780double fmax(double __x, double __y) { return __ocml_fmax_f64(__x, __y); }
781
620__DEVICE__782__DEVICE__
621inline double fmin(double __x, double __y) { return __ocml_fmin_f64(__x, __y); }783double fmin(double __x, double __y) { return __ocml_fmin_f64(__x, __y); }
784
622__DEVICE__785__DEVICE__
623inline double fmod(double __x, double __y) { return __ocml_fmod_f64(__x, __y); }786double fmod(double __x, double __y) { return __ocml_fmod_f64(__x, __y); }
787
624__DEVICE__788__DEVICE__
625inline double frexp(double __x, int *__nptr) {789double frexp(double __x, int *__nptr) {
626 int __tmp;790 int __tmp;
627 double __r =791 double __r =
628 __ocml_frexp_f64(__x, (__attribute__((address_space(5))) int *)&__tmp);792 __ocml_frexp_f64(__x, (__attribute__((address_space(5))) int *)&__tmp);
629 *__nptr = __tmp;793 *__nptr = __tmp;
630
631 return __r;794 return __r;
632}795}
796
633__DEVICE__797__DEVICE__
634inline double hypot(double __x, double __y) {798double hypot(double __x, double __y) { return __ocml_hypot_f64(__x, __y); }
635 return __ocml_hypot_f64(__x, __y);799
636}
637__DEVICE__800__DEVICE__
638inline int ilogb(double __x) { return __ocml_ilogb_f64(__x); }801int ilogb(double __x) { return __ocml_ilogb_f64(__x); }
802
639__DEVICE__803__DEVICE__
640inline __RETURN_TYPE isfinite(double __x) { return __ocml_isfinite_f64(__x); }804__RETURN_TYPE __finite(double __x) { return __ocml_isfinite_f64(__x); }
805
641__DEVICE__806__DEVICE__
642inline __RETURN_TYPE isinf(double __x) { return __ocml_isinf_f64(__x); }807__RETURN_TYPE __isinf(double __x) { return __ocml_isinf_f64(__x); }
808
643__DEVICE__809__DEVICE__
644inline __RETURN_TYPE isnan(double __x) { return __ocml_isnan_f64(__x); }810__RETURN_TYPE __isnan(double __x) { return __ocml_isnan_f64(__x); }
811
645__DEVICE__812__DEVICE__
646inline double j0(double __x) { return __ocml_j0_f64(__x); }813double j0(double __x) { return __ocml_j0_f64(__x); }
814
647__DEVICE__815__DEVICE__
648inline double j1(double __x) { return __ocml_j1_f64(__x); }816double j1(double __x) { return __ocml_j1_f64(__x); }
817
649__DEVICE__818__DEVICE__
650inline double jn(int __n,819double jn(int __n, double __x) { // TODO: we could use Ahmes multiplication
651 double __x) { // TODO: we could use Ahmes multiplication820 // and the Miller & Brown algorithm
652 // and the Miller & Brown algorithm
653 // for linear recurrences to get O(log n) steps, but it's unclear if821 // for linear recurrences to get O(log n) steps, but it's unclear if
654 // it'd be beneficial in this case. Placeholder until OCML adds822 // it'd be beneficial in this case. Placeholder until OCML adds
655 // support.823 // support.
656 if (__n == 0)824 if (__n == 0)
657 return j0f(__x);825 return j0(__x);
658 if (__n == 1)826 if (__n == 1)
659 return j1f(__x);827 return j1(__x);
660828
661 double __x0 = j0f(__x);829 double __x0 = j0(__x);
662 double __x1 = j1f(__x);830 double __x1 = j1(__x);
663 for (int __i = 1; __i < __n; ++__i) {831 for (int __i = 1; __i < __n; ++__i) {
664 double __x2 = (2 * __i) / __x * __x1 - __x0;832 double __x2 = (2 * __i) / __x * __x1 - __x0;
665 __x0 = __x1;833 __x0 = __x1;
666 __x1 = __x2;834 __x1 = __x2;
667 }835 }
668
669 return __x1;836 return __x1;
670}837}
838
671__DEVICE__839__DEVICE__
672inline double ldexp(double __x, int __e) { return __ocml_ldexp_f64(__x, __e); }840double ldexp(double __x, int __e) { return __ocml_ldexp_f64(__x, __e); }
841
673__DEVICE__842__DEVICE__
674inline double lgamma(double __x) { return __ocml_lgamma_f64(__x); }843double lgamma(double __x) { return __ocml_lgamma_f64(__x); }
844
675__DEVICE__845__DEVICE__
676inline long long int llrint(double __x) { return __ocml_rint_f64(__x); }846long long int llrint(double __x) { return __ocml_rint_f64(__x); }
847
677__DEVICE__848__DEVICE__
678inline long long int llround(double __x) { return __ocml_round_f64(__x); }849long long int llround(double __x) { return __ocml_round_f64(__x); }
850
679__DEVICE__851__DEVICE__
680inline double log(double __x) { return __ocml_log_f64(__x); }852double log(double __x) { return __ocml_log_f64(__x); }
853
681__DEVICE__854__DEVICE__
682inline double log10(double __x) { return __ocml_log10_f64(__x); }855double log10(double __x) { return __ocml_log10_f64(__x); }
856
683__DEVICE__857__DEVICE__
684inline double log1p(double __x) { return __ocml_log1p_f64(__x); }858double log1p(double __x) { return __ocml_log1p_f64(__x); }
859
685__DEVICE__860__DEVICE__
686inline double log2(double __x) { return __ocml_log2_f64(__x); }861double log2(double __x) { return __ocml_log2_f64(__x); }
862
687__DEVICE__863__DEVICE__
688inline double logb(double __x) { return __ocml_logb_f64(__x); }864double logb(double __x) { return __ocml_logb_f64(__x); }
865
689__DEVICE__866__DEVICE__
690inline long int lrint(double __x) { return __ocml_rint_f64(__x); }867long int lrint(double __x) { return __ocml_rint_f64(__x); }
868
691__DEVICE__869__DEVICE__
692inline long int lround(double __x) { return __ocml_round_f64(__x); }870long int lround(double __x) { return __ocml_round_f64(__x); }
871
693__DEVICE__872__DEVICE__
694inline double modf(double __x, double *__iptr) {873double modf(double __x, double *__iptr) {
695 double __tmp;874 double __tmp;
696 double __r =875 double __r =
697 __ocml_modf_f64(__x, (__attribute__((address_space(5))) double *)&__tmp);876 __ocml_modf_f64(__x, (__attribute__((address_space(5))) double *)&__tmp);
...@@ -699,8 +878,9 @@ inline double modf(double __x, double *__iptr) {...@@ -699,8 +878,9 @@ inline double modf(double __x, double *__iptr) {
699878
700 return __r;879 return __r;
701}880}
881
702__DEVICE__882__DEVICE__
703inline double nan(const char *__tagp) {883double nan(const char *__tagp) {
704#if !_WIN32884#if !_WIN32
705 union {885 union {
706 double val;886 double val;
...@@ -710,8 +890,8 @@ inline double nan(const char *__tagp) {...@@ -710,8 +890,8 @@ inline double nan(const char *__tagp) {
710 uint32_t exponent : 11;890 uint32_t exponent : 11;
711 uint32_t sign : 1;891 uint32_t sign : 1;
712 } bits;892 } bits;
713 static_assert(sizeof(double) == sizeof(ieee_double), "");
714 } __tmp;893 } __tmp;
894 __static_assert_type_size_equal(sizeof(__tmp.val), sizeof(__tmp.bits));
715895
716 __tmp.bits.sign = 0u;896 __tmp.bits.sign = 0u;
717 __tmp.bits.exponent = ~0u;897 __tmp.bits.exponent = ~0u;
...@@ -720,22 +900,24 @@ inline double nan(const char *__tagp) {...@@ -720,22 +900,24 @@ inline double nan(const char *__tagp) {
720900
721 return __tmp.val;901 return __tmp.val;
722#else902#else
723 static_assert(sizeof(uint64_t) == sizeof(double));903 __static_assert_type_size_equal(sizeof(uint64_t), sizeof(double));
724 uint64_t val = __make_mantissa(__tagp);904 uint64_t __val = __make_mantissa(__tagp);
725 val |= 0xFFF << 51;905 __val |= 0xFFF << 51;
726 return *reinterpret_cast<double *>(&val);906 return *reinterpret_cast<double *>(&__val);
727#endif907#endif
728}908}
909
729__DEVICE__910__DEVICE__
730inline double nearbyint(double __x) { return __ocml_nearbyint_f64(__x); }911double nearbyint(double __x) { return __ocml_nearbyint_f64(__x); }
912
731__DEVICE__913__DEVICE__
732inline double nextafter(double __x, double __y) {914double nextafter(double __x, double __y) {
733 return __ocml_nextafter_f64(__x, __y);915 return __ocml_nextafter_f64(__x, __y);
734}916}
917
735__DEVICE__918__DEVICE__
736inline double919double norm(int __dim,
737norm(int __dim,920 const double *__a) { // TODO: placeholder until OCML adds support.
738 const double *__a) { // TODO: placeholder until OCML adds support.
739 double __r = 0;921 double __r = 0;
740 while (__dim--) {922 while (__dim--) {
741 __r += __a[0] * __a[0];923 __r += __a[0] * __a[0];
...@@ -744,28 +926,39 @@ norm(int __dim,...@@ -744,28 +926,39 @@ norm(int __dim,
744926
745 return __ocml_sqrt_f64(__r);927 return __ocml_sqrt_f64(__r);
746}928}
929
747__DEVICE__930__DEVICE__
748inline double norm3d(double __x, double __y, double __z) {931double norm3d(double __x, double __y, double __z) {
749 return __ocml_len3_f64(__x, __y, __z);932 return __ocml_len3_f64(__x, __y, __z);
750}933}
934
751__DEVICE__935__DEVICE__
752inline double norm4d(double __x, double __y, double __z, double __w) {936double norm4d(double __x, double __y, double __z, double __w) {
753 return __ocml_len4_f64(__x, __y, __z, __w);937 return __ocml_len4_f64(__x, __y, __z, __w);
754}938}
939
940__DEVICE__
941double normcdf(double __x) { return __ocml_ncdf_f64(__x); }
942
755__DEVICE__943__DEVICE__
756inline double normcdf(double __x) { return __ocml_ncdf_f64(__x); }944double normcdfinv(double __x) { return __ocml_ncdfinv_f64(__x); }
945
757__DEVICE__946__DEVICE__
758inline double normcdfinv(double __x) { return __ocml_ncdfinv_f64(__x); }947double pow(double __x, double __y) { return __ocml_pow_f64(__x, __y); }
948
759__DEVICE__949__DEVICE__
760inline double pow(double __x, double __y) { return __ocml_pow_f64(__x, __y); }950double powi(double __x, int __y) { return __ocml_pown_f64(__x, __y); }
951
761__DEVICE__952__DEVICE__
762inline double rcbrt(double __x) { return __ocml_rcbrt_f64(__x); }953double rcbrt(double __x) { return __ocml_rcbrt_f64(__x); }
954
763__DEVICE__955__DEVICE__
764inline double remainder(double __x, double __y) {956double remainder(double __x, double __y) {
765 return __ocml_remainder_f64(__x, __y);957 return __ocml_remainder_f64(__x, __y);
766}958}
959
767__DEVICE__960__DEVICE__
768inline double remquo(double __x, double __y, int *__quo) {961double remquo(double __x, double __y, int *__quo) {
769 int __tmp;962 int __tmp;
770 double __r = __ocml_remquo_f64(963 double __r = __ocml_remquo_f64(
771 __x, __y, (__attribute__((address_space(5))) int *)&__tmp);964 __x, __y, (__attribute__((address_space(5))) int *)&__tmp);
...@@ -773,16 +966,16 @@ inline double remquo(double __x, double __y, int *__quo) {...@@ -773,16 +966,16 @@ inline double remquo(double __x, double __y, int *__quo) {
773966
774 return __r;967 return __r;
775}968}
969
776__DEVICE__970__DEVICE__
777inline double rhypot(double __x, double __y) {971double rhypot(double __x, double __y) { return __ocml_rhypot_f64(__x, __y); }
778 return __ocml_rhypot_f64(__x, __y);972
779}
780__DEVICE__973__DEVICE__
781inline double rint(double __x) { return __ocml_rint_f64(__x); }974double rint(double __x) { return __ocml_rint_f64(__x); }
975
782__DEVICE__976__DEVICE__
783inline double977double rnorm(int __dim,
784rnorm(int __dim,978 const double *__a) { // TODO: placeholder until OCML adds support.
785 const double *__a) { // TODO: placeholder until OCML adds support.
786 double __r = 0;979 double __r = 0;
787 while (__dim--) {980 while (__dim--) {
788 __r += __a[0] * __a[0];981 __r += __a[0] * __a[0];
...@@ -791,77 +984,93 @@ rnorm(int __dim,...@@ -791,77 +984,93 @@ rnorm(int __dim,
791984
792 return __ocml_rsqrt_f64(__r);985 return __ocml_rsqrt_f64(__r);
793}986}
987
794__DEVICE__988__DEVICE__
795inline double rnorm3d(double __x, double __y, double __z) {989double rnorm3d(double __x, double __y, double __z) {
796 return __ocml_rlen3_f64(__x, __y, __z);990 return __ocml_rlen3_f64(__x, __y, __z);
797}991}
992
798__DEVICE__993__DEVICE__
799inline double rnorm4d(double __x, double __y, double __z, double __w) {994double rnorm4d(double __x, double __y, double __z, double __w) {
800 return __ocml_rlen4_f64(__x, __y, __z, __w);995 return __ocml_rlen4_f64(__x, __y, __z, __w);
801}996}
997
802__DEVICE__998__DEVICE__
803inline double round(double __x) { return __ocml_round_f64(__x); }999double round(double __x) { return __ocml_round_f64(__x); }
1000
804__DEVICE__1001__DEVICE__
805inline double rsqrt(double __x) { return __ocml_rsqrt_f64(__x); }1002double rsqrt(double __x) { return __ocml_rsqrt_f64(__x); }
1003
806__DEVICE__1004__DEVICE__
807inline double scalbln(double __x, long int __n) {1005double scalbln(double __x, long int __n) {
808 return (__n < INT_MAX) ? __ocml_scalbn_f64(__x, __n)1006 return (__n < INT_MAX) ? __ocml_scalbn_f64(__x, __n)
809 : __ocml_scalb_f64(__x, __n);1007 : __ocml_scalb_f64(__x, __n);
810}1008}
811__DEVICE__1009__DEVICE__
812inline double scalbn(double __x, int __n) {1010double scalbn(double __x, int __n) { return __ocml_scalbn_f64(__x, __n); }
813 return __ocml_scalbn_f64(__x, __n);1011
814}
815__DEVICE__1012__DEVICE__
816inline __RETURN_TYPE signbit(double __x) { return __ocml_signbit_f64(__x); }1013__RETURN_TYPE __signbit(double __x) { return __ocml_signbit_f64(__x); }
1014
817__DEVICE__1015__DEVICE__
818inline double sin(double __x) { return __ocml_sin_f64(__x); }1016double sin(double __x) { return __ocml_sin_f64(__x); }
1017
819__DEVICE__1018__DEVICE__
820inline void sincos(double __x, double *__sinptr, double *__cosptr) {1019void sincos(double __x, double *__sinptr, double *__cosptr) {
821 double __tmp;1020 double __tmp;
822 *__sinptr = __ocml_sincos_f64(1021 *__sinptr = __ocml_sincos_f64(
823 __x, (__attribute__((address_space(5))) double *)&__tmp);1022 __x, (__attribute__((address_space(5))) double *)&__tmp);
824 *__cosptr = __tmp;1023 *__cosptr = __tmp;
825}1024}
1025
826__DEVICE__1026__DEVICE__
827inline void sincospi(double __x, double *__sinptr, double *__cosptr) {1027void sincospi(double __x, double *__sinptr, double *__cosptr) {
828 double __tmp;1028 double __tmp;
829 *__sinptr = __ocml_sincospi_f64(1029 *__sinptr = __ocml_sincospi_f64(
830 __x, (__attribute__((address_space(5))) double *)&__tmp);1030 __x, (__attribute__((address_space(5))) double *)&__tmp);
831 *__cosptr = __tmp;1031 *__cosptr = __tmp;
832}1032}
1033
833__DEVICE__1034__DEVICE__
834inline double sinh(double __x) { return __ocml_sinh_f64(__x); }1035double sinh(double __x) { return __ocml_sinh_f64(__x); }
1036
835__DEVICE__1037__DEVICE__
836inline double sinpi(double __x) { return __ocml_sinpi_f64(__x); }1038double sinpi(double __x) { return __ocml_sinpi_f64(__x); }
1039
837__DEVICE__1040__DEVICE__
838inline double sqrt(double __x) { return __ocml_sqrt_f64(__x); }1041double sqrt(double __x) { return __ocml_sqrt_f64(__x); }
1042
839__DEVICE__1043__DEVICE__
840inline double tan(double __x) { return __ocml_tan_f64(__x); }1044double tan(double __x) { return __ocml_tan_f64(__x); }
1045
841__DEVICE__1046__DEVICE__
842inline double tanh(double __x) { return __ocml_tanh_f64(__x); }1047double tanh(double __x) { return __ocml_tanh_f64(__x); }
1048
843__DEVICE__1049__DEVICE__
844inline double tgamma(double __x) { return __ocml_tgamma_f64(__x); }1050double tgamma(double __x) { return __ocml_tgamma_f64(__x); }
1051
845__DEVICE__1052__DEVICE__
846inline double trunc(double __x) { return __ocml_trunc_f64(__x); }1053double trunc(double __x) { return __ocml_trunc_f64(__x); }
1054
847__DEVICE__1055__DEVICE__
848inline double y0(double __x) { return __ocml_y0_f64(__x); }1056double y0(double __x) { return __ocml_y0_f64(__x); }
1057
849__DEVICE__1058__DEVICE__
850inline double y1(double __x) { return __ocml_y1_f64(__x); }1059double y1(double __x) { return __ocml_y1_f64(__x); }
1060
851__DEVICE__1061__DEVICE__
852inline double yn(int __n,1062double yn(int __n, double __x) { // TODO: we could use Ahmes multiplication
853 double __x) { // TODO: we could use Ahmes multiplication1063 // and the Miller & Brown algorithm
854 // and the Miller & Brown algorithm
855 // for linear recurrences to get O(log n) steps, but it's unclear if1064 // for linear recurrences to get O(log n) steps, but it's unclear if
856 // it'd be beneficial in this case. Placeholder until OCML adds1065 // it'd be beneficial in this case. Placeholder until OCML adds
857 // support.1066 // support.
858 if (__n == 0)1067 if (__n == 0)
859 return j0f(__x);1068 return y0(__x);
860 if (__n == 1)1069 if (__n == 1)
861 return j1f(__x);1070 return y1(__x);
8621071
863 double __x0 = j0f(__x);1072 double __x0 = y0(__x);
864 double __x1 = j1f(__x);1073 double __x1 = y1(__x);
865 for (int __i = 1; __i < __n; ++__i) {1074 for (int __i = 1; __i < __n; ++__i) {
866 double __x2 = (2 * __i) / __x * __x1 - __x0;1075 double __x2 = (2 * __i) / __x * __x1 - __x0;
867 __x0 = __x1;1076 __x0 = __x1;
...@@ -874,296 +1083,182 @@ inline double yn(int __n,...@@ -874,296 +1083,182 @@ inline double yn(int __n,
874// BEGIN INTRINSICS1083// BEGIN INTRINSICS
875#if defined OCML_BASIC_ROUNDED_OPERATIONS1084#if defined OCML_BASIC_ROUNDED_OPERATIONS
876__DEVICE__1085__DEVICE__
877inline double __dadd_rd(double __x, double __y) {1086double __dadd_rd(double __x, double __y) {
878 return __ocml_add_rtn_f64(__x, __y);1087 return __ocml_add_rtn_f64(__x, __y);
879}1088}
880#endif
881__DEVICE__1089__DEVICE__
882inline double __dadd_rn(double __x, double __y) { return __x + __y; }1090double __dadd_rn(double __x, double __y) {
883#if defined OCML_BASIC_ROUNDED_OPERATIONS1091 return __ocml_add_rte_f64(__x, __y);
1092}
884__DEVICE__1093__DEVICE__
885inline double __dadd_ru(double __x, double __y) {1094double __dadd_ru(double __x, double __y) {
886 return __ocml_add_rtp_f64(__x, __y);1095 return __ocml_add_rtp_f64(__x, __y);
887}1096}
888__DEVICE__1097__DEVICE__
889inline double __dadd_rz(double __x, double __y) {1098double __dadd_rz(double __x, double __y) {
890 return __ocml_add_rtz_f64(__x, __y);1099 return __ocml_add_rtz_f64(__x, __y);
891}1100}
1101#else
892__DEVICE__1102__DEVICE__
893inline double __ddiv_rd(double __x, double __y) {1103double __dadd_rn(double __x, double __y) { return __x + __y; }
1104#endif
1105
1106#if defined OCML_BASIC_ROUNDED_OPERATIONS
1107__DEVICE__
1108double __ddiv_rd(double __x, double __y) {
894 return __ocml_div_rtn_f64(__x, __y);1109 return __ocml_div_rtn_f64(__x, __y);
895}1110}
896#endif
897__DEVICE__1111__DEVICE__
898inline double __ddiv_rn(double __x, double __y) { return __x / __y; }1112double __ddiv_rn(double __x, double __y) {
899#if defined OCML_BASIC_ROUNDED_OPERATIONS1113 return __ocml_div_rte_f64(__x, __y);
1114}
900__DEVICE__1115__DEVICE__
901inline double __ddiv_ru(double __x, double __y) {1116double __ddiv_ru(double __x, double __y) {
902 return __ocml_div_rtp_f64(__x, __y);1117 return __ocml_div_rtp_f64(__x, __y);
903}1118}
904__DEVICE__1119__DEVICE__
905inline double __ddiv_rz(double __x, double __y) {1120double __ddiv_rz(double __x, double __y) {
906 return __ocml_div_rtz_f64(__x, __y);1121 return __ocml_div_rtz_f64(__x, __y);
907}1122}
1123#else
1124__DEVICE__
1125double __ddiv_rn(double __x, double __y) { return __x / __y; }
1126#endif
1127
1128#if defined OCML_BASIC_ROUNDED_OPERATIONS
908__DEVICE__1129__DEVICE__
909inline double __dmul_rd(double __x, double __y) {1130double __dmul_rd(double __x, double __y) {
910 return __ocml_mul_rtn_f64(__x, __y);1131 return __ocml_mul_rtn_f64(__x, __y);
911}1132}
912#endif
913__DEVICE__1133__DEVICE__
914inline double __dmul_rn(double __x, double __y) { return __x * __y; }1134double __dmul_rn(double __x, double __y) {
915#if defined OCML_BASIC_ROUNDED_OPERATIONS1135 return __ocml_mul_rte_f64(__x, __y);
1136}
916__DEVICE__1137__DEVICE__
917inline double __dmul_ru(double __x, double __y) {1138double __dmul_ru(double __x, double __y) {
918 return __ocml_mul_rtp_f64(__x, __y);1139 return __ocml_mul_rtp_f64(__x, __y);
919}1140}
920__DEVICE__1141__DEVICE__
921inline double __dmul_rz(double __x, double __y) {1142double __dmul_rz(double __x, double __y) {
922 return __ocml_mul_rtz_f64(__x, __y);1143 return __ocml_mul_rtz_f64(__x, __y);
923}1144}
1145#else
924__DEVICE__1146__DEVICE__
925inline double __drcp_rd(double __x) { return __llvm_amdgcn_rcp_f64(__x); }1147double __dmul_rn(double __x, double __y) { return __x * __y; }
926#endif1148#endif
927__DEVICE__1149
928inline double __drcp_rn(double __x) { return __llvm_amdgcn_rcp_f64(__x); }
929#if defined OCML_BASIC_ROUNDED_OPERATIONS1150#if defined OCML_BASIC_ROUNDED_OPERATIONS
930__DEVICE__1151__DEVICE__
931inline double __drcp_ru(double __x) { return __llvm_amdgcn_rcp_f64(__x); }1152double __drcp_rd(double __x) { return __ocml_div_rtn_f64(1.0, __x); }
932__DEVICE__1153__DEVICE__
933inline double __drcp_rz(double __x) { return __llvm_amdgcn_rcp_f64(__x); }1154double __drcp_rn(double __x) { return __ocml_div_rte_f64(1.0, __x); }
934__DEVICE__1155__DEVICE__
935inline double __dsqrt_rd(double __x) { return __ocml_sqrt_rtn_f64(__x); }1156double __drcp_ru(double __x) { return __ocml_div_rtp_f64(1.0, __x); }
936#endif
937__DEVICE__1157__DEVICE__
938inline double __dsqrt_rn(double __x) { return __ocml_sqrt_f64(__x); }1158double __drcp_rz(double __x) { return __ocml_div_rtz_f64(1.0, __x); }
1159#else
1160__DEVICE__
1161double __drcp_rn(double __x) { return 1.0 / __x; }
1162#endif
1163
939#if defined OCML_BASIC_ROUNDED_OPERATIONS1164#if defined OCML_BASIC_ROUNDED_OPERATIONS
940__DEVICE__1165__DEVICE__
941inline double __dsqrt_ru(double __x) { return __ocml_sqrt_rtp_f64(__x); }1166double __dsqrt_rd(double __x) { return __ocml_sqrt_rtn_f64(__x); }
1167__DEVICE__
1168double __dsqrt_rn(double __x) { return __ocml_sqrt_rte_f64(__x); }
1169__DEVICE__
1170double __dsqrt_ru(double __x) { return __ocml_sqrt_rtp_f64(__x); }
942__DEVICE__1171__DEVICE__
943inline double __dsqrt_rz(double __x) { return __ocml_sqrt_rtz_f64(__x); }1172double __dsqrt_rz(double __x) { return __ocml_sqrt_rtz_f64(__x); }
1173#else
1174__DEVICE__
1175double __dsqrt_rn(double __x) { return __ocml_sqrt_f64(__x); }
1176#endif
1177
1178#if defined OCML_BASIC_ROUNDED_OPERATIONS
944__DEVICE__1179__DEVICE__
945inline double __dsub_rd(double __x, double __y) {1180double __dsub_rd(double __x, double __y) {
946 return __ocml_sub_rtn_f64(__x, __y);1181 return __ocml_sub_rtn_f64(__x, __y);
947}1182}
948#endif
949__DEVICE__1183__DEVICE__
950inline double __dsub_rn(double __x, double __y) { return __x - __y; }1184double __dsub_rn(double __x, double __y) {
951#if defined OCML_BASIC_ROUNDED_OPERATIONS1185 return __ocml_sub_rte_f64(__x, __y);
1186}
952__DEVICE__1187__DEVICE__
953inline double __dsub_ru(double __x, double __y) {1188double __dsub_ru(double __x, double __y) {
954 return __ocml_sub_rtp_f64(__x, __y);1189 return __ocml_sub_rtp_f64(__x, __y);
955}1190}
956__DEVICE__1191__DEVICE__
957inline double __dsub_rz(double __x, double __y) {1192double __dsub_rz(double __x, double __y) {
958 return __ocml_sub_rtz_f64(__x, __y);1193 return __ocml_sub_rtz_f64(__x, __y);
959}1194}
1195#else
1196__DEVICE__
1197double __dsub_rn(double __x, double __y) { return __x - __y; }
1198#endif
1199
1200#if defined OCML_BASIC_ROUNDED_OPERATIONS
960__DEVICE__1201__DEVICE__
961inline double __fma_rd(double __x, double __y, double __z) {1202double __fma_rd(double __x, double __y, double __z) {
962 return __ocml_fma_rtn_f64(__x, __y, __z);1203 return __ocml_fma_rtn_f64(__x, __y, __z);
963}1204}
964#endif
965__DEVICE__1205__DEVICE__
966inline double __fma_rn(double __x, double __y, double __z) {1206double __fma_rn(double __x, double __y, double __z) {
967 return __ocml_fma_f64(__x, __y, __z);1207 return __ocml_fma_rte_f64(__x, __y, __z);
968}1208}
969#if defined OCML_BASIC_ROUNDED_OPERATIONS
970__DEVICE__1209__DEVICE__
971inline double __fma_ru(double __x, double __y, double __z) {1210double __fma_ru(double __x, double __y, double __z) {
972 return __ocml_fma_rtp_f64(__x, __y, __z);1211 return __ocml_fma_rtp_f64(__x, __y, __z);
973}1212}
974__DEVICE__1213__DEVICE__
975inline double __fma_rz(double __x, double __y, double __z) {1214double __fma_rz(double __x, double __y, double __z) {
976 return __ocml_fma_rtz_f64(__x, __y, __z);1215 return __ocml_fma_rtz_f64(__x, __y, __z);
977}1216}
1217#else
1218__DEVICE__
1219double __fma_rn(double __x, double __y, double __z) {
1220 return __ocml_fma_f64(__x, __y, __z);
1221}
978#endif1222#endif
979// END INTRINSICS1223// END INTRINSICS
980// END DOUBLE1224// END DOUBLE
9811225
982// BEGIN INTEGER1226// C only macros
983__DEVICE__1227#if !defined(__cplusplus) && __STDC_VERSION__ >= 201112L
984inline int abs(int __x) {1228#define isfinite(__x) _Generic((__x), float : __finitef, double : __finite)(__x)
985 int __sgn = __x >> (sizeof(int) * CHAR_BIT - 1);1229#define isinf(__x) _Generic((__x), float : __isinff, double : __isinf)(__x)
986 return (__x ^ __sgn) - __sgn;1230#define isnan(__x) _Generic((__x), float : __isnanf, double : __isnan)(__x)
987}1231#define signbit(__x) \
988__DEVICE__1232 _Generic((__x), float : __signbitf, double : __signbit)(__x)
989inline long labs(long __x) {1233#endif // !defined(__cplusplus) && __STDC_VERSION__ >= 201112L
990 long __sgn = __x >> (sizeof(long) * CHAR_BIT - 1);
991 return (__x ^ __sgn) - __sgn;
992}
993__DEVICE__
994inline long long llabs(long long __x) {
995 long long __sgn = __x >> (sizeof(long long) * CHAR_BIT - 1);
996 return (__x ^ __sgn) - __sgn;
997}
9981234
999#if defined(__cplusplus)1235#if defined(__cplusplus)
1000__DEVICE__1236template <class T> __DEVICE__ T min(T __arg1, T __arg2) {
1001inline long abs(long __x) { return labs(__x); }
1002__DEVICE__
1003inline long long abs(long long __x) { return llabs(__x); }
1004#endif
1005// END INTEGER
1006
1007__DEVICE__
1008inline _Float16 fma(_Float16 __x, _Float16 __y, _Float16 __z) {
1009 return __ocml_fma_f16(__x, __y, __z);
1010}
1011
1012__DEVICE__
1013inline float fma(float __x, float __y, float __z) {
1014 return fmaf(__x, __y, __z);
1015}
1016
1017#pragma push_macro("__DEF_FUN1")
1018#pragma push_macro("__DEF_FUN2")
1019#pragma push_macro("__DEF_FUNI")
1020#pragma push_macro("__DEF_FLOAT_FUN2I")
1021#pragma push_macro("__HIP_OVERLOAD1")
1022#pragma push_macro("__HIP_OVERLOAD2")
1023
1024// __hip_enable_if::type is a type function which returns __T if __B is true.
1025template <bool __B, class __T = void> struct __hip_enable_if {};
1026
1027template <class __T> struct __hip_enable_if<true, __T> { typedef __T type; };
1028
1029// __HIP_OVERLOAD1 is used to resolve function calls with integer argument to
1030// avoid compilation error due to ambibuity. e.g. floor(5) is resolved with
1031// floor(double).
1032#define __HIP_OVERLOAD1(__retty, __fn) \
1033 template <typename __T> \
1034 __DEVICE__ typename __hip_enable_if<std::numeric_limits<__T>::is_integer, \
1035 __retty>::type \
1036 __fn(__T __x) { \
1037 return ::__fn((double)__x); \
1038 }
1039
1040// __HIP_OVERLOAD2 is used to resolve function calls with mixed float/double
1041// or integer argument to avoid compilation error due to ambibuity. e.g.
1042// max(5.0f, 6.0) is resolved with max(double, double).
1043#define __HIP_OVERLOAD2(__retty, __fn) \
1044 template <typename __T1, typename __T2> \
1045 __DEVICE__ \
1046 typename __hip_enable_if<std::numeric_limits<__T1>::is_specialized && \
1047 std::numeric_limits<__T2>::is_specialized, \
1048 __retty>::type \
1049 __fn(__T1 __x, __T2 __y) { \
1050 return __fn((double)__x, (double)__y); \
1051 }
1052
1053// Define cmath functions with float argument and returns float.
1054#define __DEF_FUN1(__retty, __func) \
1055 __DEVICE__ \
1056 inline float __func(float __x) { return __func##f(__x); } \
1057 __HIP_OVERLOAD1(__retty, __func)
1058
1059// Define cmath functions with float argument and returns __retty.
1060#define __DEF_FUNI(__retty, __func) \
1061 __DEVICE__ \
1062 inline __retty __func(float __x) { return __func##f(__x); } \
1063 __HIP_OVERLOAD1(__retty, __func)
1064
1065// define cmath functions with two float arguments.
1066#define __DEF_FUN2(__retty, __func) \
1067 __DEVICE__ \
1068 inline float __func(float __x, float __y) { return __func##f(__x, __y); } \
1069 __HIP_OVERLOAD2(__retty, __func)
1070
1071__DEF_FUN1(double, acos)
1072__DEF_FUN1(double, acosh)
1073__DEF_FUN1(double, asin)
1074__DEF_FUN1(double, asinh)
1075__DEF_FUN1(double, atan)
1076__DEF_FUN2(double, atan2);
1077__DEF_FUN1(double, atanh)
1078__DEF_FUN1(double, cbrt)
1079__DEF_FUN1(double, ceil)
1080__DEF_FUN2(double, copysign);
1081__DEF_FUN1(double, cos)
1082__DEF_FUN1(double, cosh)
1083__DEF_FUN1(double, erf)
1084__DEF_FUN1(double, erfc)
1085__DEF_FUN1(double, exp)
1086__DEF_FUN1(double, exp2)
1087__DEF_FUN1(double, expm1)
1088__DEF_FUN1(double, fabs)
1089__DEF_FUN2(double, fdim);
1090__DEF_FUN1(double, floor)
1091__DEF_FUN2(double, fmax);
1092__DEF_FUN2(double, fmin);
1093__DEF_FUN2(double, fmod);
1094//__HIP_OVERLOAD1(int, fpclassify)
1095__DEF_FUN2(double, hypot);
1096__DEF_FUNI(int, ilogb)
1097__HIP_OVERLOAD1(bool, isfinite)
1098__HIP_OVERLOAD2(bool, isgreater);
1099__HIP_OVERLOAD2(bool, isgreaterequal);
1100__HIP_OVERLOAD1(bool, isinf);
1101__HIP_OVERLOAD2(bool, isless);
1102__HIP_OVERLOAD2(bool, islessequal);
1103__HIP_OVERLOAD2(bool, islessgreater);
1104__HIP_OVERLOAD1(bool, isnan);
1105//__HIP_OVERLOAD1(bool, isnormal)
1106__HIP_OVERLOAD2(bool, isunordered);
1107__DEF_FUN1(double, lgamma)
1108__DEF_FUN1(double, log)
1109__DEF_FUN1(double, log10)
1110__DEF_FUN1(double, log1p)
1111__DEF_FUN1(double, log2)
1112__DEF_FUN1(double, logb)
1113__DEF_FUNI(long long, llrint)
1114__DEF_FUNI(long long, llround)
1115__DEF_FUNI(long, lrint)
1116__DEF_FUNI(long, lround)
1117__DEF_FUN1(double, nearbyint);
1118__DEF_FUN2(double, nextafter);
1119__DEF_FUN2(double, pow);
1120__DEF_FUN2(double, remainder);
1121__DEF_FUN1(double, rint);
1122__DEF_FUN1(double, round);
1123__HIP_OVERLOAD1(bool, signbit)
1124__DEF_FUN1(double, sin)
1125__DEF_FUN1(double, sinh)
1126__DEF_FUN1(double, sqrt)
1127__DEF_FUN1(double, tan)
1128__DEF_FUN1(double, tanh)
1129__DEF_FUN1(double, tgamma)
1130__DEF_FUN1(double, trunc);
1131
1132// define cmath functions with a float and an integer argument.
1133#define __DEF_FLOAT_FUN2I(__func) \
1134 __DEVICE__ \
1135 inline float __func(float __x, int __y) { return __func##f(__x, __y); }
1136__DEF_FLOAT_FUN2I(scalbn)
1137
1138template <class T> __DEVICE__ inline T min(T __arg1, T __arg2) {
1139 return (__arg1 < __arg2) ? __arg1 : __arg2;1237 return (__arg1 < __arg2) ? __arg1 : __arg2;
1140}1238}
11411239
1142template <class T> __DEVICE__ inline T max(T __arg1, T __arg2) {1240template <class T> __DEVICE__ T max(T __arg1, T __arg2) {
1143 return (__arg1 > __arg2) ? __arg1 : __arg2;1241 return (__arg1 > __arg2) ? __arg1 : __arg2;
1144}1242}
11451243
1146__DEVICE__ inline int min(int __arg1, int __arg2) {1244__DEVICE__ int min(int __arg1, int __arg2) {
1147 return (__arg1 < __arg2) ? __arg1 : __arg2;1245 return (__arg1 < __arg2) ? __arg1 : __arg2;
1148}1246}
1149__DEVICE__ inline int max(int __arg1, int __arg2) {1247__DEVICE__ int max(int __arg1, int __arg2) {
1150 return (__arg1 > __arg2) ? __arg1 : __arg2;1248 return (__arg1 > __arg2) ? __arg1 : __arg2;
1151}1249}
11521250
1153__DEVICE__1251__DEVICE__
1154inline float max(float __x, float __y) { return fmaxf(__x, __y); }1252float max(float __x, float __y) { return fmaxf(__x, __y); }
11551253
1156__DEVICE__1254__DEVICE__
1157inline double max(double __x, double __y) { return fmax(__x, __y); }1255double max(double __x, double __y) { return fmax(__x, __y); }
11581256
1159__DEVICE__1257__DEVICE__
1160inline float min(float __x, float __y) { return fminf(__x, __y); }1258float min(float __x, float __y) { return fminf(__x, __y); }
11611259
1162__DEVICE__1260__DEVICE__
1163inline double min(double __x, double __y) { return fmin(__x, __y); }1261double min(double __x, double __y) { return fmin(__x, __y); }
1164
1165__HIP_OVERLOAD2(double, max)
1166__HIP_OVERLOAD2(double, min)
11671262
1168__host__ inline static int min(int __arg1, int __arg2) {1263__host__ inline static int min(int __arg1, int __arg2) {
1169 return std::min(__arg1, __arg2);1264 return std::min(__arg1, __arg2);
...@@ -1172,13 +1267,8 @@ __host__ inline static int min(int __arg1, int __arg2) {...@@ -1172,13 +1267,8 @@ __host__ inline static int min(int __arg1, int __arg2) {
1172__host__ inline static int max(int __arg1, int __arg2) {1267__host__ inline static int max(int __arg1, int __arg2) {
1173 return std::max(__arg1, __arg2);1268 return std::max(__arg1, __arg2);
1174}1269}
1270#endif
11751271
1176#pragma pop_macro("__DEF_FUN1")
1177#pragma pop_macro("__DEF_FUN2")
1178#pragma pop_macro("__DEF_FUNI")
1179#pragma pop_macro("__DEF_FLOAT_FUN2I")
1180#pragma pop_macro("__HIP_OVERLOAD1")
1181#pragma pop_macro("__HIP_OVERLOAD2")
1182#pragma pop_macro("__DEVICE__")1272#pragma pop_macro("__DEVICE__")
1183#pragma pop_macro("__RETURN_TYPE")1273#pragma pop_macro("__RETURN_TYPE")
11841274
lib/include/__clang_hip_runtime_wrapper.h+5
...@@ -28,6 +28,10 @@...@@ -28,6 +28,10 @@
28#define __shared__ __attribute__((shared))28#define __shared__ __attribute__((shared))
29#define __constant__ __attribute__((constant))29#define __constant__ __attribute__((constant))
3030
31#if !defined(__cplusplus) || __cplusplus < 201103L
32 #define nullptr NULL;
33#endif
34
31#if __HIP_ENABLE_DEVICE_MALLOC__35#if __HIP_ENABLE_DEVICE_MALLOC__
32extern "C" __device__ void *__hip_malloc(size_t __size);36extern "C" __device__ void *__hip_malloc(size_t __size);
33extern "C" __device__ void *__hip_free(void *__ptr);37extern "C" __device__ void *__hip_free(void *__ptr);
...@@ -51,6 +55,7 @@ static inline __device__ void *free(void *__ptr) {...@@ -51,6 +55,7 @@ static inline __device__ void *free(void *__ptr) {
5155
52#if !_OPENMP || __HIP_ENABLE_CUDA_WRAPPER_FOR_OPENMP__56#if !_OPENMP || __HIP_ENABLE_CUDA_WRAPPER_FOR_OPENMP__
53#include <__clang_cuda_math_forward_declares.h>57#include <__clang_cuda_math_forward_declares.h>
58#include <__clang_hip_cmath.h>
54#include <__clang_cuda_complex_builtins.h>59#include <__clang_cuda_complex_builtins.h>
5560
56#include <algorithm>61#include <algorithm>
lib/include/altivec.h+1143-72
...@@ -1709,6 +1709,20 @@ vec_cmpeq(vector double __a, vector double __b) {...@@ -1709,6 +1709,20 @@ vec_cmpeq(vector double __a, vector double __b) {
1709}1709}
1710#endif1710#endif
17111711
1712#ifdef __POWER10_VECTOR__
1713static __inline__ vector bool __int128 __ATTRS_o_ai
1714vec_cmpeq(vector signed __int128 __a, vector signed __int128 __b) {
1715 return (vector bool __int128)__builtin_altivec_vcmpequq(
1716 (vector bool __int128)__a, (vector bool __int128)__b);
1717}
1718
1719static __inline__ vector bool __int128 __ATTRS_o_ai
1720vec_cmpeq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
1721 return (vector bool __int128)__builtin_altivec_vcmpequq(
1722 (vector bool __int128)__a, (vector bool __int128)__b);
1723}
1724#endif
1725
1712#ifdef __POWER9_VECTOR__1726#ifdef __POWER9_VECTOR__
1713/* vec_cmpne */1727/* vec_cmpne */
17141728
...@@ -1766,35 +1780,25 @@ vec_cmpne(vector unsigned int __a, vector unsigned int __b) {...@@ -1766,35 +1780,25 @@ vec_cmpne(vector unsigned int __a, vector unsigned int __b) {
1766 (vector int)__b);1780 (vector int)__b);
1767}1781}
17681782
1769static __inline__ vector bool long long __ATTRS_o_ai
1770vec_cmpne(vector bool long long __a, vector bool long long __b) {
1771 return (vector bool long long)
1772 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1773}
1774
1775static __inline__ vector bool long long __ATTRS_o_ai
1776vec_cmpne(vector signed long long __a, vector signed long long __b) {
1777 return (vector bool long long)
1778 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1779}
1780
1781static __inline__ vector bool long long __ATTRS_o_ai
1782vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
1783 return (vector bool long long)
1784 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1785}
1786
1787static __inline__ vector bool int __ATTRS_o_ai1783static __inline__ vector bool int __ATTRS_o_ai
1788vec_cmpne(vector float __a, vector float __b) {1784vec_cmpne(vector float __a, vector float __b) {
1789 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,1785 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1790 (vector int)__b);1786 (vector int)__b);
1791}1787}
17921788
1793static __inline__ vector bool long long __ATTRS_o_ai1789#ifdef __POWER10_VECTOR__
1794vec_cmpne(vector double __a, vector double __b) {1790static __inline__ vector bool __int128 __ATTRS_o_ai
1795 return (vector bool long long)1791vec_cmpne(vector unsigned __int128 __a, vector unsigned __int128 __b) {
1796 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));1792 return (vector bool __int128) ~(__builtin_altivec_vcmpequq(
1793 (vector bool __int128)__a, (vector bool __int128)__b));
1794}
1795
1796static __inline__ vector bool __int128 __ATTRS_o_ai
1797vec_cmpne(vector signed __int128 __a, vector signed __int128 __b) {
1798 return (vector bool __int128) ~(__builtin_altivec_vcmpequq(
1799 (vector bool __int128)__a, (vector bool __int128)__b));
1797}1800}
1801#endif
17981802
1799/* vec_cmpnez */1803/* vec_cmpnez */
18001804
...@@ -1900,6 +1904,86 @@ vec_parity_lsbb(vector signed long long __a) {...@@ -1900,6 +1904,86 @@ vec_parity_lsbb(vector signed long long __a) {
1900 return __builtin_altivec_vprtybd(__a);1904 return __builtin_altivec_vprtybd(__a);
1901}1905}
19021906
1907#else
1908/* vec_cmpne */
1909
1910static __inline__ vector bool char __ATTRS_o_ai
1911vec_cmpne(vector bool char __a, vector bool char __b) {
1912 return ~(vec_cmpeq(__a, __b));
1913}
1914
1915static __inline__ vector bool char __ATTRS_o_ai
1916vec_cmpne(vector signed char __a, vector signed char __b) {
1917 return ~(vec_cmpeq(__a, __b));
1918}
1919
1920static __inline__ vector bool char __ATTRS_o_ai
1921vec_cmpne(vector unsigned char __a, vector unsigned char __b) {
1922 return ~(vec_cmpeq(__a, __b));
1923}
1924
1925static __inline__ vector bool short __ATTRS_o_ai
1926vec_cmpne(vector bool short __a, vector bool short __b) {
1927 return ~(vec_cmpeq(__a, __b));
1928}
1929
1930static __inline__ vector bool short __ATTRS_o_ai
1931vec_cmpne(vector signed short __a, vector signed short __b) {
1932 return ~(vec_cmpeq(__a, __b));
1933}
1934
1935static __inline__ vector bool short __ATTRS_o_ai
1936vec_cmpne(vector unsigned short __a, vector unsigned short __b) {
1937 return ~(vec_cmpeq(__a, __b));
1938}
1939
1940static __inline__ vector bool int __ATTRS_o_ai
1941vec_cmpne(vector bool int __a, vector bool int __b) {
1942 return ~(vec_cmpeq(__a, __b));
1943}
1944
1945static __inline__ vector bool int __ATTRS_o_ai
1946vec_cmpne(vector signed int __a, vector signed int __b) {
1947 return ~(vec_cmpeq(__a, __b));
1948}
1949
1950static __inline__ vector bool int __ATTRS_o_ai
1951vec_cmpne(vector unsigned int __a, vector unsigned int __b) {
1952 return ~(vec_cmpeq(__a, __b));
1953}
1954
1955static __inline__ vector bool int __ATTRS_o_ai
1956vec_cmpne(vector float __a, vector float __b) {
1957 return ~(vec_cmpeq(__a, __b));
1958}
1959#endif
1960
1961#ifdef __POWER8_VECTOR__
1962static __inline__ vector bool long long __ATTRS_o_ai
1963vec_cmpne(vector bool long long __a, vector bool long long __b) {
1964 return (vector bool long long)
1965 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1966}
1967
1968static __inline__ vector bool long long __ATTRS_o_ai
1969vec_cmpne(vector signed long long __a, vector signed long long __b) {
1970 return (vector bool long long)
1971 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1972}
1973
1974static __inline__ vector bool long long __ATTRS_o_ai
1975vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
1976 return (vector bool long long)
1977 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1978}
1979#endif
1980
1981#ifdef __VSX__
1982static __inline__ vector bool long long __ATTRS_o_ai
1983vec_cmpne(vector double __a, vector double __b) {
1984 return (vector bool long long)
1985 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1986}
1903#endif1987#endif
19041988
1905/* vec_cmpgt */1989/* vec_cmpgt */
...@@ -1962,6 +2046,20 @@ vec_cmpgt(vector double __a, vector double __b) {...@@ -1962,6 +2046,20 @@ vec_cmpgt(vector double __a, vector double __b) {
1962}2046}
1963#endif2047#endif
19642048
2049#ifdef __POWER10_VECTOR__
2050static __inline__ vector bool __int128 __ATTRS_o_ai
2051vec_cmpgt(vector signed __int128 __a, vector signed __int128 __b) {
2052 return (vector bool __int128)__builtin_altivec_vcmpgtsq(
2053 (vector bool __int128)__a, (vector bool __int128)__b);
2054}
2055
2056static __inline__ vector bool __int128 __ATTRS_o_ai
2057vec_cmpgt(vector unsigned __int128 __a, vector unsigned __int128 __b) {
2058 return (vector bool __int128)__builtin_altivec_vcmpgtuq(
2059 (vector bool __int128)__a, (vector bool __int128)__b);
2060}
2061#endif
2062
1965/* vec_cmpge */2063/* vec_cmpge */
19662064
1967static __inline__ vector bool char __ATTRS_o_ai2065static __inline__ vector bool char __ATTRS_o_ai
...@@ -2022,6 +2120,18 @@ vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {...@@ -2022,6 +2120,18 @@ vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
2022}2120}
2023#endif2121#endif
20242122
2123#ifdef __POWER10_VECTOR__
2124static __inline__ vector bool __int128 __ATTRS_o_ai
2125vec_cmpge(vector signed __int128 __a, vector signed __int128 __b) {
2126 return ~(vec_cmpgt(__b, __a));
2127}
2128
2129static __inline__ vector bool __int128 __ATTRS_o_ai
2130vec_cmpge(vector unsigned __int128 __a, vector unsigned __int128 __b) {
2131 return ~(vec_cmpgt(__b, __a));
2132}
2133#endif
2134
2025/* vec_vcmpgefp */2135/* vec_vcmpgefp */
20262136
2027static __inline__ vector bool int __attribute__((__always_inline__))2137static __inline__ vector bool int __attribute__((__always_inline__))
...@@ -2134,6 +2244,18 @@ vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {...@@ -2134,6 +2244,18 @@ vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
2134}2244}
2135#endif2245#endif
21362246
2247#ifdef __POWER10_VECTOR__
2248static __inline__ vector bool __int128 __ATTRS_o_ai
2249vec_cmple(vector signed __int128 __a, vector signed __int128 __b) {
2250 return vec_cmpge(__b, __a);
2251}
2252
2253static __inline__ vector bool __int128 __ATTRS_o_ai
2254vec_cmple(vector unsigned __int128 __a, vector unsigned __int128 __b) {
2255 return vec_cmpge(__b, __a);
2256}
2257#endif
2258
2137/* vec_cmplt */2259/* vec_cmplt */
21382260
2139static __inline__ vector bool char __ATTRS_o_ai2261static __inline__ vector bool char __ATTRS_o_ai
...@@ -2178,6 +2300,18 @@ vec_cmplt(vector double __a, vector double __b) {...@@ -2178,6 +2300,18 @@ vec_cmplt(vector double __a, vector double __b) {
2178}2300}
2179#endif2301#endif
21802302
2303#ifdef __POWER10_VECTOR__
2304static __inline__ vector bool __int128 __ATTRS_o_ai
2305vec_cmplt(vector signed __int128 __a, vector signed __int128 __b) {
2306 return vec_cmpgt(__b, __a);
2307}
2308
2309static __inline__ vector bool __int128 __ATTRS_o_ai
2310vec_cmplt(vector unsigned __int128 __a, vector unsigned __int128 __b) {
2311 return vec_cmpgt(__b, __a);
2312}
2313#endif
2314
2181#ifdef __POWER8_VECTOR__2315#ifdef __POWER8_VECTOR__
2182static __inline__ vector bool long long __ATTRS_o_ai2316static __inline__ vector bool long long __ATTRS_o_ai
2183vec_cmplt(vector signed long long __a, vector signed long long __b) {2317vec_cmplt(vector signed long long __a, vector signed long long __b) {
...@@ -2702,67 +2836,67 @@ vec_insert_exp(vector unsigned int __a, vector unsigned int __b) {...@@ -2702,67 +2836,67 @@ vec_insert_exp(vector unsigned int __a, vector unsigned int __b) {
2702}2836}
27032837
2704#if defined(__powerpc64__)2838#if defined(__powerpc64__)
2705static __inline__ vector signed char __ATTRS_o_ai vec_xl_len(signed char *__a,2839static __inline__ vector signed char __ATTRS_o_ai vec_xl_len(const signed char *__a,
2706 size_t __b) {2840 size_t __b) {
2707 return (vector signed char)__builtin_vsx_lxvl(__a, (__b << 56));2841 return (vector signed char)__builtin_vsx_lxvl(__a, (__b << 56));
2708}2842}
27092843
2710static __inline__ vector unsigned char __ATTRS_o_ai2844static __inline__ vector unsigned char __ATTRS_o_ai
2711vec_xl_len(unsigned char *__a, size_t __b) {2845vec_xl_len(const unsigned char *__a, size_t __b) {
2712 return (vector unsigned char)__builtin_vsx_lxvl(__a, (__b << 56));2846 return (vector unsigned char)__builtin_vsx_lxvl(__a, (__b << 56));
2713}2847}
27142848
2715static __inline__ vector signed short __ATTRS_o_ai vec_xl_len(signed short *__a,2849static __inline__ vector signed short __ATTRS_o_ai vec_xl_len(const signed short *__a,
2716 size_t __b) {2850 size_t __b) {
2717 return (vector signed short)__builtin_vsx_lxvl(__a, (__b << 56));2851 return (vector signed short)__builtin_vsx_lxvl(__a, (__b << 56));
2718}2852}
27192853
2720static __inline__ vector unsigned short __ATTRS_o_ai2854static __inline__ vector unsigned short __ATTRS_o_ai
2721vec_xl_len(unsigned short *__a, size_t __b) {2855vec_xl_len(const unsigned short *__a, size_t __b) {
2722 return (vector unsigned short)__builtin_vsx_lxvl(__a, (__b << 56));2856 return (vector unsigned short)__builtin_vsx_lxvl(__a, (__b << 56));
2723}2857}
27242858
2725static __inline__ vector signed int __ATTRS_o_ai vec_xl_len(signed int *__a,2859static __inline__ vector signed int __ATTRS_o_ai vec_xl_len(const signed int *__a,
2726 size_t __b) {2860 size_t __b) {
2727 return (vector signed int)__builtin_vsx_lxvl(__a, (__b << 56));2861 return (vector signed int)__builtin_vsx_lxvl(__a, (__b << 56));
2728}2862}
27292863
2730static __inline__ vector unsigned int __ATTRS_o_ai vec_xl_len(unsigned int *__a,2864static __inline__ vector unsigned int __ATTRS_o_ai vec_xl_len(const unsigned int *__a,
2731 size_t __b) {2865 size_t __b) {
2732 return (vector unsigned int)__builtin_vsx_lxvl(__a, (__b << 56));2866 return (vector unsigned int)__builtin_vsx_lxvl(__a, (__b << 56));
2733}2867}
27342868
2735static __inline__ vector float __ATTRS_o_ai vec_xl_len(float *__a, size_t __b) {2869static __inline__ vector float __ATTRS_o_ai vec_xl_len(const float *__a, size_t __b) {
2736 return (vector float)__builtin_vsx_lxvl(__a, (__b << 56));2870 return (vector float)__builtin_vsx_lxvl(__a, (__b << 56));
2737}2871}
27382872
2739static __inline__ vector signed __int128 __ATTRS_o_ai2873static __inline__ vector signed __int128 __ATTRS_o_ai
2740vec_xl_len(signed __int128 *__a, size_t __b) {2874vec_xl_len(const signed __int128 *__a, size_t __b) {
2741 return (vector signed __int128)__builtin_vsx_lxvl(__a, (__b << 56));2875 return (vector signed __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2742}2876}
27432877
2744static __inline__ vector unsigned __int128 __ATTRS_o_ai2878static __inline__ vector unsigned __int128 __ATTRS_o_ai
2745vec_xl_len(unsigned __int128 *__a, size_t __b) {2879vec_xl_len(const unsigned __int128 *__a, size_t __b) {
2746 return (vector unsigned __int128)__builtin_vsx_lxvl(__a, (__b << 56));2880 return (vector unsigned __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2747}2881}
27482882
2749static __inline__ vector signed long long __ATTRS_o_ai2883static __inline__ vector signed long long __ATTRS_o_ai
2750vec_xl_len(signed long long *__a, size_t __b) {2884vec_xl_len(const signed long long *__a, size_t __b) {
2751 return (vector signed long long)__builtin_vsx_lxvl(__a, (__b << 56));2885 return (vector signed long long)__builtin_vsx_lxvl(__a, (__b << 56));
2752}2886}
27532887
2754static __inline__ vector unsigned long long __ATTRS_o_ai2888static __inline__ vector unsigned long long __ATTRS_o_ai
2755vec_xl_len(unsigned long long *__a, size_t __b) {2889vec_xl_len(const unsigned long long *__a, size_t __b) {
2756 return (vector unsigned long long)__builtin_vsx_lxvl(__a, (__b << 56));2890 return (vector unsigned long long)__builtin_vsx_lxvl(__a, (__b << 56));
2757}2891}
27582892
2759static __inline__ vector double __ATTRS_o_ai vec_xl_len(double *__a,2893static __inline__ vector double __ATTRS_o_ai vec_xl_len(const double *__a,
2760 size_t __b) {2894 size_t __b) {
2761 return (vector double)__builtin_vsx_lxvl(__a, (__b << 56));2895 return (vector double)__builtin_vsx_lxvl(__a, (__b << 56));
2762}2896}
27632897
2764static __inline__ vector unsigned char __ATTRS_o_ai2898static __inline__ vector unsigned char __ATTRS_o_ai
2765vec_xl_len_r(unsigned char *__a, size_t __b) {2899vec_xl_len_r(const unsigned char *__a, size_t __b) {
2766 vector unsigned char __res =2900 vector unsigned char __res =
2767 (vector unsigned char)__builtin_vsx_lxvll(__a, (__b << 56));2901 (vector unsigned char)__builtin_vsx_lxvll(__a, (__b << 56));
2768#ifdef __LITTLE_ENDIAN__2902#ifdef __LITTLE_ENDIAN__
...@@ -2862,12 +2996,12 @@ static __inline__ void __ATTRS_o_ai vec_xst_len_r(vector unsigned char __a,...@@ -2862,12 +2996,12 @@ static __inline__ void __ATTRS_o_ai vec_xst_len_r(vector unsigned char __a,
2862#ifdef __VSX__2996#ifdef __VSX__
2863static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,2997static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,
2864 vector float __b) {2998 vector float __b) {
2865 return __builtin_vsx_xvcpsgnsp(__a, __b);2999 return __builtin_vsx_xvcpsgnsp(__b, __a);
2866}3000}
28673001
2868static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,3002static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
2869 vector double __b) {3003 vector double __b) {
2870 return __builtin_vsx_xvcpsgndp(__a, __b);3004 return __builtin_vsx_xvcpsgndp(__b, __a);
2871}3005}
2872#endif3006#endif
28733007
...@@ -2951,6 +3085,42 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,...@@ -2951,6 +3085,42 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
29513085
2952#define vec_vctuxs __builtin_altivec_vctuxs3086#define vec_vctuxs __builtin_altivec_vctuxs
29533087
3088/* vec_signext */
3089
3090#ifdef __POWER9_VECTOR__
3091static __inline__ vector signed int __ATTRS_o_ai
3092vec_signexti(vector signed char __a) {
3093 return __builtin_altivec_vextsb2w(__a);
3094}
3095
3096static __inline__ vector signed int __ATTRS_o_ai
3097vec_signexti(vector signed short __a) {
3098 return __builtin_altivec_vextsh2w(__a);
3099}
3100
3101static __inline__ vector signed long long __ATTRS_o_ai
3102vec_signextll(vector signed char __a) {
3103 return __builtin_altivec_vextsb2d(__a);
3104}
3105
3106static __inline__ vector signed long long __ATTRS_o_ai
3107vec_signextll(vector signed short __a) {
3108 return __builtin_altivec_vextsh2d(__a);
3109}
3110
3111static __inline__ vector signed long long __ATTRS_o_ai
3112vec_signextll(vector signed int __a) {
3113 return __builtin_altivec_vextsw2d(__a);
3114}
3115#endif
3116
3117#ifdef __POWER10_VECTOR__
3118static __inline__ vector signed __int128 __ATTRS_o_ai
3119vec_signextq(vector signed long long __a) {
3120 return __builtin_altivec_vextsd2q(__a);
3121}
3122#endif
3123
2954/* vec_signed */3124/* vec_signed */
29553125
2956static __inline__ vector signed int __ATTRS_o_ai3126static __inline__ vector signed int __ATTRS_o_ai
...@@ -3288,6 +3458,66 @@ static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,...@@ -3288,6 +3458,66 @@ static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,
3288}3458}
3289#endif3459#endif
32903460
3461/* vec_dive */
3462
3463#ifdef __POWER10_VECTOR__
3464static __inline__ vector signed int __ATTRS_o_ai
3465vec_dive(vector signed int __a, vector signed int __b) {
3466 return __builtin_altivec_vdivesw(__a, __b);
3467}
3468
3469static __inline__ vector unsigned int __ATTRS_o_ai
3470vec_dive(vector unsigned int __a, vector unsigned int __b) {
3471 return __builtin_altivec_vdiveuw(__a, __b);
3472}
3473
3474static __inline__ vector signed long long __ATTRS_o_ai
3475vec_dive(vector signed long long __a, vector signed long long __b) {
3476 return __builtin_altivec_vdivesd(__a, __b);
3477}
3478
3479static __inline__ vector unsigned long long __ATTRS_o_ai
3480vec_dive(vector unsigned long long __a, vector unsigned long long __b) {
3481 return __builtin_altivec_vdiveud(__a, __b);
3482}
3483
3484static __inline__ vector unsigned __int128 __ATTRS_o_ai
3485vec_dive(vector unsigned __int128 __a, vector unsigned __int128 __b) {
3486 return __builtin_altivec_vdiveuq(__a, __b);
3487}
3488
3489static __inline__ vector signed __int128 __ATTRS_o_ai
3490vec_dive(vector signed __int128 __a, vector signed __int128 __b) {
3491 return __builtin_altivec_vdivesq(__a, __b);
3492}
3493#endif
3494
3495#ifdef __POWER10_VECTOR__
3496static __inline__ vector unsigned __int128 __ATTRS_o_ai
3497vec_div(vector unsigned __int128 __a, vector unsigned __int128 __b) {
3498 return __a / __b;
3499}
3500
3501static __inline__ vector signed __int128 __ATTRS_o_ai
3502vec_div(vector signed __int128 __a, vector signed __int128 __b) {
3503 return __a / __b;
3504}
3505#endif /* __POWER10_VECTOR__ */
3506
3507/* vec_xvtdiv */
3508
3509#ifdef __VSX__
3510static __inline__ int __ATTRS_o_ai vec_test_swdiv(vector double __a,
3511 vector double __b) {
3512 return __builtin_vsx_xvtdivdp(__a, __b);
3513}
3514
3515static __inline__ int __ATTRS_o_ai vec_test_swdivs(vector float __a,
3516 vector float __b) {
3517 return __builtin_vsx_xvtdivsp(__a, __b);
3518}
3519#endif
3520
3291/* vec_dss */3521/* vec_dss */
32923522
3293#define vec_dss __builtin_altivec_dss3523#define vec_dss __builtin_altivec_dss
...@@ -3300,23 +3530,19 @@ static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {...@@ -3300,23 +3530,19 @@ static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {
33003530
3301/* vec_dst */3531/* vec_dst */
3302#define vec_dst(__PTR, __CW, __STR) \3532#define vec_dst(__PTR, __CW, __STR) \
3303 __extension__( \3533 __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR))
3304 { __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR)); })
33053534
3306/* vec_dstst */3535/* vec_dstst */
3307#define vec_dstst(__PTR, __CW, __STR) \3536#define vec_dstst(__PTR, __CW, __STR) \
3308 __extension__( \3537 __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR))
3309 { __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR)); })
33103538
3311/* vec_dststt */3539/* vec_dststt */
3312#define vec_dststt(__PTR, __CW, __STR) \3540#define vec_dststt(__PTR, __CW, __STR) \
3313 __extension__( \3541 __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR))
3314 { __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR)); })
33153542
3316/* vec_dstt */3543/* vec_dstt */
3317#define vec_dstt(__PTR, __CW, __STR) \3544#define vec_dstt(__PTR, __CW, __STR) \
3318 __extension__( \3545 __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR))
3319 { __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR)); })
33203546
3321/* vec_eqv */3547/* vec_eqv */
33223548
...@@ -5467,6 +5693,16 @@ vec_msum(vector unsigned short __a, vector unsigned short __b,...@@ -5467,6 +5693,16 @@ vec_msum(vector unsigned short __a, vector unsigned short __b,
5467 return __builtin_altivec_vmsumuhm(__a, __b, __c);5693 return __builtin_altivec_vmsumuhm(__a, __b, __c);
5468}5694}
54695695
5696/* vec_msumc */
5697
5698#ifdef __POWER10_VECTOR__
5699static __inline__ vector unsigned __int128 __ATTRS_o_ai
5700vec_msumc(vector unsigned long long __a, vector unsigned long long __b,
5701 vector unsigned __int128 __c) {
5702 return __builtin_altivec_vmsumcud(__a, __b, __c);
5703}
5704#endif
5705
5470/* vec_vmsummbm */5706/* vec_vmsummbm */
54715707
5472static __inline__ vector int __attribute__((__always_inline__))5708static __inline__ vector int __attribute__((__always_inline__))
...@@ -5693,6 +5929,26 @@ vec_mule(vector unsigned int __a, vector unsigned int __b) {...@@ -5693,6 +5929,26 @@ vec_mule(vector unsigned int __a, vector unsigned int __b) {
5693}5929}
5694#endif5930#endif
56955931
5932#ifdef __POWER10_VECTOR__
5933static __inline__ vector signed __int128 __ATTRS_o_ai
5934vec_mule(vector signed long long __a, vector signed long long __b) {
5935#ifdef __LITTLE_ENDIAN__
5936 return __builtin_altivec_vmulosd(__a, __b);
5937#else
5938 return __builtin_altivec_vmulesd(__a, __b);
5939#endif
5940}
5941
5942static __inline__ vector unsigned __int128 __ATTRS_o_ai
5943vec_mule(vector unsigned long long __a, vector unsigned long long __b) {
5944#ifdef __LITTLE_ENDIAN__
5945 return __builtin_altivec_vmuloud(__a, __b);
5946#else
5947 return __builtin_altivec_vmuleud(__a, __b);
5948#endif
5949}
5950#endif
5951
5696/* vec_vmulesb */5952/* vec_vmulesb */
56975953
5698static __inline__ vector short __attribute__((__always_inline__))5954static __inline__ vector short __attribute__((__always_inline__))
...@@ -5737,6 +5993,30 @@ vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {...@@ -5737,6 +5993,30 @@ vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {
5737#endif5993#endif
5738}5994}
57395995
5996/* vec_mulh */
5997
5998#ifdef __POWER10_VECTOR__
5999static __inline__ vector signed int __ATTRS_o_ai
6000vec_mulh(vector signed int __a, vector signed int __b) {
6001 return __builtin_altivec_vmulhsw(__a, __b);
6002}
6003
6004static __inline__ vector unsigned int __ATTRS_o_ai
6005vec_mulh(vector unsigned int __a, vector unsigned int __b) {
6006 return __builtin_altivec_vmulhuw(__a, __b);
6007}
6008
6009static __inline__ vector signed long long __ATTRS_o_ai
6010vec_mulh(vector signed long long __a, vector signed long long __b) {
6011 return __builtin_altivec_vmulhsd(__a, __b);
6012}
6013
6014static __inline__ vector unsigned long long __ATTRS_o_ai
6015vec_mulh(vector unsigned long long __a, vector unsigned long long __b) {
6016 return __builtin_altivec_vmulhud(__a, __b);
6017}
6018#endif
6019
5740/* vec_mulo */6020/* vec_mulo */
57416021
5742static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,6022static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,
...@@ -5795,6 +6075,26 @@ vec_mulo(vector unsigned int __a, vector unsigned int __b) {...@@ -5795,6 +6075,26 @@ vec_mulo(vector unsigned int __a, vector unsigned int __b) {
5795}6075}
5796#endif6076#endif
57976077
6078#ifdef __POWER10_VECTOR__
6079static __inline__ vector signed __int128 __ATTRS_o_ai
6080vec_mulo(vector signed long long __a, vector signed long long __b) {
6081#ifdef __LITTLE_ENDIAN__
6082 return __builtin_altivec_vmulesd(__a, __b);
6083#else
6084 return __builtin_altivec_vmulosd(__a, __b);
6085#endif
6086}
6087
6088static __inline__ vector unsigned __int128 __ATTRS_o_ai
6089vec_mulo(vector unsigned long long __a, vector unsigned long long __b) {
6090#ifdef __LITTLE_ENDIAN__
6091 return __builtin_altivec_vmuleud(__a, __b);
6092#else
6093 return __builtin_altivec_vmuloud(__a, __b);
6094#endif
6095}
6096#endif
6097
5798/* vec_vmulosb */6098/* vec_vmulosb */
57996099
5800static __inline__ vector short __attribute__((__always_inline__))6100static __inline__ vector short __attribute__((__always_inline__))
...@@ -7627,6 +7927,18 @@ vec_rl(vector unsigned long long __a, vector unsigned long long __b) {...@@ -7627,6 +7927,18 @@ vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
7627}7927}
7628#endif7928#endif
76297929
7930#ifdef __POWER10_VECTOR__
7931static __inline__ vector signed __int128 __ATTRS_o_ai
7932vec_rl(vector signed __int128 __a, vector unsigned __int128 __b) {
7933 return (__b << __a)|(__b >> ((__CHAR_BIT__ * sizeof(vector signed __int128)) - __a));
7934}
7935
7936static __inline__ vector unsigned __int128 __ATTRS_o_ai
7937vec_rl(vector unsigned __int128 __a, vector unsigned __int128 __b) {
7938 return (__b << __a)|(__b >> ((__CHAR_BIT__ * sizeof(vector unsigned __int128)) - __a));
7939}
7940#endif
7941
7630/* vec_rlmi */7942/* vec_rlmi */
7631#ifdef __POWER9_VECTOR__7943#ifdef __POWER9_VECTOR__
7632static __inline__ vector unsigned int __ATTRS_o_ai7944static __inline__ vector unsigned int __ATTRS_o_ai
...@@ -7640,10 +7952,26 @@ vec_rlmi(vector unsigned long long __a, vector unsigned long long __b,...@@ -7640,10 +7952,26 @@ vec_rlmi(vector unsigned long long __a, vector unsigned long long __b,
7640 vector unsigned long long __c) {7952 vector unsigned long long __c) {
7641 return __builtin_altivec_vrldmi(__a, __c, __b);7953 return __builtin_altivec_vrldmi(__a, __c, __b);
7642}7954}
7955#endif
76437956
7644/* vec_rlnm */7957#ifdef __POWER10_VECTOR__
7645static __inline__ vector unsigned int __ATTRS_o_ai7958static __inline__ vector unsigned __int128 __ATTRS_o_ai
7646vec_rlnm(vector unsigned int __a, vector unsigned int __b,7959vec_rlmi(vector unsigned __int128 __a, vector unsigned __int128 __b,
7960 vector unsigned __int128 __c) {
7961 return __builtin_altivec_vrlqmi(__a, __c, __b);
7962}
7963
7964static __inline__ vector signed __int128 __ATTRS_o_ai
7965vec_rlmi(vector signed __int128 __a, vector signed __int128 __b,
7966 vector signed __int128 __c) {
7967 return __builtin_altivec_vrlqmi(__a, __c, __b);
7968}
7969#endif
7970
7971/* vec_rlnm */
7972#ifdef __POWER9_VECTOR__
7973static __inline__ vector unsigned int __ATTRS_o_ai
7974vec_rlnm(vector unsigned int __a, vector unsigned int __b,
7647 vector unsigned int __c) {7975 vector unsigned int __c) {
7648 vector unsigned int OneByte = { 0x8, 0x8, 0x8, 0x8 };7976 vector unsigned int OneByte = { 0x8, 0x8, 0x8, 0x8 };
7649 return __builtin_altivec_vrlwnm(__a, ((__c << OneByte) | __b));7977 return __builtin_altivec_vrlwnm(__a, ((__c << OneByte) | __b));
...@@ -7657,6 +7985,42 @@ vec_rlnm(vector unsigned long long __a, vector unsigned long long __b,...@@ -7657,6 +7985,42 @@ vec_rlnm(vector unsigned long long __a, vector unsigned long long __b,
7657}7985}
7658#endif7986#endif
76597987
7988#ifdef __POWER10_VECTOR__
7989static __inline__ vector unsigned __int128 __ATTRS_o_ai
7990vec_rlnm(vector unsigned __int128 __a, vector unsigned __int128 __b,
7991 vector unsigned __int128 __c) {
7992 // Merge __b and __c using an appropriate shuffle.
7993 vector unsigned char TmpB = (vector unsigned char)__b;
7994 vector unsigned char TmpC = (vector unsigned char)__c;
7995 vector unsigned char MaskAndShift =
7996#ifdef __LITTLE_ENDIAN__
7997 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0,
7998 1, -1, -1, -1, -1, -1);
7999#else
8000 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, 31, 30, 15, -1,
8001 -1, -1, -1, -1, -1, -1, -1);
8002#endif
8003 return __builtin_altivec_vrlqnm(__a, (vector unsigned __int128) MaskAndShift);
8004}
8005
8006static __inline__ vector signed __int128 __ATTRS_o_ai
8007vec_rlnm(vector signed __int128 __a, vector signed __int128 __b,
8008 vector signed __int128 __c) {
8009 // Merge __b and __c using an appropriate shuffle.
8010 vector unsigned char TmpB = (vector unsigned char)__b;
8011 vector unsigned char TmpC = (vector unsigned char)__c;
8012 vector unsigned char MaskAndShift =
8013#ifdef __LITTLE_ENDIAN__
8014 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0,
8015 1, -1, -1, -1, -1, -1);
8016#else
8017 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, 31, 30, 15, -1,
8018 -1, -1, -1, -1, -1, -1, -1);
8019#endif
8020 return __builtin_altivec_vrlqnm(__a, (vector unsigned __int128) MaskAndShift);
8021}
8022#endif
8023
7660/* vec_vrlb */8024/* vec_vrlb */
76618025
7662static __inline__ vector signed char __ATTRS_o_ai8026static __inline__ vector signed char __ATTRS_o_ai
...@@ -7771,6 +8135,18 @@ vec_vrsqrtefp(vector float __a) {...@@ -7771,6 +8135,18 @@ vec_vrsqrtefp(vector float __a) {
7771 return __builtin_altivec_vrsqrtefp(__a);8135 return __builtin_altivec_vrsqrtefp(__a);
7772}8136}
77738137
8138/* vec_xvtsqrt */
8139
8140#ifdef __VSX__
8141static __inline__ int __ATTRS_o_ai vec_test_swsqrt(vector double __a) {
8142 return __builtin_vsx_xvtsqrtdp(__a);
8143}
8144
8145static __inline__ int __ATTRS_o_ai vec_test_swsqrts(vector float __a) {
8146 return __builtin_vsx_xvtsqrtsp(__a);
8147}
8148#endif
8149
7774/* vec_sel */8150/* vec_sel */
77758151
7776#define __builtin_altivec_vsel_4si vec_sel8152#define __builtin_altivec_vsel_4si vec_sel
...@@ -7905,6 +8281,46 @@ vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {...@@ -7905,6 +8281,46 @@ vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {
7905 ((vector long long)__b & (vector long long)__c);8281 ((vector long long)__b & (vector long long)__c);
7906 return (vector double)__res;8282 return (vector double)__res;
7907}8283}
8284
8285static __inline__ vector bool long long __ATTRS_o_ai
8286vec_sel(vector bool long long __a, vector bool long long __b,
8287 vector bool long long __c) {
8288 return (__a & ~__c) | (__b & __c);
8289}
8290
8291static __inline__ vector bool long long __ATTRS_o_ai
8292vec_sel(vector bool long long __a, vector bool long long __b,
8293 vector unsigned long long __c) {
8294 return (__a & ~(vector bool long long)__c) |
8295 (__b & (vector bool long long)__c);
8296}
8297
8298static __inline__ vector signed long long __ATTRS_o_ai
8299vec_sel(vector signed long long __a, vector signed long long __b,
8300 vector bool long long __c) {
8301 return (__a & ~(vector signed long long)__c) |
8302 (__b & (vector signed long long)__c);
8303}
8304
8305static __inline__ vector signed long long __ATTRS_o_ai
8306vec_sel(vector signed long long __a, vector signed long long __b,
8307 vector unsigned long long __c) {
8308 return (__a & ~(vector signed long long)__c) |
8309 (__b & (vector signed long long)__c);
8310}
8311
8312static __inline__ vector unsigned long long __ATTRS_o_ai
8313vec_sel(vector unsigned long long __a, vector unsigned long long __b,
8314 vector bool long long __c) {
8315 return (__a & ~(vector unsigned long long)__c) |
8316 (__b & (vector unsigned long long)__c);
8317}
8318
8319static __inline__ vector unsigned long long __ATTRS_o_ai
8320vec_sel(vector unsigned long long __a, vector unsigned long long __b,
8321 vector unsigned long long __c) {
8322 return (__a & ~__c) | (__b & __c);
8323}
7908#endif8324#endif
79098325
7910/* vec_vsel */8326/* vec_vsel */
...@@ -13900,6 +14316,18 @@ static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,...@@ -13900,6 +14316,18 @@ static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,
13900}14316}
13901#endif14317#endif
1390214318
14319#ifdef __POWER10_VECTOR__
14320static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed __int128 __a,
14321 vector signed __int128 __b) {
14322 return __builtin_altivec_vcmpequq_p(__CR6_LT, __a, __b);
14323}
14324
14325static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned __int128 __a,
14326 vector unsigned __int128 __b) {
14327 return __builtin_altivec_vcmpequq_p(__CR6_LT, __a, __b);
14328}
14329#endif
14330
13903/* vec_all_ge */14331/* vec_all_ge */
1390414332
13905static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,14333static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
...@@ -14071,6 +14499,18 @@ static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,...@@ -14071,6 +14499,18 @@ static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,
14071}14499}
14072#endif14500#endif
1407314501
14502#ifdef __POWER10_VECTOR__
14503static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed __int128 __a,
14504 vector signed __int128 __b) {
14505 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ, __b, __a);
14506}
14507
14508static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned __int128 __a,
14509 vector unsigned __int128 __b) {
14510 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ, __b, __a);
14511}
14512#endif
14513
14074/* vec_all_gt */14514/* vec_all_gt */
1407514515
14076static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,14516static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
...@@ -14242,6 +14682,18 @@ static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,...@@ -14242,6 +14682,18 @@ static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,
14242}14682}
14243#endif14683#endif
1424414684
14685#ifdef __POWER10_VECTOR__
14686static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed __int128 __a,
14687 vector signed __int128 __b) {
14688 return __builtin_altivec_vcmpgtsq_p(__CR6_LT, __a, __b);
14689}
14690
14691static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned __int128 __a,
14692 vector unsigned __int128 __b) {
14693 return __builtin_altivec_vcmpgtuq_p(__CR6_LT, __a, __b);
14694}
14695#endif
14696
14245/* vec_all_in */14697/* vec_all_in */
1424614698
14247static __inline__ int __attribute__((__always_inline__))14699static __inline__ int __attribute__((__always_inline__))
...@@ -14421,6 +14873,18 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,...@@ -14421,6 +14873,18 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,
14421}14873}
14422#endif14874#endif
1442314875
14876#ifdef __POWER10_VECTOR__
14877static __inline__ int __ATTRS_o_ai vec_all_le(vector signed __int128 __a,
14878 vector signed __int128 __b) {
14879 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ, __a, __b);
14880}
14881
14882static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned __int128 __a,
14883 vector unsigned __int128 __b) {
14884 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ, __a, __b);
14885}
14886#endif
14887
14424/* vec_all_lt */14888/* vec_all_lt */
1442514889
14426static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,14890static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
...@@ -14593,6 +15057,18 @@ static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,...@@ -14593,6 +15057,18 @@ static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,
14593}15057}
14594#endif15058#endif
1459515059
15060#ifdef __POWER10_VECTOR__
15061static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed __int128 __a,
15062 vector signed __int128 __b) {
15063 return __builtin_altivec_vcmpgtsq_p(__CR6_LT, __b, __a);
15064}
15065
15066static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned __int128 __a,
15067 vector unsigned __int128 __b) {
15068 return __builtin_altivec_vcmpgtuq_p(__CR6_LT, __b, __a);
15069}
15070#endif
15071
14596/* vec_all_nan */15072/* vec_all_nan */
1459715073
14598static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a) {15074static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a) {
...@@ -14797,6 +15273,18 @@ static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,...@@ -14797,6 +15273,18 @@ static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,
14797}15273}
14798#endif15274#endif
1479915275
15276#ifdef __POWER10_VECTOR__
15277static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed __int128 __a,
15278 vector signed __int128 __b) {
15279 return __builtin_altivec_vcmpequq_p(__CR6_EQ, __a, __b);
15280}
15281
15282static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned __int128 __a,
15283 vector unsigned __int128 __b) {
15284 return __builtin_altivec_vcmpequq_p(__CR6_EQ, __a, __b);
15285}
15286#endif
15287
14800/* vec_all_nge */15288/* vec_all_nge */
1480115289
14802static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a,15290static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a,
...@@ -15042,6 +15530,18 @@ static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,...@@ -15042,6 +15530,18 @@ static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,
15042}15530}
15043#endif15531#endif
1504415532
15533#ifdef __POWER10_VECTOR__
15534static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed __int128 __a,
15535 vector signed __int128 __b) {
15536 return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV, __a, __b);
15537}
15538
15539static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned __int128 __a,
15540 vector unsigned __int128 __b) {
15541 return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV, __a, __b);
15542}
15543#endif
15544
15045/* vec_any_ge */15545/* vec_any_ge */
1504615546
15047static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,15547static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
...@@ -15221,6 +15721,18 @@ static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,...@@ -15221,6 +15721,18 @@ static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,
15221}15721}
15222#endif15722#endif
1522315723
15724#ifdef __POWER10_VECTOR__
15725static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed __int128 __a,
15726 vector signed __int128 __b) {
15727 return __builtin_altivec_vcmpgtsq_p(__CR6_LT_REV, __b, __a);
15728}
15729
15730static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned __int128 __a,
15731 vector unsigned __int128 __b) {
15732 return __builtin_altivec_vcmpgtuq_p(__CR6_LT_REV, __b, __a);
15733}
15734#endif
15735
15224/* vec_any_gt */15736/* vec_any_gt */
1522515737
15226static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,15738static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
...@@ -15400,6 +15912,18 @@ static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,...@@ -15400,6 +15912,18 @@ static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,
15400}15912}
15401#endif15913#endif
1540215914
15915#ifdef __POWER10_VECTOR__
15916static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed __int128 __a,
15917 vector signed __int128 __b) {
15918 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ_REV, __a, __b);
15919}
15920
15921static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned __int128 __a,
15922 vector unsigned __int128 __b) {
15923 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ_REV, __a, __b);
15924}
15925#endif
15926
15403/* vec_any_le */15927/* vec_any_le */
1540415928
15405static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,15929static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
...@@ -15579,6 +16103,18 @@ static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,...@@ -15579,6 +16103,18 @@ static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,
15579}16103}
15580#endif16104#endif
1558116105
16106#ifdef __POWER10_VECTOR__
16107static __inline__ int __ATTRS_o_ai vec_any_le(vector signed __int128 __a,
16108 vector signed __int128 __b) {
16109 return __builtin_altivec_vcmpgtsq_p(__CR6_LT_REV, __a, __b);
16110}
16111
16112static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned __int128 __a,
16113 vector unsigned __int128 __b) {
16114 return __builtin_altivec_vcmpgtuq_p(__CR6_LT_REV, __a, __b);
16115}
16116#endif
16117
15582/* vec_any_lt */16118/* vec_any_lt */
1558316119
15584static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,16120static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
...@@ -15758,6 +16294,18 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,...@@ -15758,6 +16294,18 @@ static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,
15758}16294}
15759#endif16295#endif
1576016296
16297#ifdef __POWER10_VECTOR__
16298static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed __int128 __a,
16299 vector signed __int128 __b) {
16300 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ_REV, __b, __a);
16301}
16302
16303static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned __int128 __a,
16304 vector unsigned __int128 __b) {
16305 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ_REV, __b, __a);
16306}
16307#endif
16308
15761/* vec_any_nan */16309/* vec_any_nan */
1576216310
15763static __inline__ int __attribute__((__always_inline__))16311static __inline__ int __attribute__((__always_inline__))
...@@ -15953,6 +16501,18 @@ static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,...@@ -15953,6 +16501,18 @@ static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,
15953}16501}
15954#endif16502#endif
1595516503
16504#ifdef __POWER10_VECTOR__
16505static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed __int128 __a,
16506 vector signed __int128 __b) {
16507 return __builtin_altivec_vcmpequq_p(__CR6_LT_REV, __a, __b);
16508}
16509
16510static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned __int128 __a,
16511 vector unsigned __int128 __b) {
16512 return __builtin_altivec_vcmpequq_p(__CR6_LT_REV, __a, __b);
16513}
16514#endif
16515
15956/* vec_any_nge */16516/* vec_any_nge */
1595716517
15958static __inline__ int __attribute__((__always_inline__))16518static __inline__ int __attribute__((__always_inline__))
...@@ -16353,41 +16913,41 @@ typedef vector unsigned int unaligned_vec_uint __attribute__((aligned(1)));...@@ -16353,41 +16913,41 @@ typedef vector unsigned int unaligned_vec_uint __attribute__((aligned(1)));
16353typedef vector float unaligned_vec_float __attribute__((aligned(1)));16913typedef vector float unaligned_vec_float __attribute__((aligned(1)));
1635416914
16355static inline __ATTRS_o_ai vector signed char vec_xl(signed long long __offset,16915static inline __ATTRS_o_ai vector signed char vec_xl(signed long long __offset,
16356 signed char *__ptr) {16916 const signed char *__ptr) {
16357 return *(unaligned_vec_schar *)(__ptr + __offset);16917 return *(unaligned_vec_schar *)(__ptr + __offset);
16358}16918}
1635916919
16360static inline __ATTRS_o_ai vector unsigned char16920static inline __ATTRS_o_ai vector unsigned char
16361vec_xl(signed long long __offset, unsigned char *__ptr) {16921vec_xl(signed long long __offset, const unsigned char *__ptr) {
16362 return *(unaligned_vec_uchar*)(__ptr + __offset);16922 return *(unaligned_vec_uchar*)(__ptr + __offset);
16363}16923}
1636416924
16365static inline __ATTRS_o_ai vector signed short vec_xl(signed long long __offset,16925static inline __ATTRS_o_ai vector signed short vec_xl(signed long long __offset,
16366 signed short *__ptr) {16926 const signed short *__ptr) {
16367 signed char *__addr = (signed char *)__ptr + __offset;16927 signed char *__addr = (signed char *)__ptr + __offset;
16368 return *(unaligned_vec_sshort *)__addr;16928 return *(unaligned_vec_sshort *)__addr;
16369}16929}
1637016930
16371static inline __ATTRS_o_ai vector unsigned short16931static inline __ATTRS_o_ai vector unsigned short
16372vec_xl(signed long long __offset, unsigned short *__ptr) {16932vec_xl(signed long long __offset, const unsigned short *__ptr) {
16373 signed char *__addr = (signed char *)__ptr + __offset;16933 signed char *__addr = (signed char *)__ptr + __offset;
16374 return *(unaligned_vec_ushort *)__addr;16934 return *(unaligned_vec_ushort *)__addr;
16375}16935}
1637616936
16377static inline __ATTRS_o_ai vector signed int vec_xl(signed long long __offset,16937static inline __ATTRS_o_ai vector signed int vec_xl(signed long long __offset,
16378 signed int *__ptr) {16938 const signed int *__ptr) {
16379 signed char *__addr = (signed char *)__ptr + __offset;16939 signed char *__addr = (signed char *)__ptr + __offset;
16380 return *(unaligned_vec_sint *)__addr;16940 return *(unaligned_vec_sint *)__addr;
16381}16941}
1638216942
16383static inline __ATTRS_o_ai vector unsigned int vec_xl(signed long long __offset,16943static inline __ATTRS_o_ai vector unsigned int vec_xl(signed long long __offset,
16384 unsigned int *__ptr) {16944 const unsigned int *__ptr) {
16385 signed char *__addr = (signed char *)__ptr + __offset;16945 signed char *__addr = (signed char *)__ptr + __offset;
16386 return *(unaligned_vec_uint *)__addr;16946 return *(unaligned_vec_uint *)__addr;
16387}16947}
1638816948
16389static inline __ATTRS_o_ai vector float vec_xl(signed long long __offset,16949static inline __ATTRS_o_ai vector float vec_xl(signed long long __offset,
16390 float *__ptr) {16950 const float *__ptr) {
16391 signed char *__addr = (signed char *)__ptr + __offset;16951 signed char *__addr = (signed char *)__ptr + __offset;
16392 return *(unaligned_vec_float *)__addr;16952 return *(unaligned_vec_float *)__addr;
16393}16953}
...@@ -16398,19 +16958,19 @@ typedef vector unsigned long long unaligned_vec_ull __attribute__((aligned(1)));...@@ -16398,19 +16958,19 @@ typedef vector unsigned long long unaligned_vec_ull __attribute__((aligned(1)));
16398typedef vector double unaligned_vec_double __attribute__((aligned(1)));16958typedef vector double unaligned_vec_double __attribute__((aligned(1)));
1639916959
16400static inline __ATTRS_o_ai vector signed long long16960static inline __ATTRS_o_ai vector signed long long
16401vec_xl(signed long long __offset, signed long long *__ptr) {16961vec_xl(signed long long __offset, const signed long long *__ptr) {
16402 signed char *__addr = (signed char *)__ptr + __offset;16962 signed char *__addr = (signed char *)__ptr + __offset;
16403 return *(unaligned_vec_sll *)__addr;16963 return *(unaligned_vec_sll *)__addr;
16404}16964}
1640516965
16406static inline __ATTRS_o_ai vector unsigned long long16966static inline __ATTRS_o_ai vector unsigned long long
16407vec_xl(signed long long __offset, unsigned long long *__ptr) {16967vec_xl(signed long long __offset, const unsigned long long *__ptr) {
16408 signed char *__addr = (signed char *)__ptr + __offset;16968 signed char *__addr = (signed char *)__ptr + __offset;
16409 return *(unaligned_vec_ull *)__addr;16969 return *(unaligned_vec_ull *)__addr;
16410}16970}
1641116971
16412static inline __ATTRS_o_ai vector double vec_xl(signed long long __offset,16972static inline __ATTRS_o_ai vector double vec_xl(signed long long __offset,
16413 double *__ptr) {16973 const double *__ptr) {
16414 signed char *__addr = (signed char *)__ptr + __offset;16974 signed char *__addr = (signed char *)__ptr + __offset;
16415 return *(unaligned_vec_double *)__addr;16975 return *(unaligned_vec_double *)__addr;
16416}16976}
...@@ -16421,13 +16981,13 @@ typedef vector signed __int128 unaligned_vec_si128 __attribute__((aligned(1)));...@@ -16421,13 +16981,13 @@ typedef vector signed __int128 unaligned_vec_si128 __attribute__((aligned(1)));
16421typedef vector unsigned __int128 unaligned_vec_ui12816981typedef vector unsigned __int128 unaligned_vec_ui128
16422 __attribute__((aligned(1)));16982 __attribute__((aligned(1)));
16423static inline __ATTRS_o_ai vector signed __int12816983static inline __ATTRS_o_ai vector signed __int128
16424vec_xl(signed long long __offset, signed __int128 *__ptr) {16984vec_xl(signed long long __offset, const signed __int128 *__ptr) {
16425 signed char *__addr = (signed char *)__ptr + __offset;16985 signed char *__addr = (signed char *)__ptr + __offset;
16426 return *(unaligned_vec_si128 *)__addr;16986 return *(unaligned_vec_si128 *)__addr;
16427}16987}
1642816988
16429static inline __ATTRS_o_ai vector unsigned __int12816989static inline __ATTRS_o_ai vector unsigned __int128
16430vec_xl(signed long long __offset, unsigned __int128 *__ptr) {16990vec_xl(signed long long __offset, const unsigned __int128 *__ptr) {
16431 signed char *__addr = (signed char *)__ptr + __offset;16991 signed char *__addr = (signed char *)__ptr + __offset;
16432 return *(unaligned_vec_ui128 *)__addr;16992 return *(unaligned_vec_ui128 *)__addr;
16433}16993}
...@@ -16437,71 +16997,71 @@ vec_xl(signed long long __offset, unsigned __int128 *__ptr) {...@@ -16437,71 +16997,71 @@ vec_xl(signed long long __offset, unsigned __int128 *__ptr) {
1643716997
16438#ifdef __LITTLE_ENDIAN__16998#ifdef __LITTLE_ENDIAN__
16439static __inline__ vector signed char __ATTRS_o_ai16999static __inline__ vector signed char __ATTRS_o_ai
16440vec_xl_be(signed long long __offset, signed char *__ptr) {17000vec_xl_be(signed long long __offset, const signed char *__ptr) {
16441 vector signed char __vec = (vector signed char)__builtin_vsx_lxvd2x_be(__offset, __ptr);17001 vector signed char __vec = (vector signed char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16442 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,17002 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16443 13, 12, 11, 10, 9, 8);17003 13, 12, 11, 10, 9, 8);
16444}17004}
1644517005
16446static __inline__ vector unsigned char __ATTRS_o_ai17006static __inline__ vector unsigned char __ATTRS_o_ai
16447vec_xl_be(signed long long __offset, unsigned char *__ptr) {17007vec_xl_be(signed long long __offset, const unsigned char *__ptr) {
16448 vector unsigned char __vec = (vector unsigned char)__builtin_vsx_lxvd2x_be(__offset, __ptr);17008 vector unsigned char __vec = (vector unsigned char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16449 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,17009 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16450 13, 12, 11, 10, 9, 8);17010 13, 12, 11, 10, 9, 8);
16451}17011}
1645217012
16453static __inline__ vector signed short __ATTRS_o_ai17013static __inline__ vector signed short __ATTRS_o_ai
16454vec_xl_be(signed long long __offset, signed short *__ptr) {17014vec_xl_be(signed long long __offset, const signed short *__ptr) {
16455 vector signed short __vec = (vector signed short)__builtin_vsx_lxvd2x_be(__offset, __ptr);17015 vector signed short __vec = (vector signed short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16456 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);17016 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16457}17017}
1645817018
16459static __inline__ vector unsigned short __ATTRS_o_ai17019static __inline__ vector unsigned short __ATTRS_o_ai
16460vec_xl_be(signed long long __offset, unsigned short *__ptr) {17020vec_xl_be(signed long long __offset, const unsigned short *__ptr) {
16461 vector unsigned short __vec = (vector unsigned short)__builtin_vsx_lxvd2x_be(__offset, __ptr);17021 vector unsigned short __vec = (vector unsigned short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16462 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);17022 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16463}17023}
1646417024
16465static __inline__ vector signed int __ATTRS_o_ai17025static __inline__ vector signed int __ATTRS_o_ai
16466vec_xl_be(signed long long __offset, signed int *__ptr) {17026vec_xl_be(signed long long __offset, const signed int *__ptr) {
16467 return (vector signed int)__builtin_vsx_lxvw4x_be(__offset, __ptr);17027 return (vector signed int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16468}17028}
1646917029
16470static __inline__ vector unsigned int __ATTRS_o_ai17030static __inline__ vector unsigned int __ATTRS_o_ai
16471vec_xl_be(signed long long __offset, unsigned int *__ptr) {17031vec_xl_be(signed long long __offset, const unsigned int *__ptr) {
16472 return (vector unsigned int)__builtin_vsx_lxvw4x_be(__offset, __ptr);17032 return (vector unsigned int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16473}17033}
1647417034
16475static __inline__ vector float __ATTRS_o_ai17035static __inline__ vector float __ATTRS_o_ai
16476vec_xl_be(signed long long __offset, float *__ptr) {17036vec_xl_be(signed long long __offset, const float *__ptr) {
16477 return (vector float)__builtin_vsx_lxvw4x_be(__offset, __ptr);17037 return (vector float)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16478}17038}
1647917039
16480#ifdef __VSX__17040#ifdef __VSX__
16481static __inline__ vector signed long long __ATTRS_o_ai17041static __inline__ vector signed long long __ATTRS_o_ai
16482vec_xl_be(signed long long __offset, signed long long *__ptr) {17042vec_xl_be(signed long long __offset, const signed long long *__ptr) {
16483 return (vector signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);17043 return (vector signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16484}17044}
1648517045
16486static __inline__ vector unsigned long long __ATTRS_o_ai17046static __inline__ vector unsigned long long __ATTRS_o_ai
16487vec_xl_be(signed long long __offset, unsigned long long *__ptr) {17047vec_xl_be(signed long long __offset, const unsigned long long *__ptr) {
16488 return (vector unsigned long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);17048 return (vector unsigned long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16489}17049}
1649017050
16491static __inline__ vector double __ATTRS_o_ai17051static __inline__ vector double __ATTRS_o_ai
16492vec_xl_be(signed long long __offset, double *__ptr) {17052vec_xl_be(signed long long __offset, const double *__ptr) {
16493 return (vector double)__builtin_vsx_lxvd2x_be(__offset, __ptr);17053 return (vector double)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16494}17054}
16495#endif17055#endif
1649617056
16497#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)17057#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16498static __inline__ vector signed __int128 __ATTRS_o_ai17058static __inline__ vector signed __int128 __ATTRS_o_ai
16499vec_xl_be(signed long long __offset, signed __int128 *__ptr) {17059vec_xl_be(signed long long __offset, const signed __int128 *__ptr) {
16500 return vec_xl(__offset, __ptr);17060 return vec_xl(__offset, __ptr);
16501}17061}
1650217062
16503static __inline__ vector unsigned __int128 __ATTRS_o_ai17063static __inline__ vector unsigned __int128 __ATTRS_o_ai
16504vec_xl_be(signed long long __offset, unsigned __int128 *__ptr) {17064vec_xl_be(signed long long __offset, const unsigned __int128 *__ptr) {
16505 return vec_xl(__offset, __ptr);17065 return vec_xl(__offset, __ptr);
16506}17066}
16507#endif17067#endif
...@@ -16509,6 +17069,54 @@ vec_xl_be(signed long long __offset, unsigned __int128 *__ptr) {...@@ -16509,6 +17069,54 @@ vec_xl_be(signed long long __offset, unsigned __int128 *__ptr) {
16509 #define vec_xl_be vec_xl17069 #define vec_xl_be vec_xl
16510#endif17070#endif
1651117071
17072#if defined(__POWER10_VECTOR__) && defined(__VSX__)
17073
17074/* vect_xl_sext */
17075
17076static __inline__ vector unsigned __int128 __ATTRS_o_ai
17077vec_xl_sext(signed long long __offset, const signed char *__pointer) {
17078 return (vector unsigned __int128)*(__pointer + __offset);
17079}
17080
17081static __inline__ vector unsigned __int128 __ATTRS_o_ai
17082vec_xl_sext(signed long long __offset, const signed short *__pointer) {
17083 return (vector unsigned __int128)*(__pointer + __offset);
17084}
17085
17086static __inline__ vector unsigned __int128 __ATTRS_o_ai
17087vec_xl_sext(signed long long __offset, const signed int *__pointer) {
17088 return (vector unsigned __int128)*(__pointer + __offset);
17089}
17090
17091static __inline__ vector unsigned __int128 __ATTRS_o_ai
17092vec_xl_sext(signed long long __offset, const signed long long *__pointer) {
17093 return (vector unsigned __int128)*(__pointer + __offset);
17094}
17095
17096/* vec_xl_zext */
17097
17098static __inline__ vector unsigned __int128 __ATTRS_o_ai
17099vec_xl_zext(signed long long __offset, const unsigned char *__pointer) {
17100 return (vector unsigned __int128)*(__pointer + __offset);
17101}
17102
17103static __inline__ vector unsigned __int128 __ATTRS_o_ai
17104vec_xl_zext(signed long long __offset, const unsigned short *__pointer) {
17105 return (vector unsigned __int128)*(__pointer + __offset);
17106}
17107
17108static __inline__ vector unsigned __int128 __ATTRS_o_ai
17109vec_xl_zext(signed long long __offset, const unsigned int *__pointer) {
17110 return (vector unsigned __int128)*(__pointer + __offset);
17111}
17112
17113static __inline__ vector unsigned __int128 __ATTRS_o_ai
17114vec_xl_zext(signed long long __offset, const unsigned long long *__pointer) {
17115 return (vector unsigned __int128)*(__pointer + __offset);
17116}
17117
17118#endif
17119
16512/* vec_xst */17120/* vec_xst */
1651317121
16514static inline __ATTRS_o_ai void vec_xst(vector signed char __vec,17122static inline __ATTRS_o_ai void vec_xst(vector signed char __vec,
...@@ -16597,6 +17205,58 @@ static inline __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,...@@ -16597,6 +17205,58 @@ static inline __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,
16597}17205}
16598#endif17206#endif
1659917207
17208/* vec_xst_trunc */
17209
17210#if defined(__POWER10_VECTOR__) && defined(__VSX__)
17211static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17212 signed long long __offset,
17213 signed char *__ptr) {
17214 *(__ptr + __offset) = (signed char)__vec[0];
17215}
17216
17217static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17218 signed long long __offset,
17219 unsigned char *__ptr) {
17220 *(__ptr + __offset) = (unsigned char)__vec[0];
17221}
17222
17223static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17224 signed long long __offset,
17225 signed short *__ptr) {
17226 *(__ptr + __offset) = (signed short)__vec[0];
17227}
17228
17229static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17230 signed long long __offset,
17231 unsigned short *__ptr) {
17232 *(__ptr + __offset) = (unsigned short)__vec[0];
17233}
17234
17235static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17236 signed long long __offset,
17237 signed int *__ptr) {
17238 *(__ptr + __offset) = (signed int)__vec[0];
17239}
17240
17241static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17242 signed long long __offset,
17243 unsigned int *__ptr) {
17244 *(__ptr + __offset) = (unsigned int)__vec[0];
17245}
17246
17247static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
17248 signed long long __offset,
17249 signed long long *__ptr) {
17250 *(__ptr + __offset) = (signed long long)__vec[0];
17251}
17252
17253static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,
17254 signed long long __offset,
17255 unsigned long long *__ptr) {
17256 *(__ptr + __offset) = (unsigned long long)__vec[0];
17257}
17258#endif
17259
16600/* vec_xst_be */17260/* vec_xst_be */
1660117261
16602#ifdef __LITTLE_ENDIAN__17262#ifdef __LITTLE_ENDIAN__
...@@ -16763,6 +17423,100 @@ static vector signed char __ATTRS_o_ai vec_nabs(vector signed char __a) {...@@ -16763,6 +17423,100 @@ static vector signed char __ATTRS_o_ai vec_nabs(vector signed char __a) {
16763}17423}
1676417424
16765#ifdef __POWER10_VECTOR__17425#ifdef __POWER10_VECTOR__
17426
17427/* vec_extractm */
17428
17429static __inline__ unsigned int __ATTRS_o_ai
17430vec_extractm(vector unsigned char __a) {
17431 return __builtin_altivec_vextractbm(__a);
17432}
17433
17434static __inline__ unsigned int __ATTRS_o_ai
17435vec_extractm(vector unsigned short __a) {
17436 return __builtin_altivec_vextracthm(__a);
17437}
17438
17439static __inline__ unsigned int __ATTRS_o_ai
17440vec_extractm(vector unsigned int __a) {
17441 return __builtin_altivec_vextractwm(__a);
17442}
17443
17444static __inline__ unsigned int __ATTRS_o_ai
17445vec_extractm(vector unsigned long long __a) {
17446 return __builtin_altivec_vextractdm(__a);
17447}
17448
17449static __inline__ unsigned int __ATTRS_o_ai
17450vec_extractm(vector unsigned __int128 __a) {
17451 return __builtin_altivec_vextractqm(__a);
17452}
17453
17454/* vec_expandm */
17455
17456static __inline__ vector unsigned char __ATTRS_o_ai
17457vec_expandm(vector unsigned char __a) {
17458 return __builtin_altivec_vexpandbm(__a);
17459}
17460
17461static __inline__ vector unsigned short __ATTRS_o_ai
17462vec_expandm(vector unsigned short __a) {
17463 return __builtin_altivec_vexpandhm(__a);
17464}
17465
17466static __inline__ vector unsigned int __ATTRS_o_ai
17467vec_expandm(vector unsigned int __a) {
17468 return __builtin_altivec_vexpandwm(__a);
17469}
17470
17471static __inline__ vector unsigned long long __ATTRS_o_ai
17472vec_expandm(vector unsigned long long __a) {
17473 return __builtin_altivec_vexpanddm(__a);
17474}
17475
17476static __inline__ vector unsigned __int128 __ATTRS_o_ai
17477vec_expandm(vector unsigned __int128 __a) {
17478 return __builtin_altivec_vexpandqm(__a);
17479}
17480
17481/* vec_cntm */
17482
17483#define vec_cntm(__a, __mp) \
17484 _Generic((__a), vector unsigned char \
17485 : __builtin_altivec_vcntmbb((__a), (unsigned int)(__mp)), \
17486 vector unsigned short \
17487 : __builtin_altivec_vcntmbh((__a), (unsigned int)(__mp)), \
17488 vector unsigned int \
17489 : __builtin_altivec_vcntmbw((__a), (unsigned int)(__mp)), \
17490 vector unsigned long long \
17491 : __builtin_altivec_vcntmbd((__a), (unsigned int)(__mp)))
17492
17493/* vec_gen[b|h|w|d|q]m */
17494
17495static __inline__ vector unsigned char __ATTRS_o_ai
17496vec_genbm(unsigned long long __bm) {
17497 return __builtin_altivec_mtvsrbm(__bm);
17498}
17499
17500static __inline__ vector unsigned short __ATTRS_o_ai
17501vec_genhm(unsigned long long __bm) {
17502 return __builtin_altivec_mtvsrhm(__bm);
17503}
17504
17505static __inline__ vector unsigned int __ATTRS_o_ai
17506vec_genwm(unsigned long long __bm) {
17507 return __builtin_altivec_mtvsrwm(__bm);
17508}
17509
17510static __inline__ vector unsigned long long __ATTRS_o_ai
17511vec_gendm(unsigned long long __bm) {
17512 return __builtin_altivec_mtvsrdm(__bm);
17513}
17514
17515static __inline__ vector unsigned __int128 __ATTRS_o_ai
17516vec_genqm(unsigned long long __bm) {
17517 return __builtin_altivec_mtvsrqm(__bm);
17518}
17519
16766/* vec_pdep */17520/* vec_pdep */
1676717521
16768static __inline__ vector unsigned long long __ATTRS_o_ai17522static __inline__ vector unsigned long long __ATTRS_o_ai
...@@ -16881,6 +17635,38 @@ vec_cnttzm(vector unsigned long long __a, vector unsigned long long __b) {...@@ -16881,6 +17635,38 @@ vec_cnttzm(vector unsigned long long __a, vector unsigned long long __b) {
16881 return __builtin_altivec_vctzdm(__a, __b);17635 return __builtin_altivec_vctzdm(__a, __b);
16882}17636}
1688317637
17638/* vec_mod */
17639
17640static __inline__ vector signed int __ATTRS_o_ai
17641vec_mod(vector signed int __a, vector signed int __b) {
17642 return __a % __b;
17643}
17644
17645static __inline__ vector unsigned int __ATTRS_o_ai
17646vec_mod(vector unsigned int __a, vector unsigned int __b) {
17647 return __a % __b;
17648}
17649
17650static __inline__ vector signed long long __ATTRS_o_ai
17651vec_mod(vector signed long long __a, vector signed long long __b) {
17652 return __a % __b;
17653}
17654
17655static __inline__ vector unsigned long long __ATTRS_o_ai
17656vec_mod(vector unsigned long long __a, vector unsigned long long __b) {
17657 return __a % __b;
17658}
17659
17660static __inline__ vector signed __int128 __ATTRS_o_ai
17661vec_mod(vector signed __int128 __a, vector signed __int128 __b) {
17662 return __a % __b;
17663}
17664
17665static __inline__ vector unsigned __int128 __ATTRS_o_ai
17666vec_mod(vector unsigned __int128 __a, vector unsigned __int128 __b) {
17667 return __a % __b;
17668}
17669
16884/* vec_sldbi */17670/* vec_sldbi */
1688517671
16886#define vec_sldb(__a, __b, __c) __builtin_altivec_vsldbi(__a, __b, (__c & 0x7))17672#define vec_sldb(__a, __b, __c) __builtin_altivec_vsldbi(__a, __b, (__c & 0x7))
...@@ -17027,6 +17813,92 @@ vec_inserth(vector unsigned int __a, vector unsigned int __b,...@@ -17027,6 +17813,92 @@ vec_inserth(vector unsigned int __a, vector unsigned int __b,
17027#endif17813#endif
17028}17814}
1702917815
17816/* vec_extractl */
17817
17818static __inline__ vector unsigned long long __ATTRS_o_ai vec_extractl(
17819 vector unsigned char __a, vector unsigned char __b, unsigned int __c) {
17820#ifdef __LITTLE_ENDIAN__
17821 return __builtin_altivec_vextdubvrx(__a, __b, __c);
17822#else
17823 vector unsigned long long __ret = __builtin_altivec_vextdubvlx(__a, __b, __c);
17824 return vec_sld(__ret, __ret, 8);
17825#endif
17826}
17827
17828static __inline__ vector unsigned long long __ATTRS_o_ai vec_extractl(
17829 vector unsigned short __a, vector unsigned short __b, unsigned int __c) {
17830#ifdef __LITTLE_ENDIAN__
17831 return __builtin_altivec_vextduhvrx(__a, __b, __c);
17832#else
17833 vector unsigned long long __ret = __builtin_altivec_vextduhvlx(__a, __b, __c);
17834 return vec_sld(__ret, __ret, 8);
17835#endif
17836}
17837
17838static __inline__ vector unsigned long long __ATTRS_o_ai vec_extractl(
17839 vector unsigned int __a, vector unsigned int __b, unsigned int __c) {
17840#ifdef __LITTLE_ENDIAN__
17841 return __builtin_altivec_vextduwvrx(__a, __b, __c);
17842#else
17843 vector unsigned long long __ret = __builtin_altivec_vextduwvlx(__a, __b, __c);
17844 return vec_sld(__ret, __ret, 8);
17845#endif
17846}
17847
17848static __inline__ vector unsigned long long __ATTRS_o_ai
17849vec_extractl(vector unsigned long long __a, vector unsigned long long __b,
17850 unsigned int __c) {
17851#ifdef __LITTLE_ENDIAN__
17852 return __builtin_altivec_vextddvrx(__a, __b, __c);
17853#else
17854 vector unsigned long long __ret = __builtin_altivec_vextddvlx(__a, __b, __c);
17855 return vec_sld(__ret, __ret, 8);
17856#endif
17857}
17858
17859/* vec_extracth */
17860
17861static __inline__ vector unsigned long long __ATTRS_o_ai vec_extracth(
17862 vector unsigned char __a, vector unsigned char __b, unsigned int __c) {
17863#ifdef __LITTLE_ENDIAN__
17864 return __builtin_altivec_vextdubvlx(__a, __b, __c);
17865#else
17866 vector unsigned long long __ret = __builtin_altivec_vextdubvrx(__a, __b, __c);
17867 return vec_sld(__ret, __ret, 8);
17868#endif
17869}
17870
17871static __inline__ vector unsigned long long __ATTRS_o_ai vec_extracth(
17872 vector unsigned short __a, vector unsigned short __b, unsigned int __c) {
17873#ifdef __LITTLE_ENDIAN__
17874 return __builtin_altivec_vextduhvlx(__a, __b, __c);
17875#else
17876 vector unsigned long long __ret = __builtin_altivec_vextduhvrx(__a, __b, __c);
17877 return vec_sld(__ret, __ret, 8);
17878#endif
17879}
17880
17881static __inline__ vector unsigned long long __ATTRS_o_ai vec_extracth(
17882 vector unsigned int __a, vector unsigned int __b, unsigned int __c) {
17883#ifdef __LITTLE_ENDIAN__
17884 return __builtin_altivec_vextduwvlx(__a, __b, __c);
17885#else
17886 vector unsigned long long __ret = __builtin_altivec_vextduwvrx(__a, __b, __c);
17887 return vec_sld(__ret, __ret, 8);
17888#endif
17889}
17890
17891static __inline__ vector unsigned long long __ATTRS_o_ai
17892vec_extracth(vector unsigned long long __a, vector unsigned long long __b,
17893 unsigned int __c) {
17894#ifdef __LITTLE_ENDIAN__
17895 return __builtin_altivec_vextddvlx(__a, __b, __c);
17896#else
17897 vector unsigned long long __ret = __builtin_altivec_vextddvrx(__a, __b, __c);
17898 return vec_sld(__ret, __ret, 8);
17899#endif
17900}
17901
17030#ifdef __VSX__17902#ifdef __VSX__
1703117903
17032/* vec_permx */17904/* vec_permx */
...@@ -17095,6 +17967,14 @@ vec_blendv(vector double __a, vector double __b,...@@ -17095,6 +17967,14 @@ vec_blendv(vector double __a, vector double __b,
17095 return __builtin_vsx_xxblendvd(__a, __b, __c);17967 return __builtin_vsx_xxblendvd(__a, __b, __c);
17096}17968}
1709717969
17970/* vec_replace_elt */
17971
17972#define vec_replace_elt __builtin_altivec_vec_replace_elt
17973
17974/* vec_replace_unaligned */
17975
17976#define vec_replace_unaligned __builtin_altivec_vec_replace_unaligned
17977
17098/* vec_splati */17978/* vec_splati */
1709917979
17100#define vec_splati(__a) \17980#define vec_splati(__a) \
...@@ -17161,6 +18041,197 @@ vec_test_lsbb_all_zeros(vector unsigned char __a) {...@@ -17161,6 +18041,197 @@ vec_test_lsbb_all_zeros(vector unsigned char __a) {
17161 return __builtin_vsx_xvtlsbb(__a, 0);18041 return __builtin_vsx_xvtlsbb(__a, 0);
17162}18042}
17163#endif /* __VSX__ */18043#endif /* __VSX__ */
18044
18045/* vec_stril */
18046
18047static __inline__ vector unsigned char __ATTRS_o_ai
18048vec_stril(vector unsigned char __a) {
18049#ifdef __LITTLE_ENDIAN__
18050 return __builtin_altivec_vstribr((vector signed char)__a);
18051#else
18052 return __builtin_altivec_vstribl((vector signed char)__a);
18053#endif
18054}
18055
18056static __inline__ vector signed char __ATTRS_o_ai
18057vec_stril(vector signed char __a) {
18058#ifdef __LITTLE_ENDIAN__
18059 return __builtin_altivec_vstribr(__a);
18060#else
18061 return __builtin_altivec_vstribl(__a);
18062#endif
18063}
18064
18065static __inline__ vector unsigned short __ATTRS_o_ai
18066vec_stril(vector unsigned short __a) {
18067#ifdef __LITTLE_ENDIAN__
18068 return __builtin_altivec_vstrihr((vector signed short)__a);
18069#else
18070 return __builtin_altivec_vstrihl((vector signed short)__a);
18071#endif
18072}
18073
18074static __inline__ vector signed short __ATTRS_o_ai
18075vec_stril(vector signed short __a) {
18076#ifdef __LITTLE_ENDIAN__
18077 return __builtin_altivec_vstrihr(__a);
18078#else
18079 return __builtin_altivec_vstrihl(__a);
18080#endif
18081}
18082
18083/* vec_stril_p */
18084
18085static __inline__ int __ATTRS_o_ai vec_stril_p(vector unsigned char __a) {
18086#ifdef __LITTLE_ENDIAN__
18087 return __builtin_altivec_vstribr_p(__CR6_EQ, (vector signed char)__a);
18088#else
18089 return __builtin_altivec_vstribl_p(__CR6_EQ, (vector signed char)__a);
18090#endif
18091}
18092
18093static __inline__ int __ATTRS_o_ai vec_stril_p(vector signed char __a) {
18094#ifdef __LITTLE_ENDIAN__
18095 return __builtin_altivec_vstribr_p(__CR6_EQ, __a);
18096#else
18097 return __builtin_altivec_vstribl_p(__CR6_EQ, __a);
18098#endif
18099}
18100
18101static __inline__ int __ATTRS_o_ai vec_stril_p(vector unsigned short __a) {
18102#ifdef __LITTLE_ENDIAN__
18103 return __builtin_altivec_vstrihr_p(__CR6_EQ, (vector signed short)__a);
18104#else
18105 return __builtin_altivec_vstrihl_p(__CR6_EQ, (vector signed short)__a);
18106#endif
18107}
18108
18109static __inline__ int __ATTRS_o_ai vec_stril_p(vector signed short __a) {
18110#ifdef __LITTLE_ENDIAN__
18111 return __builtin_altivec_vstrihr_p(__CR6_EQ, __a);
18112#else
18113 return __builtin_altivec_vstrihl_p(__CR6_EQ, __a);
18114#endif
18115}
18116
18117/* vec_strir */
18118
18119static __inline__ vector unsigned char __ATTRS_o_ai
18120vec_strir(vector unsigned char __a) {
18121#ifdef __LITTLE_ENDIAN__
18122 return __builtin_altivec_vstribl((vector signed char)__a);
18123#else
18124 return __builtin_altivec_vstribr((vector signed char)__a);
18125#endif
18126}
18127
18128static __inline__ vector signed char __ATTRS_o_ai
18129vec_strir(vector signed char __a) {
18130#ifdef __LITTLE_ENDIAN__
18131 return __builtin_altivec_vstribl(__a);
18132#else
18133 return __builtin_altivec_vstribr(__a);
18134#endif
18135}
18136
18137static __inline__ vector unsigned short __ATTRS_o_ai
18138vec_strir(vector unsigned short __a) {
18139#ifdef __LITTLE_ENDIAN__
18140 return __builtin_altivec_vstrihl((vector signed short)__a);
18141#else
18142 return __builtin_altivec_vstrihr((vector signed short)__a);
18143#endif
18144}
18145
18146static __inline__ vector signed short __ATTRS_o_ai
18147vec_strir(vector signed short __a) {
18148#ifdef __LITTLE_ENDIAN__
18149 return __builtin_altivec_vstrihl(__a);
18150#else
18151 return __builtin_altivec_vstrihr(__a);
18152#endif
18153}
18154
18155/* vec_strir_p */
18156
18157static __inline__ int __ATTRS_o_ai vec_strir_p(vector unsigned char __a) {
18158#ifdef __LITTLE_ENDIAN__
18159 return __builtin_altivec_vstribl_p(__CR6_EQ, (vector signed char)__a);
18160#else
18161 return __builtin_altivec_vstribr_p(__CR6_EQ, (vector signed char)__a);
18162#endif
18163}
18164
18165static __inline__ int __ATTRS_o_ai vec_strir_p(vector signed char __a) {
18166#ifdef __LITTLE_ENDIAN__
18167 return __builtin_altivec_vstribl_p(__CR6_EQ, __a);
18168#else
18169 return __builtin_altivec_vstribr_p(__CR6_EQ, __a);
18170#endif
18171}
18172
18173static __inline__ int __ATTRS_o_ai vec_strir_p(vector unsigned short __a) {
18174#ifdef __LITTLE_ENDIAN__
18175 return __builtin_altivec_vstrihl_p(__CR6_EQ, (vector signed short)__a);
18176#else
18177 return __builtin_altivec_vstrihr_p(__CR6_EQ, (vector signed short)__a);
18178#endif
18179}
18180
18181static __inline__ int __ATTRS_o_ai vec_strir_p(vector signed short __a) {
18182#ifdef __LITTLE_ENDIAN__
18183 return __builtin_altivec_vstrihl_p(__CR6_EQ, __a);
18184#else
18185 return __builtin_altivec_vstrihr_p(__CR6_EQ, __a);
18186#endif
18187}
18188
18189/* vs[l | r | ra] */
18190
18191static __inline__ vector unsigned __int128 __ATTRS_o_ai
18192vec_sl(vector unsigned __int128 __a, vector unsigned __int128 __b) {
18193 return __a << (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *
18194 __CHAR_BIT__));
18195}
18196
18197static __inline__ vector signed __int128 __ATTRS_o_ai
18198vec_sl(vector signed __int128 __a, vector unsigned __int128 __b) {
18199 return __a << (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *
18200 __CHAR_BIT__));
18201}
18202
18203static __inline__ vector unsigned __int128 __ATTRS_o_ai
18204vec_sr(vector unsigned __int128 __a, vector unsigned __int128 __b) {
18205 return __a >> (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *
18206 __CHAR_BIT__));
18207}
18208
18209static __inline__ vector signed __int128 __ATTRS_o_ai
18210vec_sr(vector signed __int128 __a, vector unsigned __int128 __b) {
18211 return (
18212 vector signed __int128)(((vector unsigned __int128)__a) >>
18213 (__b %
18214 (vector unsigned __int128)(sizeof(
18215 unsigned __int128) *
18216 __CHAR_BIT__)));
18217}
18218
18219static __inline__ vector unsigned __int128 __ATTRS_o_ai
18220vec_sra(vector unsigned __int128 __a, vector unsigned __int128 __b) {
18221 return (
18222 vector unsigned __int128)(((vector signed __int128)__a) >>
18223 (__b %
18224 (vector unsigned __int128)(sizeof(
18225 unsigned __int128) *
18226 __CHAR_BIT__)));
18227}
18228
18229static __inline__ vector signed __int128 __ATTRS_o_ai
18230vec_sra(vector signed __int128 __a, vector unsigned __int128 __b) {
18231 return __a >> (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *
18232 __CHAR_BIT__));
18233}
18234
17164#endif /* __POWER10_VECTOR__ */18235#endif /* __POWER10_VECTOR__ */
1716518236
17166#undef __ATTRS_o_ai18237#undef __ATTRS_o_ai
lib/include/amxintrin.h+75-22
...@@ -15,8 +15,8 @@...@@ -15,8 +15,8 @@
15#define __AMXINTRIN_H15#define __AMXINTRIN_H
16#ifdef __x86_64__16#ifdef __x86_64__
1717
18#define __DEFAULT_FN_ATTRS \18#define __DEFAULT_FN_ATTRS_TILE \
19 __attribute__((__always_inline__, __nodebug__, __target__("amx-tile")))19 __attribute__((__always_inline__, __nodebug__, __target__("amx-tile")))
2020
21/// Load tile configuration from a 64-byte memory location specified by21/// Load tile configuration from a 64-byte memory location specified by
22/// "mem_addr". The tile configuration includes the tile type palette, the22/// "mem_addr". The tile configuration includes the tile type palette, the
...@@ -31,9 +31,8 @@...@@ -31,9 +31,8 @@
31///31///
32/// \param __config32/// \param __config
33/// A pointer to 512-bits configuration33/// A pointer to 512-bits configuration
34static __inline__ void __DEFAULT_FN_ATTRS34static __inline__ void __DEFAULT_FN_ATTRS_TILE
35_tile_loadconfig(const void *__config)35_tile_loadconfig(const void *__config) {
36{
37 __builtin_ia32_tile_loadconfig(__config);36 __builtin_ia32_tile_loadconfig(__config);
38}37}
3938
...@@ -48,9 +47,8 @@ _tile_loadconfig(const void *__config)...@@ -48,9 +47,8 @@ _tile_loadconfig(const void *__config)
48///47///
49/// \param __config48/// \param __config
50/// A pointer to 512-bits configuration49/// A pointer to 512-bits configuration
51static __inline__ void __DEFAULT_FN_ATTRS50static __inline__ void __DEFAULT_FN_ATTRS_TILE
52_tile_storeconfig(void *__config)51_tile_storeconfig(void *__config) {
53{
54 __builtin_ia32_tile_storeconfig(__config);52 __builtin_ia32_tile_storeconfig(__config);
55}53}
5654
...@@ -60,9 +58,7 @@ _tile_storeconfig(void *__config)...@@ -60,9 +58,7 @@ _tile_storeconfig(void *__config)
60/// \headerfile <x86intrin.h>58/// \headerfile <x86intrin.h>
61///59///
62/// This intrinsic corresponds to the <c> TILERELEASE </c> instruction.60/// This intrinsic corresponds to the <c> TILERELEASE </c> instruction.
63static __inline__ void __DEFAULT_FN_ATTRS61static __inline__ void __DEFAULT_FN_ATTRS_TILE _tile_release(void) {
64_tile_release(void)
65{
66 __builtin_ia32_tilerelease();62 __builtin_ia32_tilerelease();
67}63}
6864
...@@ -80,8 +76,9 @@ _tile_release(void)...@@ -80,8 +76,9 @@ _tile_release(void)
80/// A pointer to base address.76/// A pointer to base address.
81/// \param stride77/// \param stride
82/// The stride between the rows' data to be loaded in memory.78/// The stride between the rows' data to be loaded in memory.
83#define _tile_loadd(dst, base, stride) \79#define _tile_loadd(dst, base, stride) \
84 __builtin_ia32_tileloadd64((dst), ((const void *)(base)), (__SIZE_TYPE__)(stride))80 __builtin_ia32_tileloadd64((dst), ((const void *)(base)), \
81 (__SIZE_TYPE__)(stride))
8582
86/// Load tile rows from memory specifieid by "base" address and "stride" into83/// Load tile rows from memory specifieid by "base" address and "stride" into
87/// destination tile "dst" using the tile configuration previously configured84/// destination tile "dst" using the tile configuration previously configured
...@@ -99,8 +96,9 @@ _tile_release(void)...@@ -99,8 +96,9 @@ _tile_release(void)
99/// A pointer to base address.96/// A pointer to base address.
100/// \param stride97/// \param stride
101/// The stride between the rows' data to be loaded in memory.98/// The stride between the rows' data to be loaded in memory.
102#define _tile_stream_loadd(dst, base, stride) \99#define _tile_stream_loadd(dst, base, stride) \
103 __builtin_ia32_tileloaddt164((dst), ((const void *)(base)), (__SIZE_TYPE__)(stride))100 __builtin_ia32_tileloaddt164((dst), ((const void *)(base)), \
101 (__SIZE_TYPE__)(stride))
104102
105/// Store the tile specified by "src" to memory specifieid by "base" address and103/// Store the tile specified by "src" to memory specifieid by "base" address and
106/// "stride" using the tile configuration previously configured via104/// "stride" using the tile configuration previously configured via
...@@ -116,7 +114,7 @@ _tile_release(void)...@@ -116,7 +114,7 @@ _tile_release(void)
116/// A pointer to base address.114/// A pointer to base address.
117/// \param stride115/// \param stride
118/// The stride between the rows' data to be stored in memory.116/// The stride between the rows' data to be stored in memory.
119#define _tile_stored(dst, base, stride) \117#define _tile_stored(dst, base, stride) \
120 __builtin_ia32_tilestored64((dst), ((void *)(base)), (__SIZE_TYPE__)(stride))118 __builtin_ia32_tilestored64((dst), ((void *)(base)), (__SIZE_TYPE__)(stride))
121119
122/// Zero the tile specified by "tdest".120/// Zero the tile specified by "tdest".
...@@ -145,7 +143,8 @@ _tile_release(void)...@@ -145,7 +143,8 @@ _tile_release(void)
145/// The 1st source tile. Max size is 1024 Bytes.143/// The 1st source tile. Max size is 1024 Bytes.
146/// \param src1144/// \param src1
147/// The 2nd source tile. Max size is 1024 Bytes.145/// The 2nd source tile. Max size is 1024 Bytes.
148#define _tile_dpbssd(dst, src0, src1) __builtin_ia32_tdpbssd((dst), (src0), (src1))146#define _tile_dpbssd(dst, src0, src1) \
147 __builtin_ia32_tdpbssd((dst), (src0), (src1))
149148
150/// Compute dot-product of bytes in tiles with a source/destination accumulator.149/// Compute dot-product of bytes in tiles with a source/destination accumulator.
151/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in src0 with150/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in src0 with
...@@ -163,7 +162,8 @@ _tile_release(void)...@@ -163,7 +162,8 @@ _tile_release(void)
163/// The 1st source tile. Max size is 1024 Bytes.162/// The 1st source tile. Max size is 1024 Bytes.
164/// \param src1163/// \param src1
165/// The 2nd source tile. Max size is 1024 Bytes.164/// The 2nd source tile. Max size is 1024 Bytes.
166#define _tile_dpbsud(dst, src0, src1) __builtin_ia32_tdpbsud((dst), (src0), (src1))165#define _tile_dpbsud(dst, src0, src1) \
166 __builtin_ia32_tdpbsud((dst), (src0), (src1))
167167
168/// Compute dot-product of bytes in tiles with a source/destination accumulator.168/// Compute dot-product of bytes in tiles with a source/destination accumulator.
169/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in src0 with169/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in src0 with
...@@ -181,7 +181,8 @@ _tile_release(void)...@@ -181,7 +181,8 @@ _tile_release(void)
181/// The 1st source tile. Max size is 1024 Bytes.181/// The 1st source tile. Max size is 1024 Bytes.
182/// \param src1182/// \param src1
183/// The 2nd source tile. Max size is 1024 Bytes.183/// The 2nd source tile. Max size is 1024 Bytes.
184#define _tile_dpbusd(dst, src0, src1) __builtin_ia32_tdpbusd((dst), (src0), (src1))184#define _tile_dpbusd(dst, src0, src1) \
185 __builtin_ia32_tdpbusd((dst), (src0), (src1))
185186
186/// Compute dot-product of bytes in tiles with a source/destination accumulator.187/// Compute dot-product of bytes in tiles with a source/destination accumulator.
187/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in src0 with188/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in src0 with
...@@ -199,7 +200,8 @@ _tile_release(void)...@@ -199,7 +200,8 @@ _tile_release(void)
199/// The 1st source tile. Max size is 1024 Bytes.200/// The 1st source tile. Max size is 1024 Bytes.
200/// \param src1201/// \param src1
201/// The 2nd source tile. Max size is 1024 Bytes.202/// The 2nd source tile. Max size is 1024 Bytes.
202#define _tile_dpbuud(dst, src0, src1) __builtin_ia32_tdpbuud((dst), (src0), (src1))203#define _tile_dpbuud(dst, src0, src1) \
204 __builtin_ia32_tdpbuud((dst), (src0), (src1))
203205
204/// Compute dot-product of BF16 (16-bit) floating-point pairs in tiles src0 and206/// Compute dot-product of BF16 (16-bit) floating-point pairs in tiles src0 and
205/// src1, accumulating the intermediate single-precision (32-bit) floating-point207/// src1, accumulating the intermediate single-precision (32-bit) floating-point
...@@ -216,10 +218,61 @@ _tile_release(void)...@@ -216,10 +218,61 @@ _tile_release(void)
216/// The 1st source tile. Max size is 1024 Bytes.218/// The 1st source tile. Max size is 1024 Bytes.
217/// \param src1219/// \param src1
218/// The 2nd source tile. Max size is 1024 Bytes.220/// The 2nd source tile. Max size is 1024 Bytes.
219#define _tile_dpbf16ps(dst, src0, src1) \221#define _tile_dpbf16ps(dst, src0, src1) \
220 __builtin_ia32_tdpbf16ps((dst), (src0), (src1))222 __builtin_ia32_tdpbf16ps((dst), (src0), (src1))
221223
222#undef __DEFAULT_FN_ATTRS224#define __DEFAULT_FN_ATTRS_INT8 \
225 __attribute__((__always_inline__, __nodebug__, __target__("amx-int8")))
226
227typedef int _tile1024i __attribute__((__vector_size__(1024), __aligned__(64)));
228static __inline__ _tile1024i __DEFAULT_FN_ATTRS_INT8
229_tile_loadd_internal(unsigned short m, unsigned short n, const void *base,
230 __SIZE_TYPE__ stride) {
231 return __builtin_ia32_tileloadd64_internal(m, n, base,
232 (__SIZE_TYPE__)(stride));
233}
234
235static __inline__ _tile1024i __DEFAULT_FN_ATTRS_INT8
236_tile_dpbssd_internal(unsigned short m, unsigned short n, unsigned short k,
237 _tile1024i dst, _tile1024i src1, _tile1024i src2) {
238 return __builtin_ia32_tdpbssd_internal(m, n, k, dst, src1, src2);
239}
240
241static __inline__ void __DEFAULT_FN_ATTRS_INT8
242_tile_stored_internal(unsigned short m, unsigned short n, void *base,
243 __SIZE_TYPE__ stride, _tile1024i tile) {
244 return __builtin_ia32_tilestored64_internal(m, n, base,
245 (__SIZE_TYPE__)(stride), tile);
246}
247
248typedef struct __tile1024i_str {
249 const unsigned short row;
250 const unsigned short col;
251 _tile1024i tile;
252} __tile1024i;
253
254__DEFAULT_FN_ATTRS_TILE
255static void __tile_loadd(__tile1024i *dst, const void *base,
256 __SIZE_TYPE__ stride) {
257 dst->tile = _tile_loadd_internal(dst->row, dst->col, base, stride);
258}
259
260__DEFAULT_FN_ATTRS_INT8
261static void __tile_dpbssd(__tile1024i *dst, __tile1024i src1,
262 __tile1024i src2) {
263 dst->tile = _tile_dpbssd_internal(src1.row, src2.col, src1.col, dst->tile,
264 src1.tile, src2.tile);
265}
266
267__DEFAULT_FN_ATTRS_TILE
268static void __tile_stored(void *base, __SIZE_TYPE__ stride, __tile1024i src) {
269 _tile_stored_internal(src.row, src.col, base, stride, src.tile);
270}
271
272__DEFAULT_FN_ATTRS_TILE
273static void __tile_zero(__tile1024i *dst) {
274 dst->tile = __builtin_ia32_tilezero_internal(dst->row, dst->col);
275}
223276
224#endif /* __x86_64__ */277#endif /* __x86_64__ */
225#endif /* __AMXINTRIN_H */278#endif /* __AMXINTRIN_H */
lib/include/arm_acle.h+26
...@@ -639,6 +639,32 @@ __jcvt(double __a) {...@@ -639,6 +639,32 @@ __jcvt(double __a) {
639}639}
640#endif640#endif
641641
642/* Armv8.7-A load/store 64-byte intrinsics */
643#if __ARM_64BIT_STATE && defined(__ARM_FEATURE_LS64)
644typedef struct {
645 uint64_t val[8];
646} data512_t;
647
648static __inline__ data512_t __attribute__((__always_inline__, __nodebug__))
649__arm_ld64b(const void *__addr) {
650 data512_t __value;
651 __builtin_arm_ld64b(__addr, __value.val);
652 return __value;
653}
654static __inline__ void __attribute__((__always_inline__, __nodebug__))
655__arm_st64b(void *__addr, data512_t __value) {
656 __builtin_arm_st64b(__addr, __value.val);
657}
658static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
659__arm_st64bv(void *__addr, data512_t __value) {
660 return __builtin_arm_st64bv(__addr, __value.val);
661}
662static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
663__arm_st64bv0(void *__addr, data512_t __value) {
664 return __builtin_arm_st64bv0(__addr, __value.val);
665}
666#endif
667
642/* 10.1 Special register intrinsics */668/* 10.1 Special register intrinsics */
643#define __arm_rsr(sysreg) __builtin_arm_rsr(sysreg)669#define __arm_rsr(sysreg) __builtin_arm_rsr(sysreg)
644#define __arm_rsr64(sysreg) __builtin_arm_rsr64(sysreg)670#define __arm_rsr64(sysreg) __builtin_arm_rsr64(sysreg)
lib/include/arm_neon.h+7183-5513
...@@ -40429,110 +40429,1846 @@ __ai float32x4_t vcaddq_rot90_f32(float32x4_t __p0, float32x4_t __p1) {...@@ -40429,110 +40429,1846 @@ __ai float32x4_t vcaddq_rot90_f32(float32x4_t __p0, float32x4_t __p1) {
40429}40429}
40430#endif40430#endif
4043140431
40432#ifdef __LITTLE_ENDIAN__
40433__ai float32x4_t vcmlaq_f32(float32x4_t __p0, float32x4_t __p1, float32x4_t __p2) {
40434 float32x4_t __ret;
40435 __ret = (float32x4_t) __builtin_neon_vcmlaq_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 41);
40436 return __ret;
40437}
40438#else
40439__ai float32x4_t vcmlaq_f32(float32x4_t __p0, float32x4_t __p1, float32x4_t __p2) {
40440 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
40441 float32x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);
40442 float32x4_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 3, 2, 1, 0);
40443 float32x4_t __ret;
40444 __ret = (float32x4_t) __builtin_neon_vcmlaq_v((int8x16_t)__rev0, (int8x16_t)__rev1, (int8x16_t)__rev2, 41);
40445 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);
40446 return __ret;
40447}
40448__ai float32x4_t __noswap_vcmlaq_f32(float32x4_t __p0, float32x4_t __p1, float32x4_t __p2) {
40449 float32x4_t __ret;
40450 __ret = (float32x4_t) __builtin_neon_vcmlaq_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 41);
40451 return __ret;
40452}
40453#endif
40454
40455#ifdef __LITTLE_ENDIAN__
40456__ai float32x2_t vcmla_f32(float32x2_t __p0, float32x2_t __p1, float32x2_t __p2) {
40457 float32x2_t __ret;
40458 __ret = (float32x2_t) __builtin_neon_vcmla_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 9);
40459 return __ret;
40460}
40461#else
40462__ai float32x2_t vcmla_f32(float32x2_t __p0, float32x2_t __p1, float32x2_t __p2) {
40463 float32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
40464 float32x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
40465 float32x2_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 1, 0);
40466 float32x2_t __ret;
40467 __ret = (float32x2_t) __builtin_neon_vcmla_v((int8x8_t)__rev0, (int8x8_t)__rev1, (int8x8_t)__rev2, 9);
40468 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
40469 return __ret;
40470}
40471__ai float32x2_t __noswap_vcmla_f32(float32x2_t __p0, float32x2_t __p1, float32x2_t __p2) {
40472 float32x2_t __ret;
40473 __ret = (float32x2_t) __builtin_neon_vcmla_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 9);
40474 return __ret;
40475}
40476#endif
40477
40478#ifdef __LITTLE_ENDIAN__
40479#define vcmla_lane_f32(__p0_169, __p1_169, __p2_169, __p3_169) __extension__ ({ \
40480 float32x2_t __s0_169 = __p0_169; \
40481 float32x2_t __s1_169 = __p1_169; \
40482 float32x2_t __s2_169 = __p2_169; \
40483 float32x2_t __ret_169; \
40484float32x2_t __reint_169 = __s2_169; \
40485uint64x1_t __reint1_169 = (uint64x1_t) {vget_lane_u64(*(uint64x1_t *) &__reint_169, __p3_169)}; \
40486 __ret_169 = vcmla_f32(__s0_169, __s1_169, *(float32x2_t *) &__reint1_169); \
40487 __ret_169; \
40488})
40489#else
40490#define vcmla_lane_f32(__p0_170, __p1_170, __p2_170, __p3_170) __extension__ ({ \
40491 float32x2_t __s0_170 = __p0_170; \
40492 float32x2_t __s1_170 = __p1_170; \
40493 float32x2_t __s2_170 = __p2_170; \
40494 float32x2_t __rev0_170; __rev0_170 = __builtin_shufflevector(__s0_170, __s0_170, 1, 0); \
40495 float32x2_t __rev1_170; __rev1_170 = __builtin_shufflevector(__s1_170, __s1_170, 1, 0); \
40496 float32x2_t __rev2_170; __rev2_170 = __builtin_shufflevector(__s2_170, __s2_170, 1, 0); \
40497 float32x2_t __ret_170; \
40498float32x2_t __reint_170 = __rev2_170; \
40499uint64x1_t __reint1_170 = (uint64x1_t) {vget_lane_u64(*(uint64x1_t *) &__reint_170, __p3_170)}; \
40500 __ret_170 = __noswap_vcmla_f32(__rev0_170, __rev1_170, *(float32x2_t *) &__reint1_170); \
40501 __ret_170 = __builtin_shufflevector(__ret_170, __ret_170, 1, 0); \
40502 __ret_170; \
40503})
40504#endif
40505
40506#ifdef __LITTLE_ENDIAN__
40507#define vcmlaq_lane_f32(__p0_171, __p1_171, __p2_171, __p3_171) __extension__ ({ \
40508 float32x4_t __s0_171 = __p0_171; \
40509 float32x4_t __s1_171 = __p1_171; \
40510 float32x2_t __s2_171 = __p2_171; \
40511 float32x4_t __ret_171; \
40512float32x2_t __reint_171 = __s2_171; \
40513uint64x2_t __reint1_171 = (uint64x2_t) {vget_lane_u64(*(uint64x1_t *) &__reint_171, __p3_171), vget_lane_u64(*(uint64x1_t *) &__reint_171, __p3_171)}; \
40514 __ret_171 = vcmlaq_f32(__s0_171, __s1_171, *(float32x4_t *) &__reint1_171); \
40515 __ret_171; \
40516})
40517#else
40518#define vcmlaq_lane_f32(__p0_172, __p1_172, __p2_172, __p3_172) __extension__ ({ \
40519 float32x4_t __s0_172 = __p0_172; \
40520 float32x4_t __s1_172 = __p1_172; \
40521 float32x2_t __s2_172 = __p2_172; \
40522 float32x4_t __rev0_172; __rev0_172 = __builtin_shufflevector(__s0_172, __s0_172, 3, 2, 1, 0); \
40523 float32x4_t __rev1_172; __rev1_172 = __builtin_shufflevector(__s1_172, __s1_172, 3, 2, 1, 0); \
40524 float32x2_t __rev2_172; __rev2_172 = __builtin_shufflevector(__s2_172, __s2_172, 1, 0); \
40525 float32x4_t __ret_172; \
40526float32x2_t __reint_172 = __rev2_172; \
40527uint64x2_t __reint1_172 = (uint64x2_t) {vget_lane_u64(*(uint64x1_t *) &__reint_172, __p3_172), vget_lane_u64(*(uint64x1_t *) &__reint_172, __p3_172)}; \
40528 __ret_172 = __noswap_vcmlaq_f32(__rev0_172, __rev1_172, *(float32x4_t *) &__reint1_172); \
40529 __ret_172 = __builtin_shufflevector(__ret_172, __ret_172, 3, 2, 1, 0); \
40530 __ret_172; \
40531})
40532#endif
40533
40534#ifdef __LITTLE_ENDIAN__
40535#define vcmla_laneq_f32(__p0_173, __p1_173, __p2_173, __p3_173) __extension__ ({ \
40536 float32x2_t __s0_173 = __p0_173; \
40537 float32x2_t __s1_173 = __p1_173; \
40538 float32x4_t __s2_173 = __p2_173; \
40539 float32x2_t __ret_173; \
40540float32x4_t __reint_173 = __s2_173; \
40541uint64x1_t __reint1_173 = (uint64x1_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_173, __p3_173)}; \
40542 __ret_173 = vcmla_f32(__s0_173, __s1_173, *(float32x2_t *) &__reint1_173); \
40543 __ret_173; \
40544})
40545#else
40546#define vcmla_laneq_f32(__p0_174, __p1_174, __p2_174, __p3_174) __extension__ ({ \
40547 float32x2_t __s0_174 = __p0_174; \
40548 float32x2_t __s1_174 = __p1_174; \
40549 float32x4_t __s2_174 = __p2_174; \
40550 float32x2_t __rev0_174; __rev0_174 = __builtin_shufflevector(__s0_174, __s0_174, 1, 0); \
40551 float32x2_t __rev1_174; __rev1_174 = __builtin_shufflevector(__s1_174, __s1_174, 1, 0); \
40552 float32x4_t __rev2_174; __rev2_174 = __builtin_shufflevector(__s2_174, __s2_174, 3, 2, 1, 0); \
40553 float32x2_t __ret_174; \
40554float32x4_t __reint_174 = __rev2_174; \
40555uint64x1_t __reint1_174 = (uint64x1_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_174, __p3_174)}; \
40556 __ret_174 = __noswap_vcmla_f32(__rev0_174, __rev1_174, *(float32x2_t *) &__reint1_174); \
40557 __ret_174 = __builtin_shufflevector(__ret_174, __ret_174, 1, 0); \
40558 __ret_174; \
40559})
40560#endif
40561
40562#ifdef __LITTLE_ENDIAN__
40563#define vcmlaq_laneq_f32(__p0_175, __p1_175, __p2_175, __p3_175) __extension__ ({ \
40564 float32x4_t __s0_175 = __p0_175; \
40565 float32x4_t __s1_175 = __p1_175; \
40566 float32x4_t __s2_175 = __p2_175; \
40567 float32x4_t __ret_175; \
40568float32x4_t __reint_175 = __s2_175; \
40569uint64x2_t __reint1_175 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_175, __p3_175), vgetq_lane_u64(*(uint64x2_t *) &__reint_175, __p3_175)}; \
40570 __ret_175 = vcmlaq_f32(__s0_175, __s1_175, *(float32x4_t *) &__reint1_175); \
40571 __ret_175; \
40572})
40573#else
40574#define vcmlaq_laneq_f32(__p0_176, __p1_176, __p2_176, __p3_176) __extension__ ({ \
40575 float32x4_t __s0_176 = __p0_176; \
40576 float32x4_t __s1_176 = __p1_176; \
40577 float32x4_t __s2_176 = __p2_176; \
40578 float32x4_t __rev0_176; __rev0_176 = __builtin_shufflevector(__s0_176, __s0_176, 3, 2, 1, 0); \
40579 float32x4_t __rev1_176; __rev1_176 = __builtin_shufflevector(__s1_176, __s1_176, 3, 2, 1, 0); \
40580 float32x4_t __rev2_176; __rev2_176 = __builtin_shufflevector(__s2_176, __s2_176, 3, 2, 1, 0); \
40581 float32x4_t __ret_176; \
40582float32x4_t __reint_176 = __rev2_176; \
40583uint64x2_t __reint1_176 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_176, __p3_176), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_176, __p3_176)}; \
40584 __ret_176 = __noswap_vcmlaq_f32(__rev0_176, __rev1_176, *(float32x4_t *) &__reint1_176); \
40585 __ret_176 = __builtin_shufflevector(__ret_176, __ret_176, 3, 2, 1, 0); \
40586 __ret_176; \
40587})
40588#endif
40589
40590#ifdef __LITTLE_ENDIAN__
40591__ai float32x4_t vcmlaq_rot180_f32(float32x4_t __p0, float32x4_t __p1, float32x4_t __p2) {
40592 float32x4_t __ret;
40593 __ret = (float32x4_t) __builtin_neon_vcmlaq_rot180_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 41);
40594 return __ret;
40595}
40596#else
40597__ai float32x4_t vcmlaq_rot180_f32(float32x4_t __p0, float32x4_t __p1, float32x4_t __p2) {
40598 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
40599 float32x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);
40600 float32x4_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 3, 2, 1, 0);
40601 float32x4_t __ret;
40602 __ret = (float32x4_t) __builtin_neon_vcmlaq_rot180_v((int8x16_t)__rev0, (int8x16_t)__rev1, (int8x16_t)__rev2, 41);
40603 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);
40604 return __ret;
40605}
40606__ai float32x4_t __noswap_vcmlaq_rot180_f32(float32x4_t __p0, float32x4_t __p1, float32x4_t __p2) {
40607 float32x4_t __ret;
40608 __ret = (float32x4_t) __builtin_neon_vcmlaq_rot180_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 41);
40609 return __ret;
40610}
40611#endif
40612
40613#ifdef __LITTLE_ENDIAN__
40614__ai float32x2_t vcmla_rot180_f32(float32x2_t __p0, float32x2_t __p1, float32x2_t __p2) {
40615 float32x2_t __ret;
40616 __ret = (float32x2_t) __builtin_neon_vcmla_rot180_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 9);
40617 return __ret;
40618}
40619#else
40620__ai float32x2_t vcmla_rot180_f32(float32x2_t __p0, float32x2_t __p1, float32x2_t __p2) {
40621 float32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
40622 float32x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
40623 float32x2_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 1, 0);
40624 float32x2_t __ret;
40625 __ret = (float32x2_t) __builtin_neon_vcmla_rot180_v((int8x8_t)__rev0, (int8x8_t)__rev1, (int8x8_t)__rev2, 9);
40626 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
40627 return __ret;
40628}
40629__ai float32x2_t __noswap_vcmla_rot180_f32(float32x2_t __p0, float32x2_t __p1, float32x2_t __p2) {
40630 float32x2_t __ret;
40631 __ret = (float32x2_t) __builtin_neon_vcmla_rot180_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 9);
40632 return __ret;
40633}
40634#endif
40635
40636#ifdef __LITTLE_ENDIAN__
40637#define vcmla_rot180_lane_f32(__p0_177, __p1_177, __p2_177, __p3_177) __extension__ ({ \
40638 float32x2_t __s0_177 = __p0_177; \
40639 float32x2_t __s1_177 = __p1_177; \
40640 float32x2_t __s2_177 = __p2_177; \
40641 float32x2_t __ret_177; \
40642float32x2_t __reint_177 = __s2_177; \
40643uint64x1_t __reint1_177 = (uint64x1_t) {vget_lane_u64(*(uint64x1_t *) &__reint_177, __p3_177)}; \
40644 __ret_177 = vcmla_rot180_f32(__s0_177, __s1_177, *(float32x2_t *) &__reint1_177); \
40645 __ret_177; \
40646})
40647#else
40648#define vcmla_rot180_lane_f32(__p0_178, __p1_178, __p2_178, __p3_178) __extension__ ({ \
40649 float32x2_t __s0_178 = __p0_178; \
40650 float32x2_t __s1_178 = __p1_178; \
40651 float32x2_t __s2_178 = __p2_178; \
40652 float32x2_t __rev0_178; __rev0_178 = __builtin_shufflevector(__s0_178, __s0_178, 1, 0); \
40653 float32x2_t __rev1_178; __rev1_178 = __builtin_shufflevector(__s1_178, __s1_178, 1, 0); \
40654 float32x2_t __rev2_178; __rev2_178 = __builtin_shufflevector(__s2_178, __s2_178, 1, 0); \
40655 float32x2_t __ret_178; \
40656float32x2_t __reint_178 = __rev2_178; \
40657uint64x1_t __reint1_178 = (uint64x1_t) {vget_lane_u64(*(uint64x1_t *) &__reint_178, __p3_178)}; \
40658 __ret_178 = __noswap_vcmla_rot180_f32(__rev0_178, __rev1_178, *(float32x2_t *) &__reint1_178); \
40659 __ret_178 = __builtin_shufflevector(__ret_178, __ret_178, 1, 0); \
40660 __ret_178; \
40661})
40662#endif
40663
40664#ifdef __LITTLE_ENDIAN__
40665#define vcmlaq_rot180_lane_f32(__p0_179, __p1_179, __p2_179, __p3_179) __extension__ ({ \
40666 float32x4_t __s0_179 = __p0_179; \
40667 float32x4_t __s1_179 = __p1_179; \
40668 float32x2_t __s2_179 = __p2_179; \
40669 float32x4_t __ret_179; \
40670float32x2_t __reint_179 = __s2_179; \
40671uint64x2_t __reint1_179 = (uint64x2_t) {vget_lane_u64(*(uint64x1_t *) &__reint_179, __p3_179), vget_lane_u64(*(uint64x1_t *) &__reint_179, __p3_179)}; \
40672 __ret_179 = vcmlaq_rot180_f32(__s0_179, __s1_179, *(float32x4_t *) &__reint1_179); \
40673 __ret_179; \
40674})
40675#else
40676#define vcmlaq_rot180_lane_f32(__p0_180, __p1_180, __p2_180, __p3_180) __extension__ ({ \
40677 float32x4_t __s0_180 = __p0_180; \
40678 float32x4_t __s1_180 = __p1_180; \
40679 float32x2_t __s2_180 = __p2_180; \
40680 float32x4_t __rev0_180; __rev0_180 = __builtin_shufflevector(__s0_180, __s0_180, 3, 2, 1, 0); \
40681 float32x4_t __rev1_180; __rev1_180 = __builtin_shufflevector(__s1_180, __s1_180, 3, 2, 1, 0); \
40682 float32x2_t __rev2_180; __rev2_180 = __builtin_shufflevector(__s2_180, __s2_180, 1, 0); \
40683 float32x4_t __ret_180; \
40684float32x2_t __reint_180 = __rev2_180; \
40685uint64x2_t __reint1_180 = (uint64x2_t) {vget_lane_u64(*(uint64x1_t *) &__reint_180, __p3_180), vget_lane_u64(*(uint64x1_t *) &__reint_180, __p3_180)}; \
40686 __ret_180 = __noswap_vcmlaq_rot180_f32(__rev0_180, __rev1_180, *(float32x4_t *) &__reint1_180); \
40687 __ret_180 = __builtin_shufflevector(__ret_180, __ret_180, 3, 2, 1, 0); \
40688 __ret_180; \
40689})
40690#endif
40691
40692#ifdef __LITTLE_ENDIAN__
40693#define vcmla_rot180_laneq_f32(__p0_181, __p1_181, __p2_181, __p3_181) __extension__ ({ \
40694 float32x2_t __s0_181 = __p0_181; \
40695 float32x2_t __s1_181 = __p1_181; \
40696 float32x4_t __s2_181 = __p2_181; \
40697 float32x2_t __ret_181; \
40698float32x4_t __reint_181 = __s2_181; \
40699uint64x1_t __reint1_181 = (uint64x1_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_181, __p3_181)}; \
40700 __ret_181 = vcmla_rot180_f32(__s0_181, __s1_181, *(float32x2_t *) &__reint1_181); \
40701 __ret_181; \
40702})
40703#else
40704#define vcmla_rot180_laneq_f32(__p0_182, __p1_182, __p2_182, __p3_182) __extension__ ({ \
40705 float32x2_t __s0_182 = __p0_182; \
40706 float32x2_t __s1_182 = __p1_182; \
40707 float32x4_t __s2_182 = __p2_182; \
40708 float32x2_t __rev0_182; __rev0_182 = __builtin_shufflevector(__s0_182, __s0_182, 1, 0); \
40709 float32x2_t __rev1_182; __rev1_182 = __builtin_shufflevector(__s1_182, __s1_182, 1, 0); \
40710 float32x4_t __rev2_182; __rev2_182 = __builtin_shufflevector(__s2_182, __s2_182, 3, 2, 1, 0); \
40711 float32x2_t __ret_182; \
40712float32x4_t __reint_182 = __rev2_182; \
40713uint64x1_t __reint1_182 = (uint64x1_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_182, __p3_182)}; \
40714 __ret_182 = __noswap_vcmla_rot180_f32(__rev0_182, __rev1_182, *(float32x2_t *) &__reint1_182); \
40715 __ret_182 = __builtin_shufflevector(__ret_182, __ret_182, 1, 0); \
40716 __ret_182; \
40717})
40718#endif
40719
40720#ifdef __LITTLE_ENDIAN__
40721#define vcmlaq_rot180_laneq_f32(__p0_183, __p1_183, __p2_183, __p3_183) __extension__ ({ \
40722 float32x4_t __s0_183 = __p0_183; \
40723 float32x4_t __s1_183 = __p1_183; \
40724 float32x4_t __s2_183 = __p2_183; \
40725 float32x4_t __ret_183; \
40726float32x4_t __reint_183 = __s2_183; \
40727uint64x2_t __reint1_183 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_183, __p3_183), vgetq_lane_u64(*(uint64x2_t *) &__reint_183, __p3_183)}; \
40728 __ret_183 = vcmlaq_rot180_f32(__s0_183, __s1_183, *(float32x4_t *) &__reint1_183); \
40729 __ret_183; \
40730})
40731#else
40732#define vcmlaq_rot180_laneq_f32(__p0_184, __p1_184, __p2_184, __p3_184) __extension__ ({ \
40733 float32x4_t __s0_184 = __p0_184; \
40734 float32x4_t __s1_184 = __p1_184; \
40735 float32x4_t __s2_184 = __p2_184; \
40736 float32x4_t __rev0_184; __rev0_184 = __builtin_shufflevector(__s0_184, __s0_184, 3, 2, 1, 0); \
40737 float32x4_t __rev1_184; __rev1_184 = __builtin_shufflevector(__s1_184, __s1_184, 3, 2, 1, 0); \
40738 float32x4_t __rev2_184; __rev2_184 = __builtin_shufflevector(__s2_184, __s2_184, 3, 2, 1, 0); \
40739 float32x4_t __ret_184; \
40740float32x4_t __reint_184 = __rev2_184; \
40741uint64x2_t __reint1_184 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_184, __p3_184), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_184, __p3_184)}; \
40742 __ret_184 = __noswap_vcmlaq_rot180_f32(__rev0_184, __rev1_184, *(float32x4_t *) &__reint1_184); \
40743 __ret_184 = __builtin_shufflevector(__ret_184, __ret_184, 3, 2, 1, 0); \
40744 __ret_184; \
40745})
40746#endif
40747
40748#ifdef __LITTLE_ENDIAN__
40749__ai float32x4_t vcmlaq_rot270_f32(float32x4_t __p0, float32x4_t __p1, float32x4_t __p2) {
40750 float32x4_t __ret;
40751 __ret = (float32x4_t) __builtin_neon_vcmlaq_rot270_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 41);
40752 return __ret;
40753}
40754#else
40755__ai float32x4_t vcmlaq_rot270_f32(float32x4_t __p0, float32x4_t __p1, float32x4_t __p2) {
40756 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
40757 float32x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);
40758 float32x4_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 3, 2, 1, 0);
40759 float32x4_t __ret;
40760 __ret = (float32x4_t) __builtin_neon_vcmlaq_rot270_v((int8x16_t)__rev0, (int8x16_t)__rev1, (int8x16_t)__rev2, 41);
40761 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);
40762 return __ret;
40763}
40764__ai float32x4_t __noswap_vcmlaq_rot270_f32(float32x4_t __p0, float32x4_t __p1, float32x4_t __p2) {
40765 float32x4_t __ret;
40766 __ret = (float32x4_t) __builtin_neon_vcmlaq_rot270_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 41);
40767 return __ret;
40768}
40769#endif
40770
40771#ifdef __LITTLE_ENDIAN__
40772__ai float32x2_t vcmla_rot270_f32(float32x2_t __p0, float32x2_t __p1, float32x2_t __p2) {
40773 float32x2_t __ret;
40774 __ret = (float32x2_t) __builtin_neon_vcmla_rot270_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 9);
40775 return __ret;
40776}
40777#else
40778__ai float32x2_t vcmla_rot270_f32(float32x2_t __p0, float32x2_t __p1, float32x2_t __p2) {
40779 float32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
40780 float32x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
40781 float32x2_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 1, 0);
40782 float32x2_t __ret;
40783 __ret = (float32x2_t) __builtin_neon_vcmla_rot270_v((int8x8_t)__rev0, (int8x8_t)__rev1, (int8x8_t)__rev2, 9);
40784 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
40785 return __ret;
40786}
40787__ai float32x2_t __noswap_vcmla_rot270_f32(float32x2_t __p0, float32x2_t __p1, float32x2_t __p2) {
40788 float32x2_t __ret;
40789 __ret = (float32x2_t) __builtin_neon_vcmla_rot270_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 9);
40790 return __ret;
40791}
40792#endif
40793
40794#ifdef __LITTLE_ENDIAN__
40795#define vcmla_rot270_lane_f32(__p0_185, __p1_185, __p2_185, __p3_185) __extension__ ({ \
40796 float32x2_t __s0_185 = __p0_185; \
40797 float32x2_t __s1_185 = __p1_185; \
40798 float32x2_t __s2_185 = __p2_185; \
40799 float32x2_t __ret_185; \
40800float32x2_t __reint_185 = __s2_185; \
40801uint64x1_t __reint1_185 = (uint64x1_t) {vget_lane_u64(*(uint64x1_t *) &__reint_185, __p3_185)}; \
40802 __ret_185 = vcmla_rot270_f32(__s0_185, __s1_185, *(float32x2_t *) &__reint1_185); \
40803 __ret_185; \
40804})
40805#else
40806#define vcmla_rot270_lane_f32(__p0_186, __p1_186, __p2_186, __p3_186) __extension__ ({ \
40807 float32x2_t __s0_186 = __p0_186; \
40808 float32x2_t __s1_186 = __p1_186; \
40809 float32x2_t __s2_186 = __p2_186; \
40810 float32x2_t __rev0_186; __rev0_186 = __builtin_shufflevector(__s0_186, __s0_186, 1, 0); \
40811 float32x2_t __rev1_186; __rev1_186 = __builtin_shufflevector(__s1_186, __s1_186, 1, 0); \
40812 float32x2_t __rev2_186; __rev2_186 = __builtin_shufflevector(__s2_186, __s2_186, 1, 0); \
40813 float32x2_t __ret_186; \
40814float32x2_t __reint_186 = __rev2_186; \
40815uint64x1_t __reint1_186 = (uint64x1_t) {vget_lane_u64(*(uint64x1_t *) &__reint_186, __p3_186)}; \
40816 __ret_186 = __noswap_vcmla_rot270_f32(__rev0_186, __rev1_186, *(float32x2_t *) &__reint1_186); \
40817 __ret_186 = __builtin_shufflevector(__ret_186, __ret_186, 1, 0); \
40818 __ret_186; \
40819})
40820#endif
40821
40822#ifdef __LITTLE_ENDIAN__
40823#define vcmlaq_rot270_lane_f32(__p0_187, __p1_187, __p2_187, __p3_187) __extension__ ({ \
40824 float32x4_t __s0_187 = __p0_187; \
40825 float32x4_t __s1_187 = __p1_187; \
40826 float32x2_t __s2_187 = __p2_187; \
40827 float32x4_t __ret_187; \
40828float32x2_t __reint_187 = __s2_187; \
40829uint64x2_t __reint1_187 = (uint64x2_t) {vget_lane_u64(*(uint64x1_t *) &__reint_187, __p3_187), vget_lane_u64(*(uint64x1_t *) &__reint_187, __p3_187)}; \
40830 __ret_187 = vcmlaq_rot270_f32(__s0_187, __s1_187, *(float32x4_t *) &__reint1_187); \
40831 __ret_187; \
40832})
40833#else
40834#define vcmlaq_rot270_lane_f32(__p0_188, __p1_188, __p2_188, __p3_188) __extension__ ({ \
40835 float32x4_t __s0_188 = __p0_188; \
40836 float32x4_t __s1_188 = __p1_188; \
40837 float32x2_t __s2_188 = __p2_188; \
40838 float32x4_t __rev0_188; __rev0_188 = __builtin_shufflevector(__s0_188, __s0_188, 3, 2, 1, 0); \
40839 float32x4_t __rev1_188; __rev1_188 = __builtin_shufflevector(__s1_188, __s1_188, 3, 2, 1, 0); \
40840 float32x2_t __rev2_188; __rev2_188 = __builtin_shufflevector(__s2_188, __s2_188, 1, 0); \
40841 float32x4_t __ret_188; \
40842float32x2_t __reint_188 = __rev2_188; \
40843uint64x2_t __reint1_188 = (uint64x2_t) {vget_lane_u64(*(uint64x1_t *) &__reint_188, __p3_188), vget_lane_u64(*(uint64x1_t *) &__reint_188, __p3_188)}; \
40844 __ret_188 = __noswap_vcmlaq_rot270_f32(__rev0_188, __rev1_188, *(float32x4_t *) &__reint1_188); \
40845 __ret_188 = __builtin_shufflevector(__ret_188, __ret_188, 3, 2, 1, 0); \
40846 __ret_188; \
40847})
40848#endif
40849
40850#ifdef __LITTLE_ENDIAN__
40851#define vcmla_rot270_laneq_f32(__p0_189, __p1_189, __p2_189, __p3_189) __extension__ ({ \
40852 float32x2_t __s0_189 = __p0_189; \
40853 float32x2_t __s1_189 = __p1_189; \
40854 float32x4_t __s2_189 = __p2_189; \
40855 float32x2_t __ret_189; \
40856float32x4_t __reint_189 = __s2_189; \
40857uint64x1_t __reint1_189 = (uint64x1_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_189, __p3_189)}; \
40858 __ret_189 = vcmla_rot270_f32(__s0_189, __s1_189, *(float32x2_t *) &__reint1_189); \
40859 __ret_189; \
40860})
40861#else
40862#define vcmla_rot270_laneq_f32(__p0_190, __p1_190, __p2_190, __p3_190) __extension__ ({ \
40863 float32x2_t __s0_190 = __p0_190; \
40864 float32x2_t __s1_190 = __p1_190; \
40865 float32x4_t __s2_190 = __p2_190; \
40866 float32x2_t __rev0_190; __rev0_190 = __builtin_shufflevector(__s0_190, __s0_190, 1, 0); \
40867 float32x2_t __rev1_190; __rev1_190 = __builtin_shufflevector(__s1_190, __s1_190, 1, 0); \
40868 float32x4_t __rev2_190; __rev2_190 = __builtin_shufflevector(__s2_190, __s2_190, 3, 2, 1, 0); \
40869 float32x2_t __ret_190; \
40870float32x4_t __reint_190 = __rev2_190; \
40871uint64x1_t __reint1_190 = (uint64x1_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_190, __p3_190)}; \
40872 __ret_190 = __noswap_vcmla_rot270_f32(__rev0_190, __rev1_190, *(float32x2_t *) &__reint1_190); \
40873 __ret_190 = __builtin_shufflevector(__ret_190, __ret_190, 1, 0); \
40874 __ret_190; \
40875})
40876#endif
40877
40878#ifdef __LITTLE_ENDIAN__
40879#define vcmlaq_rot270_laneq_f32(__p0_191, __p1_191, __p2_191, __p3_191) __extension__ ({ \
40880 float32x4_t __s0_191 = __p0_191; \
40881 float32x4_t __s1_191 = __p1_191; \
40882 float32x4_t __s2_191 = __p2_191; \
40883 float32x4_t __ret_191; \
40884float32x4_t __reint_191 = __s2_191; \
40885uint64x2_t __reint1_191 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_191, __p3_191), vgetq_lane_u64(*(uint64x2_t *) &__reint_191, __p3_191)}; \
40886 __ret_191 = vcmlaq_rot270_f32(__s0_191, __s1_191, *(float32x4_t *) &__reint1_191); \
40887 __ret_191; \
40888})
40889#else
40890#define vcmlaq_rot270_laneq_f32(__p0_192, __p1_192, __p2_192, __p3_192) __extension__ ({ \
40891 float32x4_t __s0_192 = __p0_192; \
40892 float32x4_t __s1_192 = __p1_192; \
40893 float32x4_t __s2_192 = __p2_192; \
40894 float32x4_t __rev0_192; __rev0_192 = __builtin_shufflevector(__s0_192, __s0_192, 3, 2, 1, 0); \
40895 float32x4_t __rev1_192; __rev1_192 = __builtin_shufflevector(__s1_192, __s1_192, 3, 2, 1, 0); \
40896 float32x4_t __rev2_192; __rev2_192 = __builtin_shufflevector(__s2_192, __s2_192, 3, 2, 1, 0); \
40897 float32x4_t __ret_192; \
40898float32x4_t __reint_192 = __rev2_192; \
40899uint64x2_t __reint1_192 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_192, __p3_192), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_192, __p3_192)}; \
40900 __ret_192 = __noswap_vcmlaq_rot270_f32(__rev0_192, __rev1_192, *(float32x4_t *) &__reint1_192); \
40901 __ret_192 = __builtin_shufflevector(__ret_192, __ret_192, 3, 2, 1, 0); \
40902 __ret_192; \
40903})
40904#endif
40905
40906#ifdef __LITTLE_ENDIAN__
40907__ai float32x4_t vcmlaq_rot90_f32(float32x4_t __p0, float32x4_t __p1, float32x4_t __p2) {
40908 float32x4_t __ret;
40909 __ret = (float32x4_t) __builtin_neon_vcmlaq_rot90_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 41);
40910 return __ret;
40911}
40912#else
40913__ai float32x4_t vcmlaq_rot90_f32(float32x4_t __p0, float32x4_t __p1, float32x4_t __p2) {
40914 float32x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
40915 float32x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);
40916 float32x4_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 3, 2, 1, 0);
40917 float32x4_t __ret;
40918 __ret = (float32x4_t) __builtin_neon_vcmlaq_rot90_v((int8x16_t)__rev0, (int8x16_t)__rev1, (int8x16_t)__rev2, 41);
40919 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);
40920 return __ret;
40921}
40922__ai float32x4_t __noswap_vcmlaq_rot90_f32(float32x4_t __p0, float32x4_t __p1, float32x4_t __p2) {
40923 float32x4_t __ret;
40924 __ret = (float32x4_t) __builtin_neon_vcmlaq_rot90_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 41);
40925 return __ret;
40926}
40927#endif
40928
40929#ifdef __LITTLE_ENDIAN__
40930__ai float32x2_t vcmla_rot90_f32(float32x2_t __p0, float32x2_t __p1, float32x2_t __p2) {
40931 float32x2_t __ret;
40932 __ret = (float32x2_t) __builtin_neon_vcmla_rot90_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 9);
40933 return __ret;
40934}
40935#else
40936__ai float32x2_t vcmla_rot90_f32(float32x2_t __p0, float32x2_t __p1, float32x2_t __p2) {
40937 float32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
40938 float32x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
40939 float32x2_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 1, 0);
40940 float32x2_t __ret;
40941 __ret = (float32x2_t) __builtin_neon_vcmla_rot90_v((int8x8_t)__rev0, (int8x8_t)__rev1, (int8x8_t)__rev2, 9);
40942 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
40943 return __ret;
40944}
40945__ai float32x2_t __noswap_vcmla_rot90_f32(float32x2_t __p0, float32x2_t __p1, float32x2_t __p2) {
40946 float32x2_t __ret;
40947 __ret = (float32x2_t) __builtin_neon_vcmla_rot90_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 9);
40948 return __ret;
40949}
40950#endif
40951
40952#ifdef __LITTLE_ENDIAN__
40953#define vcmla_rot90_lane_f32(__p0_193, __p1_193, __p2_193, __p3_193) __extension__ ({ \
40954 float32x2_t __s0_193 = __p0_193; \
40955 float32x2_t __s1_193 = __p1_193; \
40956 float32x2_t __s2_193 = __p2_193; \
40957 float32x2_t __ret_193; \
40958float32x2_t __reint_193 = __s2_193; \
40959uint64x1_t __reint1_193 = (uint64x1_t) {vget_lane_u64(*(uint64x1_t *) &__reint_193, __p3_193)}; \
40960 __ret_193 = vcmla_rot90_f32(__s0_193, __s1_193, *(float32x2_t *) &__reint1_193); \
40961 __ret_193; \
40962})
40963#else
40964#define vcmla_rot90_lane_f32(__p0_194, __p1_194, __p2_194, __p3_194) __extension__ ({ \
40965 float32x2_t __s0_194 = __p0_194; \
40966 float32x2_t __s1_194 = __p1_194; \
40967 float32x2_t __s2_194 = __p2_194; \
40968 float32x2_t __rev0_194; __rev0_194 = __builtin_shufflevector(__s0_194, __s0_194, 1, 0); \
40969 float32x2_t __rev1_194; __rev1_194 = __builtin_shufflevector(__s1_194, __s1_194, 1, 0); \
40970 float32x2_t __rev2_194; __rev2_194 = __builtin_shufflevector(__s2_194, __s2_194, 1, 0); \
40971 float32x2_t __ret_194; \
40972float32x2_t __reint_194 = __rev2_194; \
40973uint64x1_t __reint1_194 = (uint64x1_t) {vget_lane_u64(*(uint64x1_t *) &__reint_194, __p3_194)}; \
40974 __ret_194 = __noswap_vcmla_rot90_f32(__rev0_194, __rev1_194, *(float32x2_t *) &__reint1_194); \
40975 __ret_194 = __builtin_shufflevector(__ret_194, __ret_194, 1, 0); \
40976 __ret_194; \
40977})
40978#endif
40979
40980#ifdef __LITTLE_ENDIAN__
40981#define vcmlaq_rot90_lane_f32(__p0_195, __p1_195, __p2_195, __p3_195) __extension__ ({ \
40982 float32x4_t __s0_195 = __p0_195; \
40983 float32x4_t __s1_195 = __p1_195; \
40984 float32x2_t __s2_195 = __p2_195; \
40985 float32x4_t __ret_195; \
40986float32x2_t __reint_195 = __s2_195; \
40987uint64x2_t __reint1_195 = (uint64x2_t) {vget_lane_u64(*(uint64x1_t *) &__reint_195, __p3_195), vget_lane_u64(*(uint64x1_t *) &__reint_195, __p3_195)}; \
40988 __ret_195 = vcmlaq_rot90_f32(__s0_195, __s1_195, *(float32x4_t *) &__reint1_195); \
40989 __ret_195; \
40990})
40991#else
40992#define vcmlaq_rot90_lane_f32(__p0_196, __p1_196, __p2_196, __p3_196) __extension__ ({ \
40993 float32x4_t __s0_196 = __p0_196; \
40994 float32x4_t __s1_196 = __p1_196; \
40995 float32x2_t __s2_196 = __p2_196; \
40996 float32x4_t __rev0_196; __rev0_196 = __builtin_shufflevector(__s0_196, __s0_196, 3, 2, 1, 0); \
40997 float32x4_t __rev1_196; __rev1_196 = __builtin_shufflevector(__s1_196, __s1_196, 3, 2, 1, 0); \
40998 float32x2_t __rev2_196; __rev2_196 = __builtin_shufflevector(__s2_196, __s2_196, 1, 0); \
40999 float32x4_t __ret_196; \
41000float32x2_t __reint_196 = __rev2_196; \
41001uint64x2_t __reint1_196 = (uint64x2_t) {vget_lane_u64(*(uint64x1_t *) &__reint_196, __p3_196), vget_lane_u64(*(uint64x1_t *) &__reint_196, __p3_196)}; \
41002 __ret_196 = __noswap_vcmlaq_rot90_f32(__rev0_196, __rev1_196, *(float32x4_t *) &__reint1_196); \
41003 __ret_196 = __builtin_shufflevector(__ret_196, __ret_196, 3, 2, 1, 0); \
41004 __ret_196; \
41005})
41006#endif
41007
41008#ifdef __LITTLE_ENDIAN__
41009#define vcmla_rot90_laneq_f32(__p0_197, __p1_197, __p2_197, __p3_197) __extension__ ({ \
41010 float32x2_t __s0_197 = __p0_197; \
41011 float32x2_t __s1_197 = __p1_197; \
41012 float32x4_t __s2_197 = __p2_197; \
41013 float32x2_t __ret_197; \
41014float32x4_t __reint_197 = __s2_197; \
41015uint64x1_t __reint1_197 = (uint64x1_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_197, __p3_197)}; \
41016 __ret_197 = vcmla_rot90_f32(__s0_197, __s1_197, *(float32x2_t *) &__reint1_197); \
41017 __ret_197; \
41018})
41019#else
41020#define vcmla_rot90_laneq_f32(__p0_198, __p1_198, __p2_198, __p3_198) __extension__ ({ \
41021 float32x2_t __s0_198 = __p0_198; \
41022 float32x2_t __s1_198 = __p1_198; \
41023 float32x4_t __s2_198 = __p2_198; \
41024 float32x2_t __rev0_198; __rev0_198 = __builtin_shufflevector(__s0_198, __s0_198, 1, 0); \
41025 float32x2_t __rev1_198; __rev1_198 = __builtin_shufflevector(__s1_198, __s1_198, 1, 0); \
41026 float32x4_t __rev2_198; __rev2_198 = __builtin_shufflevector(__s2_198, __s2_198, 3, 2, 1, 0); \
41027 float32x2_t __ret_198; \
41028float32x4_t __reint_198 = __rev2_198; \
41029uint64x1_t __reint1_198 = (uint64x1_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_198, __p3_198)}; \
41030 __ret_198 = __noswap_vcmla_rot90_f32(__rev0_198, __rev1_198, *(float32x2_t *) &__reint1_198); \
41031 __ret_198 = __builtin_shufflevector(__ret_198, __ret_198, 1, 0); \
41032 __ret_198; \
41033})
41034#endif
41035
41036#ifdef __LITTLE_ENDIAN__
41037#define vcmlaq_rot90_laneq_f32(__p0_199, __p1_199, __p2_199, __p3_199) __extension__ ({ \
41038 float32x4_t __s0_199 = __p0_199; \
41039 float32x4_t __s1_199 = __p1_199; \
41040 float32x4_t __s2_199 = __p2_199; \
41041 float32x4_t __ret_199; \
41042float32x4_t __reint_199 = __s2_199; \
41043uint64x2_t __reint1_199 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_199, __p3_199), vgetq_lane_u64(*(uint64x2_t *) &__reint_199, __p3_199)}; \
41044 __ret_199 = vcmlaq_rot90_f32(__s0_199, __s1_199, *(float32x4_t *) &__reint1_199); \
41045 __ret_199; \
41046})
41047#else
41048#define vcmlaq_rot90_laneq_f32(__p0_200, __p1_200, __p2_200, __p3_200) __extension__ ({ \
41049 float32x4_t __s0_200 = __p0_200; \
41050 float32x4_t __s1_200 = __p1_200; \
41051 float32x4_t __s2_200 = __p2_200; \
41052 float32x4_t __rev0_200; __rev0_200 = __builtin_shufflevector(__s0_200, __s0_200, 3, 2, 1, 0); \
41053 float32x4_t __rev1_200; __rev1_200 = __builtin_shufflevector(__s1_200, __s1_200, 3, 2, 1, 0); \
41054 float32x4_t __rev2_200; __rev2_200 = __builtin_shufflevector(__s2_200, __s2_200, 3, 2, 1, 0); \
41055 float32x4_t __ret_200; \
41056float32x4_t __reint_200 = __rev2_200; \
41057uint64x2_t __reint1_200 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_200, __p3_200), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_200, __p3_200)}; \
41058 __ret_200 = __noswap_vcmlaq_rot90_f32(__rev0_200, __rev1_200, *(float32x4_t *) &__reint1_200); \
41059 __ret_200 = __builtin_shufflevector(__ret_200, __ret_200, 3, 2, 1, 0); \
41060 __ret_200; \
41061})
41062#endif
41063
41064#endif
41065#if defined(__ARM_FEATURE_COMPLEX) && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
41066#ifdef __LITTLE_ENDIAN__
41067__ai float16x4_t vcadd_rot270_f16(float16x4_t __p0, float16x4_t __p1) {
41068 float16x4_t __ret;
41069 __ret = (float16x4_t) __builtin_neon_vcadd_rot270_v((int8x8_t)__p0, (int8x8_t)__p1, 8);
41070 return __ret;
41071}
41072#else
41073__ai float16x4_t vcadd_rot270_f16(float16x4_t __p0, float16x4_t __p1) {
41074 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
41075 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);
41076 float16x4_t __ret;
41077 __ret = (float16x4_t) __builtin_neon_vcadd_rot270_v((int8x8_t)__rev0, (int8x8_t)__rev1, 8);
41078 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);
41079 return __ret;
41080}
41081#endif
41082
41083#ifdef __LITTLE_ENDIAN__
41084__ai float16x4_t vcadd_rot90_f16(float16x4_t __p0, float16x4_t __p1) {
41085 float16x4_t __ret;
41086 __ret = (float16x4_t) __builtin_neon_vcadd_rot90_v((int8x8_t)__p0, (int8x8_t)__p1, 8);
41087 return __ret;
41088}
41089#else
41090__ai float16x4_t vcadd_rot90_f16(float16x4_t __p0, float16x4_t __p1) {
41091 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
41092 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);
41093 float16x4_t __ret;
41094 __ret = (float16x4_t) __builtin_neon_vcadd_rot90_v((int8x8_t)__rev0, (int8x8_t)__rev1, 8);
41095 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);
41096 return __ret;
41097}
41098#endif
41099
41100#ifdef __LITTLE_ENDIAN__
41101__ai float16x8_t vcaddq_rot270_f16(float16x8_t __p0, float16x8_t __p1) {
41102 float16x8_t __ret;
41103 __ret = (float16x8_t) __builtin_neon_vcaddq_rot270_v((int8x16_t)__p0, (int8x16_t)__p1, 40);
41104 return __ret;
41105}
41106#else
41107__ai float16x8_t vcaddq_rot270_f16(float16x8_t __p0, float16x8_t __p1) {
41108 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);
41109 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 7, 6, 5, 4, 3, 2, 1, 0);
41110 float16x8_t __ret;
41111 __ret = (float16x8_t) __builtin_neon_vcaddq_rot270_v((int8x16_t)__rev0, (int8x16_t)__rev1, 40);
41112 __ret = __builtin_shufflevector(__ret, __ret, 7, 6, 5, 4, 3, 2, 1, 0);
41113 return __ret;
41114}
41115#endif
41116
41117#ifdef __LITTLE_ENDIAN__
41118__ai float16x8_t vcaddq_rot90_f16(float16x8_t __p0, float16x8_t __p1) {
41119 float16x8_t __ret;
41120 __ret = (float16x8_t) __builtin_neon_vcaddq_rot90_v((int8x16_t)__p0, (int8x16_t)__p1, 40);
41121 return __ret;
41122}
41123#else
41124__ai float16x8_t vcaddq_rot90_f16(float16x8_t __p0, float16x8_t __p1) {
41125 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);
41126 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 7, 6, 5, 4, 3, 2, 1, 0);
41127 float16x8_t __ret;
41128 __ret = (float16x8_t) __builtin_neon_vcaddq_rot90_v((int8x16_t)__rev0, (int8x16_t)__rev1, 40);
41129 __ret = __builtin_shufflevector(__ret, __ret, 7, 6, 5, 4, 3, 2, 1, 0);
41130 return __ret;
41131}
41132#endif
41133
41134#ifdef __LITTLE_ENDIAN__
41135__ai float16x8_t vcmlaq_f16(float16x8_t __p0, float16x8_t __p1, float16x8_t __p2) {
41136 float16x8_t __ret;
41137 __ret = (float16x8_t) __builtin_neon_vcmlaq_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 40);
41138 return __ret;
41139}
41140#else
41141__ai float16x8_t vcmlaq_f16(float16x8_t __p0, float16x8_t __p1, float16x8_t __p2) {
41142 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);
41143 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 7, 6, 5, 4, 3, 2, 1, 0);
41144 float16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 7, 6, 5, 4, 3, 2, 1, 0);
41145 float16x8_t __ret;
41146 __ret = (float16x8_t) __builtin_neon_vcmlaq_v((int8x16_t)__rev0, (int8x16_t)__rev1, (int8x16_t)__rev2, 40);
41147 __ret = __builtin_shufflevector(__ret, __ret, 7, 6, 5, 4, 3, 2, 1, 0);
41148 return __ret;
41149}
41150__ai float16x8_t __noswap_vcmlaq_f16(float16x8_t __p0, float16x8_t __p1, float16x8_t __p2) {
41151 float16x8_t __ret;
41152 __ret = (float16x8_t) __builtin_neon_vcmlaq_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 40);
41153 return __ret;
41154}
41155#endif
41156
41157#ifdef __LITTLE_ENDIAN__
41158__ai float16x4_t vcmla_f16(float16x4_t __p0, float16x4_t __p1, float16x4_t __p2) {
41159 float16x4_t __ret;
41160 __ret = (float16x4_t) __builtin_neon_vcmla_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 8);
41161 return __ret;
41162}
41163#else
41164__ai float16x4_t vcmla_f16(float16x4_t __p0, float16x4_t __p1, float16x4_t __p2) {
41165 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
41166 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);
41167 float16x4_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 3, 2, 1, 0);
41168 float16x4_t __ret;
41169 __ret = (float16x4_t) __builtin_neon_vcmla_v((int8x8_t)__rev0, (int8x8_t)__rev1, (int8x8_t)__rev2, 8);
41170 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);
41171 return __ret;
41172}
41173__ai float16x4_t __noswap_vcmla_f16(float16x4_t __p0, float16x4_t __p1, float16x4_t __p2) {
41174 float16x4_t __ret;
41175 __ret = (float16x4_t) __builtin_neon_vcmla_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 8);
41176 return __ret;
41177}
41178#endif
41179
41180#ifdef __LITTLE_ENDIAN__
41181#define vcmla_lane_f16(__p0_201, __p1_201, __p2_201, __p3_201) __extension__ ({ \
41182 float16x4_t __s0_201 = __p0_201; \
41183 float16x4_t __s1_201 = __p1_201; \
41184 float16x4_t __s2_201 = __p2_201; \
41185 float16x4_t __ret_201; \
41186float16x4_t __reint_201 = __s2_201; \
41187uint32x2_t __reint1_201 = (uint32x2_t) {vget_lane_u32(*(uint32x2_t *) &__reint_201, __p3_201), vget_lane_u32(*(uint32x2_t *) &__reint_201, __p3_201)}; \
41188 __ret_201 = vcmla_f16(__s0_201, __s1_201, *(float16x4_t *) &__reint1_201); \
41189 __ret_201; \
41190})
41191#else
41192#define vcmla_lane_f16(__p0_202, __p1_202, __p2_202, __p3_202) __extension__ ({ \
41193 float16x4_t __s0_202 = __p0_202; \
41194 float16x4_t __s1_202 = __p1_202; \
41195 float16x4_t __s2_202 = __p2_202; \
41196 float16x4_t __rev0_202; __rev0_202 = __builtin_shufflevector(__s0_202, __s0_202, 3, 2, 1, 0); \
41197 float16x4_t __rev1_202; __rev1_202 = __builtin_shufflevector(__s1_202, __s1_202, 3, 2, 1, 0); \
41198 float16x4_t __rev2_202; __rev2_202 = __builtin_shufflevector(__s2_202, __s2_202, 3, 2, 1, 0); \
41199 float16x4_t __ret_202; \
41200float16x4_t __reint_202 = __rev2_202; \
41201uint32x2_t __reint1_202 = (uint32x2_t) {__noswap_vget_lane_u32(*(uint32x2_t *) &__reint_202, __p3_202), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_202, __p3_202)}; \
41202 __ret_202 = __noswap_vcmla_f16(__rev0_202, __rev1_202, *(float16x4_t *) &__reint1_202); \
41203 __ret_202 = __builtin_shufflevector(__ret_202, __ret_202, 3, 2, 1, 0); \
41204 __ret_202; \
41205})
41206#endif
41207
41208#ifdef __LITTLE_ENDIAN__
41209#define vcmlaq_lane_f16(__p0_203, __p1_203, __p2_203, __p3_203) __extension__ ({ \
41210 float16x8_t __s0_203 = __p0_203; \
41211 float16x8_t __s1_203 = __p1_203; \
41212 float16x4_t __s2_203 = __p2_203; \
41213 float16x8_t __ret_203; \
41214float16x4_t __reint_203 = __s2_203; \
41215uint32x4_t __reint1_203 = (uint32x4_t) {vget_lane_u32(*(uint32x2_t *) &__reint_203, __p3_203), vget_lane_u32(*(uint32x2_t *) &__reint_203, __p3_203), vget_lane_u32(*(uint32x2_t *) &__reint_203, __p3_203), vget_lane_u32(*(uint32x2_t *) &__reint_203, __p3_203)}; \
41216 __ret_203 = vcmlaq_f16(__s0_203, __s1_203, *(float16x8_t *) &__reint1_203); \
41217 __ret_203; \
41218})
41219#else
41220#define vcmlaq_lane_f16(__p0_204, __p1_204, __p2_204, __p3_204) __extension__ ({ \
41221 float16x8_t __s0_204 = __p0_204; \
41222 float16x8_t __s1_204 = __p1_204; \
41223 float16x4_t __s2_204 = __p2_204; \
41224 float16x8_t __rev0_204; __rev0_204 = __builtin_shufflevector(__s0_204, __s0_204, 7, 6, 5, 4, 3, 2, 1, 0); \
41225 float16x8_t __rev1_204; __rev1_204 = __builtin_shufflevector(__s1_204, __s1_204, 7, 6, 5, 4, 3, 2, 1, 0); \
41226 float16x4_t __rev2_204; __rev2_204 = __builtin_shufflevector(__s2_204, __s2_204, 3, 2, 1, 0); \
41227 float16x8_t __ret_204; \
41228float16x4_t __reint_204 = __rev2_204; \
41229uint32x4_t __reint1_204 = (uint32x4_t) {__noswap_vget_lane_u32(*(uint32x2_t *) &__reint_204, __p3_204), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_204, __p3_204), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_204, __p3_204), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_204, __p3_204)}; \
41230 __ret_204 = __noswap_vcmlaq_f16(__rev0_204, __rev1_204, *(float16x8_t *) &__reint1_204); \
41231 __ret_204 = __builtin_shufflevector(__ret_204, __ret_204, 7, 6, 5, 4, 3, 2, 1, 0); \
41232 __ret_204; \
41233})
41234#endif
41235
41236#ifdef __LITTLE_ENDIAN__
41237#define vcmla_laneq_f16(__p0_205, __p1_205, __p2_205, __p3_205) __extension__ ({ \
41238 float16x4_t __s0_205 = __p0_205; \
41239 float16x4_t __s1_205 = __p1_205; \
41240 float16x8_t __s2_205 = __p2_205; \
41241 float16x4_t __ret_205; \
41242float16x8_t __reint_205 = __s2_205; \
41243uint32x2_t __reint1_205 = (uint32x2_t) {vgetq_lane_u32(*(uint32x4_t *) &__reint_205, __p3_205), vgetq_lane_u32(*(uint32x4_t *) &__reint_205, __p3_205)}; \
41244 __ret_205 = vcmla_f16(__s0_205, __s1_205, *(float16x4_t *) &__reint1_205); \
41245 __ret_205; \
41246})
41247#else
41248#define vcmla_laneq_f16(__p0_206, __p1_206, __p2_206, __p3_206) __extension__ ({ \
41249 float16x4_t __s0_206 = __p0_206; \
41250 float16x4_t __s1_206 = __p1_206; \
41251 float16x8_t __s2_206 = __p2_206; \
41252 float16x4_t __rev0_206; __rev0_206 = __builtin_shufflevector(__s0_206, __s0_206, 3, 2, 1, 0); \
41253 float16x4_t __rev1_206; __rev1_206 = __builtin_shufflevector(__s1_206, __s1_206, 3, 2, 1, 0); \
41254 float16x8_t __rev2_206; __rev2_206 = __builtin_shufflevector(__s2_206, __s2_206, 7, 6, 5, 4, 3, 2, 1, 0); \
41255 float16x4_t __ret_206; \
41256float16x8_t __reint_206 = __rev2_206; \
41257uint32x2_t __reint1_206 = (uint32x2_t) {__noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_206, __p3_206), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_206, __p3_206)}; \
41258 __ret_206 = __noswap_vcmla_f16(__rev0_206, __rev1_206, *(float16x4_t *) &__reint1_206); \
41259 __ret_206 = __builtin_shufflevector(__ret_206, __ret_206, 3, 2, 1, 0); \
41260 __ret_206; \
41261})
41262#endif
41263
41264#ifdef __LITTLE_ENDIAN__
41265#define vcmlaq_laneq_f16(__p0_207, __p1_207, __p2_207, __p3_207) __extension__ ({ \
41266 float16x8_t __s0_207 = __p0_207; \
41267 float16x8_t __s1_207 = __p1_207; \
41268 float16x8_t __s2_207 = __p2_207; \
41269 float16x8_t __ret_207; \
41270float16x8_t __reint_207 = __s2_207; \
41271uint32x4_t __reint1_207 = (uint32x4_t) {vgetq_lane_u32(*(uint32x4_t *) &__reint_207, __p3_207), vgetq_lane_u32(*(uint32x4_t *) &__reint_207, __p3_207), vgetq_lane_u32(*(uint32x4_t *) &__reint_207, __p3_207), vgetq_lane_u32(*(uint32x4_t *) &__reint_207, __p3_207)}; \
41272 __ret_207 = vcmlaq_f16(__s0_207, __s1_207, *(float16x8_t *) &__reint1_207); \
41273 __ret_207; \
41274})
41275#else
41276#define vcmlaq_laneq_f16(__p0_208, __p1_208, __p2_208, __p3_208) __extension__ ({ \
41277 float16x8_t __s0_208 = __p0_208; \
41278 float16x8_t __s1_208 = __p1_208; \
41279 float16x8_t __s2_208 = __p2_208; \
41280 float16x8_t __rev0_208; __rev0_208 = __builtin_shufflevector(__s0_208, __s0_208, 7, 6, 5, 4, 3, 2, 1, 0); \
41281 float16x8_t __rev1_208; __rev1_208 = __builtin_shufflevector(__s1_208, __s1_208, 7, 6, 5, 4, 3, 2, 1, 0); \
41282 float16x8_t __rev2_208; __rev2_208 = __builtin_shufflevector(__s2_208, __s2_208, 7, 6, 5, 4, 3, 2, 1, 0); \
41283 float16x8_t __ret_208; \
41284float16x8_t __reint_208 = __rev2_208; \
41285uint32x4_t __reint1_208 = (uint32x4_t) {__noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_208, __p3_208), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_208, __p3_208), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_208, __p3_208), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_208, __p3_208)}; \
41286 __ret_208 = __noswap_vcmlaq_f16(__rev0_208, __rev1_208, *(float16x8_t *) &__reint1_208); \
41287 __ret_208 = __builtin_shufflevector(__ret_208, __ret_208, 7, 6, 5, 4, 3, 2, 1, 0); \
41288 __ret_208; \
41289})
41290#endif
41291
41292#ifdef __LITTLE_ENDIAN__
41293__ai float16x8_t vcmlaq_rot180_f16(float16x8_t __p0, float16x8_t __p1, float16x8_t __p2) {
41294 float16x8_t __ret;
41295 __ret = (float16x8_t) __builtin_neon_vcmlaq_rot180_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 40);
41296 return __ret;
41297}
41298#else
41299__ai float16x8_t vcmlaq_rot180_f16(float16x8_t __p0, float16x8_t __p1, float16x8_t __p2) {
41300 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);
41301 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 7, 6, 5, 4, 3, 2, 1, 0);
41302 float16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 7, 6, 5, 4, 3, 2, 1, 0);
41303 float16x8_t __ret;
41304 __ret = (float16x8_t) __builtin_neon_vcmlaq_rot180_v((int8x16_t)__rev0, (int8x16_t)__rev1, (int8x16_t)__rev2, 40);
41305 __ret = __builtin_shufflevector(__ret, __ret, 7, 6, 5, 4, 3, 2, 1, 0);
41306 return __ret;
41307}
41308__ai float16x8_t __noswap_vcmlaq_rot180_f16(float16x8_t __p0, float16x8_t __p1, float16x8_t __p2) {
41309 float16x8_t __ret;
41310 __ret = (float16x8_t) __builtin_neon_vcmlaq_rot180_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 40);
41311 return __ret;
41312}
41313#endif
41314
41315#ifdef __LITTLE_ENDIAN__
41316__ai float16x4_t vcmla_rot180_f16(float16x4_t __p0, float16x4_t __p1, float16x4_t __p2) {
41317 float16x4_t __ret;
41318 __ret = (float16x4_t) __builtin_neon_vcmla_rot180_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 8);
41319 return __ret;
41320}
41321#else
41322__ai float16x4_t vcmla_rot180_f16(float16x4_t __p0, float16x4_t __p1, float16x4_t __p2) {
41323 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
41324 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);
41325 float16x4_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 3, 2, 1, 0);
41326 float16x4_t __ret;
41327 __ret = (float16x4_t) __builtin_neon_vcmla_rot180_v((int8x8_t)__rev0, (int8x8_t)__rev1, (int8x8_t)__rev2, 8);
41328 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);
41329 return __ret;
41330}
41331__ai float16x4_t __noswap_vcmla_rot180_f16(float16x4_t __p0, float16x4_t __p1, float16x4_t __p2) {
41332 float16x4_t __ret;
41333 __ret = (float16x4_t) __builtin_neon_vcmla_rot180_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 8);
41334 return __ret;
41335}
41336#endif
41337
41338#ifdef __LITTLE_ENDIAN__
41339#define vcmla_rot180_lane_f16(__p0_209, __p1_209, __p2_209, __p3_209) __extension__ ({ \
41340 float16x4_t __s0_209 = __p0_209; \
41341 float16x4_t __s1_209 = __p1_209; \
41342 float16x4_t __s2_209 = __p2_209; \
41343 float16x4_t __ret_209; \
41344float16x4_t __reint_209 = __s2_209; \
41345uint32x2_t __reint1_209 = (uint32x2_t) {vget_lane_u32(*(uint32x2_t *) &__reint_209, __p3_209), vget_lane_u32(*(uint32x2_t *) &__reint_209, __p3_209)}; \
41346 __ret_209 = vcmla_rot180_f16(__s0_209, __s1_209, *(float16x4_t *) &__reint1_209); \
41347 __ret_209; \
41348})
41349#else
41350#define vcmla_rot180_lane_f16(__p0_210, __p1_210, __p2_210, __p3_210) __extension__ ({ \
41351 float16x4_t __s0_210 = __p0_210; \
41352 float16x4_t __s1_210 = __p1_210; \
41353 float16x4_t __s2_210 = __p2_210; \
41354 float16x4_t __rev0_210; __rev0_210 = __builtin_shufflevector(__s0_210, __s0_210, 3, 2, 1, 0); \
41355 float16x4_t __rev1_210; __rev1_210 = __builtin_shufflevector(__s1_210, __s1_210, 3, 2, 1, 0); \
41356 float16x4_t __rev2_210; __rev2_210 = __builtin_shufflevector(__s2_210, __s2_210, 3, 2, 1, 0); \
41357 float16x4_t __ret_210; \
41358float16x4_t __reint_210 = __rev2_210; \
41359uint32x2_t __reint1_210 = (uint32x2_t) {__noswap_vget_lane_u32(*(uint32x2_t *) &__reint_210, __p3_210), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_210, __p3_210)}; \
41360 __ret_210 = __noswap_vcmla_rot180_f16(__rev0_210, __rev1_210, *(float16x4_t *) &__reint1_210); \
41361 __ret_210 = __builtin_shufflevector(__ret_210, __ret_210, 3, 2, 1, 0); \
41362 __ret_210; \
41363})
41364#endif
41365
41366#ifdef __LITTLE_ENDIAN__
41367#define vcmlaq_rot180_lane_f16(__p0_211, __p1_211, __p2_211, __p3_211) __extension__ ({ \
41368 float16x8_t __s0_211 = __p0_211; \
41369 float16x8_t __s1_211 = __p1_211; \
41370 float16x4_t __s2_211 = __p2_211; \
41371 float16x8_t __ret_211; \
41372float16x4_t __reint_211 = __s2_211; \
41373uint32x4_t __reint1_211 = (uint32x4_t) {vget_lane_u32(*(uint32x2_t *) &__reint_211, __p3_211), vget_lane_u32(*(uint32x2_t *) &__reint_211, __p3_211), vget_lane_u32(*(uint32x2_t *) &__reint_211, __p3_211), vget_lane_u32(*(uint32x2_t *) &__reint_211, __p3_211)}; \
41374 __ret_211 = vcmlaq_rot180_f16(__s0_211, __s1_211, *(float16x8_t *) &__reint1_211); \
41375 __ret_211; \
41376})
41377#else
41378#define vcmlaq_rot180_lane_f16(__p0_212, __p1_212, __p2_212, __p3_212) __extension__ ({ \
41379 float16x8_t __s0_212 = __p0_212; \
41380 float16x8_t __s1_212 = __p1_212; \
41381 float16x4_t __s2_212 = __p2_212; \
41382 float16x8_t __rev0_212; __rev0_212 = __builtin_shufflevector(__s0_212, __s0_212, 7, 6, 5, 4, 3, 2, 1, 0); \
41383 float16x8_t __rev1_212; __rev1_212 = __builtin_shufflevector(__s1_212, __s1_212, 7, 6, 5, 4, 3, 2, 1, 0); \
41384 float16x4_t __rev2_212; __rev2_212 = __builtin_shufflevector(__s2_212, __s2_212, 3, 2, 1, 0); \
41385 float16x8_t __ret_212; \
41386float16x4_t __reint_212 = __rev2_212; \
41387uint32x4_t __reint1_212 = (uint32x4_t) {__noswap_vget_lane_u32(*(uint32x2_t *) &__reint_212, __p3_212), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_212, __p3_212), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_212, __p3_212), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_212, __p3_212)}; \
41388 __ret_212 = __noswap_vcmlaq_rot180_f16(__rev0_212, __rev1_212, *(float16x8_t *) &__reint1_212); \
41389 __ret_212 = __builtin_shufflevector(__ret_212, __ret_212, 7, 6, 5, 4, 3, 2, 1, 0); \
41390 __ret_212; \
41391})
41392#endif
41393
41394#ifdef __LITTLE_ENDIAN__
41395#define vcmla_rot180_laneq_f16(__p0_213, __p1_213, __p2_213, __p3_213) __extension__ ({ \
41396 float16x4_t __s0_213 = __p0_213; \
41397 float16x4_t __s1_213 = __p1_213; \
41398 float16x8_t __s2_213 = __p2_213; \
41399 float16x4_t __ret_213; \
41400float16x8_t __reint_213 = __s2_213; \
41401uint32x2_t __reint1_213 = (uint32x2_t) {vgetq_lane_u32(*(uint32x4_t *) &__reint_213, __p3_213), vgetq_lane_u32(*(uint32x4_t *) &__reint_213, __p3_213)}; \
41402 __ret_213 = vcmla_rot180_f16(__s0_213, __s1_213, *(float16x4_t *) &__reint1_213); \
41403 __ret_213; \
41404})
41405#else
41406#define vcmla_rot180_laneq_f16(__p0_214, __p1_214, __p2_214, __p3_214) __extension__ ({ \
41407 float16x4_t __s0_214 = __p0_214; \
41408 float16x4_t __s1_214 = __p1_214; \
41409 float16x8_t __s2_214 = __p2_214; \
41410 float16x4_t __rev0_214; __rev0_214 = __builtin_shufflevector(__s0_214, __s0_214, 3, 2, 1, 0); \
41411 float16x4_t __rev1_214; __rev1_214 = __builtin_shufflevector(__s1_214, __s1_214, 3, 2, 1, 0); \
41412 float16x8_t __rev2_214; __rev2_214 = __builtin_shufflevector(__s2_214, __s2_214, 7, 6, 5, 4, 3, 2, 1, 0); \
41413 float16x4_t __ret_214; \
41414float16x8_t __reint_214 = __rev2_214; \
41415uint32x2_t __reint1_214 = (uint32x2_t) {__noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_214, __p3_214), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_214, __p3_214)}; \
41416 __ret_214 = __noswap_vcmla_rot180_f16(__rev0_214, __rev1_214, *(float16x4_t *) &__reint1_214); \
41417 __ret_214 = __builtin_shufflevector(__ret_214, __ret_214, 3, 2, 1, 0); \
41418 __ret_214; \
41419})
41420#endif
41421
41422#ifdef __LITTLE_ENDIAN__
41423#define vcmlaq_rot180_laneq_f16(__p0_215, __p1_215, __p2_215, __p3_215) __extension__ ({ \
41424 float16x8_t __s0_215 = __p0_215; \
41425 float16x8_t __s1_215 = __p1_215; \
41426 float16x8_t __s2_215 = __p2_215; \
41427 float16x8_t __ret_215; \
41428float16x8_t __reint_215 = __s2_215; \
41429uint32x4_t __reint1_215 = (uint32x4_t) {vgetq_lane_u32(*(uint32x4_t *) &__reint_215, __p3_215), vgetq_lane_u32(*(uint32x4_t *) &__reint_215, __p3_215), vgetq_lane_u32(*(uint32x4_t *) &__reint_215, __p3_215), vgetq_lane_u32(*(uint32x4_t *) &__reint_215, __p3_215)}; \
41430 __ret_215 = vcmlaq_rot180_f16(__s0_215, __s1_215, *(float16x8_t *) &__reint1_215); \
41431 __ret_215; \
41432})
41433#else
41434#define vcmlaq_rot180_laneq_f16(__p0_216, __p1_216, __p2_216, __p3_216) __extension__ ({ \
41435 float16x8_t __s0_216 = __p0_216; \
41436 float16x8_t __s1_216 = __p1_216; \
41437 float16x8_t __s2_216 = __p2_216; \
41438 float16x8_t __rev0_216; __rev0_216 = __builtin_shufflevector(__s0_216, __s0_216, 7, 6, 5, 4, 3, 2, 1, 0); \
41439 float16x8_t __rev1_216; __rev1_216 = __builtin_shufflevector(__s1_216, __s1_216, 7, 6, 5, 4, 3, 2, 1, 0); \
41440 float16x8_t __rev2_216; __rev2_216 = __builtin_shufflevector(__s2_216, __s2_216, 7, 6, 5, 4, 3, 2, 1, 0); \
41441 float16x8_t __ret_216; \
41442float16x8_t __reint_216 = __rev2_216; \
41443uint32x4_t __reint1_216 = (uint32x4_t) {__noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_216, __p3_216), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_216, __p3_216), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_216, __p3_216), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_216, __p3_216)}; \
41444 __ret_216 = __noswap_vcmlaq_rot180_f16(__rev0_216, __rev1_216, *(float16x8_t *) &__reint1_216); \
41445 __ret_216 = __builtin_shufflevector(__ret_216, __ret_216, 7, 6, 5, 4, 3, 2, 1, 0); \
41446 __ret_216; \
41447})
41448#endif
41449
41450#ifdef __LITTLE_ENDIAN__
41451__ai float16x8_t vcmlaq_rot270_f16(float16x8_t __p0, float16x8_t __p1, float16x8_t __p2) {
41452 float16x8_t __ret;
41453 __ret = (float16x8_t) __builtin_neon_vcmlaq_rot270_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 40);
41454 return __ret;
41455}
41456#else
41457__ai float16x8_t vcmlaq_rot270_f16(float16x8_t __p0, float16x8_t __p1, float16x8_t __p2) {
41458 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);
41459 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 7, 6, 5, 4, 3, 2, 1, 0);
41460 float16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 7, 6, 5, 4, 3, 2, 1, 0);
41461 float16x8_t __ret;
41462 __ret = (float16x8_t) __builtin_neon_vcmlaq_rot270_v((int8x16_t)__rev0, (int8x16_t)__rev1, (int8x16_t)__rev2, 40);
41463 __ret = __builtin_shufflevector(__ret, __ret, 7, 6, 5, 4, 3, 2, 1, 0);
41464 return __ret;
41465}
41466__ai float16x8_t __noswap_vcmlaq_rot270_f16(float16x8_t __p0, float16x8_t __p1, float16x8_t __p2) {
41467 float16x8_t __ret;
41468 __ret = (float16x8_t) __builtin_neon_vcmlaq_rot270_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 40);
41469 return __ret;
41470}
41471#endif
41472
41473#ifdef __LITTLE_ENDIAN__
41474__ai float16x4_t vcmla_rot270_f16(float16x4_t __p0, float16x4_t __p1, float16x4_t __p2) {
41475 float16x4_t __ret;
41476 __ret = (float16x4_t) __builtin_neon_vcmla_rot270_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 8);
41477 return __ret;
41478}
41479#else
41480__ai float16x4_t vcmla_rot270_f16(float16x4_t __p0, float16x4_t __p1, float16x4_t __p2) {
41481 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
41482 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);
41483 float16x4_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 3, 2, 1, 0);
41484 float16x4_t __ret;
41485 __ret = (float16x4_t) __builtin_neon_vcmla_rot270_v((int8x8_t)__rev0, (int8x8_t)__rev1, (int8x8_t)__rev2, 8);
41486 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);
41487 return __ret;
41488}
41489__ai float16x4_t __noswap_vcmla_rot270_f16(float16x4_t __p0, float16x4_t __p1, float16x4_t __p2) {
41490 float16x4_t __ret;
41491 __ret = (float16x4_t) __builtin_neon_vcmla_rot270_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 8);
41492 return __ret;
41493}
41494#endif
41495
41496#ifdef __LITTLE_ENDIAN__
41497#define vcmla_rot270_lane_f16(__p0_217, __p1_217, __p2_217, __p3_217) __extension__ ({ \
41498 float16x4_t __s0_217 = __p0_217; \
41499 float16x4_t __s1_217 = __p1_217; \
41500 float16x4_t __s2_217 = __p2_217; \
41501 float16x4_t __ret_217; \
41502float16x4_t __reint_217 = __s2_217; \
41503uint32x2_t __reint1_217 = (uint32x2_t) {vget_lane_u32(*(uint32x2_t *) &__reint_217, __p3_217), vget_lane_u32(*(uint32x2_t *) &__reint_217, __p3_217)}; \
41504 __ret_217 = vcmla_rot270_f16(__s0_217, __s1_217, *(float16x4_t *) &__reint1_217); \
41505 __ret_217; \
41506})
41507#else
41508#define vcmla_rot270_lane_f16(__p0_218, __p1_218, __p2_218, __p3_218) __extension__ ({ \
41509 float16x4_t __s0_218 = __p0_218; \
41510 float16x4_t __s1_218 = __p1_218; \
41511 float16x4_t __s2_218 = __p2_218; \
41512 float16x4_t __rev0_218; __rev0_218 = __builtin_shufflevector(__s0_218, __s0_218, 3, 2, 1, 0); \
41513 float16x4_t __rev1_218; __rev1_218 = __builtin_shufflevector(__s1_218, __s1_218, 3, 2, 1, 0); \
41514 float16x4_t __rev2_218; __rev2_218 = __builtin_shufflevector(__s2_218, __s2_218, 3, 2, 1, 0); \
41515 float16x4_t __ret_218; \
41516float16x4_t __reint_218 = __rev2_218; \
41517uint32x2_t __reint1_218 = (uint32x2_t) {__noswap_vget_lane_u32(*(uint32x2_t *) &__reint_218, __p3_218), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_218, __p3_218)}; \
41518 __ret_218 = __noswap_vcmla_rot270_f16(__rev0_218, __rev1_218, *(float16x4_t *) &__reint1_218); \
41519 __ret_218 = __builtin_shufflevector(__ret_218, __ret_218, 3, 2, 1, 0); \
41520 __ret_218; \
41521})
41522#endif
41523
41524#ifdef __LITTLE_ENDIAN__
41525#define vcmlaq_rot270_lane_f16(__p0_219, __p1_219, __p2_219, __p3_219) __extension__ ({ \
41526 float16x8_t __s0_219 = __p0_219; \
41527 float16x8_t __s1_219 = __p1_219; \
41528 float16x4_t __s2_219 = __p2_219; \
41529 float16x8_t __ret_219; \
41530float16x4_t __reint_219 = __s2_219; \
41531uint32x4_t __reint1_219 = (uint32x4_t) {vget_lane_u32(*(uint32x2_t *) &__reint_219, __p3_219), vget_lane_u32(*(uint32x2_t *) &__reint_219, __p3_219), vget_lane_u32(*(uint32x2_t *) &__reint_219, __p3_219), vget_lane_u32(*(uint32x2_t *) &__reint_219, __p3_219)}; \
41532 __ret_219 = vcmlaq_rot270_f16(__s0_219, __s1_219, *(float16x8_t *) &__reint1_219); \
41533 __ret_219; \
41534})
41535#else
41536#define vcmlaq_rot270_lane_f16(__p0_220, __p1_220, __p2_220, __p3_220) __extension__ ({ \
41537 float16x8_t __s0_220 = __p0_220; \
41538 float16x8_t __s1_220 = __p1_220; \
41539 float16x4_t __s2_220 = __p2_220; \
41540 float16x8_t __rev0_220; __rev0_220 = __builtin_shufflevector(__s0_220, __s0_220, 7, 6, 5, 4, 3, 2, 1, 0); \
41541 float16x8_t __rev1_220; __rev1_220 = __builtin_shufflevector(__s1_220, __s1_220, 7, 6, 5, 4, 3, 2, 1, 0); \
41542 float16x4_t __rev2_220; __rev2_220 = __builtin_shufflevector(__s2_220, __s2_220, 3, 2, 1, 0); \
41543 float16x8_t __ret_220; \
41544float16x4_t __reint_220 = __rev2_220; \
41545uint32x4_t __reint1_220 = (uint32x4_t) {__noswap_vget_lane_u32(*(uint32x2_t *) &__reint_220, __p3_220), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_220, __p3_220), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_220, __p3_220), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_220, __p3_220)}; \
41546 __ret_220 = __noswap_vcmlaq_rot270_f16(__rev0_220, __rev1_220, *(float16x8_t *) &__reint1_220); \
41547 __ret_220 = __builtin_shufflevector(__ret_220, __ret_220, 7, 6, 5, 4, 3, 2, 1, 0); \
41548 __ret_220; \
41549})
41550#endif
41551
41552#ifdef __LITTLE_ENDIAN__
41553#define vcmla_rot270_laneq_f16(__p0_221, __p1_221, __p2_221, __p3_221) __extension__ ({ \
41554 float16x4_t __s0_221 = __p0_221; \
41555 float16x4_t __s1_221 = __p1_221; \
41556 float16x8_t __s2_221 = __p2_221; \
41557 float16x4_t __ret_221; \
41558float16x8_t __reint_221 = __s2_221; \
41559uint32x2_t __reint1_221 = (uint32x2_t) {vgetq_lane_u32(*(uint32x4_t *) &__reint_221, __p3_221), vgetq_lane_u32(*(uint32x4_t *) &__reint_221, __p3_221)}; \
41560 __ret_221 = vcmla_rot270_f16(__s0_221, __s1_221, *(float16x4_t *) &__reint1_221); \
41561 __ret_221; \
41562})
41563#else
41564#define vcmla_rot270_laneq_f16(__p0_222, __p1_222, __p2_222, __p3_222) __extension__ ({ \
41565 float16x4_t __s0_222 = __p0_222; \
41566 float16x4_t __s1_222 = __p1_222; \
41567 float16x8_t __s2_222 = __p2_222; \
41568 float16x4_t __rev0_222; __rev0_222 = __builtin_shufflevector(__s0_222, __s0_222, 3, 2, 1, 0); \
41569 float16x4_t __rev1_222; __rev1_222 = __builtin_shufflevector(__s1_222, __s1_222, 3, 2, 1, 0); \
41570 float16x8_t __rev2_222; __rev2_222 = __builtin_shufflevector(__s2_222, __s2_222, 7, 6, 5, 4, 3, 2, 1, 0); \
41571 float16x4_t __ret_222; \
41572float16x8_t __reint_222 = __rev2_222; \
41573uint32x2_t __reint1_222 = (uint32x2_t) {__noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_222, __p3_222), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_222, __p3_222)}; \
41574 __ret_222 = __noswap_vcmla_rot270_f16(__rev0_222, __rev1_222, *(float16x4_t *) &__reint1_222); \
41575 __ret_222 = __builtin_shufflevector(__ret_222, __ret_222, 3, 2, 1, 0); \
41576 __ret_222; \
41577})
41578#endif
41579
41580#ifdef __LITTLE_ENDIAN__
41581#define vcmlaq_rot270_laneq_f16(__p0_223, __p1_223, __p2_223, __p3_223) __extension__ ({ \
41582 float16x8_t __s0_223 = __p0_223; \
41583 float16x8_t __s1_223 = __p1_223; \
41584 float16x8_t __s2_223 = __p2_223; \
41585 float16x8_t __ret_223; \
41586float16x8_t __reint_223 = __s2_223; \
41587uint32x4_t __reint1_223 = (uint32x4_t) {vgetq_lane_u32(*(uint32x4_t *) &__reint_223, __p3_223), vgetq_lane_u32(*(uint32x4_t *) &__reint_223, __p3_223), vgetq_lane_u32(*(uint32x4_t *) &__reint_223, __p3_223), vgetq_lane_u32(*(uint32x4_t *) &__reint_223, __p3_223)}; \
41588 __ret_223 = vcmlaq_rot270_f16(__s0_223, __s1_223, *(float16x8_t *) &__reint1_223); \
41589 __ret_223; \
41590})
41591#else
41592#define vcmlaq_rot270_laneq_f16(__p0_224, __p1_224, __p2_224, __p3_224) __extension__ ({ \
41593 float16x8_t __s0_224 = __p0_224; \
41594 float16x8_t __s1_224 = __p1_224; \
41595 float16x8_t __s2_224 = __p2_224; \
41596 float16x8_t __rev0_224; __rev0_224 = __builtin_shufflevector(__s0_224, __s0_224, 7, 6, 5, 4, 3, 2, 1, 0); \
41597 float16x8_t __rev1_224; __rev1_224 = __builtin_shufflevector(__s1_224, __s1_224, 7, 6, 5, 4, 3, 2, 1, 0); \
41598 float16x8_t __rev2_224; __rev2_224 = __builtin_shufflevector(__s2_224, __s2_224, 7, 6, 5, 4, 3, 2, 1, 0); \
41599 float16x8_t __ret_224; \
41600float16x8_t __reint_224 = __rev2_224; \
41601uint32x4_t __reint1_224 = (uint32x4_t) {__noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_224, __p3_224), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_224, __p3_224), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_224, __p3_224), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_224, __p3_224)}; \
41602 __ret_224 = __noswap_vcmlaq_rot270_f16(__rev0_224, __rev1_224, *(float16x8_t *) &__reint1_224); \
41603 __ret_224 = __builtin_shufflevector(__ret_224, __ret_224, 7, 6, 5, 4, 3, 2, 1, 0); \
41604 __ret_224; \
41605})
41606#endif
41607
41608#ifdef __LITTLE_ENDIAN__
41609__ai float16x8_t vcmlaq_rot90_f16(float16x8_t __p0, float16x8_t __p1, float16x8_t __p2) {
41610 float16x8_t __ret;
41611 __ret = (float16x8_t) __builtin_neon_vcmlaq_rot90_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 40);
41612 return __ret;
41613}
41614#else
41615__ai float16x8_t vcmlaq_rot90_f16(float16x8_t __p0, float16x8_t __p1, float16x8_t __p2) {
41616 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);
41617 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 7, 6, 5, 4, 3, 2, 1, 0);
41618 float16x8_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 7, 6, 5, 4, 3, 2, 1, 0);
41619 float16x8_t __ret;
41620 __ret = (float16x8_t) __builtin_neon_vcmlaq_rot90_v((int8x16_t)__rev0, (int8x16_t)__rev1, (int8x16_t)__rev2, 40);
41621 __ret = __builtin_shufflevector(__ret, __ret, 7, 6, 5, 4, 3, 2, 1, 0);
41622 return __ret;
41623}
41624__ai float16x8_t __noswap_vcmlaq_rot90_f16(float16x8_t __p0, float16x8_t __p1, float16x8_t __p2) {
41625 float16x8_t __ret;
41626 __ret = (float16x8_t) __builtin_neon_vcmlaq_rot90_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 40);
41627 return __ret;
41628}
40432#endif41629#endif
40433#if defined(__ARM_FEATURE_COMPLEX) && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)41630
40434#ifdef __LITTLE_ENDIAN__41631#ifdef __LITTLE_ENDIAN__
40435__ai float16x4_t vcadd_rot270_f16(float16x4_t __p0, float16x4_t __p1) {41632__ai float16x4_t vcmla_rot90_f16(float16x4_t __p0, float16x4_t __p1, float16x4_t __p2) {
40436 float16x4_t __ret;41633 float16x4_t __ret;
40437 __ret = (float16x4_t) __builtin_neon_vcadd_rot270_v((int8x8_t)__p0, (int8x8_t)__p1, 8);41634 __ret = (float16x4_t) __builtin_neon_vcmla_rot90_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 8);
40438 return __ret;41635 return __ret;
40439}41636}
40440#else41637#else
40441__ai float16x4_t vcadd_rot270_f16(float16x4_t __p0, float16x4_t __p1) {41638__ai float16x4_t vcmla_rot90_f16(float16x4_t __p0, float16x4_t __p1, float16x4_t __p2) {
40442 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);41639 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
40443 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);41640 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);
41641 float16x4_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 3, 2, 1, 0);
40444 float16x4_t __ret;41642 float16x4_t __ret;
40445 __ret = (float16x4_t) __builtin_neon_vcadd_rot270_v((int8x8_t)__rev0, (int8x8_t)__rev1, 8);41643 __ret = (float16x4_t) __builtin_neon_vcmla_rot90_v((int8x8_t)__rev0, (int8x8_t)__rev1, (int8x8_t)__rev2, 8);
40446 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);41644 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);
40447 return __ret;41645 return __ret;
40448}41646}
41647__ai float16x4_t __noswap_vcmla_rot90_f16(float16x4_t __p0, float16x4_t __p1, float16x4_t __p2) {
41648 float16x4_t __ret;
41649 __ret = (float16x4_t) __builtin_neon_vcmla_rot90_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 8);
41650 return __ret;
41651}
40449#endif41652#endif
4045041653
40451#ifdef __LITTLE_ENDIAN__41654#ifdef __LITTLE_ENDIAN__
40452__ai float16x4_t vcadd_rot90_f16(float16x4_t __p0, float16x4_t __p1) {41655#define vcmla_rot90_lane_f16(__p0_225, __p1_225, __p2_225, __p3_225) __extension__ ({ \
40453 float16x4_t __ret;41656 float16x4_t __s0_225 = __p0_225; \
40454 __ret = (float16x4_t) __builtin_neon_vcadd_rot90_v((int8x8_t)__p0, (int8x8_t)__p1, 8);41657 float16x4_t __s1_225 = __p1_225; \
41658 float16x4_t __s2_225 = __p2_225; \
41659 float16x4_t __ret_225; \
41660float16x4_t __reint_225 = __s2_225; \
41661uint32x2_t __reint1_225 = (uint32x2_t) {vget_lane_u32(*(uint32x2_t *) &__reint_225, __p3_225), vget_lane_u32(*(uint32x2_t *) &__reint_225, __p3_225)}; \
41662 __ret_225 = vcmla_rot90_f16(__s0_225, __s1_225, *(float16x4_t *) &__reint1_225); \
41663 __ret_225; \
41664})
41665#else
41666#define vcmla_rot90_lane_f16(__p0_226, __p1_226, __p2_226, __p3_226) __extension__ ({ \
41667 float16x4_t __s0_226 = __p0_226; \
41668 float16x4_t __s1_226 = __p1_226; \
41669 float16x4_t __s2_226 = __p2_226; \
41670 float16x4_t __rev0_226; __rev0_226 = __builtin_shufflevector(__s0_226, __s0_226, 3, 2, 1, 0); \
41671 float16x4_t __rev1_226; __rev1_226 = __builtin_shufflevector(__s1_226, __s1_226, 3, 2, 1, 0); \
41672 float16x4_t __rev2_226; __rev2_226 = __builtin_shufflevector(__s2_226, __s2_226, 3, 2, 1, 0); \
41673 float16x4_t __ret_226; \
41674float16x4_t __reint_226 = __rev2_226; \
41675uint32x2_t __reint1_226 = (uint32x2_t) {__noswap_vget_lane_u32(*(uint32x2_t *) &__reint_226, __p3_226), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_226, __p3_226)}; \
41676 __ret_226 = __noswap_vcmla_rot90_f16(__rev0_226, __rev1_226, *(float16x4_t *) &__reint1_226); \
41677 __ret_226 = __builtin_shufflevector(__ret_226, __ret_226, 3, 2, 1, 0); \
41678 __ret_226; \
41679})
41680#endif
41681
41682#ifdef __LITTLE_ENDIAN__
41683#define vcmlaq_rot90_lane_f16(__p0_227, __p1_227, __p2_227, __p3_227) __extension__ ({ \
41684 float16x8_t __s0_227 = __p0_227; \
41685 float16x8_t __s1_227 = __p1_227; \
41686 float16x4_t __s2_227 = __p2_227; \
41687 float16x8_t __ret_227; \
41688float16x4_t __reint_227 = __s2_227; \
41689uint32x4_t __reint1_227 = (uint32x4_t) {vget_lane_u32(*(uint32x2_t *) &__reint_227, __p3_227), vget_lane_u32(*(uint32x2_t *) &__reint_227, __p3_227), vget_lane_u32(*(uint32x2_t *) &__reint_227, __p3_227), vget_lane_u32(*(uint32x2_t *) &__reint_227, __p3_227)}; \
41690 __ret_227 = vcmlaq_rot90_f16(__s0_227, __s1_227, *(float16x8_t *) &__reint1_227); \
41691 __ret_227; \
41692})
41693#else
41694#define vcmlaq_rot90_lane_f16(__p0_228, __p1_228, __p2_228, __p3_228) __extension__ ({ \
41695 float16x8_t __s0_228 = __p0_228; \
41696 float16x8_t __s1_228 = __p1_228; \
41697 float16x4_t __s2_228 = __p2_228; \
41698 float16x8_t __rev0_228; __rev0_228 = __builtin_shufflevector(__s0_228, __s0_228, 7, 6, 5, 4, 3, 2, 1, 0); \
41699 float16x8_t __rev1_228; __rev1_228 = __builtin_shufflevector(__s1_228, __s1_228, 7, 6, 5, 4, 3, 2, 1, 0); \
41700 float16x4_t __rev2_228; __rev2_228 = __builtin_shufflevector(__s2_228, __s2_228, 3, 2, 1, 0); \
41701 float16x8_t __ret_228; \
41702float16x4_t __reint_228 = __rev2_228; \
41703uint32x4_t __reint1_228 = (uint32x4_t) {__noswap_vget_lane_u32(*(uint32x2_t *) &__reint_228, __p3_228), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_228, __p3_228), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_228, __p3_228), __noswap_vget_lane_u32(*(uint32x2_t *) &__reint_228, __p3_228)}; \
41704 __ret_228 = __noswap_vcmlaq_rot90_f16(__rev0_228, __rev1_228, *(float16x8_t *) &__reint1_228); \
41705 __ret_228 = __builtin_shufflevector(__ret_228, __ret_228, 7, 6, 5, 4, 3, 2, 1, 0); \
41706 __ret_228; \
41707})
41708#endif
41709
41710#ifdef __LITTLE_ENDIAN__
41711#define vcmla_rot90_laneq_f16(__p0_229, __p1_229, __p2_229, __p3_229) __extension__ ({ \
41712 float16x4_t __s0_229 = __p0_229; \
41713 float16x4_t __s1_229 = __p1_229; \
41714 float16x8_t __s2_229 = __p2_229; \
41715 float16x4_t __ret_229; \
41716float16x8_t __reint_229 = __s2_229; \
41717uint32x2_t __reint1_229 = (uint32x2_t) {vgetq_lane_u32(*(uint32x4_t *) &__reint_229, __p3_229), vgetq_lane_u32(*(uint32x4_t *) &__reint_229, __p3_229)}; \
41718 __ret_229 = vcmla_rot90_f16(__s0_229, __s1_229, *(float16x4_t *) &__reint1_229); \
41719 __ret_229; \
41720})
41721#else
41722#define vcmla_rot90_laneq_f16(__p0_230, __p1_230, __p2_230, __p3_230) __extension__ ({ \
41723 float16x4_t __s0_230 = __p0_230; \
41724 float16x4_t __s1_230 = __p1_230; \
41725 float16x8_t __s2_230 = __p2_230; \
41726 float16x4_t __rev0_230; __rev0_230 = __builtin_shufflevector(__s0_230, __s0_230, 3, 2, 1, 0); \
41727 float16x4_t __rev1_230; __rev1_230 = __builtin_shufflevector(__s1_230, __s1_230, 3, 2, 1, 0); \
41728 float16x8_t __rev2_230; __rev2_230 = __builtin_shufflevector(__s2_230, __s2_230, 7, 6, 5, 4, 3, 2, 1, 0); \
41729 float16x4_t __ret_230; \
41730float16x8_t __reint_230 = __rev2_230; \
41731uint32x2_t __reint1_230 = (uint32x2_t) {__noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_230, __p3_230), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_230, __p3_230)}; \
41732 __ret_230 = __noswap_vcmla_rot90_f16(__rev0_230, __rev1_230, *(float16x4_t *) &__reint1_230); \
41733 __ret_230 = __builtin_shufflevector(__ret_230, __ret_230, 3, 2, 1, 0); \
41734 __ret_230; \
41735})
41736#endif
41737
41738#ifdef __LITTLE_ENDIAN__
41739#define vcmlaq_rot90_laneq_f16(__p0_231, __p1_231, __p2_231, __p3_231) __extension__ ({ \
41740 float16x8_t __s0_231 = __p0_231; \
41741 float16x8_t __s1_231 = __p1_231; \
41742 float16x8_t __s2_231 = __p2_231; \
41743 float16x8_t __ret_231; \
41744float16x8_t __reint_231 = __s2_231; \
41745uint32x4_t __reint1_231 = (uint32x4_t) {vgetq_lane_u32(*(uint32x4_t *) &__reint_231, __p3_231), vgetq_lane_u32(*(uint32x4_t *) &__reint_231, __p3_231), vgetq_lane_u32(*(uint32x4_t *) &__reint_231, __p3_231), vgetq_lane_u32(*(uint32x4_t *) &__reint_231, __p3_231)}; \
41746 __ret_231 = vcmlaq_rot90_f16(__s0_231, __s1_231, *(float16x8_t *) &__reint1_231); \
41747 __ret_231; \
41748})
41749#else
41750#define vcmlaq_rot90_laneq_f16(__p0_232, __p1_232, __p2_232, __p3_232) __extension__ ({ \
41751 float16x8_t __s0_232 = __p0_232; \
41752 float16x8_t __s1_232 = __p1_232; \
41753 float16x8_t __s2_232 = __p2_232; \
41754 float16x8_t __rev0_232; __rev0_232 = __builtin_shufflevector(__s0_232, __s0_232, 7, 6, 5, 4, 3, 2, 1, 0); \
41755 float16x8_t __rev1_232; __rev1_232 = __builtin_shufflevector(__s1_232, __s1_232, 7, 6, 5, 4, 3, 2, 1, 0); \
41756 float16x8_t __rev2_232; __rev2_232 = __builtin_shufflevector(__s2_232, __s2_232, 7, 6, 5, 4, 3, 2, 1, 0); \
41757 float16x8_t __ret_232; \
41758float16x8_t __reint_232 = __rev2_232; \
41759uint32x4_t __reint1_232 = (uint32x4_t) {__noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_232, __p3_232), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_232, __p3_232), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_232, __p3_232), __noswap_vgetq_lane_u32(*(uint32x4_t *) &__reint_232, __p3_232)}; \
41760 __ret_232 = __noswap_vcmlaq_rot90_f16(__rev0_232, __rev1_232, *(float16x8_t *) &__reint1_232); \
41761 __ret_232 = __builtin_shufflevector(__ret_232, __ret_232, 7, 6, 5, 4, 3, 2, 1, 0); \
41762 __ret_232; \
41763})
41764#endif
41765
41766#endif
41767#if defined(__ARM_FEATURE_COMPLEX) && defined(__aarch64__)
41768#ifdef __LITTLE_ENDIAN__
41769__ai float64x2_t vcaddq_rot270_f64(float64x2_t __p0, float64x2_t __p1) {
41770 float64x2_t __ret;
41771 __ret = (float64x2_t) __builtin_neon_vcaddq_rot270_v((int8x16_t)__p0, (int8x16_t)__p1, 42);
40455 return __ret;41772 return __ret;
40456}41773}
40457#else41774#else
40458__ai float16x4_t vcadd_rot90_f16(float16x4_t __p0, float16x4_t __p1) {41775__ai float64x2_t vcaddq_rot270_f64(float64x2_t __p0, float64x2_t __p1) {
40459 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);41776 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
40460 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);41777 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
40461 float16x4_t __ret;41778 float64x2_t __ret;
40462 __ret = (float16x4_t) __builtin_neon_vcadd_rot90_v((int8x8_t)__rev0, (int8x8_t)__rev1, 8);41779 __ret = (float64x2_t) __builtin_neon_vcaddq_rot270_v((int8x16_t)__rev0, (int8x16_t)__rev1, 42);
40463 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);41780 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
40464 return __ret;41781 return __ret;
40465}41782}
40466#endif41783#endif
4046741784
40468#ifdef __LITTLE_ENDIAN__41785#ifdef __LITTLE_ENDIAN__
40469__ai float16x8_t vcaddq_rot270_f16(float16x8_t __p0, float16x8_t __p1) {41786__ai float64x2_t vcaddq_rot90_f64(float64x2_t __p0, float64x2_t __p1) {
40470 float16x8_t __ret;41787 float64x2_t __ret;
40471 __ret = (float16x8_t) __builtin_neon_vcaddq_rot270_v((int8x16_t)__p0, (int8x16_t)__p1, 40);41788 __ret = (float64x2_t) __builtin_neon_vcaddq_rot90_v((int8x16_t)__p0, (int8x16_t)__p1, 42);
40472 return __ret;41789 return __ret;
40473}41790}
40474#else41791#else
40475__ai float16x8_t vcaddq_rot270_f16(float16x8_t __p0, float16x8_t __p1) {41792__ai float64x2_t vcaddq_rot90_f64(float64x2_t __p0, float64x2_t __p1) {
40476 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);41793 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
40477 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 7, 6, 5, 4, 3, 2, 1, 0);41794 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
40478 float16x8_t __ret;41795 float64x2_t __ret;
40479 __ret = (float16x8_t) __builtin_neon_vcaddq_rot270_v((int8x16_t)__rev0, (int8x16_t)__rev1, 40);41796 __ret = (float64x2_t) __builtin_neon_vcaddq_rot90_v((int8x16_t)__rev0, (int8x16_t)__rev1, 42);
40480 __ret = __builtin_shufflevector(__ret, __ret, 7, 6, 5, 4, 3, 2, 1, 0);41797 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
40481 return __ret;41798 return __ret;
40482}41799}
40483#endif41800#endif
4048441801
40485#ifdef __LITTLE_ENDIAN__41802#ifdef __LITTLE_ENDIAN__
40486__ai float16x8_t vcaddq_rot90_f16(float16x8_t __p0, float16x8_t __p1) {41803__ai float64x2_t vcmlaq_f64(float64x2_t __p0, float64x2_t __p1, float64x2_t __p2) {
40487 float16x8_t __ret;41804 float64x2_t __ret;
40488 __ret = (float16x8_t) __builtin_neon_vcaddq_rot90_v((int8x16_t)__p0, (int8x16_t)__p1, 40);41805 __ret = (float64x2_t) __builtin_neon_vcmlaq_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 42);
40489 return __ret;41806 return __ret;
40490}41807}
40491#else41808#else
40492__ai float16x8_t vcaddq_rot90_f16(float16x8_t __p0, float16x8_t __p1) {41809__ai float64x2_t vcmlaq_f64(float64x2_t __p0, float64x2_t __p1, float64x2_t __p2) {
40493 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);41810 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
40494 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 7, 6, 5, 4, 3, 2, 1, 0);41811 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
40495 float16x8_t __ret;41812 float64x2_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 1, 0);
40496 __ret = (float16x8_t) __builtin_neon_vcaddq_rot90_v((int8x16_t)__rev0, (int8x16_t)__rev1, 40);41813 float64x2_t __ret;
40497 __ret = __builtin_shufflevector(__ret, __ret, 7, 6, 5, 4, 3, 2, 1, 0);41814 __ret = (float64x2_t) __builtin_neon_vcmlaq_v((int8x16_t)__rev0, (int8x16_t)__rev1, (int8x16_t)__rev2, 42);
41815 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
41816 return __ret;
41817}
41818__ai float64x2_t __noswap_vcmlaq_f64(float64x2_t __p0, float64x2_t __p1, float64x2_t __p2) {
41819 float64x2_t __ret;
41820 __ret = (float64x2_t) __builtin_neon_vcmlaq_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 42);
40498 return __ret;41821 return __ret;
40499}41822}
40500#endif41823#endif
4050141824
41825__ai float64x1_t vcmla_f64(float64x1_t __p0, float64x1_t __p1, float64x1_t __p2) {
41826 float64x1_t __ret;
41827 __ret = (float64x1_t) __builtin_neon_vcmla_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 10);
41828 return __ret;
41829}
41830#define vcmla_lane_f64(__p0_233, __p1_233, __p2_233, __p3_233) __extension__ ({ \
41831 float64x1_t __s0_233 = __p0_233; \
41832 float64x1_t __s1_233 = __p1_233; \
41833 float64x1_t __s2_233 = __p2_233; \
41834 float64x1_t __ret_233; \
41835float64x1_t __reint_233 = __s2_233; \
41836uint64x2_t __reint1_233 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_233, __p3_233), vgetq_lane_u64(*(uint64x2_t *) &__reint_233, __p3_233)}; \
41837 __ret_233 = vcmla_f64(__s0_233, __s1_233, *(float64x1_t *) &__reint1_233); \
41838 __ret_233; \
41839})
41840#ifdef __LITTLE_ENDIAN__
41841#define vcmlaq_lane_f64(__p0_234, __p1_234, __p2_234, __p3_234) __extension__ ({ \
41842 float64x2_t __s0_234 = __p0_234; \
41843 float64x2_t __s1_234 = __p1_234; \
41844 float64x1_t __s2_234 = __p2_234; \
41845 float64x2_t __ret_234; \
41846float64x1_t __reint_234 = __s2_234; \
41847uint64x2_t __reint1_234 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_234, __p3_234), vgetq_lane_u64(*(uint64x2_t *) &__reint_234, __p3_234)}; \
41848 __ret_234 = vcmlaq_f64(__s0_234, __s1_234, *(float64x2_t *) &__reint1_234); \
41849 __ret_234; \
41850})
41851#else
41852#define vcmlaq_lane_f64(__p0_235, __p1_235, __p2_235, __p3_235) __extension__ ({ \
41853 float64x2_t __s0_235 = __p0_235; \
41854 float64x2_t __s1_235 = __p1_235; \
41855 float64x1_t __s2_235 = __p2_235; \
41856 float64x2_t __rev0_235; __rev0_235 = __builtin_shufflevector(__s0_235, __s0_235, 1, 0); \
41857 float64x2_t __rev1_235; __rev1_235 = __builtin_shufflevector(__s1_235, __s1_235, 1, 0); \
41858 float64x2_t __ret_235; \
41859float64x1_t __reint_235 = __s2_235; \
41860uint64x2_t __reint1_235 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_235, __p3_235), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_235, __p3_235)}; \
41861 __ret_235 = __noswap_vcmlaq_f64(__rev0_235, __rev1_235, *(float64x2_t *) &__reint1_235); \
41862 __ret_235 = __builtin_shufflevector(__ret_235, __ret_235, 1, 0); \
41863 __ret_235; \
41864})
40502#endif41865#endif
40503#if defined(__ARM_FEATURE_COMPLEX) && defined(__aarch64__)41866
40504#ifdef __LITTLE_ENDIAN__41867#ifdef __LITTLE_ENDIAN__
40505__ai float64x2_t vcaddq_rot270_f64(float64x2_t __p0, float64x2_t __p1) {41868#define vcmla_laneq_f64(__p0_236, __p1_236, __p2_236, __p3_236) __extension__ ({ \
41869 float64x1_t __s0_236 = __p0_236; \
41870 float64x1_t __s1_236 = __p1_236; \
41871 float64x2_t __s2_236 = __p2_236; \
41872 float64x1_t __ret_236; \
41873float64x2_t __reint_236 = __s2_236; \
41874uint64x2_t __reint1_236 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_236, __p3_236), vgetq_lane_u64(*(uint64x2_t *) &__reint_236, __p3_236)}; \
41875 __ret_236 = vcmla_f64(__s0_236, __s1_236, *(float64x1_t *) &__reint1_236); \
41876 __ret_236; \
41877})
41878#else
41879#define vcmla_laneq_f64(__p0_237, __p1_237, __p2_237, __p3_237) __extension__ ({ \
41880 float64x1_t __s0_237 = __p0_237; \
41881 float64x1_t __s1_237 = __p1_237; \
41882 float64x2_t __s2_237 = __p2_237; \
41883 float64x2_t __rev2_237; __rev2_237 = __builtin_shufflevector(__s2_237, __s2_237, 1, 0); \
41884 float64x1_t __ret_237; \
41885float64x2_t __reint_237 = __rev2_237; \
41886uint64x2_t __reint1_237 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_237, __p3_237), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_237, __p3_237)}; \
41887 __ret_237 = vcmla_f64(__s0_237, __s1_237, *(float64x1_t *) &__reint1_237); \
41888 __ret_237; \
41889})
41890#endif
41891
41892#ifdef __LITTLE_ENDIAN__
41893#define vcmlaq_laneq_f64(__p0_238, __p1_238, __p2_238, __p3_238) __extension__ ({ \
41894 float64x2_t __s0_238 = __p0_238; \
41895 float64x2_t __s1_238 = __p1_238; \
41896 float64x2_t __s2_238 = __p2_238; \
41897 float64x2_t __ret_238; \
41898float64x2_t __reint_238 = __s2_238; \
41899uint64x2_t __reint1_238 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_238, __p3_238), vgetq_lane_u64(*(uint64x2_t *) &__reint_238, __p3_238)}; \
41900 __ret_238 = vcmlaq_f64(__s0_238, __s1_238, *(float64x2_t *) &__reint1_238); \
41901 __ret_238; \
41902})
41903#else
41904#define vcmlaq_laneq_f64(__p0_239, __p1_239, __p2_239, __p3_239) __extension__ ({ \
41905 float64x2_t __s0_239 = __p0_239; \
41906 float64x2_t __s1_239 = __p1_239; \
41907 float64x2_t __s2_239 = __p2_239; \
41908 float64x2_t __rev0_239; __rev0_239 = __builtin_shufflevector(__s0_239, __s0_239, 1, 0); \
41909 float64x2_t __rev1_239; __rev1_239 = __builtin_shufflevector(__s1_239, __s1_239, 1, 0); \
41910 float64x2_t __rev2_239; __rev2_239 = __builtin_shufflevector(__s2_239, __s2_239, 1, 0); \
41911 float64x2_t __ret_239; \
41912float64x2_t __reint_239 = __rev2_239; \
41913uint64x2_t __reint1_239 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_239, __p3_239), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_239, __p3_239)}; \
41914 __ret_239 = __noswap_vcmlaq_f64(__rev0_239, __rev1_239, *(float64x2_t *) &__reint1_239); \
41915 __ret_239 = __builtin_shufflevector(__ret_239, __ret_239, 1, 0); \
41916 __ret_239; \
41917})
41918#endif
41919
41920#ifdef __LITTLE_ENDIAN__
41921__ai float64x2_t vcmlaq_rot180_f64(float64x2_t __p0, float64x2_t __p1, float64x2_t __p2) {
40506 float64x2_t __ret;41922 float64x2_t __ret;
40507 __ret = (float64x2_t) __builtin_neon_vcaddq_rot270_v((int8x16_t)__p0, (int8x16_t)__p1, 42);41923 __ret = (float64x2_t) __builtin_neon_vcmlaq_rot180_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 42);
40508 return __ret;41924 return __ret;
40509}41925}
40510#else41926#else
40511__ai float64x2_t vcaddq_rot270_f64(float64x2_t __p0, float64x2_t __p1) {41927__ai float64x2_t vcmlaq_rot180_f64(float64x2_t __p0, float64x2_t __p1, float64x2_t __p2) {
40512 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);41928 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
40513 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);41929 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
41930 float64x2_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 1, 0);
40514 float64x2_t __ret;41931 float64x2_t __ret;
40515 __ret = (float64x2_t) __builtin_neon_vcaddq_rot270_v((int8x16_t)__rev0, (int8x16_t)__rev1, 42);41932 __ret = (float64x2_t) __builtin_neon_vcmlaq_rot180_v((int8x16_t)__rev0, (int8x16_t)__rev1, (int8x16_t)__rev2, 42);
41933 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
41934 return __ret;
41935}
41936__ai float64x2_t __noswap_vcmlaq_rot180_f64(float64x2_t __p0, float64x2_t __p1, float64x2_t __p2) {
41937 float64x2_t __ret;
41938 __ret = (float64x2_t) __builtin_neon_vcmlaq_rot180_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 42);
41939 return __ret;
41940}
41941#endif
41942
41943__ai float64x1_t vcmla_rot180_f64(float64x1_t __p0, float64x1_t __p1, float64x1_t __p2) {
41944 float64x1_t __ret;
41945 __ret = (float64x1_t) __builtin_neon_vcmla_rot180_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 10);
41946 return __ret;
41947}
41948#define vcmla_rot180_lane_f64(__p0_240, __p1_240, __p2_240, __p3_240) __extension__ ({ \
41949 float64x1_t __s0_240 = __p0_240; \
41950 float64x1_t __s1_240 = __p1_240; \
41951 float64x1_t __s2_240 = __p2_240; \
41952 float64x1_t __ret_240; \
41953float64x1_t __reint_240 = __s2_240; \
41954uint64x2_t __reint1_240 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_240, __p3_240), vgetq_lane_u64(*(uint64x2_t *) &__reint_240, __p3_240)}; \
41955 __ret_240 = vcmla_rot180_f64(__s0_240, __s1_240, *(float64x1_t *) &__reint1_240); \
41956 __ret_240; \
41957})
41958#ifdef __LITTLE_ENDIAN__
41959#define vcmlaq_rot180_lane_f64(__p0_241, __p1_241, __p2_241, __p3_241) __extension__ ({ \
41960 float64x2_t __s0_241 = __p0_241; \
41961 float64x2_t __s1_241 = __p1_241; \
41962 float64x1_t __s2_241 = __p2_241; \
41963 float64x2_t __ret_241; \
41964float64x1_t __reint_241 = __s2_241; \
41965uint64x2_t __reint1_241 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_241, __p3_241), vgetq_lane_u64(*(uint64x2_t *) &__reint_241, __p3_241)}; \
41966 __ret_241 = vcmlaq_rot180_f64(__s0_241, __s1_241, *(float64x2_t *) &__reint1_241); \
41967 __ret_241; \
41968})
41969#else
41970#define vcmlaq_rot180_lane_f64(__p0_242, __p1_242, __p2_242, __p3_242) __extension__ ({ \
41971 float64x2_t __s0_242 = __p0_242; \
41972 float64x2_t __s1_242 = __p1_242; \
41973 float64x1_t __s2_242 = __p2_242; \
41974 float64x2_t __rev0_242; __rev0_242 = __builtin_shufflevector(__s0_242, __s0_242, 1, 0); \
41975 float64x2_t __rev1_242; __rev1_242 = __builtin_shufflevector(__s1_242, __s1_242, 1, 0); \
41976 float64x2_t __ret_242; \
41977float64x1_t __reint_242 = __s2_242; \
41978uint64x2_t __reint1_242 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_242, __p3_242), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_242, __p3_242)}; \
41979 __ret_242 = __noswap_vcmlaq_rot180_f64(__rev0_242, __rev1_242, *(float64x2_t *) &__reint1_242); \
41980 __ret_242 = __builtin_shufflevector(__ret_242, __ret_242, 1, 0); \
41981 __ret_242; \
41982})
41983#endif
41984
41985#ifdef __LITTLE_ENDIAN__
41986#define vcmla_rot180_laneq_f64(__p0_243, __p1_243, __p2_243, __p3_243) __extension__ ({ \
41987 float64x1_t __s0_243 = __p0_243; \
41988 float64x1_t __s1_243 = __p1_243; \
41989 float64x2_t __s2_243 = __p2_243; \
41990 float64x1_t __ret_243; \
41991float64x2_t __reint_243 = __s2_243; \
41992uint64x2_t __reint1_243 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_243, __p3_243), vgetq_lane_u64(*(uint64x2_t *) &__reint_243, __p3_243)}; \
41993 __ret_243 = vcmla_rot180_f64(__s0_243, __s1_243, *(float64x1_t *) &__reint1_243); \
41994 __ret_243; \
41995})
41996#else
41997#define vcmla_rot180_laneq_f64(__p0_244, __p1_244, __p2_244, __p3_244) __extension__ ({ \
41998 float64x1_t __s0_244 = __p0_244; \
41999 float64x1_t __s1_244 = __p1_244; \
42000 float64x2_t __s2_244 = __p2_244; \
42001 float64x2_t __rev2_244; __rev2_244 = __builtin_shufflevector(__s2_244, __s2_244, 1, 0); \
42002 float64x1_t __ret_244; \
42003float64x2_t __reint_244 = __rev2_244; \
42004uint64x2_t __reint1_244 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_244, __p3_244), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_244, __p3_244)}; \
42005 __ret_244 = vcmla_rot180_f64(__s0_244, __s1_244, *(float64x1_t *) &__reint1_244); \
42006 __ret_244; \
42007})
42008#endif
42009
42010#ifdef __LITTLE_ENDIAN__
42011#define vcmlaq_rot180_laneq_f64(__p0_245, __p1_245, __p2_245, __p3_245) __extension__ ({ \
42012 float64x2_t __s0_245 = __p0_245; \
42013 float64x2_t __s1_245 = __p1_245; \
42014 float64x2_t __s2_245 = __p2_245; \
42015 float64x2_t __ret_245; \
42016float64x2_t __reint_245 = __s2_245; \
42017uint64x2_t __reint1_245 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_245, __p3_245), vgetq_lane_u64(*(uint64x2_t *) &__reint_245, __p3_245)}; \
42018 __ret_245 = vcmlaq_rot180_f64(__s0_245, __s1_245, *(float64x2_t *) &__reint1_245); \
42019 __ret_245; \
42020})
42021#else
42022#define vcmlaq_rot180_laneq_f64(__p0_246, __p1_246, __p2_246, __p3_246) __extension__ ({ \
42023 float64x2_t __s0_246 = __p0_246; \
42024 float64x2_t __s1_246 = __p1_246; \
42025 float64x2_t __s2_246 = __p2_246; \
42026 float64x2_t __rev0_246; __rev0_246 = __builtin_shufflevector(__s0_246, __s0_246, 1, 0); \
42027 float64x2_t __rev1_246; __rev1_246 = __builtin_shufflevector(__s1_246, __s1_246, 1, 0); \
42028 float64x2_t __rev2_246; __rev2_246 = __builtin_shufflevector(__s2_246, __s2_246, 1, 0); \
42029 float64x2_t __ret_246; \
42030float64x2_t __reint_246 = __rev2_246; \
42031uint64x2_t __reint1_246 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_246, __p3_246), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_246, __p3_246)}; \
42032 __ret_246 = __noswap_vcmlaq_rot180_f64(__rev0_246, __rev1_246, *(float64x2_t *) &__reint1_246); \
42033 __ret_246 = __builtin_shufflevector(__ret_246, __ret_246, 1, 0); \
42034 __ret_246; \
42035})
42036#endif
42037
42038#ifdef __LITTLE_ENDIAN__
42039__ai float64x2_t vcmlaq_rot270_f64(float64x2_t __p0, float64x2_t __p1, float64x2_t __p2) {
42040 float64x2_t __ret;
42041 __ret = (float64x2_t) __builtin_neon_vcmlaq_rot270_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 42);
42042 return __ret;
42043}
42044#else
42045__ai float64x2_t vcmlaq_rot270_f64(float64x2_t __p0, float64x2_t __p1, float64x2_t __p2) {
42046 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
42047 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
42048 float64x2_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 1, 0);
42049 float64x2_t __ret;
42050 __ret = (float64x2_t) __builtin_neon_vcmlaq_rot270_v((int8x16_t)__rev0, (int8x16_t)__rev1, (int8x16_t)__rev2, 42);
42051 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
42052 return __ret;
42053}
42054__ai float64x2_t __noswap_vcmlaq_rot270_f64(float64x2_t __p0, float64x2_t __p1, float64x2_t __p2) {
42055 float64x2_t __ret;
42056 __ret = (float64x2_t) __builtin_neon_vcmlaq_rot270_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 42);
42057 return __ret;
42058}
42059#endif
42060
42061__ai float64x1_t vcmla_rot270_f64(float64x1_t __p0, float64x1_t __p1, float64x1_t __p2) {
42062 float64x1_t __ret;
42063 __ret = (float64x1_t) __builtin_neon_vcmla_rot270_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 10);
42064 return __ret;
42065}
42066#define vcmla_rot270_lane_f64(__p0_247, __p1_247, __p2_247, __p3_247) __extension__ ({ \
42067 float64x1_t __s0_247 = __p0_247; \
42068 float64x1_t __s1_247 = __p1_247; \
42069 float64x1_t __s2_247 = __p2_247; \
42070 float64x1_t __ret_247; \
42071float64x1_t __reint_247 = __s2_247; \
42072uint64x2_t __reint1_247 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_247, __p3_247), vgetq_lane_u64(*(uint64x2_t *) &__reint_247, __p3_247)}; \
42073 __ret_247 = vcmla_rot270_f64(__s0_247, __s1_247, *(float64x1_t *) &__reint1_247); \
42074 __ret_247; \
42075})
42076#ifdef __LITTLE_ENDIAN__
42077#define vcmlaq_rot270_lane_f64(__p0_248, __p1_248, __p2_248, __p3_248) __extension__ ({ \
42078 float64x2_t __s0_248 = __p0_248; \
42079 float64x2_t __s1_248 = __p1_248; \
42080 float64x1_t __s2_248 = __p2_248; \
42081 float64x2_t __ret_248; \
42082float64x1_t __reint_248 = __s2_248; \
42083uint64x2_t __reint1_248 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_248, __p3_248), vgetq_lane_u64(*(uint64x2_t *) &__reint_248, __p3_248)}; \
42084 __ret_248 = vcmlaq_rot270_f64(__s0_248, __s1_248, *(float64x2_t *) &__reint1_248); \
42085 __ret_248; \
42086})
42087#else
42088#define vcmlaq_rot270_lane_f64(__p0_249, __p1_249, __p2_249, __p3_249) __extension__ ({ \
42089 float64x2_t __s0_249 = __p0_249; \
42090 float64x2_t __s1_249 = __p1_249; \
42091 float64x1_t __s2_249 = __p2_249; \
42092 float64x2_t __rev0_249; __rev0_249 = __builtin_shufflevector(__s0_249, __s0_249, 1, 0); \
42093 float64x2_t __rev1_249; __rev1_249 = __builtin_shufflevector(__s1_249, __s1_249, 1, 0); \
42094 float64x2_t __ret_249; \
42095float64x1_t __reint_249 = __s2_249; \
42096uint64x2_t __reint1_249 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_249, __p3_249), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_249, __p3_249)}; \
42097 __ret_249 = __noswap_vcmlaq_rot270_f64(__rev0_249, __rev1_249, *(float64x2_t *) &__reint1_249); \
42098 __ret_249 = __builtin_shufflevector(__ret_249, __ret_249, 1, 0); \
42099 __ret_249; \
42100})
42101#endif
42102
42103#ifdef __LITTLE_ENDIAN__
42104#define vcmla_rot270_laneq_f64(__p0_250, __p1_250, __p2_250, __p3_250) __extension__ ({ \
42105 float64x1_t __s0_250 = __p0_250; \
42106 float64x1_t __s1_250 = __p1_250; \
42107 float64x2_t __s2_250 = __p2_250; \
42108 float64x1_t __ret_250; \
42109float64x2_t __reint_250 = __s2_250; \
42110uint64x2_t __reint1_250 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_250, __p3_250), vgetq_lane_u64(*(uint64x2_t *) &__reint_250, __p3_250)}; \
42111 __ret_250 = vcmla_rot270_f64(__s0_250, __s1_250, *(float64x1_t *) &__reint1_250); \
42112 __ret_250; \
42113})
42114#else
42115#define vcmla_rot270_laneq_f64(__p0_251, __p1_251, __p2_251, __p3_251) __extension__ ({ \
42116 float64x1_t __s0_251 = __p0_251; \
42117 float64x1_t __s1_251 = __p1_251; \
42118 float64x2_t __s2_251 = __p2_251; \
42119 float64x2_t __rev2_251; __rev2_251 = __builtin_shufflevector(__s2_251, __s2_251, 1, 0); \
42120 float64x1_t __ret_251; \
42121float64x2_t __reint_251 = __rev2_251; \
42122uint64x2_t __reint1_251 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_251, __p3_251), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_251, __p3_251)}; \
42123 __ret_251 = vcmla_rot270_f64(__s0_251, __s1_251, *(float64x1_t *) &__reint1_251); \
42124 __ret_251; \
42125})
42126#endif
42127
42128#ifdef __LITTLE_ENDIAN__
42129#define vcmlaq_rot270_laneq_f64(__p0_252, __p1_252, __p2_252, __p3_252) __extension__ ({ \
42130 float64x2_t __s0_252 = __p0_252; \
42131 float64x2_t __s1_252 = __p1_252; \
42132 float64x2_t __s2_252 = __p2_252; \
42133 float64x2_t __ret_252; \
42134float64x2_t __reint_252 = __s2_252; \
42135uint64x2_t __reint1_252 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_252, __p3_252), vgetq_lane_u64(*(uint64x2_t *) &__reint_252, __p3_252)}; \
42136 __ret_252 = vcmlaq_rot270_f64(__s0_252, __s1_252, *(float64x2_t *) &__reint1_252); \
42137 __ret_252; \
42138})
42139#else
42140#define vcmlaq_rot270_laneq_f64(__p0_253, __p1_253, __p2_253, __p3_253) __extension__ ({ \
42141 float64x2_t __s0_253 = __p0_253; \
42142 float64x2_t __s1_253 = __p1_253; \
42143 float64x2_t __s2_253 = __p2_253; \
42144 float64x2_t __rev0_253; __rev0_253 = __builtin_shufflevector(__s0_253, __s0_253, 1, 0); \
42145 float64x2_t __rev1_253; __rev1_253 = __builtin_shufflevector(__s1_253, __s1_253, 1, 0); \
42146 float64x2_t __rev2_253; __rev2_253 = __builtin_shufflevector(__s2_253, __s2_253, 1, 0); \
42147 float64x2_t __ret_253; \
42148float64x2_t __reint_253 = __rev2_253; \
42149uint64x2_t __reint1_253 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_253, __p3_253), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_253, __p3_253)}; \
42150 __ret_253 = __noswap_vcmlaq_rot270_f64(__rev0_253, __rev1_253, *(float64x2_t *) &__reint1_253); \
42151 __ret_253 = __builtin_shufflevector(__ret_253, __ret_253, 1, 0); \
42152 __ret_253; \
42153})
42154#endif
42155
42156#ifdef __LITTLE_ENDIAN__
42157__ai float64x2_t vcmlaq_rot90_f64(float64x2_t __p0, float64x2_t __p1, float64x2_t __p2) {
42158 float64x2_t __ret;
42159 __ret = (float64x2_t) __builtin_neon_vcmlaq_rot90_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 42);
42160 return __ret;
42161}
42162#else
42163__ai float64x2_t vcmlaq_rot90_f64(float64x2_t __p0, float64x2_t __p1, float64x2_t __p2) {
42164 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
42165 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
42166 float64x2_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 1, 0);
42167 float64x2_t __ret;
42168 __ret = (float64x2_t) __builtin_neon_vcmlaq_rot90_v((int8x16_t)__rev0, (int8x16_t)__rev1, (int8x16_t)__rev2, 42);
40516 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);42169 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
40517 return __ret;42170 return __ret;
40518}42171}
42172__ai float64x2_t __noswap_vcmlaq_rot90_f64(float64x2_t __p0, float64x2_t __p1, float64x2_t __p2) {
42173 float64x2_t __ret;
42174 __ret = (float64x2_t) __builtin_neon_vcmlaq_rot90_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 42);
42175 return __ret;
42176}
42177#endif
42178
42179__ai float64x1_t vcmla_rot90_f64(float64x1_t __p0, float64x1_t __p1, float64x1_t __p2) {
42180 float64x1_t __ret;
42181 __ret = (float64x1_t) __builtin_neon_vcmla_rot90_v((int8x8_t)__p0, (int8x8_t)__p1, (int8x8_t)__p2, 10);
42182 return __ret;
42183}
42184#define vcmla_rot90_lane_f64(__p0_254, __p1_254, __p2_254, __p3_254) __extension__ ({ \
42185 float64x1_t __s0_254 = __p0_254; \
42186 float64x1_t __s1_254 = __p1_254; \
42187 float64x1_t __s2_254 = __p2_254; \
42188 float64x1_t __ret_254; \
42189float64x1_t __reint_254 = __s2_254; \
42190uint64x2_t __reint1_254 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_254, __p3_254), vgetq_lane_u64(*(uint64x2_t *) &__reint_254, __p3_254)}; \
42191 __ret_254 = vcmla_rot90_f64(__s0_254, __s1_254, *(float64x1_t *) &__reint1_254); \
42192 __ret_254; \
42193})
42194#ifdef __LITTLE_ENDIAN__
42195#define vcmlaq_rot90_lane_f64(__p0_255, __p1_255, __p2_255, __p3_255) __extension__ ({ \
42196 float64x2_t __s0_255 = __p0_255; \
42197 float64x2_t __s1_255 = __p1_255; \
42198 float64x1_t __s2_255 = __p2_255; \
42199 float64x2_t __ret_255; \
42200float64x1_t __reint_255 = __s2_255; \
42201uint64x2_t __reint1_255 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_255, __p3_255), vgetq_lane_u64(*(uint64x2_t *) &__reint_255, __p3_255)}; \
42202 __ret_255 = vcmlaq_rot90_f64(__s0_255, __s1_255, *(float64x2_t *) &__reint1_255); \
42203 __ret_255; \
42204})
42205#else
42206#define vcmlaq_rot90_lane_f64(__p0_256, __p1_256, __p2_256, __p3_256) __extension__ ({ \
42207 float64x2_t __s0_256 = __p0_256; \
42208 float64x2_t __s1_256 = __p1_256; \
42209 float64x1_t __s2_256 = __p2_256; \
42210 float64x2_t __rev0_256; __rev0_256 = __builtin_shufflevector(__s0_256, __s0_256, 1, 0); \
42211 float64x2_t __rev1_256; __rev1_256 = __builtin_shufflevector(__s1_256, __s1_256, 1, 0); \
42212 float64x2_t __ret_256; \
42213float64x1_t __reint_256 = __s2_256; \
42214uint64x2_t __reint1_256 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_256, __p3_256), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_256, __p3_256)}; \
42215 __ret_256 = __noswap_vcmlaq_rot90_f64(__rev0_256, __rev1_256, *(float64x2_t *) &__reint1_256); \
42216 __ret_256 = __builtin_shufflevector(__ret_256, __ret_256, 1, 0); \
42217 __ret_256; \
42218})
40519#endif42219#endif
4052042220
40521#ifdef __LITTLE_ENDIAN__42221#ifdef __LITTLE_ENDIAN__
40522__ai float64x2_t vcaddq_rot90_f64(float64x2_t __p0, float64x2_t __p1) {42222#define vcmla_rot90_laneq_f64(__p0_257, __p1_257, __p2_257, __p3_257) __extension__ ({ \
40523 float64x2_t __ret;42223 float64x1_t __s0_257 = __p0_257; \
40524 __ret = (float64x2_t) __builtin_neon_vcaddq_rot90_v((int8x16_t)__p0, (int8x16_t)__p1, 42);42224 float64x1_t __s1_257 = __p1_257; \
40525 return __ret;42225 float64x2_t __s2_257 = __p2_257; \
40526}42226 float64x1_t __ret_257; \
42227float64x2_t __reint_257 = __s2_257; \
42228uint64x2_t __reint1_257 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_257, __p3_257), vgetq_lane_u64(*(uint64x2_t *) &__reint_257, __p3_257)}; \
42229 __ret_257 = vcmla_rot90_f64(__s0_257, __s1_257, *(float64x1_t *) &__reint1_257); \
42230 __ret_257; \
42231})
40527#else42232#else
40528__ai float64x2_t vcaddq_rot90_f64(float64x2_t __p0, float64x2_t __p1) {42233#define vcmla_rot90_laneq_f64(__p0_258, __p1_258, __p2_258, __p3_258) __extension__ ({ \
40529 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);42234 float64x1_t __s0_258 = __p0_258; \
40530 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);42235 float64x1_t __s1_258 = __p1_258; \
40531 float64x2_t __ret;42236 float64x2_t __s2_258 = __p2_258; \
40532 __ret = (float64x2_t) __builtin_neon_vcaddq_rot90_v((int8x16_t)__rev0, (int8x16_t)__rev1, 42);42237 float64x2_t __rev2_258; __rev2_258 = __builtin_shufflevector(__s2_258, __s2_258, 1, 0); \
40533 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);42238 float64x1_t __ret_258; \
40534 return __ret;42239float64x2_t __reint_258 = __rev2_258; \
40535}42240uint64x2_t __reint1_258 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_258, __p3_258), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_258, __p3_258)}; \
42241 __ret_258 = vcmla_rot90_f64(__s0_258, __s1_258, *(float64x1_t *) &__reint1_258); \
42242 __ret_258; \
42243})
42244#endif
42245
42246#ifdef __LITTLE_ENDIAN__
42247#define vcmlaq_rot90_laneq_f64(__p0_259, __p1_259, __p2_259, __p3_259) __extension__ ({ \
42248 float64x2_t __s0_259 = __p0_259; \
42249 float64x2_t __s1_259 = __p1_259; \
42250 float64x2_t __s2_259 = __p2_259; \
42251 float64x2_t __ret_259; \
42252float64x2_t __reint_259 = __s2_259; \
42253uint64x2_t __reint1_259 = (uint64x2_t) {vgetq_lane_u64(*(uint64x2_t *) &__reint_259, __p3_259), vgetq_lane_u64(*(uint64x2_t *) &__reint_259, __p3_259)}; \
42254 __ret_259 = vcmlaq_rot90_f64(__s0_259, __s1_259, *(float64x2_t *) &__reint1_259); \
42255 __ret_259; \
42256})
42257#else
42258#define vcmlaq_rot90_laneq_f64(__p0_260, __p1_260, __p2_260, __p3_260) __extension__ ({ \
42259 float64x2_t __s0_260 = __p0_260; \
42260 float64x2_t __s1_260 = __p1_260; \
42261 float64x2_t __s2_260 = __p2_260; \
42262 float64x2_t __rev0_260; __rev0_260 = __builtin_shufflevector(__s0_260, __s0_260, 1, 0); \
42263 float64x2_t __rev1_260; __rev1_260 = __builtin_shufflevector(__s1_260, __s1_260, 1, 0); \
42264 float64x2_t __rev2_260; __rev2_260 = __builtin_shufflevector(__s2_260, __s2_260, 1, 0); \
42265 float64x2_t __ret_260; \
42266float64x2_t __reint_260 = __rev2_260; \
42267uint64x2_t __reint1_260 = (uint64x2_t) {__noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_260, __p3_260), __noswap_vgetq_lane_u64(*(uint64x2_t *) &__reint_260, __p3_260)}; \
42268 __ret_260 = __noswap_vcmlaq_rot90_f64(__rev0_260, __rev1_260, *(float64x2_t *) &__reint1_260); \
42269 __ret_260 = __builtin_shufflevector(__ret_260, __ret_260, 1, 0); \
42270 __ret_260; \
42271})
40536#endif42272#endif
4053742273
40538#endif42274#endif
...@@ -40630,228 +42366,228 @@ __ai int32x2_t __noswap_vdot_s32(int32x2_t __p0, int8x8_t __p1, int8x8_t __p2) {...@@ -40630,228 +42366,228 @@ __ai int32x2_t __noswap_vdot_s32(int32x2_t __p0, int8x8_t __p1, int8x8_t __p2) {
40630#endif42366#endif
4063142367
40632#ifdef __LITTLE_ENDIAN__42368#ifdef __LITTLE_ENDIAN__
40633#define vdotq_lane_u32(__p0_169, __p1_169, __p2_169, __p3_169) __extension__ ({ \42369#define vdotq_lane_u32(__p0_261, __p1_261, __p2_261, __p3_261) __extension__ ({ \
40634 uint32x4_t __s0_169 = __p0_169; \42370 uint32x4_t __s0_261 = __p0_261; \
40635 uint8x16_t __s1_169 = __p1_169; \42371 uint8x16_t __s1_261 = __p1_261; \
40636 uint8x8_t __s2_169 = __p2_169; \42372 uint8x8_t __s2_261 = __p2_261; \
40637 uint32x4_t __ret_169; \42373 uint32x4_t __ret_261; \
40638uint8x8_t __reint_169 = __s2_169; \42374uint8x8_t __reint_261 = __s2_261; \
40639uint32x4_t __reint1_169 = splatq_lane_u32(*(uint32x2_t *) &__reint_169, __p3_169); \42375uint32x4_t __reint1_261 = splatq_lane_u32(*(uint32x2_t *) &__reint_261, __p3_261); \
40640 __ret_169 = vdotq_u32(__s0_169, __s1_169, *(uint8x16_t *) &__reint1_169); \42376 __ret_261 = vdotq_u32(__s0_261, __s1_261, *(uint8x16_t *) &__reint1_261); \
40641 __ret_169; \42377 __ret_261; \
40642})42378})
40643#else42379#else
40644#define vdotq_lane_u32(__p0_170, __p1_170, __p2_170, __p3_170) __extension__ ({ \42380#define vdotq_lane_u32(__p0_262, __p1_262, __p2_262, __p3_262) __extension__ ({ \
40645 uint32x4_t __s0_170 = __p0_170; \42381 uint32x4_t __s0_262 = __p0_262; \
40646 uint8x16_t __s1_170 = __p1_170; \42382 uint8x16_t __s1_262 = __p1_262; \
40647 uint8x8_t __s2_170 = __p2_170; \42383 uint8x8_t __s2_262 = __p2_262; \
40648 uint32x4_t __rev0_170; __rev0_170 = __builtin_shufflevector(__s0_170, __s0_170, 3, 2, 1, 0); \42384 uint32x4_t __rev0_262; __rev0_262 = __builtin_shufflevector(__s0_262, __s0_262, 3, 2, 1, 0); \
40649 uint8x16_t __rev1_170; __rev1_170 = __builtin_shufflevector(__s1_170, __s1_170, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \42385 uint8x16_t __rev1_262; __rev1_262 = __builtin_shufflevector(__s1_262, __s1_262, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
40650 uint8x8_t __rev2_170; __rev2_170 = __builtin_shufflevector(__s2_170, __s2_170, 7, 6, 5, 4, 3, 2, 1, 0); \42386 uint8x8_t __rev2_262; __rev2_262 = __builtin_shufflevector(__s2_262, __s2_262, 7, 6, 5, 4, 3, 2, 1, 0); \
40651 uint32x4_t __ret_170; \42387 uint32x4_t __ret_262; \
40652uint8x8_t __reint_170 = __rev2_170; \42388uint8x8_t __reint_262 = __rev2_262; \
40653uint32x4_t __reint1_170 = __noswap_splatq_lane_u32(*(uint32x2_t *) &__reint_170, __p3_170); \42389uint32x4_t __reint1_262 = __noswap_splatq_lane_u32(*(uint32x2_t *) &__reint_262, __p3_262); \
40654 __ret_170 = __noswap_vdotq_u32(__rev0_170, __rev1_170, *(uint8x16_t *) &__reint1_170); \42390 __ret_262 = __noswap_vdotq_u32(__rev0_262, __rev1_262, *(uint8x16_t *) &__reint1_262); \
40655 __ret_170 = __builtin_shufflevector(__ret_170, __ret_170, 3, 2, 1, 0); \42391 __ret_262 = __builtin_shufflevector(__ret_262, __ret_262, 3, 2, 1, 0); \
40656 __ret_170; \42392 __ret_262; \
40657})42393})
40658#endif42394#endif
4065942395
40660#ifdef __LITTLE_ENDIAN__42396#ifdef __LITTLE_ENDIAN__
40661#define vdotq_lane_s32(__p0_171, __p1_171, __p2_171, __p3_171) __extension__ ({ \42397#define vdotq_lane_s32(__p0_263, __p1_263, __p2_263, __p3_263) __extension__ ({ \
40662 int32x4_t __s0_171 = __p0_171; \42398 int32x4_t __s0_263 = __p0_263; \
40663 int8x16_t __s1_171 = __p1_171; \42399 int8x16_t __s1_263 = __p1_263; \
40664 int8x8_t __s2_171 = __p2_171; \42400 int8x8_t __s2_263 = __p2_263; \
40665 int32x4_t __ret_171; \42401 int32x4_t __ret_263; \
40666int8x8_t __reint_171 = __s2_171; \42402int8x8_t __reint_263 = __s2_263; \
40667int32x4_t __reint1_171 = splatq_lane_s32(*(int32x2_t *) &__reint_171, __p3_171); \42403int32x4_t __reint1_263 = splatq_lane_s32(*(int32x2_t *) &__reint_263, __p3_263); \
40668 __ret_171 = vdotq_s32(__s0_171, __s1_171, *(int8x16_t *) &__reint1_171); \42404 __ret_263 = vdotq_s32(__s0_263, __s1_263, *(int8x16_t *) &__reint1_263); \
40669 __ret_171; \42405 __ret_263; \
40670})42406})
40671#else42407#else
40672#define vdotq_lane_s32(__p0_172, __p1_172, __p2_172, __p3_172) __extension__ ({ \42408#define vdotq_lane_s32(__p0_264, __p1_264, __p2_264, __p3_264) __extension__ ({ \
40673 int32x4_t __s0_172 = __p0_172; \42409 int32x4_t __s0_264 = __p0_264; \
40674 int8x16_t __s1_172 = __p1_172; \42410 int8x16_t __s1_264 = __p1_264; \
40675 int8x8_t __s2_172 = __p2_172; \42411 int8x8_t __s2_264 = __p2_264; \
40676 int32x4_t __rev0_172; __rev0_172 = __builtin_shufflevector(__s0_172, __s0_172, 3, 2, 1, 0); \42412 int32x4_t __rev0_264; __rev0_264 = __builtin_shufflevector(__s0_264, __s0_264, 3, 2, 1, 0); \
40677 int8x16_t __rev1_172; __rev1_172 = __builtin_shufflevector(__s1_172, __s1_172, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \42413 int8x16_t __rev1_264; __rev1_264 = __builtin_shufflevector(__s1_264, __s1_264, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
40678 int8x8_t __rev2_172; __rev2_172 = __builtin_shufflevector(__s2_172, __s2_172, 7, 6, 5, 4, 3, 2, 1, 0); \42414 int8x8_t __rev2_264; __rev2_264 = __builtin_shufflevector(__s2_264, __s2_264, 7, 6, 5, 4, 3, 2, 1, 0); \
40679 int32x4_t __ret_172; \42415 int32x4_t __ret_264; \
40680int8x8_t __reint_172 = __rev2_172; \42416int8x8_t __reint_264 = __rev2_264; \
40681int32x4_t __reint1_172 = __noswap_splatq_lane_s32(*(int32x2_t *) &__reint_172, __p3_172); \42417int32x4_t __reint1_264 = __noswap_splatq_lane_s32(*(int32x2_t *) &__reint_264, __p3_264); \
40682 __ret_172 = __noswap_vdotq_s32(__rev0_172, __rev1_172, *(int8x16_t *) &__reint1_172); \42418 __ret_264 = __noswap_vdotq_s32(__rev0_264, __rev1_264, *(int8x16_t *) &__reint1_264); \
40683 __ret_172 = __builtin_shufflevector(__ret_172, __ret_172, 3, 2, 1, 0); \42419 __ret_264 = __builtin_shufflevector(__ret_264, __ret_264, 3, 2, 1, 0); \
40684 __ret_172; \42420 __ret_264; \
40685})42421})
40686#endif42422#endif
4068742423
40688#ifdef __LITTLE_ENDIAN__42424#ifdef __LITTLE_ENDIAN__
40689#define vdot_lane_u32(__p0_173, __p1_173, __p2_173, __p3_173) __extension__ ({ \42425#define vdot_lane_u32(__p0_265, __p1_265, __p2_265, __p3_265) __extension__ ({ \
40690 uint32x2_t __s0_173 = __p0_173; \42426 uint32x2_t __s0_265 = __p0_265; \
40691 uint8x8_t __s1_173 = __p1_173; \42427 uint8x8_t __s1_265 = __p1_265; \
40692 uint8x8_t __s2_173 = __p2_173; \42428 uint8x8_t __s2_265 = __p2_265; \
40693 uint32x2_t __ret_173; \42429 uint32x2_t __ret_265; \
40694uint8x8_t __reint_173 = __s2_173; \42430uint8x8_t __reint_265 = __s2_265; \
40695uint32x2_t __reint1_173 = splat_lane_u32(*(uint32x2_t *) &__reint_173, __p3_173); \42431uint32x2_t __reint1_265 = splat_lane_u32(*(uint32x2_t *) &__reint_265, __p3_265); \
40696 __ret_173 = vdot_u32(__s0_173, __s1_173, *(uint8x8_t *) &__reint1_173); \42432 __ret_265 = vdot_u32(__s0_265, __s1_265, *(uint8x8_t *) &__reint1_265); \
40697 __ret_173; \42433 __ret_265; \
40698})42434})
40699#else42435#else
40700#define vdot_lane_u32(__p0_174, __p1_174, __p2_174, __p3_174) __extension__ ({ \42436#define vdot_lane_u32(__p0_266, __p1_266, __p2_266, __p3_266) __extension__ ({ \
40701 uint32x2_t __s0_174 = __p0_174; \42437 uint32x2_t __s0_266 = __p0_266; \
40702 uint8x8_t __s1_174 = __p1_174; \42438 uint8x8_t __s1_266 = __p1_266; \
40703 uint8x8_t __s2_174 = __p2_174; \42439 uint8x8_t __s2_266 = __p2_266; \
40704 uint32x2_t __rev0_174; __rev0_174 = __builtin_shufflevector(__s0_174, __s0_174, 1, 0); \42440 uint32x2_t __rev0_266; __rev0_266 = __builtin_shufflevector(__s0_266, __s0_266, 1, 0); \
40705 uint8x8_t __rev1_174; __rev1_174 = __builtin_shufflevector(__s1_174, __s1_174, 7, 6, 5, 4, 3, 2, 1, 0); \42441 uint8x8_t __rev1_266; __rev1_266 = __builtin_shufflevector(__s1_266, __s1_266, 7, 6, 5, 4, 3, 2, 1, 0); \
40706 uint8x8_t __rev2_174; __rev2_174 = __builtin_shufflevector(__s2_174, __s2_174, 7, 6, 5, 4, 3, 2, 1, 0); \42442 uint8x8_t __rev2_266; __rev2_266 = __builtin_shufflevector(__s2_266, __s2_266, 7, 6, 5, 4, 3, 2, 1, 0); \
40707 uint32x2_t __ret_174; \42443 uint32x2_t __ret_266; \
40708uint8x8_t __reint_174 = __rev2_174; \42444uint8x8_t __reint_266 = __rev2_266; \
40709uint32x2_t __reint1_174 = __noswap_splat_lane_u32(*(uint32x2_t *) &__reint_174, __p3_174); \42445uint32x2_t __reint1_266 = __noswap_splat_lane_u32(*(uint32x2_t *) &__reint_266, __p3_266); \
40710 __ret_174 = __noswap_vdot_u32(__rev0_174, __rev1_174, *(uint8x8_t *) &__reint1_174); \42446 __ret_266 = __noswap_vdot_u32(__rev0_266, __rev1_266, *(uint8x8_t *) &__reint1_266); \
40711 __ret_174 = __builtin_shufflevector(__ret_174, __ret_174, 1, 0); \42447 __ret_266 = __builtin_shufflevector(__ret_266, __ret_266, 1, 0); \
40712 __ret_174; \42448 __ret_266; \
40713})42449})
40714#endif42450#endif
4071542451
40716#ifdef __LITTLE_ENDIAN__42452#ifdef __LITTLE_ENDIAN__
40717#define vdot_lane_s32(__p0_175, __p1_175, __p2_175, __p3_175) __extension__ ({ \42453#define vdot_lane_s32(__p0_267, __p1_267, __p2_267, __p3_267) __extension__ ({ \
40718 int32x2_t __s0_175 = __p0_175; \42454 int32x2_t __s0_267 = __p0_267; \
40719 int8x8_t __s1_175 = __p1_175; \42455 int8x8_t __s1_267 = __p1_267; \
40720 int8x8_t __s2_175 = __p2_175; \42456 int8x8_t __s2_267 = __p2_267; \
40721 int32x2_t __ret_175; \42457 int32x2_t __ret_267; \
40722int8x8_t __reint_175 = __s2_175; \42458int8x8_t __reint_267 = __s2_267; \
40723int32x2_t __reint1_175 = splat_lane_s32(*(int32x2_t *) &__reint_175, __p3_175); \42459int32x2_t __reint1_267 = splat_lane_s32(*(int32x2_t *) &__reint_267, __p3_267); \
40724 __ret_175 = vdot_s32(__s0_175, __s1_175, *(int8x8_t *) &__reint1_175); \42460 __ret_267 = vdot_s32(__s0_267, __s1_267, *(int8x8_t *) &__reint1_267); \
40725 __ret_175; \42461 __ret_267; \
40726})42462})
40727#else42463#else
40728#define vdot_lane_s32(__p0_176, __p1_176, __p2_176, __p3_176) __extension__ ({ \42464#define vdot_lane_s32(__p0_268, __p1_268, __p2_268, __p3_268) __extension__ ({ \
40729 int32x2_t __s0_176 = __p0_176; \42465 int32x2_t __s0_268 = __p0_268; \
40730 int8x8_t __s1_176 = __p1_176; \42466 int8x8_t __s1_268 = __p1_268; \
40731 int8x8_t __s2_176 = __p2_176; \42467 int8x8_t __s2_268 = __p2_268; \
40732 int32x2_t __rev0_176; __rev0_176 = __builtin_shufflevector(__s0_176, __s0_176, 1, 0); \42468 int32x2_t __rev0_268; __rev0_268 = __builtin_shufflevector(__s0_268, __s0_268, 1, 0); \
40733 int8x8_t __rev1_176; __rev1_176 = __builtin_shufflevector(__s1_176, __s1_176, 7, 6, 5, 4, 3, 2, 1, 0); \42469 int8x8_t __rev1_268; __rev1_268 = __builtin_shufflevector(__s1_268, __s1_268, 7, 6, 5, 4, 3, 2, 1, 0); \
40734 int8x8_t __rev2_176; __rev2_176 = __builtin_shufflevector(__s2_176, __s2_176, 7, 6, 5, 4, 3, 2, 1, 0); \42470 int8x8_t __rev2_268; __rev2_268 = __builtin_shufflevector(__s2_268, __s2_268, 7, 6, 5, 4, 3, 2, 1, 0); \
40735 int32x2_t __ret_176; \42471 int32x2_t __ret_268; \
40736int8x8_t __reint_176 = __rev2_176; \42472int8x8_t __reint_268 = __rev2_268; \
40737int32x2_t __reint1_176 = __noswap_splat_lane_s32(*(int32x2_t *) &__reint_176, __p3_176); \42473int32x2_t __reint1_268 = __noswap_splat_lane_s32(*(int32x2_t *) &__reint_268, __p3_268); \
40738 __ret_176 = __noswap_vdot_s32(__rev0_176, __rev1_176, *(int8x8_t *) &__reint1_176); \42474 __ret_268 = __noswap_vdot_s32(__rev0_268, __rev1_268, *(int8x8_t *) &__reint1_268); \
40739 __ret_176 = __builtin_shufflevector(__ret_176, __ret_176, 1, 0); \42475 __ret_268 = __builtin_shufflevector(__ret_268, __ret_268, 1, 0); \
40740 __ret_176; \42476 __ret_268; \
40741})42477})
40742#endif42478#endif
4074342479
40744#endif42480#endif
40745#if defined(__ARM_FEATURE_DOTPROD) && defined(__aarch64__)42481#if defined(__ARM_FEATURE_DOTPROD) && defined(__aarch64__)
40746#ifdef __LITTLE_ENDIAN__42482#ifdef __LITTLE_ENDIAN__
40747#define vdotq_laneq_u32(__p0_177, __p1_177, __p2_177, __p3_177) __extension__ ({ \42483#define vdotq_laneq_u32(__p0_269, __p1_269, __p2_269, __p3_269) __extension__ ({ \
40748 uint32x4_t __s0_177 = __p0_177; \42484 uint32x4_t __s0_269 = __p0_269; \
40749 uint8x16_t __s1_177 = __p1_177; \42485 uint8x16_t __s1_269 = __p1_269; \
40750 uint8x16_t __s2_177 = __p2_177; \42486 uint8x16_t __s2_269 = __p2_269; \
40751 uint32x4_t __ret_177; \42487 uint32x4_t __ret_269; \
40752uint8x16_t __reint_177 = __s2_177; \42488uint8x16_t __reint_269 = __s2_269; \
40753uint32x4_t __reint1_177 = splatq_laneq_u32(*(uint32x4_t *) &__reint_177, __p3_177); \42489uint32x4_t __reint1_269 = splatq_laneq_u32(*(uint32x4_t *) &__reint_269, __p3_269); \
40754 __ret_177 = vdotq_u32(__s0_177, __s1_177, *(uint8x16_t *) &__reint1_177); \42490 __ret_269 = vdotq_u32(__s0_269, __s1_269, *(uint8x16_t *) &__reint1_269); \
40755 __ret_177; \42491 __ret_269; \
40756})42492})
40757#else42493#else
40758#define vdotq_laneq_u32(__p0_178, __p1_178, __p2_178, __p3_178) __extension__ ({ \42494#define vdotq_laneq_u32(__p0_270, __p1_270, __p2_270, __p3_270) __extension__ ({ \
40759 uint32x4_t __s0_178 = __p0_178; \42495 uint32x4_t __s0_270 = __p0_270; \
40760 uint8x16_t __s1_178 = __p1_178; \42496 uint8x16_t __s1_270 = __p1_270; \
40761 uint8x16_t __s2_178 = __p2_178; \42497 uint8x16_t __s2_270 = __p2_270; \
40762 uint32x4_t __rev0_178; __rev0_178 = __builtin_shufflevector(__s0_178, __s0_178, 3, 2, 1, 0); \42498 uint32x4_t __rev0_270; __rev0_270 = __builtin_shufflevector(__s0_270, __s0_270, 3, 2, 1, 0); \
40763 uint8x16_t __rev1_178; __rev1_178 = __builtin_shufflevector(__s1_178, __s1_178, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \42499 uint8x16_t __rev1_270; __rev1_270 = __builtin_shufflevector(__s1_270, __s1_270, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
40764 uint8x16_t __rev2_178; __rev2_178 = __builtin_shufflevector(__s2_178, __s2_178, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \42500 uint8x16_t __rev2_270; __rev2_270 = __builtin_shufflevector(__s2_270, __s2_270, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
40765 uint32x4_t __ret_178; \42501 uint32x4_t __ret_270; \
40766uint8x16_t __reint_178 = __rev2_178; \42502uint8x16_t __reint_270 = __rev2_270; \
40767uint32x4_t __reint1_178 = __noswap_splatq_laneq_u32(*(uint32x4_t *) &__reint_178, __p3_178); \42503uint32x4_t __reint1_270 = __noswap_splatq_laneq_u32(*(uint32x4_t *) &__reint_270, __p3_270); \
40768 __ret_178 = __noswap_vdotq_u32(__rev0_178, __rev1_178, *(uint8x16_t *) &__reint1_178); \42504 __ret_270 = __noswap_vdotq_u32(__rev0_270, __rev1_270, *(uint8x16_t *) &__reint1_270); \
40769 __ret_178 = __builtin_shufflevector(__ret_178, __ret_178, 3, 2, 1, 0); \42505 __ret_270 = __builtin_shufflevector(__ret_270, __ret_270, 3, 2, 1, 0); \
40770 __ret_178; \42506 __ret_270; \
40771})42507})
40772#endif42508#endif
4077342509
40774#ifdef __LITTLE_ENDIAN__42510#ifdef __LITTLE_ENDIAN__
40775#define vdotq_laneq_s32(__p0_179, __p1_179, __p2_179, __p3_179) __extension__ ({ \42511#define vdotq_laneq_s32(__p0_271, __p1_271, __p2_271, __p3_271) __extension__ ({ \
40776 int32x4_t __s0_179 = __p0_179; \42512 int32x4_t __s0_271 = __p0_271; \
40777 int8x16_t __s1_179 = __p1_179; \42513 int8x16_t __s1_271 = __p1_271; \
40778 int8x16_t __s2_179 = __p2_179; \42514 int8x16_t __s2_271 = __p2_271; \
40779 int32x4_t __ret_179; \42515 int32x4_t __ret_271; \
40780int8x16_t __reint_179 = __s2_179; \42516int8x16_t __reint_271 = __s2_271; \
40781int32x4_t __reint1_179 = splatq_laneq_s32(*(int32x4_t *) &__reint_179, __p3_179); \42517int32x4_t __reint1_271 = splatq_laneq_s32(*(int32x4_t *) &__reint_271, __p3_271); \
40782 __ret_179 = vdotq_s32(__s0_179, __s1_179, *(int8x16_t *) &__reint1_179); \42518 __ret_271 = vdotq_s32(__s0_271, __s1_271, *(int8x16_t *) &__reint1_271); \
40783 __ret_179; \42519 __ret_271; \
40784})42520})
40785#else42521#else
40786#define vdotq_laneq_s32(__p0_180, __p1_180, __p2_180, __p3_180) __extension__ ({ \42522#define vdotq_laneq_s32(__p0_272, __p1_272, __p2_272, __p3_272) __extension__ ({ \
40787 int32x4_t __s0_180 = __p0_180; \42523 int32x4_t __s0_272 = __p0_272; \
40788 int8x16_t __s1_180 = __p1_180; \42524 int8x16_t __s1_272 = __p1_272; \
40789 int8x16_t __s2_180 = __p2_180; \42525 int8x16_t __s2_272 = __p2_272; \
40790 int32x4_t __rev0_180; __rev0_180 = __builtin_shufflevector(__s0_180, __s0_180, 3, 2, 1, 0); \42526 int32x4_t __rev0_272; __rev0_272 = __builtin_shufflevector(__s0_272, __s0_272, 3, 2, 1, 0); \
40791 int8x16_t __rev1_180; __rev1_180 = __builtin_shufflevector(__s1_180, __s1_180, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \42527 int8x16_t __rev1_272; __rev1_272 = __builtin_shufflevector(__s1_272, __s1_272, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
40792 int8x16_t __rev2_180; __rev2_180 = __builtin_shufflevector(__s2_180, __s2_180, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \42528 int8x16_t __rev2_272; __rev2_272 = __builtin_shufflevector(__s2_272, __s2_272, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
40793 int32x4_t __ret_180; \42529 int32x4_t __ret_272; \
40794int8x16_t __reint_180 = __rev2_180; \42530int8x16_t __reint_272 = __rev2_272; \
40795int32x4_t __reint1_180 = __noswap_splatq_laneq_s32(*(int32x4_t *) &__reint_180, __p3_180); \42531int32x4_t __reint1_272 = __noswap_splatq_laneq_s32(*(int32x4_t *) &__reint_272, __p3_272); \
40796 __ret_180 = __noswap_vdotq_s32(__rev0_180, __rev1_180, *(int8x16_t *) &__reint1_180); \42532 __ret_272 = __noswap_vdotq_s32(__rev0_272, __rev1_272, *(int8x16_t *) &__reint1_272); \
40797 __ret_180 = __builtin_shufflevector(__ret_180, __ret_180, 3, 2, 1, 0); \42533 __ret_272 = __builtin_shufflevector(__ret_272, __ret_272, 3, 2, 1, 0); \
40798 __ret_180; \42534 __ret_272; \
40799})42535})
40800#endif42536#endif
4080142537
40802#ifdef __LITTLE_ENDIAN__42538#ifdef __LITTLE_ENDIAN__
40803#define vdot_laneq_u32(__p0_181, __p1_181, __p2_181, __p3_181) __extension__ ({ \42539#define vdot_laneq_u32(__p0_273, __p1_273, __p2_273, __p3_273) __extension__ ({ \
40804 uint32x2_t __s0_181 = __p0_181; \42540 uint32x2_t __s0_273 = __p0_273; \
40805 uint8x8_t __s1_181 = __p1_181; \42541 uint8x8_t __s1_273 = __p1_273; \
40806 uint8x16_t __s2_181 = __p2_181; \42542 uint8x16_t __s2_273 = __p2_273; \
40807 uint32x2_t __ret_181; \42543 uint32x2_t __ret_273; \
40808uint8x16_t __reint_181 = __s2_181; \42544uint8x16_t __reint_273 = __s2_273; \
40809uint32x2_t __reint1_181 = splat_laneq_u32(*(uint32x4_t *) &__reint_181, __p3_181); \42545uint32x2_t __reint1_273 = splat_laneq_u32(*(uint32x4_t *) &__reint_273, __p3_273); \
40810 __ret_181 = vdot_u32(__s0_181, __s1_181, *(uint8x8_t *) &__reint1_181); \42546 __ret_273 = vdot_u32(__s0_273, __s1_273, *(uint8x8_t *) &__reint1_273); \
40811 __ret_181; \42547 __ret_273; \
40812})42548})
40813#else42549#else
40814#define vdot_laneq_u32(__p0_182, __p1_182, __p2_182, __p3_182) __extension__ ({ \42550#define vdot_laneq_u32(__p0_274, __p1_274, __p2_274, __p3_274) __extension__ ({ \
40815 uint32x2_t __s0_182 = __p0_182; \42551 uint32x2_t __s0_274 = __p0_274; \
40816 uint8x8_t __s1_182 = __p1_182; \42552 uint8x8_t __s1_274 = __p1_274; \
40817 uint8x16_t __s2_182 = __p2_182; \42553 uint8x16_t __s2_274 = __p2_274; \
40818 uint32x2_t __rev0_182; __rev0_182 = __builtin_shufflevector(__s0_182, __s0_182, 1, 0); \42554 uint32x2_t __rev0_274; __rev0_274 = __builtin_shufflevector(__s0_274, __s0_274, 1, 0); \
40819 uint8x8_t __rev1_182; __rev1_182 = __builtin_shufflevector(__s1_182, __s1_182, 7, 6, 5, 4, 3, 2, 1, 0); \42555 uint8x8_t __rev1_274; __rev1_274 = __builtin_shufflevector(__s1_274, __s1_274, 7, 6, 5, 4, 3, 2, 1, 0); \
40820 uint8x16_t __rev2_182; __rev2_182 = __builtin_shufflevector(__s2_182, __s2_182, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \42556 uint8x16_t __rev2_274; __rev2_274 = __builtin_shufflevector(__s2_274, __s2_274, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
40821 uint32x2_t __ret_182; \42557 uint32x2_t __ret_274; \
40822uint8x16_t __reint_182 = __rev2_182; \42558uint8x16_t __reint_274 = __rev2_274; \
40823uint32x2_t __reint1_182 = __noswap_splat_laneq_u32(*(uint32x4_t *) &__reint_182, __p3_182); \42559uint32x2_t __reint1_274 = __noswap_splat_laneq_u32(*(uint32x4_t *) &__reint_274, __p3_274); \
40824 __ret_182 = __noswap_vdot_u32(__rev0_182, __rev1_182, *(uint8x8_t *) &__reint1_182); \42560 __ret_274 = __noswap_vdot_u32(__rev0_274, __rev1_274, *(uint8x8_t *) &__reint1_274); \
40825 __ret_182 = __builtin_shufflevector(__ret_182, __ret_182, 1, 0); \42561 __ret_274 = __builtin_shufflevector(__ret_274, __ret_274, 1, 0); \
40826 __ret_182; \42562 __ret_274; \
40827})42563})
40828#endif42564#endif
4082942565
40830#ifdef __LITTLE_ENDIAN__42566#ifdef __LITTLE_ENDIAN__
40831#define vdot_laneq_s32(__p0_183, __p1_183, __p2_183, __p3_183) __extension__ ({ \42567#define vdot_laneq_s32(__p0_275, __p1_275, __p2_275, __p3_275) __extension__ ({ \
40832 int32x2_t __s0_183 = __p0_183; \42568 int32x2_t __s0_275 = __p0_275; \
40833 int8x8_t __s1_183 = __p1_183; \42569 int8x8_t __s1_275 = __p1_275; \
40834 int8x16_t __s2_183 = __p2_183; \42570 int8x16_t __s2_275 = __p2_275; \
40835 int32x2_t __ret_183; \42571 int32x2_t __ret_275; \
40836int8x16_t __reint_183 = __s2_183; \42572int8x16_t __reint_275 = __s2_275; \
40837int32x2_t __reint1_183 = splat_laneq_s32(*(int32x4_t *) &__reint_183, __p3_183); \42573int32x2_t __reint1_275 = splat_laneq_s32(*(int32x4_t *) &__reint_275, __p3_275); \
40838 __ret_183 = vdot_s32(__s0_183, __s1_183, *(int8x8_t *) &__reint1_183); \42574 __ret_275 = vdot_s32(__s0_275, __s1_275, *(int8x8_t *) &__reint1_275); \
40839 __ret_183; \42575 __ret_275; \
40840})42576})
40841#else42577#else
40842#define vdot_laneq_s32(__p0_184, __p1_184, __p2_184, __p3_184) __extension__ ({ \42578#define vdot_laneq_s32(__p0_276, __p1_276, __p2_276, __p3_276) __extension__ ({ \
40843 int32x2_t __s0_184 = __p0_184; \42579 int32x2_t __s0_276 = __p0_276; \
40844 int8x8_t __s1_184 = __p1_184; \42580 int8x8_t __s1_276 = __p1_276; \
40845 int8x16_t __s2_184 = __p2_184; \42581 int8x16_t __s2_276 = __p2_276; \
40846 int32x2_t __rev0_184; __rev0_184 = __builtin_shufflevector(__s0_184, __s0_184, 1, 0); \42582 int32x2_t __rev0_276; __rev0_276 = __builtin_shufflevector(__s0_276, __s0_276, 1, 0); \
40847 int8x8_t __rev1_184; __rev1_184 = __builtin_shufflevector(__s1_184, __s1_184, 7, 6, 5, 4, 3, 2, 1, 0); \42583 int8x8_t __rev1_276; __rev1_276 = __builtin_shufflevector(__s1_276, __s1_276, 7, 6, 5, 4, 3, 2, 1, 0); \
40848 int8x16_t __rev2_184; __rev2_184 = __builtin_shufflevector(__s2_184, __s2_184, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \42584 int8x16_t __rev2_276; __rev2_276 = __builtin_shufflevector(__s2_276, __s2_276, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
40849 int32x2_t __ret_184; \42585 int32x2_t __ret_276; \
40850int8x16_t __reint_184 = __rev2_184; \42586int8x16_t __reint_276 = __rev2_276; \
40851int32x2_t __reint1_184 = __noswap_splat_laneq_s32(*(int32x4_t *) &__reint_184, __p3_184); \42587int32x2_t __reint1_276 = __noswap_splat_laneq_s32(*(int32x4_t *) &__reint_276, __p3_276); \
40852 __ret_184 = __noswap_vdot_s32(__rev0_184, __rev1_184, *(int8x8_t *) &__reint1_184); \42588 __ret_276 = __noswap_vdot_s32(__rev0_276, __rev1_276, *(int8x8_t *) &__reint1_276); \
40853 __ret_184 = __builtin_shufflevector(__ret_184, __ret_184, 1, 0); \42589 __ret_276 = __builtin_shufflevector(__ret_276, __ret_276, 1, 0); \
40854 __ret_184; \42590 __ret_276; \
40855})42591})
40856#endif42592#endif
4085742593
...@@ -42518,44 +44254,44 @@ __ai float16x4_t vmul_f16(float16x4_t __p0, float16x4_t __p1) {...@@ -42518,44 +44254,44 @@ __ai float16x4_t vmul_f16(float16x4_t __p0, float16x4_t __p1) {
42518#endif44254#endif
4251944255
42520#ifdef __LITTLE_ENDIAN__44256#ifdef __LITTLE_ENDIAN__
42521#define vmulq_lane_f16(__p0_185, __p1_185, __p2_185) __extension__ ({ \44257#define vmulq_lane_f16(__p0_277, __p1_277, __p2_277) __extension__ ({ \
42522 float16x8_t __s0_185 = __p0_185; \44258 float16x8_t __s0_277 = __p0_277; \
42523 float16x4_t __s1_185 = __p1_185; \44259 float16x4_t __s1_277 = __p1_277; \
42524 float16x8_t __ret_185; \44260 float16x8_t __ret_277; \
42525 __ret_185 = __s0_185 * splatq_lane_f16(__s1_185, __p2_185); \44261 __ret_277 = __s0_277 * splatq_lane_f16(__s1_277, __p2_277); \
42526 __ret_185; \44262 __ret_277; \
42527})44263})
42528#else44264#else
42529#define vmulq_lane_f16(__p0_186, __p1_186, __p2_186) __extension__ ({ \44265#define vmulq_lane_f16(__p0_278, __p1_278, __p2_278) __extension__ ({ \
42530 float16x8_t __s0_186 = __p0_186; \44266 float16x8_t __s0_278 = __p0_278; \
42531 float16x4_t __s1_186 = __p1_186; \44267 float16x4_t __s1_278 = __p1_278; \
42532 float16x8_t __rev0_186; __rev0_186 = __builtin_shufflevector(__s0_186, __s0_186, 7, 6, 5, 4, 3, 2, 1, 0); \44268 float16x8_t __rev0_278; __rev0_278 = __builtin_shufflevector(__s0_278, __s0_278, 7, 6, 5, 4, 3, 2, 1, 0); \
42533 float16x4_t __rev1_186; __rev1_186 = __builtin_shufflevector(__s1_186, __s1_186, 3, 2, 1, 0); \44269 float16x4_t __rev1_278; __rev1_278 = __builtin_shufflevector(__s1_278, __s1_278, 3, 2, 1, 0); \
42534 float16x8_t __ret_186; \44270 float16x8_t __ret_278; \
42535 __ret_186 = __rev0_186 * __noswap_splatq_lane_f16(__rev1_186, __p2_186); \44271 __ret_278 = __rev0_278 * __noswap_splatq_lane_f16(__rev1_278, __p2_278); \
42536 __ret_186 = __builtin_shufflevector(__ret_186, __ret_186, 7, 6, 5, 4, 3, 2, 1, 0); \44272 __ret_278 = __builtin_shufflevector(__ret_278, __ret_278, 7, 6, 5, 4, 3, 2, 1, 0); \
42537 __ret_186; \44273 __ret_278; \
42538})44274})
42539#endif44275#endif
4254044276
42541#ifdef __LITTLE_ENDIAN__44277#ifdef __LITTLE_ENDIAN__
42542#define vmul_lane_f16(__p0_187, __p1_187, __p2_187) __extension__ ({ \44278#define vmul_lane_f16(__p0_279, __p1_279, __p2_279) __extension__ ({ \
42543 float16x4_t __s0_187 = __p0_187; \44279 float16x4_t __s0_279 = __p0_279; \
42544 float16x4_t __s1_187 = __p1_187; \44280 float16x4_t __s1_279 = __p1_279; \
42545 float16x4_t __ret_187; \44281 float16x4_t __ret_279; \
42546 __ret_187 = __s0_187 * splat_lane_f16(__s1_187, __p2_187); \44282 __ret_279 = __s0_279 * splat_lane_f16(__s1_279, __p2_279); \
42547 __ret_187; \44283 __ret_279; \
42548})44284})
42549#else44285#else
42550#define vmul_lane_f16(__p0_188, __p1_188, __p2_188) __extension__ ({ \44286#define vmul_lane_f16(__p0_280, __p1_280, __p2_280) __extension__ ({ \
42551 float16x4_t __s0_188 = __p0_188; \44287 float16x4_t __s0_280 = __p0_280; \
42552 float16x4_t __s1_188 = __p1_188; \44288 float16x4_t __s1_280 = __p1_280; \
42553 float16x4_t __rev0_188; __rev0_188 = __builtin_shufflevector(__s0_188, __s0_188, 3, 2, 1, 0); \44289 float16x4_t __rev0_280; __rev0_280 = __builtin_shufflevector(__s0_280, __s0_280, 3, 2, 1, 0); \
42554 float16x4_t __rev1_188; __rev1_188 = __builtin_shufflevector(__s1_188, __s1_188, 3, 2, 1, 0); \44290 float16x4_t __rev1_280; __rev1_280 = __builtin_shufflevector(__s1_280, __s1_280, 3, 2, 1, 0); \
42555 float16x4_t __ret_188; \44291 float16x4_t __ret_280; \
42556 __ret_188 = __rev0_188 * __noswap_splat_lane_f16(__rev1_188, __p2_188); \44292 __ret_280 = __rev0_280 * __noswap_splat_lane_f16(__rev1_280, __p2_280); \
42557 __ret_188 = __builtin_shufflevector(__ret_188, __ret_188, 3, 2, 1, 0); \44293 __ret_280 = __builtin_shufflevector(__ret_280, __ret_280, 3, 2, 1, 0); \
42558 __ret_188; \44294 __ret_280; \
42559})44295})
42560#endif44296#endif
4256144297
...@@ -43297,140 +45033,140 @@ __ai float16x4_t vdiv_f16(float16x4_t __p0, float16x4_t __p1) {...@@ -43297,140 +45033,140 @@ __ai float16x4_t vdiv_f16(float16x4_t __p0, float16x4_t __p1) {
43297#endif45033#endif
4329845034
43299#ifdef __LITTLE_ENDIAN__45035#ifdef __LITTLE_ENDIAN__
43300#define vfmsh_lane_f16(__p0_189, __p1_189, __p2_189, __p3_189) __extension__ ({ \45036#define vfmsh_lane_f16(__p0_281, __p1_281, __p2_281, __p3_281) __extension__ ({ \
43301 float16_t __s0_189 = __p0_189; \45037 float16_t __s0_281 = __p0_281; \
43302 float16_t __s1_189 = __p1_189; \45038 float16_t __s1_281 = __p1_281; \
43303 float16x4_t __s2_189 = __p2_189; \45039 float16x4_t __s2_281 = __p2_281; \
43304 float16_t __ret_189; \45040 float16_t __ret_281; \
43305 __ret_189 = vfmah_lane_f16(__s0_189, -__s1_189, __s2_189, __p3_189); \45041 __ret_281 = vfmah_lane_f16(__s0_281, -__s1_281, __s2_281, __p3_281); \
43306 __ret_189; \45042 __ret_281; \
43307})45043})
43308#else45044#else
43309#define vfmsh_lane_f16(__p0_190, __p1_190, __p2_190, __p3_190) __extension__ ({ \45045#define vfmsh_lane_f16(__p0_282, __p1_282, __p2_282, __p3_282) __extension__ ({ \
43310 float16_t __s0_190 = __p0_190; \45046 float16_t __s0_282 = __p0_282; \
43311 float16_t __s1_190 = __p1_190; \45047 float16_t __s1_282 = __p1_282; \
43312 float16x4_t __s2_190 = __p2_190; \45048 float16x4_t __s2_282 = __p2_282; \
43313 float16x4_t __rev2_190; __rev2_190 = __builtin_shufflevector(__s2_190, __s2_190, 3, 2, 1, 0); \45049 float16x4_t __rev2_282; __rev2_282 = __builtin_shufflevector(__s2_282, __s2_282, 3, 2, 1, 0); \
43314 float16_t __ret_190; \45050 float16_t __ret_282; \
43315 __ret_190 = __noswap_vfmah_lane_f16(__s0_190, -__s1_190, __rev2_190, __p3_190); \45051 __ret_282 = __noswap_vfmah_lane_f16(__s0_282, -__s1_282, __rev2_282, __p3_282); \
43316 __ret_190; \45052 __ret_282; \
43317})45053})
43318#endif45054#endif
4331945055
43320#ifdef __LITTLE_ENDIAN__45056#ifdef __LITTLE_ENDIAN__
43321#define vfmsq_lane_f16(__p0_191, __p1_191, __p2_191, __p3_191) __extension__ ({ \45057#define vfmsq_lane_f16(__p0_283, __p1_283, __p2_283, __p3_283) __extension__ ({ \
43322 float16x8_t __s0_191 = __p0_191; \45058 float16x8_t __s0_283 = __p0_283; \
43323 float16x8_t __s1_191 = __p1_191; \45059 float16x8_t __s1_283 = __p1_283; \
43324 float16x4_t __s2_191 = __p2_191; \45060 float16x4_t __s2_283 = __p2_283; \
43325 float16x8_t __ret_191; \45061 float16x8_t __ret_283; \
43326 __ret_191 = vfmaq_lane_f16(__s0_191, -__s1_191, __s2_191, __p3_191); \45062 __ret_283 = vfmaq_lane_f16(__s0_283, -__s1_283, __s2_283, __p3_283); \
43327 __ret_191; \45063 __ret_283; \
43328})45064})
43329#else45065#else
43330#define vfmsq_lane_f16(__p0_192, __p1_192, __p2_192, __p3_192) __extension__ ({ \45066#define vfmsq_lane_f16(__p0_284, __p1_284, __p2_284, __p3_284) __extension__ ({ \
43331 float16x8_t __s0_192 = __p0_192; \45067 float16x8_t __s0_284 = __p0_284; \
43332 float16x8_t __s1_192 = __p1_192; \45068 float16x8_t __s1_284 = __p1_284; \
43333 float16x4_t __s2_192 = __p2_192; \45069 float16x4_t __s2_284 = __p2_284; \
43334 float16x8_t __rev0_192; __rev0_192 = __builtin_shufflevector(__s0_192, __s0_192, 7, 6, 5, 4, 3, 2, 1, 0); \45070 float16x8_t __rev0_284; __rev0_284 = __builtin_shufflevector(__s0_284, __s0_284, 7, 6, 5, 4, 3, 2, 1, 0); \
43335 float16x8_t __rev1_192; __rev1_192 = __builtin_shufflevector(__s1_192, __s1_192, 7, 6, 5, 4, 3, 2, 1, 0); \45071 float16x8_t __rev1_284; __rev1_284 = __builtin_shufflevector(__s1_284, __s1_284, 7, 6, 5, 4, 3, 2, 1, 0); \
43336 float16x4_t __rev2_192; __rev2_192 = __builtin_shufflevector(__s2_192, __s2_192, 3, 2, 1, 0); \45072 float16x4_t __rev2_284; __rev2_284 = __builtin_shufflevector(__s2_284, __s2_284, 3, 2, 1, 0); \
43337 float16x8_t __ret_192; \45073 float16x8_t __ret_284; \
43338 __ret_192 = __noswap_vfmaq_lane_f16(__rev0_192, -__rev1_192, __rev2_192, __p3_192); \45074 __ret_284 = __noswap_vfmaq_lane_f16(__rev0_284, -__rev1_284, __rev2_284, __p3_284); \
43339 __ret_192 = __builtin_shufflevector(__ret_192, __ret_192, 7, 6, 5, 4, 3, 2, 1, 0); \45075 __ret_284 = __builtin_shufflevector(__ret_284, __ret_284, 7, 6, 5, 4, 3, 2, 1, 0); \
43340 __ret_192; \45076 __ret_284; \
43341})45077})
43342#endif45078#endif
4334345079
43344#ifdef __LITTLE_ENDIAN__45080#ifdef __LITTLE_ENDIAN__
43345#define vfms_lane_f16(__p0_193, __p1_193, __p2_193, __p3_193) __extension__ ({ \45081#define vfms_lane_f16(__p0_285, __p1_285, __p2_285, __p3_285) __extension__ ({ \
43346 float16x4_t __s0_193 = __p0_193; \45082 float16x4_t __s0_285 = __p0_285; \
43347 float16x4_t __s1_193 = __p1_193; \45083 float16x4_t __s1_285 = __p1_285; \
43348 float16x4_t __s2_193 = __p2_193; \45084 float16x4_t __s2_285 = __p2_285; \
43349 float16x4_t __ret_193; \45085 float16x4_t __ret_285; \
43350 __ret_193 = vfma_lane_f16(__s0_193, -__s1_193, __s2_193, __p3_193); \45086 __ret_285 = vfma_lane_f16(__s0_285, -__s1_285, __s2_285, __p3_285); \
43351 __ret_193; \45087 __ret_285; \
43352})45088})
43353#else45089#else
43354#define vfms_lane_f16(__p0_194, __p1_194, __p2_194, __p3_194) __extension__ ({ \45090#define vfms_lane_f16(__p0_286, __p1_286, __p2_286, __p3_286) __extension__ ({ \
43355 float16x4_t __s0_194 = __p0_194; \45091 float16x4_t __s0_286 = __p0_286; \
43356 float16x4_t __s1_194 = __p1_194; \45092 float16x4_t __s1_286 = __p1_286; \
43357 float16x4_t __s2_194 = __p2_194; \45093 float16x4_t __s2_286 = __p2_286; \
43358 float16x4_t __rev0_194; __rev0_194 = __builtin_shufflevector(__s0_194, __s0_194, 3, 2, 1, 0); \45094 float16x4_t __rev0_286; __rev0_286 = __builtin_shufflevector(__s0_286, __s0_286, 3, 2, 1, 0); \
43359 float16x4_t __rev1_194; __rev1_194 = __builtin_shufflevector(__s1_194, __s1_194, 3, 2, 1, 0); \45095 float16x4_t __rev1_286; __rev1_286 = __builtin_shufflevector(__s1_286, __s1_286, 3, 2, 1, 0); \
43360 float16x4_t __rev2_194; __rev2_194 = __builtin_shufflevector(__s2_194, __s2_194, 3, 2, 1, 0); \45096 float16x4_t __rev2_286; __rev2_286 = __builtin_shufflevector(__s2_286, __s2_286, 3, 2, 1, 0); \
43361 float16x4_t __ret_194; \45097 float16x4_t __ret_286; \
43362 __ret_194 = __noswap_vfma_lane_f16(__rev0_194, -__rev1_194, __rev2_194, __p3_194); \45098 __ret_286 = __noswap_vfma_lane_f16(__rev0_286, -__rev1_286, __rev2_286, __p3_286); \
43363 __ret_194 = __builtin_shufflevector(__ret_194, __ret_194, 3, 2, 1, 0); \45099 __ret_286 = __builtin_shufflevector(__ret_286, __ret_286, 3, 2, 1, 0); \
43364 __ret_194; \45100 __ret_286; \
43365})45101})
43366#endif45102#endif
4336745103
43368#ifdef __LITTLE_ENDIAN__45104#ifdef __LITTLE_ENDIAN__
43369#define vfmsh_laneq_f16(__p0_195, __p1_195, __p2_195, __p3_195) __extension__ ({ \45105#define vfmsh_laneq_f16(__p0_287, __p1_287, __p2_287, __p3_287) __extension__ ({ \
43370 float16_t __s0_195 = __p0_195; \45106 float16_t __s0_287 = __p0_287; \
43371 float16_t __s1_195 = __p1_195; \45107 float16_t __s1_287 = __p1_287; \
43372 float16x8_t __s2_195 = __p2_195; \45108 float16x8_t __s2_287 = __p2_287; \
43373 float16_t __ret_195; \45109 float16_t __ret_287; \
43374 __ret_195 = vfmah_laneq_f16(__s0_195, -__s1_195, __s2_195, __p3_195); \45110 __ret_287 = vfmah_laneq_f16(__s0_287, -__s1_287, __s2_287, __p3_287); \
43375 __ret_195; \45111 __ret_287; \
43376})45112})
43377#else45113#else
43378#define vfmsh_laneq_f16(__p0_196, __p1_196, __p2_196, __p3_196) __extension__ ({ \45114#define vfmsh_laneq_f16(__p0_288, __p1_288, __p2_288, __p3_288) __extension__ ({ \
43379 float16_t __s0_196 = __p0_196; \45115 float16_t __s0_288 = __p0_288; \
43380 float16_t __s1_196 = __p1_196; \45116 float16_t __s1_288 = __p1_288; \
43381 float16x8_t __s2_196 = __p2_196; \45117 float16x8_t __s2_288 = __p2_288; \
43382 float16x8_t __rev2_196; __rev2_196 = __builtin_shufflevector(__s2_196, __s2_196, 7, 6, 5, 4, 3, 2, 1, 0); \45118 float16x8_t __rev2_288; __rev2_288 = __builtin_shufflevector(__s2_288, __s2_288, 7, 6, 5, 4, 3, 2, 1, 0); \
43383 float16_t __ret_196; \45119 float16_t __ret_288; \
43384 __ret_196 = __noswap_vfmah_laneq_f16(__s0_196, -__s1_196, __rev2_196, __p3_196); \45120 __ret_288 = __noswap_vfmah_laneq_f16(__s0_288, -__s1_288, __rev2_288, __p3_288); \
43385 __ret_196; \45121 __ret_288; \
43386})45122})
43387#endif45123#endif
4338845124
43389#ifdef __LITTLE_ENDIAN__45125#ifdef __LITTLE_ENDIAN__
43390#define vfmsq_laneq_f16(__p0_197, __p1_197, __p2_197, __p3_197) __extension__ ({ \45126#define vfmsq_laneq_f16(__p0_289, __p1_289, __p2_289, __p3_289) __extension__ ({ \
43391 float16x8_t __s0_197 = __p0_197; \45127 float16x8_t __s0_289 = __p0_289; \
43392 float16x8_t __s1_197 = __p1_197; \45128 float16x8_t __s1_289 = __p1_289; \
43393 float16x8_t __s2_197 = __p2_197; \45129 float16x8_t __s2_289 = __p2_289; \
43394 float16x8_t __ret_197; \45130 float16x8_t __ret_289; \
43395 __ret_197 = vfmaq_laneq_f16(__s0_197, -__s1_197, __s2_197, __p3_197); \45131 __ret_289 = vfmaq_laneq_f16(__s0_289, -__s1_289, __s2_289, __p3_289); \
43396 __ret_197; \45132 __ret_289; \
43397})45133})
43398#else45134#else
43399#define vfmsq_laneq_f16(__p0_198, __p1_198, __p2_198, __p3_198) __extension__ ({ \45135#define vfmsq_laneq_f16(__p0_290, __p1_290, __p2_290, __p3_290) __extension__ ({ \
43400 float16x8_t __s0_198 = __p0_198; \45136 float16x8_t __s0_290 = __p0_290; \
43401 float16x8_t __s1_198 = __p1_198; \45137 float16x8_t __s1_290 = __p1_290; \
43402 float16x8_t __s2_198 = __p2_198; \45138 float16x8_t __s2_290 = __p2_290; \
43403 float16x8_t __rev0_198; __rev0_198 = __builtin_shufflevector(__s0_198, __s0_198, 7, 6, 5, 4, 3, 2, 1, 0); \45139 float16x8_t __rev0_290; __rev0_290 = __builtin_shufflevector(__s0_290, __s0_290, 7, 6, 5, 4, 3, 2, 1, 0); \
43404 float16x8_t __rev1_198; __rev1_198 = __builtin_shufflevector(__s1_198, __s1_198, 7, 6, 5, 4, 3, 2, 1, 0); \45140 float16x8_t __rev1_290; __rev1_290 = __builtin_shufflevector(__s1_290, __s1_290, 7, 6, 5, 4, 3, 2, 1, 0); \
43405 float16x8_t __rev2_198; __rev2_198 = __builtin_shufflevector(__s2_198, __s2_198, 7, 6, 5, 4, 3, 2, 1, 0); \45141 float16x8_t __rev2_290; __rev2_290 = __builtin_shufflevector(__s2_290, __s2_290, 7, 6, 5, 4, 3, 2, 1, 0); \
43406 float16x8_t __ret_198; \45142 float16x8_t __ret_290; \
43407 __ret_198 = __noswap_vfmaq_laneq_f16(__rev0_198, -__rev1_198, __rev2_198, __p3_198); \45143 __ret_290 = __noswap_vfmaq_laneq_f16(__rev0_290, -__rev1_290, __rev2_290, __p3_290); \
43408 __ret_198 = __builtin_shufflevector(__ret_198, __ret_198, 7, 6, 5, 4, 3, 2, 1, 0); \45144 __ret_290 = __builtin_shufflevector(__ret_290, __ret_290, 7, 6, 5, 4, 3, 2, 1, 0); \
43409 __ret_198; \45145 __ret_290; \
43410})45146})
43411#endif45147#endif
4341245148
43413#ifdef __LITTLE_ENDIAN__45149#ifdef __LITTLE_ENDIAN__
43414#define vfms_laneq_f16(__p0_199, __p1_199, __p2_199, __p3_199) __extension__ ({ \45150#define vfms_laneq_f16(__p0_291, __p1_291, __p2_291, __p3_291) __extension__ ({ \
43415 float16x4_t __s0_199 = __p0_199; \45151 float16x4_t __s0_291 = __p0_291; \
43416 float16x4_t __s1_199 = __p1_199; \45152 float16x4_t __s1_291 = __p1_291; \
43417 float16x8_t __s2_199 = __p2_199; \45153 float16x8_t __s2_291 = __p2_291; \
43418 float16x4_t __ret_199; \45154 float16x4_t __ret_291; \
43419 __ret_199 = vfma_laneq_f16(__s0_199, -__s1_199, __s2_199, __p3_199); \45155 __ret_291 = vfma_laneq_f16(__s0_291, -__s1_291, __s2_291, __p3_291); \
43420 __ret_199; \45156 __ret_291; \
43421})45157})
43422#else45158#else
43423#define vfms_laneq_f16(__p0_200, __p1_200, __p2_200, __p3_200) __extension__ ({ \45159#define vfms_laneq_f16(__p0_292, __p1_292, __p2_292, __p3_292) __extension__ ({ \
43424 float16x4_t __s0_200 = __p0_200; \45160 float16x4_t __s0_292 = __p0_292; \
43425 float16x4_t __s1_200 = __p1_200; \45161 float16x4_t __s1_292 = __p1_292; \
43426 float16x8_t __s2_200 = __p2_200; \45162 float16x8_t __s2_292 = __p2_292; \
43427 float16x4_t __rev0_200; __rev0_200 = __builtin_shufflevector(__s0_200, __s0_200, 3, 2, 1, 0); \45163 float16x4_t __rev0_292; __rev0_292 = __builtin_shufflevector(__s0_292, __s0_292, 3, 2, 1, 0); \
43428 float16x4_t __rev1_200; __rev1_200 = __builtin_shufflevector(__s1_200, __s1_200, 3, 2, 1, 0); \45164 float16x4_t __rev1_292; __rev1_292 = __builtin_shufflevector(__s1_292, __s1_292, 3, 2, 1, 0); \
43429 float16x8_t __rev2_200; __rev2_200 = __builtin_shufflevector(__s2_200, __s2_200, 7, 6, 5, 4, 3, 2, 1, 0); \45165 float16x8_t __rev2_292; __rev2_292 = __builtin_shufflevector(__s2_292, __s2_292, 7, 6, 5, 4, 3, 2, 1, 0); \
43430 float16x4_t __ret_200; \45166 float16x4_t __ret_292; \
43431 __ret_200 = __noswap_vfma_laneq_f16(__rev0_200, -__rev1_200, __rev2_200, __p3_200); \45167 __ret_292 = __noswap_vfma_laneq_f16(__rev0_292, -__rev1_292, __rev2_292, __p3_292); \
43432 __ret_200 = __builtin_shufflevector(__ret_200, __ret_200, 3, 2, 1, 0); \45168 __ret_292 = __builtin_shufflevector(__ret_292, __ret_292, 3, 2, 1, 0); \
43433 __ret_200; \45169 __ret_292; \
43434})45170})
43435#endif45171#endif
4343645172
...@@ -43617,44 +45353,44 @@ __ai float16x4_t vdiv_f16(float16x4_t __p0, float16x4_t __p1) {...@@ -43617,44 +45353,44 @@ __ai float16x4_t vdiv_f16(float16x4_t __p0, float16x4_t __p1) {
43617#endif45353#endif
4361845354
43619#ifdef __LITTLE_ENDIAN__45355#ifdef __LITTLE_ENDIAN__
43620#define vmulq_laneq_f16(__p0_201, __p1_201, __p2_201) __extension__ ({ \45356#define vmulq_laneq_f16(__p0_293, __p1_293, __p2_293) __extension__ ({ \
43621 float16x8_t __s0_201 = __p0_201; \45357 float16x8_t __s0_293 = __p0_293; \
43622 float16x8_t __s1_201 = __p1_201; \45358 float16x8_t __s1_293 = __p1_293; \
43623 float16x8_t __ret_201; \45359 float16x8_t __ret_293; \
43624 __ret_201 = __s0_201 * splatq_laneq_f16(__s1_201, __p2_201); \45360 __ret_293 = __s0_293 * splatq_laneq_f16(__s1_293, __p2_293); \
43625 __ret_201; \45361 __ret_293; \
43626})45362})
43627#else45363#else
43628#define vmulq_laneq_f16(__p0_202, __p1_202, __p2_202) __extension__ ({ \45364#define vmulq_laneq_f16(__p0_294, __p1_294, __p2_294) __extension__ ({ \
43629 float16x8_t __s0_202 = __p0_202; \45365 float16x8_t __s0_294 = __p0_294; \
43630 float16x8_t __s1_202 = __p1_202; \45366 float16x8_t __s1_294 = __p1_294; \
43631 float16x8_t __rev0_202; __rev0_202 = __builtin_shufflevector(__s0_202, __s0_202, 7, 6, 5, 4, 3, 2, 1, 0); \45367 float16x8_t __rev0_294; __rev0_294 = __builtin_shufflevector(__s0_294, __s0_294, 7, 6, 5, 4, 3, 2, 1, 0); \
43632 float16x8_t __rev1_202; __rev1_202 = __builtin_shufflevector(__s1_202, __s1_202, 7, 6, 5, 4, 3, 2, 1, 0); \45368 float16x8_t __rev1_294; __rev1_294 = __builtin_shufflevector(__s1_294, __s1_294, 7, 6, 5, 4, 3, 2, 1, 0); \
43633 float16x8_t __ret_202; \45369 float16x8_t __ret_294; \
43634 __ret_202 = __rev0_202 * __noswap_splatq_laneq_f16(__rev1_202, __p2_202); \45370 __ret_294 = __rev0_294 * __noswap_splatq_laneq_f16(__rev1_294, __p2_294); \
43635 __ret_202 = __builtin_shufflevector(__ret_202, __ret_202, 7, 6, 5, 4, 3, 2, 1, 0); \45371 __ret_294 = __builtin_shufflevector(__ret_294, __ret_294, 7, 6, 5, 4, 3, 2, 1, 0); \
43636 __ret_202; \45372 __ret_294; \
43637})45373})
43638#endif45374#endif
4363945375
43640#ifdef __LITTLE_ENDIAN__45376#ifdef __LITTLE_ENDIAN__
43641#define vmul_laneq_f16(__p0_203, __p1_203, __p2_203) __extension__ ({ \45377#define vmul_laneq_f16(__p0_295, __p1_295, __p2_295) __extension__ ({ \
43642 float16x4_t __s0_203 = __p0_203; \45378 float16x4_t __s0_295 = __p0_295; \
43643 float16x8_t __s1_203 = __p1_203; \45379 float16x8_t __s1_295 = __p1_295; \
43644 float16x4_t __ret_203; \45380 float16x4_t __ret_295; \
43645 __ret_203 = __s0_203 * splat_laneq_f16(__s1_203, __p2_203); \45381 __ret_295 = __s0_295 * splat_laneq_f16(__s1_295, __p2_295); \
43646 __ret_203; \45382 __ret_295; \
43647})45383})
43648#else45384#else
43649#define vmul_laneq_f16(__p0_204, __p1_204, __p2_204) __extension__ ({ \45385#define vmul_laneq_f16(__p0_296, __p1_296, __p2_296) __extension__ ({ \
43650 float16x4_t __s0_204 = __p0_204; \45386 float16x4_t __s0_296 = __p0_296; \
43651 float16x8_t __s1_204 = __p1_204; \45387 float16x8_t __s1_296 = __p1_296; \
43652 float16x4_t __rev0_204; __rev0_204 = __builtin_shufflevector(__s0_204, __s0_204, 3, 2, 1, 0); \45388 float16x4_t __rev0_296; __rev0_296 = __builtin_shufflevector(__s0_296, __s0_296, 3, 2, 1, 0); \
43653 float16x8_t __rev1_204; __rev1_204 = __builtin_shufflevector(__s1_204, __s1_204, 7, 6, 5, 4, 3, 2, 1, 0); \45389 float16x8_t __rev1_296; __rev1_296 = __builtin_shufflevector(__s1_296, __s1_296, 7, 6, 5, 4, 3, 2, 1, 0); \
43654 float16x4_t __ret_204; \45390 float16x4_t __ret_296; \
43655 __ret_204 = __rev0_204 * __noswap_splat_laneq_f16(__rev1_204, __p2_204); \45391 __ret_296 = __rev0_296 * __noswap_splat_laneq_f16(__rev1_296, __p2_296); \
43656 __ret_204 = __builtin_shufflevector(__ret_204, __ret_204, 3, 2, 1, 0); \45392 __ret_296 = __builtin_shufflevector(__ret_296, __ret_296, 3, 2, 1, 0); \
43657 __ret_204; \45393 __ret_296; \
43658})45394})
43659#endif45395#endif
4366045396
...@@ -43722,44 +45458,44 @@ __ai float16x4_t __noswap_vmulx_f16(float16x4_t __p0, float16x4_t __p1) {...@@ -43722,44 +45458,44 @@ __ai float16x4_t __noswap_vmulx_f16(float16x4_t __p0, float16x4_t __p1) {
43722#endif45458#endif
4372345459
43724#ifdef __LITTLE_ENDIAN__45460#ifdef __LITTLE_ENDIAN__
43725#define vmulxq_lane_f16(__p0_205, __p1_205, __p2_205) __extension__ ({ \45461#define vmulxq_lane_f16(__p0_297, __p1_297, __p2_297) __extension__ ({ \
43726 float16x8_t __s0_205 = __p0_205; \45462 float16x8_t __s0_297 = __p0_297; \
43727 float16x4_t __s1_205 = __p1_205; \45463 float16x4_t __s1_297 = __p1_297; \
43728 float16x8_t __ret_205; \45464 float16x8_t __ret_297; \
43729 __ret_205 = vmulxq_f16(__s0_205, splatq_lane_f16(__s1_205, __p2_205)); \45465 __ret_297 = vmulxq_f16(__s0_297, splatq_lane_f16(__s1_297, __p2_297)); \
43730 __ret_205; \45466 __ret_297; \
43731})45467})
43732#else45468#else
43733#define vmulxq_lane_f16(__p0_206, __p1_206, __p2_206) __extension__ ({ \45469#define vmulxq_lane_f16(__p0_298, __p1_298, __p2_298) __extension__ ({ \
43734 float16x8_t __s0_206 = __p0_206; \45470 float16x8_t __s0_298 = __p0_298; \
43735 float16x4_t __s1_206 = __p1_206; \45471 float16x4_t __s1_298 = __p1_298; \
43736 float16x8_t __rev0_206; __rev0_206 = __builtin_shufflevector(__s0_206, __s0_206, 7, 6, 5, 4, 3, 2, 1, 0); \45472 float16x8_t __rev0_298; __rev0_298 = __builtin_shufflevector(__s0_298, __s0_298, 7, 6, 5, 4, 3, 2, 1, 0); \
43737 float16x4_t __rev1_206; __rev1_206 = __builtin_shufflevector(__s1_206, __s1_206, 3, 2, 1, 0); \45473 float16x4_t __rev1_298; __rev1_298 = __builtin_shufflevector(__s1_298, __s1_298, 3, 2, 1, 0); \
43738 float16x8_t __ret_206; \45474 float16x8_t __ret_298; \
43739 __ret_206 = __noswap_vmulxq_f16(__rev0_206, __noswap_splatq_lane_f16(__rev1_206, __p2_206)); \45475 __ret_298 = __noswap_vmulxq_f16(__rev0_298, __noswap_splatq_lane_f16(__rev1_298, __p2_298)); \
43740 __ret_206 = __builtin_shufflevector(__ret_206, __ret_206, 7, 6, 5, 4, 3, 2, 1, 0); \45476 __ret_298 = __builtin_shufflevector(__ret_298, __ret_298, 7, 6, 5, 4, 3, 2, 1, 0); \
43741 __ret_206; \45477 __ret_298; \
43742})45478})
43743#endif45479#endif
4374445480
43745#ifdef __LITTLE_ENDIAN__45481#ifdef __LITTLE_ENDIAN__
43746#define vmulx_lane_f16(__p0_207, __p1_207, __p2_207) __extension__ ({ \45482#define vmulx_lane_f16(__p0_299, __p1_299, __p2_299) __extension__ ({ \
43747 float16x4_t __s0_207 = __p0_207; \45483 float16x4_t __s0_299 = __p0_299; \
43748 float16x4_t __s1_207 = __p1_207; \45484 float16x4_t __s1_299 = __p1_299; \
43749 float16x4_t __ret_207; \45485 float16x4_t __ret_299; \
43750 __ret_207 = vmulx_f16(__s0_207, splat_lane_f16(__s1_207, __p2_207)); \45486 __ret_299 = vmulx_f16(__s0_299, splat_lane_f16(__s1_299, __p2_299)); \
43751 __ret_207; \45487 __ret_299; \
43752})45488})
43753#else45489#else
43754#define vmulx_lane_f16(__p0_208, __p1_208, __p2_208) __extension__ ({ \45490#define vmulx_lane_f16(__p0_300, __p1_300, __p2_300) __extension__ ({ \
43755 float16x4_t __s0_208 = __p0_208; \45491 float16x4_t __s0_300 = __p0_300; \
43756 float16x4_t __s1_208 = __p1_208; \45492 float16x4_t __s1_300 = __p1_300; \
43757 float16x4_t __rev0_208; __rev0_208 = __builtin_shufflevector(__s0_208, __s0_208, 3, 2, 1, 0); \45493 float16x4_t __rev0_300; __rev0_300 = __builtin_shufflevector(__s0_300, __s0_300, 3, 2, 1, 0); \
43758 float16x4_t __rev1_208; __rev1_208 = __builtin_shufflevector(__s1_208, __s1_208, 3, 2, 1, 0); \45494 float16x4_t __rev1_300; __rev1_300 = __builtin_shufflevector(__s1_300, __s1_300, 3, 2, 1, 0); \
43759 float16x4_t __ret_208; \45495 float16x4_t __ret_300; \
43760 __ret_208 = __noswap_vmulx_f16(__rev0_208, __noswap_splat_lane_f16(__rev1_208, __p2_208)); \45496 __ret_300 = __noswap_vmulx_f16(__rev0_300, __noswap_splat_lane_f16(__rev1_300, __p2_300)); \
43761 __ret_208 = __builtin_shufflevector(__ret_208, __ret_208, 3, 2, 1, 0); \45497 __ret_300 = __builtin_shufflevector(__ret_300, __ret_300, 3, 2, 1, 0); \
43762 __ret_208; \45498 __ret_300; \
43763})45499})
43764#endif45500#endif
4376545501
...@@ -43783,44 +45519,44 @@ __ai float16x4_t __noswap_vmulx_f16(float16x4_t __p0, float16x4_t __p1) {...@@ -43783,44 +45519,44 @@ __ai float16x4_t __noswap_vmulx_f16(float16x4_t __p0, float16x4_t __p1) {
43783#endif45519#endif
4378445520
43785#ifdef __LITTLE_ENDIAN__45521#ifdef __LITTLE_ENDIAN__
43786#define vmulxq_laneq_f16(__p0_209, __p1_209, __p2_209) __extension__ ({ \45522#define vmulxq_laneq_f16(__p0_301, __p1_301, __p2_301) __extension__ ({ \
43787 float16x8_t __s0_209 = __p0_209; \45523 float16x8_t __s0_301 = __p0_301; \
43788 float16x8_t __s1_209 = __p1_209; \45524 float16x8_t __s1_301 = __p1_301; \
43789 float16x8_t __ret_209; \45525 float16x8_t __ret_301; \
43790 __ret_209 = vmulxq_f16(__s0_209, splatq_laneq_f16(__s1_209, __p2_209)); \45526 __ret_301 = vmulxq_f16(__s0_301, splatq_laneq_f16(__s1_301, __p2_301)); \
43791 __ret_209; \45527 __ret_301; \
43792})45528})
43793#else45529#else
43794#define vmulxq_laneq_f16(__p0_210, __p1_210, __p2_210) __extension__ ({ \45530#define vmulxq_laneq_f16(__p0_302, __p1_302, __p2_302) __extension__ ({ \
43795 float16x8_t __s0_210 = __p0_210; \45531 float16x8_t __s0_302 = __p0_302; \
43796 float16x8_t __s1_210 = __p1_210; \45532 float16x8_t __s1_302 = __p1_302; \
43797 float16x8_t __rev0_210; __rev0_210 = __builtin_shufflevector(__s0_210, __s0_210, 7, 6, 5, 4, 3, 2, 1, 0); \45533 float16x8_t __rev0_302; __rev0_302 = __builtin_shufflevector(__s0_302, __s0_302, 7, 6, 5, 4, 3, 2, 1, 0); \
43798 float16x8_t __rev1_210; __rev1_210 = __builtin_shufflevector(__s1_210, __s1_210, 7, 6, 5, 4, 3, 2, 1, 0); \45534 float16x8_t __rev1_302; __rev1_302 = __builtin_shufflevector(__s1_302, __s1_302, 7, 6, 5, 4, 3, 2, 1, 0); \
43799 float16x8_t __ret_210; \45535 float16x8_t __ret_302; \
43800 __ret_210 = __noswap_vmulxq_f16(__rev0_210, __noswap_splatq_laneq_f16(__rev1_210, __p2_210)); \45536 __ret_302 = __noswap_vmulxq_f16(__rev0_302, __noswap_splatq_laneq_f16(__rev1_302, __p2_302)); \
43801 __ret_210 = __builtin_shufflevector(__ret_210, __ret_210, 7, 6, 5, 4, 3, 2, 1, 0); \45537 __ret_302 = __builtin_shufflevector(__ret_302, __ret_302, 7, 6, 5, 4, 3, 2, 1, 0); \
43802 __ret_210; \45538 __ret_302; \
43803})45539})
43804#endif45540#endif
4380545541
43806#ifdef __LITTLE_ENDIAN__45542#ifdef __LITTLE_ENDIAN__
43807#define vmulx_laneq_f16(__p0_211, __p1_211, __p2_211) __extension__ ({ \45543#define vmulx_laneq_f16(__p0_303, __p1_303, __p2_303) __extension__ ({ \
43808 float16x4_t __s0_211 = __p0_211; \45544 float16x4_t __s0_303 = __p0_303; \
43809 float16x8_t __s1_211 = __p1_211; \45545 float16x8_t __s1_303 = __p1_303; \
43810 float16x4_t __ret_211; \45546 float16x4_t __ret_303; \
43811 __ret_211 = vmulx_f16(__s0_211, splat_laneq_f16(__s1_211, __p2_211)); \45547 __ret_303 = vmulx_f16(__s0_303, splat_laneq_f16(__s1_303, __p2_303)); \
43812 __ret_211; \45548 __ret_303; \
43813})45549})
43814#else45550#else
43815#define vmulx_laneq_f16(__p0_212, __p1_212, __p2_212) __extension__ ({ \45551#define vmulx_laneq_f16(__p0_304, __p1_304, __p2_304) __extension__ ({ \
43816 float16x4_t __s0_212 = __p0_212; \45552 float16x4_t __s0_304 = __p0_304; \
43817 float16x8_t __s1_212 = __p1_212; \45553 float16x8_t __s1_304 = __p1_304; \
43818 float16x4_t __rev0_212; __rev0_212 = __builtin_shufflevector(__s0_212, __s0_212, 3, 2, 1, 0); \45554 float16x4_t __rev0_304; __rev0_304 = __builtin_shufflevector(__s0_304, __s0_304, 3, 2, 1, 0); \
43819 float16x8_t __rev1_212; __rev1_212 = __builtin_shufflevector(__s1_212, __s1_212, 7, 6, 5, 4, 3, 2, 1, 0); \45555 float16x8_t __rev1_304; __rev1_304 = __builtin_shufflevector(__s1_304, __s1_304, 7, 6, 5, 4, 3, 2, 1, 0); \
43820 float16x4_t __ret_212; \45556 float16x4_t __ret_304; \
43821 __ret_212 = __noswap_vmulx_f16(__rev0_212, __noswap_splat_laneq_f16(__rev1_212, __p2_212)); \45557 __ret_304 = __noswap_vmulx_f16(__rev0_304, __noswap_splat_laneq_f16(__rev1_304, __p2_304)); \
43822 __ret_212 = __builtin_shufflevector(__ret_212, __ret_212, 3, 2, 1, 0); \45558 __ret_304 = __builtin_shufflevector(__ret_304, __ret_304, 3, 2, 1, 0); \
43823 __ret_212; \45559 __ret_304; \
43824})45560})
43825#endif45561#endif
4382645562
...@@ -44336,54 +46072,54 @@ __ai int32x2_t __noswap_vusdot_s32(int32x2_t __p0, uint8x8_t __p1, int8x8_t __p2...@@ -44336,54 +46072,54 @@ __ai int32x2_t __noswap_vusdot_s32(int32x2_t __p0, uint8x8_t __p1, int8x8_t __p2
44336#endif46072#endif
4433746073
44338#ifdef __LITTLE_ENDIAN__46074#ifdef __LITTLE_ENDIAN__
44339#define vusdotq_lane_s32(__p0_213, __p1_213, __p2_213, __p3_213) __extension__ ({ \46075#define vusdotq_lane_s32(__p0_305, __p1_305, __p2_305, __p3_305) __extension__ ({ \
44340 int32x4_t __s0_213 = __p0_213; \46076 int32x4_t __s0_305 = __p0_305; \
44341 uint8x16_t __s1_213 = __p1_213; \46077 uint8x16_t __s1_305 = __p1_305; \
44342 int8x8_t __s2_213 = __p2_213; \46078 int8x8_t __s2_305 = __p2_305; \
44343 int32x4_t __ret_213; \46079 int32x4_t __ret_305; \
44344int8x8_t __reint_213 = __s2_213; \46080int8x8_t __reint_305 = __s2_305; \
44345 __ret_213 = vusdotq_s32(__s0_213, __s1_213, (int8x16_t)(splatq_lane_s32(*(int32x2_t *) &__reint_213, __p3_213))); \46081 __ret_305 = vusdotq_s32(__s0_305, __s1_305, (int8x16_t)(splatq_lane_s32(*(int32x2_t *) &__reint_305, __p3_305))); \
44346 __ret_213; \46082 __ret_305; \
44347})46083})
44348#else46084#else
44349#define vusdotq_lane_s32(__p0_214, __p1_214, __p2_214, __p3_214) __extension__ ({ \46085#define vusdotq_lane_s32(__p0_306, __p1_306, __p2_306, __p3_306) __extension__ ({ \
44350 int32x4_t __s0_214 = __p0_214; \46086 int32x4_t __s0_306 = __p0_306; \
44351 uint8x16_t __s1_214 = __p1_214; \46087 uint8x16_t __s1_306 = __p1_306; \
44352 int8x8_t __s2_214 = __p2_214; \46088 int8x8_t __s2_306 = __p2_306; \
44353 int32x4_t __rev0_214; __rev0_214 = __builtin_shufflevector(__s0_214, __s0_214, 3, 2, 1, 0); \46089 int32x4_t __rev0_306; __rev0_306 = __builtin_shufflevector(__s0_306, __s0_306, 3, 2, 1, 0); \
44354 uint8x16_t __rev1_214; __rev1_214 = __builtin_shufflevector(__s1_214, __s1_214, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \46090 uint8x16_t __rev1_306; __rev1_306 = __builtin_shufflevector(__s1_306, __s1_306, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
44355 int8x8_t __rev2_214; __rev2_214 = __builtin_shufflevector(__s2_214, __s2_214, 7, 6, 5, 4, 3, 2, 1, 0); \46091 int8x8_t __rev2_306; __rev2_306 = __builtin_shufflevector(__s2_306, __s2_306, 7, 6, 5, 4, 3, 2, 1, 0); \
44356 int32x4_t __ret_214; \46092 int32x4_t __ret_306; \
44357int8x8_t __reint_214 = __rev2_214; \46093int8x8_t __reint_306 = __rev2_306; \
44358 __ret_214 = __noswap_vusdotq_s32(__rev0_214, __rev1_214, (int8x16_t)(__noswap_splatq_lane_s32(*(int32x2_t *) &__reint_214, __p3_214))); \46094 __ret_306 = __noswap_vusdotq_s32(__rev0_306, __rev1_306, (int8x16_t)(__noswap_splatq_lane_s32(*(int32x2_t *) &__reint_306, __p3_306))); \
44359 __ret_214 = __builtin_shufflevector(__ret_214, __ret_214, 3, 2, 1, 0); \46095 __ret_306 = __builtin_shufflevector(__ret_306, __ret_306, 3, 2, 1, 0); \
44360 __ret_214; \46096 __ret_306; \
44361})46097})
44362#endif46098#endif
4436346099
44364#ifdef __LITTLE_ENDIAN__46100#ifdef __LITTLE_ENDIAN__
44365#define vusdot_lane_s32(__p0_215, __p1_215, __p2_215, __p3_215) __extension__ ({ \46101#define vusdot_lane_s32(__p0_307, __p1_307, __p2_307, __p3_307) __extension__ ({ \
44366 int32x2_t __s0_215 = __p0_215; \46102 int32x2_t __s0_307 = __p0_307; \
44367 uint8x8_t __s1_215 = __p1_215; \46103 uint8x8_t __s1_307 = __p1_307; \
44368 int8x8_t __s2_215 = __p2_215; \46104 int8x8_t __s2_307 = __p2_307; \
44369 int32x2_t __ret_215; \46105 int32x2_t __ret_307; \
44370int8x8_t __reint_215 = __s2_215; \46106int8x8_t __reint_307 = __s2_307; \
44371 __ret_215 = vusdot_s32(__s0_215, __s1_215, (int8x8_t)(splat_lane_s32(*(int32x2_t *) &__reint_215, __p3_215))); \46107 __ret_307 = vusdot_s32(__s0_307, __s1_307, (int8x8_t)(splat_lane_s32(*(int32x2_t *) &__reint_307, __p3_307))); \
44372 __ret_215; \46108 __ret_307; \
44373})46109})
44374#else46110#else
44375#define vusdot_lane_s32(__p0_216, __p1_216, __p2_216, __p3_216) __extension__ ({ \46111#define vusdot_lane_s32(__p0_308, __p1_308, __p2_308, __p3_308) __extension__ ({ \
44376 int32x2_t __s0_216 = __p0_216; \46112 int32x2_t __s0_308 = __p0_308; \
44377 uint8x8_t __s1_216 = __p1_216; \46113 uint8x8_t __s1_308 = __p1_308; \
44378 int8x8_t __s2_216 = __p2_216; \46114 int8x8_t __s2_308 = __p2_308; \
44379 int32x2_t __rev0_216; __rev0_216 = __builtin_shufflevector(__s0_216, __s0_216, 1, 0); \46115 int32x2_t __rev0_308; __rev0_308 = __builtin_shufflevector(__s0_308, __s0_308, 1, 0); \
44380 uint8x8_t __rev1_216; __rev1_216 = __builtin_shufflevector(__s1_216, __s1_216, 7, 6, 5, 4, 3, 2, 1, 0); \46116 uint8x8_t __rev1_308; __rev1_308 = __builtin_shufflevector(__s1_308, __s1_308, 7, 6, 5, 4, 3, 2, 1, 0); \
44381 int8x8_t __rev2_216; __rev2_216 = __builtin_shufflevector(__s2_216, __s2_216, 7, 6, 5, 4, 3, 2, 1, 0); \46117 int8x8_t __rev2_308; __rev2_308 = __builtin_shufflevector(__s2_308, __s2_308, 7, 6, 5, 4, 3, 2, 1, 0); \
44382 int32x2_t __ret_216; \46118 int32x2_t __ret_308; \
44383int8x8_t __reint_216 = __rev2_216; \46119int8x8_t __reint_308 = __rev2_308; \
44384 __ret_216 = __noswap_vusdot_s32(__rev0_216, __rev1_216, (int8x8_t)(__noswap_splat_lane_s32(*(int32x2_t *) &__reint_216, __p3_216))); \46120 __ret_308 = __noswap_vusdot_s32(__rev0_308, __rev1_308, (int8x8_t)(__noswap_splat_lane_s32(*(int32x2_t *) &__reint_308, __p3_308))); \
44385 __ret_216 = __builtin_shufflevector(__ret_216, __ret_216, 1, 0); \46121 __ret_308 = __builtin_shufflevector(__ret_308, __ret_308, 1, 0); \
44386 __ret_216; \46122 __ret_308; \
44387})46123})
44388#endif46124#endif
4438946125
...@@ -44480,98 +46216,98 @@ __ai int16x4_t vqrdmlah_s16(int16x4_t __p0, int16x4_t __p1, int16x4_t __p2) {...@@ -44480,98 +46216,98 @@ __ai int16x4_t vqrdmlah_s16(int16x4_t __p0, int16x4_t __p1, int16x4_t __p2) {
44480#endif46216#endif
4448146217
44482#ifdef __LITTLE_ENDIAN__46218#ifdef __LITTLE_ENDIAN__
44483#define vqrdmlahq_lane_s32(__p0_217, __p1_217, __p2_217, __p3_217) __extension__ ({ \46219#define vqrdmlahq_lane_s32(__p0_309, __p1_309, __p2_309, __p3_309) __extension__ ({ \
44484 int32x4_t __s0_217 = __p0_217; \46220 int32x4_t __s0_309 = __p0_309; \
44485 int32x4_t __s1_217 = __p1_217; \46221 int32x4_t __s1_309 = __p1_309; \
44486 int32x2_t __s2_217 = __p2_217; \46222 int32x2_t __s2_309 = __p2_309; \
44487 int32x4_t __ret_217; \46223 int32x4_t __ret_309; \
44488 __ret_217 = vqaddq_s32(__s0_217, vqrdmulhq_s32(__s1_217, splatq_lane_s32(__s2_217, __p3_217))); \46224 __ret_309 = vqaddq_s32(__s0_309, vqrdmulhq_s32(__s1_309, splatq_lane_s32(__s2_309, __p3_309))); \
44489 __ret_217; \46225 __ret_309; \
44490})46226})
44491#else46227#else
44492#define vqrdmlahq_lane_s32(__p0_218, __p1_218, __p2_218, __p3_218) __extension__ ({ \46228#define vqrdmlahq_lane_s32(__p0_310, __p1_310, __p2_310, __p3_310) __extension__ ({ \
44493 int32x4_t __s0_218 = __p0_218; \46229 int32x4_t __s0_310 = __p0_310; \
44494 int32x4_t __s1_218 = __p1_218; \46230 int32x4_t __s1_310 = __p1_310; \
44495 int32x2_t __s2_218 = __p2_218; \46231 int32x2_t __s2_310 = __p2_310; \
44496 int32x4_t __rev0_218; __rev0_218 = __builtin_shufflevector(__s0_218, __s0_218, 3, 2, 1, 0); \46232 int32x4_t __rev0_310; __rev0_310 = __builtin_shufflevector(__s0_310, __s0_310, 3, 2, 1, 0); \
44497 int32x4_t __rev1_218; __rev1_218 = __builtin_shufflevector(__s1_218, __s1_218, 3, 2, 1, 0); \46233 int32x4_t __rev1_310; __rev1_310 = __builtin_shufflevector(__s1_310, __s1_310, 3, 2, 1, 0); \
44498 int32x2_t __rev2_218; __rev2_218 = __builtin_shufflevector(__s2_218, __s2_218, 1, 0); \46234 int32x2_t __rev2_310; __rev2_310 = __builtin_shufflevector(__s2_310, __s2_310, 1, 0); \
44499 int32x4_t __ret_218; \46235 int32x4_t __ret_310; \
44500 __ret_218 = __noswap_vqaddq_s32(__rev0_218, __noswap_vqrdmulhq_s32(__rev1_218, __noswap_splatq_lane_s32(__rev2_218, __p3_218))); \46236 __ret_310 = __noswap_vqaddq_s32(__rev0_310, __noswap_vqrdmulhq_s32(__rev1_310, __noswap_splatq_lane_s32(__rev2_310, __p3_310))); \
44501 __ret_218 = __builtin_shufflevector(__ret_218, __ret_218, 3, 2, 1, 0); \46237 __ret_310 = __builtin_shufflevector(__ret_310, __ret_310, 3, 2, 1, 0); \
44502 __ret_218; \46238 __ret_310; \
44503})46239})
44504#endif46240#endif
4450546241
44506#ifdef __LITTLE_ENDIAN__46242#ifdef __LITTLE_ENDIAN__
44507#define vqrdmlahq_lane_s16(__p0_219, __p1_219, __p2_219, __p3_219) __extension__ ({ \46243#define vqrdmlahq_lane_s16(__p0_311, __p1_311, __p2_311, __p3_311) __extension__ ({ \
44508 int16x8_t __s0_219 = __p0_219; \46244 int16x8_t __s0_311 = __p0_311; \
44509 int16x8_t __s1_219 = __p1_219; \46245 int16x8_t __s1_311 = __p1_311; \
44510 int16x4_t __s2_219 = __p2_219; \46246 int16x4_t __s2_311 = __p2_311; \
44511 int16x8_t __ret_219; \46247 int16x8_t __ret_311; \
44512 __ret_219 = vqaddq_s16(__s0_219, vqrdmulhq_s16(__s1_219, splatq_lane_s16(__s2_219, __p3_219))); \46248 __ret_311 = vqaddq_s16(__s0_311, vqrdmulhq_s16(__s1_311, splatq_lane_s16(__s2_311, __p3_311))); \
44513 __ret_219; \46249 __ret_311; \
44514})46250})
44515#else46251#else
44516#define vqrdmlahq_lane_s16(__p0_220, __p1_220, __p2_220, __p3_220) __extension__ ({ \46252#define vqrdmlahq_lane_s16(__p0_312, __p1_312, __p2_312, __p3_312) __extension__ ({ \
44517 int16x8_t __s0_220 = __p0_220; \46253 int16x8_t __s0_312 = __p0_312; \
44518 int16x8_t __s1_220 = __p1_220; \46254 int16x8_t __s1_312 = __p1_312; \
44519 int16x4_t __s2_220 = __p2_220; \46255 int16x4_t __s2_312 = __p2_312; \
44520 int16x8_t __rev0_220; __rev0_220 = __builtin_shufflevector(__s0_220, __s0_220, 7, 6, 5, 4, 3, 2, 1, 0); \46256 int16x8_t __rev0_312; __rev0_312 = __builtin_shufflevector(__s0_312, __s0_312, 7, 6, 5, 4, 3, 2, 1, 0); \
44521 int16x8_t __rev1_220; __rev1_220 = __builtin_shufflevector(__s1_220, __s1_220, 7, 6, 5, 4, 3, 2, 1, 0); \46257 int16x8_t __rev1_312; __rev1_312 = __builtin_shufflevector(__s1_312, __s1_312, 7, 6, 5, 4, 3, 2, 1, 0); \
44522 int16x4_t __rev2_220; __rev2_220 = __builtin_shufflevector(__s2_220, __s2_220, 3, 2, 1, 0); \46258 int16x4_t __rev2_312; __rev2_312 = __builtin_shufflevector(__s2_312, __s2_312, 3, 2, 1, 0); \
44523 int16x8_t __ret_220; \46259 int16x8_t __ret_312; \
44524 __ret_220 = __noswap_vqaddq_s16(__rev0_220, __noswap_vqrdmulhq_s16(__rev1_220, __noswap_splatq_lane_s16(__rev2_220, __p3_220))); \46260 __ret_312 = __noswap_vqaddq_s16(__rev0_312, __noswap_vqrdmulhq_s16(__rev1_312, __noswap_splatq_lane_s16(__rev2_312, __p3_312))); \
44525 __ret_220 = __builtin_shufflevector(__ret_220, __ret_220, 7, 6, 5, 4, 3, 2, 1, 0); \46261 __ret_312 = __builtin_shufflevector(__ret_312, __ret_312, 7, 6, 5, 4, 3, 2, 1, 0); \
44526 __ret_220; \46262 __ret_312; \
44527})46263})
44528#endif46264#endif
4452946265
44530#ifdef __LITTLE_ENDIAN__46266#ifdef __LITTLE_ENDIAN__
44531#define vqrdmlah_lane_s32(__p0_221, __p1_221, __p2_221, __p3_221) __extension__ ({ \46267#define vqrdmlah_lane_s32(__p0_313, __p1_313, __p2_313, __p3_313) __extension__ ({ \
44532 int32x2_t __s0_221 = __p0_221; \46268 int32x2_t __s0_313 = __p0_313; \
44533 int32x2_t __s1_221 = __p1_221; \46269 int32x2_t __s1_313 = __p1_313; \
44534 int32x2_t __s2_221 = __p2_221; \46270 int32x2_t __s2_313 = __p2_313; \
44535 int32x2_t __ret_221; \46271 int32x2_t __ret_313; \
44536 __ret_221 = vqadd_s32(__s0_221, vqrdmulh_s32(__s1_221, splat_lane_s32(__s2_221, __p3_221))); \46272 __ret_313 = vqadd_s32(__s0_313, vqrdmulh_s32(__s1_313, splat_lane_s32(__s2_313, __p3_313))); \
44537 __ret_221; \46273 __ret_313; \
44538})46274})
44539#else46275#else
44540#define vqrdmlah_lane_s32(__p0_222, __p1_222, __p2_222, __p3_222) __extension__ ({ \46276#define vqrdmlah_lane_s32(__p0_314, __p1_314, __p2_314, __p3_314) __extension__ ({ \
44541 int32x2_t __s0_222 = __p0_222; \46277 int32x2_t __s0_314 = __p0_314; \
44542 int32x2_t __s1_222 = __p1_222; \46278 int32x2_t __s1_314 = __p1_314; \
44543 int32x2_t __s2_222 = __p2_222; \46279 int32x2_t __s2_314 = __p2_314; \
44544 int32x2_t __rev0_222; __rev0_222 = __builtin_shufflevector(__s0_222, __s0_222, 1, 0); \46280 int32x2_t __rev0_314; __rev0_314 = __builtin_shufflevector(__s0_314, __s0_314, 1, 0); \
44545 int32x2_t __rev1_222; __rev1_222 = __builtin_shufflevector(__s1_222, __s1_222, 1, 0); \46281 int32x2_t __rev1_314; __rev1_314 = __builtin_shufflevector(__s1_314, __s1_314, 1, 0); \
44546 int32x2_t __rev2_222; __rev2_222 = __builtin_shufflevector(__s2_222, __s2_222, 1, 0); \46282 int32x2_t __rev2_314; __rev2_314 = __builtin_shufflevector(__s2_314, __s2_314, 1, 0); \
44547 int32x2_t __ret_222; \46283 int32x2_t __ret_314; \
44548 __ret_222 = __noswap_vqadd_s32(__rev0_222, __noswap_vqrdmulh_s32(__rev1_222, __noswap_splat_lane_s32(__rev2_222, __p3_222))); \46284 __ret_314 = __noswap_vqadd_s32(__rev0_314, __noswap_vqrdmulh_s32(__rev1_314, __noswap_splat_lane_s32(__rev2_314, __p3_314))); \
44549 __ret_222 = __builtin_shufflevector(__ret_222, __ret_222, 1, 0); \46285 __ret_314 = __builtin_shufflevector(__ret_314, __ret_314, 1, 0); \
44550 __ret_222; \46286 __ret_314; \
44551})46287})
44552#endif46288#endif
4455346289
44554#ifdef __LITTLE_ENDIAN__46290#ifdef __LITTLE_ENDIAN__
44555#define vqrdmlah_lane_s16(__p0_223, __p1_223, __p2_223, __p3_223) __extension__ ({ \46291#define vqrdmlah_lane_s16(__p0_315, __p1_315, __p2_315, __p3_315) __extension__ ({ \
44556 int16x4_t __s0_223 = __p0_223; \46292 int16x4_t __s0_315 = __p0_315; \
44557 int16x4_t __s1_223 = __p1_223; \46293 int16x4_t __s1_315 = __p1_315; \
44558 int16x4_t __s2_223 = __p2_223; \46294 int16x4_t __s2_315 = __p2_315; \
44559 int16x4_t __ret_223; \46295 int16x4_t __ret_315; \
44560 __ret_223 = vqadd_s16(__s0_223, vqrdmulh_s16(__s1_223, splat_lane_s16(__s2_223, __p3_223))); \46296 __ret_315 = vqadd_s16(__s0_315, vqrdmulh_s16(__s1_315, splat_lane_s16(__s2_315, __p3_315))); \
44561 __ret_223; \46297 __ret_315; \
44562})46298})
44563#else46299#else
44564#define vqrdmlah_lane_s16(__p0_224, __p1_224, __p2_224, __p3_224) __extension__ ({ \46300#define vqrdmlah_lane_s16(__p0_316, __p1_316, __p2_316, __p3_316) __extension__ ({ \
44565 int16x4_t __s0_224 = __p0_224; \46301 int16x4_t __s0_316 = __p0_316; \
44566 int16x4_t __s1_224 = __p1_224; \46302 int16x4_t __s1_316 = __p1_316; \
44567 int16x4_t __s2_224 = __p2_224; \46303 int16x4_t __s2_316 = __p2_316; \
44568 int16x4_t __rev0_224; __rev0_224 = __builtin_shufflevector(__s0_224, __s0_224, 3, 2, 1, 0); \46304 int16x4_t __rev0_316; __rev0_316 = __builtin_shufflevector(__s0_316, __s0_316, 3, 2, 1, 0); \
44569 int16x4_t __rev1_224; __rev1_224 = __builtin_shufflevector(__s1_224, __s1_224, 3, 2, 1, 0); \46305 int16x4_t __rev1_316; __rev1_316 = __builtin_shufflevector(__s1_316, __s1_316, 3, 2, 1, 0); \
44570 int16x4_t __rev2_224; __rev2_224 = __builtin_shufflevector(__s2_224, __s2_224, 3, 2, 1, 0); \46306 int16x4_t __rev2_316; __rev2_316 = __builtin_shufflevector(__s2_316, __s2_316, 3, 2, 1, 0); \
44571 int16x4_t __ret_224; \46307 int16x4_t __ret_316; \
44572 __ret_224 = __noswap_vqadd_s16(__rev0_224, __noswap_vqrdmulh_s16(__rev1_224, __noswap_splat_lane_s16(__rev2_224, __p3_224))); \46308 __ret_316 = __noswap_vqadd_s16(__rev0_316, __noswap_vqrdmulh_s16(__rev1_316, __noswap_splat_lane_s16(__rev2_316, __p3_316))); \
44573 __ret_224 = __builtin_shufflevector(__ret_224, __ret_224, 3, 2, 1, 0); \46309 __ret_316 = __builtin_shufflevector(__ret_316, __ret_316, 3, 2, 1, 0); \
44574 __ret_224; \46310 __ret_316; \
44575})46311})
44576#endif46312#endif
4457746313
...@@ -44648,292 +46384,292 @@ __ai int16x4_t vqrdmlsh_s16(int16x4_t __p0, int16x4_t __p1, int16x4_t __p2) {...@@ -44648,292 +46384,292 @@ __ai int16x4_t vqrdmlsh_s16(int16x4_t __p0, int16x4_t __p1, int16x4_t __p2) {
44648#endif46384#endif
4464946385
44650#ifdef __LITTLE_ENDIAN__46386#ifdef __LITTLE_ENDIAN__
44651#define vqrdmlshq_lane_s32(__p0_225, __p1_225, __p2_225, __p3_225) __extension__ ({ \46387#define vqrdmlshq_lane_s32(__p0_317, __p1_317, __p2_317, __p3_317) __extension__ ({ \
44652 int32x4_t __s0_225 = __p0_225; \46388 int32x4_t __s0_317 = __p0_317; \
44653 int32x4_t __s1_225 = __p1_225; \46389 int32x4_t __s1_317 = __p1_317; \
44654 int32x2_t __s2_225 = __p2_225; \46390 int32x2_t __s2_317 = __p2_317; \
44655 int32x4_t __ret_225; \46391 int32x4_t __ret_317; \
44656 __ret_225 = vqsubq_s32(__s0_225, vqrdmulhq_s32(__s1_225, splatq_lane_s32(__s2_225, __p3_225))); \46392 __ret_317 = vqsubq_s32(__s0_317, vqrdmulhq_s32(__s1_317, splatq_lane_s32(__s2_317, __p3_317))); \
44657 __ret_225; \46393 __ret_317; \
44658})46394})
44659#else46395#else
44660#define vqrdmlshq_lane_s32(__p0_226, __p1_226, __p2_226, __p3_226) __extension__ ({ \46396#define vqrdmlshq_lane_s32(__p0_318, __p1_318, __p2_318, __p3_318) __extension__ ({ \
44661 int32x4_t __s0_226 = __p0_226; \46397 int32x4_t __s0_318 = __p0_318; \
44662 int32x4_t __s1_226 = __p1_226; \46398 int32x4_t __s1_318 = __p1_318; \
44663 int32x2_t __s2_226 = __p2_226; \46399 int32x2_t __s2_318 = __p2_318; \
44664 int32x4_t __rev0_226; __rev0_226 = __builtin_shufflevector(__s0_226, __s0_226, 3, 2, 1, 0); \46400 int32x4_t __rev0_318; __rev0_318 = __builtin_shufflevector(__s0_318, __s0_318, 3, 2, 1, 0); \
44665 int32x4_t __rev1_226; __rev1_226 = __builtin_shufflevector(__s1_226, __s1_226, 3, 2, 1, 0); \46401 int32x4_t __rev1_318; __rev1_318 = __builtin_shufflevector(__s1_318, __s1_318, 3, 2, 1, 0); \
44666 int32x2_t __rev2_226; __rev2_226 = __builtin_shufflevector(__s2_226, __s2_226, 1, 0); \46402 int32x2_t __rev2_318; __rev2_318 = __builtin_shufflevector(__s2_318, __s2_318, 1, 0); \
44667 int32x4_t __ret_226; \46403 int32x4_t __ret_318; \
44668 __ret_226 = __noswap_vqsubq_s32(__rev0_226, __noswap_vqrdmulhq_s32(__rev1_226, __noswap_splatq_lane_s32(__rev2_226, __p3_226))); \46404 __ret_318 = __noswap_vqsubq_s32(__rev0_318, __noswap_vqrdmulhq_s32(__rev1_318, __noswap_splatq_lane_s32(__rev2_318, __p3_318))); \
44669 __ret_226 = __builtin_shufflevector(__ret_226, __ret_226, 3, 2, 1, 0); \46405 __ret_318 = __builtin_shufflevector(__ret_318, __ret_318, 3, 2, 1, 0); \
44670 __ret_226; \46406 __ret_318; \
44671})46407})
44672#endif46408#endif
4467346409
44674#ifdef __LITTLE_ENDIAN__46410#ifdef __LITTLE_ENDIAN__
44675#define vqrdmlshq_lane_s16(__p0_227, __p1_227, __p2_227, __p3_227) __extension__ ({ \46411#define vqrdmlshq_lane_s16(__p0_319, __p1_319, __p2_319, __p3_319) __extension__ ({ \
44676 int16x8_t __s0_227 = __p0_227; \46412 int16x8_t __s0_319 = __p0_319; \
44677 int16x8_t __s1_227 = __p1_227; \46413 int16x8_t __s1_319 = __p1_319; \
44678 int16x4_t __s2_227 = __p2_227; \46414 int16x4_t __s2_319 = __p2_319; \
44679 int16x8_t __ret_227; \46415 int16x8_t __ret_319; \
44680 __ret_227 = vqsubq_s16(__s0_227, vqrdmulhq_s16(__s1_227, splatq_lane_s16(__s2_227, __p3_227))); \46416 __ret_319 = vqsubq_s16(__s0_319, vqrdmulhq_s16(__s1_319, splatq_lane_s16(__s2_319, __p3_319))); \
44681 __ret_227; \46417 __ret_319; \
44682})46418})
44683#else46419#else
44684#define vqrdmlshq_lane_s16(__p0_228, __p1_228, __p2_228, __p3_228) __extension__ ({ \46420#define vqrdmlshq_lane_s16(__p0_320, __p1_320, __p2_320, __p3_320) __extension__ ({ \
44685 int16x8_t __s0_228 = __p0_228; \46421 int16x8_t __s0_320 = __p0_320; \
44686 int16x8_t __s1_228 = __p1_228; \46422 int16x8_t __s1_320 = __p1_320; \
44687 int16x4_t __s2_228 = __p2_228; \46423 int16x4_t __s2_320 = __p2_320; \
44688 int16x8_t __rev0_228; __rev0_228 = __builtin_shufflevector(__s0_228, __s0_228, 7, 6, 5, 4, 3, 2, 1, 0); \46424 int16x8_t __rev0_320; __rev0_320 = __builtin_shufflevector(__s0_320, __s0_320, 7, 6, 5, 4, 3, 2, 1, 0); \
44689 int16x8_t __rev1_228; __rev1_228 = __builtin_shufflevector(__s1_228, __s1_228, 7, 6, 5, 4, 3, 2, 1, 0); \46425 int16x8_t __rev1_320; __rev1_320 = __builtin_shufflevector(__s1_320, __s1_320, 7, 6, 5, 4, 3, 2, 1, 0); \
44690 int16x4_t __rev2_228; __rev2_228 = __builtin_shufflevector(__s2_228, __s2_228, 3, 2, 1, 0); \46426 int16x4_t __rev2_320; __rev2_320 = __builtin_shufflevector(__s2_320, __s2_320, 3, 2, 1, 0); \
44691 int16x8_t __ret_228; \46427 int16x8_t __ret_320; \
44692 __ret_228 = __noswap_vqsubq_s16(__rev0_228, __noswap_vqrdmulhq_s16(__rev1_228, __noswap_splatq_lane_s16(__rev2_228, __p3_228))); \46428 __ret_320 = __noswap_vqsubq_s16(__rev0_320, __noswap_vqrdmulhq_s16(__rev1_320, __noswap_splatq_lane_s16(__rev2_320, __p3_320))); \
44693 __ret_228 = __builtin_shufflevector(__ret_228, __ret_228, 7, 6, 5, 4, 3, 2, 1, 0); \46429 __ret_320 = __builtin_shufflevector(__ret_320, __ret_320, 7, 6, 5, 4, 3, 2, 1, 0); \
44694 __ret_228; \46430 __ret_320; \
44695})46431})
44696#endif46432#endif
4469746433
44698#ifdef __LITTLE_ENDIAN__46434#ifdef __LITTLE_ENDIAN__
44699#define vqrdmlsh_lane_s32(__p0_229, __p1_229, __p2_229, __p3_229) __extension__ ({ \46435#define vqrdmlsh_lane_s32(__p0_321, __p1_321, __p2_321, __p3_321) __extension__ ({ \
44700 int32x2_t __s0_229 = __p0_229; \46436 int32x2_t __s0_321 = __p0_321; \
44701 int32x2_t __s1_229 = __p1_229; \46437 int32x2_t __s1_321 = __p1_321; \
44702 int32x2_t __s2_229 = __p2_229; \46438 int32x2_t __s2_321 = __p2_321; \
44703 int32x2_t __ret_229; \46439 int32x2_t __ret_321; \
44704 __ret_229 = vqsub_s32(__s0_229, vqrdmulh_s32(__s1_229, splat_lane_s32(__s2_229, __p3_229))); \46440 __ret_321 = vqsub_s32(__s0_321, vqrdmulh_s32(__s1_321, splat_lane_s32(__s2_321, __p3_321))); \
44705 __ret_229; \46441 __ret_321; \
44706})46442})
44707#else46443#else
44708#define vqrdmlsh_lane_s32(__p0_230, __p1_230, __p2_230, __p3_230) __extension__ ({ \46444#define vqrdmlsh_lane_s32(__p0_322, __p1_322, __p2_322, __p3_322) __extension__ ({ \
44709 int32x2_t __s0_230 = __p0_230; \46445 int32x2_t __s0_322 = __p0_322; \
44710 int32x2_t __s1_230 = __p1_230; \46446 int32x2_t __s1_322 = __p1_322; \
44711 int32x2_t __s2_230 = __p2_230; \46447 int32x2_t __s2_322 = __p2_322; \
44712 int32x2_t __rev0_230; __rev0_230 = __builtin_shufflevector(__s0_230, __s0_230, 1, 0); \46448 int32x2_t __rev0_322; __rev0_322 = __builtin_shufflevector(__s0_322, __s0_322, 1, 0); \
44713 int32x2_t __rev1_230; __rev1_230 = __builtin_shufflevector(__s1_230, __s1_230, 1, 0); \46449 int32x2_t __rev1_322; __rev1_322 = __builtin_shufflevector(__s1_322, __s1_322, 1, 0); \
44714 int32x2_t __rev2_230; __rev2_230 = __builtin_shufflevector(__s2_230, __s2_230, 1, 0); \46450 int32x2_t __rev2_322; __rev2_322 = __builtin_shufflevector(__s2_322, __s2_322, 1, 0); \
44715 int32x2_t __ret_230; \46451 int32x2_t __ret_322; \
44716 __ret_230 = __noswap_vqsub_s32(__rev0_230, __noswap_vqrdmulh_s32(__rev1_230, __noswap_splat_lane_s32(__rev2_230, __p3_230))); \46452 __ret_322 = __noswap_vqsub_s32(__rev0_322, __noswap_vqrdmulh_s32(__rev1_322, __noswap_splat_lane_s32(__rev2_322, __p3_322))); \
44717 __ret_230 = __builtin_shufflevector(__ret_230, __ret_230, 1, 0); \46453 __ret_322 = __builtin_shufflevector(__ret_322, __ret_322, 1, 0); \
44718 __ret_230; \46454 __ret_322; \
44719})46455})
44720#endif46456#endif
4472146457
44722#ifdef __LITTLE_ENDIAN__46458#ifdef __LITTLE_ENDIAN__
44723#define vqrdmlsh_lane_s16(__p0_231, __p1_231, __p2_231, __p3_231) __extension__ ({ \46459#define vqrdmlsh_lane_s16(__p0_323, __p1_323, __p2_323, __p3_323) __extension__ ({ \
44724 int16x4_t __s0_231 = __p0_231; \46460 int16x4_t __s0_323 = __p0_323; \
44725 int16x4_t __s1_231 = __p1_231; \46461 int16x4_t __s1_323 = __p1_323; \
44726 int16x4_t __s2_231 = __p2_231; \46462 int16x4_t __s2_323 = __p2_323; \
44727 int16x4_t __ret_231; \46463 int16x4_t __ret_323; \
44728 __ret_231 = vqsub_s16(__s0_231, vqrdmulh_s16(__s1_231, splat_lane_s16(__s2_231, __p3_231))); \46464 __ret_323 = vqsub_s16(__s0_323, vqrdmulh_s16(__s1_323, splat_lane_s16(__s2_323, __p3_323))); \
44729 __ret_231; \46465 __ret_323; \
44730})46466})
44731#else46467#else
44732#define vqrdmlsh_lane_s16(__p0_232, __p1_232, __p2_232, __p3_232) __extension__ ({ \46468#define vqrdmlsh_lane_s16(__p0_324, __p1_324, __p2_324, __p3_324) __extension__ ({ \
44733 int16x4_t __s0_232 = __p0_232; \46469 int16x4_t __s0_324 = __p0_324; \
44734 int16x4_t __s1_232 = __p1_232; \46470 int16x4_t __s1_324 = __p1_324; \
44735 int16x4_t __s2_232 = __p2_232; \46471 int16x4_t __s2_324 = __p2_324; \
44736 int16x4_t __rev0_232; __rev0_232 = __builtin_shufflevector(__s0_232, __s0_232, 3, 2, 1, 0); \46472 int16x4_t __rev0_324; __rev0_324 = __builtin_shufflevector(__s0_324, __s0_324, 3, 2, 1, 0); \
44737 int16x4_t __rev1_232; __rev1_232 = __builtin_shufflevector(__s1_232, __s1_232, 3, 2, 1, 0); \46473 int16x4_t __rev1_324; __rev1_324 = __builtin_shufflevector(__s1_324, __s1_324, 3, 2, 1, 0); \
44738 int16x4_t __rev2_232; __rev2_232 = __builtin_shufflevector(__s2_232, __s2_232, 3, 2, 1, 0); \46474 int16x4_t __rev2_324; __rev2_324 = __builtin_shufflevector(__s2_324, __s2_324, 3, 2, 1, 0); \
44739 int16x4_t __ret_232; \46475 int16x4_t __ret_324; \
44740 __ret_232 = __noswap_vqsub_s16(__rev0_232, __noswap_vqrdmulh_s16(__rev1_232, __noswap_splat_lane_s16(__rev2_232, __p3_232))); \46476 __ret_324 = __noswap_vqsub_s16(__rev0_324, __noswap_vqrdmulh_s16(__rev1_324, __noswap_splat_lane_s16(__rev2_324, __p3_324))); \
44741 __ret_232 = __builtin_shufflevector(__ret_232, __ret_232, 3, 2, 1, 0); \46477 __ret_324 = __builtin_shufflevector(__ret_324, __ret_324, 3, 2, 1, 0); \
44742 __ret_232; \46478 __ret_324; \
44743})46479})
44744#endif46480#endif
4474546481
44746#endif46482#endif
44747#if defined(__ARM_FEATURE_QRDMX) && defined(__aarch64__)46483#if defined(__ARM_FEATURE_QRDMX) && defined(__aarch64__)
44748#ifdef __LITTLE_ENDIAN__46484#ifdef __LITTLE_ENDIAN__
44749#define vqrdmlahq_laneq_s32(__p0_233, __p1_233, __p2_233, __p3_233) __extension__ ({ \46485#define vqrdmlahq_laneq_s32(__p0_325, __p1_325, __p2_325, __p3_325) __extension__ ({ \
44750 int32x4_t __s0_233 = __p0_233; \46486 int32x4_t __s0_325 = __p0_325; \
44751 int32x4_t __s1_233 = __p1_233; \46487 int32x4_t __s1_325 = __p1_325; \
44752 int32x4_t __s2_233 = __p2_233; \46488 int32x4_t __s2_325 = __p2_325; \
44753 int32x4_t __ret_233; \46489 int32x4_t __ret_325; \
44754 __ret_233 = vqaddq_s32(__s0_233, vqrdmulhq_s32(__s1_233, splatq_laneq_s32(__s2_233, __p3_233))); \46490 __ret_325 = vqaddq_s32(__s0_325, vqrdmulhq_s32(__s1_325, splatq_laneq_s32(__s2_325, __p3_325))); \
44755 __ret_233; \46491 __ret_325; \
44756})46492})
44757#else46493#else
44758#define vqrdmlahq_laneq_s32(__p0_234, __p1_234, __p2_234, __p3_234) __extension__ ({ \46494#define vqrdmlahq_laneq_s32(__p0_326, __p1_326, __p2_326, __p3_326) __extension__ ({ \
44759 int32x4_t __s0_234 = __p0_234; \46495 int32x4_t __s0_326 = __p0_326; \
44760 int32x4_t __s1_234 = __p1_234; \46496 int32x4_t __s1_326 = __p1_326; \
44761 int32x4_t __s2_234 = __p2_234; \46497 int32x4_t __s2_326 = __p2_326; \
44762 int32x4_t __rev0_234; __rev0_234 = __builtin_shufflevector(__s0_234, __s0_234, 3, 2, 1, 0); \46498 int32x4_t __rev0_326; __rev0_326 = __builtin_shufflevector(__s0_326, __s0_326, 3, 2, 1, 0); \
44763 int32x4_t __rev1_234; __rev1_234 = __builtin_shufflevector(__s1_234, __s1_234, 3, 2, 1, 0); \46499 int32x4_t __rev1_326; __rev1_326 = __builtin_shufflevector(__s1_326, __s1_326, 3, 2, 1, 0); \
44764 int32x4_t __rev2_234; __rev2_234 = __builtin_shufflevector(__s2_234, __s2_234, 3, 2, 1, 0); \46500 int32x4_t __rev2_326; __rev2_326 = __builtin_shufflevector(__s2_326, __s2_326, 3, 2, 1, 0); \
44765 int32x4_t __ret_234; \46501 int32x4_t __ret_326; \
44766 __ret_234 = __noswap_vqaddq_s32(__rev0_234, __noswap_vqrdmulhq_s32(__rev1_234, __noswap_splatq_laneq_s32(__rev2_234, __p3_234))); \46502 __ret_326 = __noswap_vqaddq_s32(__rev0_326, __noswap_vqrdmulhq_s32(__rev1_326, __noswap_splatq_laneq_s32(__rev2_326, __p3_326))); \
44767 __ret_234 = __builtin_shufflevector(__ret_234, __ret_234, 3, 2, 1, 0); \46503 __ret_326 = __builtin_shufflevector(__ret_326, __ret_326, 3, 2, 1, 0); \
44768 __ret_234; \46504 __ret_326; \
44769})46505})
44770#endif46506#endif
4477146507
44772#ifdef __LITTLE_ENDIAN__46508#ifdef __LITTLE_ENDIAN__
44773#define vqrdmlahq_laneq_s16(__p0_235, __p1_235, __p2_235, __p3_235) __extension__ ({ \46509#define vqrdmlahq_laneq_s16(__p0_327, __p1_327, __p2_327, __p3_327) __extension__ ({ \
44774 int16x8_t __s0_235 = __p0_235; \46510 int16x8_t __s0_327 = __p0_327; \
44775 int16x8_t __s1_235 = __p1_235; \46511 int16x8_t __s1_327 = __p1_327; \
44776 int16x8_t __s2_235 = __p2_235; \46512 int16x8_t __s2_327 = __p2_327; \
44777 int16x8_t __ret_235; \46513 int16x8_t __ret_327; \
44778 __ret_235 = vqaddq_s16(__s0_235, vqrdmulhq_s16(__s1_235, splatq_laneq_s16(__s2_235, __p3_235))); \46514 __ret_327 = vqaddq_s16(__s0_327, vqrdmulhq_s16(__s1_327, splatq_laneq_s16(__s2_327, __p3_327))); \
44779 __ret_235; \46515 __ret_327; \
44780})46516})
44781#else46517#else
44782#define vqrdmlahq_laneq_s16(__p0_236, __p1_236, __p2_236, __p3_236) __extension__ ({ \46518#define vqrdmlahq_laneq_s16(__p0_328, __p1_328, __p2_328, __p3_328) __extension__ ({ \
44783 int16x8_t __s0_236 = __p0_236; \46519 int16x8_t __s0_328 = __p0_328; \
44784 int16x8_t __s1_236 = __p1_236; \46520 int16x8_t __s1_328 = __p1_328; \
44785 int16x8_t __s2_236 = __p2_236; \46521 int16x8_t __s2_328 = __p2_328; \
44786 int16x8_t __rev0_236; __rev0_236 = __builtin_shufflevector(__s0_236, __s0_236, 7, 6, 5, 4, 3, 2, 1, 0); \46522 int16x8_t __rev0_328; __rev0_328 = __builtin_shufflevector(__s0_328, __s0_328, 7, 6, 5, 4, 3, 2, 1, 0); \
44787 int16x8_t __rev1_236; __rev1_236 = __builtin_shufflevector(__s1_236, __s1_236, 7, 6, 5, 4, 3, 2, 1, 0); \46523 int16x8_t __rev1_328; __rev1_328 = __builtin_shufflevector(__s1_328, __s1_328, 7, 6, 5, 4, 3, 2, 1, 0); \
44788 int16x8_t __rev2_236; __rev2_236 = __builtin_shufflevector(__s2_236, __s2_236, 7, 6, 5, 4, 3, 2, 1, 0); \46524 int16x8_t __rev2_328; __rev2_328 = __builtin_shufflevector(__s2_328, __s2_328, 7, 6, 5, 4, 3, 2, 1, 0); \
44789 int16x8_t __ret_236; \46525 int16x8_t __ret_328; \
44790 __ret_236 = __noswap_vqaddq_s16(__rev0_236, __noswap_vqrdmulhq_s16(__rev1_236, __noswap_splatq_laneq_s16(__rev2_236, __p3_236))); \46526 __ret_328 = __noswap_vqaddq_s16(__rev0_328, __noswap_vqrdmulhq_s16(__rev1_328, __noswap_splatq_laneq_s16(__rev2_328, __p3_328))); \
44791 __ret_236 = __builtin_shufflevector(__ret_236, __ret_236, 7, 6, 5, 4, 3, 2, 1, 0); \46527 __ret_328 = __builtin_shufflevector(__ret_328, __ret_328, 7, 6, 5, 4, 3, 2, 1, 0); \
44792 __ret_236; \46528 __ret_328; \
44793})46529})
44794#endif46530#endif
4479546531
44796#ifdef __LITTLE_ENDIAN__46532#ifdef __LITTLE_ENDIAN__
44797#define vqrdmlah_laneq_s32(__p0_237, __p1_237, __p2_237, __p3_237) __extension__ ({ \46533#define vqrdmlah_laneq_s32(__p0_329, __p1_329, __p2_329, __p3_329) __extension__ ({ \
44798 int32x2_t __s0_237 = __p0_237; \46534 int32x2_t __s0_329 = __p0_329; \
44799 int32x2_t __s1_237 = __p1_237; \46535 int32x2_t __s1_329 = __p1_329; \
44800 int32x4_t __s2_237 = __p2_237; \46536 int32x4_t __s2_329 = __p2_329; \
44801 int32x2_t __ret_237; \46537 int32x2_t __ret_329; \
44802 __ret_237 = vqadd_s32(__s0_237, vqrdmulh_s32(__s1_237, splat_laneq_s32(__s2_237, __p3_237))); \46538 __ret_329 = vqadd_s32(__s0_329, vqrdmulh_s32(__s1_329, splat_laneq_s32(__s2_329, __p3_329))); \
44803 __ret_237; \46539 __ret_329; \
44804})46540})
44805#else46541#else
44806#define vqrdmlah_laneq_s32(__p0_238, __p1_238, __p2_238, __p3_238) __extension__ ({ \46542#define vqrdmlah_laneq_s32(__p0_330, __p1_330, __p2_330, __p3_330) __extension__ ({ \
44807 int32x2_t __s0_238 = __p0_238; \46543 int32x2_t __s0_330 = __p0_330; \
44808 int32x2_t __s1_238 = __p1_238; \46544 int32x2_t __s1_330 = __p1_330; \
44809 int32x4_t __s2_238 = __p2_238; \46545 int32x4_t __s2_330 = __p2_330; \
44810 int32x2_t __rev0_238; __rev0_238 = __builtin_shufflevector(__s0_238, __s0_238, 1, 0); \46546 int32x2_t __rev0_330; __rev0_330 = __builtin_shufflevector(__s0_330, __s0_330, 1, 0); \
44811 int32x2_t __rev1_238; __rev1_238 = __builtin_shufflevector(__s1_238, __s1_238, 1, 0); \46547 int32x2_t __rev1_330; __rev1_330 = __builtin_shufflevector(__s1_330, __s1_330, 1, 0); \
44812 int32x4_t __rev2_238; __rev2_238 = __builtin_shufflevector(__s2_238, __s2_238, 3, 2, 1, 0); \46548 int32x4_t __rev2_330; __rev2_330 = __builtin_shufflevector(__s2_330, __s2_330, 3, 2, 1, 0); \
44813 int32x2_t __ret_238; \46549 int32x2_t __ret_330; \
44814 __ret_238 = __noswap_vqadd_s32(__rev0_238, __noswap_vqrdmulh_s32(__rev1_238, __noswap_splat_laneq_s32(__rev2_238, __p3_238))); \46550 __ret_330 = __noswap_vqadd_s32(__rev0_330, __noswap_vqrdmulh_s32(__rev1_330, __noswap_splat_laneq_s32(__rev2_330, __p3_330))); \
44815 __ret_238 = __builtin_shufflevector(__ret_238, __ret_238, 1, 0); \46551 __ret_330 = __builtin_shufflevector(__ret_330, __ret_330, 1, 0); \
44816 __ret_238; \46552 __ret_330; \
44817})46553})
44818#endif46554#endif
4481946555
44820#ifdef __LITTLE_ENDIAN__46556#ifdef __LITTLE_ENDIAN__
44821#define vqrdmlah_laneq_s16(__p0_239, __p1_239, __p2_239, __p3_239) __extension__ ({ \46557#define vqrdmlah_laneq_s16(__p0_331, __p1_331, __p2_331, __p3_331) __extension__ ({ \
44822 int16x4_t __s0_239 = __p0_239; \46558 int16x4_t __s0_331 = __p0_331; \
44823 int16x4_t __s1_239 = __p1_239; \46559 int16x4_t __s1_331 = __p1_331; \
44824 int16x8_t __s2_239 = __p2_239; \46560 int16x8_t __s2_331 = __p2_331; \
44825 int16x4_t __ret_239; \46561 int16x4_t __ret_331; \
44826 __ret_239 = vqadd_s16(__s0_239, vqrdmulh_s16(__s1_239, splat_laneq_s16(__s2_239, __p3_239))); \46562 __ret_331 = vqadd_s16(__s0_331, vqrdmulh_s16(__s1_331, splat_laneq_s16(__s2_331, __p3_331))); \
44827 __ret_239; \46563 __ret_331; \
44828})46564})
44829#else46565#else
44830#define vqrdmlah_laneq_s16(__p0_240, __p1_240, __p2_240, __p3_240) __extension__ ({ \46566#define vqrdmlah_laneq_s16(__p0_332, __p1_332, __p2_332, __p3_332) __extension__ ({ \
44831 int16x4_t __s0_240 = __p0_240; \46567 int16x4_t __s0_332 = __p0_332; \
44832 int16x4_t __s1_240 = __p1_240; \46568 int16x4_t __s1_332 = __p1_332; \
44833 int16x8_t __s2_240 = __p2_240; \46569 int16x8_t __s2_332 = __p2_332; \
44834 int16x4_t __rev0_240; __rev0_240 = __builtin_shufflevector(__s0_240, __s0_240, 3, 2, 1, 0); \46570 int16x4_t __rev0_332; __rev0_332 = __builtin_shufflevector(__s0_332, __s0_332, 3, 2, 1, 0); \
44835 int16x4_t __rev1_240; __rev1_240 = __builtin_shufflevector(__s1_240, __s1_240, 3, 2, 1, 0); \46571 int16x4_t __rev1_332; __rev1_332 = __builtin_shufflevector(__s1_332, __s1_332, 3, 2, 1, 0); \
44836 int16x8_t __rev2_240; __rev2_240 = __builtin_shufflevector(__s2_240, __s2_240, 7, 6, 5, 4, 3, 2, 1, 0); \46572 int16x8_t __rev2_332; __rev2_332 = __builtin_shufflevector(__s2_332, __s2_332, 7, 6, 5, 4, 3, 2, 1, 0); \
44837 int16x4_t __ret_240; \46573 int16x4_t __ret_332; \
44838 __ret_240 = __noswap_vqadd_s16(__rev0_240, __noswap_vqrdmulh_s16(__rev1_240, __noswap_splat_laneq_s16(__rev2_240, __p3_240))); \46574 __ret_332 = __noswap_vqadd_s16(__rev0_332, __noswap_vqrdmulh_s16(__rev1_332, __noswap_splat_laneq_s16(__rev2_332, __p3_332))); \
44839 __ret_240 = __builtin_shufflevector(__ret_240, __ret_240, 3, 2, 1, 0); \46575 __ret_332 = __builtin_shufflevector(__ret_332, __ret_332, 3, 2, 1, 0); \
44840 __ret_240; \46576 __ret_332; \
44841})46577})
44842#endif46578#endif
4484346579
44844#ifdef __LITTLE_ENDIAN__46580#ifdef __LITTLE_ENDIAN__
44845#define vqrdmlshq_laneq_s32(__p0_241, __p1_241, __p2_241, __p3_241) __extension__ ({ \46581#define vqrdmlshq_laneq_s32(__p0_333, __p1_333, __p2_333, __p3_333) __extension__ ({ \
44846 int32x4_t __s0_241 = __p0_241; \46582 int32x4_t __s0_333 = __p0_333; \
44847 int32x4_t __s1_241 = __p1_241; \46583 int32x4_t __s1_333 = __p1_333; \
44848 int32x4_t __s2_241 = __p2_241; \46584 int32x4_t __s2_333 = __p2_333; \
44849 int32x4_t __ret_241; \46585 int32x4_t __ret_333; \
44850 __ret_241 = vqsubq_s32(__s0_241, vqrdmulhq_s32(__s1_241, splatq_laneq_s32(__s2_241, __p3_241))); \46586 __ret_333 = vqsubq_s32(__s0_333, vqrdmulhq_s32(__s1_333, splatq_laneq_s32(__s2_333, __p3_333))); \
44851 __ret_241; \46587 __ret_333; \
44852})46588})
44853#else46589#else
44854#define vqrdmlshq_laneq_s32(__p0_242, __p1_242, __p2_242, __p3_242) __extension__ ({ \46590#define vqrdmlshq_laneq_s32(__p0_334, __p1_334, __p2_334, __p3_334) __extension__ ({ \
44855 int32x4_t __s0_242 = __p0_242; \46591 int32x4_t __s0_334 = __p0_334; \
44856 int32x4_t __s1_242 = __p1_242; \46592 int32x4_t __s1_334 = __p1_334; \
44857 int32x4_t __s2_242 = __p2_242; \46593 int32x4_t __s2_334 = __p2_334; \
44858 int32x4_t __rev0_242; __rev0_242 = __builtin_shufflevector(__s0_242, __s0_242, 3, 2, 1, 0); \46594 int32x4_t __rev0_334; __rev0_334 = __builtin_shufflevector(__s0_334, __s0_334, 3, 2, 1, 0); \
44859 int32x4_t __rev1_242; __rev1_242 = __builtin_shufflevector(__s1_242, __s1_242, 3, 2, 1, 0); \46595 int32x4_t __rev1_334; __rev1_334 = __builtin_shufflevector(__s1_334, __s1_334, 3, 2, 1, 0); \
44860 int32x4_t __rev2_242; __rev2_242 = __builtin_shufflevector(__s2_242, __s2_242, 3, 2, 1, 0); \46596 int32x4_t __rev2_334; __rev2_334 = __builtin_shufflevector(__s2_334, __s2_334, 3, 2, 1, 0); \
44861 int32x4_t __ret_242; \46597 int32x4_t __ret_334; \
44862 __ret_242 = __noswap_vqsubq_s32(__rev0_242, __noswap_vqrdmulhq_s32(__rev1_242, __noswap_splatq_laneq_s32(__rev2_242, __p3_242))); \46598 __ret_334 = __noswap_vqsubq_s32(__rev0_334, __noswap_vqrdmulhq_s32(__rev1_334, __noswap_splatq_laneq_s32(__rev2_334, __p3_334))); \
44863 __ret_242 = __builtin_shufflevector(__ret_242, __ret_242, 3, 2, 1, 0); \46599 __ret_334 = __builtin_shufflevector(__ret_334, __ret_334, 3, 2, 1, 0); \
44864 __ret_242; \46600 __ret_334; \
44865})46601})
44866#endif46602#endif
4486746603
44868#ifdef __LITTLE_ENDIAN__46604#ifdef __LITTLE_ENDIAN__
44869#define vqrdmlshq_laneq_s16(__p0_243, __p1_243, __p2_243, __p3_243) __extension__ ({ \46605#define vqrdmlshq_laneq_s16(__p0_335, __p1_335, __p2_335, __p3_335) __extension__ ({ \
44870 int16x8_t __s0_243 = __p0_243; \46606 int16x8_t __s0_335 = __p0_335; \
44871 int16x8_t __s1_243 = __p1_243; \46607 int16x8_t __s1_335 = __p1_335; \
44872 int16x8_t __s2_243 = __p2_243; \46608 int16x8_t __s2_335 = __p2_335; \
44873 int16x8_t __ret_243; \46609 int16x8_t __ret_335; \
44874 __ret_243 = vqsubq_s16(__s0_243, vqrdmulhq_s16(__s1_243, splatq_laneq_s16(__s2_243, __p3_243))); \46610 __ret_335 = vqsubq_s16(__s0_335, vqrdmulhq_s16(__s1_335, splatq_laneq_s16(__s2_335, __p3_335))); \
44875 __ret_243; \46611 __ret_335; \
44876})46612})
44877#else46613#else
44878#define vqrdmlshq_laneq_s16(__p0_244, __p1_244, __p2_244, __p3_244) __extension__ ({ \46614#define vqrdmlshq_laneq_s16(__p0_336, __p1_336, __p2_336, __p3_336) __extension__ ({ \
44879 int16x8_t __s0_244 = __p0_244; \46615 int16x8_t __s0_336 = __p0_336; \
44880 int16x8_t __s1_244 = __p1_244; \46616 int16x8_t __s1_336 = __p1_336; \
44881 int16x8_t __s2_244 = __p2_244; \46617 int16x8_t __s2_336 = __p2_336; \
44882 int16x8_t __rev0_244; __rev0_244 = __builtin_shufflevector(__s0_244, __s0_244, 7, 6, 5, 4, 3, 2, 1, 0); \46618 int16x8_t __rev0_336; __rev0_336 = __builtin_shufflevector(__s0_336, __s0_336, 7, 6, 5, 4, 3, 2, 1, 0); \
44883 int16x8_t __rev1_244; __rev1_244 = __builtin_shufflevector(__s1_244, __s1_244, 7, 6, 5, 4, 3, 2, 1, 0); \46619 int16x8_t __rev1_336; __rev1_336 = __builtin_shufflevector(__s1_336, __s1_336, 7, 6, 5, 4, 3, 2, 1, 0); \
44884 int16x8_t __rev2_244; __rev2_244 = __builtin_shufflevector(__s2_244, __s2_244, 7, 6, 5, 4, 3, 2, 1, 0); \46620 int16x8_t __rev2_336; __rev2_336 = __builtin_shufflevector(__s2_336, __s2_336, 7, 6, 5, 4, 3, 2, 1, 0); \
44885 int16x8_t __ret_244; \46621 int16x8_t __ret_336; \
44886 __ret_244 = __noswap_vqsubq_s16(__rev0_244, __noswap_vqrdmulhq_s16(__rev1_244, __noswap_splatq_laneq_s16(__rev2_244, __p3_244))); \46622 __ret_336 = __noswap_vqsubq_s16(__rev0_336, __noswap_vqrdmulhq_s16(__rev1_336, __noswap_splatq_laneq_s16(__rev2_336, __p3_336))); \
44887 __ret_244 = __builtin_shufflevector(__ret_244, __ret_244, 7, 6, 5, 4, 3, 2, 1, 0); \46623 __ret_336 = __builtin_shufflevector(__ret_336, __ret_336, 7, 6, 5, 4, 3, 2, 1, 0); \
44888 __ret_244; \46624 __ret_336; \
44889})46625})
44890#endif46626#endif
4489146627
44892#ifdef __LITTLE_ENDIAN__46628#ifdef __LITTLE_ENDIAN__
44893#define vqrdmlsh_laneq_s32(__p0_245, __p1_245, __p2_245, __p3_245) __extension__ ({ \46629#define vqrdmlsh_laneq_s32(__p0_337, __p1_337, __p2_337, __p3_337) __extension__ ({ \
44894 int32x2_t __s0_245 = __p0_245; \46630 int32x2_t __s0_337 = __p0_337; \
44895 int32x2_t __s1_245 = __p1_245; \46631 int32x2_t __s1_337 = __p1_337; \
44896 int32x4_t __s2_245 = __p2_245; \46632 int32x4_t __s2_337 = __p2_337; \
44897 int32x2_t __ret_245; \46633 int32x2_t __ret_337; \
44898 __ret_245 = vqsub_s32(__s0_245, vqrdmulh_s32(__s1_245, splat_laneq_s32(__s2_245, __p3_245))); \46634 __ret_337 = vqsub_s32(__s0_337, vqrdmulh_s32(__s1_337, splat_laneq_s32(__s2_337, __p3_337))); \
44899 __ret_245; \46635 __ret_337; \
44900})46636})
44901#else46637#else
44902#define vqrdmlsh_laneq_s32(__p0_246, __p1_246, __p2_246, __p3_246) __extension__ ({ \46638#define vqrdmlsh_laneq_s32(__p0_338, __p1_338, __p2_338, __p3_338) __extension__ ({ \
44903 int32x2_t __s0_246 = __p0_246; \46639 int32x2_t __s0_338 = __p0_338; \
44904 int32x2_t __s1_246 = __p1_246; \46640 int32x2_t __s1_338 = __p1_338; \
44905 int32x4_t __s2_246 = __p2_246; \46641 int32x4_t __s2_338 = __p2_338; \
44906 int32x2_t __rev0_246; __rev0_246 = __builtin_shufflevector(__s0_246, __s0_246, 1, 0); \46642 int32x2_t __rev0_338; __rev0_338 = __builtin_shufflevector(__s0_338, __s0_338, 1, 0); \
44907 int32x2_t __rev1_246; __rev1_246 = __builtin_shufflevector(__s1_246, __s1_246, 1, 0); \46643 int32x2_t __rev1_338; __rev1_338 = __builtin_shufflevector(__s1_338, __s1_338, 1, 0); \
44908 int32x4_t __rev2_246; __rev2_246 = __builtin_shufflevector(__s2_246, __s2_246, 3, 2, 1, 0); \46644 int32x4_t __rev2_338; __rev2_338 = __builtin_shufflevector(__s2_338, __s2_338, 3, 2, 1, 0); \
44909 int32x2_t __ret_246; \46645 int32x2_t __ret_338; \
44910 __ret_246 = __noswap_vqsub_s32(__rev0_246, __noswap_vqrdmulh_s32(__rev1_246, __noswap_splat_laneq_s32(__rev2_246, __p3_246))); \46646 __ret_338 = __noswap_vqsub_s32(__rev0_338, __noswap_vqrdmulh_s32(__rev1_338, __noswap_splat_laneq_s32(__rev2_338, __p3_338))); \
44911 __ret_246 = __builtin_shufflevector(__ret_246, __ret_246, 1, 0); \46647 __ret_338 = __builtin_shufflevector(__ret_338, __ret_338, 1, 0); \
44912 __ret_246; \46648 __ret_338; \
44913})46649})
44914#endif46650#endif
4491546651
44916#ifdef __LITTLE_ENDIAN__46652#ifdef __LITTLE_ENDIAN__
44917#define vqrdmlsh_laneq_s16(__p0_247, __p1_247, __p2_247, __p3_247) __extension__ ({ \46653#define vqrdmlsh_laneq_s16(__p0_339, __p1_339, __p2_339, __p3_339) __extension__ ({ \
44918 int16x4_t __s0_247 = __p0_247; \46654 int16x4_t __s0_339 = __p0_339; \
44919 int16x4_t __s1_247 = __p1_247; \46655 int16x4_t __s1_339 = __p1_339; \
44920 int16x8_t __s2_247 = __p2_247; \46656 int16x8_t __s2_339 = __p2_339; \
44921 int16x4_t __ret_247; \46657 int16x4_t __ret_339; \
44922 __ret_247 = vqsub_s16(__s0_247, vqrdmulh_s16(__s1_247, splat_laneq_s16(__s2_247, __p3_247))); \46658 __ret_339 = vqsub_s16(__s0_339, vqrdmulh_s16(__s1_339, splat_laneq_s16(__s2_339, __p3_339))); \
44923 __ret_247; \46659 __ret_339; \
44924})46660})
44925#else46661#else
44926#define vqrdmlsh_laneq_s16(__p0_248, __p1_248, __p2_248, __p3_248) __extension__ ({ \46662#define vqrdmlsh_laneq_s16(__p0_340, __p1_340, __p2_340, __p3_340) __extension__ ({ \
44927 int16x4_t __s0_248 = __p0_248; \46663 int16x4_t __s0_340 = __p0_340; \
44928 int16x4_t __s1_248 = __p1_248; \46664 int16x4_t __s1_340 = __p1_340; \
44929 int16x8_t __s2_248 = __p2_248; \46665 int16x8_t __s2_340 = __p2_340; \
44930 int16x4_t __rev0_248; __rev0_248 = __builtin_shufflevector(__s0_248, __s0_248, 3, 2, 1, 0); \46666 int16x4_t __rev0_340; __rev0_340 = __builtin_shufflevector(__s0_340, __s0_340, 3, 2, 1, 0); \
44931 int16x4_t __rev1_248; __rev1_248 = __builtin_shufflevector(__s1_248, __s1_248, 3, 2, 1, 0); \46667 int16x4_t __rev1_340; __rev1_340 = __builtin_shufflevector(__s1_340, __s1_340, 3, 2, 1, 0); \
44932 int16x8_t __rev2_248; __rev2_248 = __builtin_shufflevector(__s2_248, __s2_248, 7, 6, 5, 4, 3, 2, 1, 0); \46668 int16x8_t __rev2_340; __rev2_340 = __builtin_shufflevector(__s2_340, __s2_340, 7, 6, 5, 4, 3, 2, 1, 0); \
44933 int16x4_t __ret_248; \46669 int16x4_t __ret_340; \
44934 __ret_248 = __noswap_vqsub_s16(__rev0_248, __noswap_vqrdmulh_s16(__rev1_248, __noswap_splat_laneq_s16(__rev2_248, __p3_248))); \46670 __ret_340 = __noswap_vqsub_s16(__rev0_340, __noswap_vqrdmulh_s16(__rev1_340, __noswap_splat_laneq_s16(__rev2_340, __p3_340))); \
44935 __ret_248 = __builtin_shufflevector(__ret_248, __ret_248, 3, 2, 1, 0); \46671 __ret_340 = __builtin_shufflevector(__ret_340, __ret_340, 3, 2, 1, 0); \
44936 __ret_248; \46672 __ret_340; \
44937})46673})
44938#endif46674#endif
4493946675
...@@ -45860,9 +47596,9 @@ __ai uint64_t vceqd_u64(uint64_t __p0, uint64_t __p1) {...@@ -45860,9 +47596,9 @@ __ai uint64_t vceqd_u64(uint64_t __p0, uint64_t __p1) {
45860 __ret = (uint64_t) __builtin_neon_vceqd_u64(__p0, __p1);47596 __ret = (uint64_t) __builtin_neon_vceqd_u64(__p0, __p1);
45861 return __ret;47597 return __ret;
45862}47598}
45863__ai int64_t vceqd_s64(int64_t __p0, int64_t __p1) {47599__ai uint64_t vceqd_s64(int64_t __p0, int64_t __p1) {
45864 int64_t __ret;47600 uint64_t __ret;
45865 __ret = (int64_t) __builtin_neon_vceqd_s64(__p0, __p1);47601 __ret = (uint64_t) __builtin_neon_vceqd_s64(__p0, __p1);
45866 return __ret;47602 return __ret;
45867}47603}
45868__ai uint64_t vceqd_f64(float64_t __p0, float64_t __p1) {47604__ai uint64_t vceqd_f64(float64_t __p0, float64_t __p1) {
...@@ -45881,37 +47617,21 @@ __ai uint8x8_t vceqz_p8(poly8x8_t __p0) {...@@ -45881,37 +47617,21 @@ __ai uint8x8_t vceqz_p8(poly8x8_t __p0) {
45881 __ret = (uint8x8_t) __builtin_neon_vceqz_v((int8x8_t)__p0, 16);47617 __ret = (uint8x8_t) __builtin_neon_vceqz_v((int8x8_t)__p0, 16);
45882 return __ret;47618 return __ret;
45883}47619}
45884#else47620#else
45885__ai uint8x8_t vceqz_p8(poly8x8_t __p0) {47621__ai uint8x8_t vceqz_p8(poly8x8_t __p0) {
45886 poly8x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);47622 poly8x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);
45887 uint8x8_t __ret;47623 uint8x8_t __ret;
45888 __ret = (uint8x8_t) __builtin_neon_vceqz_v((int8x8_t)__rev0, 16);47624 __ret = (uint8x8_t) __builtin_neon_vceqz_v((int8x8_t)__rev0, 16);
45889 __ret = __builtin_shufflevector(__ret, __ret, 7, 6, 5, 4, 3, 2, 1, 0);47625 __ret = __builtin_shufflevector(__ret, __ret, 7, 6, 5, 4, 3, 2, 1, 0);
45890 return __ret;
45891}
45892#endif
45893
45894__ai uint64x1_t vceqz_p64(poly64x1_t __p0) {
45895 uint64x1_t __ret;
45896 __ret = (uint64x1_t) __builtin_neon_vceqz_v((int8x8_t)__p0, 19);
45897 return __ret;
45898}
45899#ifdef __LITTLE_ENDIAN__
45900__ai uint16x4_t vceqz_p16(poly16x4_t __p0) {
45901 uint16x4_t __ret;
45902 __ret = (uint16x4_t) __builtin_neon_vceqz_v((int8x8_t)__p0, 17);
45903 return __ret;
45904}
45905#else
45906__ai uint16x4_t vceqz_p16(poly16x4_t __p0) {
45907 poly16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
45908 uint16x4_t __ret;
45909 __ret = (uint16x4_t) __builtin_neon_vceqz_v((int8x8_t)__rev0, 17);
45910 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);
45911 return __ret;47626 return __ret;
45912}47627}
45913#endif47628#endif
4591447629
47630__ai uint64x1_t vceqz_p64(poly64x1_t __p0) {
47631 uint64x1_t __ret;
47632 __ret = (uint64x1_t) __builtin_neon_vceqz_v((int8x8_t)__p0, 19);
47633 return __ret;
47634}
45915#ifdef __LITTLE_ENDIAN__47635#ifdef __LITTLE_ENDIAN__
45916__ai uint8x16_t vceqzq_p8(poly8x16_t __p0) {47636__ai uint8x16_t vceqzq_p8(poly8x16_t __p0) {
45917 uint8x16_t __ret;47637 uint8x16_t __ret;
...@@ -45944,22 +47664,6 @@ __ai uint64x2_t vceqzq_p64(poly64x2_t __p0) {...@@ -45944,22 +47664,6 @@ __ai uint64x2_t vceqzq_p64(poly64x2_t __p0) {
45944}47664}
45945#endif47665#endif
4594647666
45947#ifdef __LITTLE_ENDIAN__
45948__ai uint16x8_t vceqzq_p16(poly16x8_t __p0) {
45949 uint16x8_t __ret;
45950 __ret = (uint16x8_t) __builtin_neon_vceqzq_v((int8x16_t)__p0, 49);
45951 return __ret;
45952}
45953#else
45954__ai uint16x8_t vceqzq_p16(poly16x8_t __p0) {
45955 poly16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);
45956 uint16x8_t __ret;
45957 __ret = (uint16x8_t) __builtin_neon_vceqzq_v((int8x16_t)__rev0, 49);
45958 __ret = __builtin_shufflevector(__ret, __ret, 7, 6, 5, 4, 3, 2, 1, 0);
45959 return __ret;
45960}
45961#endif
45962
45963#ifdef __LITTLE_ENDIAN__47667#ifdef __LITTLE_ENDIAN__
45964__ai uint8x16_t vceqzq_u8(uint8x16_t __p0) {47668__ai uint8x16_t vceqzq_u8(uint8x16_t __p0) {
45965 uint8x16_t __ret;47669 uint8x16_t __ret;
...@@ -46252,9 +47956,9 @@ __ai uint64_t vceqzd_u64(uint64_t __p0) {...@@ -46252,9 +47956,9 @@ __ai uint64_t vceqzd_u64(uint64_t __p0) {
46252 __ret = (uint64_t) __builtin_neon_vceqzd_u64(__p0);47956 __ret = (uint64_t) __builtin_neon_vceqzd_u64(__p0);
46253 return __ret;47957 return __ret;
46254}47958}
46255__ai int64_t vceqzd_s64(int64_t __p0) {47959__ai uint64_t vceqzd_s64(int64_t __p0) {
46256 int64_t __ret;47960 uint64_t __ret;
46257 __ret = (int64_t) __builtin_neon_vceqzd_s64(__p0);47961 __ret = (uint64_t) __builtin_neon_vceqzd_s64(__p0);
46258 return __ret;47962 return __ret;
46259}47963}
46260__ai uint64_t vceqzd_f64(float64_t __p0) {47964__ai uint64_t vceqzd_f64(float64_t __p0) {
...@@ -46333,9 +48037,9 @@ __ai uint64x1_t vcge_s64(int64x1_t __p0, int64x1_t __p1) {...@@ -46333,9 +48037,9 @@ __ai uint64x1_t vcge_s64(int64x1_t __p0, int64x1_t __p1) {
46333 __ret = (uint64x1_t)(__p0 >= __p1);48037 __ret = (uint64x1_t)(__p0 >= __p1);
46334 return __ret;48038 return __ret;
46335}48039}
46336__ai int64_t vcged_s64(int64_t __p0, int64_t __p1) {48040__ai uint64_t vcged_s64(int64_t __p0, int64_t __p1) {
46337 int64_t __ret;48041 uint64_t __ret;
46338 __ret = (int64_t) __builtin_neon_vcged_s64(__p0, __p1);48042 __ret = (uint64_t) __builtin_neon_vcged_s64(__p0, __p1);
46339 return __ret;48043 return __ret;
46340}48044}
46341__ai uint64_t vcged_u64(uint64_t __p0, uint64_t __p1) {48045__ai uint64_t vcged_u64(uint64_t __p0, uint64_t __p1) {
...@@ -46523,9 +48227,9 @@ __ai uint16x4_t vcgez_s16(int16x4_t __p0) {...@@ -46523,9 +48227,9 @@ __ai uint16x4_t vcgez_s16(int16x4_t __p0) {
46523}48227}
46524#endif48228#endif
4652548229
46526__ai int64_t vcgezd_s64(int64_t __p0) {48230__ai uint64_t vcgezd_s64(int64_t __p0) {
46527 int64_t __ret;48231 uint64_t __ret;
46528 __ret = (int64_t) __builtin_neon_vcgezd_s64(__p0);48232 __ret = (uint64_t) __builtin_neon_vcgezd_s64(__p0);
46529 return __ret;48233 return __ret;
46530}48234}
46531__ai uint64_t vcgezd_f64(float64_t __p0) {48235__ai uint64_t vcgezd_f64(float64_t __p0) {
...@@ -46604,9 +48308,9 @@ __ai uint64x1_t vcgt_s64(int64x1_t __p0, int64x1_t __p1) {...@@ -46604,9 +48308,9 @@ __ai uint64x1_t vcgt_s64(int64x1_t __p0, int64x1_t __p1) {
46604 __ret = (uint64x1_t)(__p0 > __p1);48308 __ret = (uint64x1_t)(__p0 > __p1);
46605 return __ret;48309 return __ret;
46606}48310}
46607__ai int64_t vcgtd_s64(int64_t __p0, int64_t __p1) {48311__ai uint64_t vcgtd_s64(int64_t __p0, int64_t __p1) {
46608 int64_t __ret;48312 uint64_t __ret;
46609 __ret = (int64_t) __builtin_neon_vcgtd_s64(__p0, __p1);48313 __ret = (uint64_t) __builtin_neon_vcgtd_s64(__p0, __p1);
46610 return __ret;48314 return __ret;
46611}48315}
46612__ai uint64_t vcgtd_u64(uint64_t __p0, uint64_t __p1) {48316__ai uint64_t vcgtd_u64(uint64_t __p0, uint64_t __p1) {
...@@ -46794,9 +48498,9 @@ __ai uint16x4_t vcgtz_s16(int16x4_t __p0) {...@@ -46794,9 +48498,9 @@ __ai uint16x4_t vcgtz_s16(int16x4_t __p0) {
46794}48498}
46795#endif48499#endif
4679648500
46797__ai int64_t vcgtzd_s64(int64_t __p0) {48501__ai uint64_t vcgtzd_s64(int64_t __p0) {
46798 int64_t __ret;48502 uint64_t __ret;
46799 __ret = (int64_t) __builtin_neon_vcgtzd_s64(__p0);48503 __ret = (uint64_t) __builtin_neon_vcgtzd_s64(__p0);
46800 return __ret;48504 return __ret;
46801}48505}
46802__ai uint64_t vcgtzd_f64(float64_t __p0) {48506__ai uint64_t vcgtzd_f64(float64_t __p0) {
...@@ -46880,9 +48584,9 @@ __ai uint64_t vcled_u64(uint64_t __p0, uint64_t __p1) {...@@ -46880,9 +48584,9 @@ __ai uint64_t vcled_u64(uint64_t __p0, uint64_t __p1) {
46880 __ret = (uint64_t) __builtin_neon_vcled_u64(__p0, __p1);48584 __ret = (uint64_t) __builtin_neon_vcled_u64(__p0, __p1);
46881 return __ret;48585 return __ret;
46882}48586}
46883__ai int64_t vcled_s64(int64_t __p0, int64_t __p1) {48587__ai uint64_t vcled_s64(int64_t __p0, int64_t __p1) {
46884 int64_t __ret;48588 uint64_t __ret;
46885 __ret = (int64_t) __builtin_neon_vcled_s64(__p0, __p1);48589 __ret = (uint64_t) __builtin_neon_vcled_s64(__p0, __p1);
46886 return __ret;48590 return __ret;
46887}48591}
46888__ai uint64_t vcled_f64(float64_t __p0, float64_t __p1) {48592__ai uint64_t vcled_f64(float64_t __p0, float64_t __p1) {
...@@ -47065,9 +48769,9 @@ __ai uint16x4_t vclez_s16(int16x4_t __p0) {...@@ -47065,9 +48769,9 @@ __ai uint16x4_t vclez_s16(int16x4_t __p0) {
47065}48769}
47066#endif48770#endif
4706748771
47068__ai int64_t vclezd_s64(int64_t __p0) {48772__ai uint64_t vclezd_s64(int64_t __p0) {
47069 int64_t __ret;48773 uint64_t __ret;
47070 __ret = (int64_t) __builtin_neon_vclezd_s64(__p0);48774 __ret = (uint64_t) __builtin_neon_vclezd_s64(__p0);
47071 return __ret;48775 return __ret;
47072}48776}
47073__ai uint64_t vclezd_f64(float64_t __p0) {48777__ai uint64_t vclezd_f64(float64_t __p0) {
...@@ -47151,9 +48855,9 @@ __ai uint64_t vcltd_u64(uint64_t __p0, uint64_t __p1) {...@@ -47151,9 +48855,9 @@ __ai uint64_t vcltd_u64(uint64_t __p0, uint64_t __p1) {
47151 __ret = (uint64_t) __builtin_neon_vcltd_u64(__p0, __p1);48855 __ret = (uint64_t) __builtin_neon_vcltd_u64(__p0, __p1);
47152 return __ret;48856 return __ret;
47153}48857}
47154__ai int64_t vcltd_s64(int64_t __p0, int64_t __p1) {48858__ai uint64_t vcltd_s64(int64_t __p0, int64_t __p1) {
47155 int64_t __ret;48859 uint64_t __ret;
47156 __ret = (int64_t) __builtin_neon_vcltd_s64(__p0, __p1);48860 __ret = (uint64_t) __builtin_neon_vcltd_s64(__p0, __p1);
47157 return __ret;48861 return __ret;
47158}48862}
47159__ai uint64_t vcltd_f64(float64_t __p0, float64_t __p1) {48863__ai uint64_t vcltd_f64(float64_t __p0, float64_t __p1) {
...@@ -47336,9 +49040,9 @@ __ai uint16x4_t vcltz_s16(int16x4_t __p0) {...@@ -47336,9 +49040,9 @@ __ai uint16x4_t vcltz_s16(int16x4_t __p0) {
47336}49040}
47337#endif49041#endif
4733849042
47339__ai int64_t vcltzd_s64(int64_t __p0) {49043__ai uint64_t vcltzd_s64(int64_t __p0) {
47340 int64_t __ret;49044 uint64_t __ret;
47341 __ret = (int64_t) __builtin_neon_vcltzd_s64(__p0);49045 __ret = (uint64_t) __builtin_neon_vcltzd_s64(__p0);
47342 return __ret;49046 return __ret;
47343}49047}
47344__ai uint64_t vcltzd_f64(float64_t __p0) {49048__ai uint64_t vcltzd_f64(float64_t __p0) {
...@@ -47382,892 +49086,892 @@ __ai float64x2_t vcombine_f64(float64x1_t __p0, float64x1_t __p1) {...@@ -47382,892 +49086,892 @@ __ai float64x2_t vcombine_f64(float64x1_t __p0, float64x1_t __p1) {
47382#endif49086#endif
4738349087
47384#ifdef __LITTLE_ENDIAN__49088#ifdef __LITTLE_ENDIAN__
47385#define vcopyq_lane_p8(__p0_249, __p1_249, __p2_249, __p3_249) __extension__ ({ \49089#define vcopyq_lane_p8(__p0_341, __p1_341, __p2_341, __p3_341) __extension__ ({ \
47386 poly8x16_t __s0_249 = __p0_249; \49090 poly8x16_t __s0_341 = __p0_341; \
47387 poly8x8_t __s2_249 = __p2_249; \49091 poly8x8_t __s2_341 = __p2_341; \
47388 poly8x16_t __ret_249; \49092 poly8x16_t __ret_341; \
47389 __ret_249 = vsetq_lane_p8(vget_lane_p8(__s2_249, __p3_249), __s0_249, __p1_249); \49093 __ret_341 = vsetq_lane_p8(vget_lane_p8(__s2_341, __p3_341), __s0_341, __p1_341); \
47390 __ret_249; \49094 __ret_341; \
47391})49095})
47392#else49096#else
47393#define vcopyq_lane_p8(__p0_250, __p1_250, __p2_250, __p3_250) __extension__ ({ \49097#define vcopyq_lane_p8(__p0_342, __p1_342, __p2_342, __p3_342) __extension__ ({ \
47394 poly8x16_t __s0_250 = __p0_250; \49098 poly8x16_t __s0_342 = __p0_342; \
47395 poly8x8_t __s2_250 = __p2_250; \49099 poly8x8_t __s2_342 = __p2_342; \
47396 poly8x16_t __rev0_250; __rev0_250 = __builtin_shufflevector(__s0_250, __s0_250, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49100 poly8x16_t __rev0_342; __rev0_342 = __builtin_shufflevector(__s0_342, __s0_342, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47397 poly8x8_t __rev2_250; __rev2_250 = __builtin_shufflevector(__s2_250, __s2_250, 7, 6, 5, 4, 3, 2, 1, 0); \49101 poly8x8_t __rev2_342; __rev2_342 = __builtin_shufflevector(__s2_342, __s2_342, 7, 6, 5, 4, 3, 2, 1, 0); \
47398 poly8x16_t __ret_250; \49102 poly8x16_t __ret_342; \
47399 __ret_250 = __noswap_vsetq_lane_p8(__noswap_vget_lane_p8(__rev2_250, __p3_250), __rev0_250, __p1_250); \49103 __ret_342 = __noswap_vsetq_lane_p8(__noswap_vget_lane_p8(__rev2_342, __p3_342), __rev0_342, __p1_342); \
47400 __ret_250 = __builtin_shufflevector(__ret_250, __ret_250, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49104 __ret_342 = __builtin_shufflevector(__ret_342, __ret_342, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47401 __ret_250; \49105 __ret_342; \
47402})49106})
47403#endif49107#endif
4740449108
47405#ifdef __LITTLE_ENDIAN__49109#ifdef __LITTLE_ENDIAN__
47406#define vcopyq_lane_p16(__p0_251, __p1_251, __p2_251, __p3_251) __extension__ ({ \49110#define vcopyq_lane_p16(__p0_343, __p1_343, __p2_343, __p3_343) __extension__ ({ \
47407 poly16x8_t __s0_251 = __p0_251; \49111 poly16x8_t __s0_343 = __p0_343; \
47408 poly16x4_t __s2_251 = __p2_251; \49112 poly16x4_t __s2_343 = __p2_343; \
47409 poly16x8_t __ret_251; \49113 poly16x8_t __ret_343; \
47410 __ret_251 = vsetq_lane_p16(vget_lane_p16(__s2_251, __p3_251), __s0_251, __p1_251); \49114 __ret_343 = vsetq_lane_p16(vget_lane_p16(__s2_343, __p3_343), __s0_343, __p1_343); \
47411 __ret_251; \49115 __ret_343; \
47412})49116})
47413#else49117#else
47414#define vcopyq_lane_p16(__p0_252, __p1_252, __p2_252, __p3_252) __extension__ ({ \49118#define vcopyq_lane_p16(__p0_344, __p1_344, __p2_344, __p3_344) __extension__ ({ \
47415 poly16x8_t __s0_252 = __p0_252; \49119 poly16x8_t __s0_344 = __p0_344; \
47416 poly16x4_t __s2_252 = __p2_252; \49120 poly16x4_t __s2_344 = __p2_344; \
47417 poly16x8_t __rev0_252; __rev0_252 = __builtin_shufflevector(__s0_252, __s0_252, 7, 6, 5, 4, 3, 2, 1, 0); \49121 poly16x8_t __rev0_344; __rev0_344 = __builtin_shufflevector(__s0_344, __s0_344, 7, 6, 5, 4, 3, 2, 1, 0); \
47418 poly16x4_t __rev2_252; __rev2_252 = __builtin_shufflevector(__s2_252, __s2_252, 3, 2, 1, 0); \49122 poly16x4_t __rev2_344; __rev2_344 = __builtin_shufflevector(__s2_344, __s2_344, 3, 2, 1, 0); \
47419 poly16x8_t __ret_252; \49123 poly16x8_t __ret_344; \
47420 __ret_252 = __noswap_vsetq_lane_p16(__noswap_vget_lane_p16(__rev2_252, __p3_252), __rev0_252, __p1_252); \49124 __ret_344 = __noswap_vsetq_lane_p16(__noswap_vget_lane_p16(__rev2_344, __p3_344), __rev0_344, __p1_344); \
47421 __ret_252 = __builtin_shufflevector(__ret_252, __ret_252, 7, 6, 5, 4, 3, 2, 1, 0); \49125 __ret_344 = __builtin_shufflevector(__ret_344, __ret_344, 7, 6, 5, 4, 3, 2, 1, 0); \
47422 __ret_252; \49126 __ret_344; \
47423})49127})
47424#endif49128#endif
4742549129
47426#ifdef __LITTLE_ENDIAN__49130#ifdef __LITTLE_ENDIAN__
47427#define vcopyq_lane_u8(__p0_253, __p1_253, __p2_253, __p3_253) __extension__ ({ \49131#define vcopyq_lane_u8(__p0_345, __p1_345, __p2_345, __p3_345) __extension__ ({ \
47428 uint8x16_t __s0_253 = __p0_253; \49132 uint8x16_t __s0_345 = __p0_345; \
47429 uint8x8_t __s2_253 = __p2_253; \49133 uint8x8_t __s2_345 = __p2_345; \
47430 uint8x16_t __ret_253; \49134 uint8x16_t __ret_345; \
47431 __ret_253 = vsetq_lane_u8(vget_lane_u8(__s2_253, __p3_253), __s0_253, __p1_253); \49135 __ret_345 = vsetq_lane_u8(vget_lane_u8(__s2_345, __p3_345), __s0_345, __p1_345); \
47432 __ret_253; \49136 __ret_345; \
47433})49137})
47434#else49138#else
47435#define vcopyq_lane_u8(__p0_254, __p1_254, __p2_254, __p3_254) __extension__ ({ \49139#define vcopyq_lane_u8(__p0_346, __p1_346, __p2_346, __p3_346) __extension__ ({ \
47436 uint8x16_t __s0_254 = __p0_254; \49140 uint8x16_t __s0_346 = __p0_346; \
47437 uint8x8_t __s2_254 = __p2_254; \49141 uint8x8_t __s2_346 = __p2_346; \
47438 uint8x16_t __rev0_254; __rev0_254 = __builtin_shufflevector(__s0_254, __s0_254, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49142 uint8x16_t __rev0_346; __rev0_346 = __builtin_shufflevector(__s0_346, __s0_346, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47439 uint8x8_t __rev2_254; __rev2_254 = __builtin_shufflevector(__s2_254, __s2_254, 7, 6, 5, 4, 3, 2, 1, 0); \49143 uint8x8_t __rev2_346; __rev2_346 = __builtin_shufflevector(__s2_346, __s2_346, 7, 6, 5, 4, 3, 2, 1, 0); \
47440 uint8x16_t __ret_254; \49144 uint8x16_t __ret_346; \
47441 __ret_254 = __noswap_vsetq_lane_u8(__noswap_vget_lane_u8(__rev2_254, __p3_254), __rev0_254, __p1_254); \49145 __ret_346 = __noswap_vsetq_lane_u8(__noswap_vget_lane_u8(__rev2_346, __p3_346), __rev0_346, __p1_346); \
47442 __ret_254 = __builtin_shufflevector(__ret_254, __ret_254, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49146 __ret_346 = __builtin_shufflevector(__ret_346, __ret_346, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47443 __ret_254; \49147 __ret_346; \
47444})49148})
47445#endif49149#endif
4744649150
47447#ifdef __LITTLE_ENDIAN__49151#ifdef __LITTLE_ENDIAN__
47448#define vcopyq_lane_u32(__p0_255, __p1_255, __p2_255, __p3_255) __extension__ ({ \49152#define vcopyq_lane_u32(__p0_347, __p1_347, __p2_347, __p3_347) __extension__ ({ \
47449 uint32x4_t __s0_255 = __p0_255; \49153 uint32x4_t __s0_347 = __p0_347; \
47450 uint32x2_t __s2_255 = __p2_255; \49154 uint32x2_t __s2_347 = __p2_347; \
47451 uint32x4_t __ret_255; \49155 uint32x4_t __ret_347; \
47452 __ret_255 = vsetq_lane_u32(vget_lane_u32(__s2_255, __p3_255), __s0_255, __p1_255); \49156 __ret_347 = vsetq_lane_u32(vget_lane_u32(__s2_347, __p3_347), __s0_347, __p1_347); \
47453 __ret_255; \49157 __ret_347; \
47454})49158})
47455#else49159#else
47456#define vcopyq_lane_u32(__p0_256, __p1_256, __p2_256, __p3_256) __extension__ ({ \49160#define vcopyq_lane_u32(__p0_348, __p1_348, __p2_348, __p3_348) __extension__ ({ \
47457 uint32x4_t __s0_256 = __p0_256; \49161 uint32x4_t __s0_348 = __p0_348; \
47458 uint32x2_t __s2_256 = __p2_256; \49162 uint32x2_t __s2_348 = __p2_348; \
47459 uint32x4_t __rev0_256; __rev0_256 = __builtin_shufflevector(__s0_256, __s0_256, 3, 2, 1, 0); \49163 uint32x4_t __rev0_348; __rev0_348 = __builtin_shufflevector(__s0_348, __s0_348, 3, 2, 1, 0); \
47460 uint32x2_t __rev2_256; __rev2_256 = __builtin_shufflevector(__s2_256, __s2_256, 1, 0); \49164 uint32x2_t __rev2_348; __rev2_348 = __builtin_shufflevector(__s2_348, __s2_348, 1, 0); \
47461 uint32x4_t __ret_256; \49165 uint32x4_t __ret_348; \
47462 __ret_256 = __noswap_vsetq_lane_u32(__noswap_vget_lane_u32(__rev2_256, __p3_256), __rev0_256, __p1_256); \49166 __ret_348 = __noswap_vsetq_lane_u32(__noswap_vget_lane_u32(__rev2_348, __p3_348), __rev0_348, __p1_348); \
47463 __ret_256 = __builtin_shufflevector(__ret_256, __ret_256, 3, 2, 1, 0); \49167 __ret_348 = __builtin_shufflevector(__ret_348, __ret_348, 3, 2, 1, 0); \
47464 __ret_256; \49168 __ret_348; \
47465})49169})
47466#endif49170#endif
4746749171
47468#ifdef __LITTLE_ENDIAN__49172#ifdef __LITTLE_ENDIAN__
47469#define vcopyq_lane_u64(__p0_257, __p1_257, __p2_257, __p3_257) __extension__ ({ \49173#define vcopyq_lane_u64(__p0_349, __p1_349, __p2_349, __p3_349) __extension__ ({ \
47470 uint64x2_t __s0_257 = __p0_257; \49174 uint64x2_t __s0_349 = __p0_349; \
47471 uint64x1_t __s2_257 = __p2_257; \49175 uint64x1_t __s2_349 = __p2_349; \
47472 uint64x2_t __ret_257; \49176 uint64x2_t __ret_349; \
47473 __ret_257 = vsetq_lane_u64(vget_lane_u64(__s2_257, __p3_257), __s0_257, __p1_257); \49177 __ret_349 = vsetq_lane_u64(vget_lane_u64(__s2_349, __p3_349), __s0_349, __p1_349); \
47474 __ret_257; \49178 __ret_349; \
47475})49179})
47476#else49180#else
47477#define vcopyq_lane_u64(__p0_258, __p1_258, __p2_258, __p3_258) __extension__ ({ \49181#define vcopyq_lane_u64(__p0_350, __p1_350, __p2_350, __p3_350) __extension__ ({ \
47478 uint64x2_t __s0_258 = __p0_258; \49182 uint64x2_t __s0_350 = __p0_350; \
47479 uint64x1_t __s2_258 = __p2_258; \49183 uint64x1_t __s2_350 = __p2_350; \
47480 uint64x2_t __rev0_258; __rev0_258 = __builtin_shufflevector(__s0_258, __s0_258, 1, 0); \49184 uint64x2_t __rev0_350; __rev0_350 = __builtin_shufflevector(__s0_350, __s0_350, 1, 0); \
47481 uint64x2_t __ret_258; \49185 uint64x2_t __ret_350; \
47482 __ret_258 = __noswap_vsetq_lane_u64(vget_lane_u64(__s2_258, __p3_258), __rev0_258, __p1_258); \49186 __ret_350 = __noswap_vsetq_lane_u64(vget_lane_u64(__s2_350, __p3_350), __rev0_350, __p1_350); \
47483 __ret_258 = __builtin_shufflevector(__ret_258, __ret_258, 1, 0); \49187 __ret_350 = __builtin_shufflevector(__ret_350, __ret_350, 1, 0); \
47484 __ret_258; \49188 __ret_350; \
47485})49189})
47486#endif49190#endif
4748749191
47488#ifdef __LITTLE_ENDIAN__49192#ifdef __LITTLE_ENDIAN__
47489#define vcopyq_lane_u16(__p0_259, __p1_259, __p2_259, __p3_259) __extension__ ({ \49193#define vcopyq_lane_u16(__p0_351, __p1_351, __p2_351, __p3_351) __extension__ ({ \
47490 uint16x8_t __s0_259 = __p0_259; \49194 uint16x8_t __s0_351 = __p0_351; \
47491 uint16x4_t __s2_259 = __p2_259; \49195 uint16x4_t __s2_351 = __p2_351; \
47492 uint16x8_t __ret_259; \49196 uint16x8_t __ret_351; \
47493 __ret_259 = vsetq_lane_u16(vget_lane_u16(__s2_259, __p3_259), __s0_259, __p1_259); \49197 __ret_351 = vsetq_lane_u16(vget_lane_u16(__s2_351, __p3_351), __s0_351, __p1_351); \
47494 __ret_259; \49198 __ret_351; \
47495})49199})
47496#else49200#else
47497#define vcopyq_lane_u16(__p0_260, __p1_260, __p2_260, __p3_260) __extension__ ({ \49201#define vcopyq_lane_u16(__p0_352, __p1_352, __p2_352, __p3_352) __extension__ ({ \
47498 uint16x8_t __s0_260 = __p0_260; \49202 uint16x8_t __s0_352 = __p0_352; \
47499 uint16x4_t __s2_260 = __p2_260; \49203 uint16x4_t __s2_352 = __p2_352; \
47500 uint16x8_t __rev0_260; __rev0_260 = __builtin_shufflevector(__s0_260, __s0_260, 7, 6, 5, 4, 3, 2, 1, 0); \49204 uint16x8_t __rev0_352; __rev0_352 = __builtin_shufflevector(__s0_352, __s0_352, 7, 6, 5, 4, 3, 2, 1, 0); \
47501 uint16x4_t __rev2_260; __rev2_260 = __builtin_shufflevector(__s2_260, __s2_260, 3, 2, 1, 0); \49205 uint16x4_t __rev2_352; __rev2_352 = __builtin_shufflevector(__s2_352, __s2_352, 3, 2, 1, 0); \
47502 uint16x8_t __ret_260; \49206 uint16x8_t __ret_352; \
47503 __ret_260 = __noswap_vsetq_lane_u16(__noswap_vget_lane_u16(__rev2_260, __p3_260), __rev0_260, __p1_260); \49207 __ret_352 = __noswap_vsetq_lane_u16(__noswap_vget_lane_u16(__rev2_352, __p3_352), __rev0_352, __p1_352); \
47504 __ret_260 = __builtin_shufflevector(__ret_260, __ret_260, 7, 6, 5, 4, 3, 2, 1, 0); \49208 __ret_352 = __builtin_shufflevector(__ret_352, __ret_352, 7, 6, 5, 4, 3, 2, 1, 0); \
47505 __ret_260; \49209 __ret_352; \
47506})49210})
47507#endif49211#endif
4750849212
47509#ifdef __LITTLE_ENDIAN__49213#ifdef __LITTLE_ENDIAN__
47510#define vcopyq_lane_s8(__p0_261, __p1_261, __p2_261, __p3_261) __extension__ ({ \49214#define vcopyq_lane_s8(__p0_353, __p1_353, __p2_353, __p3_353) __extension__ ({ \
47511 int8x16_t __s0_261 = __p0_261; \49215 int8x16_t __s0_353 = __p0_353; \
47512 int8x8_t __s2_261 = __p2_261; \49216 int8x8_t __s2_353 = __p2_353; \
47513 int8x16_t __ret_261; \49217 int8x16_t __ret_353; \
47514 __ret_261 = vsetq_lane_s8(vget_lane_s8(__s2_261, __p3_261), __s0_261, __p1_261); \49218 __ret_353 = vsetq_lane_s8(vget_lane_s8(__s2_353, __p3_353), __s0_353, __p1_353); \
47515 __ret_261; \49219 __ret_353; \
47516})49220})
47517#else49221#else
47518#define vcopyq_lane_s8(__p0_262, __p1_262, __p2_262, __p3_262) __extension__ ({ \49222#define vcopyq_lane_s8(__p0_354, __p1_354, __p2_354, __p3_354) __extension__ ({ \
47519 int8x16_t __s0_262 = __p0_262; \49223 int8x16_t __s0_354 = __p0_354; \
47520 int8x8_t __s2_262 = __p2_262; \49224 int8x8_t __s2_354 = __p2_354; \
47521 int8x16_t __rev0_262; __rev0_262 = __builtin_shufflevector(__s0_262, __s0_262, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49225 int8x16_t __rev0_354; __rev0_354 = __builtin_shufflevector(__s0_354, __s0_354, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47522 int8x8_t __rev2_262; __rev2_262 = __builtin_shufflevector(__s2_262, __s2_262, 7, 6, 5, 4, 3, 2, 1, 0); \49226 int8x8_t __rev2_354; __rev2_354 = __builtin_shufflevector(__s2_354, __s2_354, 7, 6, 5, 4, 3, 2, 1, 0); \
47523 int8x16_t __ret_262; \49227 int8x16_t __ret_354; \
47524 __ret_262 = __noswap_vsetq_lane_s8(__noswap_vget_lane_s8(__rev2_262, __p3_262), __rev0_262, __p1_262); \49228 __ret_354 = __noswap_vsetq_lane_s8(__noswap_vget_lane_s8(__rev2_354, __p3_354), __rev0_354, __p1_354); \
47525 __ret_262 = __builtin_shufflevector(__ret_262, __ret_262, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49229 __ret_354 = __builtin_shufflevector(__ret_354, __ret_354, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47526 __ret_262; \49230 __ret_354; \
47527})49231})
47528#endif49232#endif
4752949233
47530#ifdef __LITTLE_ENDIAN__49234#ifdef __LITTLE_ENDIAN__
47531#define vcopyq_lane_f32(__p0_263, __p1_263, __p2_263, __p3_263) __extension__ ({ \49235#define vcopyq_lane_f32(__p0_355, __p1_355, __p2_355, __p3_355) __extension__ ({ \
47532 float32x4_t __s0_263 = __p0_263; \49236 float32x4_t __s0_355 = __p0_355; \
47533 float32x2_t __s2_263 = __p2_263; \49237 float32x2_t __s2_355 = __p2_355; \
47534 float32x4_t __ret_263; \49238 float32x4_t __ret_355; \
47535 __ret_263 = vsetq_lane_f32(vget_lane_f32(__s2_263, __p3_263), __s0_263, __p1_263); \49239 __ret_355 = vsetq_lane_f32(vget_lane_f32(__s2_355, __p3_355), __s0_355, __p1_355); \
47536 __ret_263; \49240 __ret_355; \
47537})49241})
47538#else49242#else
47539#define vcopyq_lane_f32(__p0_264, __p1_264, __p2_264, __p3_264) __extension__ ({ \49243#define vcopyq_lane_f32(__p0_356, __p1_356, __p2_356, __p3_356) __extension__ ({ \
47540 float32x4_t __s0_264 = __p0_264; \49244 float32x4_t __s0_356 = __p0_356; \
47541 float32x2_t __s2_264 = __p2_264; \49245 float32x2_t __s2_356 = __p2_356; \
47542 float32x4_t __rev0_264; __rev0_264 = __builtin_shufflevector(__s0_264, __s0_264, 3, 2, 1, 0); \49246 float32x4_t __rev0_356; __rev0_356 = __builtin_shufflevector(__s0_356, __s0_356, 3, 2, 1, 0); \
47543 float32x2_t __rev2_264; __rev2_264 = __builtin_shufflevector(__s2_264, __s2_264, 1, 0); \49247 float32x2_t __rev2_356; __rev2_356 = __builtin_shufflevector(__s2_356, __s2_356, 1, 0); \
47544 float32x4_t __ret_264; \49248 float32x4_t __ret_356; \
47545 __ret_264 = __noswap_vsetq_lane_f32(__noswap_vget_lane_f32(__rev2_264, __p3_264), __rev0_264, __p1_264); \49249 __ret_356 = __noswap_vsetq_lane_f32(__noswap_vget_lane_f32(__rev2_356, __p3_356), __rev0_356, __p1_356); \
47546 __ret_264 = __builtin_shufflevector(__ret_264, __ret_264, 3, 2, 1, 0); \49250 __ret_356 = __builtin_shufflevector(__ret_356, __ret_356, 3, 2, 1, 0); \
47547 __ret_264; \49251 __ret_356; \
47548})49252})
47549#endif49253#endif
4755049254
47551#ifdef __LITTLE_ENDIAN__49255#ifdef __LITTLE_ENDIAN__
47552#define vcopyq_lane_s32(__p0_265, __p1_265, __p2_265, __p3_265) __extension__ ({ \49256#define vcopyq_lane_s32(__p0_357, __p1_357, __p2_357, __p3_357) __extension__ ({ \
47553 int32x4_t __s0_265 = __p0_265; \49257 int32x4_t __s0_357 = __p0_357; \
47554 int32x2_t __s2_265 = __p2_265; \49258 int32x2_t __s2_357 = __p2_357; \
47555 int32x4_t __ret_265; \49259 int32x4_t __ret_357; \
47556 __ret_265 = vsetq_lane_s32(vget_lane_s32(__s2_265, __p3_265), __s0_265, __p1_265); \49260 __ret_357 = vsetq_lane_s32(vget_lane_s32(__s2_357, __p3_357), __s0_357, __p1_357); \
47557 __ret_265; \49261 __ret_357; \
47558})49262})
47559#else49263#else
47560#define vcopyq_lane_s32(__p0_266, __p1_266, __p2_266, __p3_266) __extension__ ({ \49264#define vcopyq_lane_s32(__p0_358, __p1_358, __p2_358, __p3_358) __extension__ ({ \
47561 int32x4_t __s0_266 = __p0_266; \49265 int32x4_t __s0_358 = __p0_358; \
47562 int32x2_t __s2_266 = __p2_266; \49266 int32x2_t __s2_358 = __p2_358; \
47563 int32x4_t __rev0_266; __rev0_266 = __builtin_shufflevector(__s0_266, __s0_266, 3, 2, 1, 0); \49267 int32x4_t __rev0_358; __rev0_358 = __builtin_shufflevector(__s0_358, __s0_358, 3, 2, 1, 0); \
47564 int32x2_t __rev2_266; __rev2_266 = __builtin_shufflevector(__s2_266, __s2_266, 1, 0); \49268 int32x2_t __rev2_358; __rev2_358 = __builtin_shufflevector(__s2_358, __s2_358, 1, 0); \
47565 int32x4_t __ret_266; \49269 int32x4_t __ret_358; \
47566 __ret_266 = __noswap_vsetq_lane_s32(__noswap_vget_lane_s32(__rev2_266, __p3_266), __rev0_266, __p1_266); \49270 __ret_358 = __noswap_vsetq_lane_s32(__noswap_vget_lane_s32(__rev2_358, __p3_358), __rev0_358, __p1_358); \
47567 __ret_266 = __builtin_shufflevector(__ret_266, __ret_266, 3, 2, 1, 0); \49271 __ret_358 = __builtin_shufflevector(__ret_358, __ret_358, 3, 2, 1, 0); \
47568 __ret_266; \49272 __ret_358; \
47569})49273})
47570#endif49274#endif
4757149275
47572#ifdef __LITTLE_ENDIAN__49276#ifdef __LITTLE_ENDIAN__
47573#define vcopyq_lane_s64(__p0_267, __p1_267, __p2_267, __p3_267) __extension__ ({ \49277#define vcopyq_lane_s64(__p0_359, __p1_359, __p2_359, __p3_359) __extension__ ({ \
47574 int64x2_t __s0_267 = __p0_267; \49278 int64x2_t __s0_359 = __p0_359; \
47575 int64x1_t __s2_267 = __p2_267; \49279 int64x1_t __s2_359 = __p2_359; \
47576 int64x2_t __ret_267; \49280 int64x2_t __ret_359; \
47577 __ret_267 = vsetq_lane_s64(vget_lane_s64(__s2_267, __p3_267), __s0_267, __p1_267); \49281 __ret_359 = vsetq_lane_s64(vget_lane_s64(__s2_359, __p3_359), __s0_359, __p1_359); \
47578 __ret_267; \49282 __ret_359; \
47579})49283})
47580#else49284#else
47581#define vcopyq_lane_s64(__p0_268, __p1_268, __p2_268, __p3_268) __extension__ ({ \49285#define vcopyq_lane_s64(__p0_360, __p1_360, __p2_360, __p3_360) __extension__ ({ \
47582 int64x2_t __s0_268 = __p0_268; \49286 int64x2_t __s0_360 = __p0_360; \
47583 int64x1_t __s2_268 = __p2_268; \49287 int64x1_t __s2_360 = __p2_360; \
47584 int64x2_t __rev0_268; __rev0_268 = __builtin_shufflevector(__s0_268, __s0_268, 1, 0); \49288 int64x2_t __rev0_360; __rev0_360 = __builtin_shufflevector(__s0_360, __s0_360, 1, 0); \
47585 int64x2_t __ret_268; \49289 int64x2_t __ret_360; \
47586 __ret_268 = __noswap_vsetq_lane_s64(vget_lane_s64(__s2_268, __p3_268), __rev0_268, __p1_268); \49290 __ret_360 = __noswap_vsetq_lane_s64(vget_lane_s64(__s2_360, __p3_360), __rev0_360, __p1_360); \
47587 __ret_268 = __builtin_shufflevector(__ret_268, __ret_268, 1, 0); \49291 __ret_360 = __builtin_shufflevector(__ret_360, __ret_360, 1, 0); \
47588 __ret_268; \49292 __ret_360; \
47589})49293})
47590#endif49294#endif
4759149295
47592#ifdef __LITTLE_ENDIAN__49296#ifdef __LITTLE_ENDIAN__
47593#define vcopyq_lane_s16(__p0_269, __p1_269, __p2_269, __p3_269) __extension__ ({ \49297#define vcopyq_lane_s16(__p0_361, __p1_361, __p2_361, __p3_361) __extension__ ({ \
47594 int16x8_t __s0_269 = __p0_269; \49298 int16x8_t __s0_361 = __p0_361; \
47595 int16x4_t __s2_269 = __p2_269; \49299 int16x4_t __s2_361 = __p2_361; \
47596 int16x8_t __ret_269; \49300 int16x8_t __ret_361; \
47597 __ret_269 = vsetq_lane_s16(vget_lane_s16(__s2_269, __p3_269), __s0_269, __p1_269); \49301 __ret_361 = vsetq_lane_s16(vget_lane_s16(__s2_361, __p3_361), __s0_361, __p1_361); \
47598 __ret_269; \49302 __ret_361; \
47599})49303})
47600#else49304#else
47601#define vcopyq_lane_s16(__p0_270, __p1_270, __p2_270, __p3_270) __extension__ ({ \49305#define vcopyq_lane_s16(__p0_362, __p1_362, __p2_362, __p3_362) __extension__ ({ \
47602 int16x8_t __s0_270 = __p0_270; \49306 int16x8_t __s0_362 = __p0_362; \
47603 int16x4_t __s2_270 = __p2_270; \49307 int16x4_t __s2_362 = __p2_362; \
47604 int16x8_t __rev0_270; __rev0_270 = __builtin_shufflevector(__s0_270, __s0_270, 7, 6, 5, 4, 3, 2, 1, 0); \49308 int16x8_t __rev0_362; __rev0_362 = __builtin_shufflevector(__s0_362, __s0_362, 7, 6, 5, 4, 3, 2, 1, 0); \
47605 int16x4_t __rev2_270; __rev2_270 = __builtin_shufflevector(__s2_270, __s2_270, 3, 2, 1, 0); \49309 int16x4_t __rev2_362; __rev2_362 = __builtin_shufflevector(__s2_362, __s2_362, 3, 2, 1, 0); \
47606 int16x8_t __ret_270; \49310 int16x8_t __ret_362; \
47607 __ret_270 = __noswap_vsetq_lane_s16(__noswap_vget_lane_s16(__rev2_270, __p3_270), __rev0_270, __p1_270); \49311 __ret_362 = __noswap_vsetq_lane_s16(__noswap_vget_lane_s16(__rev2_362, __p3_362), __rev0_362, __p1_362); \
47608 __ret_270 = __builtin_shufflevector(__ret_270, __ret_270, 7, 6, 5, 4, 3, 2, 1, 0); \49312 __ret_362 = __builtin_shufflevector(__ret_362, __ret_362, 7, 6, 5, 4, 3, 2, 1, 0); \
47609 __ret_270; \49313 __ret_362; \
47610})49314})
47611#endif49315#endif
4761249316
47613#ifdef __LITTLE_ENDIAN__49317#ifdef __LITTLE_ENDIAN__
47614#define vcopy_lane_p8(__p0_271, __p1_271, __p2_271, __p3_271) __extension__ ({ \49318#define vcopy_lane_p8(__p0_363, __p1_363, __p2_363, __p3_363) __extension__ ({ \
47615 poly8x8_t __s0_271 = __p0_271; \49319 poly8x8_t __s0_363 = __p0_363; \
47616 poly8x8_t __s2_271 = __p2_271; \49320 poly8x8_t __s2_363 = __p2_363; \
47617 poly8x8_t __ret_271; \49321 poly8x8_t __ret_363; \
47618 __ret_271 = vset_lane_p8(vget_lane_p8(__s2_271, __p3_271), __s0_271, __p1_271); \49322 __ret_363 = vset_lane_p8(vget_lane_p8(__s2_363, __p3_363), __s0_363, __p1_363); \
47619 __ret_271; \49323 __ret_363; \
47620})49324})
47621#else49325#else
47622#define vcopy_lane_p8(__p0_272, __p1_272, __p2_272, __p3_272) __extension__ ({ \49326#define vcopy_lane_p8(__p0_364, __p1_364, __p2_364, __p3_364) __extension__ ({ \
47623 poly8x8_t __s0_272 = __p0_272; \49327 poly8x8_t __s0_364 = __p0_364; \
47624 poly8x8_t __s2_272 = __p2_272; \49328 poly8x8_t __s2_364 = __p2_364; \
47625 poly8x8_t __rev0_272; __rev0_272 = __builtin_shufflevector(__s0_272, __s0_272, 7, 6, 5, 4, 3, 2, 1, 0); \49329 poly8x8_t __rev0_364; __rev0_364 = __builtin_shufflevector(__s0_364, __s0_364, 7, 6, 5, 4, 3, 2, 1, 0); \
47626 poly8x8_t __rev2_272; __rev2_272 = __builtin_shufflevector(__s2_272, __s2_272, 7, 6, 5, 4, 3, 2, 1, 0); \49330 poly8x8_t __rev2_364; __rev2_364 = __builtin_shufflevector(__s2_364, __s2_364, 7, 6, 5, 4, 3, 2, 1, 0); \
47627 poly8x8_t __ret_272; \49331 poly8x8_t __ret_364; \
47628 __ret_272 = __noswap_vset_lane_p8(__noswap_vget_lane_p8(__rev2_272, __p3_272), __rev0_272, __p1_272); \49332 __ret_364 = __noswap_vset_lane_p8(__noswap_vget_lane_p8(__rev2_364, __p3_364), __rev0_364, __p1_364); \
47629 __ret_272 = __builtin_shufflevector(__ret_272, __ret_272, 7, 6, 5, 4, 3, 2, 1, 0); \49333 __ret_364 = __builtin_shufflevector(__ret_364, __ret_364, 7, 6, 5, 4, 3, 2, 1, 0); \
47630 __ret_272; \49334 __ret_364; \
47631})49335})
47632#endif49336#endif
4763349337
47634#ifdef __LITTLE_ENDIAN__49338#ifdef __LITTLE_ENDIAN__
47635#define vcopy_lane_p16(__p0_273, __p1_273, __p2_273, __p3_273) __extension__ ({ \49339#define vcopy_lane_p16(__p0_365, __p1_365, __p2_365, __p3_365) __extension__ ({ \
47636 poly16x4_t __s0_273 = __p0_273; \49340 poly16x4_t __s0_365 = __p0_365; \
47637 poly16x4_t __s2_273 = __p2_273; \49341 poly16x4_t __s2_365 = __p2_365; \
47638 poly16x4_t __ret_273; \49342 poly16x4_t __ret_365; \
47639 __ret_273 = vset_lane_p16(vget_lane_p16(__s2_273, __p3_273), __s0_273, __p1_273); \49343 __ret_365 = vset_lane_p16(vget_lane_p16(__s2_365, __p3_365), __s0_365, __p1_365); \
47640 __ret_273; \49344 __ret_365; \
47641})49345})
47642#else49346#else
47643#define vcopy_lane_p16(__p0_274, __p1_274, __p2_274, __p3_274) __extension__ ({ \49347#define vcopy_lane_p16(__p0_366, __p1_366, __p2_366, __p3_366) __extension__ ({ \
47644 poly16x4_t __s0_274 = __p0_274; \49348 poly16x4_t __s0_366 = __p0_366; \
47645 poly16x4_t __s2_274 = __p2_274; \49349 poly16x4_t __s2_366 = __p2_366; \
47646 poly16x4_t __rev0_274; __rev0_274 = __builtin_shufflevector(__s0_274, __s0_274, 3, 2, 1, 0); \49350 poly16x4_t __rev0_366; __rev0_366 = __builtin_shufflevector(__s0_366, __s0_366, 3, 2, 1, 0); \
47647 poly16x4_t __rev2_274; __rev2_274 = __builtin_shufflevector(__s2_274, __s2_274, 3, 2, 1, 0); \49351 poly16x4_t __rev2_366; __rev2_366 = __builtin_shufflevector(__s2_366, __s2_366, 3, 2, 1, 0); \
47648 poly16x4_t __ret_274; \49352 poly16x4_t __ret_366; \
47649 __ret_274 = __noswap_vset_lane_p16(__noswap_vget_lane_p16(__rev2_274, __p3_274), __rev0_274, __p1_274); \49353 __ret_366 = __noswap_vset_lane_p16(__noswap_vget_lane_p16(__rev2_366, __p3_366), __rev0_366, __p1_366); \
47650 __ret_274 = __builtin_shufflevector(__ret_274, __ret_274, 3, 2, 1, 0); \49354 __ret_366 = __builtin_shufflevector(__ret_366, __ret_366, 3, 2, 1, 0); \
47651 __ret_274; \49355 __ret_366; \
47652})49356})
47653#endif49357#endif
4765449358
47655#ifdef __LITTLE_ENDIAN__49359#ifdef __LITTLE_ENDIAN__
47656#define vcopy_lane_u8(__p0_275, __p1_275, __p2_275, __p3_275) __extension__ ({ \49360#define vcopy_lane_u8(__p0_367, __p1_367, __p2_367, __p3_367) __extension__ ({ \
47657 uint8x8_t __s0_275 = __p0_275; \49361 uint8x8_t __s0_367 = __p0_367; \
47658 uint8x8_t __s2_275 = __p2_275; \49362 uint8x8_t __s2_367 = __p2_367; \
47659 uint8x8_t __ret_275; \49363 uint8x8_t __ret_367; \
47660 __ret_275 = vset_lane_u8(vget_lane_u8(__s2_275, __p3_275), __s0_275, __p1_275); \49364 __ret_367 = vset_lane_u8(vget_lane_u8(__s2_367, __p3_367), __s0_367, __p1_367); \
47661 __ret_275; \49365 __ret_367; \
47662})49366})
47663#else49367#else
47664#define vcopy_lane_u8(__p0_276, __p1_276, __p2_276, __p3_276) __extension__ ({ \49368#define vcopy_lane_u8(__p0_368, __p1_368, __p2_368, __p3_368) __extension__ ({ \
47665 uint8x8_t __s0_276 = __p0_276; \49369 uint8x8_t __s0_368 = __p0_368; \
47666 uint8x8_t __s2_276 = __p2_276; \49370 uint8x8_t __s2_368 = __p2_368; \
47667 uint8x8_t __rev0_276; __rev0_276 = __builtin_shufflevector(__s0_276, __s0_276, 7, 6, 5, 4, 3, 2, 1, 0); \49371 uint8x8_t __rev0_368; __rev0_368 = __builtin_shufflevector(__s0_368, __s0_368, 7, 6, 5, 4, 3, 2, 1, 0); \
47668 uint8x8_t __rev2_276; __rev2_276 = __builtin_shufflevector(__s2_276, __s2_276, 7, 6, 5, 4, 3, 2, 1, 0); \49372 uint8x8_t __rev2_368; __rev2_368 = __builtin_shufflevector(__s2_368, __s2_368, 7, 6, 5, 4, 3, 2, 1, 0); \
47669 uint8x8_t __ret_276; \49373 uint8x8_t __ret_368; \
47670 __ret_276 = __noswap_vset_lane_u8(__noswap_vget_lane_u8(__rev2_276, __p3_276), __rev0_276, __p1_276); \49374 __ret_368 = __noswap_vset_lane_u8(__noswap_vget_lane_u8(__rev2_368, __p3_368), __rev0_368, __p1_368); \
47671 __ret_276 = __builtin_shufflevector(__ret_276, __ret_276, 7, 6, 5, 4, 3, 2, 1, 0); \49375 __ret_368 = __builtin_shufflevector(__ret_368, __ret_368, 7, 6, 5, 4, 3, 2, 1, 0); \
47672 __ret_276; \49376 __ret_368; \
47673})49377})
47674#endif49378#endif
4767549379
47676#ifdef __LITTLE_ENDIAN__49380#ifdef __LITTLE_ENDIAN__
47677#define vcopy_lane_u32(__p0_277, __p1_277, __p2_277, __p3_277) __extension__ ({ \49381#define vcopy_lane_u32(__p0_369, __p1_369, __p2_369, __p3_369) __extension__ ({ \
47678 uint32x2_t __s0_277 = __p0_277; \49382 uint32x2_t __s0_369 = __p0_369; \
47679 uint32x2_t __s2_277 = __p2_277; \49383 uint32x2_t __s2_369 = __p2_369; \
47680 uint32x2_t __ret_277; \49384 uint32x2_t __ret_369; \
47681 __ret_277 = vset_lane_u32(vget_lane_u32(__s2_277, __p3_277), __s0_277, __p1_277); \49385 __ret_369 = vset_lane_u32(vget_lane_u32(__s2_369, __p3_369), __s0_369, __p1_369); \
47682 __ret_277; \49386 __ret_369; \
47683})49387})
47684#else49388#else
47685#define vcopy_lane_u32(__p0_278, __p1_278, __p2_278, __p3_278) __extension__ ({ \49389#define vcopy_lane_u32(__p0_370, __p1_370, __p2_370, __p3_370) __extension__ ({ \
47686 uint32x2_t __s0_278 = __p0_278; \49390 uint32x2_t __s0_370 = __p0_370; \
47687 uint32x2_t __s2_278 = __p2_278; \49391 uint32x2_t __s2_370 = __p2_370; \
47688 uint32x2_t __rev0_278; __rev0_278 = __builtin_shufflevector(__s0_278, __s0_278, 1, 0); \49392 uint32x2_t __rev0_370; __rev0_370 = __builtin_shufflevector(__s0_370, __s0_370, 1, 0); \
47689 uint32x2_t __rev2_278; __rev2_278 = __builtin_shufflevector(__s2_278, __s2_278, 1, 0); \49393 uint32x2_t __rev2_370; __rev2_370 = __builtin_shufflevector(__s2_370, __s2_370, 1, 0); \
47690 uint32x2_t __ret_278; \49394 uint32x2_t __ret_370; \
47691 __ret_278 = __noswap_vset_lane_u32(__noswap_vget_lane_u32(__rev2_278, __p3_278), __rev0_278, __p1_278); \49395 __ret_370 = __noswap_vset_lane_u32(__noswap_vget_lane_u32(__rev2_370, __p3_370), __rev0_370, __p1_370); \
47692 __ret_278 = __builtin_shufflevector(__ret_278, __ret_278, 1, 0); \49396 __ret_370 = __builtin_shufflevector(__ret_370, __ret_370, 1, 0); \
47693 __ret_278; \49397 __ret_370; \
47694})49398})
47695#endif49399#endif
4769649400
47697#define vcopy_lane_u64(__p0_279, __p1_279, __p2_279, __p3_279) __extension__ ({ \49401#define vcopy_lane_u64(__p0_371, __p1_371, __p2_371, __p3_371) __extension__ ({ \
47698 uint64x1_t __s0_279 = __p0_279; \49402 uint64x1_t __s0_371 = __p0_371; \
47699 uint64x1_t __s2_279 = __p2_279; \49403 uint64x1_t __s2_371 = __p2_371; \
47700 uint64x1_t __ret_279; \49404 uint64x1_t __ret_371; \
47701 __ret_279 = vset_lane_u64(vget_lane_u64(__s2_279, __p3_279), __s0_279, __p1_279); \49405 __ret_371 = vset_lane_u64(vget_lane_u64(__s2_371, __p3_371), __s0_371, __p1_371); \
47702 __ret_279; \49406 __ret_371; \
47703})49407})
47704#ifdef __LITTLE_ENDIAN__49408#ifdef __LITTLE_ENDIAN__
47705#define vcopy_lane_u16(__p0_280, __p1_280, __p2_280, __p3_280) __extension__ ({ \49409#define vcopy_lane_u16(__p0_372, __p1_372, __p2_372, __p3_372) __extension__ ({ \
47706 uint16x4_t __s0_280 = __p0_280; \49410 uint16x4_t __s0_372 = __p0_372; \
47707 uint16x4_t __s2_280 = __p2_280; \49411 uint16x4_t __s2_372 = __p2_372; \
47708 uint16x4_t __ret_280; \49412 uint16x4_t __ret_372; \
47709 __ret_280 = vset_lane_u16(vget_lane_u16(__s2_280, __p3_280), __s0_280, __p1_280); \49413 __ret_372 = vset_lane_u16(vget_lane_u16(__s2_372, __p3_372), __s0_372, __p1_372); \
47710 __ret_280; \49414 __ret_372; \
47711})49415})
47712#else49416#else
47713#define vcopy_lane_u16(__p0_281, __p1_281, __p2_281, __p3_281) __extension__ ({ \49417#define vcopy_lane_u16(__p0_373, __p1_373, __p2_373, __p3_373) __extension__ ({ \
47714 uint16x4_t __s0_281 = __p0_281; \49418 uint16x4_t __s0_373 = __p0_373; \
47715 uint16x4_t __s2_281 = __p2_281; \49419 uint16x4_t __s2_373 = __p2_373; \
47716 uint16x4_t __rev0_281; __rev0_281 = __builtin_shufflevector(__s0_281, __s0_281, 3, 2, 1, 0); \49420 uint16x4_t __rev0_373; __rev0_373 = __builtin_shufflevector(__s0_373, __s0_373, 3, 2, 1, 0); \
47717 uint16x4_t __rev2_281; __rev2_281 = __builtin_shufflevector(__s2_281, __s2_281, 3, 2, 1, 0); \49421 uint16x4_t __rev2_373; __rev2_373 = __builtin_shufflevector(__s2_373, __s2_373, 3, 2, 1, 0); \
47718 uint16x4_t __ret_281; \49422 uint16x4_t __ret_373; \
47719 __ret_281 = __noswap_vset_lane_u16(__noswap_vget_lane_u16(__rev2_281, __p3_281), __rev0_281, __p1_281); \49423 __ret_373 = __noswap_vset_lane_u16(__noswap_vget_lane_u16(__rev2_373, __p3_373), __rev0_373, __p1_373); \
47720 __ret_281 = __builtin_shufflevector(__ret_281, __ret_281, 3, 2, 1, 0); \49424 __ret_373 = __builtin_shufflevector(__ret_373, __ret_373, 3, 2, 1, 0); \
47721 __ret_281; \49425 __ret_373; \
47722})49426})
47723#endif49427#endif
4772449428
47725#ifdef __LITTLE_ENDIAN__49429#ifdef __LITTLE_ENDIAN__
47726#define vcopy_lane_s8(__p0_282, __p1_282, __p2_282, __p3_282) __extension__ ({ \49430#define vcopy_lane_s8(__p0_374, __p1_374, __p2_374, __p3_374) __extension__ ({ \
47727 int8x8_t __s0_282 = __p0_282; \49431 int8x8_t __s0_374 = __p0_374; \
47728 int8x8_t __s2_282 = __p2_282; \49432 int8x8_t __s2_374 = __p2_374; \
47729 int8x8_t __ret_282; \49433 int8x8_t __ret_374; \
47730 __ret_282 = vset_lane_s8(vget_lane_s8(__s2_282, __p3_282), __s0_282, __p1_282); \49434 __ret_374 = vset_lane_s8(vget_lane_s8(__s2_374, __p3_374), __s0_374, __p1_374); \
47731 __ret_282; \49435 __ret_374; \
47732})49436})
47733#else49437#else
47734#define vcopy_lane_s8(__p0_283, __p1_283, __p2_283, __p3_283) __extension__ ({ \49438#define vcopy_lane_s8(__p0_375, __p1_375, __p2_375, __p3_375) __extension__ ({ \
47735 int8x8_t __s0_283 = __p0_283; \49439 int8x8_t __s0_375 = __p0_375; \
47736 int8x8_t __s2_283 = __p2_283; \49440 int8x8_t __s2_375 = __p2_375; \
47737 int8x8_t __rev0_283; __rev0_283 = __builtin_shufflevector(__s0_283, __s0_283, 7, 6, 5, 4, 3, 2, 1, 0); \49441 int8x8_t __rev0_375; __rev0_375 = __builtin_shufflevector(__s0_375, __s0_375, 7, 6, 5, 4, 3, 2, 1, 0); \
47738 int8x8_t __rev2_283; __rev2_283 = __builtin_shufflevector(__s2_283, __s2_283, 7, 6, 5, 4, 3, 2, 1, 0); \49442 int8x8_t __rev2_375; __rev2_375 = __builtin_shufflevector(__s2_375, __s2_375, 7, 6, 5, 4, 3, 2, 1, 0); \
47739 int8x8_t __ret_283; \49443 int8x8_t __ret_375; \
47740 __ret_283 = __noswap_vset_lane_s8(__noswap_vget_lane_s8(__rev2_283, __p3_283), __rev0_283, __p1_283); \49444 __ret_375 = __noswap_vset_lane_s8(__noswap_vget_lane_s8(__rev2_375, __p3_375), __rev0_375, __p1_375); \
47741 __ret_283 = __builtin_shufflevector(__ret_283, __ret_283, 7, 6, 5, 4, 3, 2, 1, 0); \49445 __ret_375 = __builtin_shufflevector(__ret_375, __ret_375, 7, 6, 5, 4, 3, 2, 1, 0); \
47742 __ret_283; \49446 __ret_375; \
47743})49447})
47744#endif49448#endif
4774549449
47746#ifdef __LITTLE_ENDIAN__49450#ifdef __LITTLE_ENDIAN__
47747#define vcopy_lane_f32(__p0_284, __p1_284, __p2_284, __p3_284) __extension__ ({ \49451#define vcopy_lane_f32(__p0_376, __p1_376, __p2_376, __p3_376) __extension__ ({ \
47748 float32x2_t __s0_284 = __p0_284; \49452 float32x2_t __s0_376 = __p0_376; \
47749 float32x2_t __s2_284 = __p2_284; \49453 float32x2_t __s2_376 = __p2_376; \
47750 float32x2_t __ret_284; \49454 float32x2_t __ret_376; \
47751 __ret_284 = vset_lane_f32(vget_lane_f32(__s2_284, __p3_284), __s0_284, __p1_284); \49455 __ret_376 = vset_lane_f32(vget_lane_f32(__s2_376, __p3_376), __s0_376, __p1_376); \
47752 __ret_284; \49456 __ret_376; \
47753})49457})
47754#else49458#else
47755#define vcopy_lane_f32(__p0_285, __p1_285, __p2_285, __p3_285) __extension__ ({ \49459#define vcopy_lane_f32(__p0_377, __p1_377, __p2_377, __p3_377) __extension__ ({ \
47756 float32x2_t __s0_285 = __p0_285; \49460 float32x2_t __s0_377 = __p0_377; \
47757 float32x2_t __s2_285 = __p2_285; \49461 float32x2_t __s2_377 = __p2_377; \
47758 float32x2_t __rev0_285; __rev0_285 = __builtin_shufflevector(__s0_285, __s0_285, 1, 0); \49462 float32x2_t __rev0_377; __rev0_377 = __builtin_shufflevector(__s0_377, __s0_377, 1, 0); \
47759 float32x2_t __rev2_285; __rev2_285 = __builtin_shufflevector(__s2_285, __s2_285, 1, 0); \49463 float32x2_t __rev2_377; __rev2_377 = __builtin_shufflevector(__s2_377, __s2_377, 1, 0); \
47760 float32x2_t __ret_285; \49464 float32x2_t __ret_377; \
47761 __ret_285 = __noswap_vset_lane_f32(__noswap_vget_lane_f32(__rev2_285, __p3_285), __rev0_285, __p1_285); \49465 __ret_377 = __noswap_vset_lane_f32(__noswap_vget_lane_f32(__rev2_377, __p3_377), __rev0_377, __p1_377); \
47762 __ret_285 = __builtin_shufflevector(__ret_285, __ret_285, 1, 0); \49466 __ret_377 = __builtin_shufflevector(__ret_377, __ret_377, 1, 0); \
47763 __ret_285; \49467 __ret_377; \
47764})49468})
47765#endif49469#endif
4776649470
47767#ifdef __LITTLE_ENDIAN__49471#ifdef __LITTLE_ENDIAN__
47768#define vcopy_lane_s32(__p0_286, __p1_286, __p2_286, __p3_286) __extension__ ({ \49472#define vcopy_lane_s32(__p0_378, __p1_378, __p2_378, __p3_378) __extension__ ({ \
47769 int32x2_t __s0_286 = __p0_286; \49473 int32x2_t __s0_378 = __p0_378; \
47770 int32x2_t __s2_286 = __p2_286; \49474 int32x2_t __s2_378 = __p2_378; \
47771 int32x2_t __ret_286; \49475 int32x2_t __ret_378; \
47772 __ret_286 = vset_lane_s32(vget_lane_s32(__s2_286, __p3_286), __s0_286, __p1_286); \49476 __ret_378 = vset_lane_s32(vget_lane_s32(__s2_378, __p3_378), __s0_378, __p1_378); \
47773 __ret_286; \49477 __ret_378; \
47774})49478})
47775#else49479#else
47776#define vcopy_lane_s32(__p0_287, __p1_287, __p2_287, __p3_287) __extension__ ({ \49480#define vcopy_lane_s32(__p0_379, __p1_379, __p2_379, __p3_379) __extension__ ({ \
47777 int32x2_t __s0_287 = __p0_287; \49481 int32x2_t __s0_379 = __p0_379; \
47778 int32x2_t __s2_287 = __p2_287; \49482 int32x2_t __s2_379 = __p2_379; \
47779 int32x2_t __rev0_287; __rev0_287 = __builtin_shufflevector(__s0_287, __s0_287, 1, 0); \49483 int32x2_t __rev0_379; __rev0_379 = __builtin_shufflevector(__s0_379, __s0_379, 1, 0); \
47780 int32x2_t __rev2_287; __rev2_287 = __builtin_shufflevector(__s2_287, __s2_287, 1, 0); \49484 int32x2_t __rev2_379; __rev2_379 = __builtin_shufflevector(__s2_379, __s2_379, 1, 0); \
47781 int32x2_t __ret_287; \49485 int32x2_t __ret_379; \
47782 __ret_287 = __noswap_vset_lane_s32(__noswap_vget_lane_s32(__rev2_287, __p3_287), __rev0_287, __p1_287); \49486 __ret_379 = __noswap_vset_lane_s32(__noswap_vget_lane_s32(__rev2_379, __p3_379), __rev0_379, __p1_379); \
47783 __ret_287 = __builtin_shufflevector(__ret_287, __ret_287, 1, 0); \49487 __ret_379 = __builtin_shufflevector(__ret_379, __ret_379, 1, 0); \
47784 __ret_287; \49488 __ret_379; \
47785})49489})
47786#endif49490#endif
4778749491
47788#define vcopy_lane_s64(__p0_288, __p1_288, __p2_288, __p3_288) __extension__ ({ \49492#define vcopy_lane_s64(__p0_380, __p1_380, __p2_380, __p3_380) __extension__ ({ \
47789 int64x1_t __s0_288 = __p0_288; \49493 int64x1_t __s0_380 = __p0_380; \
47790 int64x1_t __s2_288 = __p2_288; \49494 int64x1_t __s2_380 = __p2_380; \
47791 int64x1_t __ret_288; \49495 int64x1_t __ret_380; \
47792 __ret_288 = vset_lane_s64(vget_lane_s64(__s2_288, __p3_288), __s0_288, __p1_288); \49496 __ret_380 = vset_lane_s64(vget_lane_s64(__s2_380, __p3_380), __s0_380, __p1_380); \
47793 __ret_288; \49497 __ret_380; \
47794})49498})
47795#ifdef __LITTLE_ENDIAN__49499#ifdef __LITTLE_ENDIAN__
47796#define vcopy_lane_s16(__p0_289, __p1_289, __p2_289, __p3_289) __extension__ ({ \49500#define vcopy_lane_s16(__p0_381, __p1_381, __p2_381, __p3_381) __extension__ ({ \
47797 int16x4_t __s0_289 = __p0_289; \49501 int16x4_t __s0_381 = __p0_381; \
47798 int16x4_t __s2_289 = __p2_289; \49502 int16x4_t __s2_381 = __p2_381; \
47799 int16x4_t __ret_289; \49503 int16x4_t __ret_381; \
47800 __ret_289 = vset_lane_s16(vget_lane_s16(__s2_289, __p3_289), __s0_289, __p1_289); \49504 __ret_381 = vset_lane_s16(vget_lane_s16(__s2_381, __p3_381), __s0_381, __p1_381); \
47801 __ret_289; \49505 __ret_381; \
47802})49506})
47803#else49507#else
47804#define vcopy_lane_s16(__p0_290, __p1_290, __p2_290, __p3_290) __extension__ ({ \49508#define vcopy_lane_s16(__p0_382, __p1_382, __p2_382, __p3_382) __extension__ ({ \
47805 int16x4_t __s0_290 = __p0_290; \49509 int16x4_t __s0_382 = __p0_382; \
47806 int16x4_t __s2_290 = __p2_290; \49510 int16x4_t __s2_382 = __p2_382; \
47807 int16x4_t __rev0_290; __rev0_290 = __builtin_shufflevector(__s0_290, __s0_290, 3, 2, 1, 0); \49511 int16x4_t __rev0_382; __rev0_382 = __builtin_shufflevector(__s0_382, __s0_382, 3, 2, 1, 0); \
47808 int16x4_t __rev2_290; __rev2_290 = __builtin_shufflevector(__s2_290, __s2_290, 3, 2, 1, 0); \49512 int16x4_t __rev2_382; __rev2_382 = __builtin_shufflevector(__s2_382, __s2_382, 3, 2, 1, 0); \
47809 int16x4_t __ret_290; \49513 int16x4_t __ret_382; \
47810 __ret_290 = __noswap_vset_lane_s16(__noswap_vget_lane_s16(__rev2_290, __p3_290), __rev0_290, __p1_290); \49514 __ret_382 = __noswap_vset_lane_s16(__noswap_vget_lane_s16(__rev2_382, __p3_382), __rev0_382, __p1_382); \
47811 __ret_290 = __builtin_shufflevector(__ret_290, __ret_290, 3, 2, 1, 0); \49515 __ret_382 = __builtin_shufflevector(__ret_382, __ret_382, 3, 2, 1, 0); \
47812 __ret_290; \49516 __ret_382; \
47813})49517})
47814#endif49518#endif
4781549519
47816#ifdef __LITTLE_ENDIAN__49520#ifdef __LITTLE_ENDIAN__
47817#define vcopyq_laneq_p8(__p0_291, __p1_291, __p2_291, __p3_291) __extension__ ({ \49521#define vcopyq_laneq_p8(__p0_383, __p1_383, __p2_383, __p3_383) __extension__ ({ \
47818 poly8x16_t __s0_291 = __p0_291; \49522 poly8x16_t __s0_383 = __p0_383; \
47819 poly8x16_t __s2_291 = __p2_291; \49523 poly8x16_t __s2_383 = __p2_383; \
47820 poly8x16_t __ret_291; \49524 poly8x16_t __ret_383; \
47821 __ret_291 = vsetq_lane_p8(vgetq_lane_p8(__s2_291, __p3_291), __s0_291, __p1_291); \49525 __ret_383 = vsetq_lane_p8(vgetq_lane_p8(__s2_383, __p3_383), __s0_383, __p1_383); \
47822 __ret_291; \49526 __ret_383; \
47823})49527})
47824#else49528#else
47825#define vcopyq_laneq_p8(__p0_292, __p1_292, __p2_292, __p3_292) __extension__ ({ \49529#define vcopyq_laneq_p8(__p0_384, __p1_384, __p2_384, __p3_384) __extension__ ({ \
47826 poly8x16_t __s0_292 = __p0_292; \49530 poly8x16_t __s0_384 = __p0_384; \
47827 poly8x16_t __s2_292 = __p2_292; \49531 poly8x16_t __s2_384 = __p2_384; \
47828 poly8x16_t __rev0_292; __rev0_292 = __builtin_shufflevector(__s0_292, __s0_292, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49532 poly8x16_t __rev0_384; __rev0_384 = __builtin_shufflevector(__s0_384, __s0_384, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47829 poly8x16_t __rev2_292; __rev2_292 = __builtin_shufflevector(__s2_292, __s2_292, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49533 poly8x16_t __rev2_384; __rev2_384 = __builtin_shufflevector(__s2_384, __s2_384, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47830 poly8x16_t __ret_292; \49534 poly8x16_t __ret_384; \
47831 __ret_292 = __noswap_vsetq_lane_p8(__noswap_vgetq_lane_p8(__rev2_292, __p3_292), __rev0_292, __p1_292); \49535 __ret_384 = __noswap_vsetq_lane_p8(__noswap_vgetq_lane_p8(__rev2_384, __p3_384), __rev0_384, __p1_384); \
47832 __ret_292 = __builtin_shufflevector(__ret_292, __ret_292, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49536 __ret_384 = __builtin_shufflevector(__ret_384, __ret_384, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47833 __ret_292; \49537 __ret_384; \
47834})49538})
47835#endif49539#endif
4783649540
47837#ifdef __LITTLE_ENDIAN__49541#ifdef __LITTLE_ENDIAN__
47838#define vcopyq_laneq_p16(__p0_293, __p1_293, __p2_293, __p3_293) __extension__ ({ \49542#define vcopyq_laneq_p16(__p0_385, __p1_385, __p2_385, __p3_385) __extension__ ({ \
47839 poly16x8_t __s0_293 = __p0_293; \49543 poly16x8_t __s0_385 = __p0_385; \
47840 poly16x8_t __s2_293 = __p2_293; \49544 poly16x8_t __s2_385 = __p2_385; \
47841 poly16x8_t __ret_293; \49545 poly16x8_t __ret_385; \
47842 __ret_293 = vsetq_lane_p16(vgetq_lane_p16(__s2_293, __p3_293), __s0_293, __p1_293); \49546 __ret_385 = vsetq_lane_p16(vgetq_lane_p16(__s2_385, __p3_385), __s0_385, __p1_385); \
47843 __ret_293; \49547 __ret_385; \
47844})49548})
47845#else49549#else
47846#define vcopyq_laneq_p16(__p0_294, __p1_294, __p2_294, __p3_294) __extension__ ({ \49550#define vcopyq_laneq_p16(__p0_386, __p1_386, __p2_386, __p3_386) __extension__ ({ \
47847 poly16x8_t __s0_294 = __p0_294; \49551 poly16x8_t __s0_386 = __p0_386; \
47848 poly16x8_t __s2_294 = __p2_294; \49552 poly16x8_t __s2_386 = __p2_386; \
47849 poly16x8_t __rev0_294; __rev0_294 = __builtin_shufflevector(__s0_294, __s0_294, 7, 6, 5, 4, 3, 2, 1, 0); \49553 poly16x8_t __rev0_386; __rev0_386 = __builtin_shufflevector(__s0_386, __s0_386, 7, 6, 5, 4, 3, 2, 1, 0); \
47850 poly16x8_t __rev2_294; __rev2_294 = __builtin_shufflevector(__s2_294, __s2_294, 7, 6, 5, 4, 3, 2, 1, 0); \49554 poly16x8_t __rev2_386; __rev2_386 = __builtin_shufflevector(__s2_386, __s2_386, 7, 6, 5, 4, 3, 2, 1, 0); \
47851 poly16x8_t __ret_294; \49555 poly16x8_t __ret_386; \
47852 __ret_294 = __noswap_vsetq_lane_p16(__noswap_vgetq_lane_p16(__rev2_294, __p3_294), __rev0_294, __p1_294); \49556 __ret_386 = __noswap_vsetq_lane_p16(__noswap_vgetq_lane_p16(__rev2_386, __p3_386), __rev0_386, __p1_386); \
47853 __ret_294 = __builtin_shufflevector(__ret_294, __ret_294, 7, 6, 5, 4, 3, 2, 1, 0); \49557 __ret_386 = __builtin_shufflevector(__ret_386, __ret_386, 7, 6, 5, 4, 3, 2, 1, 0); \
47854 __ret_294; \49558 __ret_386; \
47855})49559})
47856#endif49560#endif
4785749561
47858#ifdef __LITTLE_ENDIAN__49562#ifdef __LITTLE_ENDIAN__
47859#define vcopyq_laneq_u8(__p0_295, __p1_295, __p2_295, __p3_295) __extension__ ({ \49563#define vcopyq_laneq_u8(__p0_387, __p1_387, __p2_387, __p3_387) __extension__ ({ \
47860 uint8x16_t __s0_295 = __p0_295; \49564 uint8x16_t __s0_387 = __p0_387; \
47861 uint8x16_t __s2_295 = __p2_295; \49565 uint8x16_t __s2_387 = __p2_387; \
47862 uint8x16_t __ret_295; \49566 uint8x16_t __ret_387; \
47863 __ret_295 = vsetq_lane_u8(vgetq_lane_u8(__s2_295, __p3_295), __s0_295, __p1_295); \49567 __ret_387 = vsetq_lane_u8(vgetq_lane_u8(__s2_387, __p3_387), __s0_387, __p1_387); \
47864 __ret_295; \49568 __ret_387; \
47865})49569})
47866#else49570#else
47867#define vcopyq_laneq_u8(__p0_296, __p1_296, __p2_296, __p3_296) __extension__ ({ \49571#define vcopyq_laneq_u8(__p0_388, __p1_388, __p2_388, __p3_388) __extension__ ({ \
47868 uint8x16_t __s0_296 = __p0_296; \49572 uint8x16_t __s0_388 = __p0_388; \
47869 uint8x16_t __s2_296 = __p2_296; \49573 uint8x16_t __s2_388 = __p2_388; \
47870 uint8x16_t __rev0_296; __rev0_296 = __builtin_shufflevector(__s0_296, __s0_296, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49574 uint8x16_t __rev0_388; __rev0_388 = __builtin_shufflevector(__s0_388, __s0_388, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47871 uint8x16_t __rev2_296; __rev2_296 = __builtin_shufflevector(__s2_296, __s2_296, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49575 uint8x16_t __rev2_388; __rev2_388 = __builtin_shufflevector(__s2_388, __s2_388, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47872 uint8x16_t __ret_296; \49576 uint8x16_t __ret_388; \
47873 __ret_296 = __noswap_vsetq_lane_u8(__noswap_vgetq_lane_u8(__rev2_296, __p3_296), __rev0_296, __p1_296); \49577 __ret_388 = __noswap_vsetq_lane_u8(__noswap_vgetq_lane_u8(__rev2_388, __p3_388), __rev0_388, __p1_388); \
47874 __ret_296 = __builtin_shufflevector(__ret_296, __ret_296, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49578 __ret_388 = __builtin_shufflevector(__ret_388, __ret_388, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47875 __ret_296; \49579 __ret_388; \
47876})49580})
47877#endif49581#endif
4787849582
47879#ifdef __LITTLE_ENDIAN__49583#ifdef __LITTLE_ENDIAN__
47880#define vcopyq_laneq_u32(__p0_297, __p1_297, __p2_297, __p3_297) __extension__ ({ \49584#define vcopyq_laneq_u32(__p0_389, __p1_389, __p2_389, __p3_389) __extension__ ({ \
47881 uint32x4_t __s0_297 = __p0_297; \49585 uint32x4_t __s0_389 = __p0_389; \
47882 uint32x4_t __s2_297 = __p2_297; \49586 uint32x4_t __s2_389 = __p2_389; \
47883 uint32x4_t __ret_297; \49587 uint32x4_t __ret_389; \
47884 __ret_297 = vsetq_lane_u32(vgetq_lane_u32(__s2_297, __p3_297), __s0_297, __p1_297); \49588 __ret_389 = vsetq_lane_u32(vgetq_lane_u32(__s2_389, __p3_389), __s0_389, __p1_389); \
47885 __ret_297; \49589 __ret_389; \
47886})49590})
47887#else49591#else
47888#define vcopyq_laneq_u32(__p0_298, __p1_298, __p2_298, __p3_298) __extension__ ({ \49592#define vcopyq_laneq_u32(__p0_390, __p1_390, __p2_390, __p3_390) __extension__ ({ \
47889 uint32x4_t __s0_298 = __p0_298; \49593 uint32x4_t __s0_390 = __p0_390; \
47890 uint32x4_t __s2_298 = __p2_298; \49594 uint32x4_t __s2_390 = __p2_390; \
47891 uint32x4_t __rev0_298; __rev0_298 = __builtin_shufflevector(__s0_298, __s0_298, 3, 2, 1, 0); \49595 uint32x4_t __rev0_390; __rev0_390 = __builtin_shufflevector(__s0_390, __s0_390, 3, 2, 1, 0); \
47892 uint32x4_t __rev2_298; __rev2_298 = __builtin_shufflevector(__s2_298, __s2_298, 3, 2, 1, 0); \49596 uint32x4_t __rev2_390; __rev2_390 = __builtin_shufflevector(__s2_390, __s2_390, 3, 2, 1, 0); \
47893 uint32x4_t __ret_298; \49597 uint32x4_t __ret_390; \
47894 __ret_298 = __noswap_vsetq_lane_u32(__noswap_vgetq_lane_u32(__rev2_298, __p3_298), __rev0_298, __p1_298); \49598 __ret_390 = __noswap_vsetq_lane_u32(__noswap_vgetq_lane_u32(__rev2_390, __p3_390), __rev0_390, __p1_390); \
47895 __ret_298 = __builtin_shufflevector(__ret_298, __ret_298, 3, 2, 1, 0); \49599 __ret_390 = __builtin_shufflevector(__ret_390, __ret_390, 3, 2, 1, 0); \
47896 __ret_298; \49600 __ret_390; \
47897})49601})
47898#endif49602#endif
4789949603
47900#ifdef __LITTLE_ENDIAN__49604#ifdef __LITTLE_ENDIAN__
47901#define vcopyq_laneq_u64(__p0_299, __p1_299, __p2_299, __p3_299) __extension__ ({ \49605#define vcopyq_laneq_u64(__p0_391, __p1_391, __p2_391, __p3_391) __extension__ ({ \
47902 uint64x2_t __s0_299 = __p0_299; \49606 uint64x2_t __s0_391 = __p0_391; \
47903 uint64x2_t __s2_299 = __p2_299; \49607 uint64x2_t __s2_391 = __p2_391; \
47904 uint64x2_t __ret_299; \49608 uint64x2_t __ret_391; \
47905 __ret_299 = vsetq_lane_u64(vgetq_lane_u64(__s2_299, __p3_299), __s0_299, __p1_299); \49609 __ret_391 = vsetq_lane_u64(vgetq_lane_u64(__s2_391, __p3_391), __s0_391, __p1_391); \
47906 __ret_299; \49610 __ret_391; \
47907})49611})
47908#else49612#else
47909#define vcopyq_laneq_u64(__p0_300, __p1_300, __p2_300, __p3_300) __extension__ ({ \49613#define vcopyq_laneq_u64(__p0_392, __p1_392, __p2_392, __p3_392) __extension__ ({ \
47910 uint64x2_t __s0_300 = __p0_300; \49614 uint64x2_t __s0_392 = __p0_392; \
47911 uint64x2_t __s2_300 = __p2_300; \49615 uint64x2_t __s2_392 = __p2_392; \
47912 uint64x2_t __rev0_300; __rev0_300 = __builtin_shufflevector(__s0_300, __s0_300, 1, 0); \49616 uint64x2_t __rev0_392; __rev0_392 = __builtin_shufflevector(__s0_392, __s0_392, 1, 0); \
47913 uint64x2_t __rev2_300; __rev2_300 = __builtin_shufflevector(__s2_300, __s2_300, 1, 0); \49617 uint64x2_t __rev2_392; __rev2_392 = __builtin_shufflevector(__s2_392, __s2_392, 1, 0); \
47914 uint64x2_t __ret_300; \49618 uint64x2_t __ret_392; \
47915 __ret_300 = __noswap_vsetq_lane_u64(__noswap_vgetq_lane_u64(__rev2_300, __p3_300), __rev0_300, __p1_300); \49619 __ret_392 = __noswap_vsetq_lane_u64(__noswap_vgetq_lane_u64(__rev2_392, __p3_392), __rev0_392, __p1_392); \
47916 __ret_300 = __builtin_shufflevector(__ret_300, __ret_300, 1, 0); \49620 __ret_392 = __builtin_shufflevector(__ret_392, __ret_392, 1, 0); \
47917 __ret_300; \49621 __ret_392; \
47918})49622})
47919#endif49623#endif
4792049624
47921#ifdef __LITTLE_ENDIAN__49625#ifdef __LITTLE_ENDIAN__
47922#define vcopyq_laneq_u16(__p0_301, __p1_301, __p2_301, __p3_301) __extension__ ({ \49626#define vcopyq_laneq_u16(__p0_393, __p1_393, __p2_393, __p3_393) __extension__ ({ \
47923 uint16x8_t __s0_301 = __p0_301; \49627 uint16x8_t __s0_393 = __p0_393; \
47924 uint16x8_t __s2_301 = __p2_301; \49628 uint16x8_t __s2_393 = __p2_393; \
47925 uint16x8_t __ret_301; \49629 uint16x8_t __ret_393; \
47926 __ret_301 = vsetq_lane_u16(vgetq_lane_u16(__s2_301, __p3_301), __s0_301, __p1_301); \49630 __ret_393 = vsetq_lane_u16(vgetq_lane_u16(__s2_393, __p3_393), __s0_393, __p1_393); \
47927 __ret_301; \49631 __ret_393; \
47928})49632})
47929#else49633#else
47930#define vcopyq_laneq_u16(__p0_302, __p1_302, __p2_302, __p3_302) __extension__ ({ \49634#define vcopyq_laneq_u16(__p0_394, __p1_394, __p2_394, __p3_394) __extension__ ({ \
47931 uint16x8_t __s0_302 = __p0_302; \49635 uint16x8_t __s0_394 = __p0_394; \
47932 uint16x8_t __s2_302 = __p2_302; \49636 uint16x8_t __s2_394 = __p2_394; \
47933 uint16x8_t __rev0_302; __rev0_302 = __builtin_shufflevector(__s0_302, __s0_302, 7, 6, 5, 4, 3, 2, 1, 0); \49637 uint16x8_t __rev0_394; __rev0_394 = __builtin_shufflevector(__s0_394, __s0_394, 7, 6, 5, 4, 3, 2, 1, 0); \
47934 uint16x8_t __rev2_302; __rev2_302 = __builtin_shufflevector(__s2_302, __s2_302, 7, 6, 5, 4, 3, 2, 1, 0); \49638 uint16x8_t __rev2_394; __rev2_394 = __builtin_shufflevector(__s2_394, __s2_394, 7, 6, 5, 4, 3, 2, 1, 0); \
47935 uint16x8_t __ret_302; \49639 uint16x8_t __ret_394; \
47936 __ret_302 = __noswap_vsetq_lane_u16(__noswap_vgetq_lane_u16(__rev2_302, __p3_302), __rev0_302, __p1_302); \49640 __ret_394 = __noswap_vsetq_lane_u16(__noswap_vgetq_lane_u16(__rev2_394, __p3_394), __rev0_394, __p1_394); \
47937 __ret_302 = __builtin_shufflevector(__ret_302, __ret_302, 7, 6, 5, 4, 3, 2, 1, 0); \49641 __ret_394 = __builtin_shufflevector(__ret_394, __ret_394, 7, 6, 5, 4, 3, 2, 1, 0); \
47938 __ret_302; \49642 __ret_394; \
47939})49643})
47940#endif49644#endif
4794149645
47942#ifdef __LITTLE_ENDIAN__49646#ifdef __LITTLE_ENDIAN__
47943#define vcopyq_laneq_s8(__p0_303, __p1_303, __p2_303, __p3_303) __extension__ ({ \49647#define vcopyq_laneq_s8(__p0_395, __p1_395, __p2_395, __p3_395) __extension__ ({ \
47944 int8x16_t __s0_303 = __p0_303; \49648 int8x16_t __s0_395 = __p0_395; \
47945 int8x16_t __s2_303 = __p2_303; \49649 int8x16_t __s2_395 = __p2_395; \
47946 int8x16_t __ret_303; \49650 int8x16_t __ret_395; \
47947 __ret_303 = vsetq_lane_s8(vgetq_lane_s8(__s2_303, __p3_303), __s0_303, __p1_303); \49651 __ret_395 = vsetq_lane_s8(vgetq_lane_s8(__s2_395, __p3_395), __s0_395, __p1_395); \
47948 __ret_303; \49652 __ret_395; \
47949})49653})
47950#else49654#else
47951#define vcopyq_laneq_s8(__p0_304, __p1_304, __p2_304, __p3_304) __extension__ ({ \49655#define vcopyq_laneq_s8(__p0_396, __p1_396, __p2_396, __p3_396) __extension__ ({ \
47952 int8x16_t __s0_304 = __p0_304; \49656 int8x16_t __s0_396 = __p0_396; \
47953 int8x16_t __s2_304 = __p2_304; \49657 int8x16_t __s2_396 = __p2_396; \
47954 int8x16_t __rev0_304; __rev0_304 = __builtin_shufflevector(__s0_304, __s0_304, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49658 int8x16_t __rev0_396; __rev0_396 = __builtin_shufflevector(__s0_396, __s0_396, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47955 int8x16_t __rev2_304; __rev2_304 = __builtin_shufflevector(__s2_304, __s2_304, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49659 int8x16_t __rev2_396; __rev2_396 = __builtin_shufflevector(__s2_396, __s2_396, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47956 int8x16_t __ret_304; \49660 int8x16_t __ret_396; \
47957 __ret_304 = __noswap_vsetq_lane_s8(__noswap_vgetq_lane_s8(__rev2_304, __p3_304), __rev0_304, __p1_304); \49661 __ret_396 = __noswap_vsetq_lane_s8(__noswap_vgetq_lane_s8(__rev2_396, __p3_396), __rev0_396, __p1_396); \
47958 __ret_304 = __builtin_shufflevector(__ret_304, __ret_304, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49662 __ret_396 = __builtin_shufflevector(__ret_396, __ret_396, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
47959 __ret_304; \49663 __ret_396; \
47960})49664})
47961#endif49665#endif
4796249666
47963#ifdef __LITTLE_ENDIAN__49667#ifdef __LITTLE_ENDIAN__
47964#define vcopyq_laneq_f32(__p0_305, __p1_305, __p2_305, __p3_305) __extension__ ({ \49668#define vcopyq_laneq_f32(__p0_397, __p1_397, __p2_397, __p3_397) __extension__ ({ \
47965 float32x4_t __s0_305 = __p0_305; \49669 float32x4_t __s0_397 = __p0_397; \
47966 float32x4_t __s2_305 = __p2_305; \49670 float32x4_t __s2_397 = __p2_397; \
47967 float32x4_t __ret_305; \49671 float32x4_t __ret_397; \
47968 __ret_305 = vsetq_lane_f32(vgetq_lane_f32(__s2_305, __p3_305), __s0_305, __p1_305); \49672 __ret_397 = vsetq_lane_f32(vgetq_lane_f32(__s2_397, __p3_397), __s0_397, __p1_397); \
47969 __ret_305; \49673 __ret_397; \
47970})49674})
47971#else49675#else
47972#define vcopyq_laneq_f32(__p0_306, __p1_306, __p2_306, __p3_306) __extension__ ({ \49676#define vcopyq_laneq_f32(__p0_398, __p1_398, __p2_398, __p3_398) __extension__ ({ \
47973 float32x4_t __s0_306 = __p0_306; \49677 float32x4_t __s0_398 = __p0_398; \
47974 float32x4_t __s2_306 = __p2_306; \49678 float32x4_t __s2_398 = __p2_398; \
47975 float32x4_t __rev0_306; __rev0_306 = __builtin_shufflevector(__s0_306, __s0_306, 3, 2, 1, 0); \49679 float32x4_t __rev0_398; __rev0_398 = __builtin_shufflevector(__s0_398, __s0_398, 3, 2, 1, 0); \
47976 float32x4_t __rev2_306; __rev2_306 = __builtin_shufflevector(__s2_306, __s2_306, 3, 2, 1, 0); \49680 float32x4_t __rev2_398; __rev2_398 = __builtin_shufflevector(__s2_398, __s2_398, 3, 2, 1, 0); \
47977 float32x4_t __ret_306; \49681 float32x4_t __ret_398; \
47978 __ret_306 = __noswap_vsetq_lane_f32(__noswap_vgetq_lane_f32(__rev2_306, __p3_306), __rev0_306, __p1_306); \49682 __ret_398 = __noswap_vsetq_lane_f32(__noswap_vgetq_lane_f32(__rev2_398, __p3_398), __rev0_398, __p1_398); \
47979 __ret_306 = __builtin_shufflevector(__ret_306, __ret_306, 3, 2, 1, 0); \49683 __ret_398 = __builtin_shufflevector(__ret_398, __ret_398, 3, 2, 1, 0); \
47980 __ret_306; \49684 __ret_398; \
47981})49685})
47982#endif49686#endif
4798349687
47984#ifdef __LITTLE_ENDIAN__49688#ifdef __LITTLE_ENDIAN__
47985#define vcopyq_laneq_s32(__p0_307, __p1_307, __p2_307, __p3_307) __extension__ ({ \49689#define vcopyq_laneq_s32(__p0_399, __p1_399, __p2_399, __p3_399) __extension__ ({ \
47986 int32x4_t __s0_307 = __p0_307; \49690 int32x4_t __s0_399 = __p0_399; \
47987 int32x4_t __s2_307 = __p2_307; \49691 int32x4_t __s2_399 = __p2_399; \
47988 int32x4_t __ret_307; \49692 int32x4_t __ret_399; \
47989 __ret_307 = vsetq_lane_s32(vgetq_lane_s32(__s2_307, __p3_307), __s0_307, __p1_307); \49693 __ret_399 = vsetq_lane_s32(vgetq_lane_s32(__s2_399, __p3_399), __s0_399, __p1_399); \
47990 __ret_307; \49694 __ret_399; \
47991})49695})
47992#else49696#else
47993#define vcopyq_laneq_s32(__p0_308, __p1_308, __p2_308, __p3_308) __extension__ ({ \49697#define vcopyq_laneq_s32(__p0_400, __p1_400, __p2_400, __p3_400) __extension__ ({ \
47994 int32x4_t __s0_308 = __p0_308; \49698 int32x4_t __s0_400 = __p0_400; \
47995 int32x4_t __s2_308 = __p2_308; \49699 int32x4_t __s2_400 = __p2_400; \
47996 int32x4_t __rev0_308; __rev0_308 = __builtin_shufflevector(__s0_308, __s0_308, 3, 2, 1, 0); \49700 int32x4_t __rev0_400; __rev0_400 = __builtin_shufflevector(__s0_400, __s0_400, 3, 2, 1, 0); \
47997 int32x4_t __rev2_308; __rev2_308 = __builtin_shufflevector(__s2_308, __s2_308, 3, 2, 1, 0); \49701 int32x4_t __rev2_400; __rev2_400 = __builtin_shufflevector(__s2_400, __s2_400, 3, 2, 1, 0); \
47998 int32x4_t __ret_308; \49702 int32x4_t __ret_400; \
47999 __ret_308 = __noswap_vsetq_lane_s32(__noswap_vgetq_lane_s32(__rev2_308, __p3_308), __rev0_308, __p1_308); \49703 __ret_400 = __noswap_vsetq_lane_s32(__noswap_vgetq_lane_s32(__rev2_400, __p3_400), __rev0_400, __p1_400); \
48000 __ret_308 = __builtin_shufflevector(__ret_308, __ret_308, 3, 2, 1, 0); \49704 __ret_400 = __builtin_shufflevector(__ret_400, __ret_400, 3, 2, 1, 0); \
48001 __ret_308; \49705 __ret_400; \
48002})49706})
48003#endif49707#endif
4800449708
48005#ifdef __LITTLE_ENDIAN__49709#ifdef __LITTLE_ENDIAN__
48006#define vcopyq_laneq_s64(__p0_309, __p1_309, __p2_309, __p3_309) __extension__ ({ \49710#define vcopyq_laneq_s64(__p0_401, __p1_401, __p2_401, __p3_401) __extension__ ({ \
48007 int64x2_t __s0_309 = __p0_309; \49711 int64x2_t __s0_401 = __p0_401; \
48008 int64x2_t __s2_309 = __p2_309; \49712 int64x2_t __s2_401 = __p2_401; \
48009 int64x2_t __ret_309; \49713 int64x2_t __ret_401; \
48010 __ret_309 = vsetq_lane_s64(vgetq_lane_s64(__s2_309, __p3_309), __s0_309, __p1_309); \49714 __ret_401 = vsetq_lane_s64(vgetq_lane_s64(__s2_401, __p3_401), __s0_401, __p1_401); \
48011 __ret_309; \49715 __ret_401; \
48012})49716})
48013#else49717#else
48014#define vcopyq_laneq_s64(__p0_310, __p1_310, __p2_310, __p3_310) __extension__ ({ \49718#define vcopyq_laneq_s64(__p0_402, __p1_402, __p2_402, __p3_402) __extension__ ({ \
48015 int64x2_t __s0_310 = __p0_310; \49719 int64x2_t __s0_402 = __p0_402; \
48016 int64x2_t __s2_310 = __p2_310; \49720 int64x2_t __s2_402 = __p2_402; \
48017 int64x2_t __rev0_310; __rev0_310 = __builtin_shufflevector(__s0_310, __s0_310, 1, 0); \49721 int64x2_t __rev0_402; __rev0_402 = __builtin_shufflevector(__s0_402, __s0_402, 1, 0); \
48018 int64x2_t __rev2_310; __rev2_310 = __builtin_shufflevector(__s2_310, __s2_310, 1, 0); \49722 int64x2_t __rev2_402; __rev2_402 = __builtin_shufflevector(__s2_402, __s2_402, 1, 0); \
48019 int64x2_t __ret_310; \49723 int64x2_t __ret_402; \
48020 __ret_310 = __noswap_vsetq_lane_s64(__noswap_vgetq_lane_s64(__rev2_310, __p3_310), __rev0_310, __p1_310); \49724 __ret_402 = __noswap_vsetq_lane_s64(__noswap_vgetq_lane_s64(__rev2_402, __p3_402), __rev0_402, __p1_402); \
48021 __ret_310 = __builtin_shufflevector(__ret_310, __ret_310, 1, 0); \49725 __ret_402 = __builtin_shufflevector(__ret_402, __ret_402, 1, 0); \
48022 __ret_310; \49726 __ret_402; \
48023})49727})
48024#endif49728#endif
4802549729
48026#ifdef __LITTLE_ENDIAN__49730#ifdef __LITTLE_ENDIAN__
48027#define vcopyq_laneq_s16(__p0_311, __p1_311, __p2_311, __p3_311) __extension__ ({ \49731#define vcopyq_laneq_s16(__p0_403, __p1_403, __p2_403, __p3_403) __extension__ ({ \
48028 int16x8_t __s0_311 = __p0_311; \49732 int16x8_t __s0_403 = __p0_403; \
48029 int16x8_t __s2_311 = __p2_311; \49733 int16x8_t __s2_403 = __p2_403; \
48030 int16x8_t __ret_311; \49734 int16x8_t __ret_403; \
48031 __ret_311 = vsetq_lane_s16(vgetq_lane_s16(__s2_311, __p3_311), __s0_311, __p1_311); \49735 __ret_403 = vsetq_lane_s16(vgetq_lane_s16(__s2_403, __p3_403), __s0_403, __p1_403); \
48032 __ret_311; \49736 __ret_403; \
48033})49737})
48034#else49738#else
48035#define vcopyq_laneq_s16(__p0_312, __p1_312, __p2_312, __p3_312) __extension__ ({ \49739#define vcopyq_laneq_s16(__p0_404, __p1_404, __p2_404, __p3_404) __extension__ ({ \
48036 int16x8_t __s0_312 = __p0_312; \49740 int16x8_t __s0_404 = __p0_404; \
48037 int16x8_t __s2_312 = __p2_312; \49741 int16x8_t __s2_404 = __p2_404; \
48038 int16x8_t __rev0_312; __rev0_312 = __builtin_shufflevector(__s0_312, __s0_312, 7, 6, 5, 4, 3, 2, 1, 0); \49742 int16x8_t __rev0_404; __rev0_404 = __builtin_shufflevector(__s0_404, __s0_404, 7, 6, 5, 4, 3, 2, 1, 0); \
48039 int16x8_t __rev2_312; __rev2_312 = __builtin_shufflevector(__s2_312, __s2_312, 7, 6, 5, 4, 3, 2, 1, 0); \49743 int16x8_t __rev2_404; __rev2_404 = __builtin_shufflevector(__s2_404, __s2_404, 7, 6, 5, 4, 3, 2, 1, 0); \
48040 int16x8_t __ret_312; \49744 int16x8_t __ret_404; \
48041 __ret_312 = __noswap_vsetq_lane_s16(__noswap_vgetq_lane_s16(__rev2_312, __p3_312), __rev0_312, __p1_312); \49745 __ret_404 = __noswap_vsetq_lane_s16(__noswap_vgetq_lane_s16(__rev2_404, __p3_404), __rev0_404, __p1_404); \
48042 __ret_312 = __builtin_shufflevector(__ret_312, __ret_312, 7, 6, 5, 4, 3, 2, 1, 0); \49746 __ret_404 = __builtin_shufflevector(__ret_404, __ret_404, 7, 6, 5, 4, 3, 2, 1, 0); \
48043 __ret_312; \49747 __ret_404; \
48044})49748})
48045#endif49749#endif
4804649750
48047#ifdef __LITTLE_ENDIAN__49751#ifdef __LITTLE_ENDIAN__
48048#define vcopy_laneq_p8(__p0_313, __p1_313, __p2_313, __p3_313) __extension__ ({ \49752#define vcopy_laneq_p8(__p0_405, __p1_405, __p2_405, __p3_405) __extension__ ({ \
48049 poly8x8_t __s0_313 = __p0_313; \49753 poly8x8_t __s0_405 = __p0_405; \
48050 poly8x16_t __s2_313 = __p2_313; \49754 poly8x16_t __s2_405 = __p2_405; \
48051 poly8x8_t __ret_313; \49755 poly8x8_t __ret_405; \
48052 __ret_313 = vset_lane_p8(vgetq_lane_p8(__s2_313, __p3_313), __s0_313, __p1_313); \49756 __ret_405 = vset_lane_p8(vgetq_lane_p8(__s2_405, __p3_405), __s0_405, __p1_405); \
48053 __ret_313; \49757 __ret_405; \
48054})49758})
48055#else49759#else
48056#define vcopy_laneq_p8(__p0_314, __p1_314, __p2_314, __p3_314) __extension__ ({ \49760#define vcopy_laneq_p8(__p0_406, __p1_406, __p2_406, __p3_406) __extension__ ({ \
48057 poly8x8_t __s0_314 = __p0_314; \49761 poly8x8_t __s0_406 = __p0_406; \
48058 poly8x16_t __s2_314 = __p2_314; \49762 poly8x16_t __s2_406 = __p2_406; \
48059 poly8x8_t __rev0_314; __rev0_314 = __builtin_shufflevector(__s0_314, __s0_314, 7, 6, 5, 4, 3, 2, 1, 0); \49763 poly8x8_t __rev0_406; __rev0_406 = __builtin_shufflevector(__s0_406, __s0_406, 7, 6, 5, 4, 3, 2, 1, 0); \
48060 poly8x16_t __rev2_314; __rev2_314 = __builtin_shufflevector(__s2_314, __s2_314, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49764 poly8x16_t __rev2_406; __rev2_406 = __builtin_shufflevector(__s2_406, __s2_406, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
48061 poly8x8_t __ret_314; \49765 poly8x8_t __ret_406; \
48062 __ret_314 = __noswap_vset_lane_p8(__noswap_vgetq_lane_p8(__rev2_314, __p3_314), __rev0_314, __p1_314); \49766 __ret_406 = __noswap_vset_lane_p8(__noswap_vgetq_lane_p8(__rev2_406, __p3_406), __rev0_406, __p1_406); \
48063 __ret_314 = __builtin_shufflevector(__ret_314, __ret_314, 7, 6, 5, 4, 3, 2, 1, 0); \49767 __ret_406 = __builtin_shufflevector(__ret_406, __ret_406, 7, 6, 5, 4, 3, 2, 1, 0); \
48064 __ret_314; \49768 __ret_406; \
48065})49769})
48066#endif49770#endif
4806749771
48068#ifdef __LITTLE_ENDIAN__49772#ifdef __LITTLE_ENDIAN__
48069#define vcopy_laneq_p16(__p0_315, __p1_315, __p2_315, __p3_315) __extension__ ({ \49773#define vcopy_laneq_p16(__p0_407, __p1_407, __p2_407, __p3_407) __extension__ ({ \
48070 poly16x4_t __s0_315 = __p0_315; \49774 poly16x4_t __s0_407 = __p0_407; \
48071 poly16x8_t __s2_315 = __p2_315; \49775 poly16x8_t __s2_407 = __p2_407; \
48072 poly16x4_t __ret_315; \49776 poly16x4_t __ret_407; \
48073 __ret_315 = vset_lane_p16(vgetq_lane_p16(__s2_315, __p3_315), __s0_315, __p1_315); \49777 __ret_407 = vset_lane_p16(vgetq_lane_p16(__s2_407, __p3_407), __s0_407, __p1_407); \
48074 __ret_315; \49778 __ret_407; \
48075})49779})
48076#else49780#else
48077#define vcopy_laneq_p16(__p0_316, __p1_316, __p2_316, __p3_316) __extension__ ({ \49781#define vcopy_laneq_p16(__p0_408, __p1_408, __p2_408, __p3_408) __extension__ ({ \
48078 poly16x4_t __s0_316 = __p0_316; \49782 poly16x4_t __s0_408 = __p0_408; \
48079 poly16x8_t __s2_316 = __p2_316; \49783 poly16x8_t __s2_408 = __p2_408; \
48080 poly16x4_t __rev0_316; __rev0_316 = __builtin_shufflevector(__s0_316, __s0_316, 3, 2, 1, 0); \49784 poly16x4_t __rev0_408; __rev0_408 = __builtin_shufflevector(__s0_408, __s0_408, 3, 2, 1, 0); \
48081 poly16x8_t __rev2_316; __rev2_316 = __builtin_shufflevector(__s2_316, __s2_316, 7, 6, 5, 4, 3, 2, 1, 0); \49785 poly16x8_t __rev2_408; __rev2_408 = __builtin_shufflevector(__s2_408, __s2_408, 7, 6, 5, 4, 3, 2, 1, 0); \
48082 poly16x4_t __ret_316; \49786 poly16x4_t __ret_408; \
48083 __ret_316 = __noswap_vset_lane_p16(__noswap_vgetq_lane_p16(__rev2_316, __p3_316), __rev0_316, __p1_316); \49787 __ret_408 = __noswap_vset_lane_p16(__noswap_vgetq_lane_p16(__rev2_408, __p3_408), __rev0_408, __p1_408); \
48084 __ret_316 = __builtin_shufflevector(__ret_316, __ret_316, 3, 2, 1, 0); \49788 __ret_408 = __builtin_shufflevector(__ret_408, __ret_408, 3, 2, 1, 0); \
48085 __ret_316; \49789 __ret_408; \
48086})49790})
48087#endif49791#endif
4808849792
48089#ifdef __LITTLE_ENDIAN__49793#ifdef __LITTLE_ENDIAN__
48090#define vcopy_laneq_u8(__p0_317, __p1_317, __p2_317, __p3_317) __extension__ ({ \49794#define vcopy_laneq_u8(__p0_409, __p1_409, __p2_409, __p3_409) __extension__ ({ \
48091 uint8x8_t __s0_317 = __p0_317; \49795 uint8x8_t __s0_409 = __p0_409; \
48092 uint8x16_t __s2_317 = __p2_317; \49796 uint8x16_t __s2_409 = __p2_409; \
48093 uint8x8_t __ret_317; \49797 uint8x8_t __ret_409; \
48094 __ret_317 = vset_lane_u8(vgetq_lane_u8(__s2_317, __p3_317), __s0_317, __p1_317); \49798 __ret_409 = vset_lane_u8(vgetq_lane_u8(__s2_409, __p3_409), __s0_409, __p1_409); \
48095 __ret_317; \49799 __ret_409; \
48096})49800})
48097#else49801#else
48098#define vcopy_laneq_u8(__p0_318, __p1_318, __p2_318, __p3_318) __extension__ ({ \49802#define vcopy_laneq_u8(__p0_410, __p1_410, __p2_410, __p3_410) __extension__ ({ \
48099 uint8x8_t __s0_318 = __p0_318; \49803 uint8x8_t __s0_410 = __p0_410; \
48100 uint8x16_t __s2_318 = __p2_318; \49804 uint8x16_t __s2_410 = __p2_410; \
48101 uint8x8_t __rev0_318; __rev0_318 = __builtin_shufflevector(__s0_318, __s0_318, 7, 6, 5, 4, 3, 2, 1, 0); \49805 uint8x8_t __rev0_410; __rev0_410 = __builtin_shufflevector(__s0_410, __s0_410, 7, 6, 5, 4, 3, 2, 1, 0); \
48102 uint8x16_t __rev2_318; __rev2_318 = __builtin_shufflevector(__s2_318, __s2_318, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49806 uint8x16_t __rev2_410; __rev2_410 = __builtin_shufflevector(__s2_410, __s2_410, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
48103 uint8x8_t __ret_318; \49807 uint8x8_t __ret_410; \
48104 __ret_318 = __noswap_vset_lane_u8(__noswap_vgetq_lane_u8(__rev2_318, __p3_318), __rev0_318, __p1_318); \49808 __ret_410 = __noswap_vset_lane_u8(__noswap_vgetq_lane_u8(__rev2_410, __p3_410), __rev0_410, __p1_410); \
48105 __ret_318 = __builtin_shufflevector(__ret_318, __ret_318, 7, 6, 5, 4, 3, 2, 1, 0); \49809 __ret_410 = __builtin_shufflevector(__ret_410, __ret_410, 7, 6, 5, 4, 3, 2, 1, 0); \
48106 __ret_318; \49810 __ret_410; \
48107})49811})
48108#endif49812#endif
4810949813
48110#ifdef __LITTLE_ENDIAN__49814#ifdef __LITTLE_ENDIAN__
48111#define vcopy_laneq_u32(__p0_319, __p1_319, __p2_319, __p3_319) __extension__ ({ \49815#define vcopy_laneq_u32(__p0_411, __p1_411, __p2_411, __p3_411) __extension__ ({ \
48112 uint32x2_t __s0_319 = __p0_319; \49816 uint32x2_t __s0_411 = __p0_411; \
48113 uint32x4_t __s2_319 = __p2_319; \49817 uint32x4_t __s2_411 = __p2_411; \
48114 uint32x2_t __ret_319; \49818 uint32x2_t __ret_411; \
48115 __ret_319 = vset_lane_u32(vgetq_lane_u32(__s2_319, __p3_319), __s0_319, __p1_319); \49819 __ret_411 = vset_lane_u32(vgetq_lane_u32(__s2_411, __p3_411), __s0_411, __p1_411); \
48116 __ret_319; \49820 __ret_411; \
48117})49821})
48118#else49822#else
48119#define vcopy_laneq_u32(__p0_320, __p1_320, __p2_320, __p3_320) __extension__ ({ \49823#define vcopy_laneq_u32(__p0_412, __p1_412, __p2_412, __p3_412) __extension__ ({ \
48120 uint32x2_t __s0_320 = __p0_320; \49824 uint32x2_t __s0_412 = __p0_412; \
48121 uint32x4_t __s2_320 = __p2_320; \49825 uint32x4_t __s2_412 = __p2_412; \
48122 uint32x2_t __rev0_320; __rev0_320 = __builtin_shufflevector(__s0_320, __s0_320, 1, 0); \49826 uint32x2_t __rev0_412; __rev0_412 = __builtin_shufflevector(__s0_412, __s0_412, 1, 0); \
48123 uint32x4_t __rev2_320; __rev2_320 = __builtin_shufflevector(__s2_320, __s2_320, 3, 2, 1, 0); \49827 uint32x4_t __rev2_412; __rev2_412 = __builtin_shufflevector(__s2_412, __s2_412, 3, 2, 1, 0); \
48124 uint32x2_t __ret_320; \49828 uint32x2_t __ret_412; \
48125 __ret_320 = __noswap_vset_lane_u32(__noswap_vgetq_lane_u32(__rev2_320, __p3_320), __rev0_320, __p1_320); \49829 __ret_412 = __noswap_vset_lane_u32(__noswap_vgetq_lane_u32(__rev2_412, __p3_412), __rev0_412, __p1_412); \
48126 __ret_320 = __builtin_shufflevector(__ret_320, __ret_320, 1, 0); \49830 __ret_412 = __builtin_shufflevector(__ret_412, __ret_412, 1, 0); \
48127 __ret_320; \49831 __ret_412; \
48128})49832})
48129#endif49833#endif
4813049834
48131#ifdef __LITTLE_ENDIAN__49835#ifdef __LITTLE_ENDIAN__
48132#define vcopy_laneq_u64(__p0_321, __p1_321, __p2_321, __p3_321) __extension__ ({ \49836#define vcopy_laneq_u64(__p0_413, __p1_413, __p2_413, __p3_413) __extension__ ({ \
48133 uint64x1_t __s0_321 = __p0_321; \49837 uint64x1_t __s0_413 = __p0_413; \
48134 uint64x2_t __s2_321 = __p2_321; \49838 uint64x2_t __s2_413 = __p2_413; \
48135 uint64x1_t __ret_321; \49839 uint64x1_t __ret_413; \
48136 __ret_321 = vset_lane_u64(vgetq_lane_u64(__s2_321, __p3_321), __s0_321, __p1_321); \49840 __ret_413 = vset_lane_u64(vgetq_lane_u64(__s2_413, __p3_413), __s0_413, __p1_413); \
48137 __ret_321; \49841 __ret_413; \
48138})49842})
48139#else49843#else
48140#define vcopy_laneq_u64(__p0_322, __p1_322, __p2_322, __p3_322) __extension__ ({ \49844#define vcopy_laneq_u64(__p0_414, __p1_414, __p2_414, __p3_414) __extension__ ({ \
48141 uint64x1_t __s0_322 = __p0_322; \49845 uint64x1_t __s0_414 = __p0_414; \
48142 uint64x2_t __s2_322 = __p2_322; \49846 uint64x2_t __s2_414 = __p2_414; \
48143 uint64x2_t __rev2_322; __rev2_322 = __builtin_shufflevector(__s2_322, __s2_322, 1, 0); \49847 uint64x2_t __rev2_414; __rev2_414 = __builtin_shufflevector(__s2_414, __s2_414, 1, 0); \
48144 uint64x1_t __ret_322; \49848 uint64x1_t __ret_414; \
48145 __ret_322 = vset_lane_u64(__noswap_vgetq_lane_u64(__rev2_322, __p3_322), __s0_322, __p1_322); \49849 __ret_414 = vset_lane_u64(__noswap_vgetq_lane_u64(__rev2_414, __p3_414), __s0_414, __p1_414); \
48146 __ret_322; \49850 __ret_414; \
48147})49851})
48148#endif49852#endif
4814949853
48150#ifdef __LITTLE_ENDIAN__49854#ifdef __LITTLE_ENDIAN__
48151#define vcopy_laneq_u16(__p0_323, __p1_323, __p2_323, __p3_323) __extension__ ({ \49855#define vcopy_laneq_u16(__p0_415, __p1_415, __p2_415, __p3_415) __extension__ ({ \
48152 uint16x4_t __s0_323 = __p0_323; \49856 uint16x4_t __s0_415 = __p0_415; \
48153 uint16x8_t __s2_323 = __p2_323; \49857 uint16x8_t __s2_415 = __p2_415; \
48154 uint16x4_t __ret_323; \49858 uint16x4_t __ret_415; \
48155 __ret_323 = vset_lane_u16(vgetq_lane_u16(__s2_323, __p3_323), __s0_323, __p1_323); \49859 __ret_415 = vset_lane_u16(vgetq_lane_u16(__s2_415, __p3_415), __s0_415, __p1_415); \
48156 __ret_323; \49860 __ret_415; \
48157})49861})
48158#else49862#else
48159#define vcopy_laneq_u16(__p0_324, __p1_324, __p2_324, __p3_324) __extension__ ({ \49863#define vcopy_laneq_u16(__p0_416, __p1_416, __p2_416, __p3_416) __extension__ ({ \
48160 uint16x4_t __s0_324 = __p0_324; \49864 uint16x4_t __s0_416 = __p0_416; \
48161 uint16x8_t __s2_324 = __p2_324; \49865 uint16x8_t __s2_416 = __p2_416; \
48162 uint16x4_t __rev0_324; __rev0_324 = __builtin_shufflevector(__s0_324, __s0_324, 3, 2, 1, 0); \49866 uint16x4_t __rev0_416; __rev0_416 = __builtin_shufflevector(__s0_416, __s0_416, 3, 2, 1, 0); \
48163 uint16x8_t __rev2_324; __rev2_324 = __builtin_shufflevector(__s2_324, __s2_324, 7, 6, 5, 4, 3, 2, 1, 0); \49867 uint16x8_t __rev2_416; __rev2_416 = __builtin_shufflevector(__s2_416, __s2_416, 7, 6, 5, 4, 3, 2, 1, 0); \
48164 uint16x4_t __ret_324; \49868 uint16x4_t __ret_416; \
48165 __ret_324 = __noswap_vset_lane_u16(__noswap_vgetq_lane_u16(__rev2_324, __p3_324), __rev0_324, __p1_324); \49869 __ret_416 = __noswap_vset_lane_u16(__noswap_vgetq_lane_u16(__rev2_416, __p3_416), __rev0_416, __p1_416); \
48166 __ret_324 = __builtin_shufflevector(__ret_324, __ret_324, 3, 2, 1, 0); \49870 __ret_416 = __builtin_shufflevector(__ret_416, __ret_416, 3, 2, 1, 0); \
48167 __ret_324; \49871 __ret_416; \
48168})49872})
48169#endif49873#endif
4817049874
48171#ifdef __LITTLE_ENDIAN__49875#ifdef __LITTLE_ENDIAN__
48172#define vcopy_laneq_s8(__p0_325, __p1_325, __p2_325, __p3_325) __extension__ ({ \49876#define vcopy_laneq_s8(__p0_417, __p1_417, __p2_417, __p3_417) __extension__ ({ \
48173 int8x8_t __s0_325 = __p0_325; \49877 int8x8_t __s0_417 = __p0_417; \
48174 int8x16_t __s2_325 = __p2_325; \49878 int8x16_t __s2_417 = __p2_417; \
48175 int8x8_t __ret_325; \49879 int8x8_t __ret_417; \
48176 __ret_325 = vset_lane_s8(vgetq_lane_s8(__s2_325, __p3_325), __s0_325, __p1_325); \49880 __ret_417 = vset_lane_s8(vgetq_lane_s8(__s2_417, __p3_417), __s0_417, __p1_417); \
48177 __ret_325; \49881 __ret_417; \
48178})49882})
48179#else49883#else
48180#define vcopy_laneq_s8(__p0_326, __p1_326, __p2_326, __p3_326) __extension__ ({ \49884#define vcopy_laneq_s8(__p0_418, __p1_418, __p2_418, __p3_418) __extension__ ({ \
48181 int8x8_t __s0_326 = __p0_326; \49885 int8x8_t __s0_418 = __p0_418; \
48182 int8x16_t __s2_326 = __p2_326; \49886 int8x16_t __s2_418 = __p2_418; \
48183 int8x8_t __rev0_326; __rev0_326 = __builtin_shufflevector(__s0_326, __s0_326, 7, 6, 5, 4, 3, 2, 1, 0); \49887 int8x8_t __rev0_418; __rev0_418 = __builtin_shufflevector(__s0_418, __s0_418, 7, 6, 5, 4, 3, 2, 1, 0); \
48184 int8x16_t __rev2_326; __rev2_326 = __builtin_shufflevector(__s2_326, __s2_326, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \49888 int8x16_t __rev2_418; __rev2_418 = __builtin_shufflevector(__s2_418, __s2_418, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
48185 int8x8_t __ret_326; \49889 int8x8_t __ret_418; \
48186 __ret_326 = __noswap_vset_lane_s8(__noswap_vgetq_lane_s8(__rev2_326, __p3_326), __rev0_326, __p1_326); \49890 __ret_418 = __noswap_vset_lane_s8(__noswap_vgetq_lane_s8(__rev2_418, __p3_418), __rev0_418, __p1_418); \
48187 __ret_326 = __builtin_shufflevector(__ret_326, __ret_326, 7, 6, 5, 4, 3, 2, 1, 0); \49891 __ret_418 = __builtin_shufflevector(__ret_418, __ret_418, 7, 6, 5, 4, 3, 2, 1, 0); \
48188 __ret_326; \49892 __ret_418; \
48189})49893})
48190#endif49894#endif
4819149895
48192#ifdef __LITTLE_ENDIAN__49896#ifdef __LITTLE_ENDIAN__
48193#define vcopy_laneq_f32(__p0_327, __p1_327, __p2_327, __p3_327) __extension__ ({ \49897#define vcopy_laneq_f32(__p0_419, __p1_419, __p2_419, __p3_419) __extension__ ({ \
48194 float32x2_t __s0_327 = __p0_327; \49898 float32x2_t __s0_419 = __p0_419; \
48195 float32x4_t __s2_327 = __p2_327; \49899 float32x4_t __s2_419 = __p2_419; \
48196 float32x2_t __ret_327; \49900 float32x2_t __ret_419; \
48197 __ret_327 = vset_lane_f32(vgetq_lane_f32(__s2_327, __p3_327), __s0_327, __p1_327); \49901 __ret_419 = vset_lane_f32(vgetq_lane_f32(__s2_419, __p3_419), __s0_419, __p1_419); \
48198 __ret_327; \49902 __ret_419; \
48199})49903})
48200#else49904#else
48201#define vcopy_laneq_f32(__p0_328, __p1_328, __p2_328, __p3_328) __extension__ ({ \49905#define vcopy_laneq_f32(__p0_420, __p1_420, __p2_420, __p3_420) __extension__ ({ \
48202 float32x2_t __s0_328 = __p0_328; \49906 float32x2_t __s0_420 = __p0_420; \
48203 float32x4_t __s2_328 = __p2_328; \49907 float32x4_t __s2_420 = __p2_420; \
48204 float32x2_t __rev0_328; __rev0_328 = __builtin_shufflevector(__s0_328, __s0_328, 1, 0); \49908 float32x2_t __rev0_420; __rev0_420 = __builtin_shufflevector(__s0_420, __s0_420, 1, 0); \
48205 float32x4_t __rev2_328; __rev2_328 = __builtin_shufflevector(__s2_328, __s2_328, 3, 2, 1, 0); \49909 float32x4_t __rev2_420; __rev2_420 = __builtin_shufflevector(__s2_420, __s2_420, 3, 2, 1, 0); \
48206 float32x2_t __ret_328; \49910 float32x2_t __ret_420; \
48207 __ret_328 = __noswap_vset_lane_f32(__noswap_vgetq_lane_f32(__rev2_328, __p3_328), __rev0_328, __p1_328); \49911 __ret_420 = __noswap_vset_lane_f32(__noswap_vgetq_lane_f32(__rev2_420, __p3_420), __rev0_420, __p1_420); \
48208 __ret_328 = __builtin_shufflevector(__ret_328, __ret_328, 1, 0); \49912 __ret_420 = __builtin_shufflevector(__ret_420, __ret_420, 1, 0); \
48209 __ret_328; \49913 __ret_420; \
48210})49914})
48211#endif49915#endif
4821249916
48213#ifdef __LITTLE_ENDIAN__49917#ifdef __LITTLE_ENDIAN__
48214#define vcopy_laneq_s32(__p0_329, __p1_329, __p2_329, __p3_329) __extension__ ({ \49918#define vcopy_laneq_s32(__p0_421, __p1_421, __p2_421, __p3_421) __extension__ ({ \
48215 int32x2_t __s0_329 = __p0_329; \49919 int32x2_t __s0_421 = __p0_421; \
48216 int32x4_t __s2_329 = __p2_329; \49920 int32x4_t __s2_421 = __p2_421; \
48217 int32x2_t __ret_329; \49921 int32x2_t __ret_421; \
48218 __ret_329 = vset_lane_s32(vgetq_lane_s32(__s2_329, __p3_329), __s0_329, __p1_329); \49922 __ret_421 = vset_lane_s32(vgetq_lane_s32(__s2_421, __p3_421), __s0_421, __p1_421); \
48219 __ret_329; \49923 __ret_421; \
48220})49924})
48221#else49925#else
48222#define vcopy_laneq_s32(__p0_330, __p1_330, __p2_330, __p3_330) __extension__ ({ \49926#define vcopy_laneq_s32(__p0_422, __p1_422, __p2_422, __p3_422) __extension__ ({ \
48223 int32x2_t __s0_330 = __p0_330; \49927 int32x2_t __s0_422 = __p0_422; \
48224 int32x4_t __s2_330 = __p2_330; \49928 int32x4_t __s2_422 = __p2_422; \
48225 int32x2_t __rev0_330; __rev0_330 = __builtin_shufflevector(__s0_330, __s0_330, 1, 0); \49929 int32x2_t __rev0_422; __rev0_422 = __builtin_shufflevector(__s0_422, __s0_422, 1, 0); \
48226 int32x4_t __rev2_330; __rev2_330 = __builtin_shufflevector(__s2_330, __s2_330, 3, 2, 1, 0); \49930 int32x4_t __rev2_422; __rev2_422 = __builtin_shufflevector(__s2_422, __s2_422, 3, 2, 1, 0); \
48227 int32x2_t __ret_330; \49931 int32x2_t __ret_422; \
48228 __ret_330 = __noswap_vset_lane_s32(__noswap_vgetq_lane_s32(__rev2_330, __p3_330), __rev0_330, __p1_330); \49932 __ret_422 = __noswap_vset_lane_s32(__noswap_vgetq_lane_s32(__rev2_422, __p3_422), __rev0_422, __p1_422); \
48229 __ret_330 = __builtin_shufflevector(__ret_330, __ret_330, 1, 0); \49933 __ret_422 = __builtin_shufflevector(__ret_422, __ret_422, 1, 0); \
48230 __ret_330; \49934 __ret_422; \
48231})49935})
48232#endif49936#endif
4823349937
48234#ifdef __LITTLE_ENDIAN__49938#ifdef __LITTLE_ENDIAN__
48235#define vcopy_laneq_s64(__p0_331, __p1_331, __p2_331, __p3_331) __extension__ ({ \49939#define vcopy_laneq_s64(__p0_423, __p1_423, __p2_423, __p3_423) __extension__ ({ \
48236 int64x1_t __s0_331 = __p0_331; \49940 int64x1_t __s0_423 = __p0_423; \
48237 int64x2_t __s2_331 = __p2_331; \49941 int64x2_t __s2_423 = __p2_423; \
48238 int64x1_t __ret_331; \49942 int64x1_t __ret_423; \
48239 __ret_331 = vset_lane_s64(vgetq_lane_s64(__s2_331, __p3_331), __s0_331, __p1_331); \49943 __ret_423 = vset_lane_s64(vgetq_lane_s64(__s2_423, __p3_423), __s0_423, __p1_423); \
48240 __ret_331; \49944 __ret_423; \
48241})49945})
48242#else49946#else
48243#define vcopy_laneq_s64(__p0_332, __p1_332, __p2_332, __p3_332) __extension__ ({ \49947#define vcopy_laneq_s64(__p0_424, __p1_424, __p2_424, __p3_424) __extension__ ({ \
48244 int64x1_t __s0_332 = __p0_332; \49948 int64x1_t __s0_424 = __p0_424; \
48245 int64x2_t __s2_332 = __p2_332; \49949 int64x2_t __s2_424 = __p2_424; \
48246 int64x2_t __rev2_332; __rev2_332 = __builtin_shufflevector(__s2_332, __s2_332, 1, 0); \49950 int64x2_t __rev2_424; __rev2_424 = __builtin_shufflevector(__s2_424, __s2_424, 1, 0); \
48247 int64x1_t __ret_332; \49951 int64x1_t __ret_424; \
48248 __ret_332 = vset_lane_s64(__noswap_vgetq_lane_s64(__rev2_332, __p3_332), __s0_332, __p1_332); \49952 __ret_424 = vset_lane_s64(__noswap_vgetq_lane_s64(__rev2_424, __p3_424), __s0_424, __p1_424); \
48249 __ret_332; \49953 __ret_424; \
48250})49954})
48251#endif49955#endif
4825249956
48253#ifdef __LITTLE_ENDIAN__49957#ifdef __LITTLE_ENDIAN__
48254#define vcopy_laneq_s16(__p0_333, __p1_333, __p2_333, __p3_333) __extension__ ({ \49958#define vcopy_laneq_s16(__p0_425, __p1_425, __p2_425, __p3_425) __extension__ ({ \
48255 int16x4_t __s0_333 = __p0_333; \49959 int16x4_t __s0_425 = __p0_425; \
48256 int16x8_t __s2_333 = __p2_333; \49960 int16x8_t __s2_425 = __p2_425; \
48257 int16x4_t __ret_333; \49961 int16x4_t __ret_425; \
48258 __ret_333 = vset_lane_s16(vgetq_lane_s16(__s2_333, __p3_333), __s0_333, __p1_333); \49962 __ret_425 = vset_lane_s16(vgetq_lane_s16(__s2_425, __p3_425), __s0_425, __p1_425); \
48259 __ret_333; \49963 __ret_425; \
48260})49964})
48261#else49965#else
48262#define vcopy_laneq_s16(__p0_334, __p1_334, __p2_334, __p3_334) __extension__ ({ \49966#define vcopy_laneq_s16(__p0_426, __p1_426, __p2_426, __p3_426) __extension__ ({ \
48263 int16x4_t __s0_334 = __p0_334; \49967 int16x4_t __s0_426 = __p0_426; \
48264 int16x8_t __s2_334 = __p2_334; \49968 int16x8_t __s2_426 = __p2_426; \
48265 int16x4_t __rev0_334; __rev0_334 = __builtin_shufflevector(__s0_334, __s0_334, 3, 2, 1, 0); \49969 int16x4_t __rev0_426; __rev0_426 = __builtin_shufflevector(__s0_426, __s0_426, 3, 2, 1, 0); \
48266 int16x8_t __rev2_334; __rev2_334 = __builtin_shufflevector(__s2_334, __s2_334, 7, 6, 5, 4, 3, 2, 1, 0); \49970 int16x8_t __rev2_426; __rev2_426 = __builtin_shufflevector(__s2_426, __s2_426, 7, 6, 5, 4, 3, 2, 1, 0); \
48267 int16x4_t __ret_334; \49971 int16x4_t __ret_426; \
48268 __ret_334 = __noswap_vset_lane_s16(__noswap_vgetq_lane_s16(__rev2_334, __p3_334), __rev0_334, __p1_334); \49972 __ret_426 = __noswap_vset_lane_s16(__noswap_vgetq_lane_s16(__rev2_426, __p3_426), __rev0_426, __p1_426); \
48269 __ret_334 = __builtin_shufflevector(__ret_334, __ret_334, 3, 2, 1, 0); \49973 __ret_426 = __builtin_shufflevector(__ret_426, __ret_426, 3, 2, 1, 0); \
48270 __ret_334; \49974 __ret_426; \
48271})49975})
48272#endif49976#endif
4827349977
...@@ -49009,85 +50713,85 @@ __ai float32x2_t vdiv_f32(float32x2_t __p0, float32x2_t __p1) {...@@ -49009,85 +50713,85 @@ __ai float32x2_t vdiv_f32(float32x2_t __p0, float32x2_t __p1) {
49009})50713})
49010#endif50714#endif
4901150715
49012#define vdup_lane_p64(__p0_335, __p1_335) __extension__ ({ \50716#define vdup_lane_p64(__p0_427, __p1_427) __extension__ ({ \
49013 poly64x1_t __s0_335 = __p0_335; \50717 poly64x1_t __s0_427 = __p0_427; \
49014 poly64x1_t __ret_335; \50718 poly64x1_t __ret_427; \
49015 __ret_335 = splat_lane_p64(__s0_335, __p1_335); \50719 __ret_427 = splat_lane_p64(__s0_427, __p1_427); \
49016 __ret_335; \50720 __ret_427; \
49017})50721})
49018#ifdef __LITTLE_ENDIAN__50722#ifdef __LITTLE_ENDIAN__
49019#define vdupq_lane_p64(__p0_336, __p1_336) __extension__ ({ \50723#define vdupq_lane_p64(__p0_428, __p1_428) __extension__ ({ \
49020 poly64x1_t __s0_336 = __p0_336; \50724 poly64x1_t __s0_428 = __p0_428; \
49021 poly64x2_t __ret_336; \50725 poly64x2_t __ret_428; \
49022 __ret_336 = splatq_lane_p64(__s0_336, __p1_336); \50726 __ret_428 = splatq_lane_p64(__s0_428, __p1_428); \
49023 __ret_336; \50727 __ret_428; \
49024})50728})
49025#else50729#else
49026#define vdupq_lane_p64(__p0_337, __p1_337) __extension__ ({ \50730#define vdupq_lane_p64(__p0_429, __p1_429) __extension__ ({ \
49027 poly64x1_t __s0_337 = __p0_337; \50731 poly64x1_t __s0_429 = __p0_429; \
49028 poly64x2_t __ret_337; \50732 poly64x2_t __ret_429; \
49029 __ret_337 = __noswap_splatq_lane_p64(__s0_337, __p1_337); \50733 __ret_429 = __noswap_splatq_lane_p64(__s0_429, __p1_429); \
49030 __ret_337 = __builtin_shufflevector(__ret_337, __ret_337, 1, 0); \50734 __ret_429 = __builtin_shufflevector(__ret_429, __ret_429, 1, 0); \
49031 __ret_337; \50735 __ret_429; \
49032})50736})
49033#endif50737#endif
4903450738
49035#ifdef __LITTLE_ENDIAN__50739#ifdef __LITTLE_ENDIAN__
49036#define vdupq_lane_f64(__p0_338, __p1_338) __extension__ ({ \50740#define vdupq_lane_f64(__p0_430, __p1_430) __extension__ ({ \
49037 float64x1_t __s0_338 = __p0_338; \50741 float64x1_t __s0_430 = __p0_430; \
49038 float64x2_t __ret_338; \50742 float64x2_t __ret_430; \
49039 __ret_338 = splatq_lane_f64(__s0_338, __p1_338); \50743 __ret_430 = splatq_lane_f64(__s0_430, __p1_430); \
49040 __ret_338; \50744 __ret_430; \
49041})50745})
49042#else50746#else
49043#define vdupq_lane_f64(__p0_339, __p1_339) __extension__ ({ \50747#define vdupq_lane_f64(__p0_431, __p1_431) __extension__ ({ \
49044 float64x1_t __s0_339 = __p0_339; \50748 float64x1_t __s0_431 = __p0_431; \
49045 float64x2_t __ret_339; \50749 float64x2_t __ret_431; \
49046 __ret_339 = __noswap_splatq_lane_f64(__s0_339, __p1_339); \50750 __ret_431 = __noswap_splatq_lane_f64(__s0_431, __p1_431); \
49047 __ret_339 = __builtin_shufflevector(__ret_339, __ret_339, 1, 0); \50751 __ret_431 = __builtin_shufflevector(__ret_431, __ret_431, 1, 0); \
49048 __ret_339; \50752 __ret_431; \
49049})50753})
49050#endif50754#endif
4905150755
49052#ifdef __LITTLE_ENDIAN__50756#ifdef __LITTLE_ENDIAN__
49053#define vdupq_lane_f16(__p0_340, __p1_340) __extension__ ({ \50757#define vdupq_lane_f16(__p0_432, __p1_432) __extension__ ({ \
49054 float16x4_t __s0_340 = __p0_340; \50758 float16x4_t __s0_432 = __p0_432; \
49055 float16x8_t __ret_340; \50759 float16x8_t __ret_432; \
49056 __ret_340 = splatq_lane_f16(__s0_340, __p1_340); \50760 __ret_432 = splatq_lane_f16(__s0_432, __p1_432); \
49057 __ret_340; \50761 __ret_432; \
49058})50762})
49059#else50763#else
49060#define vdupq_lane_f16(__p0_341, __p1_341) __extension__ ({ \50764#define vdupq_lane_f16(__p0_433, __p1_433) __extension__ ({ \
49061 float16x4_t __s0_341 = __p0_341; \50765 float16x4_t __s0_433 = __p0_433; \
49062 float16x4_t __rev0_341; __rev0_341 = __builtin_shufflevector(__s0_341, __s0_341, 3, 2, 1, 0); \50766 float16x4_t __rev0_433; __rev0_433 = __builtin_shufflevector(__s0_433, __s0_433, 3, 2, 1, 0); \
49063 float16x8_t __ret_341; \50767 float16x8_t __ret_433; \
49064 __ret_341 = __noswap_splatq_lane_f16(__rev0_341, __p1_341); \50768 __ret_433 = __noswap_splatq_lane_f16(__rev0_433, __p1_433); \
49065 __ret_341 = __builtin_shufflevector(__ret_341, __ret_341, 7, 6, 5, 4, 3, 2, 1, 0); \50769 __ret_433 = __builtin_shufflevector(__ret_433, __ret_433, 7, 6, 5, 4, 3, 2, 1, 0); \
49066 __ret_341; \50770 __ret_433; \
49067})50771})
49068#endif50772#endif
4906950773
49070#define vdup_lane_f64(__p0_342, __p1_342) __extension__ ({ \50774#define vdup_lane_f64(__p0_434, __p1_434) __extension__ ({ \
49071 float64x1_t __s0_342 = __p0_342; \50775 float64x1_t __s0_434 = __p0_434; \
49072 float64x1_t __ret_342; \50776 float64x1_t __ret_434; \
49073 __ret_342 = splat_lane_f64(__s0_342, __p1_342); \50777 __ret_434 = splat_lane_f64(__s0_434, __p1_434); \
49074 __ret_342; \50778 __ret_434; \
49075})50779})
49076#ifdef __LITTLE_ENDIAN__50780#ifdef __LITTLE_ENDIAN__
49077#define vdup_lane_f16(__p0_343, __p1_343) __extension__ ({ \50781#define vdup_lane_f16(__p0_435, __p1_435) __extension__ ({ \
49078 float16x4_t __s0_343 = __p0_343; \50782 float16x4_t __s0_435 = __p0_435; \
49079 float16x4_t __ret_343; \50783 float16x4_t __ret_435; \
49080 __ret_343 = splat_lane_f16(__s0_343, __p1_343); \50784 __ret_435 = splat_lane_f16(__s0_435, __p1_435); \
49081 __ret_343; \50785 __ret_435; \
49082})50786})
49083#else50787#else
49084#define vdup_lane_f16(__p0_344, __p1_344) __extension__ ({ \50788#define vdup_lane_f16(__p0_436, __p1_436) __extension__ ({ \
49085 float16x4_t __s0_344 = __p0_344; \50789 float16x4_t __s0_436 = __p0_436; \
49086 float16x4_t __rev0_344; __rev0_344 = __builtin_shufflevector(__s0_344, __s0_344, 3, 2, 1, 0); \50790 float16x4_t __rev0_436; __rev0_436 = __builtin_shufflevector(__s0_436, __s0_436, 3, 2, 1, 0); \
49087 float16x4_t __ret_344; \50791 float16x4_t __ret_436; \
49088 __ret_344 = __noswap_splat_lane_f16(__rev0_344, __p1_344); \50792 __ret_436 = __noswap_splat_lane_f16(__rev0_436, __p1_436); \
49089 __ret_344 = __builtin_shufflevector(__ret_344, __ret_344, 3, 2, 1, 0); \50793 __ret_436 = __builtin_shufflevector(__ret_436, __ret_436, 3, 2, 1, 0); \
49090 __ret_344; \50794 __ret_436; \
49091})50795})
49092#endif50796#endif
4909350797
...@@ -49296,502 +51000,502 @@ __ai float32x2_t vdiv_f32(float32x2_t __p0, float32x2_t __p1) {...@@ -49296,502 +51000,502 @@ __ai float32x2_t vdiv_f32(float32x2_t __p0, float32x2_t __p1) {
49296#endif51000#endif
4929751001
49298#ifdef __LITTLE_ENDIAN__51002#ifdef __LITTLE_ENDIAN__
49299#define vdup_laneq_p8(__p0_345, __p1_345) __extension__ ({ \51003#define vdup_laneq_p8(__p0_437, __p1_437) __extension__ ({ \
49300 poly8x16_t __s0_345 = __p0_345; \51004 poly8x16_t __s0_437 = __p0_437; \
49301 poly8x8_t __ret_345; \51005 poly8x8_t __ret_437; \
49302 __ret_345 = splat_laneq_p8(__s0_345, __p1_345); \51006 __ret_437 = splat_laneq_p8(__s0_437, __p1_437); \
49303 __ret_345; \51007 __ret_437; \
49304})51008})
49305#else51009#else
49306#define vdup_laneq_p8(__p0_346, __p1_346) __extension__ ({ \51010#define vdup_laneq_p8(__p0_438, __p1_438) __extension__ ({ \
49307 poly8x16_t __s0_346 = __p0_346; \51011 poly8x16_t __s0_438 = __p0_438; \
49308 poly8x16_t __rev0_346; __rev0_346 = __builtin_shufflevector(__s0_346, __s0_346, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \51012 poly8x16_t __rev0_438; __rev0_438 = __builtin_shufflevector(__s0_438, __s0_438, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
49309 poly8x8_t __ret_346; \51013 poly8x8_t __ret_438; \
49310 __ret_346 = __noswap_splat_laneq_p8(__rev0_346, __p1_346); \51014 __ret_438 = __noswap_splat_laneq_p8(__rev0_438, __p1_438); \
49311 __ret_346 = __builtin_shufflevector(__ret_346, __ret_346, 7, 6, 5, 4, 3, 2, 1, 0); \51015 __ret_438 = __builtin_shufflevector(__ret_438, __ret_438, 7, 6, 5, 4, 3, 2, 1, 0); \
49312 __ret_346; \51016 __ret_438; \
49313})51017})
49314#endif51018#endif
4931551019
49316#ifdef __LITTLE_ENDIAN__51020#ifdef __LITTLE_ENDIAN__
49317#define vdup_laneq_p64(__p0_347, __p1_347) __extension__ ({ \51021#define vdup_laneq_p64(__p0_439, __p1_439) __extension__ ({ \
49318 poly64x2_t __s0_347 = __p0_347; \51022 poly64x2_t __s0_439 = __p0_439; \
49319 poly64x1_t __ret_347; \51023 poly64x1_t __ret_439; \
49320 __ret_347 = splat_laneq_p64(__s0_347, __p1_347); \51024 __ret_439 = splat_laneq_p64(__s0_439, __p1_439); \
49321 __ret_347; \51025 __ret_439; \
49322})51026})
49323#else51027#else
49324#define vdup_laneq_p64(__p0_348, __p1_348) __extension__ ({ \51028#define vdup_laneq_p64(__p0_440, __p1_440) __extension__ ({ \
49325 poly64x2_t __s0_348 = __p0_348; \51029 poly64x2_t __s0_440 = __p0_440; \
49326 poly64x2_t __rev0_348; __rev0_348 = __builtin_shufflevector(__s0_348, __s0_348, 1, 0); \51030 poly64x2_t __rev0_440; __rev0_440 = __builtin_shufflevector(__s0_440, __s0_440, 1, 0); \
49327 poly64x1_t __ret_348; \51031 poly64x1_t __ret_440; \
49328 __ret_348 = __noswap_splat_laneq_p64(__rev0_348, __p1_348); \51032 __ret_440 = __noswap_splat_laneq_p64(__rev0_440, __p1_440); \
49329 __ret_348; \51033 __ret_440; \
49330})51034})
49331#endif51035#endif
4933251036
49333#ifdef __LITTLE_ENDIAN__51037#ifdef __LITTLE_ENDIAN__
49334#define vdup_laneq_p16(__p0_349, __p1_349) __extension__ ({ \51038#define vdup_laneq_p16(__p0_441, __p1_441) __extension__ ({ \
49335 poly16x8_t __s0_349 = __p0_349; \51039 poly16x8_t __s0_441 = __p0_441; \
49336 poly16x4_t __ret_349; \51040 poly16x4_t __ret_441; \
49337 __ret_349 = splat_laneq_p16(__s0_349, __p1_349); \51041 __ret_441 = splat_laneq_p16(__s0_441, __p1_441); \
49338 __ret_349; \51042 __ret_441; \
49339})51043})
49340#else51044#else
49341#define vdup_laneq_p16(__p0_350, __p1_350) __extension__ ({ \51045#define vdup_laneq_p16(__p0_442, __p1_442) __extension__ ({ \
49342 poly16x8_t __s0_350 = __p0_350; \51046 poly16x8_t __s0_442 = __p0_442; \
49343 poly16x8_t __rev0_350; __rev0_350 = __builtin_shufflevector(__s0_350, __s0_350, 7, 6, 5, 4, 3, 2, 1, 0); \51047 poly16x8_t __rev0_442; __rev0_442 = __builtin_shufflevector(__s0_442, __s0_442, 7, 6, 5, 4, 3, 2, 1, 0); \
49344 poly16x4_t __ret_350; \51048 poly16x4_t __ret_442; \
49345 __ret_350 = __noswap_splat_laneq_p16(__rev0_350, __p1_350); \51049 __ret_442 = __noswap_splat_laneq_p16(__rev0_442, __p1_442); \
49346 __ret_350 = __builtin_shufflevector(__ret_350, __ret_350, 3, 2, 1, 0); \51050 __ret_442 = __builtin_shufflevector(__ret_442, __ret_442, 3, 2, 1, 0); \
49347 __ret_350; \51051 __ret_442; \
49348})51052})
49349#endif51053#endif
4935051054
49351#ifdef __LITTLE_ENDIAN__51055#ifdef __LITTLE_ENDIAN__
49352#define vdupq_laneq_p8(__p0_351, __p1_351) __extension__ ({ \51056#define vdupq_laneq_p8(__p0_443, __p1_443) __extension__ ({ \
49353 poly8x16_t __s0_351 = __p0_351; \51057 poly8x16_t __s0_443 = __p0_443; \
49354 poly8x16_t __ret_351; \51058 poly8x16_t __ret_443; \
49355 __ret_351 = splatq_laneq_p8(__s0_351, __p1_351); \51059 __ret_443 = splatq_laneq_p8(__s0_443, __p1_443); \
49356 __ret_351; \51060 __ret_443; \
49357})51061})
49358#else51062#else
49359#define vdupq_laneq_p8(__p0_352, __p1_352) __extension__ ({ \51063#define vdupq_laneq_p8(__p0_444, __p1_444) __extension__ ({ \
49360 poly8x16_t __s0_352 = __p0_352; \51064 poly8x16_t __s0_444 = __p0_444; \
49361 poly8x16_t __rev0_352; __rev0_352 = __builtin_shufflevector(__s0_352, __s0_352, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \51065 poly8x16_t __rev0_444; __rev0_444 = __builtin_shufflevector(__s0_444, __s0_444, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
49362 poly8x16_t __ret_352; \51066 poly8x16_t __ret_444; \
49363 __ret_352 = __noswap_splatq_laneq_p8(__rev0_352, __p1_352); \51067 __ret_444 = __noswap_splatq_laneq_p8(__rev0_444, __p1_444); \
49364 __ret_352 = __builtin_shufflevector(__ret_352, __ret_352, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \51068 __ret_444 = __builtin_shufflevector(__ret_444, __ret_444, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
49365 __ret_352; \51069 __ret_444; \
49366})51070})
49367#endif51071#endif
4936851072
49369#ifdef __LITTLE_ENDIAN__51073#ifdef __LITTLE_ENDIAN__
49370#define vdupq_laneq_p64(__p0_353, __p1_353) __extension__ ({ \51074#define vdupq_laneq_p64(__p0_445, __p1_445) __extension__ ({ \
49371 poly64x2_t __s0_353 = __p0_353; \51075 poly64x2_t __s0_445 = __p0_445; \
49372 poly64x2_t __ret_353; \51076 poly64x2_t __ret_445; \
49373 __ret_353 = splatq_laneq_p64(__s0_353, __p1_353); \51077 __ret_445 = splatq_laneq_p64(__s0_445, __p1_445); \
49374 __ret_353; \51078 __ret_445; \
49375})51079})
49376#else51080#else
49377#define vdupq_laneq_p64(__p0_354, __p1_354) __extension__ ({ \51081#define vdupq_laneq_p64(__p0_446, __p1_446) __extension__ ({ \
49378 poly64x2_t __s0_354 = __p0_354; \51082 poly64x2_t __s0_446 = __p0_446; \
49379 poly64x2_t __rev0_354; __rev0_354 = __builtin_shufflevector(__s0_354, __s0_354, 1, 0); \51083 poly64x2_t __rev0_446; __rev0_446 = __builtin_shufflevector(__s0_446, __s0_446, 1, 0); \
49380 poly64x2_t __ret_354; \51084 poly64x2_t __ret_446; \
49381 __ret_354 = __noswap_splatq_laneq_p64(__rev0_354, __p1_354); \51085 __ret_446 = __noswap_splatq_laneq_p64(__rev0_446, __p1_446); \
49382 __ret_354 = __builtin_shufflevector(__ret_354, __ret_354, 1, 0); \51086 __ret_446 = __builtin_shufflevector(__ret_446, __ret_446, 1, 0); \
49383 __ret_354; \51087 __ret_446; \
49384})51088})
49385#endif51089#endif
4938651090
49387#ifdef __LITTLE_ENDIAN__51091#ifdef __LITTLE_ENDIAN__
49388#define vdupq_laneq_p16(__p0_355, __p1_355) __extension__ ({ \51092#define vdupq_laneq_p16(__p0_447, __p1_447) __extension__ ({ \
49389 poly16x8_t __s0_355 = __p0_355; \51093 poly16x8_t __s0_447 = __p0_447; \
49390 poly16x8_t __ret_355; \51094 poly16x8_t __ret_447; \
49391 __ret_355 = splatq_laneq_p16(__s0_355, __p1_355); \51095 __ret_447 = splatq_laneq_p16(__s0_447, __p1_447); \
49392 __ret_355; \51096 __ret_447; \
49393})51097})
49394#else51098#else
49395#define vdupq_laneq_p16(__p0_356, __p1_356) __extension__ ({ \51099#define vdupq_laneq_p16(__p0_448, __p1_448) __extension__ ({ \
49396 poly16x8_t __s0_356 = __p0_356; \51100 poly16x8_t __s0_448 = __p0_448; \
49397 poly16x8_t __rev0_356; __rev0_356 = __builtin_shufflevector(__s0_356, __s0_356, 7, 6, 5, 4, 3, 2, 1, 0); \51101 poly16x8_t __rev0_448; __rev0_448 = __builtin_shufflevector(__s0_448, __s0_448, 7, 6, 5, 4, 3, 2, 1, 0); \
49398 poly16x8_t __ret_356; \51102 poly16x8_t __ret_448; \
49399 __ret_356 = __noswap_splatq_laneq_p16(__rev0_356, __p1_356); \51103 __ret_448 = __noswap_splatq_laneq_p16(__rev0_448, __p1_448); \
49400 __ret_356 = __builtin_shufflevector(__ret_356, __ret_356, 7, 6, 5, 4, 3, 2, 1, 0); \51104 __ret_448 = __builtin_shufflevector(__ret_448, __ret_448, 7, 6, 5, 4, 3, 2, 1, 0); \
49401 __ret_356; \51105 __ret_448; \
49402})51106})
49403#endif51107#endif
4940451108
49405#ifdef __LITTLE_ENDIAN__51109#ifdef __LITTLE_ENDIAN__
49406#define vdupq_laneq_u8(__p0_357, __p1_357) __extension__ ({ \51110#define vdupq_laneq_u8(__p0_449, __p1_449) __extension__ ({ \
49407 uint8x16_t __s0_357 = __p0_357; \51111 uint8x16_t __s0_449 = __p0_449; \
49408 uint8x16_t __ret_357; \51112 uint8x16_t __ret_449; \
49409 __ret_357 = splatq_laneq_u8(__s0_357, __p1_357); \51113 __ret_449 = splatq_laneq_u8(__s0_449, __p1_449); \
49410 __ret_357; \51114 __ret_449; \
49411})51115})
49412#else51116#else
49413#define vdupq_laneq_u8(__p0_358, __p1_358) __extension__ ({ \51117#define vdupq_laneq_u8(__p0_450, __p1_450) __extension__ ({ \
49414 uint8x16_t __s0_358 = __p0_358; \51118 uint8x16_t __s0_450 = __p0_450; \
49415 uint8x16_t __rev0_358; __rev0_358 = __builtin_shufflevector(__s0_358, __s0_358, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \51119 uint8x16_t __rev0_450; __rev0_450 = __builtin_shufflevector(__s0_450, __s0_450, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
49416 uint8x16_t __ret_358; \51120 uint8x16_t __ret_450; \
49417 __ret_358 = __noswap_splatq_laneq_u8(__rev0_358, __p1_358); \51121 __ret_450 = __noswap_splatq_laneq_u8(__rev0_450, __p1_450); \
49418 __ret_358 = __builtin_shufflevector(__ret_358, __ret_358, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \51122 __ret_450 = __builtin_shufflevector(__ret_450, __ret_450, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
49419 __ret_358; \51123 __ret_450; \
49420})51124})
49421#endif51125#endif
4942251126
49423#ifdef __LITTLE_ENDIAN__51127#ifdef __LITTLE_ENDIAN__
49424#define vdupq_laneq_u32(__p0_359, __p1_359) __extension__ ({ \51128#define vdupq_laneq_u32(__p0_451, __p1_451) __extension__ ({ \
49425 uint32x4_t __s0_359 = __p0_359; \51129 uint32x4_t __s0_451 = __p0_451; \
49426 uint32x4_t __ret_359; \51130 uint32x4_t __ret_451; \
49427 __ret_359 = splatq_laneq_u32(__s0_359, __p1_359); \51131 __ret_451 = splatq_laneq_u32(__s0_451, __p1_451); \
49428 __ret_359; \51132 __ret_451; \
49429})51133})
49430#else51134#else
49431#define vdupq_laneq_u32(__p0_360, __p1_360) __extension__ ({ \51135#define vdupq_laneq_u32(__p0_452, __p1_452) __extension__ ({ \
49432 uint32x4_t __s0_360 = __p0_360; \51136 uint32x4_t __s0_452 = __p0_452; \
49433 uint32x4_t __rev0_360; __rev0_360 = __builtin_shufflevector(__s0_360, __s0_360, 3, 2, 1, 0); \51137 uint32x4_t __rev0_452; __rev0_452 = __builtin_shufflevector(__s0_452, __s0_452, 3, 2, 1, 0); \
49434 uint32x4_t __ret_360; \51138 uint32x4_t __ret_452; \
49435 __ret_360 = __noswap_splatq_laneq_u32(__rev0_360, __p1_360); \51139 __ret_452 = __noswap_splatq_laneq_u32(__rev0_452, __p1_452); \
49436 __ret_360 = __builtin_shufflevector(__ret_360, __ret_360, 3, 2, 1, 0); \51140 __ret_452 = __builtin_shufflevector(__ret_452, __ret_452, 3, 2, 1, 0); \
49437 __ret_360; \51141 __ret_452; \
49438})51142})
49439#endif51143#endif
4944051144
49441#ifdef __LITTLE_ENDIAN__51145#ifdef __LITTLE_ENDIAN__
49442#define vdupq_laneq_u64(__p0_361, __p1_361) __extension__ ({ \51146#define vdupq_laneq_u64(__p0_453, __p1_453) __extension__ ({ \
49443 uint64x2_t __s0_361 = __p0_361; \51147 uint64x2_t __s0_453 = __p0_453; \
49444 uint64x2_t __ret_361; \51148 uint64x2_t __ret_453; \
49445 __ret_361 = splatq_laneq_u64(__s0_361, __p1_361); \51149 __ret_453 = splatq_laneq_u64(__s0_453, __p1_453); \
49446 __ret_361; \51150 __ret_453; \
49447})51151})
49448#else51152#else
49449#define vdupq_laneq_u64(__p0_362, __p1_362) __extension__ ({ \51153#define vdupq_laneq_u64(__p0_454, __p1_454) __extension__ ({ \
49450 uint64x2_t __s0_362 = __p0_362; \51154 uint64x2_t __s0_454 = __p0_454; \
49451 uint64x2_t __rev0_362; __rev0_362 = __builtin_shufflevector(__s0_362, __s0_362, 1, 0); \51155 uint64x2_t __rev0_454; __rev0_454 = __builtin_shufflevector(__s0_454, __s0_454, 1, 0); \
49452 uint64x2_t __ret_362; \51156 uint64x2_t __ret_454; \
49453 __ret_362 = __noswap_splatq_laneq_u64(__rev0_362, __p1_362); \51157 __ret_454 = __noswap_splatq_laneq_u64(__rev0_454, __p1_454); \
49454 __ret_362 = __builtin_shufflevector(__ret_362, __ret_362, 1, 0); \51158 __ret_454 = __builtin_shufflevector(__ret_454, __ret_454, 1, 0); \
49455 __ret_362; \51159 __ret_454; \
49456})51160})
49457#endif51161#endif
4945851162
49459#ifdef __LITTLE_ENDIAN__51163#ifdef __LITTLE_ENDIAN__
49460#define vdupq_laneq_u16(__p0_363, __p1_363) __extension__ ({ \51164#define vdupq_laneq_u16(__p0_455, __p1_455) __extension__ ({ \
49461 uint16x8_t __s0_363 = __p0_363; \51165 uint16x8_t __s0_455 = __p0_455; \
49462 uint16x8_t __ret_363; \51166 uint16x8_t __ret_455; \
49463 __ret_363 = splatq_laneq_u16(__s0_363, __p1_363); \51167 __ret_455 = splatq_laneq_u16(__s0_455, __p1_455); \
49464 __ret_363; \51168 __ret_455; \
49465})51169})
49466#else51170#else
49467#define vdupq_laneq_u16(__p0_364, __p1_364) __extension__ ({ \51171#define vdupq_laneq_u16(__p0_456, __p1_456) __extension__ ({ \
49468 uint16x8_t __s0_364 = __p0_364; \51172 uint16x8_t __s0_456 = __p0_456; \
49469 uint16x8_t __rev0_364; __rev0_364 = __builtin_shufflevector(__s0_364, __s0_364, 7, 6, 5, 4, 3, 2, 1, 0); \51173 uint16x8_t __rev0_456; __rev0_456 = __builtin_shufflevector(__s0_456, __s0_456, 7, 6, 5, 4, 3, 2, 1, 0); \
49470 uint16x8_t __ret_364; \51174 uint16x8_t __ret_456; \
49471 __ret_364 = __noswap_splatq_laneq_u16(__rev0_364, __p1_364); \51175 __ret_456 = __noswap_splatq_laneq_u16(__rev0_456, __p1_456); \
49472 __ret_364 = __builtin_shufflevector(__ret_364, __ret_364, 7, 6, 5, 4, 3, 2, 1, 0); \51176 __ret_456 = __builtin_shufflevector(__ret_456, __ret_456, 7, 6, 5, 4, 3, 2, 1, 0); \
49473 __ret_364; \51177 __ret_456; \
49474})51178})
49475#endif51179#endif
4947651180
49477#ifdef __LITTLE_ENDIAN__51181#ifdef __LITTLE_ENDIAN__
49478#define vdupq_laneq_s8(__p0_365, __p1_365) __extension__ ({ \51182#define vdupq_laneq_s8(__p0_457, __p1_457) __extension__ ({ \
49479 int8x16_t __s0_365 = __p0_365; \51183 int8x16_t __s0_457 = __p0_457; \
49480 int8x16_t __ret_365; \51184 int8x16_t __ret_457; \
49481 __ret_365 = splatq_laneq_s8(__s0_365, __p1_365); \51185 __ret_457 = splatq_laneq_s8(__s0_457, __p1_457); \
49482 __ret_365; \51186 __ret_457; \
49483})51187})
49484#else51188#else
49485#define vdupq_laneq_s8(__p0_366, __p1_366) __extension__ ({ \51189#define vdupq_laneq_s8(__p0_458, __p1_458) __extension__ ({ \
49486 int8x16_t __s0_366 = __p0_366; \51190 int8x16_t __s0_458 = __p0_458; \
49487 int8x16_t __rev0_366; __rev0_366 = __builtin_shufflevector(__s0_366, __s0_366, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \51191 int8x16_t __rev0_458; __rev0_458 = __builtin_shufflevector(__s0_458, __s0_458, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
49488 int8x16_t __ret_366; \51192 int8x16_t __ret_458; \
49489 __ret_366 = __noswap_splatq_laneq_s8(__rev0_366, __p1_366); \51193 __ret_458 = __noswap_splatq_laneq_s8(__rev0_458, __p1_458); \
49490 __ret_366 = __builtin_shufflevector(__ret_366, __ret_366, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \51194 __ret_458 = __builtin_shufflevector(__ret_458, __ret_458, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
49491 __ret_366; \51195 __ret_458; \
49492})51196})
49493#endif51197#endif
4949451198
49495#ifdef __LITTLE_ENDIAN__51199#ifdef __LITTLE_ENDIAN__
49496#define vdupq_laneq_f64(__p0_367, __p1_367) __extension__ ({ \51200#define vdupq_laneq_f64(__p0_459, __p1_459) __extension__ ({ \
49497 float64x2_t __s0_367 = __p0_367; \51201 float64x2_t __s0_459 = __p0_459; \
49498 float64x2_t __ret_367; \51202 float64x2_t __ret_459; \
49499 __ret_367 = splatq_laneq_f64(__s0_367, __p1_367); \51203 __ret_459 = splatq_laneq_f64(__s0_459, __p1_459); \
49500 __ret_367; \51204 __ret_459; \
49501})51205})
49502#else51206#else
49503#define vdupq_laneq_f64(__p0_368, __p1_368) __extension__ ({ \51207#define vdupq_laneq_f64(__p0_460, __p1_460) __extension__ ({ \
49504 float64x2_t __s0_368 = __p0_368; \51208 float64x2_t __s0_460 = __p0_460; \
49505 float64x2_t __rev0_368; __rev0_368 = __builtin_shufflevector(__s0_368, __s0_368, 1, 0); \51209 float64x2_t __rev0_460; __rev0_460 = __builtin_shufflevector(__s0_460, __s0_460, 1, 0); \
49506 float64x2_t __ret_368; \51210 float64x2_t __ret_460; \
49507 __ret_368 = __noswap_splatq_laneq_f64(__rev0_368, __p1_368); \51211 __ret_460 = __noswap_splatq_laneq_f64(__rev0_460, __p1_460); \
49508 __ret_368 = __builtin_shufflevector(__ret_368, __ret_368, 1, 0); \51212 __ret_460 = __builtin_shufflevector(__ret_460, __ret_460, 1, 0); \
49509 __ret_368; \51213 __ret_460; \
49510})51214})
49511#endif51215#endif
4951251216
49513#ifdef __LITTLE_ENDIAN__51217#ifdef __LITTLE_ENDIAN__
49514#define vdupq_laneq_f32(__p0_369, __p1_369) __extension__ ({ \51218#define vdupq_laneq_f32(__p0_461, __p1_461) __extension__ ({ \
49515 float32x4_t __s0_369 = __p0_369; \51219 float32x4_t __s0_461 = __p0_461; \
49516 float32x4_t __ret_369; \51220 float32x4_t __ret_461; \
49517 __ret_369 = splatq_laneq_f32(__s0_369, __p1_369); \51221 __ret_461 = splatq_laneq_f32(__s0_461, __p1_461); \
49518 __ret_369; \51222 __ret_461; \
49519})51223})
49520#else51224#else
49521#define vdupq_laneq_f32(__p0_370, __p1_370) __extension__ ({ \51225#define vdupq_laneq_f32(__p0_462, __p1_462) __extension__ ({ \
49522 float32x4_t __s0_370 = __p0_370; \51226 float32x4_t __s0_462 = __p0_462; \
49523 float32x4_t __rev0_370; __rev0_370 = __builtin_shufflevector(__s0_370, __s0_370, 3, 2, 1, 0); \51227 float32x4_t __rev0_462; __rev0_462 = __builtin_shufflevector(__s0_462, __s0_462, 3, 2, 1, 0); \
49524 float32x4_t __ret_370; \51228 float32x4_t __ret_462; \
49525 __ret_370 = __noswap_splatq_laneq_f32(__rev0_370, __p1_370); \51229 __ret_462 = __noswap_splatq_laneq_f32(__rev0_462, __p1_462); \
49526 __ret_370 = __builtin_shufflevector(__ret_370, __ret_370, 3, 2, 1, 0); \51230 __ret_462 = __builtin_shufflevector(__ret_462, __ret_462, 3, 2, 1, 0); \
49527 __ret_370; \51231 __ret_462; \
49528})51232})
49529#endif51233#endif
4953051234
49531#ifdef __LITTLE_ENDIAN__51235#ifdef __LITTLE_ENDIAN__
49532#define vdupq_laneq_f16(__p0_371, __p1_371) __extension__ ({ \51236#define vdupq_laneq_f16(__p0_463, __p1_463) __extension__ ({ \
49533 float16x8_t __s0_371 = __p0_371; \51237 float16x8_t __s0_463 = __p0_463; \
49534 float16x8_t __ret_371; \51238 float16x8_t __ret_463; \
49535 __ret_371 = splatq_laneq_f16(__s0_371, __p1_371); \51239 __ret_463 = splatq_laneq_f16(__s0_463, __p1_463); \
49536 __ret_371; \51240 __ret_463; \
49537})51241})
49538#else51242#else
49539#define vdupq_laneq_f16(__p0_372, __p1_372) __extension__ ({ \51243#define vdupq_laneq_f16(__p0_464, __p1_464) __extension__ ({ \
49540 float16x8_t __s0_372 = __p0_372; \51244 float16x8_t __s0_464 = __p0_464; \
49541 float16x8_t __rev0_372; __rev0_372 = __builtin_shufflevector(__s0_372, __s0_372, 7, 6, 5, 4, 3, 2, 1, 0); \51245 float16x8_t __rev0_464; __rev0_464 = __builtin_shufflevector(__s0_464, __s0_464, 7, 6, 5, 4, 3, 2, 1, 0); \
49542 float16x8_t __ret_372; \51246 float16x8_t __ret_464; \
49543 __ret_372 = __noswap_splatq_laneq_f16(__rev0_372, __p1_372); \51247 __ret_464 = __noswap_splatq_laneq_f16(__rev0_464, __p1_464); \
49544 __ret_372 = __builtin_shufflevector(__ret_372, __ret_372, 7, 6, 5, 4, 3, 2, 1, 0); \51248 __ret_464 = __builtin_shufflevector(__ret_464, __ret_464, 7, 6, 5, 4, 3, 2, 1, 0); \
49545 __ret_372; \51249 __ret_464; \
49546})51250})
49547#endif51251#endif
4954851252
49549#ifdef __LITTLE_ENDIAN__51253#ifdef __LITTLE_ENDIAN__
49550#define vdupq_laneq_s32(__p0_373, __p1_373) __extension__ ({ \51254#define vdupq_laneq_s32(__p0_465, __p1_465) __extension__ ({ \
49551 int32x4_t __s0_373 = __p0_373; \51255 int32x4_t __s0_465 = __p0_465; \
49552 int32x4_t __ret_373; \51256 int32x4_t __ret_465; \
49553 __ret_373 = splatq_laneq_s32(__s0_373, __p1_373); \51257 __ret_465 = splatq_laneq_s32(__s0_465, __p1_465); \
49554 __ret_373; \51258 __ret_465; \
49555})51259})
49556#else51260#else
49557#define vdupq_laneq_s32(__p0_374, __p1_374) __extension__ ({ \51261#define vdupq_laneq_s32(__p0_466, __p1_466) __extension__ ({ \
49558 int32x4_t __s0_374 = __p0_374; \51262 int32x4_t __s0_466 = __p0_466; \
49559 int32x4_t __rev0_374; __rev0_374 = __builtin_shufflevector(__s0_374, __s0_374, 3, 2, 1, 0); \51263 int32x4_t __rev0_466; __rev0_466 = __builtin_shufflevector(__s0_466, __s0_466, 3, 2, 1, 0); \
49560 int32x4_t __ret_374; \51264 int32x4_t __ret_466; \
49561 __ret_374 = __noswap_splatq_laneq_s32(__rev0_374, __p1_374); \51265 __ret_466 = __noswap_splatq_laneq_s32(__rev0_466, __p1_466); \
49562 __ret_374 = __builtin_shufflevector(__ret_374, __ret_374, 3, 2, 1, 0); \51266 __ret_466 = __builtin_shufflevector(__ret_466, __ret_466, 3, 2, 1, 0); \
49563 __ret_374; \51267 __ret_466; \
49564})51268})
49565#endif51269#endif
4956651270
49567#ifdef __LITTLE_ENDIAN__51271#ifdef __LITTLE_ENDIAN__
49568#define vdupq_laneq_s64(__p0_375, __p1_375) __extension__ ({ \51272#define vdupq_laneq_s64(__p0_467, __p1_467) __extension__ ({ \
49569 int64x2_t __s0_375 = __p0_375; \51273 int64x2_t __s0_467 = __p0_467; \
49570 int64x2_t __ret_375; \51274 int64x2_t __ret_467; \
49571 __ret_375 = splatq_laneq_s64(__s0_375, __p1_375); \51275 __ret_467 = splatq_laneq_s64(__s0_467, __p1_467); \
49572 __ret_375; \51276 __ret_467; \
49573})51277})
49574#else51278#else
49575#define vdupq_laneq_s64(__p0_376, __p1_376) __extension__ ({ \51279#define vdupq_laneq_s64(__p0_468, __p1_468) __extension__ ({ \
49576 int64x2_t __s0_376 = __p0_376; \51280 int64x2_t __s0_468 = __p0_468; \
49577 int64x2_t __rev0_376; __rev0_376 = __builtin_shufflevector(__s0_376, __s0_376, 1, 0); \51281 int64x2_t __rev0_468; __rev0_468 = __builtin_shufflevector(__s0_468, __s0_468, 1, 0); \
49578 int64x2_t __ret_376; \51282 int64x2_t __ret_468; \
49579 __ret_376 = __noswap_splatq_laneq_s64(__rev0_376, __p1_376); \51283 __ret_468 = __noswap_splatq_laneq_s64(__rev0_468, __p1_468); \
49580 __ret_376 = __builtin_shufflevector(__ret_376, __ret_376, 1, 0); \51284 __ret_468 = __builtin_shufflevector(__ret_468, __ret_468, 1, 0); \
49581 __ret_376; \51285 __ret_468; \
49582})51286})
49583#endif51287#endif
4958451288
49585#ifdef __LITTLE_ENDIAN__51289#ifdef __LITTLE_ENDIAN__
49586#define vdupq_laneq_s16(__p0_377, __p1_377) __extension__ ({ \51290#define vdupq_laneq_s16(__p0_469, __p1_469) __extension__ ({ \
49587 int16x8_t __s0_377 = __p0_377; \51291 int16x8_t __s0_469 = __p0_469; \
49588 int16x8_t __ret_377; \51292 int16x8_t __ret_469; \
49589 __ret_377 = splatq_laneq_s16(__s0_377, __p1_377); \51293 __ret_469 = splatq_laneq_s16(__s0_469, __p1_469); \
49590 __ret_377; \51294 __ret_469; \
49591})51295})
49592#else51296#else
49593#define vdupq_laneq_s16(__p0_378, __p1_378) __extension__ ({ \51297#define vdupq_laneq_s16(__p0_470, __p1_470) __extension__ ({ \
49594 int16x8_t __s0_378 = __p0_378; \51298 int16x8_t __s0_470 = __p0_470; \
49595 int16x8_t __rev0_378; __rev0_378 = __builtin_shufflevector(__s0_378, __s0_378, 7, 6, 5, 4, 3, 2, 1, 0); \51299 int16x8_t __rev0_470; __rev0_470 = __builtin_shufflevector(__s0_470, __s0_470, 7, 6, 5, 4, 3, 2, 1, 0); \
49596 int16x8_t __ret_378; \51300 int16x8_t __ret_470; \
49597 __ret_378 = __noswap_splatq_laneq_s16(__rev0_378, __p1_378); \51301 __ret_470 = __noswap_splatq_laneq_s16(__rev0_470, __p1_470); \
49598 __ret_378 = __builtin_shufflevector(__ret_378, __ret_378, 7, 6, 5, 4, 3, 2, 1, 0); \51302 __ret_470 = __builtin_shufflevector(__ret_470, __ret_470, 7, 6, 5, 4, 3, 2, 1, 0); \
49599 __ret_378; \51303 __ret_470; \
49600})51304})
49601#endif51305#endif
4960251306
49603#ifdef __LITTLE_ENDIAN__51307#ifdef __LITTLE_ENDIAN__
49604#define vdup_laneq_u8(__p0_379, __p1_379) __extension__ ({ \51308#define vdup_laneq_u8(__p0_471, __p1_471) __extension__ ({ \
49605 uint8x16_t __s0_379 = __p0_379; \51309 uint8x16_t __s0_471 = __p0_471; \
49606 uint8x8_t __ret_379; \51310 uint8x8_t __ret_471; \
49607 __ret_379 = splat_laneq_u8(__s0_379, __p1_379); \51311 __ret_471 = splat_laneq_u8(__s0_471, __p1_471); \
49608 __ret_379; \51312 __ret_471; \
49609})51313})
49610#else51314#else
49611#define vdup_laneq_u8(__p0_380, __p1_380) __extension__ ({ \51315#define vdup_laneq_u8(__p0_472, __p1_472) __extension__ ({ \
49612 uint8x16_t __s0_380 = __p0_380; \51316 uint8x16_t __s0_472 = __p0_472; \
49613 uint8x16_t __rev0_380; __rev0_380 = __builtin_shufflevector(__s0_380, __s0_380, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \51317 uint8x16_t __rev0_472; __rev0_472 = __builtin_shufflevector(__s0_472, __s0_472, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
49614 uint8x8_t __ret_380; \51318 uint8x8_t __ret_472; \
49615 __ret_380 = __noswap_splat_laneq_u8(__rev0_380, __p1_380); \51319 __ret_472 = __noswap_splat_laneq_u8(__rev0_472, __p1_472); \
49616 __ret_380 = __builtin_shufflevector(__ret_380, __ret_380, 7, 6, 5, 4, 3, 2, 1, 0); \51320 __ret_472 = __builtin_shufflevector(__ret_472, __ret_472, 7, 6, 5, 4, 3, 2, 1, 0); \
49617 __ret_380; \51321 __ret_472; \
49618})51322})
49619#endif51323#endif
4962051324
49621#ifdef __LITTLE_ENDIAN__51325#ifdef __LITTLE_ENDIAN__
49622#define vdup_laneq_u32(__p0_381, __p1_381) __extension__ ({ \51326#define vdup_laneq_u32(__p0_473, __p1_473) __extension__ ({ \
49623 uint32x4_t __s0_381 = __p0_381; \51327 uint32x4_t __s0_473 = __p0_473; \
49624 uint32x2_t __ret_381; \51328 uint32x2_t __ret_473; \
49625 __ret_381 = splat_laneq_u32(__s0_381, __p1_381); \51329 __ret_473 = splat_laneq_u32(__s0_473, __p1_473); \
49626 __ret_381; \51330 __ret_473; \
49627})51331})
49628#else51332#else
49629#define vdup_laneq_u32(__p0_382, __p1_382) __extension__ ({ \51333#define vdup_laneq_u32(__p0_474, __p1_474) __extension__ ({ \
49630 uint32x4_t __s0_382 = __p0_382; \51334 uint32x4_t __s0_474 = __p0_474; \
49631 uint32x4_t __rev0_382; __rev0_382 = __builtin_shufflevector(__s0_382, __s0_382, 3, 2, 1, 0); \51335 uint32x4_t __rev0_474; __rev0_474 = __builtin_shufflevector(__s0_474, __s0_474, 3, 2, 1, 0); \
49632 uint32x2_t __ret_382; \51336 uint32x2_t __ret_474; \
49633 __ret_382 = __noswap_splat_laneq_u32(__rev0_382, __p1_382); \51337 __ret_474 = __noswap_splat_laneq_u32(__rev0_474, __p1_474); \
49634 __ret_382 = __builtin_shufflevector(__ret_382, __ret_382, 1, 0); \51338 __ret_474 = __builtin_shufflevector(__ret_474, __ret_474, 1, 0); \
49635 __ret_382; \51339 __ret_474; \
49636})51340})
49637#endif51341#endif
4963851342
49639#ifdef __LITTLE_ENDIAN__51343#ifdef __LITTLE_ENDIAN__
49640#define vdup_laneq_u64(__p0_383, __p1_383) __extension__ ({ \51344#define vdup_laneq_u64(__p0_475, __p1_475) __extension__ ({ \
49641 uint64x2_t __s0_383 = __p0_383; \51345 uint64x2_t __s0_475 = __p0_475; \
49642 uint64x1_t __ret_383; \51346 uint64x1_t __ret_475; \
49643 __ret_383 = splat_laneq_u64(__s0_383, __p1_383); \51347 __ret_475 = splat_laneq_u64(__s0_475, __p1_475); \
49644 __ret_383; \51348 __ret_475; \
49645})51349})
49646#else51350#else
49647#define vdup_laneq_u64(__p0_384, __p1_384) __extension__ ({ \51351#define vdup_laneq_u64(__p0_476, __p1_476) __extension__ ({ \
49648 uint64x2_t __s0_384 = __p0_384; \51352 uint64x2_t __s0_476 = __p0_476; \
49649 uint64x2_t __rev0_384; __rev0_384 = __builtin_shufflevector(__s0_384, __s0_384, 1, 0); \51353 uint64x2_t __rev0_476; __rev0_476 = __builtin_shufflevector(__s0_476, __s0_476, 1, 0); \
49650 uint64x1_t __ret_384; \51354 uint64x1_t __ret_476; \
49651 __ret_384 = __noswap_splat_laneq_u64(__rev0_384, __p1_384); \51355 __ret_476 = __noswap_splat_laneq_u64(__rev0_476, __p1_476); \
49652 __ret_384; \51356 __ret_476; \
49653})51357})
49654#endif51358#endif
4965551359
49656#ifdef __LITTLE_ENDIAN__51360#ifdef __LITTLE_ENDIAN__
49657#define vdup_laneq_u16(__p0_385, __p1_385) __extension__ ({ \51361#define vdup_laneq_u16(__p0_477, __p1_477) __extension__ ({ \
49658 uint16x8_t __s0_385 = __p0_385; \51362 uint16x8_t __s0_477 = __p0_477; \
49659 uint16x4_t __ret_385; \51363 uint16x4_t __ret_477; \
49660 __ret_385 = splat_laneq_u16(__s0_385, __p1_385); \51364 __ret_477 = splat_laneq_u16(__s0_477, __p1_477); \
49661 __ret_385; \51365 __ret_477; \
49662})51366})
49663#else51367#else
49664#define vdup_laneq_u16(__p0_386, __p1_386) __extension__ ({ \51368#define vdup_laneq_u16(__p0_478, __p1_478) __extension__ ({ \
49665 uint16x8_t __s0_386 = __p0_386; \51369 uint16x8_t __s0_478 = __p0_478; \
49666 uint16x8_t __rev0_386; __rev0_386 = __builtin_shufflevector(__s0_386, __s0_386, 7, 6, 5, 4, 3, 2, 1, 0); \51370 uint16x8_t __rev0_478; __rev0_478 = __builtin_shufflevector(__s0_478, __s0_478, 7, 6, 5, 4, 3, 2, 1, 0); \
49667 uint16x4_t __ret_386; \51371 uint16x4_t __ret_478; \
49668 __ret_386 = __noswap_splat_laneq_u16(__rev0_386, __p1_386); \51372 __ret_478 = __noswap_splat_laneq_u16(__rev0_478, __p1_478); \
49669 __ret_386 = __builtin_shufflevector(__ret_386, __ret_386, 3, 2, 1, 0); \51373 __ret_478 = __builtin_shufflevector(__ret_478, __ret_478, 3, 2, 1, 0); \
49670 __ret_386; \51374 __ret_478; \
49671})51375})
49672#endif51376#endif
4967351377
49674#ifdef __LITTLE_ENDIAN__51378#ifdef __LITTLE_ENDIAN__
49675#define vdup_laneq_s8(__p0_387, __p1_387) __extension__ ({ \51379#define vdup_laneq_s8(__p0_479, __p1_479) __extension__ ({ \
49676 int8x16_t __s0_387 = __p0_387; \51380 int8x16_t __s0_479 = __p0_479; \
49677 int8x8_t __ret_387; \51381 int8x8_t __ret_479; \
49678 __ret_387 = splat_laneq_s8(__s0_387, __p1_387); \51382 __ret_479 = splat_laneq_s8(__s0_479, __p1_479); \
49679 __ret_387; \51383 __ret_479; \
49680})51384})
49681#else51385#else
49682#define vdup_laneq_s8(__p0_388, __p1_388) __extension__ ({ \51386#define vdup_laneq_s8(__p0_480, __p1_480) __extension__ ({ \
49683 int8x16_t __s0_388 = __p0_388; \51387 int8x16_t __s0_480 = __p0_480; \
49684 int8x16_t __rev0_388; __rev0_388 = __builtin_shufflevector(__s0_388, __s0_388, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \51388 int8x16_t __rev0_480; __rev0_480 = __builtin_shufflevector(__s0_480, __s0_480, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
49685 int8x8_t __ret_388; \51389 int8x8_t __ret_480; \
49686 __ret_388 = __noswap_splat_laneq_s8(__rev0_388, __p1_388); \51390 __ret_480 = __noswap_splat_laneq_s8(__rev0_480, __p1_480); \
49687 __ret_388 = __builtin_shufflevector(__ret_388, __ret_388, 7, 6, 5, 4, 3, 2, 1, 0); \51391 __ret_480 = __builtin_shufflevector(__ret_480, __ret_480, 7, 6, 5, 4, 3, 2, 1, 0); \
49688 __ret_388; \51392 __ret_480; \
49689})51393})
49690#endif51394#endif
4969151395
49692#ifdef __LITTLE_ENDIAN__51396#ifdef __LITTLE_ENDIAN__
49693#define vdup_laneq_f64(__p0_389, __p1_389) __extension__ ({ \51397#define vdup_laneq_f64(__p0_481, __p1_481) __extension__ ({ \
49694 float64x2_t __s0_389 = __p0_389; \51398 float64x2_t __s0_481 = __p0_481; \
49695 float64x1_t __ret_389; \51399 float64x1_t __ret_481; \
49696 __ret_389 = splat_laneq_f64(__s0_389, __p1_389); \51400 __ret_481 = splat_laneq_f64(__s0_481, __p1_481); \
49697 __ret_389; \51401 __ret_481; \
49698})51402})
49699#else51403#else
49700#define vdup_laneq_f64(__p0_390, __p1_390) __extension__ ({ \51404#define vdup_laneq_f64(__p0_482, __p1_482) __extension__ ({ \
49701 float64x2_t __s0_390 = __p0_390; \51405 float64x2_t __s0_482 = __p0_482; \
49702 float64x2_t __rev0_390; __rev0_390 = __builtin_shufflevector(__s0_390, __s0_390, 1, 0); \51406 float64x2_t __rev0_482; __rev0_482 = __builtin_shufflevector(__s0_482, __s0_482, 1, 0); \
49703 float64x1_t __ret_390; \51407 float64x1_t __ret_482; \
49704 __ret_390 = __noswap_splat_laneq_f64(__rev0_390, __p1_390); \51408 __ret_482 = __noswap_splat_laneq_f64(__rev0_482, __p1_482); \
49705 __ret_390; \51409 __ret_482; \
49706})51410})
49707#endif51411#endif
4970851412
49709#ifdef __LITTLE_ENDIAN__51413#ifdef __LITTLE_ENDIAN__
49710#define vdup_laneq_f32(__p0_391, __p1_391) __extension__ ({ \51414#define vdup_laneq_f32(__p0_483, __p1_483) __extension__ ({ \
49711 float32x4_t __s0_391 = __p0_391; \51415 float32x4_t __s0_483 = __p0_483; \
49712 float32x2_t __ret_391; \51416 float32x2_t __ret_483; \
49713 __ret_391 = splat_laneq_f32(__s0_391, __p1_391); \51417 __ret_483 = splat_laneq_f32(__s0_483, __p1_483); \
49714 __ret_391; \51418 __ret_483; \
49715})51419})
49716#else51420#else
49717#define vdup_laneq_f32(__p0_392, __p1_392) __extension__ ({ \51421#define vdup_laneq_f32(__p0_484, __p1_484) __extension__ ({ \
49718 float32x4_t __s0_392 = __p0_392; \51422 float32x4_t __s0_484 = __p0_484; \
49719 float32x4_t __rev0_392; __rev0_392 = __builtin_shufflevector(__s0_392, __s0_392, 3, 2, 1, 0); \51423 float32x4_t __rev0_484; __rev0_484 = __builtin_shufflevector(__s0_484, __s0_484, 3, 2, 1, 0); \
49720 float32x2_t __ret_392; \51424 float32x2_t __ret_484; \
49721 __ret_392 = __noswap_splat_laneq_f32(__rev0_392, __p1_392); \51425 __ret_484 = __noswap_splat_laneq_f32(__rev0_484, __p1_484); \
49722 __ret_392 = __builtin_shufflevector(__ret_392, __ret_392, 1, 0); \51426 __ret_484 = __builtin_shufflevector(__ret_484, __ret_484, 1, 0); \
49723 __ret_392; \51427 __ret_484; \
49724})51428})
49725#endif51429#endif
4972651430
49727#ifdef __LITTLE_ENDIAN__51431#ifdef __LITTLE_ENDIAN__
49728#define vdup_laneq_f16(__p0_393, __p1_393) __extension__ ({ \51432#define vdup_laneq_f16(__p0_485, __p1_485) __extension__ ({ \
49729 float16x8_t __s0_393 = __p0_393; \51433 float16x8_t __s0_485 = __p0_485; \
49730 float16x4_t __ret_393; \51434 float16x4_t __ret_485; \
49731 __ret_393 = splat_laneq_f16(__s0_393, __p1_393); \51435 __ret_485 = splat_laneq_f16(__s0_485, __p1_485); \
49732 __ret_393; \51436 __ret_485; \
49733})51437})
49734#else51438#else
49735#define vdup_laneq_f16(__p0_394, __p1_394) __extension__ ({ \51439#define vdup_laneq_f16(__p0_486, __p1_486) __extension__ ({ \
49736 float16x8_t __s0_394 = __p0_394; \51440 float16x8_t __s0_486 = __p0_486; \
49737 float16x8_t __rev0_394; __rev0_394 = __builtin_shufflevector(__s0_394, __s0_394, 7, 6, 5, 4, 3, 2, 1, 0); \51441 float16x8_t __rev0_486; __rev0_486 = __builtin_shufflevector(__s0_486, __s0_486, 7, 6, 5, 4, 3, 2, 1, 0); \
49738 float16x4_t __ret_394; \51442 float16x4_t __ret_486; \
49739 __ret_394 = __noswap_splat_laneq_f16(__rev0_394, __p1_394); \51443 __ret_486 = __noswap_splat_laneq_f16(__rev0_486, __p1_486); \
49740 __ret_394 = __builtin_shufflevector(__ret_394, __ret_394, 3, 2, 1, 0); \51444 __ret_486 = __builtin_shufflevector(__ret_486, __ret_486, 3, 2, 1, 0); \
49741 __ret_394; \51445 __ret_486; \
49742})51446})
49743#endif51447#endif
4974451448
49745#ifdef __LITTLE_ENDIAN__51449#ifdef __LITTLE_ENDIAN__
49746#define vdup_laneq_s32(__p0_395, __p1_395) __extension__ ({ \51450#define vdup_laneq_s32(__p0_487, __p1_487) __extension__ ({ \
49747 int32x4_t __s0_395 = __p0_395; \51451 int32x4_t __s0_487 = __p0_487; \
49748 int32x2_t __ret_395; \51452 int32x2_t __ret_487; \
49749 __ret_395 = splat_laneq_s32(__s0_395, __p1_395); \51453 __ret_487 = splat_laneq_s32(__s0_487, __p1_487); \
49750 __ret_395; \51454 __ret_487; \
49751})51455})
49752#else51456#else
49753#define vdup_laneq_s32(__p0_396, __p1_396) __extension__ ({ \51457#define vdup_laneq_s32(__p0_488, __p1_488) __extension__ ({ \
49754 int32x4_t __s0_396 = __p0_396; \51458 int32x4_t __s0_488 = __p0_488; \
49755 int32x4_t __rev0_396; __rev0_396 = __builtin_shufflevector(__s0_396, __s0_396, 3, 2, 1, 0); \51459 int32x4_t __rev0_488; __rev0_488 = __builtin_shufflevector(__s0_488, __s0_488, 3, 2, 1, 0); \
49756 int32x2_t __ret_396; \51460 int32x2_t __ret_488; \
49757 __ret_396 = __noswap_splat_laneq_s32(__rev0_396, __p1_396); \51461 __ret_488 = __noswap_splat_laneq_s32(__rev0_488, __p1_488); \
49758 __ret_396 = __builtin_shufflevector(__ret_396, __ret_396, 1, 0); \51462 __ret_488 = __builtin_shufflevector(__ret_488, __ret_488, 1, 0); \
49759 __ret_396; \51463 __ret_488; \
49760})51464})
49761#endif51465#endif
4976251466
49763#ifdef __LITTLE_ENDIAN__51467#ifdef __LITTLE_ENDIAN__
49764#define vdup_laneq_s64(__p0_397, __p1_397) __extension__ ({ \51468#define vdup_laneq_s64(__p0_489, __p1_489) __extension__ ({ \
49765 int64x2_t __s0_397 = __p0_397; \51469 int64x2_t __s0_489 = __p0_489; \
49766 int64x1_t __ret_397; \51470 int64x1_t __ret_489; \
49767 __ret_397 = splat_laneq_s64(__s0_397, __p1_397); \51471 __ret_489 = splat_laneq_s64(__s0_489, __p1_489); \
49768 __ret_397; \51472 __ret_489; \
49769})51473})
49770#else51474#else
49771#define vdup_laneq_s64(__p0_398, __p1_398) __extension__ ({ \51475#define vdup_laneq_s64(__p0_490, __p1_490) __extension__ ({ \
49772 int64x2_t __s0_398 = __p0_398; \51476 int64x2_t __s0_490 = __p0_490; \
49773 int64x2_t __rev0_398; __rev0_398 = __builtin_shufflevector(__s0_398, __s0_398, 1, 0); \51477 int64x2_t __rev0_490; __rev0_490 = __builtin_shufflevector(__s0_490, __s0_490, 1, 0); \
49774 int64x1_t __ret_398; \51478 int64x1_t __ret_490; \
49775 __ret_398 = __noswap_splat_laneq_s64(__rev0_398, __p1_398); \51479 __ret_490 = __noswap_splat_laneq_s64(__rev0_490, __p1_490); \
49776 __ret_398; \51480 __ret_490; \
49777})51481})
49778#endif51482#endif
4977951483
49780#ifdef __LITTLE_ENDIAN__51484#ifdef __LITTLE_ENDIAN__
49781#define vdup_laneq_s16(__p0_399, __p1_399) __extension__ ({ \51485#define vdup_laneq_s16(__p0_491, __p1_491) __extension__ ({ \
49782 int16x8_t __s0_399 = __p0_399; \51486 int16x8_t __s0_491 = __p0_491; \
49783 int16x4_t __ret_399; \51487 int16x4_t __ret_491; \
49784 __ret_399 = splat_laneq_s16(__s0_399, __p1_399); \51488 __ret_491 = splat_laneq_s16(__s0_491, __p1_491); \
49785 __ret_399; \51489 __ret_491; \
49786})51490})
49787#else51491#else
49788#define vdup_laneq_s16(__p0_400, __p1_400) __extension__ ({ \51492#define vdup_laneq_s16(__p0_492, __p1_492) __extension__ ({ \
49789 int16x8_t __s0_400 = __p0_400; \51493 int16x8_t __s0_492 = __p0_492; \
49790 int16x8_t __rev0_400; __rev0_400 = __builtin_shufflevector(__s0_400, __s0_400, 7, 6, 5, 4, 3, 2, 1, 0); \51494 int16x8_t __rev0_492; __rev0_492 = __builtin_shufflevector(__s0_492, __s0_492, 7, 6, 5, 4, 3, 2, 1, 0); \
49791 int16x4_t __ret_400; \51495 int16x4_t __ret_492; \
49792 __ret_400 = __noswap_splat_laneq_s16(__rev0_400, __p1_400); \51496 __ret_492 = __noswap_splat_laneq_s16(__rev0_492, __p1_492); \
49793 __ret_400 = __builtin_shufflevector(__ret_400, __ret_400, 3, 2, 1, 0); \51497 __ret_492 = __builtin_shufflevector(__ret_492, __ret_492, 3, 2, 1, 0); \
49794 __ret_400; \51498 __ret_492; \
49795})51499})
49796#endif51500#endif
4979751501
...@@ -50287,246 +51991,246 @@ __ai float64x1_t vfms_f64(float64x1_t __p0, float64x1_t __p1, float64x1_t __p2)...@@ -50287,246 +51991,246 @@ __ai float64x1_t vfms_f64(float64x1_t __p0, float64x1_t __p1, float64x1_t __p2)
50287 __ret = vfma_f64(__p0, -__p1, __p2);51991 __ret = vfma_f64(__p0, -__p1, __p2);
50288 return __ret;51992 return __ret;
50289}51993}
50290#define vfmsd_lane_f64(__p0_401, __p1_401, __p2_401, __p3_401) __extension__ ({ \51994#define vfmsd_lane_f64(__p0_493, __p1_493, __p2_493, __p3_493) __extension__ ({ \
50291 float64_t __s0_401 = __p0_401; \51995 float64_t __s0_493 = __p0_493; \
50292 float64_t __s1_401 = __p1_401; \51996 float64_t __s1_493 = __p1_493; \
50293 float64x1_t __s2_401 = __p2_401; \51997 float64x1_t __s2_493 = __p2_493; \
50294 float64_t __ret_401; \51998 float64_t __ret_493; \
50295 __ret_401 = vfmad_lane_f64(__s0_401, -__s1_401, __s2_401, __p3_401); \51999 __ret_493 = vfmad_lane_f64(__s0_493, -__s1_493, __s2_493, __p3_493); \
50296 __ret_401; \52000 __ret_493; \
50297})52001})
50298#ifdef __LITTLE_ENDIAN__52002#ifdef __LITTLE_ENDIAN__
50299#define vfmss_lane_f32(__p0_402, __p1_402, __p2_402, __p3_402) __extension__ ({ \52003#define vfmss_lane_f32(__p0_494, __p1_494, __p2_494, __p3_494) __extension__ ({ \
50300 float32_t __s0_402 = __p0_402; \52004 float32_t __s0_494 = __p0_494; \
50301 float32_t __s1_402 = __p1_402; \52005 float32_t __s1_494 = __p1_494; \
50302 float32x2_t __s2_402 = __p2_402; \52006 float32x2_t __s2_494 = __p2_494; \
50303 float32_t __ret_402; \52007 float32_t __ret_494; \
50304 __ret_402 = vfmas_lane_f32(__s0_402, -__s1_402, __s2_402, __p3_402); \52008 __ret_494 = vfmas_lane_f32(__s0_494, -__s1_494, __s2_494, __p3_494); \
50305 __ret_402; \52009 __ret_494; \
50306})52010})
50307#else52011#else
50308#define vfmss_lane_f32(__p0_403, __p1_403, __p2_403, __p3_403) __extension__ ({ \52012#define vfmss_lane_f32(__p0_495, __p1_495, __p2_495, __p3_495) __extension__ ({ \
50309 float32_t __s0_403 = __p0_403; \52013 float32_t __s0_495 = __p0_495; \
50310 float32_t __s1_403 = __p1_403; \52014 float32_t __s1_495 = __p1_495; \
50311 float32x2_t __s2_403 = __p2_403; \52015 float32x2_t __s2_495 = __p2_495; \
50312 float32x2_t __rev2_403; __rev2_403 = __builtin_shufflevector(__s2_403, __s2_403, 1, 0); \52016 float32x2_t __rev2_495; __rev2_495 = __builtin_shufflevector(__s2_495, __s2_495, 1, 0); \
50313 float32_t __ret_403; \52017 float32_t __ret_495; \
50314 __ret_403 = __noswap_vfmas_lane_f32(__s0_403, -__s1_403, __rev2_403, __p3_403); \52018 __ret_495 = __noswap_vfmas_lane_f32(__s0_495, -__s1_495, __rev2_495, __p3_495); \
50315 __ret_403; \52019 __ret_495; \
50316})52020})
50317#endif52021#endif
5031852022
50319#ifdef __LITTLE_ENDIAN__52023#ifdef __LITTLE_ENDIAN__
50320#define vfmsq_lane_f64(__p0_404, __p1_404, __p2_404, __p3_404) __extension__ ({ \52024#define vfmsq_lane_f64(__p0_496, __p1_496, __p2_496, __p3_496) __extension__ ({ \
50321 float64x2_t __s0_404 = __p0_404; \52025 float64x2_t __s0_496 = __p0_496; \
50322 float64x2_t __s1_404 = __p1_404; \52026 float64x2_t __s1_496 = __p1_496; \
50323 float64x1_t __s2_404 = __p2_404; \52027 float64x1_t __s2_496 = __p2_496; \
50324 float64x2_t __ret_404; \52028 float64x2_t __ret_496; \
50325 __ret_404 = vfmaq_lane_f64(__s0_404, -__s1_404, __s2_404, __p3_404); \52029 __ret_496 = vfmaq_lane_f64(__s0_496, -__s1_496, __s2_496, __p3_496); \
50326 __ret_404; \52030 __ret_496; \
50327})52031})
50328#else52032#else
50329#define vfmsq_lane_f64(__p0_405, __p1_405, __p2_405, __p3_405) __extension__ ({ \52033#define vfmsq_lane_f64(__p0_497, __p1_497, __p2_497, __p3_497) __extension__ ({ \
50330 float64x2_t __s0_405 = __p0_405; \52034 float64x2_t __s0_497 = __p0_497; \
50331 float64x2_t __s1_405 = __p1_405; \52035 float64x2_t __s1_497 = __p1_497; \
50332 float64x1_t __s2_405 = __p2_405; \52036 float64x1_t __s2_497 = __p2_497; \
50333 float64x2_t __rev0_405; __rev0_405 = __builtin_shufflevector(__s0_405, __s0_405, 1, 0); \52037 float64x2_t __rev0_497; __rev0_497 = __builtin_shufflevector(__s0_497, __s0_497, 1, 0); \
50334 float64x2_t __rev1_405; __rev1_405 = __builtin_shufflevector(__s1_405, __s1_405, 1, 0); \52038 float64x2_t __rev1_497; __rev1_497 = __builtin_shufflevector(__s1_497, __s1_497, 1, 0); \
50335 float64x2_t __ret_405; \52039 float64x2_t __ret_497; \
50336 __ret_405 = __noswap_vfmaq_lane_f64(__rev0_405, -__rev1_405, __s2_405, __p3_405); \52040 __ret_497 = __noswap_vfmaq_lane_f64(__rev0_497, -__rev1_497, __s2_497, __p3_497); \
50337 __ret_405 = __builtin_shufflevector(__ret_405, __ret_405, 1, 0); \52041 __ret_497 = __builtin_shufflevector(__ret_497, __ret_497, 1, 0); \
50338 __ret_405; \52042 __ret_497; \
50339})52043})
50340#endif52044#endif
5034152045
50342#ifdef __LITTLE_ENDIAN__52046#ifdef __LITTLE_ENDIAN__
50343#define vfmsq_lane_f32(__p0_406, __p1_406, __p2_406, __p3_406) __extension__ ({ \52047#define vfmsq_lane_f32(__p0_498, __p1_498, __p2_498, __p3_498) __extension__ ({ \
50344 float32x4_t __s0_406 = __p0_406; \52048 float32x4_t __s0_498 = __p0_498; \
50345 float32x4_t __s1_406 = __p1_406; \52049 float32x4_t __s1_498 = __p1_498; \
50346 float32x2_t __s2_406 = __p2_406; \52050 float32x2_t __s2_498 = __p2_498; \
50347 float32x4_t __ret_406; \52051 float32x4_t __ret_498; \
50348 __ret_406 = vfmaq_lane_f32(__s0_406, -__s1_406, __s2_406, __p3_406); \52052 __ret_498 = vfmaq_lane_f32(__s0_498, -__s1_498, __s2_498, __p3_498); \
50349 __ret_406; \52053 __ret_498; \
50350})52054})
50351#else52055#else
50352#define vfmsq_lane_f32(__p0_407, __p1_407, __p2_407, __p3_407) __extension__ ({ \52056#define vfmsq_lane_f32(__p0_499, __p1_499, __p2_499, __p3_499) __extension__ ({ \
50353 float32x4_t __s0_407 = __p0_407; \52057 float32x4_t __s0_499 = __p0_499; \
50354 float32x4_t __s1_407 = __p1_407; \52058 float32x4_t __s1_499 = __p1_499; \
50355 float32x2_t __s2_407 = __p2_407; \52059 float32x2_t __s2_499 = __p2_499; \
50356 float32x4_t __rev0_407; __rev0_407 = __builtin_shufflevector(__s0_407, __s0_407, 3, 2, 1, 0); \52060 float32x4_t __rev0_499; __rev0_499 = __builtin_shufflevector(__s0_499, __s0_499, 3, 2, 1, 0); \
50357 float32x4_t __rev1_407; __rev1_407 = __builtin_shufflevector(__s1_407, __s1_407, 3, 2, 1, 0); \52061 float32x4_t __rev1_499; __rev1_499 = __builtin_shufflevector(__s1_499, __s1_499, 3, 2, 1, 0); \
50358 float32x2_t __rev2_407; __rev2_407 = __builtin_shufflevector(__s2_407, __s2_407, 1, 0); \52062 float32x2_t __rev2_499; __rev2_499 = __builtin_shufflevector(__s2_499, __s2_499, 1, 0); \
50359 float32x4_t __ret_407; \52063 float32x4_t __ret_499; \
50360 __ret_407 = __noswap_vfmaq_lane_f32(__rev0_407, -__rev1_407, __rev2_407, __p3_407); \52064 __ret_499 = __noswap_vfmaq_lane_f32(__rev0_499, -__rev1_499, __rev2_499, __p3_499); \
50361 __ret_407 = __builtin_shufflevector(__ret_407, __ret_407, 3, 2, 1, 0); \52065 __ret_499 = __builtin_shufflevector(__ret_499, __ret_499, 3, 2, 1, 0); \
50362 __ret_407; \52066 __ret_499; \
50363})52067})
50364#endif52068#endif
5036552069
50366#define vfms_lane_f64(__p0_408, __p1_408, __p2_408, __p3_408) __extension__ ({ \52070#define vfms_lane_f64(__p0_500, __p1_500, __p2_500, __p3_500) __extension__ ({ \
50367 float64x1_t __s0_408 = __p0_408; \52071 float64x1_t __s0_500 = __p0_500; \
50368 float64x1_t __s1_408 = __p1_408; \52072 float64x1_t __s1_500 = __p1_500; \
50369 float64x1_t __s2_408 = __p2_408; \52073 float64x1_t __s2_500 = __p2_500; \
50370 float64x1_t __ret_408; \52074 float64x1_t __ret_500; \
50371 __ret_408 = vfma_lane_f64(__s0_408, -__s1_408, __s2_408, __p3_408); \52075 __ret_500 = vfma_lane_f64(__s0_500, -__s1_500, __s2_500, __p3_500); \
50372 __ret_408; \52076 __ret_500; \
50373})52077})
50374#ifdef __LITTLE_ENDIAN__52078#ifdef __LITTLE_ENDIAN__
50375#define vfms_lane_f32(__p0_409, __p1_409, __p2_409, __p3_409) __extension__ ({ \52079#define vfms_lane_f32(__p0_501, __p1_501, __p2_501, __p3_501) __extension__ ({ \
50376 float32x2_t __s0_409 = __p0_409; \52080 float32x2_t __s0_501 = __p0_501; \
50377 float32x2_t __s1_409 = __p1_409; \52081 float32x2_t __s1_501 = __p1_501; \
50378 float32x2_t __s2_409 = __p2_409; \52082 float32x2_t __s2_501 = __p2_501; \
50379 float32x2_t __ret_409; \52083 float32x2_t __ret_501; \
50380 __ret_409 = vfma_lane_f32(__s0_409, -__s1_409, __s2_409, __p3_409); \52084 __ret_501 = vfma_lane_f32(__s0_501, -__s1_501, __s2_501, __p3_501); \
50381 __ret_409; \52085 __ret_501; \
50382})52086})
50383#else52087#else
50384#define vfms_lane_f32(__p0_410, __p1_410, __p2_410, __p3_410) __extension__ ({ \52088#define vfms_lane_f32(__p0_502, __p1_502, __p2_502, __p3_502) __extension__ ({ \
50385 float32x2_t __s0_410 = __p0_410; \52089 float32x2_t __s0_502 = __p0_502; \
50386 float32x2_t __s1_410 = __p1_410; \52090 float32x2_t __s1_502 = __p1_502; \
50387 float32x2_t __s2_410 = __p2_410; \52091 float32x2_t __s2_502 = __p2_502; \
50388 float32x2_t __rev0_410; __rev0_410 = __builtin_shufflevector(__s0_410, __s0_410, 1, 0); \52092 float32x2_t __rev0_502; __rev0_502 = __builtin_shufflevector(__s0_502, __s0_502, 1, 0); \
50389 float32x2_t __rev1_410; __rev1_410 = __builtin_shufflevector(__s1_410, __s1_410, 1, 0); \52093 float32x2_t __rev1_502; __rev1_502 = __builtin_shufflevector(__s1_502, __s1_502, 1, 0); \
50390 float32x2_t __rev2_410; __rev2_410 = __builtin_shufflevector(__s2_410, __s2_410, 1, 0); \52094 float32x2_t __rev2_502; __rev2_502 = __builtin_shufflevector(__s2_502, __s2_502, 1, 0); \
50391 float32x2_t __ret_410; \52095 float32x2_t __ret_502; \
50392 __ret_410 = __noswap_vfma_lane_f32(__rev0_410, -__rev1_410, __rev2_410, __p3_410); \52096 __ret_502 = __noswap_vfma_lane_f32(__rev0_502, -__rev1_502, __rev2_502, __p3_502); \
50393 __ret_410 = __builtin_shufflevector(__ret_410, __ret_410, 1, 0); \52097 __ret_502 = __builtin_shufflevector(__ret_502, __ret_502, 1, 0); \
50394 __ret_410; \52098 __ret_502; \
50395})52099})
50396#endif52100#endif
5039752101
50398#ifdef __LITTLE_ENDIAN__52102#ifdef __LITTLE_ENDIAN__
50399#define vfmsd_laneq_f64(__p0_411, __p1_411, __p2_411, __p3_411) __extension__ ({ \52103#define vfmsd_laneq_f64(__p0_503, __p1_503, __p2_503, __p3_503) __extension__ ({ \
50400 float64_t __s0_411 = __p0_411; \52104 float64_t __s0_503 = __p0_503; \
50401 float64_t __s1_411 = __p1_411; \52105 float64_t __s1_503 = __p1_503; \
50402 float64x2_t __s2_411 = __p2_411; \52106 float64x2_t __s2_503 = __p2_503; \
50403 float64_t __ret_411; \52107 float64_t __ret_503; \
50404 __ret_411 = vfmad_laneq_f64(__s0_411, -__s1_411, __s2_411, __p3_411); \52108 __ret_503 = vfmad_laneq_f64(__s0_503, -__s1_503, __s2_503, __p3_503); \
50405 __ret_411; \52109 __ret_503; \
50406})52110})
50407#else52111#else
50408#define vfmsd_laneq_f64(__p0_412, __p1_412, __p2_412, __p3_412) __extension__ ({ \52112#define vfmsd_laneq_f64(__p0_504, __p1_504, __p2_504, __p3_504) __extension__ ({ \
50409 float64_t __s0_412 = __p0_412; \52113 float64_t __s0_504 = __p0_504; \
50410 float64_t __s1_412 = __p1_412; \52114 float64_t __s1_504 = __p1_504; \
50411 float64x2_t __s2_412 = __p2_412; \52115 float64x2_t __s2_504 = __p2_504; \
50412 float64x2_t __rev2_412; __rev2_412 = __builtin_shufflevector(__s2_412, __s2_412, 1, 0); \52116 float64x2_t __rev2_504; __rev2_504 = __builtin_shufflevector(__s2_504, __s2_504, 1, 0); \
50413 float64_t __ret_412; \52117 float64_t __ret_504; \
50414 __ret_412 = __noswap_vfmad_laneq_f64(__s0_412, -__s1_412, __rev2_412, __p3_412); \52118 __ret_504 = __noswap_vfmad_laneq_f64(__s0_504, -__s1_504, __rev2_504, __p3_504); \
50415 __ret_412; \52119 __ret_504; \
50416})52120})
50417#endif52121#endif
5041852122
50419#ifdef __LITTLE_ENDIAN__52123#ifdef __LITTLE_ENDIAN__
50420#define vfmss_laneq_f32(__p0_413, __p1_413, __p2_413, __p3_413) __extension__ ({ \52124#define vfmss_laneq_f32(__p0_505, __p1_505, __p2_505, __p3_505) __extension__ ({ \
50421 float32_t __s0_413 = __p0_413; \52125 float32_t __s0_505 = __p0_505; \
50422 float32_t __s1_413 = __p1_413; \52126 float32_t __s1_505 = __p1_505; \
50423 float32x4_t __s2_413 = __p2_413; \52127 float32x4_t __s2_505 = __p2_505; \
50424 float32_t __ret_413; \52128 float32_t __ret_505; \
50425 __ret_413 = vfmas_laneq_f32(__s0_413, -__s1_413, __s2_413, __p3_413); \52129 __ret_505 = vfmas_laneq_f32(__s0_505, -__s1_505, __s2_505, __p3_505); \
50426 __ret_413; \52130 __ret_505; \
50427})52131})
50428#else52132#else
50429#define vfmss_laneq_f32(__p0_414, __p1_414, __p2_414, __p3_414) __extension__ ({ \52133#define vfmss_laneq_f32(__p0_506, __p1_506, __p2_506, __p3_506) __extension__ ({ \
50430 float32_t __s0_414 = __p0_414; \52134 float32_t __s0_506 = __p0_506; \
50431 float32_t __s1_414 = __p1_414; \52135 float32_t __s1_506 = __p1_506; \
50432 float32x4_t __s2_414 = __p2_414; \52136 float32x4_t __s2_506 = __p2_506; \
50433 float32x4_t __rev2_414; __rev2_414 = __builtin_shufflevector(__s2_414, __s2_414, 3, 2, 1, 0); \52137 float32x4_t __rev2_506; __rev2_506 = __builtin_shufflevector(__s2_506, __s2_506, 3, 2, 1, 0); \
50434 float32_t __ret_414; \52138 float32_t __ret_506; \
50435 __ret_414 = __noswap_vfmas_laneq_f32(__s0_414, -__s1_414, __rev2_414, __p3_414); \52139 __ret_506 = __noswap_vfmas_laneq_f32(__s0_506, -__s1_506, __rev2_506, __p3_506); \
50436 __ret_414; \52140 __ret_506; \
50437})52141})
50438#endif52142#endif
5043952143
50440#ifdef __LITTLE_ENDIAN__52144#ifdef __LITTLE_ENDIAN__
50441#define vfmsq_laneq_f64(__p0_415, __p1_415, __p2_415, __p3_415) __extension__ ({ \52145#define vfmsq_laneq_f64(__p0_507, __p1_507, __p2_507, __p3_507) __extension__ ({ \
50442 float64x2_t __s0_415 = __p0_415; \52146 float64x2_t __s0_507 = __p0_507; \
50443 float64x2_t __s1_415 = __p1_415; \52147 float64x2_t __s1_507 = __p1_507; \
50444 float64x2_t __s2_415 = __p2_415; \52148 float64x2_t __s2_507 = __p2_507; \
50445 float64x2_t __ret_415; \52149 float64x2_t __ret_507; \
50446 __ret_415 = vfmaq_laneq_f64(__s0_415, -__s1_415, __s2_415, __p3_415); \52150 __ret_507 = vfmaq_laneq_f64(__s0_507, -__s1_507, __s2_507, __p3_507); \
50447 __ret_415; \52151 __ret_507; \
50448})52152})
50449#else52153#else
50450#define vfmsq_laneq_f64(__p0_416, __p1_416, __p2_416, __p3_416) __extension__ ({ \52154#define vfmsq_laneq_f64(__p0_508, __p1_508, __p2_508, __p3_508) __extension__ ({ \
50451 float64x2_t __s0_416 = __p0_416; \52155 float64x2_t __s0_508 = __p0_508; \
50452 float64x2_t __s1_416 = __p1_416; \52156 float64x2_t __s1_508 = __p1_508; \
50453 float64x2_t __s2_416 = __p2_416; \52157 float64x2_t __s2_508 = __p2_508; \
50454 float64x2_t __rev0_416; __rev0_416 = __builtin_shufflevector(__s0_416, __s0_416, 1, 0); \52158 float64x2_t __rev0_508; __rev0_508 = __builtin_shufflevector(__s0_508, __s0_508, 1, 0); \
50455 float64x2_t __rev1_416; __rev1_416 = __builtin_shufflevector(__s1_416, __s1_416, 1, 0); \52159 float64x2_t __rev1_508; __rev1_508 = __builtin_shufflevector(__s1_508, __s1_508, 1, 0); \
50456 float64x2_t __rev2_416; __rev2_416 = __builtin_shufflevector(__s2_416, __s2_416, 1, 0); \52160 float64x2_t __rev2_508; __rev2_508 = __builtin_shufflevector(__s2_508, __s2_508, 1, 0); \
50457 float64x2_t __ret_416; \52161 float64x2_t __ret_508; \
50458 __ret_416 = __noswap_vfmaq_laneq_f64(__rev0_416, -__rev1_416, __rev2_416, __p3_416); \52162 __ret_508 = __noswap_vfmaq_laneq_f64(__rev0_508, -__rev1_508, __rev2_508, __p3_508); \
50459 __ret_416 = __builtin_shufflevector(__ret_416, __ret_416, 1, 0); \52163 __ret_508 = __builtin_shufflevector(__ret_508, __ret_508, 1, 0); \
50460 __ret_416; \52164 __ret_508; \
50461})52165})
50462#endif52166#endif
5046352167
50464#ifdef __LITTLE_ENDIAN__52168#ifdef __LITTLE_ENDIAN__
50465#define vfmsq_laneq_f32(__p0_417, __p1_417, __p2_417, __p3_417) __extension__ ({ \52169#define vfmsq_laneq_f32(__p0_509, __p1_509, __p2_509, __p3_509) __extension__ ({ \
50466 float32x4_t __s0_417 = __p0_417; \52170 float32x4_t __s0_509 = __p0_509; \
50467 float32x4_t __s1_417 = __p1_417; \52171 float32x4_t __s1_509 = __p1_509; \
50468 float32x4_t __s2_417 = __p2_417; \52172 float32x4_t __s2_509 = __p2_509; \
50469 float32x4_t __ret_417; \52173 float32x4_t __ret_509; \
50470 __ret_417 = vfmaq_laneq_f32(__s0_417, -__s1_417, __s2_417, __p3_417); \52174 __ret_509 = vfmaq_laneq_f32(__s0_509, -__s1_509, __s2_509, __p3_509); \
50471 __ret_417; \52175 __ret_509; \
50472})52176})
50473#else52177#else
50474#define vfmsq_laneq_f32(__p0_418, __p1_418, __p2_418, __p3_418) __extension__ ({ \52178#define vfmsq_laneq_f32(__p0_510, __p1_510, __p2_510, __p3_510) __extension__ ({ \
50475 float32x4_t __s0_418 = __p0_418; \52179 float32x4_t __s0_510 = __p0_510; \
50476 float32x4_t __s1_418 = __p1_418; \52180 float32x4_t __s1_510 = __p1_510; \
50477 float32x4_t __s2_418 = __p2_418; \52181 float32x4_t __s2_510 = __p2_510; \
50478 float32x4_t __rev0_418; __rev0_418 = __builtin_shufflevector(__s0_418, __s0_418, 3, 2, 1, 0); \52182 float32x4_t __rev0_510; __rev0_510 = __builtin_shufflevector(__s0_510, __s0_510, 3, 2, 1, 0); \
50479 float32x4_t __rev1_418; __rev1_418 = __builtin_shufflevector(__s1_418, __s1_418, 3, 2, 1, 0); \52183 float32x4_t __rev1_510; __rev1_510 = __builtin_shufflevector(__s1_510, __s1_510, 3, 2, 1, 0); \
50480 float32x4_t __rev2_418; __rev2_418 = __builtin_shufflevector(__s2_418, __s2_418, 3, 2, 1, 0); \52184 float32x4_t __rev2_510; __rev2_510 = __builtin_shufflevector(__s2_510, __s2_510, 3, 2, 1, 0); \
50481 float32x4_t __ret_418; \52185 float32x4_t __ret_510; \
50482 __ret_418 = __noswap_vfmaq_laneq_f32(__rev0_418, -__rev1_418, __rev2_418, __p3_418); \52186 __ret_510 = __noswap_vfmaq_laneq_f32(__rev0_510, -__rev1_510, __rev2_510, __p3_510); \
50483 __ret_418 = __builtin_shufflevector(__ret_418, __ret_418, 3, 2, 1, 0); \52187 __ret_510 = __builtin_shufflevector(__ret_510, __ret_510, 3, 2, 1, 0); \
50484 __ret_418; \52188 __ret_510; \
50485})52189})
50486#endif52190#endif
5048752191
50488#ifdef __LITTLE_ENDIAN__52192#ifdef __LITTLE_ENDIAN__
50489#define vfms_laneq_f64(__p0_419, __p1_419, __p2_419, __p3_419) __extension__ ({ \52193#define vfms_laneq_f64(__p0_511, __p1_511, __p2_511, __p3_511) __extension__ ({ \
50490 float64x1_t __s0_419 = __p0_419; \52194 float64x1_t __s0_511 = __p0_511; \
50491 float64x1_t __s1_419 = __p1_419; \52195 float64x1_t __s1_511 = __p1_511; \
50492 float64x2_t __s2_419 = __p2_419; \52196 float64x2_t __s2_511 = __p2_511; \
50493 float64x1_t __ret_419; \52197 float64x1_t __ret_511; \
50494 __ret_419 = vfma_laneq_f64(__s0_419, -__s1_419, __s2_419, __p3_419); \52198 __ret_511 = vfma_laneq_f64(__s0_511, -__s1_511, __s2_511, __p3_511); \
50495 __ret_419; \52199 __ret_511; \
50496})52200})
50497#else52201#else
50498#define vfms_laneq_f64(__p0_420, __p1_420, __p2_420, __p3_420) __extension__ ({ \52202#define vfms_laneq_f64(__p0_512, __p1_512, __p2_512, __p3_512) __extension__ ({ \
50499 float64x1_t __s0_420 = __p0_420; \52203 float64x1_t __s0_512 = __p0_512; \
50500 float64x1_t __s1_420 = __p1_420; \52204 float64x1_t __s1_512 = __p1_512; \
50501 float64x2_t __s2_420 = __p2_420; \52205 float64x2_t __s2_512 = __p2_512; \
50502 float64x2_t __rev2_420; __rev2_420 = __builtin_shufflevector(__s2_420, __s2_420, 1, 0); \52206 float64x2_t __rev2_512; __rev2_512 = __builtin_shufflevector(__s2_512, __s2_512, 1, 0); \
50503 float64x1_t __ret_420; \52207 float64x1_t __ret_512; \
50504 __ret_420 = __noswap_vfma_laneq_f64(__s0_420, -__s1_420, __rev2_420, __p3_420); \52208 __ret_512 = __noswap_vfma_laneq_f64(__s0_512, -__s1_512, __rev2_512, __p3_512); \
50505 __ret_420; \52209 __ret_512; \
50506})52210})
50507#endif52211#endif
5050852212
50509#ifdef __LITTLE_ENDIAN__52213#ifdef __LITTLE_ENDIAN__
50510#define vfms_laneq_f32(__p0_421, __p1_421, __p2_421, __p3_421) __extension__ ({ \52214#define vfms_laneq_f32(__p0_513, __p1_513, __p2_513, __p3_513) __extension__ ({ \
50511 float32x2_t __s0_421 = __p0_421; \52215 float32x2_t __s0_513 = __p0_513; \
50512 float32x2_t __s1_421 = __p1_421; \52216 float32x2_t __s1_513 = __p1_513; \
50513 float32x4_t __s2_421 = __p2_421; \52217 float32x4_t __s2_513 = __p2_513; \
50514 float32x2_t __ret_421; \52218 float32x2_t __ret_513; \
50515 __ret_421 = vfma_laneq_f32(__s0_421, -__s1_421, __s2_421, __p3_421); \52219 __ret_513 = vfma_laneq_f32(__s0_513, -__s1_513, __s2_513, __p3_513); \
50516 __ret_421; \52220 __ret_513; \
50517})52221})
50518#else52222#else
50519#define vfms_laneq_f32(__p0_422, __p1_422, __p2_422, __p3_422) __extension__ ({ \52223#define vfms_laneq_f32(__p0_514, __p1_514, __p2_514, __p3_514) __extension__ ({ \
50520 float32x2_t __s0_422 = __p0_422; \52224 float32x2_t __s0_514 = __p0_514; \
50521 float32x2_t __s1_422 = __p1_422; \52225 float32x2_t __s1_514 = __p1_514; \
50522 float32x4_t __s2_422 = __p2_422; \52226 float32x4_t __s2_514 = __p2_514; \
50523 float32x2_t __rev0_422; __rev0_422 = __builtin_shufflevector(__s0_422, __s0_422, 1, 0); \52227 float32x2_t __rev0_514; __rev0_514 = __builtin_shufflevector(__s0_514, __s0_514, 1, 0); \
50524 float32x2_t __rev1_422; __rev1_422 = __builtin_shufflevector(__s1_422, __s1_422, 1, 0); \52228 float32x2_t __rev1_514; __rev1_514 = __builtin_shufflevector(__s1_514, __s1_514, 1, 0); \
50525 float32x4_t __rev2_422; __rev2_422 = __builtin_shufflevector(__s2_422, __s2_422, 3, 2, 1, 0); \52229 float32x4_t __rev2_514; __rev2_514 = __builtin_shufflevector(__s2_514, __s2_514, 3, 2, 1, 0); \
50526 float32x2_t __ret_422; \52230 float32x2_t __ret_514; \
50527 __ret_422 = __noswap_vfma_laneq_f32(__rev0_422, -__rev1_422, __rev2_422, __p3_422); \52231 __ret_514 = __noswap_vfma_laneq_f32(__rev0_514, -__rev1_514, __rev2_514, __p3_514); \
50528 __ret_422 = __builtin_shufflevector(__ret_422, __ret_422, 1, 0); \52232 __ret_514 = __builtin_shufflevector(__ret_514, __ret_514, 1, 0); \
50529 __ret_422; \52233 __ret_514; \
50530})52234})
50531#endif52235#endif
5053252236
...@@ -52548,547 +54252,530 @@ __ai float64x1_t vmla_f64(float64x1_t __p0, float64x1_t __p1, float64x1_t __p2)...@@ -52548,547 +54252,530 @@ __ai float64x1_t vmla_f64(float64x1_t __p0, float64x1_t __p1, float64x1_t __p2)
52548 return __ret;54252 return __ret;
52549}54253}
52550#ifdef __LITTLE_ENDIAN__54254#ifdef __LITTLE_ENDIAN__
52551#define vmlaq_laneq_u32(__p0_423, __p1_423, __p2_423, __p3_423) __extension__ ({ \54255#define vmlaq_laneq_u32(__p0_515, __p1_515, __p2_515, __p3_515) __extension__ ({ \
52552 uint32x4_t __s0_423 = __p0_423; \54256 uint32x4_t __s0_515 = __p0_515; \
52553 uint32x4_t __s1_423 = __p1_423; \54257 uint32x4_t __s1_515 = __p1_515; \
52554 uint32x4_t __s2_423 = __p2_423; \54258 uint32x4_t __s2_515 = __p2_515; \
52555 uint32x4_t __ret_423; \54259 uint32x4_t __ret_515; \
52556 __ret_423 = __s0_423 + __s1_423 * splatq_laneq_u32(__s2_423, __p3_423); \54260 __ret_515 = __s0_515 + __s1_515 * splatq_laneq_u32(__s2_515, __p3_515); \
52557 __ret_423; \54261 __ret_515; \
52558})54262})
52559#else54263#else
52560#define vmlaq_laneq_u32(__p0_424, __p1_424, __p2_424, __p3_424) __extension__ ({ \54264#define vmlaq_laneq_u32(__p0_516, __p1_516, __p2_516, __p3_516) __extension__ ({ \
52561 uint32x4_t __s0_424 = __p0_424; \54265 uint32x4_t __s0_516 = __p0_516; \
52562 uint32x4_t __s1_424 = __p1_424; \54266 uint32x4_t __s1_516 = __p1_516; \
52563 uint32x4_t __s2_424 = __p2_424; \54267 uint32x4_t __s2_516 = __p2_516; \
52564 uint32x4_t __rev0_424; __rev0_424 = __builtin_shufflevector(__s0_424, __s0_424, 3, 2, 1, 0); \54268 uint32x4_t __rev0_516; __rev0_516 = __builtin_shufflevector(__s0_516, __s0_516, 3, 2, 1, 0); \
52565 uint32x4_t __rev1_424; __rev1_424 = __builtin_shufflevector(__s1_424, __s1_424, 3, 2, 1, 0); \54269 uint32x4_t __rev1_516; __rev1_516 = __builtin_shufflevector(__s1_516, __s1_516, 3, 2, 1, 0); \
52566 uint32x4_t __rev2_424; __rev2_424 = __builtin_shufflevector(__s2_424, __s2_424, 3, 2, 1, 0); \54270 uint32x4_t __rev2_516; __rev2_516 = __builtin_shufflevector(__s2_516, __s2_516, 3, 2, 1, 0); \
52567 uint32x4_t __ret_424; \54271 uint32x4_t __ret_516; \
52568 __ret_424 = __rev0_424 + __rev1_424 * __noswap_splatq_laneq_u32(__rev2_424, __p3_424); \54272 __ret_516 = __rev0_516 + __rev1_516 * __noswap_splatq_laneq_u32(__rev2_516, __p3_516); \
52569 __ret_424 = __builtin_shufflevector(__ret_424, __ret_424, 3, 2, 1, 0); \54273 __ret_516 = __builtin_shufflevector(__ret_516, __ret_516, 3, 2, 1, 0); \
52570 __ret_424; \54274 __ret_516; \
52571})54275})
52572#endif54276#endif
5257354277
52574#ifdef __LITTLE_ENDIAN__54278#ifdef __LITTLE_ENDIAN__
52575#define vmlaq_laneq_u16(__p0_425, __p1_425, __p2_425, __p3_425) __extension__ ({ \54279#define vmlaq_laneq_u16(__p0_517, __p1_517, __p2_517, __p3_517) __extension__ ({ \
52576 uint16x8_t __s0_425 = __p0_425; \54280 uint16x8_t __s0_517 = __p0_517; \
52577 uint16x8_t __s1_425 = __p1_425; \54281 uint16x8_t __s1_517 = __p1_517; \
52578 uint16x8_t __s2_425 = __p2_425; \54282 uint16x8_t __s2_517 = __p2_517; \
52579 uint16x8_t __ret_425; \54283 uint16x8_t __ret_517; \
52580 __ret_425 = __s0_425 + __s1_425 * splatq_laneq_u16(__s2_425, __p3_425); \54284 __ret_517 = __s0_517 + __s1_517 * splatq_laneq_u16(__s2_517, __p3_517); \
52581 __ret_425; \54285 __ret_517; \
52582})54286})
52583#else54287#else
52584#define vmlaq_laneq_u16(__p0_426, __p1_426, __p2_426, __p3_426) __extension__ ({ \54288#define vmlaq_laneq_u16(__p0_518, __p1_518, __p2_518, __p3_518) __extension__ ({ \
52585 uint16x8_t __s0_426 = __p0_426; \54289 uint16x8_t __s0_518 = __p0_518; \
52586 uint16x8_t __s1_426 = __p1_426; \54290 uint16x8_t __s1_518 = __p1_518; \
52587 uint16x8_t __s2_426 = __p2_426; \54291 uint16x8_t __s2_518 = __p2_518; \
52588 uint16x8_t __rev0_426; __rev0_426 = __builtin_shufflevector(__s0_426, __s0_426, 7, 6, 5, 4, 3, 2, 1, 0); \54292 uint16x8_t __rev0_518; __rev0_518 = __builtin_shufflevector(__s0_518, __s0_518, 7, 6, 5, 4, 3, 2, 1, 0); \
52589 uint16x8_t __rev1_426; __rev1_426 = __builtin_shufflevector(__s1_426, __s1_426, 7, 6, 5, 4, 3, 2, 1, 0); \54293 uint16x8_t __rev1_518; __rev1_518 = __builtin_shufflevector(__s1_518, __s1_518, 7, 6, 5, 4, 3, 2, 1, 0); \
52590 uint16x8_t __rev2_426; __rev2_426 = __builtin_shufflevector(__s2_426, __s2_426, 7, 6, 5, 4, 3, 2, 1, 0); \54294 uint16x8_t __rev2_518; __rev2_518 = __builtin_shufflevector(__s2_518, __s2_518, 7, 6, 5, 4, 3, 2, 1, 0); \
52591 uint16x8_t __ret_426; \54295 uint16x8_t __ret_518; \
52592 __ret_426 = __rev0_426 + __rev1_426 * __noswap_splatq_laneq_u16(__rev2_426, __p3_426); \54296 __ret_518 = __rev0_518 + __rev1_518 * __noswap_splatq_laneq_u16(__rev2_518, __p3_518); \
52593 __ret_426 = __builtin_shufflevector(__ret_426, __ret_426, 7, 6, 5, 4, 3, 2, 1, 0); \54297 __ret_518 = __builtin_shufflevector(__ret_518, __ret_518, 7, 6, 5, 4, 3, 2, 1, 0); \
52594 __ret_426; \54298 __ret_518; \
52595})54299})
52596#endif54300#endif
5259754301
52598#ifdef __LITTLE_ENDIAN__54302#ifdef __LITTLE_ENDIAN__
52599#define vmlaq_laneq_f32(__p0_427, __p1_427, __p2_427, __p3_427) __extension__ ({ \54303#define vmlaq_laneq_f32(__p0_519, __p1_519, __p2_519, __p3_519) __extension__ ({ \
52600 float32x4_t __s0_427 = __p0_427; \54304 float32x4_t __s0_519 = __p0_519; \
52601 float32x4_t __s1_427 = __p1_427; \54305 float32x4_t __s1_519 = __p1_519; \
52602 float32x4_t __s2_427 = __p2_427; \54306 float32x4_t __s2_519 = __p2_519; \
52603 float32x4_t __ret_427; \54307 float32x4_t __ret_519; \
52604 __ret_427 = __s0_427 + __s1_427 * splatq_laneq_f32(__s2_427, __p3_427); \54308 __ret_519 = __s0_519 + __s1_519 * splatq_laneq_f32(__s2_519, __p3_519); \
52605 __ret_427; \54309 __ret_519; \
52606})54310})
52607#else54311#else
52608#define vmlaq_laneq_f32(__p0_428, __p1_428, __p2_428, __p3_428) __extension__ ({ \54312#define vmlaq_laneq_f32(__p0_520, __p1_520, __p2_520, __p3_520) __extension__ ({ \
52609 float32x4_t __s0_428 = __p0_428; \54313 float32x4_t __s0_520 = __p0_520; \
52610 float32x4_t __s1_428 = __p1_428; \54314 float32x4_t __s1_520 = __p1_520; \
52611 float32x4_t __s2_428 = __p2_428; \54315 float32x4_t __s2_520 = __p2_520; \
52612 float32x4_t __rev0_428; __rev0_428 = __builtin_shufflevector(__s0_428, __s0_428, 3, 2, 1, 0); \54316 float32x4_t __rev0_520; __rev0_520 = __builtin_shufflevector(__s0_520, __s0_520, 3, 2, 1, 0); \
52613 float32x4_t __rev1_428; __rev1_428 = __builtin_shufflevector(__s1_428, __s1_428, 3, 2, 1, 0); \54317 float32x4_t __rev1_520; __rev1_520 = __builtin_shufflevector(__s1_520, __s1_520, 3, 2, 1, 0); \
52614 float32x4_t __rev2_428; __rev2_428 = __builtin_shufflevector(__s2_428, __s2_428, 3, 2, 1, 0); \54318 float32x4_t __rev2_520; __rev2_520 = __builtin_shufflevector(__s2_520, __s2_520, 3, 2, 1, 0); \
52615 float32x4_t __ret_428; \54319 float32x4_t __ret_520; \
52616 __ret_428 = __rev0_428 + __rev1_428 * __noswap_splatq_laneq_f32(__rev2_428, __p3_428); \54320 __ret_520 = __rev0_520 + __rev1_520 * __noswap_splatq_laneq_f32(__rev2_520, __p3_520); \
52617 __ret_428 = __builtin_shufflevector(__ret_428, __ret_428, 3, 2, 1, 0); \54321 __ret_520 = __builtin_shufflevector(__ret_520, __ret_520, 3, 2, 1, 0); \
52618 __ret_428; \54322 __ret_520; \
52619})54323})
52620#endif54324#endif
5262154325
52622#ifdef __LITTLE_ENDIAN__54326#ifdef __LITTLE_ENDIAN__
52623#define vmlaq_laneq_s32(__p0_429, __p1_429, __p2_429, __p3_429) __extension__ ({ \54327#define vmlaq_laneq_s32(__p0_521, __p1_521, __p2_521, __p3_521) __extension__ ({ \
52624 int32x4_t __s0_429 = __p0_429; \54328 int32x4_t __s0_521 = __p0_521; \
52625 int32x4_t __s1_429 = __p1_429; \54329 int32x4_t __s1_521 = __p1_521; \
52626 int32x4_t __s2_429 = __p2_429; \54330 int32x4_t __s2_521 = __p2_521; \
52627 int32x4_t __ret_429; \54331 int32x4_t __ret_521; \
52628 __ret_429 = __s0_429 + __s1_429 * splatq_laneq_s32(__s2_429, __p3_429); \54332 __ret_521 = __s0_521 + __s1_521 * splatq_laneq_s32(__s2_521, __p3_521); \
52629 __ret_429; \54333 __ret_521; \
52630})54334})
52631#else54335#else
52632#define vmlaq_laneq_s32(__p0_430, __p1_430, __p2_430, __p3_430) __extension__ ({ \54336#define vmlaq_laneq_s32(__p0_522, __p1_522, __p2_522, __p3_522) __extension__ ({ \
52633 int32x4_t __s0_430 = __p0_430; \54337 int32x4_t __s0_522 = __p0_522; \
52634 int32x4_t __s1_430 = __p1_430; \54338 int32x4_t __s1_522 = __p1_522; \
52635 int32x4_t __s2_430 = __p2_430; \54339 int32x4_t __s2_522 = __p2_522; \
52636 int32x4_t __rev0_430; __rev0_430 = __builtin_shufflevector(__s0_430, __s0_430, 3, 2, 1, 0); \54340 int32x4_t __rev0_522; __rev0_522 = __builtin_shufflevector(__s0_522, __s0_522, 3, 2, 1, 0); \
52637 int32x4_t __rev1_430; __rev1_430 = __builtin_shufflevector(__s1_430, __s1_430, 3, 2, 1, 0); \54341 int32x4_t __rev1_522; __rev1_522 = __builtin_shufflevector(__s1_522, __s1_522, 3, 2, 1, 0); \
52638 int32x4_t __rev2_430; __rev2_430 = __builtin_shufflevector(__s2_430, __s2_430, 3, 2, 1, 0); \54342 int32x4_t __rev2_522; __rev2_522 = __builtin_shufflevector(__s2_522, __s2_522, 3, 2, 1, 0); \
52639 int32x4_t __ret_430; \54343 int32x4_t __ret_522; \
52640 __ret_430 = __rev0_430 + __rev1_430 * __noswap_splatq_laneq_s32(__rev2_430, __p3_430); \54344 __ret_522 = __rev0_522 + __rev1_522 * __noswap_splatq_laneq_s32(__rev2_522, __p3_522); \
52641 __ret_430 = __builtin_shufflevector(__ret_430, __ret_430, 3, 2, 1, 0); \54345 __ret_522 = __builtin_shufflevector(__ret_522, __ret_522, 3, 2, 1, 0); \
52642 __ret_430; \54346 __ret_522; \
52643})54347})
52644#endif54348#endif
5264554349
52646#ifdef __LITTLE_ENDIAN__54350#ifdef __LITTLE_ENDIAN__
52647#define vmlaq_laneq_s16(__p0_431, __p1_431, __p2_431, __p3_431) __extension__ ({ \54351#define vmlaq_laneq_s16(__p0_523, __p1_523, __p2_523, __p3_523) __extension__ ({ \
52648 int16x8_t __s0_431 = __p0_431; \54352 int16x8_t __s0_523 = __p0_523; \
52649 int16x8_t __s1_431 = __p1_431; \54353 int16x8_t __s1_523 = __p1_523; \
52650 int16x8_t __s2_431 = __p2_431; \54354 int16x8_t __s2_523 = __p2_523; \
52651 int16x8_t __ret_431; \54355 int16x8_t __ret_523; \
52652 __ret_431 = __s0_431 + __s1_431 * splatq_laneq_s16(__s2_431, __p3_431); \54356 __ret_523 = __s0_523 + __s1_523 * splatq_laneq_s16(__s2_523, __p3_523); \
52653 __ret_431; \54357 __ret_523; \
52654})54358})
52655#else54359#else
52656#define vmlaq_laneq_s16(__p0_432, __p1_432, __p2_432, __p3_432) __extension__ ({ \54360#define vmlaq_laneq_s16(__p0_524, __p1_524, __p2_524, __p3_524) __extension__ ({ \
52657 int16x8_t __s0_432 = __p0_432; \54361 int16x8_t __s0_524 = __p0_524; \
52658 int16x8_t __s1_432 = __p1_432; \54362 int16x8_t __s1_524 = __p1_524; \
52659 int16x8_t __s2_432 = __p2_432; \54363 int16x8_t __s2_524 = __p2_524; \
52660 int16x8_t __rev0_432; __rev0_432 = __builtin_shufflevector(__s0_432, __s0_432, 7, 6, 5, 4, 3, 2, 1, 0); \54364 int16x8_t __rev0_524; __rev0_524 = __builtin_shufflevector(__s0_524, __s0_524, 7, 6, 5, 4, 3, 2, 1, 0); \
52661 int16x8_t __rev1_432; __rev1_432 = __builtin_shufflevector(__s1_432, __s1_432, 7, 6, 5, 4, 3, 2, 1, 0); \54365 int16x8_t __rev1_524; __rev1_524 = __builtin_shufflevector(__s1_524, __s1_524, 7, 6, 5, 4, 3, 2, 1, 0); \
52662 int16x8_t __rev2_432; __rev2_432 = __builtin_shufflevector(__s2_432, __s2_432, 7, 6, 5, 4, 3, 2, 1, 0); \54366 int16x8_t __rev2_524; __rev2_524 = __builtin_shufflevector(__s2_524, __s2_524, 7, 6, 5, 4, 3, 2, 1, 0); \
52663 int16x8_t __ret_432; \54367 int16x8_t __ret_524; \
52664 __ret_432 = __rev0_432 + __rev1_432 * __noswap_splatq_laneq_s16(__rev2_432, __p3_432); \54368 __ret_524 = __rev0_524 + __rev1_524 * __noswap_splatq_laneq_s16(__rev2_524, __p3_524); \
52665 __ret_432 = __builtin_shufflevector(__ret_432, __ret_432, 7, 6, 5, 4, 3, 2, 1, 0); \54369 __ret_524 = __builtin_shufflevector(__ret_524, __ret_524, 7, 6, 5, 4, 3, 2, 1, 0); \
52666 __ret_432; \54370 __ret_524; \
52667})54371})
52668#endif54372#endif
5266954373
52670#ifdef __LITTLE_ENDIAN__54374#ifdef __LITTLE_ENDIAN__
52671#define vmla_laneq_u32(__p0_433, __p1_433, __p2_433, __p3_433) __extension__ ({ \54375#define vmla_laneq_u32(__p0_525, __p1_525, __p2_525, __p3_525) __extension__ ({ \
52672 uint32x2_t __s0_433 = __p0_433; \54376 uint32x2_t __s0_525 = __p0_525; \
52673 uint32x2_t __s1_433 = __p1_433; \54377 uint32x2_t __s1_525 = __p1_525; \
52674 uint32x4_t __s2_433 = __p2_433; \54378 uint32x4_t __s2_525 = __p2_525; \
52675 uint32x2_t __ret_433; \54379 uint32x2_t __ret_525; \
52676 __ret_433 = __s0_433 + __s1_433 * splat_laneq_u32(__s2_433, __p3_433); \54380 __ret_525 = __s0_525 + __s1_525 * splat_laneq_u32(__s2_525, __p3_525); \
52677 __ret_433; \54381 __ret_525; \
52678})54382})
52679#else54383#else
52680#define vmla_laneq_u32(__p0_434, __p1_434, __p2_434, __p3_434) __extension__ ({ \54384#define vmla_laneq_u32(__p0_526, __p1_526, __p2_526, __p3_526) __extension__ ({ \
52681 uint32x2_t __s0_434 = __p0_434; \54385 uint32x2_t __s0_526 = __p0_526; \
52682 uint32x2_t __s1_434 = __p1_434; \54386 uint32x2_t __s1_526 = __p1_526; \
52683 uint32x4_t __s2_434 = __p2_434; \54387 uint32x4_t __s2_526 = __p2_526; \
52684 uint32x2_t __rev0_434; __rev0_434 = __builtin_shufflevector(__s0_434, __s0_434, 1, 0); \54388 uint32x2_t __rev0_526; __rev0_526 = __builtin_shufflevector(__s0_526, __s0_526, 1, 0); \
52685 uint32x2_t __rev1_434; __rev1_434 = __builtin_shufflevector(__s1_434, __s1_434, 1, 0); \54389 uint32x2_t __rev1_526; __rev1_526 = __builtin_shufflevector(__s1_526, __s1_526, 1, 0); \
52686 uint32x4_t __rev2_434; __rev2_434 = __builtin_shufflevector(__s2_434, __s2_434, 3, 2, 1, 0); \54390 uint32x4_t __rev2_526; __rev2_526 = __builtin_shufflevector(__s2_526, __s2_526, 3, 2, 1, 0); \
52687 uint32x2_t __ret_434; \54391 uint32x2_t __ret_526; \
52688 __ret_434 = __rev0_434 + __rev1_434 * __noswap_splat_laneq_u32(__rev2_434, __p3_434); \54392 __ret_526 = __rev0_526 + __rev1_526 * __noswap_splat_laneq_u32(__rev2_526, __p3_526); \
52689 __ret_434 = __builtin_shufflevector(__ret_434, __ret_434, 1, 0); \54393 __ret_526 = __builtin_shufflevector(__ret_526, __ret_526, 1, 0); \
52690 __ret_434; \54394 __ret_526; \
52691})54395})
52692#endif54396#endif
5269354397
52694#ifdef __LITTLE_ENDIAN__54398#ifdef __LITTLE_ENDIAN__
52695#define vmla_laneq_u16(__p0_435, __p1_435, __p2_435, __p3_435) __extension__ ({ \54399#define vmla_laneq_u16(__p0_527, __p1_527, __p2_527, __p3_527) __extension__ ({ \
52696 uint16x4_t __s0_435 = __p0_435; \54400 uint16x4_t __s0_527 = __p0_527; \
52697 uint16x4_t __s1_435 = __p1_435; \54401 uint16x4_t __s1_527 = __p1_527; \
52698 uint16x8_t __s2_435 = __p2_435; \54402 uint16x8_t __s2_527 = __p2_527; \
52699 uint16x4_t __ret_435; \54403 uint16x4_t __ret_527; \
52700 __ret_435 = __s0_435 + __s1_435 * splat_laneq_u16(__s2_435, __p3_435); \54404 __ret_527 = __s0_527 + __s1_527 * splat_laneq_u16(__s2_527, __p3_527); \
52701 __ret_435; \54405 __ret_527; \
52702})54406})
52703#else54407#else
52704#define vmla_laneq_u16(__p0_436, __p1_436, __p2_436, __p3_436) __extension__ ({ \54408#define vmla_laneq_u16(__p0_528, __p1_528, __p2_528, __p3_528) __extension__ ({ \
52705 uint16x4_t __s0_436 = __p0_436; \54409 uint16x4_t __s0_528 = __p0_528; \
52706 uint16x4_t __s1_436 = __p1_436; \54410 uint16x4_t __s1_528 = __p1_528; \
52707 uint16x8_t __s2_436 = __p2_436; \54411 uint16x8_t __s2_528 = __p2_528; \
52708 uint16x4_t __rev0_436; __rev0_436 = __builtin_shufflevector(__s0_436, __s0_436, 3, 2, 1, 0); \54412 uint16x4_t __rev0_528; __rev0_528 = __builtin_shufflevector(__s0_528, __s0_528, 3, 2, 1, 0); \
52709 uint16x4_t __rev1_436; __rev1_436 = __builtin_shufflevector(__s1_436, __s1_436, 3, 2, 1, 0); \54413 uint16x4_t __rev1_528; __rev1_528 = __builtin_shufflevector(__s1_528, __s1_528, 3, 2, 1, 0); \
52710 uint16x8_t __rev2_436; __rev2_436 = __builtin_shufflevector(__s2_436, __s2_436, 7, 6, 5, 4, 3, 2, 1, 0); \54414 uint16x8_t __rev2_528; __rev2_528 = __builtin_shufflevector(__s2_528, __s2_528, 7, 6, 5, 4, 3, 2, 1, 0); \
52711 uint16x4_t __ret_436; \54415 uint16x4_t __ret_528; \
52712 __ret_436 = __rev0_436 + __rev1_436 * __noswap_splat_laneq_u16(__rev2_436, __p3_436); \54416 __ret_528 = __rev0_528 + __rev1_528 * __noswap_splat_laneq_u16(__rev2_528, __p3_528); \
52713 __ret_436 = __builtin_shufflevector(__ret_436, __ret_436, 3, 2, 1, 0); \54417 __ret_528 = __builtin_shufflevector(__ret_528, __ret_528, 3, 2, 1, 0); \
52714 __ret_436; \54418 __ret_528; \
52715})54419})
52716#endif54420#endif
5271754421
52718#ifdef __LITTLE_ENDIAN__54422#ifdef __LITTLE_ENDIAN__
52719#define vmla_laneq_f32(__p0_437, __p1_437, __p2_437, __p3_437) __extension__ ({ \54423#define vmla_laneq_f32(__p0_529, __p1_529, __p2_529, __p3_529) __extension__ ({ \
52720 float32x2_t __s0_437 = __p0_437; \54424 float32x2_t __s0_529 = __p0_529; \
52721 float32x2_t __s1_437 = __p1_437; \54425 float32x2_t __s1_529 = __p1_529; \
52722 float32x4_t __s2_437 = __p2_437; \54426 float32x4_t __s2_529 = __p2_529; \
52723 float32x2_t __ret_437; \54427 float32x2_t __ret_529; \
52724 __ret_437 = __s0_437 + __s1_437 * splat_laneq_f32(__s2_437, __p3_437); \54428 __ret_529 = __s0_529 + __s1_529 * splat_laneq_f32(__s2_529, __p3_529); \
52725 __ret_437; \54429 __ret_529; \
52726})54430})
52727#else54431#else
52728#define vmla_laneq_f32(__p0_438, __p1_438, __p2_438, __p3_438) __extension__ ({ \54432#define vmla_laneq_f32(__p0_530, __p1_530, __p2_530, __p3_530) __extension__ ({ \
52729 float32x2_t __s0_438 = __p0_438; \54433 float32x2_t __s0_530 = __p0_530; \
52730 float32x2_t __s1_438 = __p1_438; \54434 float32x2_t __s1_530 = __p1_530; \
52731 float32x4_t __s2_438 = __p2_438; \54435 float32x4_t __s2_530 = __p2_530; \
52732 float32x2_t __rev0_438; __rev0_438 = __builtin_shufflevector(__s0_438, __s0_438, 1, 0); \54436 float32x2_t __rev0_530; __rev0_530 = __builtin_shufflevector(__s0_530, __s0_530, 1, 0); \
52733 float32x2_t __rev1_438; __rev1_438 = __builtin_shufflevector(__s1_438, __s1_438, 1, 0); \54437 float32x2_t __rev1_530; __rev1_530 = __builtin_shufflevector(__s1_530, __s1_530, 1, 0); \
52734 float32x4_t __rev2_438; __rev2_438 = __builtin_shufflevector(__s2_438, __s2_438, 3, 2, 1, 0); \54438 float32x4_t __rev2_530; __rev2_530 = __builtin_shufflevector(__s2_530, __s2_530, 3, 2, 1, 0); \
52735 float32x2_t __ret_438; \54439 float32x2_t __ret_530; \
52736 __ret_438 = __rev0_438 + __rev1_438 * __noswap_splat_laneq_f32(__rev2_438, __p3_438); \54440 __ret_530 = __rev0_530 + __rev1_530 * __noswap_splat_laneq_f32(__rev2_530, __p3_530); \
52737 __ret_438 = __builtin_shufflevector(__ret_438, __ret_438, 1, 0); \54441 __ret_530 = __builtin_shufflevector(__ret_530, __ret_530, 1, 0); \
52738 __ret_438; \54442 __ret_530; \
52739})54443})
52740#endif54444#endif
5274154445
52742#ifdef __LITTLE_ENDIAN__54446#ifdef __LITTLE_ENDIAN__
52743#define vmla_laneq_s32(__p0_439, __p1_439, __p2_439, __p3_439) __extension__ ({ \54447#define vmla_laneq_s32(__p0_531, __p1_531, __p2_531, __p3_531) __extension__ ({ \
52744 int32x2_t __s0_439 = __p0_439; \54448 int32x2_t __s0_531 = __p0_531; \
52745 int32x2_t __s1_439 = __p1_439; \54449 int32x2_t __s1_531 = __p1_531; \
52746 int32x4_t __s2_439 = __p2_439; \54450 int32x4_t __s2_531 = __p2_531; \
52747 int32x2_t __ret_439; \54451 int32x2_t __ret_531; \
52748 __ret_439 = __s0_439 + __s1_439 * splat_laneq_s32(__s2_439, __p3_439); \54452 __ret_531 = __s0_531 + __s1_531 * splat_laneq_s32(__s2_531, __p3_531); \
52749 __ret_439; \54453 __ret_531; \
52750})54454})
52751#else54455#else
52752#define vmla_laneq_s32(__p0_440, __p1_440, __p2_440, __p3_440) __extension__ ({ \54456#define vmla_laneq_s32(__p0_532, __p1_532, __p2_532, __p3_532) __extension__ ({ \
52753 int32x2_t __s0_440 = __p0_440; \54457 int32x2_t __s0_532 = __p0_532; \
52754 int32x2_t __s1_440 = __p1_440; \54458 int32x2_t __s1_532 = __p1_532; \
52755 int32x4_t __s2_440 = __p2_440; \54459 int32x4_t __s2_532 = __p2_532; \
52756 int32x2_t __rev0_440; __rev0_440 = __builtin_shufflevector(__s0_440, __s0_440, 1, 0); \54460 int32x2_t __rev0_532; __rev0_532 = __builtin_shufflevector(__s0_532, __s0_532, 1, 0); \
52757 int32x2_t __rev1_440; __rev1_440 = __builtin_shufflevector(__s1_440, __s1_440, 1, 0); \54461 int32x2_t __rev1_532; __rev1_532 = __builtin_shufflevector(__s1_532, __s1_532, 1, 0); \
52758 int32x4_t __rev2_440; __rev2_440 = __builtin_shufflevector(__s2_440, __s2_440, 3, 2, 1, 0); \54462 int32x4_t __rev2_532; __rev2_532 = __builtin_shufflevector(__s2_532, __s2_532, 3, 2, 1, 0); \
52759 int32x2_t __ret_440; \54463 int32x2_t __ret_532; \
52760 __ret_440 = __rev0_440 + __rev1_440 * __noswap_splat_laneq_s32(__rev2_440, __p3_440); \54464 __ret_532 = __rev0_532 + __rev1_532 * __noswap_splat_laneq_s32(__rev2_532, __p3_532); \
52761 __ret_440 = __builtin_shufflevector(__ret_440, __ret_440, 1, 0); \54465 __ret_532 = __builtin_shufflevector(__ret_532, __ret_532, 1, 0); \
52762 __ret_440; \54466 __ret_532; \
52763})54467})
52764#endif54468#endif
5276554469
52766#ifdef __LITTLE_ENDIAN__54470#ifdef __LITTLE_ENDIAN__
52767#define vmla_laneq_s16(__p0_441, __p1_441, __p2_441, __p3_441) __extension__ ({ \54471#define vmla_laneq_s16(__p0_533, __p1_533, __p2_533, __p3_533) __extension__ ({ \
52768 int16x4_t __s0_441 = __p0_441; \54472 int16x4_t __s0_533 = __p0_533; \
52769 int16x4_t __s1_441 = __p1_441; \54473 int16x4_t __s1_533 = __p1_533; \
52770 int16x8_t __s2_441 = __p2_441; \54474 int16x8_t __s2_533 = __p2_533; \
52771 int16x4_t __ret_441; \54475 int16x4_t __ret_533; \
52772 __ret_441 = __s0_441 + __s1_441 * splat_laneq_s16(__s2_441, __p3_441); \54476 __ret_533 = __s0_533 + __s1_533 * splat_laneq_s16(__s2_533, __p3_533); \
52773 __ret_441; \54477 __ret_533; \
52774})54478})
52775#else54479#else
52776#define vmla_laneq_s16(__p0_442, __p1_442, __p2_442, __p3_442) __extension__ ({ \54480#define vmla_laneq_s16(__p0_534, __p1_534, __p2_534, __p3_534) __extension__ ({ \
52777 int16x4_t __s0_442 = __p0_442; \54481 int16x4_t __s0_534 = __p0_534; \
52778 int16x4_t __s1_442 = __p1_442; \54482 int16x4_t __s1_534 = __p1_534; \
52779 int16x8_t __s2_442 = __p2_442; \54483 int16x8_t __s2_534 = __p2_534; \
52780 int16x4_t __rev0_442; __rev0_442 = __builtin_shufflevector(__s0_442, __s0_442, 3, 2, 1, 0); \54484 int16x4_t __rev0_534; __rev0_534 = __builtin_shufflevector(__s0_534, __s0_534, 3, 2, 1, 0); \
52781 int16x4_t __rev1_442; __rev1_442 = __builtin_shufflevector(__s1_442, __s1_442, 3, 2, 1, 0); \54485 int16x4_t __rev1_534; __rev1_534 = __builtin_shufflevector(__s1_534, __s1_534, 3, 2, 1, 0); \
52782 int16x8_t __rev2_442; __rev2_442 = __builtin_shufflevector(__s2_442, __s2_442, 7, 6, 5, 4, 3, 2, 1, 0); \54486 int16x8_t __rev2_534; __rev2_534 = __builtin_shufflevector(__s2_534, __s2_534, 7, 6, 5, 4, 3, 2, 1, 0); \
52783 int16x4_t __ret_442; \54487 int16x4_t __ret_534; \
52784 __ret_442 = __rev0_442 + __rev1_442 * __noswap_splat_laneq_s16(__rev2_442, __p3_442); \54488 __ret_534 = __rev0_534 + __rev1_534 * __noswap_splat_laneq_s16(__rev2_534, __p3_534); \
52785 __ret_442 = __builtin_shufflevector(__ret_442, __ret_442, 3, 2, 1, 0); \54489 __ret_534 = __builtin_shufflevector(__ret_534, __ret_534, 3, 2, 1, 0); \
52786 __ret_442; \54490 __ret_534; \
52787})54491})
52788#endif54492#endif
5278954493
52790#ifdef __LITTLE_ENDIAN__54494#ifdef __LITTLE_ENDIAN__
52791__ai float64x2_t vmlaq_n_f64(float64x2_t __p0, float64x2_t __p1, float64_t __p2) {54495#define vmlal_high_lane_u32(__p0_535, __p1_535, __p2_535, __p3_535) __extension__ ({ \
52792 float64x2_t __ret;54496 uint64x2_t __s0_535 = __p0_535; \
52793 __ret = __p0 + __p1 * (float64x2_t) {__p2, __p2};54497 uint32x4_t __s1_535 = __p1_535; \
52794 return __ret;54498 uint32x2_t __s2_535 = __p2_535; \
52795}54499 uint64x2_t __ret_535; \
52796#else54500 __ret_535 = __s0_535 + vmull_u32(vget_high_u32(__s1_535), splat_lane_u32(__s2_535, __p3_535)); \
52797__ai float64x2_t vmlaq_n_f64(float64x2_t __p0, float64x2_t __p1, float64_t __p2) {54501 __ret_535; \
52798 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
52799 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
52800 float64x2_t __ret;
52801 __ret = __rev0 + __rev1 * (float64x2_t) {__p2, __p2};
52802 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
52803 return __ret;
52804}
52805#endif
52806
52807#ifdef __LITTLE_ENDIAN__
52808#define vmlal_high_lane_u32(__p0_443, __p1_443, __p2_443, __p3_443) __extension__ ({ \
52809 uint64x2_t __s0_443 = __p0_443; \
52810 uint32x4_t __s1_443 = __p1_443; \
52811 uint32x2_t __s2_443 = __p2_443; \
52812 uint64x2_t __ret_443; \
52813 __ret_443 = __s0_443 + vmull_u32(vget_high_u32(__s1_443), splat_lane_u32(__s2_443, __p3_443)); \
52814 __ret_443; \
52815})54502})
52816#else54503#else
52817#define vmlal_high_lane_u32(__p0_444, __p1_444, __p2_444, __p3_444) __extension__ ({ \54504#define vmlal_high_lane_u32(__p0_536, __p1_536, __p2_536, __p3_536) __extension__ ({ \
52818 uint64x2_t __s0_444 = __p0_444; \54505 uint64x2_t __s0_536 = __p0_536; \
52819 uint32x4_t __s1_444 = __p1_444; \54506 uint32x4_t __s1_536 = __p1_536; \
52820 uint32x2_t __s2_444 = __p2_444; \54507 uint32x2_t __s2_536 = __p2_536; \
52821 uint64x2_t __rev0_444; __rev0_444 = __builtin_shufflevector(__s0_444, __s0_444, 1, 0); \54508 uint64x2_t __rev0_536; __rev0_536 = __builtin_shufflevector(__s0_536, __s0_536, 1, 0); \
52822 uint32x4_t __rev1_444; __rev1_444 = __builtin_shufflevector(__s1_444, __s1_444, 3, 2, 1, 0); \54509 uint32x4_t __rev1_536; __rev1_536 = __builtin_shufflevector(__s1_536, __s1_536, 3, 2, 1, 0); \
52823 uint32x2_t __rev2_444; __rev2_444 = __builtin_shufflevector(__s2_444, __s2_444, 1, 0); \54510 uint32x2_t __rev2_536; __rev2_536 = __builtin_shufflevector(__s2_536, __s2_536, 1, 0); \
52824 uint64x2_t __ret_444; \54511 uint64x2_t __ret_536; \
52825 __ret_444 = __rev0_444 + __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_444), __noswap_splat_lane_u32(__rev2_444, __p3_444)); \54512 __ret_536 = __rev0_536 + __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_536), __noswap_splat_lane_u32(__rev2_536, __p3_536)); \
52826 __ret_444 = __builtin_shufflevector(__ret_444, __ret_444, 1, 0); \54513 __ret_536 = __builtin_shufflevector(__ret_536, __ret_536, 1, 0); \
52827 __ret_444; \54514 __ret_536; \
52828})54515})
52829#endif54516#endif
5283054517
52831#ifdef __LITTLE_ENDIAN__54518#ifdef __LITTLE_ENDIAN__
52832#define vmlal_high_lane_u16(__p0_445, __p1_445, __p2_445, __p3_445) __extension__ ({ \54519#define vmlal_high_lane_u16(__p0_537, __p1_537, __p2_537, __p3_537) __extension__ ({ \
52833 uint32x4_t __s0_445 = __p0_445; \54520 uint32x4_t __s0_537 = __p0_537; \
52834 uint16x8_t __s1_445 = __p1_445; \54521 uint16x8_t __s1_537 = __p1_537; \
52835 uint16x4_t __s2_445 = __p2_445; \54522 uint16x4_t __s2_537 = __p2_537; \
52836 uint32x4_t __ret_445; \54523 uint32x4_t __ret_537; \
52837 __ret_445 = __s0_445 + vmull_u16(vget_high_u16(__s1_445), splat_lane_u16(__s2_445, __p3_445)); \54524 __ret_537 = __s0_537 + vmull_u16(vget_high_u16(__s1_537), splat_lane_u16(__s2_537, __p3_537)); \
52838 __ret_445; \54525 __ret_537; \
52839})54526})
52840#else54527#else
52841#define vmlal_high_lane_u16(__p0_446, __p1_446, __p2_446, __p3_446) __extension__ ({ \54528#define vmlal_high_lane_u16(__p0_538, __p1_538, __p2_538, __p3_538) __extension__ ({ \
52842 uint32x4_t __s0_446 = __p0_446; \54529 uint32x4_t __s0_538 = __p0_538; \
52843 uint16x8_t __s1_446 = __p1_446; \54530 uint16x8_t __s1_538 = __p1_538; \
52844 uint16x4_t __s2_446 = __p2_446; \54531 uint16x4_t __s2_538 = __p2_538; \
52845 uint32x4_t __rev0_446; __rev0_446 = __builtin_shufflevector(__s0_446, __s0_446, 3, 2, 1, 0); \54532 uint32x4_t __rev0_538; __rev0_538 = __builtin_shufflevector(__s0_538, __s0_538, 3, 2, 1, 0); \
52846 uint16x8_t __rev1_446; __rev1_446 = __builtin_shufflevector(__s1_446, __s1_446, 7, 6, 5, 4, 3, 2, 1, 0); \54533 uint16x8_t __rev1_538; __rev1_538 = __builtin_shufflevector(__s1_538, __s1_538, 7, 6, 5, 4, 3, 2, 1, 0); \
52847 uint16x4_t __rev2_446; __rev2_446 = __builtin_shufflevector(__s2_446, __s2_446, 3, 2, 1, 0); \54534 uint16x4_t __rev2_538; __rev2_538 = __builtin_shufflevector(__s2_538, __s2_538, 3, 2, 1, 0); \
52848 uint32x4_t __ret_446; \54535 uint32x4_t __ret_538; \
52849 __ret_446 = __rev0_446 + __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_446), __noswap_splat_lane_u16(__rev2_446, __p3_446)); \54536 __ret_538 = __rev0_538 + __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_538), __noswap_splat_lane_u16(__rev2_538, __p3_538)); \
52850 __ret_446 = __builtin_shufflevector(__ret_446, __ret_446, 3, 2, 1, 0); \54537 __ret_538 = __builtin_shufflevector(__ret_538, __ret_538, 3, 2, 1, 0); \
52851 __ret_446; \54538 __ret_538; \
52852})54539})
52853#endif54540#endif
5285454541
52855#ifdef __LITTLE_ENDIAN__54542#ifdef __LITTLE_ENDIAN__
52856#define vmlal_high_lane_s32(__p0_447, __p1_447, __p2_447, __p3_447) __extension__ ({ \54543#define vmlal_high_lane_s32(__p0_539, __p1_539, __p2_539, __p3_539) __extension__ ({ \
52857 int64x2_t __s0_447 = __p0_447; \54544 int64x2_t __s0_539 = __p0_539; \
52858 int32x4_t __s1_447 = __p1_447; \54545 int32x4_t __s1_539 = __p1_539; \
52859 int32x2_t __s2_447 = __p2_447; \54546 int32x2_t __s2_539 = __p2_539; \
52860 int64x2_t __ret_447; \54547 int64x2_t __ret_539; \
52861 __ret_447 = __s0_447 + vmull_s32(vget_high_s32(__s1_447), splat_lane_s32(__s2_447, __p3_447)); \54548 __ret_539 = __s0_539 + vmull_s32(vget_high_s32(__s1_539), splat_lane_s32(__s2_539, __p3_539)); \
52862 __ret_447; \54549 __ret_539; \
52863})54550})
52864#else54551#else
52865#define vmlal_high_lane_s32(__p0_448, __p1_448, __p2_448, __p3_448) __extension__ ({ \54552#define vmlal_high_lane_s32(__p0_540, __p1_540, __p2_540, __p3_540) __extension__ ({ \
52866 int64x2_t __s0_448 = __p0_448; \54553 int64x2_t __s0_540 = __p0_540; \
52867 int32x4_t __s1_448 = __p1_448; \54554 int32x4_t __s1_540 = __p1_540; \
52868 int32x2_t __s2_448 = __p2_448; \54555 int32x2_t __s2_540 = __p2_540; \
52869 int64x2_t __rev0_448; __rev0_448 = __builtin_shufflevector(__s0_448, __s0_448, 1, 0); \54556 int64x2_t __rev0_540; __rev0_540 = __builtin_shufflevector(__s0_540, __s0_540, 1, 0); \
52870 int32x4_t __rev1_448; __rev1_448 = __builtin_shufflevector(__s1_448, __s1_448, 3, 2, 1, 0); \54557 int32x4_t __rev1_540; __rev1_540 = __builtin_shufflevector(__s1_540, __s1_540, 3, 2, 1, 0); \
52871 int32x2_t __rev2_448; __rev2_448 = __builtin_shufflevector(__s2_448, __s2_448, 1, 0); \54558 int32x2_t __rev2_540; __rev2_540 = __builtin_shufflevector(__s2_540, __s2_540, 1, 0); \
52872 int64x2_t __ret_448; \54559 int64x2_t __ret_540; \
52873 __ret_448 = __rev0_448 + __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_448), __noswap_splat_lane_s32(__rev2_448, __p3_448)); \54560 __ret_540 = __rev0_540 + __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_540), __noswap_splat_lane_s32(__rev2_540, __p3_540)); \
52874 __ret_448 = __builtin_shufflevector(__ret_448, __ret_448, 1, 0); \54561 __ret_540 = __builtin_shufflevector(__ret_540, __ret_540, 1, 0); \
52875 __ret_448; \54562 __ret_540; \
52876})54563})
52877#endif54564#endif
5287854565
52879#ifdef __LITTLE_ENDIAN__54566#ifdef __LITTLE_ENDIAN__
52880#define vmlal_high_lane_s16(__p0_449, __p1_449, __p2_449, __p3_449) __extension__ ({ \54567#define vmlal_high_lane_s16(__p0_541, __p1_541, __p2_541, __p3_541) __extension__ ({ \
52881 int32x4_t __s0_449 = __p0_449; \54568 int32x4_t __s0_541 = __p0_541; \
52882 int16x8_t __s1_449 = __p1_449; \54569 int16x8_t __s1_541 = __p1_541; \
52883 int16x4_t __s2_449 = __p2_449; \54570 int16x4_t __s2_541 = __p2_541; \
52884 int32x4_t __ret_449; \54571 int32x4_t __ret_541; \
52885 __ret_449 = __s0_449 + vmull_s16(vget_high_s16(__s1_449), splat_lane_s16(__s2_449, __p3_449)); \54572 __ret_541 = __s0_541 + vmull_s16(vget_high_s16(__s1_541), splat_lane_s16(__s2_541, __p3_541)); \
52886 __ret_449; \54573 __ret_541; \
52887})54574})
52888#else54575#else
52889#define vmlal_high_lane_s16(__p0_450, __p1_450, __p2_450, __p3_450) __extension__ ({ \54576#define vmlal_high_lane_s16(__p0_542, __p1_542, __p2_542, __p3_542) __extension__ ({ \
52890 int32x4_t __s0_450 = __p0_450; \54577 int32x4_t __s0_542 = __p0_542; \
52891 int16x8_t __s1_450 = __p1_450; \54578 int16x8_t __s1_542 = __p1_542; \
52892 int16x4_t __s2_450 = __p2_450; \54579 int16x4_t __s2_542 = __p2_542; \
52893 int32x4_t __rev0_450; __rev0_450 = __builtin_shufflevector(__s0_450, __s0_450, 3, 2, 1, 0); \54580 int32x4_t __rev0_542; __rev0_542 = __builtin_shufflevector(__s0_542, __s0_542, 3, 2, 1, 0); \
52894 int16x8_t __rev1_450; __rev1_450 = __builtin_shufflevector(__s1_450, __s1_450, 7, 6, 5, 4, 3, 2, 1, 0); \54581 int16x8_t __rev1_542; __rev1_542 = __builtin_shufflevector(__s1_542, __s1_542, 7, 6, 5, 4, 3, 2, 1, 0); \
52895 int16x4_t __rev2_450; __rev2_450 = __builtin_shufflevector(__s2_450, __s2_450, 3, 2, 1, 0); \54582 int16x4_t __rev2_542; __rev2_542 = __builtin_shufflevector(__s2_542, __s2_542, 3, 2, 1, 0); \
52896 int32x4_t __ret_450; \54583 int32x4_t __ret_542; \
52897 __ret_450 = __rev0_450 + __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_450), __noswap_splat_lane_s16(__rev2_450, __p3_450)); \54584 __ret_542 = __rev0_542 + __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_542), __noswap_splat_lane_s16(__rev2_542, __p3_542)); \
52898 __ret_450 = __builtin_shufflevector(__ret_450, __ret_450, 3, 2, 1, 0); \54585 __ret_542 = __builtin_shufflevector(__ret_542, __ret_542, 3, 2, 1, 0); \
52899 __ret_450; \54586 __ret_542; \
52900})54587})
52901#endif54588#endif
5290254589
52903#ifdef __LITTLE_ENDIAN__54590#ifdef __LITTLE_ENDIAN__
52904#define vmlal_high_laneq_u32(__p0_451, __p1_451, __p2_451, __p3_451) __extension__ ({ \54591#define vmlal_high_laneq_u32(__p0_543, __p1_543, __p2_543, __p3_543) __extension__ ({ \
52905 uint64x2_t __s0_451 = __p0_451; \54592 uint64x2_t __s0_543 = __p0_543; \
52906 uint32x4_t __s1_451 = __p1_451; \54593 uint32x4_t __s1_543 = __p1_543; \
52907 uint32x4_t __s2_451 = __p2_451; \54594 uint32x4_t __s2_543 = __p2_543; \
52908 uint64x2_t __ret_451; \54595 uint64x2_t __ret_543; \
52909 __ret_451 = __s0_451 + vmull_u32(vget_high_u32(__s1_451), splat_laneq_u32(__s2_451, __p3_451)); \54596 __ret_543 = __s0_543 + vmull_u32(vget_high_u32(__s1_543), splat_laneq_u32(__s2_543, __p3_543)); \
52910 __ret_451; \54597 __ret_543; \
52911})54598})
52912#else54599#else
52913#define vmlal_high_laneq_u32(__p0_452, __p1_452, __p2_452, __p3_452) __extension__ ({ \54600#define vmlal_high_laneq_u32(__p0_544, __p1_544, __p2_544, __p3_544) __extension__ ({ \
52914 uint64x2_t __s0_452 = __p0_452; \54601 uint64x2_t __s0_544 = __p0_544; \
52915 uint32x4_t __s1_452 = __p1_452; \54602 uint32x4_t __s1_544 = __p1_544; \
52916 uint32x4_t __s2_452 = __p2_452; \54603 uint32x4_t __s2_544 = __p2_544; \
52917 uint64x2_t __rev0_452; __rev0_452 = __builtin_shufflevector(__s0_452, __s0_452, 1, 0); \54604 uint64x2_t __rev0_544; __rev0_544 = __builtin_shufflevector(__s0_544, __s0_544, 1, 0); \
52918 uint32x4_t __rev1_452; __rev1_452 = __builtin_shufflevector(__s1_452, __s1_452, 3, 2, 1, 0); \54605 uint32x4_t __rev1_544; __rev1_544 = __builtin_shufflevector(__s1_544, __s1_544, 3, 2, 1, 0); \
52919 uint32x4_t __rev2_452; __rev2_452 = __builtin_shufflevector(__s2_452, __s2_452, 3, 2, 1, 0); \54606 uint32x4_t __rev2_544; __rev2_544 = __builtin_shufflevector(__s2_544, __s2_544, 3, 2, 1, 0); \
52920 uint64x2_t __ret_452; \54607 uint64x2_t __ret_544; \
52921 __ret_452 = __rev0_452 + __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_452), __noswap_splat_laneq_u32(__rev2_452, __p3_452)); \54608 __ret_544 = __rev0_544 + __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_544), __noswap_splat_laneq_u32(__rev2_544, __p3_544)); \
52922 __ret_452 = __builtin_shufflevector(__ret_452, __ret_452, 1, 0); \54609 __ret_544 = __builtin_shufflevector(__ret_544, __ret_544, 1, 0); \
52923 __ret_452; \54610 __ret_544; \
52924})54611})
52925#endif54612#endif
5292654613
52927#ifdef __LITTLE_ENDIAN__54614#ifdef __LITTLE_ENDIAN__
52928#define vmlal_high_laneq_u16(__p0_453, __p1_453, __p2_453, __p3_453) __extension__ ({ \54615#define vmlal_high_laneq_u16(__p0_545, __p1_545, __p2_545, __p3_545) __extension__ ({ \
52929 uint32x4_t __s0_453 = __p0_453; \54616 uint32x4_t __s0_545 = __p0_545; \
52930 uint16x8_t __s1_453 = __p1_453; \54617 uint16x8_t __s1_545 = __p1_545; \
52931 uint16x8_t __s2_453 = __p2_453; \54618 uint16x8_t __s2_545 = __p2_545; \
52932 uint32x4_t __ret_453; \54619 uint32x4_t __ret_545; \
52933 __ret_453 = __s0_453 + vmull_u16(vget_high_u16(__s1_453), splat_laneq_u16(__s2_453, __p3_453)); \54620 __ret_545 = __s0_545 + vmull_u16(vget_high_u16(__s1_545), splat_laneq_u16(__s2_545, __p3_545)); \
52934 __ret_453; \54621 __ret_545; \
52935})54622})
52936#else54623#else
52937#define vmlal_high_laneq_u16(__p0_454, __p1_454, __p2_454, __p3_454) __extension__ ({ \54624#define vmlal_high_laneq_u16(__p0_546, __p1_546, __p2_546, __p3_546) __extension__ ({ \
52938 uint32x4_t __s0_454 = __p0_454; \54625 uint32x4_t __s0_546 = __p0_546; \
52939 uint16x8_t __s1_454 = __p1_454; \54626 uint16x8_t __s1_546 = __p1_546; \
52940 uint16x8_t __s2_454 = __p2_454; \54627 uint16x8_t __s2_546 = __p2_546; \
52941 uint32x4_t __rev0_454; __rev0_454 = __builtin_shufflevector(__s0_454, __s0_454, 3, 2, 1, 0); \54628 uint32x4_t __rev0_546; __rev0_546 = __builtin_shufflevector(__s0_546, __s0_546, 3, 2, 1, 0); \
52942 uint16x8_t __rev1_454; __rev1_454 = __builtin_shufflevector(__s1_454, __s1_454, 7, 6, 5, 4, 3, 2, 1, 0); \54629 uint16x8_t __rev1_546; __rev1_546 = __builtin_shufflevector(__s1_546, __s1_546, 7, 6, 5, 4, 3, 2, 1, 0); \
52943 uint16x8_t __rev2_454; __rev2_454 = __builtin_shufflevector(__s2_454, __s2_454, 7, 6, 5, 4, 3, 2, 1, 0); \54630 uint16x8_t __rev2_546; __rev2_546 = __builtin_shufflevector(__s2_546, __s2_546, 7, 6, 5, 4, 3, 2, 1, 0); \
52944 uint32x4_t __ret_454; \54631 uint32x4_t __ret_546; \
52945 __ret_454 = __rev0_454 + __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_454), __noswap_splat_laneq_u16(__rev2_454, __p3_454)); \54632 __ret_546 = __rev0_546 + __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_546), __noswap_splat_laneq_u16(__rev2_546, __p3_546)); \
52946 __ret_454 = __builtin_shufflevector(__ret_454, __ret_454, 3, 2, 1, 0); \54633 __ret_546 = __builtin_shufflevector(__ret_546, __ret_546, 3, 2, 1, 0); \
52947 __ret_454; \54634 __ret_546; \
52948})54635})
52949#endif54636#endif
5295054637
52951#ifdef __LITTLE_ENDIAN__54638#ifdef __LITTLE_ENDIAN__
52952#define vmlal_high_laneq_s32(__p0_455, __p1_455, __p2_455, __p3_455) __extension__ ({ \54639#define vmlal_high_laneq_s32(__p0_547, __p1_547, __p2_547, __p3_547) __extension__ ({ \
52953 int64x2_t __s0_455 = __p0_455; \54640 int64x2_t __s0_547 = __p0_547; \
52954 int32x4_t __s1_455 = __p1_455; \54641 int32x4_t __s1_547 = __p1_547; \
52955 int32x4_t __s2_455 = __p2_455; \54642 int32x4_t __s2_547 = __p2_547; \
52956 int64x2_t __ret_455; \54643 int64x2_t __ret_547; \
52957 __ret_455 = __s0_455 + vmull_s32(vget_high_s32(__s1_455), splat_laneq_s32(__s2_455, __p3_455)); \54644 __ret_547 = __s0_547 + vmull_s32(vget_high_s32(__s1_547), splat_laneq_s32(__s2_547, __p3_547)); \
52958 __ret_455; \54645 __ret_547; \
52959})54646})
52960#else54647#else
52961#define vmlal_high_laneq_s32(__p0_456, __p1_456, __p2_456, __p3_456) __extension__ ({ \54648#define vmlal_high_laneq_s32(__p0_548, __p1_548, __p2_548, __p3_548) __extension__ ({ \
52962 int64x2_t __s0_456 = __p0_456; \54649 int64x2_t __s0_548 = __p0_548; \
52963 int32x4_t __s1_456 = __p1_456; \54650 int32x4_t __s1_548 = __p1_548; \
52964 int32x4_t __s2_456 = __p2_456; \54651 int32x4_t __s2_548 = __p2_548; \
52965 int64x2_t __rev0_456; __rev0_456 = __builtin_shufflevector(__s0_456, __s0_456, 1, 0); \54652 int64x2_t __rev0_548; __rev0_548 = __builtin_shufflevector(__s0_548, __s0_548, 1, 0); \
52966 int32x4_t __rev1_456; __rev1_456 = __builtin_shufflevector(__s1_456, __s1_456, 3, 2, 1, 0); \54653 int32x4_t __rev1_548; __rev1_548 = __builtin_shufflevector(__s1_548, __s1_548, 3, 2, 1, 0); \
52967 int32x4_t __rev2_456; __rev2_456 = __builtin_shufflevector(__s2_456, __s2_456, 3, 2, 1, 0); \54654 int32x4_t __rev2_548; __rev2_548 = __builtin_shufflevector(__s2_548, __s2_548, 3, 2, 1, 0); \
52968 int64x2_t __ret_456; \54655 int64x2_t __ret_548; \
52969 __ret_456 = __rev0_456 + __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_456), __noswap_splat_laneq_s32(__rev2_456, __p3_456)); \54656 __ret_548 = __rev0_548 + __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_548), __noswap_splat_laneq_s32(__rev2_548, __p3_548)); \
52970 __ret_456 = __builtin_shufflevector(__ret_456, __ret_456, 1, 0); \54657 __ret_548 = __builtin_shufflevector(__ret_548, __ret_548, 1, 0); \
52971 __ret_456; \54658 __ret_548; \
52972})54659})
52973#endif54660#endif
5297454661
52975#ifdef __LITTLE_ENDIAN__54662#ifdef __LITTLE_ENDIAN__
52976#define vmlal_high_laneq_s16(__p0_457, __p1_457, __p2_457, __p3_457) __extension__ ({ \54663#define vmlal_high_laneq_s16(__p0_549, __p1_549, __p2_549, __p3_549) __extension__ ({ \
52977 int32x4_t __s0_457 = __p0_457; \54664 int32x4_t __s0_549 = __p0_549; \
52978 int16x8_t __s1_457 = __p1_457; \54665 int16x8_t __s1_549 = __p1_549; \
52979 int16x8_t __s2_457 = __p2_457; \54666 int16x8_t __s2_549 = __p2_549; \
52980 int32x4_t __ret_457; \54667 int32x4_t __ret_549; \
52981 __ret_457 = __s0_457 + vmull_s16(vget_high_s16(__s1_457), splat_laneq_s16(__s2_457, __p3_457)); \54668 __ret_549 = __s0_549 + vmull_s16(vget_high_s16(__s1_549), splat_laneq_s16(__s2_549, __p3_549)); \
52982 __ret_457; \54669 __ret_549; \
52983})54670})
52984#else54671#else
52985#define vmlal_high_laneq_s16(__p0_458, __p1_458, __p2_458, __p3_458) __extension__ ({ \54672#define vmlal_high_laneq_s16(__p0_550, __p1_550, __p2_550, __p3_550) __extension__ ({ \
52986 int32x4_t __s0_458 = __p0_458; \54673 int32x4_t __s0_550 = __p0_550; \
52987 int16x8_t __s1_458 = __p1_458; \54674 int16x8_t __s1_550 = __p1_550; \
52988 int16x8_t __s2_458 = __p2_458; \54675 int16x8_t __s2_550 = __p2_550; \
52989 int32x4_t __rev0_458; __rev0_458 = __builtin_shufflevector(__s0_458, __s0_458, 3, 2, 1, 0); \54676 int32x4_t __rev0_550; __rev0_550 = __builtin_shufflevector(__s0_550, __s0_550, 3, 2, 1, 0); \
52990 int16x8_t __rev1_458; __rev1_458 = __builtin_shufflevector(__s1_458, __s1_458, 7, 6, 5, 4, 3, 2, 1, 0); \54677 int16x8_t __rev1_550; __rev1_550 = __builtin_shufflevector(__s1_550, __s1_550, 7, 6, 5, 4, 3, 2, 1, 0); \
52991 int16x8_t __rev2_458; __rev2_458 = __builtin_shufflevector(__s2_458, __s2_458, 7, 6, 5, 4, 3, 2, 1, 0); \54678 int16x8_t __rev2_550; __rev2_550 = __builtin_shufflevector(__s2_550, __s2_550, 7, 6, 5, 4, 3, 2, 1, 0); \
52992 int32x4_t __ret_458; \54679 int32x4_t __ret_550; \
52993 __ret_458 = __rev0_458 + __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_458), __noswap_splat_laneq_s16(__rev2_458, __p3_458)); \54680 __ret_550 = __rev0_550 + __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_550), __noswap_splat_laneq_s16(__rev2_550, __p3_550)); \
52994 __ret_458 = __builtin_shufflevector(__ret_458, __ret_458, 3, 2, 1, 0); \54681 __ret_550 = __builtin_shufflevector(__ret_550, __ret_550, 3, 2, 1, 0); \
52995 __ret_458; \54682 __ret_550; \
52996})54683})
52997#endif54684#endif
5299854685
52999#ifdef __LITTLE_ENDIAN__54686#ifdef __LITTLE_ENDIAN__
53000#define vmlal_laneq_u32(__p0_459, __p1_459, __p2_459, __p3_459) __extension__ ({ \54687#define vmlal_laneq_u32(__p0_551, __p1_551, __p2_551, __p3_551) __extension__ ({ \
53001 uint64x2_t __s0_459 = __p0_459; \54688 uint64x2_t __s0_551 = __p0_551; \
53002 uint32x2_t __s1_459 = __p1_459; \54689 uint32x2_t __s1_551 = __p1_551; \
53003 uint32x4_t __s2_459 = __p2_459; \54690 uint32x4_t __s2_551 = __p2_551; \
53004 uint64x2_t __ret_459; \54691 uint64x2_t __ret_551; \
53005 __ret_459 = __s0_459 + vmull_u32(__s1_459, splat_laneq_u32(__s2_459, __p3_459)); \54692 __ret_551 = __s0_551 + vmull_u32(__s1_551, splat_laneq_u32(__s2_551, __p3_551)); \
53006 __ret_459; \54693 __ret_551; \
53007})54694})
53008#else54695#else
53009#define vmlal_laneq_u32(__p0_460, __p1_460, __p2_460, __p3_460) __extension__ ({ \54696#define vmlal_laneq_u32(__p0_552, __p1_552, __p2_552, __p3_552) __extension__ ({ \
53010 uint64x2_t __s0_460 = __p0_460; \54697 uint64x2_t __s0_552 = __p0_552; \
53011 uint32x2_t __s1_460 = __p1_460; \54698 uint32x2_t __s1_552 = __p1_552; \
53012 uint32x4_t __s2_460 = __p2_460; \54699 uint32x4_t __s2_552 = __p2_552; \
53013 uint64x2_t __rev0_460; __rev0_460 = __builtin_shufflevector(__s0_460, __s0_460, 1, 0); \54700 uint64x2_t __rev0_552; __rev0_552 = __builtin_shufflevector(__s0_552, __s0_552, 1, 0); \
53014 uint32x2_t __rev1_460; __rev1_460 = __builtin_shufflevector(__s1_460, __s1_460, 1, 0); \54701 uint32x2_t __rev1_552; __rev1_552 = __builtin_shufflevector(__s1_552, __s1_552, 1, 0); \
53015 uint32x4_t __rev2_460; __rev2_460 = __builtin_shufflevector(__s2_460, __s2_460, 3, 2, 1, 0); \54702 uint32x4_t __rev2_552; __rev2_552 = __builtin_shufflevector(__s2_552, __s2_552, 3, 2, 1, 0); \
53016 uint64x2_t __ret_460; \54703 uint64x2_t __ret_552; \
53017 __ret_460 = __rev0_460 + __noswap_vmull_u32(__rev1_460, __noswap_splat_laneq_u32(__rev2_460, __p3_460)); \54704 __ret_552 = __rev0_552 + __noswap_vmull_u32(__rev1_552, __noswap_splat_laneq_u32(__rev2_552, __p3_552)); \
53018 __ret_460 = __builtin_shufflevector(__ret_460, __ret_460, 1, 0); \54705 __ret_552 = __builtin_shufflevector(__ret_552, __ret_552, 1, 0); \
53019 __ret_460; \54706 __ret_552; \
53020})54707})
53021#endif54708#endif
5302254709
53023#ifdef __LITTLE_ENDIAN__54710#ifdef __LITTLE_ENDIAN__
53024#define vmlal_laneq_u16(__p0_461, __p1_461, __p2_461, __p3_461) __extension__ ({ \54711#define vmlal_laneq_u16(__p0_553, __p1_553, __p2_553, __p3_553) __extension__ ({ \
53025 uint32x4_t __s0_461 = __p0_461; \54712 uint32x4_t __s0_553 = __p0_553; \
53026 uint16x4_t __s1_461 = __p1_461; \54713 uint16x4_t __s1_553 = __p1_553; \
53027 uint16x8_t __s2_461 = __p2_461; \54714 uint16x8_t __s2_553 = __p2_553; \
53028 uint32x4_t __ret_461; \54715 uint32x4_t __ret_553; \
53029 __ret_461 = __s0_461 + vmull_u16(__s1_461, splat_laneq_u16(__s2_461, __p3_461)); \54716 __ret_553 = __s0_553 + vmull_u16(__s1_553, splat_laneq_u16(__s2_553, __p3_553)); \
53030 __ret_461; \54717 __ret_553; \
53031})54718})
53032#else54719#else
53033#define vmlal_laneq_u16(__p0_462, __p1_462, __p2_462, __p3_462) __extension__ ({ \54720#define vmlal_laneq_u16(__p0_554, __p1_554, __p2_554, __p3_554) __extension__ ({ \
53034 uint32x4_t __s0_462 = __p0_462; \54721 uint32x4_t __s0_554 = __p0_554; \
53035 uint16x4_t __s1_462 = __p1_462; \54722 uint16x4_t __s1_554 = __p1_554; \
53036 uint16x8_t __s2_462 = __p2_462; \54723 uint16x8_t __s2_554 = __p2_554; \
53037 uint32x4_t __rev0_462; __rev0_462 = __builtin_shufflevector(__s0_462, __s0_462, 3, 2, 1, 0); \54724 uint32x4_t __rev0_554; __rev0_554 = __builtin_shufflevector(__s0_554, __s0_554, 3, 2, 1, 0); \
53038 uint16x4_t __rev1_462; __rev1_462 = __builtin_shufflevector(__s1_462, __s1_462, 3, 2, 1, 0); \54725 uint16x4_t __rev1_554; __rev1_554 = __builtin_shufflevector(__s1_554, __s1_554, 3, 2, 1, 0); \
53039 uint16x8_t __rev2_462; __rev2_462 = __builtin_shufflevector(__s2_462, __s2_462, 7, 6, 5, 4, 3, 2, 1, 0); \54726 uint16x8_t __rev2_554; __rev2_554 = __builtin_shufflevector(__s2_554, __s2_554, 7, 6, 5, 4, 3, 2, 1, 0); \
53040 uint32x4_t __ret_462; \54727 uint32x4_t __ret_554; \
53041 __ret_462 = __rev0_462 + __noswap_vmull_u16(__rev1_462, __noswap_splat_laneq_u16(__rev2_462, __p3_462)); \54728 __ret_554 = __rev0_554 + __noswap_vmull_u16(__rev1_554, __noswap_splat_laneq_u16(__rev2_554, __p3_554)); \
53042 __ret_462 = __builtin_shufflevector(__ret_462, __ret_462, 3, 2, 1, 0); \54729 __ret_554 = __builtin_shufflevector(__ret_554, __ret_554, 3, 2, 1, 0); \
53043 __ret_462; \54730 __ret_554; \
53044})54731})
53045#endif54732#endif
5304654733
53047#ifdef __LITTLE_ENDIAN__54734#ifdef __LITTLE_ENDIAN__
53048#define vmlal_laneq_s32(__p0_463, __p1_463, __p2_463, __p3_463) __extension__ ({ \54735#define vmlal_laneq_s32(__p0_555, __p1_555, __p2_555, __p3_555) __extension__ ({ \
53049 int64x2_t __s0_463 = __p0_463; \54736 int64x2_t __s0_555 = __p0_555; \
53050 int32x2_t __s1_463 = __p1_463; \54737 int32x2_t __s1_555 = __p1_555; \
53051 int32x4_t __s2_463 = __p2_463; \54738 int32x4_t __s2_555 = __p2_555; \
53052 int64x2_t __ret_463; \54739 int64x2_t __ret_555; \
53053 __ret_463 = __s0_463 + vmull_s32(__s1_463, splat_laneq_s32(__s2_463, __p3_463)); \54740 __ret_555 = __s0_555 + vmull_s32(__s1_555, splat_laneq_s32(__s2_555, __p3_555)); \
53054 __ret_463; \54741 __ret_555; \
53055})54742})
53056#else54743#else
53057#define vmlal_laneq_s32(__p0_464, __p1_464, __p2_464, __p3_464) __extension__ ({ \54744#define vmlal_laneq_s32(__p0_556, __p1_556, __p2_556, __p3_556) __extension__ ({ \
53058 int64x2_t __s0_464 = __p0_464; \54745 int64x2_t __s0_556 = __p0_556; \
53059 int32x2_t __s1_464 = __p1_464; \54746 int32x2_t __s1_556 = __p1_556; \
53060 int32x4_t __s2_464 = __p2_464; \54747 int32x4_t __s2_556 = __p2_556; \
53061 int64x2_t __rev0_464; __rev0_464 = __builtin_shufflevector(__s0_464, __s0_464, 1, 0); \54748 int64x2_t __rev0_556; __rev0_556 = __builtin_shufflevector(__s0_556, __s0_556, 1, 0); \
53062 int32x2_t __rev1_464; __rev1_464 = __builtin_shufflevector(__s1_464, __s1_464, 1, 0); \54749 int32x2_t __rev1_556; __rev1_556 = __builtin_shufflevector(__s1_556, __s1_556, 1, 0); \
53063 int32x4_t __rev2_464; __rev2_464 = __builtin_shufflevector(__s2_464, __s2_464, 3, 2, 1, 0); \54750 int32x4_t __rev2_556; __rev2_556 = __builtin_shufflevector(__s2_556, __s2_556, 3, 2, 1, 0); \
53064 int64x2_t __ret_464; \54751 int64x2_t __ret_556; \
53065 __ret_464 = __rev0_464 + __noswap_vmull_s32(__rev1_464, __noswap_splat_laneq_s32(__rev2_464, __p3_464)); \54752 __ret_556 = __rev0_556 + __noswap_vmull_s32(__rev1_556, __noswap_splat_laneq_s32(__rev2_556, __p3_556)); \
53066 __ret_464 = __builtin_shufflevector(__ret_464, __ret_464, 1, 0); \54753 __ret_556 = __builtin_shufflevector(__ret_556, __ret_556, 1, 0); \
53067 __ret_464; \54754 __ret_556; \
53068})54755})
53069#endif54756#endif
5307054757
53071#ifdef __LITTLE_ENDIAN__54758#ifdef __LITTLE_ENDIAN__
53072#define vmlal_laneq_s16(__p0_465, __p1_465, __p2_465, __p3_465) __extension__ ({ \54759#define vmlal_laneq_s16(__p0_557, __p1_557, __p2_557, __p3_557) __extension__ ({ \
53073 int32x4_t __s0_465 = __p0_465; \54760 int32x4_t __s0_557 = __p0_557; \
53074 int16x4_t __s1_465 = __p1_465; \54761 int16x4_t __s1_557 = __p1_557; \
53075 int16x8_t __s2_465 = __p2_465; \54762 int16x8_t __s2_557 = __p2_557; \
53076 int32x4_t __ret_465; \54763 int32x4_t __ret_557; \
53077 __ret_465 = __s0_465 + vmull_s16(__s1_465, splat_laneq_s16(__s2_465, __p3_465)); \54764 __ret_557 = __s0_557 + vmull_s16(__s1_557, splat_laneq_s16(__s2_557, __p3_557)); \
53078 __ret_465; \54765 __ret_557; \
53079})54766})
53080#else54767#else
53081#define vmlal_laneq_s16(__p0_466, __p1_466, __p2_466, __p3_466) __extension__ ({ \54768#define vmlal_laneq_s16(__p0_558, __p1_558, __p2_558, __p3_558) __extension__ ({ \
53082 int32x4_t __s0_466 = __p0_466; \54769 int32x4_t __s0_558 = __p0_558; \
53083 int16x4_t __s1_466 = __p1_466; \54770 int16x4_t __s1_558 = __p1_558; \
53084 int16x8_t __s2_466 = __p2_466; \54771 int16x8_t __s2_558 = __p2_558; \
53085 int32x4_t __rev0_466; __rev0_466 = __builtin_shufflevector(__s0_466, __s0_466, 3, 2, 1, 0); \54772 int32x4_t __rev0_558; __rev0_558 = __builtin_shufflevector(__s0_558, __s0_558, 3, 2, 1, 0); \
53086 int16x4_t __rev1_466; __rev1_466 = __builtin_shufflevector(__s1_466, __s1_466, 3, 2, 1, 0); \54773 int16x4_t __rev1_558; __rev1_558 = __builtin_shufflevector(__s1_558, __s1_558, 3, 2, 1, 0); \
53087 int16x8_t __rev2_466; __rev2_466 = __builtin_shufflevector(__s2_466, __s2_466, 7, 6, 5, 4, 3, 2, 1, 0); \54774 int16x8_t __rev2_558; __rev2_558 = __builtin_shufflevector(__s2_558, __s2_558, 7, 6, 5, 4, 3, 2, 1, 0); \
53088 int32x4_t __ret_466; \54775 int32x4_t __ret_558; \
53089 __ret_466 = __rev0_466 + __noswap_vmull_s16(__rev1_466, __noswap_splat_laneq_s16(__rev2_466, __p3_466)); \54776 __ret_558 = __rev0_558 + __noswap_vmull_s16(__rev1_558, __noswap_splat_laneq_s16(__rev2_558, __p3_558)); \
53090 __ret_466 = __builtin_shufflevector(__ret_466, __ret_466, 3, 2, 1, 0); \54777 __ret_558 = __builtin_shufflevector(__ret_558, __ret_558, 3, 2, 1, 0); \
53091 __ret_466; \54778 __ret_558; \
53092})54779})
53093#endif54780#endif
5309454781
...@@ -53116,547 +54803,530 @@ __ai float64x1_t vmls_f64(float64x1_t __p0, float64x1_t __p1, float64x1_t __p2)...@@ -53116,547 +54803,530 @@ __ai float64x1_t vmls_f64(float64x1_t __p0, float64x1_t __p1, float64x1_t __p2)
53116 return __ret;54803 return __ret;
53117}54804}
53118#ifdef __LITTLE_ENDIAN__54805#ifdef __LITTLE_ENDIAN__
53119#define vmlsq_laneq_u32(__p0_467, __p1_467, __p2_467, __p3_467) __extension__ ({ \54806#define vmlsq_laneq_u32(__p0_559, __p1_559, __p2_559, __p3_559) __extension__ ({ \
53120 uint32x4_t __s0_467 = __p0_467; \54807 uint32x4_t __s0_559 = __p0_559; \
53121 uint32x4_t __s1_467 = __p1_467; \54808 uint32x4_t __s1_559 = __p1_559; \
53122 uint32x4_t __s2_467 = __p2_467; \54809 uint32x4_t __s2_559 = __p2_559; \
53123 uint32x4_t __ret_467; \54810 uint32x4_t __ret_559; \
53124 __ret_467 = __s0_467 - __s1_467 * splatq_laneq_u32(__s2_467, __p3_467); \54811 __ret_559 = __s0_559 - __s1_559 * splatq_laneq_u32(__s2_559, __p3_559); \
53125 __ret_467; \54812 __ret_559; \
53126})54813})
53127#else54814#else
53128#define vmlsq_laneq_u32(__p0_468, __p1_468, __p2_468, __p3_468) __extension__ ({ \54815#define vmlsq_laneq_u32(__p0_560, __p1_560, __p2_560, __p3_560) __extension__ ({ \
53129 uint32x4_t __s0_468 = __p0_468; \54816 uint32x4_t __s0_560 = __p0_560; \
53130 uint32x4_t __s1_468 = __p1_468; \54817 uint32x4_t __s1_560 = __p1_560; \
53131 uint32x4_t __s2_468 = __p2_468; \54818 uint32x4_t __s2_560 = __p2_560; \
53132 uint32x4_t __rev0_468; __rev0_468 = __builtin_shufflevector(__s0_468, __s0_468, 3, 2, 1, 0); \54819 uint32x4_t __rev0_560; __rev0_560 = __builtin_shufflevector(__s0_560, __s0_560, 3, 2, 1, 0); \
53133 uint32x4_t __rev1_468; __rev1_468 = __builtin_shufflevector(__s1_468, __s1_468, 3, 2, 1, 0); \54820 uint32x4_t __rev1_560; __rev1_560 = __builtin_shufflevector(__s1_560, __s1_560, 3, 2, 1, 0); \
53134 uint32x4_t __rev2_468; __rev2_468 = __builtin_shufflevector(__s2_468, __s2_468, 3, 2, 1, 0); \54821 uint32x4_t __rev2_560; __rev2_560 = __builtin_shufflevector(__s2_560, __s2_560, 3, 2, 1, 0); \
53135 uint32x4_t __ret_468; \54822 uint32x4_t __ret_560; \
53136 __ret_468 = __rev0_468 - __rev1_468 * __noswap_splatq_laneq_u32(__rev2_468, __p3_468); \54823 __ret_560 = __rev0_560 - __rev1_560 * __noswap_splatq_laneq_u32(__rev2_560, __p3_560); \
53137 __ret_468 = __builtin_shufflevector(__ret_468, __ret_468, 3, 2, 1, 0); \54824 __ret_560 = __builtin_shufflevector(__ret_560, __ret_560, 3, 2, 1, 0); \
53138 __ret_468; \54825 __ret_560; \
53139})54826})
53140#endif54827#endif
5314154828
53142#ifdef __LITTLE_ENDIAN__54829#ifdef __LITTLE_ENDIAN__
53143#define vmlsq_laneq_u16(__p0_469, __p1_469, __p2_469, __p3_469) __extension__ ({ \54830#define vmlsq_laneq_u16(__p0_561, __p1_561, __p2_561, __p3_561) __extension__ ({ \
53144 uint16x8_t __s0_469 = __p0_469; \54831 uint16x8_t __s0_561 = __p0_561; \
53145 uint16x8_t __s1_469 = __p1_469; \54832 uint16x8_t __s1_561 = __p1_561; \
53146 uint16x8_t __s2_469 = __p2_469; \54833 uint16x8_t __s2_561 = __p2_561; \
53147 uint16x8_t __ret_469; \54834 uint16x8_t __ret_561; \
53148 __ret_469 = __s0_469 - __s1_469 * splatq_laneq_u16(__s2_469, __p3_469); \54835 __ret_561 = __s0_561 - __s1_561 * splatq_laneq_u16(__s2_561, __p3_561); \
53149 __ret_469; \54836 __ret_561; \
53150})54837})
53151#else54838#else
53152#define vmlsq_laneq_u16(__p0_470, __p1_470, __p2_470, __p3_470) __extension__ ({ \54839#define vmlsq_laneq_u16(__p0_562, __p1_562, __p2_562, __p3_562) __extension__ ({ \
53153 uint16x8_t __s0_470 = __p0_470; \54840 uint16x8_t __s0_562 = __p0_562; \
53154 uint16x8_t __s1_470 = __p1_470; \54841 uint16x8_t __s1_562 = __p1_562; \
53155 uint16x8_t __s2_470 = __p2_470; \54842 uint16x8_t __s2_562 = __p2_562; \
53156 uint16x8_t __rev0_470; __rev0_470 = __builtin_shufflevector(__s0_470, __s0_470, 7, 6, 5, 4, 3, 2, 1, 0); \54843 uint16x8_t __rev0_562; __rev0_562 = __builtin_shufflevector(__s0_562, __s0_562, 7, 6, 5, 4, 3, 2, 1, 0); \
53157 uint16x8_t __rev1_470; __rev1_470 = __builtin_shufflevector(__s1_470, __s1_470, 7, 6, 5, 4, 3, 2, 1, 0); \54844 uint16x8_t __rev1_562; __rev1_562 = __builtin_shufflevector(__s1_562, __s1_562, 7, 6, 5, 4, 3, 2, 1, 0); \
53158 uint16x8_t __rev2_470; __rev2_470 = __builtin_shufflevector(__s2_470, __s2_470, 7, 6, 5, 4, 3, 2, 1, 0); \54845 uint16x8_t __rev2_562; __rev2_562 = __builtin_shufflevector(__s2_562, __s2_562, 7, 6, 5, 4, 3, 2, 1, 0); \
53159 uint16x8_t __ret_470; \54846 uint16x8_t __ret_562; \
53160 __ret_470 = __rev0_470 - __rev1_470 * __noswap_splatq_laneq_u16(__rev2_470, __p3_470); \54847 __ret_562 = __rev0_562 - __rev1_562 * __noswap_splatq_laneq_u16(__rev2_562, __p3_562); \
53161 __ret_470 = __builtin_shufflevector(__ret_470, __ret_470, 7, 6, 5, 4, 3, 2, 1, 0); \54848 __ret_562 = __builtin_shufflevector(__ret_562, __ret_562, 7, 6, 5, 4, 3, 2, 1, 0); \
53162 __ret_470; \54849 __ret_562; \
53163})54850})
53164#endif54851#endif
5316554852
53166#ifdef __LITTLE_ENDIAN__54853#ifdef __LITTLE_ENDIAN__
53167#define vmlsq_laneq_f32(__p0_471, __p1_471, __p2_471, __p3_471) __extension__ ({ \54854#define vmlsq_laneq_f32(__p0_563, __p1_563, __p2_563, __p3_563) __extension__ ({ \
53168 float32x4_t __s0_471 = __p0_471; \54855 float32x4_t __s0_563 = __p0_563; \
53169 float32x4_t __s1_471 = __p1_471; \54856 float32x4_t __s1_563 = __p1_563; \
53170 float32x4_t __s2_471 = __p2_471; \54857 float32x4_t __s2_563 = __p2_563; \
53171 float32x4_t __ret_471; \54858 float32x4_t __ret_563; \
53172 __ret_471 = __s0_471 - __s1_471 * splatq_laneq_f32(__s2_471, __p3_471); \54859 __ret_563 = __s0_563 - __s1_563 * splatq_laneq_f32(__s2_563, __p3_563); \
53173 __ret_471; \54860 __ret_563; \
53174})54861})
53175#else54862#else
53176#define vmlsq_laneq_f32(__p0_472, __p1_472, __p2_472, __p3_472) __extension__ ({ \54863#define vmlsq_laneq_f32(__p0_564, __p1_564, __p2_564, __p3_564) __extension__ ({ \
53177 float32x4_t __s0_472 = __p0_472; \54864 float32x4_t __s0_564 = __p0_564; \
53178 float32x4_t __s1_472 = __p1_472; \54865 float32x4_t __s1_564 = __p1_564; \
53179 float32x4_t __s2_472 = __p2_472; \54866 float32x4_t __s2_564 = __p2_564; \
53180 float32x4_t __rev0_472; __rev0_472 = __builtin_shufflevector(__s0_472, __s0_472, 3, 2, 1, 0); \54867 float32x4_t __rev0_564; __rev0_564 = __builtin_shufflevector(__s0_564, __s0_564, 3, 2, 1, 0); \
53181 float32x4_t __rev1_472; __rev1_472 = __builtin_shufflevector(__s1_472, __s1_472, 3, 2, 1, 0); \54868 float32x4_t __rev1_564; __rev1_564 = __builtin_shufflevector(__s1_564, __s1_564, 3, 2, 1, 0); \
53182 float32x4_t __rev2_472; __rev2_472 = __builtin_shufflevector(__s2_472, __s2_472, 3, 2, 1, 0); \54869 float32x4_t __rev2_564; __rev2_564 = __builtin_shufflevector(__s2_564, __s2_564, 3, 2, 1, 0); \
53183 float32x4_t __ret_472; \54870 float32x4_t __ret_564; \
53184 __ret_472 = __rev0_472 - __rev1_472 * __noswap_splatq_laneq_f32(__rev2_472, __p3_472); \54871 __ret_564 = __rev0_564 - __rev1_564 * __noswap_splatq_laneq_f32(__rev2_564, __p3_564); \
53185 __ret_472 = __builtin_shufflevector(__ret_472, __ret_472, 3, 2, 1, 0); \54872 __ret_564 = __builtin_shufflevector(__ret_564, __ret_564, 3, 2, 1, 0); \
53186 __ret_472; \54873 __ret_564; \
53187})54874})
53188#endif54875#endif
5318954876
53190#ifdef __LITTLE_ENDIAN__54877#ifdef __LITTLE_ENDIAN__
53191#define vmlsq_laneq_s32(__p0_473, __p1_473, __p2_473, __p3_473) __extension__ ({ \54878#define vmlsq_laneq_s32(__p0_565, __p1_565, __p2_565, __p3_565) __extension__ ({ \
53192 int32x4_t __s0_473 = __p0_473; \54879 int32x4_t __s0_565 = __p0_565; \
53193 int32x4_t __s1_473 = __p1_473; \54880 int32x4_t __s1_565 = __p1_565; \
53194 int32x4_t __s2_473 = __p2_473; \54881 int32x4_t __s2_565 = __p2_565; \
53195 int32x4_t __ret_473; \54882 int32x4_t __ret_565; \
53196 __ret_473 = __s0_473 - __s1_473 * splatq_laneq_s32(__s2_473, __p3_473); \54883 __ret_565 = __s0_565 - __s1_565 * splatq_laneq_s32(__s2_565, __p3_565); \
53197 __ret_473; \54884 __ret_565; \
53198})54885})
53199#else54886#else
53200#define vmlsq_laneq_s32(__p0_474, __p1_474, __p2_474, __p3_474) __extension__ ({ \54887#define vmlsq_laneq_s32(__p0_566, __p1_566, __p2_566, __p3_566) __extension__ ({ \
53201 int32x4_t __s0_474 = __p0_474; \54888 int32x4_t __s0_566 = __p0_566; \
53202 int32x4_t __s1_474 = __p1_474; \54889 int32x4_t __s1_566 = __p1_566; \
53203 int32x4_t __s2_474 = __p2_474; \54890 int32x4_t __s2_566 = __p2_566; \
53204 int32x4_t __rev0_474; __rev0_474 = __builtin_shufflevector(__s0_474, __s0_474, 3, 2, 1, 0); \54891 int32x4_t __rev0_566; __rev0_566 = __builtin_shufflevector(__s0_566, __s0_566, 3, 2, 1, 0); \
53205 int32x4_t __rev1_474; __rev1_474 = __builtin_shufflevector(__s1_474, __s1_474, 3, 2, 1, 0); \54892 int32x4_t __rev1_566; __rev1_566 = __builtin_shufflevector(__s1_566, __s1_566, 3, 2, 1, 0); \
53206 int32x4_t __rev2_474; __rev2_474 = __builtin_shufflevector(__s2_474, __s2_474, 3, 2, 1, 0); \54893 int32x4_t __rev2_566; __rev2_566 = __builtin_shufflevector(__s2_566, __s2_566, 3, 2, 1, 0); \
53207 int32x4_t __ret_474; \54894 int32x4_t __ret_566; \
53208 __ret_474 = __rev0_474 - __rev1_474 * __noswap_splatq_laneq_s32(__rev2_474, __p3_474); \54895 __ret_566 = __rev0_566 - __rev1_566 * __noswap_splatq_laneq_s32(__rev2_566, __p3_566); \
53209 __ret_474 = __builtin_shufflevector(__ret_474, __ret_474, 3, 2, 1, 0); \54896 __ret_566 = __builtin_shufflevector(__ret_566, __ret_566, 3, 2, 1, 0); \
53210 __ret_474; \54897 __ret_566; \
53211})54898})
53212#endif54899#endif
5321354900
53214#ifdef __LITTLE_ENDIAN__54901#ifdef __LITTLE_ENDIAN__
53215#define vmlsq_laneq_s16(__p0_475, __p1_475, __p2_475, __p3_475) __extension__ ({ \54902#define vmlsq_laneq_s16(__p0_567, __p1_567, __p2_567, __p3_567) __extension__ ({ \
53216 int16x8_t __s0_475 = __p0_475; \54903 int16x8_t __s0_567 = __p0_567; \
53217 int16x8_t __s1_475 = __p1_475; \54904 int16x8_t __s1_567 = __p1_567; \
53218 int16x8_t __s2_475 = __p2_475; \54905 int16x8_t __s2_567 = __p2_567; \
53219 int16x8_t __ret_475; \54906 int16x8_t __ret_567; \
53220 __ret_475 = __s0_475 - __s1_475 * splatq_laneq_s16(__s2_475, __p3_475); \54907 __ret_567 = __s0_567 - __s1_567 * splatq_laneq_s16(__s2_567, __p3_567); \
53221 __ret_475; \54908 __ret_567; \
53222})54909})
53223#else54910#else
53224#define vmlsq_laneq_s16(__p0_476, __p1_476, __p2_476, __p3_476) __extension__ ({ \54911#define vmlsq_laneq_s16(__p0_568, __p1_568, __p2_568, __p3_568) __extension__ ({ \
53225 int16x8_t __s0_476 = __p0_476; \54912 int16x8_t __s0_568 = __p0_568; \
53226 int16x8_t __s1_476 = __p1_476; \54913 int16x8_t __s1_568 = __p1_568; \
53227 int16x8_t __s2_476 = __p2_476; \54914 int16x8_t __s2_568 = __p2_568; \
53228 int16x8_t __rev0_476; __rev0_476 = __builtin_shufflevector(__s0_476, __s0_476, 7, 6, 5, 4, 3, 2, 1, 0); \54915 int16x8_t __rev0_568; __rev0_568 = __builtin_shufflevector(__s0_568, __s0_568, 7, 6, 5, 4, 3, 2, 1, 0); \
53229 int16x8_t __rev1_476; __rev1_476 = __builtin_shufflevector(__s1_476, __s1_476, 7, 6, 5, 4, 3, 2, 1, 0); \54916 int16x8_t __rev1_568; __rev1_568 = __builtin_shufflevector(__s1_568, __s1_568, 7, 6, 5, 4, 3, 2, 1, 0); \
53230 int16x8_t __rev2_476; __rev2_476 = __builtin_shufflevector(__s2_476, __s2_476, 7, 6, 5, 4, 3, 2, 1, 0); \54917 int16x8_t __rev2_568; __rev2_568 = __builtin_shufflevector(__s2_568, __s2_568, 7, 6, 5, 4, 3, 2, 1, 0); \
53231 int16x8_t __ret_476; \54918 int16x8_t __ret_568; \
53232 __ret_476 = __rev0_476 - __rev1_476 * __noswap_splatq_laneq_s16(__rev2_476, __p3_476); \54919 __ret_568 = __rev0_568 - __rev1_568 * __noswap_splatq_laneq_s16(__rev2_568, __p3_568); \
53233 __ret_476 = __builtin_shufflevector(__ret_476, __ret_476, 7, 6, 5, 4, 3, 2, 1, 0); \54920 __ret_568 = __builtin_shufflevector(__ret_568, __ret_568, 7, 6, 5, 4, 3, 2, 1, 0); \
53234 __ret_476; \54921 __ret_568; \
53235})54922})
53236#endif54923#endif
5323754924
53238#ifdef __LITTLE_ENDIAN__54925#ifdef __LITTLE_ENDIAN__
53239#define vmls_laneq_u32(__p0_477, __p1_477, __p2_477, __p3_477) __extension__ ({ \54926#define vmls_laneq_u32(__p0_569, __p1_569, __p2_569, __p3_569) __extension__ ({ \
53240 uint32x2_t __s0_477 = __p0_477; \54927 uint32x2_t __s0_569 = __p0_569; \
53241 uint32x2_t __s1_477 = __p1_477; \54928 uint32x2_t __s1_569 = __p1_569; \
53242 uint32x4_t __s2_477 = __p2_477; \54929 uint32x4_t __s2_569 = __p2_569; \
53243 uint32x2_t __ret_477; \54930 uint32x2_t __ret_569; \
53244 __ret_477 = __s0_477 - __s1_477 * splat_laneq_u32(__s2_477, __p3_477); \54931 __ret_569 = __s0_569 - __s1_569 * splat_laneq_u32(__s2_569, __p3_569); \
53245 __ret_477; \54932 __ret_569; \
53246})54933})
53247#else54934#else
53248#define vmls_laneq_u32(__p0_478, __p1_478, __p2_478, __p3_478) __extension__ ({ \54935#define vmls_laneq_u32(__p0_570, __p1_570, __p2_570, __p3_570) __extension__ ({ \
53249 uint32x2_t __s0_478 = __p0_478; \54936 uint32x2_t __s0_570 = __p0_570; \
53250 uint32x2_t __s1_478 = __p1_478; \54937 uint32x2_t __s1_570 = __p1_570; \
53251 uint32x4_t __s2_478 = __p2_478; \54938 uint32x4_t __s2_570 = __p2_570; \
53252 uint32x2_t __rev0_478; __rev0_478 = __builtin_shufflevector(__s0_478, __s0_478, 1, 0); \54939 uint32x2_t __rev0_570; __rev0_570 = __builtin_shufflevector(__s0_570, __s0_570, 1, 0); \
53253 uint32x2_t __rev1_478; __rev1_478 = __builtin_shufflevector(__s1_478, __s1_478, 1, 0); \54940 uint32x2_t __rev1_570; __rev1_570 = __builtin_shufflevector(__s1_570, __s1_570, 1, 0); \
53254 uint32x4_t __rev2_478; __rev2_478 = __builtin_shufflevector(__s2_478, __s2_478, 3, 2, 1, 0); \54941 uint32x4_t __rev2_570; __rev2_570 = __builtin_shufflevector(__s2_570, __s2_570, 3, 2, 1, 0); \
53255 uint32x2_t __ret_478; \54942 uint32x2_t __ret_570; \
53256 __ret_478 = __rev0_478 - __rev1_478 * __noswap_splat_laneq_u32(__rev2_478, __p3_478); \54943 __ret_570 = __rev0_570 - __rev1_570 * __noswap_splat_laneq_u32(__rev2_570, __p3_570); \
53257 __ret_478 = __builtin_shufflevector(__ret_478, __ret_478, 1, 0); \54944 __ret_570 = __builtin_shufflevector(__ret_570, __ret_570, 1, 0); \
53258 __ret_478; \54945 __ret_570; \
53259})54946})
53260#endif54947#endif
5326154948
53262#ifdef __LITTLE_ENDIAN__54949#ifdef __LITTLE_ENDIAN__
53263#define vmls_laneq_u16(__p0_479, __p1_479, __p2_479, __p3_479) __extension__ ({ \54950#define vmls_laneq_u16(__p0_571, __p1_571, __p2_571, __p3_571) __extension__ ({ \
53264 uint16x4_t __s0_479 = __p0_479; \54951 uint16x4_t __s0_571 = __p0_571; \
53265 uint16x4_t __s1_479 = __p1_479; \54952 uint16x4_t __s1_571 = __p1_571; \
53266 uint16x8_t __s2_479 = __p2_479; \54953 uint16x8_t __s2_571 = __p2_571; \
53267 uint16x4_t __ret_479; \54954 uint16x4_t __ret_571; \
53268 __ret_479 = __s0_479 - __s1_479 * splat_laneq_u16(__s2_479, __p3_479); \54955 __ret_571 = __s0_571 - __s1_571 * splat_laneq_u16(__s2_571, __p3_571); \
53269 __ret_479; \54956 __ret_571; \
53270})54957})
53271#else54958#else
53272#define vmls_laneq_u16(__p0_480, __p1_480, __p2_480, __p3_480) __extension__ ({ \54959#define vmls_laneq_u16(__p0_572, __p1_572, __p2_572, __p3_572) __extension__ ({ \
53273 uint16x4_t __s0_480 = __p0_480; \54960 uint16x4_t __s0_572 = __p0_572; \
53274 uint16x4_t __s1_480 = __p1_480; \54961 uint16x4_t __s1_572 = __p1_572; \
53275 uint16x8_t __s2_480 = __p2_480; \54962 uint16x8_t __s2_572 = __p2_572; \
53276 uint16x4_t __rev0_480; __rev0_480 = __builtin_shufflevector(__s0_480, __s0_480, 3, 2, 1, 0); \54963 uint16x4_t __rev0_572; __rev0_572 = __builtin_shufflevector(__s0_572, __s0_572, 3, 2, 1, 0); \
53277 uint16x4_t __rev1_480; __rev1_480 = __builtin_shufflevector(__s1_480, __s1_480, 3, 2, 1, 0); \54964 uint16x4_t __rev1_572; __rev1_572 = __builtin_shufflevector(__s1_572, __s1_572, 3, 2, 1, 0); \
53278 uint16x8_t __rev2_480; __rev2_480 = __builtin_shufflevector(__s2_480, __s2_480, 7, 6, 5, 4, 3, 2, 1, 0); \54965 uint16x8_t __rev2_572; __rev2_572 = __builtin_shufflevector(__s2_572, __s2_572, 7, 6, 5, 4, 3, 2, 1, 0); \
53279 uint16x4_t __ret_480; \54966 uint16x4_t __ret_572; \
53280 __ret_480 = __rev0_480 - __rev1_480 * __noswap_splat_laneq_u16(__rev2_480, __p3_480); \54967 __ret_572 = __rev0_572 - __rev1_572 * __noswap_splat_laneq_u16(__rev2_572, __p3_572); \
53281 __ret_480 = __builtin_shufflevector(__ret_480, __ret_480, 3, 2, 1, 0); \54968 __ret_572 = __builtin_shufflevector(__ret_572, __ret_572, 3, 2, 1, 0); \
53282 __ret_480; \54969 __ret_572; \
53283})54970})
53284#endif54971#endif
5328554972
53286#ifdef __LITTLE_ENDIAN__54973#ifdef __LITTLE_ENDIAN__
53287#define vmls_laneq_f32(__p0_481, __p1_481, __p2_481, __p3_481) __extension__ ({ \54974#define vmls_laneq_f32(__p0_573, __p1_573, __p2_573, __p3_573) __extension__ ({ \
53288 float32x2_t __s0_481 = __p0_481; \54975 float32x2_t __s0_573 = __p0_573; \
53289 float32x2_t __s1_481 = __p1_481; \54976 float32x2_t __s1_573 = __p1_573; \
53290 float32x4_t __s2_481 = __p2_481; \54977 float32x4_t __s2_573 = __p2_573; \
53291 float32x2_t __ret_481; \54978 float32x2_t __ret_573; \
53292 __ret_481 = __s0_481 - __s1_481 * splat_laneq_f32(__s2_481, __p3_481); \54979 __ret_573 = __s0_573 - __s1_573 * splat_laneq_f32(__s2_573, __p3_573); \
53293 __ret_481; \54980 __ret_573; \
53294})54981})
53295#else54982#else
53296#define vmls_laneq_f32(__p0_482, __p1_482, __p2_482, __p3_482) __extension__ ({ \54983#define vmls_laneq_f32(__p0_574, __p1_574, __p2_574, __p3_574) __extension__ ({ \
53297 float32x2_t __s0_482 = __p0_482; \54984 float32x2_t __s0_574 = __p0_574; \
53298 float32x2_t __s1_482 = __p1_482; \54985 float32x2_t __s1_574 = __p1_574; \
53299 float32x4_t __s2_482 = __p2_482; \54986 float32x4_t __s2_574 = __p2_574; \
53300 float32x2_t __rev0_482; __rev0_482 = __builtin_shufflevector(__s0_482, __s0_482, 1, 0); \54987 float32x2_t __rev0_574; __rev0_574 = __builtin_shufflevector(__s0_574, __s0_574, 1, 0); \
53301 float32x2_t __rev1_482; __rev1_482 = __builtin_shufflevector(__s1_482, __s1_482, 1, 0); \54988 float32x2_t __rev1_574; __rev1_574 = __builtin_shufflevector(__s1_574, __s1_574, 1, 0); \
53302 float32x4_t __rev2_482; __rev2_482 = __builtin_shufflevector(__s2_482, __s2_482, 3, 2, 1, 0); \54989 float32x4_t __rev2_574; __rev2_574 = __builtin_shufflevector(__s2_574, __s2_574, 3, 2, 1, 0); \
53303 float32x2_t __ret_482; \54990 float32x2_t __ret_574; \
53304 __ret_482 = __rev0_482 - __rev1_482 * __noswap_splat_laneq_f32(__rev2_482, __p3_482); \54991 __ret_574 = __rev0_574 - __rev1_574 * __noswap_splat_laneq_f32(__rev2_574, __p3_574); \
53305 __ret_482 = __builtin_shufflevector(__ret_482, __ret_482, 1, 0); \54992 __ret_574 = __builtin_shufflevector(__ret_574, __ret_574, 1, 0); \
53306 __ret_482; \54993 __ret_574; \
53307})54994})
53308#endif54995#endif
5330954996
53310#ifdef __LITTLE_ENDIAN__54997#ifdef __LITTLE_ENDIAN__
53311#define vmls_laneq_s32(__p0_483, __p1_483, __p2_483, __p3_483) __extension__ ({ \54998#define vmls_laneq_s32(__p0_575, __p1_575, __p2_575, __p3_575) __extension__ ({ \
53312 int32x2_t __s0_483 = __p0_483; \54999 int32x2_t __s0_575 = __p0_575; \
53313 int32x2_t __s1_483 = __p1_483; \55000 int32x2_t __s1_575 = __p1_575; \
53314 int32x4_t __s2_483 = __p2_483; \55001 int32x4_t __s2_575 = __p2_575; \
53315 int32x2_t __ret_483; \55002 int32x2_t __ret_575; \
53316 __ret_483 = __s0_483 - __s1_483 * splat_laneq_s32(__s2_483, __p3_483); \55003 __ret_575 = __s0_575 - __s1_575 * splat_laneq_s32(__s2_575, __p3_575); \
53317 __ret_483; \55004 __ret_575; \
53318})55005})
53319#else55006#else
53320#define vmls_laneq_s32(__p0_484, __p1_484, __p2_484, __p3_484) __extension__ ({ \55007#define vmls_laneq_s32(__p0_576, __p1_576, __p2_576, __p3_576) __extension__ ({ \
53321 int32x2_t __s0_484 = __p0_484; \55008 int32x2_t __s0_576 = __p0_576; \
53322 int32x2_t __s1_484 = __p1_484; \55009 int32x2_t __s1_576 = __p1_576; \
53323 int32x4_t __s2_484 = __p2_484; \55010 int32x4_t __s2_576 = __p2_576; \
53324 int32x2_t __rev0_484; __rev0_484 = __builtin_shufflevector(__s0_484, __s0_484, 1, 0); \55011 int32x2_t __rev0_576; __rev0_576 = __builtin_shufflevector(__s0_576, __s0_576, 1, 0); \
53325 int32x2_t __rev1_484; __rev1_484 = __builtin_shufflevector(__s1_484, __s1_484, 1, 0); \55012 int32x2_t __rev1_576; __rev1_576 = __builtin_shufflevector(__s1_576, __s1_576, 1, 0); \
53326 int32x4_t __rev2_484; __rev2_484 = __builtin_shufflevector(__s2_484, __s2_484, 3, 2, 1, 0); \55013 int32x4_t __rev2_576; __rev2_576 = __builtin_shufflevector(__s2_576, __s2_576, 3, 2, 1, 0); \
53327 int32x2_t __ret_484; \55014 int32x2_t __ret_576; \
53328 __ret_484 = __rev0_484 - __rev1_484 * __noswap_splat_laneq_s32(__rev2_484, __p3_484); \55015 __ret_576 = __rev0_576 - __rev1_576 * __noswap_splat_laneq_s32(__rev2_576, __p3_576); \
53329 __ret_484 = __builtin_shufflevector(__ret_484, __ret_484, 1, 0); \55016 __ret_576 = __builtin_shufflevector(__ret_576, __ret_576, 1, 0); \
53330 __ret_484; \55017 __ret_576; \
53331})55018})
53332#endif55019#endif
5333355020
53334#ifdef __LITTLE_ENDIAN__55021#ifdef __LITTLE_ENDIAN__
53335#define vmls_laneq_s16(__p0_485, __p1_485, __p2_485, __p3_485) __extension__ ({ \55022#define vmls_laneq_s16(__p0_577, __p1_577, __p2_577, __p3_577) __extension__ ({ \
53336 int16x4_t __s0_485 = __p0_485; \55023 int16x4_t __s0_577 = __p0_577; \
53337 int16x4_t __s1_485 = __p1_485; \55024 int16x4_t __s1_577 = __p1_577; \
53338 int16x8_t __s2_485 = __p2_485; \55025 int16x8_t __s2_577 = __p2_577; \
53339 int16x4_t __ret_485; \55026 int16x4_t __ret_577; \
53340 __ret_485 = __s0_485 - __s1_485 * splat_laneq_s16(__s2_485, __p3_485); \55027 __ret_577 = __s0_577 - __s1_577 * splat_laneq_s16(__s2_577, __p3_577); \
53341 __ret_485; \55028 __ret_577; \
53342})55029})
53343#else55030#else
53344#define vmls_laneq_s16(__p0_486, __p1_486, __p2_486, __p3_486) __extension__ ({ \55031#define vmls_laneq_s16(__p0_578, __p1_578, __p2_578, __p3_578) __extension__ ({ \
53345 int16x4_t __s0_486 = __p0_486; \55032 int16x4_t __s0_578 = __p0_578; \
53346 int16x4_t __s1_486 = __p1_486; \55033 int16x4_t __s1_578 = __p1_578; \
53347 int16x8_t __s2_486 = __p2_486; \55034 int16x8_t __s2_578 = __p2_578; \
53348 int16x4_t __rev0_486; __rev0_486 = __builtin_shufflevector(__s0_486, __s0_486, 3, 2, 1, 0); \55035 int16x4_t __rev0_578; __rev0_578 = __builtin_shufflevector(__s0_578, __s0_578, 3, 2, 1, 0); \
53349 int16x4_t __rev1_486; __rev1_486 = __builtin_shufflevector(__s1_486, __s1_486, 3, 2, 1, 0); \55036 int16x4_t __rev1_578; __rev1_578 = __builtin_shufflevector(__s1_578, __s1_578, 3, 2, 1, 0); \
53350 int16x8_t __rev2_486; __rev2_486 = __builtin_shufflevector(__s2_486, __s2_486, 7, 6, 5, 4, 3, 2, 1, 0); \55037 int16x8_t __rev2_578; __rev2_578 = __builtin_shufflevector(__s2_578, __s2_578, 7, 6, 5, 4, 3, 2, 1, 0); \
53351 int16x4_t __ret_486; \55038 int16x4_t __ret_578; \
53352 __ret_486 = __rev0_486 - __rev1_486 * __noswap_splat_laneq_s16(__rev2_486, __p3_486); \55039 __ret_578 = __rev0_578 - __rev1_578 * __noswap_splat_laneq_s16(__rev2_578, __p3_578); \
53353 __ret_486 = __builtin_shufflevector(__ret_486, __ret_486, 3, 2, 1, 0); \55040 __ret_578 = __builtin_shufflevector(__ret_578, __ret_578, 3, 2, 1, 0); \
53354 __ret_486; \55041 __ret_578; \
53355})55042})
53356#endif55043#endif
5335755044
53358#ifdef __LITTLE_ENDIAN__55045#ifdef __LITTLE_ENDIAN__
53359__ai float64x2_t vmlsq_n_f64(float64x2_t __p0, float64x2_t __p1, float64_t __p2) {55046#define vmlsl_high_lane_u32(__p0_579, __p1_579, __p2_579, __p3_579) __extension__ ({ \
53360 float64x2_t __ret;55047 uint64x2_t __s0_579 = __p0_579; \
53361 __ret = __p0 - __p1 * (float64x2_t) {__p2, __p2};55048 uint32x4_t __s1_579 = __p1_579; \
53362 return __ret;55049 uint32x2_t __s2_579 = __p2_579; \
53363}55050 uint64x2_t __ret_579; \
53364#else55051 __ret_579 = __s0_579 - vmull_u32(vget_high_u32(__s1_579), splat_lane_u32(__s2_579, __p3_579)); \
53365__ai float64x2_t vmlsq_n_f64(float64x2_t __p0, float64x2_t __p1, float64_t __p2) {55052 __ret_579; \
53366 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
53367 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
53368 float64x2_t __ret;
53369 __ret = __rev0 - __rev1 * (float64x2_t) {__p2, __p2};
53370 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
53371 return __ret;
53372}
53373#endif
53374
53375#ifdef __LITTLE_ENDIAN__
53376#define vmlsl_high_lane_u32(__p0_487, __p1_487, __p2_487, __p3_487) __extension__ ({ \
53377 uint64x2_t __s0_487 = __p0_487; \
53378 uint32x4_t __s1_487 = __p1_487; \
53379 uint32x2_t __s2_487 = __p2_487; \
53380 uint64x2_t __ret_487; \
53381 __ret_487 = __s0_487 - vmull_u32(vget_high_u32(__s1_487), splat_lane_u32(__s2_487, __p3_487)); \
53382 __ret_487; \
53383})55053})
53384#else55054#else
53385#define vmlsl_high_lane_u32(__p0_488, __p1_488, __p2_488, __p3_488) __extension__ ({ \55055#define vmlsl_high_lane_u32(__p0_580, __p1_580, __p2_580, __p3_580) __extension__ ({ \
53386 uint64x2_t __s0_488 = __p0_488; \55056 uint64x2_t __s0_580 = __p0_580; \
53387 uint32x4_t __s1_488 = __p1_488; \55057 uint32x4_t __s1_580 = __p1_580; \
53388 uint32x2_t __s2_488 = __p2_488; \55058 uint32x2_t __s2_580 = __p2_580; \
53389 uint64x2_t __rev0_488; __rev0_488 = __builtin_shufflevector(__s0_488, __s0_488, 1, 0); \55059 uint64x2_t __rev0_580; __rev0_580 = __builtin_shufflevector(__s0_580, __s0_580, 1, 0); \
53390 uint32x4_t __rev1_488; __rev1_488 = __builtin_shufflevector(__s1_488, __s1_488, 3, 2, 1, 0); \55060 uint32x4_t __rev1_580; __rev1_580 = __builtin_shufflevector(__s1_580, __s1_580, 3, 2, 1, 0); \
53391 uint32x2_t __rev2_488; __rev2_488 = __builtin_shufflevector(__s2_488, __s2_488, 1, 0); \55061 uint32x2_t __rev2_580; __rev2_580 = __builtin_shufflevector(__s2_580, __s2_580, 1, 0); \
53392 uint64x2_t __ret_488; \55062 uint64x2_t __ret_580; \
53393 __ret_488 = __rev0_488 - __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_488), __noswap_splat_lane_u32(__rev2_488, __p3_488)); \55063 __ret_580 = __rev0_580 - __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_580), __noswap_splat_lane_u32(__rev2_580, __p3_580)); \
53394 __ret_488 = __builtin_shufflevector(__ret_488, __ret_488, 1, 0); \55064 __ret_580 = __builtin_shufflevector(__ret_580, __ret_580, 1, 0); \
53395 __ret_488; \55065 __ret_580; \
53396})55066})
53397#endif55067#endif
5339855068
53399#ifdef __LITTLE_ENDIAN__55069#ifdef __LITTLE_ENDIAN__
53400#define vmlsl_high_lane_u16(__p0_489, __p1_489, __p2_489, __p3_489) __extension__ ({ \55070#define vmlsl_high_lane_u16(__p0_581, __p1_581, __p2_581, __p3_581) __extension__ ({ \
53401 uint32x4_t __s0_489 = __p0_489; \55071 uint32x4_t __s0_581 = __p0_581; \
53402 uint16x8_t __s1_489 = __p1_489; \55072 uint16x8_t __s1_581 = __p1_581; \
53403 uint16x4_t __s2_489 = __p2_489; \55073 uint16x4_t __s2_581 = __p2_581; \
53404 uint32x4_t __ret_489; \55074 uint32x4_t __ret_581; \
53405 __ret_489 = __s0_489 - vmull_u16(vget_high_u16(__s1_489), splat_lane_u16(__s2_489, __p3_489)); \55075 __ret_581 = __s0_581 - vmull_u16(vget_high_u16(__s1_581), splat_lane_u16(__s2_581, __p3_581)); \
53406 __ret_489; \55076 __ret_581; \
53407})55077})
53408#else55078#else
53409#define vmlsl_high_lane_u16(__p0_490, __p1_490, __p2_490, __p3_490) __extension__ ({ \55079#define vmlsl_high_lane_u16(__p0_582, __p1_582, __p2_582, __p3_582) __extension__ ({ \
53410 uint32x4_t __s0_490 = __p0_490; \55080 uint32x4_t __s0_582 = __p0_582; \
53411 uint16x8_t __s1_490 = __p1_490; \55081 uint16x8_t __s1_582 = __p1_582; \
53412 uint16x4_t __s2_490 = __p2_490; \55082 uint16x4_t __s2_582 = __p2_582; \
53413 uint32x4_t __rev0_490; __rev0_490 = __builtin_shufflevector(__s0_490, __s0_490, 3, 2, 1, 0); \55083 uint32x4_t __rev0_582; __rev0_582 = __builtin_shufflevector(__s0_582, __s0_582, 3, 2, 1, 0); \
53414 uint16x8_t __rev1_490; __rev1_490 = __builtin_shufflevector(__s1_490, __s1_490, 7, 6, 5, 4, 3, 2, 1, 0); \55084 uint16x8_t __rev1_582; __rev1_582 = __builtin_shufflevector(__s1_582, __s1_582, 7, 6, 5, 4, 3, 2, 1, 0); \
53415 uint16x4_t __rev2_490; __rev2_490 = __builtin_shufflevector(__s2_490, __s2_490, 3, 2, 1, 0); \55085 uint16x4_t __rev2_582; __rev2_582 = __builtin_shufflevector(__s2_582, __s2_582, 3, 2, 1, 0); \
53416 uint32x4_t __ret_490; \55086 uint32x4_t __ret_582; \
53417 __ret_490 = __rev0_490 - __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_490), __noswap_splat_lane_u16(__rev2_490, __p3_490)); \55087 __ret_582 = __rev0_582 - __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_582), __noswap_splat_lane_u16(__rev2_582, __p3_582)); \
53418 __ret_490 = __builtin_shufflevector(__ret_490, __ret_490, 3, 2, 1, 0); \55088 __ret_582 = __builtin_shufflevector(__ret_582, __ret_582, 3, 2, 1, 0); \
53419 __ret_490; \55089 __ret_582; \
53420})55090})
53421#endif55091#endif
5342255092
53423#ifdef __LITTLE_ENDIAN__55093#ifdef __LITTLE_ENDIAN__
53424#define vmlsl_high_lane_s32(__p0_491, __p1_491, __p2_491, __p3_491) __extension__ ({ \55094#define vmlsl_high_lane_s32(__p0_583, __p1_583, __p2_583, __p3_583) __extension__ ({ \
53425 int64x2_t __s0_491 = __p0_491; \55095 int64x2_t __s0_583 = __p0_583; \
53426 int32x4_t __s1_491 = __p1_491; \55096 int32x4_t __s1_583 = __p1_583; \
53427 int32x2_t __s2_491 = __p2_491; \55097 int32x2_t __s2_583 = __p2_583; \
53428 int64x2_t __ret_491; \55098 int64x2_t __ret_583; \
53429 __ret_491 = __s0_491 - vmull_s32(vget_high_s32(__s1_491), splat_lane_s32(__s2_491, __p3_491)); \55099 __ret_583 = __s0_583 - vmull_s32(vget_high_s32(__s1_583), splat_lane_s32(__s2_583, __p3_583)); \
53430 __ret_491; \55100 __ret_583; \
53431})55101})
53432#else55102#else
53433#define vmlsl_high_lane_s32(__p0_492, __p1_492, __p2_492, __p3_492) __extension__ ({ \55103#define vmlsl_high_lane_s32(__p0_584, __p1_584, __p2_584, __p3_584) __extension__ ({ \
53434 int64x2_t __s0_492 = __p0_492; \55104 int64x2_t __s0_584 = __p0_584; \
53435 int32x4_t __s1_492 = __p1_492; \55105 int32x4_t __s1_584 = __p1_584; \
53436 int32x2_t __s2_492 = __p2_492; \55106 int32x2_t __s2_584 = __p2_584; \
53437 int64x2_t __rev0_492; __rev0_492 = __builtin_shufflevector(__s0_492, __s0_492, 1, 0); \55107 int64x2_t __rev0_584; __rev0_584 = __builtin_shufflevector(__s0_584, __s0_584, 1, 0); \
53438 int32x4_t __rev1_492; __rev1_492 = __builtin_shufflevector(__s1_492, __s1_492, 3, 2, 1, 0); \55108 int32x4_t __rev1_584; __rev1_584 = __builtin_shufflevector(__s1_584, __s1_584, 3, 2, 1, 0); \
53439 int32x2_t __rev2_492; __rev2_492 = __builtin_shufflevector(__s2_492, __s2_492, 1, 0); \55109 int32x2_t __rev2_584; __rev2_584 = __builtin_shufflevector(__s2_584, __s2_584, 1, 0); \
53440 int64x2_t __ret_492; \55110 int64x2_t __ret_584; \
53441 __ret_492 = __rev0_492 - __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_492), __noswap_splat_lane_s32(__rev2_492, __p3_492)); \55111 __ret_584 = __rev0_584 - __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_584), __noswap_splat_lane_s32(__rev2_584, __p3_584)); \
53442 __ret_492 = __builtin_shufflevector(__ret_492, __ret_492, 1, 0); \55112 __ret_584 = __builtin_shufflevector(__ret_584, __ret_584, 1, 0); \
53443 __ret_492; \55113 __ret_584; \
53444})55114})
53445#endif55115#endif
5344655116
53447#ifdef __LITTLE_ENDIAN__55117#ifdef __LITTLE_ENDIAN__
53448#define vmlsl_high_lane_s16(__p0_493, __p1_493, __p2_493, __p3_493) __extension__ ({ \55118#define vmlsl_high_lane_s16(__p0_585, __p1_585, __p2_585, __p3_585) __extension__ ({ \
53449 int32x4_t __s0_493 = __p0_493; \55119 int32x4_t __s0_585 = __p0_585; \
53450 int16x8_t __s1_493 = __p1_493; \55120 int16x8_t __s1_585 = __p1_585; \
53451 int16x4_t __s2_493 = __p2_493; \55121 int16x4_t __s2_585 = __p2_585; \
53452 int32x4_t __ret_493; \55122 int32x4_t __ret_585; \
53453 __ret_493 = __s0_493 - vmull_s16(vget_high_s16(__s1_493), splat_lane_s16(__s2_493, __p3_493)); \55123 __ret_585 = __s0_585 - vmull_s16(vget_high_s16(__s1_585), splat_lane_s16(__s2_585, __p3_585)); \
53454 __ret_493; \55124 __ret_585; \
53455})55125})
53456#else55126#else
53457#define vmlsl_high_lane_s16(__p0_494, __p1_494, __p2_494, __p3_494) __extension__ ({ \55127#define vmlsl_high_lane_s16(__p0_586, __p1_586, __p2_586, __p3_586) __extension__ ({ \
53458 int32x4_t __s0_494 = __p0_494; \55128 int32x4_t __s0_586 = __p0_586; \
53459 int16x8_t __s1_494 = __p1_494; \55129 int16x8_t __s1_586 = __p1_586; \
53460 int16x4_t __s2_494 = __p2_494; \55130 int16x4_t __s2_586 = __p2_586; \
53461 int32x4_t __rev0_494; __rev0_494 = __builtin_shufflevector(__s0_494, __s0_494, 3, 2, 1, 0); \55131 int32x4_t __rev0_586; __rev0_586 = __builtin_shufflevector(__s0_586, __s0_586, 3, 2, 1, 0); \
53462 int16x8_t __rev1_494; __rev1_494 = __builtin_shufflevector(__s1_494, __s1_494, 7, 6, 5, 4, 3, 2, 1, 0); \55132 int16x8_t __rev1_586; __rev1_586 = __builtin_shufflevector(__s1_586, __s1_586, 7, 6, 5, 4, 3, 2, 1, 0); \
53463 int16x4_t __rev2_494; __rev2_494 = __builtin_shufflevector(__s2_494, __s2_494, 3, 2, 1, 0); \55133 int16x4_t __rev2_586; __rev2_586 = __builtin_shufflevector(__s2_586, __s2_586, 3, 2, 1, 0); \
53464 int32x4_t __ret_494; \55134 int32x4_t __ret_586; \
53465 __ret_494 = __rev0_494 - __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_494), __noswap_splat_lane_s16(__rev2_494, __p3_494)); \55135 __ret_586 = __rev0_586 - __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_586), __noswap_splat_lane_s16(__rev2_586, __p3_586)); \
53466 __ret_494 = __builtin_shufflevector(__ret_494, __ret_494, 3, 2, 1, 0); \55136 __ret_586 = __builtin_shufflevector(__ret_586, __ret_586, 3, 2, 1, 0); \
53467 __ret_494; \55137 __ret_586; \
53468})55138})
53469#endif55139#endif
5347055140
53471#ifdef __LITTLE_ENDIAN__55141#ifdef __LITTLE_ENDIAN__
53472#define vmlsl_high_laneq_u32(__p0_495, __p1_495, __p2_495, __p3_495) __extension__ ({ \55142#define vmlsl_high_laneq_u32(__p0_587, __p1_587, __p2_587, __p3_587) __extension__ ({ \
53473 uint64x2_t __s0_495 = __p0_495; \55143 uint64x2_t __s0_587 = __p0_587; \
53474 uint32x4_t __s1_495 = __p1_495; \55144 uint32x4_t __s1_587 = __p1_587; \
53475 uint32x4_t __s2_495 = __p2_495; \55145 uint32x4_t __s2_587 = __p2_587; \
53476 uint64x2_t __ret_495; \55146 uint64x2_t __ret_587; \
53477 __ret_495 = __s0_495 - vmull_u32(vget_high_u32(__s1_495), splat_laneq_u32(__s2_495, __p3_495)); \55147 __ret_587 = __s0_587 - vmull_u32(vget_high_u32(__s1_587), splat_laneq_u32(__s2_587, __p3_587)); \
53478 __ret_495; \55148 __ret_587; \
53479})55149})
53480#else55150#else
53481#define vmlsl_high_laneq_u32(__p0_496, __p1_496, __p2_496, __p3_496) __extension__ ({ \55151#define vmlsl_high_laneq_u32(__p0_588, __p1_588, __p2_588, __p3_588) __extension__ ({ \
53482 uint64x2_t __s0_496 = __p0_496; \55152 uint64x2_t __s0_588 = __p0_588; \
53483 uint32x4_t __s1_496 = __p1_496; \55153 uint32x4_t __s1_588 = __p1_588; \
53484 uint32x4_t __s2_496 = __p2_496; \55154 uint32x4_t __s2_588 = __p2_588; \
53485 uint64x2_t __rev0_496; __rev0_496 = __builtin_shufflevector(__s0_496, __s0_496, 1, 0); \55155 uint64x2_t __rev0_588; __rev0_588 = __builtin_shufflevector(__s0_588, __s0_588, 1, 0); \
53486 uint32x4_t __rev1_496; __rev1_496 = __builtin_shufflevector(__s1_496, __s1_496, 3, 2, 1, 0); \55156 uint32x4_t __rev1_588; __rev1_588 = __builtin_shufflevector(__s1_588, __s1_588, 3, 2, 1, 0); \
53487 uint32x4_t __rev2_496; __rev2_496 = __builtin_shufflevector(__s2_496, __s2_496, 3, 2, 1, 0); \55157 uint32x4_t __rev2_588; __rev2_588 = __builtin_shufflevector(__s2_588, __s2_588, 3, 2, 1, 0); \
53488 uint64x2_t __ret_496; \55158 uint64x2_t __ret_588; \
53489 __ret_496 = __rev0_496 - __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_496), __noswap_splat_laneq_u32(__rev2_496, __p3_496)); \55159 __ret_588 = __rev0_588 - __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_588), __noswap_splat_laneq_u32(__rev2_588, __p3_588)); \
53490 __ret_496 = __builtin_shufflevector(__ret_496, __ret_496, 1, 0); \55160 __ret_588 = __builtin_shufflevector(__ret_588, __ret_588, 1, 0); \
53491 __ret_496; \55161 __ret_588; \
53492})55162})
53493#endif55163#endif
5349455164
53495#ifdef __LITTLE_ENDIAN__55165#ifdef __LITTLE_ENDIAN__
53496#define vmlsl_high_laneq_u16(__p0_497, __p1_497, __p2_497, __p3_497) __extension__ ({ \55166#define vmlsl_high_laneq_u16(__p0_589, __p1_589, __p2_589, __p3_589) __extension__ ({ \
53497 uint32x4_t __s0_497 = __p0_497; \55167 uint32x4_t __s0_589 = __p0_589; \
53498 uint16x8_t __s1_497 = __p1_497; \55168 uint16x8_t __s1_589 = __p1_589; \
53499 uint16x8_t __s2_497 = __p2_497; \55169 uint16x8_t __s2_589 = __p2_589; \
53500 uint32x4_t __ret_497; \55170 uint32x4_t __ret_589; \
53501 __ret_497 = __s0_497 - vmull_u16(vget_high_u16(__s1_497), splat_laneq_u16(__s2_497, __p3_497)); \55171 __ret_589 = __s0_589 - vmull_u16(vget_high_u16(__s1_589), splat_laneq_u16(__s2_589, __p3_589)); \
53502 __ret_497; \55172 __ret_589; \
53503})55173})
53504#else55174#else
53505#define vmlsl_high_laneq_u16(__p0_498, __p1_498, __p2_498, __p3_498) __extension__ ({ \55175#define vmlsl_high_laneq_u16(__p0_590, __p1_590, __p2_590, __p3_590) __extension__ ({ \
53506 uint32x4_t __s0_498 = __p0_498; \55176 uint32x4_t __s0_590 = __p0_590; \
53507 uint16x8_t __s1_498 = __p1_498; \55177 uint16x8_t __s1_590 = __p1_590; \
53508 uint16x8_t __s2_498 = __p2_498; \55178 uint16x8_t __s2_590 = __p2_590; \
53509 uint32x4_t __rev0_498; __rev0_498 = __builtin_shufflevector(__s0_498, __s0_498, 3, 2, 1, 0); \55179 uint32x4_t __rev0_590; __rev0_590 = __builtin_shufflevector(__s0_590, __s0_590, 3, 2, 1, 0); \
53510 uint16x8_t __rev1_498; __rev1_498 = __builtin_shufflevector(__s1_498, __s1_498, 7, 6, 5, 4, 3, 2, 1, 0); \55180 uint16x8_t __rev1_590; __rev1_590 = __builtin_shufflevector(__s1_590, __s1_590, 7, 6, 5, 4, 3, 2, 1, 0); \
53511 uint16x8_t __rev2_498; __rev2_498 = __builtin_shufflevector(__s2_498, __s2_498, 7, 6, 5, 4, 3, 2, 1, 0); \55181 uint16x8_t __rev2_590; __rev2_590 = __builtin_shufflevector(__s2_590, __s2_590, 7, 6, 5, 4, 3, 2, 1, 0); \
53512 uint32x4_t __ret_498; \55182 uint32x4_t __ret_590; \
53513 __ret_498 = __rev0_498 - __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_498), __noswap_splat_laneq_u16(__rev2_498, __p3_498)); \55183 __ret_590 = __rev0_590 - __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_590), __noswap_splat_laneq_u16(__rev2_590, __p3_590)); \
53514 __ret_498 = __builtin_shufflevector(__ret_498, __ret_498, 3, 2, 1, 0); \55184 __ret_590 = __builtin_shufflevector(__ret_590, __ret_590, 3, 2, 1, 0); \
53515 __ret_498; \55185 __ret_590; \
53516})55186})
53517#endif55187#endif
5351855188
53519#ifdef __LITTLE_ENDIAN__55189#ifdef __LITTLE_ENDIAN__
53520#define vmlsl_high_laneq_s32(__p0_499, __p1_499, __p2_499, __p3_499) __extension__ ({ \55190#define vmlsl_high_laneq_s32(__p0_591, __p1_591, __p2_591, __p3_591) __extension__ ({ \
53521 int64x2_t __s0_499 = __p0_499; \55191 int64x2_t __s0_591 = __p0_591; \
53522 int32x4_t __s1_499 = __p1_499; \55192 int32x4_t __s1_591 = __p1_591; \
53523 int32x4_t __s2_499 = __p2_499; \55193 int32x4_t __s2_591 = __p2_591; \
53524 int64x2_t __ret_499; \55194 int64x2_t __ret_591; \
53525 __ret_499 = __s0_499 - vmull_s32(vget_high_s32(__s1_499), splat_laneq_s32(__s2_499, __p3_499)); \55195 __ret_591 = __s0_591 - vmull_s32(vget_high_s32(__s1_591), splat_laneq_s32(__s2_591, __p3_591)); \
53526 __ret_499; \55196 __ret_591; \
53527})55197})
53528#else55198#else
53529#define vmlsl_high_laneq_s32(__p0_500, __p1_500, __p2_500, __p3_500) __extension__ ({ \55199#define vmlsl_high_laneq_s32(__p0_592, __p1_592, __p2_592, __p3_592) __extension__ ({ \
53530 int64x2_t __s0_500 = __p0_500; \55200 int64x2_t __s0_592 = __p0_592; \
53531 int32x4_t __s1_500 = __p1_500; \55201 int32x4_t __s1_592 = __p1_592; \
53532 int32x4_t __s2_500 = __p2_500; \55202 int32x4_t __s2_592 = __p2_592; \
53533 int64x2_t __rev0_500; __rev0_500 = __builtin_shufflevector(__s0_500, __s0_500, 1, 0); \55203 int64x2_t __rev0_592; __rev0_592 = __builtin_shufflevector(__s0_592, __s0_592, 1, 0); \
53534 int32x4_t __rev1_500; __rev1_500 = __builtin_shufflevector(__s1_500, __s1_500, 3, 2, 1, 0); \55204 int32x4_t __rev1_592; __rev1_592 = __builtin_shufflevector(__s1_592, __s1_592, 3, 2, 1, 0); \
53535 int32x4_t __rev2_500; __rev2_500 = __builtin_shufflevector(__s2_500, __s2_500, 3, 2, 1, 0); \55205 int32x4_t __rev2_592; __rev2_592 = __builtin_shufflevector(__s2_592, __s2_592, 3, 2, 1, 0); \
53536 int64x2_t __ret_500; \55206 int64x2_t __ret_592; \
53537 __ret_500 = __rev0_500 - __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_500), __noswap_splat_laneq_s32(__rev2_500, __p3_500)); \55207 __ret_592 = __rev0_592 - __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_592), __noswap_splat_laneq_s32(__rev2_592, __p3_592)); \
53538 __ret_500 = __builtin_shufflevector(__ret_500, __ret_500, 1, 0); \55208 __ret_592 = __builtin_shufflevector(__ret_592, __ret_592, 1, 0); \
53539 __ret_500; \55209 __ret_592; \
53540})55210})
53541#endif55211#endif
5354255212
53543#ifdef __LITTLE_ENDIAN__55213#ifdef __LITTLE_ENDIAN__
53544#define vmlsl_high_laneq_s16(__p0_501, __p1_501, __p2_501, __p3_501) __extension__ ({ \55214#define vmlsl_high_laneq_s16(__p0_593, __p1_593, __p2_593, __p3_593) __extension__ ({ \
53545 int32x4_t __s0_501 = __p0_501; \55215 int32x4_t __s0_593 = __p0_593; \
53546 int16x8_t __s1_501 = __p1_501; \55216 int16x8_t __s1_593 = __p1_593; \
53547 int16x8_t __s2_501 = __p2_501; \55217 int16x8_t __s2_593 = __p2_593; \
53548 int32x4_t __ret_501; \55218 int32x4_t __ret_593; \
53549 __ret_501 = __s0_501 - vmull_s16(vget_high_s16(__s1_501), splat_laneq_s16(__s2_501, __p3_501)); \55219 __ret_593 = __s0_593 - vmull_s16(vget_high_s16(__s1_593), splat_laneq_s16(__s2_593, __p3_593)); \
53550 __ret_501; \55220 __ret_593; \
53551})55221})
53552#else55222#else
53553#define vmlsl_high_laneq_s16(__p0_502, __p1_502, __p2_502, __p3_502) __extension__ ({ \55223#define vmlsl_high_laneq_s16(__p0_594, __p1_594, __p2_594, __p3_594) __extension__ ({ \
53554 int32x4_t __s0_502 = __p0_502; \55224 int32x4_t __s0_594 = __p0_594; \
53555 int16x8_t __s1_502 = __p1_502; \55225 int16x8_t __s1_594 = __p1_594; \
53556 int16x8_t __s2_502 = __p2_502; \55226 int16x8_t __s2_594 = __p2_594; \
53557 int32x4_t __rev0_502; __rev0_502 = __builtin_shufflevector(__s0_502, __s0_502, 3, 2, 1, 0); \55227 int32x4_t __rev0_594; __rev0_594 = __builtin_shufflevector(__s0_594, __s0_594, 3, 2, 1, 0); \
53558 int16x8_t __rev1_502; __rev1_502 = __builtin_shufflevector(__s1_502, __s1_502, 7, 6, 5, 4, 3, 2, 1, 0); \55228 int16x8_t __rev1_594; __rev1_594 = __builtin_shufflevector(__s1_594, __s1_594, 7, 6, 5, 4, 3, 2, 1, 0); \
53559 int16x8_t __rev2_502; __rev2_502 = __builtin_shufflevector(__s2_502, __s2_502, 7, 6, 5, 4, 3, 2, 1, 0); \55229 int16x8_t __rev2_594; __rev2_594 = __builtin_shufflevector(__s2_594, __s2_594, 7, 6, 5, 4, 3, 2, 1, 0); \
53560 int32x4_t __ret_502; \55230 int32x4_t __ret_594; \
53561 __ret_502 = __rev0_502 - __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_502), __noswap_splat_laneq_s16(__rev2_502, __p3_502)); \55231 __ret_594 = __rev0_594 - __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_594), __noswap_splat_laneq_s16(__rev2_594, __p3_594)); \
53562 __ret_502 = __builtin_shufflevector(__ret_502, __ret_502, 3, 2, 1, 0); \55232 __ret_594 = __builtin_shufflevector(__ret_594, __ret_594, 3, 2, 1, 0); \
53563 __ret_502; \55233 __ret_594; \
53564})55234})
53565#endif55235#endif
5356655236
53567#ifdef __LITTLE_ENDIAN__55237#ifdef __LITTLE_ENDIAN__
53568#define vmlsl_laneq_u32(__p0_503, __p1_503, __p2_503, __p3_503) __extension__ ({ \55238#define vmlsl_laneq_u32(__p0_595, __p1_595, __p2_595, __p3_595) __extension__ ({ \
53569 uint64x2_t __s0_503 = __p0_503; \55239 uint64x2_t __s0_595 = __p0_595; \
53570 uint32x2_t __s1_503 = __p1_503; \55240 uint32x2_t __s1_595 = __p1_595; \
53571 uint32x4_t __s2_503 = __p2_503; \55241 uint32x4_t __s2_595 = __p2_595; \
53572 uint64x2_t __ret_503; \55242 uint64x2_t __ret_595; \
53573 __ret_503 = __s0_503 - vmull_u32(__s1_503, splat_laneq_u32(__s2_503, __p3_503)); \55243 __ret_595 = __s0_595 - vmull_u32(__s1_595, splat_laneq_u32(__s2_595, __p3_595)); \
53574 __ret_503; \55244 __ret_595; \
53575})55245})
53576#else55246#else
53577#define vmlsl_laneq_u32(__p0_504, __p1_504, __p2_504, __p3_504) __extension__ ({ \55247#define vmlsl_laneq_u32(__p0_596, __p1_596, __p2_596, __p3_596) __extension__ ({ \
53578 uint64x2_t __s0_504 = __p0_504; \55248 uint64x2_t __s0_596 = __p0_596; \
53579 uint32x2_t __s1_504 = __p1_504; \55249 uint32x2_t __s1_596 = __p1_596; \
53580 uint32x4_t __s2_504 = __p2_504; \55250 uint32x4_t __s2_596 = __p2_596; \
53581 uint64x2_t __rev0_504; __rev0_504 = __builtin_shufflevector(__s0_504, __s0_504, 1, 0); \55251 uint64x2_t __rev0_596; __rev0_596 = __builtin_shufflevector(__s0_596, __s0_596, 1, 0); \
53582 uint32x2_t __rev1_504; __rev1_504 = __builtin_shufflevector(__s1_504, __s1_504, 1, 0); \55252 uint32x2_t __rev1_596; __rev1_596 = __builtin_shufflevector(__s1_596, __s1_596, 1, 0); \
53583 uint32x4_t __rev2_504; __rev2_504 = __builtin_shufflevector(__s2_504, __s2_504, 3, 2, 1, 0); \55253 uint32x4_t __rev2_596; __rev2_596 = __builtin_shufflevector(__s2_596, __s2_596, 3, 2, 1, 0); \
53584 uint64x2_t __ret_504; \55254 uint64x2_t __ret_596; \
53585 __ret_504 = __rev0_504 - __noswap_vmull_u32(__rev1_504, __noswap_splat_laneq_u32(__rev2_504, __p3_504)); \55255 __ret_596 = __rev0_596 - __noswap_vmull_u32(__rev1_596, __noswap_splat_laneq_u32(__rev2_596, __p3_596)); \
53586 __ret_504 = __builtin_shufflevector(__ret_504, __ret_504, 1, 0); \55256 __ret_596 = __builtin_shufflevector(__ret_596, __ret_596, 1, 0); \
53587 __ret_504; \55257 __ret_596; \
53588})55258})
53589#endif55259#endif
5359055260
53591#ifdef __LITTLE_ENDIAN__55261#ifdef __LITTLE_ENDIAN__
53592#define vmlsl_laneq_u16(__p0_505, __p1_505, __p2_505, __p3_505) __extension__ ({ \55262#define vmlsl_laneq_u16(__p0_597, __p1_597, __p2_597, __p3_597) __extension__ ({ \
53593 uint32x4_t __s0_505 = __p0_505; \55263 uint32x4_t __s0_597 = __p0_597; \
53594 uint16x4_t __s1_505 = __p1_505; \55264 uint16x4_t __s1_597 = __p1_597; \
53595 uint16x8_t __s2_505 = __p2_505; \55265 uint16x8_t __s2_597 = __p2_597; \
53596 uint32x4_t __ret_505; \55266 uint32x4_t __ret_597; \
53597 __ret_505 = __s0_505 - vmull_u16(__s1_505, splat_laneq_u16(__s2_505, __p3_505)); \55267 __ret_597 = __s0_597 - vmull_u16(__s1_597, splat_laneq_u16(__s2_597, __p3_597)); \
53598 __ret_505; \55268 __ret_597; \
53599})55269})
53600#else55270#else
53601#define vmlsl_laneq_u16(__p0_506, __p1_506, __p2_506, __p3_506) __extension__ ({ \55271#define vmlsl_laneq_u16(__p0_598, __p1_598, __p2_598, __p3_598) __extension__ ({ \
53602 uint32x4_t __s0_506 = __p0_506; \55272 uint32x4_t __s0_598 = __p0_598; \
53603 uint16x4_t __s1_506 = __p1_506; \55273 uint16x4_t __s1_598 = __p1_598; \
53604 uint16x8_t __s2_506 = __p2_506; \55274 uint16x8_t __s2_598 = __p2_598; \
53605 uint32x4_t __rev0_506; __rev0_506 = __builtin_shufflevector(__s0_506, __s0_506, 3, 2, 1, 0); \55275 uint32x4_t __rev0_598; __rev0_598 = __builtin_shufflevector(__s0_598, __s0_598, 3, 2, 1, 0); \
53606 uint16x4_t __rev1_506; __rev1_506 = __builtin_shufflevector(__s1_506, __s1_506, 3, 2, 1, 0); \55276 uint16x4_t __rev1_598; __rev1_598 = __builtin_shufflevector(__s1_598, __s1_598, 3, 2, 1, 0); \
53607 uint16x8_t __rev2_506; __rev2_506 = __builtin_shufflevector(__s2_506, __s2_506, 7, 6, 5, 4, 3, 2, 1, 0); \55277 uint16x8_t __rev2_598; __rev2_598 = __builtin_shufflevector(__s2_598, __s2_598, 7, 6, 5, 4, 3, 2, 1, 0); \
53608 uint32x4_t __ret_506; \55278 uint32x4_t __ret_598; \
53609 __ret_506 = __rev0_506 - __noswap_vmull_u16(__rev1_506, __noswap_splat_laneq_u16(__rev2_506, __p3_506)); \55279 __ret_598 = __rev0_598 - __noswap_vmull_u16(__rev1_598, __noswap_splat_laneq_u16(__rev2_598, __p3_598)); \
53610 __ret_506 = __builtin_shufflevector(__ret_506, __ret_506, 3, 2, 1, 0); \55280 __ret_598 = __builtin_shufflevector(__ret_598, __ret_598, 3, 2, 1, 0); \
53611 __ret_506; \55281 __ret_598; \
53612})55282})
53613#endif55283#endif
5361455284
53615#ifdef __LITTLE_ENDIAN__55285#ifdef __LITTLE_ENDIAN__
53616#define vmlsl_laneq_s32(__p0_507, __p1_507, __p2_507, __p3_507) __extension__ ({ \55286#define vmlsl_laneq_s32(__p0_599, __p1_599, __p2_599, __p3_599) __extension__ ({ \
53617 int64x2_t __s0_507 = __p0_507; \55287 int64x2_t __s0_599 = __p0_599; \
53618 int32x2_t __s1_507 = __p1_507; \55288 int32x2_t __s1_599 = __p1_599; \
53619 int32x4_t __s2_507 = __p2_507; \55289 int32x4_t __s2_599 = __p2_599; \
53620 int64x2_t __ret_507; \55290 int64x2_t __ret_599; \
53621 __ret_507 = __s0_507 - vmull_s32(__s1_507, splat_laneq_s32(__s2_507, __p3_507)); \55291 __ret_599 = __s0_599 - vmull_s32(__s1_599, splat_laneq_s32(__s2_599, __p3_599)); \
53622 __ret_507; \55292 __ret_599; \
53623})55293})
53624#else55294#else
53625#define vmlsl_laneq_s32(__p0_508, __p1_508, __p2_508, __p3_508) __extension__ ({ \55295#define vmlsl_laneq_s32(__p0_600, __p1_600, __p2_600, __p3_600) __extension__ ({ \
53626 int64x2_t __s0_508 = __p0_508; \55296 int64x2_t __s0_600 = __p0_600; \
53627 int32x2_t __s1_508 = __p1_508; \55297 int32x2_t __s1_600 = __p1_600; \
53628 int32x4_t __s2_508 = __p2_508; \55298 int32x4_t __s2_600 = __p2_600; \
53629 int64x2_t __rev0_508; __rev0_508 = __builtin_shufflevector(__s0_508, __s0_508, 1, 0); \55299 int64x2_t __rev0_600; __rev0_600 = __builtin_shufflevector(__s0_600, __s0_600, 1, 0); \
53630 int32x2_t __rev1_508; __rev1_508 = __builtin_shufflevector(__s1_508, __s1_508, 1, 0); \55300 int32x2_t __rev1_600; __rev1_600 = __builtin_shufflevector(__s1_600, __s1_600, 1, 0); \
53631 int32x4_t __rev2_508; __rev2_508 = __builtin_shufflevector(__s2_508, __s2_508, 3, 2, 1, 0); \55301 int32x4_t __rev2_600; __rev2_600 = __builtin_shufflevector(__s2_600, __s2_600, 3, 2, 1, 0); \
53632 int64x2_t __ret_508; \55302 int64x2_t __ret_600; \
53633 __ret_508 = __rev0_508 - __noswap_vmull_s32(__rev1_508, __noswap_splat_laneq_s32(__rev2_508, __p3_508)); \55303 __ret_600 = __rev0_600 - __noswap_vmull_s32(__rev1_600, __noswap_splat_laneq_s32(__rev2_600, __p3_600)); \
53634 __ret_508 = __builtin_shufflevector(__ret_508, __ret_508, 1, 0); \55304 __ret_600 = __builtin_shufflevector(__ret_600, __ret_600, 1, 0); \
53635 __ret_508; \55305 __ret_600; \
53636})55306})
53637#endif55307#endif
5363855308
53639#ifdef __LITTLE_ENDIAN__55309#ifdef __LITTLE_ENDIAN__
53640#define vmlsl_laneq_s16(__p0_509, __p1_509, __p2_509, __p3_509) __extension__ ({ \55310#define vmlsl_laneq_s16(__p0_601, __p1_601, __p2_601, __p3_601) __extension__ ({ \
53641 int32x4_t __s0_509 = __p0_509; \55311 int32x4_t __s0_601 = __p0_601; \
53642 int16x4_t __s1_509 = __p1_509; \55312 int16x4_t __s1_601 = __p1_601; \
53643 int16x8_t __s2_509 = __p2_509; \55313 int16x8_t __s2_601 = __p2_601; \
53644 int32x4_t __ret_509; \55314 int32x4_t __ret_601; \
53645 __ret_509 = __s0_509 - vmull_s16(__s1_509, splat_laneq_s16(__s2_509, __p3_509)); \55315 __ret_601 = __s0_601 - vmull_s16(__s1_601, splat_laneq_s16(__s2_601, __p3_601)); \
53646 __ret_509; \55316 __ret_601; \
53647})55317})
53648#else55318#else
53649#define vmlsl_laneq_s16(__p0_510, __p1_510, __p2_510, __p3_510) __extension__ ({ \55319#define vmlsl_laneq_s16(__p0_602, __p1_602, __p2_602, __p3_602) __extension__ ({ \
53650 int32x4_t __s0_510 = __p0_510; \55320 int32x4_t __s0_602 = __p0_602; \
53651 int16x4_t __s1_510 = __p1_510; \55321 int16x4_t __s1_602 = __p1_602; \
53652 int16x8_t __s2_510 = __p2_510; \55322 int16x8_t __s2_602 = __p2_602; \
53653 int32x4_t __rev0_510; __rev0_510 = __builtin_shufflevector(__s0_510, __s0_510, 3, 2, 1, 0); \55323 int32x4_t __rev0_602; __rev0_602 = __builtin_shufflevector(__s0_602, __s0_602, 3, 2, 1, 0); \
53654 int16x4_t __rev1_510; __rev1_510 = __builtin_shufflevector(__s1_510, __s1_510, 3, 2, 1, 0); \55324 int16x4_t __rev1_602; __rev1_602 = __builtin_shufflevector(__s1_602, __s1_602, 3, 2, 1, 0); \
53655 int16x8_t __rev2_510; __rev2_510 = __builtin_shufflevector(__s2_510, __s2_510, 7, 6, 5, 4, 3, 2, 1, 0); \55325 int16x8_t __rev2_602; __rev2_602 = __builtin_shufflevector(__s2_602, __s2_602, 7, 6, 5, 4, 3, 2, 1, 0); \
53656 int32x4_t __ret_510; \55326 int32x4_t __ret_602; \
53657 __ret_510 = __rev0_510 - __noswap_vmull_s16(__rev1_510, __noswap_splat_laneq_s16(__rev2_510, __p3_510)); \55327 __ret_602 = __rev0_602 - __noswap_vmull_s16(__rev1_602, __noswap_splat_laneq_s16(__rev2_602, __p3_602)); \
53658 __ret_510 = __builtin_shufflevector(__ret_510, __ret_510, 3, 2, 1, 0); \55328 __ret_602 = __builtin_shufflevector(__ret_602, __ret_602, 3, 2, 1, 0); \
53659 __ret_510; \55329 __ret_602; \
53660})55330})
53661#endif55331#endif
5366255332
...@@ -53701,146 +55371,146 @@ __ai float64x1_t vmov_n_f64(float64_t __p0) {...@@ -53701,146 +55371,146 @@ __ai float64x1_t vmov_n_f64(float64_t __p0) {
53701 return __ret;55371 return __ret;
53702}55372}
53703#ifdef __LITTLE_ENDIAN__55373#ifdef __LITTLE_ENDIAN__
53704__ai uint16x8_t vmovl_high_u8(uint8x16_t __p0_511) {55374__ai uint16x8_t vmovl_high_u8(uint8x16_t __p0_603) {
53705 uint16x8_t __ret_511;55375 uint16x8_t __ret_603;
53706 uint8x8_t __a1_511 = vget_high_u8(__p0_511);55376 uint8x8_t __a1_603 = vget_high_u8(__p0_603);
53707 __ret_511 = (uint16x8_t)(vshll_n_u8(__a1_511, 0));55377 __ret_603 = (uint16x8_t)(vshll_n_u8(__a1_603, 0));
53708 return __ret_511;55378 return __ret_603;
53709}55379}
53710#else55380#else
53711__ai uint16x8_t vmovl_high_u8(uint8x16_t __p0_512) {55381__ai uint16x8_t vmovl_high_u8(uint8x16_t __p0_604) {
53712 uint8x16_t __rev0_512; __rev0_512 = __builtin_shufflevector(__p0_512, __p0_512, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);55382 uint8x16_t __rev0_604; __rev0_604 = __builtin_shufflevector(__p0_604, __p0_604, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
53713 uint16x8_t __ret_512;55383 uint16x8_t __ret_604;
53714 uint8x8_t __a1_512 = __noswap_vget_high_u8(__rev0_512);55384 uint8x8_t __a1_604 = __noswap_vget_high_u8(__rev0_604);
53715 __ret_512 = (uint16x8_t)(__noswap_vshll_n_u8(__a1_512, 0));55385 __ret_604 = (uint16x8_t)(__noswap_vshll_n_u8(__a1_604, 0));
53716 __ret_512 = __builtin_shufflevector(__ret_512, __ret_512, 7, 6, 5, 4, 3, 2, 1, 0);55386 __ret_604 = __builtin_shufflevector(__ret_604, __ret_604, 7, 6, 5, 4, 3, 2, 1, 0);
53717 return __ret_512;55387 return __ret_604;
53718}55388}
53719__ai uint16x8_t __noswap_vmovl_high_u8(uint8x16_t __p0_513) {55389__ai uint16x8_t __noswap_vmovl_high_u8(uint8x16_t __p0_605) {
53720 uint16x8_t __ret_513;55390 uint16x8_t __ret_605;
53721 uint8x8_t __a1_513 = __noswap_vget_high_u8(__p0_513);55391 uint8x8_t __a1_605 = __noswap_vget_high_u8(__p0_605);
53722 __ret_513 = (uint16x8_t)(__noswap_vshll_n_u8(__a1_513, 0));55392 __ret_605 = (uint16x8_t)(__noswap_vshll_n_u8(__a1_605, 0));
53723 return __ret_513;55393 return __ret_605;
53724}55394}
53725#endif55395#endif
5372655396
53727#ifdef __LITTLE_ENDIAN__55397#ifdef __LITTLE_ENDIAN__
53728__ai uint64x2_t vmovl_high_u32(uint32x4_t __p0_514) {55398__ai uint64x2_t vmovl_high_u32(uint32x4_t __p0_606) {
53729 uint64x2_t __ret_514;55399 uint64x2_t __ret_606;
53730 uint32x2_t __a1_514 = vget_high_u32(__p0_514);55400 uint32x2_t __a1_606 = vget_high_u32(__p0_606);
53731 __ret_514 = (uint64x2_t)(vshll_n_u32(__a1_514, 0));55401 __ret_606 = (uint64x2_t)(vshll_n_u32(__a1_606, 0));
53732 return __ret_514;55402 return __ret_606;
53733}55403}
53734#else55404#else
53735__ai uint64x2_t vmovl_high_u32(uint32x4_t __p0_515) {55405__ai uint64x2_t vmovl_high_u32(uint32x4_t __p0_607) {
53736 uint32x4_t __rev0_515; __rev0_515 = __builtin_shufflevector(__p0_515, __p0_515, 3, 2, 1, 0);55406 uint32x4_t __rev0_607; __rev0_607 = __builtin_shufflevector(__p0_607, __p0_607, 3, 2, 1, 0);
53737 uint64x2_t __ret_515;55407 uint64x2_t __ret_607;
53738 uint32x2_t __a1_515 = __noswap_vget_high_u32(__rev0_515);55408 uint32x2_t __a1_607 = __noswap_vget_high_u32(__rev0_607);
53739 __ret_515 = (uint64x2_t)(__noswap_vshll_n_u32(__a1_515, 0));55409 __ret_607 = (uint64x2_t)(__noswap_vshll_n_u32(__a1_607, 0));
53740 __ret_515 = __builtin_shufflevector(__ret_515, __ret_515, 1, 0);55410 __ret_607 = __builtin_shufflevector(__ret_607, __ret_607, 1, 0);
53741 return __ret_515;55411 return __ret_607;
53742}55412}
53743__ai uint64x2_t __noswap_vmovl_high_u32(uint32x4_t __p0_516) {55413__ai uint64x2_t __noswap_vmovl_high_u32(uint32x4_t __p0_608) {
53744 uint64x2_t __ret_516;55414 uint64x2_t __ret_608;
53745 uint32x2_t __a1_516 = __noswap_vget_high_u32(__p0_516);55415 uint32x2_t __a1_608 = __noswap_vget_high_u32(__p0_608);
53746 __ret_516 = (uint64x2_t)(__noswap_vshll_n_u32(__a1_516, 0));55416 __ret_608 = (uint64x2_t)(__noswap_vshll_n_u32(__a1_608, 0));
53747 return __ret_516;55417 return __ret_608;
53748}55418}
53749#endif55419#endif
5375055420
53751#ifdef __LITTLE_ENDIAN__55421#ifdef __LITTLE_ENDIAN__
53752__ai uint32x4_t vmovl_high_u16(uint16x8_t __p0_517) {55422__ai uint32x4_t vmovl_high_u16(uint16x8_t __p0_609) {
53753 uint32x4_t __ret_517;55423 uint32x4_t __ret_609;
53754 uint16x4_t __a1_517 = vget_high_u16(__p0_517);55424 uint16x4_t __a1_609 = vget_high_u16(__p0_609);
53755 __ret_517 = (uint32x4_t)(vshll_n_u16(__a1_517, 0));55425 __ret_609 = (uint32x4_t)(vshll_n_u16(__a1_609, 0));
53756 return __ret_517;55426 return __ret_609;
53757}55427}
53758#else55428#else
53759__ai uint32x4_t vmovl_high_u16(uint16x8_t __p0_518) {55429__ai uint32x4_t vmovl_high_u16(uint16x8_t __p0_610) {
53760 uint16x8_t __rev0_518; __rev0_518 = __builtin_shufflevector(__p0_518, __p0_518, 7, 6, 5, 4, 3, 2, 1, 0);55430 uint16x8_t __rev0_610; __rev0_610 = __builtin_shufflevector(__p0_610, __p0_610, 7, 6, 5, 4, 3, 2, 1, 0);
53761 uint32x4_t __ret_518;55431 uint32x4_t __ret_610;
53762 uint16x4_t __a1_518 = __noswap_vget_high_u16(__rev0_518);55432 uint16x4_t __a1_610 = __noswap_vget_high_u16(__rev0_610);
53763 __ret_518 = (uint32x4_t)(__noswap_vshll_n_u16(__a1_518, 0));55433 __ret_610 = (uint32x4_t)(__noswap_vshll_n_u16(__a1_610, 0));
53764 __ret_518 = __builtin_shufflevector(__ret_518, __ret_518, 3, 2, 1, 0);55434 __ret_610 = __builtin_shufflevector(__ret_610, __ret_610, 3, 2, 1, 0);
53765 return __ret_518;55435 return __ret_610;
53766}55436}
53767__ai uint32x4_t __noswap_vmovl_high_u16(uint16x8_t __p0_519) {55437__ai uint32x4_t __noswap_vmovl_high_u16(uint16x8_t __p0_611) {
53768 uint32x4_t __ret_519;55438 uint32x4_t __ret_611;
53769 uint16x4_t __a1_519 = __noswap_vget_high_u16(__p0_519);55439 uint16x4_t __a1_611 = __noswap_vget_high_u16(__p0_611);
53770 __ret_519 = (uint32x4_t)(__noswap_vshll_n_u16(__a1_519, 0));55440 __ret_611 = (uint32x4_t)(__noswap_vshll_n_u16(__a1_611, 0));
53771 return __ret_519;55441 return __ret_611;
53772}55442}
53773#endif55443#endif
5377455444
53775#ifdef __LITTLE_ENDIAN__55445#ifdef __LITTLE_ENDIAN__
53776__ai int16x8_t vmovl_high_s8(int8x16_t __p0_520) {55446__ai int16x8_t vmovl_high_s8(int8x16_t __p0_612) {
53777 int16x8_t __ret_520;55447 int16x8_t __ret_612;
53778 int8x8_t __a1_520 = vget_high_s8(__p0_520);55448 int8x8_t __a1_612 = vget_high_s8(__p0_612);
53779 __ret_520 = (int16x8_t)(vshll_n_s8(__a1_520, 0));55449 __ret_612 = (int16x8_t)(vshll_n_s8(__a1_612, 0));
53780 return __ret_520;55450 return __ret_612;
53781}55451}
53782#else55452#else
53783__ai int16x8_t vmovl_high_s8(int8x16_t __p0_521) {55453__ai int16x8_t vmovl_high_s8(int8x16_t __p0_613) {
53784 int8x16_t __rev0_521; __rev0_521 = __builtin_shufflevector(__p0_521, __p0_521, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);55454 int8x16_t __rev0_613; __rev0_613 = __builtin_shufflevector(__p0_613, __p0_613, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
53785 int16x8_t __ret_521;55455 int16x8_t __ret_613;
53786 int8x8_t __a1_521 = __noswap_vget_high_s8(__rev0_521);55456 int8x8_t __a1_613 = __noswap_vget_high_s8(__rev0_613);
53787 __ret_521 = (int16x8_t)(__noswap_vshll_n_s8(__a1_521, 0));55457 __ret_613 = (int16x8_t)(__noswap_vshll_n_s8(__a1_613, 0));
53788 __ret_521 = __builtin_shufflevector(__ret_521, __ret_521, 7, 6, 5, 4, 3, 2, 1, 0);55458 __ret_613 = __builtin_shufflevector(__ret_613, __ret_613, 7, 6, 5, 4, 3, 2, 1, 0);
53789 return __ret_521;55459 return __ret_613;
53790}55460}
53791__ai int16x8_t __noswap_vmovl_high_s8(int8x16_t __p0_522) {55461__ai int16x8_t __noswap_vmovl_high_s8(int8x16_t __p0_614) {
53792 int16x8_t __ret_522;55462 int16x8_t __ret_614;
53793 int8x8_t __a1_522 = __noswap_vget_high_s8(__p0_522);55463 int8x8_t __a1_614 = __noswap_vget_high_s8(__p0_614);
53794 __ret_522 = (int16x8_t)(__noswap_vshll_n_s8(__a1_522, 0));55464 __ret_614 = (int16x8_t)(__noswap_vshll_n_s8(__a1_614, 0));
53795 return __ret_522;55465 return __ret_614;
53796}55466}
53797#endif55467#endif
5379855468
53799#ifdef __LITTLE_ENDIAN__55469#ifdef __LITTLE_ENDIAN__
53800__ai int64x2_t vmovl_high_s32(int32x4_t __p0_523) {55470__ai int64x2_t vmovl_high_s32(int32x4_t __p0_615) {
53801 int64x2_t __ret_523;55471 int64x2_t __ret_615;
53802 int32x2_t __a1_523 = vget_high_s32(__p0_523);55472 int32x2_t __a1_615 = vget_high_s32(__p0_615);
53803 __ret_523 = (int64x2_t)(vshll_n_s32(__a1_523, 0));55473 __ret_615 = (int64x2_t)(vshll_n_s32(__a1_615, 0));
53804 return __ret_523;55474 return __ret_615;
53805}55475}
53806#else55476#else
53807__ai int64x2_t vmovl_high_s32(int32x4_t __p0_524) {55477__ai int64x2_t vmovl_high_s32(int32x4_t __p0_616) {
53808 int32x4_t __rev0_524; __rev0_524 = __builtin_shufflevector(__p0_524, __p0_524, 3, 2, 1, 0);55478 int32x4_t __rev0_616; __rev0_616 = __builtin_shufflevector(__p0_616, __p0_616, 3, 2, 1, 0);
53809 int64x2_t __ret_524;55479 int64x2_t __ret_616;
53810 int32x2_t __a1_524 = __noswap_vget_high_s32(__rev0_524);55480 int32x2_t __a1_616 = __noswap_vget_high_s32(__rev0_616);
53811 __ret_524 = (int64x2_t)(__noswap_vshll_n_s32(__a1_524, 0));55481 __ret_616 = (int64x2_t)(__noswap_vshll_n_s32(__a1_616, 0));
53812 __ret_524 = __builtin_shufflevector(__ret_524, __ret_524, 1, 0);55482 __ret_616 = __builtin_shufflevector(__ret_616, __ret_616, 1, 0);
53813 return __ret_524;55483 return __ret_616;
53814}55484}
53815__ai int64x2_t __noswap_vmovl_high_s32(int32x4_t __p0_525) {55485__ai int64x2_t __noswap_vmovl_high_s32(int32x4_t __p0_617) {
53816 int64x2_t __ret_525;55486 int64x2_t __ret_617;
53817 int32x2_t __a1_525 = __noswap_vget_high_s32(__p0_525);55487 int32x2_t __a1_617 = __noswap_vget_high_s32(__p0_617);
53818 __ret_525 = (int64x2_t)(__noswap_vshll_n_s32(__a1_525, 0));55488 __ret_617 = (int64x2_t)(__noswap_vshll_n_s32(__a1_617, 0));
53819 return __ret_525;55489 return __ret_617;
53820}55490}
53821#endif55491#endif
5382255492
53823#ifdef __LITTLE_ENDIAN__55493#ifdef __LITTLE_ENDIAN__
53824__ai int32x4_t vmovl_high_s16(int16x8_t __p0_526) {55494__ai int32x4_t vmovl_high_s16(int16x8_t __p0_618) {
53825 int32x4_t __ret_526;55495 int32x4_t __ret_618;
53826 int16x4_t __a1_526 = vget_high_s16(__p0_526);55496 int16x4_t __a1_618 = vget_high_s16(__p0_618);
53827 __ret_526 = (int32x4_t)(vshll_n_s16(__a1_526, 0));55497 __ret_618 = (int32x4_t)(vshll_n_s16(__a1_618, 0));
53828 return __ret_526;55498 return __ret_618;
53829}55499}
53830#else55500#else
53831__ai int32x4_t vmovl_high_s16(int16x8_t __p0_527) {55501__ai int32x4_t vmovl_high_s16(int16x8_t __p0_619) {
53832 int16x8_t __rev0_527; __rev0_527 = __builtin_shufflevector(__p0_527, __p0_527, 7, 6, 5, 4, 3, 2, 1, 0);55502 int16x8_t __rev0_619; __rev0_619 = __builtin_shufflevector(__p0_619, __p0_619, 7, 6, 5, 4, 3, 2, 1, 0);
53833 int32x4_t __ret_527;55503 int32x4_t __ret_619;
53834 int16x4_t __a1_527 = __noswap_vget_high_s16(__rev0_527);55504 int16x4_t __a1_619 = __noswap_vget_high_s16(__rev0_619);
53835 __ret_527 = (int32x4_t)(__noswap_vshll_n_s16(__a1_527, 0));55505 __ret_619 = (int32x4_t)(__noswap_vshll_n_s16(__a1_619, 0));
53836 __ret_527 = __builtin_shufflevector(__ret_527, __ret_527, 3, 2, 1, 0);55506 __ret_619 = __builtin_shufflevector(__ret_619, __ret_619, 3, 2, 1, 0);
53837 return __ret_527;55507 return __ret_619;
53838}55508}
53839__ai int32x4_t __noswap_vmovl_high_s16(int16x8_t __p0_528) {55509__ai int32x4_t __noswap_vmovl_high_s16(int16x8_t __p0_620) {
53840 int32x4_t __ret_528;55510 int32x4_t __ret_620;
53841 int16x4_t __a1_528 = __noswap_vget_high_s16(__p0_528);55511 int16x4_t __a1_620 = __noswap_vget_high_s16(__p0_620);
53842 __ret_528 = (int32x4_t)(__noswap_vshll_n_s16(__a1_528, 0));55512 __ret_620 = (int32x4_t)(__noswap_vshll_n_s16(__a1_620, 0));
53843 return __ret_528;55513 return __ret_620;
53844}55514}
53845#endif55515#endif
5384655516
...@@ -53968,29 +55638,29 @@ __ai float64x1_t vmul_f64(float64x1_t __p0, float64x1_t __p1) {...@@ -53968,29 +55638,29 @@ __ai float64x1_t vmul_f64(float64x1_t __p0, float64x1_t __p1) {
53968 __ret = __p0 * __p1;55638 __ret = __p0 * __p1;
53969 return __ret;55639 return __ret;
53970}55640}
53971#define vmuld_lane_f64(__p0_529, __p1_529, __p2_529) __extension__ ({ \55641#define vmuld_lane_f64(__p0_621, __p1_621, __p2_621) __extension__ ({ \
53972 float64_t __s0_529 = __p0_529; \55642 float64_t __s0_621 = __p0_621; \
53973 float64x1_t __s1_529 = __p1_529; \55643 float64x1_t __s1_621 = __p1_621; \
53974 float64_t __ret_529; \55644 float64_t __ret_621; \
53975 __ret_529 = __s0_529 * vget_lane_f64(__s1_529, __p2_529); \55645 __ret_621 = __s0_621 * vget_lane_f64(__s1_621, __p2_621); \
53976 __ret_529; \55646 __ret_621; \
53977})55647})
53978#ifdef __LITTLE_ENDIAN__55648#ifdef __LITTLE_ENDIAN__
53979#define vmuls_lane_f32(__p0_530, __p1_530, __p2_530) __extension__ ({ \55649#define vmuls_lane_f32(__p0_622, __p1_622, __p2_622) __extension__ ({ \
53980 float32_t __s0_530 = __p0_530; \55650 float32_t __s0_622 = __p0_622; \
53981 float32x2_t __s1_530 = __p1_530; \55651 float32x2_t __s1_622 = __p1_622; \
53982 float32_t __ret_530; \55652 float32_t __ret_622; \
53983 __ret_530 = __s0_530 * vget_lane_f32(__s1_530, __p2_530); \55653 __ret_622 = __s0_622 * vget_lane_f32(__s1_622, __p2_622); \
53984 __ret_530; \55654 __ret_622; \
53985})55655})
53986#else55656#else
53987#define vmuls_lane_f32(__p0_531, __p1_531, __p2_531) __extension__ ({ \55657#define vmuls_lane_f32(__p0_623, __p1_623, __p2_623) __extension__ ({ \
53988 float32_t __s0_531 = __p0_531; \55658 float32_t __s0_623 = __p0_623; \
53989 float32x2_t __s1_531 = __p1_531; \55659 float32x2_t __s1_623 = __p1_623; \
53990 float32x2_t __rev1_531; __rev1_531 = __builtin_shufflevector(__s1_531, __s1_531, 1, 0); \55660 float32x2_t __rev1_623; __rev1_623 = __builtin_shufflevector(__s1_623, __s1_623, 1, 0); \
53991 float32_t __ret_531; \55661 float32_t __ret_623; \
53992 __ret_531 = __s0_531 * __noswap_vget_lane_f32(__rev1_531, __p2_531); \55662 __ret_623 = __s0_623 * __noswap_vget_lane_f32(__rev1_623, __p2_623); \
53993 __ret_531; \55663 __ret_623; \
53994})55664})
53995#endif55665#endif
5399655666
...@@ -54002,60 +55672,60 @@ __ai float64x1_t vmul_f64(float64x1_t __p0, float64x1_t __p1) {...@@ -54002,60 +55672,60 @@ __ai float64x1_t vmul_f64(float64x1_t __p0, float64x1_t __p1) {
54002 __ret; \55672 __ret; \
54003})55673})
54004#ifdef __LITTLE_ENDIAN__55674#ifdef __LITTLE_ENDIAN__
54005#define vmulq_lane_f64(__p0_532, __p1_532, __p2_532) __extension__ ({ \55675#define vmulq_lane_f64(__p0_624, __p1_624, __p2_624) __extension__ ({ \
54006 float64x2_t __s0_532 = __p0_532; \55676 float64x2_t __s0_624 = __p0_624; \
54007 float64x1_t __s1_532 = __p1_532; \55677 float64x1_t __s1_624 = __p1_624; \
54008 float64x2_t __ret_532; \55678 float64x2_t __ret_624; \
54009 __ret_532 = __s0_532 * splatq_lane_f64(__s1_532, __p2_532); \55679 __ret_624 = __s0_624 * splatq_lane_f64(__s1_624, __p2_624); \
54010 __ret_532; \55680 __ret_624; \
54011})55681})
54012#else55682#else
54013#define vmulq_lane_f64(__p0_533, __p1_533, __p2_533) __extension__ ({ \55683#define vmulq_lane_f64(__p0_625, __p1_625, __p2_625) __extension__ ({ \
54014 float64x2_t __s0_533 = __p0_533; \55684 float64x2_t __s0_625 = __p0_625; \
54015 float64x1_t __s1_533 = __p1_533; \55685 float64x1_t __s1_625 = __p1_625; \
54016 float64x2_t __rev0_533; __rev0_533 = __builtin_shufflevector(__s0_533, __s0_533, 1, 0); \55686 float64x2_t __rev0_625; __rev0_625 = __builtin_shufflevector(__s0_625, __s0_625, 1, 0); \
54017 float64x2_t __ret_533; \55687 float64x2_t __ret_625; \
54018 __ret_533 = __rev0_533 * __noswap_splatq_lane_f64(__s1_533, __p2_533); \55688 __ret_625 = __rev0_625 * __noswap_splatq_lane_f64(__s1_625, __p2_625); \
54019 __ret_533 = __builtin_shufflevector(__ret_533, __ret_533, 1, 0); \55689 __ret_625 = __builtin_shufflevector(__ret_625, __ret_625, 1, 0); \
54020 __ret_533; \55690 __ret_625; \
54021})55691})
54022#endif55692#endif
5402355693
54024#ifdef __LITTLE_ENDIAN__55694#ifdef __LITTLE_ENDIAN__
54025#define vmuld_laneq_f64(__p0_534, __p1_534, __p2_534) __extension__ ({ \55695#define vmuld_laneq_f64(__p0_626, __p1_626, __p2_626) __extension__ ({ \
54026 float64_t __s0_534 = __p0_534; \55696 float64_t __s0_626 = __p0_626; \
54027 float64x2_t __s1_534 = __p1_534; \55697 float64x2_t __s1_626 = __p1_626; \
54028 float64_t __ret_534; \55698 float64_t __ret_626; \
54029 __ret_534 = __s0_534 * vgetq_lane_f64(__s1_534, __p2_534); \55699 __ret_626 = __s0_626 * vgetq_lane_f64(__s1_626, __p2_626); \
54030 __ret_534; \55700 __ret_626; \
54031})55701})
54032#else55702#else
54033#define vmuld_laneq_f64(__p0_535, __p1_535, __p2_535) __extension__ ({ \55703#define vmuld_laneq_f64(__p0_627, __p1_627, __p2_627) __extension__ ({ \
54034 float64_t __s0_535 = __p0_535; \55704 float64_t __s0_627 = __p0_627; \
54035 float64x2_t __s1_535 = __p1_535; \55705 float64x2_t __s1_627 = __p1_627; \
54036 float64x2_t __rev1_535; __rev1_535 = __builtin_shufflevector(__s1_535, __s1_535, 1, 0); \55706 float64x2_t __rev1_627; __rev1_627 = __builtin_shufflevector(__s1_627, __s1_627, 1, 0); \
54037 float64_t __ret_535; \55707 float64_t __ret_627; \
54038 __ret_535 = __s0_535 * __noswap_vgetq_lane_f64(__rev1_535, __p2_535); \55708 __ret_627 = __s0_627 * __noswap_vgetq_lane_f64(__rev1_627, __p2_627); \
54039 __ret_535; \55709 __ret_627; \
54040})55710})
54041#endif55711#endif
5404255712
54043#ifdef __LITTLE_ENDIAN__55713#ifdef __LITTLE_ENDIAN__
54044#define vmuls_laneq_f32(__p0_536, __p1_536, __p2_536) __extension__ ({ \55714#define vmuls_laneq_f32(__p0_628, __p1_628, __p2_628) __extension__ ({ \
54045 float32_t __s0_536 = __p0_536; \55715 float32_t __s0_628 = __p0_628; \
54046 float32x4_t __s1_536 = __p1_536; \55716 float32x4_t __s1_628 = __p1_628; \
54047 float32_t __ret_536; \55717 float32_t __ret_628; \
54048 __ret_536 = __s0_536 * vgetq_lane_f32(__s1_536, __p2_536); \55718 __ret_628 = __s0_628 * vgetq_lane_f32(__s1_628, __p2_628); \
54049 __ret_536; \55719 __ret_628; \
54050})55720})
54051#else55721#else
54052#define vmuls_laneq_f32(__p0_537, __p1_537, __p2_537) __extension__ ({ \55722#define vmuls_laneq_f32(__p0_629, __p1_629, __p2_629) __extension__ ({ \
54053 float32_t __s0_537 = __p0_537; \55723 float32_t __s0_629 = __p0_629; \
54054 float32x4_t __s1_537 = __p1_537; \55724 float32x4_t __s1_629 = __p1_629; \
54055 float32x4_t __rev1_537; __rev1_537 = __builtin_shufflevector(__s1_537, __s1_537, 3, 2, 1, 0); \55725 float32x4_t __rev1_629; __rev1_629 = __builtin_shufflevector(__s1_629, __s1_629, 3, 2, 1, 0); \
54056 float32_t __ret_537; \55726 float32_t __ret_629; \
54057 __ret_537 = __s0_537 * __noswap_vgetq_lane_f32(__rev1_537, __p2_537); \55727 __ret_629 = __s0_629 * __noswap_vgetq_lane_f32(__rev1_629, __p2_629); \
54058 __ret_537; \55728 __ret_629; \
54059})55729})
54060#endif55730#endif
5406155731
...@@ -54079,233 +55749,233 @@ __ai float64x1_t vmul_f64(float64x1_t __p0, float64x1_t __p1) {...@@ -54079,233 +55749,233 @@ __ai float64x1_t vmul_f64(float64x1_t __p0, float64x1_t __p1) {
54079#endif55749#endif
5408055750
54081#ifdef __LITTLE_ENDIAN__55751#ifdef __LITTLE_ENDIAN__
54082#define vmulq_laneq_u32(__p0_538, __p1_538, __p2_538) __extension__ ({ \55752#define vmulq_laneq_u32(__p0_630, __p1_630, __p2_630) __extension__ ({ \
54083 uint32x4_t __s0_538 = __p0_538; \55753 uint32x4_t __s0_630 = __p0_630; \
54084 uint32x4_t __s1_538 = __p1_538; \55754 uint32x4_t __s1_630 = __p1_630; \
54085 uint32x4_t __ret_538; \55755 uint32x4_t __ret_630; \
54086 __ret_538 = __s0_538 * splatq_laneq_u32(__s1_538, __p2_538); \55756 __ret_630 = __s0_630 * splatq_laneq_u32(__s1_630, __p2_630); \
54087 __ret_538; \55757 __ret_630; \
54088})55758})
54089#else55759#else
54090#define vmulq_laneq_u32(__p0_539, __p1_539, __p2_539) __extension__ ({ \55760#define vmulq_laneq_u32(__p0_631, __p1_631, __p2_631) __extension__ ({ \
54091 uint32x4_t __s0_539 = __p0_539; \55761 uint32x4_t __s0_631 = __p0_631; \
54092 uint32x4_t __s1_539 = __p1_539; \55762 uint32x4_t __s1_631 = __p1_631; \
54093 uint32x4_t __rev0_539; __rev0_539 = __builtin_shufflevector(__s0_539, __s0_539, 3, 2, 1, 0); \55763 uint32x4_t __rev0_631; __rev0_631 = __builtin_shufflevector(__s0_631, __s0_631, 3, 2, 1, 0); \
54094 uint32x4_t __rev1_539; __rev1_539 = __builtin_shufflevector(__s1_539, __s1_539, 3, 2, 1, 0); \55764 uint32x4_t __rev1_631; __rev1_631 = __builtin_shufflevector(__s1_631, __s1_631, 3, 2, 1, 0); \
54095 uint32x4_t __ret_539; \55765 uint32x4_t __ret_631; \
54096 __ret_539 = __rev0_539 * __noswap_splatq_laneq_u32(__rev1_539, __p2_539); \55766 __ret_631 = __rev0_631 * __noswap_splatq_laneq_u32(__rev1_631, __p2_631); \
54097 __ret_539 = __builtin_shufflevector(__ret_539, __ret_539, 3, 2, 1, 0); \55767 __ret_631 = __builtin_shufflevector(__ret_631, __ret_631, 3, 2, 1, 0); \
54098 __ret_539; \55768 __ret_631; \
54099})55769})
54100#endif55770#endif
5410155771
54102#ifdef __LITTLE_ENDIAN__55772#ifdef __LITTLE_ENDIAN__
54103#define vmulq_laneq_u16(__p0_540, __p1_540, __p2_540) __extension__ ({ \55773#define vmulq_laneq_u16(__p0_632, __p1_632, __p2_632) __extension__ ({ \
54104 uint16x8_t __s0_540 = __p0_540; \55774 uint16x8_t __s0_632 = __p0_632; \
54105 uint16x8_t __s1_540 = __p1_540; \55775 uint16x8_t __s1_632 = __p1_632; \
54106 uint16x8_t __ret_540; \55776 uint16x8_t __ret_632; \
54107 __ret_540 = __s0_540 * splatq_laneq_u16(__s1_540, __p2_540); \55777 __ret_632 = __s0_632 * splatq_laneq_u16(__s1_632, __p2_632); \
54108 __ret_540; \55778 __ret_632; \
54109})55779})
54110#else55780#else
54111#define vmulq_laneq_u16(__p0_541, __p1_541, __p2_541) __extension__ ({ \55781#define vmulq_laneq_u16(__p0_633, __p1_633, __p2_633) __extension__ ({ \
54112 uint16x8_t __s0_541 = __p0_541; \55782 uint16x8_t __s0_633 = __p0_633; \
54113 uint16x8_t __s1_541 = __p1_541; \55783 uint16x8_t __s1_633 = __p1_633; \
54114 uint16x8_t __rev0_541; __rev0_541 = __builtin_shufflevector(__s0_541, __s0_541, 7, 6, 5, 4, 3, 2, 1, 0); \55784 uint16x8_t __rev0_633; __rev0_633 = __builtin_shufflevector(__s0_633, __s0_633, 7, 6, 5, 4, 3, 2, 1, 0); \
54115 uint16x8_t __rev1_541; __rev1_541 = __builtin_shufflevector(__s1_541, __s1_541, 7, 6, 5, 4, 3, 2, 1, 0); \55785 uint16x8_t __rev1_633; __rev1_633 = __builtin_shufflevector(__s1_633, __s1_633, 7, 6, 5, 4, 3, 2, 1, 0); \
54116 uint16x8_t __ret_541; \55786 uint16x8_t __ret_633; \
54117 __ret_541 = __rev0_541 * __noswap_splatq_laneq_u16(__rev1_541, __p2_541); \55787 __ret_633 = __rev0_633 * __noswap_splatq_laneq_u16(__rev1_633, __p2_633); \
54118 __ret_541 = __builtin_shufflevector(__ret_541, __ret_541, 7, 6, 5, 4, 3, 2, 1, 0); \55788 __ret_633 = __builtin_shufflevector(__ret_633, __ret_633, 7, 6, 5, 4, 3, 2, 1, 0); \
54119 __ret_541; \55789 __ret_633; \
54120})55790})
54121#endif55791#endif
5412255792
54123#ifdef __LITTLE_ENDIAN__55793#ifdef __LITTLE_ENDIAN__
54124#define vmulq_laneq_f64(__p0_542, __p1_542, __p2_542) __extension__ ({ \55794#define vmulq_laneq_f64(__p0_634, __p1_634, __p2_634) __extension__ ({ \
54125 float64x2_t __s0_542 = __p0_542; \55795 float64x2_t __s0_634 = __p0_634; \
54126 float64x2_t __s1_542 = __p1_542; \55796 float64x2_t __s1_634 = __p1_634; \
54127 float64x2_t __ret_542; \55797 float64x2_t __ret_634; \
54128 __ret_542 = __s0_542 * splatq_laneq_f64(__s1_542, __p2_542); \55798 __ret_634 = __s0_634 * splatq_laneq_f64(__s1_634, __p2_634); \
54129 __ret_542; \55799 __ret_634; \
54130})55800})
54131#else55801#else
54132#define vmulq_laneq_f64(__p0_543, __p1_543, __p2_543) __extension__ ({ \55802#define vmulq_laneq_f64(__p0_635, __p1_635, __p2_635) __extension__ ({ \
54133 float64x2_t __s0_543 = __p0_543; \55803 float64x2_t __s0_635 = __p0_635; \
54134 float64x2_t __s1_543 = __p1_543; \55804 float64x2_t __s1_635 = __p1_635; \
54135 float64x2_t __rev0_543; __rev0_543 = __builtin_shufflevector(__s0_543, __s0_543, 1, 0); \55805 float64x2_t __rev0_635; __rev0_635 = __builtin_shufflevector(__s0_635, __s0_635, 1, 0); \
54136 float64x2_t __rev1_543; __rev1_543 = __builtin_shufflevector(__s1_543, __s1_543, 1, 0); \55806 float64x2_t __rev1_635; __rev1_635 = __builtin_shufflevector(__s1_635, __s1_635, 1, 0); \
54137 float64x2_t __ret_543; \55807 float64x2_t __ret_635; \
54138 __ret_543 = __rev0_543 * __noswap_splatq_laneq_f64(__rev1_543, __p2_543); \55808 __ret_635 = __rev0_635 * __noswap_splatq_laneq_f64(__rev1_635, __p2_635); \
54139 __ret_543 = __builtin_shufflevector(__ret_543, __ret_543, 1, 0); \55809 __ret_635 = __builtin_shufflevector(__ret_635, __ret_635, 1, 0); \
54140 __ret_543; \55810 __ret_635; \
54141})55811})
54142#endif55812#endif
5414355813
54144#ifdef __LITTLE_ENDIAN__55814#ifdef __LITTLE_ENDIAN__
54145#define vmulq_laneq_f32(__p0_544, __p1_544, __p2_544) __extension__ ({ \55815#define vmulq_laneq_f32(__p0_636, __p1_636, __p2_636) __extension__ ({ \
54146 float32x4_t __s0_544 = __p0_544; \55816 float32x4_t __s0_636 = __p0_636; \
54147 float32x4_t __s1_544 = __p1_544; \55817 float32x4_t __s1_636 = __p1_636; \
54148 float32x4_t __ret_544; \55818 float32x4_t __ret_636; \
54149 __ret_544 = __s0_544 * splatq_laneq_f32(__s1_544, __p2_544); \55819 __ret_636 = __s0_636 * splatq_laneq_f32(__s1_636, __p2_636); \
54150 __ret_544; \55820 __ret_636; \
54151})55821})
54152#else55822#else
54153#define vmulq_laneq_f32(__p0_545, __p1_545, __p2_545) __extension__ ({ \55823#define vmulq_laneq_f32(__p0_637, __p1_637, __p2_637) __extension__ ({ \
54154 float32x4_t __s0_545 = __p0_545; \55824 float32x4_t __s0_637 = __p0_637; \
54155 float32x4_t __s1_545 = __p1_545; \55825 float32x4_t __s1_637 = __p1_637; \
54156 float32x4_t __rev0_545; __rev0_545 = __builtin_shufflevector(__s0_545, __s0_545, 3, 2, 1, 0); \55826 float32x4_t __rev0_637; __rev0_637 = __builtin_shufflevector(__s0_637, __s0_637, 3, 2, 1, 0); \
54157 float32x4_t __rev1_545; __rev1_545 = __builtin_shufflevector(__s1_545, __s1_545, 3, 2, 1, 0); \55827 float32x4_t __rev1_637; __rev1_637 = __builtin_shufflevector(__s1_637, __s1_637, 3, 2, 1, 0); \
54158 float32x4_t __ret_545; \55828 float32x4_t __ret_637; \
54159 __ret_545 = __rev0_545 * __noswap_splatq_laneq_f32(__rev1_545, __p2_545); \55829 __ret_637 = __rev0_637 * __noswap_splatq_laneq_f32(__rev1_637, __p2_637); \
54160 __ret_545 = __builtin_shufflevector(__ret_545, __ret_545, 3, 2, 1, 0); \55830 __ret_637 = __builtin_shufflevector(__ret_637, __ret_637, 3, 2, 1, 0); \
54161 __ret_545; \55831 __ret_637; \
54162})55832})
54163#endif55833#endif
5416455834
54165#ifdef __LITTLE_ENDIAN__55835#ifdef __LITTLE_ENDIAN__
54166#define vmulq_laneq_s32(__p0_546, __p1_546, __p2_546) __extension__ ({ \55836#define vmulq_laneq_s32(__p0_638, __p1_638, __p2_638) __extension__ ({ \
54167 int32x4_t __s0_546 = __p0_546; \55837 int32x4_t __s0_638 = __p0_638; \
54168 int32x4_t __s1_546 = __p1_546; \55838 int32x4_t __s1_638 = __p1_638; \
54169 int32x4_t __ret_546; \55839 int32x4_t __ret_638; \
54170 __ret_546 = __s0_546 * splatq_laneq_s32(__s1_546, __p2_546); \55840 __ret_638 = __s0_638 * splatq_laneq_s32(__s1_638, __p2_638); \
54171 __ret_546; \55841 __ret_638; \
54172})55842})
54173#else55843#else
54174#define vmulq_laneq_s32(__p0_547, __p1_547, __p2_547) __extension__ ({ \55844#define vmulq_laneq_s32(__p0_639, __p1_639, __p2_639) __extension__ ({ \
54175 int32x4_t __s0_547 = __p0_547; \55845 int32x4_t __s0_639 = __p0_639; \
54176 int32x4_t __s1_547 = __p1_547; \55846 int32x4_t __s1_639 = __p1_639; \
54177 int32x4_t __rev0_547; __rev0_547 = __builtin_shufflevector(__s0_547, __s0_547, 3, 2, 1, 0); \55847 int32x4_t __rev0_639; __rev0_639 = __builtin_shufflevector(__s0_639, __s0_639, 3, 2, 1, 0); \
54178 int32x4_t __rev1_547; __rev1_547 = __builtin_shufflevector(__s1_547, __s1_547, 3, 2, 1, 0); \55848 int32x4_t __rev1_639; __rev1_639 = __builtin_shufflevector(__s1_639, __s1_639, 3, 2, 1, 0); \
54179 int32x4_t __ret_547; \55849 int32x4_t __ret_639; \
54180 __ret_547 = __rev0_547 * __noswap_splatq_laneq_s32(__rev1_547, __p2_547); \55850 __ret_639 = __rev0_639 * __noswap_splatq_laneq_s32(__rev1_639, __p2_639); \
54181 __ret_547 = __builtin_shufflevector(__ret_547, __ret_547, 3, 2, 1, 0); \55851 __ret_639 = __builtin_shufflevector(__ret_639, __ret_639, 3, 2, 1, 0); \
54182 __ret_547; \55852 __ret_639; \
54183})55853})
54184#endif55854#endif
5418555855
54186#ifdef __LITTLE_ENDIAN__55856#ifdef __LITTLE_ENDIAN__
54187#define vmulq_laneq_s16(__p0_548, __p1_548, __p2_548) __extension__ ({ \55857#define vmulq_laneq_s16(__p0_640, __p1_640, __p2_640) __extension__ ({ \
54188 int16x8_t __s0_548 = __p0_548; \55858 int16x8_t __s0_640 = __p0_640; \
54189 int16x8_t __s1_548 = __p1_548; \55859 int16x8_t __s1_640 = __p1_640; \
54190 int16x8_t __ret_548; \55860 int16x8_t __ret_640; \
54191 __ret_548 = __s0_548 * splatq_laneq_s16(__s1_548, __p2_548); \55861 __ret_640 = __s0_640 * splatq_laneq_s16(__s1_640, __p2_640); \
54192 __ret_548; \55862 __ret_640; \
54193})55863})
54194#else55864#else
54195#define vmulq_laneq_s16(__p0_549, __p1_549, __p2_549) __extension__ ({ \55865#define vmulq_laneq_s16(__p0_641, __p1_641, __p2_641) __extension__ ({ \
54196 int16x8_t __s0_549 = __p0_549; \55866 int16x8_t __s0_641 = __p0_641; \
54197 int16x8_t __s1_549 = __p1_549; \55867 int16x8_t __s1_641 = __p1_641; \
54198 int16x8_t __rev0_549; __rev0_549 = __builtin_shufflevector(__s0_549, __s0_549, 7, 6, 5, 4, 3, 2, 1, 0); \55868 int16x8_t __rev0_641; __rev0_641 = __builtin_shufflevector(__s0_641, __s0_641, 7, 6, 5, 4, 3, 2, 1, 0); \
54199 int16x8_t __rev1_549; __rev1_549 = __builtin_shufflevector(__s1_549, __s1_549, 7, 6, 5, 4, 3, 2, 1, 0); \55869 int16x8_t __rev1_641; __rev1_641 = __builtin_shufflevector(__s1_641, __s1_641, 7, 6, 5, 4, 3, 2, 1, 0); \
54200 int16x8_t __ret_549; \55870 int16x8_t __ret_641; \
54201 __ret_549 = __rev0_549 * __noswap_splatq_laneq_s16(__rev1_549, __p2_549); \55871 __ret_641 = __rev0_641 * __noswap_splatq_laneq_s16(__rev1_641, __p2_641); \
54202 __ret_549 = __builtin_shufflevector(__ret_549, __ret_549, 7, 6, 5, 4, 3, 2, 1, 0); \55872 __ret_641 = __builtin_shufflevector(__ret_641, __ret_641, 7, 6, 5, 4, 3, 2, 1, 0); \
54203 __ret_549; \55873 __ret_641; \
54204})55874})
54205#endif55875#endif
5420655876
54207#ifdef __LITTLE_ENDIAN__55877#ifdef __LITTLE_ENDIAN__
54208#define vmul_laneq_u32(__p0_550, __p1_550, __p2_550) __extension__ ({ \55878#define vmul_laneq_u32(__p0_642, __p1_642, __p2_642) __extension__ ({ \
54209 uint32x2_t __s0_550 = __p0_550; \55879 uint32x2_t __s0_642 = __p0_642; \
54210 uint32x4_t __s1_550 = __p1_550; \55880 uint32x4_t __s1_642 = __p1_642; \
54211 uint32x2_t __ret_550; \55881 uint32x2_t __ret_642; \
54212 __ret_550 = __s0_550 * splat_laneq_u32(__s1_550, __p2_550); \55882 __ret_642 = __s0_642 * splat_laneq_u32(__s1_642, __p2_642); \
54213 __ret_550; \55883 __ret_642; \
54214})55884})
54215#else55885#else
54216#define vmul_laneq_u32(__p0_551, __p1_551, __p2_551) __extension__ ({ \55886#define vmul_laneq_u32(__p0_643, __p1_643, __p2_643) __extension__ ({ \
54217 uint32x2_t __s0_551 = __p0_551; \55887 uint32x2_t __s0_643 = __p0_643; \
54218 uint32x4_t __s1_551 = __p1_551; \55888 uint32x4_t __s1_643 = __p1_643; \
54219 uint32x2_t __rev0_551; __rev0_551 = __builtin_shufflevector(__s0_551, __s0_551, 1, 0); \55889 uint32x2_t __rev0_643; __rev0_643 = __builtin_shufflevector(__s0_643, __s0_643, 1, 0); \
54220 uint32x4_t __rev1_551; __rev1_551 = __builtin_shufflevector(__s1_551, __s1_551, 3, 2, 1, 0); \55890 uint32x4_t __rev1_643; __rev1_643 = __builtin_shufflevector(__s1_643, __s1_643, 3, 2, 1, 0); \
54221 uint32x2_t __ret_551; \55891 uint32x2_t __ret_643; \
54222 __ret_551 = __rev0_551 * __noswap_splat_laneq_u32(__rev1_551, __p2_551); \55892 __ret_643 = __rev0_643 * __noswap_splat_laneq_u32(__rev1_643, __p2_643); \
54223 __ret_551 = __builtin_shufflevector(__ret_551, __ret_551, 1, 0); \55893 __ret_643 = __builtin_shufflevector(__ret_643, __ret_643, 1, 0); \
54224 __ret_551; \55894 __ret_643; \
54225})55895})
54226#endif55896#endif
5422755897
54228#ifdef __LITTLE_ENDIAN__55898#ifdef __LITTLE_ENDIAN__
54229#define vmul_laneq_u16(__p0_552, __p1_552, __p2_552) __extension__ ({ \55899#define vmul_laneq_u16(__p0_644, __p1_644, __p2_644) __extension__ ({ \
54230 uint16x4_t __s0_552 = __p0_552; \55900 uint16x4_t __s0_644 = __p0_644; \
54231 uint16x8_t __s1_552 = __p1_552; \55901 uint16x8_t __s1_644 = __p1_644; \
54232 uint16x4_t __ret_552; \55902 uint16x4_t __ret_644; \
54233 __ret_552 = __s0_552 * splat_laneq_u16(__s1_552, __p2_552); \55903 __ret_644 = __s0_644 * splat_laneq_u16(__s1_644, __p2_644); \
54234 __ret_552; \55904 __ret_644; \
54235})55905})
54236#else55906#else
54237#define vmul_laneq_u16(__p0_553, __p1_553, __p2_553) __extension__ ({ \55907#define vmul_laneq_u16(__p0_645, __p1_645, __p2_645) __extension__ ({ \
54238 uint16x4_t __s0_553 = __p0_553; \55908 uint16x4_t __s0_645 = __p0_645; \
54239 uint16x8_t __s1_553 = __p1_553; \55909 uint16x8_t __s1_645 = __p1_645; \
54240 uint16x4_t __rev0_553; __rev0_553 = __builtin_shufflevector(__s0_553, __s0_553, 3, 2, 1, 0); \55910 uint16x4_t __rev0_645; __rev0_645 = __builtin_shufflevector(__s0_645, __s0_645, 3, 2, 1, 0); \
54241 uint16x8_t __rev1_553; __rev1_553 = __builtin_shufflevector(__s1_553, __s1_553, 7, 6, 5, 4, 3, 2, 1, 0); \55911 uint16x8_t __rev1_645; __rev1_645 = __builtin_shufflevector(__s1_645, __s1_645, 7, 6, 5, 4, 3, 2, 1, 0); \
54242 uint16x4_t __ret_553; \55912 uint16x4_t __ret_645; \
54243 __ret_553 = __rev0_553 * __noswap_splat_laneq_u16(__rev1_553, __p2_553); \55913 __ret_645 = __rev0_645 * __noswap_splat_laneq_u16(__rev1_645, __p2_645); \
54244 __ret_553 = __builtin_shufflevector(__ret_553, __ret_553, 3, 2, 1, 0); \55914 __ret_645 = __builtin_shufflevector(__ret_645, __ret_645, 3, 2, 1, 0); \
54245 __ret_553; \55915 __ret_645; \
54246})55916})
54247#endif55917#endif
5424855918
54249#ifdef __LITTLE_ENDIAN__55919#ifdef __LITTLE_ENDIAN__
54250#define vmul_laneq_f32(__p0_554, __p1_554, __p2_554) __extension__ ({ \55920#define vmul_laneq_f32(__p0_646, __p1_646, __p2_646) __extension__ ({ \
54251 float32x2_t __s0_554 = __p0_554; \55921 float32x2_t __s0_646 = __p0_646; \
54252 float32x4_t __s1_554 = __p1_554; \55922 float32x4_t __s1_646 = __p1_646; \
54253 float32x2_t __ret_554; \55923 float32x2_t __ret_646; \
54254 __ret_554 = __s0_554 * splat_laneq_f32(__s1_554, __p2_554); \55924 __ret_646 = __s0_646 * splat_laneq_f32(__s1_646, __p2_646); \
54255 __ret_554; \55925 __ret_646; \
54256})55926})
54257#else55927#else
54258#define vmul_laneq_f32(__p0_555, __p1_555, __p2_555) __extension__ ({ \55928#define vmul_laneq_f32(__p0_647, __p1_647, __p2_647) __extension__ ({ \
54259 float32x2_t __s0_555 = __p0_555; \55929 float32x2_t __s0_647 = __p0_647; \
54260 float32x4_t __s1_555 = __p1_555; \55930 float32x4_t __s1_647 = __p1_647; \
54261 float32x2_t __rev0_555; __rev0_555 = __builtin_shufflevector(__s0_555, __s0_555, 1, 0); \55931 float32x2_t __rev0_647; __rev0_647 = __builtin_shufflevector(__s0_647, __s0_647, 1, 0); \
54262 float32x4_t __rev1_555; __rev1_555 = __builtin_shufflevector(__s1_555, __s1_555, 3, 2, 1, 0); \55932 float32x4_t __rev1_647; __rev1_647 = __builtin_shufflevector(__s1_647, __s1_647, 3, 2, 1, 0); \
54263 float32x2_t __ret_555; \55933 float32x2_t __ret_647; \
54264 __ret_555 = __rev0_555 * __noswap_splat_laneq_f32(__rev1_555, __p2_555); \55934 __ret_647 = __rev0_647 * __noswap_splat_laneq_f32(__rev1_647, __p2_647); \
54265 __ret_555 = __builtin_shufflevector(__ret_555, __ret_555, 1, 0); \55935 __ret_647 = __builtin_shufflevector(__ret_647, __ret_647, 1, 0); \
54266 __ret_555; \55936 __ret_647; \
54267})55937})
54268#endif55938#endif
5426955939
54270#ifdef __LITTLE_ENDIAN__55940#ifdef __LITTLE_ENDIAN__
54271#define vmul_laneq_s32(__p0_556, __p1_556, __p2_556) __extension__ ({ \55941#define vmul_laneq_s32(__p0_648, __p1_648, __p2_648) __extension__ ({ \
54272 int32x2_t __s0_556 = __p0_556; \55942 int32x2_t __s0_648 = __p0_648; \
54273 int32x4_t __s1_556 = __p1_556; \55943 int32x4_t __s1_648 = __p1_648; \
54274 int32x2_t __ret_556; \55944 int32x2_t __ret_648; \
54275 __ret_556 = __s0_556 * splat_laneq_s32(__s1_556, __p2_556); \55945 __ret_648 = __s0_648 * splat_laneq_s32(__s1_648, __p2_648); \
54276 __ret_556; \55946 __ret_648; \
54277})55947})
54278#else55948#else
54279#define vmul_laneq_s32(__p0_557, __p1_557, __p2_557) __extension__ ({ \55949#define vmul_laneq_s32(__p0_649, __p1_649, __p2_649) __extension__ ({ \
54280 int32x2_t __s0_557 = __p0_557; \55950 int32x2_t __s0_649 = __p0_649; \
54281 int32x4_t __s1_557 = __p1_557; \55951 int32x4_t __s1_649 = __p1_649; \
54282 int32x2_t __rev0_557; __rev0_557 = __builtin_shufflevector(__s0_557, __s0_557, 1, 0); \55952 int32x2_t __rev0_649; __rev0_649 = __builtin_shufflevector(__s0_649, __s0_649, 1, 0); \
54283 int32x4_t __rev1_557; __rev1_557 = __builtin_shufflevector(__s1_557, __s1_557, 3, 2, 1, 0); \55953 int32x4_t __rev1_649; __rev1_649 = __builtin_shufflevector(__s1_649, __s1_649, 3, 2, 1, 0); \
54284 int32x2_t __ret_557; \55954 int32x2_t __ret_649; \
54285 __ret_557 = __rev0_557 * __noswap_splat_laneq_s32(__rev1_557, __p2_557); \55955 __ret_649 = __rev0_649 * __noswap_splat_laneq_s32(__rev1_649, __p2_649); \
54286 __ret_557 = __builtin_shufflevector(__ret_557, __ret_557, 1, 0); \55956 __ret_649 = __builtin_shufflevector(__ret_649, __ret_649, 1, 0); \
54287 __ret_557; \55957 __ret_649; \
54288})55958})
54289#endif55959#endif
5429055960
54291#ifdef __LITTLE_ENDIAN__55961#ifdef __LITTLE_ENDIAN__
54292#define vmul_laneq_s16(__p0_558, __p1_558, __p2_558) __extension__ ({ \55962#define vmul_laneq_s16(__p0_650, __p1_650, __p2_650) __extension__ ({ \
54293 int16x4_t __s0_558 = __p0_558; \55963 int16x4_t __s0_650 = __p0_650; \
54294 int16x8_t __s1_558 = __p1_558; \55964 int16x8_t __s1_650 = __p1_650; \
54295 int16x4_t __ret_558; \55965 int16x4_t __ret_650; \
54296 __ret_558 = __s0_558 * splat_laneq_s16(__s1_558, __p2_558); \55966 __ret_650 = __s0_650 * splat_laneq_s16(__s1_650, __p2_650); \
54297 __ret_558; \55967 __ret_650; \
54298})55968})
54299#else55969#else
54300#define vmul_laneq_s16(__p0_559, __p1_559, __p2_559) __extension__ ({ \55970#define vmul_laneq_s16(__p0_651, __p1_651, __p2_651) __extension__ ({ \
54301 int16x4_t __s0_559 = __p0_559; \55971 int16x4_t __s0_651 = __p0_651; \
54302 int16x8_t __s1_559 = __p1_559; \55972 int16x8_t __s1_651 = __p1_651; \
54303 int16x4_t __rev0_559; __rev0_559 = __builtin_shufflevector(__s0_559, __s0_559, 3, 2, 1, 0); \55973 int16x4_t __rev0_651; __rev0_651 = __builtin_shufflevector(__s0_651, __s0_651, 3, 2, 1, 0); \
54304 int16x8_t __rev1_559; __rev1_559 = __builtin_shufflevector(__s1_559, __s1_559, 7, 6, 5, 4, 3, 2, 1, 0); \55974 int16x8_t __rev1_651; __rev1_651 = __builtin_shufflevector(__s1_651, __s1_651, 7, 6, 5, 4, 3, 2, 1, 0); \
54305 int16x4_t __ret_559; \55975 int16x4_t __ret_651; \
54306 __ret_559 = __rev0_559 * __noswap_splat_laneq_s16(__rev1_559, __p2_559); \55976 __ret_651 = __rev0_651 * __noswap_splat_laneq_s16(__rev1_651, __p2_651); \
54307 __ret_559 = __builtin_shufflevector(__ret_559, __ret_559, 3, 2, 1, 0); \55977 __ret_651 = __builtin_shufflevector(__ret_651, __ret_651, 3, 2, 1, 0); \
54308 __ret_559; \55978 __ret_651; \
54309})55979})
54310#endif55980#endif
5431155981
...@@ -54471,170 +56141,170 @@ __ai poly128_t vmull_high_p64(poly64x2_t __p0, poly64x2_t __p1) {...@@ -54471,170 +56141,170 @@ __ai poly128_t vmull_high_p64(poly64x2_t __p0, poly64x2_t __p1) {
54471#endif56141#endif
5447256142
54473#ifdef __LITTLE_ENDIAN__56143#ifdef __LITTLE_ENDIAN__
54474#define vmull_high_lane_u32(__p0_560, __p1_560, __p2_560) __extension__ ({ \56144#define vmull_high_lane_u32(__p0_652, __p1_652, __p2_652) __extension__ ({ \
54475 uint32x4_t __s0_560 = __p0_560; \56145 uint32x4_t __s0_652 = __p0_652; \
54476 uint32x2_t __s1_560 = __p1_560; \56146 uint32x2_t __s1_652 = __p1_652; \
54477 uint64x2_t __ret_560; \56147 uint64x2_t __ret_652; \
54478 __ret_560 = vmull_u32(vget_high_u32(__s0_560), splat_lane_u32(__s1_560, __p2_560)); \56148 __ret_652 = vmull_u32(vget_high_u32(__s0_652), splat_lane_u32(__s1_652, __p2_652)); \
54479 __ret_560; \56149 __ret_652; \
54480})56150})
54481#else56151#else
54482#define vmull_high_lane_u32(__p0_561, __p1_561, __p2_561) __extension__ ({ \56152#define vmull_high_lane_u32(__p0_653, __p1_653, __p2_653) __extension__ ({ \
54483 uint32x4_t __s0_561 = __p0_561; \56153 uint32x4_t __s0_653 = __p0_653; \
54484 uint32x2_t __s1_561 = __p1_561; \56154 uint32x2_t __s1_653 = __p1_653; \
54485 uint32x4_t __rev0_561; __rev0_561 = __builtin_shufflevector(__s0_561, __s0_561, 3, 2, 1, 0); \56155 uint32x4_t __rev0_653; __rev0_653 = __builtin_shufflevector(__s0_653, __s0_653, 3, 2, 1, 0); \
54486 uint32x2_t __rev1_561; __rev1_561 = __builtin_shufflevector(__s1_561, __s1_561, 1, 0); \56156 uint32x2_t __rev1_653; __rev1_653 = __builtin_shufflevector(__s1_653, __s1_653, 1, 0); \
54487 uint64x2_t __ret_561; \56157 uint64x2_t __ret_653; \
54488 __ret_561 = __noswap_vmull_u32(__noswap_vget_high_u32(__rev0_561), __noswap_splat_lane_u32(__rev1_561, __p2_561)); \56158 __ret_653 = __noswap_vmull_u32(__noswap_vget_high_u32(__rev0_653), __noswap_splat_lane_u32(__rev1_653, __p2_653)); \
54489 __ret_561 = __builtin_shufflevector(__ret_561, __ret_561, 1, 0); \56159 __ret_653 = __builtin_shufflevector(__ret_653, __ret_653, 1, 0); \
54490 __ret_561; \56160 __ret_653; \
54491})56161})
54492#endif56162#endif
5449356163
54494#ifdef __LITTLE_ENDIAN__56164#ifdef __LITTLE_ENDIAN__
54495#define vmull_high_lane_u16(__p0_562, __p1_562, __p2_562) __extension__ ({ \56165#define vmull_high_lane_u16(__p0_654, __p1_654, __p2_654) __extension__ ({ \
54496 uint16x8_t __s0_562 = __p0_562; \56166 uint16x8_t __s0_654 = __p0_654; \
54497 uint16x4_t __s1_562 = __p1_562; \56167 uint16x4_t __s1_654 = __p1_654; \
54498 uint32x4_t __ret_562; \56168 uint32x4_t __ret_654; \
54499 __ret_562 = vmull_u16(vget_high_u16(__s0_562), splat_lane_u16(__s1_562, __p2_562)); \56169 __ret_654 = vmull_u16(vget_high_u16(__s0_654), splat_lane_u16(__s1_654, __p2_654)); \
54500 __ret_562; \56170 __ret_654; \
54501})56171})
54502#else56172#else
54503#define vmull_high_lane_u16(__p0_563, __p1_563, __p2_563) __extension__ ({ \56173#define vmull_high_lane_u16(__p0_655, __p1_655, __p2_655) __extension__ ({ \
54504 uint16x8_t __s0_563 = __p0_563; \56174 uint16x8_t __s0_655 = __p0_655; \
54505 uint16x4_t __s1_563 = __p1_563; \56175 uint16x4_t __s1_655 = __p1_655; \
54506 uint16x8_t __rev0_563; __rev0_563 = __builtin_shufflevector(__s0_563, __s0_563, 7, 6, 5, 4, 3, 2, 1, 0); \56176 uint16x8_t __rev0_655; __rev0_655 = __builtin_shufflevector(__s0_655, __s0_655, 7, 6, 5, 4, 3, 2, 1, 0); \
54507 uint16x4_t __rev1_563; __rev1_563 = __builtin_shufflevector(__s1_563, __s1_563, 3, 2, 1, 0); \56177 uint16x4_t __rev1_655; __rev1_655 = __builtin_shufflevector(__s1_655, __s1_655, 3, 2, 1, 0); \
54508 uint32x4_t __ret_563; \56178 uint32x4_t __ret_655; \
54509 __ret_563 = __noswap_vmull_u16(__noswap_vget_high_u16(__rev0_563), __noswap_splat_lane_u16(__rev1_563, __p2_563)); \56179 __ret_655 = __noswap_vmull_u16(__noswap_vget_high_u16(__rev0_655), __noswap_splat_lane_u16(__rev1_655, __p2_655)); \
54510 __ret_563 = __builtin_shufflevector(__ret_563, __ret_563, 3, 2, 1, 0); \56180 __ret_655 = __builtin_shufflevector(__ret_655, __ret_655, 3, 2, 1, 0); \
54511 __ret_563; \56181 __ret_655; \
54512})56182})
54513#endif56183#endif
5451456184
54515#ifdef __LITTLE_ENDIAN__56185#ifdef __LITTLE_ENDIAN__
54516#define vmull_high_lane_s32(__p0_564, __p1_564, __p2_564) __extension__ ({ \56186#define vmull_high_lane_s32(__p0_656, __p1_656, __p2_656) __extension__ ({ \
54517 int32x4_t __s0_564 = __p0_564; \56187 int32x4_t __s0_656 = __p0_656; \
54518 int32x2_t __s1_564 = __p1_564; \56188 int32x2_t __s1_656 = __p1_656; \
54519 int64x2_t __ret_564; \56189 int64x2_t __ret_656; \
54520 __ret_564 = vmull_s32(vget_high_s32(__s0_564), splat_lane_s32(__s1_564, __p2_564)); \56190 __ret_656 = vmull_s32(vget_high_s32(__s0_656), splat_lane_s32(__s1_656, __p2_656)); \
54521 __ret_564; \56191 __ret_656; \
54522})56192})
54523#else56193#else
54524#define vmull_high_lane_s32(__p0_565, __p1_565, __p2_565) __extension__ ({ \56194#define vmull_high_lane_s32(__p0_657, __p1_657, __p2_657) __extension__ ({ \
54525 int32x4_t __s0_565 = __p0_565; \56195 int32x4_t __s0_657 = __p0_657; \
54526 int32x2_t __s1_565 = __p1_565; \56196 int32x2_t __s1_657 = __p1_657; \
54527 int32x4_t __rev0_565; __rev0_565 = __builtin_shufflevector(__s0_565, __s0_565, 3, 2, 1, 0); \56197 int32x4_t __rev0_657; __rev0_657 = __builtin_shufflevector(__s0_657, __s0_657, 3, 2, 1, 0); \
54528 int32x2_t __rev1_565; __rev1_565 = __builtin_shufflevector(__s1_565, __s1_565, 1, 0); \56198 int32x2_t __rev1_657; __rev1_657 = __builtin_shufflevector(__s1_657, __s1_657, 1, 0); \
54529 int64x2_t __ret_565; \56199 int64x2_t __ret_657; \
54530 __ret_565 = __noswap_vmull_s32(__noswap_vget_high_s32(__rev0_565), __noswap_splat_lane_s32(__rev1_565, __p2_565)); \56200 __ret_657 = __noswap_vmull_s32(__noswap_vget_high_s32(__rev0_657), __noswap_splat_lane_s32(__rev1_657, __p2_657)); \
54531 __ret_565 = __builtin_shufflevector(__ret_565, __ret_565, 1, 0); \56201 __ret_657 = __builtin_shufflevector(__ret_657, __ret_657, 1, 0); \
54532 __ret_565; \56202 __ret_657; \
54533})56203})
54534#endif56204#endif
5453556205
54536#ifdef __LITTLE_ENDIAN__56206#ifdef __LITTLE_ENDIAN__
54537#define vmull_high_lane_s16(__p0_566, __p1_566, __p2_566) __extension__ ({ \56207#define vmull_high_lane_s16(__p0_658, __p1_658, __p2_658) __extension__ ({ \
54538 int16x8_t __s0_566 = __p0_566; \56208 int16x8_t __s0_658 = __p0_658; \
54539 int16x4_t __s1_566 = __p1_566; \56209 int16x4_t __s1_658 = __p1_658; \
54540 int32x4_t __ret_566; \56210 int32x4_t __ret_658; \
54541 __ret_566 = vmull_s16(vget_high_s16(__s0_566), splat_lane_s16(__s1_566, __p2_566)); \56211 __ret_658 = vmull_s16(vget_high_s16(__s0_658), splat_lane_s16(__s1_658, __p2_658)); \
54542 __ret_566; \56212 __ret_658; \
54543})56213})
54544#else56214#else
54545#define vmull_high_lane_s16(__p0_567, __p1_567, __p2_567) __extension__ ({ \56215#define vmull_high_lane_s16(__p0_659, __p1_659, __p2_659) __extension__ ({ \
54546 int16x8_t __s0_567 = __p0_567; \56216 int16x8_t __s0_659 = __p0_659; \
54547 int16x4_t __s1_567 = __p1_567; \56217 int16x4_t __s1_659 = __p1_659; \
54548 int16x8_t __rev0_567; __rev0_567 = __builtin_shufflevector(__s0_567, __s0_567, 7, 6, 5, 4, 3, 2, 1, 0); \56218 int16x8_t __rev0_659; __rev0_659 = __builtin_shufflevector(__s0_659, __s0_659, 7, 6, 5, 4, 3, 2, 1, 0); \
54549 int16x4_t __rev1_567; __rev1_567 = __builtin_shufflevector(__s1_567, __s1_567, 3, 2, 1, 0); \56219 int16x4_t __rev1_659; __rev1_659 = __builtin_shufflevector(__s1_659, __s1_659, 3, 2, 1, 0); \
54550 int32x4_t __ret_567; \56220 int32x4_t __ret_659; \
54551 __ret_567 = __noswap_vmull_s16(__noswap_vget_high_s16(__rev0_567), __noswap_splat_lane_s16(__rev1_567, __p2_567)); \56221 __ret_659 = __noswap_vmull_s16(__noswap_vget_high_s16(__rev0_659), __noswap_splat_lane_s16(__rev1_659, __p2_659)); \
54552 __ret_567 = __builtin_shufflevector(__ret_567, __ret_567, 3, 2, 1, 0); \56222 __ret_659 = __builtin_shufflevector(__ret_659, __ret_659, 3, 2, 1, 0); \
54553 __ret_567; \56223 __ret_659; \
54554})56224})
54555#endif56225#endif
5455656226
54557#ifdef __LITTLE_ENDIAN__56227#ifdef __LITTLE_ENDIAN__
54558#define vmull_high_laneq_u32(__p0_568, __p1_568, __p2_568) __extension__ ({ \56228#define vmull_high_laneq_u32(__p0_660, __p1_660, __p2_660) __extension__ ({ \
54559 uint32x4_t __s0_568 = __p0_568; \56229 uint32x4_t __s0_660 = __p0_660; \
54560 uint32x4_t __s1_568 = __p1_568; \56230 uint32x4_t __s1_660 = __p1_660; \
54561 uint64x2_t __ret_568; \56231 uint64x2_t __ret_660; \
54562 __ret_568 = vmull_u32(vget_high_u32(__s0_568), splat_laneq_u32(__s1_568, __p2_568)); \56232 __ret_660 = vmull_u32(vget_high_u32(__s0_660), splat_laneq_u32(__s1_660, __p2_660)); \
54563 __ret_568; \56233 __ret_660; \
54564})56234})
54565#else56235#else
54566#define vmull_high_laneq_u32(__p0_569, __p1_569, __p2_569) __extension__ ({ \56236#define vmull_high_laneq_u32(__p0_661, __p1_661, __p2_661) __extension__ ({ \
54567 uint32x4_t __s0_569 = __p0_569; \56237 uint32x4_t __s0_661 = __p0_661; \
54568 uint32x4_t __s1_569 = __p1_569; \56238 uint32x4_t __s1_661 = __p1_661; \
54569 uint32x4_t __rev0_569; __rev0_569 = __builtin_shufflevector(__s0_569, __s0_569, 3, 2, 1, 0); \56239 uint32x4_t __rev0_661; __rev0_661 = __builtin_shufflevector(__s0_661, __s0_661, 3, 2, 1, 0); \
54570 uint32x4_t __rev1_569; __rev1_569 = __builtin_shufflevector(__s1_569, __s1_569, 3, 2, 1, 0); \56240 uint32x4_t __rev1_661; __rev1_661 = __builtin_shufflevector(__s1_661, __s1_661, 3, 2, 1, 0); \
54571 uint64x2_t __ret_569; \56241 uint64x2_t __ret_661; \
54572 __ret_569 = __noswap_vmull_u32(__noswap_vget_high_u32(__rev0_569), __noswap_splat_laneq_u32(__rev1_569, __p2_569)); \56242 __ret_661 = __noswap_vmull_u32(__noswap_vget_high_u32(__rev0_661), __noswap_splat_laneq_u32(__rev1_661, __p2_661)); \
54573 __ret_569 = __builtin_shufflevector(__ret_569, __ret_569, 1, 0); \56243 __ret_661 = __builtin_shufflevector(__ret_661, __ret_661, 1, 0); \
54574 __ret_569; \56244 __ret_661; \
54575})56245})
54576#endif56246#endif
5457756247
54578#ifdef __LITTLE_ENDIAN__56248#ifdef __LITTLE_ENDIAN__
54579#define vmull_high_laneq_u16(__p0_570, __p1_570, __p2_570) __extension__ ({ \56249#define vmull_high_laneq_u16(__p0_662, __p1_662, __p2_662) __extension__ ({ \
54580 uint16x8_t __s0_570 = __p0_570; \56250 uint16x8_t __s0_662 = __p0_662; \
54581 uint16x8_t __s1_570 = __p1_570; \56251 uint16x8_t __s1_662 = __p1_662; \
54582 uint32x4_t __ret_570; \56252 uint32x4_t __ret_662; \
54583 __ret_570 = vmull_u16(vget_high_u16(__s0_570), splat_laneq_u16(__s1_570, __p2_570)); \56253 __ret_662 = vmull_u16(vget_high_u16(__s0_662), splat_laneq_u16(__s1_662, __p2_662)); \
54584 __ret_570; \56254 __ret_662; \
54585})56255})
54586#else56256#else
54587#define vmull_high_laneq_u16(__p0_571, __p1_571, __p2_571) __extension__ ({ \56257#define vmull_high_laneq_u16(__p0_663, __p1_663, __p2_663) __extension__ ({ \
54588 uint16x8_t __s0_571 = __p0_571; \56258 uint16x8_t __s0_663 = __p0_663; \
54589 uint16x8_t __s1_571 = __p1_571; \56259 uint16x8_t __s1_663 = __p1_663; \
54590 uint16x8_t __rev0_571; __rev0_571 = __builtin_shufflevector(__s0_571, __s0_571, 7, 6, 5, 4, 3, 2, 1, 0); \56260 uint16x8_t __rev0_663; __rev0_663 = __builtin_shufflevector(__s0_663, __s0_663, 7, 6, 5, 4, 3, 2, 1, 0); \
54591 uint16x8_t __rev1_571; __rev1_571 = __builtin_shufflevector(__s1_571, __s1_571, 7, 6, 5, 4, 3, 2, 1, 0); \56261 uint16x8_t __rev1_663; __rev1_663 = __builtin_shufflevector(__s1_663, __s1_663, 7, 6, 5, 4, 3, 2, 1, 0); \
54592 uint32x4_t __ret_571; \56262 uint32x4_t __ret_663; \
54593 __ret_571 = __noswap_vmull_u16(__noswap_vget_high_u16(__rev0_571), __noswap_splat_laneq_u16(__rev1_571, __p2_571)); \56263 __ret_663 = __noswap_vmull_u16(__noswap_vget_high_u16(__rev0_663), __noswap_splat_laneq_u16(__rev1_663, __p2_663)); \
54594 __ret_571 = __builtin_shufflevector(__ret_571, __ret_571, 3, 2, 1, 0); \56264 __ret_663 = __builtin_shufflevector(__ret_663, __ret_663, 3, 2, 1, 0); \
54595 __ret_571; \56265 __ret_663; \
54596})56266})
54597#endif56267#endif
5459856268
54599#ifdef __LITTLE_ENDIAN__56269#ifdef __LITTLE_ENDIAN__
54600#define vmull_high_laneq_s32(__p0_572, __p1_572, __p2_572) __extension__ ({ \56270#define vmull_high_laneq_s32(__p0_664, __p1_664, __p2_664) __extension__ ({ \
54601 int32x4_t __s0_572 = __p0_572; \56271 int32x4_t __s0_664 = __p0_664; \
54602 int32x4_t __s1_572 = __p1_572; \56272 int32x4_t __s1_664 = __p1_664; \
54603 int64x2_t __ret_572; \56273 int64x2_t __ret_664; \
54604 __ret_572 = vmull_s32(vget_high_s32(__s0_572), splat_laneq_s32(__s1_572, __p2_572)); \56274 __ret_664 = vmull_s32(vget_high_s32(__s0_664), splat_laneq_s32(__s1_664, __p2_664)); \
54605 __ret_572; \56275 __ret_664; \
54606})56276})
54607#else56277#else
54608#define vmull_high_laneq_s32(__p0_573, __p1_573, __p2_573) __extension__ ({ \56278#define vmull_high_laneq_s32(__p0_665, __p1_665, __p2_665) __extension__ ({ \
54609 int32x4_t __s0_573 = __p0_573; \56279 int32x4_t __s0_665 = __p0_665; \
54610 int32x4_t __s1_573 = __p1_573; \56280 int32x4_t __s1_665 = __p1_665; \
54611 int32x4_t __rev0_573; __rev0_573 = __builtin_shufflevector(__s0_573, __s0_573, 3, 2, 1, 0); \56281 int32x4_t __rev0_665; __rev0_665 = __builtin_shufflevector(__s0_665, __s0_665, 3, 2, 1, 0); \
54612 int32x4_t __rev1_573; __rev1_573 = __builtin_shufflevector(__s1_573, __s1_573, 3, 2, 1, 0); \56282 int32x4_t __rev1_665; __rev1_665 = __builtin_shufflevector(__s1_665, __s1_665, 3, 2, 1, 0); \
54613 int64x2_t __ret_573; \56283 int64x2_t __ret_665; \
54614 __ret_573 = __noswap_vmull_s32(__noswap_vget_high_s32(__rev0_573), __noswap_splat_laneq_s32(__rev1_573, __p2_573)); \56284 __ret_665 = __noswap_vmull_s32(__noswap_vget_high_s32(__rev0_665), __noswap_splat_laneq_s32(__rev1_665, __p2_665)); \
54615 __ret_573 = __builtin_shufflevector(__ret_573, __ret_573, 1, 0); \56285 __ret_665 = __builtin_shufflevector(__ret_665, __ret_665, 1, 0); \
54616 __ret_573; \56286 __ret_665; \
54617})56287})
54618#endif56288#endif
5461956289
54620#ifdef __LITTLE_ENDIAN__56290#ifdef __LITTLE_ENDIAN__
54621#define vmull_high_laneq_s16(__p0_574, __p1_574, __p2_574) __extension__ ({ \56291#define vmull_high_laneq_s16(__p0_666, __p1_666, __p2_666) __extension__ ({ \
54622 int16x8_t __s0_574 = __p0_574; \56292 int16x8_t __s0_666 = __p0_666; \
54623 int16x8_t __s1_574 = __p1_574; \56293 int16x8_t __s1_666 = __p1_666; \
54624 int32x4_t __ret_574; \56294 int32x4_t __ret_666; \
54625 __ret_574 = vmull_s16(vget_high_s16(__s0_574), splat_laneq_s16(__s1_574, __p2_574)); \56295 __ret_666 = vmull_s16(vget_high_s16(__s0_666), splat_laneq_s16(__s1_666, __p2_666)); \
54626 __ret_574; \56296 __ret_666; \
54627})56297})
54628#else56298#else
54629#define vmull_high_laneq_s16(__p0_575, __p1_575, __p2_575) __extension__ ({ \56299#define vmull_high_laneq_s16(__p0_667, __p1_667, __p2_667) __extension__ ({ \
54630 int16x8_t __s0_575 = __p0_575; \56300 int16x8_t __s0_667 = __p0_667; \
54631 int16x8_t __s1_575 = __p1_575; \56301 int16x8_t __s1_667 = __p1_667; \
54632 int16x8_t __rev0_575; __rev0_575 = __builtin_shufflevector(__s0_575, __s0_575, 7, 6, 5, 4, 3, 2, 1, 0); \56302 int16x8_t __rev0_667; __rev0_667 = __builtin_shufflevector(__s0_667, __s0_667, 7, 6, 5, 4, 3, 2, 1, 0); \
54633 int16x8_t __rev1_575; __rev1_575 = __builtin_shufflevector(__s1_575, __s1_575, 7, 6, 5, 4, 3, 2, 1, 0); \56303 int16x8_t __rev1_667; __rev1_667 = __builtin_shufflevector(__s1_667, __s1_667, 7, 6, 5, 4, 3, 2, 1, 0); \
54634 int32x4_t __ret_575; \56304 int32x4_t __ret_667; \
54635 __ret_575 = __noswap_vmull_s16(__noswap_vget_high_s16(__rev0_575), __noswap_splat_laneq_s16(__rev1_575, __p2_575)); \56305 __ret_667 = __noswap_vmull_s16(__noswap_vget_high_s16(__rev0_667), __noswap_splat_laneq_s16(__rev1_667, __p2_667)); \
54636 __ret_575 = __builtin_shufflevector(__ret_575, __ret_575, 3, 2, 1, 0); \56306 __ret_667 = __builtin_shufflevector(__ret_667, __ret_667, 3, 2, 1, 0); \
54637 __ret_575; \56307 __ret_667; \
54638})56308})
54639#endif56309#endif
5464056310
...@@ -54703,86 +56373,86 @@ __ai int32x4_t vmull_high_n_s16(int16x8_t __p0, int16_t __p1) {...@@ -54703,86 +56373,86 @@ __ai int32x4_t vmull_high_n_s16(int16x8_t __p0, int16_t __p1) {
54703#endif56373#endif
5470456374
54705#ifdef __LITTLE_ENDIAN__56375#ifdef __LITTLE_ENDIAN__
54706#define vmull_laneq_u32(__p0_576, __p1_576, __p2_576) __extension__ ({ \56376#define vmull_laneq_u32(__p0_668, __p1_668, __p2_668) __extension__ ({ \
54707 uint32x2_t __s0_576 = __p0_576; \56377 uint32x2_t __s0_668 = __p0_668; \
54708 uint32x4_t __s1_576 = __p1_576; \56378 uint32x4_t __s1_668 = __p1_668; \
54709 uint64x2_t __ret_576; \56379 uint64x2_t __ret_668; \
54710 __ret_576 = vmull_u32(__s0_576, splat_laneq_u32(__s1_576, __p2_576)); \56380 __ret_668 = vmull_u32(__s0_668, splat_laneq_u32(__s1_668, __p2_668)); \
54711 __ret_576; \56381 __ret_668; \
54712})56382})
54713#else56383#else
54714#define vmull_laneq_u32(__p0_577, __p1_577, __p2_577) __extension__ ({ \56384#define vmull_laneq_u32(__p0_669, __p1_669, __p2_669) __extension__ ({ \
54715 uint32x2_t __s0_577 = __p0_577; \56385 uint32x2_t __s0_669 = __p0_669; \
54716 uint32x4_t __s1_577 = __p1_577; \56386 uint32x4_t __s1_669 = __p1_669; \
54717 uint32x2_t __rev0_577; __rev0_577 = __builtin_shufflevector(__s0_577, __s0_577, 1, 0); \56387 uint32x2_t __rev0_669; __rev0_669 = __builtin_shufflevector(__s0_669, __s0_669, 1, 0); \
54718 uint32x4_t __rev1_577; __rev1_577 = __builtin_shufflevector(__s1_577, __s1_577, 3, 2, 1, 0); \56388 uint32x4_t __rev1_669; __rev1_669 = __builtin_shufflevector(__s1_669, __s1_669, 3, 2, 1, 0); \
54719 uint64x2_t __ret_577; \56389 uint64x2_t __ret_669; \
54720 __ret_577 = __noswap_vmull_u32(__rev0_577, __noswap_splat_laneq_u32(__rev1_577, __p2_577)); \56390 __ret_669 = __noswap_vmull_u32(__rev0_669, __noswap_splat_laneq_u32(__rev1_669, __p2_669)); \
54721 __ret_577 = __builtin_shufflevector(__ret_577, __ret_577, 1, 0); \56391 __ret_669 = __builtin_shufflevector(__ret_669, __ret_669, 1, 0); \
54722 __ret_577; \56392 __ret_669; \
54723})56393})
54724#endif56394#endif
5472556395
54726#ifdef __LITTLE_ENDIAN__56396#ifdef __LITTLE_ENDIAN__
54727#define vmull_laneq_u16(__p0_578, __p1_578, __p2_578) __extension__ ({ \56397#define vmull_laneq_u16(__p0_670, __p1_670, __p2_670) __extension__ ({ \
54728 uint16x4_t __s0_578 = __p0_578; \56398 uint16x4_t __s0_670 = __p0_670; \
54729 uint16x8_t __s1_578 = __p1_578; \56399 uint16x8_t __s1_670 = __p1_670; \
54730 uint32x4_t __ret_578; \56400 uint32x4_t __ret_670; \
54731 __ret_578 = vmull_u16(__s0_578, splat_laneq_u16(__s1_578, __p2_578)); \56401 __ret_670 = vmull_u16(__s0_670, splat_laneq_u16(__s1_670, __p2_670)); \
54732 __ret_578; \56402 __ret_670; \
54733})56403})
54734#else56404#else
54735#define vmull_laneq_u16(__p0_579, __p1_579, __p2_579) __extension__ ({ \56405#define vmull_laneq_u16(__p0_671, __p1_671, __p2_671) __extension__ ({ \
54736 uint16x4_t __s0_579 = __p0_579; \56406 uint16x4_t __s0_671 = __p0_671; \
54737 uint16x8_t __s1_579 = __p1_579; \56407 uint16x8_t __s1_671 = __p1_671; \
54738 uint16x4_t __rev0_579; __rev0_579 = __builtin_shufflevector(__s0_579, __s0_579, 3, 2, 1, 0); \56408 uint16x4_t __rev0_671; __rev0_671 = __builtin_shufflevector(__s0_671, __s0_671, 3, 2, 1, 0); \
54739 uint16x8_t __rev1_579; __rev1_579 = __builtin_shufflevector(__s1_579, __s1_579, 7, 6, 5, 4, 3, 2, 1, 0); \56409 uint16x8_t __rev1_671; __rev1_671 = __builtin_shufflevector(__s1_671, __s1_671, 7, 6, 5, 4, 3, 2, 1, 0); \
54740 uint32x4_t __ret_579; \56410 uint32x4_t __ret_671; \
54741 __ret_579 = __noswap_vmull_u16(__rev0_579, __noswap_splat_laneq_u16(__rev1_579, __p2_579)); \56411 __ret_671 = __noswap_vmull_u16(__rev0_671, __noswap_splat_laneq_u16(__rev1_671, __p2_671)); \
54742 __ret_579 = __builtin_shufflevector(__ret_579, __ret_579, 3, 2, 1, 0); \56412 __ret_671 = __builtin_shufflevector(__ret_671, __ret_671, 3, 2, 1, 0); \
54743 __ret_579; \56413 __ret_671; \
54744})56414})
54745#endif56415#endif
5474656416
54747#ifdef __LITTLE_ENDIAN__56417#ifdef __LITTLE_ENDIAN__
54748#define vmull_laneq_s32(__p0_580, __p1_580, __p2_580) __extension__ ({ \56418#define vmull_laneq_s32(__p0_672, __p1_672, __p2_672) __extension__ ({ \
54749 int32x2_t __s0_580 = __p0_580; \56419 int32x2_t __s0_672 = __p0_672; \
54750 int32x4_t __s1_580 = __p1_580; \56420 int32x4_t __s1_672 = __p1_672; \
54751 int64x2_t __ret_580; \56421 int64x2_t __ret_672; \
54752 __ret_580 = vmull_s32(__s0_580, splat_laneq_s32(__s1_580, __p2_580)); \56422 __ret_672 = vmull_s32(__s0_672, splat_laneq_s32(__s1_672, __p2_672)); \
54753 __ret_580; \56423 __ret_672; \
54754})56424})
54755#else56425#else
54756#define vmull_laneq_s32(__p0_581, __p1_581, __p2_581) __extension__ ({ \56426#define vmull_laneq_s32(__p0_673, __p1_673, __p2_673) __extension__ ({ \
54757 int32x2_t __s0_581 = __p0_581; \56427 int32x2_t __s0_673 = __p0_673; \
54758 int32x4_t __s1_581 = __p1_581; \56428 int32x4_t __s1_673 = __p1_673; \
54759 int32x2_t __rev0_581; __rev0_581 = __builtin_shufflevector(__s0_581, __s0_581, 1, 0); \56429 int32x2_t __rev0_673; __rev0_673 = __builtin_shufflevector(__s0_673, __s0_673, 1, 0); \
54760 int32x4_t __rev1_581; __rev1_581 = __builtin_shufflevector(__s1_581, __s1_581, 3, 2, 1, 0); \56430 int32x4_t __rev1_673; __rev1_673 = __builtin_shufflevector(__s1_673, __s1_673, 3, 2, 1, 0); \
54761 int64x2_t __ret_581; \56431 int64x2_t __ret_673; \
54762 __ret_581 = __noswap_vmull_s32(__rev0_581, __noswap_splat_laneq_s32(__rev1_581, __p2_581)); \56432 __ret_673 = __noswap_vmull_s32(__rev0_673, __noswap_splat_laneq_s32(__rev1_673, __p2_673)); \
54763 __ret_581 = __builtin_shufflevector(__ret_581, __ret_581, 1, 0); \56433 __ret_673 = __builtin_shufflevector(__ret_673, __ret_673, 1, 0); \
54764 __ret_581; \56434 __ret_673; \
54765})56435})
54766#endif56436#endif
5476756437
54768#ifdef __LITTLE_ENDIAN__56438#ifdef __LITTLE_ENDIAN__
54769#define vmull_laneq_s16(__p0_582, __p1_582, __p2_582) __extension__ ({ \56439#define vmull_laneq_s16(__p0_674, __p1_674, __p2_674) __extension__ ({ \
54770 int16x4_t __s0_582 = __p0_582; \56440 int16x4_t __s0_674 = __p0_674; \
54771 int16x8_t __s1_582 = __p1_582; \56441 int16x8_t __s1_674 = __p1_674; \
54772 int32x4_t __ret_582; \56442 int32x4_t __ret_674; \
54773 __ret_582 = vmull_s16(__s0_582, splat_laneq_s16(__s1_582, __p2_582)); \56443 __ret_674 = vmull_s16(__s0_674, splat_laneq_s16(__s1_674, __p2_674)); \
54774 __ret_582; \56444 __ret_674; \
54775})56445})
54776#else56446#else
54777#define vmull_laneq_s16(__p0_583, __p1_583, __p2_583) __extension__ ({ \56447#define vmull_laneq_s16(__p0_675, __p1_675, __p2_675) __extension__ ({ \
54778 int16x4_t __s0_583 = __p0_583; \56448 int16x4_t __s0_675 = __p0_675; \
54779 int16x8_t __s1_583 = __p1_583; \56449 int16x8_t __s1_675 = __p1_675; \
54780 int16x4_t __rev0_583; __rev0_583 = __builtin_shufflevector(__s0_583, __s0_583, 3, 2, 1, 0); \56450 int16x4_t __rev0_675; __rev0_675 = __builtin_shufflevector(__s0_675, __s0_675, 3, 2, 1, 0); \
54781 int16x8_t __rev1_583; __rev1_583 = __builtin_shufflevector(__s1_583, __s1_583, 7, 6, 5, 4, 3, 2, 1, 0); \56451 int16x8_t __rev1_675; __rev1_675 = __builtin_shufflevector(__s1_675, __s1_675, 7, 6, 5, 4, 3, 2, 1, 0); \
54782 int32x4_t __ret_583; \56452 int32x4_t __ret_675; \
54783 __ret_583 = __noswap_vmull_s16(__rev0_583, __noswap_splat_laneq_s16(__rev1_583, __p2_583)); \56453 __ret_675 = __noswap_vmull_s16(__rev0_675, __noswap_splat_laneq_s16(__rev1_675, __p2_675)); \
54784 __ret_583 = __builtin_shufflevector(__ret_583, __ret_583, 3, 2, 1, 0); \56454 __ret_675 = __builtin_shufflevector(__ret_675, __ret_675, 3, 2, 1, 0); \
54785 __ret_583; \56455 __ret_675; \
54786})56456})
54787#endif56457#endif
5478856458
...@@ -54867,192 +56537,192 @@ __ai float32_t vmulxs_f32(float32_t __p0, float32_t __p1) {...@@ -54867,192 +56537,192 @@ __ai float32_t vmulxs_f32(float32_t __p0, float32_t __p1) {
54867 __ret = (float32_t) __builtin_neon_vmulxs_f32(__p0, __p1);56537 __ret = (float32_t) __builtin_neon_vmulxs_f32(__p0, __p1);
54868 return __ret;56538 return __ret;
54869}56539}
54870#define vmulxd_lane_f64(__p0_584, __p1_584, __p2_584) __extension__ ({ \56540#define vmulxd_lane_f64(__p0_676, __p1_676, __p2_676) __extension__ ({ \
54871 float64_t __s0_584 = __p0_584; \56541 float64_t __s0_676 = __p0_676; \
54872 float64x1_t __s1_584 = __p1_584; \56542 float64x1_t __s1_676 = __p1_676; \
54873 float64_t __ret_584; \56543 float64_t __ret_676; \
54874 __ret_584 = vmulxd_f64(__s0_584, vget_lane_f64(__s1_584, __p2_584)); \56544 __ret_676 = vmulxd_f64(__s0_676, vget_lane_f64(__s1_676, __p2_676)); \
54875 __ret_584; \56545 __ret_676; \
54876})56546})
54877#ifdef __LITTLE_ENDIAN__56547#ifdef __LITTLE_ENDIAN__
54878#define vmulxs_lane_f32(__p0_585, __p1_585, __p2_585) __extension__ ({ \56548#define vmulxs_lane_f32(__p0_677, __p1_677, __p2_677) __extension__ ({ \
54879 float32_t __s0_585 = __p0_585; \56549 float32_t __s0_677 = __p0_677; \
54880 float32x2_t __s1_585 = __p1_585; \56550 float32x2_t __s1_677 = __p1_677; \
54881 float32_t __ret_585; \56551 float32_t __ret_677; \
54882 __ret_585 = vmulxs_f32(__s0_585, vget_lane_f32(__s1_585, __p2_585)); \56552 __ret_677 = vmulxs_f32(__s0_677, vget_lane_f32(__s1_677, __p2_677)); \
54883 __ret_585; \56553 __ret_677; \
54884})56554})
54885#else56555#else
54886#define vmulxs_lane_f32(__p0_586, __p1_586, __p2_586) __extension__ ({ \56556#define vmulxs_lane_f32(__p0_678, __p1_678, __p2_678) __extension__ ({ \
54887 float32_t __s0_586 = __p0_586; \56557 float32_t __s0_678 = __p0_678; \
54888 float32x2_t __s1_586 = __p1_586; \56558 float32x2_t __s1_678 = __p1_678; \
54889 float32x2_t __rev1_586; __rev1_586 = __builtin_shufflevector(__s1_586, __s1_586, 1, 0); \56559 float32x2_t __rev1_678; __rev1_678 = __builtin_shufflevector(__s1_678, __s1_678, 1, 0); \
54890 float32_t __ret_586; \56560 float32_t __ret_678; \
54891 __ret_586 = vmulxs_f32(__s0_586, __noswap_vget_lane_f32(__rev1_586, __p2_586)); \56561 __ret_678 = vmulxs_f32(__s0_678, __noswap_vget_lane_f32(__rev1_678, __p2_678)); \
54892 __ret_586; \56562 __ret_678; \
54893})56563})
54894#endif56564#endif
5489556565
54896#ifdef __LITTLE_ENDIAN__56566#ifdef __LITTLE_ENDIAN__
54897#define vmulxq_lane_f64(__p0_587, __p1_587, __p2_587) __extension__ ({ \56567#define vmulxq_lane_f64(__p0_679, __p1_679, __p2_679) __extension__ ({ \
54898 float64x2_t __s0_587 = __p0_587; \56568 float64x2_t __s0_679 = __p0_679; \
54899 float64x1_t __s1_587 = __p1_587; \56569 float64x1_t __s1_679 = __p1_679; \
54900 float64x2_t __ret_587; \56570 float64x2_t __ret_679; \
54901 __ret_587 = vmulxq_f64(__s0_587, splatq_lane_f64(__s1_587, __p2_587)); \56571 __ret_679 = vmulxq_f64(__s0_679, splatq_lane_f64(__s1_679, __p2_679)); \
54902 __ret_587; \56572 __ret_679; \
54903})56573})
54904#else56574#else
54905#define vmulxq_lane_f64(__p0_588, __p1_588, __p2_588) __extension__ ({ \56575#define vmulxq_lane_f64(__p0_680, __p1_680, __p2_680) __extension__ ({ \
54906 float64x2_t __s0_588 = __p0_588; \56576 float64x2_t __s0_680 = __p0_680; \
54907 float64x1_t __s1_588 = __p1_588; \56577 float64x1_t __s1_680 = __p1_680; \
54908 float64x2_t __rev0_588; __rev0_588 = __builtin_shufflevector(__s0_588, __s0_588, 1, 0); \56578 float64x2_t __rev0_680; __rev0_680 = __builtin_shufflevector(__s0_680, __s0_680, 1, 0); \
54909 float64x2_t __ret_588; \56579 float64x2_t __ret_680; \
54910 __ret_588 = __noswap_vmulxq_f64(__rev0_588, __noswap_splatq_lane_f64(__s1_588, __p2_588)); \56580 __ret_680 = __noswap_vmulxq_f64(__rev0_680, __noswap_splatq_lane_f64(__s1_680, __p2_680)); \
54911 __ret_588 = __builtin_shufflevector(__ret_588, __ret_588, 1, 0); \56581 __ret_680 = __builtin_shufflevector(__ret_680, __ret_680, 1, 0); \
54912 __ret_588; \56582 __ret_680; \
54913})56583})
54914#endif56584#endif
5491556585
54916#ifdef __LITTLE_ENDIAN__56586#ifdef __LITTLE_ENDIAN__
54917#define vmulxq_lane_f32(__p0_589, __p1_589, __p2_589) __extension__ ({ \56587#define vmulxq_lane_f32(__p0_681, __p1_681, __p2_681) __extension__ ({ \
54918 float32x4_t __s0_589 = __p0_589; \56588 float32x4_t __s0_681 = __p0_681; \
54919 float32x2_t __s1_589 = __p1_589; \56589 float32x2_t __s1_681 = __p1_681; \
54920 float32x4_t __ret_589; \56590 float32x4_t __ret_681; \
54921 __ret_589 = vmulxq_f32(__s0_589, splatq_lane_f32(__s1_589, __p2_589)); \56591 __ret_681 = vmulxq_f32(__s0_681, splatq_lane_f32(__s1_681, __p2_681)); \
54922 __ret_589; \56592 __ret_681; \
54923})56593})
54924#else56594#else
54925#define vmulxq_lane_f32(__p0_590, __p1_590, __p2_590) __extension__ ({ \56595#define vmulxq_lane_f32(__p0_682, __p1_682, __p2_682) __extension__ ({ \
54926 float32x4_t __s0_590 = __p0_590; \56596 float32x4_t __s0_682 = __p0_682; \
54927 float32x2_t __s1_590 = __p1_590; \56597 float32x2_t __s1_682 = __p1_682; \
54928 float32x4_t __rev0_590; __rev0_590 = __builtin_shufflevector(__s0_590, __s0_590, 3, 2, 1, 0); \56598 float32x4_t __rev0_682; __rev0_682 = __builtin_shufflevector(__s0_682, __s0_682, 3, 2, 1, 0); \
54929 float32x2_t __rev1_590; __rev1_590 = __builtin_shufflevector(__s1_590, __s1_590, 1, 0); \56599 float32x2_t __rev1_682; __rev1_682 = __builtin_shufflevector(__s1_682, __s1_682, 1, 0); \
54930 float32x4_t __ret_590; \56600 float32x4_t __ret_682; \
54931 __ret_590 = __noswap_vmulxq_f32(__rev0_590, __noswap_splatq_lane_f32(__rev1_590, __p2_590)); \56601 __ret_682 = __noswap_vmulxq_f32(__rev0_682, __noswap_splatq_lane_f32(__rev1_682, __p2_682)); \
54932 __ret_590 = __builtin_shufflevector(__ret_590, __ret_590, 3, 2, 1, 0); \56602 __ret_682 = __builtin_shufflevector(__ret_682, __ret_682, 3, 2, 1, 0); \
54933 __ret_590; \56603 __ret_682; \
54934})56604})
54935#endif56605#endif
5493656606
54937#ifdef __LITTLE_ENDIAN__56607#ifdef __LITTLE_ENDIAN__
54938#define vmulx_lane_f32(__p0_591, __p1_591, __p2_591) __extension__ ({ \56608#define vmulx_lane_f32(__p0_683, __p1_683, __p2_683) __extension__ ({ \
54939 float32x2_t __s0_591 = __p0_591; \56609 float32x2_t __s0_683 = __p0_683; \
54940 float32x2_t __s1_591 = __p1_591; \56610 float32x2_t __s1_683 = __p1_683; \
54941 float32x2_t __ret_591; \56611 float32x2_t __ret_683; \
54942 __ret_591 = vmulx_f32(__s0_591, splat_lane_f32(__s1_591, __p2_591)); \56612 __ret_683 = vmulx_f32(__s0_683, splat_lane_f32(__s1_683, __p2_683)); \
54943 __ret_591; \56613 __ret_683; \
54944})56614})
54945#else56615#else
54946#define vmulx_lane_f32(__p0_592, __p1_592, __p2_592) __extension__ ({ \56616#define vmulx_lane_f32(__p0_684, __p1_684, __p2_684) __extension__ ({ \
54947 float32x2_t __s0_592 = __p0_592; \56617 float32x2_t __s0_684 = __p0_684; \
54948 float32x2_t __s1_592 = __p1_592; \56618 float32x2_t __s1_684 = __p1_684; \
54949 float32x2_t __rev0_592; __rev0_592 = __builtin_shufflevector(__s0_592, __s0_592, 1, 0); \56619 float32x2_t __rev0_684; __rev0_684 = __builtin_shufflevector(__s0_684, __s0_684, 1, 0); \
54950 float32x2_t __rev1_592; __rev1_592 = __builtin_shufflevector(__s1_592, __s1_592, 1, 0); \56620 float32x2_t __rev1_684; __rev1_684 = __builtin_shufflevector(__s1_684, __s1_684, 1, 0); \
54951 float32x2_t __ret_592; \56621 float32x2_t __ret_684; \
54952 __ret_592 = __noswap_vmulx_f32(__rev0_592, __noswap_splat_lane_f32(__rev1_592, __p2_592)); \56622 __ret_684 = __noswap_vmulx_f32(__rev0_684, __noswap_splat_lane_f32(__rev1_684, __p2_684)); \
54953 __ret_592 = __builtin_shufflevector(__ret_592, __ret_592, 1, 0); \56623 __ret_684 = __builtin_shufflevector(__ret_684, __ret_684, 1, 0); \
54954 __ret_592; \56624 __ret_684; \
54955})56625})
54956#endif56626#endif
5495756627
54958#ifdef __LITTLE_ENDIAN__56628#ifdef __LITTLE_ENDIAN__
54959#define vmulxd_laneq_f64(__p0_593, __p1_593, __p2_593) __extension__ ({ \56629#define vmulxd_laneq_f64(__p0_685, __p1_685, __p2_685) __extension__ ({ \
54960 float64_t __s0_593 = __p0_593; \56630 float64_t __s0_685 = __p0_685; \
54961 float64x2_t __s1_593 = __p1_593; \56631 float64x2_t __s1_685 = __p1_685; \
54962 float64_t __ret_593; \56632 float64_t __ret_685; \
54963 __ret_593 = vmulxd_f64(__s0_593, vgetq_lane_f64(__s1_593, __p2_593)); \56633 __ret_685 = vmulxd_f64(__s0_685, vgetq_lane_f64(__s1_685, __p2_685)); \
54964 __ret_593; \56634 __ret_685; \
54965})56635})
54966#else56636#else
54967#define vmulxd_laneq_f64(__p0_594, __p1_594, __p2_594) __extension__ ({ \56637#define vmulxd_laneq_f64(__p0_686, __p1_686, __p2_686) __extension__ ({ \
54968 float64_t __s0_594 = __p0_594; \56638 float64_t __s0_686 = __p0_686; \
54969 float64x2_t __s1_594 = __p1_594; \56639 float64x2_t __s1_686 = __p1_686; \
54970 float64x2_t __rev1_594; __rev1_594 = __builtin_shufflevector(__s1_594, __s1_594, 1, 0); \56640 float64x2_t __rev1_686; __rev1_686 = __builtin_shufflevector(__s1_686, __s1_686, 1, 0); \
54971 float64_t __ret_594; \56641 float64_t __ret_686; \
54972 __ret_594 = vmulxd_f64(__s0_594, __noswap_vgetq_lane_f64(__rev1_594, __p2_594)); \56642 __ret_686 = vmulxd_f64(__s0_686, __noswap_vgetq_lane_f64(__rev1_686, __p2_686)); \
54973 __ret_594; \56643 __ret_686; \
54974})56644})
54975#endif56645#endif
5497656646
54977#ifdef __LITTLE_ENDIAN__56647#ifdef __LITTLE_ENDIAN__
54978#define vmulxs_laneq_f32(__p0_595, __p1_595, __p2_595) __extension__ ({ \56648#define vmulxs_laneq_f32(__p0_687, __p1_687, __p2_687) __extension__ ({ \
54979 float32_t __s0_595 = __p0_595; \56649 float32_t __s0_687 = __p0_687; \
54980 float32x4_t __s1_595 = __p1_595; \56650 float32x4_t __s1_687 = __p1_687; \
54981 float32_t __ret_595; \56651 float32_t __ret_687; \
54982 __ret_595 = vmulxs_f32(__s0_595, vgetq_lane_f32(__s1_595, __p2_595)); \56652 __ret_687 = vmulxs_f32(__s0_687, vgetq_lane_f32(__s1_687, __p2_687)); \
54983 __ret_595; \56653 __ret_687; \
54984})56654})
54985#else56655#else
54986#define vmulxs_laneq_f32(__p0_596, __p1_596, __p2_596) __extension__ ({ \56656#define vmulxs_laneq_f32(__p0_688, __p1_688, __p2_688) __extension__ ({ \
54987 float32_t __s0_596 = __p0_596; \56657 float32_t __s0_688 = __p0_688; \
54988 float32x4_t __s1_596 = __p1_596; \56658 float32x4_t __s1_688 = __p1_688; \
54989 float32x4_t __rev1_596; __rev1_596 = __builtin_shufflevector(__s1_596, __s1_596, 3, 2, 1, 0); \56659 float32x4_t __rev1_688; __rev1_688 = __builtin_shufflevector(__s1_688, __s1_688, 3, 2, 1, 0); \
54990 float32_t __ret_596; \56660 float32_t __ret_688; \
54991 __ret_596 = vmulxs_f32(__s0_596, __noswap_vgetq_lane_f32(__rev1_596, __p2_596)); \56661 __ret_688 = vmulxs_f32(__s0_688, __noswap_vgetq_lane_f32(__rev1_688, __p2_688)); \
54992 __ret_596; \56662 __ret_688; \
54993})56663})
54994#endif56664#endif
5499556665
54996#ifdef __LITTLE_ENDIAN__56666#ifdef __LITTLE_ENDIAN__
54997#define vmulxq_laneq_f64(__p0_597, __p1_597, __p2_597) __extension__ ({ \56667#define vmulxq_laneq_f64(__p0_689, __p1_689, __p2_689) __extension__ ({ \
54998 float64x2_t __s0_597 = __p0_597; \56668 float64x2_t __s0_689 = __p0_689; \
54999 float64x2_t __s1_597 = __p1_597; \56669 float64x2_t __s1_689 = __p1_689; \
55000 float64x2_t __ret_597; \56670 float64x2_t __ret_689; \
55001 __ret_597 = vmulxq_f64(__s0_597, splatq_laneq_f64(__s1_597, __p2_597)); \56671 __ret_689 = vmulxq_f64(__s0_689, splatq_laneq_f64(__s1_689, __p2_689)); \
55002 __ret_597; \56672 __ret_689; \
55003})56673})
55004#else56674#else
55005#define vmulxq_laneq_f64(__p0_598, __p1_598, __p2_598) __extension__ ({ \56675#define vmulxq_laneq_f64(__p0_690, __p1_690, __p2_690) __extension__ ({ \
55006 float64x2_t __s0_598 = __p0_598; \56676 float64x2_t __s0_690 = __p0_690; \
55007 float64x2_t __s1_598 = __p1_598; \56677 float64x2_t __s1_690 = __p1_690; \
55008 float64x2_t __rev0_598; __rev0_598 = __builtin_shufflevector(__s0_598, __s0_598, 1, 0); \56678 float64x2_t __rev0_690; __rev0_690 = __builtin_shufflevector(__s0_690, __s0_690, 1, 0); \
55009 float64x2_t __rev1_598; __rev1_598 = __builtin_shufflevector(__s1_598, __s1_598, 1, 0); \56679 float64x2_t __rev1_690; __rev1_690 = __builtin_shufflevector(__s1_690, __s1_690, 1, 0); \
55010 float64x2_t __ret_598; \56680 float64x2_t __ret_690; \
55011 __ret_598 = __noswap_vmulxq_f64(__rev0_598, __noswap_splatq_laneq_f64(__rev1_598, __p2_598)); \56681 __ret_690 = __noswap_vmulxq_f64(__rev0_690, __noswap_splatq_laneq_f64(__rev1_690, __p2_690)); \
55012 __ret_598 = __builtin_shufflevector(__ret_598, __ret_598, 1, 0); \56682 __ret_690 = __builtin_shufflevector(__ret_690, __ret_690, 1, 0); \
55013 __ret_598; \56683 __ret_690; \
55014})56684})
55015#endif56685#endif
5501656686
55017#ifdef __LITTLE_ENDIAN__56687#ifdef __LITTLE_ENDIAN__
55018#define vmulxq_laneq_f32(__p0_599, __p1_599, __p2_599) __extension__ ({ \56688#define vmulxq_laneq_f32(__p0_691, __p1_691, __p2_691) __extension__ ({ \
55019 float32x4_t __s0_599 = __p0_599; \56689 float32x4_t __s0_691 = __p0_691; \
55020 float32x4_t __s1_599 = __p1_599; \56690 float32x4_t __s1_691 = __p1_691; \
55021 float32x4_t __ret_599; \56691 float32x4_t __ret_691; \
55022 __ret_599 = vmulxq_f32(__s0_599, splatq_laneq_f32(__s1_599, __p2_599)); \56692 __ret_691 = vmulxq_f32(__s0_691, splatq_laneq_f32(__s1_691, __p2_691)); \
55023 __ret_599; \56693 __ret_691; \
55024})56694})
55025#else56695#else
55026#define vmulxq_laneq_f32(__p0_600, __p1_600, __p2_600) __extension__ ({ \56696#define vmulxq_laneq_f32(__p0_692, __p1_692, __p2_692) __extension__ ({ \
55027 float32x4_t __s0_600 = __p0_600; \56697 float32x4_t __s0_692 = __p0_692; \
55028 float32x4_t __s1_600 = __p1_600; \56698 float32x4_t __s1_692 = __p1_692; \
55029 float32x4_t __rev0_600; __rev0_600 = __builtin_shufflevector(__s0_600, __s0_600, 3, 2, 1, 0); \56699 float32x4_t __rev0_692; __rev0_692 = __builtin_shufflevector(__s0_692, __s0_692, 3, 2, 1, 0); \
55030 float32x4_t __rev1_600; __rev1_600 = __builtin_shufflevector(__s1_600, __s1_600, 3, 2, 1, 0); \56700 float32x4_t __rev1_692; __rev1_692 = __builtin_shufflevector(__s1_692, __s1_692, 3, 2, 1, 0); \
55031 float32x4_t __ret_600; \56701 float32x4_t __ret_692; \
55032 __ret_600 = __noswap_vmulxq_f32(__rev0_600, __noswap_splatq_laneq_f32(__rev1_600, __p2_600)); \56702 __ret_692 = __noswap_vmulxq_f32(__rev0_692, __noswap_splatq_laneq_f32(__rev1_692, __p2_692)); \
55033 __ret_600 = __builtin_shufflevector(__ret_600, __ret_600, 3, 2, 1, 0); \56703 __ret_692 = __builtin_shufflevector(__ret_692, __ret_692, 3, 2, 1, 0); \
55034 __ret_600; \56704 __ret_692; \
55035})56705})
55036#endif56706#endif
5503756707
55038#ifdef __LITTLE_ENDIAN__56708#ifdef __LITTLE_ENDIAN__
55039#define vmulx_laneq_f32(__p0_601, __p1_601, __p2_601) __extension__ ({ \56709#define vmulx_laneq_f32(__p0_693, __p1_693, __p2_693) __extension__ ({ \
55040 float32x2_t __s0_601 = __p0_601; \56710 float32x2_t __s0_693 = __p0_693; \
55041 float32x4_t __s1_601 = __p1_601; \56711 float32x4_t __s1_693 = __p1_693; \
55042 float32x2_t __ret_601; \56712 float32x2_t __ret_693; \
55043 __ret_601 = vmulx_f32(__s0_601, splat_laneq_f32(__s1_601, __p2_601)); \56713 __ret_693 = vmulx_f32(__s0_693, splat_laneq_f32(__s1_693, __p2_693)); \
55044 __ret_601; \56714 __ret_693; \
55045})56715})
55046#else56716#else
55047#define vmulx_laneq_f32(__p0_602, __p1_602, __p2_602) __extension__ ({ \56717#define vmulx_laneq_f32(__p0_694, __p1_694, __p2_694) __extension__ ({ \
55048 float32x2_t __s0_602 = __p0_602; \56718 float32x2_t __s0_694 = __p0_694; \
55049 float32x4_t __s1_602 = __p1_602; \56719 float32x4_t __s1_694 = __p1_694; \
55050 float32x2_t __rev0_602; __rev0_602 = __builtin_shufflevector(__s0_602, __s0_602, 1, 0); \56720 float32x2_t __rev0_694; __rev0_694 = __builtin_shufflevector(__s0_694, __s0_694, 1, 0); \
55051 float32x4_t __rev1_602; __rev1_602 = __builtin_shufflevector(__s1_602, __s1_602, 3, 2, 1, 0); \56721 float32x4_t __rev1_694; __rev1_694 = __builtin_shufflevector(__s1_694, __s1_694, 3, 2, 1, 0); \
55052 float32x2_t __ret_602; \56722 float32x2_t __ret_694; \
55053 __ret_602 = __noswap_vmulx_f32(__rev0_602, __noswap_splat_laneq_f32(__rev1_602, __p2_602)); \56723 __ret_694 = __noswap_vmulx_f32(__rev0_694, __noswap_splat_laneq_f32(__rev1_694, __p2_694)); \
55054 __ret_602 = __builtin_shufflevector(__ret_602, __ret_602, 1, 0); \56724 __ret_694 = __builtin_shufflevector(__ret_694, __ret_694, 1, 0); \
55055 __ret_602; \56725 __ret_694; \
55056})56726})
55057#endif56727#endif
5505856728
...@@ -55955,98 +57625,98 @@ __ai int32x4_t vqdmlal_high_s16(int32x4_t __p0, int16x8_t __p1, int16x8_t __p2)...@@ -55955,98 +57625,98 @@ __ai int32x4_t vqdmlal_high_s16(int32x4_t __p0, int16x8_t __p1, int16x8_t __p2)
55955#endif57625#endif
5595657626
55957#ifdef __LITTLE_ENDIAN__57627#ifdef __LITTLE_ENDIAN__
55958#define vqdmlal_high_lane_s32(__p0_603, __p1_603, __p2_603, __p3_603) __extension__ ({ \57628#define vqdmlal_high_lane_s32(__p0_695, __p1_695, __p2_695, __p3_695) __extension__ ({ \
55959 int64x2_t __s0_603 = __p0_603; \57629 int64x2_t __s0_695 = __p0_695; \
55960 int32x4_t __s1_603 = __p1_603; \57630 int32x4_t __s1_695 = __p1_695; \
55961 int32x2_t __s2_603 = __p2_603; \57631 int32x2_t __s2_695 = __p2_695; \
55962 int64x2_t __ret_603; \57632 int64x2_t __ret_695; \
55963 __ret_603 = vqdmlal_s32(__s0_603, vget_high_s32(__s1_603), splat_lane_s32(__s2_603, __p3_603)); \57633 __ret_695 = vqdmlal_s32(__s0_695, vget_high_s32(__s1_695), splat_lane_s32(__s2_695, __p3_695)); \
55964 __ret_603; \57634 __ret_695; \
55965})57635})
55966#else57636#else
55967#define vqdmlal_high_lane_s32(__p0_604, __p1_604, __p2_604, __p3_604) __extension__ ({ \57637#define vqdmlal_high_lane_s32(__p0_696, __p1_696, __p2_696, __p3_696) __extension__ ({ \
55968 int64x2_t __s0_604 = __p0_604; \57638 int64x2_t __s0_696 = __p0_696; \
55969 int32x4_t __s1_604 = __p1_604; \57639 int32x4_t __s1_696 = __p1_696; \
55970 int32x2_t __s2_604 = __p2_604; \57640 int32x2_t __s2_696 = __p2_696; \
55971 int64x2_t __rev0_604; __rev0_604 = __builtin_shufflevector(__s0_604, __s0_604, 1, 0); \57641 int64x2_t __rev0_696; __rev0_696 = __builtin_shufflevector(__s0_696, __s0_696, 1, 0); \
55972 int32x4_t __rev1_604; __rev1_604 = __builtin_shufflevector(__s1_604, __s1_604, 3, 2, 1, 0); \57642 int32x4_t __rev1_696; __rev1_696 = __builtin_shufflevector(__s1_696, __s1_696, 3, 2, 1, 0); \
55973 int32x2_t __rev2_604; __rev2_604 = __builtin_shufflevector(__s2_604, __s2_604, 1, 0); \57643 int32x2_t __rev2_696; __rev2_696 = __builtin_shufflevector(__s2_696, __s2_696, 1, 0); \
55974 int64x2_t __ret_604; \57644 int64x2_t __ret_696; \
55975 __ret_604 = __noswap_vqdmlal_s32(__rev0_604, __noswap_vget_high_s32(__rev1_604), __noswap_splat_lane_s32(__rev2_604, __p3_604)); \57645 __ret_696 = __noswap_vqdmlal_s32(__rev0_696, __noswap_vget_high_s32(__rev1_696), __noswap_splat_lane_s32(__rev2_696, __p3_696)); \
55976 __ret_604 = __builtin_shufflevector(__ret_604, __ret_604, 1, 0); \57646 __ret_696 = __builtin_shufflevector(__ret_696, __ret_696, 1, 0); \
55977 __ret_604; \57647 __ret_696; \
55978})57648})
55979#endif57649#endif
5598057650
55981#ifdef __LITTLE_ENDIAN__57651#ifdef __LITTLE_ENDIAN__
55982#define vqdmlal_high_lane_s16(__p0_605, __p1_605, __p2_605, __p3_605) __extension__ ({ \57652#define vqdmlal_high_lane_s16(__p0_697, __p1_697, __p2_697, __p3_697) __extension__ ({ \
55983 int32x4_t __s0_605 = __p0_605; \57653 int32x4_t __s0_697 = __p0_697; \
55984 int16x8_t __s1_605 = __p1_605; \57654 int16x8_t __s1_697 = __p1_697; \
55985 int16x4_t __s2_605 = __p2_605; \57655 int16x4_t __s2_697 = __p2_697; \
55986 int32x4_t __ret_605; \57656 int32x4_t __ret_697; \
55987 __ret_605 = vqdmlal_s16(__s0_605, vget_high_s16(__s1_605), splat_lane_s16(__s2_605, __p3_605)); \57657 __ret_697 = vqdmlal_s16(__s0_697, vget_high_s16(__s1_697), splat_lane_s16(__s2_697, __p3_697)); \
55988 __ret_605; \57658 __ret_697; \
55989})57659})
55990#else57660#else
55991#define vqdmlal_high_lane_s16(__p0_606, __p1_606, __p2_606, __p3_606) __extension__ ({ \57661#define vqdmlal_high_lane_s16(__p0_698, __p1_698, __p2_698, __p3_698) __extension__ ({ \
55992 int32x4_t __s0_606 = __p0_606; \57662 int32x4_t __s0_698 = __p0_698; \
55993 int16x8_t __s1_606 = __p1_606; \57663 int16x8_t __s1_698 = __p1_698; \
55994 int16x4_t __s2_606 = __p2_606; \57664 int16x4_t __s2_698 = __p2_698; \
55995 int32x4_t __rev0_606; __rev0_606 = __builtin_shufflevector(__s0_606, __s0_606, 3, 2, 1, 0); \57665 int32x4_t __rev0_698; __rev0_698 = __builtin_shufflevector(__s0_698, __s0_698, 3, 2, 1, 0); \
55996 int16x8_t __rev1_606; __rev1_606 = __builtin_shufflevector(__s1_606, __s1_606, 7, 6, 5, 4, 3, 2, 1, 0); \57666 int16x8_t __rev1_698; __rev1_698 = __builtin_shufflevector(__s1_698, __s1_698, 7, 6, 5, 4, 3, 2, 1, 0); \
55997 int16x4_t __rev2_606; __rev2_606 = __builtin_shufflevector(__s2_606, __s2_606, 3, 2, 1, 0); \57667 int16x4_t __rev2_698; __rev2_698 = __builtin_shufflevector(__s2_698, __s2_698, 3, 2, 1, 0); \
55998 int32x4_t __ret_606; \57668 int32x4_t __ret_698; \
55999 __ret_606 = __noswap_vqdmlal_s16(__rev0_606, __noswap_vget_high_s16(__rev1_606), __noswap_splat_lane_s16(__rev2_606, __p3_606)); \57669 __ret_698 = __noswap_vqdmlal_s16(__rev0_698, __noswap_vget_high_s16(__rev1_698), __noswap_splat_lane_s16(__rev2_698, __p3_698)); \
56000 __ret_606 = __builtin_shufflevector(__ret_606, __ret_606, 3, 2, 1, 0); \57670 __ret_698 = __builtin_shufflevector(__ret_698, __ret_698, 3, 2, 1, 0); \
56001 __ret_606; \57671 __ret_698; \
56002})57672})
56003#endif57673#endif
5600457674
56005#ifdef __LITTLE_ENDIAN__57675#ifdef __LITTLE_ENDIAN__
56006#define vqdmlal_high_laneq_s32(__p0_607, __p1_607, __p2_607, __p3_607) __extension__ ({ \57676#define vqdmlal_high_laneq_s32(__p0_699, __p1_699, __p2_699, __p3_699) __extension__ ({ \
56007 int64x2_t __s0_607 = __p0_607; \57677 int64x2_t __s0_699 = __p0_699; \
56008 int32x4_t __s1_607 = __p1_607; \57678 int32x4_t __s1_699 = __p1_699; \
56009 int32x4_t __s2_607 = __p2_607; \57679 int32x4_t __s2_699 = __p2_699; \
56010 int64x2_t __ret_607; \57680 int64x2_t __ret_699; \
56011 __ret_607 = vqdmlal_s32(__s0_607, vget_high_s32(__s1_607), splat_laneq_s32(__s2_607, __p3_607)); \57681 __ret_699 = vqdmlal_s32(__s0_699, vget_high_s32(__s1_699), splat_laneq_s32(__s2_699, __p3_699)); \
56012 __ret_607; \57682 __ret_699; \
56013})57683})
56014#else57684#else
56015#define vqdmlal_high_laneq_s32(__p0_608, __p1_608, __p2_608, __p3_608) __extension__ ({ \57685#define vqdmlal_high_laneq_s32(__p0_700, __p1_700, __p2_700, __p3_700) __extension__ ({ \
56016 int64x2_t __s0_608 = __p0_608; \57686 int64x2_t __s0_700 = __p0_700; \
56017 int32x4_t __s1_608 = __p1_608; \57687 int32x4_t __s1_700 = __p1_700; \
56018 int32x4_t __s2_608 = __p2_608; \57688 int32x4_t __s2_700 = __p2_700; \
56019 int64x2_t __rev0_608; __rev0_608 = __builtin_shufflevector(__s0_608, __s0_608, 1, 0); \57689 int64x2_t __rev0_700; __rev0_700 = __builtin_shufflevector(__s0_700, __s0_700, 1, 0); \
56020 int32x4_t __rev1_608; __rev1_608 = __builtin_shufflevector(__s1_608, __s1_608, 3, 2, 1, 0); \57690 int32x4_t __rev1_700; __rev1_700 = __builtin_shufflevector(__s1_700, __s1_700, 3, 2, 1, 0); \
56021 int32x4_t __rev2_608; __rev2_608 = __builtin_shufflevector(__s2_608, __s2_608, 3, 2, 1, 0); \57691 int32x4_t __rev2_700; __rev2_700 = __builtin_shufflevector(__s2_700, __s2_700, 3, 2, 1, 0); \
56022 int64x2_t __ret_608; \57692 int64x2_t __ret_700; \
56023 __ret_608 = __noswap_vqdmlal_s32(__rev0_608, __noswap_vget_high_s32(__rev1_608), __noswap_splat_laneq_s32(__rev2_608, __p3_608)); \57693 __ret_700 = __noswap_vqdmlal_s32(__rev0_700, __noswap_vget_high_s32(__rev1_700), __noswap_splat_laneq_s32(__rev2_700, __p3_700)); \
56024 __ret_608 = __builtin_shufflevector(__ret_608, __ret_608, 1, 0); \57694 __ret_700 = __builtin_shufflevector(__ret_700, __ret_700, 1, 0); \
56025 __ret_608; \57695 __ret_700; \
56026})57696})
56027#endif57697#endif
5602857698
56029#ifdef __LITTLE_ENDIAN__57699#ifdef __LITTLE_ENDIAN__
56030#define vqdmlal_high_laneq_s16(__p0_609, __p1_609, __p2_609, __p3_609) __extension__ ({ \57700#define vqdmlal_high_laneq_s16(__p0_701, __p1_701, __p2_701, __p3_701) __extension__ ({ \
56031 int32x4_t __s0_609 = __p0_609; \57701 int32x4_t __s0_701 = __p0_701; \
56032 int16x8_t __s1_609 = __p1_609; \57702 int16x8_t __s1_701 = __p1_701; \
56033 int16x8_t __s2_609 = __p2_609; \57703 int16x8_t __s2_701 = __p2_701; \
56034 int32x4_t __ret_609; \57704 int32x4_t __ret_701; \
56035 __ret_609 = vqdmlal_s16(__s0_609, vget_high_s16(__s1_609), splat_laneq_s16(__s2_609, __p3_609)); \57705 __ret_701 = vqdmlal_s16(__s0_701, vget_high_s16(__s1_701), splat_laneq_s16(__s2_701, __p3_701)); \
56036 __ret_609; \57706 __ret_701; \
56037})57707})
56038#else57708#else
56039#define vqdmlal_high_laneq_s16(__p0_610, __p1_610, __p2_610, __p3_610) __extension__ ({ \57709#define vqdmlal_high_laneq_s16(__p0_702, __p1_702, __p2_702, __p3_702) __extension__ ({ \
56040 int32x4_t __s0_610 = __p0_610; \57710 int32x4_t __s0_702 = __p0_702; \
56041 int16x8_t __s1_610 = __p1_610; \57711 int16x8_t __s1_702 = __p1_702; \
56042 int16x8_t __s2_610 = __p2_610; \57712 int16x8_t __s2_702 = __p2_702; \
56043 int32x4_t __rev0_610; __rev0_610 = __builtin_shufflevector(__s0_610, __s0_610, 3, 2, 1, 0); \57713 int32x4_t __rev0_702; __rev0_702 = __builtin_shufflevector(__s0_702, __s0_702, 3, 2, 1, 0); \
56044 int16x8_t __rev1_610; __rev1_610 = __builtin_shufflevector(__s1_610, __s1_610, 7, 6, 5, 4, 3, 2, 1, 0); \57714 int16x8_t __rev1_702; __rev1_702 = __builtin_shufflevector(__s1_702, __s1_702, 7, 6, 5, 4, 3, 2, 1, 0); \
56045 int16x8_t __rev2_610; __rev2_610 = __builtin_shufflevector(__s2_610, __s2_610, 7, 6, 5, 4, 3, 2, 1, 0); \57715 int16x8_t __rev2_702; __rev2_702 = __builtin_shufflevector(__s2_702, __s2_702, 7, 6, 5, 4, 3, 2, 1, 0); \
56046 int32x4_t __ret_610; \57716 int32x4_t __ret_702; \
56047 __ret_610 = __noswap_vqdmlal_s16(__rev0_610, __noswap_vget_high_s16(__rev1_610), __noswap_splat_laneq_s16(__rev2_610, __p3_610)); \57717 __ret_702 = __noswap_vqdmlal_s16(__rev0_702, __noswap_vget_high_s16(__rev1_702), __noswap_splat_laneq_s16(__rev2_702, __p3_702)); \
56048 __ret_610 = __builtin_shufflevector(__ret_610, __ret_610, 3, 2, 1, 0); \57718 __ret_702 = __builtin_shufflevector(__ret_702, __ret_702, 3, 2, 1, 0); \
56049 __ret_610; \57719 __ret_702; \
56050})57720})
56051#endif57721#endif
5605257722
...@@ -56169,50 +57839,50 @@ __ai int32x4_t vqdmlal_high_n_s16(int32x4_t __p0, int16x8_t __p1, int16_t __p2)...@@ -56169,50 +57839,50 @@ __ai int32x4_t vqdmlal_high_n_s16(int32x4_t __p0, int16x8_t __p1, int16_t __p2)
56169#endif57839#endif
5617057840
56171#ifdef __LITTLE_ENDIAN__57841#ifdef __LITTLE_ENDIAN__
56172#define vqdmlal_laneq_s32(__p0_611, __p1_611, __p2_611, __p3_611) __extension__ ({ \57842#define vqdmlal_laneq_s32(__p0_703, __p1_703, __p2_703, __p3_703) __extension__ ({ \
56173 int64x2_t __s0_611 = __p0_611; \57843 int64x2_t __s0_703 = __p0_703; \
56174 int32x2_t __s1_611 = __p1_611; \57844 int32x2_t __s1_703 = __p1_703; \
56175 int32x4_t __s2_611 = __p2_611; \57845 int32x4_t __s2_703 = __p2_703; \
56176 int64x2_t __ret_611; \57846 int64x2_t __ret_703; \
56177 __ret_611 = vqdmlal_s32(__s0_611, __s1_611, splat_laneq_s32(__s2_611, __p3_611)); \57847 __ret_703 = vqdmlal_s32(__s0_703, __s1_703, splat_laneq_s32(__s2_703, __p3_703)); \
56178 __ret_611; \57848 __ret_703; \
56179})57849})
56180#else57850#else
56181#define vqdmlal_laneq_s32(__p0_612, __p1_612, __p2_612, __p3_612) __extension__ ({ \57851#define vqdmlal_laneq_s32(__p0_704, __p1_704, __p2_704, __p3_704) __extension__ ({ \
56182 int64x2_t __s0_612 = __p0_612; \57852 int64x2_t __s0_704 = __p0_704; \
56183 int32x2_t __s1_612 = __p1_612; \57853 int32x2_t __s1_704 = __p1_704; \
56184 int32x4_t __s2_612 = __p2_612; \57854 int32x4_t __s2_704 = __p2_704; \
56185 int64x2_t __rev0_612; __rev0_612 = __builtin_shufflevector(__s0_612, __s0_612, 1, 0); \57855 int64x2_t __rev0_704; __rev0_704 = __builtin_shufflevector(__s0_704, __s0_704, 1, 0); \
56186 int32x2_t __rev1_612; __rev1_612 = __builtin_shufflevector(__s1_612, __s1_612, 1, 0); \57856 int32x2_t __rev1_704; __rev1_704 = __builtin_shufflevector(__s1_704, __s1_704, 1, 0); \
56187 int32x4_t __rev2_612; __rev2_612 = __builtin_shufflevector(__s2_612, __s2_612, 3, 2, 1, 0); \57857 int32x4_t __rev2_704; __rev2_704 = __builtin_shufflevector(__s2_704, __s2_704, 3, 2, 1, 0); \
56188 int64x2_t __ret_612; \57858 int64x2_t __ret_704; \
56189 __ret_612 = __noswap_vqdmlal_s32(__rev0_612, __rev1_612, __noswap_splat_laneq_s32(__rev2_612, __p3_612)); \57859 __ret_704 = __noswap_vqdmlal_s32(__rev0_704, __rev1_704, __noswap_splat_laneq_s32(__rev2_704, __p3_704)); \
56190 __ret_612 = __builtin_shufflevector(__ret_612, __ret_612, 1, 0); \57860 __ret_704 = __builtin_shufflevector(__ret_704, __ret_704, 1, 0); \
56191 __ret_612; \57861 __ret_704; \
56192})57862})
56193#endif57863#endif
5619457864
56195#ifdef __LITTLE_ENDIAN__57865#ifdef __LITTLE_ENDIAN__
56196#define vqdmlal_laneq_s16(__p0_613, __p1_613, __p2_613, __p3_613) __extension__ ({ \57866#define vqdmlal_laneq_s16(__p0_705, __p1_705, __p2_705, __p3_705) __extension__ ({ \
56197 int32x4_t __s0_613 = __p0_613; \57867 int32x4_t __s0_705 = __p0_705; \
56198 int16x4_t __s1_613 = __p1_613; \57868 int16x4_t __s1_705 = __p1_705; \
56199 int16x8_t __s2_613 = __p2_613; \57869 int16x8_t __s2_705 = __p2_705; \
56200 int32x4_t __ret_613; \57870 int32x4_t __ret_705; \
56201 __ret_613 = vqdmlal_s16(__s0_613, __s1_613, splat_laneq_s16(__s2_613, __p3_613)); \57871 __ret_705 = vqdmlal_s16(__s0_705, __s1_705, splat_laneq_s16(__s2_705, __p3_705)); \
56202 __ret_613; \57872 __ret_705; \
56203})57873})
56204#else57874#else
56205#define vqdmlal_laneq_s16(__p0_614, __p1_614, __p2_614, __p3_614) __extension__ ({ \57875#define vqdmlal_laneq_s16(__p0_706, __p1_706, __p2_706, __p3_706) __extension__ ({ \
56206 int32x4_t __s0_614 = __p0_614; \57876 int32x4_t __s0_706 = __p0_706; \
56207 int16x4_t __s1_614 = __p1_614; \57877 int16x4_t __s1_706 = __p1_706; \
56208 int16x8_t __s2_614 = __p2_614; \57878 int16x8_t __s2_706 = __p2_706; \
56209 int32x4_t __rev0_614; __rev0_614 = __builtin_shufflevector(__s0_614, __s0_614, 3, 2, 1, 0); \57879 int32x4_t __rev0_706; __rev0_706 = __builtin_shufflevector(__s0_706, __s0_706, 3, 2, 1, 0); \
56210 int16x4_t __rev1_614; __rev1_614 = __builtin_shufflevector(__s1_614, __s1_614, 3, 2, 1, 0); \57880 int16x4_t __rev1_706; __rev1_706 = __builtin_shufflevector(__s1_706, __s1_706, 3, 2, 1, 0); \
56211 int16x8_t __rev2_614; __rev2_614 = __builtin_shufflevector(__s2_614, __s2_614, 7, 6, 5, 4, 3, 2, 1, 0); \57881 int16x8_t __rev2_706; __rev2_706 = __builtin_shufflevector(__s2_706, __s2_706, 7, 6, 5, 4, 3, 2, 1, 0); \
56212 int32x4_t __ret_614; \57882 int32x4_t __ret_706; \
56213 __ret_614 = __noswap_vqdmlal_s16(__rev0_614, __rev1_614, __noswap_splat_laneq_s16(__rev2_614, __p3_614)); \57883 __ret_706 = __noswap_vqdmlal_s16(__rev0_706, __rev1_706, __noswap_splat_laneq_s16(__rev2_706, __p3_706)); \
56214 __ret_614 = __builtin_shufflevector(__ret_614, __ret_614, 3, 2, 1, 0); \57884 __ret_706 = __builtin_shufflevector(__ret_706, __ret_706, 3, 2, 1, 0); \
56215 __ret_614; \57885 __ret_706; \
56216})57886})
56217#endif57887#endif
5621857888
...@@ -56263,98 +57933,98 @@ __ai int32x4_t vqdmlsl_high_s16(int32x4_t __p0, int16x8_t __p1, int16x8_t __p2)...@@ -56263,98 +57933,98 @@ __ai int32x4_t vqdmlsl_high_s16(int32x4_t __p0, int16x8_t __p1, int16x8_t __p2)
56263#endif57933#endif
5626457934
56265#ifdef __LITTLE_ENDIAN__57935#ifdef __LITTLE_ENDIAN__
56266#define vqdmlsl_high_lane_s32(__p0_615, __p1_615, __p2_615, __p3_615) __extension__ ({ \57936#define vqdmlsl_high_lane_s32(__p0_707, __p1_707, __p2_707, __p3_707) __extension__ ({ \
56267 int64x2_t __s0_615 = __p0_615; \57937 int64x2_t __s0_707 = __p0_707; \
56268 int32x4_t __s1_615 = __p1_615; \57938 int32x4_t __s1_707 = __p1_707; \
56269 int32x2_t __s2_615 = __p2_615; \57939 int32x2_t __s2_707 = __p2_707; \
56270 int64x2_t __ret_615; \57940 int64x2_t __ret_707; \
56271 __ret_615 = vqdmlsl_s32(__s0_615, vget_high_s32(__s1_615), splat_lane_s32(__s2_615, __p3_615)); \57941 __ret_707 = vqdmlsl_s32(__s0_707, vget_high_s32(__s1_707), splat_lane_s32(__s2_707, __p3_707)); \
56272 __ret_615; \57942 __ret_707; \
56273})57943})
56274#else57944#else
56275#define vqdmlsl_high_lane_s32(__p0_616, __p1_616, __p2_616, __p3_616) __extension__ ({ \57945#define vqdmlsl_high_lane_s32(__p0_708, __p1_708, __p2_708, __p3_708) __extension__ ({ \
56276 int64x2_t __s0_616 = __p0_616; \57946 int64x2_t __s0_708 = __p0_708; \
56277 int32x4_t __s1_616 = __p1_616; \57947 int32x4_t __s1_708 = __p1_708; \
56278 int32x2_t __s2_616 = __p2_616; \57948 int32x2_t __s2_708 = __p2_708; \
56279 int64x2_t __rev0_616; __rev0_616 = __builtin_shufflevector(__s0_616, __s0_616, 1, 0); \57949 int64x2_t __rev0_708; __rev0_708 = __builtin_shufflevector(__s0_708, __s0_708, 1, 0); \
56280 int32x4_t __rev1_616; __rev1_616 = __builtin_shufflevector(__s1_616, __s1_616, 3, 2, 1, 0); \57950 int32x4_t __rev1_708; __rev1_708 = __builtin_shufflevector(__s1_708, __s1_708, 3, 2, 1, 0); \
56281 int32x2_t __rev2_616; __rev2_616 = __builtin_shufflevector(__s2_616, __s2_616, 1, 0); \57951 int32x2_t __rev2_708; __rev2_708 = __builtin_shufflevector(__s2_708, __s2_708, 1, 0); \
56282 int64x2_t __ret_616; \57952 int64x2_t __ret_708; \
56283 __ret_616 = __noswap_vqdmlsl_s32(__rev0_616, __noswap_vget_high_s32(__rev1_616), __noswap_splat_lane_s32(__rev2_616, __p3_616)); \57953 __ret_708 = __noswap_vqdmlsl_s32(__rev0_708, __noswap_vget_high_s32(__rev1_708), __noswap_splat_lane_s32(__rev2_708, __p3_708)); \
56284 __ret_616 = __builtin_shufflevector(__ret_616, __ret_616, 1, 0); \57954 __ret_708 = __builtin_shufflevector(__ret_708, __ret_708, 1, 0); \
56285 __ret_616; \57955 __ret_708; \
56286})57956})
56287#endif57957#endif
5628857958
56289#ifdef __LITTLE_ENDIAN__57959#ifdef __LITTLE_ENDIAN__
56290#define vqdmlsl_high_lane_s16(__p0_617, __p1_617, __p2_617, __p3_617) __extension__ ({ \57960#define vqdmlsl_high_lane_s16(__p0_709, __p1_709, __p2_709, __p3_709) __extension__ ({ \
56291 int32x4_t __s0_617 = __p0_617; \57961 int32x4_t __s0_709 = __p0_709; \
56292 int16x8_t __s1_617 = __p1_617; \57962 int16x8_t __s1_709 = __p1_709; \
56293 int16x4_t __s2_617 = __p2_617; \57963 int16x4_t __s2_709 = __p2_709; \
56294 int32x4_t __ret_617; \57964 int32x4_t __ret_709; \
56295 __ret_617 = vqdmlsl_s16(__s0_617, vget_high_s16(__s1_617), splat_lane_s16(__s2_617, __p3_617)); \57965 __ret_709 = vqdmlsl_s16(__s0_709, vget_high_s16(__s1_709), splat_lane_s16(__s2_709, __p3_709)); \
56296 __ret_617; \57966 __ret_709; \
56297})57967})
56298#else57968#else
56299#define vqdmlsl_high_lane_s16(__p0_618, __p1_618, __p2_618, __p3_618) __extension__ ({ \57969#define vqdmlsl_high_lane_s16(__p0_710, __p1_710, __p2_710, __p3_710) __extension__ ({ \
56300 int32x4_t __s0_618 = __p0_618; \57970 int32x4_t __s0_710 = __p0_710; \
56301 int16x8_t __s1_618 = __p1_618; \57971 int16x8_t __s1_710 = __p1_710; \
56302 int16x4_t __s2_618 = __p2_618; \57972 int16x4_t __s2_710 = __p2_710; \
56303 int32x4_t __rev0_618; __rev0_618 = __builtin_shufflevector(__s0_618, __s0_618, 3, 2, 1, 0); \57973 int32x4_t __rev0_710; __rev0_710 = __builtin_shufflevector(__s0_710, __s0_710, 3, 2, 1, 0); \
56304 int16x8_t __rev1_618; __rev1_618 = __builtin_shufflevector(__s1_618, __s1_618, 7, 6, 5, 4, 3, 2, 1, 0); \57974 int16x8_t __rev1_710; __rev1_710 = __builtin_shufflevector(__s1_710, __s1_710, 7, 6, 5, 4, 3, 2, 1, 0); \
56305 int16x4_t __rev2_618; __rev2_618 = __builtin_shufflevector(__s2_618, __s2_618, 3, 2, 1, 0); \57975 int16x4_t __rev2_710; __rev2_710 = __builtin_shufflevector(__s2_710, __s2_710, 3, 2, 1, 0); \
56306 int32x4_t __ret_618; \57976 int32x4_t __ret_710; \
56307 __ret_618 = __noswap_vqdmlsl_s16(__rev0_618, __noswap_vget_high_s16(__rev1_618), __noswap_splat_lane_s16(__rev2_618, __p3_618)); \57977 __ret_710 = __noswap_vqdmlsl_s16(__rev0_710, __noswap_vget_high_s16(__rev1_710), __noswap_splat_lane_s16(__rev2_710, __p3_710)); \
56308 __ret_618 = __builtin_shufflevector(__ret_618, __ret_618, 3, 2, 1, 0); \57978 __ret_710 = __builtin_shufflevector(__ret_710, __ret_710, 3, 2, 1, 0); \
56309 __ret_618; \57979 __ret_710; \
56310})57980})
56311#endif57981#endif
5631257982
56313#ifdef __LITTLE_ENDIAN__57983#ifdef __LITTLE_ENDIAN__
56314#define vqdmlsl_high_laneq_s32(__p0_619, __p1_619, __p2_619, __p3_619) __extension__ ({ \57984#define vqdmlsl_high_laneq_s32(__p0_711, __p1_711, __p2_711, __p3_711) __extension__ ({ \
56315 int64x2_t __s0_619 = __p0_619; \57985 int64x2_t __s0_711 = __p0_711; \
56316 int32x4_t __s1_619 = __p1_619; \57986 int32x4_t __s1_711 = __p1_711; \
56317 int32x4_t __s2_619 = __p2_619; \57987 int32x4_t __s2_711 = __p2_711; \
56318 int64x2_t __ret_619; \57988 int64x2_t __ret_711; \
56319 __ret_619 = vqdmlsl_s32(__s0_619, vget_high_s32(__s1_619), splat_laneq_s32(__s2_619, __p3_619)); \57989 __ret_711 = vqdmlsl_s32(__s0_711, vget_high_s32(__s1_711), splat_laneq_s32(__s2_711, __p3_711)); \
56320 __ret_619; \57990 __ret_711; \
56321})57991})
56322#else57992#else
56323#define vqdmlsl_high_laneq_s32(__p0_620, __p1_620, __p2_620, __p3_620) __extension__ ({ \57993#define vqdmlsl_high_laneq_s32(__p0_712, __p1_712, __p2_712, __p3_712) __extension__ ({ \
56324 int64x2_t __s0_620 = __p0_620; \57994 int64x2_t __s0_712 = __p0_712; \
56325 int32x4_t __s1_620 = __p1_620; \57995 int32x4_t __s1_712 = __p1_712; \
56326 int32x4_t __s2_620 = __p2_620; \57996 int32x4_t __s2_712 = __p2_712; \
56327 int64x2_t __rev0_620; __rev0_620 = __builtin_shufflevector(__s0_620, __s0_620, 1, 0); \57997 int64x2_t __rev0_712; __rev0_712 = __builtin_shufflevector(__s0_712, __s0_712, 1, 0); \
56328 int32x4_t __rev1_620; __rev1_620 = __builtin_shufflevector(__s1_620, __s1_620, 3, 2, 1, 0); \57998 int32x4_t __rev1_712; __rev1_712 = __builtin_shufflevector(__s1_712, __s1_712, 3, 2, 1, 0); \
56329 int32x4_t __rev2_620; __rev2_620 = __builtin_shufflevector(__s2_620, __s2_620, 3, 2, 1, 0); \57999 int32x4_t __rev2_712; __rev2_712 = __builtin_shufflevector(__s2_712, __s2_712, 3, 2, 1, 0); \
56330 int64x2_t __ret_620; \58000 int64x2_t __ret_712; \
56331 __ret_620 = __noswap_vqdmlsl_s32(__rev0_620, __noswap_vget_high_s32(__rev1_620), __noswap_splat_laneq_s32(__rev2_620, __p3_620)); \58001 __ret_712 = __noswap_vqdmlsl_s32(__rev0_712, __noswap_vget_high_s32(__rev1_712), __noswap_splat_laneq_s32(__rev2_712, __p3_712)); \
56332 __ret_620 = __builtin_shufflevector(__ret_620, __ret_620, 1, 0); \58002 __ret_712 = __builtin_shufflevector(__ret_712, __ret_712, 1, 0); \
56333 __ret_620; \58003 __ret_712; \
56334})58004})
56335#endif58005#endif
5633658006
56337#ifdef __LITTLE_ENDIAN__58007#ifdef __LITTLE_ENDIAN__
56338#define vqdmlsl_high_laneq_s16(__p0_621, __p1_621, __p2_621, __p3_621) __extension__ ({ \58008#define vqdmlsl_high_laneq_s16(__p0_713, __p1_713, __p2_713, __p3_713) __extension__ ({ \
56339 int32x4_t __s0_621 = __p0_621; \58009 int32x4_t __s0_713 = __p0_713; \
56340 int16x8_t __s1_621 = __p1_621; \58010 int16x8_t __s1_713 = __p1_713; \
56341 int16x8_t __s2_621 = __p2_621; \58011 int16x8_t __s2_713 = __p2_713; \
56342 int32x4_t __ret_621; \58012 int32x4_t __ret_713; \
56343 __ret_621 = vqdmlsl_s16(__s0_621, vget_high_s16(__s1_621), splat_laneq_s16(__s2_621, __p3_621)); \58013 __ret_713 = vqdmlsl_s16(__s0_713, vget_high_s16(__s1_713), splat_laneq_s16(__s2_713, __p3_713)); \
56344 __ret_621; \58014 __ret_713; \
56345})58015})
56346#else58016#else
56347#define vqdmlsl_high_laneq_s16(__p0_622, __p1_622, __p2_622, __p3_622) __extension__ ({ \58017#define vqdmlsl_high_laneq_s16(__p0_714, __p1_714, __p2_714, __p3_714) __extension__ ({ \
56348 int32x4_t __s0_622 = __p0_622; \58018 int32x4_t __s0_714 = __p0_714; \
56349 int16x8_t __s1_622 = __p1_622; \58019 int16x8_t __s1_714 = __p1_714; \
56350 int16x8_t __s2_622 = __p2_622; \58020 int16x8_t __s2_714 = __p2_714; \
56351 int32x4_t __rev0_622; __rev0_622 = __builtin_shufflevector(__s0_622, __s0_622, 3, 2, 1, 0); \58021 int32x4_t __rev0_714; __rev0_714 = __builtin_shufflevector(__s0_714, __s0_714, 3, 2, 1, 0); \
56352 int16x8_t __rev1_622; __rev1_622 = __builtin_shufflevector(__s1_622, __s1_622, 7, 6, 5, 4, 3, 2, 1, 0); \58022 int16x8_t __rev1_714; __rev1_714 = __builtin_shufflevector(__s1_714, __s1_714, 7, 6, 5, 4, 3, 2, 1, 0); \
56353 int16x8_t __rev2_622; __rev2_622 = __builtin_shufflevector(__s2_622, __s2_622, 7, 6, 5, 4, 3, 2, 1, 0); \58023 int16x8_t __rev2_714; __rev2_714 = __builtin_shufflevector(__s2_714, __s2_714, 7, 6, 5, 4, 3, 2, 1, 0); \
56354 int32x4_t __ret_622; \58024 int32x4_t __ret_714; \
56355 __ret_622 = __noswap_vqdmlsl_s16(__rev0_622, __noswap_vget_high_s16(__rev1_622), __noswap_splat_laneq_s16(__rev2_622, __p3_622)); \58025 __ret_714 = __noswap_vqdmlsl_s16(__rev0_714, __noswap_vget_high_s16(__rev1_714), __noswap_splat_laneq_s16(__rev2_714, __p3_714)); \
56356 __ret_622 = __builtin_shufflevector(__ret_622, __ret_622, 3, 2, 1, 0); \58026 __ret_714 = __builtin_shufflevector(__ret_714, __ret_714, 3, 2, 1, 0); \
56357 __ret_622; \58027 __ret_714; \
56358})58028})
56359#endif58029#endif
5636058030
...@@ -56477,50 +58147,50 @@ __ai int32x4_t vqdmlsl_high_n_s16(int32x4_t __p0, int16x8_t __p1, int16_t __p2)...@@ -56477,50 +58147,50 @@ __ai int32x4_t vqdmlsl_high_n_s16(int32x4_t __p0, int16x8_t __p1, int16_t __p2)
56477#endif58147#endif
5647858148
56479#ifdef __LITTLE_ENDIAN__58149#ifdef __LITTLE_ENDIAN__
56480#define vqdmlsl_laneq_s32(__p0_623, __p1_623, __p2_623, __p3_623) __extension__ ({ \58150#define vqdmlsl_laneq_s32(__p0_715, __p1_715, __p2_715, __p3_715) __extension__ ({ \
56481 int64x2_t __s0_623 = __p0_623; \58151 int64x2_t __s0_715 = __p0_715; \
56482 int32x2_t __s1_623 = __p1_623; \58152 int32x2_t __s1_715 = __p1_715; \
56483 int32x4_t __s2_623 = __p2_623; \58153 int32x4_t __s2_715 = __p2_715; \
56484 int64x2_t __ret_623; \58154 int64x2_t __ret_715; \
56485 __ret_623 = vqdmlsl_s32(__s0_623, __s1_623, splat_laneq_s32(__s2_623, __p3_623)); \58155 __ret_715 = vqdmlsl_s32(__s0_715, __s1_715, splat_laneq_s32(__s2_715, __p3_715)); \
56486 __ret_623; \58156 __ret_715; \
56487})58157})
56488#else58158#else
56489#define vqdmlsl_laneq_s32(__p0_624, __p1_624, __p2_624, __p3_624) __extension__ ({ \58159#define vqdmlsl_laneq_s32(__p0_716, __p1_716, __p2_716, __p3_716) __extension__ ({ \
56490 int64x2_t __s0_624 = __p0_624; \58160 int64x2_t __s0_716 = __p0_716; \
56491 int32x2_t __s1_624 = __p1_624; \58161 int32x2_t __s1_716 = __p1_716; \
56492 int32x4_t __s2_624 = __p2_624; \58162 int32x4_t __s2_716 = __p2_716; \
56493 int64x2_t __rev0_624; __rev0_624 = __builtin_shufflevector(__s0_624, __s0_624, 1, 0); \58163 int64x2_t __rev0_716; __rev0_716 = __builtin_shufflevector(__s0_716, __s0_716, 1, 0); \
56494 int32x2_t __rev1_624; __rev1_624 = __builtin_shufflevector(__s1_624, __s1_624, 1, 0); \58164 int32x2_t __rev1_716; __rev1_716 = __builtin_shufflevector(__s1_716, __s1_716, 1, 0); \
56495 int32x4_t __rev2_624; __rev2_624 = __builtin_shufflevector(__s2_624, __s2_624, 3, 2, 1, 0); \58165 int32x4_t __rev2_716; __rev2_716 = __builtin_shufflevector(__s2_716, __s2_716, 3, 2, 1, 0); \
56496 int64x2_t __ret_624; \58166 int64x2_t __ret_716; \
56497 __ret_624 = __noswap_vqdmlsl_s32(__rev0_624, __rev1_624, __noswap_splat_laneq_s32(__rev2_624, __p3_624)); \58167 __ret_716 = __noswap_vqdmlsl_s32(__rev0_716, __rev1_716, __noswap_splat_laneq_s32(__rev2_716, __p3_716)); \
56498 __ret_624 = __builtin_shufflevector(__ret_624, __ret_624, 1, 0); \58168 __ret_716 = __builtin_shufflevector(__ret_716, __ret_716, 1, 0); \
56499 __ret_624; \58169 __ret_716; \
56500})58170})
56501#endif58171#endif
5650258172
56503#ifdef __LITTLE_ENDIAN__58173#ifdef __LITTLE_ENDIAN__
56504#define vqdmlsl_laneq_s16(__p0_625, __p1_625, __p2_625, __p3_625) __extension__ ({ \58174#define vqdmlsl_laneq_s16(__p0_717, __p1_717, __p2_717, __p3_717) __extension__ ({ \
56505 int32x4_t __s0_625 = __p0_625; \58175 int32x4_t __s0_717 = __p0_717; \
56506 int16x4_t __s1_625 = __p1_625; \58176 int16x4_t __s1_717 = __p1_717; \
56507 int16x8_t __s2_625 = __p2_625; \58177 int16x8_t __s2_717 = __p2_717; \
56508 int32x4_t __ret_625; \58178 int32x4_t __ret_717; \
56509 __ret_625 = vqdmlsl_s16(__s0_625, __s1_625, splat_laneq_s16(__s2_625, __p3_625)); \58179 __ret_717 = vqdmlsl_s16(__s0_717, __s1_717, splat_laneq_s16(__s2_717, __p3_717)); \
56510 __ret_625; \58180 __ret_717; \
56511})58181})
56512#else58182#else
56513#define vqdmlsl_laneq_s16(__p0_626, __p1_626, __p2_626, __p3_626) __extension__ ({ \58183#define vqdmlsl_laneq_s16(__p0_718, __p1_718, __p2_718, __p3_718) __extension__ ({ \
56514 int32x4_t __s0_626 = __p0_626; \58184 int32x4_t __s0_718 = __p0_718; \
56515 int16x4_t __s1_626 = __p1_626; \58185 int16x4_t __s1_718 = __p1_718; \
56516 int16x8_t __s2_626 = __p2_626; \58186 int16x8_t __s2_718 = __p2_718; \
56517 int32x4_t __rev0_626; __rev0_626 = __builtin_shufflevector(__s0_626, __s0_626, 3, 2, 1, 0); \58187 int32x4_t __rev0_718; __rev0_718 = __builtin_shufflevector(__s0_718, __s0_718, 3, 2, 1, 0); \
56518 int16x4_t __rev1_626; __rev1_626 = __builtin_shufflevector(__s1_626, __s1_626, 3, 2, 1, 0); \58188 int16x4_t __rev1_718; __rev1_718 = __builtin_shufflevector(__s1_718, __s1_718, 3, 2, 1, 0); \
56519 int16x8_t __rev2_626; __rev2_626 = __builtin_shufflevector(__s2_626, __s2_626, 7, 6, 5, 4, 3, 2, 1, 0); \58189 int16x8_t __rev2_718; __rev2_718 = __builtin_shufflevector(__s2_718, __s2_718, 7, 6, 5, 4, 3, 2, 1, 0); \
56520 int32x4_t __ret_626; \58190 int32x4_t __ret_718; \
56521 __ret_626 = __noswap_vqdmlsl_s16(__rev0_626, __rev1_626, __noswap_splat_laneq_s16(__rev2_626, __p3_626)); \58191 __ret_718 = __noswap_vqdmlsl_s16(__rev0_718, __rev1_718, __noswap_splat_laneq_s16(__rev2_718, __p3_718)); \
56522 __ret_626 = __builtin_shufflevector(__ret_626, __ret_626, 3, 2, 1, 0); \58192 __ret_718 = __builtin_shufflevector(__ret_718, __ret_718, 3, 2, 1, 0); \
56523 __ret_626; \58193 __ret_718; \
56524})58194})
56525#endif58195#endif
5652658196
...@@ -56619,78 +58289,78 @@ __ai int16_t vqdmulhh_s16(int16_t __p0, int16_t __p1) {...@@ -56619,78 +58289,78 @@ __ai int16_t vqdmulhh_s16(int16_t __p0, int16_t __p1) {
56619#endif58289#endif
5662058290
56621#ifdef __LITTLE_ENDIAN__58291#ifdef __LITTLE_ENDIAN__
56622#define vqdmulhs_lane_s32(__p0_627, __p1_627, __p2_627) __extension__ ({ \58292#define vqdmulhs_lane_s32(__p0_719, __p1_719, __p2_719) __extension__ ({ \
56623 int32_t __s0_627 = __p0_627; \58293 int32_t __s0_719 = __p0_719; \
56624 int32x2_t __s1_627 = __p1_627; \58294 int32x2_t __s1_719 = __p1_719; \
56625 int32_t __ret_627; \58295 int32_t __ret_719; \
56626 __ret_627 = vqdmulhs_s32(__s0_627, vget_lane_s32(__s1_627, __p2_627)); \58296 __ret_719 = vqdmulhs_s32(__s0_719, vget_lane_s32(__s1_719, __p2_719)); \
56627 __ret_627; \58297 __ret_719; \
56628})58298})
56629#else58299#else
56630#define vqdmulhs_lane_s32(__p0_628, __p1_628, __p2_628) __extension__ ({ \58300#define vqdmulhs_lane_s32(__p0_720, __p1_720, __p2_720) __extension__ ({ \
56631 int32_t __s0_628 = __p0_628; \58301 int32_t __s0_720 = __p0_720; \
56632 int32x2_t __s1_628 = __p1_628; \58302 int32x2_t __s1_720 = __p1_720; \
56633 int32x2_t __rev1_628; __rev1_628 = __builtin_shufflevector(__s1_628, __s1_628, 1, 0); \58303 int32x2_t __rev1_720; __rev1_720 = __builtin_shufflevector(__s1_720, __s1_720, 1, 0); \
56634 int32_t __ret_628; \58304 int32_t __ret_720; \
56635 __ret_628 = vqdmulhs_s32(__s0_628, __noswap_vget_lane_s32(__rev1_628, __p2_628)); \58305 __ret_720 = vqdmulhs_s32(__s0_720, __noswap_vget_lane_s32(__rev1_720, __p2_720)); \
56636 __ret_628; \58306 __ret_720; \
56637})58307})
56638#endif58308#endif
5663958309
56640#ifdef __LITTLE_ENDIAN__58310#ifdef __LITTLE_ENDIAN__
56641#define vqdmulhh_lane_s16(__p0_629, __p1_629, __p2_629) __extension__ ({ \58311#define vqdmulhh_lane_s16(__p0_721, __p1_721, __p2_721) __extension__ ({ \
56642 int16_t __s0_629 = __p0_629; \58312 int16_t __s0_721 = __p0_721; \
56643 int16x4_t __s1_629 = __p1_629; \58313 int16x4_t __s1_721 = __p1_721; \
56644 int16_t __ret_629; \58314 int16_t __ret_721; \
56645 __ret_629 = vqdmulhh_s16(__s0_629, vget_lane_s16(__s1_629, __p2_629)); \58315 __ret_721 = vqdmulhh_s16(__s0_721, vget_lane_s16(__s1_721, __p2_721)); \
56646 __ret_629; \58316 __ret_721; \
56647})58317})
56648#else58318#else
56649#define vqdmulhh_lane_s16(__p0_630, __p1_630, __p2_630) __extension__ ({ \58319#define vqdmulhh_lane_s16(__p0_722, __p1_722, __p2_722) __extension__ ({ \
56650 int16_t __s0_630 = __p0_630; \58320 int16_t __s0_722 = __p0_722; \
56651 int16x4_t __s1_630 = __p1_630; \58321 int16x4_t __s1_722 = __p1_722; \
56652 int16x4_t __rev1_630; __rev1_630 = __builtin_shufflevector(__s1_630, __s1_630, 3, 2, 1, 0); \58322 int16x4_t __rev1_722; __rev1_722 = __builtin_shufflevector(__s1_722, __s1_722, 3, 2, 1, 0); \
56653 int16_t __ret_630; \58323 int16_t __ret_722; \
56654 __ret_630 = vqdmulhh_s16(__s0_630, __noswap_vget_lane_s16(__rev1_630, __p2_630)); \58324 __ret_722 = vqdmulhh_s16(__s0_722, __noswap_vget_lane_s16(__rev1_722, __p2_722)); \
56655 __ret_630; \58325 __ret_722; \
56656})58326})
56657#endif58327#endif
5665858328
56659#ifdef __LITTLE_ENDIAN__58329#ifdef __LITTLE_ENDIAN__
56660#define vqdmulhs_laneq_s32(__p0_631, __p1_631, __p2_631) __extension__ ({ \58330#define vqdmulhs_laneq_s32(__p0_723, __p1_723, __p2_723) __extension__ ({ \
56661 int32_t __s0_631 = __p0_631; \58331 int32_t __s0_723 = __p0_723; \
56662 int32x4_t __s1_631 = __p1_631; \58332 int32x4_t __s1_723 = __p1_723; \
56663 int32_t __ret_631; \58333 int32_t __ret_723; \
56664 __ret_631 = vqdmulhs_s32(__s0_631, vgetq_lane_s32(__s1_631, __p2_631)); \58334 __ret_723 = vqdmulhs_s32(__s0_723, vgetq_lane_s32(__s1_723, __p2_723)); \
56665 __ret_631; \58335 __ret_723; \
56666})58336})
56667#else58337#else
56668#define vqdmulhs_laneq_s32(__p0_632, __p1_632, __p2_632) __extension__ ({ \58338#define vqdmulhs_laneq_s32(__p0_724, __p1_724, __p2_724) __extension__ ({ \
56669 int32_t __s0_632 = __p0_632; \58339 int32_t __s0_724 = __p0_724; \
56670 int32x4_t __s1_632 = __p1_632; \58340 int32x4_t __s1_724 = __p1_724; \
56671 int32x4_t __rev1_632; __rev1_632 = __builtin_shufflevector(__s1_632, __s1_632, 3, 2, 1, 0); \58341 int32x4_t __rev1_724; __rev1_724 = __builtin_shufflevector(__s1_724, __s1_724, 3, 2, 1, 0); \
56672 int32_t __ret_632; \58342 int32_t __ret_724; \
56673 __ret_632 = vqdmulhs_s32(__s0_632, __noswap_vgetq_lane_s32(__rev1_632, __p2_632)); \58343 __ret_724 = vqdmulhs_s32(__s0_724, __noswap_vgetq_lane_s32(__rev1_724, __p2_724)); \
56674 __ret_632; \58344 __ret_724; \
56675})58345})
56676#endif58346#endif
5667758347
56678#ifdef __LITTLE_ENDIAN__58348#ifdef __LITTLE_ENDIAN__
56679#define vqdmulhh_laneq_s16(__p0_633, __p1_633, __p2_633) __extension__ ({ \58349#define vqdmulhh_laneq_s16(__p0_725, __p1_725, __p2_725) __extension__ ({ \
56680 int16_t __s0_633 = __p0_633; \58350 int16_t __s0_725 = __p0_725; \
56681 int16x8_t __s1_633 = __p1_633; \58351 int16x8_t __s1_725 = __p1_725; \
56682 int16_t __ret_633; \58352 int16_t __ret_725; \
56683 __ret_633 = vqdmulhh_s16(__s0_633, vgetq_lane_s16(__s1_633, __p2_633)); \58353 __ret_725 = vqdmulhh_s16(__s0_725, vgetq_lane_s16(__s1_725, __p2_725)); \
56684 __ret_633; \58354 __ret_725; \
56685})58355})
56686#else58356#else
56687#define vqdmulhh_laneq_s16(__p0_634, __p1_634, __p2_634) __extension__ ({ \58357#define vqdmulhh_laneq_s16(__p0_726, __p1_726, __p2_726) __extension__ ({ \
56688 int16_t __s0_634 = __p0_634; \58358 int16_t __s0_726 = __p0_726; \
56689 int16x8_t __s1_634 = __p1_634; \58359 int16x8_t __s1_726 = __p1_726; \
56690 int16x8_t __rev1_634; __rev1_634 = __builtin_shufflevector(__s1_634, __s1_634, 7, 6, 5, 4, 3, 2, 1, 0); \58360 int16x8_t __rev1_726; __rev1_726 = __builtin_shufflevector(__s1_726, __s1_726, 7, 6, 5, 4, 3, 2, 1, 0); \
56691 int16_t __ret_634; \58361 int16_t __ret_726; \
56692 __ret_634 = vqdmulhh_s16(__s0_634, __noswap_vgetq_lane_s16(__rev1_634, __p2_634)); \58362 __ret_726 = vqdmulhh_s16(__s0_726, __noswap_vgetq_lane_s16(__rev1_726, __p2_726)); \
56693 __ret_634; \58363 __ret_726; \
56694})58364})
56695#endif58365#endif
5669658366
...@@ -56823,86 +58493,86 @@ __ai int32x4_t vqdmull_high_s16(int16x8_t __p0, int16x8_t __p1) {...@@ -56823,86 +58493,86 @@ __ai int32x4_t vqdmull_high_s16(int16x8_t __p0, int16x8_t __p1) {
56823#endif58493#endif
5682458494
56825#ifdef __LITTLE_ENDIAN__58495#ifdef __LITTLE_ENDIAN__
56826#define vqdmull_high_lane_s32(__p0_635, __p1_635, __p2_635) __extension__ ({ \58496#define vqdmull_high_lane_s32(__p0_727, __p1_727, __p2_727) __extension__ ({ \
56827 int32x4_t __s0_635 = __p0_635; \58497 int32x4_t __s0_727 = __p0_727; \
56828 int32x2_t __s1_635 = __p1_635; \58498 int32x2_t __s1_727 = __p1_727; \
56829 int64x2_t __ret_635; \58499 int64x2_t __ret_727; \
56830 __ret_635 = vqdmull_s32(vget_high_s32(__s0_635), splat_lane_s32(__s1_635, __p2_635)); \58500 __ret_727 = vqdmull_s32(vget_high_s32(__s0_727), splat_lane_s32(__s1_727, __p2_727)); \
56831 __ret_635; \58501 __ret_727; \
56832})58502})
56833#else58503#else
56834#define vqdmull_high_lane_s32(__p0_636, __p1_636, __p2_636) __extension__ ({ \58504#define vqdmull_high_lane_s32(__p0_728, __p1_728, __p2_728) __extension__ ({ \
56835 int32x4_t __s0_636 = __p0_636; \58505 int32x4_t __s0_728 = __p0_728; \
56836 int32x2_t __s1_636 = __p1_636; \58506 int32x2_t __s1_728 = __p1_728; \
56837 int32x4_t __rev0_636; __rev0_636 = __builtin_shufflevector(__s0_636, __s0_636, 3, 2, 1, 0); \58507 int32x4_t __rev0_728; __rev0_728 = __builtin_shufflevector(__s0_728, __s0_728, 3, 2, 1, 0); \
56838 int32x2_t __rev1_636; __rev1_636 = __builtin_shufflevector(__s1_636, __s1_636, 1, 0); \58508 int32x2_t __rev1_728; __rev1_728 = __builtin_shufflevector(__s1_728, __s1_728, 1, 0); \
56839 int64x2_t __ret_636; \58509 int64x2_t __ret_728; \
56840 __ret_636 = __noswap_vqdmull_s32(__noswap_vget_high_s32(__rev0_636), __noswap_splat_lane_s32(__rev1_636, __p2_636)); \58510 __ret_728 = __noswap_vqdmull_s32(__noswap_vget_high_s32(__rev0_728), __noswap_splat_lane_s32(__rev1_728, __p2_728)); \
56841 __ret_636 = __builtin_shufflevector(__ret_636, __ret_636, 1, 0); \58511 __ret_728 = __builtin_shufflevector(__ret_728, __ret_728, 1, 0); \
56842 __ret_636; \58512 __ret_728; \
56843})58513})
56844#endif58514#endif
5684558515
56846#ifdef __LITTLE_ENDIAN__58516#ifdef __LITTLE_ENDIAN__
56847#define vqdmull_high_lane_s16(__p0_637, __p1_637, __p2_637) __extension__ ({ \58517#define vqdmull_high_lane_s16(__p0_729, __p1_729, __p2_729) __extension__ ({ \
56848 int16x8_t __s0_637 = __p0_637; \58518 int16x8_t __s0_729 = __p0_729; \
56849 int16x4_t __s1_637 = __p1_637; \58519 int16x4_t __s1_729 = __p1_729; \
56850 int32x4_t __ret_637; \58520 int32x4_t __ret_729; \
56851 __ret_637 = vqdmull_s16(vget_high_s16(__s0_637), splat_lane_s16(__s1_637, __p2_637)); \58521 __ret_729 = vqdmull_s16(vget_high_s16(__s0_729), splat_lane_s16(__s1_729, __p2_729)); \
56852 __ret_637; \58522 __ret_729; \
56853})58523})
56854#else58524#else
56855#define vqdmull_high_lane_s16(__p0_638, __p1_638, __p2_638) __extension__ ({ \58525#define vqdmull_high_lane_s16(__p0_730, __p1_730, __p2_730) __extension__ ({ \
56856 int16x8_t __s0_638 = __p0_638; \58526 int16x8_t __s0_730 = __p0_730; \
56857 int16x4_t __s1_638 = __p1_638; \58527 int16x4_t __s1_730 = __p1_730; \
56858 int16x8_t __rev0_638; __rev0_638 = __builtin_shufflevector(__s0_638, __s0_638, 7, 6, 5, 4, 3, 2, 1, 0); \58528 int16x8_t __rev0_730; __rev0_730 = __builtin_shufflevector(__s0_730, __s0_730, 7, 6, 5, 4, 3, 2, 1, 0); \
56859 int16x4_t __rev1_638; __rev1_638 = __builtin_shufflevector(__s1_638, __s1_638, 3, 2, 1, 0); \58529 int16x4_t __rev1_730; __rev1_730 = __builtin_shufflevector(__s1_730, __s1_730, 3, 2, 1, 0); \
56860 int32x4_t __ret_638; \58530 int32x4_t __ret_730; \
56861 __ret_638 = __noswap_vqdmull_s16(__noswap_vget_high_s16(__rev0_638), __noswap_splat_lane_s16(__rev1_638, __p2_638)); \58531 __ret_730 = __noswap_vqdmull_s16(__noswap_vget_high_s16(__rev0_730), __noswap_splat_lane_s16(__rev1_730, __p2_730)); \
56862 __ret_638 = __builtin_shufflevector(__ret_638, __ret_638, 3, 2, 1, 0); \58532 __ret_730 = __builtin_shufflevector(__ret_730, __ret_730, 3, 2, 1, 0); \
56863 __ret_638; \58533 __ret_730; \
56864})58534})
56865#endif58535#endif
5686658536
56867#ifdef __LITTLE_ENDIAN__58537#ifdef __LITTLE_ENDIAN__
56868#define vqdmull_high_laneq_s32(__p0_639, __p1_639, __p2_639) __extension__ ({ \58538#define vqdmull_high_laneq_s32(__p0_731, __p1_731, __p2_731) __extension__ ({ \
56869 int32x4_t __s0_639 = __p0_639; \58539 int32x4_t __s0_731 = __p0_731; \
56870 int32x4_t __s1_639 = __p1_639; \58540 int32x4_t __s1_731 = __p1_731; \
56871 int64x2_t __ret_639; \58541 int64x2_t __ret_731; \
56872 __ret_639 = vqdmull_s32(vget_high_s32(__s0_639), splat_laneq_s32(__s1_639, __p2_639)); \58542 __ret_731 = vqdmull_s32(vget_high_s32(__s0_731), splat_laneq_s32(__s1_731, __p2_731)); \
56873 __ret_639; \58543 __ret_731; \
56874})58544})
56875#else58545#else
56876#define vqdmull_high_laneq_s32(__p0_640, __p1_640, __p2_640) __extension__ ({ \58546#define vqdmull_high_laneq_s32(__p0_732, __p1_732, __p2_732) __extension__ ({ \
56877 int32x4_t __s0_640 = __p0_640; \58547 int32x4_t __s0_732 = __p0_732; \
56878 int32x4_t __s1_640 = __p1_640; \58548 int32x4_t __s1_732 = __p1_732; \
56879 int32x4_t __rev0_640; __rev0_640 = __builtin_shufflevector(__s0_640, __s0_640, 3, 2, 1, 0); \58549 int32x4_t __rev0_732; __rev0_732 = __builtin_shufflevector(__s0_732, __s0_732, 3, 2, 1, 0); \
56880 int32x4_t __rev1_640; __rev1_640 = __builtin_shufflevector(__s1_640, __s1_640, 3, 2, 1, 0); \58550 int32x4_t __rev1_732; __rev1_732 = __builtin_shufflevector(__s1_732, __s1_732, 3, 2, 1, 0); \
56881 int64x2_t __ret_640; \58551 int64x2_t __ret_732; \
56882 __ret_640 = __noswap_vqdmull_s32(__noswap_vget_high_s32(__rev0_640), __noswap_splat_laneq_s32(__rev1_640, __p2_640)); \58552 __ret_732 = __noswap_vqdmull_s32(__noswap_vget_high_s32(__rev0_732), __noswap_splat_laneq_s32(__rev1_732, __p2_732)); \
56883 __ret_640 = __builtin_shufflevector(__ret_640, __ret_640, 1, 0); \58553 __ret_732 = __builtin_shufflevector(__ret_732, __ret_732, 1, 0); \
56884 __ret_640; \58554 __ret_732; \
56885})58555})
56886#endif58556#endif
5688758557
56888#ifdef __LITTLE_ENDIAN__58558#ifdef __LITTLE_ENDIAN__
56889#define vqdmull_high_laneq_s16(__p0_641, __p1_641, __p2_641) __extension__ ({ \58559#define vqdmull_high_laneq_s16(__p0_733, __p1_733, __p2_733) __extension__ ({ \
56890 int16x8_t __s0_641 = __p0_641; \58560 int16x8_t __s0_733 = __p0_733; \
56891 int16x8_t __s1_641 = __p1_641; \58561 int16x8_t __s1_733 = __p1_733; \
56892 int32x4_t __ret_641; \58562 int32x4_t __ret_733; \
56893 __ret_641 = vqdmull_s16(vget_high_s16(__s0_641), splat_laneq_s16(__s1_641, __p2_641)); \58563 __ret_733 = vqdmull_s16(vget_high_s16(__s0_733), splat_laneq_s16(__s1_733, __p2_733)); \
56894 __ret_641; \58564 __ret_733; \
56895})58565})
56896#else58566#else
56897#define vqdmull_high_laneq_s16(__p0_642, __p1_642, __p2_642) __extension__ ({ \58567#define vqdmull_high_laneq_s16(__p0_734, __p1_734, __p2_734) __extension__ ({ \
56898 int16x8_t __s0_642 = __p0_642; \58568 int16x8_t __s0_734 = __p0_734; \
56899 int16x8_t __s1_642 = __p1_642; \58569 int16x8_t __s1_734 = __p1_734; \
56900 int16x8_t __rev0_642; __rev0_642 = __builtin_shufflevector(__s0_642, __s0_642, 7, 6, 5, 4, 3, 2, 1, 0); \58570 int16x8_t __rev0_734; __rev0_734 = __builtin_shufflevector(__s0_734, __s0_734, 7, 6, 5, 4, 3, 2, 1, 0); \
56901 int16x8_t __rev1_642; __rev1_642 = __builtin_shufflevector(__s1_642, __s1_642, 7, 6, 5, 4, 3, 2, 1, 0); \58571 int16x8_t __rev1_734; __rev1_734 = __builtin_shufflevector(__s1_734, __s1_734, 7, 6, 5, 4, 3, 2, 1, 0); \
56902 int32x4_t __ret_642; \58572 int32x4_t __ret_734; \
56903 __ret_642 = __noswap_vqdmull_s16(__noswap_vget_high_s16(__rev0_642), __noswap_splat_laneq_s16(__rev1_642, __p2_642)); \58573 __ret_734 = __noswap_vqdmull_s16(__noswap_vget_high_s16(__rev0_734), __noswap_splat_laneq_s16(__rev1_734, __p2_734)); \
56904 __ret_642 = __builtin_shufflevector(__ret_642, __ret_642, 3, 2, 1, 0); \58574 __ret_734 = __builtin_shufflevector(__ret_734, __ret_734, 3, 2, 1, 0); \
56905 __ret_642; \58575 __ret_734; \
56906})58576})
56907#endif58577#endif
5690858578
...@@ -56939,120 +58609,120 @@ __ai int32x4_t vqdmull_high_n_s16(int16x8_t __p0, int16_t __p1) {...@@ -56939,120 +58609,120 @@ __ai int32x4_t vqdmull_high_n_s16(int16x8_t __p0, int16_t __p1) {
56939#endif58609#endif
5694058610
56941#ifdef __LITTLE_ENDIAN__58611#ifdef __LITTLE_ENDIAN__
56942#define vqdmulls_lane_s32(__p0_643, __p1_643, __p2_643) __extension__ ({ \58612#define vqdmulls_lane_s32(__p0_735, __p1_735, __p2_735) __extension__ ({ \
56943 int32_t __s0_643 = __p0_643; \58613 int32_t __s0_735 = __p0_735; \
56944 int32x2_t __s1_643 = __p1_643; \58614 int32x2_t __s1_735 = __p1_735; \
56945 int64_t __ret_643; \58615 int64_t __ret_735; \
56946 __ret_643 = vqdmulls_s32(__s0_643, vget_lane_s32(__s1_643, __p2_643)); \58616 __ret_735 = vqdmulls_s32(__s0_735, vget_lane_s32(__s1_735, __p2_735)); \
56947 __ret_643; \58617 __ret_735; \
56948})58618})
56949#else58619#else
56950#define vqdmulls_lane_s32(__p0_644, __p1_644, __p2_644) __extension__ ({ \58620#define vqdmulls_lane_s32(__p0_736, __p1_736, __p2_736) __extension__ ({ \
56951 int32_t __s0_644 = __p0_644; \58621 int32_t __s0_736 = __p0_736; \
56952 int32x2_t __s1_644 = __p1_644; \58622 int32x2_t __s1_736 = __p1_736; \
56953 int32x2_t __rev1_644; __rev1_644 = __builtin_shufflevector(__s1_644, __s1_644, 1, 0); \58623 int32x2_t __rev1_736; __rev1_736 = __builtin_shufflevector(__s1_736, __s1_736, 1, 0); \
56954 int64_t __ret_644; \58624 int64_t __ret_736; \
56955 __ret_644 = vqdmulls_s32(__s0_644, __noswap_vget_lane_s32(__rev1_644, __p2_644)); \58625 __ret_736 = vqdmulls_s32(__s0_736, __noswap_vget_lane_s32(__rev1_736, __p2_736)); \
56956 __ret_644; \58626 __ret_736; \
56957})58627})
56958#endif58628#endif
5695958629
56960#ifdef __LITTLE_ENDIAN__58630#ifdef __LITTLE_ENDIAN__
56961#define vqdmullh_lane_s16(__p0_645, __p1_645, __p2_645) __extension__ ({ \58631#define vqdmullh_lane_s16(__p0_737, __p1_737, __p2_737) __extension__ ({ \
56962 int16_t __s0_645 = __p0_645; \58632 int16_t __s0_737 = __p0_737; \
56963 int16x4_t __s1_645 = __p1_645; \58633 int16x4_t __s1_737 = __p1_737; \
56964 int32_t __ret_645; \58634 int32_t __ret_737; \
56965 __ret_645 = vqdmullh_s16(__s0_645, vget_lane_s16(__s1_645, __p2_645)); \58635 __ret_737 = vqdmullh_s16(__s0_737, vget_lane_s16(__s1_737, __p2_737)); \
56966 __ret_645; \58636 __ret_737; \
56967})58637})
56968#else58638#else
56969#define vqdmullh_lane_s16(__p0_646, __p1_646, __p2_646) __extension__ ({ \58639#define vqdmullh_lane_s16(__p0_738, __p1_738, __p2_738) __extension__ ({ \
56970 int16_t __s0_646 = __p0_646; \58640 int16_t __s0_738 = __p0_738; \
56971 int16x4_t __s1_646 = __p1_646; \58641 int16x4_t __s1_738 = __p1_738; \
56972 int16x4_t __rev1_646; __rev1_646 = __builtin_shufflevector(__s1_646, __s1_646, 3, 2, 1, 0); \58642 int16x4_t __rev1_738; __rev1_738 = __builtin_shufflevector(__s1_738, __s1_738, 3, 2, 1, 0); \
56973 int32_t __ret_646; \58643 int32_t __ret_738; \
56974 __ret_646 = vqdmullh_s16(__s0_646, __noswap_vget_lane_s16(__rev1_646, __p2_646)); \58644 __ret_738 = vqdmullh_s16(__s0_738, __noswap_vget_lane_s16(__rev1_738, __p2_738)); \
56975 __ret_646; \58645 __ret_738; \
56976})58646})
56977#endif58647#endif
5697858648
56979#ifdef __LITTLE_ENDIAN__58649#ifdef __LITTLE_ENDIAN__
56980#define vqdmulls_laneq_s32(__p0_647, __p1_647, __p2_647) __extension__ ({ \58650#define vqdmulls_laneq_s32(__p0_739, __p1_739, __p2_739) __extension__ ({ \
56981 int32_t __s0_647 = __p0_647; \58651 int32_t __s0_739 = __p0_739; \
56982 int32x4_t __s1_647 = __p1_647; \58652 int32x4_t __s1_739 = __p1_739; \
56983 int64_t __ret_647; \58653 int64_t __ret_739; \
56984 __ret_647 = vqdmulls_s32(__s0_647, vgetq_lane_s32(__s1_647, __p2_647)); \58654 __ret_739 = vqdmulls_s32(__s0_739, vgetq_lane_s32(__s1_739, __p2_739)); \
56985 __ret_647; \58655 __ret_739; \
56986})58656})
56987#else58657#else
56988#define vqdmulls_laneq_s32(__p0_648, __p1_648, __p2_648) __extension__ ({ \58658#define vqdmulls_laneq_s32(__p0_740, __p1_740, __p2_740) __extension__ ({ \
56989 int32_t __s0_648 = __p0_648; \58659 int32_t __s0_740 = __p0_740; \
56990 int32x4_t __s1_648 = __p1_648; \58660 int32x4_t __s1_740 = __p1_740; \
56991 int32x4_t __rev1_648; __rev1_648 = __builtin_shufflevector(__s1_648, __s1_648, 3, 2, 1, 0); \58661 int32x4_t __rev1_740; __rev1_740 = __builtin_shufflevector(__s1_740, __s1_740, 3, 2, 1, 0); \
56992 int64_t __ret_648; \58662 int64_t __ret_740; \
56993 __ret_648 = vqdmulls_s32(__s0_648, __noswap_vgetq_lane_s32(__rev1_648, __p2_648)); \58663 __ret_740 = vqdmulls_s32(__s0_740, __noswap_vgetq_lane_s32(__rev1_740, __p2_740)); \
56994 __ret_648; \58664 __ret_740; \
56995})58665})
56996#endif58666#endif
5699758667
56998#ifdef __LITTLE_ENDIAN__58668#ifdef __LITTLE_ENDIAN__
56999#define vqdmullh_laneq_s16(__p0_649, __p1_649, __p2_649) __extension__ ({ \58669#define vqdmullh_laneq_s16(__p0_741, __p1_741, __p2_741) __extension__ ({ \
57000 int16_t __s0_649 = __p0_649; \58670 int16_t __s0_741 = __p0_741; \
57001 int16x8_t __s1_649 = __p1_649; \58671 int16x8_t __s1_741 = __p1_741; \
57002 int32_t __ret_649; \58672 int32_t __ret_741; \
57003 __ret_649 = vqdmullh_s16(__s0_649, vgetq_lane_s16(__s1_649, __p2_649)); \58673 __ret_741 = vqdmullh_s16(__s0_741, vgetq_lane_s16(__s1_741, __p2_741)); \
57004 __ret_649; \58674 __ret_741; \
57005})58675})
57006#else58676#else
57007#define vqdmullh_laneq_s16(__p0_650, __p1_650, __p2_650) __extension__ ({ \58677#define vqdmullh_laneq_s16(__p0_742, __p1_742, __p2_742) __extension__ ({ \
57008 int16_t __s0_650 = __p0_650; \58678 int16_t __s0_742 = __p0_742; \
57009 int16x8_t __s1_650 = __p1_650; \58679 int16x8_t __s1_742 = __p1_742; \
57010 int16x8_t __rev1_650; __rev1_650 = __builtin_shufflevector(__s1_650, __s1_650, 7, 6, 5, 4, 3, 2, 1, 0); \58680 int16x8_t __rev1_742; __rev1_742 = __builtin_shufflevector(__s1_742, __s1_742, 7, 6, 5, 4, 3, 2, 1, 0); \
57011 int32_t __ret_650; \58681 int32_t __ret_742; \
57012 __ret_650 = vqdmullh_s16(__s0_650, __noswap_vgetq_lane_s16(__rev1_650, __p2_650)); \58682 __ret_742 = vqdmullh_s16(__s0_742, __noswap_vgetq_lane_s16(__rev1_742, __p2_742)); \
57013 __ret_650; \58683 __ret_742; \
57014})58684})
57015#endif58685#endif
5701658686
57017#ifdef __LITTLE_ENDIAN__58687#ifdef __LITTLE_ENDIAN__
57018#define vqdmull_laneq_s32(__p0_651, __p1_651, __p2_651) __extension__ ({ \58688#define vqdmull_laneq_s32(__p0_743, __p1_743, __p2_743) __extension__ ({ \
57019 int32x2_t __s0_651 = __p0_651; \58689 int32x2_t __s0_743 = __p0_743; \
57020 int32x4_t __s1_651 = __p1_651; \58690 int32x4_t __s1_743 = __p1_743; \
57021 int64x2_t __ret_651; \58691 int64x2_t __ret_743; \
57022 __ret_651 = vqdmull_s32(__s0_651, splat_laneq_s32(__s1_651, __p2_651)); \58692 __ret_743 = vqdmull_s32(__s0_743, splat_laneq_s32(__s1_743, __p2_743)); \
57023 __ret_651; \58693 __ret_743; \
57024})58694})
57025#else58695#else
57026#define vqdmull_laneq_s32(__p0_652, __p1_652, __p2_652) __extension__ ({ \58696#define vqdmull_laneq_s32(__p0_744, __p1_744, __p2_744) __extension__ ({ \
57027 int32x2_t __s0_652 = __p0_652; \58697 int32x2_t __s0_744 = __p0_744; \
57028 int32x4_t __s1_652 = __p1_652; \58698 int32x4_t __s1_744 = __p1_744; \
57029 int32x2_t __rev0_652; __rev0_652 = __builtin_shufflevector(__s0_652, __s0_652, 1, 0); \58699 int32x2_t __rev0_744; __rev0_744 = __builtin_shufflevector(__s0_744, __s0_744, 1, 0); \
57030 int32x4_t __rev1_652; __rev1_652 = __builtin_shufflevector(__s1_652, __s1_652, 3, 2, 1, 0); \58700 int32x4_t __rev1_744; __rev1_744 = __builtin_shufflevector(__s1_744, __s1_744, 3, 2, 1, 0); \
57031 int64x2_t __ret_652; \58701 int64x2_t __ret_744; \
57032 __ret_652 = __noswap_vqdmull_s32(__rev0_652, __noswap_splat_laneq_s32(__rev1_652, __p2_652)); \58702 __ret_744 = __noswap_vqdmull_s32(__rev0_744, __noswap_splat_laneq_s32(__rev1_744, __p2_744)); \
57033 __ret_652 = __builtin_shufflevector(__ret_652, __ret_652, 1, 0); \58703 __ret_744 = __builtin_shufflevector(__ret_744, __ret_744, 1, 0); \
57034 __ret_652; \58704 __ret_744; \
57035})58705})
57036#endif58706#endif
5703758707
57038#ifdef __LITTLE_ENDIAN__58708#ifdef __LITTLE_ENDIAN__
57039#define vqdmull_laneq_s16(__p0_653, __p1_653, __p2_653) __extension__ ({ \58709#define vqdmull_laneq_s16(__p0_745, __p1_745, __p2_745) __extension__ ({ \
57040 int16x4_t __s0_653 = __p0_653; \58710 int16x4_t __s0_745 = __p0_745; \
57041 int16x8_t __s1_653 = __p1_653; \58711 int16x8_t __s1_745 = __p1_745; \
57042 int32x4_t __ret_653; \58712 int32x4_t __ret_745; \
57043 __ret_653 = vqdmull_s16(__s0_653, splat_laneq_s16(__s1_653, __p2_653)); \58713 __ret_745 = vqdmull_s16(__s0_745, splat_laneq_s16(__s1_745, __p2_745)); \
57044 __ret_653; \58714 __ret_745; \
57045})58715})
57046#else58716#else
57047#define vqdmull_laneq_s16(__p0_654, __p1_654, __p2_654) __extension__ ({ \58717#define vqdmull_laneq_s16(__p0_746, __p1_746, __p2_746) __extension__ ({ \
57048 int16x4_t __s0_654 = __p0_654; \58718 int16x4_t __s0_746 = __p0_746; \
57049 int16x8_t __s1_654 = __p1_654; \58719 int16x8_t __s1_746 = __p1_746; \
57050 int16x4_t __rev0_654; __rev0_654 = __builtin_shufflevector(__s0_654, __s0_654, 3, 2, 1, 0); \58720 int16x4_t __rev0_746; __rev0_746 = __builtin_shufflevector(__s0_746, __s0_746, 3, 2, 1, 0); \
57051 int16x8_t __rev1_654; __rev1_654 = __builtin_shufflevector(__s1_654, __s1_654, 7, 6, 5, 4, 3, 2, 1, 0); \58721 int16x8_t __rev1_746; __rev1_746 = __builtin_shufflevector(__s1_746, __s1_746, 7, 6, 5, 4, 3, 2, 1, 0); \
57052 int32x4_t __ret_654; \58722 int32x4_t __ret_746; \
57053 __ret_654 = __noswap_vqdmull_s16(__rev0_654, __noswap_splat_laneq_s16(__rev1_654, __p2_654)); \58723 __ret_746 = __noswap_vqdmull_s16(__rev0_746, __noswap_splat_laneq_s16(__rev1_746, __p2_746)); \
57054 __ret_654 = __builtin_shufflevector(__ret_654, __ret_654, 3, 2, 1, 0); \58724 __ret_746 = __builtin_shufflevector(__ret_746, __ret_746, 3, 2, 1, 0); \
57055 __ret_654; \58725 __ret_746; \
57056})58726})
57057#endif58727#endif
5705858728
...@@ -57188,30 +58858,30 @@ __ai int8x16_t vqmovn_high_s16(int8x8_t __p0, int16x8_t __p1) {...@@ -57188,30 +58858,30 @@ __ai int8x16_t vqmovn_high_s16(int8x8_t __p0, int16x8_t __p1) {
57188}58858}
57189#endif58859#endif
5719058860
57191__ai int16_t vqmovuns_s32(int32_t __p0) {58861__ai uint16_t vqmovuns_s32(int32_t __p0) {
57192 int16_t __ret;58862 uint16_t __ret;
57193 __ret = (int16_t) __builtin_neon_vqmovuns_s32(__p0);58863 __ret = (uint16_t) __builtin_neon_vqmovuns_s32(__p0);
57194 return __ret;58864 return __ret;
57195}58865}
57196__ai int32_t vqmovund_s64(int64_t __p0) {58866__ai uint32_t vqmovund_s64(int64_t __p0) {
57197 int32_t __ret;58867 uint32_t __ret;
57198 __ret = (int32_t) __builtin_neon_vqmovund_s64(__p0);58868 __ret = (uint32_t) __builtin_neon_vqmovund_s64(__p0);
57199 return __ret;58869 return __ret;
57200}58870}
57201__ai int8_t vqmovunh_s16(int16_t __p0) {58871__ai uint8_t vqmovunh_s16(int16_t __p0) {
57202 int8_t __ret;58872 uint8_t __ret;
57203 __ret = (int8_t) __builtin_neon_vqmovunh_s16(__p0);58873 __ret = (uint8_t) __builtin_neon_vqmovunh_s16(__p0);
57204 return __ret;58874 return __ret;
57205}58875}
57206#ifdef __LITTLE_ENDIAN__58876#ifdef __LITTLE_ENDIAN__
57207__ai uint16x8_t vqmovun_high_s32(int16x4_t __p0, int32x4_t __p1) {58877__ai uint16x8_t vqmovun_high_s32(uint16x4_t __p0, int32x4_t __p1) {
57208 uint16x8_t __ret;58878 uint16x8_t __ret;
57209 __ret = vcombine_u16((uint16x4_t)(__p0), vqmovun_s32(__p1));58879 __ret = vcombine_u16((uint16x4_t)(__p0), vqmovun_s32(__p1));
57210 return __ret;58880 return __ret;
57211}58881}
57212#else58882#else
57213__ai uint16x8_t vqmovun_high_s32(int16x4_t __p0, int32x4_t __p1) {58883__ai uint16x8_t vqmovun_high_s32(uint16x4_t __p0, int32x4_t __p1) {
57214 int16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);58884 uint16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
57215 int32x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);58885 int32x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);
57216 uint16x8_t __ret;58886 uint16x8_t __ret;
57217 __ret = __noswap_vcombine_u16((uint16x4_t)(__rev0), __noswap_vqmovun_s32(__rev1));58887 __ret = __noswap_vcombine_u16((uint16x4_t)(__rev0), __noswap_vqmovun_s32(__rev1));
...@@ -57221,14 +58891,14 @@ __ai uint16x8_t vqmovun_high_s32(int16x4_t __p0, int32x4_t __p1) {...@@ -57221,14 +58891,14 @@ __ai uint16x8_t vqmovun_high_s32(int16x4_t __p0, int32x4_t __p1) {
57221#endif58891#endif
5722258892
57223#ifdef __LITTLE_ENDIAN__58893#ifdef __LITTLE_ENDIAN__
57224__ai uint32x4_t vqmovun_high_s64(int32x2_t __p0, int64x2_t __p1) {58894__ai uint32x4_t vqmovun_high_s64(uint32x2_t __p0, int64x2_t __p1) {
57225 uint32x4_t __ret;58895 uint32x4_t __ret;
57226 __ret = vcombine_u32((uint32x2_t)(__p0), vqmovun_s64(__p1));58896 __ret = vcombine_u32((uint32x2_t)(__p0), vqmovun_s64(__p1));
57227 return __ret;58897 return __ret;
57228}58898}
57229#else58899#else
57230__ai uint32x4_t vqmovun_high_s64(int32x2_t __p0, int64x2_t __p1) {58900__ai uint32x4_t vqmovun_high_s64(uint32x2_t __p0, int64x2_t __p1) {
57231 int32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);58901 uint32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
57232 int64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);58902 int64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
57233 uint32x4_t __ret;58903 uint32x4_t __ret;
57234 __ret = __noswap_vcombine_u32((uint32x2_t)(__rev0), __noswap_vqmovun_s64(__rev1));58904 __ret = __noswap_vcombine_u32((uint32x2_t)(__rev0), __noswap_vqmovun_s64(__rev1));
...@@ -57238,14 +58908,14 @@ __ai uint32x4_t vqmovun_high_s64(int32x2_t __p0, int64x2_t __p1) {...@@ -57238,14 +58908,14 @@ __ai uint32x4_t vqmovun_high_s64(int32x2_t __p0, int64x2_t __p1) {
57238#endif58908#endif
5723958909
57240#ifdef __LITTLE_ENDIAN__58910#ifdef __LITTLE_ENDIAN__
57241__ai uint8x16_t vqmovun_high_s16(int8x8_t __p0, int16x8_t __p1) {58911__ai uint8x16_t vqmovun_high_s16(uint8x8_t __p0, int16x8_t __p1) {
57242 uint8x16_t __ret;58912 uint8x16_t __ret;
57243 __ret = vcombine_u8((uint8x8_t)(__p0), vqmovun_s16(__p1));58913 __ret = vcombine_u8((uint8x8_t)(__p0), vqmovun_s16(__p1));
57244 return __ret;58914 return __ret;
57245}58915}
57246#else58916#else
57247__ai uint8x16_t vqmovun_high_s16(int8x8_t __p0, int16x8_t __p1) {58917__ai uint8x16_t vqmovun_high_s16(uint8x8_t __p0, int16x8_t __p1) {
57248 int8x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);58918 uint8x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);
57249 int16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 7, 6, 5, 4, 3, 2, 1, 0);58919 int16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 7, 6, 5, 4, 3, 2, 1, 0);
57250 uint8x16_t __ret;58920 uint8x16_t __ret;
57251 __ret = __noswap_vcombine_u8((uint8x8_t)(__rev0), __noswap_vqmovun_s16(__rev1));58921 __ret = __noswap_vcombine_u8((uint8x8_t)(__rev0), __noswap_vqmovun_s16(__rev1));
...@@ -57390,78 +59060,78 @@ __ai int16_t vqrdmulhh_s16(int16_t __p0, int16_t __p1) {...@@ -57390,78 +59060,78 @@ __ai int16_t vqrdmulhh_s16(int16_t __p0, int16_t __p1) {
57390#endif59060#endif
5739159061
57392#ifdef __LITTLE_ENDIAN__59062#ifdef __LITTLE_ENDIAN__
57393#define vqrdmulhs_lane_s32(__p0_655, __p1_655, __p2_655) __extension__ ({ \59063#define vqrdmulhs_lane_s32(__p0_747, __p1_747, __p2_747) __extension__ ({ \
57394 int32_t __s0_655 = __p0_655; \59064 int32_t __s0_747 = __p0_747; \
57395 int32x2_t __s1_655 = __p1_655; \59065 int32x2_t __s1_747 = __p1_747; \
57396 int32_t __ret_655; \59066 int32_t __ret_747; \
57397 __ret_655 = vqrdmulhs_s32(__s0_655, vget_lane_s32(__s1_655, __p2_655)); \59067 __ret_747 = vqrdmulhs_s32(__s0_747, vget_lane_s32(__s1_747, __p2_747)); \
57398 __ret_655; \59068 __ret_747; \
57399})59069})
57400#else59070#else
57401#define vqrdmulhs_lane_s32(__p0_656, __p1_656, __p2_656) __extension__ ({ \59071#define vqrdmulhs_lane_s32(__p0_748, __p1_748, __p2_748) __extension__ ({ \
57402 int32_t __s0_656 = __p0_656; \59072 int32_t __s0_748 = __p0_748; \
57403 int32x2_t __s1_656 = __p1_656; \59073 int32x2_t __s1_748 = __p1_748; \
57404 int32x2_t __rev1_656; __rev1_656 = __builtin_shufflevector(__s1_656, __s1_656, 1, 0); \59074 int32x2_t __rev1_748; __rev1_748 = __builtin_shufflevector(__s1_748, __s1_748, 1, 0); \
57405 int32_t __ret_656; \59075 int32_t __ret_748; \
57406 __ret_656 = vqrdmulhs_s32(__s0_656, __noswap_vget_lane_s32(__rev1_656, __p2_656)); \59076 __ret_748 = vqrdmulhs_s32(__s0_748, __noswap_vget_lane_s32(__rev1_748, __p2_748)); \
57407 __ret_656; \59077 __ret_748; \
57408})59078})
57409#endif59079#endif
5741059080
57411#ifdef __LITTLE_ENDIAN__59081#ifdef __LITTLE_ENDIAN__
57412#define vqrdmulhh_lane_s16(__p0_657, __p1_657, __p2_657) __extension__ ({ \59082#define vqrdmulhh_lane_s16(__p0_749, __p1_749, __p2_749) __extension__ ({ \
57413 int16_t __s0_657 = __p0_657; \59083 int16_t __s0_749 = __p0_749; \
57414 int16x4_t __s1_657 = __p1_657; \59084 int16x4_t __s1_749 = __p1_749; \
57415 int16_t __ret_657; \59085 int16_t __ret_749; \
57416 __ret_657 = vqrdmulhh_s16(__s0_657, vget_lane_s16(__s1_657, __p2_657)); \59086 __ret_749 = vqrdmulhh_s16(__s0_749, vget_lane_s16(__s1_749, __p2_749)); \
57417 __ret_657; \59087 __ret_749; \
57418})59088})
57419#else59089#else
57420#define vqrdmulhh_lane_s16(__p0_658, __p1_658, __p2_658) __extension__ ({ \59090#define vqrdmulhh_lane_s16(__p0_750, __p1_750, __p2_750) __extension__ ({ \
57421 int16_t __s0_658 = __p0_658; \59091 int16_t __s0_750 = __p0_750; \
57422 int16x4_t __s1_658 = __p1_658; \59092 int16x4_t __s1_750 = __p1_750; \
57423 int16x4_t __rev1_658; __rev1_658 = __builtin_shufflevector(__s1_658, __s1_658, 3, 2, 1, 0); \59093 int16x4_t __rev1_750; __rev1_750 = __builtin_shufflevector(__s1_750, __s1_750, 3, 2, 1, 0); \
57424 int16_t __ret_658; \59094 int16_t __ret_750; \
57425 __ret_658 = vqrdmulhh_s16(__s0_658, __noswap_vget_lane_s16(__rev1_658, __p2_658)); \59095 __ret_750 = vqrdmulhh_s16(__s0_750, __noswap_vget_lane_s16(__rev1_750, __p2_750)); \
57426 __ret_658; \59096 __ret_750; \
57427})59097})
57428#endif59098#endif
5742959099
57430#ifdef __LITTLE_ENDIAN__59100#ifdef __LITTLE_ENDIAN__
57431#define vqrdmulhs_laneq_s32(__p0_659, __p1_659, __p2_659) __extension__ ({ \59101#define vqrdmulhs_laneq_s32(__p0_751, __p1_751, __p2_751) __extension__ ({ \
57432 int32_t __s0_659 = __p0_659; \59102 int32_t __s0_751 = __p0_751; \
57433 int32x4_t __s1_659 = __p1_659; \59103 int32x4_t __s1_751 = __p1_751; \
57434 int32_t __ret_659; \59104 int32_t __ret_751; \
57435 __ret_659 = vqrdmulhs_s32(__s0_659, vgetq_lane_s32(__s1_659, __p2_659)); \59105 __ret_751 = vqrdmulhs_s32(__s0_751, vgetq_lane_s32(__s1_751, __p2_751)); \
57436 __ret_659; \59106 __ret_751; \
57437})59107})
57438#else59108#else
57439#define vqrdmulhs_laneq_s32(__p0_660, __p1_660, __p2_660) __extension__ ({ \59109#define vqrdmulhs_laneq_s32(__p0_752, __p1_752, __p2_752) __extension__ ({ \
57440 int32_t __s0_660 = __p0_660; \59110 int32_t __s0_752 = __p0_752; \
57441 int32x4_t __s1_660 = __p1_660; \59111 int32x4_t __s1_752 = __p1_752; \
57442 int32x4_t __rev1_660; __rev1_660 = __builtin_shufflevector(__s1_660, __s1_660, 3, 2, 1, 0); \59112 int32x4_t __rev1_752; __rev1_752 = __builtin_shufflevector(__s1_752, __s1_752, 3, 2, 1, 0); \
57443 int32_t __ret_660; \59113 int32_t __ret_752; \
57444 __ret_660 = vqrdmulhs_s32(__s0_660, __noswap_vgetq_lane_s32(__rev1_660, __p2_660)); \59114 __ret_752 = vqrdmulhs_s32(__s0_752, __noswap_vgetq_lane_s32(__rev1_752, __p2_752)); \
57445 __ret_660; \59115 __ret_752; \
57446})59116})
57447#endif59117#endif
5744859118
57449#ifdef __LITTLE_ENDIAN__59119#ifdef __LITTLE_ENDIAN__
57450#define vqrdmulhh_laneq_s16(__p0_661, __p1_661, __p2_661) __extension__ ({ \59120#define vqrdmulhh_laneq_s16(__p0_753, __p1_753, __p2_753) __extension__ ({ \
57451 int16_t __s0_661 = __p0_661; \59121 int16_t __s0_753 = __p0_753; \
57452 int16x8_t __s1_661 = __p1_661; \59122 int16x8_t __s1_753 = __p1_753; \
57453 int16_t __ret_661; \59123 int16_t __ret_753; \
57454 __ret_661 = vqrdmulhh_s16(__s0_661, vgetq_lane_s16(__s1_661, __p2_661)); \59124 __ret_753 = vqrdmulhh_s16(__s0_753, vgetq_lane_s16(__s1_753, __p2_753)); \
57455 __ret_661; \59125 __ret_753; \
57456})59126})
57457#else59127#else
57458#define vqrdmulhh_laneq_s16(__p0_662, __p1_662, __p2_662) __extension__ ({ \59128#define vqrdmulhh_laneq_s16(__p0_754, __p1_754, __p2_754) __extension__ ({ \
57459 int16_t __s0_662 = __p0_662; \59129 int16_t __s0_754 = __p0_754; \
57460 int16x8_t __s1_662 = __p1_662; \59130 int16x8_t __s1_754 = __p1_754; \
57461 int16x8_t __rev1_662; __rev1_662 = __builtin_shufflevector(__s1_662, __s1_662, 7, 6, 5, 4, 3, 2, 1, 0); \59131 int16x8_t __rev1_754; __rev1_754 = __builtin_shufflevector(__s1_754, __s1_754, 7, 6, 5, 4, 3, 2, 1, 0); \
57462 int16_t __ret_662; \59132 int16_t __ret_754; \
57463 __ret_662 = vqrdmulhh_s16(__s0_662, __noswap_vgetq_lane_s16(__rev1_662, __p2_662)); \59133 __ret_754 = vqrdmulhh_s16(__s0_754, __noswap_vgetq_lane_s16(__rev1_754, __p2_754)); \
57464 __ret_662; \59134 __ret_754; \
57465})59135})
57466#endif59136#endif
5746759137
...@@ -57549,22 +59219,22 @@ __ai int16_t vqrdmulhh_s16(int16_t __p0, int16_t __p1) {...@@ -57549,22 +59219,22 @@ __ai int16_t vqrdmulhh_s16(int16_t __p0, int16_t __p1) {
57549})59219})
57550#endif59220#endif
5755159221
57552__ai uint8_t vqrshlb_u8(uint8_t __p0, uint8_t __p1) {59222__ai uint8_t vqrshlb_u8(uint8_t __p0, int8_t __p1) {
57553 uint8_t __ret;59223 uint8_t __ret;
57554 __ret = (uint8_t) __builtin_neon_vqrshlb_u8(__p0, __p1);59224 __ret = (uint8_t) __builtin_neon_vqrshlb_u8(__p0, __p1);
57555 return __ret;59225 return __ret;
57556}59226}
57557__ai uint32_t vqrshls_u32(uint32_t __p0, uint32_t __p1) {59227__ai uint32_t vqrshls_u32(uint32_t __p0, int32_t __p1) {
57558 uint32_t __ret;59228 uint32_t __ret;
57559 __ret = (uint32_t) __builtin_neon_vqrshls_u32(__p0, __p1);59229 __ret = (uint32_t) __builtin_neon_vqrshls_u32(__p0, __p1);
57560 return __ret;59230 return __ret;
57561}59231}
57562__ai uint64_t vqrshld_u64(uint64_t __p0, uint64_t __p1) {59232__ai uint64_t vqrshld_u64(uint64_t __p0, int64_t __p1) {
57563 uint64_t __ret;59233 uint64_t __ret;
57564 __ret = (uint64_t) __builtin_neon_vqrshld_u64(__p0, __p1);59234 __ret = (uint64_t) __builtin_neon_vqrshld_u64(__p0, __p1);
57565 return __ret;59235 return __ret;
57566}59236}
57567__ai uint16_t vqrshlh_u16(uint16_t __p0, uint16_t __p1) {59237__ai uint16_t vqrshlh_u16(uint16_t __p0, int16_t __p1) {
57568 uint16_t __ret;59238 uint16_t __ret;
57569 __ret = (uint16_t) __builtin_neon_vqrshlh_u16(__p0, __p1);59239 __ret = (uint16_t) __builtin_neon_vqrshlh_u16(__p0, __p1);
57570 return __ret;59240 return __ret;
...@@ -57590,128 +59260,128 @@ __ai int16_t vqrshlh_s16(int16_t __p0, int16_t __p1) {...@@ -57590,128 +59260,128 @@ __ai int16_t vqrshlh_s16(int16_t __p0, int16_t __p1) {
57590 return __ret;59260 return __ret;
57591}59261}
57592#ifdef __LITTLE_ENDIAN__59262#ifdef __LITTLE_ENDIAN__
57593#define vqrshrn_high_n_u32(__p0_663, __p1_663, __p2_663) __extension__ ({ \59263#define vqrshrn_high_n_u32(__p0_755, __p1_755, __p2_755) __extension__ ({ \
57594 uint16x4_t __s0_663 = __p0_663; \59264 uint16x4_t __s0_755 = __p0_755; \
57595 uint32x4_t __s1_663 = __p1_663; \59265 uint32x4_t __s1_755 = __p1_755; \
57596 uint16x8_t __ret_663; \59266 uint16x8_t __ret_755; \
57597 __ret_663 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_663), (uint16x4_t)(vqrshrn_n_u32(__s1_663, __p2_663)))); \59267 __ret_755 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_755), (uint16x4_t)(vqrshrn_n_u32(__s1_755, __p2_755)))); \
57598 __ret_663; \59268 __ret_755; \
57599})59269})
57600#else59270#else
57601#define vqrshrn_high_n_u32(__p0_664, __p1_664, __p2_664) __extension__ ({ \59271#define vqrshrn_high_n_u32(__p0_756, __p1_756, __p2_756) __extension__ ({ \
57602 uint16x4_t __s0_664 = __p0_664; \59272 uint16x4_t __s0_756 = __p0_756; \
57603 uint32x4_t __s1_664 = __p1_664; \59273 uint32x4_t __s1_756 = __p1_756; \
57604 uint16x4_t __rev0_664; __rev0_664 = __builtin_shufflevector(__s0_664, __s0_664, 3, 2, 1, 0); \59274 uint16x4_t __rev0_756; __rev0_756 = __builtin_shufflevector(__s0_756, __s0_756, 3, 2, 1, 0); \
57605 uint32x4_t __rev1_664; __rev1_664 = __builtin_shufflevector(__s1_664, __s1_664, 3, 2, 1, 0); \59275 uint32x4_t __rev1_756; __rev1_756 = __builtin_shufflevector(__s1_756, __s1_756, 3, 2, 1, 0); \
57606 uint16x8_t __ret_664; \59276 uint16x8_t __ret_756; \
57607 __ret_664 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_664), (uint16x4_t)(__noswap_vqrshrn_n_u32(__rev1_664, __p2_664)))); \59277 __ret_756 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_756), (uint16x4_t)(__noswap_vqrshrn_n_u32(__rev1_756, __p2_756)))); \
57608 __ret_664 = __builtin_shufflevector(__ret_664, __ret_664, 7, 6, 5, 4, 3, 2, 1, 0); \59278 __ret_756 = __builtin_shufflevector(__ret_756, __ret_756, 7, 6, 5, 4, 3, 2, 1, 0); \
57609 __ret_664; \59279 __ret_756; \
57610})59280})
57611#endif59281#endif
5761259282
57613#ifdef __LITTLE_ENDIAN__59283#ifdef __LITTLE_ENDIAN__
57614#define vqrshrn_high_n_u64(__p0_665, __p1_665, __p2_665) __extension__ ({ \59284#define vqrshrn_high_n_u64(__p0_757, __p1_757, __p2_757) __extension__ ({ \
57615 uint32x2_t __s0_665 = __p0_665; \59285 uint32x2_t __s0_757 = __p0_757; \
57616 uint64x2_t __s1_665 = __p1_665; \59286 uint64x2_t __s1_757 = __p1_757; \
57617 uint32x4_t __ret_665; \59287 uint32x4_t __ret_757; \
57618 __ret_665 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_665), (uint32x2_t)(vqrshrn_n_u64(__s1_665, __p2_665)))); \59288 __ret_757 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_757), (uint32x2_t)(vqrshrn_n_u64(__s1_757, __p2_757)))); \
57619 __ret_665; \59289 __ret_757; \
57620})59290})
57621#else59291#else
57622#define vqrshrn_high_n_u64(__p0_666, __p1_666, __p2_666) __extension__ ({ \59292#define vqrshrn_high_n_u64(__p0_758, __p1_758, __p2_758) __extension__ ({ \
57623 uint32x2_t __s0_666 = __p0_666; \59293 uint32x2_t __s0_758 = __p0_758; \
57624 uint64x2_t __s1_666 = __p1_666; \59294 uint64x2_t __s1_758 = __p1_758; \
57625 uint32x2_t __rev0_666; __rev0_666 = __builtin_shufflevector(__s0_666, __s0_666, 1, 0); \59295 uint32x2_t __rev0_758; __rev0_758 = __builtin_shufflevector(__s0_758, __s0_758, 1, 0); \
57626 uint64x2_t __rev1_666; __rev1_666 = __builtin_shufflevector(__s1_666, __s1_666, 1, 0); \59296 uint64x2_t __rev1_758; __rev1_758 = __builtin_shufflevector(__s1_758, __s1_758, 1, 0); \
57627 uint32x4_t __ret_666; \59297 uint32x4_t __ret_758; \
57628 __ret_666 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_666), (uint32x2_t)(__noswap_vqrshrn_n_u64(__rev1_666, __p2_666)))); \59298 __ret_758 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_758), (uint32x2_t)(__noswap_vqrshrn_n_u64(__rev1_758, __p2_758)))); \
57629 __ret_666 = __builtin_shufflevector(__ret_666, __ret_666, 3, 2, 1, 0); \59299 __ret_758 = __builtin_shufflevector(__ret_758, __ret_758, 3, 2, 1, 0); \
57630 __ret_666; \59300 __ret_758; \
57631})59301})
57632#endif59302#endif
5763359303
57634#ifdef __LITTLE_ENDIAN__59304#ifdef __LITTLE_ENDIAN__
57635#define vqrshrn_high_n_u16(__p0_667, __p1_667, __p2_667) __extension__ ({ \59305#define vqrshrn_high_n_u16(__p0_759, __p1_759, __p2_759) __extension__ ({ \
57636 uint8x8_t __s0_667 = __p0_667; \59306 uint8x8_t __s0_759 = __p0_759; \
57637 uint16x8_t __s1_667 = __p1_667; \59307 uint16x8_t __s1_759 = __p1_759; \
57638 uint8x16_t __ret_667; \59308 uint8x16_t __ret_759; \
57639 __ret_667 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_667), (uint8x8_t)(vqrshrn_n_u16(__s1_667, __p2_667)))); \59309 __ret_759 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_759), (uint8x8_t)(vqrshrn_n_u16(__s1_759, __p2_759)))); \
57640 __ret_667; \59310 __ret_759; \
57641})59311})
57642#else59312#else
57643#define vqrshrn_high_n_u16(__p0_668, __p1_668, __p2_668) __extension__ ({ \59313#define vqrshrn_high_n_u16(__p0_760, __p1_760, __p2_760) __extension__ ({ \
57644 uint8x8_t __s0_668 = __p0_668; \59314 uint8x8_t __s0_760 = __p0_760; \
57645 uint16x8_t __s1_668 = __p1_668; \59315 uint16x8_t __s1_760 = __p1_760; \
57646 uint8x8_t __rev0_668; __rev0_668 = __builtin_shufflevector(__s0_668, __s0_668, 7, 6, 5, 4, 3, 2, 1, 0); \59316 uint8x8_t __rev0_760; __rev0_760 = __builtin_shufflevector(__s0_760, __s0_760, 7, 6, 5, 4, 3, 2, 1, 0); \
57647 uint16x8_t __rev1_668; __rev1_668 = __builtin_shufflevector(__s1_668, __s1_668, 7, 6, 5, 4, 3, 2, 1, 0); \59317 uint16x8_t __rev1_760; __rev1_760 = __builtin_shufflevector(__s1_760, __s1_760, 7, 6, 5, 4, 3, 2, 1, 0); \
57648 uint8x16_t __ret_668; \59318 uint8x16_t __ret_760; \
57649 __ret_668 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_668), (uint8x8_t)(__noswap_vqrshrn_n_u16(__rev1_668, __p2_668)))); \59319 __ret_760 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_760), (uint8x8_t)(__noswap_vqrshrn_n_u16(__rev1_760, __p2_760)))); \
57650 __ret_668 = __builtin_shufflevector(__ret_668, __ret_668, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \59320 __ret_760 = __builtin_shufflevector(__ret_760, __ret_760, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
57651 __ret_668; \59321 __ret_760; \
57652})59322})
57653#endif59323#endif
5765459324
57655#ifdef __LITTLE_ENDIAN__59325#ifdef __LITTLE_ENDIAN__
57656#define vqrshrn_high_n_s32(__p0_669, __p1_669, __p2_669) __extension__ ({ \59326#define vqrshrn_high_n_s32(__p0_761, __p1_761, __p2_761) __extension__ ({ \
57657 int16x4_t __s0_669 = __p0_669; \59327 int16x4_t __s0_761 = __p0_761; \
57658 int32x4_t __s1_669 = __p1_669; \59328 int32x4_t __s1_761 = __p1_761; \
57659 int16x8_t __ret_669; \59329 int16x8_t __ret_761; \
57660 __ret_669 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_669), (int16x4_t)(vqrshrn_n_s32(__s1_669, __p2_669)))); \59330 __ret_761 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_761), (int16x4_t)(vqrshrn_n_s32(__s1_761, __p2_761)))); \
57661 __ret_669; \59331 __ret_761; \
57662})59332})
57663#else59333#else
57664#define vqrshrn_high_n_s32(__p0_670, __p1_670, __p2_670) __extension__ ({ \59334#define vqrshrn_high_n_s32(__p0_762, __p1_762, __p2_762) __extension__ ({ \
57665 int16x4_t __s0_670 = __p0_670; \59335 int16x4_t __s0_762 = __p0_762; \
57666 int32x4_t __s1_670 = __p1_670; \59336 int32x4_t __s1_762 = __p1_762; \
57667 int16x4_t __rev0_670; __rev0_670 = __builtin_shufflevector(__s0_670, __s0_670, 3, 2, 1, 0); \59337 int16x4_t __rev0_762; __rev0_762 = __builtin_shufflevector(__s0_762, __s0_762, 3, 2, 1, 0); \
57668 int32x4_t __rev1_670; __rev1_670 = __builtin_shufflevector(__s1_670, __s1_670, 3, 2, 1, 0); \59338 int32x4_t __rev1_762; __rev1_762 = __builtin_shufflevector(__s1_762, __s1_762, 3, 2, 1, 0); \
57669 int16x8_t __ret_670; \59339 int16x8_t __ret_762; \
57670 __ret_670 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_670), (int16x4_t)(__noswap_vqrshrn_n_s32(__rev1_670, __p2_670)))); \59340 __ret_762 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_762), (int16x4_t)(__noswap_vqrshrn_n_s32(__rev1_762, __p2_762)))); \
57671 __ret_670 = __builtin_shufflevector(__ret_670, __ret_670, 7, 6, 5, 4, 3, 2, 1, 0); \59341 __ret_762 = __builtin_shufflevector(__ret_762, __ret_762, 7, 6, 5, 4, 3, 2, 1, 0); \
57672 __ret_670; \59342 __ret_762; \
57673})59343})
57674#endif59344#endif
5767559345
57676#ifdef __LITTLE_ENDIAN__59346#ifdef __LITTLE_ENDIAN__
57677#define vqrshrn_high_n_s64(__p0_671, __p1_671, __p2_671) __extension__ ({ \59347#define vqrshrn_high_n_s64(__p0_763, __p1_763, __p2_763) __extension__ ({ \
57678 int32x2_t __s0_671 = __p0_671; \59348 int32x2_t __s0_763 = __p0_763; \
57679 int64x2_t __s1_671 = __p1_671; \59349 int64x2_t __s1_763 = __p1_763; \
57680 int32x4_t __ret_671; \59350 int32x4_t __ret_763; \
57681 __ret_671 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_671), (int32x2_t)(vqrshrn_n_s64(__s1_671, __p2_671)))); \59351 __ret_763 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_763), (int32x2_t)(vqrshrn_n_s64(__s1_763, __p2_763)))); \
57682 __ret_671; \59352 __ret_763; \
57683})59353})
57684#else59354#else
57685#define vqrshrn_high_n_s64(__p0_672, __p1_672, __p2_672) __extension__ ({ \59355#define vqrshrn_high_n_s64(__p0_764, __p1_764, __p2_764) __extension__ ({ \
57686 int32x2_t __s0_672 = __p0_672; \59356 int32x2_t __s0_764 = __p0_764; \
57687 int64x2_t __s1_672 = __p1_672; \59357 int64x2_t __s1_764 = __p1_764; \
57688 int32x2_t __rev0_672; __rev0_672 = __builtin_shufflevector(__s0_672, __s0_672, 1, 0); \59358 int32x2_t __rev0_764; __rev0_764 = __builtin_shufflevector(__s0_764, __s0_764, 1, 0); \
57689 int64x2_t __rev1_672; __rev1_672 = __builtin_shufflevector(__s1_672, __s1_672, 1, 0); \59359 int64x2_t __rev1_764; __rev1_764 = __builtin_shufflevector(__s1_764, __s1_764, 1, 0); \
57690 int32x4_t __ret_672; \59360 int32x4_t __ret_764; \
57691 __ret_672 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_672), (int32x2_t)(__noswap_vqrshrn_n_s64(__rev1_672, __p2_672)))); \59361 __ret_764 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_764), (int32x2_t)(__noswap_vqrshrn_n_s64(__rev1_764, __p2_764)))); \
57692 __ret_672 = __builtin_shufflevector(__ret_672, __ret_672, 3, 2, 1, 0); \59362 __ret_764 = __builtin_shufflevector(__ret_764, __ret_764, 3, 2, 1, 0); \
57693 __ret_672; \59363 __ret_764; \
57694})59364})
57695#endif59365#endif
5769659366
57697#ifdef __LITTLE_ENDIAN__59367#ifdef __LITTLE_ENDIAN__
57698#define vqrshrn_high_n_s16(__p0_673, __p1_673, __p2_673) __extension__ ({ \59368#define vqrshrn_high_n_s16(__p0_765, __p1_765, __p2_765) __extension__ ({ \
57699 int8x8_t __s0_673 = __p0_673; \59369 int8x8_t __s0_765 = __p0_765; \
57700 int16x8_t __s1_673 = __p1_673; \59370 int16x8_t __s1_765 = __p1_765; \
57701 int8x16_t __ret_673; \59371 int8x16_t __ret_765; \
57702 __ret_673 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_673), (int8x8_t)(vqrshrn_n_s16(__s1_673, __p2_673)))); \59372 __ret_765 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_765), (int8x8_t)(vqrshrn_n_s16(__s1_765, __p2_765)))); \
57703 __ret_673; \59373 __ret_765; \
57704})59374})
57705#else59375#else
57706#define vqrshrn_high_n_s16(__p0_674, __p1_674, __p2_674) __extension__ ({ \59376#define vqrshrn_high_n_s16(__p0_766, __p1_766, __p2_766) __extension__ ({ \
57707 int8x8_t __s0_674 = __p0_674; \59377 int8x8_t __s0_766 = __p0_766; \
57708 int16x8_t __s1_674 = __p1_674; \59378 int16x8_t __s1_766 = __p1_766; \
57709 int8x8_t __rev0_674; __rev0_674 = __builtin_shufflevector(__s0_674, __s0_674, 7, 6, 5, 4, 3, 2, 1, 0); \59379 int8x8_t __rev0_766; __rev0_766 = __builtin_shufflevector(__s0_766, __s0_766, 7, 6, 5, 4, 3, 2, 1, 0); \
57710 int16x8_t __rev1_674; __rev1_674 = __builtin_shufflevector(__s1_674, __s1_674, 7, 6, 5, 4, 3, 2, 1, 0); \59380 int16x8_t __rev1_766; __rev1_766 = __builtin_shufflevector(__s1_766, __s1_766, 7, 6, 5, 4, 3, 2, 1, 0); \
57711 int8x16_t __ret_674; \59381 int8x16_t __ret_766; \
57712 __ret_674 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_674), (int8x8_t)(__noswap_vqrshrn_n_s16(__rev1_674, __p2_674)))); \59382 __ret_766 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_766), (int8x8_t)(__noswap_vqrshrn_n_s16(__rev1_766, __p2_766)))); \
57713 __ret_674 = __builtin_shufflevector(__ret_674, __ret_674, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \59383 __ret_766 = __builtin_shufflevector(__ret_766, __ret_766, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
57714 __ret_674; \59384 __ret_766; \
57715})59385})
57716#endif59386#endif
5771759387
...@@ -57752,65 +59422,65 @@ __ai int16_t vqrshlh_s16(int16_t __p0, int16_t __p1) {...@@ -57752,65 +59422,65 @@ __ai int16_t vqrshlh_s16(int16_t __p0, int16_t __p1) {
57752 __ret; \59422 __ret; \
57753})59423})
57754#ifdef __LITTLE_ENDIAN__59424#ifdef __LITTLE_ENDIAN__
57755#define vqrshrun_high_n_s32(__p0_675, __p1_675, __p2_675) __extension__ ({ \59425#define vqrshrun_high_n_s32(__p0_767, __p1_767, __p2_767) __extension__ ({ \
57756 int16x4_t __s0_675 = __p0_675; \59426 int16x4_t __s0_767 = __p0_767; \
57757 int32x4_t __s1_675 = __p1_675; \59427 int32x4_t __s1_767 = __p1_767; \
57758 int16x8_t __ret_675; \59428 int16x8_t __ret_767; \
57759 __ret_675 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_675), (int16x4_t)(vqrshrun_n_s32(__s1_675, __p2_675)))); \59429 __ret_767 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_767), (int16x4_t)(vqrshrun_n_s32(__s1_767, __p2_767)))); \
57760 __ret_675; \59430 __ret_767; \
57761})59431})
57762#else59432#else
57763#define vqrshrun_high_n_s32(__p0_676, __p1_676, __p2_676) __extension__ ({ \59433#define vqrshrun_high_n_s32(__p0_768, __p1_768, __p2_768) __extension__ ({ \
57764 int16x4_t __s0_676 = __p0_676; \59434 int16x4_t __s0_768 = __p0_768; \
57765 int32x4_t __s1_676 = __p1_676; \59435 int32x4_t __s1_768 = __p1_768; \
57766 int16x4_t __rev0_676; __rev0_676 = __builtin_shufflevector(__s0_676, __s0_676, 3, 2, 1, 0); \59436 int16x4_t __rev0_768; __rev0_768 = __builtin_shufflevector(__s0_768, __s0_768, 3, 2, 1, 0); \
57767 int32x4_t __rev1_676; __rev1_676 = __builtin_shufflevector(__s1_676, __s1_676, 3, 2, 1, 0); \59437 int32x4_t __rev1_768; __rev1_768 = __builtin_shufflevector(__s1_768, __s1_768, 3, 2, 1, 0); \
57768 int16x8_t __ret_676; \59438 int16x8_t __ret_768; \
57769 __ret_676 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_676), (int16x4_t)(__noswap_vqrshrun_n_s32(__rev1_676, __p2_676)))); \59439 __ret_768 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_768), (int16x4_t)(__noswap_vqrshrun_n_s32(__rev1_768, __p2_768)))); \
57770 __ret_676 = __builtin_shufflevector(__ret_676, __ret_676, 7, 6, 5, 4, 3, 2, 1, 0); \59440 __ret_768 = __builtin_shufflevector(__ret_768, __ret_768, 7, 6, 5, 4, 3, 2, 1, 0); \
57771 __ret_676; \59441 __ret_768; \
57772})59442})
57773#endif59443#endif
5777459444
57775#ifdef __LITTLE_ENDIAN__59445#ifdef __LITTLE_ENDIAN__
57776#define vqrshrun_high_n_s64(__p0_677, __p1_677, __p2_677) __extension__ ({ \59446#define vqrshrun_high_n_s64(__p0_769, __p1_769, __p2_769) __extension__ ({ \
57777 int32x2_t __s0_677 = __p0_677; \59447 int32x2_t __s0_769 = __p0_769; \
57778 int64x2_t __s1_677 = __p1_677; \59448 int64x2_t __s1_769 = __p1_769; \
57779 int32x4_t __ret_677; \59449 int32x4_t __ret_769; \
57780 __ret_677 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_677), (int32x2_t)(vqrshrun_n_s64(__s1_677, __p2_677)))); \59450 __ret_769 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_769), (int32x2_t)(vqrshrun_n_s64(__s1_769, __p2_769)))); \
57781 __ret_677; \59451 __ret_769; \
57782})59452})
57783#else59453#else
57784#define vqrshrun_high_n_s64(__p0_678, __p1_678, __p2_678) __extension__ ({ \59454#define vqrshrun_high_n_s64(__p0_770, __p1_770, __p2_770) __extension__ ({ \
57785 int32x2_t __s0_678 = __p0_678; \59455 int32x2_t __s0_770 = __p0_770; \
57786 int64x2_t __s1_678 = __p1_678; \59456 int64x2_t __s1_770 = __p1_770; \
57787 int32x2_t __rev0_678; __rev0_678 = __builtin_shufflevector(__s0_678, __s0_678, 1, 0); \59457 int32x2_t __rev0_770; __rev0_770 = __builtin_shufflevector(__s0_770, __s0_770, 1, 0); \
57788 int64x2_t __rev1_678; __rev1_678 = __builtin_shufflevector(__s1_678, __s1_678, 1, 0); \59458 int64x2_t __rev1_770; __rev1_770 = __builtin_shufflevector(__s1_770, __s1_770, 1, 0); \
57789 int32x4_t __ret_678; \59459 int32x4_t __ret_770; \
57790 __ret_678 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_678), (int32x2_t)(__noswap_vqrshrun_n_s64(__rev1_678, __p2_678)))); \59460 __ret_770 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_770), (int32x2_t)(__noswap_vqrshrun_n_s64(__rev1_770, __p2_770)))); \
57791 __ret_678 = __builtin_shufflevector(__ret_678, __ret_678, 3, 2, 1, 0); \59461 __ret_770 = __builtin_shufflevector(__ret_770, __ret_770, 3, 2, 1, 0); \
57792 __ret_678; \59462 __ret_770; \
57793})59463})
57794#endif59464#endif
5779559465
57796#ifdef __LITTLE_ENDIAN__59466#ifdef __LITTLE_ENDIAN__
57797#define vqrshrun_high_n_s16(__p0_679, __p1_679, __p2_679) __extension__ ({ \59467#define vqrshrun_high_n_s16(__p0_771, __p1_771, __p2_771) __extension__ ({ \
57798 int8x8_t __s0_679 = __p0_679; \59468 int8x8_t __s0_771 = __p0_771; \
57799 int16x8_t __s1_679 = __p1_679; \59469 int16x8_t __s1_771 = __p1_771; \
57800 int8x16_t __ret_679; \59470 int8x16_t __ret_771; \
57801 __ret_679 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_679), (int8x8_t)(vqrshrun_n_s16(__s1_679, __p2_679)))); \59471 __ret_771 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_771), (int8x8_t)(vqrshrun_n_s16(__s1_771, __p2_771)))); \
57802 __ret_679; \59472 __ret_771; \
57803})59473})
57804#else59474#else
57805#define vqrshrun_high_n_s16(__p0_680, __p1_680, __p2_680) __extension__ ({ \59475#define vqrshrun_high_n_s16(__p0_772, __p1_772, __p2_772) __extension__ ({ \
57806 int8x8_t __s0_680 = __p0_680; \59476 int8x8_t __s0_772 = __p0_772; \
57807 int16x8_t __s1_680 = __p1_680; \59477 int16x8_t __s1_772 = __p1_772; \
57808 int8x8_t __rev0_680; __rev0_680 = __builtin_shufflevector(__s0_680, __s0_680, 7, 6, 5, 4, 3, 2, 1, 0); \59478 int8x8_t __rev0_772; __rev0_772 = __builtin_shufflevector(__s0_772, __s0_772, 7, 6, 5, 4, 3, 2, 1, 0); \
57809 int16x8_t __rev1_680; __rev1_680 = __builtin_shufflevector(__s1_680, __s1_680, 7, 6, 5, 4, 3, 2, 1, 0); \59479 int16x8_t __rev1_772; __rev1_772 = __builtin_shufflevector(__s1_772, __s1_772, 7, 6, 5, 4, 3, 2, 1, 0); \
57810 int8x16_t __ret_680; \59480 int8x16_t __ret_772; \
57811 __ret_680 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_680), (int8x8_t)(__noswap_vqrshrun_n_s16(__rev1_680, __p2_680)))); \59481 __ret_772 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_772), (int8x8_t)(__noswap_vqrshrun_n_s16(__rev1_772, __p2_772)))); \
57812 __ret_680 = __builtin_shufflevector(__ret_680, __ret_680, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \59482 __ret_772 = __builtin_shufflevector(__ret_772, __ret_772, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
57813 __ret_680; \59483 __ret_772; \
57814})59484})
57815#endif59485#endif
5781659486
...@@ -57832,22 +59502,22 @@ __ai int16_t vqrshlh_s16(int16_t __p0, int16_t __p1) {...@@ -57832,22 +59502,22 @@ __ai int16_t vqrshlh_s16(int16_t __p0, int16_t __p1) {
57832 __ret = (int8_t) __builtin_neon_vqrshrunh_n_s16(__s0, __p1); \59502 __ret = (int8_t) __builtin_neon_vqrshrunh_n_s16(__s0, __p1); \
57833 __ret; \59503 __ret; \
57834})59504})
57835__ai uint8_t vqshlb_u8(uint8_t __p0, uint8_t __p1) {59505__ai uint8_t vqshlb_u8(uint8_t __p0, int8_t __p1) {
57836 uint8_t __ret;59506 uint8_t __ret;
57837 __ret = (uint8_t) __builtin_neon_vqshlb_u8(__p0, __p1);59507 __ret = (uint8_t) __builtin_neon_vqshlb_u8(__p0, __p1);
57838 return __ret;59508 return __ret;
57839}59509}
57840__ai uint32_t vqshls_u32(uint32_t __p0, uint32_t __p1) {59510__ai uint32_t vqshls_u32(uint32_t __p0, int32_t __p1) {
57841 uint32_t __ret;59511 uint32_t __ret;
57842 __ret = (uint32_t) __builtin_neon_vqshls_u32(__p0, __p1);59512 __ret = (uint32_t) __builtin_neon_vqshls_u32(__p0, __p1);
57843 return __ret;59513 return __ret;
57844}59514}
57845__ai uint64_t vqshld_u64(uint64_t __p0, uint64_t __p1) {59515__ai uint64_t vqshld_u64(uint64_t __p0, int64_t __p1) {
57846 uint64_t __ret;59516 uint64_t __ret;
57847 __ret = (uint64_t) __builtin_neon_vqshld_u64(__p0, __p1);59517 __ret = (uint64_t) __builtin_neon_vqshld_u64(__p0, __p1);
57848 return __ret;59518 return __ret;
57849}59519}
57850__ai uint16_t vqshlh_u16(uint16_t __p0, uint16_t __p1) {59520__ai uint16_t vqshlh_u16(uint16_t __p0, int16_t __p1) {
57851 uint16_t __ret;59521 uint16_t __ret;
57852 __ret = (uint16_t) __builtin_neon_vqshlh_u16(__p0, __p1);59522 __ret = (uint16_t) __builtin_neon_vqshlh_u16(__p0, __p1);
57853 return __ret;59523 return __ret;
...@@ -57945,128 +59615,128 @@ __ai int16_t vqshlh_s16(int16_t __p0, int16_t __p1) {...@@ -57945,128 +59615,128 @@ __ai int16_t vqshlh_s16(int16_t __p0, int16_t __p1) {
57945 __ret; \59615 __ret; \
57946})59616})
57947#ifdef __LITTLE_ENDIAN__59617#ifdef __LITTLE_ENDIAN__
57948#define vqshrn_high_n_u32(__p0_681, __p1_681, __p2_681) __extension__ ({ \59618#define vqshrn_high_n_u32(__p0_773, __p1_773, __p2_773) __extension__ ({ \
57949 uint16x4_t __s0_681 = __p0_681; \59619 uint16x4_t __s0_773 = __p0_773; \
57950 uint32x4_t __s1_681 = __p1_681; \59620 uint32x4_t __s1_773 = __p1_773; \
57951 uint16x8_t __ret_681; \59621 uint16x8_t __ret_773; \
57952 __ret_681 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_681), (uint16x4_t)(vqshrn_n_u32(__s1_681, __p2_681)))); \59622 __ret_773 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_773), (uint16x4_t)(vqshrn_n_u32(__s1_773, __p2_773)))); \
57953 __ret_681; \59623 __ret_773; \
57954})59624})
57955#else59625#else
57956#define vqshrn_high_n_u32(__p0_682, __p1_682, __p2_682) __extension__ ({ \59626#define vqshrn_high_n_u32(__p0_774, __p1_774, __p2_774) __extension__ ({ \
57957 uint16x4_t __s0_682 = __p0_682; \59627 uint16x4_t __s0_774 = __p0_774; \
57958 uint32x4_t __s1_682 = __p1_682; \59628 uint32x4_t __s1_774 = __p1_774; \
57959 uint16x4_t __rev0_682; __rev0_682 = __builtin_shufflevector(__s0_682, __s0_682, 3, 2, 1, 0); \59629 uint16x4_t __rev0_774; __rev0_774 = __builtin_shufflevector(__s0_774, __s0_774, 3, 2, 1, 0); \
57960 uint32x4_t __rev1_682; __rev1_682 = __builtin_shufflevector(__s1_682, __s1_682, 3, 2, 1, 0); \59630 uint32x4_t __rev1_774; __rev1_774 = __builtin_shufflevector(__s1_774, __s1_774, 3, 2, 1, 0); \
57961 uint16x8_t __ret_682; \59631 uint16x8_t __ret_774; \
57962 __ret_682 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_682), (uint16x4_t)(__noswap_vqshrn_n_u32(__rev1_682, __p2_682)))); \59632 __ret_774 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_774), (uint16x4_t)(__noswap_vqshrn_n_u32(__rev1_774, __p2_774)))); \
57963 __ret_682 = __builtin_shufflevector(__ret_682, __ret_682, 7, 6, 5, 4, 3, 2, 1, 0); \59633 __ret_774 = __builtin_shufflevector(__ret_774, __ret_774, 7, 6, 5, 4, 3, 2, 1, 0); \
57964 __ret_682; \59634 __ret_774; \
57965})59635})
57966#endif59636#endif
5796759637
57968#ifdef __LITTLE_ENDIAN__59638#ifdef __LITTLE_ENDIAN__
57969#define vqshrn_high_n_u64(__p0_683, __p1_683, __p2_683) __extension__ ({ \59639#define vqshrn_high_n_u64(__p0_775, __p1_775, __p2_775) __extension__ ({ \
57970 uint32x2_t __s0_683 = __p0_683; \59640 uint32x2_t __s0_775 = __p0_775; \
57971 uint64x2_t __s1_683 = __p1_683; \59641 uint64x2_t __s1_775 = __p1_775; \
57972 uint32x4_t __ret_683; \59642 uint32x4_t __ret_775; \
57973 __ret_683 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_683), (uint32x2_t)(vqshrn_n_u64(__s1_683, __p2_683)))); \59643 __ret_775 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_775), (uint32x2_t)(vqshrn_n_u64(__s1_775, __p2_775)))); \
57974 __ret_683; \59644 __ret_775; \
57975})59645})
57976#else59646#else
57977#define vqshrn_high_n_u64(__p0_684, __p1_684, __p2_684) __extension__ ({ \59647#define vqshrn_high_n_u64(__p0_776, __p1_776, __p2_776) __extension__ ({ \
57978 uint32x2_t __s0_684 = __p0_684; \59648 uint32x2_t __s0_776 = __p0_776; \
57979 uint64x2_t __s1_684 = __p1_684; \59649 uint64x2_t __s1_776 = __p1_776; \
57980 uint32x2_t __rev0_684; __rev0_684 = __builtin_shufflevector(__s0_684, __s0_684, 1, 0); \59650 uint32x2_t __rev0_776; __rev0_776 = __builtin_shufflevector(__s0_776, __s0_776, 1, 0); \
57981 uint64x2_t __rev1_684; __rev1_684 = __builtin_shufflevector(__s1_684, __s1_684, 1, 0); \59651 uint64x2_t __rev1_776; __rev1_776 = __builtin_shufflevector(__s1_776, __s1_776, 1, 0); \
57982 uint32x4_t __ret_684; \59652 uint32x4_t __ret_776; \
57983 __ret_684 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_684), (uint32x2_t)(__noswap_vqshrn_n_u64(__rev1_684, __p2_684)))); \59653 __ret_776 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_776), (uint32x2_t)(__noswap_vqshrn_n_u64(__rev1_776, __p2_776)))); \
57984 __ret_684 = __builtin_shufflevector(__ret_684, __ret_684, 3, 2, 1, 0); \59654 __ret_776 = __builtin_shufflevector(__ret_776, __ret_776, 3, 2, 1, 0); \
57985 __ret_684; \59655 __ret_776; \
57986})59656})
57987#endif59657#endif
5798859658
57989#ifdef __LITTLE_ENDIAN__59659#ifdef __LITTLE_ENDIAN__
57990#define vqshrn_high_n_u16(__p0_685, __p1_685, __p2_685) __extension__ ({ \59660#define vqshrn_high_n_u16(__p0_777, __p1_777, __p2_777) __extension__ ({ \
57991 uint8x8_t __s0_685 = __p0_685; \59661 uint8x8_t __s0_777 = __p0_777; \
57992 uint16x8_t __s1_685 = __p1_685; \59662 uint16x8_t __s1_777 = __p1_777; \
57993 uint8x16_t __ret_685; \59663 uint8x16_t __ret_777; \
57994 __ret_685 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_685), (uint8x8_t)(vqshrn_n_u16(__s1_685, __p2_685)))); \59664 __ret_777 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_777), (uint8x8_t)(vqshrn_n_u16(__s1_777, __p2_777)))); \
57995 __ret_685; \59665 __ret_777; \
57996})59666})
57997#else59667#else
57998#define vqshrn_high_n_u16(__p0_686, __p1_686, __p2_686) __extension__ ({ \59668#define vqshrn_high_n_u16(__p0_778, __p1_778, __p2_778) __extension__ ({ \
57999 uint8x8_t __s0_686 = __p0_686; \59669 uint8x8_t __s0_778 = __p0_778; \
58000 uint16x8_t __s1_686 = __p1_686; \59670 uint16x8_t __s1_778 = __p1_778; \
58001 uint8x8_t __rev0_686; __rev0_686 = __builtin_shufflevector(__s0_686, __s0_686, 7, 6, 5, 4, 3, 2, 1, 0); \59671 uint8x8_t __rev0_778; __rev0_778 = __builtin_shufflevector(__s0_778, __s0_778, 7, 6, 5, 4, 3, 2, 1, 0); \
58002 uint16x8_t __rev1_686; __rev1_686 = __builtin_shufflevector(__s1_686, __s1_686, 7, 6, 5, 4, 3, 2, 1, 0); \59672 uint16x8_t __rev1_778; __rev1_778 = __builtin_shufflevector(__s1_778, __s1_778, 7, 6, 5, 4, 3, 2, 1, 0); \
58003 uint8x16_t __ret_686; \59673 uint8x16_t __ret_778; \
58004 __ret_686 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_686), (uint8x8_t)(__noswap_vqshrn_n_u16(__rev1_686, __p2_686)))); \59674 __ret_778 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_778), (uint8x8_t)(__noswap_vqshrn_n_u16(__rev1_778, __p2_778)))); \
58005 __ret_686 = __builtin_shufflevector(__ret_686, __ret_686, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \59675 __ret_778 = __builtin_shufflevector(__ret_778, __ret_778, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
58006 __ret_686; \59676 __ret_778; \
58007})59677})
58008#endif59678#endif
5800959679
58010#ifdef __LITTLE_ENDIAN__59680#ifdef __LITTLE_ENDIAN__
58011#define vqshrn_high_n_s32(__p0_687, __p1_687, __p2_687) __extension__ ({ \59681#define vqshrn_high_n_s32(__p0_779, __p1_779, __p2_779) __extension__ ({ \
58012 int16x4_t __s0_687 = __p0_687; \59682 int16x4_t __s0_779 = __p0_779; \
58013 int32x4_t __s1_687 = __p1_687; \59683 int32x4_t __s1_779 = __p1_779; \
58014 int16x8_t __ret_687; \59684 int16x8_t __ret_779; \
58015 __ret_687 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_687), (int16x4_t)(vqshrn_n_s32(__s1_687, __p2_687)))); \59685 __ret_779 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_779), (int16x4_t)(vqshrn_n_s32(__s1_779, __p2_779)))); \
58016 __ret_687; \59686 __ret_779; \
58017})59687})
58018#else59688#else
58019#define vqshrn_high_n_s32(__p0_688, __p1_688, __p2_688) __extension__ ({ \59689#define vqshrn_high_n_s32(__p0_780, __p1_780, __p2_780) __extension__ ({ \
58020 int16x4_t __s0_688 = __p0_688; \59690 int16x4_t __s0_780 = __p0_780; \
58021 int32x4_t __s1_688 = __p1_688; \59691 int32x4_t __s1_780 = __p1_780; \
58022 int16x4_t __rev0_688; __rev0_688 = __builtin_shufflevector(__s0_688, __s0_688, 3, 2, 1, 0); \59692 int16x4_t __rev0_780; __rev0_780 = __builtin_shufflevector(__s0_780, __s0_780, 3, 2, 1, 0); \
58023 int32x4_t __rev1_688; __rev1_688 = __builtin_shufflevector(__s1_688, __s1_688, 3, 2, 1, 0); \59693 int32x4_t __rev1_780; __rev1_780 = __builtin_shufflevector(__s1_780, __s1_780, 3, 2, 1, 0); \
58024 int16x8_t __ret_688; \59694 int16x8_t __ret_780; \
58025 __ret_688 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_688), (int16x4_t)(__noswap_vqshrn_n_s32(__rev1_688, __p2_688)))); \59695 __ret_780 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_780), (int16x4_t)(__noswap_vqshrn_n_s32(__rev1_780, __p2_780)))); \
58026 __ret_688 = __builtin_shufflevector(__ret_688, __ret_688, 7, 6, 5, 4, 3, 2, 1, 0); \59696 __ret_780 = __builtin_shufflevector(__ret_780, __ret_780, 7, 6, 5, 4, 3, 2, 1, 0); \
58027 __ret_688; \59697 __ret_780; \
58028})59698})
58029#endif59699#endif
5803059700
58031#ifdef __LITTLE_ENDIAN__59701#ifdef __LITTLE_ENDIAN__
58032#define vqshrn_high_n_s64(__p0_689, __p1_689, __p2_689) __extension__ ({ \59702#define vqshrn_high_n_s64(__p0_781, __p1_781, __p2_781) __extension__ ({ \
58033 int32x2_t __s0_689 = __p0_689; \59703 int32x2_t __s0_781 = __p0_781; \
58034 int64x2_t __s1_689 = __p1_689; \59704 int64x2_t __s1_781 = __p1_781; \
58035 int32x4_t __ret_689; \59705 int32x4_t __ret_781; \
58036 __ret_689 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_689), (int32x2_t)(vqshrn_n_s64(__s1_689, __p2_689)))); \59706 __ret_781 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_781), (int32x2_t)(vqshrn_n_s64(__s1_781, __p2_781)))); \
58037 __ret_689; \59707 __ret_781; \
58038})59708})
58039#else59709#else
58040#define vqshrn_high_n_s64(__p0_690, __p1_690, __p2_690) __extension__ ({ \59710#define vqshrn_high_n_s64(__p0_782, __p1_782, __p2_782) __extension__ ({ \
58041 int32x2_t __s0_690 = __p0_690; \59711 int32x2_t __s0_782 = __p0_782; \
58042 int64x2_t __s1_690 = __p1_690; \59712 int64x2_t __s1_782 = __p1_782; \
58043 int32x2_t __rev0_690; __rev0_690 = __builtin_shufflevector(__s0_690, __s0_690, 1, 0); \59713 int32x2_t __rev0_782; __rev0_782 = __builtin_shufflevector(__s0_782, __s0_782, 1, 0); \
58044 int64x2_t __rev1_690; __rev1_690 = __builtin_shufflevector(__s1_690, __s1_690, 1, 0); \59714 int64x2_t __rev1_782; __rev1_782 = __builtin_shufflevector(__s1_782, __s1_782, 1, 0); \
58045 int32x4_t __ret_690; \59715 int32x4_t __ret_782; \
58046 __ret_690 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_690), (int32x2_t)(__noswap_vqshrn_n_s64(__rev1_690, __p2_690)))); \59716 __ret_782 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_782), (int32x2_t)(__noswap_vqshrn_n_s64(__rev1_782, __p2_782)))); \
58047 __ret_690 = __builtin_shufflevector(__ret_690, __ret_690, 3, 2, 1, 0); \59717 __ret_782 = __builtin_shufflevector(__ret_782, __ret_782, 3, 2, 1, 0); \
58048 __ret_690; \59718 __ret_782; \
58049})59719})
58050#endif59720#endif
5805159721
58052#ifdef __LITTLE_ENDIAN__59722#ifdef __LITTLE_ENDIAN__
58053#define vqshrn_high_n_s16(__p0_691, __p1_691, __p2_691) __extension__ ({ \59723#define vqshrn_high_n_s16(__p0_783, __p1_783, __p2_783) __extension__ ({ \
58054 int8x8_t __s0_691 = __p0_691; \59724 int8x8_t __s0_783 = __p0_783; \
58055 int16x8_t __s1_691 = __p1_691; \59725 int16x8_t __s1_783 = __p1_783; \
58056 int8x16_t __ret_691; \59726 int8x16_t __ret_783; \
58057 __ret_691 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_691), (int8x8_t)(vqshrn_n_s16(__s1_691, __p2_691)))); \59727 __ret_783 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_783), (int8x8_t)(vqshrn_n_s16(__s1_783, __p2_783)))); \
58058 __ret_691; \59728 __ret_783; \
58059})59729})
58060#else59730#else
58061#define vqshrn_high_n_s16(__p0_692, __p1_692, __p2_692) __extension__ ({ \59731#define vqshrn_high_n_s16(__p0_784, __p1_784, __p2_784) __extension__ ({ \
58062 int8x8_t __s0_692 = __p0_692; \59732 int8x8_t __s0_784 = __p0_784; \
58063 int16x8_t __s1_692 = __p1_692; \59733 int16x8_t __s1_784 = __p1_784; \
58064 int8x8_t __rev0_692; __rev0_692 = __builtin_shufflevector(__s0_692, __s0_692, 7, 6, 5, 4, 3, 2, 1, 0); \59734 int8x8_t __rev0_784; __rev0_784 = __builtin_shufflevector(__s0_784, __s0_784, 7, 6, 5, 4, 3, 2, 1, 0); \
58065 int16x8_t __rev1_692; __rev1_692 = __builtin_shufflevector(__s1_692, __s1_692, 7, 6, 5, 4, 3, 2, 1, 0); \59735 int16x8_t __rev1_784; __rev1_784 = __builtin_shufflevector(__s1_784, __s1_784, 7, 6, 5, 4, 3, 2, 1, 0); \
58066 int8x16_t __ret_692; \59736 int8x16_t __ret_784; \
58067 __ret_692 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_692), (int8x8_t)(__noswap_vqshrn_n_s16(__rev1_692, __p2_692)))); \59737 __ret_784 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_784), (int8x8_t)(__noswap_vqshrn_n_s16(__rev1_784, __p2_784)))); \
58068 __ret_692 = __builtin_shufflevector(__ret_692, __ret_692, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \59738 __ret_784 = __builtin_shufflevector(__ret_784, __ret_784, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
58069 __ret_692; \59739 __ret_784; \
58070})59740})
58071#endif59741#endif
5807259742
...@@ -58107,65 +59777,65 @@ __ai int16_t vqshlh_s16(int16_t __p0, int16_t __p1) {...@@ -58107,65 +59777,65 @@ __ai int16_t vqshlh_s16(int16_t __p0, int16_t __p1) {
58107 __ret; \59777 __ret; \
58108})59778})
58109#ifdef __LITTLE_ENDIAN__59779#ifdef __LITTLE_ENDIAN__
58110#define vqshrun_high_n_s32(__p0_693, __p1_693, __p2_693) __extension__ ({ \59780#define vqshrun_high_n_s32(__p0_785, __p1_785, __p2_785) __extension__ ({ \
58111 int16x4_t __s0_693 = __p0_693; \59781 int16x4_t __s0_785 = __p0_785; \
58112 int32x4_t __s1_693 = __p1_693; \59782 int32x4_t __s1_785 = __p1_785; \
58113 int16x8_t __ret_693; \59783 int16x8_t __ret_785; \
58114 __ret_693 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_693), (int16x4_t)(vqshrun_n_s32(__s1_693, __p2_693)))); \59784 __ret_785 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_785), (int16x4_t)(vqshrun_n_s32(__s1_785, __p2_785)))); \
58115 __ret_693; \59785 __ret_785; \
58116})59786})
58117#else59787#else
58118#define vqshrun_high_n_s32(__p0_694, __p1_694, __p2_694) __extension__ ({ \59788#define vqshrun_high_n_s32(__p0_786, __p1_786, __p2_786) __extension__ ({ \
58119 int16x4_t __s0_694 = __p0_694; \59789 int16x4_t __s0_786 = __p0_786; \
58120 int32x4_t __s1_694 = __p1_694; \59790 int32x4_t __s1_786 = __p1_786; \
58121 int16x4_t __rev0_694; __rev0_694 = __builtin_shufflevector(__s0_694, __s0_694, 3, 2, 1, 0); \59791 int16x4_t __rev0_786; __rev0_786 = __builtin_shufflevector(__s0_786, __s0_786, 3, 2, 1, 0); \
58122 int32x4_t __rev1_694; __rev1_694 = __builtin_shufflevector(__s1_694, __s1_694, 3, 2, 1, 0); \59792 int32x4_t __rev1_786; __rev1_786 = __builtin_shufflevector(__s1_786, __s1_786, 3, 2, 1, 0); \
58123 int16x8_t __ret_694; \59793 int16x8_t __ret_786; \
58124 __ret_694 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_694), (int16x4_t)(__noswap_vqshrun_n_s32(__rev1_694, __p2_694)))); \59794 __ret_786 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_786), (int16x4_t)(__noswap_vqshrun_n_s32(__rev1_786, __p2_786)))); \
58125 __ret_694 = __builtin_shufflevector(__ret_694, __ret_694, 7, 6, 5, 4, 3, 2, 1, 0); \59795 __ret_786 = __builtin_shufflevector(__ret_786, __ret_786, 7, 6, 5, 4, 3, 2, 1, 0); \
58126 __ret_694; \59796 __ret_786; \
58127})59797})
58128#endif59798#endif
5812959799
58130#ifdef __LITTLE_ENDIAN__59800#ifdef __LITTLE_ENDIAN__
58131#define vqshrun_high_n_s64(__p0_695, __p1_695, __p2_695) __extension__ ({ \59801#define vqshrun_high_n_s64(__p0_787, __p1_787, __p2_787) __extension__ ({ \
58132 int32x2_t __s0_695 = __p0_695; \59802 int32x2_t __s0_787 = __p0_787; \
58133 int64x2_t __s1_695 = __p1_695; \59803 int64x2_t __s1_787 = __p1_787; \
58134 int32x4_t __ret_695; \59804 int32x4_t __ret_787; \
58135 __ret_695 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_695), (int32x2_t)(vqshrun_n_s64(__s1_695, __p2_695)))); \59805 __ret_787 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_787), (int32x2_t)(vqshrun_n_s64(__s1_787, __p2_787)))); \
58136 __ret_695; \59806 __ret_787; \
58137})59807})
58138#else59808#else
58139#define vqshrun_high_n_s64(__p0_696, __p1_696, __p2_696) __extension__ ({ \59809#define vqshrun_high_n_s64(__p0_788, __p1_788, __p2_788) __extension__ ({ \
58140 int32x2_t __s0_696 = __p0_696; \59810 int32x2_t __s0_788 = __p0_788; \
58141 int64x2_t __s1_696 = __p1_696; \59811 int64x2_t __s1_788 = __p1_788; \
58142 int32x2_t __rev0_696; __rev0_696 = __builtin_shufflevector(__s0_696, __s0_696, 1, 0); \59812 int32x2_t __rev0_788; __rev0_788 = __builtin_shufflevector(__s0_788, __s0_788, 1, 0); \
58143 int64x2_t __rev1_696; __rev1_696 = __builtin_shufflevector(__s1_696, __s1_696, 1, 0); \59813 int64x2_t __rev1_788; __rev1_788 = __builtin_shufflevector(__s1_788, __s1_788, 1, 0); \
58144 int32x4_t __ret_696; \59814 int32x4_t __ret_788; \
58145 __ret_696 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_696), (int32x2_t)(__noswap_vqshrun_n_s64(__rev1_696, __p2_696)))); \59815 __ret_788 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_788), (int32x2_t)(__noswap_vqshrun_n_s64(__rev1_788, __p2_788)))); \
58146 __ret_696 = __builtin_shufflevector(__ret_696, __ret_696, 3, 2, 1, 0); \59816 __ret_788 = __builtin_shufflevector(__ret_788, __ret_788, 3, 2, 1, 0); \
58147 __ret_696; \59817 __ret_788; \
58148})59818})
58149#endif59819#endif
5815059820
58151#ifdef __LITTLE_ENDIAN__59821#ifdef __LITTLE_ENDIAN__
58152#define vqshrun_high_n_s16(__p0_697, __p1_697, __p2_697) __extension__ ({ \59822#define vqshrun_high_n_s16(__p0_789, __p1_789, __p2_789) __extension__ ({ \
58153 int8x8_t __s0_697 = __p0_697; \59823 int8x8_t __s0_789 = __p0_789; \
58154 int16x8_t __s1_697 = __p1_697; \59824 int16x8_t __s1_789 = __p1_789; \
58155 int8x16_t __ret_697; \59825 int8x16_t __ret_789; \
58156 __ret_697 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_697), (int8x8_t)(vqshrun_n_s16(__s1_697, __p2_697)))); \59826 __ret_789 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_789), (int8x8_t)(vqshrun_n_s16(__s1_789, __p2_789)))); \
58157 __ret_697; \59827 __ret_789; \
58158})59828})
58159#else59829#else
58160#define vqshrun_high_n_s16(__p0_698, __p1_698, __p2_698) __extension__ ({ \59830#define vqshrun_high_n_s16(__p0_790, __p1_790, __p2_790) __extension__ ({ \
58161 int8x8_t __s0_698 = __p0_698; \59831 int8x8_t __s0_790 = __p0_790; \
58162 int16x8_t __s1_698 = __p1_698; \59832 int16x8_t __s1_790 = __p1_790; \
58163 int8x8_t __rev0_698; __rev0_698 = __builtin_shufflevector(__s0_698, __s0_698, 7, 6, 5, 4, 3, 2, 1, 0); \59833 int8x8_t __rev0_790; __rev0_790 = __builtin_shufflevector(__s0_790, __s0_790, 7, 6, 5, 4, 3, 2, 1, 0); \
58164 int16x8_t __rev1_698; __rev1_698 = __builtin_shufflevector(__s1_698, __s1_698, 7, 6, 5, 4, 3, 2, 1, 0); \59834 int16x8_t __rev1_790; __rev1_790 = __builtin_shufflevector(__s1_790, __s1_790, 7, 6, 5, 4, 3, 2, 1, 0); \
58165 int8x16_t __ret_698; \59835 int8x16_t __ret_790; \
58166 __ret_698 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_698), (int8x8_t)(__noswap_vqshrun_n_s16(__rev1_698, __p2_698)))); \59836 __ret_790 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_790), (int8x8_t)(__noswap_vqshrun_n_s16(__rev1_790, __p2_790)))); \
58167 __ret_698 = __builtin_shufflevector(__ret_698, __ret_698, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \59837 __ret_790 = __builtin_shufflevector(__ret_790, __ret_790, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
58168 __ret_698; \59838 __ret_790; \
58169})59839})
58170#endif59840#endif
5817159841
...@@ -59452,7 +61122,7 @@ __ai float32_t vrecpxs_f32(float32_t __p0) {...@@ -59452,7 +61122,7 @@ __ai float32_t vrecpxs_f32(float32_t __p0) {
59452 __ret = (float32_t) __builtin_neon_vrecpxs_f32(__p0);61122 __ret = (float32_t) __builtin_neon_vrecpxs_f32(__p0);
59453 return __ret;61123 return __ret;
59454}61124}
59455__ai uint64_t vrshld_u64(uint64_t __p0, uint64_t __p1) {61125__ai uint64_t vrshld_u64(uint64_t __p0, int64_t __p1) {
59456 uint64_t __ret;61126 uint64_t __ret;
59457 __ret = (uint64_t) __builtin_neon_vrshld_u64(__p0, __p1);61127 __ret = (uint64_t) __builtin_neon_vrshld_u64(__p0, __p1);
59458 return __ret;61128 return __ret;
...@@ -59475,128 +61145,128 @@ __ai int64_t vrshld_s64(int64_t __p0, int64_t __p1) {...@@ -59475,128 +61145,128 @@ __ai int64_t vrshld_s64(int64_t __p0, int64_t __p1) {
59475 __ret; \61145 __ret; \
59476})61146})
59477#ifdef __LITTLE_ENDIAN__61147#ifdef __LITTLE_ENDIAN__
59478#define vrshrn_high_n_u32(__p0_699, __p1_699, __p2_699) __extension__ ({ \61148#define vrshrn_high_n_u32(__p0_791, __p1_791, __p2_791) __extension__ ({ \
59479 uint16x4_t __s0_699 = __p0_699; \61149 uint16x4_t __s0_791 = __p0_791; \
59480 uint32x4_t __s1_699 = __p1_699; \61150 uint32x4_t __s1_791 = __p1_791; \
59481 uint16x8_t __ret_699; \61151 uint16x8_t __ret_791; \
59482 __ret_699 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_699), (uint16x4_t)(vrshrn_n_u32(__s1_699, __p2_699)))); \61152 __ret_791 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_791), (uint16x4_t)(vrshrn_n_u32(__s1_791, __p2_791)))); \
59483 __ret_699; \61153 __ret_791; \
59484})61154})
59485#else61155#else
59486#define vrshrn_high_n_u32(__p0_700, __p1_700, __p2_700) __extension__ ({ \61156#define vrshrn_high_n_u32(__p0_792, __p1_792, __p2_792) __extension__ ({ \
59487 uint16x4_t __s0_700 = __p0_700; \61157 uint16x4_t __s0_792 = __p0_792; \
59488 uint32x4_t __s1_700 = __p1_700; \61158 uint32x4_t __s1_792 = __p1_792; \
59489 uint16x4_t __rev0_700; __rev0_700 = __builtin_shufflevector(__s0_700, __s0_700, 3, 2, 1, 0); \61159 uint16x4_t __rev0_792; __rev0_792 = __builtin_shufflevector(__s0_792, __s0_792, 3, 2, 1, 0); \
59490 uint32x4_t __rev1_700; __rev1_700 = __builtin_shufflevector(__s1_700, __s1_700, 3, 2, 1, 0); \61160 uint32x4_t __rev1_792; __rev1_792 = __builtin_shufflevector(__s1_792, __s1_792, 3, 2, 1, 0); \
59491 uint16x8_t __ret_700; \61161 uint16x8_t __ret_792; \
59492 __ret_700 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_700), (uint16x4_t)(__noswap_vrshrn_n_u32(__rev1_700, __p2_700)))); \61162 __ret_792 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_792), (uint16x4_t)(__noswap_vrshrn_n_u32(__rev1_792, __p2_792)))); \
59493 __ret_700 = __builtin_shufflevector(__ret_700, __ret_700, 7, 6, 5, 4, 3, 2, 1, 0); \61163 __ret_792 = __builtin_shufflevector(__ret_792, __ret_792, 7, 6, 5, 4, 3, 2, 1, 0); \
59494 __ret_700; \61164 __ret_792; \
59495})61165})
59496#endif61166#endif
5949761167
59498#ifdef __LITTLE_ENDIAN__61168#ifdef __LITTLE_ENDIAN__
59499#define vrshrn_high_n_u64(__p0_701, __p1_701, __p2_701) __extension__ ({ \61169#define vrshrn_high_n_u64(__p0_793, __p1_793, __p2_793) __extension__ ({ \
59500 uint32x2_t __s0_701 = __p0_701; \61170 uint32x2_t __s0_793 = __p0_793; \
59501 uint64x2_t __s1_701 = __p1_701; \61171 uint64x2_t __s1_793 = __p1_793; \
59502 uint32x4_t __ret_701; \61172 uint32x4_t __ret_793; \
59503 __ret_701 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_701), (uint32x2_t)(vrshrn_n_u64(__s1_701, __p2_701)))); \61173 __ret_793 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_793), (uint32x2_t)(vrshrn_n_u64(__s1_793, __p2_793)))); \
59504 __ret_701; \61174 __ret_793; \
59505})61175})
59506#else61176#else
59507#define vrshrn_high_n_u64(__p0_702, __p1_702, __p2_702) __extension__ ({ \61177#define vrshrn_high_n_u64(__p0_794, __p1_794, __p2_794) __extension__ ({ \
59508 uint32x2_t __s0_702 = __p0_702; \61178 uint32x2_t __s0_794 = __p0_794; \
59509 uint64x2_t __s1_702 = __p1_702; \61179 uint64x2_t __s1_794 = __p1_794; \
59510 uint32x2_t __rev0_702; __rev0_702 = __builtin_shufflevector(__s0_702, __s0_702, 1, 0); \61180 uint32x2_t __rev0_794; __rev0_794 = __builtin_shufflevector(__s0_794, __s0_794, 1, 0); \
59511 uint64x2_t __rev1_702; __rev1_702 = __builtin_shufflevector(__s1_702, __s1_702, 1, 0); \61181 uint64x2_t __rev1_794; __rev1_794 = __builtin_shufflevector(__s1_794, __s1_794, 1, 0); \
59512 uint32x4_t __ret_702; \61182 uint32x4_t __ret_794; \
59513 __ret_702 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_702), (uint32x2_t)(__noswap_vrshrn_n_u64(__rev1_702, __p2_702)))); \61183 __ret_794 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_794), (uint32x2_t)(__noswap_vrshrn_n_u64(__rev1_794, __p2_794)))); \
59514 __ret_702 = __builtin_shufflevector(__ret_702, __ret_702, 3, 2, 1, 0); \61184 __ret_794 = __builtin_shufflevector(__ret_794, __ret_794, 3, 2, 1, 0); \
59515 __ret_702; \61185 __ret_794; \
59516})61186})
59517#endif61187#endif
5951861188
59519#ifdef __LITTLE_ENDIAN__61189#ifdef __LITTLE_ENDIAN__
59520#define vrshrn_high_n_u16(__p0_703, __p1_703, __p2_703) __extension__ ({ \61190#define vrshrn_high_n_u16(__p0_795, __p1_795, __p2_795) __extension__ ({ \
59521 uint8x8_t __s0_703 = __p0_703; \61191 uint8x8_t __s0_795 = __p0_795; \
59522 uint16x8_t __s1_703 = __p1_703; \61192 uint16x8_t __s1_795 = __p1_795; \
59523 uint8x16_t __ret_703; \61193 uint8x16_t __ret_795; \
59524 __ret_703 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_703), (uint8x8_t)(vrshrn_n_u16(__s1_703, __p2_703)))); \61194 __ret_795 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_795), (uint8x8_t)(vrshrn_n_u16(__s1_795, __p2_795)))); \
59525 __ret_703; \61195 __ret_795; \
59526})61196})
59527#else61197#else
59528#define vrshrn_high_n_u16(__p0_704, __p1_704, __p2_704) __extension__ ({ \61198#define vrshrn_high_n_u16(__p0_796, __p1_796, __p2_796) __extension__ ({ \
59529 uint8x8_t __s0_704 = __p0_704; \61199 uint8x8_t __s0_796 = __p0_796; \
59530 uint16x8_t __s1_704 = __p1_704; \61200 uint16x8_t __s1_796 = __p1_796; \
59531 uint8x8_t __rev0_704; __rev0_704 = __builtin_shufflevector(__s0_704, __s0_704, 7, 6, 5, 4, 3, 2, 1, 0); \61201 uint8x8_t __rev0_796; __rev0_796 = __builtin_shufflevector(__s0_796, __s0_796, 7, 6, 5, 4, 3, 2, 1, 0); \
59532 uint16x8_t __rev1_704; __rev1_704 = __builtin_shufflevector(__s1_704, __s1_704, 7, 6, 5, 4, 3, 2, 1, 0); \61202 uint16x8_t __rev1_796; __rev1_796 = __builtin_shufflevector(__s1_796, __s1_796, 7, 6, 5, 4, 3, 2, 1, 0); \
59533 uint8x16_t __ret_704; \61203 uint8x16_t __ret_796; \
59534 __ret_704 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_704), (uint8x8_t)(__noswap_vrshrn_n_u16(__rev1_704, __p2_704)))); \61204 __ret_796 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_796), (uint8x8_t)(__noswap_vrshrn_n_u16(__rev1_796, __p2_796)))); \
59535 __ret_704 = __builtin_shufflevector(__ret_704, __ret_704, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \61205 __ret_796 = __builtin_shufflevector(__ret_796, __ret_796, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
59536 __ret_704; \61206 __ret_796; \
59537})61207})
59538#endif61208#endif
5953961209
59540#ifdef __LITTLE_ENDIAN__61210#ifdef __LITTLE_ENDIAN__
59541#define vrshrn_high_n_s32(__p0_705, __p1_705, __p2_705) __extension__ ({ \61211#define vrshrn_high_n_s32(__p0_797, __p1_797, __p2_797) __extension__ ({ \
59542 int16x4_t __s0_705 = __p0_705; \61212 int16x4_t __s0_797 = __p0_797; \
59543 int32x4_t __s1_705 = __p1_705; \61213 int32x4_t __s1_797 = __p1_797; \
59544 int16x8_t __ret_705; \61214 int16x8_t __ret_797; \
59545 __ret_705 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_705), (int16x4_t)(vrshrn_n_s32(__s1_705, __p2_705)))); \61215 __ret_797 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_797), (int16x4_t)(vrshrn_n_s32(__s1_797, __p2_797)))); \
59546 __ret_705; \61216 __ret_797; \
59547})61217})
59548#else61218#else
59549#define vrshrn_high_n_s32(__p0_706, __p1_706, __p2_706) __extension__ ({ \61219#define vrshrn_high_n_s32(__p0_798, __p1_798, __p2_798) __extension__ ({ \
59550 int16x4_t __s0_706 = __p0_706; \61220 int16x4_t __s0_798 = __p0_798; \
59551 int32x4_t __s1_706 = __p1_706; \61221 int32x4_t __s1_798 = __p1_798; \
59552 int16x4_t __rev0_706; __rev0_706 = __builtin_shufflevector(__s0_706, __s0_706, 3, 2, 1, 0); \61222 int16x4_t __rev0_798; __rev0_798 = __builtin_shufflevector(__s0_798, __s0_798, 3, 2, 1, 0); \
59553 int32x4_t __rev1_706; __rev1_706 = __builtin_shufflevector(__s1_706, __s1_706, 3, 2, 1, 0); \61223 int32x4_t __rev1_798; __rev1_798 = __builtin_shufflevector(__s1_798, __s1_798, 3, 2, 1, 0); \
59554 int16x8_t __ret_706; \61224 int16x8_t __ret_798; \
59555 __ret_706 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_706), (int16x4_t)(__noswap_vrshrn_n_s32(__rev1_706, __p2_706)))); \61225 __ret_798 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_798), (int16x4_t)(__noswap_vrshrn_n_s32(__rev1_798, __p2_798)))); \
59556 __ret_706 = __builtin_shufflevector(__ret_706, __ret_706, 7, 6, 5, 4, 3, 2, 1, 0); \61226 __ret_798 = __builtin_shufflevector(__ret_798, __ret_798, 7, 6, 5, 4, 3, 2, 1, 0); \
59557 __ret_706; \61227 __ret_798; \
59558})61228})
59559#endif61229#endif
5956061230
59561#ifdef __LITTLE_ENDIAN__61231#ifdef __LITTLE_ENDIAN__
59562#define vrshrn_high_n_s64(__p0_707, __p1_707, __p2_707) __extension__ ({ \61232#define vrshrn_high_n_s64(__p0_799, __p1_799, __p2_799) __extension__ ({ \
59563 int32x2_t __s0_707 = __p0_707; \61233 int32x2_t __s0_799 = __p0_799; \
59564 int64x2_t __s1_707 = __p1_707; \61234 int64x2_t __s1_799 = __p1_799; \
59565 int32x4_t __ret_707; \61235 int32x4_t __ret_799; \
59566 __ret_707 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_707), (int32x2_t)(vrshrn_n_s64(__s1_707, __p2_707)))); \61236 __ret_799 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_799), (int32x2_t)(vrshrn_n_s64(__s1_799, __p2_799)))); \
59567 __ret_707; \61237 __ret_799; \
59568})61238})
59569#else61239#else
59570#define vrshrn_high_n_s64(__p0_708, __p1_708, __p2_708) __extension__ ({ \61240#define vrshrn_high_n_s64(__p0_800, __p1_800, __p2_800) __extension__ ({ \
59571 int32x2_t __s0_708 = __p0_708; \61241 int32x2_t __s0_800 = __p0_800; \
59572 int64x2_t __s1_708 = __p1_708; \61242 int64x2_t __s1_800 = __p1_800; \
59573 int32x2_t __rev0_708; __rev0_708 = __builtin_shufflevector(__s0_708, __s0_708, 1, 0); \61243 int32x2_t __rev0_800; __rev0_800 = __builtin_shufflevector(__s0_800, __s0_800, 1, 0); \
59574 int64x2_t __rev1_708; __rev1_708 = __builtin_shufflevector(__s1_708, __s1_708, 1, 0); \61244 int64x2_t __rev1_800; __rev1_800 = __builtin_shufflevector(__s1_800, __s1_800, 1, 0); \
59575 int32x4_t __ret_708; \61245 int32x4_t __ret_800; \
59576 __ret_708 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_708), (int32x2_t)(__noswap_vrshrn_n_s64(__rev1_708, __p2_708)))); \61246 __ret_800 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_800), (int32x2_t)(__noswap_vrshrn_n_s64(__rev1_800, __p2_800)))); \
59577 __ret_708 = __builtin_shufflevector(__ret_708, __ret_708, 3, 2, 1, 0); \61247 __ret_800 = __builtin_shufflevector(__ret_800, __ret_800, 3, 2, 1, 0); \
59578 __ret_708; \61248 __ret_800; \
59579})61249})
59580#endif61250#endif
5958161251
59582#ifdef __LITTLE_ENDIAN__61252#ifdef __LITTLE_ENDIAN__
59583#define vrshrn_high_n_s16(__p0_709, __p1_709, __p2_709) __extension__ ({ \61253#define vrshrn_high_n_s16(__p0_801, __p1_801, __p2_801) __extension__ ({ \
59584 int8x8_t __s0_709 = __p0_709; \61254 int8x8_t __s0_801 = __p0_801; \
59585 int16x8_t __s1_709 = __p1_709; \61255 int16x8_t __s1_801 = __p1_801; \
59586 int8x16_t __ret_709; \61256 int8x16_t __ret_801; \
59587 __ret_709 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_709), (int8x8_t)(vrshrn_n_s16(__s1_709, __p2_709)))); \61257 __ret_801 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_801), (int8x8_t)(vrshrn_n_s16(__s1_801, __p2_801)))); \
59588 __ret_709; \61258 __ret_801; \
59589})61259})
59590#else61260#else
59591#define vrshrn_high_n_s16(__p0_710, __p1_710, __p2_710) __extension__ ({ \61261#define vrshrn_high_n_s16(__p0_802, __p1_802, __p2_802) __extension__ ({ \
59592 int8x8_t __s0_710 = __p0_710; \61262 int8x8_t __s0_802 = __p0_802; \
59593 int16x8_t __s1_710 = __p1_710; \61263 int16x8_t __s1_802 = __p1_802; \
59594 int8x8_t __rev0_710; __rev0_710 = __builtin_shufflevector(__s0_710, __s0_710, 7, 6, 5, 4, 3, 2, 1, 0); \61264 int8x8_t __rev0_802; __rev0_802 = __builtin_shufflevector(__s0_802, __s0_802, 7, 6, 5, 4, 3, 2, 1, 0); \
59595 int16x8_t __rev1_710; __rev1_710 = __builtin_shufflevector(__s1_710, __s1_710, 7, 6, 5, 4, 3, 2, 1, 0); \61265 int16x8_t __rev1_802; __rev1_802 = __builtin_shufflevector(__s1_802, __s1_802, 7, 6, 5, 4, 3, 2, 1, 0); \
59596 int8x16_t __ret_710; \61266 int8x16_t __ret_802; \
59597 __ret_710 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_710), (int8x8_t)(__noswap_vrshrn_n_s16(__rev1_710, __p2_710)))); \61267 __ret_802 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_802), (int8x8_t)(__noswap_vrshrn_n_s16(__rev1_802, __p2_802)))); \
59598 __ret_710 = __builtin_shufflevector(__ret_710, __ret_710, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \61268 __ret_802 = __builtin_shufflevector(__ret_802, __ret_802, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
59599 __ret_710; \61269 __ret_802; \
59600})61270})
59601#endif61271#endif
5960261272
...@@ -59853,7 +61523,7 @@ __ai int8x16_t vrsubhn_high_s16(int8x8_t __p0, int16x8_t __p1, int16x8_t __p2) {...@@ -59853,7 +61523,7 @@ __ai int8x16_t vrsubhn_high_s16(int8x8_t __p0, int16x8_t __p1, int16x8_t __p2) {
59853 __ret = (float64x1_t) __builtin_neon_vset_lane_f64(__s0, (float64x1_t)__s1, __p2); \61523 __ret = (float64x1_t) __builtin_neon_vset_lane_f64(__s0, (float64x1_t)__s1, __p2); \
59854 __ret; \61524 __ret; \
59855})61525})
59856__ai uint64_t vshld_u64(uint64_t __p0, uint64_t __p1) {61526__ai uint64_t vshld_u64(uint64_t __p0, int64_t __p1) {
59857 uint64_t __ret;61527 uint64_t __ret;
59858 __ret = (uint64_t) __builtin_neon_vshld_u64(__p0, __p1);61528 __ret = (uint64_t) __builtin_neon_vshld_u64(__p0, __p1);
59859 return __ret;61529 return __ret;
...@@ -59876,110 +61546,110 @@ __ai int64_t vshld_s64(int64_t __p0, int64_t __p1) {...@@ -59876,110 +61546,110 @@ __ai int64_t vshld_s64(int64_t __p0, int64_t __p1) {
59876 __ret; \61546 __ret; \
59877})61547})
59878#ifdef __LITTLE_ENDIAN__61548#ifdef __LITTLE_ENDIAN__
59879#define vshll_high_n_u8(__p0_711, __p1_711) __extension__ ({ \61549#define vshll_high_n_u8(__p0_803, __p1_803) __extension__ ({ \
59880 uint8x16_t __s0_711 = __p0_711; \61550 uint8x16_t __s0_803 = __p0_803; \
59881 uint16x8_t __ret_711; \61551 uint16x8_t __ret_803; \
59882 __ret_711 = (uint16x8_t)(vshll_n_u8(vget_high_u8(__s0_711), __p1_711)); \61552 __ret_803 = (uint16x8_t)(vshll_n_u8(vget_high_u8(__s0_803), __p1_803)); \
59883 __ret_711; \61553 __ret_803; \
59884})61554})
59885#else61555#else
59886#define vshll_high_n_u8(__p0_712, __p1_712) __extension__ ({ \61556#define vshll_high_n_u8(__p0_804, __p1_804) __extension__ ({ \
59887 uint8x16_t __s0_712 = __p0_712; \61557 uint8x16_t __s0_804 = __p0_804; \
59888 uint8x16_t __rev0_712; __rev0_712 = __builtin_shufflevector(__s0_712, __s0_712, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \61558 uint8x16_t __rev0_804; __rev0_804 = __builtin_shufflevector(__s0_804, __s0_804, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
59889 uint16x8_t __ret_712; \61559 uint16x8_t __ret_804; \
59890 __ret_712 = (uint16x8_t)(__noswap_vshll_n_u8(__noswap_vget_high_u8(__rev0_712), __p1_712)); \61560 __ret_804 = (uint16x8_t)(__noswap_vshll_n_u8(__noswap_vget_high_u8(__rev0_804), __p1_804)); \
59891 __ret_712 = __builtin_shufflevector(__ret_712, __ret_712, 7, 6, 5, 4, 3, 2, 1, 0); \61561 __ret_804 = __builtin_shufflevector(__ret_804, __ret_804, 7, 6, 5, 4, 3, 2, 1, 0); \
59892 __ret_712; \61562 __ret_804; \
59893})61563})
59894#endif61564#endif
5989561565
59896#ifdef __LITTLE_ENDIAN__61566#ifdef __LITTLE_ENDIAN__
59897#define vshll_high_n_u32(__p0_713, __p1_713) __extension__ ({ \61567#define vshll_high_n_u32(__p0_805, __p1_805) __extension__ ({ \
59898 uint32x4_t __s0_713 = __p0_713; \61568 uint32x4_t __s0_805 = __p0_805; \
59899 uint64x2_t __ret_713; \61569 uint64x2_t __ret_805; \
59900 __ret_713 = (uint64x2_t)(vshll_n_u32(vget_high_u32(__s0_713), __p1_713)); \61570 __ret_805 = (uint64x2_t)(vshll_n_u32(vget_high_u32(__s0_805), __p1_805)); \
59901 __ret_713; \61571 __ret_805; \
59902})61572})
59903#else61573#else
59904#define vshll_high_n_u32(__p0_714, __p1_714) __extension__ ({ \61574#define vshll_high_n_u32(__p0_806, __p1_806) __extension__ ({ \
59905 uint32x4_t __s0_714 = __p0_714; \61575 uint32x4_t __s0_806 = __p0_806; \
59906 uint32x4_t __rev0_714; __rev0_714 = __builtin_shufflevector(__s0_714, __s0_714, 3, 2, 1, 0); \61576 uint32x4_t __rev0_806; __rev0_806 = __builtin_shufflevector(__s0_806, __s0_806, 3, 2, 1, 0); \
59907 uint64x2_t __ret_714; \61577 uint64x2_t __ret_806; \
59908 __ret_714 = (uint64x2_t)(__noswap_vshll_n_u32(__noswap_vget_high_u32(__rev0_714), __p1_714)); \61578 __ret_806 = (uint64x2_t)(__noswap_vshll_n_u32(__noswap_vget_high_u32(__rev0_806), __p1_806)); \
59909 __ret_714 = __builtin_shufflevector(__ret_714, __ret_714, 1, 0); \61579 __ret_806 = __builtin_shufflevector(__ret_806, __ret_806, 1, 0); \
59910 __ret_714; \61580 __ret_806; \
59911})61581})
59912#endif61582#endif
5991361583
59914#ifdef __LITTLE_ENDIAN__61584#ifdef __LITTLE_ENDIAN__
59915#define vshll_high_n_u16(__p0_715, __p1_715) __extension__ ({ \61585#define vshll_high_n_u16(__p0_807, __p1_807) __extension__ ({ \
59916 uint16x8_t __s0_715 = __p0_715; \61586 uint16x8_t __s0_807 = __p0_807; \
59917 uint32x4_t __ret_715; \61587 uint32x4_t __ret_807; \
59918 __ret_715 = (uint32x4_t)(vshll_n_u16(vget_high_u16(__s0_715), __p1_715)); \61588 __ret_807 = (uint32x4_t)(vshll_n_u16(vget_high_u16(__s0_807), __p1_807)); \
59919 __ret_715; \61589 __ret_807; \
59920})61590})
59921#else61591#else
59922#define vshll_high_n_u16(__p0_716, __p1_716) __extension__ ({ \61592#define vshll_high_n_u16(__p0_808, __p1_808) __extension__ ({ \
59923 uint16x8_t __s0_716 = __p0_716; \61593 uint16x8_t __s0_808 = __p0_808; \
59924 uint16x8_t __rev0_716; __rev0_716 = __builtin_shufflevector(__s0_716, __s0_716, 7, 6, 5, 4, 3, 2, 1, 0); \61594 uint16x8_t __rev0_808; __rev0_808 = __builtin_shufflevector(__s0_808, __s0_808, 7, 6, 5, 4, 3, 2, 1, 0); \
59925 uint32x4_t __ret_716; \61595 uint32x4_t __ret_808; \
59926 __ret_716 = (uint32x4_t)(__noswap_vshll_n_u16(__noswap_vget_high_u16(__rev0_716), __p1_716)); \61596 __ret_808 = (uint32x4_t)(__noswap_vshll_n_u16(__noswap_vget_high_u16(__rev0_808), __p1_808)); \
59927 __ret_716 = __builtin_shufflevector(__ret_716, __ret_716, 3, 2, 1, 0); \61597 __ret_808 = __builtin_shufflevector(__ret_808, __ret_808, 3, 2, 1, 0); \
59928 __ret_716; \61598 __ret_808; \
59929})61599})
59930#endif61600#endif
5993161601
59932#ifdef __LITTLE_ENDIAN__61602#ifdef __LITTLE_ENDIAN__
59933#define vshll_high_n_s8(__p0_717, __p1_717) __extension__ ({ \61603#define vshll_high_n_s8(__p0_809, __p1_809) __extension__ ({ \
59934 int8x16_t __s0_717 = __p0_717; \61604 int8x16_t __s0_809 = __p0_809; \
59935 int16x8_t __ret_717; \61605 int16x8_t __ret_809; \
59936 __ret_717 = (int16x8_t)(vshll_n_s8(vget_high_s8(__s0_717), __p1_717)); \61606 __ret_809 = (int16x8_t)(vshll_n_s8(vget_high_s8(__s0_809), __p1_809)); \
59937 __ret_717; \61607 __ret_809; \
59938})61608})
59939#else61609#else
59940#define vshll_high_n_s8(__p0_718, __p1_718) __extension__ ({ \61610#define vshll_high_n_s8(__p0_810, __p1_810) __extension__ ({ \
59941 int8x16_t __s0_718 = __p0_718; \61611 int8x16_t __s0_810 = __p0_810; \
59942 int8x16_t __rev0_718; __rev0_718 = __builtin_shufflevector(__s0_718, __s0_718, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \61612 int8x16_t __rev0_810; __rev0_810 = __builtin_shufflevector(__s0_810, __s0_810, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
59943 int16x8_t __ret_718; \61613 int16x8_t __ret_810; \
59944 __ret_718 = (int16x8_t)(__noswap_vshll_n_s8(__noswap_vget_high_s8(__rev0_718), __p1_718)); \61614 __ret_810 = (int16x8_t)(__noswap_vshll_n_s8(__noswap_vget_high_s8(__rev0_810), __p1_810)); \
59945 __ret_718 = __builtin_shufflevector(__ret_718, __ret_718, 7, 6, 5, 4, 3, 2, 1, 0); \61615 __ret_810 = __builtin_shufflevector(__ret_810, __ret_810, 7, 6, 5, 4, 3, 2, 1, 0); \
59946 __ret_718; \61616 __ret_810; \
59947})61617})
59948#endif61618#endif
5994961619
59950#ifdef __LITTLE_ENDIAN__61620#ifdef __LITTLE_ENDIAN__
59951#define vshll_high_n_s32(__p0_719, __p1_719) __extension__ ({ \61621#define vshll_high_n_s32(__p0_811, __p1_811) __extension__ ({ \
59952 int32x4_t __s0_719 = __p0_719; \61622 int32x4_t __s0_811 = __p0_811; \
59953 int64x2_t __ret_719; \61623 int64x2_t __ret_811; \
59954 __ret_719 = (int64x2_t)(vshll_n_s32(vget_high_s32(__s0_719), __p1_719)); \61624 __ret_811 = (int64x2_t)(vshll_n_s32(vget_high_s32(__s0_811), __p1_811)); \
59955 __ret_719; \61625 __ret_811; \
59956})61626})
59957#else61627#else
59958#define vshll_high_n_s32(__p0_720, __p1_720) __extension__ ({ \61628#define vshll_high_n_s32(__p0_812, __p1_812) __extension__ ({ \
59959 int32x4_t __s0_720 = __p0_720; \61629 int32x4_t __s0_812 = __p0_812; \
59960 int32x4_t __rev0_720; __rev0_720 = __builtin_shufflevector(__s0_720, __s0_720, 3, 2, 1, 0); \61630 int32x4_t __rev0_812; __rev0_812 = __builtin_shufflevector(__s0_812, __s0_812, 3, 2, 1, 0); \
59961 int64x2_t __ret_720; \61631 int64x2_t __ret_812; \
59962 __ret_720 = (int64x2_t)(__noswap_vshll_n_s32(__noswap_vget_high_s32(__rev0_720), __p1_720)); \61632 __ret_812 = (int64x2_t)(__noswap_vshll_n_s32(__noswap_vget_high_s32(__rev0_812), __p1_812)); \
59963 __ret_720 = __builtin_shufflevector(__ret_720, __ret_720, 1, 0); \61633 __ret_812 = __builtin_shufflevector(__ret_812, __ret_812, 1, 0); \
59964 __ret_720; \61634 __ret_812; \
59965})61635})
59966#endif61636#endif
5996761637
59968#ifdef __LITTLE_ENDIAN__61638#ifdef __LITTLE_ENDIAN__
59969#define vshll_high_n_s16(__p0_721, __p1_721) __extension__ ({ \61639#define vshll_high_n_s16(__p0_813, __p1_813) __extension__ ({ \
59970 int16x8_t __s0_721 = __p0_721; \61640 int16x8_t __s0_813 = __p0_813; \
59971 int32x4_t __ret_721; \61641 int32x4_t __ret_813; \
59972 __ret_721 = (int32x4_t)(vshll_n_s16(vget_high_s16(__s0_721), __p1_721)); \61642 __ret_813 = (int32x4_t)(vshll_n_s16(vget_high_s16(__s0_813), __p1_813)); \
59973 __ret_721; \61643 __ret_813; \
59974})61644})
59975#else61645#else
59976#define vshll_high_n_s16(__p0_722, __p1_722) __extension__ ({ \61646#define vshll_high_n_s16(__p0_814, __p1_814) __extension__ ({ \
59977 int16x8_t __s0_722 = __p0_722; \61647 int16x8_t __s0_814 = __p0_814; \
59978 int16x8_t __rev0_722; __rev0_722 = __builtin_shufflevector(__s0_722, __s0_722, 7, 6, 5, 4, 3, 2, 1, 0); \61648 int16x8_t __rev0_814; __rev0_814 = __builtin_shufflevector(__s0_814, __s0_814, 7, 6, 5, 4, 3, 2, 1, 0); \
59979 int32x4_t __ret_722; \61649 int32x4_t __ret_814; \
59980 __ret_722 = (int32x4_t)(__noswap_vshll_n_s16(__noswap_vget_high_s16(__rev0_722), __p1_722)); \61650 __ret_814 = (int32x4_t)(__noswap_vshll_n_s16(__noswap_vget_high_s16(__rev0_814), __p1_814)); \
59981 __ret_722 = __builtin_shufflevector(__ret_722, __ret_722, 3, 2, 1, 0); \61651 __ret_814 = __builtin_shufflevector(__ret_814, __ret_814, 3, 2, 1, 0); \
59982 __ret_722; \61652 __ret_814; \
59983})61653})
59984#endif61654#endif
5998561655
...@@ -59996,128 +61666,128 @@ __ai int64_t vshld_s64(int64_t __p0, int64_t __p1) {...@@ -59996,128 +61666,128 @@ __ai int64_t vshld_s64(int64_t __p0, int64_t __p1) {
59996 __ret; \61666 __ret; \
59997})61667})
59998#ifdef __LITTLE_ENDIAN__61668#ifdef __LITTLE_ENDIAN__
59999#define vshrn_high_n_u32(__p0_723, __p1_723, __p2_723) __extension__ ({ \61669#define vshrn_high_n_u32(__p0_815, __p1_815, __p2_815) __extension__ ({ \
60000 uint16x4_t __s0_723 = __p0_723; \61670 uint16x4_t __s0_815 = __p0_815; \
60001 uint32x4_t __s1_723 = __p1_723; \61671 uint32x4_t __s1_815 = __p1_815; \
60002 uint16x8_t __ret_723; \61672 uint16x8_t __ret_815; \
60003 __ret_723 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_723), (uint16x4_t)(vshrn_n_u32(__s1_723, __p2_723)))); \61673 __ret_815 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_815), (uint16x4_t)(vshrn_n_u32(__s1_815, __p2_815)))); \
60004 __ret_723; \61674 __ret_815; \
60005})61675})
60006#else61676#else
60007#define vshrn_high_n_u32(__p0_724, __p1_724, __p2_724) __extension__ ({ \61677#define vshrn_high_n_u32(__p0_816, __p1_816, __p2_816) __extension__ ({ \
60008 uint16x4_t __s0_724 = __p0_724; \61678 uint16x4_t __s0_816 = __p0_816; \
60009 uint32x4_t __s1_724 = __p1_724; \61679 uint32x4_t __s1_816 = __p1_816; \
60010 uint16x4_t __rev0_724; __rev0_724 = __builtin_shufflevector(__s0_724, __s0_724, 3, 2, 1, 0); \61680 uint16x4_t __rev0_816; __rev0_816 = __builtin_shufflevector(__s0_816, __s0_816, 3, 2, 1, 0); \
60011 uint32x4_t __rev1_724; __rev1_724 = __builtin_shufflevector(__s1_724, __s1_724, 3, 2, 1, 0); \61681 uint32x4_t __rev1_816; __rev1_816 = __builtin_shufflevector(__s1_816, __s1_816, 3, 2, 1, 0); \
60012 uint16x8_t __ret_724; \61682 uint16x8_t __ret_816; \
60013 __ret_724 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_724), (uint16x4_t)(__noswap_vshrn_n_u32(__rev1_724, __p2_724)))); \61683 __ret_816 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_816), (uint16x4_t)(__noswap_vshrn_n_u32(__rev1_816, __p2_816)))); \
60014 __ret_724 = __builtin_shufflevector(__ret_724, __ret_724, 7, 6, 5, 4, 3, 2, 1, 0); \61684 __ret_816 = __builtin_shufflevector(__ret_816, __ret_816, 7, 6, 5, 4, 3, 2, 1, 0); \
60015 __ret_724; \61685 __ret_816; \
60016})61686})
60017#endif61687#endif
6001861688
60019#ifdef __LITTLE_ENDIAN__61689#ifdef __LITTLE_ENDIAN__
60020#define vshrn_high_n_u64(__p0_725, __p1_725, __p2_725) __extension__ ({ \61690#define vshrn_high_n_u64(__p0_817, __p1_817, __p2_817) __extension__ ({ \
60021 uint32x2_t __s0_725 = __p0_725; \61691 uint32x2_t __s0_817 = __p0_817; \
60022 uint64x2_t __s1_725 = __p1_725; \61692 uint64x2_t __s1_817 = __p1_817; \
60023 uint32x4_t __ret_725; \61693 uint32x4_t __ret_817; \
60024 __ret_725 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_725), (uint32x2_t)(vshrn_n_u64(__s1_725, __p2_725)))); \61694 __ret_817 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_817), (uint32x2_t)(vshrn_n_u64(__s1_817, __p2_817)))); \
60025 __ret_725; \61695 __ret_817; \
60026})61696})
60027#else61697#else
60028#define vshrn_high_n_u64(__p0_726, __p1_726, __p2_726) __extension__ ({ \61698#define vshrn_high_n_u64(__p0_818, __p1_818, __p2_818) __extension__ ({ \
60029 uint32x2_t __s0_726 = __p0_726; \61699 uint32x2_t __s0_818 = __p0_818; \
60030 uint64x2_t __s1_726 = __p1_726; \61700 uint64x2_t __s1_818 = __p1_818; \
60031 uint32x2_t __rev0_726; __rev0_726 = __builtin_shufflevector(__s0_726, __s0_726, 1, 0); \61701 uint32x2_t __rev0_818; __rev0_818 = __builtin_shufflevector(__s0_818, __s0_818, 1, 0); \
60032 uint64x2_t __rev1_726; __rev1_726 = __builtin_shufflevector(__s1_726, __s1_726, 1, 0); \61702 uint64x2_t __rev1_818; __rev1_818 = __builtin_shufflevector(__s1_818, __s1_818, 1, 0); \
60033 uint32x4_t __ret_726; \61703 uint32x4_t __ret_818; \
60034 __ret_726 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_726), (uint32x2_t)(__noswap_vshrn_n_u64(__rev1_726, __p2_726)))); \61704 __ret_818 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_818), (uint32x2_t)(__noswap_vshrn_n_u64(__rev1_818, __p2_818)))); \
60035 __ret_726 = __builtin_shufflevector(__ret_726, __ret_726, 3, 2, 1, 0); \61705 __ret_818 = __builtin_shufflevector(__ret_818, __ret_818, 3, 2, 1, 0); \
60036 __ret_726; \61706 __ret_818; \
60037})61707})
60038#endif61708#endif
6003961709
60040#ifdef __LITTLE_ENDIAN__61710#ifdef __LITTLE_ENDIAN__
60041#define vshrn_high_n_u16(__p0_727, __p1_727, __p2_727) __extension__ ({ \61711#define vshrn_high_n_u16(__p0_819, __p1_819, __p2_819) __extension__ ({ \
60042 uint8x8_t __s0_727 = __p0_727; \61712 uint8x8_t __s0_819 = __p0_819; \
60043 uint16x8_t __s1_727 = __p1_727; \61713 uint16x8_t __s1_819 = __p1_819; \
60044 uint8x16_t __ret_727; \61714 uint8x16_t __ret_819; \
60045 __ret_727 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_727), (uint8x8_t)(vshrn_n_u16(__s1_727, __p2_727)))); \61715 __ret_819 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_819), (uint8x8_t)(vshrn_n_u16(__s1_819, __p2_819)))); \
60046 __ret_727; \61716 __ret_819; \
60047})61717})
60048#else61718#else
60049#define vshrn_high_n_u16(__p0_728, __p1_728, __p2_728) __extension__ ({ \61719#define vshrn_high_n_u16(__p0_820, __p1_820, __p2_820) __extension__ ({ \
60050 uint8x8_t __s0_728 = __p0_728; \61720 uint8x8_t __s0_820 = __p0_820; \
60051 uint16x8_t __s1_728 = __p1_728; \61721 uint16x8_t __s1_820 = __p1_820; \
60052 uint8x8_t __rev0_728; __rev0_728 = __builtin_shufflevector(__s0_728, __s0_728, 7, 6, 5, 4, 3, 2, 1, 0); \61722 uint8x8_t __rev0_820; __rev0_820 = __builtin_shufflevector(__s0_820, __s0_820, 7, 6, 5, 4, 3, 2, 1, 0); \
60053 uint16x8_t __rev1_728; __rev1_728 = __builtin_shufflevector(__s1_728, __s1_728, 7, 6, 5, 4, 3, 2, 1, 0); \61723 uint16x8_t __rev1_820; __rev1_820 = __builtin_shufflevector(__s1_820, __s1_820, 7, 6, 5, 4, 3, 2, 1, 0); \
60054 uint8x16_t __ret_728; \61724 uint8x16_t __ret_820; \
60055 __ret_728 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_728), (uint8x8_t)(__noswap_vshrn_n_u16(__rev1_728, __p2_728)))); \61725 __ret_820 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_820), (uint8x8_t)(__noswap_vshrn_n_u16(__rev1_820, __p2_820)))); \
60056 __ret_728 = __builtin_shufflevector(__ret_728, __ret_728, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \61726 __ret_820 = __builtin_shufflevector(__ret_820, __ret_820, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
60057 __ret_728; \61727 __ret_820; \
60058})61728})
60059#endif61729#endif
6006061730
60061#ifdef __LITTLE_ENDIAN__61731#ifdef __LITTLE_ENDIAN__
60062#define vshrn_high_n_s32(__p0_729, __p1_729, __p2_729) __extension__ ({ \61732#define vshrn_high_n_s32(__p0_821, __p1_821, __p2_821) __extension__ ({ \
60063 int16x4_t __s0_729 = __p0_729; \61733 int16x4_t __s0_821 = __p0_821; \
60064 int32x4_t __s1_729 = __p1_729; \61734 int32x4_t __s1_821 = __p1_821; \
60065 int16x8_t __ret_729; \61735 int16x8_t __ret_821; \
60066 __ret_729 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_729), (int16x4_t)(vshrn_n_s32(__s1_729, __p2_729)))); \61736 __ret_821 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_821), (int16x4_t)(vshrn_n_s32(__s1_821, __p2_821)))); \
60067 __ret_729; \61737 __ret_821; \
60068})61738})
60069#else61739#else
60070#define vshrn_high_n_s32(__p0_730, __p1_730, __p2_730) __extension__ ({ \61740#define vshrn_high_n_s32(__p0_822, __p1_822, __p2_822) __extension__ ({ \
60071 int16x4_t __s0_730 = __p0_730; \61741 int16x4_t __s0_822 = __p0_822; \
60072 int32x4_t __s1_730 = __p1_730; \61742 int32x4_t __s1_822 = __p1_822; \
60073 int16x4_t __rev0_730; __rev0_730 = __builtin_shufflevector(__s0_730, __s0_730, 3, 2, 1, 0); \61743 int16x4_t __rev0_822; __rev0_822 = __builtin_shufflevector(__s0_822, __s0_822, 3, 2, 1, 0); \
60074 int32x4_t __rev1_730; __rev1_730 = __builtin_shufflevector(__s1_730, __s1_730, 3, 2, 1, 0); \61744 int32x4_t __rev1_822; __rev1_822 = __builtin_shufflevector(__s1_822, __s1_822, 3, 2, 1, 0); \
60075 int16x8_t __ret_730; \61745 int16x8_t __ret_822; \
60076 __ret_730 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_730), (int16x4_t)(__noswap_vshrn_n_s32(__rev1_730, __p2_730)))); \61746 __ret_822 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_822), (int16x4_t)(__noswap_vshrn_n_s32(__rev1_822, __p2_822)))); \
60077 __ret_730 = __builtin_shufflevector(__ret_730, __ret_730, 7, 6, 5, 4, 3, 2, 1, 0); \61747 __ret_822 = __builtin_shufflevector(__ret_822, __ret_822, 7, 6, 5, 4, 3, 2, 1, 0); \
60078 __ret_730; \61748 __ret_822; \
60079})61749})
60080#endif61750#endif
6008161751
60082#ifdef __LITTLE_ENDIAN__61752#ifdef __LITTLE_ENDIAN__
60083#define vshrn_high_n_s64(__p0_731, __p1_731, __p2_731) __extension__ ({ \61753#define vshrn_high_n_s64(__p0_823, __p1_823, __p2_823) __extension__ ({ \
60084 int32x2_t __s0_731 = __p0_731; \61754 int32x2_t __s0_823 = __p0_823; \
60085 int64x2_t __s1_731 = __p1_731; \61755 int64x2_t __s1_823 = __p1_823; \
60086 int32x4_t __ret_731; \61756 int32x4_t __ret_823; \
60087 __ret_731 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_731), (int32x2_t)(vshrn_n_s64(__s1_731, __p2_731)))); \61757 __ret_823 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_823), (int32x2_t)(vshrn_n_s64(__s1_823, __p2_823)))); \
60088 __ret_731; \61758 __ret_823; \
60089})61759})
60090#else61760#else
60091#define vshrn_high_n_s64(__p0_732, __p1_732, __p2_732) __extension__ ({ \61761#define vshrn_high_n_s64(__p0_824, __p1_824, __p2_824) __extension__ ({ \
60092 int32x2_t __s0_732 = __p0_732; \61762 int32x2_t __s0_824 = __p0_824; \
60093 int64x2_t __s1_732 = __p1_732; \61763 int64x2_t __s1_824 = __p1_824; \
60094 int32x2_t __rev0_732; __rev0_732 = __builtin_shufflevector(__s0_732, __s0_732, 1, 0); \61764 int32x2_t __rev0_824; __rev0_824 = __builtin_shufflevector(__s0_824, __s0_824, 1, 0); \
60095 int64x2_t __rev1_732; __rev1_732 = __builtin_shufflevector(__s1_732, __s1_732, 1, 0); \61765 int64x2_t __rev1_824; __rev1_824 = __builtin_shufflevector(__s1_824, __s1_824, 1, 0); \
60096 int32x4_t __ret_732; \61766 int32x4_t __ret_824; \
60097 __ret_732 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_732), (int32x2_t)(__noswap_vshrn_n_s64(__rev1_732, __p2_732)))); \61767 __ret_824 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_824), (int32x2_t)(__noswap_vshrn_n_s64(__rev1_824, __p2_824)))); \
60098 __ret_732 = __builtin_shufflevector(__ret_732, __ret_732, 3, 2, 1, 0); \61768 __ret_824 = __builtin_shufflevector(__ret_824, __ret_824, 3, 2, 1, 0); \
60099 __ret_732; \61769 __ret_824; \
60100})61770})
60101#endif61771#endif
6010261772
60103#ifdef __LITTLE_ENDIAN__61773#ifdef __LITTLE_ENDIAN__
60104#define vshrn_high_n_s16(__p0_733, __p1_733, __p2_733) __extension__ ({ \61774#define vshrn_high_n_s16(__p0_825, __p1_825, __p2_825) __extension__ ({ \
60105 int8x8_t __s0_733 = __p0_733; \61775 int8x8_t __s0_825 = __p0_825; \
60106 int16x8_t __s1_733 = __p1_733; \61776 int16x8_t __s1_825 = __p1_825; \
60107 int8x16_t __ret_733; \61777 int8x16_t __ret_825; \
60108 __ret_733 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_733), (int8x8_t)(vshrn_n_s16(__s1_733, __p2_733)))); \61778 __ret_825 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_825), (int8x8_t)(vshrn_n_s16(__s1_825, __p2_825)))); \
60109 __ret_733; \61779 __ret_825; \
60110})61780})
60111#else61781#else
60112#define vshrn_high_n_s16(__p0_734, __p1_734, __p2_734) __extension__ ({ \61782#define vshrn_high_n_s16(__p0_826, __p1_826, __p2_826) __extension__ ({ \
60113 int8x8_t __s0_734 = __p0_734; \61783 int8x8_t __s0_826 = __p0_826; \
60114 int16x8_t __s1_734 = __p1_734; \61784 int16x8_t __s1_826 = __p1_826; \
60115 int8x8_t __rev0_734; __rev0_734 = __builtin_shufflevector(__s0_734, __s0_734, 7, 6, 5, 4, 3, 2, 1, 0); \61785 int8x8_t __rev0_826; __rev0_826 = __builtin_shufflevector(__s0_826, __s0_826, 7, 6, 5, 4, 3, 2, 1, 0); \
60116 int16x8_t __rev1_734; __rev1_734 = __builtin_shufflevector(__s1_734, __s1_734, 7, 6, 5, 4, 3, 2, 1, 0); \61786 int16x8_t __rev1_826; __rev1_826 = __builtin_shufflevector(__s1_826, __s1_826, 7, 6, 5, 4, 3, 2, 1, 0); \
60117 int8x16_t __ret_734; \61787 int8x16_t __ret_826; \
60118 __ret_734 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_734), (int8x8_t)(__noswap_vshrn_n_s16(__rev1_734, __p2_734)))); \61788 __ret_826 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_826), (int8x8_t)(__noswap_vshrn_n_s16(__rev1_826, __p2_826)))); \
60119 __ret_734 = __builtin_shufflevector(__ret_734, __ret_734, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \61789 __ret_826 = __builtin_shufflevector(__ret_826, __ret_826, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
60120 __ret_734; \61790 __ret_826; \
60121})61791})
60122#endif61792#endif
6012361793
...@@ -61553,54 +63223,54 @@ __ai int32x4_t vsubw_high_s16(int32x4_t __p0, int16x8_t __p1) {...@@ -61553,54 +63223,54 @@ __ai int32x4_t vsubw_high_s16(int32x4_t __p0, int16x8_t __p1) {
61553#endif63223#endif
6155463224
61555#ifdef __LITTLE_ENDIAN__63225#ifdef __LITTLE_ENDIAN__
61556#define vsudotq_laneq_s32(__p0_735, __p1_735, __p2_735, __p3_735) __extension__ ({ \63226#define vsudotq_laneq_s32(__p0_827, __p1_827, __p2_827, __p3_827) __extension__ ({ \
61557 int32x4_t __s0_735 = __p0_735; \63227 int32x4_t __s0_827 = __p0_827; \
61558 int8x16_t __s1_735 = __p1_735; \63228 int8x16_t __s1_827 = __p1_827; \
61559 uint8x16_t __s2_735 = __p2_735; \63229 uint8x16_t __s2_827 = __p2_827; \
61560 int32x4_t __ret_735; \63230 int32x4_t __ret_827; \
61561uint8x16_t __reint_735 = __s2_735; \63231uint8x16_t __reint_827 = __s2_827; \
61562 __ret_735 = vusdotq_s32(__s0_735, (uint8x16_t)(splatq_laneq_s32(*(int32x4_t *) &__reint_735, __p3_735)), __s1_735); \63232 __ret_827 = vusdotq_s32(__s0_827, (uint8x16_t)(splatq_laneq_s32(*(int32x4_t *) &__reint_827, __p3_827)), __s1_827); \
61563 __ret_735; \63233 __ret_827; \
61564})63234})
61565#else63235#else
61566#define vsudotq_laneq_s32(__p0_736, __p1_736, __p2_736, __p3_736) __extension__ ({ \63236#define vsudotq_laneq_s32(__p0_828, __p1_828, __p2_828, __p3_828) __extension__ ({ \
61567 int32x4_t __s0_736 = __p0_736; \63237 int32x4_t __s0_828 = __p0_828; \
61568 int8x16_t __s1_736 = __p1_736; \63238 int8x16_t __s1_828 = __p1_828; \
61569 uint8x16_t __s2_736 = __p2_736; \63239 uint8x16_t __s2_828 = __p2_828; \
61570 int32x4_t __rev0_736; __rev0_736 = __builtin_shufflevector(__s0_736, __s0_736, 3, 2, 1, 0); \63240 int32x4_t __rev0_828; __rev0_828 = __builtin_shufflevector(__s0_828, __s0_828, 3, 2, 1, 0); \
61571 int8x16_t __rev1_736; __rev1_736 = __builtin_shufflevector(__s1_736, __s1_736, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \63241 int8x16_t __rev1_828; __rev1_828 = __builtin_shufflevector(__s1_828, __s1_828, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
61572 uint8x16_t __rev2_736; __rev2_736 = __builtin_shufflevector(__s2_736, __s2_736, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \63242 uint8x16_t __rev2_828; __rev2_828 = __builtin_shufflevector(__s2_828, __s2_828, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
61573 int32x4_t __ret_736; \63243 int32x4_t __ret_828; \
61574uint8x16_t __reint_736 = __rev2_736; \63244uint8x16_t __reint_828 = __rev2_828; \
61575 __ret_736 = __noswap_vusdotq_s32(__rev0_736, (uint8x16_t)(__noswap_splatq_laneq_s32(*(int32x4_t *) &__reint_736, __p3_736)), __rev1_736); \63245 __ret_828 = __noswap_vusdotq_s32(__rev0_828, (uint8x16_t)(__noswap_splatq_laneq_s32(*(int32x4_t *) &__reint_828, __p3_828)), __rev1_828); \
61576 __ret_736 = __builtin_shufflevector(__ret_736, __ret_736, 3, 2, 1, 0); \63246 __ret_828 = __builtin_shufflevector(__ret_828, __ret_828, 3, 2, 1, 0); \
61577 __ret_736; \63247 __ret_828; \
61578})63248})
61579#endif63249#endif
6158063250
61581#ifdef __LITTLE_ENDIAN__63251#ifdef __LITTLE_ENDIAN__
61582#define vsudot_laneq_s32(__p0_737, __p1_737, __p2_737, __p3_737) __extension__ ({ \63252#define vsudot_laneq_s32(__p0_829, __p1_829, __p2_829, __p3_829) __extension__ ({ \
61583 int32x2_t __s0_737 = __p0_737; \63253 int32x2_t __s0_829 = __p0_829; \
61584 int8x8_t __s1_737 = __p1_737; \63254 int8x8_t __s1_829 = __p1_829; \
61585 uint8x16_t __s2_737 = __p2_737; \63255 uint8x16_t __s2_829 = __p2_829; \
61586 int32x2_t __ret_737; \63256 int32x2_t __ret_829; \
61587uint8x16_t __reint_737 = __s2_737; \63257uint8x16_t __reint_829 = __s2_829; \
61588 __ret_737 = vusdot_s32(__s0_737, (uint8x8_t)(splat_laneq_s32(*(int32x4_t *) &__reint_737, __p3_737)), __s1_737); \63258 __ret_829 = vusdot_s32(__s0_829, (uint8x8_t)(splat_laneq_s32(*(int32x4_t *) &__reint_829, __p3_829)), __s1_829); \
61589 __ret_737; \63259 __ret_829; \
61590})63260})
61591#else63261#else
61592#define vsudot_laneq_s32(__p0_738, __p1_738, __p2_738, __p3_738) __extension__ ({ \63262#define vsudot_laneq_s32(__p0_830, __p1_830, __p2_830, __p3_830) __extension__ ({ \
61593 int32x2_t __s0_738 = __p0_738; \63263 int32x2_t __s0_830 = __p0_830; \
61594 int8x8_t __s1_738 = __p1_738; \63264 int8x8_t __s1_830 = __p1_830; \
61595 uint8x16_t __s2_738 = __p2_738; \63265 uint8x16_t __s2_830 = __p2_830; \
61596 int32x2_t __rev0_738; __rev0_738 = __builtin_shufflevector(__s0_738, __s0_738, 1, 0); \63266 int32x2_t __rev0_830; __rev0_830 = __builtin_shufflevector(__s0_830, __s0_830, 1, 0); \
61597 int8x8_t __rev1_738; __rev1_738 = __builtin_shufflevector(__s1_738, __s1_738, 7, 6, 5, 4, 3, 2, 1, 0); \63267 int8x8_t __rev1_830; __rev1_830 = __builtin_shufflevector(__s1_830, __s1_830, 7, 6, 5, 4, 3, 2, 1, 0); \
61598 uint8x16_t __rev2_738; __rev2_738 = __builtin_shufflevector(__s2_738, __s2_738, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \63268 uint8x16_t __rev2_830; __rev2_830 = __builtin_shufflevector(__s2_830, __s2_830, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
61599 int32x2_t __ret_738; \63269 int32x2_t __ret_830; \
61600uint8x16_t __reint_738 = __rev2_738; \63270uint8x16_t __reint_830 = __rev2_830; \
61601 __ret_738 = __noswap_vusdot_s32(__rev0_738, (uint8x8_t)(__noswap_splat_laneq_s32(*(int32x4_t *) &__reint_738, __p3_738)), __rev1_738); \63271 __ret_830 = __noswap_vusdot_s32(__rev0_830, (uint8x8_t)(__noswap_splat_laneq_s32(*(int32x4_t *) &__reint_830, __p3_830)), __rev1_830); \
61602 __ret_738 = __builtin_shufflevector(__ret_738, __ret_738, 1, 0); \63272 __ret_830 = __builtin_shufflevector(__ret_830, __ret_830, 1, 0); \
61603 __ret_738; \63273 __ret_830; \
61604})63274})
61605#endif63275#endif
6160663276
...@@ -62423,9 +64093,9 @@ __ai uint64_t vtstd_u64(uint64_t __p0, uint64_t __p1) {...@@ -62423,9 +64093,9 @@ __ai uint64_t vtstd_u64(uint64_t __p0, uint64_t __p1) {
62423 __ret = (uint64_t) __builtin_neon_vtstd_u64(__p0, __p1);64093 __ret = (uint64_t) __builtin_neon_vtstd_u64(__p0, __p1);
62424 return __ret;64094 return __ret;
62425}64095}
62426__ai int64_t vtstd_s64(int64_t __p0, int64_t __p1) {64096__ai uint64_t vtstd_s64(int64_t __p0, int64_t __p1) {
62427 int64_t __ret;64097 uint64_t __ret;
62428 __ret = (int64_t) __builtin_neon_vtstd_s64(__p0, __p1);64098 __ret = (uint64_t) __builtin_neon_vtstd_s64(__p0, __p1);
62429 return __ret;64099 return __ret;
62430}64100}
62431__ai int8_t vuqaddb_s8(int8_t __p0, uint8_t __p1) {64101__ai int8_t vuqaddb_s8(int8_t __p0, uint8_t __p1) {
...@@ -62573,54 +64243,54 @@ __ai int16x4_t vuqadd_s16(int16x4_t __p0, uint16x4_t __p1) {...@@ -62573,54 +64243,54 @@ __ai int16x4_t vuqadd_s16(int16x4_t __p0, uint16x4_t __p1) {
62573#endif64243#endif
6257464244
62575#ifdef __LITTLE_ENDIAN__64245#ifdef __LITTLE_ENDIAN__
62576#define vusdotq_laneq_s32(__p0_739, __p1_739, __p2_739, __p3_739) __extension__ ({ \64246#define vusdotq_laneq_s32(__p0_831, __p1_831, __p2_831, __p3_831) __extension__ ({ \
62577 int32x4_t __s0_739 = __p0_739; \64247 int32x4_t __s0_831 = __p0_831; \
62578 uint8x16_t __s1_739 = __p1_739; \64248 uint8x16_t __s1_831 = __p1_831; \
62579 int8x16_t __s2_739 = __p2_739; \64249 int8x16_t __s2_831 = __p2_831; \
62580 int32x4_t __ret_739; \64250 int32x4_t __ret_831; \
62581int8x16_t __reint_739 = __s2_739; \64251int8x16_t __reint_831 = __s2_831; \
62582 __ret_739 = vusdotq_s32(__s0_739, __s1_739, (int8x16_t)(splatq_laneq_s32(*(int32x4_t *) &__reint_739, __p3_739))); \64252 __ret_831 = vusdotq_s32(__s0_831, __s1_831, (int8x16_t)(splatq_laneq_s32(*(int32x4_t *) &__reint_831, __p3_831))); \
62583 __ret_739; \64253 __ret_831; \
62584})64254})
62585#else64255#else
62586#define vusdotq_laneq_s32(__p0_740, __p1_740, __p2_740, __p3_740) __extension__ ({ \64256#define vusdotq_laneq_s32(__p0_832, __p1_832, __p2_832, __p3_832) __extension__ ({ \
62587 int32x4_t __s0_740 = __p0_740; \64257 int32x4_t __s0_832 = __p0_832; \
62588 uint8x16_t __s1_740 = __p1_740; \64258 uint8x16_t __s1_832 = __p1_832; \
62589 int8x16_t __s2_740 = __p2_740; \64259 int8x16_t __s2_832 = __p2_832; \
62590 int32x4_t __rev0_740; __rev0_740 = __builtin_shufflevector(__s0_740, __s0_740, 3, 2, 1, 0); \64260 int32x4_t __rev0_832; __rev0_832 = __builtin_shufflevector(__s0_832, __s0_832, 3, 2, 1, 0); \
62591 uint8x16_t __rev1_740; __rev1_740 = __builtin_shufflevector(__s1_740, __s1_740, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \64261 uint8x16_t __rev1_832; __rev1_832 = __builtin_shufflevector(__s1_832, __s1_832, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
62592 int8x16_t __rev2_740; __rev2_740 = __builtin_shufflevector(__s2_740, __s2_740, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \64262 int8x16_t __rev2_832; __rev2_832 = __builtin_shufflevector(__s2_832, __s2_832, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
62593 int32x4_t __ret_740; \64263 int32x4_t __ret_832; \
62594int8x16_t __reint_740 = __rev2_740; \64264int8x16_t __reint_832 = __rev2_832; \
62595 __ret_740 = __noswap_vusdotq_s32(__rev0_740, __rev1_740, (int8x16_t)(__noswap_splatq_laneq_s32(*(int32x4_t *) &__reint_740, __p3_740))); \64265 __ret_832 = __noswap_vusdotq_s32(__rev0_832, __rev1_832, (int8x16_t)(__noswap_splatq_laneq_s32(*(int32x4_t *) &__reint_832, __p3_832))); \
62596 __ret_740 = __builtin_shufflevector(__ret_740, __ret_740, 3, 2, 1, 0); \64266 __ret_832 = __builtin_shufflevector(__ret_832, __ret_832, 3, 2, 1, 0); \
62597 __ret_740; \64267 __ret_832; \
62598})64268})
62599#endif64269#endif
6260064270
62601#ifdef __LITTLE_ENDIAN__64271#ifdef __LITTLE_ENDIAN__
62602#define vusdot_laneq_s32(__p0_741, __p1_741, __p2_741, __p3_741) __extension__ ({ \64272#define vusdot_laneq_s32(__p0_833, __p1_833, __p2_833, __p3_833) __extension__ ({ \
62603 int32x2_t __s0_741 = __p0_741; \64273 int32x2_t __s0_833 = __p0_833; \
62604 uint8x8_t __s1_741 = __p1_741; \64274 uint8x8_t __s1_833 = __p1_833; \
62605 int8x16_t __s2_741 = __p2_741; \64275 int8x16_t __s2_833 = __p2_833; \
62606 int32x2_t __ret_741; \64276 int32x2_t __ret_833; \
62607int8x16_t __reint_741 = __s2_741; \64277int8x16_t __reint_833 = __s2_833; \
62608 __ret_741 = vusdot_s32(__s0_741, __s1_741, (int8x8_t)(splat_laneq_s32(*(int32x4_t *) &__reint_741, __p3_741))); \64278 __ret_833 = vusdot_s32(__s0_833, __s1_833, (int8x8_t)(splat_laneq_s32(*(int32x4_t *) &__reint_833, __p3_833))); \
62609 __ret_741; \64279 __ret_833; \
62610})64280})
62611#else64281#else
62612#define vusdot_laneq_s32(__p0_742, __p1_742, __p2_742, __p3_742) __extension__ ({ \64282#define vusdot_laneq_s32(__p0_834, __p1_834, __p2_834, __p3_834) __extension__ ({ \
62613 int32x2_t __s0_742 = __p0_742; \64283 int32x2_t __s0_834 = __p0_834; \
62614 uint8x8_t __s1_742 = __p1_742; \64284 uint8x8_t __s1_834 = __p1_834; \
62615 int8x16_t __s2_742 = __p2_742; \64285 int8x16_t __s2_834 = __p2_834; \
62616 int32x2_t __rev0_742; __rev0_742 = __builtin_shufflevector(__s0_742, __s0_742, 1, 0); \64286 int32x2_t __rev0_834; __rev0_834 = __builtin_shufflevector(__s0_834, __s0_834, 1, 0); \
62617 uint8x8_t __rev1_742; __rev1_742 = __builtin_shufflevector(__s1_742, __s1_742, 7, 6, 5, 4, 3, 2, 1, 0); \64287 uint8x8_t __rev1_834; __rev1_834 = __builtin_shufflevector(__s1_834, __s1_834, 7, 6, 5, 4, 3, 2, 1, 0); \
62618 int8x16_t __rev2_742; __rev2_742 = __builtin_shufflevector(__s2_742, __s2_742, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \64288 int8x16_t __rev2_834; __rev2_834 = __builtin_shufflevector(__s2_834, __s2_834, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
62619 int32x2_t __ret_742; \64289 int32x2_t __ret_834; \
62620int8x16_t __reint_742 = __rev2_742; \64290int8x16_t __reint_834 = __rev2_834; \
62621 __ret_742 = __noswap_vusdot_s32(__rev0_742, __rev1_742, (int8x8_t)(__noswap_splat_laneq_s32(*(int32x4_t *) &__reint_742, __p3_742))); \64291 __ret_834 = __noswap_vusdot_s32(__rev0_834, __rev1_834, (int8x8_t)(__noswap_splat_laneq_s32(*(int32x4_t *) &__reint_834, __p3_834))); \
62622 __ret_742 = __builtin_shufflevector(__ret_742, __ret_742, 1, 0); \64292 __ret_834 = __builtin_shufflevector(__ret_834, __ret_834, 1, 0); \
62623 __ret_742; \64293 __ret_834; \
62624})64294})
62625#endif64295#endif
6262664296
...@@ -64674,60 +66344,60 @@ __ai int32x4_t vaddw_s16(int32x4_t __p0, int16x4_t __p1) {...@@ -64674,60 +66344,60 @@ __ai int32x4_t vaddw_s16(int32x4_t __p0, int16x4_t __p1) {
64674#endif66344#endif
6467566345
64676#ifdef __LITTLE_ENDIAN__66346#ifdef __LITTLE_ENDIAN__
64677#define vget_lane_f16(__p0_743, __p1_743) __extension__ ({ \66347#define vget_lane_f16(__p0_835, __p1_835) __extension__ ({ \
64678 float16x4_t __s0_743 = __p0_743; \66348 float16x4_t __s0_835 = __p0_835; \
64679 float16_t __ret_743; \66349 float16_t __ret_835; \
64680float16x4_t __reint_743 = __s0_743; \66350float16x4_t __reint_835 = __s0_835; \
64681int16_t __reint1_743 = vget_lane_s16(*(int16x4_t *) &__reint_743, __p1_743); \66351int16_t __reint1_835 = vget_lane_s16(*(int16x4_t *) &__reint_835, __p1_835); \
64682 __ret_743 = *(float16_t *) &__reint1_743; \66352 __ret_835 = *(float16_t *) &__reint1_835; \
64683 __ret_743; \66353 __ret_835; \
64684})66354})
64685#else66355#else
64686#define vget_lane_f16(__p0_744, __p1_744) __extension__ ({ \66356#define vget_lane_f16(__p0_836, __p1_836) __extension__ ({ \
64687 float16x4_t __s0_744 = __p0_744; \66357 float16x4_t __s0_836 = __p0_836; \
64688 float16x4_t __rev0_744; __rev0_744 = __builtin_shufflevector(__s0_744, __s0_744, 3, 2, 1, 0); \66358 float16x4_t __rev0_836; __rev0_836 = __builtin_shufflevector(__s0_836, __s0_836, 3, 2, 1, 0); \
64689 float16_t __ret_744; \66359 float16_t __ret_836; \
64690float16x4_t __reint_744 = __rev0_744; \66360float16x4_t __reint_836 = __rev0_836; \
64691int16_t __reint1_744 = __noswap_vget_lane_s16(*(int16x4_t *) &__reint_744, __p1_744); \66361int16_t __reint1_836 = __noswap_vget_lane_s16(*(int16x4_t *) &__reint_836, __p1_836); \
64692 __ret_744 = *(float16_t *) &__reint1_744; \66362 __ret_836 = *(float16_t *) &__reint1_836; \
64693 __ret_744; \66363 __ret_836; \
64694})66364})
64695#define __noswap_vget_lane_f16(__p0_745, __p1_745) __extension__ ({ \66365#define __noswap_vget_lane_f16(__p0_837, __p1_837) __extension__ ({ \
64696 float16x4_t __s0_745 = __p0_745; \66366 float16x4_t __s0_837 = __p0_837; \
64697 float16_t __ret_745; \66367 float16_t __ret_837; \
64698float16x4_t __reint_745 = __s0_745; \66368float16x4_t __reint_837 = __s0_837; \
64699int16_t __reint1_745 = __noswap_vget_lane_s16(*(int16x4_t *) &__reint_745, __p1_745); \66369int16_t __reint1_837 = __noswap_vget_lane_s16(*(int16x4_t *) &__reint_837, __p1_837); \
64700 __ret_745 = *(float16_t *) &__reint1_745; \66370 __ret_837 = *(float16_t *) &__reint1_837; \
64701 __ret_745; \66371 __ret_837; \
64702})66372})
64703#endif66373#endif
6470466374
64705#ifdef __LITTLE_ENDIAN__66375#ifdef __LITTLE_ENDIAN__
64706#define vgetq_lane_f16(__p0_746, __p1_746) __extension__ ({ \66376#define vgetq_lane_f16(__p0_838, __p1_838) __extension__ ({ \
64707 float16x8_t __s0_746 = __p0_746; \66377 float16x8_t __s0_838 = __p0_838; \
64708 float16_t __ret_746; \66378 float16_t __ret_838; \
64709float16x8_t __reint_746 = __s0_746; \66379float16x8_t __reint_838 = __s0_838; \
64710int16_t __reint1_746 = vgetq_lane_s16(*(int16x8_t *) &__reint_746, __p1_746); \66380int16_t __reint1_838 = vgetq_lane_s16(*(int16x8_t *) &__reint_838, __p1_838); \
64711 __ret_746 = *(float16_t *) &__reint1_746; \66381 __ret_838 = *(float16_t *) &__reint1_838; \
64712 __ret_746; \66382 __ret_838; \
64713})66383})
64714#else66384#else
64715#define vgetq_lane_f16(__p0_747, __p1_747) __extension__ ({ \66385#define vgetq_lane_f16(__p0_839, __p1_839) __extension__ ({ \
64716 float16x8_t __s0_747 = __p0_747; \66386 float16x8_t __s0_839 = __p0_839; \
64717 float16x8_t __rev0_747; __rev0_747 = __builtin_shufflevector(__s0_747, __s0_747, 7, 6, 5, 4, 3, 2, 1, 0); \66387 float16x8_t __rev0_839; __rev0_839 = __builtin_shufflevector(__s0_839, __s0_839, 7, 6, 5, 4, 3, 2, 1, 0); \
64718 float16_t __ret_747; \66388 float16_t __ret_839; \
64719float16x8_t __reint_747 = __rev0_747; \66389float16x8_t __reint_839 = __rev0_839; \
64720int16_t __reint1_747 = __noswap_vgetq_lane_s16(*(int16x8_t *) &__reint_747, __p1_747); \66390int16_t __reint1_839 = __noswap_vgetq_lane_s16(*(int16x8_t *) &__reint_839, __p1_839); \
64721 __ret_747 = *(float16_t *) &__reint1_747; \66391 __ret_839 = *(float16_t *) &__reint1_839; \
64722 __ret_747; \66392 __ret_839; \
64723})66393})
64724#define __noswap_vgetq_lane_f16(__p0_748, __p1_748) __extension__ ({ \66394#define __noswap_vgetq_lane_f16(__p0_840, __p1_840) __extension__ ({ \
64725 float16x8_t __s0_748 = __p0_748; \66395 float16x8_t __s0_840 = __p0_840; \
64726 float16_t __ret_748; \66396 float16_t __ret_840; \
64727float16x8_t __reint_748 = __s0_748; \66397float16x8_t __reint_840 = __s0_840; \
64728int16_t __reint1_748 = __noswap_vgetq_lane_s16(*(int16x8_t *) &__reint_748, __p1_748); \66398int16_t __reint1_840 = __noswap_vgetq_lane_s16(*(int16x8_t *) &__reint_840, __p1_840); \
64729 __ret_748 = *(float16_t *) &__reint1_748; \66399 __ret_840 = *(float16_t *) &__reint1_840; \
64730 __ret_748; \66400 __ret_840; \
64731})66401})
64732#endif66402#endif
6473366403
...@@ -64870,98 +66540,98 @@ __ai int32x4_t __noswap_vmlal_s16(int32x4_t __p0, int16x4_t __p1, int16x4_t __p2...@@ -64870,98 +66540,98 @@ __ai int32x4_t __noswap_vmlal_s16(int32x4_t __p0, int16x4_t __p1, int16x4_t __p2
64870#endif66540#endif
6487166541
64872#ifdef __LITTLE_ENDIAN__66542#ifdef __LITTLE_ENDIAN__
64873#define vmlal_lane_u32(__p0_749, __p1_749, __p2_749, __p3_749) __extension__ ({ \66543#define vmlal_lane_u32(__p0_841, __p1_841, __p2_841, __p3_841) __extension__ ({ \
64874 uint64x2_t __s0_749 = __p0_749; \66544 uint64x2_t __s0_841 = __p0_841; \
64875 uint32x2_t __s1_749 = __p1_749; \66545 uint32x2_t __s1_841 = __p1_841; \
64876 uint32x2_t __s2_749 = __p2_749; \66546 uint32x2_t __s2_841 = __p2_841; \
64877 uint64x2_t __ret_749; \66547 uint64x2_t __ret_841; \
64878 __ret_749 = __s0_749 + vmull_u32(__s1_749, splat_lane_u32(__s2_749, __p3_749)); \66548 __ret_841 = __s0_841 + vmull_u32(__s1_841, splat_lane_u32(__s2_841, __p3_841)); \
64879 __ret_749; \66549 __ret_841; \
64880})66550})
64881#else66551#else
64882#define vmlal_lane_u32(__p0_750, __p1_750, __p2_750, __p3_750) __extension__ ({ \66552#define vmlal_lane_u32(__p0_842, __p1_842, __p2_842, __p3_842) __extension__ ({ \
64883 uint64x2_t __s0_750 = __p0_750; \66553 uint64x2_t __s0_842 = __p0_842; \
64884 uint32x2_t __s1_750 = __p1_750; \66554 uint32x2_t __s1_842 = __p1_842; \
64885 uint32x2_t __s2_750 = __p2_750; \66555 uint32x2_t __s2_842 = __p2_842; \
64886 uint64x2_t __rev0_750; __rev0_750 = __builtin_shufflevector(__s0_750, __s0_750, 1, 0); \66556 uint64x2_t __rev0_842; __rev0_842 = __builtin_shufflevector(__s0_842, __s0_842, 1, 0); \
64887 uint32x2_t __rev1_750; __rev1_750 = __builtin_shufflevector(__s1_750, __s1_750, 1, 0); \66557 uint32x2_t __rev1_842; __rev1_842 = __builtin_shufflevector(__s1_842, __s1_842, 1, 0); \
64888 uint32x2_t __rev2_750; __rev2_750 = __builtin_shufflevector(__s2_750, __s2_750, 1, 0); \66558 uint32x2_t __rev2_842; __rev2_842 = __builtin_shufflevector(__s2_842, __s2_842, 1, 0); \
64889 uint64x2_t __ret_750; \66559 uint64x2_t __ret_842; \
64890 __ret_750 = __rev0_750 + __noswap_vmull_u32(__rev1_750, __noswap_splat_lane_u32(__rev2_750, __p3_750)); \66560 __ret_842 = __rev0_842 + __noswap_vmull_u32(__rev1_842, __noswap_splat_lane_u32(__rev2_842, __p3_842)); \
64891 __ret_750 = __builtin_shufflevector(__ret_750, __ret_750, 1, 0); \66561 __ret_842 = __builtin_shufflevector(__ret_842, __ret_842, 1, 0); \
64892 __ret_750; \66562 __ret_842; \
64893})66563})
64894#endif66564#endif
6489566565
64896#ifdef __LITTLE_ENDIAN__66566#ifdef __LITTLE_ENDIAN__
64897#define vmlal_lane_u16(__p0_751, __p1_751, __p2_751, __p3_751) __extension__ ({ \66567#define vmlal_lane_u16(__p0_843, __p1_843, __p2_843, __p3_843) __extension__ ({ \
64898 uint32x4_t __s0_751 = __p0_751; \66568 uint32x4_t __s0_843 = __p0_843; \
64899 uint16x4_t __s1_751 = __p1_751; \66569 uint16x4_t __s1_843 = __p1_843; \
64900 uint16x4_t __s2_751 = __p2_751; \66570 uint16x4_t __s2_843 = __p2_843; \
64901 uint32x4_t __ret_751; \66571 uint32x4_t __ret_843; \
64902 __ret_751 = __s0_751 + vmull_u16(__s1_751, splat_lane_u16(__s2_751, __p3_751)); \66572 __ret_843 = __s0_843 + vmull_u16(__s1_843, splat_lane_u16(__s2_843, __p3_843)); \
64903 __ret_751; \66573 __ret_843; \
64904})66574})
64905#else66575#else
64906#define vmlal_lane_u16(__p0_752, __p1_752, __p2_752, __p3_752) __extension__ ({ \66576#define vmlal_lane_u16(__p0_844, __p1_844, __p2_844, __p3_844) __extension__ ({ \
64907 uint32x4_t __s0_752 = __p0_752; \66577 uint32x4_t __s0_844 = __p0_844; \
64908 uint16x4_t __s1_752 = __p1_752; \66578 uint16x4_t __s1_844 = __p1_844; \
64909 uint16x4_t __s2_752 = __p2_752; \66579 uint16x4_t __s2_844 = __p2_844; \
64910 uint32x4_t __rev0_752; __rev0_752 = __builtin_shufflevector(__s0_752, __s0_752, 3, 2, 1, 0); \66580 uint32x4_t __rev0_844; __rev0_844 = __builtin_shufflevector(__s0_844, __s0_844, 3, 2, 1, 0); \
64911 uint16x4_t __rev1_752; __rev1_752 = __builtin_shufflevector(__s1_752, __s1_752, 3, 2, 1, 0); \66581 uint16x4_t __rev1_844; __rev1_844 = __builtin_shufflevector(__s1_844, __s1_844, 3, 2, 1, 0); \
64912 uint16x4_t __rev2_752; __rev2_752 = __builtin_shufflevector(__s2_752, __s2_752, 3, 2, 1, 0); \66582 uint16x4_t __rev2_844; __rev2_844 = __builtin_shufflevector(__s2_844, __s2_844, 3, 2, 1, 0); \
64913 uint32x4_t __ret_752; \66583 uint32x4_t __ret_844; \
64914 __ret_752 = __rev0_752 + __noswap_vmull_u16(__rev1_752, __noswap_splat_lane_u16(__rev2_752, __p3_752)); \66584 __ret_844 = __rev0_844 + __noswap_vmull_u16(__rev1_844, __noswap_splat_lane_u16(__rev2_844, __p3_844)); \
64915 __ret_752 = __builtin_shufflevector(__ret_752, __ret_752, 3, 2, 1, 0); \66585 __ret_844 = __builtin_shufflevector(__ret_844, __ret_844, 3, 2, 1, 0); \
64916 __ret_752; \66586 __ret_844; \
64917})66587})
64918#endif66588#endif
6491966589
64920#ifdef __LITTLE_ENDIAN__66590#ifdef __LITTLE_ENDIAN__
64921#define vmlal_lane_s32(__p0_753, __p1_753, __p2_753, __p3_753) __extension__ ({ \66591#define vmlal_lane_s32(__p0_845, __p1_845, __p2_845, __p3_845) __extension__ ({ \
64922 int64x2_t __s0_753 = __p0_753; \66592 int64x2_t __s0_845 = __p0_845; \
64923 int32x2_t __s1_753 = __p1_753; \66593 int32x2_t __s1_845 = __p1_845; \
64924 int32x2_t __s2_753 = __p2_753; \66594 int32x2_t __s2_845 = __p2_845; \
64925 int64x2_t __ret_753; \66595 int64x2_t __ret_845; \
64926 __ret_753 = __s0_753 + vmull_s32(__s1_753, splat_lane_s32(__s2_753, __p3_753)); \66596 __ret_845 = __s0_845 + vmull_s32(__s1_845, splat_lane_s32(__s2_845, __p3_845)); \
64927 __ret_753; \66597 __ret_845; \
64928})66598})
64929#else66599#else
64930#define vmlal_lane_s32(__p0_754, __p1_754, __p2_754, __p3_754) __extension__ ({ \66600#define vmlal_lane_s32(__p0_846, __p1_846, __p2_846, __p3_846) __extension__ ({ \
64931 int64x2_t __s0_754 = __p0_754; \66601 int64x2_t __s0_846 = __p0_846; \
64932 int32x2_t __s1_754 = __p1_754; \66602 int32x2_t __s1_846 = __p1_846; \
64933 int32x2_t __s2_754 = __p2_754; \66603 int32x2_t __s2_846 = __p2_846; \
64934 int64x2_t __rev0_754; __rev0_754 = __builtin_shufflevector(__s0_754, __s0_754, 1, 0); \66604 int64x2_t __rev0_846; __rev0_846 = __builtin_shufflevector(__s0_846, __s0_846, 1, 0); \
64935 int32x2_t __rev1_754; __rev1_754 = __builtin_shufflevector(__s1_754, __s1_754, 1, 0); \66605 int32x2_t __rev1_846; __rev1_846 = __builtin_shufflevector(__s1_846, __s1_846, 1, 0); \
64936 int32x2_t __rev2_754; __rev2_754 = __builtin_shufflevector(__s2_754, __s2_754, 1, 0); \66606 int32x2_t __rev2_846; __rev2_846 = __builtin_shufflevector(__s2_846, __s2_846, 1, 0); \
64937 int64x2_t __ret_754; \66607 int64x2_t __ret_846; \
64938 __ret_754 = __rev0_754 + __noswap_vmull_s32(__rev1_754, __noswap_splat_lane_s32(__rev2_754, __p3_754)); \66608 __ret_846 = __rev0_846 + __noswap_vmull_s32(__rev1_846, __noswap_splat_lane_s32(__rev2_846, __p3_846)); \
64939 __ret_754 = __builtin_shufflevector(__ret_754, __ret_754, 1, 0); \66609 __ret_846 = __builtin_shufflevector(__ret_846, __ret_846, 1, 0); \
64940 __ret_754; \66610 __ret_846; \
64941})66611})
64942#endif66612#endif
6494366613
64944#ifdef __LITTLE_ENDIAN__66614#ifdef __LITTLE_ENDIAN__
64945#define vmlal_lane_s16(__p0_755, __p1_755, __p2_755, __p3_755) __extension__ ({ \66615#define vmlal_lane_s16(__p0_847, __p1_847, __p2_847, __p3_847) __extension__ ({ \
64946 int32x4_t __s0_755 = __p0_755; \66616 int32x4_t __s0_847 = __p0_847; \
64947 int16x4_t __s1_755 = __p1_755; \66617 int16x4_t __s1_847 = __p1_847; \
64948 int16x4_t __s2_755 = __p2_755; \66618 int16x4_t __s2_847 = __p2_847; \
64949 int32x4_t __ret_755; \66619 int32x4_t __ret_847; \
64950 __ret_755 = __s0_755 + vmull_s16(__s1_755, splat_lane_s16(__s2_755, __p3_755)); \66620 __ret_847 = __s0_847 + vmull_s16(__s1_847, splat_lane_s16(__s2_847, __p3_847)); \
64951 __ret_755; \66621 __ret_847; \
64952})66622})
64953#else66623#else
64954#define vmlal_lane_s16(__p0_756, __p1_756, __p2_756, __p3_756) __extension__ ({ \66624#define vmlal_lane_s16(__p0_848, __p1_848, __p2_848, __p3_848) __extension__ ({ \
64955 int32x4_t __s0_756 = __p0_756; \66625 int32x4_t __s0_848 = __p0_848; \
64956 int16x4_t __s1_756 = __p1_756; \66626 int16x4_t __s1_848 = __p1_848; \
64957 int16x4_t __s2_756 = __p2_756; \66627 int16x4_t __s2_848 = __p2_848; \
64958 int32x4_t __rev0_756; __rev0_756 = __builtin_shufflevector(__s0_756, __s0_756, 3, 2, 1, 0); \66628 int32x4_t __rev0_848; __rev0_848 = __builtin_shufflevector(__s0_848, __s0_848, 3, 2, 1, 0); \
64959 int16x4_t __rev1_756; __rev1_756 = __builtin_shufflevector(__s1_756, __s1_756, 3, 2, 1, 0); \66629 int16x4_t __rev1_848; __rev1_848 = __builtin_shufflevector(__s1_848, __s1_848, 3, 2, 1, 0); \
64960 int16x4_t __rev2_756; __rev2_756 = __builtin_shufflevector(__s2_756, __s2_756, 3, 2, 1, 0); \66630 int16x4_t __rev2_848; __rev2_848 = __builtin_shufflevector(__s2_848, __s2_848, 3, 2, 1, 0); \
64961 int32x4_t __ret_756; \66631 int32x4_t __ret_848; \
64962 __ret_756 = __rev0_756 + __noswap_vmull_s16(__rev1_756, __noswap_splat_lane_s16(__rev2_756, __p3_756)); \66632 __ret_848 = __rev0_848 + __noswap_vmull_s16(__rev1_848, __noswap_splat_lane_s16(__rev2_848, __p3_848)); \
64963 __ret_756 = __builtin_shufflevector(__ret_756, __ret_756, 3, 2, 1, 0); \66633 __ret_848 = __builtin_shufflevector(__ret_848, __ret_848, 3, 2, 1, 0); \
64964 __ret_756; \66634 __ret_848; \
64965})66635})
64966#endif66636#endif
6496766637
...@@ -65192,98 +66862,98 @@ __ai int32x4_t __noswap_vmlsl_s16(int32x4_t __p0, int16x4_t __p1, int16x4_t __p2...@@ -65192,98 +66862,98 @@ __ai int32x4_t __noswap_vmlsl_s16(int32x4_t __p0, int16x4_t __p1, int16x4_t __p2
65192#endif66862#endif
6519366863
65194#ifdef __LITTLE_ENDIAN__66864#ifdef __LITTLE_ENDIAN__
65195#define vmlsl_lane_u32(__p0_757, __p1_757, __p2_757, __p3_757) __extension__ ({ \66865#define vmlsl_lane_u32(__p0_849, __p1_849, __p2_849, __p3_849) __extension__ ({ \
65196 uint64x2_t __s0_757 = __p0_757; \66866 uint64x2_t __s0_849 = __p0_849; \
65197 uint32x2_t __s1_757 = __p1_757; \66867 uint32x2_t __s1_849 = __p1_849; \
65198 uint32x2_t __s2_757 = __p2_757; \66868 uint32x2_t __s2_849 = __p2_849; \
65199 uint64x2_t __ret_757; \66869 uint64x2_t __ret_849; \
65200 __ret_757 = __s0_757 - vmull_u32(__s1_757, splat_lane_u32(__s2_757, __p3_757)); \66870 __ret_849 = __s0_849 - vmull_u32(__s1_849, splat_lane_u32(__s2_849, __p3_849)); \
65201 __ret_757; \66871 __ret_849; \
65202})66872})
65203#else66873#else
65204#define vmlsl_lane_u32(__p0_758, __p1_758, __p2_758, __p3_758) __extension__ ({ \66874#define vmlsl_lane_u32(__p0_850, __p1_850, __p2_850, __p3_850) __extension__ ({ \
65205 uint64x2_t __s0_758 = __p0_758; \66875 uint64x2_t __s0_850 = __p0_850; \
65206 uint32x2_t __s1_758 = __p1_758; \66876 uint32x2_t __s1_850 = __p1_850; \
65207 uint32x2_t __s2_758 = __p2_758; \66877 uint32x2_t __s2_850 = __p2_850; \
65208 uint64x2_t __rev0_758; __rev0_758 = __builtin_shufflevector(__s0_758, __s0_758, 1, 0); \66878 uint64x2_t __rev0_850; __rev0_850 = __builtin_shufflevector(__s0_850, __s0_850, 1, 0); \
65209 uint32x2_t __rev1_758; __rev1_758 = __builtin_shufflevector(__s1_758, __s1_758, 1, 0); \66879 uint32x2_t __rev1_850; __rev1_850 = __builtin_shufflevector(__s1_850, __s1_850, 1, 0); \
65210 uint32x2_t __rev2_758; __rev2_758 = __builtin_shufflevector(__s2_758, __s2_758, 1, 0); \66880 uint32x2_t __rev2_850; __rev2_850 = __builtin_shufflevector(__s2_850, __s2_850, 1, 0); \
65211 uint64x2_t __ret_758; \66881 uint64x2_t __ret_850; \
65212 __ret_758 = __rev0_758 - __noswap_vmull_u32(__rev1_758, __noswap_splat_lane_u32(__rev2_758, __p3_758)); \66882 __ret_850 = __rev0_850 - __noswap_vmull_u32(__rev1_850, __noswap_splat_lane_u32(__rev2_850, __p3_850)); \
65213 __ret_758 = __builtin_shufflevector(__ret_758, __ret_758, 1, 0); \66883 __ret_850 = __builtin_shufflevector(__ret_850, __ret_850, 1, 0); \
65214 __ret_758; \66884 __ret_850; \
65215})66885})
65216#endif66886#endif
6521766887
65218#ifdef __LITTLE_ENDIAN__66888#ifdef __LITTLE_ENDIAN__
65219#define vmlsl_lane_u16(__p0_759, __p1_759, __p2_759, __p3_759) __extension__ ({ \66889#define vmlsl_lane_u16(__p0_851, __p1_851, __p2_851, __p3_851) __extension__ ({ \
65220 uint32x4_t __s0_759 = __p0_759; \66890 uint32x4_t __s0_851 = __p0_851; \
65221 uint16x4_t __s1_759 = __p1_759; \66891 uint16x4_t __s1_851 = __p1_851; \
65222 uint16x4_t __s2_759 = __p2_759; \66892 uint16x4_t __s2_851 = __p2_851; \
65223 uint32x4_t __ret_759; \66893 uint32x4_t __ret_851; \
65224 __ret_759 = __s0_759 - vmull_u16(__s1_759, splat_lane_u16(__s2_759, __p3_759)); \66894 __ret_851 = __s0_851 - vmull_u16(__s1_851, splat_lane_u16(__s2_851, __p3_851)); \
65225 __ret_759; \66895 __ret_851; \
65226})66896})
65227#else66897#else
65228#define vmlsl_lane_u16(__p0_760, __p1_760, __p2_760, __p3_760) __extension__ ({ \66898#define vmlsl_lane_u16(__p0_852, __p1_852, __p2_852, __p3_852) __extension__ ({ \
65229 uint32x4_t __s0_760 = __p0_760; \66899 uint32x4_t __s0_852 = __p0_852; \
65230 uint16x4_t __s1_760 = __p1_760; \66900 uint16x4_t __s1_852 = __p1_852; \
65231 uint16x4_t __s2_760 = __p2_760; \66901 uint16x4_t __s2_852 = __p2_852; \
65232 uint32x4_t __rev0_760; __rev0_760 = __builtin_shufflevector(__s0_760, __s0_760, 3, 2, 1, 0); \66902 uint32x4_t __rev0_852; __rev0_852 = __builtin_shufflevector(__s0_852, __s0_852, 3, 2, 1, 0); \
65233 uint16x4_t __rev1_760; __rev1_760 = __builtin_shufflevector(__s1_760, __s1_760, 3, 2, 1, 0); \66903 uint16x4_t __rev1_852; __rev1_852 = __builtin_shufflevector(__s1_852, __s1_852, 3, 2, 1, 0); \
65234 uint16x4_t __rev2_760; __rev2_760 = __builtin_shufflevector(__s2_760, __s2_760, 3, 2, 1, 0); \66904 uint16x4_t __rev2_852; __rev2_852 = __builtin_shufflevector(__s2_852, __s2_852, 3, 2, 1, 0); \
65235 uint32x4_t __ret_760; \66905 uint32x4_t __ret_852; \
65236 __ret_760 = __rev0_760 - __noswap_vmull_u16(__rev1_760, __noswap_splat_lane_u16(__rev2_760, __p3_760)); \66906 __ret_852 = __rev0_852 - __noswap_vmull_u16(__rev1_852, __noswap_splat_lane_u16(__rev2_852, __p3_852)); \
65237 __ret_760 = __builtin_shufflevector(__ret_760, __ret_760, 3, 2, 1, 0); \66907 __ret_852 = __builtin_shufflevector(__ret_852, __ret_852, 3, 2, 1, 0); \
65238 __ret_760; \66908 __ret_852; \
65239})66909})
65240#endif66910#endif
6524166911
65242#ifdef __LITTLE_ENDIAN__66912#ifdef __LITTLE_ENDIAN__
65243#define vmlsl_lane_s32(__p0_761, __p1_761, __p2_761, __p3_761) __extension__ ({ \66913#define vmlsl_lane_s32(__p0_853, __p1_853, __p2_853, __p3_853) __extension__ ({ \
65244 int64x2_t __s0_761 = __p0_761; \66914 int64x2_t __s0_853 = __p0_853; \
65245 int32x2_t __s1_761 = __p1_761; \66915 int32x2_t __s1_853 = __p1_853; \
65246 int32x2_t __s2_761 = __p2_761; \66916 int32x2_t __s2_853 = __p2_853; \
65247 int64x2_t __ret_761; \66917 int64x2_t __ret_853; \
65248 __ret_761 = __s0_761 - vmull_s32(__s1_761, splat_lane_s32(__s2_761, __p3_761)); \66918 __ret_853 = __s0_853 - vmull_s32(__s1_853, splat_lane_s32(__s2_853, __p3_853)); \
65249 __ret_761; \66919 __ret_853; \
65250})66920})
65251#else66921#else
65252#define vmlsl_lane_s32(__p0_762, __p1_762, __p2_762, __p3_762) __extension__ ({ \66922#define vmlsl_lane_s32(__p0_854, __p1_854, __p2_854, __p3_854) __extension__ ({ \
65253 int64x2_t __s0_762 = __p0_762; \66923 int64x2_t __s0_854 = __p0_854; \
65254 int32x2_t __s1_762 = __p1_762; \66924 int32x2_t __s1_854 = __p1_854; \
65255 int32x2_t __s2_762 = __p2_762; \66925 int32x2_t __s2_854 = __p2_854; \
65256 int64x2_t __rev0_762; __rev0_762 = __builtin_shufflevector(__s0_762, __s0_762, 1, 0); \66926 int64x2_t __rev0_854; __rev0_854 = __builtin_shufflevector(__s0_854, __s0_854, 1, 0); \
65257 int32x2_t __rev1_762; __rev1_762 = __builtin_shufflevector(__s1_762, __s1_762, 1, 0); \66927 int32x2_t __rev1_854; __rev1_854 = __builtin_shufflevector(__s1_854, __s1_854, 1, 0); \
65258 int32x2_t __rev2_762; __rev2_762 = __builtin_shufflevector(__s2_762, __s2_762, 1, 0); \66928 int32x2_t __rev2_854; __rev2_854 = __builtin_shufflevector(__s2_854, __s2_854, 1, 0); \
65259 int64x2_t __ret_762; \66929 int64x2_t __ret_854; \
65260 __ret_762 = __rev0_762 - __noswap_vmull_s32(__rev1_762, __noswap_splat_lane_s32(__rev2_762, __p3_762)); \66930 __ret_854 = __rev0_854 - __noswap_vmull_s32(__rev1_854, __noswap_splat_lane_s32(__rev2_854, __p3_854)); \
65261 __ret_762 = __builtin_shufflevector(__ret_762, __ret_762, 1, 0); \66931 __ret_854 = __builtin_shufflevector(__ret_854, __ret_854, 1, 0); \
65262 __ret_762; \66932 __ret_854; \
65263})66933})
65264#endif66934#endif
6526566935
65266#ifdef __LITTLE_ENDIAN__66936#ifdef __LITTLE_ENDIAN__
65267#define vmlsl_lane_s16(__p0_763, __p1_763, __p2_763, __p3_763) __extension__ ({ \66937#define vmlsl_lane_s16(__p0_855, __p1_855, __p2_855, __p3_855) __extension__ ({ \
65268 int32x4_t __s0_763 = __p0_763; \66938 int32x4_t __s0_855 = __p0_855; \
65269 int16x4_t __s1_763 = __p1_763; \66939 int16x4_t __s1_855 = __p1_855; \
65270 int16x4_t __s2_763 = __p2_763; \66940 int16x4_t __s2_855 = __p2_855; \
65271 int32x4_t __ret_763; \66941 int32x4_t __ret_855; \
65272 __ret_763 = __s0_763 - vmull_s16(__s1_763, splat_lane_s16(__s2_763, __p3_763)); \66942 __ret_855 = __s0_855 - vmull_s16(__s1_855, splat_lane_s16(__s2_855, __p3_855)); \
65273 __ret_763; \66943 __ret_855; \
65274})66944})
65275#else66945#else
65276#define vmlsl_lane_s16(__p0_764, __p1_764, __p2_764, __p3_764) __extension__ ({ \66946#define vmlsl_lane_s16(__p0_856, __p1_856, __p2_856, __p3_856) __extension__ ({ \
65277 int32x4_t __s0_764 = __p0_764; \66947 int32x4_t __s0_856 = __p0_856; \
65278 int16x4_t __s1_764 = __p1_764; \66948 int16x4_t __s1_856 = __p1_856; \
65279 int16x4_t __s2_764 = __p2_764; \66949 int16x4_t __s2_856 = __p2_856; \
65280 int32x4_t __rev0_764; __rev0_764 = __builtin_shufflevector(__s0_764, __s0_764, 3, 2, 1, 0); \66950 int32x4_t __rev0_856; __rev0_856 = __builtin_shufflevector(__s0_856, __s0_856, 3, 2, 1, 0); \
65281 int16x4_t __rev1_764; __rev1_764 = __builtin_shufflevector(__s1_764, __s1_764, 3, 2, 1, 0); \66951 int16x4_t __rev1_856; __rev1_856 = __builtin_shufflevector(__s1_856, __s1_856, 3, 2, 1, 0); \
65282 int16x4_t __rev2_764; __rev2_764 = __builtin_shufflevector(__s2_764, __s2_764, 3, 2, 1, 0); \66952 int16x4_t __rev2_856; __rev2_856 = __builtin_shufflevector(__s2_856, __s2_856, 3, 2, 1, 0); \
65283 int32x4_t __ret_764; \66953 int32x4_t __ret_856; \
65284 __ret_764 = __rev0_764 - __noswap_vmull_s16(__rev1_764, __noswap_splat_lane_s16(__rev2_764, __p3_764)); \66954 __ret_856 = __rev0_856 - __noswap_vmull_s16(__rev1_856, __noswap_splat_lane_s16(__rev2_856, __p3_856)); \
65285 __ret_764 = __builtin_shufflevector(__ret_764, __ret_764, 3, 2, 1, 0); \66955 __ret_856 = __builtin_shufflevector(__ret_856, __ret_856, 3, 2, 1, 0); \
65286 __ret_764; \66956 __ret_856; \
65287})66957})
65288#endif66958#endif
6528966959
...@@ -65376,151 +67046,151 @@ __ai int32x4_t __noswap_vmlsl_n_s16(int32x4_t __p0, int16x4_t __p1, int16_t __p2...@@ -65376,151 +67046,151 @@ __ai int32x4_t __noswap_vmlsl_n_s16(int32x4_t __p0, int16x4_t __p1, int16_t __p2
65376#endif67046#endif
6537767047
65378#ifdef __LITTLE_ENDIAN__67048#ifdef __LITTLE_ENDIAN__
65379#define vset_lane_f16(__p0_765, __p1_765, __p2_765) __extension__ ({ \67049#define vset_lane_f16(__p0_857, __p1_857, __p2_857) __extension__ ({ \
65380 float16_t __s0_765 = __p0_765; \67050 float16_t __s0_857 = __p0_857; \
65381 float16x4_t __s1_765 = __p1_765; \67051 float16x4_t __s1_857 = __p1_857; \
65382 float16x4_t __ret_765; \67052 float16x4_t __ret_857; \
65383float16_t __reint_765 = __s0_765; \67053float16_t __reint_857 = __s0_857; \
65384float16x4_t __reint1_765 = __s1_765; \67054float16x4_t __reint1_857 = __s1_857; \
65385int16x4_t __reint2_765 = vset_lane_s16(*(int16_t *) &__reint_765, *(int16x4_t *) &__reint1_765, __p2_765); \67055int16x4_t __reint2_857 = vset_lane_s16(*(int16_t *) &__reint_857, *(int16x4_t *) &__reint1_857, __p2_857); \
65386 __ret_765 = *(float16x4_t *) &__reint2_765; \67056 __ret_857 = *(float16x4_t *) &__reint2_857; \
65387 __ret_765; \67057 __ret_857; \
65388})67058})
65389#else67059#else
65390#define vset_lane_f16(__p0_766, __p1_766, __p2_766) __extension__ ({ \67060#define vset_lane_f16(__p0_858, __p1_858, __p2_858) __extension__ ({ \
65391 float16_t __s0_766 = __p0_766; \67061 float16_t __s0_858 = __p0_858; \
65392 float16x4_t __s1_766 = __p1_766; \67062 float16x4_t __s1_858 = __p1_858; \
65393 float16x4_t __rev1_766; __rev1_766 = __builtin_shufflevector(__s1_766, __s1_766, 3, 2, 1, 0); \67063 float16x4_t __rev1_858; __rev1_858 = __builtin_shufflevector(__s1_858, __s1_858, 3, 2, 1, 0); \
65394 float16x4_t __ret_766; \67064 float16x4_t __ret_858; \
65395float16_t __reint_766 = __s0_766; \67065float16_t __reint_858 = __s0_858; \
65396float16x4_t __reint1_766 = __rev1_766; \67066float16x4_t __reint1_858 = __rev1_858; \
65397int16x4_t __reint2_766 = __noswap_vset_lane_s16(*(int16_t *) &__reint_766, *(int16x4_t *) &__reint1_766, __p2_766); \67067int16x4_t __reint2_858 = __noswap_vset_lane_s16(*(int16_t *) &__reint_858, *(int16x4_t *) &__reint1_858, __p2_858); \
65398 __ret_766 = *(float16x4_t *) &__reint2_766; \67068 __ret_858 = *(float16x4_t *) &__reint2_858; \
65399 __ret_766 = __builtin_shufflevector(__ret_766, __ret_766, 3, 2, 1, 0); \67069 __ret_858 = __builtin_shufflevector(__ret_858, __ret_858, 3, 2, 1, 0); \
65400 __ret_766; \67070 __ret_858; \
65401})67071})
65402#endif67072#endif
6540367073
65404#ifdef __LITTLE_ENDIAN__67074#ifdef __LITTLE_ENDIAN__
65405#define vsetq_lane_f16(__p0_767, __p1_767, __p2_767) __extension__ ({ \67075#define vsetq_lane_f16(__p0_859, __p1_859, __p2_859) __extension__ ({ \
65406 float16_t __s0_767 = __p0_767; \67076 float16_t __s0_859 = __p0_859; \
65407 float16x8_t __s1_767 = __p1_767; \67077 float16x8_t __s1_859 = __p1_859; \
65408 float16x8_t __ret_767; \67078 float16x8_t __ret_859; \
65409float16_t __reint_767 = __s0_767; \67079float16_t __reint_859 = __s0_859; \
65410float16x8_t __reint1_767 = __s1_767; \67080float16x8_t __reint1_859 = __s1_859; \
65411int16x8_t __reint2_767 = vsetq_lane_s16(*(int16_t *) &__reint_767, *(int16x8_t *) &__reint1_767, __p2_767); \67081int16x8_t __reint2_859 = vsetq_lane_s16(*(int16_t *) &__reint_859, *(int16x8_t *) &__reint1_859, __p2_859); \
65412 __ret_767 = *(float16x8_t *) &__reint2_767; \67082 __ret_859 = *(float16x8_t *) &__reint2_859; \
65413 __ret_767; \67083 __ret_859; \
65414})67084})
65415#else67085#else
65416#define vsetq_lane_f16(__p0_768, __p1_768, __p2_768) __extension__ ({ \67086#define vsetq_lane_f16(__p0_860, __p1_860, __p2_860) __extension__ ({ \
65417 float16_t __s0_768 = __p0_768; \67087 float16_t __s0_860 = __p0_860; \
65418 float16x8_t __s1_768 = __p1_768; \67088 float16x8_t __s1_860 = __p1_860; \
65419 float16x8_t __rev1_768; __rev1_768 = __builtin_shufflevector(__s1_768, __s1_768, 7, 6, 5, 4, 3, 2, 1, 0); \67089 float16x8_t __rev1_860; __rev1_860 = __builtin_shufflevector(__s1_860, __s1_860, 7, 6, 5, 4, 3, 2, 1, 0); \
65420 float16x8_t __ret_768; \67090 float16x8_t __ret_860; \
65421float16_t __reint_768 = __s0_768; \67091float16_t __reint_860 = __s0_860; \
65422float16x8_t __reint1_768 = __rev1_768; \67092float16x8_t __reint1_860 = __rev1_860; \
65423int16x8_t __reint2_768 = __noswap_vsetq_lane_s16(*(int16_t *) &__reint_768, *(int16x8_t *) &__reint1_768, __p2_768); \67093int16x8_t __reint2_860 = __noswap_vsetq_lane_s16(*(int16_t *) &__reint_860, *(int16x8_t *) &__reint1_860, __p2_860); \
65424 __ret_768 = *(float16x8_t *) &__reint2_768; \67094 __ret_860 = *(float16x8_t *) &__reint2_860; \
65425 __ret_768 = __builtin_shufflevector(__ret_768, __ret_768, 7, 6, 5, 4, 3, 2, 1, 0); \67095 __ret_860 = __builtin_shufflevector(__ret_860, __ret_860, 7, 6, 5, 4, 3, 2, 1, 0); \
65426 __ret_768; \67096 __ret_860; \
65427})67097})
65428#endif67098#endif
6542967099
65430#if defined(__ARM_FEATURE_BF16_VECTOR_ARITHMETIC)67100#if defined(__ARM_FEATURE_BF16_VECTOR_ARITHMETIC)
65431#ifdef __LITTLE_ENDIAN__67101#ifdef __LITTLE_ENDIAN__
65432#define vbfmlalbq_lane_f32(__p0_769, __p1_769, __p2_769, __p3_769) __extension__ ({ \67102#define vbfmlalbq_lane_f32(__p0_861, __p1_861, __p2_861, __p3_861) __extension__ ({ \
65433 float32x4_t __s0_769 = __p0_769; \67103 float32x4_t __s0_861 = __p0_861; \
65434 bfloat16x8_t __s1_769 = __p1_769; \67104 bfloat16x8_t __s1_861 = __p1_861; \
65435 bfloat16x4_t __s2_769 = __p2_769; \67105 bfloat16x4_t __s2_861 = __p2_861; \
65436 float32x4_t __ret_769; \67106 float32x4_t __ret_861; \
65437 __ret_769 = vbfmlalbq_f32(__s0_769, __s1_769, (bfloat16x8_t) {vget_lane_bf16(__s2_769, __p3_769), vget_lane_bf16(__s2_769, __p3_769), vget_lane_bf16(__s2_769, __p3_769), vget_lane_bf16(__s2_769, __p3_769), vget_lane_bf16(__s2_769, __p3_769), vget_lane_bf16(__s2_769, __p3_769), vget_lane_bf16(__s2_769, __p3_769), vget_lane_bf16(__s2_769, __p3_769)}); \67107 __ret_861 = vbfmlalbq_f32(__s0_861, __s1_861, (bfloat16x8_t) {vget_lane_bf16(__s2_861, __p3_861), vget_lane_bf16(__s2_861, __p3_861), vget_lane_bf16(__s2_861, __p3_861), vget_lane_bf16(__s2_861, __p3_861), vget_lane_bf16(__s2_861, __p3_861), vget_lane_bf16(__s2_861, __p3_861), vget_lane_bf16(__s2_861, __p3_861), vget_lane_bf16(__s2_861, __p3_861)}); \
65438 __ret_769; \67108 __ret_861; \
65439})67109})
65440#else67110#else
65441#define vbfmlalbq_lane_f32(__p0_770, __p1_770, __p2_770, __p3_770) __extension__ ({ \67111#define vbfmlalbq_lane_f32(__p0_862, __p1_862, __p2_862, __p3_862) __extension__ ({ \
65442 float32x4_t __s0_770 = __p0_770; \67112 float32x4_t __s0_862 = __p0_862; \
65443 bfloat16x8_t __s1_770 = __p1_770; \67113 bfloat16x8_t __s1_862 = __p1_862; \
65444 bfloat16x4_t __s2_770 = __p2_770; \67114 bfloat16x4_t __s2_862 = __p2_862; \
65445 float32x4_t __rev0_770; __rev0_770 = __builtin_shufflevector(__s0_770, __s0_770, 3, 2, 1, 0); \67115 float32x4_t __rev0_862; __rev0_862 = __builtin_shufflevector(__s0_862, __s0_862, 3, 2, 1, 0); \
65446 bfloat16x8_t __rev1_770; __rev1_770 = __builtin_shufflevector(__s1_770, __s1_770, 7, 6, 5, 4, 3, 2, 1, 0); \67116 bfloat16x8_t __rev1_862; __rev1_862 = __builtin_shufflevector(__s1_862, __s1_862, 7, 6, 5, 4, 3, 2, 1, 0); \
65447 bfloat16x4_t __rev2_770; __rev2_770 = __builtin_shufflevector(__s2_770, __s2_770, 3, 2, 1, 0); \67117 bfloat16x4_t __rev2_862; __rev2_862 = __builtin_shufflevector(__s2_862, __s2_862, 3, 2, 1, 0); \
65448 float32x4_t __ret_770; \67118 float32x4_t __ret_862; \
65449 __ret_770 = __noswap_vbfmlalbq_f32(__rev0_770, __rev1_770, (bfloat16x8_t) {__noswap_vget_lane_bf16(__rev2_770, __p3_770), __noswap_vget_lane_bf16(__rev2_770, __p3_770), __noswap_vget_lane_bf16(__rev2_770, __p3_770), __noswap_vget_lane_bf16(__rev2_770, __p3_770), __noswap_vget_lane_bf16(__rev2_770, __p3_770), __noswap_vget_lane_bf16(__rev2_770, __p3_770), __noswap_vget_lane_bf16(__rev2_770, __p3_770), __noswap_vget_lane_bf16(__rev2_770, __p3_770)}); \67119 __ret_862 = __noswap_vbfmlalbq_f32(__rev0_862, __rev1_862, (bfloat16x8_t) {__noswap_vget_lane_bf16(__rev2_862, __p3_862), __noswap_vget_lane_bf16(__rev2_862, __p3_862), __noswap_vget_lane_bf16(__rev2_862, __p3_862), __noswap_vget_lane_bf16(__rev2_862, __p3_862), __noswap_vget_lane_bf16(__rev2_862, __p3_862), __noswap_vget_lane_bf16(__rev2_862, __p3_862), __noswap_vget_lane_bf16(__rev2_862, __p3_862), __noswap_vget_lane_bf16(__rev2_862, __p3_862)}); \
65450 __ret_770 = __builtin_shufflevector(__ret_770, __ret_770, 3, 2, 1, 0); \67120 __ret_862 = __builtin_shufflevector(__ret_862, __ret_862, 3, 2, 1, 0); \
65451 __ret_770; \67121 __ret_862; \
65452})67122})
65453#endif67123#endif
6545467124
65455#ifdef __LITTLE_ENDIAN__67125#ifdef __LITTLE_ENDIAN__
65456#define vbfmlalbq_laneq_f32(__p0_771, __p1_771, __p2_771, __p3_771) __extension__ ({ \67126#define vbfmlalbq_laneq_f32(__p0_863, __p1_863, __p2_863, __p3_863) __extension__ ({ \
65457 float32x4_t __s0_771 = __p0_771; \67127 float32x4_t __s0_863 = __p0_863; \
65458 bfloat16x8_t __s1_771 = __p1_771; \67128 bfloat16x8_t __s1_863 = __p1_863; \
65459 bfloat16x8_t __s2_771 = __p2_771; \67129 bfloat16x8_t __s2_863 = __p2_863; \
65460 float32x4_t __ret_771; \67130 float32x4_t __ret_863; \
65461 __ret_771 = vbfmlalbq_f32(__s0_771, __s1_771, (bfloat16x8_t) {vgetq_lane_bf16(__s2_771, __p3_771), vgetq_lane_bf16(__s2_771, __p3_771), vgetq_lane_bf16(__s2_771, __p3_771), vgetq_lane_bf16(__s2_771, __p3_771), vgetq_lane_bf16(__s2_771, __p3_771), vgetq_lane_bf16(__s2_771, __p3_771), vgetq_lane_bf16(__s2_771, __p3_771), vgetq_lane_bf16(__s2_771, __p3_771)}); \67131 __ret_863 = vbfmlalbq_f32(__s0_863, __s1_863, (bfloat16x8_t) {vgetq_lane_bf16(__s2_863, __p3_863), vgetq_lane_bf16(__s2_863, __p3_863), vgetq_lane_bf16(__s2_863, __p3_863), vgetq_lane_bf16(__s2_863, __p3_863), vgetq_lane_bf16(__s2_863, __p3_863), vgetq_lane_bf16(__s2_863, __p3_863), vgetq_lane_bf16(__s2_863, __p3_863), vgetq_lane_bf16(__s2_863, __p3_863)}); \
65462 __ret_771; \67132 __ret_863; \
65463})67133})
65464#else67134#else
65465#define vbfmlalbq_laneq_f32(__p0_772, __p1_772, __p2_772, __p3_772) __extension__ ({ \67135#define vbfmlalbq_laneq_f32(__p0_864, __p1_864, __p2_864, __p3_864) __extension__ ({ \
65466 float32x4_t __s0_772 = __p0_772; \67136 float32x4_t __s0_864 = __p0_864; \
65467 bfloat16x8_t __s1_772 = __p1_772; \67137 bfloat16x8_t __s1_864 = __p1_864; \
65468 bfloat16x8_t __s2_772 = __p2_772; \67138 bfloat16x8_t __s2_864 = __p2_864; \
65469 float32x4_t __rev0_772; __rev0_772 = __builtin_shufflevector(__s0_772, __s0_772, 3, 2, 1, 0); \67139 float32x4_t __rev0_864; __rev0_864 = __builtin_shufflevector(__s0_864, __s0_864, 3, 2, 1, 0); \
65470 bfloat16x8_t __rev1_772; __rev1_772 = __builtin_shufflevector(__s1_772, __s1_772, 7, 6, 5, 4, 3, 2, 1, 0); \67140 bfloat16x8_t __rev1_864; __rev1_864 = __builtin_shufflevector(__s1_864, __s1_864, 7, 6, 5, 4, 3, 2, 1, 0); \
65471 bfloat16x8_t __rev2_772; __rev2_772 = __builtin_shufflevector(__s2_772, __s2_772, 7, 6, 5, 4, 3, 2, 1, 0); \67141 bfloat16x8_t __rev2_864; __rev2_864 = __builtin_shufflevector(__s2_864, __s2_864, 7, 6, 5, 4, 3, 2, 1, 0); \
65472 float32x4_t __ret_772; \67142 float32x4_t __ret_864; \
65473 __ret_772 = __noswap_vbfmlalbq_f32(__rev0_772, __rev1_772, (bfloat16x8_t) {__noswap_vgetq_lane_bf16(__rev2_772, __p3_772), __noswap_vgetq_lane_bf16(__rev2_772, __p3_772), __noswap_vgetq_lane_bf16(__rev2_772, __p3_772), __noswap_vgetq_lane_bf16(__rev2_772, __p3_772), __noswap_vgetq_lane_bf16(__rev2_772, __p3_772), __noswap_vgetq_lane_bf16(__rev2_772, __p3_772), __noswap_vgetq_lane_bf16(__rev2_772, __p3_772), __noswap_vgetq_lane_bf16(__rev2_772, __p3_772)}); \67143 __ret_864 = __noswap_vbfmlalbq_f32(__rev0_864, __rev1_864, (bfloat16x8_t) {__noswap_vgetq_lane_bf16(__rev2_864, __p3_864), __noswap_vgetq_lane_bf16(__rev2_864, __p3_864), __noswap_vgetq_lane_bf16(__rev2_864, __p3_864), __noswap_vgetq_lane_bf16(__rev2_864, __p3_864), __noswap_vgetq_lane_bf16(__rev2_864, __p3_864), __noswap_vgetq_lane_bf16(__rev2_864, __p3_864), __noswap_vgetq_lane_bf16(__rev2_864, __p3_864), __noswap_vgetq_lane_bf16(__rev2_864, __p3_864)}); \
65474 __ret_772 = __builtin_shufflevector(__ret_772, __ret_772, 3, 2, 1, 0); \67144 __ret_864 = __builtin_shufflevector(__ret_864, __ret_864, 3, 2, 1, 0); \
65475 __ret_772; \67145 __ret_864; \
65476})67146})
65477#endif67147#endif
6547867148
65479#ifdef __LITTLE_ENDIAN__67149#ifdef __LITTLE_ENDIAN__
65480#define vbfmlaltq_lane_f32(__p0_773, __p1_773, __p2_773, __p3_773) __extension__ ({ \67150#define vbfmlaltq_lane_f32(__p0_865, __p1_865, __p2_865, __p3_865) __extension__ ({ \
65481 float32x4_t __s0_773 = __p0_773; \67151 float32x4_t __s0_865 = __p0_865; \
65482 bfloat16x8_t __s1_773 = __p1_773; \67152 bfloat16x8_t __s1_865 = __p1_865; \
65483 bfloat16x4_t __s2_773 = __p2_773; \67153 bfloat16x4_t __s2_865 = __p2_865; \
65484 float32x4_t __ret_773; \67154 float32x4_t __ret_865; \
65485 __ret_773 = vbfmlaltq_f32(__s0_773, __s1_773, (bfloat16x8_t) {vget_lane_bf16(__s2_773, __p3_773), vget_lane_bf16(__s2_773, __p3_773), vget_lane_bf16(__s2_773, __p3_773), vget_lane_bf16(__s2_773, __p3_773), vget_lane_bf16(__s2_773, __p3_773), vget_lane_bf16(__s2_773, __p3_773), vget_lane_bf16(__s2_773, __p3_773), vget_lane_bf16(__s2_773, __p3_773)}); \67155 __ret_865 = vbfmlaltq_f32(__s0_865, __s1_865, (bfloat16x8_t) {vget_lane_bf16(__s2_865, __p3_865), vget_lane_bf16(__s2_865, __p3_865), vget_lane_bf16(__s2_865, __p3_865), vget_lane_bf16(__s2_865, __p3_865), vget_lane_bf16(__s2_865, __p3_865), vget_lane_bf16(__s2_865, __p3_865), vget_lane_bf16(__s2_865, __p3_865), vget_lane_bf16(__s2_865, __p3_865)}); \
65486 __ret_773; \67156 __ret_865; \
65487})67157})
65488#else67158#else
65489#define vbfmlaltq_lane_f32(__p0_774, __p1_774, __p2_774, __p3_774) __extension__ ({ \67159#define vbfmlaltq_lane_f32(__p0_866, __p1_866, __p2_866, __p3_866) __extension__ ({ \
65490 float32x4_t __s0_774 = __p0_774; \67160 float32x4_t __s0_866 = __p0_866; \
65491 bfloat16x8_t __s1_774 = __p1_774; \67161 bfloat16x8_t __s1_866 = __p1_866; \
65492 bfloat16x4_t __s2_774 = __p2_774; \67162 bfloat16x4_t __s2_866 = __p2_866; \
65493 float32x4_t __rev0_774; __rev0_774 = __builtin_shufflevector(__s0_774, __s0_774, 3, 2, 1, 0); \67163 float32x4_t __rev0_866; __rev0_866 = __builtin_shufflevector(__s0_866, __s0_866, 3, 2, 1, 0); \
65494 bfloat16x8_t __rev1_774; __rev1_774 = __builtin_shufflevector(__s1_774, __s1_774, 7, 6, 5, 4, 3, 2, 1, 0); \67164 bfloat16x8_t __rev1_866; __rev1_866 = __builtin_shufflevector(__s1_866, __s1_866, 7, 6, 5, 4, 3, 2, 1, 0); \
65495 bfloat16x4_t __rev2_774; __rev2_774 = __builtin_shufflevector(__s2_774, __s2_774, 3, 2, 1, 0); \67165 bfloat16x4_t __rev2_866; __rev2_866 = __builtin_shufflevector(__s2_866, __s2_866, 3, 2, 1, 0); \
65496 float32x4_t __ret_774; \67166 float32x4_t __ret_866; \
65497 __ret_774 = __noswap_vbfmlaltq_f32(__rev0_774, __rev1_774, (bfloat16x8_t) {__noswap_vget_lane_bf16(__rev2_774, __p3_774), __noswap_vget_lane_bf16(__rev2_774, __p3_774), __noswap_vget_lane_bf16(__rev2_774, __p3_774), __noswap_vget_lane_bf16(__rev2_774, __p3_774), __noswap_vget_lane_bf16(__rev2_774, __p3_774), __noswap_vget_lane_bf16(__rev2_774, __p3_774), __noswap_vget_lane_bf16(__rev2_774, __p3_774), __noswap_vget_lane_bf16(__rev2_774, __p3_774)}); \67167 __ret_866 = __noswap_vbfmlaltq_f32(__rev0_866, __rev1_866, (bfloat16x8_t) {__noswap_vget_lane_bf16(__rev2_866, __p3_866), __noswap_vget_lane_bf16(__rev2_866, __p3_866), __noswap_vget_lane_bf16(__rev2_866, __p3_866), __noswap_vget_lane_bf16(__rev2_866, __p3_866), __noswap_vget_lane_bf16(__rev2_866, __p3_866), __noswap_vget_lane_bf16(__rev2_866, __p3_866), __noswap_vget_lane_bf16(__rev2_866, __p3_866), __noswap_vget_lane_bf16(__rev2_866, __p3_866)}); \
65498 __ret_774 = __builtin_shufflevector(__ret_774, __ret_774, 3, 2, 1, 0); \67168 __ret_866 = __builtin_shufflevector(__ret_866, __ret_866, 3, 2, 1, 0); \
65499 __ret_774; \67169 __ret_866; \
65500})67170})
65501#endif67171#endif
6550267172
65503#ifdef __LITTLE_ENDIAN__67173#ifdef __LITTLE_ENDIAN__
65504#define vbfmlaltq_laneq_f32(__p0_775, __p1_775, __p2_775, __p3_775) __extension__ ({ \67174#define vbfmlaltq_laneq_f32(__p0_867, __p1_867, __p2_867, __p3_867) __extension__ ({ \
65505 float32x4_t __s0_775 = __p0_775; \67175 float32x4_t __s0_867 = __p0_867; \
65506 bfloat16x8_t __s1_775 = __p1_775; \67176 bfloat16x8_t __s1_867 = __p1_867; \
65507 bfloat16x8_t __s2_775 = __p2_775; \67177 bfloat16x8_t __s2_867 = __p2_867; \
65508 float32x4_t __ret_775; \67178 float32x4_t __ret_867; \
65509 __ret_775 = vbfmlaltq_f32(__s0_775, __s1_775, (bfloat16x8_t) {vgetq_lane_bf16(__s2_775, __p3_775), vgetq_lane_bf16(__s2_775, __p3_775), vgetq_lane_bf16(__s2_775, __p3_775), vgetq_lane_bf16(__s2_775, __p3_775), vgetq_lane_bf16(__s2_775, __p3_775), vgetq_lane_bf16(__s2_775, __p3_775), vgetq_lane_bf16(__s2_775, __p3_775), vgetq_lane_bf16(__s2_775, __p3_775)}); \67179 __ret_867 = vbfmlaltq_f32(__s0_867, __s1_867, (bfloat16x8_t) {vgetq_lane_bf16(__s2_867, __p3_867), vgetq_lane_bf16(__s2_867, __p3_867), vgetq_lane_bf16(__s2_867, __p3_867), vgetq_lane_bf16(__s2_867, __p3_867), vgetq_lane_bf16(__s2_867, __p3_867), vgetq_lane_bf16(__s2_867, __p3_867), vgetq_lane_bf16(__s2_867, __p3_867), vgetq_lane_bf16(__s2_867, __p3_867)}); \
65510 __ret_775; \67180 __ret_867; \
65511})67181})
65512#else67182#else
65513#define vbfmlaltq_laneq_f32(__p0_776, __p1_776, __p2_776, __p3_776) __extension__ ({ \67183#define vbfmlaltq_laneq_f32(__p0_868, __p1_868, __p2_868, __p3_868) __extension__ ({ \
65514 float32x4_t __s0_776 = __p0_776; \67184 float32x4_t __s0_868 = __p0_868; \
65515 bfloat16x8_t __s1_776 = __p1_776; \67185 bfloat16x8_t __s1_868 = __p1_868; \
65516 bfloat16x8_t __s2_776 = __p2_776; \67186 bfloat16x8_t __s2_868 = __p2_868; \
65517 float32x4_t __rev0_776; __rev0_776 = __builtin_shufflevector(__s0_776, __s0_776, 3, 2, 1, 0); \67187 float32x4_t __rev0_868; __rev0_868 = __builtin_shufflevector(__s0_868, __s0_868, 3, 2, 1, 0); \
65518 bfloat16x8_t __rev1_776; __rev1_776 = __builtin_shufflevector(__s1_776, __s1_776, 7, 6, 5, 4, 3, 2, 1, 0); \67188 bfloat16x8_t __rev1_868; __rev1_868 = __builtin_shufflevector(__s1_868, __s1_868, 7, 6, 5, 4, 3, 2, 1, 0); \
65519 bfloat16x8_t __rev2_776; __rev2_776 = __builtin_shufflevector(__s2_776, __s2_776, 7, 6, 5, 4, 3, 2, 1, 0); \67189 bfloat16x8_t __rev2_868; __rev2_868 = __builtin_shufflevector(__s2_868, __s2_868, 7, 6, 5, 4, 3, 2, 1, 0); \
65520 float32x4_t __ret_776; \67190 float32x4_t __ret_868; \
65521 __ret_776 = __noswap_vbfmlaltq_f32(__rev0_776, __rev1_776, (bfloat16x8_t) {__noswap_vgetq_lane_bf16(__rev2_776, __p3_776), __noswap_vgetq_lane_bf16(__rev2_776, __p3_776), __noswap_vgetq_lane_bf16(__rev2_776, __p3_776), __noswap_vgetq_lane_bf16(__rev2_776, __p3_776), __noswap_vgetq_lane_bf16(__rev2_776, __p3_776), __noswap_vgetq_lane_bf16(__rev2_776, __p3_776), __noswap_vgetq_lane_bf16(__rev2_776, __p3_776), __noswap_vgetq_lane_bf16(__rev2_776, __p3_776)}); \67191 __ret_868 = __noswap_vbfmlaltq_f32(__rev0_868, __rev1_868, (bfloat16x8_t) {__noswap_vgetq_lane_bf16(__rev2_868, __p3_868), __noswap_vgetq_lane_bf16(__rev2_868, __p3_868), __noswap_vgetq_lane_bf16(__rev2_868, __p3_868), __noswap_vgetq_lane_bf16(__rev2_868, __p3_868), __noswap_vgetq_lane_bf16(__rev2_868, __p3_868), __noswap_vgetq_lane_bf16(__rev2_868, __p3_868), __noswap_vgetq_lane_bf16(__rev2_868, __p3_868), __noswap_vgetq_lane_bf16(__rev2_868, __p3_868)}); \
65522 __ret_776 = __builtin_shufflevector(__ret_776, __ret_776, 3, 2, 1, 0); \67192 __ret_868 = __builtin_shufflevector(__ret_868, __ret_868, 3, 2, 1, 0); \
65523 __ret_776; \67193 __ret_868; \
65524})67194})
65525#endif67195#endif
6552667196
...@@ -65559,480 +67229,480 @@ __ai float32x4_t vcvtq_low_f32_bf16(bfloat16x8_t __p0) {...@@ -65559,480 +67229,480 @@ __ai float32x4_t vcvtq_low_f32_bf16(bfloat16x8_t __p0) {
65559#endif67229#endif
65560#if defined(__ARM_FEATURE_FP16FML) && defined(__aarch64__)67230#if defined(__ARM_FEATURE_FP16FML) && defined(__aarch64__)
65561#ifdef __LITTLE_ENDIAN__67231#ifdef __LITTLE_ENDIAN__
65562#define vfmlalq_lane_high_f16(__p0_777, __p1_777, __p2_777, __p3_777) __extension__ ({ \67232#define vfmlalq_lane_high_f16(__p0_869, __p1_869, __p2_869, __p3_869) __extension__ ({ \
65563 float32x4_t __s0_777 = __p0_777; \67233 float32x4_t __s0_869 = __p0_869; \
65564 float16x8_t __s1_777 = __p1_777; \67234 float16x8_t __s1_869 = __p1_869; \
65565 float16x4_t __s2_777 = __p2_777; \67235 float16x4_t __s2_869 = __p2_869; \
65566 float32x4_t __ret_777; \67236 float32x4_t __ret_869; \
65567 __ret_777 = vfmlalq_high_f16(__s0_777, __s1_777, (float16x8_t) {vget_lane_f16(__s2_777, __p3_777), vget_lane_f16(__s2_777, __p3_777), vget_lane_f16(__s2_777, __p3_777), vget_lane_f16(__s2_777, __p3_777), vget_lane_f16(__s2_777, __p3_777), vget_lane_f16(__s2_777, __p3_777), vget_lane_f16(__s2_777, __p3_777), vget_lane_f16(__s2_777, __p3_777)}); \67237 __ret_869 = vfmlalq_high_f16(__s0_869, __s1_869, (float16x8_t) {vget_lane_f16(__s2_869, __p3_869), vget_lane_f16(__s2_869, __p3_869), vget_lane_f16(__s2_869, __p3_869), vget_lane_f16(__s2_869, __p3_869), vget_lane_f16(__s2_869, __p3_869), vget_lane_f16(__s2_869, __p3_869), vget_lane_f16(__s2_869, __p3_869), vget_lane_f16(__s2_869, __p3_869)}); \
65568 __ret_777; \67238 __ret_869; \
65569})67239})
65570#else67240#else
65571#define vfmlalq_lane_high_f16(__p0_778, __p1_778, __p2_778, __p3_778) __extension__ ({ \67241#define vfmlalq_lane_high_f16(__p0_870, __p1_870, __p2_870, __p3_870) __extension__ ({ \
65572 float32x4_t __s0_778 = __p0_778; \67242 float32x4_t __s0_870 = __p0_870; \
65573 float16x8_t __s1_778 = __p1_778; \67243 float16x8_t __s1_870 = __p1_870; \
65574 float16x4_t __s2_778 = __p2_778; \67244 float16x4_t __s2_870 = __p2_870; \
65575 float32x4_t __rev0_778; __rev0_778 = __builtin_shufflevector(__s0_778, __s0_778, 3, 2, 1, 0); \67245 float32x4_t __rev0_870; __rev0_870 = __builtin_shufflevector(__s0_870, __s0_870, 3, 2, 1, 0); \
65576 float16x8_t __rev1_778; __rev1_778 = __builtin_shufflevector(__s1_778, __s1_778, 7, 6, 5, 4, 3, 2, 1, 0); \67246 float16x8_t __rev1_870; __rev1_870 = __builtin_shufflevector(__s1_870, __s1_870, 7, 6, 5, 4, 3, 2, 1, 0); \
65577 float16x4_t __rev2_778; __rev2_778 = __builtin_shufflevector(__s2_778, __s2_778, 3, 2, 1, 0); \67247 float16x4_t __rev2_870; __rev2_870 = __builtin_shufflevector(__s2_870, __s2_870, 3, 2, 1, 0); \
65578 float32x4_t __ret_778; \67248 float32x4_t __ret_870; \
65579 __ret_778 = __noswap_vfmlalq_high_f16(__rev0_778, __rev1_778, (float16x8_t) {__noswap_vget_lane_f16(__rev2_778, __p3_778), __noswap_vget_lane_f16(__rev2_778, __p3_778), __noswap_vget_lane_f16(__rev2_778, __p3_778), __noswap_vget_lane_f16(__rev2_778, __p3_778), __noswap_vget_lane_f16(__rev2_778, __p3_778), __noswap_vget_lane_f16(__rev2_778, __p3_778), __noswap_vget_lane_f16(__rev2_778, __p3_778), __noswap_vget_lane_f16(__rev2_778, __p3_778)}); \67249 __ret_870 = __noswap_vfmlalq_high_f16(__rev0_870, __rev1_870, (float16x8_t) {__noswap_vget_lane_f16(__rev2_870, __p3_870), __noswap_vget_lane_f16(__rev2_870, __p3_870), __noswap_vget_lane_f16(__rev2_870, __p3_870), __noswap_vget_lane_f16(__rev2_870, __p3_870), __noswap_vget_lane_f16(__rev2_870, __p3_870), __noswap_vget_lane_f16(__rev2_870, __p3_870), __noswap_vget_lane_f16(__rev2_870, __p3_870), __noswap_vget_lane_f16(__rev2_870, __p3_870)}); \
65580 __ret_778 = __builtin_shufflevector(__ret_778, __ret_778, 3, 2, 1, 0); \67250 __ret_870 = __builtin_shufflevector(__ret_870, __ret_870, 3, 2, 1, 0); \
65581 __ret_778; \67251 __ret_870; \
65582})67252})
65583#endif67253#endif
6558467254
65585#ifdef __LITTLE_ENDIAN__67255#ifdef __LITTLE_ENDIAN__
65586#define vfmlal_lane_high_f16(__p0_779, __p1_779, __p2_779, __p3_779) __extension__ ({ \67256#define vfmlal_lane_high_f16(__p0_871, __p1_871, __p2_871, __p3_871) __extension__ ({ \
65587 float32x2_t __s0_779 = __p0_779; \67257 float32x2_t __s0_871 = __p0_871; \
65588 float16x4_t __s1_779 = __p1_779; \67258 float16x4_t __s1_871 = __p1_871; \
65589 float16x4_t __s2_779 = __p2_779; \67259 float16x4_t __s2_871 = __p2_871; \
65590 float32x2_t __ret_779; \67260 float32x2_t __ret_871; \
65591 __ret_779 = vfmlal_high_f16(__s0_779, __s1_779, (float16x4_t) {vget_lane_f16(__s2_779, __p3_779), vget_lane_f16(__s2_779, __p3_779), vget_lane_f16(__s2_779, __p3_779), vget_lane_f16(__s2_779, __p3_779)}); \67261 __ret_871 = vfmlal_high_f16(__s0_871, __s1_871, (float16x4_t) {vget_lane_f16(__s2_871, __p3_871), vget_lane_f16(__s2_871, __p3_871), vget_lane_f16(__s2_871, __p3_871), vget_lane_f16(__s2_871, __p3_871)}); \
65592 __ret_779; \67262 __ret_871; \
65593})67263})
65594#else67264#else
65595#define vfmlal_lane_high_f16(__p0_780, __p1_780, __p2_780, __p3_780) __extension__ ({ \67265#define vfmlal_lane_high_f16(__p0_872, __p1_872, __p2_872, __p3_872) __extension__ ({ \
65596 float32x2_t __s0_780 = __p0_780; \67266 float32x2_t __s0_872 = __p0_872; \
65597 float16x4_t __s1_780 = __p1_780; \67267 float16x4_t __s1_872 = __p1_872; \
65598 float16x4_t __s2_780 = __p2_780; \67268 float16x4_t __s2_872 = __p2_872; \
65599 float32x2_t __rev0_780; __rev0_780 = __builtin_shufflevector(__s0_780, __s0_780, 1, 0); \67269 float32x2_t __rev0_872; __rev0_872 = __builtin_shufflevector(__s0_872, __s0_872, 1, 0); \
65600 float16x4_t __rev1_780; __rev1_780 = __builtin_shufflevector(__s1_780, __s1_780, 3, 2, 1, 0); \67270 float16x4_t __rev1_872; __rev1_872 = __builtin_shufflevector(__s1_872, __s1_872, 3, 2, 1, 0); \
65601 float16x4_t __rev2_780; __rev2_780 = __builtin_shufflevector(__s2_780, __s2_780, 3, 2, 1, 0); \67271 float16x4_t __rev2_872; __rev2_872 = __builtin_shufflevector(__s2_872, __s2_872, 3, 2, 1, 0); \
65602 float32x2_t __ret_780; \67272 float32x2_t __ret_872; \
65603 __ret_780 = __noswap_vfmlal_high_f16(__rev0_780, __rev1_780, (float16x4_t) {__noswap_vget_lane_f16(__rev2_780, __p3_780), __noswap_vget_lane_f16(__rev2_780, __p3_780), __noswap_vget_lane_f16(__rev2_780, __p3_780), __noswap_vget_lane_f16(__rev2_780, __p3_780)}); \67273 __ret_872 = __noswap_vfmlal_high_f16(__rev0_872, __rev1_872, (float16x4_t) {__noswap_vget_lane_f16(__rev2_872, __p3_872), __noswap_vget_lane_f16(__rev2_872, __p3_872), __noswap_vget_lane_f16(__rev2_872, __p3_872), __noswap_vget_lane_f16(__rev2_872, __p3_872)}); \
65604 __ret_780 = __builtin_shufflevector(__ret_780, __ret_780, 1, 0); \67274 __ret_872 = __builtin_shufflevector(__ret_872, __ret_872, 1, 0); \
65605 __ret_780; \67275 __ret_872; \
65606})67276})
65607#endif67277#endif
6560867278
65609#ifdef __LITTLE_ENDIAN__67279#ifdef __LITTLE_ENDIAN__
65610#define vfmlalq_lane_low_f16(__p0_781, __p1_781, __p2_781, __p3_781) __extension__ ({ \67280#define vfmlalq_lane_low_f16(__p0_873, __p1_873, __p2_873, __p3_873) __extension__ ({ \
65611 float32x4_t __s0_781 = __p0_781; \67281 float32x4_t __s0_873 = __p0_873; \
65612 float16x8_t __s1_781 = __p1_781; \67282 float16x8_t __s1_873 = __p1_873; \
65613 float16x4_t __s2_781 = __p2_781; \67283 float16x4_t __s2_873 = __p2_873; \
65614 float32x4_t __ret_781; \67284 float32x4_t __ret_873; \
65615 __ret_781 = vfmlalq_low_f16(__s0_781, __s1_781, (float16x8_t) {vget_lane_f16(__s2_781, __p3_781), vget_lane_f16(__s2_781, __p3_781), vget_lane_f16(__s2_781, __p3_781), vget_lane_f16(__s2_781, __p3_781), vget_lane_f16(__s2_781, __p3_781), vget_lane_f16(__s2_781, __p3_781), vget_lane_f16(__s2_781, __p3_781), vget_lane_f16(__s2_781, __p3_781)}); \67285 __ret_873 = vfmlalq_low_f16(__s0_873, __s1_873, (float16x8_t) {vget_lane_f16(__s2_873, __p3_873), vget_lane_f16(__s2_873, __p3_873), vget_lane_f16(__s2_873, __p3_873), vget_lane_f16(__s2_873, __p3_873), vget_lane_f16(__s2_873, __p3_873), vget_lane_f16(__s2_873, __p3_873), vget_lane_f16(__s2_873, __p3_873), vget_lane_f16(__s2_873, __p3_873)}); \
65616 __ret_781; \67286 __ret_873; \
65617})67287})
65618#else67288#else
65619#define vfmlalq_lane_low_f16(__p0_782, __p1_782, __p2_782, __p3_782) __extension__ ({ \67289#define vfmlalq_lane_low_f16(__p0_874, __p1_874, __p2_874, __p3_874) __extension__ ({ \
65620 float32x4_t __s0_782 = __p0_782; \67290 float32x4_t __s0_874 = __p0_874; \
65621 float16x8_t __s1_782 = __p1_782; \67291 float16x8_t __s1_874 = __p1_874; \
65622 float16x4_t __s2_782 = __p2_782; \67292 float16x4_t __s2_874 = __p2_874; \
65623 float32x4_t __rev0_782; __rev0_782 = __builtin_shufflevector(__s0_782, __s0_782, 3, 2, 1, 0); \67293 float32x4_t __rev0_874; __rev0_874 = __builtin_shufflevector(__s0_874, __s0_874, 3, 2, 1, 0); \
65624 float16x8_t __rev1_782; __rev1_782 = __builtin_shufflevector(__s1_782, __s1_782, 7, 6, 5, 4, 3, 2, 1, 0); \67294 float16x8_t __rev1_874; __rev1_874 = __builtin_shufflevector(__s1_874, __s1_874, 7, 6, 5, 4, 3, 2, 1, 0); \
65625 float16x4_t __rev2_782; __rev2_782 = __builtin_shufflevector(__s2_782, __s2_782, 3, 2, 1, 0); \67295 float16x4_t __rev2_874; __rev2_874 = __builtin_shufflevector(__s2_874, __s2_874, 3, 2, 1, 0); \
65626 float32x4_t __ret_782; \67296 float32x4_t __ret_874; \
65627 __ret_782 = __noswap_vfmlalq_low_f16(__rev0_782, __rev1_782, (float16x8_t) {__noswap_vget_lane_f16(__rev2_782, __p3_782), __noswap_vget_lane_f16(__rev2_782, __p3_782), __noswap_vget_lane_f16(__rev2_782, __p3_782), __noswap_vget_lane_f16(__rev2_782, __p3_782), __noswap_vget_lane_f16(__rev2_782, __p3_782), __noswap_vget_lane_f16(__rev2_782, __p3_782), __noswap_vget_lane_f16(__rev2_782, __p3_782), __noswap_vget_lane_f16(__rev2_782, __p3_782)}); \67297 __ret_874 = __noswap_vfmlalq_low_f16(__rev0_874, __rev1_874, (float16x8_t) {__noswap_vget_lane_f16(__rev2_874, __p3_874), __noswap_vget_lane_f16(__rev2_874, __p3_874), __noswap_vget_lane_f16(__rev2_874, __p3_874), __noswap_vget_lane_f16(__rev2_874, __p3_874), __noswap_vget_lane_f16(__rev2_874, __p3_874), __noswap_vget_lane_f16(__rev2_874, __p3_874), __noswap_vget_lane_f16(__rev2_874, __p3_874), __noswap_vget_lane_f16(__rev2_874, __p3_874)}); \
65628 __ret_782 = __builtin_shufflevector(__ret_782, __ret_782, 3, 2, 1, 0); \67298 __ret_874 = __builtin_shufflevector(__ret_874, __ret_874, 3, 2, 1, 0); \
65629 __ret_782; \67299 __ret_874; \
65630})67300})
65631#endif67301#endif
6563267302
65633#ifdef __LITTLE_ENDIAN__67303#ifdef __LITTLE_ENDIAN__
65634#define vfmlal_lane_low_f16(__p0_783, __p1_783, __p2_783, __p3_783) __extension__ ({ \67304#define vfmlal_lane_low_f16(__p0_875, __p1_875, __p2_875, __p3_875) __extension__ ({ \
65635 float32x2_t __s0_783 = __p0_783; \67305 float32x2_t __s0_875 = __p0_875; \
65636 float16x4_t __s1_783 = __p1_783; \67306 float16x4_t __s1_875 = __p1_875; \
65637 float16x4_t __s2_783 = __p2_783; \67307 float16x4_t __s2_875 = __p2_875; \
65638 float32x2_t __ret_783; \67308 float32x2_t __ret_875; \
65639 __ret_783 = vfmlal_low_f16(__s0_783, __s1_783, (float16x4_t) {vget_lane_f16(__s2_783, __p3_783), vget_lane_f16(__s2_783, __p3_783), vget_lane_f16(__s2_783, __p3_783), vget_lane_f16(__s2_783, __p3_783)}); \67309 __ret_875 = vfmlal_low_f16(__s0_875, __s1_875, (float16x4_t) {vget_lane_f16(__s2_875, __p3_875), vget_lane_f16(__s2_875, __p3_875), vget_lane_f16(__s2_875, __p3_875), vget_lane_f16(__s2_875, __p3_875)}); \
65640 __ret_783; \67310 __ret_875; \
65641})67311})
65642#else67312#else
65643#define vfmlal_lane_low_f16(__p0_784, __p1_784, __p2_784, __p3_784) __extension__ ({ \67313#define vfmlal_lane_low_f16(__p0_876, __p1_876, __p2_876, __p3_876) __extension__ ({ \
65644 float32x2_t __s0_784 = __p0_784; \67314 float32x2_t __s0_876 = __p0_876; \
65645 float16x4_t __s1_784 = __p1_784; \67315 float16x4_t __s1_876 = __p1_876; \
65646 float16x4_t __s2_784 = __p2_784; \67316 float16x4_t __s2_876 = __p2_876; \
65647 float32x2_t __rev0_784; __rev0_784 = __builtin_shufflevector(__s0_784, __s0_784, 1, 0); \67317 float32x2_t __rev0_876; __rev0_876 = __builtin_shufflevector(__s0_876, __s0_876, 1, 0); \
65648 float16x4_t __rev1_784; __rev1_784 = __builtin_shufflevector(__s1_784, __s1_784, 3, 2, 1, 0); \67318 float16x4_t __rev1_876; __rev1_876 = __builtin_shufflevector(__s1_876, __s1_876, 3, 2, 1, 0); \
65649 float16x4_t __rev2_784; __rev2_784 = __builtin_shufflevector(__s2_784, __s2_784, 3, 2, 1, 0); \67319 float16x4_t __rev2_876; __rev2_876 = __builtin_shufflevector(__s2_876, __s2_876, 3, 2, 1, 0); \
65650 float32x2_t __ret_784; \67320 float32x2_t __ret_876; \
65651 __ret_784 = __noswap_vfmlal_low_f16(__rev0_784, __rev1_784, (float16x4_t) {__noswap_vget_lane_f16(__rev2_784, __p3_784), __noswap_vget_lane_f16(__rev2_784, __p3_784), __noswap_vget_lane_f16(__rev2_784, __p3_784), __noswap_vget_lane_f16(__rev2_784, __p3_784)}); \67321 __ret_876 = __noswap_vfmlal_low_f16(__rev0_876, __rev1_876, (float16x4_t) {__noswap_vget_lane_f16(__rev2_876, __p3_876), __noswap_vget_lane_f16(__rev2_876, __p3_876), __noswap_vget_lane_f16(__rev2_876, __p3_876), __noswap_vget_lane_f16(__rev2_876, __p3_876)}); \
65652 __ret_784 = __builtin_shufflevector(__ret_784, __ret_784, 1, 0); \67322 __ret_876 = __builtin_shufflevector(__ret_876, __ret_876, 1, 0); \
65653 __ret_784; \67323 __ret_876; \
65654})67324})
65655#endif67325#endif
6565667326
65657#ifdef __LITTLE_ENDIAN__67327#ifdef __LITTLE_ENDIAN__
65658#define vfmlalq_laneq_high_f16(__p0_785, __p1_785, __p2_785, __p3_785) __extension__ ({ \67328#define vfmlalq_laneq_high_f16(__p0_877, __p1_877, __p2_877, __p3_877) __extension__ ({ \
65659 float32x4_t __s0_785 = __p0_785; \67329 float32x4_t __s0_877 = __p0_877; \
65660 float16x8_t __s1_785 = __p1_785; \67330 float16x8_t __s1_877 = __p1_877; \
65661 float16x8_t __s2_785 = __p2_785; \67331 float16x8_t __s2_877 = __p2_877; \
65662 float32x4_t __ret_785; \67332 float32x4_t __ret_877; \
65663 __ret_785 = vfmlalq_high_f16(__s0_785, __s1_785, (float16x8_t) {vgetq_lane_f16(__s2_785, __p3_785), vgetq_lane_f16(__s2_785, __p3_785), vgetq_lane_f16(__s2_785, __p3_785), vgetq_lane_f16(__s2_785, __p3_785), vgetq_lane_f16(__s2_785, __p3_785), vgetq_lane_f16(__s2_785, __p3_785), vgetq_lane_f16(__s2_785, __p3_785), vgetq_lane_f16(__s2_785, __p3_785)}); \67333 __ret_877 = vfmlalq_high_f16(__s0_877, __s1_877, (float16x8_t) {vgetq_lane_f16(__s2_877, __p3_877), vgetq_lane_f16(__s2_877, __p3_877), vgetq_lane_f16(__s2_877, __p3_877), vgetq_lane_f16(__s2_877, __p3_877), vgetq_lane_f16(__s2_877, __p3_877), vgetq_lane_f16(__s2_877, __p3_877), vgetq_lane_f16(__s2_877, __p3_877), vgetq_lane_f16(__s2_877, __p3_877)}); \
65664 __ret_785; \67334 __ret_877; \
65665})67335})
65666#else67336#else
65667#define vfmlalq_laneq_high_f16(__p0_786, __p1_786, __p2_786, __p3_786) __extension__ ({ \67337#define vfmlalq_laneq_high_f16(__p0_878, __p1_878, __p2_878, __p3_878) __extension__ ({ \
65668 float32x4_t __s0_786 = __p0_786; \67338 float32x4_t __s0_878 = __p0_878; \
65669 float16x8_t __s1_786 = __p1_786; \67339 float16x8_t __s1_878 = __p1_878; \
65670 float16x8_t __s2_786 = __p2_786; \67340 float16x8_t __s2_878 = __p2_878; \
65671 float32x4_t __rev0_786; __rev0_786 = __builtin_shufflevector(__s0_786, __s0_786, 3, 2, 1, 0); \67341 float32x4_t __rev0_878; __rev0_878 = __builtin_shufflevector(__s0_878, __s0_878, 3, 2, 1, 0); \
65672 float16x8_t __rev1_786; __rev1_786 = __builtin_shufflevector(__s1_786, __s1_786, 7, 6, 5, 4, 3, 2, 1, 0); \67342 float16x8_t __rev1_878; __rev1_878 = __builtin_shufflevector(__s1_878, __s1_878, 7, 6, 5, 4, 3, 2, 1, 0); \
65673 float16x8_t __rev2_786; __rev2_786 = __builtin_shufflevector(__s2_786, __s2_786, 7, 6, 5, 4, 3, 2, 1, 0); \67343 float16x8_t __rev2_878; __rev2_878 = __builtin_shufflevector(__s2_878, __s2_878, 7, 6, 5, 4, 3, 2, 1, 0); \
65674 float32x4_t __ret_786; \67344 float32x4_t __ret_878; \
65675 __ret_786 = __noswap_vfmlalq_high_f16(__rev0_786, __rev1_786, (float16x8_t) {__noswap_vgetq_lane_f16(__rev2_786, __p3_786), __noswap_vgetq_lane_f16(__rev2_786, __p3_786), __noswap_vgetq_lane_f16(__rev2_786, __p3_786), __noswap_vgetq_lane_f16(__rev2_786, __p3_786), __noswap_vgetq_lane_f16(__rev2_786, __p3_786), __noswap_vgetq_lane_f16(__rev2_786, __p3_786), __noswap_vgetq_lane_f16(__rev2_786, __p3_786), __noswap_vgetq_lane_f16(__rev2_786, __p3_786)}); \67345 __ret_878 = __noswap_vfmlalq_high_f16(__rev0_878, __rev1_878, (float16x8_t) {__noswap_vgetq_lane_f16(__rev2_878, __p3_878), __noswap_vgetq_lane_f16(__rev2_878, __p3_878), __noswap_vgetq_lane_f16(__rev2_878, __p3_878), __noswap_vgetq_lane_f16(__rev2_878, __p3_878), __noswap_vgetq_lane_f16(__rev2_878, __p3_878), __noswap_vgetq_lane_f16(__rev2_878, __p3_878), __noswap_vgetq_lane_f16(__rev2_878, __p3_878), __noswap_vgetq_lane_f16(__rev2_878, __p3_878)}); \
65676 __ret_786 = __builtin_shufflevector(__ret_786, __ret_786, 3, 2, 1, 0); \67346 __ret_878 = __builtin_shufflevector(__ret_878, __ret_878, 3, 2, 1, 0); \
65677 __ret_786; \67347 __ret_878; \
65678})67348})
65679#endif67349#endif
6568067350
65681#ifdef __LITTLE_ENDIAN__67351#ifdef __LITTLE_ENDIAN__
65682#define vfmlal_laneq_high_f16(__p0_787, __p1_787, __p2_787, __p3_787) __extension__ ({ \67352#define vfmlal_laneq_high_f16(__p0_879, __p1_879, __p2_879, __p3_879) __extension__ ({ \
65683 float32x2_t __s0_787 = __p0_787; \67353 float32x2_t __s0_879 = __p0_879; \
65684 float16x4_t __s1_787 = __p1_787; \67354 float16x4_t __s1_879 = __p1_879; \
65685 float16x8_t __s2_787 = __p2_787; \67355 float16x8_t __s2_879 = __p2_879; \
65686 float32x2_t __ret_787; \67356 float32x2_t __ret_879; \
65687 __ret_787 = vfmlal_high_f16(__s0_787, __s1_787, (float16x4_t) {vgetq_lane_f16(__s2_787, __p3_787), vgetq_lane_f16(__s2_787, __p3_787), vgetq_lane_f16(__s2_787, __p3_787), vgetq_lane_f16(__s2_787, __p3_787)}); \67357 __ret_879 = vfmlal_high_f16(__s0_879, __s1_879, (float16x4_t) {vgetq_lane_f16(__s2_879, __p3_879), vgetq_lane_f16(__s2_879, __p3_879), vgetq_lane_f16(__s2_879, __p3_879), vgetq_lane_f16(__s2_879, __p3_879)}); \
65688 __ret_787; \67358 __ret_879; \
65689})67359})
65690#else67360#else
65691#define vfmlal_laneq_high_f16(__p0_788, __p1_788, __p2_788, __p3_788) __extension__ ({ \67361#define vfmlal_laneq_high_f16(__p0_880, __p1_880, __p2_880, __p3_880) __extension__ ({ \
65692 float32x2_t __s0_788 = __p0_788; \67362 float32x2_t __s0_880 = __p0_880; \
65693 float16x4_t __s1_788 = __p1_788; \67363 float16x4_t __s1_880 = __p1_880; \
65694 float16x8_t __s2_788 = __p2_788; \67364 float16x8_t __s2_880 = __p2_880; \
65695 float32x2_t __rev0_788; __rev0_788 = __builtin_shufflevector(__s0_788, __s0_788, 1, 0); \67365 float32x2_t __rev0_880; __rev0_880 = __builtin_shufflevector(__s0_880, __s0_880, 1, 0); \
65696 float16x4_t __rev1_788; __rev1_788 = __builtin_shufflevector(__s1_788, __s1_788, 3, 2, 1, 0); \67366 float16x4_t __rev1_880; __rev1_880 = __builtin_shufflevector(__s1_880, __s1_880, 3, 2, 1, 0); \
65697 float16x8_t __rev2_788; __rev2_788 = __builtin_shufflevector(__s2_788, __s2_788, 7, 6, 5, 4, 3, 2, 1, 0); \67367 float16x8_t __rev2_880; __rev2_880 = __builtin_shufflevector(__s2_880, __s2_880, 7, 6, 5, 4, 3, 2, 1, 0); \
65698 float32x2_t __ret_788; \67368 float32x2_t __ret_880; \
65699 __ret_788 = __noswap_vfmlal_high_f16(__rev0_788, __rev1_788, (float16x4_t) {__noswap_vgetq_lane_f16(__rev2_788, __p3_788), __noswap_vgetq_lane_f16(__rev2_788, __p3_788), __noswap_vgetq_lane_f16(__rev2_788, __p3_788), __noswap_vgetq_lane_f16(__rev2_788, __p3_788)}); \67369 __ret_880 = __noswap_vfmlal_high_f16(__rev0_880, __rev1_880, (float16x4_t) {__noswap_vgetq_lane_f16(__rev2_880, __p3_880), __noswap_vgetq_lane_f16(__rev2_880, __p3_880), __noswap_vgetq_lane_f16(__rev2_880, __p3_880), __noswap_vgetq_lane_f16(__rev2_880, __p3_880)}); \
65700 __ret_788 = __builtin_shufflevector(__ret_788, __ret_788, 1, 0); \67370 __ret_880 = __builtin_shufflevector(__ret_880, __ret_880, 1, 0); \
65701 __ret_788; \67371 __ret_880; \
65702})67372})
65703#endif67373#endif
6570467374
65705#ifdef __LITTLE_ENDIAN__67375#ifdef __LITTLE_ENDIAN__
65706#define vfmlalq_laneq_low_f16(__p0_789, __p1_789, __p2_789, __p3_789) __extension__ ({ \67376#define vfmlalq_laneq_low_f16(__p0_881, __p1_881, __p2_881, __p3_881) __extension__ ({ \
65707 float32x4_t __s0_789 = __p0_789; \67377 float32x4_t __s0_881 = __p0_881; \
65708 float16x8_t __s1_789 = __p1_789; \67378 float16x8_t __s1_881 = __p1_881; \
65709 float16x8_t __s2_789 = __p2_789; \67379 float16x8_t __s2_881 = __p2_881; \
65710 float32x4_t __ret_789; \67380 float32x4_t __ret_881; \
65711 __ret_789 = vfmlalq_low_f16(__s0_789, __s1_789, (float16x8_t) {vgetq_lane_f16(__s2_789, __p3_789), vgetq_lane_f16(__s2_789, __p3_789), vgetq_lane_f16(__s2_789, __p3_789), vgetq_lane_f16(__s2_789, __p3_789), vgetq_lane_f16(__s2_789, __p3_789), vgetq_lane_f16(__s2_789, __p3_789), vgetq_lane_f16(__s2_789, __p3_789), vgetq_lane_f16(__s2_789, __p3_789)}); \67381 __ret_881 = vfmlalq_low_f16(__s0_881, __s1_881, (float16x8_t) {vgetq_lane_f16(__s2_881, __p3_881), vgetq_lane_f16(__s2_881, __p3_881), vgetq_lane_f16(__s2_881, __p3_881), vgetq_lane_f16(__s2_881, __p3_881), vgetq_lane_f16(__s2_881, __p3_881), vgetq_lane_f16(__s2_881, __p3_881), vgetq_lane_f16(__s2_881, __p3_881), vgetq_lane_f16(__s2_881, __p3_881)}); \
65712 __ret_789; \67382 __ret_881; \
65713})67383})
65714#else67384#else
65715#define vfmlalq_laneq_low_f16(__p0_790, __p1_790, __p2_790, __p3_790) __extension__ ({ \67385#define vfmlalq_laneq_low_f16(__p0_882, __p1_882, __p2_882, __p3_882) __extension__ ({ \
65716 float32x4_t __s0_790 = __p0_790; \67386 float32x4_t __s0_882 = __p0_882; \
65717 float16x8_t __s1_790 = __p1_790; \67387 float16x8_t __s1_882 = __p1_882; \
65718 float16x8_t __s2_790 = __p2_790; \67388 float16x8_t __s2_882 = __p2_882; \
65719 float32x4_t __rev0_790; __rev0_790 = __builtin_shufflevector(__s0_790, __s0_790, 3, 2, 1, 0); \67389 float32x4_t __rev0_882; __rev0_882 = __builtin_shufflevector(__s0_882, __s0_882, 3, 2, 1, 0); \
65720 float16x8_t __rev1_790; __rev1_790 = __builtin_shufflevector(__s1_790, __s1_790, 7, 6, 5, 4, 3, 2, 1, 0); \67390 float16x8_t __rev1_882; __rev1_882 = __builtin_shufflevector(__s1_882, __s1_882, 7, 6, 5, 4, 3, 2, 1, 0); \
65721 float16x8_t __rev2_790; __rev2_790 = __builtin_shufflevector(__s2_790, __s2_790, 7, 6, 5, 4, 3, 2, 1, 0); \67391 float16x8_t __rev2_882; __rev2_882 = __builtin_shufflevector(__s2_882, __s2_882, 7, 6, 5, 4, 3, 2, 1, 0); \
65722 float32x4_t __ret_790; \67392 float32x4_t __ret_882; \
65723 __ret_790 = __noswap_vfmlalq_low_f16(__rev0_790, __rev1_790, (float16x8_t) {__noswap_vgetq_lane_f16(__rev2_790, __p3_790), __noswap_vgetq_lane_f16(__rev2_790, __p3_790), __noswap_vgetq_lane_f16(__rev2_790, __p3_790), __noswap_vgetq_lane_f16(__rev2_790, __p3_790), __noswap_vgetq_lane_f16(__rev2_790, __p3_790), __noswap_vgetq_lane_f16(__rev2_790, __p3_790), __noswap_vgetq_lane_f16(__rev2_790, __p3_790), __noswap_vgetq_lane_f16(__rev2_790, __p3_790)}); \67393 __ret_882 = __noswap_vfmlalq_low_f16(__rev0_882, __rev1_882, (float16x8_t) {__noswap_vgetq_lane_f16(__rev2_882, __p3_882), __noswap_vgetq_lane_f16(__rev2_882, __p3_882), __noswap_vgetq_lane_f16(__rev2_882, __p3_882), __noswap_vgetq_lane_f16(__rev2_882, __p3_882), __noswap_vgetq_lane_f16(__rev2_882, __p3_882), __noswap_vgetq_lane_f16(__rev2_882, __p3_882), __noswap_vgetq_lane_f16(__rev2_882, __p3_882), __noswap_vgetq_lane_f16(__rev2_882, __p3_882)}); \
65724 __ret_790 = __builtin_shufflevector(__ret_790, __ret_790, 3, 2, 1, 0); \67394 __ret_882 = __builtin_shufflevector(__ret_882, __ret_882, 3, 2, 1, 0); \
65725 __ret_790; \67395 __ret_882; \
65726})67396})
65727#endif67397#endif
6572867398
65729#ifdef __LITTLE_ENDIAN__67399#ifdef __LITTLE_ENDIAN__
65730#define vfmlal_laneq_low_f16(__p0_791, __p1_791, __p2_791, __p3_791) __extension__ ({ \67400#define vfmlal_laneq_low_f16(__p0_883, __p1_883, __p2_883, __p3_883) __extension__ ({ \
65731 float32x2_t __s0_791 = __p0_791; \67401 float32x2_t __s0_883 = __p0_883; \
65732 float16x4_t __s1_791 = __p1_791; \67402 float16x4_t __s1_883 = __p1_883; \
65733 float16x8_t __s2_791 = __p2_791; \67403 float16x8_t __s2_883 = __p2_883; \
65734 float32x2_t __ret_791; \67404 float32x2_t __ret_883; \
65735 __ret_791 = vfmlal_low_f16(__s0_791, __s1_791, (float16x4_t) {vgetq_lane_f16(__s2_791, __p3_791), vgetq_lane_f16(__s2_791, __p3_791), vgetq_lane_f16(__s2_791, __p3_791), vgetq_lane_f16(__s2_791, __p3_791)}); \67405 __ret_883 = vfmlal_low_f16(__s0_883, __s1_883, (float16x4_t) {vgetq_lane_f16(__s2_883, __p3_883), vgetq_lane_f16(__s2_883, __p3_883), vgetq_lane_f16(__s2_883, __p3_883), vgetq_lane_f16(__s2_883, __p3_883)}); \
65736 __ret_791; \67406 __ret_883; \
65737})67407})
65738#else67408#else
65739#define vfmlal_laneq_low_f16(__p0_792, __p1_792, __p2_792, __p3_792) __extension__ ({ \67409#define vfmlal_laneq_low_f16(__p0_884, __p1_884, __p2_884, __p3_884) __extension__ ({ \
65740 float32x2_t __s0_792 = __p0_792; \67410 float32x2_t __s0_884 = __p0_884; \
65741 float16x4_t __s1_792 = __p1_792; \67411 float16x4_t __s1_884 = __p1_884; \
65742 float16x8_t __s2_792 = __p2_792; \67412 float16x8_t __s2_884 = __p2_884; \
65743 float32x2_t __rev0_792; __rev0_792 = __builtin_shufflevector(__s0_792, __s0_792, 1, 0); \67413 float32x2_t __rev0_884; __rev0_884 = __builtin_shufflevector(__s0_884, __s0_884, 1, 0); \
65744 float16x4_t __rev1_792; __rev1_792 = __builtin_shufflevector(__s1_792, __s1_792, 3, 2, 1, 0); \67414 float16x4_t __rev1_884; __rev1_884 = __builtin_shufflevector(__s1_884, __s1_884, 3, 2, 1, 0); \
65745 float16x8_t __rev2_792; __rev2_792 = __builtin_shufflevector(__s2_792, __s2_792, 7, 6, 5, 4, 3, 2, 1, 0); \67415 float16x8_t __rev2_884; __rev2_884 = __builtin_shufflevector(__s2_884, __s2_884, 7, 6, 5, 4, 3, 2, 1, 0); \
65746 float32x2_t __ret_792; \67416 float32x2_t __ret_884; \
65747 __ret_792 = __noswap_vfmlal_low_f16(__rev0_792, __rev1_792, (float16x4_t) {__noswap_vgetq_lane_f16(__rev2_792, __p3_792), __noswap_vgetq_lane_f16(__rev2_792, __p3_792), __noswap_vgetq_lane_f16(__rev2_792, __p3_792), __noswap_vgetq_lane_f16(__rev2_792, __p3_792)}); \67417 __ret_884 = __noswap_vfmlal_low_f16(__rev0_884, __rev1_884, (float16x4_t) {__noswap_vgetq_lane_f16(__rev2_884, __p3_884), __noswap_vgetq_lane_f16(__rev2_884, __p3_884), __noswap_vgetq_lane_f16(__rev2_884, __p3_884), __noswap_vgetq_lane_f16(__rev2_884, __p3_884)}); \
65748 __ret_792 = __builtin_shufflevector(__ret_792, __ret_792, 1, 0); \67418 __ret_884 = __builtin_shufflevector(__ret_884, __ret_884, 1, 0); \
65749 __ret_792; \67419 __ret_884; \
65750})67420})
65751#endif67421#endif
6575267422
65753#ifdef __LITTLE_ENDIAN__67423#ifdef __LITTLE_ENDIAN__
65754#define vfmlslq_lane_high_f16(__p0_793, __p1_793, __p2_793, __p3_793) __extension__ ({ \67424#define vfmlslq_lane_high_f16(__p0_885, __p1_885, __p2_885, __p3_885) __extension__ ({ \
65755 float32x4_t __s0_793 = __p0_793; \67425 float32x4_t __s0_885 = __p0_885; \
65756 float16x8_t __s1_793 = __p1_793; \67426 float16x8_t __s1_885 = __p1_885; \
65757 float16x4_t __s2_793 = __p2_793; \67427 float16x4_t __s2_885 = __p2_885; \
65758 float32x4_t __ret_793; \67428 float32x4_t __ret_885; \
65759 __ret_793 = vfmlslq_high_f16(__s0_793, __s1_793, (float16x8_t) {vget_lane_f16(__s2_793, __p3_793), vget_lane_f16(__s2_793, __p3_793), vget_lane_f16(__s2_793, __p3_793), vget_lane_f16(__s2_793, __p3_793), vget_lane_f16(__s2_793, __p3_793), vget_lane_f16(__s2_793, __p3_793), vget_lane_f16(__s2_793, __p3_793), vget_lane_f16(__s2_793, __p3_793)}); \67429 __ret_885 = vfmlslq_high_f16(__s0_885, __s1_885, (float16x8_t) {vget_lane_f16(__s2_885, __p3_885), vget_lane_f16(__s2_885, __p3_885), vget_lane_f16(__s2_885, __p3_885), vget_lane_f16(__s2_885, __p3_885), vget_lane_f16(__s2_885, __p3_885), vget_lane_f16(__s2_885, __p3_885), vget_lane_f16(__s2_885, __p3_885), vget_lane_f16(__s2_885, __p3_885)}); \
65760 __ret_793; \67430 __ret_885; \
65761})67431})
65762#else67432#else
65763#define vfmlslq_lane_high_f16(__p0_794, __p1_794, __p2_794, __p3_794) __extension__ ({ \67433#define vfmlslq_lane_high_f16(__p0_886, __p1_886, __p2_886, __p3_886) __extension__ ({ \
65764 float32x4_t __s0_794 = __p0_794; \67434 float32x4_t __s0_886 = __p0_886; \
65765 float16x8_t __s1_794 = __p1_794; \67435 float16x8_t __s1_886 = __p1_886; \
65766 float16x4_t __s2_794 = __p2_794; \67436 float16x4_t __s2_886 = __p2_886; \
65767 float32x4_t __rev0_794; __rev0_794 = __builtin_shufflevector(__s0_794, __s0_794, 3, 2, 1, 0); \67437 float32x4_t __rev0_886; __rev0_886 = __builtin_shufflevector(__s0_886, __s0_886, 3, 2, 1, 0); \
65768 float16x8_t __rev1_794; __rev1_794 = __builtin_shufflevector(__s1_794, __s1_794, 7, 6, 5, 4, 3, 2, 1, 0); \67438 float16x8_t __rev1_886; __rev1_886 = __builtin_shufflevector(__s1_886, __s1_886, 7, 6, 5, 4, 3, 2, 1, 0); \
65769 float16x4_t __rev2_794; __rev2_794 = __builtin_shufflevector(__s2_794, __s2_794, 3, 2, 1, 0); \67439 float16x4_t __rev2_886; __rev2_886 = __builtin_shufflevector(__s2_886, __s2_886, 3, 2, 1, 0); \
65770 float32x4_t __ret_794; \67440 float32x4_t __ret_886; \
65771 __ret_794 = __noswap_vfmlslq_high_f16(__rev0_794, __rev1_794, (float16x8_t) {__noswap_vget_lane_f16(__rev2_794, __p3_794), __noswap_vget_lane_f16(__rev2_794, __p3_794), __noswap_vget_lane_f16(__rev2_794, __p3_794), __noswap_vget_lane_f16(__rev2_794, __p3_794), __noswap_vget_lane_f16(__rev2_794, __p3_794), __noswap_vget_lane_f16(__rev2_794, __p3_794), __noswap_vget_lane_f16(__rev2_794, __p3_794), __noswap_vget_lane_f16(__rev2_794, __p3_794)}); \67441 __ret_886 = __noswap_vfmlslq_high_f16(__rev0_886, __rev1_886, (float16x8_t) {__noswap_vget_lane_f16(__rev2_886, __p3_886), __noswap_vget_lane_f16(__rev2_886, __p3_886), __noswap_vget_lane_f16(__rev2_886, __p3_886), __noswap_vget_lane_f16(__rev2_886, __p3_886), __noswap_vget_lane_f16(__rev2_886, __p3_886), __noswap_vget_lane_f16(__rev2_886, __p3_886), __noswap_vget_lane_f16(__rev2_886, __p3_886), __noswap_vget_lane_f16(__rev2_886, __p3_886)}); \
65772 __ret_794 = __builtin_shufflevector(__ret_794, __ret_794, 3, 2, 1, 0); \67442 __ret_886 = __builtin_shufflevector(__ret_886, __ret_886, 3, 2, 1, 0); \
65773 __ret_794; \67443 __ret_886; \
65774})67444})
65775#endif67445#endif
6577667446
65777#ifdef __LITTLE_ENDIAN__67447#ifdef __LITTLE_ENDIAN__
65778#define vfmlsl_lane_high_f16(__p0_795, __p1_795, __p2_795, __p3_795) __extension__ ({ \67448#define vfmlsl_lane_high_f16(__p0_887, __p1_887, __p2_887, __p3_887) __extension__ ({ \
65779 float32x2_t __s0_795 = __p0_795; \67449 float32x2_t __s0_887 = __p0_887; \
65780 float16x4_t __s1_795 = __p1_795; \67450 float16x4_t __s1_887 = __p1_887; \
65781 float16x4_t __s2_795 = __p2_795; \67451 float16x4_t __s2_887 = __p2_887; \
65782 float32x2_t __ret_795; \67452 float32x2_t __ret_887; \
65783 __ret_795 = vfmlsl_high_f16(__s0_795, __s1_795, (float16x4_t) {vget_lane_f16(__s2_795, __p3_795), vget_lane_f16(__s2_795, __p3_795), vget_lane_f16(__s2_795, __p3_795), vget_lane_f16(__s2_795, __p3_795)}); \67453 __ret_887 = vfmlsl_high_f16(__s0_887, __s1_887, (float16x4_t) {vget_lane_f16(__s2_887, __p3_887), vget_lane_f16(__s2_887, __p3_887), vget_lane_f16(__s2_887, __p3_887), vget_lane_f16(__s2_887, __p3_887)}); \
65784 __ret_795; \67454 __ret_887; \
65785})67455})
65786#else67456#else
65787#define vfmlsl_lane_high_f16(__p0_796, __p1_796, __p2_796, __p3_796) __extension__ ({ \67457#define vfmlsl_lane_high_f16(__p0_888, __p1_888, __p2_888, __p3_888) __extension__ ({ \
65788 float32x2_t __s0_796 = __p0_796; \67458 float32x2_t __s0_888 = __p0_888; \
65789 float16x4_t __s1_796 = __p1_796; \67459 float16x4_t __s1_888 = __p1_888; \
65790 float16x4_t __s2_796 = __p2_796; \67460 float16x4_t __s2_888 = __p2_888; \
65791 float32x2_t __rev0_796; __rev0_796 = __builtin_shufflevector(__s0_796, __s0_796, 1, 0); \67461 float32x2_t __rev0_888; __rev0_888 = __builtin_shufflevector(__s0_888, __s0_888, 1, 0); \
65792 float16x4_t __rev1_796; __rev1_796 = __builtin_shufflevector(__s1_796, __s1_796, 3, 2, 1, 0); \67462 float16x4_t __rev1_888; __rev1_888 = __builtin_shufflevector(__s1_888, __s1_888, 3, 2, 1, 0); \
65793 float16x4_t __rev2_796; __rev2_796 = __builtin_shufflevector(__s2_796, __s2_796, 3, 2, 1, 0); \67463 float16x4_t __rev2_888; __rev2_888 = __builtin_shufflevector(__s2_888, __s2_888, 3, 2, 1, 0); \
65794 float32x2_t __ret_796; \67464 float32x2_t __ret_888; \
65795 __ret_796 = __noswap_vfmlsl_high_f16(__rev0_796, __rev1_796, (float16x4_t) {__noswap_vget_lane_f16(__rev2_796, __p3_796), __noswap_vget_lane_f16(__rev2_796, __p3_796), __noswap_vget_lane_f16(__rev2_796, __p3_796), __noswap_vget_lane_f16(__rev2_796, __p3_796)}); \67465 __ret_888 = __noswap_vfmlsl_high_f16(__rev0_888, __rev1_888, (float16x4_t) {__noswap_vget_lane_f16(__rev2_888, __p3_888), __noswap_vget_lane_f16(__rev2_888, __p3_888), __noswap_vget_lane_f16(__rev2_888, __p3_888), __noswap_vget_lane_f16(__rev2_888, __p3_888)}); \
65796 __ret_796 = __builtin_shufflevector(__ret_796, __ret_796, 1, 0); \67466 __ret_888 = __builtin_shufflevector(__ret_888, __ret_888, 1, 0); \
65797 __ret_796; \67467 __ret_888; \
65798})67468})
65799#endif67469#endif
6580067470
65801#ifdef __LITTLE_ENDIAN__67471#ifdef __LITTLE_ENDIAN__
65802#define vfmlslq_lane_low_f16(__p0_797, __p1_797, __p2_797, __p3_797) __extension__ ({ \67472#define vfmlslq_lane_low_f16(__p0_889, __p1_889, __p2_889, __p3_889) __extension__ ({ \
65803 float32x4_t __s0_797 = __p0_797; \67473 float32x4_t __s0_889 = __p0_889; \
65804 float16x8_t __s1_797 = __p1_797; \67474 float16x8_t __s1_889 = __p1_889; \
65805 float16x4_t __s2_797 = __p2_797; \67475 float16x4_t __s2_889 = __p2_889; \
65806 float32x4_t __ret_797; \67476 float32x4_t __ret_889; \
65807 __ret_797 = vfmlslq_low_f16(__s0_797, __s1_797, (float16x8_t) {vget_lane_f16(__s2_797, __p3_797), vget_lane_f16(__s2_797, __p3_797), vget_lane_f16(__s2_797, __p3_797), vget_lane_f16(__s2_797, __p3_797), vget_lane_f16(__s2_797, __p3_797), vget_lane_f16(__s2_797, __p3_797), vget_lane_f16(__s2_797, __p3_797), vget_lane_f16(__s2_797, __p3_797)}); \67477 __ret_889 = vfmlslq_low_f16(__s0_889, __s1_889, (float16x8_t) {vget_lane_f16(__s2_889, __p3_889), vget_lane_f16(__s2_889, __p3_889), vget_lane_f16(__s2_889, __p3_889), vget_lane_f16(__s2_889, __p3_889), vget_lane_f16(__s2_889, __p3_889), vget_lane_f16(__s2_889, __p3_889), vget_lane_f16(__s2_889, __p3_889), vget_lane_f16(__s2_889, __p3_889)}); \
65808 __ret_797; \67478 __ret_889; \
65809})67479})
65810#else67480#else
65811#define vfmlslq_lane_low_f16(__p0_798, __p1_798, __p2_798, __p3_798) __extension__ ({ \67481#define vfmlslq_lane_low_f16(__p0_890, __p1_890, __p2_890, __p3_890) __extension__ ({ \
65812 float32x4_t __s0_798 = __p0_798; \67482 float32x4_t __s0_890 = __p0_890; \
65813 float16x8_t __s1_798 = __p1_798; \67483 float16x8_t __s1_890 = __p1_890; \
65814 float16x4_t __s2_798 = __p2_798; \67484 float16x4_t __s2_890 = __p2_890; \
65815 float32x4_t __rev0_798; __rev0_798 = __builtin_shufflevector(__s0_798, __s0_798, 3, 2, 1, 0); \67485 float32x4_t __rev0_890; __rev0_890 = __builtin_shufflevector(__s0_890, __s0_890, 3, 2, 1, 0); \
65816 float16x8_t __rev1_798; __rev1_798 = __builtin_shufflevector(__s1_798, __s1_798, 7, 6, 5, 4, 3, 2, 1, 0); \67486 float16x8_t __rev1_890; __rev1_890 = __builtin_shufflevector(__s1_890, __s1_890, 7, 6, 5, 4, 3, 2, 1, 0); \
65817 float16x4_t __rev2_798; __rev2_798 = __builtin_shufflevector(__s2_798, __s2_798, 3, 2, 1, 0); \67487 float16x4_t __rev2_890; __rev2_890 = __builtin_shufflevector(__s2_890, __s2_890, 3, 2, 1, 0); \
65818 float32x4_t __ret_798; \67488 float32x4_t __ret_890; \
65819 __ret_798 = __noswap_vfmlslq_low_f16(__rev0_798, __rev1_798, (float16x8_t) {__noswap_vget_lane_f16(__rev2_798, __p3_798), __noswap_vget_lane_f16(__rev2_798, __p3_798), __noswap_vget_lane_f16(__rev2_798, __p3_798), __noswap_vget_lane_f16(__rev2_798, __p3_798), __noswap_vget_lane_f16(__rev2_798, __p3_798), __noswap_vget_lane_f16(__rev2_798, __p3_798), __noswap_vget_lane_f16(__rev2_798, __p3_798), __noswap_vget_lane_f16(__rev2_798, __p3_798)}); \67489 __ret_890 = __noswap_vfmlslq_low_f16(__rev0_890, __rev1_890, (float16x8_t) {__noswap_vget_lane_f16(__rev2_890, __p3_890), __noswap_vget_lane_f16(__rev2_890, __p3_890), __noswap_vget_lane_f16(__rev2_890, __p3_890), __noswap_vget_lane_f16(__rev2_890, __p3_890), __noswap_vget_lane_f16(__rev2_890, __p3_890), __noswap_vget_lane_f16(__rev2_890, __p3_890), __noswap_vget_lane_f16(__rev2_890, __p3_890), __noswap_vget_lane_f16(__rev2_890, __p3_890)}); \
65820 __ret_798 = __builtin_shufflevector(__ret_798, __ret_798, 3, 2, 1, 0); \67490 __ret_890 = __builtin_shufflevector(__ret_890, __ret_890, 3, 2, 1, 0); \
65821 __ret_798; \67491 __ret_890; \
65822})67492})
65823#endif67493#endif
6582467494
65825#ifdef __LITTLE_ENDIAN__67495#ifdef __LITTLE_ENDIAN__
65826#define vfmlsl_lane_low_f16(__p0_799, __p1_799, __p2_799, __p3_799) __extension__ ({ \67496#define vfmlsl_lane_low_f16(__p0_891, __p1_891, __p2_891, __p3_891) __extension__ ({ \
65827 float32x2_t __s0_799 = __p0_799; \67497 float32x2_t __s0_891 = __p0_891; \
65828 float16x4_t __s1_799 = __p1_799; \67498 float16x4_t __s1_891 = __p1_891; \
65829 float16x4_t __s2_799 = __p2_799; \67499 float16x4_t __s2_891 = __p2_891; \
65830 float32x2_t __ret_799; \67500 float32x2_t __ret_891; \
65831 __ret_799 = vfmlsl_low_f16(__s0_799, __s1_799, (float16x4_t) {vget_lane_f16(__s2_799, __p3_799), vget_lane_f16(__s2_799, __p3_799), vget_lane_f16(__s2_799, __p3_799), vget_lane_f16(__s2_799, __p3_799)}); \67501 __ret_891 = vfmlsl_low_f16(__s0_891, __s1_891, (float16x4_t) {vget_lane_f16(__s2_891, __p3_891), vget_lane_f16(__s2_891, __p3_891), vget_lane_f16(__s2_891, __p3_891), vget_lane_f16(__s2_891, __p3_891)}); \
65832 __ret_799; \67502 __ret_891; \
65833})67503})
65834#else67504#else
65835#define vfmlsl_lane_low_f16(__p0_800, __p1_800, __p2_800, __p3_800) __extension__ ({ \67505#define vfmlsl_lane_low_f16(__p0_892, __p1_892, __p2_892, __p3_892) __extension__ ({ \
65836 float32x2_t __s0_800 = __p0_800; \67506 float32x2_t __s0_892 = __p0_892; \
65837 float16x4_t __s1_800 = __p1_800; \67507 float16x4_t __s1_892 = __p1_892; \
65838 float16x4_t __s2_800 = __p2_800; \67508 float16x4_t __s2_892 = __p2_892; \
65839 float32x2_t __rev0_800; __rev0_800 = __builtin_shufflevector(__s0_800, __s0_800, 1, 0); \67509 float32x2_t __rev0_892; __rev0_892 = __builtin_shufflevector(__s0_892, __s0_892, 1, 0); \
65840 float16x4_t __rev1_800; __rev1_800 = __builtin_shufflevector(__s1_800, __s1_800, 3, 2, 1, 0); \67510 float16x4_t __rev1_892; __rev1_892 = __builtin_shufflevector(__s1_892, __s1_892, 3, 2, 1, 0); \
65841 float16x4_t __rev2_800; __rev2_800 = __builtin_shufflevector(__s2_800, __s2_800, 3, 2, 1, 0); \67511 float16x4_t __rev2_892; __rev2_892 = __builtin_shufflevector(__s2_892, __s2_892, 3, 2, 1, 0); \
65842 float32x2_t __ret_800; \67512 float32x2_t __ret_892; \
65843 __ret_800 = __noswap_vfmlsl_low_f16(__rev0_800, __rev1_800, (float16x4_t) {__noswap_vget_lane_f16(__rev2_800, __p3_800), __noswap_vget_lane_f16(__rev2_800, __p3_800), __noswap_vget_lane_f16(__rev2_800, __p3_800), __noswap_vget_lane_f16(__rev2_800, __p3_800)}); \67513 __ret_892 = __noswap_vfmlsl_low_f16(__rev0_892, __rev1_892, (float16x4_t) {__noswap_vget_lane_f16(__rev2_892, __p3_892), __noswap_vget_lane_f16(__rev2_892, __p3_892), __noswap_vget_lane_f16(__rev2_892, __p3_892), __noswap_vget_lane_f16(__rev2_892, __p3_892)}); \
65844 __ret_800 = __builtin_shufflevector(__ret_800, __ret_800, 1, 0); \67514 __ret_892 = __builtin_shufflevector(__ret_892, __ret_892, 1, 0); \
65845 __ret_800; \67515 __ret_892; \
65846})67516})
65847#endif67517#endif
6584867518
65849#ifdef __LITTLE_ENDIAN__67519#ifdef __LITTLE_ENDIAN__
65850#define vfmlslq_laneq_high_f16(__p0_801, __p1_801, __p2_801, __p3_801) __extension__ ({ \67520#define vfmlslq_laneq_high_f16(__p0_893, __p1_893, __p2_893, __p3_893) __extension__ ({ \
65851 float32x4_t __s0_801 = __p0_801; \67521 float32x4_t __s0_893 = __p0_893; \
65852 float16x8_t __s1_801 = __p1_801; \67522 float16x8_t __s1_893 = __p1_893; \
65853 float16x8_t __s2_801 = __p2_801; \67523 float16x8_t __s2_893 = __p2_893; \
65854 float32x4_t __ret_801; \67524 float32x4_t __ret_893; \
65855 __ret_801 = vfmlslq_high_f16(__s0_801, __s1_801, (float16x8_t) {vgetq_lane_f16(__s2_801, __p3_801), vgetq_lane_f16(__s2_801, __p3_801), vgetq_lane_f16(__s2_801, __p3_801), vgetq_lane_f16(__s2_801, __p3_801), vgetq_lane_f16(__s2_801, __p3_801), vgetq_lane_f16(__s2_801, __p3_801), vgetq_lane_f16(__s2_801, __p3_801), vgetq_lane_f16(__s2_801, __p3_801)}); \67525 __ret_893 = vfmlslq_high_f16(__s0_893, __s1_893, (float16x8_t) {vgetq_lane_f16(__s2_893, __p3_893), vgetq_lane_f16(__s2_893, __p3_893), vgetq_lane_f16(__s2_893, __p3_893), vgetq_lane_f16(__s2_893, __p3_893), vgetq_lane_f16(__s2_893, __p3_893), vgetq_lane_f16(__s2_893, __p3_893), vgetq_lane_f16(__s2_893, __p3_893), vgetq_lane_f16(__s2_893, __p3_893)}); \
65856 __ret_801; \67526 __ret_893; \
65857})67527})
65858#else67528#else
65859#define vfmlslq_laneq_high_f16(__p0_802, __p1_802, __p2_802, __p3_802) __extension__ ({ \67529#define vfmlslq_laneq_high_f16(__p0_894, __p1_894, __p2_894, __p3_894) __extension__ ({ \
65860 float32x4_t __s0_802 = __p0_802; \67530 float32x4_t __s0_894 = __p0_894; \
65861 float16x8_t __s1_802 = __p1_802; \67531 float16x8_t __s1_894 = __p1_894; \
65862 float16x8_t __s2_802 = __p2_802; \67532 float16x8_t __s2_894 = __p2_894; \
65863 float32x4_t __rev0_802; __rev0_802 = __builtin_shufflevector(__s0_802, __s0_802, 3, 2, 1, 0); \67533 float32x4_t __rev0_894; __rev0_894 = __builtin_shufflevector(__s0_894, __s0_894, 3, 2, 1, 0); \
65864 float16x8_t __rev1_802; __rev1_802 = __builtin_shufflevector(__s1_802, __s1_802, 7, 6, 5, 4, 3, 2, 1, 0); \67534 float16x8_t __rev1_894; __rev1_894 = __builtin_shufflevector(__s1_894, __s1_894, 7, 6, 5, 4, 3, 2, 1, 0); \
65865 float16x8_t __rev2_802; __rev2_802 = __builtin_shufflevector(__s2_802, __s2_802, 7, 6, 5, 4, 3, 2, 1, 0); \67535 float16x8_t __rev2_894; __rev2_894 = __builtin_shufflevector(__s2_894, __s2_894, 7, 6, 5, 4, 3, 2, 1, 0); \
65866 float32x4_t __ret_802; \67536 float32x4_t __ret_894; \
65867 __ret_802 = __noswap_vfmlslq_high_f16(__rev0_802, __rev1_802, (float16x8_t) {__noswap_vgetq_lane_f16(__rev2_802, __p3_802), __noswap_vgetq_lane_f16(__rev2_802, __p3_802), __noswap_vgetq_lane_f16(__rev2_802, __p3_802), __noswap_vgetq_lane_f16(__rev2_802, __p3_802), __noswap_vgetq_lane_f16(__rev2_802, __p3_802), __noswap_vgetq_lane_f16(__rev2_802, __p3_802), __noswap_vgetq_lane_f16(__rev2_802, __p3_802), __noswap_vgetq_lane_f16(__rev2_802, __p3_802)}); \67537 __ret_894 = __noswap_vfmlslq_high_f16(__rev0_894, __rev1_894, (float16x8_t) {__noswap_vgetq_lane_f16(__rev2_894, __p3_894), __noswap_vgetq_lane_f16(__rev2_894, __p3_894), __noswap_vgetq_lane_f16(__rev2_894, __p3_894), __noswap_vgetq_lane_f16(__rev2_894, __p3_894), __noswap_vgetq_lane_f16(__rev2_894, __p3_894), __noswap_vgetq_lane_f16(__rev2_894, __p3_894), __noswap_vgetq_lane_f16(__rev2_894, __p3_894), __noswap_vgetq_lane_f16(__rev2_894, __p3_894)}); \
65868 __ret_802 = __builtin_shufflevector(__ret_802, __ret_802, 3, 2, 1, 0); \67538 __ret_894 = __builtin_shufflevector(__ret_894, __ret_894, 3, 2, 1, 0); \
65869 __ret_802; \67539 __ret_894; \
65870})67540})
65871#endif67541#endif
6587267542
65873#ifdef __LITTLE_ENDIAN__67543#ifdef __LITTLE_ENDIAN__
65874#define vfmlsl_laneq_high_f16(__p0_803, __p1_803, __p2_803, __p3_803) __extension__ ({ \67544#define vfmlsl_laneq_high_f16(__p0_895, __p1_895, __p2_895, __p3_895) __extension__ ({ \
65875 float32x2_t __s0_803 = __p0_803; \67545 float32x2_t __s0_895 = __p0_895; \
65876 float16x4_t __s1_803 = __p1_803; \67546 float16x4_t __s1_895 = __p1_895; \
65877 float16x8_t __s2_803 = __p2_803; \67547 float16x8_t __s2_895 = __p2_895; \
65878 float32x2_t __ret_803; \67548 float32x2_t __ret_895; \
65879 __ret_803 = vfmlsl_high_f16(__s0_803, __s1_803, (float16x4_t) {vgetq_lane_f16(__s2_803, __p3_803), vgetq_lane_f16(__s2_803, __p3_803), vgetq_lane_f16(__s2_803, __p3_803), vgetq_lane_f16(__s2_803, __p3_803)}); \67549 __ret_895 = vfmlsl_high_f16(__s0_895, __s1_895, (float16x4_t) {vgetq_lane_f16(__s2_895, __p3_895), vgetq_lane_f16(__s2_895, __p3_895), vgetq_lane_f16(__s2_895, __p3_895), vgetq_lane_f16(__s2_895, __p3_895)}); \
65880 __ret_803; \67550 __ret_895; \
65881})67551})
65882#else67552#else
65883#define vfmlsl_laneq_high_f16(__p0_804, __p1_804, __p2_804, __p3_804) __extension__ ({ \67553#define vfmlsl_laneq_high_f16(__p0_896, __p1_896, __p2_896, __p3_896) __extension__ ({ \
65884 float32x2_t __s0_804 = __p0_804; \67554 float32x2_t __s0_896 = __p0_896; \
65885 float16x4_t __s1_804 = __p1_804; \67555 float16x4_t __s1_896 = __p1_896; \
65886 float16x8_t __s2_804 = __p2_804; \67556 float16x8_t __s2_896 = __p2_896; \
65887 float32x2_t __rev0_804; __rev0_804 = __builtin_shufflevector(__s0_804, __s0_804, 1, 0); \67557 float32x2_t __rev0_896; __rev0_896 = __builtin_shufflevector(__s0_896, __s0_896, 1, 0); \
65888 float16x4_t __rev1_804; __rev1_804 = __builtin_shufflevector(__s1_804, __s1_804, 3, 2, 1, 0); \67558 float16x4_t __rev1_896; __rev1_896 = __builtin_shufflevector(__s1_896, __s1_896, 3, 2, 1, 0); \
65889 float16x8_t __rev2_804; __rev2_804 = __builtin_shufflevector(__s2_804, __s2_804, 7, 6, 5, 4, 3, 2, 1, 0); \67559 float16x8_t __rev2_896; __rev2_896 = __builtin_shufflevector(__s2_896, __s2_896, 7, 6, 5, 4, 3, 2, 1, 0); \
65890 float32x2_t __ret_804; \67560 float32x2_t __ret_896; \
65891 __ret_804 = __noswap_vfmlsl_high_f16(__rev0_804, __rev1_804, (float16x4_t) {__noswap_vgetq_lane_f16(__rev2_804, __p3_804), __noswap_vgetq_lane_f16(__rev2_804, __p3_804), __noswap_vgetq_lane_f16(__rev2_804, __p3_804), __noswap_vgetq_lane_f16(__rev2_804, __p3_804)}); \67561 __ret_896 = __noswap_vfmlsl_high_f16(__rev0_896, __rev1_896, (float16x4_t) {__noswap_vgetq_lane_f16(__rev2_896, __p3_896), __noswap_vgetq_lane_f16(__rev2_896, __p3_896), __noswap_vgetq_lane_f16(__rev2_896, __p3_896), __noswap_vgetq_lane_f16(__rev2_896, __p3_896)}); \
65892 __ret_804 = __builtin_shufflevector(__ret_804, __ret_804, 1, 0); \67562 __ret_896 = __builtin_shufflevector(__ret_896, __ret_896, 1, 0); \
65893 __ret_804; \67563 __ret_896; \
65894})67564})
65895#endif67565#endif
6589667566
65897#ifdef __LITTLE_ENDIAN__67567#ifdef __LITTLE_ENDIAN__
65898#define vfmlslq_laneq_low_f16(__p0_805, __p1_805, __p2_805, __p3_805) __extension__ ({ \67568#define vfmlslq_laneq_low_f16(__p0_897, __p1_897, __p2_897, __p3_897) __extension__ ({ \
65899 float32x4_t __s0_805 = __p0_805; \67569 float32x4_t __s0_897 = __p0_897; \
65900 float16x8_t __s1_805 = __p1_805; \67570 float16x8_t __s1_897 = __p1_897; \
65901 float16x8_t __s2_805 = __p2_805; \67571 float16x8_t __s2_897 = __p2_897; \
65902 float32x4_t __ret_805; \67572 float32x4_t __ret_897; \
65903 __ret_805 = vfmlslq_low_f16(__s0_805, __s1_805, (float16x8_t) {vgetq_lane_f16(__s2_805, __p3_805), vgetq_lane_f16(__s2_805, __p3_805), vgetq_lane_f16(__s2_805, __p3_805), vgetq_lane_f16(__s2_805, __p3_805), vgetq_lane_f16(__s2_805, __p3_805), vgetq_lane_f16(__s2_805, __p3_805), vgetq_lane_f16(__s2_805, __p3_805), vgetq_lane_f16(__s2_805, __p3_805)}); \67573 __ret_897 = vfmlslq_low_f16(__s0_897, __s1_897, (float16x8_t) {vgetq_lane_f16(__s2_897, __p3_897), vgetq_lane_f16(__s2_897, __p3_897), vgetq_lane_f16(__s2_897, __p3_897), vgetq_lane_f16(__s2_897, __p3_897), vgetq_lane_f16(__s2_897, __p3_897), vgetq_lane_f16(__s2_897, __p3_897), vgetq_lane_f16(__s2_897, __p3_897), vgetq_lane_f16(__s2_897, __p3_897)}); \
65904 __ret_805; \67574 __ret_897; \
65905})67575})
65906#else67576#else
65907#define vfmlslq_laneq_low_f16(__p0_806, __p1_806, __p2_806, __p3_806) __extension__ ({ \67577#define vfmlslq_laneq_low_f16(__p0_898, __p1_898, __p2_898, __p3_898) __extension__ ({ \
65908 float32x4_t __s0_806 = __p0_806; \67578 float32x4_t __s0_898 = __p0_898; \
65909 float16x8_t __s1_806 = __p1_806; \67579 float16x8_t __s1_898 = __p1_898; \
65910 float16x8_t __s2_806 = __p2_806; \67580 float16x8_t __s2_898 = __p2_898; \
65911 float32x4_t __rev0_806; __rev0_806 = __builtin_shufflevector(__s0_806, __s0_806, 3, 2, 1, 0); \67581 float32x4_t __rev0_898; __rev0_898 = __builtin_shufflevector(__s0_898, __s0_898, 3, 2, 1, 0); \
65912 float16x8_t __rev1_806; __rev1_806 = __builtin_shufflevector(__s1_806, __s1_806, 7, 6, 5, 4, 3, 2, 1, 0); \67582 float16x8_t __rev1_898; __rev1_898 = __builtin_shufflevector(__s1_898, __s1_898, 7, 6, 5, 4, 3, 2, 1, 0); \
65913 float16x8_t __rev2_806; __rev2_806 = __builtin_shufflevector(__s2_806, __s2_806, 7, 6, 5, 4, 3, 2, 1, 0); \67583 float16x8_t __rev2_898; __rev2_898 = __builtin_shufflevector(__s2_898, __s2_898, 7, 6, 5, 4, 3, 2, 1, 0); \
65914 float32x4_t __ret_806; \67584 float32x4_t __ret_898; \
65915 __ret_806 = __noswap_vfmlslq_low_f16(__rev0_806, __rev1_806, (float16x8_t) {__noswap_vgetq_lane_f16(__rev2_806, __p3_806), __noswap_vgetq_lane_f16(__rev2_806, __p3_806), __noswap_vgetq_lane_f16(__rev2_806, __p3_806), __noswap_vgetq_lane_f16(__rev2_806, __p3_806), __noswap_vgetq_lane_f16(__rev2_806, __p3_806), __noswap_vgetq_lane_f16(__rev2_806, __p3_806), __noswap_vgetq_lane_f16(__rev2_806, __p3_806), __noswap_vgetq_lane_f16(__rev2_806, __p3_806)}); \67585 __ret_898 = __noswap_vfmlslq_low_f16(__rev0_898, __rev1_898, (float16x8_t) {__noswap_vgetq_lane_f16(__rev2_898, __p3_898), __noswap_vgetq_lane_f16(__rev2_898, __p3_898), __noswap_vgetq_lane_f16(__rev2_898, __p3_898), __noswap_vgetq_lane_f16(__rev2_898, __p3_898), __noswap_vgetq_lane_f16(__rev2_898, __p3_898), __noswap_vgetq_lane_f16(__rev2_898, __p3_898), __noswap_vgetq_lane_f16(__rev2_898, __p3_898), __noswap_vgetq_lane_f16(__rev2_898, __p3_898)}); \
65916 __ret_806 = __builtin_shufflevector(__ret_806, __ret_806, 3, 2, 1, 0); \67586 __ret_898 = __builtin_shufflevector(__ret_898, __ret_898, 3, 2, 1, 0); \
65917 __ret_806; \67587 __ret_898; \
65918})67588})
65919#endif67589#endif
6592067590
65921#ifdef __LITTLE_ENDIAN__67591#ifdef __LITTLE_ENDIAN__
65922#define vfmlsl_laneq_low_f16(__p0_807, __p1_807, __p2_807, __p3_807) __extension__ ({ \67592#define vfmlsl_laneq_low_f16(__p0_899, __p1_899, __p2_899, __p3_899) __extension__ ({ \
65923 float32x2_t __s0_807 = __p0_807; \67593 float32x2_t __s0_899 = __p0_899; \
65924 float16x4_t __s1_807 = __p1_807; \67594 float16x4_t __s1_899 = __p1_899; \
65925 float16x8_t __s2_807 = __p2_807; \67595 float16x8_t __s2_899 = __p2_899; \
65926 float32x2_t __ret_807; \67596 float32x2_t __ret_899; \
65927 __ret_807 = vfmlsl_low_f16(__s0_807, __s1_807, (float16x4_t) {vgetq_lane_f16(__s2_807, __p3_807), vgetq_lane_f16(__s2_807, __p3_807), vgetq_lane_f16(__s2_807, __p3_807), vgetq_lane_f16(__s2_807, __p3_807)}); \67597 __ret_899 = vfmlsl_low_f16(__s0_899, __s1_899, (float16x4_t) {vgetq_lane_f16(__s2_899, __p3_899), vgetq_lane_f16(__s2_899, __p3_899), vgetq_lane_f16(__s2_899, __p3_899), vgetq_lane_f16(__s2_899, __p3_899)}); \
65928 __ret_807; \67598 __ret_899; \
65929})67599})
65930#else67600#else
65931#define vfmlsl_laneq_low_f16(__p0_808, __p1_808, __p2_808, __p3_808) __extension__ ({ \67601#define vfmlsl_laneq_low_f16(__p0_900, __p1_900, __p2_900, __p3_900) __extension__ ({ \
65932 float32x2_t __s0_808 = __p0_808; \67602 float32x2_t __s0_900 = __p0_900; \
65933 float16x4_t __s1_808 = __p1_808; \67603 float16x4_t __s1_900 = __p1_900; \
65934 float16x8_t __s2_808 = __p2_808; \67604 float16x8_t __s2_900 = __p2_900; \
65935 float32x2_t __rev0_808; __rev0_808 = __builtin_shufflevector(__s0_808, __s0_808, 1, 0); \67605 float32x2_t __rev0_900; __rev0_900 = __builtin_shufflevector(__s0_900, __s0_900, 1, 0); \
65936 float16x4_t __rev1_808; __rev1_808 = __builtin_shufflevector(__s1_808, __s1_808, 3, 2, 1, 0); \67606 float16x4_t __rev1_900; __rev1_900 = __builtin_shufflevector(__s1_900, __s1_900, 3, 2, 1, 0); \
65937 float16x8_t __rev2_808; __rev2_808 = __builtin_shufflevector(__s2_808, __s2_808, 7, 6, 5, 4, 3, 2, 1, 0); \67607 float16x8_t __rev2_900; __rev2_900 = __builtin_shufflevector(__s2_900, __s2_900, 7, 6, 5, 4, 3, 2, 1, 0); \
65938 float32x2_t __ret_808; \67608 float32x2_t __ret_900; \
65939 __ret_808 = __noswap_vfmlsl_low_f16(__rev0_808, __rev1_808, (float16x4_t) {__noswap_vgetq_lane_f16(__rev2_808, __p3_808), __noswap_vgetq_lane_f16(__rev2_808, __p3_808), __noswap_vgetq_lane_f16(__rev2_808, __p3_808), __noswap_vgetq_lane_f16(__rev2_808, __p3_808)}); \67609 __ret_900 = __noswap_vfmlsl_low_f16(__rev0_900, __rev1_900, (float16x4_t) {__noswap_vgetq_lane_f16(__rev2_900, __p3_900), __noswap_vgetq_lane_f16(__rev2_900, __p3_900), __noswap_vgetq_lane_f16(__rev2_900, __p3_900), __noswap_vgetq_lane_f16(__rev2_900, __p3_900)}); \
65940 __ret_808 = __builtin_shufflevector(__ret_808, __ret_808, 1, 0); \67610 __ret_900 = __builtin_shufflevector(__ret_900, __ret_900, 1, 0); \
65941 __ret_808; \67611 __ret_900; \
65942})67612})
65943#endif67613#endif
6594467614
65945#endif67615#endif
65946#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarch64__)67616#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarch64__)
65947#ifdef __LITTLE_ENDIAN__67617#ifdef __LITTLE_ENDIAN__
65948#define vmulh_lane_f16(__p0_809, __p1_809, __p2_809) __extension__ ({ \67618#define vmulh_lane_f16(__p0_901, __p1_901, __p2_901) __extension__ ({ \
65949 float16_t __s0_809 = __p0_809; \67619 float16_t __s0_901 = __p0_901; \
65950 float16x4_t __s1_809 = __p1_809; \67620 float16x4_t __s1_901 = __p1_901; \
65951 float16_t __ret_809; \67621 float16_t __ret_901; \
65952 __ret_809 = __s0_809 * vget_lane_f16(__s1_809, __p2_809); \67622 __ret_901 = __s0_901 * vget_lane_f16(__s1_901, __p2_901); \
65953 __ret_809; \67623 __ret_901; \
65954})67624})
65955#else67625#else
65956#define vmulh_lane_f16(__p0_810, __p1_810, __p2_810) __extension__ ({ \67626#define vmulh_lane_f16(__p0_902, __p1_902, __p2_902) __extension__ ({ \
65957 float16_t __s0_810 = __p0_810; \67627 float16_t __s0_902 = __p0_902; \
65958 float16x4_t __s1_810 = __p1_810; \67628 float16x4_t __s1_902 = __p1_902; \
65959 float16x4_t __rev1_810; __rev1_810 = __builtin_shufflevector(__s1_810, __s1_810, 3, 2, 1, 0); \67629 float16x4_t __rev1_902; __rev1_902 = __builtin_shufflevector(__s1_902, __s1_902, 3, 2, 1, 0); \
65960 float16_t __ret_810; \67630 float16_t __ret_902; \
65961 __ret_810 = __s0_810 * __noswap_vget_lane_f16(__rev1_810, __p2_810); \67631 __ret_902 = __s0_902 * __noswap_vget_lane_f16(__rev1_902, __p2_902); \
65962 __ret_810; \67632 __ret_902; \
65963})67633})
65964#endif67634#endif
6596567635
65966#ifdef __LITTLE_ENDIAN__67636#ifdef __LITTLE_ENDIAN__
65967#define vmulh_laneq_f16(__p0_811, __p1_811, __p2_811) __extension__ ({ \67637#define vmulh_laneq_f16(__p0_903, __p1_903, __p2_903) __extension__ ({ \
65968 float16_t __s0_811 = __p0_811; \67638 float16_t __s0_903 = __p0_903; \
65969 float16x8_t __s1_811 = __p1_811; \67639 float16x8_t __s1_903 = __p1_903; \
65970 float16_t __ret_811; \67640 float16_t __ret_903; \
65971 __ret_811 = __s0_811 * vgetq_lane_f16(__s1_811, __p2_811); \67641 __ret_903 = __s0_903 * vgetq_lane_f16(__s1_903, __p2_903); \
65972 __ret_811; \67642 __ret_903; \
65973})67643})
65974#else67644#else
65975#define vmulh_laneq_f16(__p0_812, __p1_812, __p2_812) __extension__ ({ \67645#define vmulh_laneq_f16(__p0_904, __p1_904, __p2_904) __extension__ ({ \
65976 float16_t __s0_812 = __p0_812; \67646 float16_t __s0_904 = __p0_904; \
65977 float16x8_t __s1_812 = __p1_812; \67647 float16x8_t __s1_904 = __p1_904; \
65978 float16x8_t __rev1_812; __rev1_812 = __builtin_shufflevector(__s1_812, __s1_812, 7, 6, 5, 4, 3, 2, 1, 0); \67648 float16x8_t __rev1_904; __rev1_904 = __builtin_shufflevector(__s1_904, __s1_904, 7, 6, 5, 4, 3, 2, 1, 0); \
65979 float16_t __ret_812; \67649 float16_t __ret_904; \
65980 __ret_812 = __s0_812 * __noswap_vgetq_lane_f16(__rev1_812, __p2_812); \67650 __ret_904 = __s0_904 * __noswap_vgetq_lane_f16(__rev1_904, __p2_904); \
65981 __ret_812; \67651 __ret_904; \
65982})67652})
65983#endif67653#endif
6598467654
65985#endif67655#endif
65986#if defined(__ARM_FEATURE_MATMUL_INT8)67656#if defined(__ARM_FEATURE_MATMUL_INT8)
65987#ifdef __LITTLE_ENDIAN__67657#ifdef __LITTLE_ENDIAN__
65988#define vsudotq_lane_s32(__p0_813, __p1_813, __p2_813, __p3_813) __extension__ ({ \67658#define vsudotq_lane_s32(__p0_905, __p1_905, __p2_905, __p3_905) __extension__ ({ \
65989 int32x4_t __s0_813 = __p0_813; \67659 int32x4_t __s0_905 = __p0_905; \
65990 int8x16_t __s1_813 = __p1_813; \67660 int8x16_t __s1_905 = __p1_905; \
65991 uint8x8_t __s2_813 = __p2_813; \67661 uint8x8_t __s2_905 = __p2_905; \
65992 int32x4_t __ret_813; \67662 int32x4_t __ret_905; \
65993uint8x8_t __reint_813 = __s2_813; \67663uint8x8_t __reint_905 = __s2_905; \
65994 __ret_813 = vusdotq_s32(__s0_813, (uint8x16_t)(splatq_lane_s32(*(int32x2_t *) &__reint_813, __p3_813)), __s1_813); \67664 __ret_905 = vusdotq_s32(__s0_905, (uint8x16_t)(splatq_lane_s32(*(int32x2_t *) &__reint_905, __p3_905)), __s1_905); \
65995 __ret_813; \67665 __ret_905; \
65996})67666})
65997#else67667#else
65998#define vsudotq_lane_s32(__p0_814, __p1_814, __p2_814, __p3_814) __extension__ ({ \67668#define vsudotq_lane_s32(__p0_906, __p1_906, __p2_906, __p3_906) __extension__ ({ \
65999 int32x4_t __s0_814 = __p0_814; \67669 int32x4_t __s0_906 = __p0_906; \
66000 int8x16_t __s1_814 = __p1_814; \67670 int8x16_t __s1_906 = __p1_906; \
66001 uint8x8_t __s2_814 = __p2_814; \67671 uint8x8_t __s2_906 = __p2_906; \
66002 int32x4_t __rev0_814; __rev0_814 = __builtin_shufflevector(__s0_814, __s0_814, 3, 2, 1, 0); \67672 int32x4_t __rev0_906; __rev0_906 = __builtin_shufflevector(__s0_906, __s0_906, 3, 2, 1, 0); \
66003 int8x16_t __rev1_814; __rev1_814 = __builtin_shufflevector(__s1_814, __s1_814, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \67673 int8x16_t __rev1_906; __rev1_906 = __builtin_shufflevector(__s1_906, __s1_906, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); \
66004 uint8x8_t __rev2_814; __rev2_814 = __builtin_shufflevector(__s2_814, __s2_814, 7, 6, 5, 4, 3, 2, 1, 0); \67674 uint8x8_t __rev2_906; __rev2_906 = __builtin_shufflevector(__s2_906, __s2_906, 7, 6, 5, 4, 3, 2, 1, 0); \
66005 int32x4_t __ret_814; \67675 int32x4_t __ret_906; \
66006uint8x8_t __reint_814 = __rev2_814; \67676uint8x8_t __reint_906 = __rev2_906; \
66007 __ret_814 = __noswap_vusdotq_s32(__rev0_814, (uint8x16_t)(__noswap_splatq_lane_s32(*(int32x2_t *) &__reint_814, __p3_814)), __rev1_814); \67677 __ret_906 = __noswap_vusdotq_s32(__rev0_906, (uint8x16_t)(__noswap_splatq_lane_s32(*(int32x2_t *) &__reint_906, __p3_906)), __rev1_906); \
66008 __ret_814 = __builtin_shufflevector(__ret_814, __ret_814, 3, 2, 1, 0); \67678 __ret_906 = __builtin_shufflevector(__ret_906, __ret_906, 3, 2, 1, 0); \
66009 __ret_814; \67679 __ret_906; \
66010})67680})
66011#endif67681#endif
6601267682
66013#ifdef __LITTLE_ENDIAN__67683#ifdef __LITTLE_ENDIAN__
66014#define vsudot_lane_s32(__p0_815, __p1_815, __p2_815, __p3_815) __extension__ ({ \67684#define vsudot_lane_s32(__p0_907, __p1_907, __p2_907, __p3_907) __extension__ ({ \
66015 int32x2_t __s0_815 = __p0_815; \67685 int32x2_t __s0_907 = __p0_907; \
66016 int8x8_t __s1_815 = __p1_815; \67686 int8x8_t __s1_907 = __p1_907; \
66017 uint8x8_t __s2_815 = __p2_815; \67687 uint8x8_t __s2_907 = __p2_907; \
66018 int32x2_t __ret_815; \67688 int32x2_t __ret_907; \
66019uint8x8_t __reint_815 = __s2_815; \67689uint8x8_t __reint_907 = __s2_907; \
66020 __ret_815 = vusdot_s32(__s0_815, (uint8x8_t)(splat_lane_s32(*(int32x2_t *) &__reint_815, __p3_815)), __s1_815); \67690 __ret_907 = vusdot_s32(__s0_907, (uint8x8_t)(splat_lane_s32(*(int32x2_t *) &__reint_907, __p3_907)), __s1_907); \
66021 __ret_815; \67691 __ret_907; \
66022})67692})
66023#else67693#else
66024#define vsudot_lane_s32(__p0_816, __p1_816, __p2_816, __p3_816) __extension__ ({ \67694#define vsudot_lane_s32(__p0_908, __p1_908, __p2_908, __p3_908) __extension__ ({ \
66025 int32x2_t __s0_816 = __p0_816; \67695 int32x2_t __s0_908 = __p0_908; \
66026 int8x8_t __s1_816 = __p1_816; \67696 int8x8_t __s1_908 = __p1_908; \
66027 uint8x8_t __s2_816 = __p2_816; \67697 uint8x8_t __s2_908 = __p2_908; \
66028 int32x2_t __rev0_816; __rev0_816 = __builtin_shufflevector(__s0_816, __s0_816, 1, 0); \67698 int32x2_t __rev0_908; __rev0_908 = __builtin_shufflevector(__s0_908, __s0_908, 1, 0); \
66029 int8x8_t __rev1_816; __rev1_816 = __builtin_shufflevector(__s1_816, __s1_816, 7, 6, 5, 4, 3, 2, 1, 0); \67699 int8x8_t __rev1_908; __rev1_908 = __builtin_shufflevector(__s1_908, __s1_908, 7, 6, 5, 4, 3, 2, 1, 0); \
66030 uint8x8_t __rev2_816; __rev2_816 = __builtin_shufflevector(__s2_816, __s2_816, 7, 6, 5, 4, 3, 2, 1, 0); \67700 uint8x8_t __rev2_908; __rev2_908 = __builtin_shufflevector(__s2_908, __s2_908, 7, 6, 5, 4, 3, 2, 1, 0); \
66031 int32x2_t __ret_816; \67701 int32x2_t __ret_908; \
66032uint8x8_t __reint_816 = __rev2_816; \67702uint8x8_t __reint_908 = __rev2_908; \
66033 __ret_816 = __noswap_vusdot_s32(__rev0_816, (uint8x8_t)(__noswap_splat_lane_s32(*(int32x2_t *) &__reint_816, __p3_816)), __rev1_816); \67703 __ret_908 = __noswap_vusdot_s32(__rev0_908, (uint8x8_t)(__noswap_splat_lane_s32(*(int32x2_t *) &__reint_908, __p3_908)), __rev1_908); \
66034 __ret_816 = __builtin_shufflevector(__ret_816, __ret_816, 1, 0); \67704 __ret_908 = __builtin_shufflevector(__ret_908, __ret_908, 1, 0); \
66035 __ret_816; \67705 __ret_908; \
66036})67706})
66037#endif67707#endif
6603867708
...@@ -66049,86 +67719,86 @@ __ai int16_t vqrdmlahh_s16(int16_t __p0, int16_t __p1, int16_t __p2) {...@@ -66049,86 +67719,86 @@ __ai int16_t vqrdmlahh_s16(int16_t __p0, int16_t __p1, int16_t __p2) {
66049 return __ret;67719 return __ret;
66050}67720}
66051#ifdef __LITTLE_ENDIAN__67721#ifdef __LITTLE_ENDIAN__
66052#define vqrdmlahs_lane_s32(__p0_817, __p1_817, __p2_817, __p3_817) __extension__ ({ \67722#define vqrdmlahs_lane_s32(__p0_909, __p1_909, __p2_909, __p3_909) __extension__ ({ \
66053 int32_t __s0_817 = __p0_817; \67723 int32_t __s0_909 = __p0_909; \
66054 int32_t __s1_817 = __p1_817; \67724 int32_t __s1_909 = __p1_909; \
66055 int32x2_t __s2_817 = __p2_817; \67725 int32x2_t __s2_909 = __p2_909; \
66056 int32_t __ret_817; \67726 int32_t __ret_909; \
66057 __ret_817 = vqadds_s32(__s0_817, vqrdmulhs_s32(__s1_817, vget_lane_s32(__s2_817, __p3_817))); \67727 __ret_909 = vqadds_s32(__s0_909, vqrdmulhs_s32(__s1_909, vget_lane_s32(__s2_909, __p3_909))); \
66058 __ret_817; \67728 __ret_909; \
66059})67729})
66060#else67730#else
66061#define vqrdmlahs_lane_s32(__p0_818, __p1_818, __p2_818, __p3_818) __extension__ ({ \67731#define vqrdmlahs_lane_s32(__p0_910, __p1_910, __p2_910, __p3_910) __extension__ ({ \
66062 int32_t __s0_818 = __p0_818; \67732 int32_t __s0_910 = __p0_910; \
66063 int32_t __s1_818 = __p1_818; \67733 int32_t __s1_910 = __p1_910; \
66064 int32x2_t __s2_818 = __p2_818; \67734 int32x2_t __s2_910 = __p2_910; \
66065 int32x2_t __rev2_818; __rev2_818 = __builtin_shufflevector(__s2_818, __s2_818, 1, 0); \67735 int32x2_t __rev2_910; __rev2_910 = __builtin_shufflevector(__s2_910, __s2_910, 1, 0); \
66066 int32_t __ret_818; \67736 int32_t __ret_910; \
66067 __ret_818 = vqadds_s32(__s0_818, vqrdmulhs_s32(__s1_818, __noswap_vget_lane_s32(__rev2_818, __p3_818))); \67737 __ret_910 = vqadds_s32(__s0_910, vqrdmulhs_s32(__s1_910, __noswap_vget_lane_s32(__rev2_910, __p3_910))); \
66068 __ret_818; \67738 __ret_910; \
66069})67739})
66070#endif67740#endif
6607167741
66072#ifdef __LITTLE_ENDIAN__67742#ifdef __LITTLE_ENDIAN__
66073#define vqrdmlahh_lane_s16(__p0_819, __p1_819, __p2_819, __p3_819) __extension__ ({ \67743#define vqrdmlahh_lane_s16(__p0_911, __p1_911, __p2_911, __p3_911) __extension__ ({ \
66074 int16_t __s0_819 = __p0_819; \67744 int16_t __s0_911 = __p0_911; \
66075 int16_t __s1_819 = __p1_819; \67745 int16_t __s1_911 = __p1_911; \
66076 int16x4_t __s2_819 = __p2_819; \67746 int16x4_t __s2_911 = __p2_911; \
66077 int16_t __ret_819; \67747 int16_t __ret_911; \
66078 __ret_819 = vqaddh_s16(__s0_819, vqrdmulhh_s16(__s1_819, vget_lane_s16(__s2_819, __p3_819))); \67748 __ret_911 = vqaddh_s16(__s0_911, vqrdmulhh_s16(__s1_911, vget_lane_s16(__s2_911, __p3_911))); \
66079 __ret_819; \67749 __ret_911; \
66080})67750})
66081#else67751#else
66082#define vqrdmlahh_lane_s16(__p0_820, __p1_820, __p2_820, __p3_820) __extension__ ({ \67752#define vqrdmlahh_lane_s16(__p0_912, __p1_912, __p2_912, __p3_912) __extension__ ({ \
66083 int16_t __s0_820 = __p0_820; \67753 int16_t __s0_912 = __p0_912; \
66084 int16_t __s1_820 = __p1_820; \67754 int16_t __s1_912 = __p1_912; \
66085 int16x4_t __s2_820 = __p2_820; \67755 int16x4_t __s2_912 = __p2_912; \
66086 int16x4_t __rev2_820; __rev2_820 = __builtin_shufflevector(__s2_820, __s2_820, 3, 2, 1, 0); \67756 int16x4_t __rev2_912; __rev2_912 = __builtin_shufflevector(__s2_912, __s2_912, 3, 2, 1, 0); \
66087 int16_t __ret_820; \67757 int16_t __ret_912; \
66088 __ret_820 = vqaddh_s16(__s0_820, vqrdmulhh_s16(__s1_820, __noswap_vget_lane_s16(__rev2_820, __p3_820))); \67758 __ret_912 = vqaddh_s16(__s0_912, vqrdmulhh_s16(__s1_912, __noswap_vget_lane_s16(__rev2_912, __p3_912))); \
66089 __ret_820; \67759 __ret_912; \
66090})67760})
66091#endif67761#endif
6609267762
66093#ifdef __LITTLE_ENDIAN__67763#ifdef __LITTLE_ENDIAN__
66094#define vqrdmlahs_laneq_s32(__p0_821, __p1_821, __p2_821, __p3_821) __extension__ ({ \67764#define vqrdmlahs_laneq_s32(__p0_913, __p1_913, __p2_913, __p3_913) __extension__ ({ \
66095 int32_t __s0_821 = __p0_821; \67765 int32_t __s0_913 = __p0_913; \
66096 int32_t __s1_821 = __p1_821; \67766 int32_t __s1_913 = __p1_913; \
66097 int32x4_t __s2_821 = __p2_821; \67767 int32x4_t __s2_913 = __p2_913; \
66098 int32_t __ret_821; \67768 int32_t __ret_913; \
66099 __ret_821 = vqadds_s32(__s0_821, vqrdmulhs_s32(__s1_821, vgetq_lane_s32(__s2_821, __p3_821))); \67769 __ret_913 = vqadds_s32(__s0_913, vqrdmulhs_s32(__s1_913, vgetq_lane_s32(__s2_913, __p3_913))); \
66100 __ret_821; \67770 __ret_913; \
66101})67771})
66102#else67772#else
66103#define vqrdmlahs_laneq_s32(__p0_822, __p1_822, __p2_822, __p3_822) __extension__ ({ \67773#define vqrdmlahs_laneq_s32(__p0_914, __p1_914, __p2_914, __p3_914) __extension__ ({ \
66104 int32_t __s0_822 = __p0_822; \67774 int32_t __s0_914 = __p0_914; \
66105 int32_t __s1_822 = __p1_822; \67775 int32_t __s1_914 = __p1_914; \
66106 int32x4_t __s2_822 = __p2_822; \67776 int32x4_t __s2_914 = __p2_914; \
66107 int32x4_t __rev2_822; __rev2_822 = __builtin_shufflevector(__s2_822, __s2_822, 3, 2, 1, 0); \67777 int32x4_t __rev2_914; __rev2_914 = __builtin_shufflevector(__s2_914, __s2_914, 3, 2, 1, 0); \
66108 int32_t __ret_822; \67778 int32_t __ret_914; \
66109 __ret_822 = vqadds_s32(__s0_822, vqrdmulhs_s32(__s1_822, __noswap_vgetq_lane_s32(__rev2_822, __p3_822))); \67779 __ret_914 = vqadds_s32(__s0_914, vqrdmulhs_s32(__s1_914, __noswap_vgetq_lane_s32(__rev2_914, __p3_914))); \
66110 __ret_822; \67780 __ret_914; \
66111})67781})
66112#endif67782#endif
6611367783
66114#ifdef __LITTLE_ENDIAN__67784#ifdef __LITTLE_ENDIAN__
66115#define vqrdmlahh_laneq_s16(__p0_823, __p1_823, __p2_823, __p3_823) __extension__ ({ \67785#define vqrdmlahh_laneq_s16(__p0_915, __p1_915, __p2_915, __p3_915) __extension__ ({ \
66116 int16_t __s0_823 = __p0_823; \67786 int16_t __s0_915 = __p0_915; \
66117 int16_t __s1_823 = __p1_823; \67787 int16_t __s1_915 = __p1_915; \
66118 int16x8_t __s2_823 = __p2_823; \67788 int16x8_t __s2_915 = __p2_915; \
66119 int16_t __ret_823; \67789 int16_t __ret_915; \
66120 __ret_823 = vqaddh_s16(__s0_823, vqrdmulhh_s16(__s1_823, vgetq_lane_s16(__s2_823, __p3_823))); \67790 __ret_915 = vqaddh_s16(__s0_915, vqrdmulhh_s16(__s1_915, vgetq_lane_s16(__s2_915, __p3_915))); \
66121 __ret_823; \67791 __ret_915; \
66122})67792})
66123#else67793#else
66124#define vqrdmlahh_laneq_s16(__p0_824, __p1_824, __p2_824, __p3_824) __extension__ ({ \67794#define vqrdmlahh_laneq_s16(__p0_916, __p1_916, __p2_916, __p3_916) __extension__ ({ \
66125 int16_t __s0_824 = __p0_824; \67795 int16_t __s0_916 = __p0_916; \
66126 int16_t __s1_824 = __p1_824; \67796 int16_t __s1_916 = __p1_916; \
66127 int16x8_t __s2_824 = __p2_824; \67797 int16x8_t __s2_916 = __p2_916; \
66128 int16x8_t __rev2_824; __rev2_824 = __builtin_shufflevector(__s2_824, __s2_824, 7, 6, 5, 4, 3, 2, 1, 0); \67798 int16x8_t __rev2_916; __rev2_916 = __builtin_shufflevector(__s2_916, __s2_916, 7, 6, 5, 4, 3, 2, 1, 0); \
66129 int16_t __ret_824; \67799 int16_t __ret_916; \
66130 __ret_824 = vqaddh_s16(__s0_824, vqrdmulhh_s16(__s1_824, __noswap_vgetq_lane_s16(__rev2_824, __p3_824))); \67800 __ret_916 = vqaddh_s16(__s0_916, vqrdmulhh_s16(__s1_916, __noswap_vgetq_lane_s16(__rev2_916, __p3_916))); \
66131 __ret_824; \67801 __ret_916; \
66132})67802})
66133#endif67803#endif
6613467804
...@@ -66143,86 +67813,86 @@ __ai int16_t vqrdmlshh_s16(int16_t __p0, int16_t __p1, int16_t __p2) {...@@ -66143,86 +67813,86 @@ __ai int16_t vqrdmlshh_s16(int16_t __p0, int16_t __p1, int16_t __p2) {
66143 return __ret;67813 return __ret;
66144}67814}
66145#ifdef __LITTLE_ENDIAN__67815#ifdef __LITTLE_ENDIAN__
66146#define vqrdmlshs_lane_s32(__p0_825, __p1_825, __p2_825, __p3_825) __extension__ ({ \67816#define vqrdmlshs_lane_s32(__p0_917, __p1_917, __p2_917, __p3_917) __extension__ ({ \
66147 int32_t __s0_825 = __p0_825; \67817 int32_t __s0_917 = __p0_917; \
66148 int32_t __s1_825 = __p1_825; \67818 int32_t __s1_917 = __p1_917; \
66149 int32x2_t __s2_825 = __p2_825; \67819 int32x2_t __s2_917 = __p2_917; \
66150 int32_t __ret_825; \67820 int32_t __ret_917; \
66151 __ret_825 = vqsubs_s32(__s0_825, vqrdmulhs_s32(__s1_825, vget_lane_s32(__s2_825, __p3_825))); \67821 __ret_917 = vqsubs_s32(__s0_917, vqrdmulhs_s32(__s1_917, vget_lane_s32(__s2_917, __p3_917))); \
66152 __ret_825; \67822 __ret_917; \
66153})67823})
66154#else67824#else
66155#define vqrdmlshs_lane_s32(__p0_826, __p1_826, __p2_826, __p3_826) __extension__ ({ \67825#define vqrdmlshs_lane_s32(__p0_918, __p1_918, __p2_918, __p3_918) __extension__ ({ \
66156 int32_t __s0_826 = __p0_826; \67826 int32_t __s0_918 = __p0_918; \
66157 int32_t __s1_826 = __p1_826; \67827 int32_t __s1_918 = __p1_918; \
66158 int32x2_t __s2_826 = __p2_826; \67828 int32x2_t __s2_918 = __p2_918; \
66159 int32x2_t __rev2_826; __rev2_826 = __builtin_shufflevector(__s2_826, __s2_826, 1, 0); \67829 int32x2_t __rev2_918; __rev2_918 = __builtin_shufflevector(__s2_918, __s2_918, 1, 0); \
66160 int32_t __ret_826; \67830 int32_t __ret_918; \
66161 __ret_826 = vqsubs_s32(__s0_826, vqrdmulhs_s32(__s1_826, __noswap_vget_lane_s32(__rev2_826, __p3_826))); \67831 __ret_918 = vqsubs_s32(__s0_918, vqrdmulhs_s32(__s1_918, __noswap_vget_lane_s32(__rev2_918, __p3_918))); \
66162 __ret_826; \67832 __ret_918; \
66163})67833})
66164#endif67834#endif
6616567835
66166#ifdef __LITTLE_ENDIAN__67836#ifdef __LITTLE_ENDIAN__
66167#define vqrdmlshh_lane_s16(__p0_827, __p1_827, __p2_827, __p3_827) __extension__ ({ \67837#define vqrdmlshh_lane_s16(__p0_919, __p1_919, __p2_919, __p3_919) __extension__ ({ \
66168 int16_t __s0_827 = __p0_827; \67838 int16_t __s0_919 = __p0_919; \
66169 int16_t __s1_827 = __p1_827; \67839 int16_t __s1_919 = __p1_919; \
66170 int16x4_t __s2_827 = __p2_827; \67840 int16x4_t __s2_919 = __p2_919; \
66171 int16_t __ret_827; \67841 int16_t __ret_919; \
66172 __ret_827 = vqsubh_s16(__s0_827, vqrdmulhh_s16(__s1_827, vget_lane_s16(__s2_827, __p3_827))); \67842 __ret_919 = vqsubh_s16(__s0_919, vqrdmulhh_s16(__s1_919, vget_lane_s16(__s2_919, __p3_919))); \
66173 __ret_827; \67843 __ret_919; \
66174})67844})
66175#else67845#else
66176#define vqrdmlshh_lane_s16(__p0_828, __p1_828, __p2_828, __p3_828) __extension__ ({ \67846#define vqrdmlshh_lane_s16(__p0_920, __p1_920, __p2_920, __p3_920) __extension__ ({ \
66177 int16_t __s0_828 = __p0_828; \67847 int16_t __s0_920 = __p0_920; \
66178 int16_t __s1_828 = __p1_828; \67848 int16_t __s1_920 = __p1_920; \
66179 int16x4_t __s2_828 = __p2_828; \67849 int16x4_t __s2_920 = __p2_920; \
66180 int16x4_t __rev2_828; __rev2_828 = __builtin_shufflevector(__s2_828, __s2_828, 3, 2, 1, 0); \67850 int16x4_t __rev2_920; __rev2_920 = __builtin_shufflevector(__s2_920, __s2_920, 3, 2, 1, 0); \
66181 int16_t __ret_828; \67851 int16_t __ret_920; \
66182 __ret_828 = vqsubh_s16(__s0_828, vqrdmulhh_s16(__s1_828, __noswap_vget_lane_s16(__rev2_828, __p3_828))); \67852 __ret_920 = vqsubh_s16(__s0_920, vqrdmulhh_s16(__s1_920, __noswap_vget_lane_s16(__rev2_920, __p3_920))); \
66183 __ret_828; \67853 __ret_920; \
66184})67854})
66185#endif67855#endif
6618667856
66187#ifdef __LITTLE_ENDIAN__67857#ifdef __LITTLE_ENDIAN__
66188#define vqrdmlshs_laneq_s32(__p0_829, __p1_829, __p2_829, __p3_829) __extension__ ({ \67858#define vqrdmlshs_laneq_s32(__p0_921, __p1_921, __p2_921, __p3_921) __extension__ ({ \
66189 int32_t __s0_829 = __p0_829; \67859 int32_t __s0_921 = __p0_921; \
66190 int32_t __s1_829 = __p1_829; \67860 int32_t __s1_921 = __p1_921; \
66191 int32x4_t __s2_829 = __p2_829; \67861 int32x4_t __s2_921 = __p2_921; \
66192 int32_t __ret_829; \67862 int32_t __ret_921; \
66193 __ret_829 = vqsubs_s32(__s0_829, vqrdmulhs_s32(__s1_829, vgetq_lane_s32(__s2_829, __p3_829))); \67863 __ret_921 = vqsubs_s32(__s0_921, vqrdmulhs_s32(__s1_921, vgetq_lane_s32(__s2_921, __p3_921))); \
66194 __ret_829; \67864 __ret_921; \
66195})67865})
66196#else67866#else
66197#define vqrdmlshs_laneq_s32(__p0_830, __p1_830, __p2_830, __p3_830) __extension__ ({ \67867#define vqrdmlshs_laneq_s32(__p0_922, __p1_922, __p2_922, __p3_922) __extension__ ({ \
66198 int32_t __s0_830 = __p0_830; \67868 int32_t __s0_922 = __p0_922; \
66199 int32_t __s1_830 = __p1_830; \67869 int32_t __s1_922 = __p1_922; \
66200 int32x4_t __s2_830 = __p2_830; \67870 int32x4_t __s2_922 = __p2_922; \
66201 int32x4_t __rev2_830; __rev2_830 = __builtin_shufflevector(__s2_830, __s2_830, 3, 2, 1, 0); \67871 int32x4_t __rev2_922; __rev2_922 = __builtin_shufflevector(__s2_922, __s2_922, 3, 2, 1, 0); \
66202 int32_t __ret_830; \67872 int32_t __ret_922; \
66203 __ret_830 = vqsubs_s32(__s0_830, vqrdmulhs_s32(__s1_830, __noswap_vgetq_lane_s32(__rev2_830, __p3_830))); \67873 __ret_922 = vqsubs_s32(__s0_922, vqrdmulhs_s32(__s1_922, __noswap_vgetq_lane_s32(__rev2_922, __p3_922))); \
66204 __ret_830; \67874 __ret_922; \
66205})67875})
66206#endif67876#endif
6620767877
66208#ifdef __LITTLE_ENDIAN__67878#ifdef __LITTLE_ENDIAN__
66209#define vqrdmlshh_laneq_s16(__p0_831, __p1_831, __p2_831, __p3_831) __extension__ ({ \67879#define vqrdmlshh_laneq_s16(__p0_923, __p1_923, __p2_923, __p3_923) __extension__ ({ \
66210 int16_t __s0_831 = __p0_831; \67880 int16_t __s0_923 = __p0_923; \
66211 int16_t __s1_831 = __p1_831; \67881 int16_t __s1_923 = __p1_923; \
66212 int16x8_t __s2_831 = __p2_831; \67882 int16x8_t __s2_923 = __p2_923; \
66213 int16_t __ret_831; \67883 int16_t __ret_923; \
66214 __ret_831 = vqsubh_s16(__s0_831, vqrdmulhh_s16(__s1_831, vgetq_lane_s16(__s2_831, __p3_831))); \67884 __ret_923 = vqsubh_s16(__s0_923, vqrdmulhh_s16(__s1_923, vgetq_lane_s16(__s2_923, __p3_923))); \
66215 __ret_831; \67885 __ret_923; \
66216})67886})
66217#else67887#else
66218#define vqrdmlshh_laneq_s16(__p0_832, __p1_832, __p2_832, __p3_832) __extension__ ({ \67888#define vqrdmlshh_laneq_s16(__p0_924, __p1_924, __p2_924, __p3_924) __extension__ ({ \
66219 int16_t __s0_832 = __p0_832; \67889 int16_t __s0_924 = __p0_924; \
66220 int16_t __s1_832 = __p1_832; \67890 int16_t __s1_924 = __p1_924; \
66221 int16x8_t __s2_832 = __p2_832; \67891 int16x8_t __s2_924 = __p2_924; \
66222 int16x8_t __rev2_832; __rev2_832 = __builtin_shufflevector(__s2_832, __s2_832, 7, 6, 5, 4, 3, 2, 1, 0); \67892 int16x8_t __rev2_924; __rev2_924 = __builtin_shufflevector(__s2_924, __s2_924, 7, 6, 5, 4, 3, 2, 1, 0); \
66223 int16_t __ret_832; \67893 int16_t __ret_924; \
66224 __ret_832 = vqsubh_s16(__s0_832, vqrdmulhh_s16(__s1_832, __noswap_vgetq_lane_s16(__rev2_832, __p3_832))); \67894 __ret_924 = vqsubh_s16(__s0_924, vqrdmulhh_s16(__s1_924, __noswap_vgetq_lane_s16(__rev2_924, __p3_924))); \
66225 __ret_832; \67895 __ret_924; \
66226})67896})
66227#endif67897#endif
6622867898
...@@ -66535,136 +68205,136 @@ __ai int32x4_t vaddw_high_s16(int32x4_t __p0, int16x8_t __p1) {...@@ -66535,136 +68205,136 @@ __ai int32x4_t vaddw_high_s16(int32x4_t __p0, int16x8_t __p1) {
66535#endif68205#endif
6653668206
66537#ifdef __LITTLE_ENDIAN__68207#ifdef __LITTLE_ENDIAN__
66538#define vcopyq_lane_p64(__p0_833, __p1_833, __p2_833, __p3_833) __extension__ ({ \68208#define vcopyq_lane_p64(__p0_925, __p1_925, __p2_925, __p3_925) __extension__ ({ \
66539 poly64x2_t __s0_833 = __p0_833; \68209 poly64x2_t __s0_925 = __p0_925; \
66540 poly64x1_t __s2_833 = __p2_833; \68210 poly64x1_t __s2_925 = __p2_925; \
66541 poly64x2_t __ret_833; \68211 poly64x2_t __ret_925; \
66542 __ret_833 = vsetq_lane_p64(vget_lane_p64(__s2_833, __p3_833), __s0_833, __p1_833); \68212 __ret_925 = vsetq_lane_p64(vget_lane_p64(__s2_925, __p3_925), __s0_925, __p1_925); \
66543 __ret_833; \68213 __ret_925; \
66544})68214})
66545#else68215#else
66546#define vcopyq_lane_p64(__p0_834, __p1_834, __p2_834, __p3_834) __extension__ ({ \68216#define vcopyq_lane_p64(__p0_926, __p1_926, __p2_926, __p3_926) __extension__ ({ \
66547 poly64x2_t __s0_834 = __p0_834; \68217 poly64x2_t __s0_926 = __p0_926; \
66548 poly64x1_t __s2_834 = __p2_834; \68218 poly64x1_t __s2_926 = __p2_926; \
66549 poly64x2_t __rev0_834; __rev0_834 = __builtin_shufflevector(__s0_834, __s0_834, 1, 0); \68219 poly64x2_t __rev0_926; __rev0_926 = __builtin_shufflevector(__s0_926, __s0_926, 1, 0); \
66550 poly64x2_t __ret_834; \68220 poly64x2_t __ret_926; \
66551 __ret_834 = __noswap_vsetq_lane_p64(vget_lane_p64(__s2_834, __p3_834), __rev0_834, __p1_834); \68221 __ret_926 = __noswap_vsetq_lane_p64(vget_lane_p64(__s2_926, __p3_926), __rev0_926, __p1_926); \
66552 __ret_834 = __builtin_shufflevector(__ret_834, __ret_834, 1, 0); \68222 __ret_926 = __builtin_shufflevector(__ret_926, __ret_926, 1, 0); \
66553 __ret_834; \68223 __ret_926; \
66554})68224})
66555#endif68225#endif
6655668226
66557#ifdef __LITTLE_ENDIAN__68227#ifdef __LITTLE_ENDIAN__
66558#define vcopyq_lane_f64(__p0_835, __p1_835, __p2_835, __p3_835) __extension__ ({ \68228#define vcopyq_lane_f64(__p0_927, __p1_927, __p2_927, __p3_927) __extension__ ({ \
66559 float64x2_t __s0_835 = __p0_835; \68229 float64x2_t __s0_927 = __p0_927; \
66560 float64x1_t __s2_835 = __p2_835; \68230 float64x1_t __s2_927 = __p2_927; \
66561 float64x2_t __ret_835; \68231 float64x2_t __ret_927; \
66562 __ret_835 = vsetq_lane_f64(vget_lane_f64(__s2_835, __p3_835), __s0_835, __p1_835); \68232 __ret_927 = vsetq_lane_f64(vget_lane_f64(__s2_927, __p3_927), __s0_927, __p1_927); \
66563 __ret_835; \68233 __ret_927; \
66564})68234})
66565#else68235#else
66566#define vcopyq_lane_f64(__p0_836, __p1_836, __p2_836, __p3_836) __extension__ ({ \68236#define vcopyq_lane_f64(__p0_928, __p1_928, __p2_928, __p3_928) __extension__ ({ \
66567 float64x2_t __s0_836 = __p0_836; \68237 float64x2_t __s0_928 = __p0_928; \
66568 float64x1_t __s2_836 = __p2_836; \68238 float64x1_t __s2_928 = __p2_928; \
66569 float64x2_t __rev0_836; __rev0_836 = __builtin_shufflevector(__s0_836, __s0_836, 1, 0); \68239 float64x2_t __rev0_928; __rev0_928 = __builtin_shufflevector(__s0_928, __s0_928, 1, 0); \
66570 float64x2_t __ret_836; \68240 float64x2_t __ret_928; \
66571 __ret_836 = __noswap_vsetq_lane_f64(vget_lane_f64(__s2_836, __p3_836), __rev0_836, __p1_836); \68241 __ret_928 = __noswap_vsetq_lane_f64(vget_lane_f64(__s2_928, __p3_928), __rev0_928, __p1_928); \
66572 __ret_836 = __builtin_shufflevector(__ret_836, __ret_836, 1, 0); \68242 __ret_928 = __builtin_shufflevector(__ret_928, __ret_928, 1, 0); \
66573 __ret_836; \68243 __ret_928; \
66574})68244})
66575#endif68245#endif
6657668246
66577#define vcopy_lane_p64(__p0_837, __p1_837, __p2_837, __p3_837) __extension__ ({ \68247#define vcopy_lane_p64(__p0_929, __p1_929, __p2_929, __p3_929) __extension__ ({ \
66578 poly64x1_t __s0_837 = __p0_837; \68248 poly64x1_t __s0_929 = __p0_929; \
66579 poly64x1_t __s2_837 = __p2_837; \68249 poly64x1_t __s2_929 = __p2_929; \
66580 poly64x1_t __ret_837; \68250 poly64x1_t __ret_929; \
66581 __ret_837 = vset_lane_p64(vget_lane_p64(__s2_837, __p3_837), __s0_837, __p1_837); \68251 __ret_929 = vset_lane_p64(vget_lane_p64(__s2_929, __p3_929), __s0_929, __p1_929); \
66582 __ret_837; \68252 __ret_929; \
66583})68253})
66584#define vcopy_lane_f64(__p0_838, __p1_838, __p2_838, __p3_838) __extension__ ({ \68254#define vcopy_lane_f64(__p0_930, __p1_930, __p2_930, __p3_930) __extension__ ({ \
66585 float64x1_t __s0_838 = __p0_838; \68255 float64x1_t __s0_930 = __p0_930; \
66586 float64x1_t __s2_838 = __p2_838; \68256 float64x1_t __s2_930 = __p2_930; \
66587 float64x1_t __ret_838; \68257 float64x1_t __ret_930; \
66588 __ret_838 = vset_lane_f64(vget_lane_f64(__s2_838, __p3_838), __s0_838, __p1_838); \68258 __ret_930 = vset_lane_f64(vget_lane_f64(__s2_930, __p3_930), __s0_930, __p1_930); \
66589 __ret_838; \68259 __ret_930; \
66590})68260})
66591#ifdef __LITTLE_ENDIAN__68261#ifdef __LITTLE_ENDIAN__
66592#define vcopyq_laneq_p64(__p0_839, __p1_839, __p2_839, __p3_839) __extension__ ({ \68262#define vcopyq_laneq_p64(__p0_931, __p1_931, __p2_931, __p3_931) __extension__ ({ \
66593 poly64x2_t __s0_839 = __p0_839; \68263 poly64x2_t __s0_931 = __p0_931; \
66594 poly64x2_t __s2_839 = __p2_839; \68264 poly64x2_t __s2_931 = __p2_931; \
66595 poly64x2_t __ret_839; \68265 poly64x2_t __ret_931; \
66596 __ret_839 = vsetq_lane_p64(vgetq_lane_p64(__s2_839, __p3_839), __s0_839, __p1_839); \68266 __ret_931 = vsetq_lane_p64(vgetq_lane_p64(__s2_931, __p3_931), __s0_931, __p1_931); \
66597 __ret_839; \68267 __ret_931; \
66598})68268})
66599#else68269#else
66600#define vcopyq_laneq_p64(__p0_840, __p1_840, __p2_840, __p3_840) __extension__ ({ \68270#define vcopyq_laneq_p64(__p0_932, __p1_932, __p2_932, __p3_932) __extension__ ({ \
66601 poly64x2_t __s0_840 = __p0_840; \68271 poly64x2_t __s0_932 = __p0_932; \
66602 poly64x2_t __s2_840 = __p2_840; \68272 poly64x2_t __s2_932 = __p2_932; \
66603 poly64x2_t __rev0_840; __rev0_840 = __builtin_shufflevector(__s0_840, __s0_840, 1, 0); \68273 poly64x2_t __rev0_932; __rev0_932 = __builtin_shufflevector(__s0_932, __s0_932, 1, 0); \
66604 poly64x2_t __rev2_840; __rev2_840 = __builtin_shufflevector(__s2_840, __s2_840, 1, 0); \68274 poly64x2_t __rev2_932; __rev2_932 = __builtin_shufflevector(__s2_932, __s2_932, 1, 0); \
66605 poly64x2_t __ret_840; \68275 poly64x2_t __ret_932; \
66606 __ret_840 = __noswap_vsetq_lane_p64(__noswap_vgetq_lane_p64(__rev2_840, __p3_840), __rev0_840, __p1_840); \68276 __ret_932 = __noswap_vsetq_lane_p64(__noswap_vgetq_lane_p64(__rev2_932, __p3_932), __rev0_932, __p1_932); \
66607 __ret_840 = __builtin_shufflevector(__ret_840, __ret_840, 1, 0); \68277 __ret_932 = __builtin_shufflevector(__ret_932, __ret_932, 1, 0); \
66608 __ret_840; \68278 __ret_932; \
66609})68279})
66610#endif68280#endif
6661168281
66612#ifdef __LITTLE_ENDIAN__68282#ifdef __LITTLE_ENDIAN__
66613#define vcopyq_laneq_f64(__p0_841, __p1_841, __p2_841, __p3_841) __extension__ ({ \68283#define vcopyq_laneq_f64(__p0_933, __p1_933, __p2_933, __p3_933) __extension__ ({ \
66614 float64x2_t __s0_841 = __p0_841; \68284 float64x2_t __s0_933 = __p0_933; \
66615 float64x2_t __s2_841 = __p2_841; \68285 float64x2_t __s2_933 = __p2_933; \
66616 float64x2_t __ret_841; \68286 float64x2_t __ret_933; \
66617 __ret_841 = vsetq_lane_f64(vgetq_lane_f64(__s2_841, __p3_841), __s0_841, __p1_841); \68287 __ret_933 = vsetq_lane_f64(vgetq_lane_f64(__s2_933, __p3_933), __s0_933, __p1_933); \
66618 __ret_841; \68288 __ret_933; \
66619})68289})
66620#else68290#else
66621#define vcopyq_laneq_f64(__p0_842, __p1_842, __p2_842, __p3_842) __extension__ ({ \68291#define vcopyq_laneq_f64(__p0_934, __p1_934, __p2_934, __p3_934) __extension__ ({ \
66622 float64x2_t __s0_842 = __p0_842; \68292 float64x2_t __s0_934 = __p0_934; \
66623 float64x2_t __s2_842 = __p2_842; \68293 float64x2_t __s2_934 = __p2_934; \
66624 float64x2_t __rev0_842; __rev0_842 = __builtin_shufflevector(__s0_842, __s0_842, 1, 0); \68294 float64x2_t __rev0_934; __rev0_934 = __builtin_shufflevector(__s0_934, __s0_934, 1, 0); \
66625 float64x2_t __rev2_842; __rev2_842 = __builtin_shufflevector(__s2_842, __s2_842, 1, 0); \68295 float64x2_t __rev2_934; __rev2_934 = __builtin_shufflevector(__s2_934, __s2_934, 1, 0); \
66626 float64x2_t __ret_842; \68296 float64x2_t __ret_934; \
66627 __ret_842 = __noswap_vsetq_lane_f64(__noswap_vgetq_lane_f64(__rev2_842, __p3_842), __rev0_842, __p1_842); \68297 __ret_934 = __noswap_vsetq_lane_f64(__noswap_vgetq_lane_f64(__rev2_934, __p3_934), __rev0_934, __p1_934); \
66628 __ret_842 = __builtin_shufflevector(__ret_842, __ret_842, 1, 0); \68298 __ret_934 = __builtin_shufflevector(__ret_934, __ret_934, 1, 0); \
66629 __ret_842; \68299 __ret_934; \
66630})68300})
66631#endif68301#endif
6663268302
66633#ifdef __LITTLE_ENDIAN__68303#ifdef __LITTLE_ENDIAN__
66634#define vcopy_laneq_p64(__p0_843, __p1_843, __p2_843, __p3_843) __extension__ ({ \68304#define vcopy_laneq_p64(__p0_935, __p1_935, __p2_935, __p3_935) __extension__ ({ \
66635 poly64x1_t __s0_843 = __p0_843; \68305 poly64x1_t __s0_935 = __p0_935; \
66636 poly64x2_t __s2_843 = __p2_843; \68306 poly64x2_t __s2_935 = __p2_935; \
66637 poly64x1_t __ret_843; \68307 poly64x1_t __ret_935; \
66638 __ret_843 = vset_lane_p64(vgetq_lane_p64(__s2_843, __p3_843), __s0_843, __p1_843); \68308 __ret_935 = vset_lane_p64(vgetq_lane_p64(__s2_935, __p3_935), __s0_935, __p1_935); \
66639 __ret_843; \68309 __ret_935; \
66640})68310})
66641#else68311#else
66642#define vcopy_laneq_p64(__p0_844, __p1_844, __p2_844, __p3_844) __extension__ ({ \68312#define vcopy_laneq_p64(__p0_936, __p1_936, __p2_936, __p3_936) __extension__ ({ \
66643 poly64x1_t __s0_844 = __p0_844; \68313 poly64x1_t __s0_936 = __p0_936; \
66644 poly64x2_t __s2_844 = __p2_844; \68314 poly64x2_t __s2_936 = __p2_936; \
66645 poly64x2_t __rev2_844; __rev2_844 = __builtin_shufflevector(__s2_844, __s2_844, 1, 0); \68315 poly64x2_t __rev2_936; __rev2_936 = __builtin_shufflevector(__s2_936, __s2_936, 1, 0); \
66646 poly64x1_t __ret_844; \68316 poly64x1_t __ret_936; \
66647 __ret_844 = vset_lane_p64(__noswap_vgetq_lane_p64(__rev2_844, __p3_844), __s0_844, __p1_844); \68317 __ret_936 = vset_lane_p64(__noswap_vgetq_lane_p64(__rev2_936, __p3_936), __s0_936, __p1_936); \
66648 __ret_844; \68318 __ret_936; \
66649})68319})
66650#endif68320#endif
6665168321
66652#ifdef __LITTLE_ENDIAN__68322#ifdef __LITTLE_ENDIAN__
66653#define vcopy_laneq_f64(__p0_845, __p1_845, __p2_845, __p3_845) __extension__ ({ \68323#define vcopy_laneq_f64(__p0_937, __p1_937, __p2_937, __p3_937) __extension__ ({ \
66654 float64x1_t __s0_845 = __p0_845; \68324 float64x1_t __s0_937 = __p0_937; \
66655 float64x2_t __s2_845 = __p2_845; \68325 float64x2_t __s2_937 = __p2_937; \
66656 float64x1_t __ret_845; \68326 float64x1_t __ret_937; \
66657 __ret_845 = vset_lane_f64(vgetq_lane_f64(__s2_845, __p3_845), __s0_845, __p1_845); \68327 __ret_937 = vset_lane_f64(vgetq_lane_f64(__s2_937, __p3_937), __s0_937, __p1_937); \
66658 __ret_845; \68328 __ret_937; \
66659})68329})
66660#else68330#else
66661#define vcopy_laneq_f64(__p0_846, __p1_846, __p2_846, __p3_846) __extension__ ({ \68331#define vcopy_laneq_f64(__p0_938, __p1_938, __p2_938, __p3_938) __extension__ ({ \
66662 float64x1_t __s0_846 = __p0_846; \68332 float64x1_t __s0_938 = __p0_938; \
66663 float64x2_t __s2_846 = __p2_846; \68333 float64x2_t __s2_938 = __p2_938; \
66664 float64x2_t __rev2_846; __rev2_846 = __builtin_shufflevector(__s2_846, __s2_846, 1, 0); \68334 float64x2_t __rev2_938; __rev2_938 = __builtin_shufflevector(__s2_938, __s2_938, 1, 0); \
66665 float64x1_t __ret_846; \68335 float64x1_t __ret_938; \
66666 __ret_846 = vset_lane_f64(__noswap_vgetq_lane_f64(__rev2_846, __p3_846), __s0_846, __p1_846); \68336 __ret_938 = vset_lane_f64(__noswap_vgetq_lane_f64(__rev2_938, __p3_938), __s0_938, __p1_938); \
66667 __ret_846; \68337 __ret_938; \
66668})68338})
66669#endif68339#endif
6667068340
...@@ -67020,38 +68690,38 @@ __ai int32x4_t vmlsl_high_n_s16(int32x4_t __p0, int16x8_t __p1, int16_t __p2) {...@@ -67020,38 +68690,38 @@ __ai int32x4_t vmlsl_high_n_s16(int32x4_t __p0, int16x8_t __p1, int16_t __p2) {
67020}68690}
67021#endif68691#endif
6702268692
67023#define vmulx_lane_f64(__p0_847, __p1_847, __p2_847) __extension__ ({ \68693#define vmulx_lane_f64(__p0_939, __p1_939, __p2_939) __extension__ ({ \
67024 float64x1_t __s0_847 = __p0_847; \68694 float64x1_t __s0_939 = __p0_939; \
67025 float64x1_t __s1_847 = __p1_847; \68695 float64x1_t __s1_939 = __p1_939; \
67026 float64x1_t __ret_847; \68696 float64x1_t __ret_939; \
67027 float64_t __x_847 = vget_lane_f64(__s0_847, 0); \68697 float64_t __x_939 = vget_lane_f64(__s0_939, 0); \
67028 float64_t __y_847 = vget_lane_f64(__s1_847, __p2_847); \68698 float64_t __y_939 = vget_lane_f64(__s1_939, __p2_939); \
67029 float64_t __z_847 = vmulxd_f64(__x_847, __y_847); \68699 float64_t __z_939 = vmulxd_f64(__x_939, __y_939); \
67030 __ret_847 = vset_lane_f64(__z_847, __s0_847, __p2_847); \68700 __ret_939 = vset_lane_f64(__z_939, __s0_939, __p2_939); \
67031 __ret_847; \68701 __ret_939; \
67032})68702})
67033#ifdef __LITTLE_ENDIAN__68703#ifdef __LITTLE_ENDIAN__
67034#define vmulx_laneq_f64(__p0_848, __p1_848, __p2_848) __extension__ ({ \68704#define vmulx_laneq_f64(__p0_940, __p1_940, __p2_940) __extension__ ({ \
67035 float64x1_t __s0_848 = __p0_848; \68705 float64x1_t __s0_940 = __p0_940; \
67036 float64x2_t __s1_848 = __p1_848; \68706 float64x2_t __s1_940 = __p1_940; \
67037 float64x1_t __ret_848; \68707 float64x1_t __ret_940; \
67038 float64_t __x_848 = vget_lane_f64(__s0_848, 0); \68708 float64_t __x_940 = vget_lane_f64(__s0_940, 0); \
67039 float64_t __y_848 = vgetq_lane_f64(__s1_848, __p2_848); \68709 float64_t __y_940 = vgetq_lane_f64(__s1_940, __p2_940); \
67040 float64_t __z_848 = vmulxd_f64(__x_848, __y_848); \68710 float64_t __z_940 = vmulxd_f64(__x_940, __y_940); \
67041 __ret_848 = vset_lane_f64(__z_848, __s0_848, 0); \68711 __ret_940 = vset_lane_f64(__z_940, __s0_940, 0); \
67042 __ret_848; \68712 __ret_940; \
67043})68713})
67044#else68714#else
67045#define vmulx_laneq_f64(__p0_849, __p1_849, __p2_849) __extension__ ({ \68715#define vmulx_laneq_f64(__p0_941, __p1_941, __p2_941) __extension__ ({ \
67046 float64x1_t __s0_849 = __p0_849; \68716 float64x1_t __s0_941 = __p0_941; \
67047 float64x2_t __s1_849 = __p1_849; \68717 float64x2_t __s1_941 = __p1_941; \
67048 float64x2_t __rev1_849; __rev1_849 = __builtin_shufflevector(__s1_849, __s1_849, 1, 0); \68718 float64x2_t __rev1_941; __rev1_941 = __builtin_shufflevector(__s1_941, __s1_941, 1, 0); \
67049 float64x1_t __ret_849; \68719 float64x1_t __ret_941; \
67050 float64_t __x_849 = vget_lane_f64(__s0_849, 0); \68720 float64_t __x_941 = vget_lane_f64(__s0_941, 0); \
67051 float64_t __y_849 = __noswap_vgetq_lane_f64(__rev1_849, __p2_849); \68721 float64_t __y_941 = __noswap_vgetq_lane_f64(__rev1_941, __p2_941); \
67052 float64_t __z_849 = vmulxd_f64(__x_849, __y_849); \68722 float64_t __z_941 = vmulxd_f64(__x_941, __y_941); \
67053 __ret_849 = vset_lane_f64(__z_849, __s0_849, 0); \68723 __ret_941 = vset_lane_f64(__z_941, __s0_941, 0); \
67054 __ret_849; \68724 __ret_941; \
67055})68725})
67056#endif68726#endif
6705768727
lib/include/arm_sve.h+80-80
...@@ -94,7 +94,7 @@ typedef __clang_svbfloat16x2_t svbfloat16x2_t;...@@ -94,7 +94,7 @@ typedef __clang_svbfloat16x2_t svbfloat16x2_t;
94typedef __clang_svbfloat16x3_t svbfloat16x3_t;94typedef __clang_svbfloat16x3_t svbfloat16x3_t;
95typedef __clang_svbfloat16x4_t svbfloat16x4_t;95typedef __clang_svbfloat16x4_t svbfloat16x4_t;
96#endif96#endif
97typedef enum97enum svpattern
98{98{
99 SV_POW2 = 0,99 SV_POW2 = 0,
100 SV_VL1 = 1,100 SV_VL1 = 1,
...@@ -113,9 +113,9 @@ typedef enum...@@ -113,9 +113,9 @@ typedef enum
113 SV_MUL4 = 29,113 SV_MUL4 = 29,
114 SV_MUL3 = 30,114 SV_MUL3 = 30,
115 SV_ALL = 31115 SV_ALL = 31
116} sv_pattern;116};
117117
118typedef enum118enum svprfop
119{119{
120 SV_PLDL1KEEP = 0,120 SV_PLDL1KEEP = 0,
121 SV_PLDL1STRM = 1,121 SV_PLDL1STRM = 1,
...@@ -129,7 +129,7 @@ typedef enum...@@ -129,7 +129,7 @@ typedef enum
129 SV_PSTL2STRM = 11,129 SV_PSTL2STRM = 11,
130 SV_PSTL3KEEP = 12,130 SV_PSTL3KEEP = 12,
131 SV_PSTL3STRM = 13131 SV_PSTL3STRM = 13
132} sv_prfop;132};
133133
134/* Function attributes */134/* Function attributes */
135#define __aio static inline __attribute__((__always_inline__, __nodebug__, __overloadable__))135#define __aio static inline __attribute__((__always_inline__, __nodebug__, __overloadable__))
...@@ -10013,69 +10013,69 @@ int16_t svorv(svbool_t, svint16_t);...@@ -10013,69 +10013,69 @@ int16_t svorv(svbool_t, svint16_t);
10013__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpfirst_b)))10013__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpfirst_b)))
10014svbool_t svpfirst(svbool_t, svbool_t);10014svbool_t svpfirst(svbool_t, svbool_t);
10015__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_u32base)))10015__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_u32base)))
10016void svprfb_gather(svbool_t, svuint32_t, sv_prfop);10016void svprfb_gather(svbool_t, svuint32_t, enum svprfop);
10017__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_u64base)))10017__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_u64base)))
10018void svprfb_gather(svbool_t, svuint64_t, sv_prfop);10018void svprfb_gather(svbool_t, svuint64_t, enum svprfop);
10019__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_u32base_offset)))10019__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_u32base_offset)))
10020void svprfb_gather_offset(svbool_t, svuint32_t, int64_t, sv_prfop);10020void svprfb_gather_offset(svbool_t, svuint32_t, int64_t, enum svprfop);
10021__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_u64base_offset)))10021__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_u64base_offset)))
10022void svprfb_gather_offset(svbool_t, svuint64_t, int64_t, sv_prfop);10022void svprfb_gather_offset(svbool_t, svuint64_t, int64_t, enum svprfop);
10023__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_s32offset)))10023__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_s32offset)))
10024void svprfb_gather_offset(svbool_t, void const *, svint32_t, sv_prfop);10024void svprfb_gather_offset(svbool_t, void const *, svint32_t, enum svprfop);
10025__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_u32offset)))10025__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_u32offset)))
10026void svprfb_gather_offset(svbool_t, void const *, svuint32_t, sv_prfop);10026void svprfb_gather_offset(svbool_t, void const *, svuint32_t, enum svprfop);
10027__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_s64offset)))10027__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_s64offset)))
10028void svprfb_gather_offset(svbool_t, void const *, svint64_t, sv_prfop);10028void svprfb_gather_offset(svbool_t, void const *, svint64_t, enum svprfop);
10029__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_u64offset)))10029__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfb_gather_u64offset)))
10030void svprfb_gather_offset(svbool_t, void const *, svuint64_t, sv_prfop);10030void svprfb_gather_offset(svbool_t, void const *, svuint64_t, enum svprfop);
10031__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_u32base)))10031__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_u32base)))
10032void svprfd_gather(svbool_t, svuint32_t, sv_prfop);10032void svprfd_gather(svbool_t, svuint32_t, enum svprfop);
10033__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_u64base)))10033__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_u64base)))
10034void svprfd_gather(svbool_t, svuint64_t, sv_prfop);10034void svprfd_gather(svbool_t, svuint64_t, enum svprfop);
10035__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_u32base_index)))10035__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_u32base_index)))
10036void svprfd_gather_index(svbool_t, svuint32_t, int64_t, sv_prfop);10036void svprfd_gather_index(svbool_t, svuint32_t, int64_t, enum svprfop);
10037__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_u64base_index)))10037__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_u64base_index)))
10038void svprfd_gather_index(svbool_t, svuint64_t, int64_t, sv_prfop);10038void svprfd_gather_index(svbool_t, svuint64_t, int64_t, enum svprfop);
10039__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_s32index)))10039__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_s32index)))
10040void svprfd_gather_index(svbool_t, void const *, svint32_t, sv_prfop);10040void svprfd_gather_index(svbool_t, void const *, svint32_t, enum svprfop);
10041__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_u32index)))10041__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_u32index)))
10042void svprfd_gather_index(svbool_t, void const *, svuint32_t, sv_prfop);10042void svprfd_gather_index(svbool_t, void const *, svuint32_t, enum svprfop);
10043__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_s64index)))10043__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_s64index)))
10044void svprfd_gather_index(svbool_t, void const *, svint64_t, sv_prfop);10044void svprfd_gather_index(svbool_t, void const *, svint64_t, enum svprfop);
10045__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_u64index)))10045__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfd_gather_u64index)))
10046void svprfd_gather_index(svbool_t, void const *, svuint64_t, sv_prfop);10046void svprfd_gather_index(svbool_t, void const *, svuint64_t, enum svprfop);
10047__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_u32base)))10047__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_u32base)))
10048void svprfh_gather(svbool_t, svuint32_t, sv_prfop);10048void svprfh_gather(svbool_t, svuint32_t, enum svprfop);
10049__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_u64base)))10049__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_u64base)))
10050void svprfh_gather(svbool_t, svuint64_t, sv_prfop);10050void svprfh_gather(svbool_t, svuint64_t, enum svprfop);
10051__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_u32base_index)))10051__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_u32base_index)))
10052void svprfh_gather_index(svbool_t, svuint32_t, int64_t, sv_prfop);10052void svprfh_gather_index(svbool_t, svuint32_t, int64_t, enum svprfop);
10053__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_u64base_index)))10053__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_u64base_index)))
10054void svprfh_gather_index(svbool_t, svuint64_t, int64_t, sv_prfop);10054void svprfh_gather_index(svbool_t, svuint64_t, int64_t, enum svprfop);
10055__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_s32index)))10055__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_s32index)))
10056void svprfh_gather_index(svbool_t, void const *, svint32_t, sv_prfop);10056void svprfh_gather_index(svbool_t, void const *, svint32_t, enum svprfop);
10057__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_u32index)))10057__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_u32index)))
10058void svprfh_gather_index(svbool_t, void const *, svuint32_t, sv_prfop);10058void svprfh_gather_index(svbool_t, void const *, svuint32_t, enum svprfop);
10059__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_s64index)))10059__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_s64index)))
10060void svprfh_gather_index(svbool_t, void const *, svint64_t, sv_prfop);10060void svprfh_gather_index(svbool_t, void const *, svint64_t, enum svprfop);
10061__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_u64index)))10061__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfh_gather_u64index)))
10062void svprfh_gather_index(svbool_t, void const *, svuint64_t, sv_prfop);10062void svprfh_gather_index(svbool_t, void const *, svuint64_t, enum svprfop);
10063__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_u32base)))10063__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_u32base)))
10064void svprfw_gather(svbool_t, svuint32_t, sv_prfop);10064void svprfw_gather(svbool_t, svuint32_t, enum svprfop);
10065__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_u64base)))10065__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_u64base)))
10066void svprfw_gather(svbool_t, svuint64_t, sv_prfop);10066void svprfw_gather(svbool_t, svuint64_t, enum svprfop);
10067__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_u32base_index)))10067__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_u32base_index)))
10068void svprfw_gather_index(svbool_t, svuint32_t, int64_t, sv_prfop);10068void svprfw_gather_index(svbool_t, svuint32_t, int64_t, enum svprfop);
10069__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_u64base_index)))10069__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_u64base_index)))
10070void svprfw_gather_index(svbool_t, svuint64_t, int64_t, sv_prfop);10070void svprfw_gather_index(svbool_t, svuint64_t, int64_t, enum svprfop);
10071__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_s32index)))10071__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_s32index)))
10072void svprfw_gather_index(svbool_t, void const *, svint32_t, sv_prfop);10072void svprfw_gather_index(svbool_t, void const *, svint32_t, enum svprfop);
10073__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_u32index)))10073__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_u32index)))
10074void svprfw_gather_index(svbool_t, void const *, svuint32_t, sv_prfop);10074void svprfw_gather_index(svbool_t, void const *, svuint32_t, enum svprfop);
10075__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_s64index)))10075__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_s64index)))
10076void svprfw_gather_index(svbool_t, void const *, svint64_t, sv_prfop);10076void svprfw_gather_index(svbool_t, void const *, svint64_t, enum svprfop);
10077__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_u64index)))10077__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svprfw_gather_u64index)))
10078void svprfw_gather_index(svbool_t, void const *, svuint64_t, sv_prfop);10078void svprfw_gather_index(svbool_t, void const *, svuint64_t, enum svprfop);
10079__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqadd_n_s8)))10079__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqadd_n_s8)))
10080svint8_t svqadd(svint8_t, int8_t);10080svint8_t svqadd(svint8_t, int8_t);
10081__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqadd_n_s32)))10081__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqadd_n_s32)))
...@@ -10117,13 +10117,13 @@ uint32_t svqdecb(uint32_t, uint64_t);...@@ -10117,13 +10117,13 @@ uint32_t svqdecb(uint32_t, uint64_t);
10117__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecb_n_u64)))10117__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecb_n_u64)))
10118uint64_t svqdecb(uint64_t, uint64_t);10118uint64_t svqdecb(uint64_t, uint64_t);
10119__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecb_pat_n_s32)))10119__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecb_pat_n_s32)))
10120int32_t svqdecb_pat(int32_t, sv_pattern, uint64_t);10120int32_t svqdecb_pat(int32_t, enum svpattern, uint64_t);
10121__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecb_pat_n_s64)))10121__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecb_pat_n_s64)))
10122int64_t svqdecb_pat(int64_t, sv_pattern, uint64_t);10122int64_t svqdecb_pat(int64_t, enum svpattern, uint64_t);
10123__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecb_pat_n_u32)))10123__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecb_pat_n_u32)))
10124uint32_t svqdecb_pat(uint32_t, sv_pattern, uint64_t);10124uint32_t svqdecb_pat(uint32_t, enum svpattern, uint64_t);
10125__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecb_pat_n_u64)))10125__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecb_pat_n_u64)))
10126uint64_t svqdecb_pat(uint64_t, sv_pattern, uint64_t);10126uint64_t svqdecb_pat(uint64_t, enum svpattern, uint64_t);
10127__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_n_s32)))10127__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_n_s32)))
10128int32_t svqdecd(int32_t, uint64_t);10128int32_t svqdecd(int32_t, uint64_t);
10129__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_n_s64)))10129__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_n_s64)))
...@@ -10137,17 +10137,17 @@ svint64_t svqdecd(svint64_t, uint64_t);...@@ -10137,17 +10137,17 @@ svint64_t svqdecd(svint64_t, uint64_t);
10137__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_u64)))10137__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_u64)))
10138svuint64_t svqdecd(svuint64_t, uint64_t);10138svuint64_t svqdecd(svuint64_t, uint64_t);
10139__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_pat_n_s32)))10139__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_pat_n_s32)))
10140int32_t svqdecd_pat(int32_t, sv_pattern, uint64_t);10140int32_t svqdecd_pat(int32_t, enum svpattern, uint64_t);
10141__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_pat_n_s64)))10141__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_pat_n_s64)))
10142int64_t svqdecd_pat(int64_t, sv_pattern, uint64_t);10142int64_t svqdecd_pat(int64_t, enum svpattern, uint64_t);
10143__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_pat_n_u32)))10143__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_pat_n_u32)))
10144uint32_t svqdecd_pat(uint32_t, sv_pattern, uint64_t);10144uint32_t svqdecd_pat(uint32_t, enum svpattern, uint64_t);
10145__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_pat_n_u64)))10145__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_pat_n_u64)))
10146uint64_t svqdecd_pat(uint64_t, sv_pattern, uint64_t);10146uint64_t svqdecd_pat(uint64_t, enum svpattern, uint64_t);
10147__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_pat_s64)))10147__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_pat_s64)))
10148svint64_t svqdecd_pat(svint64_t, sv_pattern, uint64_t);10148svint64_t svqdecd_pat(svint64_t, enum svpattern, uint64_t);
10149__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_pat_u64)))10149__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_pat_u64)))
10150svuint64_t svqdecd_pat(svuint64_t, sv_pattern, uint64_t);10150svuint64_t svqdecd_pat(svuint64_t, enum svpattern, uint64_t);
10151__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_n_s32)))10151__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_n_s32)))
10152int32_t svqdech(int32_t, uint64_t);10152int32_t svqdech(int32_t, uint64_t);
10153__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_n_s64)))10153__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_n_s64)))
...@@ -10161,17 +10161,17 @@ svint16_t svqdech(svint16_t, uint64_t);...@@ -10161,17 +10161,17 @@ svint16_t svqdech(svint16_t, uint64_t);
10161__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_u16)))10161__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_u16)))
10162svuint16_t svqdech(svuint16_t, uint64_t);10162svuint16_t svqdech(svuint16_t, uint64_t);
10163__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_pat_n_s32)))10163__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_pat_n_s32)))
10164int32_t svqdech_pat(int32_t, sv_pattern, uint64_t);10164int32_t svqdech_pat(int32_t, enum svpattern, uint64_t);
10165__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_pat_n_s64)))10165__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_pat_n_s64)))
10166int64_t svqdech_pat(int64_t, sv_pattern, uint64_t);10166int64_t svqdech_pat(int64_t, enum svpattern, uint64_t);
10167__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_pat_n_u32)))10167__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_pat_n_u32)))
10168uint32_t svqdech_pat(uint32_t, sv_pattern, uint64_t);10168uint32_t svqdech_pat(uint32_t, enum svpattern, uint64_t);
10169__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_pat_n_u64)))10169__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_pat_n_u64)))
10170uint64_t svqdech_pat(uint64_t, sv_pattern, uint64_t);10170uint64_t svqdech_pat(uint64_t, enum svpattern, uint64_t);
10171__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_pat_s16)))10171__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_pat_s16)))
10172svint16_t svqdech_pat(svint16_t, sv_pattern, uint64_t);10172svint16_t svqdech_pat(svint16_t, enum svpattern, uint64_t);
10173__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_pat_u16)))10173__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_pat_u16)))
10174svuint16_t svqdech_pat(svuint16_t, sv_pattern, uint64_t);10174svuint16_t svqdech_pat(svuint16_t, enum svpattern, uint64_t);
10175__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecp_n_s32_b8)))10175__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecp_n_s32_b8)))
10176int32_t svqdecp_b8(int32_t, svbool_t);10176int32_t svqdecp_b8(int32_t, svbool_t);
10177__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecp_n_s32_b32)))10177__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecp_n_s32_b32)))
...@@ -10229,17 +10229,17 @@ svint32_t svqdecw(svint32_t, uint64_t);...@@ -10229,17 +10229,17 @@ svint32_t svqdecw(svint32_t, uint64_t);
10229__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_u32)))10229__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_u32)))
10230svuint32_t svqdecw(svuint32_t, uint64_t);10230svuint32_t svqdecw(svuint32_t, uint64_t);
10231__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_pat_n_s32)))10231__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_pat_n_s32)))
10232int32_t svqdecw_pat(int32_t, sv_pattern, uint64_t);10232int32_t svqdecw_pat(int32_t, enum svpattern, uint64_t);
10233__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_pat_n_s64)))10233__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_pat_n_s64)))
10234int64_t svqdecw_pat(int64_t, sv_pattern, uint64_t);10234int64_t svqdecw_pat(int64_t, enum svpattern, uint64_t);
10235__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_pat_n_u32)))10235__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_pat_n_u32)))
10236uint32_t svqdecw_pat(uint32_t, sv_pattern, uint64_t);10236uint32_t svqdecw_pat(uint32_t, enum svpattern, uint64_t);
10237__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_pat_n_u64)))10237__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_pat_n_u64)))
10238uint64_t svqdecw_pat(uint64_t, sv_pattern, uint64_t);10238uint64_t svqdecw_pat(uint64_t, enum svpattern, uint64_t);
10239__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_pat_s32)))10239__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_pat_s32)))
10240svint32_t svqdecw_pat(svint32_t, sv_pattern, uint64_t);10240svint32_t svqdecw_pat(svint32_t, enum svpattern, uint64_t);
10241__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_pat_u32)))10241__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_pat_u32)))
10242svuint32_t svqdecw_pat(svuint32_t, sv_pattern, uint64_t);10242svuint32_t svqdecw_pat(svuint32_t, enum svpattern, uint64_t);
10243__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_n_s32)))10243__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_n_s32)))
10244int32_t svqincb(int32_t, uint64_t);10244int32_t svqincb(int32_t, uint64_t);
10245__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_n_s64)))10245__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_n_s64)))
...@@ -10249,13 +10249,13 @@ uint32_t svqincb(uint32_t, uint64_t);...@@ -10249,13 +10249,13 @@ uint32_t svqincb(uint32_t, uint64_t);
10249__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_n_u64)))10249__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_n_u64)))
10250uint64_t svqincb(uint64_t, uint64_t);10250uint64_t svqincb(uint64_t, uint64_t);
10251__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_pat_n_s32)))10251__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_pat_n_s32)))
10252int32_t svqincb_pat(int32_t, sv_pattern, uint64_t);10252int32_t svqincb_pat(int32_t, enum svpattern, uint64_t);
10253__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_pat_n_s64)))10253__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_pat_n_s64)))
10254int64_t svqincb_pat(int64_t, sv_pattern, uint64_t);10254int64_t svqincb_pat(int64_t, enum svpattern, uint64_t);
10255__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_pat_n_u32)))10255__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_pat_n_u32)))
10256uint32_t svqincb_pat(uint32_t, sv_pattern, uint64_t);10256uint32_t svqincb_pat(uint32_t, enum svpattern, uint64_t);
10257__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_pat_n_u64)))10257__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_pat_n_u64)))
10258uint64_t svqincb_pat(uint64_t, sv_pattern, uint64_t);10258uint64_t svqincb_pat(uint64_t, enum svpattern, uint64_t);
10259__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_n_s32)))10259__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_n_s32)))
10260int32_t svqincd(int32_t, uint64_t);10260int32_t svqincd(int32_t, uint64_t);
10261__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_n_s64)))10261__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_n_s64)))
...@@ -10269,17 +10269,17 @@ svint64_t svqincd(svint64_t, uint64_t);...@@ -10269,17 +10269,17 @@ svint64_t svqincd(svint64_t, uint64_t);
10269__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_u64)))10269__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_u64)))
10270svuint64_t svqincd(svuint64_t, uint64_t);10270svuint64_t svqincd(svuint64_t, uint64_t);
10271__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_pat_n_s32)))10271__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_pat_n_s32)))
10272int32_t svqincd_pat(int32_t, sv_pattern, uint64_t);10272int32_t svqincd_pat(int32_t, enum svpattern, uint64_t);
10273__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_pat_n_s64)))10273__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_pat_n_s64)))
10274int64_t svqincd_pat(int64_t, sv_pattern, uint64_t);10274int64_t svqincd_pat(int64_t, enum svpattern, uint64_t);
10275__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_pat_n_u32)))10275__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_pat_n_u32)))
10276uint32_t svqincd_pat(uint32_t, sv_pattern, uint64_t);10276uint32_t svqincd_pat(uint32_t, enum svpattern, uint64_t);
10277__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_pat_n_u64)))10277__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_pat_n_u64)))
10278uint64_t svqincd_pat(uint64_t, sv_pattern, uint64_t);10278uint64_t svqincd_pat(uint64_t, enum svpattern, uint64_t);
10279__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_pat_s64)))10279__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_pat_s64)))
10280svint64_t svqincd_pat(svint64_t, sv_pattern, uint64_t);10280svint64_t svqincd_pat(svint64_t, enum svpattern, uint64_t);
10281__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_pat_u64)))10281__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_pat_u64)))
10282svuint64_t svqincd_pat(svuint64_t, sv_pattern, uint64_t);10282svuint64_t svqincd_pat(svuint64_t, enum svpattern, uint64_t);
10283__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_n_s32)))10283__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_n_s32)))
10284int32_t svqinch(int32_t, uint64_t);10284int32_t svqinch(int32_t, uint64_t);
10285__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_n_s64)))10285__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_n_s64)))
...@@ -10293,17 +10293,17 @@ svint16_t svqinch(svint16_t, uint64_t);...@@ -10293,17 +10293,17 @@ svint16_t svqinch(svint16_t, uint64_t);
10293__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_u16)))10293__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_u16)))
10294svuint16_t svqinch(svuint16_t, uint64_t);10294svuint16_t svqinch(svuint16_t, uint64_t);
10295__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_pat_n_s32)))10295__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_pat_n_s32)))
10296int32_t svqinch_pat(int32_t, sv_pattern, uint64_t);10296int32_t svqinch_pat(int32_t, enum svpattern, uint64_t);
10297__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_pat_n_s64)))10297__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_pat_n_s64)))
10298int64_t svqinch_pat(int64_t, sv_pattern, uint64_t);10298int64_t svqinch_pat(int64_t, enum svpattern, uint64_t);
10299__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_pat_n_u32)))10299__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_pat_n_u32)))
10300uint32_t svqinch_pat(uint32_t, sv_pattern, uint64_t);10300uint32_t svqinch_pat(uint32_t, enum svpattern, uint64_t);
10301__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_pat_n_u64)))10301__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_pat_n_u64)))
10302uint64_t svqinch_pat(uint64_t, sv_pattern, uint64_t);10302uint64_t svqinch_pat(uint64_t, enum svpattern, uint64_t);
10303__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_pat_s16)))10303__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_pat_s16)))
10304svint16_t svqinch_pat(svint16_t, sv_pattern, uint64_t);10304svint16_t svqinch_pat(svint16_t, enum svpattern, uint64_t);
10305__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_pat_u16)))10305__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_pat_u16)))
10306svuint16_t svqinch_pat(svuint16_t, sv_pattern, uint64_t);10306svuint16_t svqinch_pat(svuint16_t, enum svpattern, uint64_t);
10307__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincp_n_s32_b8)))10307__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincp_n_s32_b8)))
10308int32_t svqincp_b8(int32_t, svbool_t);10308int32_t svqincp_b8(int32_t, svbool_t);
10309__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincp_n_s32_b32)))10309__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincp_n_s32_b32)))
...@@ -10361,17 +10361,17 @@ svint32_t svqincw(svint32_t, uint64_t);...@@ -10361,17 +10361,17 @@ svint32_t svqincw(svint32_t, uint64_t);
10361__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_u32)))10361__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_u32)))
10362svuint32_t svqincw(svuint32_t, uint64_t);10362svuint32_t svqincw(svuint32_t, uint64_t);
10363__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_pat_n_s32)))10363__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_pat_n_s32)))
10364int32_t svqincw_pat(int32_t, sv_pattern, uint64_t);10364int32_t svqincw_pat(int32_t, enum svpattern, uint64_t);
10365__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_pat_n_s64)))10365__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_pat_n_s64)))
10366int64_t svqincw_pat(int64_t, sv_pattern, uint64_t);10366int64_t svqincw_pat(int64_t, enum svpattern, uint64_t);
10367__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_pat_n_u32)))10367__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_pat_n_u32)))
10368uint32_t svqincw_pat(uint32_t, sv_pattern, uint64_t);10368uint32_t svqincw_pat(uint32_t, enum svpattern, uint64_t);
10369__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_pat_n_u64)))10369__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_pat_n_u64)))
10370uint64_t svqincw_pat(uint64_t, sv_pattern, uint64_t);10370uint64_t svqincw_pat(uint64_t, enum svpattern, uint64_t);
10371__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_pat_s32)))10371__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_pat_s32)))
10372svint32_t svqincw_pat(svint32_t, sv_pattern, uint64_t);10372svint32_t svqincw_pat(svint32_t, enum svpattern, uint64_t);
10373__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_pat_u32)))10373__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_pat_u32)))
10374svuint32_t svqincw_pat(svuint32_t, sv_pattern, uint64_t);10374svuint32_t svqincw_pat(svuint32_t, enum svpattern, uint64_t);
10375__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqsub_n_s8)))10375__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqsub_n_s8)))
10376svint8_t svqsub(svint8_t, int8_t);10376svint8_t svqsub(svint8_t, int8_t);
10377__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqsub_n_s32)))10377__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqsub_n_s32)))
lib/include/avx512fintrin.h+47-118
...@@ -9297,303 +9297,232 @@ _mm512_mask_abs_pd(__m512d __W, __mmask8 __K, __m512d __A)...@@ -9297,303 +9297,232 @@ _mm512_mask_abs_pd(__m512d __W, __mmask8 __K, __m512d __A)
92979297
9298/* Vector-reduction arithmetic accepts vectors as inputs and produces scalars as9298/* Vector-reduction arithmetic accepts vectors as inputs and produces scalars as
9299 * outputs. This class of vector operation forms the basis of many scientific9299 * outputs. This class of vector operation forms the basis of many scientific
9300 * computations. In vector-reduction arithmetic, the evaluation off is9300 * computations. In vector-reduction arithmetic, the evaluation order is
9301 * independent of the order of the input elements of V.9301 * independent of the order of the input elements of V.
93029302
9303 * For floating point types, we always assume the elements are reassociable even
9304 * if -fast-math is off.
9305
9303 * Used bisection method. At each step, we partition the vector with previous9306 * Used bisection method. At each step, we partition the vector with previous
9304 * step in half, and the operation is performed on its two halves.9307 * step in half, and the operation is performed on its two halves.
9305 * This takes log2(n) steps where n is the number of elements in the vector.9308 * This takes log2(n) steps where n is the number of elements in the vector.
9306 */9309 */
93079310
9308#define _mm512_mask_reduce_operator(op) \
9309 __v4du __t1 = (__v4du)_mm512_extracti64x4_epi64(__W, 0); \
9310 __v4du __t2 = (__v4du)_mm512_extracti64x4_epi64(__W, 1); \
9311 __m256i __t3 = (__m256i)(__t1 op __t2); \
9312 __v2du __t4 = (__v2du)_mm256_extracti128_si256(__t3, 0); \
9313 __v2du __t5 = (__v2du)_mm256_extracti128_si256(__t3, 1); \
9314 __v2du __t6 = __t4 op __t5; \
9315 __v2du __t7 = __builtin_shufflevector(__t6, __t6, 1, 0); \
9316 __v2du __t8 = __t6 op __t7; \
9317 return __t8[0]
9318
9319static __inline__ long long __DEFAULT_FN_ATTRS512 _mm512_reduce_add_epi64(__m512i __W) {9311static __inline__ long long __DEFAULT_FN_ATTRS512 _mm512_reduce_add_epi64(__m512i __W) {
9320 _mm512_mask_reduce_operator(+);9312 return __builtin_ia32_reduce_add_q512(__W);
9321}9313}
93229314
9323static __inline__ long long __DEFAULT_FN_ATTRS512 _mm512_reduce_mul_epi64(__m512i __W) {9315static __inline__ long long __DEFAULT_FN_ATTRS512 _mm512_reduce_mul_epi64(__m512i __W) {
9324 _mm512_mask_reduce_operator(*);9316 return __builtin_ia32_reduce_mul_q512(__W);
9325}9317}
93269318
9327static __inline__ long long __DEFAULT_FN_ATTRS512 _mm512_reduce_and_epi64(__m512i __W) {9319static __inline__ long long __DEFAULT_FN_ATTRS512 _mm512_reduce_and_epi64(__m512i __W) {
9328 _mm512_mask_reduce_operator(&);9320 return __builtin_ia32_reduce_and_q512(__W);
9329}9321}
93309322
9331static __inline__ long long __DEFAULT_FN_ATTRS512 _mm512_reduce_or_epi64(__m512i __W) {9323static __inline__ long long __DEFAULT_FN_ATTRS512 _mm512_reduce_or_epi64(__m512i __W) {
9332 _mm512_mask_reduce_operator(|);9324 return __builtin_ia32_reduce_or_q512(__W);
9333}9325}
93349326
9335static __inline__ long long __DEFAULT_FN_ATTRS5129327static __inline__ long long __DEFAULT_FN_ATTRS512
9336_mm512_mask_reduce_add_epi64(__mmask8 __M, __m512i __W) {9328_mm512_mask_reduce_add_epi64(__mmask8 __M, __m512i __W) {
9337 __W = _mm512_maskz_mov_epi64(__M, __W);9329 __W = _mm512_maskz_mov_epi64(__M, __W);
9338 _mm512_mask_reduce_operator(+);9330 return __builtin_ia32_reduce_add_q512(__W);
9339}9331}
93409332
9341static __inline__ long long __DEFAULT_FN_ATTRS5129333static __inline__ long long __DEFAULT_FN_ATTRS512
9342_mm512_mask_reduce_mul_epi64(__mmask8 __M, __m512i __W) {9334_mm512_mask_reduce_mul_epi64(__mmask8 __M, __m512i __W) {
9343 __W = _mm512_mask_mov_epi64(_mm512_set1_epi64(1), __M, __W);9335 __W = _mm512_mask_mov_epi64(_mm512_set1_epi64(1), __M, __W);
9344 _mm512_mask_reduce_operator(*);9336 return __builtin_ia32_reduce_mul_q512(__W);
9345}9337}
93469338
9347static __inline__ long long __DEFAULT_FN_ATTRS5129339static __inline__ long long __DEFAULT_FN_ATTRS512
9348_mm512_mask_reduce_and_epi64(__mmask8 __M, __m512i __W) {9340_mm512_mask_reduce_and_epi64(__mmask8 __M, __m512i __W) {
9349 __W = _mm512_mask_mov_epi64(_mm512_set1_epi64(~0ULL), __M, __W);9341 __W = _mm512_mask_mov_epi64(_mm512_set1_epi64(~0ULL), __M, __W);
9350 _mm512_mask_reduce_operator(&);9342 return __builtin_ia32_reduce_and_q512(__W);
9351}9343}
93529344
9353static __inline__ long long __DEFAULT_FN_ATTRS5129345static __inline__ long long __DEFAULT_FN_ATTRS512
9354_mm512_mask_reduce_or_epi64(__mmask8 __M, __m512i __W) {9346_mm512_mask_reduce_or_epi64(__mmask8 __M, __m512i __W) {
9355 __W = _mm512_maskz_mov_epi64(__M, __W);9347 __W = _mm512_maskz_mov_epi64(__M, __W);
9356 _mm512_mask_reduce_operator(|);9348 return __builtin_ia32_reduce_or_q512(__W);
9357}9349}
9358#undef _mm512_mask_reduce_operator
9359
9360#define _mm512_mask_reduce_operator(op) \
9361 __m256d __t1 = _mm512_extractf64x4_pd(__W, 0); \
9362 __m256d __t2 = _mm512_extractf64x4_pd(__W, 1); \
9363 __m256d __t3 = __t1 op __t2; \
9364 __m128d __t4 = _mm256_extractf128_pd(__t3, 0); \
9365 __m128d __t5 = _mm256_extractf128_pd(__t3, 1); \
9366 __m128d __t6 = __t4 op __t5; \
9367 __m128d __t7 = __builtin_shufflevector(__t6, __t6, 1, 0); \
9368 __m128d __t8 = __t6 op __t7; \
9369 return __t8[0]
93709350
9351// -0.0 is used to ignore the start value since it is the neutral value of
9352// floating point addition. For more information, please refer to
9353// https://llvm.org/docs/LangRef.html#llvm-vector-reduce-fadd-intrinsic
9371static __inline__ double __DEFAULT_FN_ATTRS512 _mm512_reduce_add_pd(__m512d __W) {9354static __inline__ double __DEFAULT_FN_ATTRS512 _mm512_reduce_add_pd(__m512d __W) {
9372 _mm512_mask_reduce_operator(+);9355 return __builtin_ia32_reduce_fadd_pd512(-0.0, __W);
9373}9356}
93749357
9375static __inline__ double __DEFAULT_FN_ATTRS512 _mm512_reduce_mul_pd(__m512d __W) {9358static __inline__ double __DEFAULT_FN_ATTRS512 _mm512_reduce_mul_pd(__m512d __W) {
9376 _mm512_mask_reduce_operator(*);9359 return __builtin_ia32_reduce_fmul_pd512(1.0, __W);
9377}9360}
93789361
9379static __inline__ double __DEFAULT_FN_ATTRS5129362static __inline__ double __DEFAULT_FN_ATTRS512
9380_mm512_mask_reduce_add_pd(__mmask8 __M, __m512d __W) {9363_mm512_mask_reduce_add_pd(__mmask8 __M, __m512d __W) {
9381 __W = _mm512_maskz_mov_pd(__M, __W);9364 __W = _mm512_maskz_mov_pd(__M, __W);
9382 _mm512_mask_reduce_operator(+);9365 return __builtin_ia32_reduce_fadd_pd512(-0.0, __W);
9383}9366}
93849367
9385static __inline__ double __DEFAULT_FN_ATTRS5129368static __inline__ double __DEFAULT_FN_ATTRS512
9386_mm512_mask_reduce_mul_pd(__mmask8 __M, __m512d __W) {9369_mm512_mask_reduce_mul_pd(__mmask8 __M, __m512d __W) {
9387 __W = _mm512_mask_mov_pd(_mm512_set1_pd(1.0), __M, __W);9370 __W = _mm512_mask_mov_pd(_mm512_set1_pd(1.0), __M, __W);
9388 _mm512_mask_reduce_operator(*);9371 return __builtin_ia32_reduce_fmul_pd512(1.0, __W);
9389}9372}
9390#undef _mm512_mask_reduce_operator
9391
9392#define _mm512_mask_reduce_operator(op) \
9393 __v8su __t1 = (__v8su)_mm512_extracti64x4_epi64(__W, 0); \
9394 __v8su __t2 = (__v8su)_mm512_extracti64x4_epi64(__W, 1); \
9395 __m256i __t3 = (__m256i)(__t1 op __t2); \
9396 __v4su __t4 = (__v4su)_mm256_extracti128_si256(__t3, 0); \
9397 __v4su __t5 = (__v4su)_mm256_extracti128_si256(__t3, 1); \
9398 __v4su __t6 = __t4 op __t5; \
9399 __v4su __t7 = __builtin_shufflevector(__t6, __t6, 2, 3, 0, 1); \
9400 __v4su __t8 = __t6 op __t7; \
9401 __v4su __t9 = __builtin_shufflevector(__t8, __t8, 1, 0, 3, 2); \
9402 __v4su __t10 = __t8 op __t9; \
9403 return __t10[0]
94049373
9405static __inline__ int __DEFAULT_FN_ATTRS5129374static __inline__ int __DEFAULT_FN_ATTRS512
9406_mm512_reduce_add_epi32(__m512i __W) {9375_mm512_reduce_add_epi32(__m512i __W) {
9407 _mm512_mask_reduce_operator(+);9376 return __builtin_ia32_reduce_add_d512((__v16si)__W);
9408}9377}
94099378
9410static __inline__ int __DEFAULT_FN_ATTRS5129379static __inline__ int __DEFAULT_FN_ATTRS512
9411_mm512_reduce_mul_epi32(__m512i __W) {9380_mm512_reduce_mul_epi32(__m512i __W) {
9412 _mm512_mask_reduce_operator(*);9381 return __builtin_ia32_reduce_mul_d512((__v16si)__W);
9413}9382}
94149383
9415static __inline__ int __DEFAULT_FN_ATTRS5129384static __inline__ int __DEFAULT_FN_ATTRS512
9416_mm512_reduce_and_epi32(__m512i __W) {9385_mm512_reduce_and_epi32(__m512i __W) {
9417 _mm512_mask_reduce_operator(&);9386 return __builtin_ia32_reduce_and_d512((__v16si)__W);
9418}9387}
94199388
9420static __inline__ int __DEFAULT_FN_ATTRS5129389static __inline__ int __DEFAULT_FN_ATTRS512
9421_mm512_reduce_or_epi32(__m512i __W) {9390_mm512_reduce_or_epi32(__m512i __W) {
9422 _mm512_mask_reduce_operator(|);9391 return __builtin_ia32_reduce_or_d512((__v16si)__W);
9423}9392}
94249393
9425static __inline__ int __DEFAULT_FN_ATTRS5129394static __inline__ int __DEFAULT_FN_ATTRS512
9426_mm512_mask_reduce_add_epi32( __mmask16 __M, __m512i __W) {9395_mm512_mask_reduce_add_epi32( __mmask16 __M, __m512i __W) {
9427 __W = _mm512_maskz_mov_epi32(__M, __W);9396 __W = _mm512_maskz_mov_epi32(__M, __W);
9428 _mm512_mask_reduce_operator(+);9397 return __builtin_ia32_reduce_add_d512((__v16si)__W);
9429}9398}
94309399
9431static __inline__ int __DEFAULT_FN_ATTRS5129400static __inline__ int __DEFAULT_FN_ATTRS512
9432_mm512_mask_reduce_mul_epi32( __mmask16 __M, __m512i __W) {9401_mm512_mask_reduce_mul_epi32( __mmask16 __M, __m512i __W) {
9433 __W = _mm512_mask_mov_epi32(_mm512_set1_epi32(1), __M, __W);9402 __W = _mm512_mask_mov_epi32(_mm512_set1_epi32(1), __M, __W);
9434 _mm512_mask_reduce_operator(*);9403 return __builtin_ia32_reduce_mul_d512((__v16si)__W);
9435}9404}
94369405
9437static __inline__ int __DEFAULT_FN_ATTRS5129406static __inline__ int __DEFAULT_FN_ATTRS512
9438_mm512_mask_reduce_and_epi32( __mmask16 __M, __m512i __W) {9407_mm512_mask_reduce_and_epi32( __mmask16 __M, __m512i __W) {
9439 __W = _mm512_mask_mov_epi32(_mm512_set1_epi32(~0U), __M, __W);9408 __W = _mm512_mask_mov_epi32(_mm512_set1_epi32(~0U), __M, __W);
9440 _mm512_mask_reduce_operator(&);9409 return __builtin_ia32_reduce_and_d512((__v16si)__W);
9441}9410}
94429411
9443static __inline__ int __DEFAULT_FN_ATTRS5129412static __inline__ int __DEFAULT_FN_ATTRS512
9444_mm512_mask_reduce_or_epi32(__mmask16 __M, __m512i __W) {9413_mm512_mask_reduce_or_epi32(__mmask16 __M, __m512i __W) {
9445 __W = _mm512_maskz_mov_epi32(__M, __W);9414 __W = _mm512_maskz_mov_epi32(__M, __W);
9446 _mm512_mask_reduce_operator(|);9415 return __builtin_ia32_reduce_or_d512((__v16si)__W);
9447}9416}
9448#undef _mm512_mask_reduce_operator
9449
9450#define _mm512_mask_reduce_operator(op) \
9451 __m256 __t1 = (__m256)_mm512_extractf64x4_pd((__m512d)__W, 0); \
9452 __m256 __t2 = (__m256)_mm512_extractf64x4_pd((__m512d)__W, 1); \
9453 __m256 __t3 = __t1 op __t2; \
9454 __m128 __t4 = _mm256_extractf128_ps(__t3, 0); \
9455 __m128 __t5 = _mm256_extractf128_ps(__t3, 1); \
9456 __m128 __t6 = __t4 op __t5; \
9457 __m128 __t7 = __builtin_shufflevector(__t6, __t6, 2, 3, 0, 1); \
9458 __m128 __t8 = __t6 op __t7; \
9459 __m128 __t9 = __builtin_shufflevector(__t8, __t8, 1, 0, 3, 2); \
9460 __m128 __t10 = __t8 op __t9; \
9461 return __t10[0]
94629417
9463static __inline__ float __DEFAULT_FN_ATTRS5129418static __inline__ float __DEFAULT_FN_ATTRS512
9464_mm512_reduce_add_ps(__m512 __W) {9419_mm512_reduce_add_ps(__m512 __W) {
9465 _mm512_mask_reduce_operator(+);9420 return __builtin_ia32_reduce_fadd_ps512(-0.0f, __W);
9466}9421}
94679422
9468static __inline__ float __DEFAULT_FN_ATTRS5129423static __inline__ float __DEFAULT_FN_ATTRS512
9469_mm512_reduce_mul_ps(__m512 __W) {9424_mm512_reduce_mul_ps(__m512 __W) {
9470 _mm512_mask_reduce_operator(*);9425 return __builtin_ia32_reduce_fmul_ps512(1.0f, __W);
9471}9426}
94729427
9473static __inline__ float __DEFAULT_FN_ATTRS5129428static __inline__ float __DEFAULT_FN_ATTRS512
9474_mm512_mask_reduce_add_ps(__mmask16 __M, __m512 __W) {9429_mm512_mask_reduce_add_ps(__mmask16 __M, __m512 __W) {
9475 __W = _mm512_maskz_mov_ps(__M, __W);9430 __W = _mm512_maskz_mov_ps(__M, __W);
9476 _mm512_mask_reduce_operator(+);9431 return __builtin_ia32_reduce_fadd_ps512(-0.0f, __W);
9477}9432}
94789433
9479static __inline__ float __DEFAULT_FN_ATTRS5129434static __inline__ float __DEFAULT_FN_ATTRS512
9480_mm512_mask_reduce_mul_ps(__mmask16 __M, __m512 __W) {9435_mm512_mask_reduce_mul_ps(__mmask16 __M, __m512 __W) {
9481 __W = _mm512_mask_mov_ps(_mm512_set1_ps(1.0f), __M, __W);9436 __W = _mm512_mask_mov_ps(_mm512_set1_ps(1.0f), __M, __W);
9482 _mm512_mask_reduce_operator(*);9437 return __builtin_ia32_reduce_fmul_ps512(1.0f, __W);
9483}9438}
9484#undef _mm512_mask_reduce_operator
9485
9486#define _mm512_mask_reduce_operator(op) \
9487 __m512i __t1 = (__m512i)__builtin_shufflevector((__v8di)__V, (__v8di)__V, 4, 5, 6, 7, 0, 1, 2, 3); \
9488 __m512i __t2 = _mm512_##op(__V, __t1); \
9489 __m512i __t3 = (__m512i)__builtin_shufflevector((__v8di)__t2, (__v8di)__t2, 2, 3, 0, 1, 6, 7, 4, 5); \
9490 __m512i __t4 = _mm512_##op(__t2, __t3); \
9491 __m512i __t5 = (__m512i)__builtin_shufflevector((__v8di)__t4, (__v8di)__t4, 1, 0, 3, 2, 5, 4, 7, 6); \
9492 __v8di __t6 = (__v8di)_mm512_##op(__t4, __t5); \
9493 return __t6[0]
94949439
9495static __inline__ long long __DEFAULT_FN_ATTRS5129440static __inline__ long long __DEFAULT_FN_ATTRS512
9496_mm512_reduce_max_epi64(__m512i __V) {9441_mm512_reduce_max_epi64(__m512i __V) {
9497 _mm512_mask_reduce_operator(max_epi64);9442 return __builtin_ia32_reduce_smax_q512(__V);
9498}9443}
94999444
9500static __inline__ unsigned long long __DEFAULT_FN_ATTRS5129445static __inline__ unsigned long long __DEFAULT_FN_ATTRS512
9501_mm512_reduce_max_epu64(__m512i __V) {9446_mm512_reduce_max_epu64(__m512i __V) {
9502 _mm512_mask_reduce_operator(max_epu64);9447 return __builtin_ia32_reduce_umax_q512(__V);
9503}9448}
95049449
9505static __inline__ long long __DEFAULT_FN_ATTRS5129450static __inline__ long long __DEFAULT_FN_ATTRS512
9506_mm512_reduce_min_epi64(__m512i __V) {9451_mm512_reduce_min_epi64(__m512i __V) {
9507 _mm512_mask_reduce_operator(min_epi64);9452 return __builtin_ia32_reduce_smin_q512(__V);
9508}9453}
95099454
9510static __inline__ unsigned long long __DEFAULT_FN_ATTRS5129455static __inline__ unsigned long long __DEFAULT_FN_ATTRS512
9511_mm512_reduce_min_epu64(__m512i __V) {9456_mm512_reduce_min_epu64(__m512i __V) {
9512 _mm512_mask_reduce_operator(min_epu64);9457 return __builtin_ia32_reduce_umin_q512(__V);
9513}9458}
95149459
9515static __inline__ long long __DEFAULT_FN_ATTRS5129460static __inline__ long long __DEFAULT_FN_ATTRS512
9516_mm512_mask_reduce_max_epi64(__mmask8 __M, __m512i __V) {9461_mm512_mask_reduce_max_epi64(__mmask8 __M, __m512i __V) {
9517 __V = _mm512_mask_mov_epi64(_mm512_set1_epi64(-__LONG_LONG_MAX__ - 1LL), __M, __V);9462 __V = _mm512_mask_mov_epi64(_mm512_set1_epi64(-__LONG_LONG_MAX__ - 1LL), __M, __V);
9518 _mm512_mask_reduce_operator(max_epi64);9463 return __builtin_ia32_reduce_smax_q512(__V);
9519}9464}
95209465
9521static __inline__ unsigned long long __DEFAULT_FN_ATTRS5129466static __inline__ unsigned long long __DEFAULT_FN_ATTRS512
9522_mm512_mask_reduce_max_epu64(__mmask8 __M, __m512i __V) {9467_mm512_mask_reduce_max_epu64(__mmask8 __M, __m512i __V) {
9523 __V = _mm512_maskz_mov_epi64(__M, __V);9468 __V = _mm512_maskz_mov_epi64(__M, __V);
9524 _mm512_mask_reduce_operator(max_epu64);9469 return __builtin_ia32_reduce_umax_q512(__V);
9525}9470}
95269471
9527static __inline__ long long __DEFAULT_FN_ATTRS5129472static __inline__ long long __DEFAULT_FN_ATTRS512
9528_mm512_mask_reduce_min_epi64(__mmask8 __M, __m512i __V) {9473_mm512_mask_reduce_min_epi64(__mmask8 __M, __m512i __V) {
9529 __V = _mm512_mask_mov_epi64(_mm512_set1_epi64(__LONG_LONG_MAX__), __M, __V);9474 __V = _mm512_mask_mov_epi64(_mm512_set1_epi64(__LONG_LONG_MAX__), __M, __V);
9530 _mm512_mask_reduce_operator(min_epi64);9475 return __builtin_ia32_reduce_smin_q512(__V);
9531}9476}
95329477
9533static __inline__ unsigned long long __DEFAULT_FN_ATTRS5129478static __inline__ unsigned long long __DEFAULT_FN_ATTRS512
9534_mm512_mask_reduce_min_epu64(__mmask8 __M, __m512i __V) {9479_mm512_mask_reduce_min_epu64(__mmask8 __M, __m512i __V) {
9535 __V = _mm512_mask_mov_epi64(_mm512_set1_epi64(~0ULL), __M, __V);9480 __V = _mm512_mask_mov_epi64(_mm512_set1_epi64(~0ULL), __M, __V);
9536 _mm512_mask_reduce_operator(min_epu64);9481 return __builtin_ia32_reduce_umin_q512(__V);
9537}9482}
9538#undef _mm512_mask_reduce_operator
9539
9540#define _mm512_mask_reduce_operator(op) \
9541 __m256i __t1 = _mm512_extracti64x4_epi64(__V, 0); \
9542 __m256i __t2 = _mm512_extracti64x4_epi64(__V, 1); \
9543 __m256i __t3 = _mm256_##op(__t1, __t2); \
9544 __m128i __t4 = _mm256_extracti128_si256(__t3, 0); \
9545 __m128i __t5 = _mm256_extracti128_si256(__t3, 1); \
9546 __m128i __t6 = _mm_##op(__t4, __t5); \
9547 __m128i __t7 = (__m128i)__builtin_shufflevector((__v4si)__t6, (__v4si)__t6, 2, 3, 0, 1); \
9548 __m128i __t8 = _mm_##op(__t6, __t7); \
9549 __m128i __t9 = (__m128i)__builtin_shufflevector((__v4si)__t8, (__v4si)__t8, 1, 0, 3, 2); \
9550 __v4si __t10 = (__v4si)_mm_##op(__t8, __t9); \
9551 return __t10[0]
9552
9553static __inline__ int __DEFAULT_FN_ATTRS5129483static __inline__ int __DEFAULT_FN_ATTRS512
9554_mm512_reduce_max_epi32(__m512i __V) {9484_mm512_reduce_max_epi32(__m512i __V) {
9555 _mm512_mask_reduce_operator(max_epi32);9485 return __builtin_ia32_reduce_smax_d512((__v16si)__V);
9556}9486}
95579487
9558static __inline__ unsigned int __DEFAULT_FN_ATTRS5129488static __inline__ unsigned int __DEFAULT_FN_ATTRS512
9559_mm512_reduce_max_epu32(__m512i __V) {9489_mm512_reduce_max_epu32(__m512i __V) {
9560 _mm512_mask_reduce_operator(max_epu32);9490 return __builtin_ia32_reduce_umax_d512((__v16si)__V);
9561}9491}
95629492
9563static __inline__ int __DEFAULT_FN_ATTRS5129493static __inline__ int __DEFAULT_FN_ATTRS512
9564_mm512_reduce_min_epi32(__m512i __V) {9494_mm512_reduce_min_epi32(__m512i __V) {
9565 _mm512_mask_reduce_operator(min_epi32);9495 return __builtin_ia32_reduce_smin_d512((__v16si)__V);
9566}9496}
95679497
9568static __inline__ unsigned int __DEFAULT_FN_ATTRS5129498static __inline__ unsigned int __DEFAULT_FN_ATTRS512
9569_mm512_reduce_min_epu32(__m512i __V) {9499_mm512_reduce_min_epu32(__m512i __V) {
9570 _mm512_mask_reduce_operator(min_epu32);9500 return __builtin_ia32_reduce_umin_d512((__v16si)__V);
9571}9501}
95729502
9573static __inline__ int __DEFAULT_FN_ATTRS5129503static __inline__ int __DEFAULT_FN_ATTRS512
9574_mm512_mask_reduce_max_epi32(__mmask16 __M, __m512i __V) {9504_mm512_mask_reduce_max_epi32(__mmask16 __M, __m512i __V) {
9575 __V = _mm512_mask_mov_epi32(_mm512_set1_epi32(-__INT_MAX__ - 1), __M, __V);9505 __V = _mm512_mask_mov_epi32(_mm512_set1_epi32(-__INT_MAX__ - 1), __M, __V);
9576 _mm512_mask_reduce_operator(max_epi32);9506 return __builtin_ia32_reduce_smax_d512((__v16si)__V);
9577}9507}
95789508
9579static __inline__ unsigned int __DEFAULT_FN_ATTRS5129509static __inline__ unsigned int __DEFAULT_FN_ATTRS512
9580_mm512_mask_reduce_max_epu32(__mmask16 __M, __m512i __V) {9510_mm512_mask_reduce_max_epu32(__mmask16 __M, __m512i __V) {
9581 __V = _mm512_maskz_mov_epi32(__M, __V);9511 __V = _mm512_maskz_mov_epi32(__M, __V);
9582 _mm512_mask_reduce_operator(max_epu32);9512 return __builtin_ia32_reduce_umax_d512((__v16si)__V);
9583}9513}
95849514
9585static __inline__ int __DEFAULT_FN_ATTRS5129515static __inline__ int __DEFAULT_FN_ATTRS512
9586_mm512_mask_reduce_min_epi32(__mmask16 __M, __m512i __V) {9516_mm512_mask_reduce_min_epi32(__mmask16 __M, __m512i __V) {
9587 __V = _mm512_mask_mov_epi32(_mm512_set1_epi32(__INT_MAX__), __M, __V);9517 __V = _mm512_mask_mov_epi32(_mm512_set1_epi32(__INT_MAX__), __M, __V);
9588 _mm512_mask_reduce_operator(min_epi32);9518 return __builtin_ia32_reduce_smin_d512((__v16si)__V);
9589}9519}
95909520
9591static __inline__ unsigned int __DEFAULT_FN_ATTRS5129521static __inline__ unsigned int __DEFAULT_FN_ATTRS512
9592_mm512_mask_reduce_min_epu32(__mmask16 __M, __m512i __V) {9522_mm512_mask_reduce_min_epu32(__mmask16 __M, __m512i __V) {
9593 __V = _mm512_mask_mov_epi32(_mm512_set1_epi32(~0U), __M, __V);9523 __V = _mm512_mask_mov_epi32(_mm512_set1_epi32(~0U), __M, __V);
9594 _mm512_mask_reduce_operator(min_epu32);9524 return __builtin_ia32_reduce_umin_d512((__v16si)__V);
9595}9525}
9596#undef _mm512_mask_reduce_operator
95979526
9598#define _mm512_mask_reduce_operator(op) \9527#define _mm512_mask_reduce_operator(op) \
9599 __m256d __t1 = _mm512_extractf64x4_pd(__V, 0); \9528 __m256d __t1 = _mm512_extractf64x4_pd(__V, 0); \
lib/include/avx512vlvnniintrin.h+150-55
...@@ -18,13 +18,157 @@...@@ -18,13 +18,157 @@
18#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512vnni"), __min_vector_width__(128)))18#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512vnni"), __min_vector_width__(128)))
19#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512vnni"), __min_vector_width__(256)))19#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512vnni"), __min_vector_width__(256)))
2020
21/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with
22/// corresponding signed 8-bit integers in \a B, producing 4 intermediate signed
23/// 16-bit results. Sum these 4 results with the corresponding 32-bit integer
24/// in \a S, and store the packed 32-bit results in DST.
25///
26/// This intrinsic corresponds to the <c> VPDPBUSD </c> instructions.
27///
28/// \operation
29/// FOR j := 0 to 7
30/// tmp1.word := Signed(ZeroExtend16(A.byte[4*j]) * SignExtend16(B.byte[4*j]))
31/// tmp2.word := Signed(ZeroExtend16(A.byte[4*j+1]) * SignExtend16(B.byte[4*j+1]))
32/// tmp3.word := Signed(ZeroExtend16(A.byte[4*j+2]) * SignExtend16(B.byte[4*j+2]))
33/// tmp4.word := Signed(ZeroExtend16(A.byte[4*j+3]) * SignExtend16(B.byte[4*j+3]))
34/// DST.dword[j] := S.dword[j] + tmp1 + tmp2 + tmp3 + tmp4
35/// ENDFOR
36/// DST[MAX:256] := 0
37/// \endoperation
38#define _mm256_dpbusd_epi32(S, A, B) \
39 (__m256i)__builtin_ia32_vpdpbusd256((__v8si)(S), (__v8si)(A), (__v8si)(B))
2140
22static __inline__ __m256i __DEFAULT_FN_ATTRS25641/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with
23_mm256_dpbusd_epi32(__m256i __S, __m256i __A, __m256i __B)42/// corresponding signed 8-bit integers in \a B, producing 4 intermediate signed
24{43/// 16-bit results. Sum these 4 results with the corresponding 32-bit integer
25 return (__m256i)__builtin_ia32_vpdpbusd256((__v8si)__S, (__v8si)__A,44/// in \a S using signed saturation, and store the packed 32-bit results in DST.
26 (__v8si)__B);45///
27}46/// This intrinsic corresponds to the <c> VPDPBUSDS </c> instructions.
47///
48/// \operation
49/// FOR j := 0 to 7
50/// tmp1.word := Signed(ZeroExtend16(A.byte[4*j]) * SignExtend16(B.byte[4*j]))
51/// tmp2.word := Signed(ZeroExtend16(A.byte[4*j+1]) * SignExtend16(B.byte[4*j+1]))
52/// tmp3.word := Signed(ZeroExtend16(A.byte[4*j+2]) * SignExtend16(B.byte[4*j+2]))
53/// tmp4.word := Signed(ZeroExtend16(A.byte[4*j+3]) * SignExtend16(B.byte[4*j+3]))
54/// DST.dword[j] := Saturate32(S.dword[j] + tmp1 + tmp2 + tmp3 + tmp4)
55/// ENDFOR
56/// DST[MAX:256] := 0
57/// \endoperation
58#define _mm256_dpbusds_epi32(S, A, B) \
59 (__m256i)__builtin_ia32_vpdpbusds256((__v8si)(S), (__v8si)(A), (__v8si)(B))
60
61/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a A with
62/// corresponding 16-bit integers in \a B, producing 2 intermediate signed 32-bit
63/// results. Sum these 2 results with the corresponding 32-bit integer in \a S,
64/// and store the packed 32-bit results in DST.
65///
66/// This intrinsic corresponds to the <c> VPDPWSSD </c> instructions.
67///
68/// \operation
69/// FOR j := 0 to 7
70/// tmp1.dword := SignExtend32(A.word[2*j]) * SignExtend32(B.word[2*j])
71/// tmp2.dword := SignExtend32(A.word[2*j+1]) * SignExtend32(B.word[2*j+1])
72/// DST.dword[j] := S.dword[j] + tmp1 + tmp2
73/// ENDFOR
74/// DST[MAX:256] := 0
75/// \endoperation
76#define _mm256_dpwssd_epi32(S, A, B) \
77 (__m256i)__builtin_ia32_vpdpwssd256((__v8si)(S), (__v8si)(A), (__v8si)(B))
78
79/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a A with
80/// corresponding 16-bit integers in \a B, producing 2 intermediate signed 32-bit
81/// results. Sum these 2 results with the corresponding 32-bit integer in \a S
82/// using signed saturation, and store the packed 32-bit results in DST.
83///
84/// This intrinsic corresponds to the <c> VPDPWSSDS </c> instructions.
85///
86/// \operation
87/// FOR j := 0 to 7
88/// tmp1.dword := SignExtend32(A.word[2*j]) * SignExtend32(B.word[2*j])
89/// tmp2.dword := SignExtend32(A.word[2*j+1]) * SignExtend32(B.word[2*j+1])
90/// DST.dword[j] := Saturate32(S.dword[j] + tmp1 + tmp2)
91/// ENDFOR
92/// DST[MAX:256] := 0
93/// \endoperation
94#define _mm256_dpwssds_epi32(S, A, B) \
95 (__m256i)__builtin_ia32_vpdpwssds256((__v8si)(S), (__v8si)(A), (__v8si)(B))
96
97/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with
98/// corresponding signed 8-bit integers in \a B, producing 4 intermediate signed
99/// 16-bit results. Sum these 4 results with the corresponding 32-bit integer
100/// in \a S, and store the packed 32-bit results in DST.
101///
102/// This intrinsic corresponds to the <c> VPDPBUSD </c> instructions.
103///
104/// \operation
105/// FOR j := 0 to 3
106/// tmp1.word := Signed(ZeroExtend16(A.byte[4*j]) * SignExtend16(B.byte[4*j]))
107/// tmp2.word := Signed(ZeroExtend16(A.byte[4*j+1]) * SignExtend16(B.byte[4*j+1]))
108/// tmp3.word := Signed(ZeroExtend16(A.byte[4*j+2]) * SignExtend16(B.byte[4*j+2]))
109/// tmp4.word := Signed(ZeroExtend16(A.byte[4*j+3]) * SignExtend16(B.byte[4*j+3]))
110/// DST.dword[j] := S.dword[j] + tmp1 + tmp2 + tmp3 + tmp4
111/// ENDFOR
112/// DST[MAX:128] := 0
113/// \endoperation
114#define _mm_dpbusd_epi32(S, A, B) \
115 (__m128i)__builtin_ia32_vpdpbusd128((__v4si)(S), (__v4si)(A), (__v4si)(B))
116
117/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with
118/// corresponding signed 8-bit integers in \a B, producing 4 intermediate signed
119/// 16-bit results. Sum these 4 results with the corresponding 32-bit integer
120/// in \a S using signed saturation, and store the packed 32-bit results in DST.
121///
122/// This intrinsic corresponds to the <c> VPDPBUSDS </c> instructions.
123///
124/// \operation
125/// FOR j := 0 to 3
126/// tmp1.word := Signed(ZeroExtend16(A.byte[4*j]) * SignExtend16(B.byte[4*j]))
127/// tmp2.word := Signed(ZeroExtend16(A.byte[4*j+1]) * SignExtend16(B.byte[4*j+1]))
128/// tmp3.word := Signed(ZeroExtend16(A.byte[4*j+2]) * SignExtend16(B.byte[4*j+2]))
129/// tmp4.word := Signed(ZeroExtend16(A.byte[4*j+3]) * SignExtend16(B.byte[4*j+3]))
130/// DST.dword[j] := Saturate32(S.dword[j] + tmp1 + tmp2 + tmp3 + tmp4)
131/// ENDFOR
132/// DST[MAX:128] := 0
133/// \endoperation
134#define _mm_dpbusds_epi32(S, A, B) \
135 (__m128i)__builtin_ia32_vpdpbusds128((__v4si)(S), (__v4si)(A), (__v4si)(B))
136
137/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a A with
138/// corresponding 16-bit integers in \a B, producing 2 intermediate signed 32-bit
139/// results. Sum these 2 results with the corresponding 32-bit integer in \a S,
140/// and store the packed 32-bit results in DST.
141///
142/// This intrinsic corresponds to the <c> VPDPWSSD </c> instructions.
143///
144/// \operation
145/// FOR j := 0 to 3
146/// tmp1.dword := SignExtend32(A.word[2*j]) * SignExtend32(B.word[2*j])
147/// tmp2.dword := SignExtend32(A.word[2*j+1]) * SignExtend32(B.word[2*j+1])
148/// DST.dword[j] := S.dword[j] + tmp1 + tmp2
149/// ENDFOR
150/// DST[MAX:128] := 0
151/// \endoperation
152#define _mm_dpwssd_epi32(S, A, B) \
153 (__m128i)__builtin_ia32_vpdpwssd128((__v4si)(S), (__v4si)(A), (__v4si)(B))
154
155/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a A with
156/// corresponding 16-bit integers in \a B, producing 2 intermediate signed 32-bit
157/// results. Sum these 2 results with the corresponding 32-bit integer in \a S
158/// using signed saturation, and store the packed 32-bit results in DST.
159///
160/// This intrinsic corresponds to the <c> VPDPWSSDS </c> instructions.
161///
162/// \operation
163/// FOR j := 0 to 3
164/// tmp1.dword := SignExtend32(A.word[2*j]) * SignExtend32(B.word[2*j])
165/// tmp2.dword := SignExtend32(A.word[2*j+1]) * SignExtend32(B.word[2*j+1])
166/// DST.dword[j] := Saturate32(S.dword[j] + tmp1 + tmp2)
167/// ENDFOR
168/// DST[MAX:128] := 0
169/// \endoperation
170#define _mm_dpwssds_epi32(S, A, B) \
171 (__m128i)__builtin_ia32_vpdpwssds128((__v4si)(S), (__v4si)(A), (__v4si)(B))
28172
29static __inline__ __m256i __DEFAULT_FN_ATTRS256173static __inline__ __m256i __DEFAULT_FN_ATTRS256
30_mm256_mask_dpbusd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)174_mm256_mask_dpbusd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)
...@@ -42,13 +186,6 @@ _mm256_maskz_dpbusd_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)...@@ -42,13 +186,6 @@ _mm256_maskz_dpbusd_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)
42 (__v8si)_mm256_setzero_si256());186 (__v8si)_mm256_setzero_si256());
43}187}
44188
45static __inline__ __m256i __DEFAULT_FN_ATTRS256
46_mm256_dpbusds_epi32(__m256i __S, __m256i __A, __m256i __B)
47{
48 return (__m256i)__builtin_ia32_vpdpbusds256((__v8si)__S, (__v8si)__A,
49 (__v8si)__B);
50}
51
52static __inline__ __m256i __DEFAULT_FN_ATTRS256189static __inline__ __m256i __DEFAULT_FN_ATTRS256
53_mm256_mask_dpbusds_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)190_mm256_mask_dpbusds_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)
54{191{
...@@ -65,13 +202,6 @@ _mm256_maskz_dpbusds_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)...@@ -65,13 +202,6 @@ _mm256_maskz_dpbusds_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)
65 (__v8si)_mm256_setzero_si256());202 (__v8si)_mm256_setzero_si256());
66}203}
67204
68static __inline__ __m256i __DEFAULT_FN_ATTRS256
69_mm256_dpwssd_epi32(__m256i __S, __m256i __A, __m256i __B)
70{
71 return (__m256i)__builtin_ia32_vpdpwssd256((__v8si)__S, (__v8si)__A,
72 (__v8si)__B);
73}
74
75static __inline__ __m256i __DEFAULT_FN_ATTRS256205static __inline__ __m256i __DEFAULT_FN_ATTRS256
76_mm256_mask_dpwssd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)206_mm256_mask_dpwssd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)
77{207{
...@@ -88,13 +218,6 @@ _mm256_maskz_dpwssd_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)...@@ -88,13 +218,6 @@ _mm256_maskz_dpwssd_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)
88 (__v8si)_mm256_setzero_si256());218 (__v8si)_mm256_setzero_si256());
89}219}
90220
91static __inline__ __m256i __DEFAULT_FN_ATTRS256
92_mm256_dpwssds_epi32(__m256i __S, __m256i __A, __m256i __B)
93{
94 return (__m256i)__builtin_ia32_vpdpwssds256((__v8si)__S, (__v8si)__A,
95 (__v8si)__B);
96}
97
98static __inline__ __m256i __DEFAULT_FN_ATTRS256221static __inline__ __m256i __DEFAULT_FN_ATTRS256
99_mm256_mask_dpwssds_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)222_mm256_mask_dpwssds_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)
100{223{
...@@ -111,13 +234,6 @@ _mm256_maskz_dpwssds_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)...@@ -111,13 +234,6 @@ _mm256_maskz_dpwssds_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)
111 (__v8si)_mm256_setzero_si256());234 (__v8si)_mm256_setzero_si256());
112}235}
113236
114static __inline__ __m128i __DEFAULT_FN_ATTRS128
115_mm_dpbusd_epi32(__m128i __S, __m128i __A, __m128i __B)
116{
117 return (__m128i)__builtin_ia32_vpdpbusd128((__v4si)__S, (__v4si)__A,
118 (__v4si)__B);
119}
120
121static __inline__ __m128i __DEFAULT_FN_ATTRS128237static __inline__ __m128i __DEFAULT_FN_ATTRS128
122_mm_mask_dpbusd_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)238_mm_mask_dpbusd_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)
123{239{
...@@ -134,13 +250,6 @@ _mm_maskz_dpbusd_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)...@@ -134,13 +250,6 @@ _mm_maskz_dpbusd_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)
134 (__v4si)_mm_setzero_si128());250 (__v4si)_mm_setzero_si128());
135}251}
136252
137static __inline__ __m128i __DEFAULT_FN_ATTRS128
138_mm_dpbusds_epi32(__m128i __S, __m128i __A, __m128i __B)
139{
140 return (__m128i)__builtin_ia32_vpdpbusds128((__v4si)__S, (__v4si)__A,
141 (__v4si)__B);
142}
143
144static __inline__ __m128i __DEFAULT_FN_ATTRS128253static __inline__ __m128i __DEFAULT_FN_ATTRS128
145_mm_mask_dpbusds_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)254_mm_mask_dpbusds_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)
146{255{
...@@ -157,13 +266,6 @@ _mm_maskz_dpbusds_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)...@@ -157,13 +266,6 @@ _mm_maskz_dpbusds_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)
157 (__v4si)_mm_setzero_si128());266 (__v4si)_mm_setzero_si128());
158}267}
159268
160static __inline__ __m128i __DEFAULT_FN_ATTRS128
161_mm_dpwssd_epi32(__m128i __S, __m128i __A, __m128i __B)
162{
163 return (__m128i)__builtin_ia32_vpdpwssd128((__v4si)__S, (__v4si)__A,
164 (__v4si)__B);
165}
166
167static __inline__ __m128i __DEFAULT_FN_ATTRS128269static __inline__ __m128i __DEFAULT_FN_ATTRS128
168_mm_mask_dpwssd_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)270_mm_mask_dpwssd_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)
169{271{
...@@ -180,13 +282,6 @@ _mm_maskz_dpwssd_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)...@@ -180,13 +282,6 @@ _mm_maskz_dpwssd_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)
180 (__v4si)_mm_setzero_si128());282 (__v4si)_mm_setzero_si128());
181}283}
182284
183static __inline__ __m128i __DEFAULT_FN_ATTRS128
184_mm_dpwssds_epi32(__m128i __S, __m128i __A, __m128i __B)
185{
186 return (__m128i)__builtin_ia32_vpdpwssds128((__v4si)__S, (__v4si)__A,
187 (__v4si)__B);
188}
189
190static __inline__ __m128i __DEFAULT_FN_ATTRS128285static __inline__ __m128i __DEFAULT_FN_ATTRS128
191_mm_mask_dpwssds_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)286_mm_mask_dpwssds_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)
192{287{
lib/include/avxintrin.h+3-3
...@@ -2245,7 +2245,7 @@ _mm256_cvttps_epi32(__m256 __a)...@@ -2245,7 +2245,7 @@ _mm256_cvttps_epi32(__m256 __a)
22452245
2246/// Returns the first element of the input vector of [4 x double].2246/// Returns the first element of the input vector of [4 x double].
2247///2247///
2248/// \headerfile <avxintrin.h>2248/// \headerfile <x86intrin.h>
2249///2249///
2250/// This intrinsic is a utility function and does not correspond to a specific2250/// This intrinsic is a utility function and does not correspond to a specific
2251/// instruction.2251/// instruction.
...@@ -2261,7 +2261,7 @@ _mm256_cvtsd_f64(__m256d __a)...@@ -2261,7 +2261,7 @@ _mm256_cvtsd_f64(__m256d __a)
22612261
2262/// Returns the first element of the input vector of [8 x i32].2262/// Returns the first element of the input vector of [8 x i32].
2263///2263///
2264/// \headerfile <avxintrin.h>2264/// \headerfile <x86intrin.h>
2265///2265///
2266/// This intrinsic is a utility function and does not correspond to a specific2266/// This intrinsic is a utility function and does not correspond to a specific
2267/// instruction.2267/// instruction.
...@@ -2278,7 +2278,7 @@ _mm256_cvtsi256_si32(__m256i __a)...@@ -2278,7 +2278,7 @@ _mm256_cvtsi256_si32(__m256i __a)
22782278
2279/// Returns the first element of the input vector of [8 x float].2279/// Returns the first element of the input vector of [8 x float].
2280///2280///
2281/// \headerfile <avxintrin.h>2281/// \headerfile <x86intrin.h>
2282///2282///
2283/// This intrinsic is a utility function and does not correspond to a specific2283/// This intrinsic is a utility function and does not correspond to a specific
2284/// instruction.2284/// instruction.
lib/include/avxvnniintrin.h created+225
...@@ -0,0 +1,225 @@
1/*===--------------- avxvnniintrin.h - VNNI intrinsics --------------------===
2 *
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 *
22 *===-----------------------------------------------------------------------===
23 */
24#ifndef __IMMINTRIN_H
25#error "Never use <avxvnniintrin.h> directly; include <immintrin.h> instead."
26#endif
27
28#ifndef __AVXVNNIINTRIN_H
29#define __AVXVNNIINTRIN_H
30
31/* Below intrinsics defined in avx512vlvnniintrin.h can be used for AVXVNNI */
32/// \fn __m256i _mm256_dpbusd_epi32(__m256i __S, __m256i __A, __m256i __B)
33/// \fn __m256i _mm256_dpbusds_epi32(__m256i __S, __m256i __A, __m256i __B)
34/// \fn __m256i _mm256_dpwssd_epi32(__m256i __S, __m256i __A, __m256i __B)
35/// \fn __m256i _mm256_dpwssds_epi32(__m256i __S, __m256i __A, __m256i __B)
36/// \fn __m128i _mm_dpbusd_epi32(__m128i __S, __m128i __A, __m128i __B)
37/// \fn __m128i _mm_dpbusds_epi32(__m128i __S, __m128i __A, __m128i __B)
38/// \fn __m128i _mm_dpwssd_epi32(__m128i __S, __m128i __A, __m128i __B)
39/// \fn __m128i _mm_dpwssds_epi32(__m128i __S, __m128i __A, __m128i __B)
40
41/* Intrinsics with _avx_ prefix are for compatibility with msvc. */
42/* Define the default attributes for the functions in this file. */
43#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("avxvnni"), __min_vector_width__(256)))
44#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avxvnni"), __min_vector_width__(128)))
45
46/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with
47/// corresponding signed 8-bit integers in \a __B, producing 4 intermediate signed
48/// 16-bit results. Sum these 4 results with the corresponding 32-bit integer
49/// in \a __S, and store the packed 32-bit results in DST.
50///
51/// This intrinsic corresponds to the <c> VPDPBUSD </c> instructions.
52///
53/// \operation
54/// FOR j := 0 to 7
55/// tmp1.word := Signed(ZeroExtend16(__A.byte[4*j]) * SignExtend16(__B.byte[4*j]))
56/// tmp2.word := Signed(ZeroExtend16(__A.byte[4*j+1]) * SignExtend16(__B.byte[4*j+1]))
57/// tmp3.word := Signed(ZeroExtend16(__A.byte[4*j+2]) * SignExtend16(__B.byte[4*j+2]))
58/// tmp4.word := Signed(ZeroExtend16(__A.byte[4*j+3]) * SignExtend16(__B.byte[4*j+3]))
59/// DST.dword[j] := __S.dword[j] + tmp1 + tmp2 + tmp3 + tmp4
60/// ENDFOR
61/// DST[MAX:256] := 0
62/// \endoperation
63static __inline__ __m256i __DEFAULT_FN_ATTRS256
64_mm256_dpbusd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
65{
66 return (__m256i)__builtin_ia32_vpdpbusd256((__v8si)__S, (__v8si)__A, (__v8si)__B);
67}
68
69/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with
70/// corresponding signed 8-bit integers in \a __B, producing 4 intermediate signed
71/// 16-bit results. Sum these 4 results with the corresponding 32-bit integer
72/// in \a __S using signed saturation, and store the packed 32-bit results in DST.
73///
74/// This intrinsic corresponds to the <c> VPDPBUSDS </c> instructions.
75///
76/// \operation
77/// FOR j := 0 to 7
78/// tmp1.word := Signed(ZeroExtend16(__A.byte[4*j]) * SignExtend16(__B.byte[4*j]))
79/// tmp2.word := Signed(ZeroExtend16(__A.byte[4*j+1]) * SignExtend16(__B.byte[4*j+1]))
80/// tmp3.word := Signed(ZeroExtend16(__A.byte[4*j+2]) * SignExtend16(__B.byte[4*j+2]))
81/// tmp4.word := Signed(ZeroExtend16(__A.byte[4*j+3]) * SignExtend16(__B.byte[4*j+3]))
82/// DST.dword[j] := Saturate32(__S.dword[j] + tmp1 + tmp2 + tmp3 + tmp4)
83/// ENDFOR
84/// DST[MAX:256] := 0
85/// \endoperation
86static __inline__ __m256i __DEFAULT_FN_ATTRS256
87_mm256_dpbusds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
88{
89 return (__m256i)__builtin_ia32_vpdpbusds256((__v8si)__S, (__v8si)__A, (__v8si)__B);
90}
91
92/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with
93/// corresponding 16-bit integers in \a __B, producing 2 intermediate signed 32-bit
94/// results. Sum these 2 results with the corresponding 32-bit integer in \a __S,
95/// and store the packed 32-bit results in DST.
96///
97/// This intrinsic corresponds to the <c> VPDPWSSD </c> instructions.
98///
99/// \operation
100/// FOR j := 0 to 7
101/// tmp1.dword := SignExtend32(__A.word[2*j]) * SignExtend32(__B.word[2*j])
102/// tmp2.dword := SignExtend32(__A.word[2*j+1]) * SignExtend32(__B.word[2*j+1])
103/// DST.dword[j] := __S.dword[j] + tmp1 + tmp2
104/// ENDFOR
105/// DST[MAX:256] := 0
106/// \endoperation
107static __inline__ __m256i __DEFAULT_FN_ATTRS256
108_mm256_dpwssd_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
109{
110 return (__m256i)__builtin_ia32_vpdpwssd256((__v8si)__S, (__v8si)__A, (__v8si)__B);
111}
112
113/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with
114/// corresponding 16-bit integers in \a __B, producing 2 intermediate signed 32-bit
115/// results. Sum these 2 results with the corresponding 32-bit integer in \a __S
116/// using signed saturation, and store the packed 32-bit results in DST.
117///
118/// This intrinsic corresponds to the <c> VPDPWSSDS </c> instructions.
119///
120/// \operation
121/// FOR j := 0 to 7
122/// tmp1.dword := SignExtend32(__A.word[2*j]) * SignExtend32(__B.word[2*j])
123/// tmp2.dword := SignExtend32(__A.word[2*j+1]) * SignExtend32(__B.word[2*j+1])
124/// DST.dword[j] := Saturate32(__S.dword[j] + tmp1 + tmp2)
125/// ENDFOR
126/// DST[MAX:256] := 0
127/// \endoperation
128static __inline__ __m256i __DEFAULT_FN_ATTRS256
129_mm256_dpwssds_avx_epi32(__m256i __S, __m256i __A, __m256i __B)
130{
131 return (__m256i)__builtin_ia32_vpdpwssds256((__v8si)__S, (__v8si)__A, (__v8si)__B);
132}
133
134/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with
135/// corresponding signed 8-bit integers in \a __B, producing 4 intermediate signed
136/// 16-bit results. Sum these 4 results with the corresponding 32-bit integer
137/// in \a __S, and store the packed 32-bit results in DST.
138///
139/// This intrinsic corresponds to the <c> VPDPBUSD </c> instructions.
140///
141/// \operation
142/// FOR j := 0 to 3
143/// tmp1.word := Signed(ZeroExtend16(__A.byte[4*j]) * SignExtend16(__B.byte[4*j]))
144/// tmp2.word := Signed(ZeroExtend16(__A.byte[4*j+1]) * SignExtend16(__B.byte[4*j+1]))
145/// tmp3.word := Signed(ZeroExtend16(__A.byte[4*j+2]) * SignExtend16(__B.byte[4*j+2]))
146/// tmp4.word := Signed(ZeroExtend16(__A.byte[4*j+3]) * SignExtend16(__B.byte[4*j+3]))
147/// DST.dword[j] := __S.dword[j] + tmp1 + tmp2 + tmp3 + tmp4
148/// ENDFOR
149/// DST[MAX:128] := 0
150/// \endoperation
151static __inline__ __m128i __DEFAULT_FN_ATTRS128
152_mm_dpbusd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)
153{
154 return (__m128i)__builtin_ia32_vpdpbusd128((__v4si)__S, (__v4si)__A, (__v4si)__B);
155}
156
157/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a __A with
158/// corresponding signed 8-bit integers in \a __B, producing 4 intermediate signed
159/// 16-bit results. Sum these 4 results with the corresponding 32-bit integer
160/// in \a __S using signed saturation, and store the packed 32-bit results in DST.
161///
162/// This intrinsic corresponds to the <c> VPDPBUSDS </c> instructions.
163///
164/// \operation
165/// FOR j := 0 to 3
166/// tmp1.word := Signed(ZeroExtend16(__A.byte[4*j]) * SignExtend16(__B.byte[4*j]))
167/// tmp2.word := Signed(ZeroExtend16(__A.byte[4*j+1]) * SignExtend16(__B.byte[4*j+1]))
168/// tmp3.word := Signed(ZeroExtend16(__A.byte[4*j+2]) * SignExtend16(__B.byte[4*j+2]))
169/// tmp4.word := Signed(ZeroExtend16(__A.byte[4*j+3]) * SignExtend16(__B.byte[4*j+3]))
170/// DST.dword[j] := Saturate32(__S.dword[j] + tmp1 + tmp2 + tmp3 + tmp4)
171/// ENDFOR
172/// DST[MAX:128] := 0
173/// \endoperation
174static __inline__ __m128i __DEFAULT_FN_ATTRS128
175_mm_dpbusds_avx_epi32(__m128i __S, __m128i __A, __m128i __B)
176{
177 return (__m128i)__builtin_ia32_vpdpbusds128((__v4si)__S, (__v4si)__A, (__v4si)__B);
178}
179
180/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with
181/// corresponding 16-bit integers in \a __B, producing 2 intermediate signed 32-bit
182/// results. Sum these 2 results with the corresponding 32-bit integer in \a __S,
183/// and store the packed 32-bit results in DST.
184///
185/// This intrinsic corresponds to the <c> VPDPWSSD </c> instructions.
186///
187/// \operation
188/// FOR j := 0 to 3
189/// tmp1.dword := SignExtend32(__A.word[2*j]) * SignExtend32(__B.word[2*j])
190/// tmp2.dword := SignExtend32(__A.word[2*j+1]) * SignExtend32(__B.word[2*j+1])
191/// DST.dword[j] := __S.dword[j] + tmp1 + tmp2
192/// ENDFOR
193/// DST[MAX:128] := 0
194/// \endoperation
195static __inline__ __m128i __DEFAULT_FN_ATTRS128
196_mm_dpwssd_avx_epi32(__m128i __S, __m128i __A, __m128i __B)
197{
198 return (__m128i)__builtin_ia32_vpdpwssd128((__v4si)__S, (__v4si)__A, (__v4si)__B);
199}
200
201/// Multiply groups of 2 adjacent pairs of signed 16-bit integers in \a __A with
202/// corresponding 16-bit integers in \a __B, producing 2 intermediate signed 32-bit
203/// results. Sum these 2 results with the corresponding 32-bit integer in \a __S
204/// using signed saturation, and store the packed 32-bit results in DST.
205///
206/// This intrinsic corresponds to the <c> VPDPWSSDS </c> instructions.
207///
208/// \operation
209/// FOR j := 0 to 3
210/// tmp1.dword := SignExtend32(__A.word[2*j]) * SignExtend32(__B.word[2*j])
211/// tmp2.dword := SignExtend32(__A.word[2*j+1]) * SignExtend32(__B.word[2*j+1])
212/// DST.dword[j] := Saturate32(__S.dword[j] + tmp1 + tmp2)
213/// ENDFOR
214/// DST[MAX:128] := 0
215/// \endoperation
216static __inline__ __m128i __DEFAULT_FN_ATTRS128
217_mm_dpwssds_avx_epi32(__m128i __S, __m128i __A, __m128i __B)
218{
219 return (__m128i)__builtin_ia32_vpdpwssds128((__v4si)__S, (__v4si)__A, (__v4si)__B);
220}
221
222#undef __DEFAULT_FN_ATTRS128
223#undef __DEFAULT_FN_ATTRS256
224
225#endif // __AVXVNNIINTRIN_H
lib/include/cpuid.h+8
...@@ -7,6 +7,9 @@...@@ -7,6 +7,9 @@
7 *===-----------------------------------------------------------------------===7 *===-----------------------------------------------------------------------===
8 */8 */
99
10#ifndef __CPUID_H
11#define __CPUID_H
12
10#if !(__x86_64__ || __i386__)13#if !(__x86_64__ || __i386__)
11#error this header is for x86 only14#error this header is for x86 only
12#endif15#endif
...@@ -186,6 +189,7 @@...@@ -186,6 +189,7 @@
186/* Features in %edx for leaf 7 sub-leaf 0 */189/* Features in %edx for leaf 7 sub-leaf 0 */
187#define bit_AVX5124VNNIW 0x00000004190#define bit_AVX5124VNNIW 0x00000004
188#define bit_AVX5124FMAPS 0x00000008191#define bit_AVX5124FMAPS 0x00000008
192#define bit_UINTR 0x00000020
189#define bit_SERIALIZE 0x00004000193#define bit_SERIALIZE 0x00004000
190#define bit_TSXLDTRK 0x00010000194#define bit_TSXLDTRK 0x00010000
191#define bit_PCONFIG 0x00040000195#define bit_PCONFIG 0x00040000
...@@ -195,7 +199,9 @@...@@ -195,7 +199,9 @@
195#define bit_AMXINT8 0x02000000199#define bit_AMXINT8 0x02000000
196200
197/* Features in %eax for leaf 7 sub-leaf 1 */201/* Features in %eax for leaf 7 sub-leaf 1 */
202#define bit_AVXVNNI 0x00000008
198#define bit_AVX512BF16 0x00000020203#define bit_AVX512BF16 0x00000020
204#define bit_HRESET 0x00400000
199205
200/* Features in %eax for leaf 13 sub-leaf 1 */206/* Features in %eax for leaf 13 sub-leaf 1 */
201#define bit_XSAVEOPT 0x00000001207#define bit_XSAVEOPT 0x00000001
...@@ -309,3 +315,5 @@ static __inline int __get_cpuid_count (unsigned int __leaf,...@@ -309,3 +315,5 @@ static __inline int __get_cpuid_count (unsigned int __leaf,
309 __cpuid_count(__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx);315 __cpuid_count(__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx);
310 return 1;316 return 1;
311}317}
318
319#endif /* __CPUID_H */
lib/include/cuda_wrappers/algorithm+1-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/*===---- complex - CUDA wrapper for <algorithm> ----------------------------===1/*===---- algorithm - CUDA wrapper for <algorithm> -------------------------===
2 *2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal4 * of this software and associated documentation files (the "Software"), to deal
lib/include/cuda_wrappers/new+9-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1/*===---- complex - CUDA wrapper for <new> ------------------------------===1/*===---- new - CUDA wrapper for <new> -------------------------------------===
2 *2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal4 * of this software and associated documentation files (the "Software"), to deal
...@@ -26,6 +26,13 @@...@@ -26,6 +26,13 @@
2626
27#include_next <new>27#include_next <new>
2828
29#if !defined(__device__)
30// The header has been included too early from the standard C++ library
31// and CUDA-specific macros are not available yet.
32// Undo the include guard and try again later.
33#undef __CLANG_CUDA_WRAPPERS_NEW
34#else
35
29#pragma push_macro("CUDA_NOEXCEPT")36#pragma push_macro("CUDA_NOEXCEPT")
30#if __cplusplus >= 201103L37#if __cplusplus >= 201103L
31#define CUDA_NOEXCEPT noexcept38#define CUDA_NOEXCEPT noexcept
...@@ -95,4 +102,5 @@ __device__ inline void operator delete[](void *, void *) CUDA_NOEXCEPT {}...@@ -95,4 +102,5 @@ __device__ inline void operator delete[](void *, void *) CUDA_NOEXCEPT {}
95102
96#pragma pop_macro("CUDA_NOEXCEPT")103#pragma pop_macro("CUDA_NOEXCEPT")
97104
105#endif // __device__
98#endif // include guard106#endif // include guard
lib/include/emmintrin.h+1-1
...@@ -4025,7 +4025,7 @@ _mm_storeu_si128(__m128i_u *__p, __m128i __b)...@@ -4025,7 +4025,7 @@ _mm_storeu_si128(__m128i_u *__p, __m128i __b)
4025///4025///
4026/// \param __p4026/// \param __p
4027/// A pointer to a 64-bit memory location. The address of the memory4027/// A pointer to a 64-bit memory location. The address of the memory
4028/// location does not have to be algned.4028/// location does not have to be aligned.
4029/// \param __b4029/// \param __b
4030/// A 128-bit integer vector containing the value to be stored.4030/// A 128-bit integer vector containing the value to be stored.
4031static __inline__ void __DEFAULT_FN_ATTRS4031static __inline__ void __DEFAULT_FN_ATTRS
lib/include/gfniintrin.h+90-91
...@@ -14,38 +14,56 @@...@@ -14,38 +14,56 @@
14#ifndef __GFNIINTRIN_H14#ifndef __GFNIINTRIN_H
15#define __GFNIINTRIN_H15#define __GFNIINTRIN_H
1616
17/* Default attributes for simple form (no masking). */
18#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("gfni"), __min_vector_width__(128)))
19
20/* Default attributes for YMM unmasked form. */
21#define __DEFAULT_FN_ATTRS_Y __attribute__((__always_inline__, __nodebug__, __target__("avx,gfni"), __min_vector_width__(256)))
22
23/* Default attributes for ZMM forms. */
24#define __DEFAULT_FN_ATTRS_Z __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,gfni"), __min_vector_width__(512)))
25
26/* Default attributes for VLX forms. */
27#define __DEFAULT_FN_ATTRS_VL128 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,avx512vl,gfni"), __min_vector_width__(128)))
28#define __DEFAULT_FN_ATTRS_VL256 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,avx512vl,gfni"), __min_vector_width__(256)))
1729
18#define _mm_gf2p8affineinv_epi64_epi8(A, B, I) \30#define _mm_gf2p8affineinv_epi64_epi8(A, B, I) \
19 (__m128i)__builtin_ia32_vgf2p8affineinvqb_v16qi((__v16qi)(__m128i)(A), \31 (__m128i)__builtin_ia32_vgf2p8affineinvqb_v16qi((__v16qi)(__m128i)(A), \
20 (__v16qi)(__m128i)(B), \32 (__v16qi)(__m128i)(B), \
21 (char)(I))33 (char)(I))
2234
23#define _mm_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) \35#define _mm_gf2p8affine_epi64_epi8(A, B, I) \
24 (__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \36 (__m128i)__builtin_ia32_vgf2p8affineqb_v16qi((__v16qi)(__m128i)(A), \
25 (__v16qi)_mm_gf2p8affineinv_epi64_epi8(A, B, I), \37 (__v16qi)(__m128i)(B), \
26 (__v16qi)(__m128i)(S))38 (char)(I))
27
28
29#define _mm_maskz_gf2p8affineinv_epi64_epi8(U, A, B, I) \
30 (__m128i)_mm_mask_gf2p8affineinv_epi64_epi8((__m128i)_mm_setzero_si128(), \
31 U, A, B, I)
3239
40static __inline__ __m128i __DEFAULT_FN_ATTRS
41_mm_gf2p8mul_epi8(__m128i __A, __m128i __B)
42{
43 return (__m128i) __builtin_ia32_vgf2p8mulb_v16qi((__v16qi) __A,
44 (__v16qi) __B);
45}
3346
47#ifdef __AVXINTRIN_H
34#define _mm256_gf2p8affineinv_epi64_epi8(A, B, I) \48#define _mm256_gf2p8affineinv_epi64_epi8(A, B, I) \
35 (__m256i)__builtin_ia32_vgf2p8affineinvqb_v32qi((__v32qi)(__m256i)(A), \49 (__m256i)__builtin_ia32_vgf2p8affineinvqb_v32qi((__v32qi)(__m256i)(A), \
36 (__v32qi)(__m256i)(B), \50 (__v32qi)(__m256i)(B), \
37 (char)(I))51 (char)(I))
3852
39#define _mm256_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) \53#define _mm256_gf2p8affine_epi64_epi8(A, B, I) \
40 (__m256i)__builtin_ia32_selectb_256((__mmask32)(U), \54 (__m256i)__builtin_ia32_vgf2p8affineqb_v32qi((__v32qi)(__m256i)(A), \
41 (__v32qi)_mm256_gf2p8affineinv_epi64_epi8(A, B, I), \55 (__v32qi)(__m256i)(B), \
42 (__v32qi)(__m256i)(S))56 (char)(I))
43
44#define _mm256_maskz_gf2p8affineinv_epi64_epi8(U, A, B, I) \
45 (__m256i)_mm256_mask_gf2p8affineinv_epi64_epi8((__m256i)_mm256_setzero_si256(), \
46 U, A, B, I)
4757
58static __inline__ __m256i __DEFAULT_FN_ATTRS_Y
59_mm256_gf2p8mul_epi8(__m256i __A, __m256i __B)
60{
61 return (__m256i) __builtin_ia32_vgf2p8mulb_v32qi((__v32qi) __A,
62 (__v32qi) __B);
63}
64#endif /* __AVXINTRIN_H */
4865
66#ifdef __AVX512BWINTRIN_H
49#define _mm512_gf2p8affineinv_epi64_epi8(A, B, I) \67#define _mm512_gf2p8affineinv_epi64_epi8(A, B, I) \
50 (__m512i)__builtin_ia32_vgf2p8affineinvqb_v64qi((__v64qi)(__m512i)(A), \68 (__m512i)__builtin_ia32_vgf2p8affineinvqb_v64qi((__v64qi)(__m512i)(A), \
51 (__v64qi)(__m512i)(B), \69 (__v64qi)(__m512i)(B), \
...@@ -60,27 +78,71 @@...@@ -60,27 +78,71 @@
60 (__m512i)_mm512_mask_gf2p8affineinv_epi64_epi8((__m512i)_mm512_setzero_si512(), \78 (__m512i)_mm512_mask_gf2p8affineinv_epi64_epi8((__m512i)_mm512_setzero_si512(), \
61 U, A, B, I)79 U, A, B, I)
6280
63#define _mm_gf2p8affine_epi64_epi8(A, B, I) \81#define _mm512_gf2p8affine_epi64_epi8(A, B, I) \
64 (__m128i)__builtin_ia32_vgf2p8affineqb_v16qi((__v16qi)(__m128i)(A), \82 (__m512i)__builtin_ia32_vgf2p8affineqb_v64qi((__v64qi)(__m512i)(A), \
65 (__v16qi)(__m128i)(B), \83 (__v64qi)(__m512i)(B), \
66 (char)(I))84 (char)(I))
6785
86#define _mm512_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) \
87 (__m512i)__builtin_ia32_selectb_512((__mmask64)(U), \
88 (__v64qi)_mm512_gf2p8affine_epi64_epi8(A, B, I), \
89 (__v64qi)(__m512i)(S))
90
91#define _mm512_maskz_gf2p8affine_epi64_epi8(U, A, B, I) \
92 (__m512i)_mm512_mask_gf2p8affine_epi64_epi8((__m512i)_mm512_setzero_si512(), \
93 U, A, B, I)
94
95static __inline__ __m512i __DEFAULT_FN_ATTRS_Z
96_mm512_gf2p8mul_epi8(__m512i __A, __m512i __B)
97{
98 return (__m512i) __builtin_ia32_vgf2p8mulb_v64qi((__v64qi) __A,
99 (__v64qi) __B);
100}
101
102static __inline__ __m512i __DEFAULT_FN_ATTRS_Z
103_mm512_mask_gf2p8mul_epi8(__m512i __S, __mmask64 __U, __m512i __A, __m512i __B)
104{
105 return (__m512i) __builtin_ia32_selectb_512(__U,
106 (__v64qi) _mm512_gf2p8mul_epi8(__A, __B),
107 (__v64qi) __S);
108}
109
110static __inline__ __m512i __DEFAULT_FN_ATTRS_Z
111_mm512_maskz_gf2p8mul_epi8(__mmask64 __U, __m512i __A, __m512i __B)
112{
113 return _mm512_mask_gf2p8mul_epi8((__m512i)_mm512_setzero_si512(),
114 __U, __A, __B);
115}
116#endif /* __AVX512BWINTRIN_H */
117
118#ifdef __AVX512VLBWINTRIN_H
119#define _mm_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) \
120 (__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \
121 (__v16qi)_mm_gf2p8affineinv_epi64_epi8(A, B, I), \
122 (__v16qi)(__m128i)(S))
123
124#define _mm_maskz_gf2p8affineinv_epi64_epi8(U, A, B, I) \
125 (__m128i)_mm_mask_gf2p8affineinv_epi64_epi8((__m128i)_mm_setzero_si128(), \
126 U, A, B, I)
127
128#define _mm256_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) \
129 (__m256i)__builtin_ia32_selectb_256((__mmask32)(U), \
130 (__v32qi)_mm256_gf2p8affineinv_epi64_epi8(A, B, I), \
131 (__v32qi)(__m256i)(S))
132
133#define _mm256_maskz_gf2p8affineinv_epi64_epi8(U, A, B, I) \
134 (__m256i)_mm256_mask_gf2p8affineinv_epi64_epi8((__m256i)_mm256_setzero_si256(), \
135 U, A, B, I)
136
68#define _mm_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) \137#define _mm_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) \
69 (__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \138 (__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \
70 (__v16qi)_mm_gf2p8affine_epi64_epi8(A, B, I), \139 (__v16qi)_mm_gf2p8affine_epi64_epi8(A, B, I), \
71 (__v16qi)(__m128i)(S))140 (__v16qi)(__m128i)(S))
72141
73
74#define _mm_maskz_gf2p8affine_epi64_epi8(U, A, B, I) \142#define _mm_maskz_gf2p8affine_epi64_epi8(U, A, B, I) \
75 (__m128i)_mm_mask_gf2p8affine_epi64_epi8((__m128i)_mm_setzero_si128(), \143 (__m128i)_mm_mask_gf2p8affine_epi64_epi8((__m128i)_mm_setzero_si128(), \
76 U, A, B, I)144 U, A, B, I)
77145
78
79#define _mm256_gf2p8affine_epi64_epi8(A, B, I) \
80 (__m256i)__builtin_ia32_vgf2p8affineqb_v32qi((__v32qi)(__m256i)(A), \
81 (__v32qi)(__m256i)(B), \
82 (char)(I))
83
84#define _mm256_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) \146#define _mm256_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) \
85 (__m256i)__builtin_ia32_selectb_256((__mmask32)(U), \147 (__m256i)__builtin_ia32_selectb_256((__mmask32)(U), \
86 (__v32qi)_mm256_gf2p8affine_epi64_epi8(A, B, I), \148 (__v32qi)_mm256_gf2p8affine_epi64_epi8(A, B, I), \
...@@ -90,41 +152,6 @@...@@ -90,41 +152,6 @@
90 (__m256i)_mm256_mask_gf2p8affine_epi64_epi8((__m256i)_mm256_setzero_si256(), \152 (__m256i)_mm256_mask_gf2p8affine_epi64_epi8((__m256i)_mm256_setzero_si256(), \
91 U, A, B, I)153 U, A, B, I)
92154
93
94#define _mm512_gf2p8affine_epi64_epi8(A, B, I) \
95 (__m512i)__builtin_ia32_vgf2p8affineqb_v64qi((__v64qi)(__m512i)(A), \
96 (__v64qi)(__m512i)(B), \
97 (char)(I))
98
99#define _mm512_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) \
100 (__m512i)__builtin_ia32_selectb_512((__mmask64)(U), \
101 (__v64qi)_mm512_gf2p8affine_epi64_epi8(A, B, I), \
102 (__v64qi)(__m512i)(S))
103
104#define _mm512_maskz_gf2p8affine_epi64_epi8(U, A, B, I) \
105 (__m512i)_mm512_mask_gf2p8affine_epi64_epi8((__m512i)_mm512_setzero_si512(), \
106 U, A, B, I)
107
108/* Default attributes for simple form (no masking). */
109#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("gfni"), __min_vector_width__(128)))
110
111/* Default attributes for YMM unmasked form. */
112#define __DEFAULT_FN_ATTRS_Y __attribute__((__always_inline__, __nodebug__, __target__("avx,gfni"), __min_vector_width__(256)))
113
114/* Default attributes for ZMM forms. */
115#define __DEFAULT_FN_ATTRS_Z __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,gfni"), __min_vector_width__(512)))
116
117/* Default attributes for VLX forms. */
118#define __DEFAULT_FN_ATTRS_VL128 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,avx512vl,gfni"), __min_vector_width__(128)))
119#define __DEFAULT_FN_ATTRS_VL256 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,avx512vl,gfni"), __min_vector_width__(256)))
120
121static __inline__ __m128i __DEFAULT_FN_ATTRS
122_mm_gf2p8mul_epi8(__m128i __A, __m128i __B)
123{
124 return (__m128i) __builtin_ia32_vgf2p8mulb_v16qi((__v16qi) __A,
125 (__v16qi) __B);
126}
127
128static __inline__ __m128i __DEFAULT_FN_ATTRS_VL128155static __inline__ __m128i __DEFAULT_FN_ATTRS_VL128
129_mm_mask_gf2p8mul_epi8(__m128i __S, __mmask16 __U, __m128i __A, __m128i __B)156_mm_mask_gf2p8mul_epi8(__m128i __S, __mmask16 __U, __m128i __A, __m128i __B)
130{157{
...@@ -140,13 +167,6 @@ _mm_maskz_gf2p8mul_epi8(__mmask16 __U, __m128i __A, __m128i __B)...@@ -140,13 +167,6 @@ _mm_maskz_gf2p8mul_epi8(__mmask16 __U, __m128i __A, __m128i __B)
140 __U, __A, __B);167 __U, __A, __B);
141}168}
142169
143static __inline__ __m256i __DEFAULT_FN_ATTRS_Y
144_mm256_gf2p8mul_epi8(__m256i __A, __m256i __B)
145{
146 return (__m256i) __builtin_ia32_vgf2p8mulb_v32qi((__v32qi) __A,
147 (__v32qi) __B);
148}
149
150static __inline__ __m256i __DEFAULT_FN_ATTRS_VL256170static __inline__ __m256i __DEFAULT_FN_ATTRS_VL256
151_mm256_mask_gf2p8mul_epi8(__m256i __S, __mmask32 __U, __m256i __A, __m256i __B)171_mm256_mask_gf2p8mul_epi8(__m256i __S, __mmask32 __U, __m256i __A, __m256i __B)
152{172{
...@@ -161,28 +181,7 @@ _mm256_maskz_gf2p8mul_epi8(__mmask32 __U, __m256i __A, __m256i __B)...@@ -161,28 +181,7 @@ _mm256_maskz_gf2p8mul_epi8(__mmask32 __U, __m256i __A, __m256i __B)
161 return _mm256_mask_gf2p8mul_epi8((__m256i)_mm256_setzero_si256(),181 return _mm256_mask_gf2p8mul_epi8((__m256i)_mm256_setzero_si256(),
162 __U, __A, __B);182 __U, __A, __B);
163}183}
164184#endif /* __AVX512VLBWINTRIN_H */
165static __inline__ __m512i __DEFAULT_FN_ATTRS_Z
166_mm512_gf2p8mul_epi8(__m512i __A, __m512i __B)
167{
168 return (__m512i) __builtin_ia32_vgf2p8mulb_v64qi((__v64qi) __A,
169 (__v64qi) __B);
170}
171
172static __inline__ __m512i __DEFAULT_FN_ATTRS_Z
173_mm512_mask_gf2p8mul_epi8(__m512i __S, __mmask64 __U, __m512i __A, __m512i __B)
174{
175 return (__m512i) __builtin_ia32_selectb_512(__U,
176 (__v64qi) _mm512_gf2p8mul_epi8(__A, __B),
177 (__v64qi) __S);
178}
179
180static __inline__ __m512i __DEFAULT_FN_ATTRS_Z
181_mm512_maskz_gf2p8mul_epi8(__mmask64 __U, __m512i __A, __m512i __B)
182{
183 return _mm512_mask_gf2p8mul_epi8((__m512i)_mm512_setzero_si512(),
184 __U, __A, __B);
185}
186185
187#undef __DEFAULT_FN_ATTRS186#undef __DEFAULT_FN_ATTRS
188#undef __DEFAULT_FN_ATTRS_Y187#undef __DEFAULT_FN_ATTRS_Y
lib/include/hresetintrin.h created+49
...@@ -0,0 +1,49 @@
1/*===---------------- hresetintrin.h - HRESET 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#ifndef __X86GPRINTRIN_H
10#error "Never use <hresetintrin.h> directly; include <x86gprintrin.h> instead."
11#endif
12
13#ifndef __HRESETINTRIN_H
14#define __HRESETINTRIN_H
15
16#if __has_extension(gnu_asm)
17
18/* Define the default attributes for the functions in this file. */
19#define __DEFAULT_FN_ATTRS \
20 __attribute__((__always_inline__, __nodebug__, __target__("hreset")))
21
22/// Provides a hint to the processor to selectively reset the prediction
23/// history of the current logical processor specified by a 32-bit integer
24/// value \a __eax.
25///
26/// This intrinsic corresponds to the <c> HRESET </c> instruction.
27///
28/// \operation
29/// IF __eax == 0
30/// // nop
31/// ELSE
32/// FOR i := 0 to 31
33/// IF __eax[i]
34/// ResetPredictionFeature(i)
35/// FI
36/// ENDFOR
37/// FI
38/// \endoperation
39static __inline void __DEFAULT_FN_ATTRS
40_hreset(int __eax)
41{
42 __asm__ ("hreset $0" :: "a"(__eax));
43}
44
45#undef __DEFAULT_FN_ATTRS
46
47#endif /* __has_extension(gnu_asm) */
48
49#endif /* __HRESETINTRIN_H */
lib/include/ia32intrin.h+53-44
...@@ -14,6 +14,18 @@...@@ -14,6 +14,18 @@
14#ifndef __IA32INTRIN_H14#ifndef __IA32INTRIN_H
15#define __IA32INTRIN_H15#define __IA32INTRIN_H
1616
17/* Define the default attributes for the functions in this file. */
18#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
19#define __DEFAULT_FN_ATTRS_SSE42 __attribute__((__always_inline__, __nodebug__, __target__("sse4.2")))
20
21#if defined(__cplusplus) && (__cplusplus >= 201103L)
22#define __DEFAULT_FN_ATTRS_CAST __attribute__((__always_inline__)) constexpr
23#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
24#else
25#define __DEFAULT_FN_ATTRS_CAST __attribute__((__always_inline__))
26#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
27#endif
28
17/** Find the first set bit starting from the lsb. Result is undefined if29/** Find the first set bit starting from the lsb. Result is undefined if
18 * input is 0.30 * input is 0.
19 *31 *
...@@ -26,7 +38,7 @@...@@ -26,7 +38,7 @@
26 * A 32-bit integer operand.38 * A 32-bit integer operand.
27 * \returns A 32-bit integer containing the bit number.39 * \returns A 32-bit integer containing the bit number.
28 */40 */
29static __inline__ int __attribute__((__always_inline__, __nodebug__))41static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
30__bsfd(int __A) {42__bsfd(int __A) {
31 return __builtin_ctz(__A);43 return __builtin_ctz(__A);
32}44}
...@@ -43,7 +55,7 @@ __bsfd(int __A) {...@@ -43,7 +55,7 @@ __bsfd(int __A) {
43 * A 32-bit integer operand.55 * A 32-bit integer operand.
44 * \returns A 32-bit integer containing the bit number.56 * \returns A 32-bit integer containing the bit number.
45 */57 */
46static __inline__ int __attribute__((__always_inline__, __nodebug__))58static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
47__bsrd(int __A) {59__bsrd(int __A) {
48 return 31 - __builtin_clz(__A);60 return 31 - __builtin_clz(__A);
49}61}
...@@ -59,12 +71,12 @@ __bsrd(int __A) {...@@ -59,12 +71,12 @@ __bsrd(int __A) {
59 * A 32-bit integer operand.71 * A 32-bit integer operand.
60 * \returns A 32-bit integer containing the swapped bytes.72 * \returns A 32-bit integer containing the swapped bytes.
61 */73 */
62static __inline__ int __attribute__((__always_inline__, __nodebug__))74static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
63__bswapd(int __A) {75__bswapd(int __A) {
64 return __builtin_bswap32(__A);76 return __builtin_bswap32(__A);
65}77}
6678
67static __inline__ int __attribute__((__always_inline__, __nodebug__))79static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
68_bswap(int __A) {80_bswap(int __A) {
69 return __builtin_bswap32(__A);81 return __builtin_bswap32(__A);
70}82}
...@@ -85,7 +97,7 @@ _bswap(int __A) {...@@ -85,7 +97,7 @@ _bswap(int __A) {
85 * A 64-bit integer operand.97 * A 64-bit integer operand.
86 * \returns A 32-bit integer containing the bit number.98 * \returns A 32-bit integer containing the bit number.
87 */99 */
88static __inline__ int __attribute__((__always_inline__, __nodebug__))100static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
89__bsfq(long long __A) {101__bsfq(long long __A) {
90 return __builtin_ctzll(__A);102 return __builtin_ctzll(__A);
91}103}
...@@ -102,7 +114,7 @@ __bsfq(long long __A) {...@@ -102,7 +114,7 @@ __bsfq(long long __A) {
102 * A 64-bit integer operand.114 * A 64-bit integer operand.
103 * \returns A 32-bit integer containing the bit number.115 * \returns A 32-bit integer containing the bit number.
104 */116 */
105static __inline__ int __attribute__((__always_inline__, __nodebug__))117static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
106__bsrq(long long __A) {118__bsrq(long long __A) {
107 return 63 - __builtin_clzll(__A);119 return 63 - __builtin_clzll(__A);
108}120}
...@@ -118,7 +130,7 @@ __bsrq(long long __A) {...@@ -118,7 +130,7 @@ __bsrq(long long __A) {
118 * A 64-bit integer operand.130 * A 64-bit integer operand.
119 * \returns A 64-bit integer containing the swapped bytes.131 * \returns A 64-bit integer containing the swapped bytes.
120 */132 */
121static __inline__ long long __attribute__((__always_inline__, __nodebug__))133static __inline__ long long __DEFAULT_FN_ATTRS_CONSTEXPR
122__bswapq(long long __A) {134__bswapq(long long __A) {
123 return __builtin_bswap64(__A);135 return __builtin_bswap64(__A);
124}136}
...@@ -138,7 +150,7 @@ __bswapq(long long __A) {...@@ -138,7 +150,7 @@ __bswapq(long long __A) {
138 * \returns A 32-bit integer containing the number of bits with value 1 in the150 * \returns A 32-bit integer containing the number of bits with value 1 in the
139 * source operand.151 * source operand.
140 */152 */
141static __inline__ int __attribute__((__always_inline__, __nodebug__))153static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
142__popcntd(unsigned int __A)154__popcntd(unsigned int __A)
143{155{
144 return __builtin_popcount(__A);156 return __builtin_popcount(__A);
...@@ -159,7 +171,7 @@ __popcntd(unsigned int __A)...@@ -159,7 +171,7 @@ __popcntd(unsigned int __A)
159 * \returns A 64-bit integer containing the number of bits with value 1 in the171 * \returns A 64-bit integer containing the number of bits with value 1 in the
160 * source operand.172 * source operand.
161 */173 */
162static __inline__ long long __attribute__((__always_inline__, __nodebug__))174static __inline__ long long __DEFAULT_FN_ATTRS_CONSTEXPR
163__popcntq(unsigned long long __A)175__popcntq(unsigned long long __A)
164{176{
165 return __builtin_popcountll(__A);177 return __builtin_popcountll(__A);
...@@ -169,26 +181,26 @@ __popcntq(unsigned long long __A)...@@ -169,26 +181,26 @@ __popcntq(unsigned long long __A)
169#endif /* __x86_64__ */181#endif /* __x86_64__ */
170182
171#ifdef __x86_64__183#ifdef __x86_64__
172static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))184static __inline__ unsigned long long __DEFAULT_FN_ATTRS
173__readeflags(void)185__readeflags(void)
174{186{
175 return __builtin_ia32_readeflags_u64();187 return __builtin_ia32_readeflags_u64();
176}188}
177189
178static __inline__ void __attribute__((__always_inline__, __nodebug__))190static __inline__ void __DEFAULT_FN_ATTRS
179__writeeflags(unsigned long long __f)191__writeeflags(unsigned long long __f)
180{192{
181 __builtin_ia32_writeeflags_u64(__f);193 __builtin_ia32_writeeflags_u64(__f);
182}194}
183195
184#else /* !__x86_64__ */196#else /* !__x86_64__ */
185static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__))197static __inline__ unsigned int __DEFAULT_FN_ATTRS
186__readeflags(void)198__readeflags(void)
187{199{
188 return __builtin_ia32_readeflags_u32();200 return __builtin_ia32_readeflags_u32();
189}201}
190202
191static __inline__ void __attribute__((__always_inline__, __nodebug__))203static __inline__ void __DEFAULT_FN_ATTRS
192__writeeflags(unsigned int __f)204__writeeflags(unsigned int __f)
193{205{
194 __builtin_ia32_writeeflags_u32(__f);206 __builtin_ia32_writeeflags_u32(__f);
...@@ -205,11 +217,9 @@ __writeeflags(unsigned int __f)...@@ -205,11 +217,9 @@ __writeeflags(unsigned int __f)
205 * A 32-bit float value.217 * A 32-bit float value.
206 * \returns a 32-bit unsigned integer containing the converted value.218 * \returns a 32-bit unsigned integer containing the converted value.
207 */219 */
208static __inline__ unsigned int __attribute__((__always_inline__))220static __inline__ unsigned int __DEFAULT_FN_ATTRS_CAST
209_castf32_u32(float __A) {221_castf32_u32(float __A) {
210 unsigned int D;222 return __builtin_bit_cast(unsigned int, __A);
211 __builtin_memcpy(&D, &__A, sizeof(__A));
212 return D;
213}223}
214224
215/** Cast a 64-bit float value to a 64-bit unsigned integer value225/** Cast a 64-bit float value to a 64-bit unsigned integer value
...@@ -222,11 +232,9 @@ _castf32_u32(float __A) {...@@ -222,11 +232,9 @@ _castf32_u32(float __A) {
222 * A 64-bit float value.232 * A 64-bit float value.
223 * \returns a 64-bit unsigned integer containing the converted value.233 * \returns a 64-bit unsigned integer containing the converted value.
224 */234 */
225static __inline__ unsigned long long __attribute__((__always_inline__))235static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CAST
226_castf64_u64(double __A) {236_castf64_u64(double __A) {
227 unsigned long long D;237 return __builtin_bit_cast(unsigned long long, __A);
228 __builtin_memcpy(&D, &__A, sizeof(__A));
229 return D;
230}238}
231239
232/** Cast a 32-bit unsigned integer value to a 32-bit float value240/** Cast a 32-bit unsigned integer value to a 32-bit float value
...@@ -239,11 +247,9 @@ _castf64_u64(double __A) {...@@ -239,11 +247,9 @@ _castf64_u64(double __A) {
239 * A 32-bit unsigned integer value.247 * A 32-bit unsigned integer value.
240 * \returns a 32-bit float value containing the converted value.248 * \returns a 32-bit float value containing the converted value.
241 */249 */
242static __inline__ float __attribute__((__always_inline__))250static __inline__ float __DEFAULT_FN_ATTRS_CAST
243_castu32_f32(unsigned int __A) {251_castu32_f32(unsigned int __A) {
244 float D;252 return __builtin_bit_cast(float, __A);
245 __builtin_memcpy(&D, &__A, sizeof(__A));
246 return D;
247}253}
248254
249/** Cast a 64-bit unsigned integer value to a 64-bit float value255/** Cast a 64-bit unsigned integer value to a 64-bit float value
...@@ -256,11 +262,9 @@ _castu32_f32(unsigned int __A) {...@@ -256,11 +262,9 @@ _castu32_f32(unsigned int __A) {
256 * A 64-bit unsigned integer value.262 * A 64-bit unsigned integer value.
257 * \returns a 64-bit float value containing the converted value.263 * \returns a 64-bit float value containing the converted value.
258 */264 */
259static __inline__ double __attribute__((__always_inline__))265static __inline__ double __DEFAULT_FN_ATTRS_CAST
260_castu64_f64(unsigned long long __A) {266_castu64_f64(unsigned long long __A) {
261 double D;267 return __builtin_bit_cast(double, __A);
262 __builtin_memcpy(&D, &__A, sizeof(__A));
263 return D;
264}268}
265269
266/** Adds the unsigned integer operand to the CRC-32C checksum of the270/** Adds the unsigned integer operand to the CRC-32C checksum of the
...@@ -278,7 +282,7 @@ _castu64_f64(unsigned long long __A) {...@@ -278,7 +282,7 @@ _castu64_f64(unsigned long long __A) {
278 * \returns The result of adding operand \a __C to the CRC-32C checksum of282 * \returns The result of adding operand \a __C to the CRC-32C checksum of
279 * operand \a __D.283 * operand \a __D.
280 */284 */
281static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("sse4.2")))285static __inline__ unsigned int __DEFAULT_FN_ATTRS_SSE42
282__crc32b(unsigned int __C, unsigned char __D)286__crc32b(unsigned int __C, unsigned char __D)
283{287{
284 return __builtin_ia32_crc32qi(__C, __D);288 return __builtin_ia32_crc32qi(__C, __D);
...@@ -299,7 +303,7 @@ __crc32b(unsigned int __C, unsigned char __D)...@@ -299,7 +303,7 @@ __crc32b(unsigned int __C, unsigned char __D)
299 * \returns The result of adding operand \a __C to the CRC-32C checksum of303 * \returns The result of adding operand \a __C to the CRC-32C checksum of
300 * operand \a __D.304 * operand \a __D.
301 */305 */
302static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("sse4.2")))306static __inline__ unsigned int __DEFAULT_FN_ATTRS_SSE42
303__crc32w(unsigned int __C, unsigned short __D)307__crc32w(unsigned int __C, unsigned short __D)
304{308{
305 return __builtin_ia32_crc32hi(__C, __D);309 return __builtin_ia32_crc32hi(__C, __D);
...@@ -320,7 +324,7 @@ __crc32w(unsigned int __C, unsigned short __D)...@@ -320,7 +324,7 @@ __crc32w(unsigned int __C, unsigned short __D)
320 * \returns The result of adding operand \a __C to the CRC-32C checksum of324 * \returns The result of adding operand \a __C to the CRC-32C checksum of
321 * operand \a __D.325 * operand \a __D.
322 */326 */
323static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("sse4.2")))327static __inline__ unsigned int __DEFAULT_FN_ATTRS_SSE42
324__crc32d(unsigned int __C, unsigned int __D)328__crc32d(unsigned int __C, unsigned int __D)
325{329{
326 return __builtin_ia32_crc32si(__C, __D);330 return __builtin_ia32_crc32si(__C, __D);
...@@ -342,20 +346,20 @@ __crc32d(unsigned int __C, unsigned int __D)...@@ -342,20 +346,20 @@ __crc32d(unsigned int __C, unsigned int __D)
342 * \returns The result of adding operand \a __C to the CRC-32C checksum of346 * \returns The result of adding operand \a __C to the CRC-32C checksum of
343 * operand \a __D.347 * operand \a __D.
344 */348 */
345static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__, __target__("sse4.2")))349static __inline__ unsigned long long __DEFAULT_FN_ATTRS_SSE42
346__crc32q(unsigned long long __C, unsigned long long __D)350__crc32q(unsigned long long __C, unsigned long long __D)
347{351{
348 return __builtin_ia32_crc32di(__C, __D);352 return __builtin_ia32_crc32di(__C, __D);
349}353}
350#endif /* __x86_64__ */354#endif /* __x86_64__ */
351355
352static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))356static __inline__ unsigned long long __DEFAULT_FN_ATTRS
353__rdpmc(int __A) {357__rdpmc(int __A) {
354 return __builtin_ia32_rdpmc(__A);358 return __builtin_ia32_rdpmc(__A);
355}359}
356360
357/* __rdtscp */361/* __rdtscp */
358static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))362static __inline__ unsigned long long __DEFAULT_FN_ATTRS
359__rdtscp(unsigned int *__A) {363__rdtscp(unsigned int *__A) {
360 return __builtin_ia32_rdtscp(__A);364 return __builtin_ia32_rdtscp(__A);
361}365}
...@@ -364,48 +368,48 @@ __rdtscp(unsigned int *__A) {...@@ -364,48 +368,48 @@ __rdtscp(unsigned int *__A) {
364368
365#define _rdpmc(A) __rdpmc(A)369#define _rdpmc(A) __rdpmc(A)
366370
367static __inline__ void __attribute__((__always_inline__, __nodebug__))371static __inline__ void __DEFAULT_FN_ATTRS
368_wbinvd(void) {372_wbinvd(void) {
369 __builtin_ia32_wbinvd();373 __builtin_ia32_wbinvd();
370}374}
371375
372static __inline__ unsigned char __attribute__((__always_inline__, __nodebug__))376static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
373__rolb(unsigned char __X, int __C) {377__rolb(unsigned char __X, int __C) {
374 return __builtin_rotateleft8(__X, __C);378 return __builtin_rotateleft8(__X, __C);
375}379}
376380
377static __inline__ unsigned char __attribute__((__always_inline__, __nodebug__))381static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
378__rorb(unsigned char __X, int __C) {382__rorb(unsigned char __X, int __C) {
379 return __builtin_rotateright8(__X, __C);383 return __builtin_rotateright8(__X, __C);
380}384}
381385
382static __inline__ unsigned short __attribute__((__always_inline__, __nodebug__))386static __inline__ unsigned short __DEFAULT_FN_ATTRS_CONSTEXPR
383__rolw(unsigned short __X, int __C) {387__rolw(unsigned short __X, int __C) {
384 return __builtin_rotateleft16(__X, __C);388 return __builtin_rotateleft16(__X, __C);
385}389}
386390
387static __inline__ unsigned short __attribute__((__always_inline__, __nodebug__))391static __inline__ unsigned short __DEFAULT_FN_ATTRS_CONSTEXPR
388__rorw(unsigned short __X, int __C) {392__rorw(unsigned short __X, int __C) {
389 return __builtin_rotateright16(__X, __C);393 return __builtin_rotateright16(__X, __C);
390}394}
391395
392static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__))396static __inline__ unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR
393__rold(unsigned int __X, int __C) {397__rold(unsigned int __X, int __C) {
394 return __builtin_rotateleft32(__X, __C);398 return __builtin_rotateleft32(__X, __C);
395}399}
396400
397static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__))401static __inline__ unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR
398__rord(unsigned int __X, int __C) {402__rord(unsigned int __X, int __C) {
399 return __builtin_rotateright32(__X, __C);403 return __builtin_rotateright32(__X, __C);
400}404}
401405
402#ifdef __x86_64__406#ifdef __x86_64__
403static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))407static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CONSTEXPR
404__rolq(unsigned long long __X, int __C) {408__rolq(unsigned long long __X, int __C) {
405 return __builtin_rotateleft64(__X, __C);409 return __builtin_rotateleft64(__X, __C);
406}410}
407411
408static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))412static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CONSTEXPR
409__rorq(unsigned long long __X, int __C) {413__rorq(unsigned long long __X, int __C) {
410 return __builtin_rotateright64(__X, __C);414 return __builtin_rotateright64(__X, __C);
411}415}
...@@ -429,4 +433,9 @@ __rorq(unsigned long long __X, int __C) {...@@ -429,4 +433,9 @@ __rorq(unsigned long long __X, int __C) {
429#define _rotwl(a,b) __rolw((a), (b))433#define _rotwl(a,b) __rolw((a), (b))
430#define _rotwr(a,b) __rorw((a), (b))434#define _rotwr(a,b) __rorw((a), (b))
431435
436#undef __DEFAULT_FN_ATTRS
437#undef __DEFAULT_FN_ATTRS_CAST
438#undef __DEFAULT_FN_ATTRS_SSE42
439#undef __DEFAULT_FN_ATTRS_CONSTEXPR
440
432#endif /* __IA32INTRIN_H */441#endif /* __IA32INTRIN_H */
lib/include/immintrin.h+12
...@@ -10,6 +10,8 @@...@@ -10,6 +10,8 @@
10#ifndef __IMMINTRIN_H10#ifndef __IMMINTRIN_H
11#define __IMMINTRIN_H11#define __IMMINTRIN_H
1212
13#include <x86gprintrin.h>
14
13#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \15#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
14 defined(__MMX__)16 defined(__MMX__)
15#include <mmintrin.h>17#include <mmintrin.h>
...@@ -143,6 +145,11 @@...@@ -143,6 +145,11 @@
143#include <avx512vlvnniintrin.h>145#include <avx512vlvnniintrin.h>
144#endif146#endif
145147
148#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
149 defined(__AVXVNNI__)
150#include <avxvnniintrin.h>
151#endif
152
146#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \153#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
147 defined(__AVX512DQ__)154 defined(__AVX512DQ__)
148#include <avx512dqintrin.h>155#include <avx512dqintrin.h>
...@@ -471,6 +478,11 @@ _storebe_i64(void * __P, long long __D) {...@@ -471,6 +478,11 @@ _storebe_i64(void * __P, long long __D) {
471#include <invpcidintrin.h>478#include <invpcidintrin.h>
472#endif479#endif
473480
481#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
482 defined(__KL__) || defined(__WIDEKL__)
483#include <keylockerintrin.h>
484#endif
485
474#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \486#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
475 defined(__AMXTILE__) || defined(__AMXINT8__) || defined(__AMXBF16__)487 defined(__AMXTILE__) || defined(__AMXINT8__) || defined(__AMXBF16__)
476#include <amxintrin.h>488#include <amxintrin.h>
lib/include/intrin.h+78-91
...@@ -57,16 +57,11 @@ void __addfsbyte(unsigned long, unsigned char);...@@ -57,16 +57,11 @@ void __addfsbyte(unsigned long, unsigned char);
57void __addfsdword(unsigned long, unsigned long);57void __addfsdword(unsigned long, unsigned long);
58void __addfsword(unsigned long, unsigned short);58void __addfsword(unsigned long, unsigned short);
59void __code_seg(const char *);59void __code_seg(const char *);
60static __inline__
61void __cpuid(int[4], int);60void __cpuid(int[4], int);
62static __inline__
63void __cpuidex(int[4], int, int);61void __cpuidex(int[4], int, int);
64static __inline__
65__int64 __emul(int, int);62__int64 __emul(int, int);
66static __inline__
67unsigned __int64 __emulu(unsigned int, unsigned int);63unsigned __int64 __emulu(unsigned int, unsigned int);
68unsigned int __getcallerseflags(void);64unsigned int __getcallerseflags(void);
69static __inline__
70void __halt(void);65void __halt(void);
71unsigned char __inbyte(unsigned short);66unsigned char __inbyte(unsigned short);
72void __inbytestring(unsigned short, unsigned char *, unsigned long);67void __inbytestring(unsigned short, unsigned char *, unsigned long);
...@@ -82,13 +77,9 @@ void __inwordstring(unsigned short, unsigned short *, unsigned long);...@@ -82,13 +77,9 @@ void __inwordstring(unsigned short, unsigned short *, unsigned long);
82void __lidt(void *);77void __lidt(void *);
83unsigned __int64 __ll_lshift(unsigned __int64, int);78unsigned __int64 __ll_lshift(unsigned __int64, int);
84__int64 __ll_rshift(__int64, int);79__int64 __ll_rshift(__int64, int);
85static __inline__
86void __movsb(unsigned char *, unsigned char const *, size_t);80void __movsb(unsigned char *, unsigned char const *, size_t);
87static __inline__
88void __movsd(unsigned long *, unsigned long const *, size_t);81void __movsd(unsigned long *, unsigned long const *, size_t);
89static __inline__
90void __movsw(unsigned short *, unsigned short const *, size_t);82void __movsw(unsigned short *, unsigned short const *, size_t);
91static __inline__
92void __nop(void);83void __nop(void);
93void __nvreg_restore_fence(void);84void __nvreg_restore_fence(void);
94void __nvreg_save_fence(void);85void __nvreg_save_fence(void);
...@@ -105,23 +96,16 @@ unsigned long __readcr4(void);...@@ -105,23 +96,16 @@ unsigned long __readcr4(void);
105unsigned long __readcr8(void);96unsigned long __readcr8(void);
106unsigned int __readdr(unsigned int);97unsigned int __readdr(unsigned int);
107#ifdef __i386__98#ifdef __i386__
108static __inline__
109unsigned char __readfsbyte(unsigned long);99unsigned char __readfsbyte(unsigned long);
110static __inline__
111unsigned __int64 __readfsqword(unsigned long);100unsigned __int64 __readfsqword(unsigned long);
112static __inline__
113unsigned short __readfsword(unsigned long);101unsigned short __readfsword(unsigned long);
114#endif102#endif
115static __inline__
116unsigned __int64 __readmsr(unsigned long);103unsigned __int64 __readmsr(unsigned long);
117unsigned __int64 __readpmc(unsigned long);104unsigned __int64 __readpmc(unsigned long);
118unsigned long __segmentlimit(unsigned long);105unsigned long __segmentlimit(unsigned long);
119void __sidt(void *);106void __sidt(void *);
120static __inline__
121void __stosb(unsigned char *, unsigned char, size_t);107void __stosb(unsigned char *, unsigned char, size_t);
122static __inline__
123void __stosd(unsigned long *, unsigned long, size_t);108void __stosd(unsigned long *, unsigned long, size_t);
124static __inline__
125void __stosw(unsigned short *, unsigned short, size_t);109void __stosw(unsigned short *, unsigned short, size_t);
126void __svm_clgi(void);110void __svm_clgi(void);
127void __svm_invlpga(void *, int);111void __svm_invlpga(void *, int);
...@@ -136,7 +120,6 @@ void __vmx_off(void);...@@ -136,7 +120,6 @@ void __vmx_off(void);
136void __vmx_vmptrst(unsigned __int64 *);120void __vmx_vmptrst(unsigned __int64 *);
137void __wbinvd(void);121void __wbinvd(void);
138void __writecr0(unsigned int);122void __writecr0(unsigned int);
139static __inline__
140void __writecr3(unsigned __INTPTR_TYPE__);123void __writecr3(unsigned __INTPTR_TYPE__);
141void __writecr4(unsigned int);124void __writecr4(unsigned int);
142void __writecr8(unsigned int);125void __writecr8(unsigned int);
...@@ -146,11 +129,8 @@ void __writefsdword(unsigned long, unsigned long);...@@ -146,11 +129,8 @@ void __writefsdword(unsigned long, unsigned long);
146void __writefsqword(unsigned long, unsigned __int64);129void __writefsqword(unsigned long, unsigned __int64);
147void __writefsword(unsigned long, unsigned short);130void __writefsword(unsigned long, unsigned short);
148void __writemsr(unsigned long, unsigned __int64);131void __writemsr(unsigned long, unsigned __int64);
149static __inline__
150void *_AddressOfReturnAddress(void);132void *_AddressOfReturnAddress(void);
151static __inline__
152unsigned char _BitScanForward(unsigned long *_Index, unsigned long _Mask);133unsigned char _BitScanForward(unsigned long *_Index, unsigned long _Mask);
153static __inline__
154unsigned char _BitScanReverse(unsigned long *_Index, unsigned long _Mask);134unsigned char _BitScanReverse(unsigned long *_Index, unsigned long _Mask);
155unsigned char _bittest(long const *, long);135unsigned char _bittest(long const *, long);
156unsigned char _bittestandcomplement(long *, long);136unsigned char _bittestandcomplement(long *, long);
...@@ -169,12 +149,10 @@ long _InterlockedExchangeAdd_HLEAcquire(long volatile *, long);...@@ -169,12 +149,10 @@ long _InterlockedExchangeAdd_HLEAcquire(long volatile *, long);
169long _InterlockedExchangeAdd_HLERelease(long volatile *, long);149long _InterlockedExchangeAdd_HLERelease(long volatile *, long);
170__int64 _InterlockedExchangeAdd64_HLEAcquire(__int64 volatile *, __int64);150__int64 _InterlockedExchangeAdd64_HLEAcquire(__int64 volatile *, __int64);
171__int64 _InterlockedExchangeAdd64_HLERelease(__int64 volatile *, __int64);151__int64 _InterlockedExchangeAdd64_HLERelease(__int64 volatile *, __int64);
172static __inline__ void152void __attribute__((__deprecated__(
173__attribute__((__deprecated__("use other intrinsics or C++11 atomics instead")))153 "use other intrinsics or C++11 atomics instead"))) _ReadBarrier(void);
174_ReadBarrier(void);154void __attribute__((__deprecated__(
175static __inline__ void155 "use other intrinsics or C++11 atomics instead"))) _ReadWriteBarrier(void);
176__attribute__((__deprecated__("use other intrinsics or C++11 atomics instead")))
177_ReadWriteBarrier(void);
178unsigned int _rorx_u32(unsigned int, const unsigned int);156unsigned int _rorx_u32(unsigned int, const unsigned int);
179int _sarx_i32(int, unsigned int);157int _sarx_i32(int, unsigned int);
180#if __STDC_HOSTED__158#if __STDC_HOSTED__
...@@ -185,9 +163,8 @@ unsigned int _shrx_u32(unsigned int, unsigned int);...@@ -185,9 +163,8 @@ unsigned int _shrx_u32(unsigned int, unsigned int);
185void _Store_HLERelease(long volatile *, long);163void _Store_HLERelease(long volatile *, long);
186void _Store64_HLERelease(__int64 volatile *, __int64);164void _Store64_HLERelease(__int64 volatile *, __int64);
187void _StorePointer_HLERelease(void *volatile *, void *);165void _StorePointer_HLERelease(void *volatile *, void *);
188static __inline__ void166void __attribute__((__deprecated__(
189__attribute__((__deprecated__("use other intrinsics or C++11 atomics instead")))167 "use other intrinsics or C++11 atomics instead"))) _WriteBarrier(void);
190_WriteBarrier(void);
191unsigned __int32 xbegin(void);168unsigned __int32 xbegin(void);
192void _xend(void);169void _xend(void);
193170
...@@ -197,19 +174,14 @@ void __addgsbyte(unsigned long, unsigned char);...@@ -197,19 +174,14 @@ void __addgsbyte(unsigned long, unsigned char);
197void __addgsdword(unsigned long, unsigned long);174void __addgsdword(unsigned long, unsigned long);
198void __addgsqword(unsigned long, unsigned __int64);175void __addgsqword(unsigned long, unsigned __int64);
199void __addgsword(unsigned long, unsigned short);176void __addgsword(unsigned long, unsigned short);
200static __inline__
201void __faststorefence(void);177void __faststorefence(void);
202void __incgsbyte(unsigned long);178void __incgsbyte(unsigned long);
203void __incgsdword(unsigned long);179void __incgsdword(unsigned long);
204void __incgsqword(unsigned long);180void __incgsqword(unsigned long);
205void __incgsword(unsigned long);181void __incgsword(unsigned long);
206static __inline__
207void __movsq(unsigned long long *, unsigned long long const *, size_t);182void __movsq(unsigned long long *, unsigned long long const *, size_t);
208static __inline__
209unsigned char __readgsbyte(unsigned long);183unsigned char __readgsbyte(unsigned long);
210static __inline__
211unsigned long __readgsdword(unsigned long);184unsigned long __readgsdword(unsigned long);
212static __inline__
213unsigned __int64 __readgsqword(unsigned long);185unsigned __int64 __readgsqword(unsigned long);
214unsigned short __readgsword(unsigned long);186unsigned short __readgsword(unsigned long);
215unsigned __int64 __shiftleft128(unsigned __int64 _LowPart,187unsigned __int64 __shiftleft128(unsigned __int64 _LowPart,
...@@ -218,7 +190,6 @@ unsigned __int64 __shiftleft128(unsigned __int64 _LowPart,...@@ -218,7 +190,6 @@ unsigned __int64 __shiftleft128(unsigned __int64 _LowPart,
218unsigned __int64 __shiftright128(unsigned __int64 _LowPart,190unsigned __int64 __shiftright128(unsigned __int64 _LowPart,
219 unsigned __int64 _HighPart,191 unsigned __int64 _HighPart,
220 unsigned char _Shift);192 unsigned char _Shift);
221static __inline__
222void __stosq(unsigned __int64 *, unsigned __int64, size_t);193void __stosq(unsigned __int64 *, unsigned __int64, size_t);
223unsigned char __vmx_on(unsigned __int64 *);194unsigned char __vmx_on(unsigned __int64 *);
224unsigned char __vmx_vmclear(unsigned __int64 *);195unsigned char __vmx_vmclear(unsigned __int64 *);
...@@ -243,10 +214,6 @@ unsigned char _interlockedbittestandreset64(__int64 volatile *, __int64);...@@ -243,10 +214,6 @@ unsigned char _interlockedbittestandreset64(__int64 volatile *, __int64);
243unsigned char _interlockedbittestandset64(__int64 volatile *, __int64);214unsigned char _interlockedbittestandset64(__int64 volatile *, __int64);
244long _InterlockedCompareExchange_np(long volatile *_Destination, long _Exchange,215long _InterlockedCompareExchange_np(long volatile *_Destination, long _Exchange,
245 long _Comparand);216 long _Comparand);
246unsigned char _InterlockedCompareExchange128(__int64 volatile *_Destination,
247 __int64 _ExchangeHigh,
248 __int64 _ExchangeLow,
249 __int64 *_CompareandResult);
250unsigned char _InterlockedCompareExchange128_np(__int64 volatile *_Destination,217unsigned char _InterlockedCompareExchange128_np(__int64 volatile *_Destination,
251 __int64 _ExchangeHigh,218 __int64 _ExchangeHigh,
252 __int64 _ExchangeLow,219 __int64 _ExchangeLow,
...@@ -269,13 +236,9 @@ unsigned __int64 _rorx_u64(unsigned __int64, const unsigned int);...@@ -269,13 +236,9 @@ unsigned __int64 _rorx_u64(unsigned __int64, const unsigned int);
269__int64 _sarx_i64(__int64, unsigned int);236__int64 _sarx_i64(__int64, unsigned int);
270unsigned __int64 _shlx_u64(unsigned __int64, unsigned int);237unsigned __int64 _shlx_u64(unsigned __int64, unsigned int);
271unsigned __int64 _shrx_u64(unsigned __int64, unsigned int);238unsigned __int64 _shrx_u64(unsigned __int64, unsigned int);
272static __inline__
273__int64 __mulh(__int64, __int64);239__int64 __mulh(__int64, __int64);
274static __inline__
275unsigned __int64 __umulh(unsigned __int64, unsigned __int64);240unsigned __int64 __umulh(unsigned __int64, unsigned __int64);
276static __inline__
277__int64 _mul128(__int64, __int64, __int64*);241__int64 _mul128(__int64, __int64, __int64*);
278static __inline__
279unsigned __int64 _umul128(unsigned __int64,242unsigned __int64 _umul128(unsigned __int64,
280 unsigned __int64,243 unsigned __int64,
281 unsigned __int64*);244 unsigned __int64*);
...@@ -284,29 +247,19 @@ unsigned __int64 _umul128(unsigned __int64,...@@ -284,29 +247,19 @@ unsigned __int64 _umul128(unsigned __int64,
284247
285#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)248#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
286249
287static __inline__
288unsigned char _BitScanForward64(unsigned long *_Index, unsigned __int64 _Mask);250unsigned char _BitScanForward64(unsigned long *_Index, unsigned __int64 _Mask);
289static __inline__
290unsigned char _BitScanReverse64(unsigned long *_Index, unsigned __int64 _Mask);251unsigned char _BitScanReverse64(unsigned long *_Index, unsigned __int64 _Mask);
291252
292#endif253#endif
293254
294#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)255#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
295static __inline__
296__int64 _InterlockedDecrement64(__int64 volatile *_Addend);256__int64 _InterlockedDecrement64(__int64 volatile *_Addend);
297static __inline__
298__int64 _InterlockedExchange64(__int64 volatile *_Target, __int64 _Value);257__int64 _InterlockedExchange64(__int64 volatile *_Target, __int64 _Value);
299static __inline__
300__int64 _InterlockedExchangeAdd64(__int64 volatile *_Addend, __int64 _Value);258__int64 _InterlockedExchangeAdd64(__int64 volatile *_Addend, __int64 _Value);
301static __inline__
302__int64 _InterlockedExchangeSub64(__int64 volatile *_Subend, __int64 _Value);259__int64 _InterlockedExchangeSub64(__int64 volatile *_Subend, __int64 _Value);
303static __inline__
304__int64 _InterlockedIncrement64(__int64 volatile *_Addend);260__int64 _InterlockedIncrement64(__int64 volatile *_Addend);
305static __inline__
306__int64 _InterlockedOr64(__int64 volatile *_Value, __int64 _Mask);261__int64 _InterlockedOr64(__int64 volatile *_Value, __int64 _Mask);
307static __inline__
308__int64 _InterlockedXor64(__int64 volatile *_Value, __int64 _Mask);262__int64 _InterlockedXor64(__int64 volatile *_Value, __int64 _Mask);
309static __inline__
310__int64 _InterlockedAnd64(__int64 volatile *_Value, __int64 _Mask);263__int64 _InterlockedAnd64(__int64 volatile *_Value, __int64 _Mask);
311264
312#endif265#endif
...@@ -470,45 +423,81 @@ __int64 _InterlockedCompareExchange64_nf(__int64 volatile *_Destination,...@@ -470,45 +423,81 @@ __int64 _InterlockedCompareExchange64_nf(__int64 volatile *_Destination,
470__int64 _InterlockedCompareExchange64_rel(__int64 volatile *_Destination,423__int64 _InterlockedCompareExchange64_rel(__int64 volatile *_Destination,
471 __int64 _Exchange, __int64 _Comparand);424 __int64 _Exchange, __int64 _Comparand);
472#endif425#endif
426#if defined(__x86_64__) || defined(__aarch64__)
427unsigned char _InterlockedCompareExchange128(__int64 volatile *_Destination,
428 __int64 _ExchangeHigh,
429 __int64 _ExchangeLow,
430 __int64 *_ComparandResult);
431#endif
432#if defined(__aarch64__)
433unsigned char _InterlockedCompareExchange128_acq(__int64 volatile *_Destination,
434 __int64 _ExchangeHigh,
435 __int64 _ExchangeLow,
436 __int64 *_ComparandResult);
437unsigned char _InterlockedCompareExchange128_nf(__int64 volatile *_Destination,
438 __int64 _ExchangeHigh,
439 __int64 _ExchangeLow,
440 __int64 *_ComparandResult);
441unsigned char _InterlockedCompareExchange128_rel(__int64 volatile *_Destination,
442 __int64 _ExchangeHigh,
443 __int64 _ExchangeLow,
444 __int64 *_ComparandResult);
445#endif
473446
474/*----------------------------------------------------------------------------*\447/*----------------------------------------------------------------------------*\
475|* movs, stos448|* movs, stos
476\*----------------------------------------------------------------------------*/449\*----------------------------------------------------------------------------*/
477#if defined(__i386__) || defined(__x86_64__)450#if defined(__i386__) || defined(__x86_64__)
478static __inline__ void __DEFAULT_FN_ATTRS451static __inline__ void __DEFAULT_FN_ATTRS __movsb(unsigned char *__dst,
479__movsb(unsigned char *__dst, unsigned char const *__src, size_t __n) {452 unsigned char const *__src,
453 size_t __n) {
480 __asm__ __volatile__("rep movsb" : "+D"(__dst), "+S"(__src), "+c"(__n)454 __asm__ __volatile__("rep movsb" : "+D"(__dst), "+S"(__src), "+c"(__n)
481 : : "memory");455 : : "memory");
482}456}
483static __inline__ void __DEFAULT_FN_ATTRS457static __inline__ void __DEFAULT_FN_ATTRS __movsd(unsigned long *__dst,
484__movsd(unsigned long *__dst, unsigned long const *__src, size_t __n) {458 unsigned long const *__src,
485 __asm__ __volatile__("rep movsl" : "+D"(__dst), "+S"(__src), "+c"(__n)459 size_t __n) {
486 : : "memory");460 __asm__ __volatile__("rep movsl"
461 : "+D"(__dst), "+S"(__src), "+c"(__n)
462 :
463 : "memory");
487}464}
488static __inline__ void __DEFAULT_FN_ATTRS465static __inline__ void __DEFAULT_FN_ATTRS __movsw(unsigned short *__dst,
489__movsw(unsigned short *__dst, unsigned short const *__src, size_t __n) {466 unsigned short const *__src,
490 __asm__ __volatile__("rep movsw" : "+D"(__dst), "+S"(__src), "+c"(__n)467 size_t __n) {
491 : : "memory");468 __asm__ __volatile__("rep movsw"
469 : "+D"(__dst), "+S"(__src), "+c"(__n)
470 :
471 : "memory");
492}472}
493static __inline__ void __DEFAULT_FN_ATTRS473static __inline__ void __DEFAULT_FN_ATTRS __stosd(unsigned long *__dst,
494__stosd(unsigned long *__dst, unsigned long __x, size_t __n) {474 unsigned long __x,
495 __asm__ __volatile__("rep stosl" : "+D"(__dst), "+c"(__n) : "a"(__x)475 size_t __n) {
476 __asm__ __volatile__("rep stosl"
477 : "+D"(__dst), "+c"(__n)
478 : "a"(__x)
496 : "memory");479 : "memory");
497}480}
498static __inline__ void __DEFAULT_FN_ATTRS481static __inline__ void __DEFAULT_FN_ATTRS __stosw(unsigned short *__dst,
499__stosw(unsigned short *__dst, unsigned short __x, size_t __n) {482 unsigned short __x,
500 __asm__ __volatile__("rep stosw" : "+D"(__dst), "+c"(__n) : "a"(__x)483 size_t __n) {
484 __asm__ __volatile__("rep stosw"
485 : "+D"(__dst), "+c"(__n)
486 : "a"(__x)
501 : "memory");487 : "memory");
502}488}
503#endif489#endif
504#ifdef __x86_64__490#ifdef __x86_64__
505static __inline__ void __DEFAULT_FN_ATTRS491static __inline__ void __DEFAULT_FN_ATTRS __movsq(
506__movsq(unsigned long long *__dst, unsigned long long const *__src, size_t __n) {492 unsigned long long *__dst, unsigned long long const *__src, size_t __n) {
507 __asm__ __volatile__("rep movsq" : "+D"(__dst), "+S"(__src), "+c"(__n)493 __asm__ __volatile__("rep movsq"
508 : : "memory");494 : "+D"(__dst), "+S"(__src), "+c"(__n)
495 :
496 : "memory");
509}497}
510static __inline__ void __DEFAULT_FN_ATTRS498static __inline__ void __DEFAULT_FN_ATTRS __stosq(unsigned __int64 *__dst,
511__stosq(unsigned __int64 *__dst, unsigned __int64 __x, size_t __n) {499 unsigned __int64 __x,
500 size_t __n) {
512 __asm__ __volatile__("rep stosq" : "+D"(__dst), "+c"(__n) : "a"(__x)501 __asm__ __volatile__("rep stosq" : "+D"(__dst), "+c"(__n) : "a"(__x)
513 : "memory");502 : "memory");
514}503}
...@@ -518,26 +507,25 @@ __stosq(unsigned __int64 *__dst, unsigned __int64 __x, size_t __n) {...@@ -518,26 +507,25 @@ __stosq(unsigned __int64 *__dst, unsigned __int64 __x, size_t __n) {
518|* Misc507|* Misc
519\*----------------------------------------------------------------------------*/508\*----------------------------------------------------------------------------*/
520#if defined(__i386__) || defined(__x86_64__)509#if defined(__i386__) || defined(__x86_64__)
521static __inline__ void __DEFAULT_FN_ATTRS510static __inline__ void __DEFAULT_FN_ATTRS __cpuid(int __info[4], int __level) {
522__cpuid(int __info[4], int __level) {511 __asm__("cpuid"
523 __asm__ ("cpuid" : "=a"(__info[0]), "=b" (__info[1]), "=c"(__info[2]), "=d"(__info[3])512 : "=a"(__info[0]), "=b"(__info[1]), "=c"(__info[2]), "=d"(__info[3])
524 : "a"(__level), "c"(0));513 : "a"(__level), "c"(0));
525}514}
526static __inline__ void __DEFAULT_FN_ATTRS515static __inline__ void __DEFAULT_FN_ATTRS __cpuidex(int __info[4], int __level,
527__cpuidex(int __info[4], int __level, int __ecx) {516 int __ecx) {
528 __asm__ ("cpuid" : "=a"(__info[0]), "=b" (__info[1]), "=c"(__info[2]), "=d"(__info[3])517 __asm__("cpuid"
529 : "a"(__level), "c"(__ecx));518 : "=a"(__info[0]), "=b"(__info[1]), "=c"(__info[2]), "=d"(__info[3])
519 : "a"(__level), "c"(__ecx));
530}520}
531static __inline__ void __DEFAULT_FN_ATTRS521static __inline__ void __DEFAULT_FN_ATTRS __halt(void) {
532__halt(void) {522 __asm__ volatile("hlt");
533 __asm__ volatile ("hlt");
534}523}
535#endif524#endif
536525
537#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)526#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
538static __inline__ void __DEFAULT_FN_ATTRS527static __inline__ void __DEFAULT_FN_ATTRS __nop(void) {
539__nop(void) {528 __asm__ volatile("nop");
540 __asm__ volatile ("nop");
541}529}
542#endif530#endif
543531
...@@ -574,8 +562,7 @@ __readmsr(unsigned long __register) {...@@ -574,8 +562,7 @@ __readmsr(unsigned long __register) {
574}562}
575#endif563#endif
576564
577static __inline__ unsigned __LPTRINT_TYPE__ __DEFAULT_FN_ATTRS565static __inline__ unsigned __LPTRINT_TYPE__ __DEFAULT_FN_ATTRS __readcr3(void) {
578__readcr3(void) {
579 unsigned __LPTRINT_TYPE__ __cr3_val;566 unsigned __LPTRINT_TYPE__ __cr3_val;
580 __asm__ __volatile__ ("mov %%cr3, %0" : "=r"(__cr3_val) : : "memory");567 __asm__ __volatile__ ("mov %%cr3, %0" : "=r"(__cr3_val) : : "memory");
581 return __cr3_val;568 return __cr3_val;
lib/include/keylockerintrin.h created+506
...@@ -0,0 +1,506 @@
1/*===----------------- keylockerintrin.h - KL Intrinsics -------------------===
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
9 *
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 * THE SOFTWARE.
20 *
21 *===-----------------------------------------------------------------------===
22 */
23
24#ifndef __IMMINTRIN_H
25#error "Never use <keylockerintrin.h> directly; include <immintrin.h> instead."
26#endif
27
28#ifndef _KEYLOCKERINTRIN_H
29#define _KEYLOCKERINTRIN_H
30
31#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
32 defined(__KL__)
33
34/* Define the default attributes for the functions in this file. */
35#define __DEFAULT_FN_ATTRS \
36 __attribute__((__always_inline__, __nodebug__, __target__("kl"),\
37 __min_vector_width__(128)))
38
39/// Load internal wrapping key from __intkey, __enkey_lo and __enkey_hi. __ctl
40/// will assigned to EAX, whch specifies the KeySource and whether backing up
41/// the key is permitted. The 256-bit encryption key is loaded from the two
42/// explicit operands (__enkey_lo and __enkey_hi). The 128-bit integrity key is
43/// loaded from the implicit operand XMM0 which assigned by __intkey.
44///
45/// \headerfile <x86intrin.h>
46///
47/// This intrinsic corresponds to the <c> LOADIWKEY </c> instructions.
48///
49/// \operation
50/// IF CPL > 0 // LOADKWKEY only allowed at ring 0 (supervisor mode)
51/// GP (0)
52/// FI
53/// IF “LOADIWKEY exiting” VM execution control set
54/// VMexit
55/// FI
56/// IF __ctl[4:1] > 1 // Reserved KeySource encoding used
57/// GP (0)
58/// FI
59/// IF __ctl[31:5] != 0 // Reserved bit in __ctl is set
60/// GP (0)
61/// FI
62/// IF __ctl[0] AND (CPUID.19H.ECX[0] == 0) // NoBackup is not supported on this part
63/// GP (0)
64/// FI
65/// IF (__ctl[4:1] == 1) AND (CPUID.19H.ECX[1] == 0) // KeySource of 1 is not supported on this part
66/// GP (0)
67/// FI
68/// IF (__ctl[4:1] == 0) // KeySource of 0.
69/// IWKey.Encryption Key[127:0] := __enkey_hi[127:0]:
70/// IWKey.Encryption Key[255:128] := __enkey_lo[127:0]
71/// IWKey.IntegrityKey[127:0] := __intkey[127:0]
72/// IWKey.NoBackup := __ctl[0]
73/// IWKey.KeySource := __ctl[4:1]
74/// ZF := 0
75/// ELSE // KeySource of 1. See RDSEED definition for details of randomness
76/// IF HW_NRND_GEN.ready == 1 // Full-entropy random data from RDSEED was received
77/// IWKey.Encryption Key[127:0] := __enkey_hi[127:0] XOR HW_NRND_GEN.data[127:0]
78/// IWKey.Encryption Key[255:128] := __enkey_lo[127:0] XOR HW_NRND_GEN.data[255:128]
79/// IWKey.Encryption Key[255:0] := __enkey_hi[127:0]:__enkey_lo[127:0] XOR HW_NRND_GEN.data[255:0]
80/// IWKey.IntegrityKey[127:0] := __intkey[127:0] XOR HW_NRND_GEN.data[383:256]
81/// IWKey.NoBackup := __ctl[0]
82/// IWKey.KeySource := __ctl[4:1]
83/// ZF := 0
84/// ELSE // Random data was not returned from RDSEED. IWKey was not loaded
85/// ZF := 1
86/// FI
87/// FI
88/// dst := ZF
89/// OF := 0
90/// SF := 0
91/// AF := 0
92/// PF := 0
93/// CF := 0
94/// \endoperation
95static __inline__ void __DEFAULT_FN_ATTRS
96_mm_loadiwkey (unsigned int __ctl, __m128i __intkey,
97 __m128i __enkey_lo, __m128i __enkey_hi) {
98 __builtin_ia32_loadiwkey (__intkey, __enkey_lo, __enkey_hi, __ctl);
99}
100
101/// Wrap a 128-bit AES key from __key into a key handle and output in
102/// ((__m128i*)__h) to ((__m128i*)__h) + 5 and a 32-bit value as return.
103/// The explicit source operand __htype specifies handle restrictions.
104///
105/// \headerfile <x86intrin.h>
106///
107/// This intrinsic corresponds to the <c> ENCODEKEY128 </c> instructions.
108///
109/// \operation
110/// InputKey[127:0] := __key[127:0]
111/// KeyMetadata[2:0] := __htype[2:0]
112/// KeyMetadata[23:3] := 0 // Reserved for future usage
113/// KeyMetadata[27:24] := 0 // KeyType is AES-128 (value of 0)
114/// KeyMetadata[127:28] := 0 // Reserved for future usage
115/// Handle[383:0] := WrapKey128(InputKey[127:0], KeyMetadata[127:0],
116/// IWKey.Integrity Key[127:0], IWKey.Encryption Key[255:0])
117/// dst[0] := IWKey.NoBackup
118/// dst[4:1] := IWKey.KeySource[3:0]
119/// dst[31:5] := 0
120/// MEM[__h+127:__h] := Handle[127:0] // AAD
121/// MEM[__h+255:__h+128] := Handle[255:128] // Integrity Tag
122/// MEM[__h+383:__h+256] := Handle[383:256] // CipherText
123/// MEM[__h+511:__h+384] := 0 // Reserved for future usage
124/// MEM[__h+639:__h+512] := 0 // Reserved for future usage
125/// MEM[__h+767:__h+640] := 0 // Reserved for future usage
126/// OF := 0
127/// SF := 0
128/// ZF := 0
129/// AF := 0
130/// PF := 0
131/// CF := 0
132/// \endoperation
133static __inline__ unsigned int __DEFAULT_FN_ATTRS
134_mm_encodekey128_u32(unsigned int __htype, __m128i __key, void *__h) {
135 return __builtin_ia32_encodekey128_u32(__htype, (__v2di)__key, __h);
136}
137
138/// Wrap a 256-bit AES key from __key_hi:__key_lo into a key handle, then
139/// output handle in ((__m128i*)__h) to ((__m128i*)__h) + 6 and
140/// a 32-bit value as return.
141/// The explicit source operand __htype specifies handle restrictions.
142///
143/// \headerfile <x86intrin.h>
144///
145/// This intrinsic corresponds to the <c> ENCODEKEY256 </c> instructions.
146///
147/// \operation
148/// InputKey[127:0] := __key_lo[127:0]
149/// InputKey[255:128] := __key_hi[255:128]
150/// KeyMetadata[2:0] := __htype[2:0]
151/// KeyMetadata[23:3] := 0 // Reserved for future usage
152/// KeyMetadata[27:24] := 1 // KeyType is AES-256 (value of 1)
153/// KeyMetadata[127:28] := 0 // Reserved for future usage
154/// Handle[511:0] := WrapKey256(InputKey[255:0], KeyMetadata[127:0],
155/// IWKey.Integrity Key[127:0], IWKey.Encryption Key[255:0])
156/// dst[0] := IWKey.NoBackup
157/// dst[4:1] := IWKey.KeySource[3:0]
158/// dst[31:5] := 0
159/// MEM[__h+127:__h] := Handle[127:0] // AAD
160/// MEM[__h+255:__h+128] := Handle[255:128] // Tag
161/// MEM[__h+383:__h+256] := Handle[383:256] // CipherText[127:0]
162/// MEM[__h+511:__h+384] := Handle[511:384] // CipherText[255:128]
163/// MEM[__h+639:__h+512] := 0 // Reserved for future usage
164/// MEM[__h+767:__h+640] := 0 // Reserved for future usage
165/// MEM[__h+895:__h+768] := 0 Integrity// Reserved for future usage
166/// OF := 0
167/// SF := 0
168/// ZF := 0
169/// AF := 0
170/// PF := 0
171/// CF := 0
172/// \endoperation
173static __inline__ unsigned int __DEFAULT_FN_ATTRS
174_mm_encodekey256_u32(unsigned int __htype, __m128i __key_lo, __m128i __key_hi,
175 void *__h) {
176 return __builtin_ia32_encodekey256_u32(__htype, (__v2di)__key_lo,
177 (__v2di)__key_hi, __h);
178}
179
180/// The AESENC128KL performs 10 rounds of AES to encrypt the __idata using
181/// the 128-bit key in the handle from the __h. It stores the result in the
182/// __odata. And return the affected ZF flag status.
183///
184/// \headerfile <x86intrin.h>
185///
186/// This intrinsic corresponds to the <c> AESENC128KL </c> instructions.
187///
188/// \operation
189/// Handle[383:0] := MEM[__h+383:__h] // Load is not guaranteed to be atomic.
190/// IllegalHandle := ( HandleReservedBitSet (Handle[383:0]) ||
191/// (Handle[127:0] AND (CPL > 0)) ||
192/// Handle[383:256] ||
193/// HandleKeyType (Handle[383:0]) != HANDLE_KEY_TYPE_AES128 )
194/// IF (IllegalHandle)
195/// ZF := 1
196/// ELSE
197/// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate384 (Handle[383:0], IWKey)
198/// IF (Authentic == 0)
199/// ZF := 1
200/// ELSE
201/// MEM[__odata+127:__odata] := AES128Encrypt (__idata[127:0], UnwrappedKey)
202/// ZF := 0
203/// FI
204/// FI
205/// dst := ZF
206/// OF := 0
207/// SF := 0
208/// AF := 0
209/// PF := 0
210/// CF := 0
211/// \endoperation
212static __inline__ unsigned char __DEFAULT_FN_ATTRS
213_mm_aesenc128kl_u8(__m128i* __odata, __m128i __idata, const void *__h) {
214 return __builtin_ia32_aesenc128kl_u8((__v2di *)__odata, (__v2di)__idata, __h);
215}
216
217/// The AESENC256KL performs 14 rounds of AES to encrypt the __idata using
218/// the 256-bit key in the handle from the __h. It stores the result in the
219/// __odata. And return the affected ZF flag status.
220///
221/// \headerfile <x86intrin.h>
222///
223/// This intrinsic corresponds to the <c> AESENC256KL </c> instructions.
224///
225/// \operation
226/// Handle[511:0] := MEM[__h+511:__h] // Load is not guaranteed to be atomic.
227/// IllegalHandle := ( HandleReservedBitSet (Handle[511:0]) ||
228/// (Handle[127:0] AND (CPL > 0)) ||
229/// Handle[255:128] ||
230/// HandleKeyType (Handle[511:0]) != HANDLE_KEY_TYPE_AES256 )
231/// IF (IllegalHandle)
232/// ZF := 1
233/// ELSE
234/// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate512 (Handle[511:0], IWKey)
235/// IF (Authentic == 0)
236/// ZF := 1
237/// ELSE
238/// MEM[__odata+127:__odata] := AES256Encrypt (__idata[127:0], UnwrappedKey)
239/// ZF := 0
240/// FI
241/// FI
242/// dst := ZF
243/// OF := 0
244/// SF := 0
245/// AF := 0
246/// PF := 0
247/// CF := 0
248/// \endoperation
249static __inline__ unsigned char __DEFAULT_FN_ATTRS
250_mm_aesenc256kl_u8(__m128i* __odata, __m128i __idata, const void *__h) {
251 return __builtin_ia32_aesenc256kl_u8((__v2di *)__odata, (__v2di)__idata, __h);
252}
253
254/// The AESDEC128KL performs 10 rounds of AES to decrypt the __idata using
255/// the 128-bit key in the handle from the __h. It stores the result in the
256/// __odata. And return the affected ZF flag status.
257///
258/// \headerfile <x86intrin.h>
259///
260/// This intrinsic corresponds to the <c> AESDEC128KL </c> instructions.
261///
262/// \operation
263/// Handle[383:0] := MEM[__h+383:__h] // Load is not guaranteed to be atomic.
264/// IllegalHandle := (HandleReservedBitSet (Handle[383:0]) ||
265/// (Handle[127:0] AND (CPL > 0)) ||
266/// Handle[383:256] ||
267/// HandleKeyType (Handle[383:0]) != HANDLE_KEY_TYPE_AES128)
268/// IF (IllegalHandle)
269/// ZF := 1
270/// ELSE
271/// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate384 (Handle[383:0], IWKey)
272/// IF (Authentic == 0)
273/// ZF := 1
274/// ELSE
275/// MEM[__odata+127:__odata] := AES128Decrypt (__idata[127:0], UnwrappedKey)
276/// ZF := 0
277/// FI
278/// FI
279/// dst := ZF
280/// OF := 0
281/// SF := 0
282/// AF := 0
283/// PF := 0
284/// CF := 0
285/// \endoperation
286static __inline__ unsigned char __DEFAULT_FN_ATTRS
287_mm_aesdec128kl_u8(__m128i* __odata, __m128i __idata, const void *__h) {
288 return __builtin_ia32_aesdec128kl_u8((__v2di *)__odata, (__v2di)__idata, __h);
289}
290
291/// The AESDEC256KL performs 10 rounds of AES to decrypt the __idata using
292/// the 256-bit key in the handle from the __h. It stores the result in the
293/// __odata. And return the affected ZF flag status.
294///
295/// \headerfile <x86intrin.h>
296///
297/// This intrinsic corresponds to the <c> AESDEC256KL </c> instructions.
298///
299/// \operation
300/// Handle[511:0] := MEM[__h+511:__h]
301/// IllegalHandle := (HandleReservedBitSet (Handle[511:0]) ||
302/// (Handle[127:0] AND (CPL > 0)) ||
303/// Handle[383:256] ||
304/// HandleKeyType (Handle[511:0]) != HANDLE_KEY_TYPE_AES256)
305/// IF (IllegalHandle)
306/// ZF := 1
307/// ELSE
308/// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate512 (Handle[511:0], IWKey)
309/// IF (Authentic == 0)
310/// ZF := 1
311/// ELSE
312/// MEM[__odata+127:__odata] := AES256Decrypt (__idata[127:0], UnwrappedKey)
313/// ZF := 0
314/// FI
315/// FI
316/// dst := ZF
317/// OF := 0
318/// SF := 0
319/// AF := 0
320/// PF := 0
321/// CF := 0
322/// \endoperation
323static __inline__ unsigned char __DEFAULT_FN_ATTRS
324_mm_aesdec256kl_u8(__m128i* __odata, __m128i __idata, const void *__h) {
325 return __builtin_ia32_aesdec256kl_u8((__v2di *)__odata, (__v2di)__idata, __h);
326}
327
328#undef __DEFAULT_FN_ATTRS
329
330#endif /* !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) \
331 || defined(__KL__) */
332
333#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
334 defined(__WIDEKL__)
335
336/* Define the default attributes for the functions in this file. */
337#define __DEFAULT_FN_ATTRS \
338 __attribute__((__always_inline__, __nodebug__, __target__("kl,widekl"),\
339 __min_vector_width__(128)))
340
341/// Encrypt __idata[0] to __idata[7] using 128-bit AES key indicated by handle
342/// at __h and store each resultant block back from __odata to __odata+7. And
343/// return the affected ZF flag status.
344///
345/// \headerfile <x86intrin.h>
346///
347/// This intrinsic corresponds to the <c> AESENCWIDE128KL </c> instructions.
348///
349/// \operation
350/// Handle := MEM[__h+383:__h]
351/// IllegalHandle := ( HandleReservedBitSet (Handle[383:0]) ||
352/// (Handle[127:0] AND (CPL > 0)) ||
353/// Handle[255:128] ||
354/// HandleKeyType (Handle[383:0]) != HANDLE_KEY_TYPE_AES128 )
355/// IF (IllegalHandle)
356/// ZF := 1
357/// ELSE
358/// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate384 (Handle[383:0], IWKey)
359/// IF Authentic == 0
360/// ZF := 1
361/// ELSE
362/// FOR i := 0 to 7
363/// __odata[i] := AES128Encrypt (__idata[i], UnwrappedKey)
364/// ENDFOR
365/// ZF := 0
366/// FI
367/// FI
368/// dst := ZF
369/// OF := 0
370/// SF := 0
371/// AF := 0
372/// PF := 0
373/// CF := 0
374/// \endoperation
375static __inline__ unsigned char __DEFAULT_FN_ATTRS
376_mm_aesencwide128kl_u8(__m128i __odata[8], const __m128i __idata[8], const void* __h) {
377 return __builtin_ia32_aesencwide128kl_u8((__v2di *)__odata,
378 (const __v2di *)__idata, __h);
379}
380
381/// Encrypt __idata[0] to __idata[7] using 256-bit AES key indicated by handle
382/// at __h and store each resultant block back from __odata to __odata+7. And
383/// return the affected ZF flag status.
384///
385/// \headerfile <x86intrin.h>
386///
387/// This intrinsic corresponds to the <c> AESENCWIDE256KL </c> instructions.
388///
389/// \operation
390/// Handle[511:0] := MEM[__h+511:__h]
391/// IllegalHandle := ( HandleReservedBitSet (Handle[511:0]) ||
392/// (Handle[127:0] AND (CPL > 0)) ||
393/// Handle[255:128] ||
394/// HandleKeyType (Handle[511:0]) != HANDLE_KEY_TYPE_AES512 )
395/// IF (IllegalHandle)
396/// ZF := 1
397/// ELSE
398/// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate512 (Handle[511:0], IWKey)
399/// IF Authentic == 0
400/// ZF := 1
401/// ELSE
402/// FOR i := 0 to 7
403/// __odata[i] := AES256Encrypt (__idata[i], UnwrappedKey)
404/// ENDFOR
405/// ZF := 0
406/// FI
407/// FI
408/// dst := ZF
409/// OF := 0
410/// SF := 0
411/// AF := 0
412/// PF := 0
413/// CF := 0
414/// \endoperation
415static __inline__ unsigned char __DEFAULT_FN_ATTRS
416_mm_aesencwide256kl_u8(__m128i __odata[8], const __m128i __idata[8], const void* __h) {
417 return __builtin_ia32_aesencwide256kl_u8((__v2di *)__odata,
418 (const __v2di *)__idata, __h);
419}
420
421/// Decrypt __idata[0] to __idata[7] using 128-bit AES key indicated by handle
422/// at __h and store each resultant block back from __odata to __odata+7. And
423/// return the affected ZF flag status.
424///
425/// \headerfile <x86intrin.h>
426///
427/// This intrinsic corresponds to the <c> AESDECWIDE128KL </c> instructions.
428///
429/// \operation
430/// Handle[383:0] := MEM[__h+383:__h]
431/// IllegalHandle := ( HandleReservedBitSet (Handle[383:0]) ||
432/// (Handle[127:0] AND (CPL > 0)) ||
433/// Handle[255:128] ||
434/// HandleKeyType (Handle) != HANDLE_KEY_TYPE_AES128 )
435/// IF (IllegalHandle)
436/// ZF := 1
437/// ELSE
438/// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate384 (Handle[383:0], IWKey)
439/// IF Authentic == 0
440/// ZF := 1
441/// ELSE
442/// FOR i := 0 to 7
443/// __odata[i] := AES128Decrypt (__idata[i], UnwrappedKey)
444/// ENDFOR
445/// ZF := 0
446/// FI
447/// FI
448/// dst := ZF
449/// OF := 0
450/// SF := 0
451/// AF := 0
452/// PF := 0
453/// CF := 0
454/// \endoperation
455static __inline__ unsigned char __DEFAULT_FN_ATTRS
456_mm_aesdecwide128kl_u8(__m128i __odata[8], const __m128i __idata[8], const void* __h) {
457 return __builtin_ia32_aesdecwide128kl_u8((__v2di *)__odata,
458 (const __v2di *)__idata, __h);
459}
460
461/// Decrypt __idata[0] to __idata[7] using 256-bit AES key indicated by handle
462/// at __h and store each resultant block back from __odata to __odata+7. And
463/// return the affected ZF flag status.
464///
465/// \headerfile <x86intrin.h>
466///
467/// This intrinsic corresponds to the <c> AESDECWIDE256KL </c> instructions.
468///
469/// \operation
470/// Handle[511:0] := MEM[__h+511:__h]
471/// IllegalHandle = ( HandleReservedBitSet (Handle[511:0]) ||
472/// (Handle[127:0] AND (CPL > 0)) ||
473/// Handle[255:128] ||
474/// HandleKeyType (Handle) != HANDLE_KEY_TYPE_AES512 )
475/// If (IllegalHandle)
476/// ZF := 1
477/// ELSE
478/// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate512 (Handle[511:0], IWKey)
479/// IF Authentic == 0
480/// ZF := 1
481/// ELSE
482/// FOR i := 0 to 7
483/// __odata[i] := AES256Decrypt (__idata[i], UnwrappedKey)
484/// ENDFOR
485/// ZF := 0
486/// FI
487/// FI
488/// dst := ZF
489/// OF := 0
490/// SF := 0
491/// AF := 0
492/// PF := 0
493/// CF := 0
494/// \endoperation
495static __inline__ unsigned char __DEFAULT_FN_ATTRS
496_mm_aesdecwide256kl_u8(__m128i __odata[8], const __m128i __idata[8], const void* __h) {
497 return __builtin_ia32_aesdecwide256kl_u8((__v2di *)__odata,
498 (const __v2di *)__idata, __h);
499}
500
501#undef __DEFAULT_FN_ATTRS
502
503#endif /* !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) \
504 || defined(__WIDEKL__) */
505
506#endif /* _KEYLOCKERINTRIN_H */
lib/include/mm_malloc.h+6
...@@ -54,7 +54,13 @@ _mm_malloc(size_t __size, size_t __align)...@@ -54,7 +54,13 @@ _mm_malloc(size_t __size, size_t __align)
54static __inline__ void __attribute__((__always_inline__, __nodebug__))54static __inline__ void __attribute__((__always_inline__, __nodebug__))
55_mm_free(void *__p)55_mm_free(void *__p)
56{56{
57#if defined(__MINGW32__)
58 __mingw_aligned_free(__p);
59#elif defined(_WIN32)
60 _aligned_free(__p);
61#else
57 free(__p);62 free(__p);
63#endif
58}64}
59#endif65#endif
6066
lib/include/opencl-c-base.h+18
...@@ -9,6 +9,21 @@...@@ -9,6 +9,21 @@
9#ifndef _OPENCL_BASE_H_9#ifndef _OPENCL_BASE_H_
10#define _OPENCL_BASE_H_10#define _OPENCL_BASE_H_
1111
12// Define extension macros
13
14#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
15// For SPIR all extensions are supported.
16#if defined(__SPIR__)
17#define cl_khr_subgroup_extended_types 1
18#define cl_khr_subgroup_non_uniform_vote 1
19#define cl_khr_subgroup_ballot 1
20#define cl_khr_subgroup_non_uniform_arithmetic 1
21#define cl_khr_subgroup_shuffle 1
22#define cl_khr_subgroup_shuffle_relative 1
23#define cl_khr_subgroup_clustered_reduce 1
24#endif // defined(__SPIR__)
25#endif // (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
26
12// built-in scalar data types:27// built-in scalar data types:
1328
14/**29/**
...@@ -568,4 +583,7 @@ typedef struct {...@@ -568,4 +583,7 @@ typedef struct {
568#pragma OPENCL EXTENSION cl_intel_device_side_avc_motion_estimation : end583#pragma OPENCL EXTENSION cl_intel_device_side_avc_motion_estimation : end
569#endif // cl_intel_device_side_avc_motion_estimation584#endif // cl_intel_device_side_avc_motion_estimation
570585
586// Disable any extensions we may have enabled previously.
587#pragma OPENCL EXTENSION all : disable
588
571#endif //_OPENCL_BASE_H_589#endif //_OPENCL_BASE_H_
lib/include/opencl-c.h+2
...@@ -4633,6 +4633,7 @@ float16 __ovld __cnfn convert_float16(float16);...@@ -4633,6 +4633,7 @@ float16 __ovld __cnfn convert_float16(float16);
4633// Conversions with double data type parameters or return value.4633// Conversions with double data type parameters or return value.
46344634
4635#ifdef cl_khr_fp644635#ifdef cl_khr_fp64
4636#pragma OPENCL EXTENSION cl_khr_fp64 : enable
4636char __ovld __cnfn convert_char(double);4637char __ovld __cnfn convert_char(double);
4637char __ovld __cnfn convert_char_rte(double);4638char __ovld __cnfn convert_char_rte(double);
4638char __ovld __cnfn convert_char_rtn(double);4639char __ovld __cnfn convert_char_rtn(double);
...@@ -5455,6 +5456,7 @@ double16 __ovld __cnfn convert_double16_rtz(ushort16);...@@ -5455,6 +5456,7 @@ double16 __ovld __cnfn convert_double16_rtz(ushort16);
5455#endif //cl_khr_fp645456#endif //cl_khr_fp64
54565457
5457#ifdef cl_khr_fp165458#ifdef cl_khr_fp16
5459#pragma OPENCL EXTENSION cl_khr_fp16 : enable
5458// Convert half types to non-double types.5460// Convert half types to non-double types.
5459uchar __ovld __cnfn convert_uchar(half);5461uchar __ovld __cnfn convert_uchar(half);
5460uchar __ovld __cnfn convert_uchar_rte(half);5462uchar __ovld __cnfn convert_uchar_rte(half);
lib/include/openmp_wrappers/cmath+4-1
...@@ -24,8 +24,11 @@...@@ -24,8 +24,11 @@
24// which might live in cstdlib.24// which might live in cstdlib.
25#include <cstdlib>25#include <cstdlib>
2626
27// We need limits because __clang_cuda_cmath.h below uses `std::numeric_limit`.
28#include <limits>
29
27#pragma omp begin declare variant match( \30#pragma omp begin declare variant match( \
28 device = {arch(nvptx, nvptx64)}, implementation = {extension(match_any)})31 device = {arch(nvptx, nvptx64)}, implementation = {extension(match_any, allow_templates)})
2932
30#define __CUDA__33#define __CUDA__
31#define __OPENMP_NVPTX__34#define __OPENMP_NVPTX__
lib/include/openmp_wrappers/complex+25
...@@ -25,3 +25,28 @@...@@ -25,3 +25,28 @@
2525
26// Grab the host header too.26// Grab the host header too.
27#include_next <complex>27#include_next <complex>
28
29
30#ifdef __cplusplus
31
32// If we are compiling against libc++, the macro _LIBCPP_STD_VER should be set
33// after including <cmath> above. Since the complex header we use is a
34// simplified version of the libc++, we don't need it in this case. If we
35// compile against libstdc++, or any other standard library, we will overload
36// the (hopefully template) functions in the <complex> header with the ones we
37// got from libc++ which decomposes math functions, like `std::sin`, into
38// arithmetic and calls to non-complex functions, all of which we can then
39// handle.
40#ifndef _LIBCPP_STD_VER
41
42#pragma omp begin declare variant match( \
43 device = {arch(nvptx, nvptx64)}, \
44 implementation = {extension(match_any, allow_templates)})
45
46#include <complex_cmath.h>
47
48#pragma omp end declare variant
49
50#endif
51
52#endif
lib/include/openmp_wrappers/complex_cmath.h created+388
...@@ -0,0 +1,388 @@
1//===------------------------- __complex_cmath.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// std::complex header copied from the libcxx source and simplified for use in
10// OpenMP target offload regions.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef _OPENMP
15#error "This file is for OpenMP compilation only."
16#endif
17
18#ifndef __cplusplus
19#error "This file is for C++ compilation only."
20#endif
21
22#ifndef _LIBCPP_COMPLEX
23#define _LIBCPP_COMPLEX
24
25#include <cmath>
26#include <type_traits>
27
28#define __DEVICE__ static constexpr __attribute__((nothrow))
29
30namespace std {
31
32// abs
33
34template <class _Tp> __DEVICE__ _Tp abs(const std::complex<_Tp> &__c) {
35 return hypot(__c.real(), __c.imag());
36}
37
38// arg
39
40template <class _Tp> __DEVICE__ _Tp arg(const std::complex<_Tp> &__c) {
41 return atan2(__c.imag(), __c.real());
42}
43
44template <class _Tp>
45typename enable_if<is_integral<_Tp>::value || is_same<_Tp, double>::value,
46 double>::type
47arg(_Tp __re) {
48 return atan2(0., __re);
49}
50
51template <class _Tp>
52typename enable_if<is_same<_Tp, float>::value, float>::type arg(_Tp __re) {
53 return atan2f(0.F, __re);
54}
55
56// norm
57
58template <class _Tp> __DEVICE__ _Tp norm(const std::complex<_Tp> &__c) {
59 if (std::isinf(__c.real()))
60 return abs(__c.real());
61 if (std::isinf(__c.imag()))
62 return abs(__c.imag());
63 return __c.real() * __c.real() + __c.imag() * __c.imag();
64}
65
66// conj
67
68template <class _Tp> std::complex<_Tp> conj(const std::complex<_Tp> &__c) {
69 return std::complex<_Tp>(__c.real(), -__c.imag());
70}
71
72// proj
73
74template <class _Tp> std::complex<_Tp> proj(const std::complex<_Tp> &__c) {
75 std::complex<_Tp> __r = __c;
76 if (std::isinf(__c.real()) || std::isinf(__c.imag()))
77 __r = std::complex<_Tp>(INFINITY, copysign(_Tp(0), __c.imag()));
78 return __r;
79}
80
81// polar
82
83template <class _Tp>
84complex<_Tp> polar(const _Tp &__rho, const _Tp &__theta = _Tp()) {
85 if (std::isnan(__rho) || signbit(__rho))
86 return std::complex<_Tp>(_Tp(NAN), _Tp(NAN));
87 if (std::isnan(__theta)) {
88 if (std::isinf(__rho))
89 return std::complex<_Tp>(__rho, __theta);
90 return std::complex<_Tp>(__theta, __theta);
91 }
92 if (std::isinf(__theta)) {
93 if (std::isinf(__rho))
94 return std::complex<_Tp>(__rho, _Tp(NAN));
95 return std::complex<_Tp>(_Tp(NAN), _Tp(NAN));
96 }
97 _Tp __x = __rho * cos(__theta);
98 if (std::isnan(__x))
99 __x = 0;
100 _Tp __y = __rho * sin(__theta);
101 if (std::isnan(__y))
102 __y = 0;
103 return std::complex<_Tp>(__x, __y);
104}
105
106// log
107
108template <class _Tp> std::complex<_Tp> log(const std::complex<_Tp> &__x) {
109 return std::complex<_Tp>(log(abs(__x)), arg(__x));
110}
111
112// log10
113
114template <class _Tp> std::complex<_Tp> log10(const std::complex<_Tp> &__x) {
115 return log(__x) / log(_Tp(10));
116}
117
118// sqrt
119
120template <class _Tp>
121__DEVICE__ std::complex<_Tp> sqrt(const std::complex<_Tp> &__x) {
122 if (std::isinf(__x.imag()))
123 return std::complex<_Tp>(_Tp(INFINITY), __x.imag());
124 if (std::isinf(__x.real())) {
125 if (__x.real() > _Tp(0))
126 return std::complex<_Tp>(__x.real(), std::isnan(__x.imag())
127 ? __x.imag()
128 : copysign(_Tp(0), __x.imag()));
129 return std::complex<_Tp>(std::isnan(__x.imag()) ? __x.imag() : _Tp(0),
130 copysign(__x.real(), __x.imag()));
131 }
132 return polar(sqrt(abs(__x)), arg(__x) / _Tp(2));
133}
134
135// exp
136
137template <class _Tp>
138__DEVICE__ std::complex<_Tp> exp(const std::complex<_Tp> &__x) {
139 _Tp __i = __x.imag();
140 if (std::isinf(__x.real())) {
141 if (__x.real() < _Tp(0)) {
142 if (!std::isfinite(__i))
143 __i = _Tp(1);
144 } else if (__i == 0 || !std::isfinite(__i)) {
145 if (std::isinf(__i))
146 __i = _Tp(NAN);
147 return std::complex<_Tp>(__x.real(), __i);
148 }
149 } else if (std::isnan(__x.real()) && __x.imag() == 0)
150 return __x;
151 _Tp __e = exp(__x.real());
152 return std::complex<_Tp>(__e * cos(__i), __e * sin(__i));
153}
154
155// pow
156
157template <class _Tp>
158std::complex<_Tp> pow(const std::complex<_Tp> &__x,
159 const std::complex<_Tp> &__y) {
160 return exp(__y * log(__x));
161}
162
163// __sqr, computes pow(x, 2)
164
165template <class _Tp> std::complex<_Tp> __sqr(const std::complex<_Tp> &__x) {
166 return std::complex<_Tp>((__x.real() - __x.imag()) *
167 (__x.real() + __x.imag()),
168 _Tp(2) * __x.real() * __x.imag());
169}
170
171// asinh
172
173template <class _Tp>
174__DEVICE__ std::complex<_Tp> asinh(const std::complex<_Tp> &__x) {
175 const _Tp __pi(atan2(+0., -0.));
176 if (std::isinf(__x.real())) {
177 if (std::isnan(__x.imag()))
178 return __x;
179 if (std::isinf(__x.imag()))
180 return std::complex<_Tp>(__x.real(),
181 copysign(__pi * _Tp(0.25), __x.imag()));
182 return std::complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
183 }
184 if (std::isnan(__x.real())) {
185 if (std::isinf(__x.imag()))
186 return std::complex<_Tp>(__x.imag(), __x.real());
187 if (__x.imag() == 0)
188 return __x;
189 return std::complex<_Tp>(__x.real(), __x.real());
190 }
191 if (std::isinf(__x.imag()))
192 return std::complex<_Tp>(copysign(__x.imag(), __x.real()),
193 copysign(__pi / _Tp(2), __x.imag()));
194 std::complex<_Tp> __z = log(__x + sqrt(__sqr(__x) + _Tp(1)));
195 return std::complex<_Tp>(copysign(__z.real(), __x.real()),
196 copysign(__z.imag(), __x.imag()));
197}
198
199// acosh
200
201template <class _Tp>
202__DEVICE__ std::complex<_Tp> acosh(const std::complex<_Tp> &__x) {
203 const _Tp __pi(atan2(+0., -0.));
204 if (std::isinf(__x.real())) {
205 if (std::isnan(__x.imag()))
206 return std::complex<_Tp>(abs(__x.real()), __x.imag());
207 if (std::isinf(__x.imag())) {
208 if (__x.real() > 0)
209 return std::complex<_Tp>(__x.real(),
210 copysign(__pi * _Tp(0.25), __x.imag()));
211 else
212 return std::complex<_Tp>(-__x.real(),
213 copysign(__pi * _Tp(0.75), __x.imag()));
214 }
215 if (__x.real() < 0)
216 return std::complex<_Tp>(-__x.real(), copysign(__pi, __x.imag()));
217 return std::complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
218 }
219 if (std::isnan(__x.real())) {
220 if (std::isinf(__x.imag()))
221 return std::complex<_Tp>(abs(__x.imag()), __x.real());
222 return std::complex<_Tp>(__x.real(), __x.real());
223 }
224 if (std::isinf(__x.imag()))
225 return std::complex<_Tp>(abs(__x.imag()),
226 copysign(__pi / _Tp(2), __x.imag()));
227 std::complex<_Tp> __z = log(__x + sqrt(__sqr(__x) - _Tp(1)));
228 return std::complex<_Tp>(copysign(__z.real(), _Tp(0)),
229 copysign(__z.imag(), __x.imag()));
230}
231
232// atanh
233
234template <class _Tp>
235__DEVICE__ std::complex<_Tp> atanh(const std::complex<_Tp> &__x) {
236 const _Tp __pi(atan2(+0., -0.));
237 if (std::isinf(__x.imag())) {
238 return std::complex<_Tp>(copysign(_Tp(0), __x.real()),
239 copysign(__pi / _Tp(2), __x.imag()));
240 }
241 if (std::isnan(__x.imag())) {
242 if (std::isinf(__x.real()) || __x.real() == 0)
243 return std::complex<_Tp>(copysign(_Tp(0), __x.real()), __x.imag());
244 return std::complex<_Tp>(__x.imag(), __x.imag());
245 }
246 if (std::isnan(__x.real())) {
247 return std::complex<_Tp>(__x.real(), __x.real());
248 }
249 if (std::isinf(__x.real())) {
250 return std::complex<_Tp>(copysign(_Tp(0), __x.real()),
251 copysign(__pi / _Tp(2), __x.imag()));
252 }
253 if (abs(__x.real()) == _Tp(1) && __x.imag() == _Tp(0)) {
254 return std::complex<_Tp>(copysign(_Tp(INFINITY), __x.real()),
255 copysign(_Tp(0), __x.imag()));
256 }
257 std::complex<_Tp> __z = log((_Tp(1) + __x) / (_Tp(1) - __x)) / _Tp(2);
258 return std::complex<_Tp>(copysign(__z.real(), __x.real()),
259 copysign(__z.imag(), __x.imag()));
260}
261
262// sinh
263
264template <class _Tp>
265__DEVICE__ std::complex<_Tp> sinh(const std::complex<_Tp> &__x) {
266 if (std::isinf(__x.real()) && !std::isfinite(__x.imag()))
267 return std::complex<_Tp>(__x.real(), _Tp(NAN));
268 if (__x.real() == 0 && !std::isfinite(__x.imag()))
269 return std::complex<_Tp>(__x.real(), _Tp(NAN));
270 if (__x.imag() == 0 && !std::isfinite(__x.real()))
271 return __x;
272 return std::complex<_Tp>(sinh(__x.real()) * cos(__x.imag()),
273 cosh(__x.real()) * sin(__x.imag()));
274}
275
276// cosh
277
278template <class _Tp>
279__DEVICE__ std::complex<_Tp> cosh(const std::complex<_Tp> &__x) {
280 if (std::isinf(__x.real()) && !std::isfinite(__x.imag()))
281 return std::complex<_Tp>(abs(__x.real()), _Tp(NAN));
282 if (__x.real() == 0 && !std::isfinite(__x.imag()))
283 return std::complex<_Tp>(_Tp(NAN), __x.real());
284 if (__x.real() == 0 && __x.imag() == 0)
285 return std::complex<_Tp>(_Tp(1), __x.imag());
286 if (__x.imag() == 0 && !std::isfinite(__x.real()))
287 return std::complex<_Tp>(abs(__x.real()), __x.imag());
288 return std::complex<_Tp>(cosh(__x.real()) * cos(__x.imag()),
289 sinh(__x.real()) * sin(__x.imag()));
290}
291
292// tanh
293
294template <class _Tp>
295__DEVICE__ std::complex<_Tp> tanh(const std::complex<_Tp> &__x) {
296 if (std::isinf(__x.real())) {
297 if (!std::isfinite(__x.imag()))
298 return std::complex<_Tp>(_Tp(1), _Tp(0));
299 return std::complex<_Tp>(_Tp(1),
300 copysign(_Tp(0), sin(_Tp(2) * __x.imag())));
301 }
302 if (std::isnan(__x.real()) && __x.imag() == 0)
303 return __x;
304 _Tp __2r(_Tp(2) * __x.real());
305 _Tp __2i(_Tp(2) * __x.imag());
306 _Tp __d(cosh(__2r) + cos(__2i));
307 _Tp __2rsh(sinh(__2r));
308 if (std::isinf(__2rsh) && std::isinf(__d))
309 return std::complex<_Tp>(__2rsh > _Tp(0) ? _Tp(1) : _Tp(-1),
310 __2i > _Tp(0) ? _Tp(0) : _Tp(-0.));
311 return std::complex<_Tp>(__2rsh / __d, sin(__2i) / __d);
312}
313
314// asin
315
316template <class _Tp>
317__DEVICE__ std::complex<_Tp> asin(const std::complex<_Tp> &__x) {
318 std::complex<_Tp> __z = asinh(complex<_Tp>(-__x.imag(), __x.real()));
319 return std::complex<_Tp>(__z.imag(), -__z.real());
320}
321
322// acos
323
324template <class _Tp>
325__DEVICE__ std::complex<_Tp> acos(const std::complex<_Tp> &__x) {
326 const _Tp __pi(atan2(+0., -0.));
327 if (std::isinf(__x.real())) {
328 if (std::isnan(__x.imag()))
329 return std::complex<_Tp>(__x.imag(), __x.real());
330 if (std::isinf(__x.imag())) {
331 if (__x.real() < _Tp(0))
332 return std::complex<_Tp>(_Tp(0.75) * __pi, -__x.imag());
333 return std::complex<_Tp>(_Tp(0.25) * __pi, -__x.imag());
334 }
335 if (__x.real() < _Tp(0))
336 return std::complex<_Tp>(__pi,
337 signbit(__x.imag()) ? -__x.real() : __x.real());
338 return std::complex<_Tp>(_Tp(0),
339 signbit(__x.imag()) ? __x.real() : -__x.real());
340 }
341 if (std::isnan(__x.real())) {
342 if (std::isinf(__x.imag()))
343 return std::complex<_Tp>(__x.real(), -__x.imag());
344 return std::complex<_Tp>(__x.real(), __x.real());
345 }
346 if (std::isinf(__x.imag()))
347 return std::complex<_Tp>(__pi / _Tp(2), -__x.imag());
348 if (__x.real() == 0 && (__x.imag() == 0 || isnan(__x.imag())))
349 return std::complex<_Tp>(__pi / _Tp(2), -__x.imag());
350 std::complex<_Tp> __z = log(__x + sqrt(__sqr(__x) - _Tp(1)));
351 if (signbit(__x.imag()))
352 return std::complex<_Tp>(abs(__z.imag()), abs(__z.real()));
353 return std::complex<_Tp>(abs(__z.imag()), -abs(__z.real()));
354}
355
356// atan
357
358template <class _Tp>
359__DEVICE__ std::complex<_Tp> atan(const std::complex<_Tp> &__x) {
360 std::complex<_Tp> __z = atanh(complex<_Tp>(-__x.imag(), __x.real()));
361 return std::complex<_Tp>(__z.imag(), -__z.real());
362}
363
364// sin
365
366template <class _Tp>
367__DEVICE__ std::complex<_Tp> sin(const std::complex<_Tp> &__x) {
368 std::complex<_Tp> __z = sinh(complex<_Tp>(-__x.imag(), __x.real()));
369 return std::complex<_Tp>(__z.imag(), -__z.real());
370}
371
372// cos
373
374template <class _Tp> std::complex<_Tp> cos(const std::complex<_Tp> &__x) {
375 return cosh(complex<_Tp>(-__x.imag(), __x.real()));
376}
377
378// tan
379
380template <class _Tp>
381__DEVICE__ std::complex<_Tp> tan(const std::complex<_Tp> &__x) {
382 std::complex<_Tp> __z = tanh(complex<_Tp>(-__x.imag(), __x.real()));
383 return std::complex<_Tp>(__z.imag(), -__z.real());
384}
385
386} // namespace std
387
388#endif
lib/include/popcntintrin.h+9-2
...@@ -13,6 +13,12 @@...@@ -13,6 +13,12 @@
13/* Define the default attributes for the functions in this file. */13/* Define the default attributes for the functions in this file. */
14#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("popcnt")))14#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("popcnt")))
1515
16#if defined(__cplusplus) && (__cplusplus >= 201103L)
17#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS constexpr
18#else
19#define __DEFAULT_FN_ATTRS_CONSTEXPR __DEFAULT_FN_ATTRS
20#endif
21
16/// Counts the number of bits in the source operand having a value of 1.22/// Counts the number of bits in the source operand having a value of 1.
17///23///
18/// \headerfile <x86intrin.h>24/// \headerfile <x86intrin.h>
...@@ -23,7 +29,7 @@...@@ -23,7 +29,7 @@
23/// An unsigned 32-bit integer operand.29/// An unsigned 32-bit integer operand.
24/// \returns A 32-bit integer containing the number of bits with value 1 in the30/// \returns A 32-bit integer containing the number of bits with value 1 in the
25/// source operand.31/// source operand.
26static __inline__ int __DEFAULT_FN_ATTRS32static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
27_mm_popcnt_u32(unsigned int __A)33_mm_popcnt_u32(unsigned int __A)
28{34{
29 return __builtin_popcount(__A);35 return __builtin_popcount(__A);
...@@ -40,7 +46,7 @@ _mm_popcnt_u32(unsigned int __A)...@@ -40,7 +46,7 @@ _mm_popcnt_u32(unsigned int __A)
40/// An unsigned 64-bit integer operand.46/// An unsigned 64-bit integer operand.
41/// \returns A 64-bit integer containing the number of bits with value 1 in the47/// \returns A 64-bit integer containing the number of bits with value 1 in the
42/// source operand.48/// source operand.
43static __inline__ long long __DEFAULT_FN_ATTRS49static __inline__ long long __DEFAULT_FN_ATTRS_CONSTEXPR
44_mm_popcnt_u64(unsigned long long __A)50_mm_popcnt_u64(unsigned long long __A)
45{51{
46 return __builtin_popcountll(__A);52 return __builtin_popcountll(__A);
...@@ -48,5 +54,6 @@ _mm_popcnt_u64(unsigned long long __A)...@@ -48,5 +54,6 @@ _mm_popcnt_u64(unsigned long long __A)
48#endif /* __x86_64__ */54#endif /* __x86_64__ */
4955
50#undef __DEFAULT_FN_ATTRS56#undef __DEFAULT_FN_ATTRS
57#undef __DEFAULT_FN_ATTRS_CONSTEXPR
5158
52#endif /* __POPCNTINTRIN_H */59#endif /* __POPCNTINTRIN_H */
lib/include/ppc_wrappers/smmintrin.h+24
...@@ -78,6 +78,30 @@ extern __inline __m128i...@@ -78,6 +78,30 @@ extern __inline __m128i
78 return (__m128i)vec_sel((__v16qu)__A, (__v16qu)__B, __lmask);78 return (__m128i)vec_sel((__v16qu)__A, (__v16qu)__B, __lmask);
79}79}
8080
81extern __inline __m128i
82 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
83 _mm_insert_epi8(__m128i const __A, int const __D, int const __N) {
84 __v16qi result = (__v16qi)__A;
85 result[__N & 0xf] = __D;
86 return (__m128i)result;
87}
88
89extern __inline __m128i
90 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
91 _mm_insert_epi32(__m128i const __A, int const __D, int const __N) {
92 __v4si result = (__v4si)__A;
93 result[__N & 3] = __D;
94 return (__m128i)result;
95}
96
97extern __inline __m128i
98 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
99 _mm_insert_epi64(__m128i const __A, long long const __D, int const __N) {
100 __v2di result = (__v2di)__A;
101 result[__N & 1] = __D;
102 return (__m128i)result;
103}
104
81#else105#else
82#include_next <smmintrin.h>106#include_next <smmintrin.h>
83#endif /* defined(__linux__) && defined(__ppc64__) */107#endif /* defined(__linux__) && defined(__ppc64__) */
lib/include/uintrintrin.h created+150
...@@ -0,0 +1,150 @@
1/*===------------------ uintrintrin.h - UINTR 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 __X86GPRINTRIN_H
11#error "Never use <uintrintrin.h> directly; include <x86gprintrin.h> instead."
12#endif
13
14#ifndef __UINTRINTRIN_H
15#define __UINTRINTRIN_H
16
17/* Define the default attributes for the functions in this file */
18#define __DEFAULT_FN_ATTRS \
19 __attribute__((__always_inline__, __nodebug__, __target__("uintr")))
20
21#ifdef __x86_64__
22
23/// Clears the user interrupt flag (UIF). Its effect takes place immediately: a
24/// user interrupt cannot be delivered on the instruction boundary following
25/// CLUI. Can be executed only if CR4.UINT = 1, the logical processor is in
26/// 64-bit mode, and software is not executing inside an enclave; otherwise,
27/// each causes an invalid-opcode exception. Causes a transactional abort if
28/// executed inside a transactional region; the abort loads EAX as it would
29/// had it been due to an execution of CLI.
30///
31/// \headerfile <x86gprintrin.h>
32///
33/// This intrinsic corresponds to the <c> CLUI </c> instruction.
34///
35/// \operation
36/// UIF := 0
37/// \endoperation
38static __inline__ void __DEFAULT_FN_ATTRS
39_clui (void)
40{
41 __builtin_ia32_clui();
42}
43
44/// Sets the user interrupt flag (UIF). Its effect takes place immediately; a
45/// user interrupt may be delivered on the instruction boundary following
46/// STUI. Can be executed only if CR4.UINT = 1, the logical processor is in
47/// 64-bit mode, and software is not executing inside an enclave; otherwise,
48/// each causes an invalid-opcode exception. Causes a transactional abort if
49/// executed inside a transactional region; the abort loads EAX as it would
50/// had it been due to an execution of STI.
51///
52/// \headerfile <x86gprintrin.h>
53///
54/// This intrinsic corresponds to the <c> STUI </c> instruction.
55///
56/// \operation
57/// UIF := 1
58/// \endoperation
59static __inline__ void __DEFAULT_FN_ATTRS
60_stui (void)
61{
62 __builtin_ia32_stui();
63}
64
65/// Get the current value of the user interrupt flag (UIF). Can be executed
66/// regardless of CPL and inside a transactional region. Can be executed only
67/// if CR4.UINT = 1, the logical processor is in 64-bit mode, and software is
68/// not executing inside an enclave; otherwise, it causes an invalid-opcode
69/// exception.
70///
71/// \headerfile <x86gprintrin.h>
72///
73/// This intrinsic corresponds to the <c> TESTUI </c> instruction.
74///
75/// \returns The current value of the user interrupt flag (UIF).
76///
77/// \operation
78/// CF := UIF
79/// ZF := 0
80/// AF := 0
81/// OF := 0
82/// PF := 0
83/// SF := 0
84/// dst := CF
85/// \endoperation
86static __inline__ unsigned char __DEFAULT_FN_ATTRS
87_testui (void)
88{
89 return __builtin_ia32_testui();
90}
91
92/// Send interprocessor user interrupt. Can be executed only if
93/// CR4.UINT = IA32_UINT_TT[0] = 1, the logical processor is in 64-bit mode,
94/// and software is not executing inside an enclave; otherwise, it causes an
95/// invalid-opcode exception. May be executed at any privilege level, all of
96/// its memory accesses are performed with supervisor privilege.
97///
98/// \headerfile <x86gprintrin.h>
99///
100/// This intrinsic corresponds to the <c> SENDUIPI </c> instruction
101///
102/// \param __a
103/// Index of user-interrupt target table entry in user-interrupt target
104/// table.
105///
106/// \operation
107/// IF __a > UITTSZ
108/// GP (0)
109/// FI
110/// tempUITTE := MEM[UITTADDR + (a<<4)]
111/// // tempUITTE must be valid, and can't have any reserved bit set
112/// IF (tempUITTE.V == 0 OR tempUITTE[7:1] != 0)
113/// GP (0)
114/// FI
115/// tempUPID := MEM[tempUITTE.UPIDADDR] // under lock
116/// // tempUPID can't have any reserved bit set
117/// IF (tempUPID[15:2] != 0 OR tempUPID[31:24] != 0)
118/// GP (0) // release lock
119/// FI
120/// tempUPID.PIR[tempUITTE.UV] := 1;
121/// IF (tempUPID.SN == 0 AND tempUPID.ON == 0)
122/// tempUPID.ON := 1
123/// sendNotify := 1
124/// ELSE
125/// sendNotify := 0
126/// FI
127/// MEM[tempUITTE.UPIDADDR] := tempUPID // release lock
128/// IF sendNotify == 1
129/// IF IA32_APIC_BASE[10] == 1 // local APIC is in x2APIC mode
130/// // send ordinary IPI with vector tempUPID.NV to 32-bit physical APIC
131/// // ID tempUPID.NDST
132/// SendOrdinaryIPI(tempUPID.NV, tempUPID.NDST)
133/// ELSE
134/// // send ordinary IPI with vector tempUPID.NV to 8-bit physical APIC
135/// // ID tempUPID.NDST[15:8]
136/// SendOrdinaryIPI(tempUPID.NV, tempUPID.NDST[15:8])
137/// FI
138/// FI
139/// \endoperation
140static __inline__ void __DEFAULT_FN_ATTRS
141_senduipi (unsigned long long __a)
142{
143 __builtin_ia32_senduipi(__a);
144}
145
146#endif /* __x86_64__ */
147
148#undef __DEFAULT_FN_ATTRS
149
150#endif /* __UINTRINTRIN_H */
lib/include/wasm_simd128.h+73-39
...@@ -18,8 +18,7 @@ typedef int32_t v128_t __attribute__((__vector_size__(16), __aligned__(16)));...@@ -18,8 +18,7 @@ typedef int32_t v128_t __attribute__((__vector_size__(16), __aligned__(16)));
1818
19// Internal types determined by clang builtin definitions19// Internal types determined by clang builtin definitions
20typedef int32_t __v128_u __attribute__((__vector_size__(16), __aligned__(1)));20typedef int32_t __v128_u __attribute__((__vector_size__(16), __aligned__(1)));
21typedef char __i8x16 __attribute__((__vector_size__(16), __aligned__(16)));21typedef signed char __i8x16
22typedef signed char __s8x16
23 __attribute__((__vector_size__(16), __aligned__(16)));22 __attribute__((__vector_size__(16), __aligned__(16)));
24typedef unsigned char __u8x1623typedef unsigned char __u8x16
25 __attribute__((__vector_size__(16), __aligned__(16)));24 __attribute__((__vector_size__(16), __aligned__(16)));
...@@ -35,6 +34,13 @@ typedef unsigned long long __u64x2...@@ -35,6 +34,13 @@ typedef unsigned long long __u64x2
35typedef float __f32x4 __attribute__((__vector_size__(16), __aligned__(16)));34typedef float __f32x4 __attribute__((__vector_size__(16), __aligned__(16)));
36typedef double __f64x2 __attribute__((__vector_size__(16), __aligned__(16)));35typedef double __f64x2 __attribute__((__vector_size__(16), __aligned__(16)));
3736
37typedef signed char __i8x8 __attribute__((__vector_size__(8), __aligned__(8)));
38typedef unsigned char __u8x8
39 __attribute__((__vector_size__(8), __aligned__(8)));
40typedef short __i16x4 __attribute__((__vector_size__(8), __aligned__(8)));
41typedef unsigned short __u16x4
42 __attribute__((__vector_size__(8), __aligned__(8)));
43
38#define __DEFAULT_FN_ATTRS \44#define __DEFAULT_FN_ATTRS \
39 __attribute__((__always_inline__, __nodebug__, __target__("simd128"), \45 __attribute__((__always_inline__, __nodebug__, __target__("simd128"), \
40 __min_vector_width__(128)))46 __min_vector_width__(128)))
...@@ -273,7 +279,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_splat(int8_t __a) {...@@ -273,7 +279,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_splat(int8_t __a) {
273 (__builtin_wasm_extract_lane_s_i8x16((__i8x16)(__a), __i))279 (__builtin_wasm_extract_lane_s_i8x16((__i8x16)(__a), __i))
274280
275#define wasm_u8x16_extract_lane(__a, __i) \281#define wasm_u8x16_extract_lane(__a, __i) \
276 (__builtin_wasm_extract_lane_u_i8x16((__i8x16)(__a), __i))282 (__builtin_wasm_extract_lane_u_i8x16((__u8x16)(__a), __i))
277283
278#define wasm_i8x16_replace_lane(__a, __i, __b) \284#define wasm_i8x16_replace_lane(__a, __i, __b) \
279 ((v128_t)__builtin_wasm_replace_lane_i8x16((__i8x16)(__a), __i, __b))285 ((v128_t)__builtin_wasm_replace_lane_i8x16((__i8x16)(__a), __i, __b))
...@@ -286,7 +292,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i16x8_splat(int16_t __a) {...@@ -286,7 +292,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i16x8_splat(int16_t __a) {
286 (__builtin_wasm_extract_lane_s_i16x8((__i16x8)(__a), __i))292 (__builtin_wasm_extract_lane_s_i16x8((__i16x8)(__a), __i))
287293
288#define wasm_u16x8_extract_lane(__a, __i) \294#define wasm_u16x8_extract_lane(__a, __i) \
289 (__builtin_wasm_extract_lane_u_i16x8((__i16x8)(__a), __i))295 (__builtin_wasm_extract_lane_u_i16x8((__u16x8)(__a), __i))
290296
291#define wasm_i16x8_replace_lane(__a, __i, __b) \297#define wasm_i16x8_replace_lane(__a, __i, __b) \
292 ((v128_t)__builtin_wasm_replace_lane_i16x8((__i16x8)(__a), __i, __b))298 ((v128_t)__builtin_wasm_replace_lane_i16x8((__i16x8)(__a), __i, __b))
...@@ -333,17 +339,17 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_f64x2_splat(double __a) {...@@ -333,17 +339,17 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_f64x2_splat(double __a) {
333339
334static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_eq(v128_t __a,340static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_eq(v128_t __a,
335 v128_t __b) {341 v128_t __b) {
336 return (v128_t)((__s8x16)__a == (__s8x16)__b);342 return (v128_t)((__i8x16)__a == (__i8x16)__b);
337}343}
338344
339static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_ne(v128_t __a,345static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_ne(v128_t __a,
340 v128_t __b) {346 v128_t __b) {
341 return (v128_t)((__s8x16)__a != (__s8x16)__b);347 return (v128_t)((__i8x16)__a != (__i8x16)__b);
342}348}
343349
344static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_lt(v128_t __a,350static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_lt(v128_t __a,
345 v128_t __b) {351 v128_t __b) {
346 return (v128_t)((__s8x16)__a < (__s8x16)__b);352 return (v128_t)((__i8x16)__a < (__i8x16)__b);
347}353}
348354
349static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_lt(v128_t __a,355static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_lt(v128_t __a,
...@@ -353,7 +359,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_lt(v128_t __a,...@@ -353,7 +359,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_lt(v128_t __a,
353359
354static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_gt(v128_t __a,360static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_gt(v128_t __a,
355 v128_t __b) {361 v128_t __b) {
356 return (v128_t)((__s8x16)__a > (__s8x16)__b);362 return (v128_t)((__i8x16)__a > (__i8x16)__b);
357}363}
358364
359static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_gt(v128_t __a,365static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_gt(v128_t __a,
...@@ -363,7 +369,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_gt(v128_t __a,...@@ -363,7 +369,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_gt(v128_t __a,
363369
364static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_le(v128_t __a,370static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_le(v128_t __a,
365 v128_t __b) {371 v128_t __b) {
366 return (v128_t)((__s8x16)__a <= (__s8x16)__b);372 return (v128_t)((__i8x16)__a <= (__i8x16)__b);
367}373}
368374
369static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_le(v128_t __a,375static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_le(v128_t __a,
...@@ -373,7 +379,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_le(v128_t __a,...@@ -373,7 +379,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_le(v128_t __a,
373379
374static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_ge(v128_t __a,380static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_ge(v128_t __a,
375 v128_t __b) {381 v128_t __b) {
376 return (v128_t)((__s8x16)__a >= (__s8x16)__b);382 return (v128_t)((__i8x16)__a >= (__i8x16)__b);
377}383}
378384
379static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_ge(v128_t __a,385static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_ge(v128_t __a,
...@@ -595,7 +601,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_shl(v128_t __a,...@@ -595,7 +601,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_shl(v128_t __a,
595601
596static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_shr(v128_t __a,602static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_shr(v128_t __a,
597 int32_t __b) {603 int32_t __b) {
598 return (v128_t)((__s8x16)__a >> __b);604 return (v128_t)((__i8x16)__a >> __b);
599}605}
600606
601static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_shr(v128_t __a,607static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_shr(v128_t __a,
...@@ -616,8 +622,8 @@ wasm_i8x16_add_saturate(v128_t __a, v128_t __b) {...@@ -616,8 +622,8 @@ wasm_i8x16_add_saturate(v128_t __a, v128_t __b) {
616622
617static __inline__ v128_t __DEFAULT_FN_ATTRS623static __inline__ v128_t __DEFAULT_FN_ATTRS
618wasm_u8x16_add_saturate(v128_t __a, v128_t __b) {624wasm_u8x16_add_saturate(v128_t __a, v128_t __b) {
619 return (v128_t)__builtin_wasm_add_saturate_u_i8x16((__i8x16)__a,625 return (v128_t)__builtin_wasm_add_saturate_u_i8x16((__u8x16)__a,
620 (__i8x16)__b);626 (__u8x16)__b);
621}627}
622628
623static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_sub(v128_t __a,629static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_sub(v128_t __a,
...@@ -633,8 +639,8 @@ wasm_i8x16_sub_saturate(v128_t __a, v128_t __b) {...@@ -633,8 +639,8 @@ wasm_i8x16_sub_saturate(v128_t __a, v128_t __b) {
633639
634static __inline__ v128_t __DEFAULT_FN_ATTRS640static __inline__ v128_t __DEFAULT_FN_ATTRS
635wasm_u8x16_sub_saturate(v128_t __a, v128_t __b) {641wasm_u8x16_sub_saturate(v128_t __a, v128_t __b) {
636 return (v128_t)__builtin_wasm_sub_saturate_u_i8x16((__i8x16)__a,642 return (v128_t)__builtin_wasm_sub_saturate_u_i8x16((__u8x16)__a,
637 (__i8x16)__b);643 (__u8x16)__b);
638}644}
639645
640static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_min(v128_t __a,646static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_min(v128_t __a,
...@@ -644,7 +650,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_min(v128_t __a,...@@ -644,7 +650,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_min(v128_t __a,
644650
645static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_min(v128_t __a,651static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_min(v128_t __a,
646 v128_t __b) {652 v128_t __b) {
647 return (v128_t)__builtin_wasm_min_u_i8x16((__i8x16)__a, (__i8x16)__b);653 return (v128_t)__builtin_wasm_min_u_i8x16((__u8x16)__a, (__u8x16)__b);
648}654}
649655
650static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_max(v128_t __a,656static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_max(v128_t __a,
...@@ -654,12 +660,12 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_max(v128_t __a,...@@ -654,12 +660,12 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_max(v128_t __a,
654660
655static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_max(v128_t __a,661static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_max(v128_t __a,
656 v128_t __b) {662 v128_t __b) {
657 return (v128_t)__builtin_wasm_max_u_i8x16((__i8x16)__a, (__i8x16)__b);663 return (v128_t)__builtin_wasm_max_u_i8x16((__u8x16)__a, (__u8x16)__b);
658}664}
659665
660static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_avgr(v128_t __a,666static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_avgr(v128_t __a,
661 v128_t __b) {667 v128_t __b) {
662 return (v128_t)__builtin_wasm_avgr_u_i8x16((__i8x16)__a, (__i8x16)__b);668 return (v128_t)__builtin_wasm_avgr_u_i8x16((__u8x16)__a, (__u8x16)__b);
663}669}
664670
665static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i16x8_abs(v128_t __a) {671static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i16x8_abs(v128_t __a) {
...@@ -706,8 +712,8 @@ wasm_i16x8_add_saturate(v128_t __a, v128_t __b) {...@@ -706,8 +712,8 @@ wasm_i16x8_add_saturate(v128_t __a, v128_t __b) {
706712
707static __inline__ v128_t __DEFAULT_FN_ATTRS713static __inline__ v128_t __DEFAULT_FN_ATTRS
708wasm_u16x8_add_saturate(v128_t __a, v128_t __b) {714wasm_u16x8_add_saturate(v128_t __a, v128_t __b) {
709 return (v128_t)__builtin_wasm_add_saturate_u_i16x8((__i16x8)__a,715 return (v128_t)__builtin_wasm_add_saturate_u_i16x8((__u16x8)__a,
710 (__i16x8)__b);716 (__u16x8)__b);
711}717}
712718
713static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i16x8_sub(v128_t __a,719static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i16x8_sub(v128_t __a,
...@@ -723,8 +729,8 @@ wasm_i16x8_sub_saturate(v128_t __a, v128_t __b) {...@@ -723,8 +729,8 @@ wasm_i16x8_sub_saturate(v128_t __a, v128_t __b) {
723729
724static __inline__ v128_t __DEFAULT_FN_ATTRS730static __inline__ v128_t __DEFAULT_FN_ATTRS
725wasm_u16x8_sub_saturate(v128_t __a, v128_t __b) {731wasm_u16x8_sub_saturate(v128_t __a, v128_t __b) {
726 return (v128_t)__builtin_wasm_sub_saturate_u_i16x8((__i16x8)__a,732 return (v128_t)__builtin_wasm_sub_saturate_u_i16x8((__u16x8)__a,
727 (__i16x8)__b);733 (__u16x8)__b);
728}734}
729735
730static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i16x8_mul(v128_t __a,736static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i16x8_mul(v128_t __a,
...@@ -739,7 +745,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i16x8_min(v128_t __a,...@@ -739,7 +745,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i16x8_min(v128_t __a,
739745
740static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u16x8_min(v128_t __a,746static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u16x8_min(v128_t __a,
741 v128_t __b) {747 v128_t __b) {
742 return (v128_t)__builtin_wasm_min_u_i16x8((__i16x8)__a, (__i16x8)__b);748 return (v128_t)__builtin_wasm_min_u_i16x8((__u16x8)__a, (__u16x8)__b);
743}749}
744750
745static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i16x8_max(v128_t __a,751static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i16x8_max(v128_t __a,
...@@ -749,12 +755,12 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i16x8_max(v128_t __a,...@@ -749,12 +755,12 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i16x8_max(v128_t __a,
749755
750static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u16x8_max(v128_t __a,756static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u16x8_max(v128_t __a,
751 v128_t __b) {757 v128_t __b) {
752 return (v128_t)__builtin_wasm_max_u_i16x8((__i16x8)__a, (__i16x8)__b);758 return (v128_t)__builtin_wasm_max_u_i16x8((__u16x8)__a, (__u16x8)__b);
753}759}
754760
755static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u16x8_avgr(v128_t __a,761static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u16x8_avgr(v128_t __a,
756 v128_t __b) {762 v128_t __b) {
757 return (v128_t)__builtin_wasm_avgr_u_i16x8((__i16x8)__a, (__i16x8)__b);763 return (v128_t)__builtin_wasm_avgr_u_i16x8((__u16x8)__a, (__u16x8)__b);
758}764}
759765
760static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i32x4_abs(v128_t __a) {766static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i32x4_abs(v128_t __a) {
...@@ -810,7 +816,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i32x4_min(v128_t __a,...@@ -810,7 +816,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i32x4_min(v128_t __a,
810816
811static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u32x4_min(v128_t __a,817static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u32x4_min(v128_t __a,
812 v128_t __b) {818 v128_t __b) {
813 return (v128_t)__builtin_wasm_min_u_i32x4((__i32x4)__a, (__i32x4)__b);819 return (v128_t)__builtin_wasm_min_u_i32x4((__u32x4)__a, (__u32x4)__b);
814}820}
815821
816static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i32x4_max(v128_t __a,822static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i32x4_max(v128_t __a,
...@@ -820,7 +826,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i32x4_max(v128_t __a,...@@ -820,7 +826,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i32x4_max(v128_t __a,
820826
821static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u32x4_max(v128_t __a,827static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u32x4_max(v128_t __a,
822 v128_t __b) {828 v128_t __b) {
823 return (v128_t)__builtin_wasm_max_u_i32x4((__i32x4)__a, (__i32x4)__b);829 return (v128_t)__builtin_wasm_max_u_i32x4((__u32x4)__a, (__u32x4)__b);
824}830}
825831
826static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i64x2_neg(v128_t __a) {832static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i64x2_neg(v128_t __a) {
...@@ -1071,8 +1077,8 @@ wasm_i8x16_narrow_i16x8(v128_t __a, v128_t __b) {...@@ -1071,8 +1077,8 @@ wasm_i8x16_narrow_i16x8(v128_t __a, v128_t __b) {
10711077
1072static __inline__ v128_t __DEFAULT_FN_ATTRS1078static __inline__ v128_t __DEFAULT_FN_ATTRS
1073wasm_u8x16_narrow_i16x8(v128_t __a, v128_t __b) {1079wasm_u8x16_narrow_i16x8(v128_t __a, v128_t __b) {
1074 return (v128_t)__builtin_wasm_narrow_u_i8x16_i16x8((__i16x8)__a,1080 return (v128_t)__builtin_wasm_narrow_u_i8x16_i16x8((__u16x8)__a,
1075 (__i16x8)__b);1081 (__u16x8)__b);
1076}1082}
10771083
1078static __inline__ v128_t __DEFAULT_FN_ATTRS1084static __inline__ v128_t __DEFAULT_FN_ATTRS
...@@ -1083,48 +1089,76 @@ wasm_i16x8_narrow_i32x4(v128_t __a, v128_t __b) {...@@ -1083,48 +1089,76 @@ wasm_i16x8_narrow_i32x4(v128_t __a, v128_t __b) {
10831089
1084static __inline__ v128_t __DEFAULT_FN_ATTRS1090static __inline__ v128_t __DEFAULT_FN_ATTRS
1085wasm_u16x8_narrow_i32x4(v128_t __a, v128_t __b) {1091wasm_u16x8_narrow_i32x4(v128_t __a, v128_t __b) {
1086 return (v128_t)__builtin_wasm_narrow_u_i16x8_i32x4((__i32x4)__a,1092 return (v128_t)__builtin_wasm_narrow_u_i16x8_i32x4((__u32x4)__a,
1087 (__i32x4)__b);1093 (__u32x4)__b);
1088}1094}
10891095
1090static __inline__ v128_t __DEFAULT_FN_ATTRS1096static __inline__ v128_t __DEFAULT_FN_ATTRS
1091wasm_i16x8_widen_low_i8x16(v128_t __a) {1097wasm_i16x8_widen_low_i8x16(v128_t __a) {
1092 return (v128_t)__builtin_wasm_widen_low_s_i16x8_i8x16((__i8x16)__a);1098 return (v128_t) __builtin_convertvector(
1099 (__i8x8){((__i8x16)__a)[0], ((__i8x16)__a)[1], ((__i8x16)__a)[2],
1100 ((__i8x16)__a)[3], ((__i8x16)__a)[4], ((__i8x16)__a)[5],
1101 ((__i8x16)__a)[6], ((__i8x16)__a)[7]},
1102 __i16x8);
1093}1103}
10941104
1095static __inline__ v128_t __DEFAULT_FN_ATTRS1105static __inline__ v128_t __DEFAULT_FN_ATTRS
1096wasm_i16x8_widen_high_i8x16(v128_t __a) {1106wasm_i16x8_widen_high_i8x16(v128_t __a) {
1097 return (v128_t)__builtin_wasm_widen_high_s_i16x8_i8x16((__i8x16)__a);1107 return (v128_t) __builtin_convertvector(
1108 (__i8x8){((__i8x16)__a)[8], ((__i8x16)__a)[9], ((__i8x16)__a)[10],
1109 ((__i8x16)__a)[11], ((__i8x16)__a)[12], ((__i8x16)__a)[13],
1110 ((__i8x16)__a)[14], ((__i8x16)__a)[15]},
1111 __i16x8);
1098}1112}
10991113
1100static __inline__ v128_t __DEFAULT_FN_ATTRS1114static __inline__ v128_t __DEFAULT_FN_ATTRS
1101wasm_i16x8_widen_low_u8x16(v128_t __a) {1115wasm_i16x8_widen_low_u8x16(v128_t __a) {
1102 return (v128_t)__builtin_wasm_widen_low_u_i16x8_i8x16((__i8x16)__a);1116 return (v128_t) __builtin_convertvector(
1117 (__u8x8){((__u8x16)__a)[0], ((__u8x16)__a)[1], ((__u8x16)__a)[2],
1118 ((__u8x16)__a)[3], ((__u8x16)__a)[4], ((__u8x16)__a)[5],
1119 ((__u8x16)__a)[6], ((__u8x16)__a)[7]},
1120 __u16x8);
1103}1121}
11041122
1105static __inline__ v128_t __DEFAULT_FN_ATTRS1123static __inline__ v128_t __DEFAULT_FN_ATTRS
1106wasm_i16x8_widen_high_u8x16(v128_t __a) {1124wasm_i16x8_widen_high_u8x16(v128_t __a) {
1107 return (v128_t)__builtin_wasm_widen_high_u_i16x8_i8x16((__i8x16)__a);1125 return (v128_t) __builtin_convertvector(
1126 (__u8x8){((__u8x16)__a)[8], ((__u8x16)__a)[9], ((__u8x16)__a)[10],
1127 ((__u8x16)__a)[11], ((__u8x16)__a)[12], ((__u8x16)__a)[13],
1128 ((__u8x16)__a)[14], ((__u8x16)__a)[15]},
1129 __u16x8);
1108}1130}
11091131
1110static __inline__ v128_t __DEFAULT_FN_ATTRS1132static __inline__ v128_t __DEFAULT_FN_ATTRS
1111wasm_i32x4_widen_low_i16x8(v128_t __a) {1133wasm_i32x4_widen_low_i16x8(v128_t __a) {
1112 return (v128_t)__builtin_wasm_widen_low_s_i32x4_i16x8((__i16x8)__a);1134 return (v128_t) __builtin_convertvector(
1135 (__i16x4){((__i16x8)__a)[0], ((__i16x8)__a)[1], ((__i16x8)__a)[2],
1136 ((__i16x8)__a)[3]},
1137 __i32x4);
1113}1138}
11141139
1115static __inline__ v128_t __DEFAULT_FN_ATTRS1140static __inline__ v128_t __DEFAULT_FN_ATTRS
1116wasm_i32x4_widen_high_i16x8(v128_t __a) {1141wasm_i32x4_widen_high_i16x8(v128_t __a) {
1117 return (v128_t)__builtin_wasm_widen_high_s_i32x4_i16x8((__i16x8)__a);1142 return (v128_t) __builtin_convertvector(
1143 (__i16x4){((__i16x8)__a)[4], ((__i16x8)__a)[5], ((__i16x8)__a)[6],
1144 ((__i16x8)__a)[7]},
1145 __i32x4);
1118}1146}
11191147
1120static __inline__ v128_t __DEFAULT_FN_ATTRS1148static __inline__ v128_t __DEFAULT_FN_ATTRS
1121wasm_i32x4_widen_low_u16x8(v128_t __a) {1149wasm_i32x4_widen_low_u16x8(v128_t __a) {
1122 return (v128_t)__builtin_wasm_widen_low_u_i32x4_i16x8((__i16x8)__a);1150 return (v128_t) __builtin_convertvector(
1151 (__u16x4){((__u16x8)__a)[0], ((__u16x8)__a)[1], ((__u16x8)__a)[2],
1152 ((__u16x8)__a)[3]},
1153 __u32x4);
1123}1154}
11241155
1125static __inline__ v128_t __DEFAULT_FN_ATTRS1156static __inline__ v128_t __DEFAULT_FN_ATTRS
1126wasm_i32x4_widen_high_u16x8(v128_t __a) {1157wasm_i32x4_widen_high_u16x8(v128_t __a) {
1127 return (v128_t)__builtin_wasm_widen_high_u_i32x4_i16x8((__i16x8)__a);1158 return (v128_t) __builtin_convertvector(
1159 (__u16x4){((__u16x8)__a)[4], ((__u16x8)__a)[5], ((__u16x8)__a)[6],
1160 ((__u16x8)__a)[7]},
1161 __u32x4);
1128}1162}
11291163
1130// Undefine helper macros1164// Undefine helper macros
lib/include/x86gprintrin.h created+23
...@@ -0,0 +1,23 @@
1/*===--------------- x86gprintrin.h - X86 GPR 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 __X86GPRINTRIN_H
11#define __X86GPRINTRIN_H
12
13#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
14 defined(__HRESET__)
15#include <hresetintrin.h>
16#endif
17
18#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
19 defined(__UINTR__)
20#include <uintrintrin.h>
21#endif
22
23#endif /* __X86GPRINTRIN_H */
lib/libcxx/include/__availability created+206
...@@ -0,0 +1,206 @@
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___AVAILABILITY
11#define _LIBCPP___AVAILABILITY
12
13#include <__config>
14
15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16# pragma GCC system_header
17#endif
18
19// Libc++ is shipped by various vendors. In particular, it is used as a system
20// library on macOS, iOS and other Apple platforms. In order for users to be
21// able to compile a binary that is intended to be deployed to an older version
22// of a platform, Clang provides availability attributes [1]. These attributes
23// can be placed on declarations and are used to describe the life cycle of a
24// symbol in the library.
25//
26// The main goal is to ensure a compile-time error if a symbol that hasn't been
27// introduced in a previously released library is used in a program that targets
28// that previously released library. Normally, this would be a load-time error
29// when one tries to launch the program against the older library.
30//
31// For example, the filesystem library was introduced in the dylib in macOS 10.15.
32// If a user compiles on a macOS 10.15 host but targets macOS 10.13 with their
33// program, the compiler would normally not complain (because the required
34// declarations are in the headers), but the dynamic loader would fail to find
35// the symbols when actually trying to launch the program on macOS 10.13. To
36// turn this into a compile-time issue instead, declarations are annotated with
37// when they were introduced, and the compiler can produce a diagnostic if the
38// program references something that isn't available on the deployment target.
39//
40// This mechanism is general in nature, and any vendor can add their markup to
41// the library (see below). Whenever a new feature is added that requires support
42// in the shared library, a macro should be added below to mark this feature
43// as unavailable. When vendors decide to ship the feature as part of their
44// shared library, they can update the markup appropriately.
45//
46// Note that this mechanism is disabled by default in the "upstream" libc++.
47// Availability annotations are only meaningful when shipping libc++ inside
48// a platform (i.e. as a system library), and so vendors that want them should
49// turn those annotations on at CMake configuration time.
50//
51// [1]: https://clang.llvm.org/docs/AttributeReference.html#availability
52
53
54// For backwards compatibility, allow users to define _LIBCPP_DISABLE_AVAILABILITY
55// for a while.
56#if defined(_LIBCPP_DISABLE_AVAILABILITY)
57# if !defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
58# define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
59# endif
60#endif
61
62// Availability markup is disabled when building the library, or when the compiler
63// doesn't support the proper attributes.
64#if defined(_LIBCPP_BUILDING_LIBRARY) || \
65 defined(_LIBCXXABI_BUILDING_LIBRARY) || \
66 !__has_feature(attribute_availability_with_strict) || \
67 !__has_feature(attribute_availability_in_templates) || \
68 !__has_extension(pragma_clang_attribute_external_declaration)
69# if !defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
70# define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
71# endif
72#endif
73
74#if defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
75
76 // This controls the availability of std::shared_mutex and std::shared_timed_mutex,
77 // which were added to the dylib later.
78# define _LIBCPP_AVAILABILITY_SHARED_MUTEX
79
80 // These macros control the availability of std::bad_optional_access and
81 // other exception types. These were put in the shared library to prevent
82 // code bloat from every user program defining the vtable for these exception
83 // types.
84# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
85# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
86# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST
87
88 // This controls the availability of std::uncaught_exceptions().
89# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
90
91 // This controls the availability of the sized version of ::operator delete,
92 // which was added to the dylib later.
93# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
94
95 // This controls the availability of the std::future_error exception.
96# define _LIBCPP_AVAILABILITY_FUTURE_ERROR
97
98 // This controls the availability of std::type_info's vtable.
99 // I can't imagine how using std::type_info can work at all if
100 // this isn't supported.
101# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
102
103 // This controls the availability of std::locale::category members
104 // (e.g. std::locale::collate), which are defined in the dylib.
105# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
106
107 // This controls the availability of atomic operations on std::shared_ptr
108 // (e.g. `std::atomic_store(std::shared_ptr)`), which require a shared
109 // lock table located in the dylib.
110# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
111
112 // These macros control the availability of all parts of <filesystem> that
113 // depend on something in the dylib.
114# define _LIBCPP_AVAILABILITY_FILESYSTEM
115# define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
116# define _LIBCPP_AVAILABILITY_FILESYSTEM_POP
117
118 // This controls the availability of std::to_chars.
119# define _LIBCPP_AVAILABILITY_TO_CHARS
120
121 // This controls the availability of the C++20 synchronization library,
122 // which requires shared library support for various operations
123 // (see libcxx/src/atomic.cpp).
124# define _LIBCPP_AVAILABILITY_SYNC
125
126#elif defined(__APPLE__)
127
128# define _LIBCPP_AVAILABILITY_SHARED_MUTEX \
129 __attribute__((availability(macosx,strict,introduced=10.12))) \
130 __attribute__((availability(ios,strict,introduced=10.0))) \
131 __attribute__((availability(tvos,strict,introduced=10.0))) \
132 __attribute__((availability(watchos,strict,introduced=3.0)))
133# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS \
134 __attribute__((availability(macosx,strict,introduced=10.13))) \
135 __attribute__((availability(ios,strict,introduced=11.0))) \
136 __attribute__((availability(tvos,strict,introduced=11.0))) \
137 __attribute__((availability(watchos,strict,introduced=4.0)))
138# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS \
139 _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
140# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST \
141 _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
142# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \
143 __attribute__((availability(macosx,strict,introduced=10.12))) \
144 __attribute__((availability(ios,strict,introduced=10.0))) \
145 __attribute__((availability(tvos,strict,introduced=10.0))) \
146 __attribute__((availability(watchos,strict,introduced=3.0)))
147# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE \
148 __attribute__((availability(macosx,strict,introduced=10.12))) \
149 __attribute__((availability(ios,strict,introduced=10.0))) \
150 __attribute__((availability(tvos,strict,introduced=10.0))) \
151 __attribute__((availability(watchos,strict,introduced=3.0)))
152# define _LIBCPP_AVAILABILITY_FUTURE_ERROR \
153 __attribute__((availability(ios,strict,introduced=6.0)))
154# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE \
155 __attribute__((availability(macosx,strict,introduced=10.9))) \
156 __attribute__((availability(ios,strict,introduced=7.0)))
157# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY \
158 __attribute__((availability(macosx,strict,introduced=10.9))) \
159 __attribute__((availability(ios,strict,introduced=7.0)))
160# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \
161 __attribute__((availability(macosx,strict,introduced=10.9))) \
162 __attribute__((availability(ios,strict,introduced=7.0)))
163# define _LIBCPP_AVAILABILITY_FILESYSTEM \
164 __attribute__((availability(macosx,strict,introduced=10.15))) \
165 __attribute__((availability(ios,strict,introduced=13.0))) \
166 __attribute__((availability(tvos,strict,introduced=13.0))) \
167 __attribute__((availability(watchos,strict,introduced=6.0)))
168# define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH \
169 _Pragma("clang attribute push(__attribute__((availability(macosx,strict,introduced=10.15))), apply_to=any(function,record))") \
170 _Pragma("clang attribute push(__attribute__((availability(ios,strict,introduced=13.0))), apply_to=any(function,record))") \
171 _Pragma("clang attribute push(__attribute__((availability(tvos,strict,introduced=13.0))), apply_to=any(function,record))") \
172 _Pragma("clang attribute push(__attribute__((availability(watchos,strict,introduced=6.0))), apply_to=any(function,record))")
173# define _LIBCPP_AVAILABILITY_FILESYSTEM_POP \
174 _Pragma("clang attribute pop") \
175 _Pragma("clang attribute pop") \
176 _Pragma("clang attribute pop") \
177 _Pragma("clang attribute pop")
178# define _LIBCPP_AVAILABILITY_TO_CHARS \
179 _LIBCPP_AVAILABILITY_FILESYSTEM
180# define _LIBCPP_AVAILABILITY_SYNC \
181 __attribute__((unavailable))
182
183#else
184
185// ...New vendors can add availability markup here...
186
187# error "It looks like you're trying to enable vendor availability markup, but you haven't defined the corresponding macros yet!"
188
189#endif
190
191// Define availability attributes that depend on _LIBCPP_NO_EXCEPTIONS.
192// Those are defined in terms of the availability attributes above, and
193// should not be vendor-specific.
194#if defined(_LIBCPP_NO_EXCEPTIONS)
195# define _LIBCPP_AVAILABILITY_FUTURE
196# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
197# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
198# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
199#else
200# define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR
201# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _LIBCPP_AVAILABILITY_BAD_ANY_CAST
202# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
203# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
204#endif
205
206#endif // _LIBCPP___AVAILABILITY
lib/libcxx/include/__bit_reference+15-15
...@@ -11,7 +11,7 @@...@@ -11,7 +11,7 @@
11#define _LIBCPP___BIT_REFERENCE11#define _LIBCPP___BIT_REFERENCE
1212
13#include <__config>13#include <__config>
14#include <bit>14#include <__bits>
15#include <algorithm>15#include <algorithm>
1616
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -239,8 +239,8 @@ __bit_iterator<_Cp, _IsConst>...@@ -239,8 +239,8 @@ __bit_iterator<_Cp, _IsConst>
239find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_)239find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_)
240{240{
241 if (static_cast<bool>(__value_))241 if (static_cast<bool>(__value_))
242 return __find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));242 return _VSTD::__find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
243 return __find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));243 return _VSTD::__find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
244}244}
245245
246// count246// count
...@@ -313,8 +313,8 @@ typename __bit_iterator<_Cp, _IsConst>::difference_type...@@ -313,8 +313,8 @@ typename __bit_iterator<_Cp, _IsConst>::difference_type
313count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_)313count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_)
314{314{
315 if (static_cast<bool>(__value_))315 if (static_cast<bool>(__value_))
316 return __count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));316 return _VSTD::__count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
317 return __count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));317 return _VSTD::__count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
318}318}
319319
320// fill_n320// fill_n
...@@ -387,9 +387,9 @@ fill_n(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n, bool __v...@@ -387,9 +387,9 @@ fill_n(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n, bool __v
387 if (__n > 0)387 if (__n > 0)
388 {388 {
389 if (__value_)389 if (__value_)
390 __fill_n_true(__first, __n);390 _VSTD::__fill_n_true(__first, __n);
391 else391 else
392 __fill_n_false(__first, __n);392 _VSTD::__fill_n_false(__first, __n);
393 }393 }
394}394}
395395
...@@ -538,8 +538,8 @@ __bit_iterator<_Cp, false>...@@ -538,8 +538,8 @@ __bit_iterator<_Cp, false>
538copy(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)538copy(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
539{539{
540 if (__first.__ctz_ == __result.__ctz_)540 if (__first.__ctz_ == __result.__ctz_)
541 return __copy_aligned(__first, __last, __result);541 return _VSTD::__copy_aligned(__first, __last, __result);
542 return __copy_unaligned(__first, __last, __result);542 return _VSTD::__copy_unaligned(__first, __last, __result);
543}543}
544544
545// copy_backward545// copy_backward
...@@ -685,8 +685,8 @@ __bit_iterator<_Cp, false>...@@ -685,8 +685,8 @@ __bit_iterator<_Cp, false>
685copy_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)685copy_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
686{686{
687 if (__last.__ctz_ == __result.__ctz_)687 if (__last.__ctz_ == __result.__ctz_)
688 return __copy_backward_aligned(__first, __last, __result);688 return _VSTD::__copy_backward_aligned(__first, __last, __result);
689 return __copy_backward_unaligned(__first, __last, __result);689 return _VSTD::__copy_backward_unaligned(__first, __last, __result);
690}690}
691691
692// move692// move
...@@ -868,8 +868,8 @@ swap_ranges(__bit_iterator<__C1, false> __first1, __bit_iterator<__C1, false> __...@@ -868,8 +868,8 @@ swap_ranges(__bit_iterator<__C1, false> __first1, __bit_iterator<__C1, false> __
868 __bit_iterator<__C2, false> __first2)868 __bit_iterator<__C2, false> __first2)
869{869{
870 if (__first1.__ctz_ == __first2.__ctz_)870 if (__first1.__ctz_ == __first2.__ctz_)
871 return __swap_ranges_aligned(__first1, __last1, __first2);871 return _VSTD::__swap_ranges_aligned(__first1, __last1, __first2);
872 return __swap_ranges_unaligned(__first1, __last1, __first2);872 return _VSTD::__swap_ranges_unaligned(__first1, __last1, __first2);
873}873}
874874
875// rotate875// rotate
...@@ -1083,8 +1083,8 @@ bool...@@ -1083,8 +1083,8 @@ bool
1083equal(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, __bit_iterator<_Cp, _IC2> __first2)1083equal(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, __bit_iterator<_Cp, _IC2> __first2)
1084{1084{
1085 if (__first1.__ctz_ == __first2.__ctz_)1085 if (__first1.__ctz_ == __first2.__ctz_)
1086 return __equal_aligned(__first1, __last1, __first2);1086 return _VSTD::__equal_aligned(__first1, __last1, __first2);
1087 return __equal_unaligned(__first1, __last1, __first2);1087 return _VSTD::__equal_unaligned(__first1, __last1, __first2);
1088}1088}
10891089
1090template <class _Cp, bool _IsConst,1090template <class _Cp, bool _IsConst,
lib/libcxx/include/__bits created+146
...@@ -0,0 +1,146 @@
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___BITS
11#define _LIBCPP___BITS
12
13#include <__config>
14
15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16#pragma GCC system_header
17#endif
18
19_LIBCPP_PUSH_MACROS
20#include <__undef_macros>
21
22
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25#ifndef _LIBCPP_COMPILER_MSVC
26
27inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
28int __libcpp_ctz(unsigned __x) _NOEXCEPT { return __builtin_ctz(__x); }
29
30inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
31int __libcpp_ctz(unsigned long __x) _NOEXCEPT { return __builtin_ctzl(__x); }
32
33inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
34int __libcpp_ctz(unsigned long long __x) _NOEXCEPT { return __builtin_ctzll(__x); }
35
36
37inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
38int __libcpp_clz(unsigned __x) _NOEXCEPT { return __builtin_clz(__x); }
39
40inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
41int __libcpp_clz(unsigned long __x) _NOEXCEPT { return __builtin_clzl(__x); }
42
43inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
44int __libcpp_clz(unsigned long long __x) _NOEXCEPT { return __builtin_clzll(__x); }
45
46
47inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
48int __libcpp_popcount(unsigned __x) _NOEXCEPT { return __builtin_popcount(__x); }
49
50inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
51int __libcpp_popcount(unsigned long __x) _NOEXCEPT { return __builtin_popcountl(__x); }
52
53inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
54int __libcpp_popcount(unsigned long long __x) _NOEXCEPT { return __builtin_popcountll(__x); }
55
56#else // _LIBCPP_COMPILER_MSVC
57
58// Precondition: __x != 0
59inline _LIBCPP_INLINE_VISIBILITY
60int __libcpp_ctz(unsigned __x) {
61 static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
62 static_assert(sizeof(unsigned long) == 4, "");
63 unsigned long __where;
64 if (_BitScanForward(&__where, __x))
65 return static_cast<int>(__where);
66 return 32;
67}
68
69inline _LIBCPP_INLINE_VISIBILITY
70int __libcpp_ctz(unsigned long __x) {
71 static_assert(sizeof(unsigned long) == sizeof(unsigned), "");
72 return __ctz(static_cast<unsigned>(__x));
73}
74
75inline _LIBCPP_INLINE_VISIBILITY
76int __libcpp_ctz(unsigned long long __x) {
77 unsigned long __where;
78#if defined(_LIBCPP_HAS_BITSCAN64)
79 (defined(_M_AMD64) || defined(__x86_64__))
80 if (_BitScanForward64(&__where, __x))
81 return static_cast<int>(__where);
82#else
83 // Win32 doesn't have _BitScanForward64 so emulate it with two 32 bit calls.
84 if (_BitScanForward(&__where, static_cast<unsigned long>(__x)))
85 return static_cast<int>(__where);
86 if (_BitScanForward(&__where, static_cast<unsigned long>(__x >> 32)))
87 return static_cast<int>(__where + 32);
88#endif
89 return 64;
90}
91
92// Precondition: __x != 0
93inline _LIBCPP_INLINE_VISIBILITY
94int __libcpp_clz(unsigned __x) {
95 static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
96 static_assert(sizeof(unsigned long) == 4, "");
97 unsigned long __where;
98 if (_BitScanReverse(&__where, __x))
99 return static_cast<int>(31 - __where);
100 return 32; // Undefined Behavior.
101}
102
103inline _LIBCPP_INLINE_VISIBILITY
104int __libcpp_clz(unsigned long __x) {
105 static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
106 return __libcpp_clz(static_cast<unsigned>(__x));
107}
108
109inline _LIBCPP_INLINE_VISIBILITY
110int __libcpp_clz(unsigned long long __x) {
111 unsigned long __where;
112#if defined(_LIBCPP_HAS_BITSCAN64)
113 if (_BitScanReverse64(&__where, __x))
114 return static_cast<int>(63 - __where);
115#else
116 // Win32 doesn't have _BitScanReverse64 so emulate it with two 32 bit calls.
117 if (_BitScanReverse(&__where, static_cast<unsigned long>(__x >> 32)))
118 return static_cast<int>(63 - (__where + 32));
119 if (_BitScanReverse(&__where, static_cast<unsigned long>(__x)))
120 return static_cast<int>(63 - __where);
121#endif
122 return 64; // Undefined Behavior.
123}
124
125inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned __x) {
126 static_assert(sizeof(unsigned) == 4, "");
127 return __popcnt(__x);
128}
129
130inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned long __x) {
131 static_assert(sizeof(unsigned long) == 4, "");
132 return __popcnt(__x);
133}
134
135inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned long long __x) {
136 static_assert(sizeof(unsigned long long) == 8, "");
137 return __popcnt64(__x);
138}
139
140#endif // _LIBCPP_COMPILER_MSVC
141
142_LIBCPP_END_NAMESPACE_STD
143
144_LIBCPP_POP_MACROS
145
146#endif // _LIBCPP__BITS
lib/libcxx/include/__config+101-203
...@@ -32,13 +32,13 @@...@@ -32,13 +32,13 @@
32# define _GNUC_VER_NEW 032# define _GNUC_VER_NEW 0
33#endif33#endif
3434
35#define _LIBCPP_VERSION 1100035#define _LIBCPP_VERSION 12000
3636
37#ifndef _LIBCPP_ABI_VERSION37#ifndef _LIBCPP_ABI_VERSION
38# define _LIBCPP_ABI_VERSION 138# define _LIBCPP_ABI_VERSION 1
39#endif39#endif
4040
41#ifndef __STDC_HOSTED__41#if __STDC_HOSTED__ == 0
42# define _LIBCPP_FREESTANDING42# define _LIBCPP_FREESTANDING
43#endif43#endif
4444
...@@ -49,8 +49,10 @@...@@ -49,8 +49,10 @@
49# define _LIBCPP_STD_VER 1449# define _LIBCPP_STD_VER 14
50# elif __cplusplus <= 201703L50# elif __cplusplus <= 201703L
51# define _LIBCPP_STD_VER 1751# define _LIBCPP_STD_VER 17
52# elif __cplusplus <= 202002L
53# define _LIBCPP_STD_VER 20
52# else54# else
53# define _LIBCPP_STD_VER 18 // current year, or date of c++2a ratification55# define _LIBCPP_STD_VER 21 // current year, or date of c++2b ratification
54# endif56# endif
55#endif // _LIBCPP_STD_VER57#endif // _LIBCPP_STD_VER
5658
...@@ -63,7 +65,7 @@...@@ -63,7 +65,7 @@
63#elif defined(__wasm__)65#elif defined(__wasm__)
64# define _LIBCPP_OBJECT_FORMAT_WASM 166# define _LIBCPP_OBJECT_FORMAT_WASM 1
65#else67#else
66# error Unknown object file format68 // ... add new file formats here ...
67#endif69#endif
6870
69#if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 271#if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
...@@ -105,6 +107,10 @@...@@ -105,6 +107,10 @@
105// Re-worked external template instantiations for std::string with a focus on107// Re-worked external template instantiations for std::string with a focus on
106// performance and fast-path inlining.108// performance and fast-path inlining.
107# define _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION109# define _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
110// Enable clang::trivial_abi on std::unique_ptr.
111# define _LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI
112// Enable clang::trivial_abi on std::shared_ptr and std::weak_ptr
113# define _LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI
108#elif _LIBCPP_ABI_VERSION == 1114#elif _LIBCPP_ABI_VERSION == 1
109# if !defined(_LIBCPP_OBJECT_FORMAT_COFF)115# if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
110// Enable compiling copies of now inline methods into the dylib to support116// Enable compiling copies of now inline methods into the dylib to support
...@@ -121,9 +127,11 @@...@@ -121,9 +127,11 @@
121# endif127# endif
122#endif128#endif
123129
124#ifdef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR130#if defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
125#error "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. \131// Enable additional explicit instantiations of iostreams components. This
126 use _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR instead132// reduces the number of weak definitions generated in programs that use
133// iostreams by providing a single strong definition in the shared library.
134# define _LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1
127#endif135#endif
128136
129#define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y137#define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y
...@@ -256,14 +264,14 @@...@@ -256,14 +264,14 @@
256# endif // __LONG_LONG_SUPPORTED264# endif // __LONG_LONG_SUPPORTED
257#endif // __FreeBSD__265#endif // __FreeBSD__
258266
259#ifdef __NetBSD__267#if defined(__NetBSD__) || defined(__OpenBSD__)
260# include <sys/endian.h>268# include <sys/endian.h>
261# if _BYTE_ORDER == _LITTLE_ENDIAN269# if _BYTE_ORDER == _LITTLE_ENDIAN
262# define _LIBCPP_LITTLE_ENDIAN270# define _LIBCPP_LITTLE_ENDIAN
263# else // _BYTE_ORDER == _LITTLE_ENDIAN271# else // _BYTE_ORDER == _LITTLE_ENDIAN
264# define _LIBCPP_BIG_ENDIAN272# define _LIBCPP_BIG_ENDIAN
265# endif // _BYTE_ORDER == _LITTLE_ENDIAN273# endif // _BYTE_ORDER == _LITTLE_ENDIAN
266#endif // __NetBSD__274#endif // defined(__NetBSD__) || defined(__OpenBSD__)
267275
268#if defined(_WIN32)276#if defined(_WIN32)
269# define _LIBCPP_WIN32API277# define _LIBCPP_WIN32API
...@@ -304,7 +312,7 @@...@@ -304,7 +312,7 @@
304# endif312# endif
305#endif // __sun__313#endif // __sun__
306314
307#if defined(__CloudABI__)315#if defined(__OpenBSD__) || defined(__CloudABI__)
308 // Certain architectures provide arc4random(). Prefer using316 // Certain architectures provide arc4random(). Prefer using
309 // arc4random() over /dev/{u,}random to make it possible to obtain317 // arc4random() over /dev/{u,}random to make it possible to obtain
310 // random data even when using sandboxing mechanisms such as chroots,318 // random data even when using sandboxing mechanisms such as chroots,
...@@ -344,13 +352,11 @@...@@ -344,13 +352,11 @@
344# if defined(__FreeBSD__)352# if defined(__FreeBSD__)
345# define _LIBCPP_HAS_ALIGNED_ALLOC353# define _LIBCPP_HAS_ALIGNED_ALLOC
346# define _LIBCPP_HAS_QUICK_EXIT354# define _LIBCPP_HAS_QUICK_EXIT
347# define _LIBCPP_HAS_C11_FEATURES
348# if __FreeBSD_version >= 1300064 || \355# if __FreeBSD_version >= 1300064 || \
349 (__FreeBSD_version >= 1201504 && __FreeBSD_version < 1300000)356 (__FreeBSD_version >= 1201504 && __FreeBSD_version < 1300000)
350# define _LIBCPP_HAS_TIMESPEC_GET357# define _LIBCPP_HAS_TIMESPEC_GET
351# endif358# endif
352# elif defined(__BIONIC__)359# elif defined(__BIONIC__)
353# define _LIBCPP_HAS_C11_FEATURES
354# if __ANDROID_API__ >= 21360# if __ANDROID_API__ >= 21
355# define _LIBCPP_HAS_QUICK_EXIT361# define _LIBCPP_HAS_QUICK_EXIT
356# endif362# endif
...@@ -364,7 +370,9 @@...@@ -364,7 +370,9 @@
364# define _LIBCPP_HAS_ALIGNED_ALLOC370# define _LIBCPP_HAS_ALIGNED_ALLOC
365# define _LIBCPP_HAS_QUICK_EXIT371# define _LIBCPP_HAS_QUICK_EXIT
366# define _LIBCPP_HAS_TIMESPEC_GET372# define _LIBCPP_HAS_TIMESPEC_GET
367# define _LIBCPP_HAS_C11_FEATURES373# elif defined(__OpenBSD__)
374# define _LIBCPP_HAS_ALIGNED_ALLOC
375# define _LIBCPP_HAS_TIMESPEC_GET
368# elif defined(__linux__)376# elif defined(__linux__)
369# if !defined(_LIBCPP_HAS_MUSL_LIBC)377# if !defined(_LIBCPP_HAS_MUSL_LIBC)
370# if _LIBCPP_GLIBC_PREREQ(2, 15) || defined(__BIONIC__)378# if _LIBCPP_GLIBC_PREREQ(2, 15) || defined(__BIONIC__)
...@@ -372,16 +380,24 @@...@@ -372,16 +380,24 @@
372# endif380# endif
373# if _LIBCPP_GLIBC_PREREQ(2, 17)381# if _LIBCPP_GLIBC_PREREQ(2, 17)
374# define _LIBCPP_HAS_ALIGNED_ALLOC382# define _LIBCPP_HAS_ALIGNED_ALLOC
375# define _LIBCPP_HAS_C11_FEATURES
376# define _LIBCPP_HAS_TIMESPEC_GET383# define _LIBCPP_HAS_TIMESPEC_GET
377# endif384# endif
378# else // defined(_LIBCPP_HAS_MUSL_LIBC)385# else // defined(_LIBCPP_HAS_MUSL_LIBC)
379# define _LIBCPP_HAS_ALIGNED_ALLOC386# define _LIBCPP_HAS_ALIGNED_ALLOC
380# define _LIBCPP_HAS_QUICK_EXIT387# define _LIBCPP_HAS_QUICK_EXIT
381# define _LIBCPP_HAS_TIMESPEC_GET388# define _LIBCPP_HAS_TIMESPEC_GET
382# define _LIBCPP_HAS_C11_FEATURES
383# endif389# endif
384# endif // __linux__390# elif defined(__APPLE__)
391 // timespec_get and aligned_alloc were introduced in macOS 10.15 and
392 // aligned releases
393# if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500 || \
394 __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130000 || \
395 __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 130000 || \
396 __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 60000)
397# define _LIBCPP_HAS_ALIGNED_ALLOC
398# define _LIBCPP_HAS_TIMESPEC_GET
399# endif
400# endif // __APPLE__
385#endif401#endif
386402
387#ifndef _LIBCPP_CXX03_LANG403#ifndef _LIBCPP_CXX03_LANG
...@@ -389,9 +405,7 @@...@@ -389,9 +405,7 @@
389#elif defined(_LIBCPP_COMPILER_CLANG)405#elif defined(_LIBCPP_COMPILER_CLANG)
390# define _LIBCPP_ALIGNOF(_Tp) _Alignof(_Tp)406# define _LIBCPP_ALIGNOF(_Tp) _Alignof(_Tp)
391#else407#else
392// This definition is potentially buggy, but it's only taken with GCC in C++03,408# error "We don't know a correct way to implement alignof(T) in C++03 outside of Clang"
393// which we barely support anyway. See llvm.org/PR39713
394# define _LIBCPP_ALIGNOF(_Tp) __alignof(_Tp)
395#endif409#endif
396410
397#define _LIBCPP_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp)411#define _LIBCPP_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp)
...@@ -433,10 +447,6 @@ typedef __char32_t char32_t;...@@ -433,10 +447,6 @@ typedef __char32_t char32_t;
433# define _LIBCPP_NORETURN __attribute__ ((noreturn))447# define _LIBCPP_NORETURN __attribute__ ((noreturn))
434#endif448#endif
435449
436#if !(__has_feature(cxx_lambdas))
437#define _LIBCPP_HAS_NO_LAMBDAS
438#endif
439
440#if !(__has_feature(cxx_nullptr))450#if !(__has_feature(cxx_nullptr))
441# if (__has_extension(cxx_nullptr) || __has_keyword(__nullptr)) && defined(_LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR)451# if (__has_extension(cxx_nullptr) || __has_keyword(__nullptr)) && defined(_LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR)
442# define nullptr __nullptr452# define nullptr __nullptr
...@@ -445,18 +455,6 @@ typedef __char32_t char32_t;...@@ -445,18 +455,6 @@ typedef __char32_t char32_t;
445# endif455# endif
446#endif456#endif
447457
448#if !(__has_feature(cxx_rvalue_references))
449#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
450#endif
451
452#if !(__has_feature(cxx_auto_type))
453#define _LIBCPP_HAS_NO_AUTO_TYPE
454#endif
455
456#if !(__has_feature(cxx_variadic_templates))
457#define _LIBCPP_HAS_NO_VARIADICS
458#endif
459
460// Objective-C++ features (opt-in)458// Objective-C++ features (opt-in)
461#if __has_feature(objc_arc)459#if __has_feature(objc_arc)
462#define _LIBCPP_HAS_OBJC_ARC460#define _LIBCPP_HAS_OBJC_ARC
...@@ -720,7 +718,7 @@ typedef __char32_t char32_t;...@@ -720,7 +718,7 @@ typedef __char32_t char32_t;
720#endif718#endif
721719
722#ifndef _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS720#ifndef _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
723# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)721# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
724# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __attribute__ ((__visibility__("default")))722# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __attribute__ ((__visibility__("default")))
725# else723# else
726# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS724# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
...@@ -754,16 +752,6 @@ typedef __char32_t char32_t;...@@ -754,16 +752,6 @@ typedef __char32_t char32_t;
754# endif752# endif
755#endif753#endif
756754
757#ifndef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION
758# ifdef _LIBCPP_OBJECT_FORMAT_COFF // Windows binaries can't merge typeinfos.
759# define _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION 2
760# else
761 // TODO: This isn't strictly correct on ELF platforms due to llvm.org/PR37398
762 // And we should consider defaulting to OFF.
763# define _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION 1
764# endif
765#endif
766
767#ifndef _LIBCPP_HIDE_FROM_ABI755#ifndef _LIBCPP_HIDE_FROM_ABI
768# if _LIBCPP_HIDE_FROM_ABI_PER_TU756# if _LIBCPP_HIDE_FROM_ABI_PER_TU
769# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_INTERNAL_LINKAGE757# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_INTERNAL_LINKAGE
...@@ -838,6 +826,12 @@ typedef unsigned int char32_t;...@@ -838,6 +826,12 @@ typedef unsigned int char32_t;
838# define _LIBCPP_CONSTEXPR constexpr826# define _LIBCPP_CONSTEXPR constexpr
839#endif827#endif
840828
829#ifndef __cpp_consteval
830# define _LIBCPP_CONSTEVAL _LIBCPP_CONSTEXPR
831#else
832# define _LIBCPP_CONSTEVAL consteval
833#endif
834
841#ifdef _LIBCPP_CXX03_LANG835#ifdef _LIBCPP_CXX03_LANG
842# define _LIBCPP_DEFAULT {}836# define _LIBCPP_DEFAULT {}
843#else837#else
...@@ -863,10 +857,6 @@ typedef unsigned int char32_t;...@@ -863,10 +857,6 @@ typedef unsigned int char32_t;
863# define _LIBCPP_EXPLICIT857# define _LIBCPP_EXPLICIT
864#endif858#endif
865859
866#if !__has_builtin(__builtin_operator_new) || !__has_builtin(__builtin_operator_delete)
867#define _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE
868#endif
869
870#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS860#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
871# define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx861# define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
872# define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \862# define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
...@@ -880,34 +870,43 @@ typedef unsigned int char32_t;...@@ -880,34 +870,43 @@ typedef unsigned int char32_t;
880# define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)870# define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
881#endif // _LIBCPP_HAS_NO_STRONG_ENUMS871#endif // _LIBCPP_HAS_NO_STRONG_ENUMS
882872
883#ifdef _LIBCPP_DEBUG873// _LIBCPP_DEBUG potential values:
884# if _LIBCPP_DEBUG == 0874// - undefined: No assertions. This is the default.
885# define _LIBCPP_DEBUG_LEVEL 1875// - 0: Basic assertions
886# elif _LIBCPP_DEBUG == 1876// - 1: Basic assertions + iterator validity checks.
887# define _LIBCPP_DEBUG_LEVEL 2877#if !defined(_LIBCPP_DEBUG)
888# else878# define _LIBCPP_DEBUG_LEVEL 0
889# error Supported values for _LIBCPP_DEBUG are 0 and 1879#elif _LIBCPP_DEBUG == 0
890# endif880# define _LIBCPP_DEBUG_LEVEL 1
891# if !defined(_LIBCPP_BUILDING_LIBRARY)881#elif _LIBCPP_DEBUG == 1
892# define _LIBCPP_EXTERN_TEMPLATE(...)882# define _LIBCPP_DEBUG_LEVEL 2
893# endif883#else
884# error Supported values for _LIBCPP_DEBUG are 0 and 1
894#endif885#endif
895886
896#ifndef _LIBCPP_DEBUG_LEVEL887// _LIBCPP_DEBUG_LEVEL is always defined to one of [0, 1, 2] at this point
897# define _LIBCPP_DEBUG_LEVEL 0888#if _LIBCPP_DEBUG_LEVEL >= 1 && !defined(_LIBCPP_DISABLE_EXTERN_TEMPLATE)
889# define _LIBCPP_EXTERN_TEMPLATE(...)
898#endif890#endif
899891
900#ifdef _LIBCPP_DISABLE_EXTERN_TEMPLATE892#ifdef _LIBCPP_DISABLE_EXTERN_TEMPLATE
901#define _LIBCPP_EXTERN_TEMPLATE(...)893# define _LIBCPP_EXTERN_TEMPLATE(...)
902#define _LIBCPP_EXTERN_TEMPLATE2(...)894# define _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(...)
903#endif895#endif
904896
905#ifndef _LIBCPP_EXTERN_TEMPLATE897#ifndef _LIBCPP_EXTERN_TEMPLATE
906#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;898#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
907#endif899#endif
908900
909#ifndef _LIBCPP_EXTERN_TEMPLATE2901// When the Debug mode is enabled, we disable extern declarations because we
910#define _LIBCPP_EXTERN_TEMPLATE2(...) extern template __VA_ARGS__;902// don't want to use the functions compiled in the library, which might not
903// have had the debug mode enabled when built. However, some extern declarations
904// need to be used, because code correctness depends on it (several instances
905// in the <locale>). Those special declarations are declared with
906// _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE, which is enabled even
907// when the debug mode is enabled.
908#ifndef _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE
909# define _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(...) extern template __VA_ARGS__;
911#endif910#endif
912911
913#ifndef _LIBCPP_EXTERN_TEMPLATE_DEFINE912#ifndef _LIBCPP_EXTERN_TEMPLATE_DEFINE
...@@ -938,6 +937,8 @@ typedef unsigned int char32_t;...@@ -938,6 +937,8 @@ typedef unsigned int char32_t;
938 // We're deferring to Microsoft's STL to provide aligned new et al. We don't937 // We're deferring to Microsoft's STL to provide aligned new et al. We don't
939 // have it unless the language feature test macro is defined.938 // have it unless the language feature test macro is defined.
940# define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION939# define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
940#elif defined(__MVS__)
941# define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
941#endif942#endif
942943
943#if defined(__APPLE__)944#if defined(__APPLE__)
...@@ -999,6 +1000,18 @@ typedef unsigned int char32_t;...@@ -999,6 +1000,18 @@ typedef unsigned int char32_t;
999# define _LIBCPP_DEPRECATED_IN_CXX171000# define _LIBCPP_DEPRECATED_IN_CXX17
1000#endif1001#endif
10011002
1003#if _LIBCPP_STD_VER > 17
1004# define _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_DEPRECATED
1005#else
1006# define _LIBCPP_DEPRECATED_IN_CXX20
1007#endif
1008
1009#if !defined(_LIBCPP_NO_HAS_CHAR8_T)
1010# define _LIBCPP_DEPRECATED_WITH_CHAR8_T _LIBCPP_DEPRECATED
1011#else
1012# define _LIBCPP_DEPRECATED_WITH_CHAR8_T
1013#endif
1014
1002// Macros to enter and leave a state where deprecation warnings are suppressed.1015// Macros to enter and leave a state where deprecation warnings are suppressed.
1003#if !defined(_LIBCPP_SUPPRESS_DEPRECATED_PUSH) && \1016#if !defined(_LIBCPP_SUPPRESS_DEPRECATED_PUSH) && \
1004 (defined(_LIBCPP_COMPILER_CLANG) || defined(_LIBCPP_COMPILER_GCC))1017 (defined(_LIBCPP_COMPILER_CLANG) || defined(_LIBCPP_COMPILER_GCC))
...@@ -1037,14 +1050,6 @@ typedef unsigned int char32_t;...@@ -1037,14 +1050,6 @@ typedef unsigned int char32_t;
1037# define _LIBCPP_CONSTEXPR_AFTER_CXX171050# define _LIBCPP_CONSTEXPR_AFTER_CXX17
1038#endif1051#endif
10391052
1040#if _LIBCPP_STD_VER > 17 && \
1041 !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) && \
1042 !defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED)
1043# define _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED constexpr
1044#else
1045# define _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
1046#endif
1047
1048// The _LIBCPP_NODISCARD_ATTRIBUTE should only be used to define other1053// The _LIBCPP_NODISCARD_ATTRIBUTE should only be used to define other
1049// NODISCARD macros to the correct attribute.1054// NODISCARD macros to the correct attribute.
1050#if __has_cpp_attribute(nodiscard) || defined(_LIBCPP_COMPILER_MSVC)1055#if __has_cpp_attribute(nodiscard) || defined(_LIBCPP_COMPILER_MSVC)
...@@ -1079,12 +1084,6 @@ typedef unsigned int char32_t;...@@ -1079,12 +1084,6 @@ typedef unsigned int char32_t;
1079# define _LIBCPP_INLINE_VAR1084# define _LIBCPP_INLINE_VAR
1080#endif1085#endif
10811086
1082#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1083# define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x)
1084#else
1085# define _LIBCPP_EXPLICIT_MOVE(x) (x)
1086#endif
1087
1088#ifndef _LIBCPP_CONSTEXPR_IF_NODEBUG1087#ifndef _LIBCPP_CONSTEXPR_IF_NODEBUG
1089#if defined(_LIBCPP_DEBUG) || defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)1088#if defined(_LIBCPP_DEBUG) || defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
1090#define _LIBCPP_CONSTEXPR_IF_NODEBUG1089#define _LIBCPP_CONSTEXPR_IF_NODEBUG
...@@ -1100,7 +1099,7 @@ typedef unsigned int char32_t;...@@ -1100,7 +1099,7 @@ typedef unsigned int char32_t;
1100#endif1099#endif
11011100
1102#ifndef _LIBCPP_HAS_NO_ASAN1101#ifndef _LIBCPP_HAS_NO_ASAN
1103_LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(1102extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container(
1104 const void *, const void *, const void *, const void *);1103 const void *, const void *, const void *, const void *);
1105#endif1104#endif
11061105
...@@ -1125,11 +1124,14 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(...@@ -1125,11 +1124,14 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
1125# if defined(__FreeBSD__) || \1124# if defined(__FreeBSD__) || \
1126 defined(__wasi__) || \1125 defined(__wasi__) || \
1127 defined(__NetBSD__) || \1126 defined(__NetBSD__) || \
1127 defined(__OpenBSD__) || \
1128 defined(__NuttX__) || \
1128 defined(__linux__) || \1129 defined(__linux__) || \
1129 defined(__GNU__) || \1130 defined(__GNU__) || \
1130 defined(__APPLE__) || \1131 defined(__APPLE__) || \
1131 defined(__CloudABI__) || \1132 defined(__CloudABI__) || \
1132 defined(__sun__) || \1133 defined(__sun__) || \
1134 defined(__MVS__) || \
1133 (defined(__MINGW32__) && __has_include(<pthread.h>))1135 (defined(__MINGW32__) && __has_include(<pthread.h>))
1134# define _LIBCPP_HAS_THREAD_API_PTHREAD1136# define _LIBCPP_HAS_THREAD_API_PTHREAD
1135# elif defined(__Fuchsia__)1137# elif defined(__Fuchsia__)
...@@ -1167,10 +1169,6 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(...@@ -1167,10 +1169,6 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
1167 _LIBCPP_HAS_NO_THREADS is defined.1169 _LIBCPP_HAS_NO_THREADS is defined.
1168#endif1170#endif
11691171
1170#if defined(__STDCPP_THREADS__) && defined(_LIBCPP_HAS_NO_THREADS)
1171#error _LIBCPP_HAS_NO_THREADS cannot be set when __STDCPP_THREADS__ is set.
1172#endif
1173
1174#if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(__STDCPP_THREADS__)1172#if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(__STDCPP_THREADS__)
1175#define __STDCPP_THREADS__ 11173#define __STDCPP_THREADS__ 1
1176#endif1174#endif
...@@ -1222,13 +1220,15 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(...@@ -1222,13 +1220,15 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
1222// Some systems do not provide gets() in their C library, for security reasons.1220// Some systems do not provide gets() in their C library, for security reasons.
1223#ifndef _LIBCPP_C_HAS_NO_GETS1221#ifndef _LIBCPP_C_HAS_NO_GETS
1224# if defined(_LIBCPP_MSVCRT) || \1222# if defined(_LIBCPP_MSVCRT) || \
1225 (defined(__FreeBSD_version) && __FreeBSD_version >= 1300043)1223 (defined(__FreeBSD_version) && __FreeBSD_version >= 1300043) || \
1224 defined(__OpenBSD__)
1226# define _LIBCPP_C_HAS_NO_GETS1225# define _LIBCPP_C_HAS_NO_GETS
1227# endif1226# endif
1228#endif1227#endif
12291228
1230#if defined(__BIONIC__) || defined(__CloudABI__) || \1229#if defined(__BIONIC__) || defined(__CloudABI__) || defined(__NuttX__) || \
1231 defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC)1230 defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC) || \
1231 defined(__MVS__) || defined(__OpenBSD__)
1232#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE1232#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
1233#endif1233#endif
12341234
...@@ -1337,6 +1337,12 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(...@@ -1337,6 +1337,12 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
1337#endif1337#endif
1338#endif // !defined(_LIBCPP_NODEBUG_TYPE)1338#endif // !defined(_LIBCPP_NODEBUG_TYPE)
13391339
1340#if __has_attribute(__preferred_name__)
1341#define _LIBCPP_PREFERRED_NAME(x) __attribute__((__preferred_name__(x)))
1342#else
1343#define _LIBCPP_PREFERRED_NAME(x)
1344#endif
1345
1340#if defined(_LIBCPP_ABI_MICROSOFT) && \1346#if defined(_LIBCPP_ABI_MICROSOFT) && \
1341 (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases))1347 (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases))
1342# define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases)1348# define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
...@@ -1367,120 +1373,6 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(...@@ -1367,120 +1373,6 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
1367#define _LIBCPP_HAS_NO_SPACESHIP_OPERATOR1373#define _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
1368#endif1374#endif
13691375
1370// Decide whether to use availability macros.
1371#if !defined(_LIBCPP_BUILDING_LIBRARY) && \
1372 !defined(_LIBCXXABI_BUILDING_LIBRARY) && \
1373 !defined(_LIBCPP_DISABLE_AVAILABILITY) && \
1374 __has_feature(attribute_availability_with_strict) && \
1375 __has_feature(attribute_availability_in_templates) && \
1376 __has_extension(pragma_clang_attribute_external_declaration)
1377# ifdef __APPLE__
1378# define _LIBCPP_USE_AVAILABILITY_APPLE
1379# endif
1380#endif
1381
1382// Define availability macros.
1383#if defined(_LIBCPP_USE_AVAILABILITY_APPLE)
1384# define _LIBCPP_AVAILABILITY_SHARED_MUTEX \
1385 __attribute__((availability(macosx,strict,introduced=10.12))) \
1386 __attribute__((availability(ios,strict,introduced=10.0))) \
1387 __attribute__((availability(tvos,strict,introduced=10.0))) \
1388 __attribute__((availability(watchos,strict,introduced=3.0)))
1389# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS \
1390 __attribute__((availability(macosx,strict,introduced=10.13))) \
1391 __attribute__((availability(ios,strict,introduced=11.0))) \
1392 __attribute__((availability(tvos,strict,introduced=11.0))) \
1393 __attribute__((availability(watchos,strict,introduced=4.0)))
1394# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS \
1395 _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
1396# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST \
1397 _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
1398# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \
1399 __attribute__((availability(macosx,strict,introduced=10.12))) \
1400 __attribute__((availability(ios,strict,introduced=10.0))) \
1401 __attribute__((availability(tvos,strict,introduced=10.0))) \
1402 __attribute__((availability(watchos,strict,introduced=3.0)))
1403# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE \
1404 __attribute__((availability(macosx,strict,introduced=10.12))) \
1405 __attribute__((availability(ios,strict,introduced=10.0))) \
1406 __attribute__((availability(tvos,strict,introduced=10.0))) \
1407 __attribute__((availability(watchos,strict,introduced=3.0)))
1408# define _LIBCPP_AVAILABILITY_FUTURE_ERROR \
1409 __attribute__((availability(ios,strict,introduced=6.0)))
1410# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE \
1411 __attribute__((availability(macosx,strict,introduced=10.9))) \
1412 __attribute__((availability(ios,strict,introduced=7.0)))
1413# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY \
1414 __attribute__((availability(macosx,strict,introduced=10.9))) \
1415 __attribute__((availability(ios,strict,introduced=7.0)))
1416# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \
1417 __attribute__((availability(macosx,strict,introduced=10.9))) \
1418 __attribute__((availability(ios,strict,introduced=7.0)))
1419# define _LIBCPP_AVAILABILITY_FILESYSTEM \
1420 __attribute__((availability(macosx,strict,introduced=10.15))) \
1421 __attribute__((availability(ios,strict,introduced=13.0))) \
1422 __attribute__((availability(tvos,strict,introduced=13.0))) \
1423 __attribute__((availability(watchos,strict,introduced=6.0)))
1424# define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH \
1425 _Pragma("clang attribute push(__attribute__((availability(macosx,strict,introduced=10.15))), apply_to=any(function,record))") \
1426 _Pragma("clang attribute push(__attribute__((availability(ios,strict,introduced=13.0))), apply_to=any(function,record))") \
1427 _Pragma("clang attribute push(__attribute__((availability(tvos,strict,introduced=13.0))), apply_to=any(function,record))") \
1428 _Pragma("clang attribute push(__attribute__((availability(watchos,strict,introduced=6.0))), apply_to=any(function,record))")
1429# define _LIBCPP_AVAILABILITY_FILESYSTEM_POP \
1430 _Pragma("clang attribute pop") \
1431 _Pragma("clang attribute pop") \
1432 _Pragma("clang attribute pop") \
1433 _Pragma("clang attribute pop")
1434# define _LIBCPP_AVAILABILITY_TO_CHARS \
1435 _LIBCPP_AVAILABILITY_FILESYSTEM
1436# define _LIBCPP_AVAILABILITY_SYNC \
1437 __attribute__((unavailable))
1438#else
1439# define _LIBCPP_AVAILABILITY_SHARED_MUTEX
1440# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
1441# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
1442# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST
1443# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
1444# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
1445# define _LIBCPP_AVAILABILITY_FUTURE_ERROR
1446# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
1447# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
1448# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
1449# define _LIBCPP_AVAILABILITY_FILESYSTEM
1450# define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH
1451# define _LIBCPP_AVAILABILITY_FILESYSTEM_POP
1452# define _LIBCPP_AVAILABILITY_TO_CHARS
1453# define _LIBCPP_AVAILABILITY_SYNC
1454#endif
1455
1456// Define availability that depends on _LIBCPP_NO_EXCEPTIONS.
1457#ifdef _LIBCPP_NO_EXCEPTIONS
1458# define _LIBCPP_AVAILABILITY_FUTURE
1459# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
1460# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
1461# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
1462#else
1463# define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR
1464# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _LIBCPP_AVAILABILITY_BAD_ANY_CAST
1465# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
1466# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
1467#endif
1468
1469// The stream API was dropped and re-added in the dylib shipped on macOS
1470// and iOS. We can only assume the dylib to provide these definitions for
1471// macosx >= 10.9 and ios >= 7.0. Otherwise, the definitions are available
1472// from the headers, but not from the dylib. Explicit instantiation
1473// declarations for streams exist conditionally to this; if we provide
1474// an explicit instantiation declaration and we try to deploy to a dylib
1475// that does not provide those symbols, we'll get a load-time error.
1476#if !defined(_LIBCPP_BUILDING_LIBRARY) && \
1477 ((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
1478 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090) || \
1479 (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
1480 __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000))
1481# define _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
1482#endif
1483
1484#if defined(_LIBCPP_COMPILER_IBM)1376#if defined(_LIBCPP_COMPILER_IBM)
1485#define _LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO1377#define _LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO
1486#endif1378#endif
...@@ -1547,6 +1439,12 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(...@@ -1547,6 +1439,12 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
1547#define _LIBCPP_HAS_NO_FGETPOS_FSETPOS1439#define _LIBCPP_HAS_NO_FGETPOS_FSETPOS
1548#endif1440#endif
15491441
1442#if __has_attribute(init_priority)
1443# define _LIBCPP_INIT_PRIORITY_MAX __attribute__((init_priority(101)))
1444#else
1445# define _LIBCPP_INIT_PRIORITY_MAX
1446#endif
1447
1550#endif // __cplusplus1448#endif // __cplusplus
15511449
1552#endif // _LIBCPP_CONFIG1450#endif // _LIBCPP_CONFIG
lib/libcxx/include/__config_site.in+4-2
...@@ -26,12 +26,14 @@...@@ -26,12 +26,14 @@
26#cmakedefine _LIBCPP_HAS_THREAD_API_WIN3226#cmakedefine _LIBCPP_HAS_THREAD_API_WIN32
27#cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL27#cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL
28#cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS28#cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
29#cmakedefine _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
29#cmakedefine _LIBCPP_NO_VCRUNTIME30#cmakedefine _LIBCPP_NO_VCRUNTIME
30#ifndef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION
31#cmakedefine _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION @_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION@31#cmakedefine _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION @_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION@
32#endif
33#cmakedefine _LIBCPP_ABI_NAMESPACE @_LIBCPP_ABI_NAMESPACE@32#cmakedefine _LIBCPP_ABI_NAMESPACE @_LIBCPP_ABI_NAMESPACE@
33#cmakedefine _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY
34#cmakedefine _LIBCPP_HAS_PARALLEL_ALGORITHMS34#cmakedefine _LIBCPP_HAS_PARALLEL_ALGORITHMS
35#cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE
36#cmakedefine _LIBCPP_HAS_NO_LOCALIZATION
3537
36@_LIBCPP_ABI_DEFINES@38@_LIBCPP_ABI_DEFINES@
3739
lib/libcxx/include/__debug+17-22
...@@ -27,26 +27,21 @@...@@ -27,26 +27,21 @@
27# include <cstddef>27# include <cstddef>
28#endif28#endif
2929
30#if _LIBCPP_DEBUG_LEVEL >= 1 && !defined(_LIBCPP_ASSERT)30#if _LIBCPP_DEBUG_LEVEL == 0
31# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : \31# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0)
32 _VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, #x, m)))32# define _LIBCPP_ASSERT_IMPL(x, m) ((void)0)
33#endif33#elif _LIBCPP_DEBUG_LEVEL == 1
34
35#if _LIBCPP_DEBUG_LEVEL >= 2
36#ifndef _LIBCPP_DEBUG_ASSERT
37#define _LIBCPP_DEBUG_ASSERT(x, m) _LIBCPP_ASSERT(x, m)
38#endif
39#define _LIBCPP_DEBUG_MODE(...) __VA_ARGS__
40#endif
41
42#ifndef _LIBCPP_ASSERT
43# define _LIBCPP_ASSERT(x, m) ((void)0)
44#endif
45#ifndef _LIBCPP_DEBUG_ASSERT
46# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0)34# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0)
35# define _LIBCPP_ASSERT_IMPL(x, m) ((x) ? (void)0 : _VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, #x, m)))
36#elif _LIBCPP_DEBUG_LEVEL == 2
37# define _LIBCPP_DEBUG_ASSERT(x, m) _LIBCPP_ASSERT(x, m)
38# define _LIBCPP_ASSERT_IMPL(x, m) ((x) ? (void)0 : _VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, #x, m)))
39#else
40# error _LIBCPP_DEBUG_LEVEL must be one of 0, 1, 2
47#endif41#endif
48#ifndef _LIBCPP_DEBUG_MODE42
49#define _LIBCPP_DEBUG_MODE(...) ((void)0)43#if !defined(_LIBCPP_ASSERT)
44# define _LIBCPP_ASSERT(x, m) _LIBCPP_ASSERT_IMPL(x, m)
50#endif45#endif
5146
52_LIBCPP_BEGIN_NAMESPACE_STD47_LIBCPP_BEGIN_NAMESPACE_STD
...@@ -59,7 +54,7 @@ struct _LIBCPP_TEMPLATE_VIS __libcpp_debug_info {...@@ -59,7 +54,7 @@ struct _LIBCPP_TEMPLATE_VIS __libcpp_debug_info {
59 __libcpp_debug_info(const char* __f, int __l, const char* __p, const char* __m)54 __libcpp_debug_info(const char* __f, int __l, const char* __p, const char* __m)
60 : __file_(__f), __line_(__l), __pred_(__p), __msg_(__m) {}55 : __file_(__f), __line_(__l), __pred_(__p), __msg_(__m) {}
6156
62 _LIBCPP_FUNC_VIS std::string what() const;57 _LIBCPP_FUNC_VIS string what() const;
6358
64 const char* __file_;59 const char* __file_;
65 int __line_;60 int __line_;
...@@ -83,7 +78,7 @@ void __libcpp_abort_debug_function(__libcpp_debug_info const&);...@@ -83,7 +78,7 @@ void __libcpp_abort_debug_function(__libcpp_debug_info const&);
83_LIBCPP_FUNC_VIS78_LIBCPP_FUNC_VIS
84bool __libcpp_set_debug_function(__libcpp_debug_function_type __func);79bool __libcpp_set_debug_function(__libcpp_debug_function_type __func);
8580
86#if _LIBCPP_DEBUG_LEVEL >= 2 || defined(_LIBCPP_BUILDING_LIBRARY)81#if _LIBCPP_DEBUG_LEVEL == 2 || defined(_LIBCPP_BUILDING_LIBRARY)
8782
88struct _LIBCPP_TYPE_VIS __c_node;83struct _LIBCPP_TYPE_VIS __c_node;
8984
...@@ -226,7 +221,7 @@ public:...@@ -226,7 +221,7 @@ public:
226221
227 template <class _Cont>222 template <class _Cont>
228 _LIBCPP_INLINE_VISIBILITY static __c_node* __create_C_node(void *__mem, void *__c, __c_node *__next) {223 _LIBCPP_INLINE_VISIBILITY static __c_node* __create_C_node(void *__mem, void *__c, __c_node *__next) {
229 return ::new(__mem) _C_node<_Cont>(__c, __next);224 return ::new (__mem) _C_node<_Cont>(__c, __next);
230 }225 }
231226
232 template <class _Cont>227 template <class _Cont>
...@@ -271,7 +266,7 @@ _LIBCPP_FUNC_VIS __libcpp_db* __get_db();...@@ -271,7 +266,7 @@ _LIBCPP_FUNC_VIS __libcpp_db* __get_db();
271_LIBCPP_FUNC_VIS const __libcpp_db* __get_const_db();266_LIBCPP_FUNC_VIS const __libcpp_db* __get_const_db();
272267
273268
274#endif // _LIBCPP_DEBUG_LEVEL >= 2 || defined(_LIBCPP_BUILDING_LIBRARY)269#endif // _LIBCPP_DEBUG_LEVEL == 2 || defined(_LIBCPP_BUILDING_LIBRARY)
275270
276_LIBCPP_END_NAMESPACE_STD271_LIBCPP_END_NAMESPACE_STD
277272
lib/libcxx/include/__functional_03+24-24
...@@ -126,7 +126,7 @@ __func<_Fp, _Alloc, _Rp()>::__clone() const...@@ -126,7 +126,7 @@ __func<_Fp, _Alloc, _Rp()>::__clone() const
126 _Ap __a(__f_.second());126 _Ap __a(__f_.second());
127 typedef __allocator_destructor<_Ap> _Dp;127 typedef __allocator_destructor<_Ap> _Dp;
128 unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));128 unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
129 ::new (__hold.get()) __func(__f_.first(), _Alloc(__a));129 ::new ((void*)__hold.get()) __func(__f_.first(), _Alloc(__a));
130 return __hold.release();130 return __hold.release();
131}131}
132132
...@@ -134,7 +134,7 @@ template<class _Fp, class _Alloc, class _Rp>...@@ -134,7 +134,7 @@ template<class _Fp, class _Alloc, class _Rp>
134void134void
135__func<_Fp, _Alloc, _Rp()>::__clone(__base<_Rp()>* __p) const135__func<_Fp, _Alloc, _Rp()>::__clone(__base<_Rp()>* __p) const
136{136{
137 ::new (__p) __func(__f_.first(), __f_.second());137 ::new ((void*)__p) __func(__f_.first(), __f_.second());
138}138}
139139
140template<class _Fp, class _Alloc, class _Rp>140template<class _Fp, class _Alloc, class _Rp>
...@@ -212,7 +212,7 @@ __func<_Fp, _Alloc, _Rp(_A0)>::__clone() const...@@ -212,7 +212,7 @@ __func<_Fp, _Alloc, _Rp(_A0)>::__clone() const
212 _Ap __a(__f_.second());212 _Ap __a(__f_.second());
213 typedef __allocator_destructor<_Ap> _Dp;213 typedef __allocator_destructor<_Ap> _Dp;
214 unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));214 unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
215 ::new (__hold.get()) __func(__f_.first(), _Alloc(__a));215 ::new ((void*)__hold.get()) __func(__f_.first(), _Alloc(__a));
216 return __hold.release();216 return __hold.release();
217}217}
218218
...@@ -220,7 +220,7 @@ template<class _Fp, class _Alloc, class _Rp, class _A0>...@@ -220,7 +220,7 @@ template<class _Fp, class _Alloc, class _Rp, class _A0>
220void220void
221__func<_Fp, _Alloc, _Rp(_A0)>::__clone(__base<_Rp(_A0)>* __p) const221__func<_Fp, _Alloc, _Rp(_A0)>::__clone(__base<_Rp(_A0)>* __p) const
222{222{
223 ::new (__p) __func(__f_.first(), __f_.second());223 ::new ((void*)__p) __func(__f_.first(), __f_.second());
224}224}
225225
226template<class _Fp, class _Alloc, class _Rp, class _A0>226template<class _Fp, class _Alloc, class _Rp, class _A0>
...@@ -298,7 +298,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone() const...@@ -298,7 +298,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone() const
298 _Ap __a(__f_.second());298 _Ap __a(__f_.second());
299 typedef __allocator_destructor<_Ap> _Dp;299 typedef __allocator_destructor<_Ap> _Dp;
300 unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));300 unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
301 ::new (__hold.get()) __func(__f_.first(), _Alloc(__a));301 ::new ((void*)__hold.get()) __func(__f_.first(), _Alloc(__a));
302 return __hold.release();302 return __hold.release();
303}303}
304304
...@@ -306,7 +306,7 @@ template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>...@@ -306,7 +306,7 @@ template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
306void306void
307__func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone(__base<_Rp(_A0, _A1)>* __p) const307__func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone(__base<_Rp(_A0, _A1)>* __p) const
308{308{
309 ::new (__p) __func(__f_.first(), __f_.second());309 ::new ((void*)__p) __func(__f_.first(), __f_.second());
310}310}
311311
312template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>312template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
...@@ -384,7 +384,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone() const...@@ -384,7 +384,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone() const
384 _Ap __a(__f_.second());384 _Ap __a(__f_.second());
385 typedef __allocator_destructor<_Ap> _Dp;385 typedef __allocator_destructor<_Ap> _Dp;
386 unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));386 unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
387 ::new (__hold.get()) __func(__f_.first(), _Alloc(__a));387 ::new ((void*)__hold.get()) __func(__f_.first(), _Alloc(__a));
388 return __hold.release();388 return __hold.release();
389}389}
390390
...@@ -392,7 +392,7 @@ template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>...@@ -392,7 +392,7 @@ template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
392void392void
393__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone(__base<_Rp(_A0, _A1, _A2)>* __p) const393__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone(__base<_Rp(_A0, _A1, _A2)>* __p) const
394{394{
395 ::new (__p) __func(__f_.first(), __f_.second());395 ::new ((void*)__p) __func(__f_.first(), __f_.second());
396}396}
397397
398template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>398template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
...@@ -554,7 +554,7 @@ function<_Rp()>::function(_Fp __f,...@@ -554,7 +554,7 @@ function<_Rp()>::function(_Fp __f,
554 if (sizeof(_FF) <= sizeof(__buf_))554 if (sizeof(_FF) <= sizeof(__buf_))
555 {555 {
556 __f_ = (__base*)&__buf_;556 __f_ = (__base*)&__buf_;
557 ::new (__f_) _FF(__f);557 ::new ((void*)__f_) _FF(__f);
558 }558 }
559 else559 else
560 {560 {
...@@ -562,7 +562,7 @@ function<_Rp()>::function(_Fp __f,...@@ -562,7 +562,7 @@ function<_Rp()>::function(_Fp __f,
562 _Ap __a;562 _Ap __a;
563 typedef __allocator_destructor<_Ap> _Dp;563 typedef __allocator_destructor<_Ap> _Dp;
564 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));564 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
565 ::new (__hold.get()) _FF(__f, allocator<_Fp>(__a));565 ::new ((void*)__hold.get()) _FF(__f, allocator<_Fp>(__a));
566 __f_ = __hold.release();566 __f_ = __hold.release();
567 }567 }
568 }568 }
...@@ -581,7 +581,7 @@ function<_Rp()>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,...@@ -581,7 +581,7 @@ function<_Rp()>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
581 if (sizeof(_FF) <= sizeof(__buf_))581 if (sizeof(_FF) <= sizeof(__buf_))
582 {582 {
583 __f_ = (__base*)&__buf_;583 __f_ = (__base*)&__buf_;
584 ::new (__f_) _FF(__f, __a0);584 ::new ((void*)__f_) _FF(__f, __a0);
585 }585 }
586 else586 else
587 {587 {
...@@ -589,7 +589,7 @@ function<_Rp()>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,...@@ -589,7 +589,7 @@ function<_Rp()>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
589 _Ap __a(__a0);589 _Ap __a(__a0);
590 typedef __allocator_destructor<_Ap> _Dp;590 typedef __allocator_destructor<_Ap> _Dp;
591 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));591 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
592 ::new (__hold.get()) _FF(__f, _Alloc(__a));592 ::new ((void*)__hold.get()) _FF(__f, _Alloc(__a));
593 __f_ = __hold.release();593 __f_ = __hold.release();
594 }594 }
595 }595 }
...@@ -834,7 +834,7 @@ function<_Rp(_A0)>::function(_Fp __f,...@@ -834,7 +834,7 @@ function<_Rp(_A0)>::function(_Fp __f,
834 if (sizeof(_FF) <= sizeof(__buf_))834 if (sizeof(_FF) <= sizeof(__buf_))
835 {835 {
836 __f_ = (__base*)&__buf_;836 __f_ = (__base*)&__buf_;
837 ::new (__f_) _FF(__f);837 ::new ((void*)__f_) _FF(__f);
838 }838 }
839 else839 else
840 {840 {
...@@ -842,7 +842,7 @@ function<_Rp(_A0)>::function(_Fp __f,...@@ -842,7 +842,7 @@ function<_Rp(_A0)>::function(_Fp __f,
842 _Ap __a;842 _Ap __a;
843 typedef __allocator_destructor<_Ap> _Dp;843 typedef __allocator_destructor<_Ap> _Dp;
844 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));844 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
845 ::new (__hold.get()) _FF(__f, allocator<_Fp>(__a));845 ::new ((void*)__hold.get()) _FF(__f, allocator<_Fp>(__a));
846 __f_ = __hold.release();846 __f_ = __hold.release();
847 }847 }
848 }848 }
...@@ -861,7 +861,7 @@ function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,...@@ -861,7 +861,7 @@ function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
861 if (sizeof(_FF) <= sizeof(__buf_))861 if (sizeof(_FF) <= sizeof(__buf_))
862 {862 {
863 __f_ = (__base*)&__buf_;863 __f_ = (__base*)&__buf_;
864 ::new (__f_) _FF(__f, __a0);864 ::new ((void*)__f_) _FF(__f, __a0);
865 }865 }
866 else866 else
867 {867 {
...@@ -869,7 +869,7 @@ function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,...@@ -869,7 +869,7 @@ function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
869 _Ap __a(__a0);869 _Ap __a(__a0);
870 typedef __allocator_destructor<_Ap> _Dp;870 typedef __allocator_destructor<_Ap> _Dp;
871 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));871 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
872 ::new (__hold.get()) _FF(__f, _Alloc(__a));872 ::new ((void*)__hold.get()) _FF(__f, _Alloc(__a));
873 __f_ = __hold.release();873 __f_ = __hold.release();
874 }874 }
875 }875 }
...@@ -1114,7 +1114,7 @@ function<_Rp(_A0, _A1)>::function(_Fp __f,...@@ -1114,7 +1114,7 @@ function<_Rp(_A0, _A1)>::function(_Fp __f,
1114 if (sizeof(_FF) <= sizeof(__buf_))1114 if (sizeof(_FF) <= sizeof(__buf_))
1115 {1115 {
1116 __f_ = (__base*)&__buf_;1116 __f_ = (__base*)&__buf_;
1117 ::new (__f_) _FF(__f);1117 ::new ((void*)__f_) _FF(__f);
1118 }1118 }
1119 else1119 else
1120 {1120 {
...@@ -1122,7 +1122,7 @@ function<_Rp(_A0, _A1)>::function(_Fp __f,...@@ -1122,7 +1122,7 @@ function<_Rp(_A0, _A1)>::function(_Fp __f,
1122 _Ap __a;1122 _Ap __a;
1123 typedef __allocator_destructor<_Ap> _Dp;1123 typedef __allocator_destructor<_Ap> _Dp;
1124 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));1124 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
1125 ::new (__hold.get()) _FF(__f, allocator<_Fp>(__a));1125 ::new ((void*)__hold.get()) _FF(__f, allocator<_Fp>(__a));
1126 __f_ = __hold.release();1126 __f_ = __hold.release();
1127 }1127 }
1128 }1128 }
...@@ -1141,7 +1141,7 @@ function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,...@@ -1141,7 +1141,7 @@ function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
1141 if (sizeof(_FF) <= sizeof(__buf_))1141 if (sizeof(_FF) <= sizeof(__buf_))
1142 {1142 {
1143 __f_ = (__base*)&__buf_;1143 __f_ = (__base*)&__buf_;
1144 ::new (__f_) _FF(__f, __a0);1144 ::new ((void*)__f_) _FF(__f, __a0);
1145 }1145 }
1146 else1146 else
1147 {1147 {
...@@ -1149,7 +1149,7 @@ function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,...@@ -1149,7 +1149,7 @@ function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
1149 _Ap __a(__a0);1149 _Ap __a(__a0);
1150 typedef __allocator_destructor<_Ap> _Dp;1150 typedef __allocator_destructor<_Ap> _Dp;
1151 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));1151 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
1152 ::new (__hold.get()) _FF(__f, _Alloc(__a));1152 ::new ((void*)__hold.get()) _FF(__f, _Alloc(__a));
1153 __f_ = __hold.release();1153 __f_ = __hold.release();
1154 }1154 }
1155 }1155 }
...@@ -1394,7 +1394,7 @@ function<_Rp(_A0, _A1, _A2)>::function(_Fp __f,...@@ -1394,7 +1394,7 @@ function<_Rp(_A0, _A1, _A2)>::function(_Fp __f,
1394 if (sizeof(_FF) <= sizeof(__buf_))1394 if (sizeof(_FF) <= sizeof(__buf_))
1395 {1395 {
1396 __f_ = (__base*)&__buf_;1396 __f_ = (__base*)&__buf_;
1397 ::new (__f_) _FF(__f);1397 ::new ((void*)__f_) _FF(__f);
1398 }1398 }
1399 else1399 else
1400 {1400 {
...@@ -1402,7 +1402,7 @@ function<_Rp(_A0, _A1, _A2)>::function(_Fp __f,...@@ -1402,7 +1402,7 @@ function<_Rp(_A0, _A1, _A2)>::function(_Fp __f,
1402 _Ap __a;1402 _Ap __a;
1403 typedef __allocator_destructor<_Ap> _Dp;1403 typedef __allocator_destructor<_Ap> _Dp;
1404 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));1404 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
1405 ::new (__hold.get()) _FF(__f, allocator<_Fp>(__a));1405 ::new ((void*)__hold.get()) _FF(__f, allocator<_Fp>(__a));
1406 __f_ = __hold.release();1406 __f_ = __hold.release();
1407 }1407 }
1408 }1408 }
...@@ -1421,7 +1421,7 @@ function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc& __a0, _Fp...@@ -1421,7 +1421,7 @@ function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc& __a0, _Fp
1421 if (sizeof(_FF) <= sizeof(__buf_))1421 if (sizeof(_FF) <= sizeof(__buf_))
1422 {1422 {
1423 __f_ = (__base*)&__buf_;1423 __f_ = (__base*)&__buf_;
1424 ::new (__f_) _FF(__f, __a0);1424 ::new ((void*)__f_) _FF(__f, __a0);
1425 }1425 }
1426 else1426 else
1427 {1427 {
...@@ -1429,7 +1429,7 @@ function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc& __a0, _Fp...@@ -1429,7 +1429,7 @@ function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc& __a0, _Fp
1429 _Ap __a(__a0);1429 _Ap __a(__a0);
1430 typedef __allocator_destructor<_Ap> _Dp;1430 typedef __allocator_destructor<_Ap> _Dp;
1431 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));1431 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
1432 ::new (__hold.get()) _FF(__f, _Alloc(__a));1432 ::new ((void*)__hold.get()) _FF(__f, _Alloc(__a));
1433 __f_ = __hold.release();1433 __f_ = __hold.release();
1434 }1434 }
1435 }1435 }
lib/libcxx/include/__functional_base+41-38
...@@ -298,7 +298,7 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile>...@@ -298,7 +298,7 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile>
298template <class _Tp, class ..._Args>298template <class _Tp, class ..._Args>
299struct __invoke_return299struct __invoke_return
300{300{
301 typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type;301 typedef decltype(_VSTD::__invoke(declval<_Tp>(), declval<_Args>()...)) type;
302};302};
303303
304#else // defined(_LIBCPP_CXX03_LANG)304#else // defined(_LIBCPP_CXX03_LANG)
...@@ -308,64 +308,64 @@ struct __invoke_return...@@ -308,64 +308,64 @@ struct __invoke_return
308#endif // !defined(_LIBCPP_CXX03_LANG)308#endif // !defined(_LIBCPP_CXX03_LANG)
309309
310310
311template <class _Ret>311template <class _Ret, bool = is_void<_Ret>::value>
312struct __invoke_void_return_wrapper312struct __invoke_void_return_wrapper
313{313{
314#ifndef _LIBCPP_CXX03_LANG314#ifndef _LIBCPP_CXX03_LANG
315 template <class ..._Args>315 template <class ..._Args>
316 static _Ret __call(_Args&&... __args) {316 static _Ret __call(_Args&&... __args) {
317 return __invoke(_VSTD::forward<_Args>(__args)...);317 return _VSTD::__invoke(_VSTD::forward<_Args>(__args)...);
318 }318 }
319#else319#else
320 template <class _Fn>320 template <class _Fn>
321 static _Ret __call(_Fn __f) {321 static _Ret __call(_Fn __f) {
322 return __invoke(__f);322 return _VSTD::__invoke(__f);
323 }323 }
324324
325 template <class _Fn, class _A0>325 template <class _Fn, class _A0>
326 static _Ret __call(_Fn __f, _A0& __a0) {326 static _Ret __call(_Fn __f, _A0& __a0) {
327 return __invoke(__f, __a0);327 return _VSTD::__invoke(__f, __a0);
328 }328 }
329329
330 template <class _Fn, class _A0, class _A1>330 template <class _Fn, class _A0, class _A1>
331 static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1) {331 static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1) {
332 return __invoke(__f, __a0, __a1);332 return _VSTD::__invoke(__f, __a0, __a1);
333 }333 }
334334
335 template <class _Fn, class _A0, class _A1, class _A2>335 template <class _Fn, class _A0, class _A1, class _A2>
336 static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2){336 static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2){
337 return __invoke(__f, __a0, __a1, __a2);337 return _VSTD::__invoke(__f, __a0, __a1, __a2);
338 }338 }
339#endif339#endif
340};340};
341341
342template <>342template <class _Ret>
343struct __invoke_void_return_wrapper<void>343struct __invoke_void_return_wrapper<_Ret, true>
344{344{
345#ifndef _LIBCPP_CXX03_LANG345#ifndef _LIBCPP_CXX03_LANG
346 template <class ..._Args>346 template <class ..._Args>
347 static void __call(_Args&&... __args) {347 static void __call(_Args&&... __args) {
348 __invoke(_VSTD::forward<_Args>(__args)...);348 _VSTD::__invoke(_VSTD::forward<_Args>(__args)...);
349 }349 }
350#else350#else
351 template <class _Fn>351 template <class _Fn>
352 static void __call(_Fn __f) {352 static void __call(_Fn __f) {
353 __invoke(__f);353 _VSTD::__invoke(__f);
354 }354 }
355355
356 template <class _Fn, class _A0>356 template <class _Fn, class _A0>
357 static void __call(_Fn __f, _A0& __a0) {357 static void __call(_Fn __f, _A0& __a0) {
358 __invoke(__f, __a0);358 _VSTD::__invoke(__f, __a0);
359 }359 }
360360
361 template <class _Fn, class _A0, class _A1>361 template <class _Fn, class _A0, class _A1>
362 static void __call(_Fn __f, _A0& __a0, _A1& __a1) {362 static void __call(_Fn __f, _A0& __a0, _A1& __a1) {
363 __invoke(__f, __a0, __a1);363 _VSTD::__invoke(__f, __a0, __a1);
364 }364 }
365365
366 template <class _Fn, class _A0, class _A1, class _A2>366 template <class _Fn, class _A0, class _A1, class _A2>
367 static void __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2) {367 static void __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2) {
368 __invoke(__f, __a0, __a1, __a2);368 _VSTD::__invoke(__f, __a0, __a1, __a2);
369 }369 }
370#endif370#endif
371};371};
...@@ -382,135 +382,138 @@ private:...@@ -382,135 +382,138 @@ private:
382382
383public:383public:
384 // construct/copy/destroy384 // construct/copy/destroy
385 _LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT385 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
386 reference_wrapper(type& __f) _NOEXCEPT
386 : __f_(_VSTD::addressof(__f)) {}387 : __f_(_VSTD::addressof(__f)) {}
387#ifndef _LIBCPP_CXX03_LANG388#ifndef _LIBCPP_CXX03_LANG
388 private: reference_wrapper(type&&); public: // = delete; // do not bind to temps389 private: reference_wrapper(type&&); public: // = delete; // do not bind to temps
389#endif390#endif
390391
391 // access392 // access
392 _LIBCPP_INLINE_VISIBILITY operator type& () const _NOEXCEPT {return *__f_;}393 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
393 _LIBCPP_INLINE_VISIBILITY type& get() const _NOEXCEPT {return *__f_;}394 operator type&() const _NOEXCEPT {return *__f_;}
395 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
396 type& get() const _NOEXCEPT {return *__f_;}
394397
395#ifndef _LIBCPP_CXX03_LANG398#ifndef _LIBCPP_CXX03_LANG
396 // invoke399 // invoke
397 template <class... _ArgTypes>400 template <class... _ArgTypes>
398 _LIBCPP_INLINE_VISIBILITY401 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
399 typename __invoke_of<type&, _ArgTypes...>::type402 typename __invoke_of<type&, _ArgTypes...>::type
400 operator() (_ArgTypes&&... __args) const {403 operator() (_ArgTypes&&... __args) const {
401 return __invoke(get(), _VSTD::forward<_ArgTypes>(__args)...);404 return _VSTD::__invoke(get(), _VSTD::forward<_ArgTypes>(__args)...);
402 }405 }
403#else406#else
404407
405 _LIBCPP_INLINE_VISIBILITY408 _LIBCPP_INLINE_VISIBILITY
406 typename __invoke_return<type>::type409 typename __invoke_return<type>::type
407 operator() () const {410 operator() () const {
408 return __invoke(get());411 return _VSTD::__invoke(get());
409 }412 }
410413
411 template <class _A0>414 template <class _A0>
412 _LIBCPP_INLINE_VISIBILITY415 _LIBCPP_INLINE_VISIBILITY
413 typename __invoke_return0<type, _A0>::type416 typename __invoke_return0<type, _A0>::type
414 operator() (_A0& __a0) const {417 operator() (_A0& __a0) const {
415 return __invoke(get(), __a0);418 return _VSTD::__invoke(get(), __a0);
416 }419 }
417420
418 template <class _A0>421 template <class _A0>
419 _LIBCPP_INLINE_VISIBILITY422 _LIBCPP_INLINE_VISIBILITY
420 typename __invoke_return0<type, _A0 const>::type423 typename __invoke_return0<type, _A0 const>::type
421 operator() (_A0 const& __a0) const {424 operator() (_A0 const& __a0) const {
422 return __invoke(get(), __a0);425 return _VSTD::__invoke(get(), __a0);
423 }426 }
424427
425 template <class _A0, class _A1>428 template <class _A0, class _A1>
426 _LIBCPP_INLINE_VISIBILITY429 _LIBCPP_INLINE_VISIBILITY
427 typename __invoke_return1<type, _A0, _A1>::type430 typename __invoke_return1<type, _A0, _A1>::type
428 operator() (_A0& __a0, _A1& __a1) const {431 operator() (_A0& __a0, _A1& __a1) const {
429 return __invoke(get(), __a0, __a1);432 return _VSTD::__invoke(get(), __a0, __a1);
430 }433 }
431434
432 template <class _A0, class _A1>435 template <class _A0, class _A1>
433 _LIBCPP_INLINE_VISIBILITY436 _LIBCPP_INLINE_VISIBILITY
434 typename __invoke_return1<type, _A0 const, _A1>::type437 typename __invoke_return1<type, _A0 const, _A1>::type
435 operator() (_A0 const& __a0, _A1& __a1) const {438 operator() (_A0 const& __a0, _A1& __a1) const {
436 return __invoke(get(), __a0, __a1);439 return _VSTD::__invoke(get(), __a0, __a1);
437 }440 }
438441
439 template <class _A0, class _A1>442 template <class _A0, class _A1>
440 _LIBCPP_INLINE_VISIBILITY443 _LIBCPP_INLINE_VISIBILITY
441 typename __invoke_return1<type, _A0, _A1 const>::type444 typename __invoke_return1<type, _A0, _A1 const>::type
442 operator() (_A0& __a0, _A1 const& __a1) const {445 operator() (_A0& __a0, _A1 const& __a1) const {
443 return __invoke(get(), __a0, __a1);446 return _VSTD::__invoke(get(), __a0, __a1);
444 }447 }
445448
446 template <class _A0, class _A1>449 template <class _A0, class _A1>
447 _LIBCPP_INLINE_VISIBILITY450 _LIBCPP_INLINE_VISIBILITY
448 typename __invoke_return1<type, _A0 const, _A1 const>::type451 typename __invoke_return1<type, _A0 const, _A1 const>::type
449 operator() (_A0 const& __a0, _A1 const& __a1) const {452 operator() (_A0 const& __a0, _A1 const& __a1) const {
450 return __invoke(get(), __a0, __a1);453 return _VSTD::__invoke(get(), __a0, __a1);
451 }454 }
452455
453 template <class _A0, class _A1, class _A2>456 template <class _A0, class _A1, class _A2>
454 _LIBCPP_INLINE_VISIBILITY457 _LIBCPP_INLINE_VISIBILITY
455 typename __invoke_return2<type, _A0, _A1, _A2>::type458 typename __invoke_return2<type, _A0, _A1, _A2>::type
456 operator() (_A0& __a0, _A1& __a1, _A2& __a2) const {459 operator() (_A0& __a0, _A1& __a1, _A2& __a2) const {
457 return __invoke(get(), __a0, __a1, __a2);460 return _VSTD::__invoke(get(), __a0, __a1, __a2);
458 }461 }
459462
460 template <class _A0, class _A1, class _A2>463 template <class _A0, class _A1, class _A2>
461 _LIBCPP_INLINE_VISIBILITY464 _LIBCPP_INLINE_VISIBILITY
462 typename __invoke_return2<type, _A0 const, _A1, _A2>::type465 typename __invoke_return2<type, _A0 const, _A1, _A2>::type
463 operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const {466 operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const {
464 return __invoke(get(), __a0, __a1, __a2);467 return _VSTD::__invoke(get(), __a0, __a1, __a2);
465 }468 }
466469
467 template <class _A0, class _A1, class _A2>470 template <class _A0, class _A1, class _A2>
468 _LIBCPP_INLINE_VISIBILITY471 _LIBCPP_INLINE_VISIBILITY
469 typename __invoke_return2<type, _A0, _A1 const, _A2>::type472 typename __invoke_return2<type, _A0, _A1 const, _A2>::type
470 operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const {473 operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const {
471 return __invoke(get(), __a0, __a1, __a2);474 return _VSTD::__invoke(get(), __a0, __a1, __a2);
472 }475 }
473476
474 template <class _A0, class _A1, class _A2>477 template <class _A0, class _A1, class _A2>
475 _LIBCPP_INLINE_VISIBILITY478 _LIBCPP_INLINE_VISIBILITY
476 typename __invoke_return2<type, _A0, _A1, _A2 const>::type479 typename __invoke_return2<type, _A0, _A1, _A2 const>::type
477 operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const {480 operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const {
478 return __invoke(get(), __a0, __a1, __a2);481 return _VSTD::__invoke(get(), __a0, __a1, __a2);
479 }482 }
480483
481 template <class _A0, class _A1, class _A2>484 template <class _A0, class _A1, class _A2>
482 _LIBCPP_INLINE_VISIBILITY485 _LIBCPP_INLINE_VISIBILITY
483 typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type486 typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type
484 operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const {487 operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const {
485 return __invoke(get(), __a0, __a1, __a2);488 return _VSTD::__invoke(get(), __a0, __a1, __a2);
486 }489 }
487490
488 template <class _A0, class _A1, class _A2>491 template <class _A0, class _A1, class _A2>
489 _LIBCPP_INLINE_VISIBILITY492 _LIBCPP_INLINE_VISIBILITY
490 typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type493 typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type
491 operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const {494 operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const {
492 return __invoke(get(), __a0, __a1, __a2);495 return _VSTD::__invoke(get(), __a0, __a1, __a2);
493 }496 }
494497
495 template <class _A0, class _A1, class _A2>498 template <class _A0, class _A1, class _A2>
496 _LIBCPP_INLINE_VISIBILITY499 _LIBCPP_INLINE_VISIBILITY
497 typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type500 typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type
498 operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const {501 operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const {
499 return __invoke(get(), __a0, __a1, __a2);502 return _VSTD::__invoke(get(), __a0, __a1, __a2);
500 }503 }
501504
502 template <class _A0, class _A1, class _A2>505 template <class _A0, class _A1, class _A2>
503 _LIBCPP_INLINE_VISIBILITY506 _LIBCPP_INLINE_VISIBILITY
504 typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type507 typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type
505 operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const {508 operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const {
506 return __invoke(get(), __a0, __a1, __a2);509 return _VSTD::__invoke(get(), __a0, __a1, __a2);
507 }510 }
508#endif // _LIBCPP_CXX03_LANG511#endif // _LIBCPP_CXX03_LANG
509};512};
510513
511514
512template <class _Tp>515template <class _Tp>
513inline _LIBCPP_INLINE_VISIBILITY516inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
514reference_wrapper<_Tp>517reference_wrapper<_Tp>
515ref(_Tp& __t) _NOEXCEPT518ref(_Tp& __t) _NOEXCEPT
516{519{
...@@ -518,7 +521,7 @@ ref(_Tp& __t) _NOEXCEPT...@@ -518,7 +521,7 @@ ref(_Tp& __t) _NOEXCEPT
518}521}
519522
520template <class _Tp>523template <class _Tp>
521inline _LIBCPP_INLINE_VISIBILITY524inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
522reference_wrapper<_Tp>525reference_wrapper<_Tp>
523ref(reference_wrapper<_Tp> __t) _NOEXCEPT526ref(reference_wrapper<_Tp> __t) _NOEXCEPT
524{527{
...@@ -526,7 +529,7 @@ ref(reference_wrapper<_Tp> __t) _NOEXCEPT...@@ -526,7 +529,7 @@ ref(reference_wrapper<_Tp> __t) _NOEXCEPT
526}529}
527530
528template <class _Tp>531template <class _Tp>
529inline _LIBCPP_INLINE_VISIBILITY532inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
530reference_wrapper<const _Tp>533reference_wrapper<const _Tp>
531cref(const _Tp& __t) _NOEXCEPT534cref(const _Tp& __t) _NOEXCEPT
532{535{
...@@ -534,7 +537,7 @@ cref(const _Tp& __t) _NOEXCEPT...@@ -534,7 +537,7 @@ cref(const _Tp& __t) _NOEXCEPT
534}537}
535538
536template <class _Tp>539template <class _Tp>
537inline _LIBCPP_INLINE_VISIBILITY540inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
538reference_wrapper<const _Tp>541reference_wrapper<const _Tp>
539cref(reference_wrapper<_Tp> __t) _NOEXCEPT542cref(reference_wrapper<_Tp> __t) _NOEXCEPT
540{543{
lib/libcxx/include/__functional_base_03+12-12
...@@ -40,7 +40,7 @@ struct __enable_invoke_imp<_Ret, _T1, false, true> {...@@ -40,7 +40,7 @@ struct __enable_invoke_imp<_Ret, _T1, false, true> {
40template <class _Ret, class _T1>40template <class _Ret, class _T1>
41struct __enable_invoke_imp<_Ret, _T1, false, false> {41struct __enable_invoke_imp<_Ret, _T1, false, false> {
42 typedef typename add_lvalue_reference<42 typedef typename add_lvalue_reference<
43 typename __apply_cv<decltype(*_VSTD::declval<_T1>()), _Ret>::type43 typename __apply_cv<decltype(*declval<_T1>()), _Ret>::type
44 >::type _Bullet4;44 >::type _Bullet4;
45 typedef _Bullet4 type;45 typedef _Bullet4 type;
46};46};
...@@ -142,7 +142,7 @@ __invoke(_Fn __f, _T1& __t1) {...@@ -142,7 +142,7 @@ __invoke(_Fn __f, _T1& __t1) {
142142
143template <class _Fp>143template <class _Fp>
144inline _LIBCPP_INLINE_VISIBILITY144inline _LIBCPP_INLINE_VISIBILITY
145decltype(_VSTD::declval<_Fp&>()())145decltype(declval<_Fp&>()())
146__invoke(_Fp& __f)146__invoke(_Fp& __f)
147{147{
148 return __f();148 return __f();
...@@ -150,7 +150,7 @@ __invoke(_Fp& __f)...@@ -150,7 +150,7 @@ __invoke(_Fp& __f)
150150
151template <class _Fp, class _A0>151template <class _Fp, class _A0>
152inline _LIBCPP_INLINE_VISIBILITY152inline _LIBCPP_INLINE_VISIBILITY
153decltype(_VSTD::declval<_Fp&>()(_VSTD::declval<_A0&>()))153decltype(declval<_Fp&>()(declval<_A0&>()))
154__invoke(_Fp& __f, _A0& __a0)154__invoke(_Fp& __f, _A0& __a0)
155{155{
156 return __f(__a0);156 return __f(__a0);
...@@ -158,7 +158,7 @@ __invoke(_Fp& __f, _A0& __a0)...@@ -158,7 +158,7 @@ __invoke(_Fp& __f, _A0& __a0)
158158
159template <class _Fp, class _A0, class _A1>159template <class _Fp, class _A0, class _A1>
160inline _LIBCPP_INLINE_VISIBILITY160inline _LIBCPP_INLINE_VISIBILITY
161decltype(_VSTD::declval<_Fp&>()(_VSTD::declval<_A0&>(), _VSTD::declval<_A1&>()))161decltype(declval<_Fp&>()(declval<_A0&>(), declval<_A1&>()))
162__invoke(_Fp& __f, _A0& __a0, _A1& __a1)162__invoke(_Fp& __f, _A0& __a0, _A1& __a1)
163{163{
164 return __f(__a0, __a1);164 return __f(__a0, __a1);
...@@ -166,7 +166,7 @@ __invoke(_Fp& __f, _A0& __a0, _A1& __a1)...@@ -166,7 +166,7 @@ __invoke(_Fp& __f, _A0& __a0, _A1& __a1)
166166
167template <class _Fp, class _A0, class _A1, class _A2>167template <class _Fp, class _A0, class _A1, class _A2>
168inline _LIBCPP_INLINE_VISIBILITY168inline _LIBCPP_INLINE_VISIBILITY
169decltype(_VSTD::declval<_Fp&>()(_VSTD::declval<_A0&>(), _VSTD::declval<_A1&>(), _VSTD::declval<_A2&>()))169decltype(declval<_Fp&>()(declval<_A0&>(), declval<_A1&>(), declval<_A2&>()))
170__invoke(_Fp& __f, _A0& __a0, _A1& __a1, _A2& __a2)170__invoke(_Fp& __f, _A0& __a0, _A1& __a1, _A2& __a2)
171{171{
172 return __f(__a0, __a1, __a2);172 return __f(__a0, __a1, __a2);
...@@ -181,13 +181,13 @@ struct __invoke_return...@@ -181,13 +181,13 @@ struct __invoke_return
181template <class _Fp>181template <class _Fp>
182struct __invoke_return<_Fp, false>182struct __invoke_return<_Fp, false>
183{183{
184 typedef decltype(__invoke(_VSTD::declval<_Fp&>())) type;184 typedef decltype(_VSTD::__invoke(declval<_Fp&>())) type;
185};185};
186186
187template <class _Tp, class _A0>187template <class _Tp, class _A0>
188struct __invoke_return0188struct __invoke_return0
189{189{
190 typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>())) type;190 typedef decltype(_VSTD::__invoke(declval<_Tp&>(), declval<_A0&>())) type;
191};191};
192192
193template <class _Rp, class _Tp, class _A0>193template <class _Rp, class _Tp, class _A0>
...@@ -199,8 +199,8 @@ struct __invoke_return0<_Rp _Tp::*, _A0>...@@ -199,8 +199,8 @@ struct __invoke_return0<_Rp _Tp::*, _A0>
199template <class _Tp, class _A0, class _A1>199template <class _Tp, class _A0, class _A1>
200struct __invoke_return1200struct __invoke_return1
201{201{
202 typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>(),202 typedef decltype(_VSTD::__invoke(declval<_Tp&>(), declval<_A0&>(),
203 _VSTD::declval<_A1&>())) type;203 declval<_A1&>())) type;
204};204};
205205
206template <class _Rp, class _Class, class _A0, class _A1>206template <class _Rp, class _Class, class _A0, class _A1>
...@@ -211,9 +211,9 @@ struct __invoke_return1<_Rp _Class::*, _A0, _A1> {...@@ -211,9 +211,9 @@ struct __invoke_return1<_Rp _Class::*, _A0, _A1> {
211template <class _Tp, class _A0, class _A1, class _A2>211template <class _Tp, class _A0, class _A1, class _A2>
212struct __invoke_return2212struct __invoke_return2
213{213{
214 typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>(),214 typedef decltype(_VSTD::__invoke(declval<_Tp&>(), declval<_A0&>(),
215 _VSTD::declval<_A1&>(),215 declval<_A1&>(),
216 _VSTD::declval<_A2&>())) type;216 declval<_A2&>())) type;
217};217};
218218
219template <class _Ret, class _Class, class _A0, class _A1, class _A2>219template <class _Ret, class _Class, class _A0, class _A1, class _A2>
lib/libcxx/include/__hash_table+68-170
...@@ -34,19 +34,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -34,19 +34,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD
34template <class _Key, class _Tp>34template <class _Key, class _Tp>
35struct __hash_value_type;35struct __hash_value_type;
3636
37#ifndef _LIBCPP_CXX03_LANG
38template <class _Tp>37template <class _Tp>
39struct __is_hash_value_type_imp : false_type {};38struct __is_hash_value_type_imp : false_type {};
4039
41template <class _Key, class _Value>40template <class _Key, class _Value>
42struct __is_hash_value_type_imp<__hash_value_type<_Key, _Value>> : true_type {};41struct __is_hash_value_type_imp<__hash_value_type<_Key, _Value> > : true_type {};
4342
44template <class ..._Args>43template <class ..._Args>
45struct __is_hash_value_type : false_type {};44struct __is_hash_value_type : false_type {};
4645
47template <class _One>46template <class _One>
48struct __is_hash_value_type<_One> : __is_hash_value_type_imp<typename __uncvref<_One>::type> {};47struct __is_hash_value_type<_One> : __is_hash_value_type_imp<typename __uncvref<_One>::type> {};
49#endif
5048
51_LIBCPP_FUNC_VIS49_LIBCPP_FUNC_VIS
52size_t __next_prime(size_t __n);50size_t __next_prime(size_t __n);
...@@ -122,7 +120,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -122,7 +120,7 @@ inline _LIBCPP_INLINE_VISIBILITY
122size_t120size_t
123__next_hash_pow2(size_t __n)121__next_hash_pow2(size_t __n)
124{122{
125 return __n < 2 ? __n : (size_t(1) << (std::numeric_limits<size_t>::digits - __libcpp_clz(__n-1)));123 return __n < 2 ? __n : (size_t(1) << (numeric_limits<size_t>::digits - __libcpp_clz(__n-1)));
126}124}
127125
128126
...@@ -155,12 +153,10 @@ struct __hash_key_value_types {...@@ -155,12 +153,10 @@ struct __hash_key_value_types {
155 static __container_value_type* __get_ptr(__node_value_type& __n) {153 static __container_value_type* __get_ptr(__node_value_type& __n) {
156 return _VSTD::addressof(__n);154 return _VSTD::addressof(__n);
157 }155 }
158#ifndef _LIBCPP_CXX03_LANG
159 _LIBCPP_INLINE_VISIBILITY156 _LIBCPP_INLINE_VISIBILITY
160 static __container_value_type&& __move(__node_value_type& __v) {157 static __container_value_type&& __move(__node_value_type& __v) {
161 return _VSTD::move(__v);158 return _VSTD::move(__v);
162 }159 }
163#endif
164};160};
165161
166template <class _Key, class _Tp>162template <class _Key, class _Tp>
...@@ -197,13 +193,10 @@ struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > {...@@ -197,13 +193,10 @@ struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > {
197 static __container_value_type* __get_ptr(__node_value_type& __n) {193 static __container_value_type* __get_ptr(__node_value_type& __n) {
198 return _VSTD::addressof(__n.__get_value());194 return _VSTD::addressof(__n.__get_value());
199 }195 }
200#ifndef _LIBCPP_CXX03_LANG
201 _LIBCPP_INLINE_VISIBILITY196 _LIBCPP_INLINE_VISIBILITY
202 static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) {197 static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) {
203 return __v.__move();198 return __v.__move();
204 }199 }
205#endif
206
207};200};
208201
209template <class _Tp, class _AllocPtr, class _KVTypes = __hash_key_value_types<_Tp>,202template <class _Tp, class _AllocPtr, class _KVTypes = __hash_key_value_types<_Tp>,
...@@ -295,10 +288,12 @@ public:...@@ -295,10 +288,12 @@ public:
295 typedef typename _NodeTypes::__node_value_type_pointer pointer;288 typedef typename _NodeTypes::__node_value_type_pointer pointer;
296289
297 _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT : __node_(nullptr) {290 _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT : __node_(nullptr) {
298 _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));291#if _LIBCPP_DEBUG_LEVEL == 2
292 __get_db()->__insert_i(this);
293#endif
299 }294 }
300295
301#if _LIBCPP_DEBUG_LEVEL >= 2296#if _LIBCPP_DEBUG_LEVEL == 2
302 _LIBCPP_INLINE_VISIBILITY297 _LIBCPP_INLINE_VISIBILITY
303 __hash_iterator(const __hash_iterator& __i)298 __hash_iterator(const __hash_iterator& __i)
304 : __node_(__i.__node_)299 : __node_(__i.__node_)
...@@ -322,7 +317,7 @@ public:...@@ -322,7 +317,7 @@ public:
322 }317 }
323 return *this;318 return *this;
324 }319 }
325#endif // _LIBCPP_DEBUG_LEVEL >= 2320#endif // _LIBCPP_DEBUG_LEVEL == 2
326321
327 _LIBCPP_INLINE_VISIBILITY322 _LIBCPP_INLINE_VISIBILITY
328 reference operator*() const {323 reference operator*() const {
...@@ -364,7 +359,7 @@ public:...@@ -364,7 +359,7 @@ public:
364 {return !(__x == __y);}359 {return !(__x == __y);}
365360
366private:361private:
367#if _LIBCPP_DEBUG_LEVEL >= 2362#if _LIBCPP_DEBUG_LEVEL == 2
368 _LIBCPP_INLINE_VISIBILITY363 _LIBCPP_INLINE_VISIBILITY
369 __hash_iterator(__next_pointer __node, const void* __c) _NOEXCEPT364 __hash_iterator(__next_pointer __node, const void* __c) _NOEXCEPT
370 : __node_(__node)365 : __node_(__node)
...@@ -405,17 +400,21 @@ public:...@@ -405,17 +400,21 @@ public:
405400
406401
407 _LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT : __node_(nullptr) {402 _LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT : __node_(nullptr) {
408 _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));403#if _LIBCPP_DEBUG_LEVEL == 2
404 __get_db()->__insert_i(this);
405#endif
409 }406 }
410407
411 _LIBCPP_INLINE_VISIBILITY408 _LIBCPP_INLINE_VISIBILITY
412 __hash_const_iterator(const __non_const_iterator& __x) _NOEXCEPT409 __hash_const_iterator(const __non_const_iterator& __x) _NOEXCEPT
413 : __node_(__x.__node_)410 : __node_(__x.__node_)
414 {411 {
415 _LIBCPP_DEBUG_MODE(__get_db()->__iterator_copy(this, &__x));412#if _LIBCPP_DEBUG_LEVEL == 2
413 __get_db()->__iterator_copy(this, &__x);
414#endif
416 }415 }
417416
418#if _LIBCPP_DEBUG_LEVEL >= 2417#if _LIBCPP_DEBUG_LEVEL == 2
419 _LIBCPP_INLINE_VISIBILITY418 _LIBCPP_INLINE_VISIBILITY
420 __hash_const_iterator(const __hash_const_iterator& __i)419 __hash_const_iterator(const __hash_const_iterator& __i)
421 : __node_(__i.__node_)420 : __node_(__i.__node_)
...@@ -439,7 +438,7 @@ public:...@@ -439,7 +438,7 @@ public:
439 }438 }
440 return *this;439 return *this;
441 }440 }
442#endif // _LIBCPP_DEBUG_LEVEL >= 2441#endif // _LIBCPP_DEBUG_LEVEL == 2
443442
444 _LIBCPP_INLINE_VISIBILITY443 _LIBCPP_INLINE_VISIBILITY
445 reference operator*() const {444 reference operator*() const {
...@@ -480,7 +479,7 @@ public:...@@ -480,7 +479,7 @@ public:
480 {return !(__x == __y);}479 {return !(__x == __y);}
481480
482private:481private:
483#if _LIBCPP_DEBUG_LEVEL >= 2482#if _LIBCPP_DEBUG_LEVEL == 2
484 _LIBCPP_INLINE_VISIBILITY483 _LIBCPP_INLINE_VISIBILITY
485 __hash_const_iterator(__next_pointer __node, const void* __c) _NOEXCEPT484 __hash_const_iterator(__next_pointer __node, const void* __c) _NOEXCEPT
486 : __node_(__node)485 : __node_(__node)
...@@ -518,10 +517,12 @@ public:...@@ -518,10 +517,12 @@ public:
518 typedef typename _NodeTypes::__node_value_type_pointer pointer;517 typedef typename _NodeTypes::__node_value_type_pointer pointer;
519518
520 _LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT : __node_(nullptr) {519 _LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT : __node_(nullptr) {
521 _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));520#if _LIBCPP_DEBUG_LEVEL == 2
521 __get_db()->__insert_i(this);
522#endif
522 }523 }
523524
524#if _LIBCPP_DEBUG_LEVEL >= 2525#if _LIBCPP_DEBUG_LEVEL == 2
525 _LIBCPP_INLINE_VISIBILITY526 _LIBCPP_INLINE_VISIBILITY
526 __hash_local_iterator(const __hash_local_iterator& __i)527 __hash_local_iterator(const __hash_local_iterator& __i)
527 : __node_(__i.__node_),528 : __node_(__i.__node_),
...@@ -549,7 +550,7 @@ public:...@@ -549,7 +550,7 @@ public:
549 }550 }
550 return *this;551 return *this;
551 }552 }
552#endif // _LIBCPP_DEBUG_LEVEL >= 2553#endif // _LIBCPP_DEBUG_LEVEL == 2
553554
554 _LIBCPP_INLINE_VISIBILITY555 _LIBCPP_INLINE_VISIBILITY
555 reference operator*() const {556 reference operator*() const {
...@@ -593,7 +594,7 @@ public:...@@ -593,7 +594,7 @@ public:
593 {return !(__x == __y);}594 {return !(__x == __y);}
594595
595private:596private:
596#if _LIBCPP_DEBUG_LEVEL >= 2597#if _LIBCPP_DEBUG_LEVEL == 2
597 _LIBCPP_INLINE_VISIBILITY598 _LIBCPP_INLINE_VISIBILITY
598 __hash_local_iterator(__next_pointer __node, size_t __bucket,599 __hash_local_iterator(__next_pointer __node, size_t __bucket,
599 size_t __bucket_count, const void* __c) _NOEXCEPT600 size_t __bucket_count, const void* __c) _NOEXCEPT
...@@ -650,7 +651,9 @@ public:...@@ -650,7 +651,9 @@ public:
650651
651652
652 _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT : __node_(nullptr) {653 _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT : __node_(nullptr) {
653 _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));654#if _LIBCPP_DEBUG_LEVEL == 2
655 __get_db()->__insert_i(this);
656#endif
654 }657 }
655658
656 _LIBCPP_INLINE_VISIBILITY659 _LIBCPP_INLINE_VISIBILITY
...@@ -659,10 +662,12 @@ public:...@@ -659,10 +662,12 @@ public:
659 __bucket_(__x.__bucket_),662 __bucket_(__x.__bucket_),
660 __bucket_count_(__x.__bucket_count_)663 __bucket_count_(__x.__bucket_count_)
661 {664 {
662 _LIBCPP_DEBUG_MODE(__get_db()->__iterator_copy(this, &__x));665#if _LIBCPP_DEBUG_LEVEL == 2
666 __get_db()->__iterator_copy(this, &__x);
667#endif
663 }668 }
664669
665#if _LIBCPP_DEBUG_LEVEL >= 2670#if _LIBCPP_DEBUG_LEVEL == 2
666 _LIBCPP_INLINE_VISIBILITY671 _LIBCPP_INLINE_VISIBILITY
667 __hash_const_local_iterator(const __hash_const_local_iterator& __i)672 __hash_const_local_iterator(const __hash_const_local_iterator& __i)
668 : __node_(__i.__node_),673 : __node_(__i.__node_),
...@@ -690,7 +695,7 @@ public:...@@ -690,7 +695,7 @@ public:
690 }695 }
691 return *this;696 return *this;
692 }697 }
693#endif // _LIBCPP_DEBUG_LEVEL >= 2698#endif // _LIBCPP_DEBUG_LEVEL == 2
694699
695 _LIBCPP_INLINE_VISIBILITY700 _LIBCPP_INLINE_VISIBILITY
696 reference operator*() const {701 reference operator*() const {
...@@ -734,7 +739,7 @@ public:...@@ -734,7 +739,7 @@ public:
734 {return !(__x == __y);}739 {return !(__x == __y);}
735740
736private:741private:
737#if _LIBCPP_DEBUG_LEVEL >= 2742#if _LIBCPP_DEBUG_LEVEL == 2
738 _LIBCPP_INLINE_VISIBILITY743 _LIBCPP_INLINE_VISIBILITY
739 __hash_const_local_iterator(__next_pointer __node, size_t __bucket,744 __hash_const_local_iterator(__next_pointer __node, size_t __bucket,
740 size_t __bucket_count, const void* __c) _NOEXCEPT745 size_t __bucket_count, const void* __c) _NOEXCEPT
...@@ -783,7 +788,6 @@ public:...@@ -783,7 +788,6 @@ public:
783 _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)788 _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
784 : __data_(__size, __a) {}789 : __data_(__size, __a) {}
785790
786#ifndef _LIBCPP_CXX03_LANG
787 _LIBCPP_INLINE_VISIBILITY791 _LIBCPP_INLINE_VISIBILITY
788 __bucket_list_deallocator(__bucket_list_deallocator&& __x)792 __bucket_list_deallocator(__bucket_list_deallocator&& __x)
789 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)793 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
...@@ -791,7 +795,6 @@ public:...@@ -791,7 +795,6 @@ public:
791 {795 {
792 __x.size() = 0;796 __x.size() = 0;
793 }797 }
794#endif
795798
796 _LIBCPP_INLINE_VISIBILITY799 _LIBCPP_INLINE_VISIBILITY
797 size_type& size() _NOEXCEPT {return __data_.first();}800 size_type& size() _NOEXCEPT {return __data_.first();}
...@@ -1007,7 +1010,6 @@ public:...@@ -1007,7 +1010,6 @@ public:
1007 explicit __hash_table(const allocator_type& __a);1010 explicit __hash_table(const allocator_type& __a);
1008 __hash_table(const __hash_table& __u);1011 __hash_table(const __hash_table& __u);
1009 __hash_table(const __hash_table& __u, const allocator_type& __a);1012 __hash_table(const __hash_table& __u, const allocator_type& __a);
1010#ifndef _LIBCPP_CXX03_LANG
1011 __hash_table(__hash_table&& __u)1013 __hash_table(__hash_table&& __u)
1012 _NOEXCEPT_(1014 _NOEXCEPT_(
1013 is_nothrow_move_constructible<__bucket_list>::value &&1015 is_nothrow_move_constructible<__bucket_list>::value &&
...@@ -1016,11 +1018,9 @@ public:...@@ -1016,11 +1018,9 @@ public:
1016 is_nothrow_move_constructible<hasher>::value &&1018 is_nothrow_move_constructible<hasher>::value &&
1017 is_nothrow_move_constructible<key_equal>::value);1019 is_nothrow_move_constructible<key_equal>::value);
1018 __hash_table(__hash_table&& __u, const allocator_type& __a);1020 __hash_table(__hash_table&& __u, const allocator_type& __a);
1019#endif // _LIBCPP_CXX03_LANG
1020 ~__hash_table();1021 ~__hash_table();
10211022
1022 __hash_table& operator=(const __hash_table& __u);1023 __hash_table& operator=(const __hash_table& __u);
1023#ifndef _LIBCPP_CXX03_LANG
1024 _LIBCPP_INLINE_VISIBILITY1024 _LIBCPP_INLINE_VISIBILITY
1025 __hash_table& operator=(__hash_table&& __u)1025 __hash_table& operator=(__hash_table&& __u)
1026 _NOEXCEPT_(1026 _NOEXCEPT_(
...@@ -1028,7 +1028,6 @@ public:...@@ -1028,7 +1028,6 @@ public:
1028 is_nothrow_move_assignable<__node_allocator>::value &&1028 is_nothrow_move_assignable<__node_allocator>::value &&
1029 is_nothrow_move_assignable<hasher>::value &&1029 is_nothrow_move_assignable<hasher>::value &&
1030 is_nothrow_move_assignable<key_equal>::value);1030 is_nothrow_move_assignable<key_equal>::value);
1031#endif
1032 template <class _InputIterator>1031 template <class _InputIterator>
1033 void __assign_unique(_InputIterator __first, _InputIterator __last);1032 void __assign_unique(_InputIterator __first, _InputIterator __last);
1034 template <class _InputIterator>1033 template <class _InputIterator>
...@@ -1037,7 +1036,7 @@ public:...@@ -1037,7 +1036,7 @@ public:
1037 _LIBCPP_INLINE_VISIBILITY1036 _LIBCPP_INLINE_VISIBILITY
1038 size_type max_size() const _NOEXCEPT1037 size_type max_size() const _NOEXCEPT
1039 {1038 {
1040 return std::min<size_type>(1039 return _VSTD::min<size_type>(
1041 __node_traits::max_size(__node_alloc()),1040 __node_traits::max_size(__node_alloc()),
1042 numeric_limits<difference_type >::max()1041 numeric_limits<difference_type >::max()
1043 );1042 );
...@@ -1066,7 +1065,6 @@ public:...@@ -1066,7 +1065,6 @@ public:
1066 iterator __node_insert_multi(const_iterator __p,1065 iterator __node_insert_multi(const_iterator __p,
1067 __node_pointer __nd);1066 __node_pointer __nd);
10681067
1069#ifndef _LIBCPP_CXX03_LANG
1070 template <class _Key, class ..._Args>1068 template <class _Key, class ..._Args>
1071 _LIBCPP_INLINE_VISIBILITY1069 _LIBCPP_INLINE_VISIBILITY
1072 pair<iterator, bool> __emplace_unique_key_args(_Key const& __k, _Args&&... __args);1070 pair<iterator, bool> __emplace_unique_key_args(_Key const& __k, _Args&&... __args);
...@@ -1151,15 +1149,6 @@ public:...@@ -1151,15 +1149,6 @@ public:
1151 return __emplace_hint_multi(__p, _VSTD::forward<_Pp>(__x));1149 return __emplace_hint_multi(__p, _VSTD::forward<_Pp>(__x));
1152 }1150 }
11531151
1154#else // !defined(_LIBCPP_CXX03_LANG)
1155 template <class _Key, class _Args>
1156 _LIBCPP_INLINE_VISIBILITY
1157 pair<iterator, bool> __emplace_unique_key_args(_Key const&, _Args& __args);
1158
1159 iterator __insert_multi(const __container_value_type& __x);
1160 iterator __insert_multi(const_iterator __p, const __container_value_type& __x);
1161#endif
1162
1163 _LIBCPP_INLINE_VISIBILITY1152 _LIBCPP_INLINE_VISIBILITY
1164 pair<iterator, bool> __insert_unique(const __container_value_type& __x) {1153 pair<iterator, bool> __insert_unique(const __container_value_type& __x) {
1165 return __emplace_unique_key_args(_NodeTypes::__get_key(__x), __x);1154 return __emplace_unique_key_args(_NodeTypes::__get_key(__x), __x);
...@@ -1295,7 +1284,7 @@ public:...@@ -1295,7 +1284,7 @@ public:
1295 {1284 {
1296 _LIBCPP_ASSERT(__n < bucket_count(),1285 _LIBCPP_ASSERT(__n < bucket_count(),
1297 "unordered container::begin(n) called with n >= bucket_count()");1286 "unordered container::begin(n) called with n >= bucket_count()");
1298#if _LIBCPP_DEBUG_LEVEL >= 21287#if _LIBCPP_DEBUG_LEVEL == 2
1299 return local_iterator(__bucket_list_[__n], __n, bucket_count(), this);1288 return local_iterator(__bucket_list_[__n], __n, bucket_count(), this);
1300#else1289#else
1301 return local_iterator(__bucket_list_[__n], __n, bucket_count());1290 return local_iterator(__bucket_list_[__n], __n, bucket_count());
...@@ -1308,7 +1297,7 @@ public:...@@ -1308,7 +1297,7 @@ public:
1308 {1297 {
1309 _LIBCPP_ASSERT(__n < bucket_count(),1298 _LIBCPP_ASSERT(__n < bucket_count(),
1310 "unordered container::end(n) called with n >= bucket_count()");1299 "unordered container::end(n) called with n >= bucket_count()");
1311#if _LIBCPP_DEBUG_LEVEL >= 21300#if _LIBCPP_DEBUG_LEVEL == 2
1312 return local_iterator(nullptr, __n, bucket_count(), this);1301 return local_iterator(nullptr, __n, bucket_count(), this);
1313#else1302#else
1314 return local_iterator(nullptr, __n, bucket_count());1303 return local_iterator(nullptr, __n, bucket_count());
...@@ -1321,7 +1310,7 @@ public:...@@ -1321,7 +1310,7 @@ public:
1321 {1310 {
1322 _LIBCPP_ASSERT(__n < bucket_count(),1311 _LIBCPP_ASSERT(__n < bucket_count(),
1323 "unordered container::cbegin(n) called with n >= bucket_count()");1312 "unordered container::cbegin(n) called with n >= bucket_count()");
1324#if _LIBCPP_DEBUG_LEVEL >= 21313#if _LIBCPP_DEBUG_LEVEL == 2
1325 return const_local_iterator(__bucket_list_[__n], __n, bucket_count(), this);1314 return const_local_iterator(__bucket_list_[__n], __n, bucket_count(), this);
1326#else1315#else
1327 return const_local_iterator(__bucket_list_[__n], __n, bucket_count());1316 return const_local_iterator(__bucket_list_[__n], __n, bucket_count());
...@@ -1334,35 +1323,30 @@ public:...@@ -1334,35 +1323,30 @@ public:
1334 {1323 {
1335 _LIBCPP_ASSERT(__n < bucket_count(),1324 _LIBCPP_ASSERT(__n < bucket_count(),
1336 "unordered container::cend(n) called with n >= bucket_count()");1325 "unordered container::cend(n) called with n >= bucket_count()");
1337#if _LIBCPP_DEBUG_LEVEL >= 21326#if _LIBCPP_DEBUG_LEVEL == 2
1338 return const_local_iterator(nullptr, __n, bucket_count(), this);1327 return const_local_iterator(nullptr, __n, bucket_count(), this);
1339#else1328#else
1340 return const_local_iterator(nullptr, __n, bucket_count());1329 return const_local_iterator(nullptr, __n, bucket_count());
1341#endif1330#endif
1342 }1331 }
13431332
1344#if _LIBCPP_DEBUG_LEVEL >= 21333#if _LIBCPP_DEBUG_LEVEL == 2
13451334
1346 bool __dereferenceable(const const_iterator* __i) const;1335 bool __dereferenceable(const const_iterator* __i) const;
1347 bool __decrementable(const const_iterator* __i) const;1336 bool __decrementable(const const_iterator* __i) const;
1348 bool __addable(const const_iterator* __i, ptrdiff_t __n) const;1337 bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
1349 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;1338 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
13501339
1351#endif // _LIBCPP_DEBUG_LEVEL >= 21340#endif // _LIBCPP_DEBUG_LEVEL == 2
13521341
1353private:1342private:
1354 void __rehash(size_type __n);1343 void __rehash(size_type __n);
13551344
1356#ifndef _LIBCPP_CXX03_LANG
1357 template <class ..._Args>1345 template <class ..._Args>
1358 __node_holder __construct_node(_Args&& ...__args);1346 __node_holder __construct_node(_Args&& ...__args);
13591347
1360 template <class _First, class ..._Rest>1348 template <class _First, class ..._Rest>
1361 __node_holder __construct_node_hash(size_t __hash, _First&& __f, _Rest&&... __rest);1349 __node_holder __construct_node_hash(size_t __hash, _First&& __f, _Rest&&... __rest);
1362#else // _LIBCPP_CXX03_LANG
1363 __node_holder __construct_node(const __container_value_type& __v);
1364 __node_holder __construct_node_hash(size_t __hash, const __container_value_type& __v);
1365#endif
13661350
13671351
1368 _LIBCPP_INLINE_VISIBILITY1352 _LIBCPP_INLINE_VISIBILITY
...@@ -1373,7 +1357,6 @@ private:...@@ -1373,7 +1357,6 @@ private:
1373 _LIBCPP_INLINE_VISIBILITY1357 _LIBCPP_INLINE_VISIBILITY
1374 void __copy_assign_alloc(const __hash_table&, false_type) {}1358 void __copy_assign_alloc(const __hash_table&, false_type) {}
13751359
1376#ifndef _LIBCPP_CXX03_LANG
1377 void __move_assign(__hash_table& __u, false_type);1360 void __move_assign(__hash_table& __u, false_type);
1378 void __move_assign(__hash_table& __u, true_type)1361 void __move_assign(__hash_table& __u, true_type)
1379 _NOEXCEPT_(1362 _NOEXCEPT_(
...@@ -1400,7 +1383,6 @@ private:...@@ -1400,7 +1383,6 @@ private:
1400 }1383 }
1401 _LIBCPP_INLINE_VISIBILITY1384 _LIBCPP_INLINE_VISIBILITY
1402 void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}1385 void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}
1403#endif // _LIBCPP_CXX03_LANG
14041386
1405 void __deallocate_node(__next_pointer __np) _NOEXCEPT;1387 void __deallocate_node(__next_pointer __np) _NOEXCEPT;
1406 __next_pointer __detach() _NOEXCEPT;1388 __next_pointer __detach() _NOEXCEPT;
...@@ -1477,8 +1459,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const __hash_table& __u,...@@ -1477,8 +1459,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const __hash_table& __u,
1477{1459{
1478}1460}
14791461
1480#ifndef _LIBCPP_CXX03_LANG
1481
1482template <class _Tp, class _Hash, class _Equal, class _Alloc>1462template <class _Tp, class _Hash, class _Equal, class _Alloc>
1483__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)1463__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)
1484 _NOEXCEPT_(1464 _NOEXCEPT_(
...@@ -1526,8 +1506,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u,...@@ -1526,8 +1506,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u,
1526 }1506 }
1527}1507}
15281508
1529#endif // _LIBCPP_CXX03_LANG
1530
1531template <class _Tp, class _Hash, class _Equal, class _Alloc>1509template <class _Tp, class _Hash, class _Equal, class _Alloc>
1532__hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table()1510__hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table()
1533{1511{
...@@ -1539,7 +1517,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table()...@@ -1539,7 +1517,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table()
1539#endif1517#endif
15401518
1541 __deallocate_node(__p1_.first().__next_);1519 __deallocate_node(__p1_.first().__next_);
1542#if _LIBCPP_DEBUG_LEVEL >= 21520#if _LIBCPP_DEBUG_LEVEL == 2
1543 __get_db()->__erase_c(this);1521 __get_db()->__erase_c(this);
1544#endif1522#endif
1545}1523}
...@@ -1583,7 +1561,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate_node(__next_pointer __np)...@@ -1583,7 +1561,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate_node(__next_pointer __np)
1583 while (__np != nullptr)1561 while (__np != nullptr)
1584 {1562 {
1585 __next_pointer __next = __np->__next_;1563 __next_pointer __next = __np->__next_;
1586#if _LIBCPP_DEBUG_LEVEL >= 21564#if _LIBCPP_DEBUG_LEVEL == 2
1587 __c_node* __c = __get_db()->__find_c_and_lock(this);1565 __c_node* __c = __get_db()->__find_c_and_lock(this);
1588 for (__i_node** __p = __c->end_; __p != __c->beg_; )1566 for (__i_node** __p = __c->end_; __p != __c->beg_; )
1589 {1567 {
...@@ -1593,7 +1571,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate_node(__next_pointer __np)...@@ -1593,7 +1571,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate_node(__next_pointer __np)
1593 {1571 {
1594 (*__p)->__c_ = nullptr;1572 (*__p)->__c_ = nullptr;
1595 if (--__c->end_ != __p)1573 if (--__c->end_ != __p)
1596 memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));1574 _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
1597 }1575 }
1598 }1576 }
1599 __get_db()->unlock();1577 __get_db()->unlock();
...@@ -1618,8 +1596,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__detach() _NOEXCEPT...@@ -1618,8 +1596,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__detach() _NOEXCEPT
1618 return __cache;1596 return __cache;
1619}1597}
16201598
1621#ifndef _LIBCPP_CXX03_LANG
1622
1623template <class _Tp, class _Hash, class _Equal, class _Alloc>1599template <class _Tp, class _Hash, class _Equal, class _Alloc>
1624void1600void
1625__hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(1601__hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
...@@ -1646,7 +1622,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(...@@ -1646,7 +1622,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
1646 __u.__p1_.first().__next_ = nullptr;1622 __u.__p1_.first().__next_ = nullptr;
1647 __u.size() = 0;1623 __u.size() = 0;
1648 }1624 }
1649#if _LIBCPP_DEBUG_LEVEL >= 21625#if _LIBCPP_DEBUG_LEVEL == 2
1650 __get_db()->swap(this, &__u);1626 __get_db()->swap(this, &__u);
1651#endif1627#endif
1652}1628}
...@@ -1714,8 +1690,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(__hash_table&& __u)...@@ -1714,8 +1690,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(__hash_table&& __u)
1714 return *this;1690 return *this;
1715}1691}
17161692
1717#endif // _LIBCPP_CXX03_LANG
1718
1719template <class _Tp, class _Hash, class _Equal, class _Alloc>1693template <class _Tp, class _Hash, class _Equal, class _Alloc>
1720template <class _InputIterator>1694template <class _InputIterator>
1721void1695void
...@@ -1800,7 +1774,7 @@ inline...@@ -1800,7 +1774,7 @@ inline
1800typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator1774typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
1801__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() _NOEXCEPT1775__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() _NOEXCEPT
1802{1776{
1803#if _LIBCPP_DEBUG_LEVEL >= 21777#if _LIBCPP_DEBUG_LEVEL == 2
1804 return iterator(__p1_.first().__next_, this);1778 return iterator(__p1_.first().__next_, this);
1805#else1779#else
1806 return iterator(__p1_.first().__next_);1780 return iterator(__p1_.first().__next_);
...@@ -1812,7 +1786,7 @@ inline...@@ -1812,7 +1786,7 @@ inline
1812typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator1786typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
1813__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() _NOEXCEPT1787__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() _NOEXCEPT
1814{1788{
1815#if _LIBCPP_DEBUG_LEVEL >= 21789#if _LIBCPP_DEBUG_LEVEL == 2
1816 return iterator(nullptr, this);1790 return iterator(nullptr, this);
1817#else1791#else
1818 return iterator(nullptr);1792 return iterator(nullptr);
...@@ -1824,7 +1798,7 @@ inline...@@ -1824,7 +1798,7 @@ inline
1824typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator1798typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
1825__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() const _NOEXCEPT1799__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() const _NOEXCEPT
1826{1800{
1827#if _LIBCPP_DEBUG_LEVEL >= 21801#if _LIBCPP_DEBUG_LEVEL == 2
1828 return const_iterator(__p1_.first().__next_, this);1802 return const_iterator(__p1_.first().__next_, this);
1829#else1803#else
1830 return const_iterator(__p1_.first().__next_);1804 return const_iterator(__p1_.first().__next_);
...@@ -1836,7 +1810,7 @@ inline...@@ -1836,7 +1810,7 @@ inline
1836typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator1810typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
1837__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() const _NOEXCEPT1811__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() const _NOEXCEPT
1838{1812{
1839#if _LIBCPP_DEBUG_LEVEL >= 21813#if _LIBCPP_DEBUG_LEVEL == 2
1840 return const_iterator(nullptr, this);1814 return const_iterator(nullptr, this);
1841#else1815#else
1842 return const_iterator(nullptr);1816 return const_iterator(nullptr);
...@@ -1945,7 +1919,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __...@@ -1945,7 +1919,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
1945 __existing_node = __nd->__ptr();1919 __existing_node = __nd->__ptr();
1946 __inserted = true;1920 __inserted = true;
1947 }1921 }
1948#if _LIBCPP_DEBUG_LEVEL >= 21922#if _LIBCPP_DEBUG_LEVEL == 2
1949 return pair<iterator, bool>(iterator(__existing_node, this), __inserted);1923 return pair<iterator, bool>(iterator(__existing_node, this), __inserted);
1950#else1924#else
1951 return pair<iterator, bool>(iterator(__existing_node), __inserted);1925 return pair<iterator, bool>(iterator(__existing_node), __inserted);
...@@ -1955,7 +1929,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __...@@ -1955,7 +1929,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
1955// Prepare the container for an insertion of the value __cp_val with the hash1929// Prepare the container for an insertion of the value __cp_val with the hash
1956// __cp_hash. This does a lookup into the container to see if __cp_value is1930// __cp_hash. This does a lookup into the container to see if __cp_value is
1957// already present, and performs a rehash if necessary. Returns a pointer to the1931// already present, and performs a rehash if necessary. Returns a pointer to the
1958// last occurance of __cp_val in the map.1932// last occurrence of __cp_val in the map.
1959//1933//
1960// Note that this function does forward exceptions if key_eq() throws, and never1934// Note that this function does forward exceptions if key_eq() throws, and never
1961// mutates __value or actually inserts into the map.1935// mutates __value or actually inserts into the map.
...@@ -2043,7 +2017,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c...@@ -2043,7 +2017,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c
2043 __next_pointer __pn = __node_insert_multi_prepare(__cp->__hash(), __cp->__value_);2017 __next_pointer __pn = __node_insert_multi_prepare(__cp->__hash(), __cp->__value_);
2044 __node_insert_multi_perform(__cp, __pn);2018 __node_insert_multi_perform(__cp, __pn);
20452019
2046#if _LIBCPP_DEBUG_LEVEL >= 22020#if _LIBCPP_DEBUG_LEVEL == 2
2047 return iterator(__cp->__ptr(), this);2021 return iterator(__cp->__ptr(), this);
2048#else2022#else
2049 return iterator(__cp->__ptr());2023 return iterator(__cp->__ptr());
...@@ -2055,7 +2029,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator...@@ -2055,7 +2029,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
2055__hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(2029__hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
2056 const_iterator __p, __node_pointer __cp)2030 const_iterator __p, __node_pointer __cp)
2057{2031{
2058#if _LIBCPP_DEBUG_LEVEL >= 22032#if _LIBCPP_DEBUG_LEVEL == 2
2059 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,2033 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
2060 "unordered container::emplace_hint(const_iterator, args...) called with an iterator not"2034 "unordered container::emplace_hint(const_iterator, args...) called with an iterator not"
2061 " referring to this unordered container");2035 " referring to this unordered container");
...@@ -2078,7 +2052,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(...@@ -2078,7 +2052,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
2078 __cp->__next_ = __np;2052 __cp->__next_ = __np;
2079 __pp->__next_ = static_cast<__next_pointer>(__cp);2053 __pp->__next_ = static_cast<__next_pointer>(__cp);
2080 ++size();2054 ++size();
2081#if _LIBCPP_DEBUG_LEVEL >= 22055#if _LIBCPP_DEBUG_LEVEL == 2
2082 return iterator(static_cast<__next_pointer>(__cp), this);2056 return iterator(static_cast<__next_pointer>(__cp), this);
2083#else2057#else
2084 return iterator(static_cast<__next_pointer>(__cp));2058 return iterator(static_cast<__next_pointer>(__cp));
...@@ -2089,17 +2063,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(...@@ -2089,17 +2063,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
20892063
20902064
20912065
2092#ifndef _LIBCPP_CXX03_LANG
2093template <class _Tp, class _Hash, class _Equal, class _Alloc>2066template <class _Tp, class _Hash, class _Equal, class _Alloc>
2094template <class _Key, class ..._Args>2067template <class _Key, class ..._Args>
2095pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>2068pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
2096__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args)2069__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args)
2097#else
2098template <class _Tp, class _Hash, class _Equal, class _Alloc>
2099template <class _Key, class _Args>
2100pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
2101__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __k, _Args& __args)
2102#endif
2103{2070{
21042071
2105 size_t __hash = hash_function()(__k);2072 size_t __hash = hash_function()(__k);
...@@ -2123,11 +2090,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const&...@@ -2123,11 +2090,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const&
2123 }2090 }
2124 }2091 }
2125 {2092 {
2126#ifndef _LIBCPP_CXX03_LANG
2127 __node_holder __h = __construct_node_hash(__hash, _VSTD::forward<_Args>(__args)...);2093 __node_holder __h = __construct_node_hash(__hash, _VSTD::forward<_Args>(__args)...);
2128#else
2129 __node_holder __h = __construct_node_hash(__hash, __args);
2130#endif
2131 if (size()+1 > __bc * max_load_factor() || __bc == 0)2094 if (size()+1 > __bc * max_load_factor() || __bc == 0)
2132 {2095 {
2133 rehash(_VSTD::max<size_type>(2 * __bc + !__is_hash_power2(__bc),2096 rehash(_VSTD::max<size_type>(2 * __bc + !__is_hash_power2(__bc),
...@@ -2159,15 +2122,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const&...@@ -2159,15 +2122,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const&
2159 __inserted = true;2122 __inserted = true;
2160 }2123 }
2161__done:2124__done:
2162#if _LIBCPP_DEBUG_LEVEL >= 22125#if _LIBCPP_DEBUG_LEVEL == 2
2163 return pair<iterator, bool>(iterator(__nd, this), __inserted);2126 return pair<iterator, bool>(iterator(__nd, this), __inserted);
2164#else2127#else
2165 return pair<iterator, bool>(iterator(__nd), __inserted);2128 return pair<iterator, bool>(iterator(__nd), __inserted);
2166#endif2129#endif
2167}2130}
21682131
2169#ifndef _LIBCPP_CXX03_LANG
2170
2171template <class _Tp, class _Hash, class _Equal, class _Alloc>2132template <class _Tp, class _Hash, class _Equal, class _Alloc>
2172template <class... _Args>2133template <class... _Args>
2173pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>2134pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
...@@ -2197,7 +2158,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator...@@ -2197,7 +2158,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
2197__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(2158__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(
2198 const_iterator __p, _Args&&... __args)2159 const_iterator __p, _Args&&... __args)
2199{2160{
2200#if _LIBCPP_DEBUG_LEVEL >= 22161#if _LIBCPP_DEBUG_LEVEL == 2
2201 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,2162 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
2202 "unordered container::emplace_hint(const_iterator, args...) called with an iterator not"2163 "unordered container::emplace_hint(const_iterator, args...) called with an iterator not"
2203 " referring to this unordered container");2164 " referring to this unordered container");
...@@ -2208,36 +2169,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(...@@ -2208,36 +2169,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(
2208 return __r;2169 return __r;
2209}2170}
22102171
2211#else // _LIBCPP_CXX03_LANG
2212
2213template <class _Tp, class _Hash, class _Equal, class _Alloc>
2214typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
2215__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const __container_value_type& __x)
2216{
2217 __node_holder __h = __construct_node(__x);
2218 iterator __r = __node_insert_multi(__h.get());
2219 __h.release();
2220 return __r;
2221}
2222
2223template <class _Tp, class _Hash, class _Equal, class _Alloc>
2224typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
2225__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p,
2226 const __container_value_type& __x)
2227{
2228#if _LIBCPP_DEBUG_LEVEL >= 2
2229 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
2230 "unordered container::insert(const_iterator, lvalue) called with an iterator not"
2231 " referring to this unordered container");
2232#endif
2233 __node_holder __h = __construct_node(__x);
2234 iterator __r = __node_insert_multi(__p, __h.get());
2235 __h.release();
2236 return __r;
2237}
2238
2239#endif // _LIBCPP_CXX03_LANG
2240
2241#if _LIBCPP_STD_VER > 142172#if _LIBCPP_STD_VER > 14
2242template <class _Tp, class _Hash, class _Equal, class _Alloc>2173template <class _Tp, class _Hash, class _Equal, class _Alloc>
2243template <class _NodeHandle, class _InsertReturnType>2174template <class _NodeHandle, class _InsertReturnType>
...@@ -2399,9 +2330,9 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>...@@ -2399,9 +2330,9 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
2399void2330void
2400__hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __nbc)2331__hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __nbc)
2401{2332{
2402#if _LIBCPP_DEBUG_LEVEL >= 22333#if _LIBCPP_DEBUG_LEVEL == 2
2403 __get_db()->__invalidate_all(this);2334 __get_db()->__invalidate_all(this);
2404#endif // _LIBCPP_DEBUG_LEVEL >= 22335#endif
2405 __pointer_allocator& __npa = __bucket_list_.get_deleter().__alloc();2336 __pointer_allocator& __npa = __bucket_list_.get_deleter().__alloc();
2406 __bucket_list_.reset(__nbc > 0 ?2337 __bucket_list_.reset(__nbc > 0 ?
2407 __pointer_alloc_traits::allocate(__npa, __nbc) : nullptr);2338 __pointer_alloc_traits::allocate(__npa, __nbc) : nullptr);
...@@ -2470,7 +2401,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k)...@@ -2470,7 +2401,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k)
2470 {2401 {
2471 if ((__nd->__hash() == __hash)2402 if ((__nd->__hash() == __hash)
2472 && key_eq()(__nd->__upcast()->__value_, __k))2403 && key_eq()(__nd->__upcast()->__value_, __k))
2473#if _LIBCPP_DEBUG_LEVEL >= 22404#if _LIBCPP_DEBUG_LEVEL == 2
2474 return iterator(__nd, this);2405 return iterator(__nd, this);
2475#else2406#else
2476 return iterator(__nd);2407 return iterator(__nd);
...@@ -2501,7 +2432,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) const...@@ -2501,7 +2432,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) const
2501 {2432 {
2502 if ((__nd->__hash() == __hash)2433 if ((__nd->__hash() == __hash)
2503 && key_eq()(__nd->__upcast()->__value_, __k))2434 && key_eq()(__nd->__upcast()->__value_, __k))
2504#if _LIBCPP_DEBUG_LEVEL >= 22435#if _LIBCPP_DEBUG_LEVEL == 2
2505 return const_iterator(__nd, this);2436 return const_iterator(__nd, this);
2506#else2437#else
2507 return const_iterator(__nd);2438 return const_iterator(__nd);
...@@ -2513,8 +2444,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) const...@@ -2513,8 +2444,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) const
2513 return end();2444 return end();
2514}2445}
25152446
2516#ifndef _LIBCPP_CXX03_LANG
2517
2518template <class _Tp, class _Hash, class _Equal, class _Alloc>2447template <class _Tp, class _Hash, class _Equal, class _Alloc>
2519template <class ..._Args>2448template <class ..._Args>
2520typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder2449typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
...@@ -2550,43 +2479,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(...@@ -2550,43 +2479,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(
2550 return __h;2479 return __h;
2551}2480}
25522481
2553#else // _LIBCPP_CXX03_LANG
2554
2555template <class _Tp, class _Hash, class _Equal, class _Alloc>
2556typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
2557__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const __container_value_type& __v)
2558{
2559 __node_allocator& __na = __node_alloc();
2560 __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
2561 __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v);
2562 __h.get_deleter().__value_constructed = true;
2563 __h->__hash_ = hash_function()(__h->__value_);
2564 __h->__next_ = nullptr;
2565 return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
2566}
2567
2568template <class _Tp, class _Hash, class _Equal, class _Alloc>
2569typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
2570__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(size_t __hash,
2571 const __container_value_type& __v)
2572{
2573 __node_allocator& __na = __node_alloc();
2574 __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
2575 __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v);
2576 __h.get_deleter().__value_constructed = true;
2577 __h->__hash_ = __hash;
2578 __h->__next_ = nullptr;
2579 return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
2580}
2581
2582#endif // _LIBCPP_CXX03_LANG
2583
2584template <class _Tp, class _Hash, class _Equal, class _Alloc>2482template <class _Tp, class _Hash, class _Equal, class _Alloc>
2585typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator2483typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
2586__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p)2484__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p)
2587{2485{
2588 __next_pointer __np = __p.__node_;2486 __next_pointer __np = __p.__node_;
2589#if _LIBCPP_DEBUG_LEVEL >= 22487#if _LIBCPP_DEBUG_LEVEL == 2
2590 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,2488 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
2591 "unordered container erase(iterator) called with an iterator not"2489 "unordered container erase(iterator) called with an iterator not"
2592 " referring to this container");2490 " referring to this container");
...@@ -2606,7 +2504,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator...@@ -2606,7 +2504,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
2606__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __first,2504__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __first,
2607 const_iterator __last)2505 const_iterator __last)
2608{2506{
2609#if _LIBCPP_DEBUG_LEVEL >= 22507#if _LIBCPP_DEBUG_LEVEL == 2
2610 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,2508 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,
2611 "unodered container::erase(iterator, iterator) called with an iterator not"2509 "unodered container::erase(iterator, iterator) called with an iterator not"
2612 " referring to this unodered container");2510 " referring to this unodered container");
...@@ -2620,7 +2518,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __first,...@@ -2620,7 +2518,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __first,
2620 erase(__p);2518 erase(__p);
2621 }2519 }
2622 __next_pointer __np = __last.__node_;2520 __next_pointer __np = __last.__node_;
2623#if _LIBCPP_DEBUG_LEVEL >= 22521#if _LIBCPP_DEBUG_LEVEL == 2
2624 return iterator (__np, this);2522 return iterator (__np, this);
2625#else2523#else
2626 return iterator (__np);2524 return iterator (__np);
...@@ -2691,7 +2589,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT...@@ -2691,7 +2589,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
2691 __pn->__next_ = __cn->__next_;2589 __pn->__next_ = __cn->__next_;
2692 __cn->__next_ = nullptr;2590 __cn->__next_ = nullptr;
2693 --size();2591 --size();
2694#if _LIBCPP_DEBUG_LEVEL >= 22592#if _LIBCPP_DEBUG_LEVEL == 2
2695 __c_node* __c = __get_db()->__find_c_and_lock(this);2593 __c_node* __c = __get_db()->__find_c_and_lock(this);
2696 for (__i_node** __dp = __c->end_; __dp != __c->beg_; )2594 for (__i_node** __dp = __c->end_; __dp != __c->beg_; )
2697 {2595 {
...@@ -2701,7 +2599,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT...@@ -2701,7 +2599,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
2701 {2599 {
2702 (*__dp)->__c_ = nullptr;2600 (*__dp)->__c_ = nullptr;
2703 if (--__c->end_ != __dp)2601 if (--__c->end_ != __dp)
2704 memmove(__dp, __dp+1, (__c->end_ - __dp)*sizeof(__i_node*));2602 _VSTD::memmove(__dp, __dp+1, (__c->end_ - __dp)*sizeof(__i_node*));
2705 }2603 }
2706 }2604 }
2707 __get_db()->unlock();2605 __get_db()->unlock();
...@@ -2830,9 +2728,9 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)...@@ -2830,9 +2728,9 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
2830 __u.__bucket_list_.reset(__npp);2728 __u.__bucket_list_.reset(__npp);
2831 }2729 }
2832 _VSTD::swap(__bucket_list_.get_deleter().size(), __u.__bucket_list_.get_deleter().size());2730 _VSTD::swap(__bucket_list_.get_deleter().size(), __u.__bucket_list_.get_deleter().size());
2833 __swap_allocator(__bucket_list_.get_deleter().__alloc(),2731 _VSTD::__swap_allocator(__bucket_list_.get_deleter().__alloc(),
2834 __u.__bucket_list_.get_deleter().__alloc());2732 __u.__bucket_list_.get_deleter().__alloc());
2835 __swap_allocator(__node_alloc(), __u.__node_alloc());2733 _VSTD::__swap_allocator(__node_alloc(), __u.__node_alloc());
2836 _VSTD::swap(__p1_.first().__next_, __u.__p1_.first().__next_);2734 _VSTD::swap(__p1_.first().__next_, __u.__p1_.first().__next_);
2837 __p2_.swap(__u.__p2_);2735 __p2_.swap(__u.__p2_);
2838 __p3_.swap(__u.__p3_);2736 __p3_.swap(__u.__p3_);
...@@ -2842,7 +2740,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)...@@ -2842,7 +2740,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
2842 if (__u.size() > 0)2740 if (__u.size() > 0)
2843 __u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash(), __u.bucket_count())] =2741 __u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash(), __u.bucket_count())] =
2844 __u.__p1_.first().__ptr();2742 __u.__p1_.first().__ptr();
2845#if _LIBCPP_DEBUG_LEVEL >= 22743#if _LIBCPP_DEBUG_LEVEL == 2
2846 __get_db()->swap(this, &__u);2744 __get_db()->swap(this, &__u);
2847#endif2745#endif
2848}2746}
...@@ -2876,7 +2774,7 @@ swap(__hash_table<_Tp, _Hash, _Equal, _Alloc>& __x,...@@ -2876,7 +2774,7 @@ swap(__hash_table<_Tp, _Hash, _Equal, _Alloc>& __x,
2876 __x.swap(__y);2774 __x.swap(__y);
2877}2775}
28782776
2879#if _LIBCPP_DEBUG_LEVEL >= 22777#if _LIBCPP_DEBUG_LEVEL == 2
28802778
2881template <class _Tp, class _Hash, class _Equal, class _Alloc>2779template <class _Tp, class _Hash, class _Equal, class _Alloc>
2882bool2780bool
...@@ -2906,7 +2804,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__subscriptable(const const_iterator*,...@@ -2906,7 +2804,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__subscriptable(const const_iterator*,
2906 return false;2804 return false;
2907}2805}
29082806
2909#endif // _LIBCPP_DEBUG_LEVEL >= 22807#endif // _LIBCPP_DEBUG_LEVEL == 2
29102808
2911_LIBCPP_END_NAMESPACE_STD2809_LIBCPP_END_NAMESPACE_STD
29122810
lib/libcxx/include/__libcpp_version+1-1
...@@ -1 +1 @@...@@ -1 +1 @@
111000112000
lib/libcxx/include/__locale+244-44
...@@ -11,6 +11,7 @@...@@ -11,6 +11,7 @@
11#define _LIBCPP___LOCALE11#define _LIBCPP___LOCALE
1212
13#include <__config>13#include <__config>
14#include <__availability>
14#include <string>15#include <string>
15#include <memory>16#include <memory>
16#include <utility>17#include <utility>
...@@ -20,26 +21,30 @@...@@ -20,26 +21,30 @@
20#include <locale.h>21#include <locale.h>
21#if defined(_LIBCPP_MSVCRT_LIKE)22#if defined(_LIBCPP_MSVCRT_LIKE)
22# include <cstring>23# include <cstring>
23# include <support/win32/locale_win32.h>24# include <__support/win32/locale_win32.h>
24#elif defined(_AIX)25#elif defined(__NuttX__)
25# include <support/ibm/xlocale.h>26# include <__support/nuttx/xlocale.h>
27#elif defined(_AIX) || defined(__MVS__)
28# include <__support/ibm/xlocale.h>
26#elif defined(__ANDROID__)29#elif defined(__ANDROID__)
27# include <support/android/locale_bionic.h>30# include <__support/android/locale_bionic.h>
28#elif defined(__sun__)31#elif defined(__sun__)
29# include <xlocale.h>32# include <xlocale.h>
30# include <support/solaris/xlocale.h>33# include <__support/solaris/xlocale.h>
31#elif defined(_NEWLIB_VERSION)34#elif defined(_NEWLIB_VERSION)
32# include <support/newlib/xlocale.h>35# include <__support/newlib/xlocale.h>
36#elif defined(__OpenBSD__)
37# include <__support/openbsd/xlocale.h>
33#elif (defined(__APPLE__) || defined(__FreeBSD__) \38#elif (defined(__APPLE__) || defined(__FreeBSD__) \
34 || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))39 || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
35# include <xlocale.h>40# include <xlocale.h>
36#elif defined(__Fuchsia__)41#elif defined(__Fuchsia__)
37# include <support/fuchsia/xlocale.h>42# include <__support/fuchsia/xlocale.h>
38#elif defined(__wasi__)43#elif defined(__wasi__)
39// WASI libc uses musl's locales support.44// WASI libc uses musl's locales support.
40# include <support/musl/xlocale.h>45# include <__support/musl/xlocale.h>
41#elif defined(_LIBCPP_HAS_MUSL_LIBC)46#elif defined(_LIBCPP_HAS_MUSL_LIBC)
42# include <support/musl/xlocale.h>47# include <__support/musl/xlocale.h>
43#endif48#endif
4449
45#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)50#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -76,7 +81,7 @@ struct __libcpp_locale_guard {...@@ -76,7 +81,7 @@ struct __libcpp_locale_guard {
76 // locale name, otherwise it will be a semicolon-separated string listing81 // locale name, otherwise it will be a semicolon-separated string listing
77 // each category. In the second case, we know at least one category won't82 // each category. In the second case, we know at least one category won't
78 // be what we want, so we only have to check the first case.83 // be what we want, so we only have to check the first case.
79 if (strcmp(__l.__get_locale(), __lc) != 0) {84 if (_VSTD::strcmp(__l.__get_locale(), __lc) != 0) {
80 __locale_all = _strdup(__lc);85 __locale_all = _strdup(__lc);
81 if (__locale_all == nullptr)86 if (__locale_all == nullptr)
82 __throw_bad_alloc();87 __throw_bad_alloc();
...@@ -105,7 +110,6 @@ struct __libcpp_locale_guard {...@@ -105,7 +110,6 @@ struct __libcpp_locale_guard {
105};110};
106#endif111#endif
107112
108
109class _LIBCPP_TYPE_VIS locale;113class _LIBCPP_TYPE_VIS locale;
110114
111template <class _Facet>115template <class _Facet>
...@@ -335,8 +339,8 @@ collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const...@@ -335,8 +339,8 @@ collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const
335 return static_cast<long>(__h);339 return static_cast<long>(__h);
336}340}
337341
338_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<char>)342_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<char>)
339_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<wchar_t>)343_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<wchar_t>)
340344
341// template <class CharT> class collate_byname;345// template <class CharT> class collate_byname;
342346
...@@ -396,7 +400,26 @@ locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,...@@ -396,7 +400,26 @@ locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
396class _LIBCPP_TYPE_VIS ctype_base400class _LIBCPP_TYPE_VIS ctype_base
397{401{
398public:402public:
399#if defined(__GLIBC__)403#if defined(_LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE)
404 typedef unsigned long mask;
405 static const mask space = 1<<0;
406 static const mask print = 1<<1;
407 static const mask cntrl = 1<<2;
408 static const mask upper = 1<<3;
409 static const mask lower = 1<<4;
410 static const mask alpha = 1<<5;
411 static const mask digit = 1<<6;
412 static const mask punct = 1<<7;
413 static const mask xdigit = 1<<8;
414 static const mask blank = 1<<9;
415#if defined(__BIONIC__)
416 // Historically this was a part of regex_traits rather than ctype_base. The
417 // historical value of the constant is preserved for ABI compatibility.
418 static const mask __regex_word = 0x8000;
419#else
420 static const mask __regex_word = 1<<10;
421#endif // defined(__BIONIC__)
422#elif defined(__GLIBC__)
400 typedef unsigned short mask;423 typedef unsigned short mask;
401 static const mask space = _ISspace;424 static const mask space = _ISspace;
402 static const mask print = _ISprint;425 static const mask print = _ISprint;
...@@ -485,24 +508,7 @@ public:...@@ -485,24 +508,7 @@ public:
485# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA508# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA
486# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_XDIGIT509# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_XDIGIT
487#else510#else
488 typedef unsigned long mask;511# error unknown rune table for this platform -- do you mean to define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE?
489 static const mask space = 1<<0;
490 static const mask print = 1<<1;
491 static const mask cntrl = 1<<2;
492 static const mask upper = 1<<3;
493 static const mask lower = 1<<4;
494 static const mask alpha = 1<<5;
495 static const mask digit = 1<<6;
496 static const mask punct = 1<<7;
497 static const mask xdigit = 1<<8;
498 static const mask blank = 1<<9;
499#if defined(__BIONIC__)
500 // Historically this was a part of regex_traits rather than ctype_base. The
501 // historical value of the constant is preserved for ABI compatibility.
502 static const mask __regex_word = 0x8000;
503#else
504 static const mask __regex_word = 1<<10;
505#endif // defined(__BIONIC__)
506#endif512#endif
507 static const mask alnum = alpha | digit;513 static const mask alnum = alpha | digit;
508 static const mask graph = alnum | punct;514 static const mask graph = alnum | punct;
...@@ -623,7 +629,7 @@ class _LIBCPP_TYPE_VIS ctype<char>...@@ -623,7 +629,7 @@ class _LIBCPP_TYPE_VIS ctype<char>
623public:629public:
624 typedef char char_type;630 typedef char char_type;
625631
626 explicit ctype(const mask* __tab = 0, bool __del = false, size_t __refs = 0);632 explicit ctype(const mask* __tab = nullptr, bool __del = false, size_t __refs = 0);
627633
628 _LIBCPP_INLINE_VISIBILITY634 _LIBCPP_INLINE_VISIBILITY
629 bool is(mask __m, char_type __c) const635 bool is(mask __m, char_type __c) const
...@@ -1069,10 +1075,10 @@ protected:...@@ -1069,10 +1075,10 @@ protected:
1069 virtual int do_max_length() const _NOEXCEPT;1075 virtual int do_max_length() const _NOEXCEPT;
1070};1076};
10711077
1072// template <> class codecvt<char16_t, char, mbstate_t>1078// template <> class codecvt<char16_t, char, mbstate_t> // deprecated in C++20
10731079
1074template <>1080template <>
1075class _LIBCPP_TYPE_VIS codecvt<char16_t, char, mbstate_t>1081class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_TYPE_VIS codecvt<char16_t, char, mbstate_t>
1076 : public locale::facet,1082 : public locale::facet,
1077 public codecvt_base1083 public codecvt_base
1078{1084{
...@@ -1155,10 +1161,100 @@ protected:...@@ -1155,10 +1161,100 @@ protected:
1155 virtual int do_max_length() const _NOEXCEPT;1161 virtual int do_max_length() const _NOEXCEPT;
1156};1162};
11571163
1158// template <> class codecvt<char32_t, char, mbstate_t>1164#ifndef _LIBCPP_NO_HAS_CHAR8_T
1165
1166// template <> class codecvt<char16_t, char8_t, mbstate_t> // C++20
11591167
1160template <>1168template <>
1161class _LIBCPP_TYPE_VIS codecvt<char32_t, char, mbstate_t>1169class _LIBCPP_TYPE_VIS codecvt<char16_t, char8_t, mbstate_t>
1170 : public locale::facet,
1171 public codecvt_base
1172{
1173public:
1174 typedef char16_t intern_type;
1175 typedef char8_t extern_type;
1176 typedef mbstate_t state_type;
1177
1178 _LIBCPP_INLINE_VISIBILITY
1179 explicit codecvt(size_t __refs = 0)
1180 : locale::facet(__refs) {}
1181
1182 _LIBCPP_INLINE_VISIBILITY
1183 result out(state_type& __st,
1184 const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
1185 extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
1186 {
1187 return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
1188 }
1189
1190 _LIBCPP_INLINE_VISIBILITY
1191 result unshift(state_type& __st,
1192 extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
1193 {
1194 return do_unshift(__st, __to, __to_end, __to_nxt);
1195 }
1196
1197 _LIBCPP_INLINE_VISIBILITY
1198 result in(state_type& __st,
1199 const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
1200 intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const
1201 {
1202 return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
1203 }
1204
1205 _LIBCPP_INLINE_VISIBILITY
1206 int encoding() const _NOEXCEPT
1207 {
1208 return do_encoding();
1209 }
1210
1211 _LIBCPP_INLINE_VISIBILITY
1212 bool always_noconv() const _NOEXCEPT
1213 {
1214 return do_always_noconv();
1215 }
1216
1217 _LIBCPP_INLINE_VISIBILITY
1218 int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
1219 {
1220 return do_length(__st, __frm, __end, __mx);
1221 }
1222
1223 _LIBCPP_INLINE_VISIBILITY
1224 int max_length() const _NOEXCEPT
1225 {
1226 return do_max_length();
1227 }
1228
1229 static locale::id id;
1230
1231protected:
1232 _LIBCPP_INLINE_VISIBILITY
1233 explicit codecvt(const char*, size_t __refs = 0)
1234 : locale::facet(__refs) {}
1235
1236 ~codecvt();
1237
1238 virtual result do_out(state_type& __st,
1239 const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
1240 extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
1241 virtual result do_in(state_type& __st,
1242 const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
1243 intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
1244 virtual result do_unshift(state_type& __st,
1245 extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
1246 virtual int do_encoding() const _NOEXCEPT;
1247 virtual bool do_always_noconv() const _NOEXCEPT;
1248 virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
1249 virtual int do_max_length() const _NOEXCEPT;
1250};
1251
1252#endif
1253
1254// template <> class codecvt<char32_t, char, mbstate_t> // deprecated in C++20
1255
1256template <>
1257class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_TYPE_VIS codecvt<char32_t, char, mbstate_t>
1162 : public locale::facet,1258 : public locale::facet,
1163 public codecvt_base1259 public codecvt_base
1164{1260{
...@@ -1241,6 +1337,96 @@ protected:...@@ -1241,6 +1337,96 @@ protected:
1241 virtual int do_max_length() const _NOEXCEPT;1337 virtual int do_max_length() const _NOEXCEPT;
1242};1338};
12431339
1340#ifndef _LIBCPP_NO_HAS_CHAR8_T
1341
1342// template <> class codecvt<char32_t, char8_t, mbstate_t> // C++20
1343
1344template <>
1345class _LIBCPP_TYPE_VIS codecvt<char32_t, char8_t, mbstate_t>
1346 : public locale::facet,
1347 public codecvt_base
1348{
1349public:
1350 typedef char32_t intern_type;
1351 typedef char8_t extern_type;
1352 typedef mbstate_t state_type;
1353
1354 _LIBCPP_INLINE_VISIBILITY
1355 explicit codecvt(size_t __refs = 0)
1356 : locale::facet(__refs) {}
1357
1358 _LIBCPP_INLINE_VISIBILITY
1359 result out(state_type& __st,
1360 const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
1361 extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
1362 {
1363 return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
1364 }
1365
1366 _LIBCPP_INLINE_VISIBILITY
1367 result unshift(state_type& __st,
1368 extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
1369 {
1370 return do_unshift(__st, __to, __to_end, __to_nxt);
1371 }
1372
1373 _LIBCPP_INLINE_VISIBILITY
1374 result in(state_type& __st,
1375 const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
1376 intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const
1377 {
1378 return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
1379 }
1380
1381 _LIBCPP_INLINE_VISIBILITY
1382 int encoding() const _NOEXCEPT
1383 {
1384 return do_encoding();
1385 }
1386
1387 _LIBCPP_INLINE_VISIBILITY
1388 bool always_noconv() const _NOEXCEPT
1389 {
1390 return do_always_noconv();
1391 }
1392
1393 _LIBCPP_INLINE_VISIBILITY
1394 int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
1395 {
1396 return do_length(__st, __frm, __end, __mx);
1397 }
1398
1399 _LIBCPP_INLINE_VISIBILITY
1400 int max_length() const _NOEXCEPT
1401 {
1402 return do_max_length();
1403 }
1404
1405 static locale::id id;
1406
1407protected:
1408 _LIBCPP_INLINE_VISIBILITY
1409 explicit codecvt(const char*, size_t __refs = 0)
1410 : locale::facet(__refs) {}
1411
1412 ~codecvt();
1413
1414 virtual result do_out(state_type& __st,
1415 const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
1416 extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
1417 virtual result do_in(state_type& __st,
1418 const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
1419 intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
1420 virtual result do_unshift(state_type& __st,
1421 extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
1422 virtual int do_encoding() const _NOEXCEPT;
1423 virtual bool do_always_noconv() const _NOEXCEPT;
1424 virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
1425 virtual int do_max_length() const _NOEXCEPT;
1426};
1427
1428#endif
1429
1244// template <class _InternT, class _ExternT, class _StateT> class codecvt_byname1430// template <class _InternT, class _ExternT, class _StateT> class codecvt_byname
12451431
1246template <class _InternT, class _ExternT, class _StateT>1432template <class _InternT, class _ExternT, class _StateT>
...@@ -1258,15 +1444,21 @@ protected:...@@ -1258,15 +1444,21 @@ protected:
1258 ~codecvt_byname();1444 ~codecvt_byname();
1259};1445};
12601446
1447_LIBCPP_SUPPRESS_DEPRECATED_PUSH
1261template <class _InternT, class _ExternT, class _StateT>1448template <class _InternT, class _ExternT, class _StateT>
1262codecvt_byname<_InternT, _ExternT, _StateT>::~codecvt_byname()1449codecvt_byname<_InternT, _ExternT, _StateT>::~codecvt_byname()
1263{1450{
1264}1451}
12651452_LIBCPP_SUPPRESS_DEPRECATED_POP
1266_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char, char, mbstate_t>)1453
1267_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>)1454_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char, char, mbstate_t>)
1268_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>)1455_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>)
1269_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>)1456_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>) // deprecated in C++20
1457_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>) // deprecated in C++20
1458#ifndef _LIBCPP_NO_HAS_CHAR8_T
1459_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char8_t, mbstate_t>) // C++20
1460_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char8_t, mbstate_t>) // C++20
1461#endif
12701462
1271template <size_t _Np>1463template <size_t _Np>
1272struct __narrow_to_utf81464struct __narrow_to_utf8
...@@ -1290,12 +1482,14 @@ struct __narrow_to_utf8<8>...@@ -1290,12 +1482,14 @@ struct __narrow_to_utf8<8>
1290 }1482 }
1291};1483};
12921484
1485_LIBCPP_SUPPRESS_DEPRECATED_PUSH
1293template <>1486template <>
1294struct _LIBCPP_TEMPLATE_VIS __narrow_to_utf8<16>1487struct _LIBCPP_TEMPLATE_VIS __narrow_to_utf8<16>
1295 : public codecvt<char16_t, char, mbstate_t>1488 : public codecvt<char16_t, char, mbstate_t>
1296{1489{
1297 _LIBCPP_INLINE_VISIBILITY1490 _LIBCPP_INLINE_VISIBILITY
1298 __narrow_to_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}1491 __narrow_to_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}
1492_LIBCPP_SUPPRESS_DEPRECATED_POP
12991493
1300 _LIBCPP_EXPORTED_FROM_ABI ~__narrow_to_utf8();1494 _LIBCPP_EXPORTED_FROM_ABI ~__narrow_to_utf8();
13011495
...@@ -1324,12 +1518,14 @@ struct _LIBCPP_TEMPLATE_VIS __narrow_to_utf8<16>...@@ -1324,12 +1518,14 @@ struct _LIBCPP_TEMPLATE_VIS __narrow_to_utf8<16>
1324 }1518 }
1325};1519};
13261520
1521_LIBCPP_SUPPRESS_DEPRECATED_PUSH
1327template <>1522template <>
1328struct _LIBCPP_TEMPLATE_VIS __narrow_to_utf8<32>1523struct _LIBCPP_TEMPLATE_VIS __narrow_to_utf8<32>
1329 : public codecvt<char32_t, char, mbstate_t>1524 : public codecvt<char32_t, char, mbstate_t>
1330{1525{
1331 _LIBCPP_INLINE_VISIBILITY1526 _LIBCPP_INLINE_VISIBILITY
1332 __narrow_to_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}1527 __narrow_to_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}
1528_LIBCPP_SUPPRESS_DEPRECATED_POP
13331529
1334 _LIBCPP_EXPORTED_FROM_ABI ~__narrow_to_utf8();1530 _LIBCPP_EXPORTED_FROM_ABI ~__narrow_to_utf8();
13351531
...@@ -1380,12 +1576,14 @@ struct __widen_from_utf8<8>...@@ -1380,12 +1576,14 @@ struct __widen_from_utf8<8>
1380 }1576 }
1381};1577};
13821578
1579_LIBCPP_SUPPRESS_DEPRECATED_PUSH
1383template <>1580template <>
1384struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<16>1581struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<16>
1385 : public codecvt<char16_t, char, mbstate_t>1582 : public codecvt<char16_t, char, mbstate_t>
1386{1583{
1387 _LIBCPP_INLINE_VISIBILITY1584 _LIBCPP_INLINE_VISIBILITY
1388 __widen_from_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}1585 __widen_from_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}
1586_LIBCPP_SUPPRESS_DEPRECATED_POP
13891587
1390 _LIBCPP_EXPORTED_FROM_ABI ~__widen_from_utf8();1588 _LIBCPP_EXPORTED_FROM_ABI ~__widen_from_utf8();
13911589
...@@ -1407,19 +1605,21 @@ struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<16>...@@ -1407,19 +1605,21 @@ struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<16>
1407 if (__r == codecvt_base::error || __nn == __nb)1605 if (__r == codecvt_base::error || __nn == __nb)
1408 __throw_runtime_error("locale not supported");1606 __throw_runtime_error("locale not supported");
1409 for (const char16_t* __p = __buf; __p < __bn; ++__p, ++__s)1607 for (const char16_t* __p = __buf; __p < __bn; ++__p, ++__s)
1410 *__s = (wchar_t)*__p;1608 *__s = *__p;
1411 __nb = __nn;1609 __nb = __nn;
1412 }1610 }
1413 return __s;1611 return __s;
1414 }1612 }
1415};1613};
14161614
1615_LIBCPP_SUPPRESS_DEPRECATED_PUSH
1417template <>1616template <>
1418struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<32>1617struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<32>
1419 : public codecvt<char32_t, char, mbstate_t>1618 : public codecvt<char32_t, char, mbstate_t>
1420{1619{
1421 _LIBCPP_INLINE_VISIBILITY1620 _LIBCPP_INLINE_VISIBILITY
1422 __widen_from_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}1621 __widen_from_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}
1622_LIBCPP_SUPPRESS_DEPRECATED_POP
14231623
1424 _LIBCPP_EXPORTED_FROM_ABI ~__widen_from_utf8();1624 _LIBCPP_EXPORTED_FROM_ABI ~__widen_from_utf8();
14251625
...@@ -1441,7 +1641,7 @@ struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<32>...@@ -1441,7 +1641,7 @@ struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<32>
1441 if (__r == codecvt_base::error || __nn == __nb)1641 if (__r == codecvt_base::error || __nn == __nb)
1442 __throw_runtime_error("locale not supported");1642 __throw_runtime_error("locale not supported");
1443 for (const char32_t* __p = __buf; __p < __bn; ++__p, ++__s)1643 for (const char32_t* __p = __buf; __p < __bn; ++__p, ++__s)
1444 *__s = (wchar_t)*__p;1644 *__s = *__p;
1445 __nb = __nn;1645 __nb = __nn;
1446 }1646 }
1447 return __s;1647 return __s;
lib/libcxx/include/__memory/allocator_traits.h created+401
...@@ -0,0 +1,401 @@
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___MEMORY_ALLOCATOR_TRAITS_H
11#define _LIBCPP___MEMORY_ALLOCATOR_TRAITS_H
12
13#include <__config>
14#include <__memory/base.h>
15#include <__memory/pointer_traits.h>
16#include <type_traits>
17
18#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
19#pragma GCC system_header
20#endif
21
22_LIBCPP_PUSH_MACROS
23#include <__undef_macros>
24
25_LIBCPP_BEGIN_NAMESPACE_STD
26
27#define _LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(NAME, PROPERTY) \
28 template <class _Tp, class = void> struct NAME : false_type { }; \
29 template <class _Tp> struct NAME<_Tp, typename __void_t<typename _Tp:: PROPERTY >::type> : true_type { }
30
31// __pointer
32_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_pointer, pointer);
33template <class _Tp, class _Alloc,
34 class _RawAlloc = typename remove_reference<_Alloc>::type,
35 bool = __has_pointer<_RawAlloc>::value>
36struct __pointer {
37 using type _LIBCPP_NODEBUG_TYPE = typename _RawAlloc::pointer;
38};
39template <class _Tp, class _Alloc, class _RawAlloc>
40struct __pointer<_Tp, _Alloc, _RawAlloc, false> {
41 using type _LIBCPP_NODEBUG_TYPE = _Tp*;
42};
43
44// __const_pointer
45_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_const_pointer, const_pointer);
46template <class _Tp, class _Ptr, class _Alloc,
47 bool = __has_const_pointer<_Alloc>::value>
48struct __const_pointer {
49 using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::const_pointer;
50};
51template <class _Tp, class _Ptr, class _Alloc>
52struct __const_pointer<_Tp, _Ptr, _Alloc, false> {
53#ifdef _LIBCPP_CXX03_LANG
54 using type = typename pointer_traits<_Ptr>::template rebind<const _Tp>::other;
55#else
56 using type _LIBCPP_NODEBUG_TYPE = typename pointer_traits<_Ptr>::template rebind<const _Tp>;
57#endif
58};
59
60// __void_pointer
61_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_void_pointer, void_pointer);
62template <class _Ptr, class _Alloc,
63 bool = __has_void_pointer<_Alloc>::value>
64struct __void_pointer {
65 using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::void_pointer;
66};
67template <class _Ptr, class _Alloc>
68struct __void_pointer<_Ptr, _Alloc, false> {
69#ifdef _LIBCPP_CXX03_LANG
70 using type _LIBCPP_NODEBUG_TYPE = typename pointer_traits<_Ptr>::template rebind<void>::other;
71#else
72 using type _LIBCPP_NODEBUG_TYPE = typename pointer_traits<_Ptr>::template rebind<void>;
73#endif
74};
75
76// __const_void_pointer
77_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_const_void_pointer, const_void_pointer);
78template <class _Ptr, class _Alloc,
79 bool = __has_const_void_pointer<_Alloc>::value>
80struct __const_void_pointer {
81 using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::const_void_pointer;
82};
83template <class _Ptr, class _Alloc>
84struct __const_void_pointer<_Ptr, _Alloc, false> {
85#ifdef _LIBCPP_CXX03_LANG
86 using type _LIBCPP_NODEBUG_TYPE = typename pointer_traits<_Ptr>::template rebind<const void>::other;
87#else
88 using type _LIBCPP_NODEBUG_TYPE = typename pointer_traits<_Ptr>::template rebind<const void>;
89#endif
90};
91
92// __size_type
93_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_size_type, size_type);
94template <class _Alloc, class _DiffType, bool = __has_size_type<_Alloc>::value>
95struct __size_type : make_unsigned<_DiffType> { };
96template <class _Alloc, class _DiffType>
97struct __size_type<_Alloc, _DiffType, true> {
98 using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::size_type;
99};
100
101// __alloc_traits_difference_type
102_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_alloc_traits_difference_type, difference_type);
103template <class _Alloc, class _Ptr, bool = __has_alloc_traits_difference_type<_Alloc>::value>
104struct __alloc_traits_difference_type {
105 using type _LIBCPP_NODEBUG_TYPE = typename pointer_traits<_Ptr>::difference_type;
106};
107template <class _Alloc, class _Ptr>
108struct __alloc_traits_difference_type<_Alloc, _Ptr, true> {
109 using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::difference_type;
110};
111
112// __propagate_on_container_copy_assignment
113_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_copy_assignment, propagate_on_container_copy_assignment);
114template <class _Alloc, bool = __has_propagate_on_container_copy_assignment<_Alloc>::value>
115struct __propagate_on_container_copy_assignment : false_type { };
116template <class _Alloc>
117struct __propagate_on_container_copy_assignment<_Alloc, true> {
118 using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::propagate_on_container_copy_assignment;
119};
120
121// __propagate_on_container_move_assignment
122_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_move_assignment, propagate_on_container_move_assignment);
123template <class _Alloc, bool = __has_propagate_on_container_move_assignment<_Alloc>::value>
124struct __propagate_on_container_move_assignment : false_type { };
125template <class _Alloc>
126struct __propagate_on_container_move_assignment<_Alloc, true> {
127 using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::propagate_on_container_move_assignment;
128};
129
130// __propagate_on_container_swap
131_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_swap, propagate_on_container_swap);
132template <class _Alloc, bool = __has_propagate_on_container_swap<_Alloc>::value>
133struct __propagate_on_container_swap : false_type { };
134template <class _Alloc>
135struct __propagate_on_container_swap<_Alloc, true> {
136 using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::propagate_on_container_swap;
137};
138
139// __is_always_equal
140_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_is_always_equal, is_always_equal);
141template <class _Alloc, bool = __has_is_always_equal<_Alloc>::value>
142struct __is_always_equal : is_empty<_Alloc> { };
143template <class _Alloc>
144struct __is_always_equal<_Alloc, true> {
145 using type _LIBCPP_NODEBUG_TYPE = typename _Alloc::is_always_equal;
146};
147
148// __allocator_traits_rebind
149_LIBCPP_SUPPRESS_DEPRECATED_PUSH
150template <class _Tp, class _Up, class = void>
151struct __has_rebind_other : false_type { };
152template <class _Tp, class _Up>
153struct __has_rebind_other<_Tp, _Up, typename __void_t<
154 typename _Tp::template rebind<_Up>::other
155>::type> : true_type { };
156
157template <class _Tp, class _Up, bool = __has_rebind_other<_Tp, _Up>::value>
158struct __allocator_traits_rebind {
159 using type _LIBCPP_NODEBUG_TYPE = typename _Tp::template rebind<_Up>::other;
160};
161template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up>
162struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, true> {
163 using type _LIBCPP_NODEBUG_TYPE = typename _Alloc<_Tp, _Args...>::template rebind<_Up>::other;
164};
165template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up>
166struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, false> {
167 using type _LIBCPP_NODEBUG_TYPE = _Alloc<_Up, _Args...>;
168};
169_LIBCPP_SUPPRESS_DEPRECATED_POP
170
171template<class _Alloc, class _Tp>
172using __allocator_traits_rebind_t = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
173
174_LIBCPP_SUPPRESS_DEPRECATED_PUSH
175
176// __has_allocate_hint
177template <class _Alloc, class _SizeType, class _ConstVoidPtr, class = void>
178struct __has_allocate_hint : false_type { };
179
180template <class _Alloc, class _SizeType, class _ConstVoidPtr>
181struct __has_allocate_hint<_Alloc, _SizeType, _ConstVoidPtr, decltype(
182 (void)declval<_Alloc>().allocate(declval<_SizeType>(), declval<_ConstVoidPtr>())
183)> : true_type { };
184
185// __has_construct
186template <class, class _Alloc, class ..._Args>
187struct __has_construct_impl : false_type { };
188
189template <class _Alloc, class ..._Args>
190struct __has_construct_impl<decltype(
191 (void)declval<_Alloc>().construct(declval<_Args>()...)
192), _Alloc, _Args...> : true_type { };
193
194template <class _Alloc, class ..._Args>
195struct __has_construct : __has_construct_impl<void, _Alloc, _Args...> { };
196
197// __has_destroy
198template <class _Alloc, class _Pointer, class = void>
199struct __has_destroy : false_type { };
200
201template <class _Alloc, class _Pointer>
202struct __has_destroy<_Alloc, _Pointer, decltype(
203 (void)declval<_Alloc>().destroy(declval<_Pointer>())
204)> : true_type { };
205
206// __has_max_size
207template <class _Alloc, class = void>
208struct __has_max_size : false_type { };
209
210template <class _Alloc>
211struct __has_max_size<_Alloc, decltype(
212 (void)declval<_Alloc&>().max_size()
213)> : true_type { };
214
215// __has_select_on_container_copy_construction
216template <class _Alloc, class = void>
217struct __has_select_on_container_copy_construction : false_type { };
218
219template <class _Alloc>
220struct __has_select_on_container_copy_construction<_Alloc, decltype(
221 (void)declval<_Alloc>().select_on_container_copy_construction()
222)> : true_type { };
223
224_LIBCPP_SUPPRESS_DEPRECATED_POP
225
226template <class _Alloc>
227struct _LIBCPP_TEMPLATE_VIS allocator_traits
228{
229 using allocator_type = _Alloc;
230 using value_type = typename allocator_type::value_type;
231 using pointer = typename __pointer<value_type, allocator_type>::type;
232 using const_pointer = typename __const_pointer<value_type, pointer, allocator_type>::type;
233 using void_pointer = typename __void_pointer<pointer, allocator_type>::type;
234 using const_void_pointer = typename __const_void_pointer<pointer, allocator_type>::type;
235 using difference_type = typename __alloc_traits_difference_type<allocator_type, pointer>::type;
236 using size_type = typename __size_type<allocator_type, difference_type>::type;
237 using propagate_on_container_copy_assignment = typename __propagate_on_container_copy_assignment<allocator_type>::type;
238 using propagate_on_container_move_assignment = typename __propagate_on_container_move_assignment<allocator_type>::type;
239 using propagate_on_container_swap = typename __propagate_on_container_swap<allocator_type>::type;
240 using is_always_equal = typename __is_always_equal<allocator_type>::type;
241
242#ifndef _LIBCPP_CXX03_LANG
243 template <class _Tp>
244 using rebind_alloc = __allocator_traits_rebind_t<allocator_type, _Tp>;
245 template <class _Tp>
246 using rebind_traits = allocator_traits<rebind_alloc<_Tp> >;
247#else // _LIBCPP_CXX03_LANG
248 template <class _Tp>
249 struct rebind_alloc {
250 using other = __allocator_traits_rebind_t<allocator_type, _Tp>;
251 };
252 template <class _Tp>
253 struct rebind_traits {
254 using other = allocator_traits<typename rebind_alloc<_Tp>::other>;
255 };
256#endif // _LIBCPP_CXX03_LANG
257
258 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
259 static pointer allocate(allocator_type& __a, size_type __n) {
260 return __a.allocate(__n);
261 }
262
263 template <class _Ap = _Alloc, class =
264 _EnableIf<__has_allocate_hint<_Ap, size_type, const_void_pointer>::value> >
265 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
266 static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint) {
267 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
268 return __a.allocate(__n, __hint);
269 _LIBCPP_SUPPRESS_DEPRECATED_POP
270 }
271 template <class _Ap = _Alloc, class = void, class =
272 _EnableIf<!__has_allocate_hint<_Ap, size_type, const_void_pointer>::value> >
273 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
274 static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer) {
275 return __a.allocate(__n);
276 }
277
278 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
279 static void deallocate(allocator_type& __a, pointer __p, size_type __n) _NOEXCEPT {
280 __a.deallocate(__p, __n);
281 }
282
283 template <class _Tp, class... _Args, class =
284 _EnableIf<__has_construct<allocator_type, _Tp*, _Args...>::value> >
285 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
286 static void construct(allocator_type& __a, _Tp* __p, _Args&&... __args) {
287 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
288 __a.construct(__p, _VSTD::forward<_Args>(__args)...);
289 _LIBCPP_SUPPRESS_DEPRECATED_POP
290 }
291 template <class _Tp, class... _Args, class = void, class =
292 _EnableIf<!__has_construct<allocator_type, _Tp*, _Args...>::value> >
293 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
294 static void construct(allocator_type&, _Tp* __p, _Args&&... __args) {
295#if _LIBCPP_STD_VER > 17
296 _VSTD::construct_at(__p, _VSTD::forward<_Args>(__args)...);
297#else
298 ::new ((void*)__p) _Tp(_VSTD::forward<_Args>(__args)...);
299#endif
300 }
301
302 template <class _Tp, class =
303 _EnableIf<__has_destroy<allocator_type, _Tp*>::value> >
304 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
305 static void destroy(allocator_type& __a, _Tp* __p) {
306 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
307 __a.destroy(__p);
308 _LIBCPP_SUPPRESS_DEPRECATED_POP
309 }
310 template <class _Tp, class = void, class =
311 _EnableIf<!__has_destroy<allocator_type, _Tp*>::value> >
312 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
313 static void destroy(allocator_type&, _Tp* __p) {
314#if _LIBCPP_STD_VER > 17
315 _VSTD::destroy_at(__p);
316#else
317 __p->~_Tp();
318#endif
319 }
320
321 template <class _Ap = _Alloc, class =
322 _EnableIf<__has_max_size<const _Ap>::value> >
323 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
324 static size_type max_size(const allocator_type& __a) _NOEXCEPT {
325 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
326 return __a.max_size();
327 _LIBCPP_SUPPRESS_DEPRECATED_POP
328 }
329 template <class _Ap = _Alloc, class = void, class =
330 _EnableIf<!__has_max_size<const _Ap>::value> >
331 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
332 static size_type max_size(const allocator_type&) _NOEXCEPT {
333 return numeric_limits<size_type>::max() / sizeof(value_type);
334 }
335
336 template <class _Ap = _Alloc, class =
337 _EnableIf<__has_select_on_container_copy_construction<const _Ap>::value> >
338 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
339 static allocator_type select_on_container_copy_construction(const allocator_type& __a) {
340 return __a.select_on_container_copy_construction();
341 }
342 template <class _Ap = _Alloc, class = void, class =
343 _EnableIf<!__has_select_on_container_copy_construction<const _Ap>::value> >
344 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
345 static allocator_type select_on_container_copy_construction(const allocator_type& __a) {
346 return __a;
347 }
348};
349
350template <class _Traits, class _Tp>
351struct __rebind_alloc_helper {
352#ifndef _LIBCPP_CXX03_LANG
353 using type _LIBCPP_NODEBUG_TYPE = typename _Traits::template rebind_alloc<_Tp>;
354#else
355 using type = typename _Traits::template rebind_alloc<_Tp>::other;
356#endif
357};
358
359// __is_default_allocator
360template <class _Tp>
361struct __is_default_allocator : false_type { };
362
363template <class _Tp>
364struct __is_default_allocator<_VSTD::allocator<_Tp> > : true_type { };
365
366// __is_cpp17_move_insertable
367template <class _Alloc, class = void>
368struct __is_cpp17_move_insertable
369 : is_move_constructible<typename _Alloc::value_type>
370{ };
371
372template <class _Alloc>
373struct __is_cpp17_move_insertable<_Alloc, _EnableIf<
374 !__is_default_allocator<_Alloc>::value &&
375 __has_construct<_Alloc, typename _Alloc::value_type*, typename _Alloc::value_type&&>::value
376> > : true_type { };
377
378// __is_cpp17_copy_insertable
379template <class _Alloc, class = void>
380struct __is_cpp17_copy_insertable
381 : integral_constant<bool,
382 is_copy_constructible<typename _Alloc::value_type>::value &&
383 __is_cpp17_move_insertable<_Alloc>::value
384 >
385{ };
386
387template <class _Alloc>
388struct __is_cpp17_copy_insertable<_Alloc, _EnableIf<
389 !__is_default_allocator<_Alloc>::value &&
390 __has_construct<_Alloc, typename _Alloc::value_type*, const typename _Alloc::value_type&>::value
391> >
392 : __is_cpp17_move_insertable<_Alloc>
393{ };
394
395#undef _LIBCPP_ALLOCATOR_TRAITS_HAS_XXX
396
397_LIBCPP_END_NAMESPACE_STD
398
399_LIBCPP_POP_MACROS
400
401#endif // _LIBCPP___MEMORY_ALLOCATOR_TRAITS_H
lib/libcxx/include/__memory/base.h created+127
...@@ -0,0 +1,127 @@
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___MEMORY_BASE_H
11#define _LIBCPP___MEMORY_BASE_H
12
13#include <__config>
14#include <__debug>
15#include <type_traits>
16
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18#pragma GCC system_header
19#endif
20
21_LIBCPP_PUSH_MACROS
22#include <__undef_macros>
23
24_LIBCPP_BEGIN_NAMESPACE_STD
25
26// addressof
27#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
28
29template <class _Tp>
30inline _LIBCPP_CONSTEXPR_AFTER_CXX14
31_LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
32_Tp*
33addressof(_Tp& __x) _NOEXCEPT
34{
35 return __builtin_addressof(__x);
36}
37
38#else
39
40template <class _Tp>
41inline _LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
42_Tp*
43addressof(_Tp& __x) _NOEXCEPT
44{
45 return reinterpret_cast<_Tp *>(
46 const_cast<char *>(&reinterpret_cast<const volatile char &>(__x)));
47}
48
49#endif // _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
50
51#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
52// Objective-C++ Automatic Reference Counting uses qualified pointers
53// that require special addressof() signatures. When
54// _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler
55// itself is providing these definitions. Otherwise, we provide them.
56template <class _Tp>
57inline _LIBCPP_INLINE_VISIBILITY
58__strong _Tp*
59addressof(__strong _Tp& __x) _NOEXCEPT
60{
61 return &__x;
62}
63
64#ifdef _LIBCPP_HAS_OBJC_ARC_WEAK
65template <class _Tp>
66inline _LIBCPP_INLINE_VISIBILITY
67__weak _Tp*
68addressof(__weak _Tp& __x) _NOEXCEPT
69{
70 return &__x;
71}
72#endif
73
74template <class _Tp>
75inline _LIBCPP_INLINE_VISIBILITY
76__autoreleasing _Tp*
77addressof(__autoreleasing _Tp& __x) _NOEXCEPT
78{
79 return &__x;
80}
81
82template <class _Tp>
83inline _LIBCPP_INLINE_VISIBILITY
84__unsafe_unretained _Tp*
85addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
86{
87 return &__x;
88}
89#endif
90
91#if !defined(_LIBCPP_CXX03_LANG)
92template <class _Tp> _Tp* addressof(const _Tp&&) noexcept = delete;
93#endif
94
95// construct_at
96
97#if _LIBCPP_STD_VER > 17
98
99template<class _Tp, class ..._Args, class = decltype(
100 ::new (_VSTD::declval<void*>()) _Tp(_VSTD::declval<_Args>()...)
101)>
102_LIBCPP_INLINE_VISIBILITY
103constexpr _Tp* construct_at(_Tp* __location, _Args&& ...__args) {
104 _LIBCPP_ASSERT(__location, "null pointer given to construct_at");
105 return ::new ((void*)__location) _Tp(_VSTD::forward<_Args>(__args)...);
106}
107
108#endif
109
110// destroy_at
111
112#if _LIBCPP_STD_VER > 14
113
114template <class _Tp>
115inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
116void destroy_at(_Tp* __loc) {
117 _LIBCPP_ASSERT(__loc, "null pointer given to destroy_at");
118 __loc->~_Tp();
119}
120
121#endif
122
123_LIBCPP_END_NAMESPACE_STD
124
125_LIBCPP_POP_MACROS
126
127#endif // _LIBCPP___MEMORY_BASE_H
lib/libcxx/include/__memory/pointer_traits.h created+169
...@@ -0,0 +1,169 @@
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___MEMORY_POINTER_TRAITS_H
11#define _LIBCPP___MEMORY_POINTER_TRAITS_H
12
13#include <__config>
14#include <type_traits>
15
16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17#pragma GCC system_header
18#endif
19
20_LIBCPP_PUSH_MACROS
21#include <__undef_macros>
22
23_LIBCPP_BEGIN_NAMESPACE_STD
24
25template <class _Tp, class = void>
26struct __has_element_type : false_type {};
27
28template <class _Tp>
29struct __has_element_type<_Tp,
30 typename __void_t<typename _Tp::element_type>::type> : true_type {};
31
32template <class _Ptr, bool = __has_element_type<_Ptr>::value>
33struct __pointer_traits_element_type;
34
35template <class _Ptr>
36struct __pointer_traits_element_type<_Ptr, true>
37{
38 typedef _LIBCPP_NODEBUG_TYPE typename _Ptr::element_type type;
39};
40
41template <template <class, class...> class _Sp, class _Tp, class ..._Args>
42struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, true>
43{
44 typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::element_type type;
45};
46
47template <template <class, class...> class _Sp, class _Tp, class ..._Args>
48struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, false>
49{
50 typedef _LIBCPP_NODEBUG_TYPE _Tp type;
51};
52
53template <class _Tp, class = void>
54struct __has_difference_type : false_type {};
55
56template <class _Tp>
57struct __has_difference_type<_Tp,
58 typename __void_t<typename _Tp::difference_type>::type> : true_type {};
59
60template <class _Ptr, bool = __has_difference_type<_Ptr>::value>
61struct __pointer_traits_difference_type
62{
63 typedef _LIBCPP_NODEBUG_TYPE ptrdiff_t type;
64};
65
66template <class _Ptr>
67struct __pointer_traits_difference_type<_Ptr, true>
68{
69 typedef _LIBCPP_NODEBUG_TYPE typename _Ptr::difference_type type;
70};
71
72template <class _Tp, class _Up>
73struct __has_rebind
74{
75private:
76 struct __two {char __lx; char __lxx;};
77 template <class _Xp> static __two __test(...);
78 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
79 template <class _Xp> static char __test(typename _Xp::template rebind<_Up>* = 0);
80 _LIBCPP_SUPPRESS_DEPRECATED_POP
81public:
82 static const bool value = sizeof(__test<_Tp>(0)) == 1;
83};
84
85template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
86struct __pointer_traits_rebind
87{
88#ifndef _LIBCPP_CXX03_LANG
89 typedef _LIBCPP_NODEBUG_TYPE typename _Tp::template rebind<_Up> type;
90#else
91 typedef _LIBCPP_NODEBUG_TYPE typename _Tp::template rebind<_Up>::other type;
92#endif
93};
94
95template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up>
96struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, true>
97{
98#ifndef _LIBCPP_CXX03_LANG
99 typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::template rebind<_Up> type;
100#else
101 typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type;
102#endif
103};
104
105template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up>
106struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, false>
107{
108 typedef _Sp<_Up, _Args...> type;
109};
110
111template <class _Ptr>
112struct _LIBCPP_TEMPLATE_VIS pointer_traits
113{
114 typedef _Ptr pointer;
115 typedef typename __pointer_traits_element_type<pointer>::type element_type;
116 typedef typename __pointer_traits_difference_type<pointer>::type difference_type;
117
118#ifndef _LIBCPP_CXX03_LANG
119 template <class _Up> using rebind = typename __pointer_traits_rebind<pointer, _Up>::type;
120#else
121 template <class _Up> struct rebind
122 {typedef typename __pointer_traits_rebind<pointer, _Up>::type other;};
123#endif // _LIBCPP_CXX03_LANG
124
125private:
126 struct __nat {};
127public:
128 _LIBCPP_INLINE_VISIBILITY
129 static pointer pointer_to(typename conditional<is_void<element_type>::value,
130 __nat, element_type>::type& __r)
131 {return pointer::pointer_to(__r);}
132};
133
134template <class _Tp>
135struct _LIBCPP_TEMPLATE_VIS pointer_traits<_Tp*>
136{
137 typedef _Tp* pointer;
138 typedef _Tp element_type;
139 typedef ptrdiff_t difference_type;
140
141#ifndef _LIBCPP_CXX03_LANG
142 template <class _Up> using rebind = _Up*;
143#else
144 template <class _Up> struct rebind {typedef _Up* other;};
145#endif
146
147private:
148 struct __nat {};
149public:
150 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
151 static pointer pointer_to(typename conditional<is_void<element_type>::value,
152 __nat, element_type>::type& __r) _NOEXCEPT
153 {return _VSTD::addressof(__r);}
154};
155
156template <class _From, class _To>
157struct __rebind_pointer {
158#ifndef _LIBCPP_CXX03_LANG
159 typedef typename pointer_traits<_From>::template rebind<_To> type;
160#else
161 typedef typename pointer_traits<_From>::template rebind<_To>::other type;
162#endif
163};
164
165_LIBCPP_END_NAMESPACE_STD
166
167_LIBCPP_POP_MACROS
168
169#endif // _LIBCPP___MEMORY_POINTER_TRAITS_H
lib/libcxx/include/__memory/utilities.h created+88
...@@ -0,0 +1,88 @@
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___MEMORY_UTILITIES_H
11#define _LIBCPP___MEMORY_UTILITIES_H
12
13#include <__config>
14#include <__memory/allocator_traits.h>
15#include <cstddef>
16
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18#pragma GCC system_header
19#endif
20
21_LIBCPP_PUSH_MACROS
22#include <__undef_macros>
23
24
25_LIBCPP_BEGIN_NAMESPACE_STD
26
27// Helper class to allocate memory using an Allocator in an exception safe
28// manner.
29//
30// The intended usage of this class is as follows:
31//
32// 0
33// 1 __allocation_guard<SomeAllocator> guard(alloc, 10);
34// 2 do_some_initialization_that_may_throw(guard.__get());
35// 3 save_allocated_pointer_in_a_noexcept_operation(guard.__release_ptr());
36// 4
37//
38// If line (2) throws an exception during initialization of the memory, the
39// guard's destructor will be called, and the memory will be released using
40// Allocator deallocation. Otherwise, we release the memory from the guard on
41// line (3) in an operation that can't throw -- after that, the guard is not
42// responsible for the memory anymore.
43//
44// This is similar to a unique_ptr, except it's easier to use with a
45// custom allocator.
46template<class _Alloc>
47struct __allocation_guard {
48 using _Pointer = typename allocator_traits<_Alloc>::pointer;
49 using _Size = typename allocator_traits<_Alloc>::size_type;
50
51 template<class _AllocT> // we perform the allocator conversion inside the constructor
52 _LIBCPP_HIDE_FROM_ABI
53 explicit __allocation_guard(_AllocT __alloc, _Size __n)
54 : __alloc_(_VSTD::move(__alloc))
55 , __n_(__n)
56 , __ptr_(allocator_traits<_Alloc>::allocate(__alloc_, __n_)) // initialization order is important
57 { }
58
59 _LIBCPP_HIDE_FROM_ABI
60 ~__allocation_guard() _NOEXCEPT {
61 if (__ptr_ != nullptr) {
62 allocator_traits<_Alloc>::deallocate(__alloc_, __ptr_, __n_);
63 }
64 }
65
66 _LIBCPP_HIDE_FROM_ABI
67 _Pointer __release_ptr() _NOEXCEPT { // not called __release() because it's a keyword in objective-c++
68 _Pointer __tmp = __ptr_;
69 __ptr_ = nullptr;
70 return __tmp;
71 }
72
73 _LIBCPP_HIDE_FROM_ABI
74 _Pointer __get() const _NOEXCEPT {
75 return __ptr_;
76 }
77
78private:
79 _Alloc __alloc_;
80 _Size __n_;
81 _Pointer __ptr_;
82};
83
84_LIBCPP_END_NAMESPACE_STD
85
86_LIBCPP_POP_MACROS
87
88#endif // _LIBCPP___MEMORY_UTILITIES_H
lib/libcxx/include/__mutex_base+6-9
...@@ -146,7 +146,6 @@ private:...@@ -146,7 +146,6 @@ private:
146 unique_lock& operator=(unique_lock const&); // = delete;146 unique_lock& operator=(unique_lock const&); // = delete;
147147
148public:148public:
149#ifndef _LIBCPP_CXX03_LANG
150 _LIBCPP_INLINE_VISIBILITY149 _LIBCPP_INLINE_VISIBILITY
151 unique_lock(unique_lock&& __u) _NOEXCEPT150 unique_lock(unique_lock&& __u) _NOEXCEPT
152 : __m_(__u.__m_), __owns_(__u.__owns_)151 : __m_(__u.__m_), __owns_(__u.__owns_)
...@@ -163,8 +162,6 @@ public:...@@ -163,8 +162,6 @@ public:
163 return *this;162 return *this;
164 }163 }
165164
166#endif // _LIBCPP_CXX03_LANG
167
168 void lock();165 void lock();
169 bool try_lock();166 bool try_lock();
170167
...@@ -382,12 +379,12 @@ __safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d)...@@ -382,12 +379,12 @@ __safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d)
382379
383 using __ratio = ratio_divide<_Period, nano>;380 using __ratio = ratio_divide<_Period, nano>;
384 using __ns_rep = nanoseconds::rep;381 using __ns_rep = nanoseconds::rep;
385 __ns_rep __result_max = std::numeric_limits<__ns_rep>::max();382 __ns_rep __result_max = numeric_limits<__ns_rep>::max();
386 if (__d.count() > 0 && __d.count() > __result_max / __ratio::num) {383 if (__d.count() > 0 && __d.count() > __result_max / __ratio::num) {
387 return nanoseconds::max();384 return nanoseconds::max();
388 }385 }
389386
390 __ns_rep __result_min = std::numeric_limits<__ns_rep>::min();387 __ns_rep __result_min = numeric_limits<__ns_rep>::min();
391 if (__d.count() < 0 && __d.count() < __result_min / __ratio::num) {388 if (__d.count() < 0 && __d.count() < __result_min / __ratio::num) {
392 return nanoseconds::min();389 return nanoseconds::min();
393 }390 }
...@@ -421,7 +418,7 @@ condition_variable::wait_until(unique_lock<mutex>& __lk,...@@ -421,7 +418,7 @@ condition_variable::wait_until(unique_lock<mutex>& __lk,
421 if (__t <= __now)418 if (__t <= __now)
422 return cv_status::timeout;419 return cv_status::timeout;
423420
424 __clock_tp_ns __t_ns = __clock_tp_ns(__safe_nanosecond_cast(__t.time_since_epoch()));421 __clock_tp_ns __t_ns = __clock_tp_ns(_VSTD::__safe_nanosecond_cast(__t.time_since_epoch()));
425422
426 __do_timed_wait(__lk, __t_ns);423 __do_timed_wait(__lk, __t_ns);
427 return _Clock::now() < __t ? cv_status::no_timeout : cv_status::timeout;424 return _Clock::now() < __t ? cv_status::no_timeout : cv_status::timeout;
...@@ -454,13 +451,13 @@ condition_variable::wait_for(unique_lock<mutex>& __lk,...@@ -454,13 +451,13 @@ condition_variable::wait_for(unique_lock<mutex>& __lk,
454451
455#if defined(_LIBCPP_HAS_COND_CLOCKWAIT)452#if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
456 using __clock_tp_ns = time_point<steady_clock, nanoseconds>;453 using __clock_tp_ns = time_point<steady_clock, nanoseconds>;
457 __ns_rep __now_count_ns = __safe_nanosecond_cast(__c_now.time_since_epoch()).count();454 __ns_rep __now_count_ns = _VSTD::__safe_nanosecond_cast(__c_now.time_since_epoch()).count();
458#else455#else
459 using __clock_tp_ns = time_point<system_clock, nanoseconds>;456 using __clock_tp_ns = time_point<system_clock, nanoseconds>;
460 __ns_rep __now_count_ns = __safe_nanosecond_cast(system_clock::now().time_since_epoch()).count();457 __ns_rep __now_count_ns = _VSTD::__safe_nanosecond_cast(system_clock::now().time_since_epoch()).count();
461#endif458#endif
462459
463 __ns_rep __d_ns_count = __safe_nanosecond_cast(__d).count();460 __ns_rep __d_ns_count = _VSTD::__safe_nanosecond_cast(__d).count();
464461
465 if (__now_count_ns > numeric_limits<__ns_rep>::max() - __d_ns_count) {462 if (__now_count_ns > numeric_limits<__ns_rep>::max() - __d_ns_count) {
466 __do_timed_wait(__lk, __clock_tp_ns::max());463 __do_timed_wait(__lk, __clock_tp_ns::max());
lib/libcxx/include/__split_buffer+4-20
...@@ -68,7 +68,6 @@ public:...@@ -68,7 +68,6 @@ public:
68 __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);68 __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
69 ~__split_buffer();69 ~__split_buffer();
7070
71#ifndef _LIBCPP_CXX03_LANG
72 __split_buffer(__split_buffer&& __c)71 __split_buffer(__split_buffer&& __c)
73 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);72 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
74 __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);73 __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
...@@ -76,7 +75,6 @@ public:...@@ -76,7 +75,6 @@ public:
76 _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&75 _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
77 is_nothrow_move_assignable<allocator_type>::value) ||76 is_nothrow_move_assignable<allocator_type>::value) ||
78 !__alloc_traits::propagate_on_container_move_assignment::value);77 !__alloc_traits::propagate_on_container_move_assignment::value);
79#endif // _LIBCPP_CXX03_LANG
8078
81 _LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT {return __begin_;}79 _LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT {return __begin_;}
82 _LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT {return __begin_;}80 _LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT {return __begin_;}
...@@ -101,12 +99,10 @@ public:...@@ -101,12 +99,10 @@ public:
101 void shrink_to_fit() _NOEXCEPT;99 void shrink_to_fit() _NOEXCEPT;
102 void push_front(const_reference __x);100 void push_front(const_reference __x);
103 _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);101 _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
104#ifndef _LIBCPP_CXX03_LANG
105 void push_front(value_type&& __x);102 void push_front(value_type&& __x);
106 void push_back(value_type&& __x);103 void push_back(value_type&& __x);
107 template <class... _Args>104 template <class... _Args>
108 void emplace_back(_Args&&... __args);105 void emplace_back(_Args&&... __args);
109#endif // !defined(_LIBCPP_CXX03_LANG)
110106
111 _LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);}107 _LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);}
112 _LIBCPP_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);}108 _LIBCPP_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);}
...@@ -270,7 +266,7 @@ typename enable_if...@@ -270,7 +266,7 @@ typename enable_if
270>::type266>::type
271__split_buffer<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last)267__split_buffer<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last)
272{268{
273 _ConstructTransaction __tx(&this->__end_, std::distance(__first, __last));269 _ConstructTransaction __tx(&this->__end_, _VSTD::distance(__first, __last));
274 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, ++__first) {270 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, ++__first) {
275 __alloc_traits::construct(this->__alloc(),271 __alloc_traits::construct(this->__alloc(),
276 _VSTD::__to_address(__tx.__pos_), *__first);272 _VSTD::__to_address(__tx.__pos_), *__first);
...@@ -283,7 +279,7 @@ void...@@ -283,7 +279,7 @@ void
283__split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type)279__split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type)
284{280{
285 while (__begin_ != __new_begin)281 while (__begin_ != __new_begin)
286 __alloc_traits::destroy(__alloc(), __to_address(__begin_++));282 __alloc_traits::destroy(__alloc(), _VSTD::__to_address(__begin_++));
287}283}
288284
289template <class _Tp, class _Allocator>285template <class _Tp, class _Allocator>
...@@ -300,7 +296,7 @@ void...@@ -300,7 +296,7 @@ void
300__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT296__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT
301{297{
302 while (__new_last != __end_)298 while (__new_last != __end_)
303 __alloc_traits::destroy(__alloc(), __to_address(--__end_));299 __alloc_traits::destroy(__alloc(), _VSTD::__to_address(--__end_));
304}300}
305301
306template <class _Tp, class _Allocator>302template <class _Tp, class _Allocator>
...@@ -350,8 +346,6 @@ __split_buffer<_Tp, _Allocator>::~__split_buffer()...@@ -350,8 +346,6 @@ __split_buffer<_Tp, _Allocator>::~__split_buffer()
350 __alloc_traits::deallocate(__alloc(), __first_, capacity());346 __alloc_traits::deallocate(__alloc(), __first_, capacity());
351}347}
352348
353#ifndef _LIBCPP_CXX03_LANG
354
355template <class _Tp, class _Allocator>349template <class _Tp, class _Allocator>
356__split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)350__split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)
357 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)351 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
...@@ -412,8 +406,6 @@ __split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c)...@@ -412,8 +406,6 @@ __split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c)
412 return *this;406 return *this;
413}407}
414408
415#endif // _LIBCPP_CXX03_LANG
416
417template <class _Tp, class _Allocator>409template <class _Tp, class _Allocator>
418void410void
419__split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x)411__split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x)
...@@ -424,7 +416,7 @@ __split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x)...@@ -424,7 +416,7 @@ __split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x)
424 _VSTD::swap(__begin_, __x.__begin_);416 _VSTD::swap(__begin_, __x.__begin_);
425 _VSTD::swap(__end_, __x.__end_);417 _VSTD::swap(__end_, __x.__end_);
426 _VSTD::swap(__end_cap(), __x.__end_cap());418 _VSTD::swap(__end_cap(), __x.__end_cap());
427 __swap_allocator(__alloc(), __x.__alloc());419 _VSTD::__swap_allocator(__alloc(), __x.__alloc());
428}420}
429421
430template <class _Tp, class _Allocator>422template <class _Tp, class _Allocator>
...@@ -499,8 +491,6 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x)...@@ -499,8 +491,6 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x)
499 --__begin_;491 --__begin_;
500}492}
501493
502#ifndef _LIBCPP_CXX03_LANG
503
504template <class _Tp, class _Allocator>494template <class _Tp, class _Allocator>
505void495void
506__split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)496__split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
...@@ -531,8 +521,6 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)...@@ -531,8 +521,6 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
531 --__begin_;521 --__begin_;
532}522}
533523
534#endif // _LIBCPP_CXX03_LANG
535
536template <class _Tp, class _Allocator>524template <class _Tp, class _Allocator>
537inline _LIBCPP_INLINE_VISIBILITY525inline _LIBCPP_INLINE_VISIBILITY
538void526void
...@@ -563,8 +551,6 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x)...@@ -563,8 +551,6 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x)
563 ++__end_;551 ++__end_;
564}552}
565553
566#ifndef _LIBCPP_CXX03_LANG
567
568template <class _Tp, class _Allocator>554template <class _Tp, class _Allocator>
569void555void
570__split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)556__split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)
...@@ -626,8 +612,6 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)...@@ -626,8 +612,6 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)
626 ++__end_;612 ++__end_;
627}613}
628614
629#endif // _LIBCPP_CXX03_LANG
630
631template <class _Tp, class _Allocator>615template <class _Tp, class _Allocator>
632inline _LIBCPP_INLINE_VISIBILITY616inline _LIBCPP_INLINE_VISIBILITY
633void617void
lib/libcxx/include/__sso_allocator+5-4
...@@ -11,8 +11,9 @@...@@ -11,8 +11,9 @@
11#define _LIBCPP___SSO_ALLOCATOR11#define _LIBCPP___SSO_ALLOCATOR
1212
13#include <__config>13#include <__config>
14#include <type_traits>14#include <memory>
15#include <new>15#include <new>
16#include <type_traits>
1617
17#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)18#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18#pragma GCC system_header19#pragma GCC system_header
...@@ -47,21 +48,21 @@ public:...@@ -47,21 +48,21 @@ public:
47private:48private:
48 __sso_allocator& operator=(const __sso_allocator&);49 __sso_allocator& operator=(const __sso_allocator&);
49public:50public:
50 _LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, typename __sso_allocator<void, _Np>::const_pointer = 0)51 _LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, typename __sso_allocator<void, _Np>::const_pointer = nullptr)
51 {52 {
52 if (!__allocated_ && __n <= _Np)53 if (!__allocated_ && __n <= _Np)
53 {54 {
54 __allocated_ = true;55 __allocated_ = true;
55 return (pointer)&buf_;56 return (pointer)&buf_;
56 }57 }
57 return static_cast<pointer>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));58 return allocator<_Tp>().allocate(__n);
58 }59 }
59 _LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type __n)60 _LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type __n)
60 {61 {
61 if (__p == (pointer)&buf_)62 if (__p == (pointer)&buf_)
62 __allocated_ = false;63 __allocated_ = false;
63 else64 else
64 _VSTD::__libcpp_deallocate(__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));65 allocator<_Tp>().deallocate(__p, __n);
65 }66 }
66 _LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);}67 _LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);}
6768
lib/libcxx/include/__string+49-47
...@@ -55,7 +55,9 @@ template <> struct char_traits<char8_t>; // c++20...@@ -55,7 +55,9 @@ template <> struct char_traits<char8_t>; // c++20
5555
56#include <__config>56#include <__config>
57#include <algorithm> // for search and min57#include <algorithm> // for search and min
58#include <cstdio> // For EOF.58#include <cstdio> // for EOF
59#include <cstring> // for memcpy
60#include <cwchar> // for wmemcpy
59#include <memory> // for __murmur2_or_cityhash61#include <memory> // for __murmur2_or_cityhash
6062
61#include <__debug>63#include <__debug>
...@@ -92,7 +94,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -92,7 +94,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
92 _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type, size_type)) \94 _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type, size_type)) \
93 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&)) \95 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&)) \
94 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*)) \96 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*)) \
95 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, std::allocator<_CharType> const&)) \97 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, allocator<_CharType> const&)) \
96 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_not_of(value_type const*, size_type, size_type) const) \98 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_not_of(value_type const*, size_type, size_type) const) \
97 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::~basic_string()) \99 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::~basic_string()) \
98 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_not_of(value_type const*, size_type, size_type) const) \100 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_not_of(value_type const*, size_type, size_type) const) \
...@@ -108,7 +110,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -108,7 +110,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
108 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \110 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \
109 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \111 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \
110 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \112 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \
111 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, std::allocator<_CharType> const&)) \113 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, allocator<_CharType> const&)) \
112 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \114 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \
113 _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \115 _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \
114 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \116 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \
...@@ -158,7 +160,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -158,7 +160,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
158 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \160 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \
159 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \161 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \
160 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \162 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \
161 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, std::allocator<_CharType> const&)) \163 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, allocator<_CharType> const&)) \
162 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \164 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \
163 _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \165 _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \
164 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \166 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \
...@@ -268,7 +270,7 @@ char_traits<_CharT>::find(const char_type* __s, size_t __n, const char_type& __a...@@ -268,7 +270,7 @@ char_traits<_CharT>::find(const char_type* __s, size_t __n, const char_type& __a
268 return __s;270 return __s;
269 ++__s;271 ++__s;
270 }272 }
271 return 0;273 return nullptr;
272}274}
273275
274template <class _CharT>276template <class _CharT>
...@@ -318,7 +320,7 @@ char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a)...@@ -318,7 +320,7 @@ char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a)
318// constexpr versions of move/copy/assign.320// constexpr versions of move/copy/assign.
319321
320template <class _CharT>322template <class _CharT>
321static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED323static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
322_CharT* __move_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT324_CharT* __move_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT
323{325{
324 if (__n == 0) return __s1;326 if (__n == 0) return __s1;
...@@ -331,7 +333,7 @@ _CharT* __move_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT...@@ -331,7 +333,7 @@ _CharT* __move_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT
331}333}
332334
333template <class _CharT>335template <class _CharT>
334static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED336static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
335_CharT* __copy_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT337_CharT* __copy_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT
336{338{
337 _VSTD::copy_n(__s2, __n, __s1);339 _VSTD::copy_n(__s2, __n, __s1);
...@@ -339,7 +341,7 @@ _CharT* __copy_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT...@@ -339,7 +341,7 @@ _CharT* __copy_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT
339}341}
340342
341template <class _CharT>343template <class _CharT>
342static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED344static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
343_CharT* __assign_constexpr(_CharT* __s, size_t __n, _CharT __a) _NOEXCEPT345_CharT* __assign_constexpr(_CharT* __s, size_t __n, _CharT __a) _NOEXCEPT
344{346{
345 _VSTD::fill_n(__s, __n, __a);347 _VSTD::fill_n(__s, __n, __a);
...@@ -370,27 +372,27 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char>...@@ -370,27 +372,27 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char>
370 length(const char_type* __s) _NOEXCEPT {return __builtin_strlen(__s);}372 length(const char_type* __s) _NOEXCEPT {return __builtin_strlen(__s);}
371 static _LIBCPP_CONSTEXPR_AFTER_CXX14373 static _LIBCPP_CONSTEXPR_AFTER_CXX14
372 const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;374 const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
373 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED375 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
374 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT376 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
375 {377 {
376 return __libcpp_is_constant_evaluated()378 return __libcpp_is_constant_evaluated()
377 ? __move_constexpr(__s1, __s2, __n)379 ? _VSTD::__move_constexpr(__s1, __s2, __n)
378 : __n == 0 ? __s1 : (char_type*)memmove(__s1, __s2, __n);380 : __n == 0 ? __s1 : (char_type*)_VSTD::memmove(__s1, __s2, __n);
379 }381 }
380 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED382 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
381 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT383 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
382 {384 {
383 _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");385 _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
384 return __libcpp_is_constant_evaluated()386 return __libcpp_is_constant_evaluated()
385 ? __copy_constexpr(__s1, __s2, __n)387 ? _VSTD::__copy_constexpr(__s1, __s2, __n)
386 : __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n);388 : __n == 0 ? __s1 : (char_type*)_VSTD::memcpy(__s1, __s2, __n);
387 }389 }
388 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED390 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
389 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT391 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
390 {392 {
391 return __libcpp_is_constant_evaluated()393 return __libcpp_is_constant_evaluated()
392 ? __assign_constexpr(__s, __n, __a)394 ? _VSTD::__assign_constexpr(__s, __n, __a)
393 : __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n);395 : __n == 0 ? __s : (char_type*)_VSTD::memset(__s, to_int_type(__a), __n);
394 }396 }
395397
396 static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT398 static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
...@@ -414,7 +416,7 @@ char_traits<char>::compare(const char_type* __s1, const char_type* __s2, size_t...@@ -414,7 +416,7 @@ char_traits<char>::compare(const char_type* __s1, const char_type* __s2, size_t
414#if __has_feature(cxx_constexpr_string_builtins)416#if __has_feature(cxx_constexpr_string_builtins)
415 return __builtin_memcmp(__s1, __s2, __n);417 return __builtin_memcmp(__s1, __s2, __n);
416#elif _LIBCPP_STD_VER <= 14418#elif _LIBCPP_STD_VER <= 14
417 return memcmp(__s1, __s2, __n);419 return _VSTD::memcmp(__s1, __s2, __n);
418#else420#else
419 for (; __n; --__n, ++__s1, ++__s2)421 for (; __n; --__n, ++__s1, ++__s2)
420 {422 {
...@@ -436,7 +438,7 @@ char_traits<char>::find(const char_type* __s, size_t __n, const char_type& __a)...@@ -436,7 +438,7 @@ char_traits<char>::find(const char_type* __s, size_t __n, const char_type& __a)
436#if __has_feature(cxx_constexpr_string_builtins)438#if __has_feature(cxx_constexpr_string_builtins)
437 return __builtin_char_memchr(__s, to_int_type(__a), __n);439 return __builtin_char_memchr(__s, to_int_type(__a), __n);
438#elif _LIBCPP_STD_VER <= 14440#elif _LIBCPP_STD_VER <= 14
439 return (const char_type*) memchr(__s, to_int_type(__a), __n);441 return (const char_type*) _VSTD::memchr(__s, to_int_type(__a), __n);
440#else442#else
441 for (; __n; --__n)443 for (; __n; --__n)
442 {444 {
...@@ -473,27 +475,27 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t>...@@ -473,27 +475,27 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t>
473 size_t length(const char_type* __s) _NOEXCEPT;475 size_t length(const char_type* __s) _NOEXCEPT;
474 static _LIBCPP_CONSTEXPR_AFTER_CXX14476 static _LIBCPP_CONSTEXPR_AFTER_CXX14
475 const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;477 const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
476 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED478 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
477 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT479 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
478 {480 {
479 return __libcpp_is_constant_evaluated()481 return __libcpp_is_constant_evaluated()
480 ? __move_constexpr(__s1, __s2, __n)482 ? _VSTD::__move_constexpr(__s1, __s2, __n)
481 : __n == 0 ? __s1 : wmemmove(__s1, __s2, __n);483 : __n == 0 ? __s1 : _VSTD::wmemmove(__s1, __s2, __n);
482 }484 }
483 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED485 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
484 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT486 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
485 {487 {
486 _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");488 _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
487 return __libcpp_is_constant_evaluated()489 return __libcpp_is_constant_evaluated()
488 ? __copy_constexpr(__s1, __s2, __n)490 ? _VSTD::__copy_constexpr(__s1, __s2, __n)
489 : __n == 0 ? __s1 : wmemcpy(__s1, __s2, __n);491 : __n == 0 ? __s1 : _VSTD::wmemcpy(__s1, __s2, __n);
490 }492 }
491 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED493 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
492 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT494 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
493 {495 {
494 return __libcpp_is_constant_evaluated()496 return __libcpp_is_constant_evaluated()
495 ? __assign_constexpr(__s, __n, __a)497 ? _VSTD::__assign_constexpr(__s, __n, __a)
496 : __n == 0 ? __s : wmemset(__s, __a, __n);498 : __n == 0 ? __s : _VSTD::wmemset(__s, __a, __n);
497 }499 }
498 static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT500 static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
499 {return eq_int_type(__c, eof()) ? ~eof() : __c;}501 {return eq_int_type(__c, eof()) ? ~eof() : __c;}
...@@ -516,7 +518,7 @@ char_traits<wchar_t>::compare(const char_type* __s1, const char_type* __s2, size...@@ -516,7 +518,7 @@ char_traits<wchar_t>::compare(const char_type* __s1, const char_type* __s2, size
516#if __has_feature(cxx_constexpr_string_builtins)518#if __has_feature(cxx_constexpr_string_builtins)
517 return __builtin_wmemcmp(__s1, __s2, __n);519 return __builtin_wmemcmp(__s1, __s2, __n);
518#elif _LIBCPP_STD_VER <= 14520#elif _LIBCPP_STD_VER <= 14
519 return wmemcmp(__s1, __s2, __n);521 return _VSTD::wmemcmp(__s1, __s2, __n);
520#else522#else
521 for (; __n; --__n, ++__s1, ++__s2)523 for (; __n; --__n, ++__s1, ++__s2)
522 {524 {
...@@ -548,7 +550,7 @@ char_traits<wchar_t>::length(const char_type* __s) _NOEXCEPT...@@ -548,7 +550,7 @@ char_traits<wchar_t>::length(const char_type* __s) _NOEXCEPT
548#if __has_feature(cxx_constexpr_string_builtins)550#if __has_feature(cxx_constexpr_string_builtins)
549 return __builtin_wcslen(__s);551 return __builtin_wcslen(__s);
550#elif _LIBCPP_STD_VER <= 14552#elif _LIBCPP_STD_VER <= 14
551 return wcslen(__s);553 return _VSTD::wcslen(__s);
552#else554#else
553 size_t __len = 0;555 size_t __len = 0;
554 for (; !eq(*__s, char_type(0)); ++__s)556 for (; !eq(*__s, char_type(0)); ++__s)
...@@ -566,7 +568,7 @@ char_traits<wchar_t>::find(const char_type* __s, size_t __n, const char_type& __...@@ -566,7 +568,7 @@ char_traits<wchar_t>::find(const char_type* __s, size_t __n, const char_type& __
566#if __has_feature(cxx_constexpr_string_builtins)568#if __has_feature(cxx_constexpr_string_builtins)
567 return __builtin_wmemchr(__s, __a, __n);569 return __builtin_wmemchr(__s, __a, __n);
568#elif _LIBCPP_STD_VER <= 14570#elif _LIBCPP_STD_VER <= 14
569 return wmemchr(__s, __a, __n);571 return _VSTD::wmemchr(__s, __a, __n);
570#else572#else
571 for (; __n; --__n)573 for (; __n; --__n)
572 {574 {
...@@ -606,29 +608,29 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char8_t>...@@ -606,29 +608,29 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char8_t>
606 _LIBCPP_INLINE_VISIBILITY static constexpr608 _LIBCPP_INLINE_VISIBILITY static constexpr
607 const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;609 const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
608610
609 static _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED611 static _LIBCPP_CONSTEXPR_AFTER_CXX17
610 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT612 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
611 {613 {
612 return __libcpp_is_constant_evaluated()614 return __libcpp_is_constant_evaluated()
613 ? __move_constexpr(__s1, __s2, __n)615 ? _VSTD::__move_constexpr(__s1, __s2, __n)
614 : __n == 0 ? __s1 : (char_type*)memmove(__s1, __s2, __n);616 : __n == 0 ? __s1 : (char_type*)_VSTD::memmove(__s1, __s2, __n);
615 }617 }
616618
617 static _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED619 static _LIBCPP_CONSTEXPR_AFTER_CXX17
618 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT620 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
619 {621 {
620 _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");622 _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
621 return __libcpp_is_constant_evaluated()623 return __libcpp_is_constant_evaluated()
622 ? __copy_constexpr(__s1, __s2, __n)624 ? _VSTD::__copy_constexpr(__s1, __s2, __n)
623 : __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n);625 : __n == 0 ? __s1 : (char_type*)_VSTD::memcpy(__s1, __s2, __n);
624 }626 }
625627
626 static _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED628 static _LIBCPP_CONSTEXPR_AFTER_CXX17
627 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT629 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
628 {630 {
629 return __libcpp_is_constant_evaluated()631 return __libcpp_is_constant_evaluated()
630 ? __assign_constexpr(__s, __n, __a)632 ? _VSTD::__assign_constexpr(__s, __n, __a)
631 : __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n);633 : __n == 0 ? __s : (char_type*)_VSTD::memset(__s, to_int_type(__a), __n);
632 }634 }
633635
634 static inline constexpr int_type not_eof(int_type __c) noexcept636 static inline constexpr int_type not_eof(int_type __c) noexcept
...@@ -683,7 +685,7 @@ char_traits<char8_t>::find(const char_type* __s, size_t __n, const char_type& __...@@ -683,7 +685,7 @@ char_traits<char8_t>::find(const char_type* __s, size_t __n, const char_type& __
683 return __s;685 return __s;
684 ++__s;686 ++__s;
685 }687 }
686 return 0;688 return nullptr;
687}689}
688690
689#endif // #_LIBCPP_NO_HAS_CHAR8_T691#endif // #_LIBCPP_NO_HAS_CHAR8_T
...@@ -765,7 +767,7 @@ char_traits<char16_t>::find(const char_type* __s, size_t __n, const char_type& _...@@ -765,7 +767,7 @@ char_traits<char16_t>::find(const char_type* __s, size_t __n, const char_type& _
765 return __s;767 return __s;
766 ++__s;768 ++__s;
767 }769 }
768 return 0;770 return nullptr;
769}771}
770772
771inline _LIBCPP_CONSTEXPR_AFTER_CXX17773inline _LIBCPP_CONSTEXPR_AFTER_CXX17
...@@ -885,7 +887,7 @@ char_traits<char32_t>::find(const char_type* __s, size_t __n, const char_type& _...@@ -885,7 +887,7 @@ char_traits<char32_t>::find(const char_type* __s, size_t __n, const char_type& _
885 return __s;887 return __s;
886 ++__s;888 ++__s;
887 }889 }
888 return 0;890 return nullptr;
889}891}
890892
891inline _LIBCPP_CONSTEXPR_AFTER_CXX17893inline _LIBCPP_CONSTEXPR_AFTER_CXX17
...@@ -943,7 +945,7 @@ __str_find(const _CharT *__p, _SizeT __sz,...@@ -943,7 +945,7 @@ __str_find(const _CharT *__p, _SizeT __sz,
943 if (__pos >= __sz)945 if (__pos >= __sz)
944 return __npos;946 return __npos;
945 const _CharT* __r = _Traits::find(__p + __pos, __sz - __pos, __c);947 const _CharT* __r = _Traits::find(__p + __pos, __sz - __pos, __c);
946 if (__r == 0)948 if (__r == nullptr)
947 return __npos;949 return __npos;
948 return static_cast<_SizeT>(__r - __p);950 return static_cast<_SizeT>(__r - __p);
949}951}
...@@ -972,7 +974,7 @@ __search_substring(const _CharT *__first1, const _CharT *__last1,...@@ -972,7 +974,7 @@ __search_substring(const _CharT *__first1, const _CharT *__last1,
972974
973 // Find __f2 the first byte matching in __first1.975 // Find __f2 the first byte matching in __first1.
974 __first1 = _Traits::find(__first1, __len1 - __len2 + 1, __f2);976 __first1 = _Traits::find(__first1, __len1 - __len2 + 1, __f2);
975 if (__first1 == 0)977 if (__first1 == nullptr)
976 return __last1;978 return __last1;
977979
978 // It is faster to compare from the first byte of __first1 even if we980 // It is faster to compare from the first byte of __first1 even if we
...@@ -1095,7 +1097,7 @@ __str_find_first_not_of(const _CharT *__p, _SizeT __sz,...@@ -1095,7 +1097,7 @@ __str_find_first_not_of(const _CharT *__p, _SizeT __sz,
1095 {1097 {
1096 const _CharT* __pe = __p + __sz;1098 const _CharT* __pe = __p + __sz;
1097 for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)1099 for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
1098 if (_Traits::find(__s, __n, *__ps) == 0)1100 if (_Traits::find(__s, __n, *__ps) == nullptr)
1099 return static_cast<_SizeT>(__ps - __p);1101 return static_cast<_SizeT>(__ps - __p);
1100 }1102 }
1101 return __npos;1103 return __npos;
...@@ -1129,7 +1131,7 @@ __str_find_last_not_of(const _CharT *__p, _SizeT __sz,...@@ -1129,7 +1131,7 @@ __str_find_last_not_of(const _CharT *__p, _SizeT __sz,
1129 else1131 else
1130 __pos = __sz;1132 __pos = __sz;
1131 for (const _CharT* __ps = __p + __pos; __ps != __p;)1133 for (const _CharT* __ps = __p + __pos; __ps != __p;)
1132 if (_Traits::find(__s, __n, *--__ps) == 0)1134 if (_Traits::find(__s, __n, *--__ps) == nullptr)
1133 return static_cast<_SizeT>(__ps - __p);1135 return static_cast<_SizeT>(__ps - __p);
1134 return __npos;1136 return __npos;
1135}1137}
lib/libcxx/include/__support/android/locale_bionic.h created+69
...@@ -0,0 +1,69 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
11#define _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
12
13#if defined(__BIONIC__)
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19#include <stdlib.h>
20#include <xlocale.h>
21
22#ifdef __cplusplus
23}
24#endif
25
26#if defined(__ANDROID__)
27
28#include <android/api-level.h>
29#include <android/ndk-version.h>
30#if __ANDROID_API__ < 21
31#include <__support/xlocale/__posix_l_fallback.h>
32#endif
33// In NDK versions later than 16, locale-aware functions are provided by
34// legacy_stdlib_inlines.h
35#if __NDK_MAJOR__ <= 16
36#if __ANDROID_API__ < 21
37#include <__support/xlocale/__strtonum_fallback.h>
38#elif __ANDROID_API__ < 26
39
40#if defined(__cplusplus)
41extern "C" {
42#endif
43
44inline _LIBCPP_INLINE_VISIBILITY float strtof_l(const char* __nptr, char** __endptr,
45 locale_t) {
46 return ::strtof(__nptr, __endptr);
47}
48
49inline _LIBCPP_INLINE_VISIBILITY double strtod_l(const char* __nptr,
50 char** __endptr, locale_t) {
51 return ::strtod(__nptr, __endptr);
52}
53
54inline _LIBCPP_INLINE_VISIBILITY long strtol_l(const char* __nptr, char** __endptr,
55 int __base, locale_t) {
56 return ::strtol(__nptr, __endptr, __base);
57}
58
59#if defined(__cplusplus)
60}
61#endif
62
63#endif // __ANDROID_API__ < 26
64
65#endif // __NDK_MAJOR__ <= 16
66#endif // defined(__ANDROID__)
67
68#endif // defined(__BIONIC__)
69#endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
lib/libcxx/include/__support/fuchsia/xlocale.h created+22
...@@ -0,0 +1,22 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
11#define _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
12
13#if defined(__Fuchsia__)
14
15#include <cstdlib>
16#include <cwchar>
17#include <__support/xlocale/__posix_l_fallback.h>
18#include <__support/xlocale/__strtonum_fallback.h>
19
20#endif // defined(__Fuchsia__)
21
22#endif // _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
lib/libcxx/include/__support/ibm/limits.h created+98
...@@ -0,0 +1,98 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_IBM_LIMITS_H
11#define _LIBCPP_SUPPORT_IBM_LIMITS_H
12
13#if !defined(_AIX) // Linux
14#include <math.h> // for HUGE_VAL, HUGE_VALF, HUGE_VALL, and NAN
15
16static const unsigned int _QNAN_F = 0x7fc00000;
17#define NANF (*((float *)(&_QNAN_F)))
18static const unsigned int _QNAN_LDBL128[4] = {0x7ff80000, 0x0, 0x0, 0x0};
19#define NANL (*((long double *)(&_QNAN_LDBL128)))
20static const unsigned int _SNAN_F= 0x7f855555;
21#define NANSF (*((float *)(&_SNAN_F)))
22static const unsigned int _SNAN_D[2] = {0x7ff55555, 0x55555555};
23#define NANS (*((double *)(&_SNAN_D)))
24static const unsigned int _SNAN_LDBL128[4] = {0x7ff55555, 0x55555555, 0x0, 0x0};
25#define NANSL (*((long double *)(&_SNAN_LDBL128)))
26
27#define __builtin_huge_val() HUGE_VAL
28#define __builtin_huge_valf() HUGE_VALF
29#define __builtin_huge_vall() HUGE_VALL
30#define __builtin_nan(__dummy) NAN
31#define __builtin_nanf(__dummy) NANF
32#define __builtin_nanl(__dummy) NANL
33#define __builtin_nans(__dummy) NANS
34#define __builtin_nansf(__dummy) NANSF
35#define __builtin_nansl(__dummy) NANSL
36
37#else
38
39#include <math.h>
40#include <float.h> // limit constants
41
42#define __builtin_huge_val() HUGE_VAL //0x7ff0000000000000
43#define __builtin_huge_valf() HUGE_VALF //0x7f800000
44#define __builtin_huge_vall() HUGE_VALL //0x7ff0000000000000
45#define __builtin_nan(__dummy) nan(__dummy) //0x7ff8000000000000
46#define __builtin_nanf(__dummy) nanf(__dummy) // 0x7ff80000
47#define __builtin_nanl(__dummy) nanl(__dummy) //0x7ff8000000000000
48#define __builtin_nans(__dummy) DBL_SNAN //0x7ff5555555555555
49#define __builtin_nansf(__dummy) FLT_SNAN //0x7f855555
50#define __builtin_nansl(__dummy) DBL_SNAN //0x7ff5555555555555
51
52#define __FLT_MANT_DIG__ FLT_MANT_DIG
53#define __FLT_DIG__ FLT_DIG
54#define __FLT_RADIX__ FLT_RADIX
55#define __FLT_MIN_EXP__ FLT_MIN_EXP
56#define __FLT_MIN_10_EXP__ FLT_MIN_10_EXP
57#define __FLT_MAX_EXP__ FLT_MAX_EXP
58#define __FLT_MAX_10_EXP__ FLT_MAX_10_EXP
59#define __FLT_MIN__ FLT_MIN
60#define __FLT_MAX__ FLT_MAX
61#define __FLT_EPSILON__ FLT_EPSILON
62// predefined by XLC on LoP
63#define __FLT_DENORM_MIN__ 1.40129846e-45F
64
65#define __DBL_MANT_DIG__ DBL_MANT_DIG
66#define __DBL_DIG__ DBL_DIG
67#define __DBL_MIN_EXP__ DBL_MIN_EXP
68#define __DBL_MIN_10_EXP__ DBL_MIN_10_EXP
69#define __DBL_MAX_EXP__ DBL_MAX_EXP
70#define __DBL_MAX_10_EXP__ DBL_MAX_10_EXP
71#define __DBL_MIN__ DBL_MIN
72#define __DBL_MAX__ DBL_MAX
73#define __DBL_EPSILON__ DBL_EPSILON
74// predefined by XLC on LoP
75#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
76
77#define __LDBL_MANT_DIG__ LDBL_MANT_DIG
78#define __LDBL_DIG__ LDBL_DIG
79#define __LDBL_MIN_EXP__ LDBL_MIN_EXP
80#define __LDBL_MIN_10_EXP__ LDBL_MIN_10_EXP
81#define __LDBL_MAX_EXP__ LDBL_MAX_EXP
82#define __LDBL_MAX_10_EXP__ LDBL_MAX_10_EXP
83#define __LDBL_MIN__ LDBL_MIN
84#define __LDBL_MAX__ LDBL_MAX
85#define __LDBL_EPSILON__ LDBL_EPSILON
86// predefined by XLC on LoP
87#if __LONGDOUBLE128
88#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
89#else
90#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
91#endif
92
93// predefined by XLC on LoP
94#define __CHAR_BIT__ 8
95
96#endif // _AIX
97
98#endif // _LIBCPP_SUPPORT_IBM_LIMITS_H
lib/libcxx/include/__support/ibm/locale_mgmt_aix.h created+84
...@@ -0,0 +1,84 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_AIX_H
11#define _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_AIX_H
12
13#if defined(_AIX)
14#include "cstdlib"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#if !defined(_AIX71)
21// AIX 7.1 and higher has these definitions. Definitions and stubs
22// are provied here as a temporary workaround on AIX 6.1.
23
24#define LC_COLLATE_MASK 1
25#define LC_CTYPE_MASK 2
26#define LC_MESSAGES_MASK 4
27#define LC_MONETARY_MASK 8
28#define LC_NUMERIC_MASK 16
29#define LC_TIME_MASK 32
30#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | \
31 LC_MESSAGES_MASK | LC_MONETARY_MASK |\
32 LC_NUMERIC_MASK | LC_TIME_MASK)
33
34typedef void* locale_t;
35
36// The following are stubs. They are not supported on AIX 6.1.
37static inline
38locale_t newlocale(int category_mask, const char *locale, locale_t base)
39{
40 _LC_locale_t *newloc, *loc;
41 if ((loc = (_LC_locale_t *)__xopen_locale(locale)) == NULL)
42 {
43 errno = EINVAL;
44 return (locale_t)0;
45 }
46 if ((newloc = (_LC_locale_t *)calloc(1, sizeof(_LC_locale_t))) == NULL)
47 {
48 errno = ENOMEM;
49 return (locale_t)0;
50 }
51 if (!base)
52 base = (_LC_locale_t *)__xopen_locale("C");
53 memcpy(newloc, base, sizeof (_LC_locale_t));
54 if (category_mask & LC_COLLATE_MASK)
55 newloc->lc_collate = loc->lc_collate;
56 if (category_mask & LC_CTYPE_MASK)
57 newloc->lc_ctype = loc->lc_ctype;
58 //if (category_mask & LC_MESSAGES_MASK)
59 // newloc->lc_messages = loc->lc_messages;
60 if (category_mask & LC_MONETARY_MASK)
61 newloc->lc_monetary = loc->lc_monetary;
62 if (category_mask & LC_TIME_MASK)
63 newloc->lc_time = loc->lc_time;
64 if (category_mask & LC_NUMERIC_MASK)
65 newloc->lc_numeric = loc->lc_numeric;
66 return (locale_t)newloc;
67}
68static inline
69void freelocale(locale_t locobj)
70{
71 free(locobj);
72}
73static inline
74locale_t uselocale(locale_t newloc)
75{
76 return (locale_t)0;
77}
78#endif // !defined(_AIX71)
79
80#ifdef __cplusplus
81}
82#endif
83#endif // defined(_AIX)
84#endif // _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_AIX_H
lib/libcxx/include/__support/ibm/nanosleep.h created+38
...@@ -0,0 +1,38 @@
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_IBM_NANOSLEEP_H
11#define _LIBCPP_SUPPORT_IBM_NANOSLEEP_H
12
13#include <unistd.h>
14
15inline int nanosleep(const struct timespec* req, struct timespec* rem)
16{
17 // The nanosleep() function is not available on z/OS. Therefore, we will call
18 // sleep() to sleep for whole seconds and usleep() to sleep for any remaining
19 // fraction of a second. Any remaining nanoseconds will round up to the next
20 // microsecond.
21
22 useconds_t __micro_sec = (rem->tv_nsec + 999) / 1000;
23 if (__micro_sec > 999999)
24 {
25 ++rem->tv_sec;
26 __micro_sec -= 1000000;
27 }
28 while (rem->tv_sec)
29 rem->tv_sec = sleep(rem->tv_sec);
30 if (__micro_sec) {
31 rem->tv_nsec = __micro_sec * 1000;
32 return usleep(__micro_sec);
33 }
34 rem->tv_nsec = 0;
35 return 0;
36}
37
38#endif // _LIBCPP_SUPPORT_IBM_NANOSLEEP_H
lib/libcxx/include/__support/ibm/support.h created+53
...@@ -0,0 +1,53 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_IBM_SUPPORT_H
11#define _LIBCPP_SUPPORT_IBM_SUPPORT_H
12
13extern "builtin" int __popcnt4(unsigned int);
14extern "builtin" int __popcnt8(unsigned long long);
15extern "builtin" unsigned int __cnttz4(unsigned int);
16extern "builtin" unsigned int __cnttz8(unsigned long long);
17extern "builtin" unsigned int __cntlz4(unsigned int);
18extern "builtin" unsigned int __cntlz8(unsigned long long);
19
20// Builtin functions for counting population
21#define __builtin_popcount(x) __popcnt4(x)
22#define __builtin_popcountll(x) __popcnt8(x)
23#if defined(__64BIT__)
24#define __builtin_popcountl(x) __builtin_popcountll(x)
25#else
26#define __builtin_popcountl(x) __builtin_popcount(x)
27#endif
28
29// Builtin functions for counting trailing zeros
30#define __builtin_ctz(x) __cnttz4(x)
31#define __builtin_ctzll(x) __cnttz8(x)
32#if defined(__64BIT__)
33#define __builtin_ctzl(x) __builtin_ctzll(x)
34#else
35#define __builtin_ctzl(x) __builtin_ctz(x)
36#endif
37
38// Builtin functions for counting leading zeros
39#define __builtin_clz(x) __cntlz4(x)
40#define __builtin_clzll(x) __cntlz8(x)
41#if defined(__64BIT__)
42#define __builtin_clzl(x) __builtin_clzll(x)
43#else
44#define __builtin_clzl(x) __builtin_clz(x)
45#endif
46
47#if defined(__64BIT__)
48#define __SIZE_WIDTH__ 64
49#else
50#define __SIZE_WIDTH__ 32
51#endif
52
53#endif // _LIBCPP_SUPPORT_IBM_SUPPORT_H
lib/libcxx/include/__support/ibm/xlocale.h created+276
...@@ -0,0 +1,276 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_IBM_XLOCALE_H
11#define _LIBCPP_SUPPORT_IBM_XLOCALE_H
12
13#include <__support/ibm/locale_mgmt_aix.h>
14
15#include "cstdlib"
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21#if defined(_AIX)
22#if !defined(_AIX71)
23// AIX 7.1 and higher has these definitions. Definitions and stubs
24// are provied here as a temporary workaround on AIX 6.1.
25static inline
26int isalnum_l(int c, locale_t locale)
27{
28 return __xisalnum(locale, c);
29}
30static inline
31int isalpha_l(int c, locale_t locale)
32{
33 return __xisalpha(locale, c);
34}
35static inline
36int isblank_l(int c, locale_t locale)
37{
38 return __xisblank(locale, c);
39}
40static inline
41int iscntrl_l(int c, locale_t locale)
42{
43 return __xiscntrl(locale, c);
44}
45static inline
46int isdigit_l(int c, locale_t locale)
47{
48 return __xisdigit(locale, c);
49}
50static inline
51int isgraph_l(int c, locale_t locale)
52{
53 return __xisgraph(locale, c);
54}
55static inline
56int islower_l(int c, locale_t locale)
57{
58 return __xislower(locale, c);
59}
60static inline
61int isprint_l(int c, locale_t locale)
62{
63 return __xisprint(locale, c);
64}
65
66static inline
67int ispunct_l(int c, locale_t locale)
68{
69 return __xispunct(locale, c);
70}
71static inline
72int isspace_l(int c, locale_t locale)
73{
74 return __xisspace(locale, c);
75}
76static inline
77int isupper_l(int c, locale_t locale)
78{
79 return __xisupper(locale, c);
80}
81
82static inline
83int isxdigit_l(int c, locale_t locale)
84{
85 return __xisxdigit(locale, c);
86}
87
88static inline
89int iswalnum_l(wchar_t wc, locale_t locale)
90{
91 return __xiswalnum(locale, wc);
92}
93
94static inline
95int iswalpha_l(wchar_t wc, locale_t locale)
96{
97 return __xiswalpha(locale, wc);
98}
99
100static inline
101int iswblank_l(wchar_t wc, locale_t locale)
102{
103 return __xiswblank(locale, wc);
104}
105
106static inline
107int iswcntrl_l(wchar_t wc, locale_t locale)
108{
109 return __xiswcntrl(locale, wc);
110}
111
112static inline
113int iswdigit_l(wchar_t wc, locale_t locale)
114{
115 return __xiswdigit(locale, wc);
116}
117
118static inline
119int iswgraph_l(wchar_t wc, locale_t locale)
120{
121 return __xiswgraph(locale, wc);
122}
123
124static inline
125int iswlower_l(wchar_t wc, locale_t locale)
126{
127 return __xiswlower(locale, wc);
128}
129
130static inline
131int iswprint_l(wchar_t wc, locale_t locale)
132{
133 return __xiswprint(locale, wc);
134}
135
136static inline
137int iswpunct_l(wchar_t wc, locale_t locale)
138{
139 return __xiswpunct(locale, wc);
140}
141
142static inline
143int iswspace_l(wchar_t wc, locale_t locale)
144{
145 return __xiswspace(locale, wc);
146}
147
148static inline
149int iswupper_l(wchar_t wc, locale_t locale)
150{
151 return __xiswupper(locale, wc);
152}
153
154static inline
155int iswxdigit_l(wchar_t wc, locale_t locale)
156{
157 return __xiswxdigit(locale, wc);
158}
159
160static inline
161int iswctype_l(wint_t wc, wctype_t desc, locale_t locale)
162{
163 return __xiswctype(locale, wc, desc);
164}
165
166static inline
167int toupper_l(int c, locale_t locale)
168{
169 return __xtoupper(locale, c);
170}
171static inline
172int tolower_l(int c, locale_t locale)
173{
174 return __xtolower(locale, c);
175}
176static inline
177wint_t towupper_l(wint_t wc, locale_t locale)
178{
179 return __xtowupper(locale, wc);
180}
181static inline
182wint_t towlower_l(wint_t wc, locale_t locale)
183{
184 return __xtowlower(locale, wc);
185}
186
187static inline
188int strcoll_l(const char *__s1, const char *__s2, locale_t locale)
189{
190 return __xstrcoll(locale, __s1, __s2);
191}
192static inline
193int wcscoll_l(const wchar_t *__s1, const wchar_t *__s2, locale_t locale)
194{
195 return __xwcscoll(locale, __s1, __s2);
196}
197static inline
198size_t strxfrm_l(char *__s1, const char *__s2, size_t __n, locale_t locale)
199{
200 return __xstrxfrm(locale, __s1, __s2, __n);
201}
202
203static inline
204size_t wcsxfrm_l(wchar_t *__ws1, const wchar_t *__ws2, size_t __n,
205 locale_t locale)
206{
207 return __xwcsxfrm(locale, __ws1, __ws2, __n);
208}
209#endif // !defined(_AIX71)
210
211// strftime_l() is defined by POSIX. However, AIX 7.1 and z/OS do not have it
212// implemented yet. z/OS retrieves it from the POSIX fallbacks.
213static inline
214size_t strftime_l(char *__s, size_t __size, const char *__fmt,
215 const struct tm *__tm, locale_t locale) {
216 return __xstrftime(locale, __s, __size, __fmt, __tm);
217}
218
219#elif defined(__MVS__)
220#include <wctype.h>
221// POSIX routines
222#include <__support/xlocale/__posix_l_fallback.h>
223#endif // defined(__MVS__)
224
225// The following are not POSIX routines. These are quick-and-dirty hacks
226// to make things pretend to work
227static inline
228long long strtoll_l(const char *__nptr, char **__endptr,
229 int __base, locale_t locale) {
230 return strtoll(__nptr, __endptr, __base);
231}
232static inline
233long strtol_l(const char *__nptr, char **__endptr,
234 int __base, locale_t locale) {
235 return strtol(__nptr, __endptr, __base);
236}
237static inline
238long double strtold_l(const char *__nptr, char **__endptr,
239 locale_t locale) {
240 return strtold(__nptr, __endptr);
241}
242static inline
243unsigned long long strtoull_l(const char *__nptr, char **__endptr,
244 int __base, locale_t locale) {
245 return strtoull(__nptr, __endptr, __base);
246}
247static inline
248unsigned long strtoul_l(const char *__nptr, char **__endptr,
249 int __base, locale_t locale) {
250 return strtoul(__nptr, __endptr, __base);
251}
252
253static inline
254int vasprintf(char **strp, const char *fmt, va_list ap)
255{
256 const size_t buff_size = 256;
257 int str_size;
258 if ((*strp = (char *)malloc(buff_size)) == NULL)
259 {
260 return -1;
261 }
262 if ((str_size = vsnprintf(*strp, buff_size, fmt, ap)) >= buff_size)
263 {
264 if ((*strp = (char *)realloc(*strp, str_size + 1)) == NULL)
265 {
266 return -1;
267 }
268 str_size = vsnprintf(*strp, str_size + 1, fmt, ap);
269 }
270 return str_size;
271}
272
273#ifdef __cplusplus
274}
275#endif
276#endif // _LIBCPP_SUPPORT_IBM_XLOCALE_H
lib/libcxx/include/__support/musl/xlocale.h created+57
...@@ -0,0 +1,57 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9// This adds support for the extended locale functions that are currently
10// missing from the Musl C library.
11//
12// This only works when the specified locale is "C" or "POSIX", but that's
13// about as good as we can do without implementing full xlocale support
14// in Musl.
15//===----------------------------------------------------------------------===//
16
17#ifndef _LIBCPP_SUPPORT_MUSL_XLOCALE_H
18#define _LIBCPP_SUPPORT_MUSL_XLOCALE_H
19
20#include <cstdlib>
21#include <cwchar>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27static inline long long strtoll_l(const char *nptr, char **endptr, int base,
28 locale_t) {
29 return strtoll(nptr, endptr, base);
30}
31
32static inline unsigned long long strtoull_l(const char *nptr, char **endptr,
33 int base, locale_t) {
34 return strtoull(nptr, endptr, base);
35}
36
37static inline long long wcstoll_l(const wchar_t *nptr, wchar_t **endptr,
38 int base, locale_t) {
39 return wcstoll(nptr, endptr, base);
40}
41
42static inline unsigned long long wcstoull_l(const wchar_t *nptr,
43 wchar_t **endptr, int base,
44 locale_t) {
45 return wcstoull(nptr, endptr, base);
46}
47
48static inline long double wcstold_l(const wchar_t *nptr, wchar_t **endptr,
49 locale_t) {
50 return wcstold(nptr, endptr);
51}
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif // _LIBCPP_SUPPORT_MUSL_XLOCALE_H
lib/libcxx/include/__support/newlib/xlocale.h created+27
...@@ -0,0 +1,27 @@
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_SUPPORT_NEWLIB_XLOCALE_H
10#define _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
11
12#if defined(_NEWLIB_VERSION)
13
14#include <cstdlib>
15#include <clocale>
16#include <cwctype>
17#include <ctype.h>
18#if !defined(__NEWLIB__) || __NEWLIB__ < 2 || \
19 __NEWLIB__ == 2 && __NEWLIB_MINOR__ < 5
20#include <__support/xlocale/__nop_locale_mgmt.h>
21#include <__support/xlocale/__posix_l_fallback.h>
22#include <__support/xlocale/__strtonum_fallback.h>
23#endif
24
25#endif // _NEWLIB_VERSION
26
27#endif
lib/libcxx/include/__support/nuttx/xlocale.h created+18
...@@ -0,0 +1,18 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_NUTTX_XLOCALE_H
11#define _LIBCPP_SUPPORT_NUTTX_XLOCALE_H
12
13#if defined(__NuttX__)
14#include <__support/xlocale/__posix_l_fallback.h>
15#include <__support/xlocale/__strtonum_fallback.h>
16#endif // __NuttX__
17
18#endif
lib/libcxx/include/__support/openbsd/xlocale.h created+19
...@@ -0,0 +1,19 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_OPENBSD_XLOCALE_H
11#define _LIBCPP_SUPPORT_OPENBSD_XLOCALE_H
12
13#include <cstdlib>
14#include <clocale>
15#include <cwctype>
16#include <ctype.h>
17#include <__support/xlocale/__strtonum_fallback.h>
18
19#endif
lib/libcxx/include/__support/solaris/floatingpoint.h created+13
...@@ -0,0 +1,13 @@
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#define atof sun_atof
10#define strtod sun_strtod
11#include_next "floatingpoint.h"
12#undef atof
13#undef strtod
lib/libcxx/include/__support/solaris/wchar.h created+46
...@@ -0,0 +1,46 @@
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#define iswalpha sun_iswalpha
10#define iswupper sun_iswupper
11#define iswlower sun_iswlower
12#define iswdigit sun_iswdigit
13#define iswxdigit sun_iswxdigit
14#define iswalnum sun_iswalnum
15#define iswspace sun_iswspace
16#define iswpunct sun_iswpunct
17#define iswprint sun_iswprint
18#define iswgraph sun_iswgraph
19#define iswcntrl sun_iswcntrl
20#define iswctype sun_iswctype
21#define towlower sun_towlower
22#define towupper sun_towupper
23#define wcswcs sun_wcswcs
24#define wcswidth sun_wcswidth
25#define wcwidth sun_wcwidth
26#define wctype sun_wctype
27#define _WCHAR_T 1
28#include_next "wchar.h"
29#undef iswalpha
30#undef iswupper
31#undef iswlower
32#undef iswdigit
33#undef iswxdigit
34#undef iswalnum
35#undef iswspace
36#undef iswpunct
37#undef iswprint
38#undef iswgraph
39#undef iswcntrl
40#undef iswctype
41#undef towlower
42#undef towupper
43#undef wcswcs
44#undef wcswidth
45#undef wcwidth
46#undef wctype
lib/libcxx/include/__support/solaris/xlocale.h created+76
...@@ -0,0 +1,76 @@
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9////////////////////////////////////////////////////////////////////////////////
10// Minimal xlocale implementation for Solaris. This implements the subset of
11// the xlocale APIs that libc++ depends on.
12////////////////////////////////////////////////////////////////////////////////
13#ifndef __XLOCALE_H_INCLUDED
14#define __XLOCALE_H_INCLUDED
15
16#include <stdlib.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22
23int snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...);
24int asprintf_l(char **__s, locale_t __l, const char *__format, ...);
25
26int sscanf_l(const char *__s, locale_t __l, const char *__format, ...);
27
28int toupper_l(int __c, locale_t __l);
29int tolower_l(int __c, locale_t __l);
30
31struct lconv *localeconv(void);
32struct lconv *localeconv_l(locale_t __l);
33
34// FIXME: These are quick-and-dirty hacks to make things pretend to work
35static inline
36long long strtoll_l(const char *__nptr, char **__endptr,
37 int __base, locale_t __loc) {
38 return strtoll(__nptr, __endptr, __base);
39}
40static inline
41long strtol_l(const char *__nptr, char **__endptr,
42 int __base, locale_t __loc) {
43 return strtol(__nptr, __endptr, __base);
44}
45static inline
46unsigned long long strtoull_l(const char *__nptr, char **__endptr,
47 int __base, locale_t __loc) {
48 return strtoull(__nptr, __endptr, __base);
49}
50static inline
51unsigned long strtoul_l(const char *__nptr, char **__endptr,
52 int __base, locale_t __loc) {
53 return strtoul(__nptr, __endptr, __base);
54}
55static inline
56float strtof_l(const char *__nptr, char **__endptr,
57 locale_t __loc) {
58 return strtof(__nptr, __endptr);
59}
60static inline
61double strtod_l(const char *__nptr, char **__endptr,
62 locale_t __loc) {
63 return strtod(__nptr, __endptr);
64}
65static inline
66long double strtold_l(const char *__nptr, char **__endptr,
67 locale_t __loc) {
68 return strtold(__nptr, __endptr);
69}
70
71
72#ifdef __cplusplus
73}
74#endif
75
76#endif
lib/libcxx/include/__support/win32/limits_msvc_win32.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_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
11#define _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
12
13#if !defined(_LIBCPP_MSVCRT)
14#error "This header complements the Microsoft C Runtime library, and should not be included otherwise."
15#endif
16#if defined(__clang__)
17#error "This header should only be included when using Microsofts C1XX frontend"
18#endif
19
20#include <limits.h> // CHAR_BIT
21#include <float.h> // limit constants
22#include <math.h> // HUGE_VAL
23#include <ymath.h> // internal MSVC header providing the needed functionality
24
25#define __CHAR_BIT__ CHAR_BIT
26
27#define __FLT_MANT_DIG__ FLT_MANT_DIG
28#define __FLT_DIG__ FLT_DIG
29#define __FLT_RADIX__ FLT_RADIX
30#define __FLT_MIN_EXP__ FLT_MIN_EXP
31#define __FLT_MIN_10_EXP__ FLT_MIN_10_EXP
32#define __FLT_MAX_EXP__ FLT_MAX_EXP
33#define __FLT_MAX_10_EXP__ FLT_MAX_10_EXP
34#define __FLT_MIN__ FLT_MIN
35#define __FLT_MAX__ FLT_MAX
36#define __FLT_EPSILON__ FLT_EPSILON
37// predefined by MinGW GCC
38#define __FLT_DENORM_MIN__ 1.40129846432481707092e-45F
39
40#define __DBL_MANT_DIG__ DBL_MANT_DIG
41#define __DBL_DIG__ DBL_DIG
42#define __DBL_RADIX__ DBL_RADIX
43#define __DBL_MIN_EXP__ DBL_MIN_EXP
44#define __DBL_MIN_10_EXP__ DBL_MIN_10_EXP
45#define __DBL_MAX_EXP__ DBL_MAX_EXP
46#define __DBL_MAX_10_EXP__ DBL_MAX_10_EXP
47#define __DBL_MIN__ DBL_MIN
48#define __DBL_MAX__ DBL_MAX
49#define __DBL_EPSILON__ DBL_EPSILON
50// predefined by MinGW GCC
51#define __DBL_DENORM_MIN__ double(4.94065645841246544177e-324L)
52
53#define __LDBL_MANT_DIG__ LDBL_MANT_DIG
54#define __LDBL_DIG__ LDBL_DIG
55#define __LDBL_RADIX__ LDBL_RADIX
56#define __LDBL_MIN_EXP__ LDBL_MIN_EXP
57#define __LDBL_MIN_10_EXP__ LDBL_MIN_10_EXP
58#define __LDBL_MAX_EXP__ LDBL_MAX_EXP
59#define __LDBL_MAX_10_EXP__ LDBL_MAX_10_EXP
60#define __LDBL_MIN__ LDBL_MIN
61#define __LDBL_MAX__ LDBL_MAX
62#define __LDBL_EPSILON__ LDBL_EPSILON
63// predefined by MinGW GCC
64#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
65
66// __builtin replacements/workarounds
67#define __builtin_huge_vall() _LInf._Long_double
68#define __builtin_nanl(__dummmy) _LNan._Long_double
69#define __builtin_nansl(__dummy) _LSnan._Long_double
70
71#endif // _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
lib/libcxx/include/__support/win32/locale_win32.h created+264
...@@ -0,0 +1,264 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
11#define _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
12
13#include <__config>
14#include <stdio.h>
15#include <xlocinfo.h> // _locale_t
16#include <__nullptr>
17
18#define LC_COLLATE_MASK _M_COLLATE
19#define LC_CTYPE_MASK _M_CTYPE
20#define LC_MONETARY_MASK _M_MONETARY
21#define LC_NUMERIC_MASK _M_NUMERIC
22#define LC_TIME_MASK _M_TIME
23#define LC_MESSAGES_MASK _M_MESSAGES
24#define LC_ALL_MASK ( LC_COLLATE_MASK \
25 | LC_CTYPE_MASK \
26 | LC_MESSAGES_MASK \
27 | LC_MONETARY_MASK \
28 | LC_NUMERIC_MASK \
29 | LC_TIME_MASK )
30
31class __lconv_storage {
32public:
33 __lconv_storage(const lconv *__lc_input) {
34 __lc = *__lc_input;
35
36 __decimal_point = __lc_input->decimal_point;
37 __thousands_sep = __lc_input->thousands_sep;
38 __grouping = __lc_input->grouping;
39 __int_curr_symbol = __lc_input->int_curr_symbol;
40 __currency_symbol = __lc_input->currency_symbol;
41 __mon_decimal_point = __lc_input->mon_decimal_point;
42 __mon_thousands_sep = __lc_input->mon_thousands_sep;
43 __mon_grouping = __lc_input->mon_grouping;
44 __positive_sign = __lc_input->positive_sign;
45 __negative_sign = __lc_input->negative_sign;
46
47 __lc.decimal_point = const_cast<char *>(__decimal_point.c_str());
48 __lc.thousands_sep = const_cast<char *>(__thousands_sep.c_str());
49 __lc.grouping = const_cast<char *>(__grouping.c_str());
50 __lc.int_curr_symbol = const_cast<char *>(__int_curr_symbol.c_str());
51 __lc.currency_symbol = const_cast<char *>(__currency_symbol.c_str());
52 __lc.mon_decimal_point = const_cast<char *>(__mon_decimal_point.c_str());
53 __lc.mon_thousands_sep = const_cast<char *>(__mon_thousands_sep.c_str());
54 __lc.mon_grouping = const_cast<char *>(__mon_grouping.c_str());
55 __lc.positive_sign = const_cast<char *>(__positive_sign.c_str());
56 __lc.negative_sign = const_cast<char *>(__negative_sign.c_str());
57 }
58
59 lconv *__get() {
60 return &__lc;
61 }
62private:
63 lconv __lc;
64 std::string __decimal_point;
65 std::string __thousands_sep;
66 std::string __grouping;
67 std::string __int_curr_symbol;
68 std::string __currency_symbol;
69 std::string __mon_decimal_point;
70 std::string __mon_thousands_sep;
71 std::string __mon_grouping;
72 std::string __positive_sign;
73 std::string __negative_sign;
74};
75
76class locale_t {
77public:
78 locale_t()
79 : __locale(nullptr), __locale_str(nullptr), __lc(nullptr) {}
80 locale_t(std::nullptr_t)
81 : __locale(nullptr), __locale_str(nullptr), __lc(nullptr) {}
82 locale_t(_locale_t __xlocale, const char* __xlocale_str)
83 : __locale(__xlocale), __locale_str(__xlocale_str), __lc(nullptr) {}
84 locale_t(const locale_t &__l)
85 : __locale(__l.__locale), __locale_str(__l.__locale_str), __lc(nullptr) {}
86
87 ~locale_t() {
88 delete __lc;
89 }
90
91 locale_t &operator =(const locale_t &__l) {
92 __locale = __l.__locale;
93 __locale_str = __l.__locale_str;
94 // __lc not copied
95 return *this;
96 }
97
98 friend bool operator==(const locale_t& __left, const locale_t& __right) {
99 return __left.__locale == __right.__locale;
100 }
101
102 friend bool operator==(const locale_t& __left, int __right) {
103 return __left.__locale == nullptr && __right == 0;
104 }
105
106 friend bool operator==(const locale_t& __left, long long __right) {
107 return __left.__locale == nullptr && __right == 0;
108 }
109
110 friend bool operator==(const locale_t& __left, std::nullptr_t) {
111 return __left.__locale == nullptr;
112 }
113
114 friend bool operator==(int __left, const locale_t& __right) {
115 return __left == 0 && nullptr == __right.__locale;
116 }
117
118 friend bool operator==(std::nullptr_t, const locale_t& __right) {
119 return nullptr == __right.__locale;
120 }
121
122 friend bool operator!=(const locale_t& __left, const locale_t& __right) {
123 return !(__left == __right);
124 }
125
126 friend bool operator!=(const locale_t& __left, int __right) {
127 return !(__left == __right);
128 }
129
130 friend bool operator!=(const locale_t& __left, long long __right) {
131 return !(__left == __right);
132 }
133
134 friend bool operator!=(const locale_t& __left, std::nullptr_t __right) {
135 return !(__left == __right);
136 }
137
138 friend bool operator!=(int __left, const locale_t& __right) {
139 return !(__left == __right);
140 }
141
142 friend bool operator!=(std::nullptr_t __left, const locale_t& __right) {
143 return !(__left == __right);
144 }
145
146 operator bool() const {
147 return __locale != nullptr;
148 }
149
150 const char* __get_locale() const { return __locale_str; }
151
152 operator _locale_t() const {
153 return __locale;
154 }
155
156 lconv *__store_lconv(const lconv *__input_lc) {
157 delete __lc;
158 __lc = new __lconv_storage(__input_lc);
159 return __lc->__get();
160 }
161private:
162 _locale_t __locale;
163 const char* __locale_str;
164 __lconv_storage *__lc = nullptr;
165};
166
167// Locale management functions
168#define freelocale _free_locale
169// FIXME: base currently unused. Needs manual work to construct the new locale
170locale_t newlocale( int mask, const char * locale, locale_t base );
171// uselocale can't be implemented on Windows because Windows allows partial modification
172// of thread-local locale and so _get_current_locale() returns a copy while uselocale does
173// not create any copies.
174// We can still implement raii even without uselocale though.
175
176
177lconv *localeconv_l( locale_t &loc );
178size_t mbrlen_l( const char *__restrict s, size_t n,
179 mbstate_t *__restrict ps, locale_t loc);
180size_t mbsrtowcs_l( wchar_t *__restrict dst, const char **__restrict src,
181 size_t len, mbstate_t *__restrict ps, locale_t loc );
182size_t wcrtomb_l( char *__restrict s, wchar_t wc, mbstate_t *__restrict ps,
183 locale_t loc);
184size_t mbrtowc_l( wchar_t *__restrict pwc, const char *__restrict s,
185 size_t n, mbstate_t *__restrict ps, locale_t loc);
186size_t mbsnrtowcs_l( wchar_t *__restrict dst, const char **__restrict src,
187 size_t nms, size_t len, mbstate_t *__restrict ps, locale_t loc);
188size_t wcsnrtombs_l( char *__restrict dst, const wchar_t **__restrict src,
189 size_t nwc, size_t len, mbstate_t *__restrict ps, locale_t loc);
190wint_t btowc_l( int c, locale_t loc );
191int wctob_l( wint_t c, locale_t loc );
192
193decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l );
194
195// the *_l functions are prefixed on Windows, only available for msvcr80+, VS2005+
196#define mbtowc_l _mbtowc_l
197#define strtoll_l _strtoi64_l
198#define strtoull_l _strtoui64_l
199#define strtod_l _strtod_l
200#if defined(_LIBCPP_MSVCRT)
201#define strtof_l _strtof_l
202#define strtold_l _strtold_l
203#else
204_LIBCPP_FUNC_VIS float strtof_l(const char*, char**, locale_t);
205_LIBCPP_FUNC_VIS long double strtold_l(const char*, char**, locale_t);
206#endif
207inline _LIBCPP_INLINE_VISIBILITY
208int
209islower_l(int c, _locale_t loc)
210{
211 return _islower_l((int)c, loc);
212}
213
214inline _LIBCPP_INLINE_VISIBILITY
215int
216isupper_l(int c, _locale_t loc)
217{
218 return _isupper_l((int)c, loc);
219}
220
221#define isdigit_l _isdigit_l
222#define isxdigit_l _isxdigit_l
223#define strcoll_l _strcoll_l
224#define strxfrm_l _strxfrm_l
225#define wcscoll_l _wcscoll_l
226#define wcsxfrm_l _wcsxfrm_l
227#define toupper_l _toupper_l
228#define tolower_l _tolower_l
229#define iswspace_l _iswspace_l
230#define iswprint_l _iswprint_l
231#define iswcntrl_l _iswcntrl_l
232#define iswupper_l _iswupper_l
233#define iswlower_l _iswlower_l
234#define iswalpha_l _iswalpha_l
235#define iswdigit_l _iswdigit_l
236#define iswpunct_l _iswpunct_l
237#define iswxdigit_l _iswxdigit_l
238#define towupper_l _towupper_l
239#define towlower_l _towlower_l
240#if defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x0800
241_LIBCPP_FUNC_VIS size_t strftime_l(char *ret, size_t n, const char *format,
242 const struct tm *tm, locale_t loc);
243#else
244#define strftime_l _strftime_l
245#endif
246#define sscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ )
247#define sprintf_l( __s, __l, __f, ... ) _sprintf_l( __s, __f, __l, __VA_ARGS__ )
248#define vsprintf_l( __s, __l, __f, ... ) _vsprintf_l( __s, __f, __l, __VA_ARGS__ )
249#define vsnprintf_l( __s, __n, __l, __f, ... ) _vsnprintf_l( __s, __n, __f, __l, __VA_ARGS__ )
250_LIBCPP_FUNC_VIS int snprintf_l(char *ret, size_t n, locale_t loc, const char *format, ...);
251_LIBCPP_FUNC_VIS int asprintf_l( char **ret, locale_t loc, const char *format, ... );
252_LIBCPP_FUNC_VIS int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap );
253
254// not-so-pressing FIXME: use locale to determine blank characters
255inline int isblank_l( int c, locale_t /*loc*/ )
256{
257 return ( c == ' ' || c == '\t' );
258}
259inline int iswblank_l( wint_t c, locale_t /*loc*/ )
260{
261 return ( c == L' ' || c == L'\t' );
262}
263
264#endif // _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
lib/libcxx/include/__support/xlocale/__nop_locale_mgmt.h created+51
...@@ -0,0 +1,51 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
11#define _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17// Patch over lack of extended locale support
18typedef void *locale_t;
19static inline locale_t duplocale(locale_t) {
20 return NULL;
21}
22
23static inline void freelocale(locale_t) {
24}
25
26static inline locale_t newlocale(int, const char *, locale_t) {
27 return NULL;
28}
29
30static inline locale_t uselocale(locale_t) {
31 return NULL;
32}
33
34#define LC_COLLATE_MASK (1 << LC_COLLATE)
35#define LC_CTYPE_MASK (1 << LC_CTYPE)
36#define LC_MESSAGES_MASK (1 << LC_MESSAGES)
37#define LC_MONETARY_MASK (1 << LC_MONETARY)
38#define LC_NUMERIC_MASK (1 << LC_NUMERIC)
39#define LC_TIME_MASK (1 << LC_TIME)
40#define LC_ALL_MASK (LC_COLLATE_MASK|\
41 LC_CTYPE_MASK|\
42 LC_MONETARY_MASK|\
43 LC_NUMERIC_MASK|\
44 LC_TIME_MASK|\
45 LC_MESSAGES_MASK)
46
47#ifdef __cplusplus
48} // extern "C"
49#endif
50
51#endif // _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
lib/libcxx/include/__support/xlocale/__posix_l_fallback.h created+164
...@@ -0,0 +1,164 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9// These are reimplementations of some extended locale functions ( *_l ) that
10// are normally part of POSIX. This shared implementation provides parts of the
11// extended locale support for libc's that normally don't have any (like
12// Android's bionic and Newlib).
13//===----------------------------------------------------------------------===//
14
15#ifndef _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
16#define _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22inline _LIBCPP_INLINE_VISIBILITY int isalnum_l(int c, locale_t) {
23 return ::isalnum(c);
24}
25
26inline _LIBCPP_INLINE_VISIBILITY int isalpha_l(int c, locale_t) {
27 return ::isalpha(c);
28}
29
30inline _LIBCPP_INLINE_VISIBILITY int isblank_l(int c, locale_t) {
31 return ::isblank(c);
32}
33
34inline _LIBCPP_INLINE_VISIBILITY int iscntrl_l(int c, locale_t) {
35 return ::iscntrl(c);
36}
37
38inline _LIBCPP_INLINE_VISIBILITY int isdigit_l(int c, locale_t) {
39 return ::isdigit(c);
40}
41
42inline _LIBCPP_INLINE_VISIBILITY int isgraph_l(int c, locale_t) {
43 return ::isgraph(c);
44}
45
46inline _LIBCPP_INLINE_VISIBILITY int islower_l(int c, locale_t) {
47 return ::islower(c);
48}
49
50inline _LIBCPP_INLINE_VISIBILITY int isprint_l(int c, locale_t) {
51 return ::isprint(c);
52}
53
54inline _LIBCPP_INLINE_VISIBILITY int ispunct_l(int c, locale_t) {
55 return ::ispunct(c);
56}
57
58inline _LIBCPP_INLINE_VISIBILITY int isspace_l(int c, locale_t) {
59 return ::isspace(c);
60}
61
62inline _LIBCPP_INLINE_VISIBILITY int isupper_l(int c, locale_t) {
63 return ::isupper(c);
64}
65
66inline _LIBCPP_INLINE_VISIBILITY int isxdigit_l(int c, locale_t) {
67 return ::isxdigit(c);
68}
69
70inline _LIBCPP_INLINE_VISIBILITY int iswalnum_l(wint_t c, locale_t) {
71 return ::iswalnum(c);
72}
73
74inline _LIBCPP_INLINE_VISIBILITY int iswalpha_l(wint_t c, locale_t) {
75 return ::iswalpha(c);
76}
77
78inline _LIBCPP_INLINE_VISIBILITY int iswblank_l(wint_t c, locale_t) {
79 return ::iswblank(c);
80}
81
82inline _LIBCPP_INLINE_VISIBILITY int iswcntrl_l(wint_t c, locale_t) {
83 return ::iswcntrl(c);
84}
85
86inline _LIBCPP_INLINE_VISIBILITY int iswdigit_l(wint_t c, locale_t) {
87 return ::iswdigit(c);
88}
89
90inline _LIBCPP_INLINE_VISIBILITY int iswgraph_l(wint_t c, locale_t) {
91 return ::iswgraph(c);
92}
93
94inline _LIBCPP_INLINE_VISIBILITY int iswlower_l(wint_t c, locale_t) {
95 return ::iswlower(c);
96}
97
98inline _LIBCPP_INLINE_VISIBILITY int iswprint_l(wint_t c, locale_t) {
99 return ::iswprint(c);
100}
101
102inline _LIBCPP_INLINE_VISIBILITY int iswpunct_l(wint_t c, locale_t) {
103 return ::iswpunct(c);
104}
105
106inline _LIBCPP_INLINE_VISIBILITY int iswspace_l(wint_t c, locale_t) {
107 return ::iswspace(c);
108}
109
110inline _LIBCPP_INLINE_VISIBILITY int iswupper_l(wint_t c, locale_t) {
111 return ::iswupper(c);
112}
113
114inline _LIBCPP_INLINE_VISIBILITY int iswxdigit_l(wint_t c, locale_t) {
115 return ::iswxdigit(c);
116}
117
118inline _LIBCPP_INLINE_VISIBILITY int toupper_l(int c, locale_t) {
119 return ::toupper(c);
120}
121
122inline _LIBCPP_INLINE_VISIBILITY int tolower_l(int c, locale_t) {
123 return ::tolower(c);
124}
125
126inline _LIBCPP_INLINE_VISIBILITY wint_t towupper_l(wint_t c, locale_t) {
127 return ::towupper(c);
128}
129
130inline _LIBCPP_INLINE_VISIBILITY wint_t towlower_l(wint_t c, locale_t) {
131 return ::towlower(c);
132}
133
134inline _LIBCPP_INLINE_VISIBILITY int strcoll_l(const char *s1, const char *s2,
135 locale_t) {
136 return ::strcoll(s1, s2);
137}
138
139inline _LIBCPP_INLINE_VISIBILITY size_t strxfrm_l(char *dest, const char *src,
140 size_t n, locale_t) {
141 return ::strxfrm(dest, src, n);
142}
143
144inline _LIBCPP_INLINE_VISIBILITY size_t strftime_l(char *s, size_t max,
145 const char *format,
146 const struct tm *tm, locale_t) {
147 return ::strftime(s, max, format, tm);
148}
149
150inline _LIBCPP_INLINE_VISIBILITY int wcscoll_l(const wchar_t *ws1,
151 const wchar_t *ws2, locale_t) {
152 return ::wcscoll(ws1, ws2);
153}
154
155inline _LIBCPP_INLINE_VISIBILITY size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src,
156 size_t n, locale_t) {
157 return ::wcsxfrm(dest, src, n);
158}
159
160#ifdef __cplusplus
161}
162#endif
163
164#endif // _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
lib/libcxx/include/__support/xlocale/__strtonum_fallback.h created+66
...@@ -0,0 +1,66 @@
1// -*- C++ -*-
2//===-----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9// These are reimplementations of some extended locale functions ( *_l ) that
10// aren't part of POSIX. They are widely available though (GLIBC, BSD, maybe
11// others). The unifying aspect in this case is that all of these functions
12// convert strings to some numeric type.
13//===----------------------------------------------------------------------===//
14
15#ifndef _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
16#define _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22inline _LIBCPP_INLINE_VISIBILITY float strtof_l(const char *nptr,
23 char **endptr, locale_t) {
24 return ::strtof(nptr, endptr);
25}
26
27inline _LIBCPP_INLINE_VISIBILITY double strtod_l(const char *nptr,
28 char **endptr, locale_t) {
29 return ::strtod(nptr, endptr);
30}
31
32inline _LIBCPP_INLINE_VISIBILITY long double strtold_l(const char *nptr,
33 char **endptr, locale_t) {
34 return ::strtold(nptr, endptr);
35}
36
37inline _LIBCPP_INLINE_VISIBILITY long long
38strtoll_l(const char *nptr, char **endptr, int base, locale_t) {
39 return ::strtoll(nptr, endptr, base);
40}
41
42inline _LIBCPP_INLINE_VISIBILITY unsigned long long
43strtoull_l(const char *nptr, char **endptr, int base, locale_t) {
44 return ::strtoull(nptr, endptr, base);
45}
46
47inline _LIBCPP_INLINE_VISIBILITY long long
48wcstoll_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t) {
49 return ::wcstoll(nptr, endptr, base);
50}
51
52inline _LIBCPP_INLINE_VISIBILITY unsigned long long
53wcstoull_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t) {
54 return ::wcstoull(nptr, endptr, base);
55}
56
57inline _LIBCPP_INLINE_VISIBILITY long double wcstold_l(const wchar_t *nptr,
58 wchar_t **endptr, locale_t) {
59 return ::wcstold(nptr, endptr);
60}
61
62#ifdef __cplusplus
63}
64#endif
65
66#endif // _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
lib/libcxx/include/__threading_support+36-26
...@@ -11,10 +11,15 @@...@@ -11,10 +11,15 @@
11#define _LIBCPP_THREADING_SUPPORT11#define _LIBCPP_THREADING_SUPPORT
1212
13#include <__config>13#include <__config>
14#include <__availability>
14#include <chrono>15#include <chrono>
15#include <iosfwd>16#include <iosfwd>
16#include <errno.h>17#include <errno.h>
1718
19#ifdef __MVS__
20# include <__support/ibm/nanosleep.h>
21#endif
22
18#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER23#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
19#pragma GCC system_header24#pragma GCC system_header
20#endif25#endif
...@@ -26,7 +31,7 @@...@@ -26,7 +31,7 @@
26#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)31#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
27# include <pthread.h>32# include <pthread.h>
28# include <sched.h>33# include <sched.h>
29# ifdef __APPLE__34# if defined(__APPLE__) || defined(__MVS__)
30# define _LIBCPP_NO_NATIVE_SEMAPHORES35# define _LIBCPP_NO_NATIVE_SEMAPHORES
31# endif36# endif
32# ifndef _LIBCPP_NO_NATIVE_SEMAPHORES37# ifndef _LIBCPP_NO_NATIVE_SEMAPHORES
...@@ -82,11 +87,14 @@ typedef pthread_once_t __libcpp_exec_once_flag;...@@ -82,11 +87,14 @@ typedef pthread_once_t __libcpp_exec_once_flag;
82#define _LIBCPP_EXEC_ONCE_INITIALIZER PTHREAD_ONCE_INIT87#define _LIBCPP_EXEC_ONCE_INITIALIZER PTHREAD_ONCE_INIT
8388
84// Thread id89// Thread id
85typedef pthread_t __libcpp_thread_id;90#if defined(__MVS__)
91 typedef unsigned long long __libcpp_thread_id;
92#else
93 typedef pthread_t __libcpp_thread_id;
94#endif
8695
87// Thread96// Thread
88#define _LIBCPP_NULL_THREAD 0U97#define _LIBCPP_NULL_THREAD ((__libcpp_thread_t()))
89
90typedef pthread_t __libcpp_thread_t;98typedef pthread_t __libcpp_thread_t;
9199
92// Thread Local Storage100// Thread Local Storage
...@@ -278,24 +286,21 @@ int __libcpp_tls_set(__libcpp_tls_key __key, void *__p);...@@ -278,24 +286,21 @@ int __libcpp_tls_set(__libcpp_tls_key __key, void *__p);
278#endif // !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)286#endif // !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
279287
280struct __libcpp_timed_backoff_policy {288struct __libcpp_timed_backoff_policy {
281 _LIBCPP_THREAD_ABI_VISIBILITY289 _LIBCPP_INLINE_VISIBILITY
282 bool operator()(chrono::nanoseconds __elapsed) const;290 bool operator()(chrono::nanoseconds __elapsed) const
291 {
292 if(__elapsed > chrono::milliseconds(128))
293 __libcpp_thread_sleep_for(chrono::milliseconds(8));
294 else if(__elapsed > chrono::microseconds(64))
295 __libcpp_thread_sleep_for(__elapsed / 2);
296 else if(__elapsed > chrono::microseconds(4))
297 __libcpp_thread_yield();
298 else
299 {} // poll
300 return false;
301 }
283};302};
284303
285inline _LIBCPP_INLINE_VISIBILITY
286bool __libcpp_timed_backoff_policy::operator()(chrono::nanoseconds __elapsed) const
287{
288 if(__elapsed > chrono::milliseconds(128))
289 __libcpp_thread_sleep_for(chrono::milliseconds(8));
290 else if(__elapsed > chrono::microseconds(64))
291 __libcpp_thread_sleep_for(__elapsed / 2);
292 else if(__elapsed > chrono::microseconds(4))
293 __libcpp_thread_yield();
294 else
295 ; // poll
296 return false;
297}
298
299static _LIBCPP_CONSTEXPR const int __libcpp_polling_count = 64;304static _LIBCPP_CONSTEXPR const int __libcpp_polling_count = 64;
300305
301template<class _Fn, class _BFn>306template<class _Fn, class _BFn>
...@@ -484,7 +489,7 @@ int __libcpp_execute_once(__libcpp_exec_once_flag *flag,...@@ -484,7 +489,7 @@ int __libcpp_execute_once(__libcpp_exec_once_flag *flag,
484// Returns non-zero if the thread ids are equal, otherwise 0489// Returns non-zero if the thread ids are equal, otherwise 0
485bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2)490bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2)
486{491{
487 return pthread_equal(t1, t2) != 0;492 return t1 == t2;
488}493}
489494
490// Returns non-zero if t1 < t2, otherwise 0495// Returns non-zero if t1 < t2, otherwise 0
...@@ -495,28 +500,33 @@ bool __libcpp_thread_id_less(__libcpp_thread_id t1, __libcpp_thread_id t2)...@@ -495,28 +500,33 @@ bool __libcpp_thread_id_less(__libcpp_thread_id t1, __libcpp_thread_id t2)
495500
496// Thread501// Thread
497bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) {502bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) {
498 return *__t == 0;503 return *__t == __libcpp_thread_t();
499}504}
500505
501int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),506int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),
502 void *__arg)507 void *__arg)
503{508{
504 return pthread_create(__t, 0, __func, __arg);509 return pthread_create(__t, nullptr, __func, __arg);
505}510}
506511
507__libcpp_thread_id __libcpp_thread_get_current_id()512__libcpp_thread_id __libcpp_thread_get_current_id()
508{513{
509 return pthread_self();514 const __libcpp_thread_t thread = pthread_self();
515 return __libcpp_thread_get_id(&thread);
510}516}
511517
512__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t)518__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t)
513{519{
520#if defined(__MVS__)
521 return __t->__;
522#else
514 return *__t;523 return *__t;
524#endif
515}525}
516526
517int __libcpp_thread_join(__libcpp_thread_t *__t)527int __libcpp_thread_join(__libcpp_thread_t *__t)
518{528{
519 return pthread_join(*__t, 0);529 return pthread_join(*__t, nullptr);
520}530}
521531
522int __libcpp_thread_detach(__libcpp_thread_t *__t)532int __libcpp_thread_detach(__libcpp_thread_t *__t)
...@@ -651,7 +661,7 @@ bool __libcpp_thread_id_less(__libcpp_thread_id t1, __libcpp_thread_id t2)...@@ -651,7 +661,7 @@ bool __libcpp_thread_id_less(__libcpp_thread_id t1, __libcpp_thread_id t2)
651661
652// Thread662// Thread
653bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) {663bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) {
654 return *__t == 0;664 return __libcpp_thread_get_id(__t) == 0;
655}665}
656666
657int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),667int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),
lib/libcxx/include/__tree+60-160
...@@ -108,10 +108,10 @@ __tree_sub_invariant(_NodePtr __x)...@@ -108,10 +108,10 @@ __tree_sub_invariant(_NodePtr __x)
108 if (__x->__right_ && !__x->__right_->__is_black_)108 if (__x->__right_ && !__x->__right_->__is_black_)
109 return 0;109 return 0;
110 }110 }
111 unsigned __h = __tree_sub_invariant(__x->__left_);111 unsigned __h = _VSTD::__tree_sub_invariant(__x->__left_);
112 if (__h == 0)112 if (__h == 0)
113 return 0; // invalid left subtree113 return 0; // invalid left subtree
114 if (__h != __tree_sub_invariant(__x->__right_))114 if (__h != _VSTD::__tree_sub_invariant(__x->__right_))
115 return 0; // invalid or different height right subtree115 return 0; // invalid or different height right subtree
116 return __h + __x->__is_black_; // return black height of this node116 return __h + __x->__is_black_; // return black height of this node
117}117}
...@@ -128,13 +128,13 @@ __tree_invariant(_NodePtr __root)...@@ -128,13 +128,13 @@ __tree_invariant(_NodePtr __root)
128 // check __x->__parent_ consistency128 // check __x->__parent_ consistency
129 if (__root->__parent_ == nullptr)129 if (__root->__parent_ == nullptr)
130 return false;130 return false;
131 if (!__tree_is_left_child(__root))131 if (!_VSTD::__tree_is_left_child(__root))
132 return false;132 return false;
133 // root must be black133 // root must be black
134 if (!__root->__is_black_)134 if (!__root->__is_black_)
135 return false;135 return false;
136 // do normal node checks136 // do normal node checks
137 return __tree_sub_invariant(__root) != 0;137 return _VSTD::__tree_sub_invariant(__root) != 0;
138}138}
139139
140// Returns: pointer to the left-most node under __x.140// Returns: pointer to the left-most node under __x.
...@@ -168,8 +168,8 @@ _NodePtr...@@ -168,8 +168,8 @@ _NodePtr
168__tree_next(_NodePtr __x) _NOEXCEPT168__tree_next(_NodePtr __x) _NOEXCEPT
169{169{
170 if (__x->__right_ != nullptr)170 if (__x->__right_ != nullptr)
171 return __tree_min(__x->__right_);171 return _VSTD::__tree_min(__x->__right_);
172 while (!__tree_is_left_child(__x))172 while (!_VSTD::__tree_is_left_child(__x))
173 __x = __x->__parent_unsafe();173 __x = __x->__parent_unsafe();
174 return __x->__parent_unsafe();174 return __x->__parent_unsafe();
175}175}
...@@ -180,8 +180,8 @@ _EndNodePtr...@@ -180,8 +180,8 @@ _EndNodePtr
180__tree_next_iter(_NodePtr __x) _NOEXCEPT180__tree_next_iter(_NodePtr __x) _NOEXCEPT
181{181{
182 if (__x->__right_ != nullptr)182 if (__x->__right_ != nullptr)
183 return static_cast<_EndNodePtr>(__tree_min(__x->__right_));183 return static_cast<_EndNodePtr>(_VSTD::__tree_min(__x->__right_));
184 while (!__tree_is_left_child(__x))184 while (!_VSTD::__tree_is_left_child(__x))
185 __x = __x->__parent_unsafe();185 __x = __x->__parent_unsafe();
186 return static_cast<_EndNodePtr>(__x->__parent_);186 return static_cast<_EndNodePtr>(__x->__parent_);
187}187}
...@@ -195,9 +195,9 @@ _NodePtr...@@ -195,9 +195,9 @@ _NodePtr
195__tree_prev_iter(_EndNodePtr __x) _NOEXCEPT195__tree_prev_iter(_EndNodePtr __x) _NOEXCEPT
196{196{
197 if (__x->__left_ != nullptr)197 if (__x->__left_ != nullptr)
198 return __tree_max(__x->__left_);198 return _VSTD::__tree_max(__x->__left_);
199 _NodePtr __xx = static_cast<_NodePtr>(__x);199 _NodePtr __xx = static_cast<_NodePtr>(__x);
200 while (__tree_is_left_child(__xx))200 while (_VSTD::__tree_is_left_child(__xx))
201 __xx = __xx->__parent_unsafe();201 __xx = __xx->__parent_unsafe();
202 return __xx->__parent_unsafe();202 return __xx->__parent_unsafe();
203}203}
...@@ -237,7 +237,7 @@ __tree_left_rotate(_NodePtr __x) _NOEXCEPT...@@ -237,7 +237,7 @@ __tree_left_rotate(_NodePtr __x) _NOEXCEPT
237 if (__x->__right_ != nullptr)237 if (__x->__right_ != nullptr)
238 __x->__right_->__set_parent(__x);238 __x->__right_->__set_parent(__x);
239 __y->__parent_ = __x->__parent_;239 __y->__parent_ = __x->__parent_;
240 if (__tree_is_left_child(__x))240 if (_VSTD::__tree_is_left_child(__x))
241 __x->__parent_->__left_ = __y;241 __x->__parent_->__left_ = __y;
242 else242 else
243 __x->__parent_unsafe()->__right_ = __y;243 __x->__parent_unsafe()->__right_ = __y;
...@@ -257,7 +257,7 @@ __tree_right_rotate(_NodePtr __x) _NOEXCEPT...@@ -257,7 +257,7 @@ __tree_right_rotate(_NodePtr __x) _NOEXCEPT
257 if (__x->__left_ != nullptr)257 if (__x->__left_ != nullptr)
258 __x->__left_->__set_parent(__x);258 __x->__left_->__set_parent(__x);
259 __y->__parent_ = __x->__parent_;259 __y->__parent_ = __x->__parent_;
260 if (__tree_is_left_child(__x))260 if (_VSTD::__tree_is_left_child(__x))
261 __x->__parent_->__left_ = __y;261 __x->__parent_->__left_ = __y;
262 else262 else
263 __x->__parent_unsafe()->__right_ = __y;263 __x->__parent_unsafe()->__right_ = __y;
...@@ -281,7 +281,7 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT...@@ -281,7 +281,7 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
281 while (__x != __root && !__x->__parent_unsafe()->__is_black_)281 while (__x != __root && !__x->__parent_unsafe()->__is_black_)
282 {282 {
283 // __x->__parent_ != __root because __x->__parent_->__is_black == false283 // __x->__parent_ != __root because __x->__parent_->__is_black == false
284 if (__tree_is_left_child(__x->__parent_unsafe()))284 if (_VSTD::__tree_is_left_child(__x->__parent_unsafe()))
285 {285 {
286 _NodePtr __y = __x->__parent_unsafe()->__parent_unsafe()->__right_;286 _NodePtr __y = __x->__parent_unsafe()->__parent_unsafe()->__right_;
287 if (__y != nullptr && !__y->__is_black_)287 if (__y != nullptr && !__y->__is_black_)
...@@ -294,16 +294,16 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT...@@ -294,16 +294,16 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
294 }294 }
295 else295 else
296 {296 {
297 if (!__tree_is_left_child(__x))297 if (!_VSTD::__tree_is_left_child(__x))
298 {298 {
299 __x = __x->__parent_unsafe();299 __x = __x->__parent_unsafe();
300 __tree_left_rotate(__x);300 _VSTD::__tree_left_rotate(__x);
301 }301 }
302 __x = __x->__parent_unsafe();302 __x = __x->__parent_unsafe();
303 __x->__is_black_ = true;303 __x->__is_black_ = true;
304 __x = __x->__parent_unsafe();304 __x = __x->__parent_unsafe();
305 __x->__is_black_ = false;305 __x->__is_black_ = false;
306 __tree_right_rotate(__x);306 _VSTD::__tree_right_rotate(__x);
307 break;307 break;
308 }308 }
309 }309 }
...@@ -320,16 +320,16 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT...@@ -320,16 +320,16 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
320 }320 }
321 else321 else
322 {322 {
323 if (__tree_is_left_child(__x))323 if (_VSTD::__tree_is_left_child(__x))
324 {324 {
325 __x = __x->__parent_unsafe();325 __x = __x->__parent_unsafe();
326 __tree_right_rotate(__x);326 _VSTD::__tree_right_rotate(__x);
327 }327 }
328 __x = __x->__parent_unsafe();328 __x = __x->__parent_unsafe();
329 __x->__is_black_ = true;329 __x->__is_black_ = true;
330 __x = __x->__parent_unsafe();330 __x = __x->__parent_unsafe();
331 __x->__is_black_ = false;331 __x->__is_black_ = false;
332 __tree_left_rotate(__x);332 _VSTD::__tree_left_rotate(__x);
333 break;333 break;
334 }334 }
335 }335 }
...@@ -352,7 +352,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT...@@ -352,7 +352,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
352 // __y will have at most one child.352 // __y will have at most one child.
353 // __y will be the initial hole in the tree (make the hole at a leaf)353 // __y will be the initial hole in the tree (make the hole at a leaf)
354 _NodePtr __y = (__z->__left_ == nullptr || __z->__right_ == nullptr) ?354 _NodePtr __y = (__z->__left_ == nullptr || __z->__right_ == nullptr) ?
355 __z : __tree_next(__z);355 __z : _VSTD::__tree_next(__z);
356 // __x is __y's possibly null single child356 // __x is __y's possibly null single child
357 _NodePtr __x = __y->__left_ != nullptr ? __y->__left_ : __y->__right_;357 _NodePtr __x = __y->__left_ != nullptr ? __y->__left_ : __y->__right_;
358 // __w is __x's possibly null uncle (will become __x's sibling)358 // __w is __x's possibly null uncle (will become __x's sibling)
...@@ -360,7 +360,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT...@@ -360,7 +360,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
360 // link __x to __y's parent, and find __w360 // link __x to __y's parent, and find __w
361 if (__x != nullptr)361 if (__x != nullptr)
362 __x->__parent_ = __y->__parent_;362 __x->__parent_ = __y->__parent_;
363 if (__tree_is_left_child(__y))363 if (_VSTD::__tree_is_left_child(__y))
364 {364 {
365 __y->__parent_->__left_ = __x;365 __y->__parent_->__left_ = __x;
366 if (__y != __root)366 if (__y != __root)
...@@ -381,7 +381,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT...@@ -381,7 +381,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
381 {381 {
382 // __z->__left_ != nulptr but __z->__right_ might == __x == nullptr382 // __z->__left_ != nulptr but __z->__right_ might == __x == nullptr
383 __y->__parent_ = __z->__parent_;383 __y->__parent_ = __z->__parent_;
384 if (__tree_is_left_child(__z))384 if (_VSTD::__tree_is_left_child(__z))
385 __y->__parent_->__left_ = __y;385 __y->__parent_->__left_ = __y;
386 else386 else
387 __y->__parent_unsafe()->__right_ = __y;387 __y->__parent_unsafe()->__right_ = __y;
...@@ -421,13 +421,13 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT...@@ -421,13 +421,13 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
421 // with a non-null black child).421 // with a non-null black child).
422 while (true)422 while (true)
423 {423 {
424 if (!__tree_is_left_child(__w)) // if x is left child424 if (!_VSTD::__tree_is_left_child(__w)) // if x is left child
425 {425 {
426 if (!__w->__is_black_)426 if (!__w->__is_black_)
427 {427 {
428 __w->__is_black_ = true;428 __w->__is_black_ = true;
429 __w->__parent_unsafe()->__is_black_ = false;429 __w->__parent_unsafe()->__is_black_ = false;
430 __tree_left_rotate(__w->__parent_unsafe());430 _VSTD::__tree_left_rotate(__w->__parent_unsafe());
431 // __x is still valid431 // __x is still valid
432 // reset __root only if necessary432 // reset __root only if necessary
433 if (__root == __w->__left_)433 if (__root == __w->__left_)
...@@ -448,7 +448,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT...@@ -448,7 +448,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
448 break;448 break;
449 }449 }
450 // reset sibling, and it still can't be null450 // reset sibling, and it still can't be null
451 __w = __tree_is_left_child(__x) ?451 __w = _VSTD::__tree_is_left_child(__x) ?
452 __x->__parent_unsafe()->__right_ :452 __x->__parent_unsafe()->__right_ :
453 __x->__parent_->__left_;453 __x->__parent_->__left_;
454 // continue;454 // continue;
...@@ -460,7 +460,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT...@@ -460,7 +460,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
460 // __w left child is non-null and red460 // __w left child is non-null and red
461 __w->__left_->__is_black_ = true;461 __w->__left_->__is_black_ = true;
462 __w->__is_black_ = false;462 __w->__is_black_ = false;
463 __tree_right_rotate(__w);463 _VSTD::__tree_right_rotate(__w);
464 // __w is known not to be root, so root hasn't changed464 // __w is known not to be root, so root hasn't changed
465 // reset sibling, and it still can't be null465 // reset sibling, and it still can't be null
466 __w = __w->__parent_unsafe();466 __w = __w->__parent_unsafe();
...@@ -469,7 +469,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT...@@ -469,7 +469,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
469 __w->__is_black_ = __w->__parent_unsafe()->__is_black_;469 __w->__is_black_ = __w->__parent_unsafe()->__is_black_;
470 __w->__parent_unsafe()->__is_black_ = true;470 __w->__parent_unsafe()->__is_black_ = true;
471 __w->__right_->__is_black_ = true;471 __w->__right_->__is_black_ = true;
472 __tree_left_rotate(__w->__parent_unsafe());472 _VSTD::__tree_left_rotate(__w->__parent_unsafe());
473 break;473 break;
474 }474 }
475 }475 }
...@@ -479,7 +479,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT...@@ -479,7 +479,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
479 {479 {
480 __w->__is_black_ = true;480 __w->__is_black_ = true;
481 __w->__parent_unsafe()->__is_black_ = false;481 __w->__parent_unsafe()->__is_black_ = false;
482 __tree_right_rotate(__w->__parent_unsafe());482 _VSTD::__tree_right_rotate(__w->__parent_unsafe());
483 // __x is still valid483 // __x is still valid
484 // reset __root only if necessary484 // reset __root only if necessary
485 if (__root == __w->__right_)485 if (__root == __w->__right_)
...@@ -500,7 +500,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT...@@ -500,7 +500,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
500 break;500 break;
501 }501 }
502 // reset sibling, and it still can't be null502 // reset sibling, and it still can't be null
503 __w = __tree_is_left_child(__x) ?503 __w = _VSTD::__tree_is_left_child(__x) ?
504 __x->__parent_unsafe()->__right_ :504 __x->__parent_unsafe()->__right_ :
505 __x->__parent_->__left_;505 __x->__parent_->__left_;
506 // continue;506 // continue;
...@@ -512,7 +512,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT...@@ -512,7 +512,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
512 // __w right child is non-null and red512 // __w right child is non-null and red
513 __w->__right_->__is_black_ = true;513 __w->__right_->__is_black_ = true;
514 __w->__is_black_ = false;514 __w->__is_black_ = false;
515 __tree_left_rotate(__w);515 _VSTD::__tree_left_rotate(__w);
516 // __w is known not to be root, so root hasn't changed516 // __w is known not to be root, so root hasn't changed
517 // reset sibling, and it still can't be null517 // reset sibling, and it still can't be null
518 __w = __w->__parent_unsafe();518 __w = __w->__parent_unsafe();
...@@ -521,7 +521,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT...@@ -521,7 +521,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
521 __w->__is_black_ = __w->__parent_unsafe()->__is_black_;521 __w->__is_black_ = __w->__parent_unsafe()->__is_black_;
522 __w->__parent_unsafe()->__is_black_ = true;522 __w->__parent_unsafe()->__is_black_ = true;
523 __w->__left_->__is_black_ = true;523 __w->__left_->__is_black_ = true;
524 __tree_right_rotate(__w->__parent_unsafe());524 _VSTD::__tree_right_rotate(__w->__parent_unsafe());
525 break;525 break;
526 }526 }
527 }527 }
...@@ -533,19 +533,17 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT...@@ -533,19 +533,17 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
533// node traits533// node traits
534534
535535
536#ifndef _LIBCPP_CXX03_LANG
537template <class _Tp>536template <class _Tp>
538struct __is_tree_value_type_imp : false_type {};537struct __is_tree_value_type_imp : false_type {};
539538
540template <class _Key, class _Value>539template <class _Key, class _Value>
541struct __is_tree_value_type_imp<__value_type<_Key, _Value>> : true_type {};540struct __is_tree_value_type_imp<__value_type<_Key, _Value> > : true_type {};
542541
543template <class ..._Args>542template <class ..._Args>
544struct __is_tree_value_type : false_type {};543struct __is_tree_value_type : false_type {};
545544
546template <class _One>545template <class _One>
547struct __is_tree_value_type<_One> : __is_tree_value_type_imp<typename __uncvref<_One>::type> {};546struct __is_tree_value_type<_One> : __is_tree_value_type_imp<typename __uncvref<_One>::type> {};
548#endif
549547
550template <class _Tp>548template <class _Tp>
551struct __tree_key_value_types {549struct __tree_key_value_types {
...@@ -566,12 +564,10 @@ struct __tree_key_value_types {...@@ -566,12 +564,10 @@ struct __tree_key_value_types {
566 static __container_value_type* __get_ptr(__node_value_type& __n) {564 static __container_value_type* __get_ptr(__node_value_type& __n) {
567 return _VSTD::addressof(__n);565 return _VSTD::addressof(__n);
568 }566 }
569#ifndef _LIBCPP_CXX03_LANG
570 _LIBCPP_INLINE_VISIBILITY567 _LIBCPP_INLINE_VISIBILITY
571 static __container_value_type&& __move(__node_value_type& __v) {568 static __container_value_type&& __move(__node_value_type& __v) {
572 return _VSTD::move(__v);569 return _VSTD::move(__v);
573 }570 }
574#endif
575};571};
576572
577template <class _Key, class _Tp>573template <class _Key, class _Tp>
...@@ -616,12 +612,10 @@ struct __tree_key_value_types<__value_type<_Key, _Tp> > {...@@ -616,12 +612,10 @@ struct __tree_key_value_types<__value_type<_Key, _Tp> > {
616 return _VSTD::addressof(__n.__get_value());612 return _VSTD::addressof(__n.__get_value());
617 }613 }
618614
619#ifndef _LIBCPP_CXX03_LANG
620 _LIBCPP_INLINE_VISIBILITY615 _LIBCPP_INLINE_VISIBILITY
621 static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) {616 static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) {
622 return __v.__move();617 return __v.__move();
623 }618 }
624#endif
625};619};
626620
627template <class _VoidPtr>621template <class _VoidPtr>
...@@ -845,7 +839,7 @@ public:...@@ -845,7 +839,7 @@ public:
845 _LIBCPP_INLINE_VISIBILITY839 _LIBCPP_INLINE_VISIBILITY
846 __tree_iterator& operator++() {840 __tree_iterator& operator++() {
847 __ptr_ = static_cast<__iter_pointer>(841 __ptr_ = static_cast<__iter_pointer>(
848 __tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_)));842 _VSTD::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_)));
849 return *this;843 return *this;
850 }844 }
851 _LIBCPP_INLINE_VISIBILITY845 _LIBCPP_INLINE_VISIBILITY
...@@ -854,7 +848,7 @@ public:...@@ -854,7 +848,7 @@ public:
854848
855 _LIBCPP_INLINE_VISIBILITY849 _LIBCPP_INLINE_VISIBILITY
856 __tree_iterator& operator--() {850 __tree_iterator& operator--() {
857 __ptr_ = static_cast<__iter_pointer>(__tree_prev_iter<__node_base_pointer>(851 __ptr_ = static_cast<__iter_pointer>(_VSTD::__tree_prev_iter<__node_base_pointer>(
858 static_cast<__end_node_pointer>(__ptr_)));852 static_cast<__end_node_pointer>(__ptr_)));
859 return *this;853 return *this;
860 }854 }
...@@ -926,7 +920,7 @@ public:...@@ -926,7 +920,7 @@ public:
926 _LIBCPP_INLINE_VISIBILITY920 _LIBCPP_INLINE_VISIBILITY
927 __tree_const_iterator& operator++() {921 __tree_const_iterator& operator++() {
928 __ptr_ = static_cast<__iter_pointer>(922 __ptr_ = static_cast<__iter_pointer>(
929 __tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_)));923 _VSTD::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_)));
930 return *this;924 return *this;
931 }925 }
932926
...@@ -936,7 +930,7 @@ public:...@@ -936,7 +930,7 @@ public:
936930
937 _LIBCPP_INLINE_VISIBILITY931 _LIBCPP_INLINE_VISIBILITY
938 __tree_const_iterator& operator--() {932 __tree_const_iterator& operator--() {
939 __ptr_ = static_cast<__iter_pointer>(__tree_prev_iter<__node_base_pointer>(933 __ptr_ = static_cast<__iter_pointer>(_VSTD::__tree_prev_iter<__node_base_pointer>(
940 static_cast<__end_node_pointer>(__ptr_)));934 static_cast<__end_node_pointer>(__ptr_)));
941 return *this;935 return *this;
942 }936 }
...@@ -973,7 +967,7 @@ private:...@@ -973,7 +967,7 @@ private:
973967
974template<class _Tp, class _Compare>968template<class _Tp, class _Compare>
975#ifndef _LIBCPP_CXX03_LANG969#ifndef _LIBCPP_CXX03_LANG
976 _LIBCPP_DIAGNOSE_WARNING(!std::__invokable<_Compare const&, _Tp const&, _Tp const&>::value,970 _LIBCPP_DIAGNOSE_WARNING(!__invokable<_Compare const&, _Tp const&, _Tp const&>::value,
977 "the specified comparator type does not provide a viable const call operator")971 "the specified comparator type does not provide a viable const call operator")
978#endif972#endif
979int __diagnose_non_const_comparator();973int __diagnose_non_const_comparator();
...@@ -1103,7 +1097,6 @@ public:...@@ -1103,7 +1097,6 @@ public:
1103 void __assign_unique(_ForwardIterator __first, _ForwardIterator __last);1097 void __assign_unique(_ForwardIterator __first, _ForwardIterator __last);
1104 template <class _InputIterator>1098 template <class _InputIterator>
1105 void __assign_multi(_InputIterator __first, _InputIterator __last);1099 void __assign_multi(_InputIterator __first, _InputIterator __last);
1106#ifndef _LIBCPP_CXX03_LANG
1107 __tree(__tree&& __t)1100 __tree(__tree&& __t)
1108 _NOEXCEPT_(1101 _NOEXCEPT_(
1109 is_nothrow_move_constructible<__node_allocator>::value &&1102 is_nothrow_move_constructible<__node_allocator>::value &&
...@@ -1114,8 +1107,6 @@ public:...@@ -1114,8 +1107,6 @@ public:
1114 __node_traits::propagate_on_container_move_assignment::value &&1107 __node_traits::propagate_on_container_move_assignment::value &&
1115 is_nothrow_move_assignable<value_compare>::value &&1108 is_nothrow_move_assignable<value_compare>::value &&
1116 is_nothrow_move_assignable<__node_allocator>::value);1109 is_nothrow_move_assignable<__node_allocator>::value);
1117#endif // _LIBCPP_CXX03_LANG
1118
1119 ~__tree();1110 ~__tree();
11201111
1121 _LIBCPP_INLINE_VISIBILITY1112 _LIBCPP_INLINE_VISIBILITY
...@@ -1129,7 +1120,7 @@ public:...@@ -1129,7 +1120,7 @@ public:
11291120
1130 _LIBCPP_INLINE_VISIBILITY1121 _LIBCPP_INLINE_VISIBILITY
1131 size_type max_size() const _NOEXCEPT1122 size_type max_size() const _NOEXCEPT
1132 {return std::min<size_type>(1123 {return _VSTD::min<size_type>(
1133 __node_traits::max_size(__node_alloc()),1124 __node_traits::max_size(__node_alloc()),
1134 numeric_limits<difference_type >::max());}1125 numeric_limits<difference_type >::max());}
11351126
...@@ -1146,12 +1137,11 @@ public:...@@ -1146,12 +1137,11 @@ public:
1146 _NOEXCEPT_(__is_nothrow_swappable<value_compare>::value);1137 _NOEXCEPT_(__is_nothrow_swappable<value_compare>::value);
1147#endif1138#endif
11481139
1149#ifndef _LIBCPP_CXX03_LANG
1150 template <class _Key, class ..._Args>1140 template <class _Key, class ..._Args>
1151 pair<iterator, bool>1141 pair<iterator, bool>
1152 __emplace_unique_key_args(_Key const&, _Args&&... __args);1142 __emplace_unique_key_args(_Key const&, _Args&&... __args);
1153 template <class _Key, class ..._Args>1143 template <class _Key, class ..._Args>
1154 iterator1144 pair<iterator, bool>
1155 __emplace_hint_unique_key_args(const_iterator, _Key const&, _Args&&...);1145 __emplace_hint_unique_key_args(const_iterator, _Key const&, _Args&&...);
11561146
1157 template <class... _Args>1147 template <class... _Args>
...@@ -1225,7 +1215,7 @@ public:...@@ -1225,7 +1215,7 @@ public:
1225 >::type __emplace_hint_unique(const_iterator __p, _First&& __f, _Second&& __s) {1215 >::type __emplace_hint_unique(const_iterator __p, _First&& __f, _Second&& __s) {
1226 return __emplace_hint_unique_key_args(__p, __f,1216 return __emplace_hint_unique_key_args(__p, __f,
1227 _VSTD::forward<_First>(__f),1217 _VSTD::forward<_First>(__f),
1228 _VSTD::forward<_Second>(__s));1218 _VSTD::forward<_Second>(__s)).first;
1229 }1219 }
12301220
1231 template <class... _Args>1221 template <class... _Args>
...@@ -1245,25 +1235,16 @@ public:...@@ -1245,25 +1235,16 @@ public:
1245 _LIBCPP_INLINE_VISIBILITY1235 _LIBCPP_INLINE_VISIBILITY
1246 iterator1236 iterator
1247 __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_self_tag) {1237 __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_self_tag) {
1248 return __emplace_hint_unique_key_args(__p, __x, _VSTD::forward<_Pp>(__x));1238 return __emplace_hint_unique_key_args(__p, __x, _VSTD::forward<_Pp>(__x)).first;
1249 }1239 }
12501240
1251 template <class _Pp>1241 template <class _Pp>
1252 _LIBCPP_INLINE_VISIBILITY1242 _LIBCPP_INLINE_VISIBILITY
1253 iterator1243 iterator
1254 __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_first_tag) {1244 __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_first_tag) {
1255 return __emplace_hint_unique_key_args(__p, __x.first, _VSTD::forward<_Pp>(__x));1245 return __emplace_hint_unique_key_args(__p, __x.first, _VSTD::forward<_Pp>(__x)).first;
1256 }1246 }
12571247
1258#else
1259 template <class _Key, class _Args>
1260 _LIBCPP_INLINE_VISIBILITY
1261 pair<iterator, bool> __emplace_unique_key_args(_Key const&, _Args& __args);
1262 template <class _Key, class _Args>
1263 _LIBCPP_INLINE_VISIBILITY
1264 iterator __emplace_hint_unique_key_args(const_iterator, _Key const&, _Args&);
1265#endif
1266
1267 _LIBCPP_INLINE_VISIBILITY1248 _LIBCPP_INLINE_VISIBILITY
1268 pair<iterator, bool> __insert_unique(const __container_value_type& __v) {1249 pair<iterator, bool> __insert_unique(const __container_value_type& __v) {
1269 return __emplace_unique_key_args(_NodeTypes::__get_key(__v), __v);1250 return __emplace_unique_key_args(_NodeTypes::__get_key(__v), __v);
...@@ -1271,15 +1252,9 @@ public:...@@ -1271,15 +1252,9 @@ public:
12711252
1272 _LIBCPP_INLINE_VISIBILITY1253 _LIBCPP_INLINE_VISIBILITY
1273 iterator __insert_unique(const_iterator __p, const __container_value_type& __v) {1254 iterator __insert_unique(const_iterator __p, const __container_value_type& __v) {
1274 return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), __v);1255 return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), __v).first;
1275 }1256 }
12761257
1277#ifdef _LIBCPP_CXX03_LANG
1278 _LIBCPP_INLINE_VISIBILITY
1279 iterator __insert_multi(const __container_value_type& __v);
1280 _LIBCPP_INLINE_VISIBILITY
1281 iterator __insert_multi(const_iterator __p, const __container_value_type& __v);
1282#else
1283 _LIBCPP_INLINE_VISIBILITY1258 _LIBCPP_INLINE_VISIBILITY
1284 pair<iterator, bool> __insert_unique(__container_value_type&& __v) {1259 pair<iterator, bool> __insert_unique(__container_value_type&& __v) {
1285 return __emplace_unique_key_args(_NodeTypes::__get_key(__v), _VSTD::move(__v));1260 return __emplace_unique_key_args(_NodeTypes::__get_key(__v), _VSTD::move(__v));
...@@ -1287,7 +1262,7 @@ public:...@@ -1287,7 +1262,7 @@ public:
12871262
1288 _LIBCPP_INLINE_VISIBILITY1263 _LIBCPP_INLINE_VISIBILITY
1289 iterator __insert_unique(const_iterator __p, __container_value_type&& __v) {1264 iterator __insert_unique(const_iterator __p, __container_value_type&& __v) {
1290 return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), _VSTD::move(__v));1265 return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), _VSTD::move(__v)).first;
1291 }1266 }
12921267
1293 template <class _Vp, class = typename enable_if<1268 template <class _Vp, class = typename enable_if<
...@@ -1332,8 +1307,6 @@ public:...@@ -1332,8 +1307,6 @@ public:
1332 return __emplace_hint_multi(__p, _VSTD::forward<_Vp>(__v));1307 return __emplace_hint_multi(__p, _VSTD::forward<_Vp>(__v));
1333 }1308 }
13341309
1335#endif // !_LIBCPP_CXX03_LANG
1336
1337 _LIBCPP_INLINE_VISIBILITY1310 _LIBCPP_INLINE_VISIBILITY
1338 pair<iterator, bool> __node_assign_unique(const __container_value_type& __v, __node_pointer __dest);1311 pair<iterator, bool> __node_assign_unique(const __container_value_type& __v, __node_pointer __dest);
13391312
...@@ -1455,7 +1428,7 @@ private:...@@ -1455,7 +1428,7 @@ private:
1455 __node_base_pointer&1428 __node_base_pointer&
1456 __find_leaf(const_iterator __hint,1429 __find_leaf(const_iterator __hint,
1457 __parent_pointer& __parent, const key_type& __v);1430 __parent_pointer& __parent, const key_type& __v);
1458 // FIXME: Make this function const qualified. Unfortunetly doing so1431 // FIXME: Make this function const qualified. Unfortunately doing so
1459 // breaks existing code which uses non-const callable comparators.1432 // breaks existing code which uses non-const callable comparators.
1460 template <class _Key>1433 template <class _Key>
1461 __node_base_pointer&1434 __node_base_pointer&
...@@ -1471,12 +1444,8 @@ private:...@@ -1471,12 +1444,8 @@ private:
1471 __node_base_pointer& __dummy,1444 __node_base_pointer& __dummy,
1472 const _Key& __v);1445 const _Key& __v);
14731446
1474#ifndef _LIBCPP_CXX03_LANG
1475 template <class ..._Args>1447 template <class ..._Args>
1476 __node_holder __construct_node(_Args&& ...__args);1448 __node_holder __construct_node(_Args&& ...__args);
1477#else
1478 __node_holder __construct_node(const __container_value_type& __v);
1479#endif
14801449
1481 void destroy(__node_pointer __nd) _NOEXCEPT;1450 void destroy(__node_pointer __nd) _NOEXCEPT;
14821451
...@@ -1621,20 +1590,20 @@ __tree<_Tp, _Compare, _Allocator>::_DetachedTreeCache::__detach_next(__node_poin...@@ -1621,20 +1590,20 @@ __tree<_Tp, _Compare, _Allocator>::_DetachedTreeCache::__detach_next(__node_poin
1621{1590{
1622 if (__cache->__parent_ == nullptr)1591 if (__cache->__parent_ == nullptr)
1623 return nullptr;1592 return nullptr;
1624 if (__tree_is_left_child(static_cast<__node_base_pointer>(__cache)))1593 if (_VSTD::__tree_is_left_child(static_cast<__node_base_pointer>(__cache)))
1625 {1594 {
1626 __cache->__parent_->__left_ = nullptr;1595 __cache->__parent_->__left_ = nullptr;
1627 __cache = static_cast<__node_pointer>(__cache->__parent_);1596 __cache = static_cast<__node_pointer>(__cache->__parent_);
1628 if (__cache->__right_ == nullptr)1597 if (__cache->__right_ == nullptr)
1629 return __cache;1598 return __cache;
1630 return static_cast<__node_pointer>(__tree_leaf(__cache->__right_));1599 return static_cast<__node_pointer>(_VSTD::__tree_leaf(__cache->__right_));
1631 }1600 }
1632 // __cache is right child1601 // __cache is right child
1633 __cache->__parent_unsafe()->__right_ = nullptr;1602 __cache->__parent_unsafe()->__right_ = nullptr;
1634 __cache = static_cast<__node_pointer>(__cache->__parent_);1603 __cache = static_cast<__node_pointer>(__cache->__parent_);
1635 if (__cache->__left_ == nullptr)1604 if (__cache->__left_ == nullptr)
1636 return __cache;1605 return __cache;
1637 return static_cast<__node_pointer>(__tree_leaf(__cache->__left_));1606 return static_cast<__node_pointer>(_VSTD::__tree_leaf(__cache->__left_));
1638}1607}
16391608
1640template <class _Tp, class _Compare, class _Allocator>1609template <class _Tp, class _Compare, class _Allocator>
...@@ -1706,8 +1675,6 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)...@@ -1706,8 +1675,6 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
1706 __begin_node() = __end_node();1675 __begin_node() = __end_node();
1707}1676}
17081677
1709#ifndef _LIBCPP_CXX03_LANG
1710
1711template <class _Tp, class _Compare, class _Allocator>1678template <class _Tp, class _Compare, class _Allocator>
1712__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)1679__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)
1713 _NOEXCEPT_(1680 _NOEXCEPT_(
...@@ -1814,8 +1781,6 @@ __tree<_Tp, _Compare, _Allocator>::operator=(__tree&& __t)...@@ -1814,8 +1781,6 @@ __tree<_Tp, _Compare, _Allocator>::operator=(__tree&& __t)
1814 return *this;1781 return *this;
1815}1782}
18161783
1817#endif // _LIBCPP_CXX03_LANG
1818
1819template <class _Tp, class _Compare, class _Allocator>1784template <class _Tp, class _Compare, class _Allocator>
1820__tree<_Tp, _Compare, _Allocator>::~__tree()1785__tree<_Tp, _Compare, _Allocator>::~__tree()
1821{1786{
...@@ -1854,7 +1819,7 @@ __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)...@@ -1854,7 +1819,7 @@ __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
1854 using _VSTD::swap;1819 using _VSTD::swap;
1855 swap(__begin_node_, __t.__begin_node_);1820 swap(__begin_node_, __t.__begin_node_);
1856 swap(__pair1_.first(), __t.__pair1_.first());1821 swap(__pair1_.first(), __t.__pair1_.first());
1857 __swap_allocator(__node_alloc(), __t.__node_alloc());1822 _VSTD::__swap_allocator(__node_alloc(), __t.__node_alloc());
1858 __pair3_.swap(__t.__pair3_);1823 __pair3_.swap(__t.__pair3_);
1859 if (size() == 0)1824 if (size() == 0)
1860 __begin_node() = __end_node();1825 __begin_node() = __end_node();
...@@ -2113,21 +2078,14 @@ void __tree<_Tp, _Compare, _Allocator>::__insert_node_at(...@@ -2113,21 +2078,14 @@ void __tree<_Tp, _Compare, _Allocator>::__insert_node_at(
2113 __child = __new_node;2078 __child = __new_node;
2114 if (__begin_node()->__left_ != nullptr)2079 if (__begin_node()->__left_ != nullptr)
2115 __begin_node() = static_cast<__iter_pointer>(__begin_node()->__left_);2080 __begin_node() = static_cast<__iter_pointer>(__begin_node()->__left_);
2116 __tree_balance_after_insert(__end_node()->__left_, __child);2081 _VSTD::__tree_balance_after_insert(__end_node()->__left_, __child);
2117 ++size();2082 ++size();
2118}2083}
21192084
2120#ifndef _LIBCPP_CXX03_LANG
2121template <class _Tp, class _Compare, class _Allocator>2085template <class _Tp, class _Compare, class _Allocator>
2122template <class _Key, class... _Args>2086template <class _Key, class... _Args>
2123pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>2087pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
2124__tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args)2088__tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args)
2125#else
2126template <class _Tp, class _Compare, class _Allocator>
2127template <class _Key, class _Args>
2128pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
2129__tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _Args& __args)
2130#endif
2131{2089{
2132 __parent_pointer __parent;2090 __parent_pointer __parent;
2133 __node_base_pointer& __child = __find_equal(__parent, __k);2091 __node_base_pointer& __child = __find_equal(__parent, __k);
...@@ -2135,11 +2093,7 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _A...@@ -2135,11 +2093,7 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _A
2135 bool __inserted = false;2093 bool __inserted = false;
2136 if (__child == nullptr)2094 if (__child == nullptr)
2137 {2095 {
2138#ifndef _LIBCPP_CXX03_LANG
2139 __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);2096 __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
2140#else
2141 __node_holder __h = __construct_node(__args);
2142#endif
2143 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));2097 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
2144 __r = __h.release();2098 __r = __h.release();
2145 __inserted = true;2099 __inserted = true;
...@@ -2147,41 +2101,27 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _A...@@ -2147,41 +2101,27 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _A
2147 return pair<iterator, bool>(iterator(__r), __inserted);2101 return pair<iterator, bool>(iterator(__r), __inserted);
2148}2102}
21492103
2150
2151#ifndef _LIBCPP_CXX03_LANG
2152template <class _Tp, class _Compare, class _Allocator>2104template <class _Tp, class _Compare, class _Allocator>
2153template <class _Key, class... _Args>2105template <class _Key, class... _Args>
2154typename __tree<_Tp, _Compare, _Allocator>::iterator2106pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
2155__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_key_args(2107__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_key_args(
2156 const_iterator __p, _Key const& __k, _Args&&... __args)2108 const_iterator __p, _Key const& __k, _Args&&... __args)
2157#else
2158template <class _Tp, class _Compare, class _Allocator>
2159template <class _Key, class _Args>
2160typename __tree<_Tp, _Compare, _Allocator>::iterator
2161__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_key_args(
2162 const_iterator __p, _Key const& __k, _Args& __args)
2163#endif
2164{2109{
2165 __parent_pointer __parent;2110 __parent_pointer __parent;
2166 __node_base_pointer __dummy;2111 __node_base_pointer __dummy;
2167 __node_base_pointer& __child = __find_equal(__p, __parent, __dummy, __k);2112 __node_base_pointer& __child = __find_equal(__p, __parent, __dummy, __k);
2168 __node_pointer __r = static_cast<__node_pointer>(__child);2113 __node_pointer __r = static_cast<__node_pointer>(__child);
2114 bool __inserted = false;
2169 if (__child == nullptr)2115 if (__child == nullptr)
2170 {2116 {
2171#ifndef _LIBCPP_CXX03_LANG
2172 __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);2117 __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
2173#else
2174 __node_holder __h = __construct_node(__args);
2175#endif
2176 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));2118 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
2177 __r = __h.release();2119 __r = __h.release();
2120 __inserted = true;
2178 }2121 }
2179 return iterator(__r);2122 return pair<iterator, bool>(iterator(__r), __inserted);
2180}2123}
21812124
2182
2183#ifndef _LIBCPP_CXX03_LANG
2184
2185template <class _Tp, class _Compare, class _Allocator>2125template <class _Tp, class _Compare, class _Allocator>
2186template <class ..._Args>2126template <class ..._Args>
2187typename __tree<_Tp, _Compare, _Allocator>::__node_holder2127typename __tree<_Tp, _Compare, _Allocator>::__node_holder
...@@ -2259,46 +2199,6 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p,...@@ -2259,46 +2199,6 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p,
2259 return iterator(static_cast<__node_pointer>(__h.release()));2199 return iterator(static_cast<__node_pointer>(__h.release()));
2260}2200}
22612201
2262
2263#else // _LIBCPP_CXX03_LANG
2264
2265template <class _Tp, class _Compare, class _Allocator>
2266typename __tree<_Tp, _Compare, _Allocator>::__node_holder
2267__tree<_Tp, _Compare, _Allocator>::__construct_node(const __container_value_type& __v)
2268{
2269 __node_allocator& __na = __node_alloc();
2270 __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
2271 __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v);
2272 __h.get_deleter().__value_constructed = true;
2273 return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
2274}
2275
2276#endif // _LIBCPP_CXX03_LANG
2277
2278#ifdef _LIBCPP_CXX03_LANG
2279template <class _Tp, class _Compare, class _Allocator>
2280typename __tree<_Tp, _Compare, _Allocator>::iterator
2281__tree<_Tp, _Compare, _Allocator>::__insert_multi(const __container_value_type& __v)
2282{
2283 __parent_pointer __parent;
2284 __node_base_pointer& __child = __find_leaf_high(__parent, _NodeTypes::__get_key(__v));
2285 __node_holder __h = __construct_node(__v);
2286 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
2287 return iterator(__h.release());
2288}
2289
2290template <class _Tp, class _Compare, class _Allocator>
2291typename __tree<_Tp, _Compare, _Allocator>::iterator
2292__tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, const __container_value_type& __v)
2293{
2294 __parent_pointer __parent;
2295 __node_base_pointer& __child = __find_leaf(__p, __parent, _NodeTypes::__get_key(__v));
2296 __node_holder __h = __construct_node(__v);
2297 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
2298 return iterator(__h.release());
2299}
2300#endif
2301
2302template <class _Tp, class _Compare, class _Allocator>2202template <class _Tp, class _Compare, class _Allocator>
2303pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>2203pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
2304__tree<_Tp, _Compare, _Allocator>::__node_assign_unique(const __container_value_type& __v, __node_pointer __nd)2204__tree<_Tp, _Compare, _Allocator>::__node_assign_unique(const __container_value_type& __v, __node_pointer __nd)
...@@ -2348,8 +2248,8 @@ __tree<_Tp, _Compare, _Allocator>::__remove_node_pointer(__node_pointer __ptr) _...@@ -2348,8 +2248,8 @@ __tree<_Tp, _Compare, _Allocator>::__remove_node_pointer(__node_pointer __ptr) _
2348 if (__begin_node() == __ptr)2248 if (__begin_node() == __ptr)
2349 __begin_node() = __r.__ptr_;2249 __begin_node() = __r.__ptr_;
2350 --size();2250 --size();
2351 __tree_remove(__end_node()->__left_,2251 _VSTD::__tree_remove(__end_node()->__left_,
2352 static_cast<__node_base_pointer>(__ptr));2252 static_cast<__node_base_pointer>(__ptr));
2353 return __r;2253 return __r;
2354}2254}
23552255
...@@ -2727,7 +2627,7 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k)...@@ -2727,7 +2627,7 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k)
2727 return _Pp(iterator(__rt),2627 return _Pp(iterator(__rt),
2728 iterator(2628 iterator(
2729 __rt->__right_ != nullptr ?2629 __rt->__right_ != nullptr ?
2730 static_cast<__iter_pointer>(__tree_min(__rt->__right_))2630 static_cast<__iter_pointer>(_VSTD::__tree_min(__rt->__right_))
2731 : __result));2631 : __result));
2732 }2632 }
2733 return _Pp(iterator(__result), iterator(__result));2633 return _Pp(iterator(__result), iterator(__result));
...@@ -2755,7 +2655,7 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const...@@ -2755,7 +2655,7 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const
2755 return _Pp(const_iterator(__rt),2655 return _Pp(const_iterator(__rt),
2756 const_iterator(2656 const_iterator(
2757 __rt->__right_ != nullptr ?2657 __rt->__right_ != nullptr ?
2758 static_cast<__iter_pointer>(__tree_min(__rt->__right_))2658 static_cast<__iter_pointer>(_VSTD::__tree_min(__rt->__right_))
2759 : __result));2659 : __result));
2760 }2660 }
2761 return _Pp(const_iterator(__result), const_iterator(__result));2661 return _Pp(const_iterator(__result), const_iterator(__result));
...@@ -2824,8 +2724,8 @@ __tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p) _NOEXCEPT...@@ -2824,8 +2724,8 @@ __tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p) _NOEXCEPT
2824 __begin_node() = static_cast<__iter_pointer>(__np->__parent_);2724 __begin_node() = static_cast<__iter_pointer>(__np->__parent_);
2825 }2725 }
2826 --size();2726 --size();
2827 __tree_remove(__end_node()->__left_,2727 _VSTD::__tree_remove(__end_node()->__left_,
2828 static_cast<__node_base_pointer>(__np));2728 static_cast<__node_base_pointer>(__np));
2829 return __node_holder(__np, _Dp(__node_alloc(), true));2729 return __node_holder(__np, _Dp(__node_alloc(), true));
2830}2730}
28312731
lib/libcxx/include/algorithm+417-268
...@@ -47,16 +47,16 @@ template <class InputIterator, class Predicate>...@@ -47,16 +47,16 @@ template <class InputIterator, class Predicate>
47 find_if(InputIterator first, InputIterator last, Predicate pred);47 find_if(InputIterator first, InputIterator last, Predicate pred);
4848
49template<class InputIterator, class Predicate>49template<class InputIterator, class Predicate>
50 InputIterator // constexpr in C++2050 constexpr InputIterator // constexpr in C++20
51 find_if_not(InputIterator first, InputIterator last, Predicate pred);51 find_if_not(InputIterator first, InputIterator last, Predicate pred);
5252
53template <class ForwardIterator1, class ForwardIterator2>53template <class ForwardIterator1, class ForwardIterator2>
54 ForwardIterator1 // constexpr in C++2054 constexpr ForwardIterator1 // constexpr in C++20
55 find_end(ForwardIterator1 first1, ForwardIterator1 last1,55 find_end(ForwardIterator1 first1, ForwardIterator1 last1,
56 ForwardIterator2 first2, ForwardIterator2 last2);56 ForwardIterator2 first2, ForwardIterator2 last2);
5757
58template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>58template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
59 ForwardIterator1 // constexpr in C++2059 constexpr ForwardIterator1 // constexpr in C++20
60 find_end(ForwardIterator1 first1, ForwardIterator1 last1,60 find_end(ForwardIterator1 first1, ForwardIterator1 last1,
61 ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred);61 ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred);
6262
...@@ -185,11 +185,11 @@ template <class BidirectionalIterator1, class BidirectionalIterator2>...@@ -185,11 +185,11 @@ template <class BidirectionalIterator1, class BidirectionalIterator2>
185 BidirectionalIterator2 result);185 BidirectionalIterator2 result);
186186
187template <class ForwardIterator1, class ForwardIterator2>187template <class ForwardIterator1, class ForwardIterator2>
188 ForwardIterator2188 constexpr ForwardIterator2 // constexpr in C++20
189 swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2);189 swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2);
190190
191template <class ForwardIterator1, class ForwardIterator2>191template <class ForwardIterator1, class ForwardIterator2>
192 void192 constexpr void // constexpr in C++20
193 iter_swap(ForwardIterator1 a, ForwardIterator2 b);193 iter_swap(ForwardIterator1 a, ForwardIterator2 b);
194194
195template <class InputIterator, class OutputIterator, class UnaryOperation>195template <class InputIterator, class OutputIterator, class UnaryOperation>
...@@ -251,23 +251,23 @@ template <class InputIterator, class OutputIterator, class Predicate>...@@ -251,23 +251,23 @@ template <class InputIterator, class OutputIterator, class Predicate>
251 remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred);251 remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred);
252252
253template <class ForwardIterator>253template <class ForwardIterator>
254 ForwardIterator254 constexpr ForwardIterator // constexpr in C++20
255 unique(ForwardIterator first, ForwardIterator last);255 unique(ForwardIterator first, ForwardIterator last);
256256
257template <class ForwardIterator, class BinaryPredicate>257template <class ForwardIterator, class BinaryPredicate>
258 ForwardIterator258 constexpr ForwardIterator // constexpr in C++20
259 unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred);259 unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred);
260260
261template <class InputIterator, class OutputIterator>261template <class InputIterator, class OutputIterator>
262 OutputIterator262 constexpr OutputIterator // constexpr in C++20
263 unique_copy(InputIterator first, InputIterator last, OutputIterator result);263 unique_copy(InputIterator first, InputIterator last, OutputIterator result);
264264
265template <class InputIterator, class OutputIterator, class BinaryPredicate>265template <class InputIterator, class OutputIterator, class BinaryPredicate>
266 OutputIterator266 constexpr OutputIterator // constexpr in C++20
267 unique_copy(InputIterator first, InputIterator last, OutputIterator result, BinaryPredicate pred);267 unique_copy(InputIterator first, InputIterator last, OutputIterator result, BinaryPredicate pred);
268268
269template <class BidirectionalIterator>269template <class BidirectionalIterator>
270 void270 constexpr void // constexpr in C++20
271 reverse(BidirectionalIterator first, BidirectionalIterator last);271 reverse(BidirectionalIterator first, BidirectionalIterator last);
272272
273template <class BidirectionalIterator, class OutputIterator>273template <class BidirectionalIterator, class OutputIterator>
...@@ -275,11 +275,11 @@ template <class BidirectionalIterator, class OutputIterator>...@@ -275,11 +275,11 @@ template <class BidirectionalIterator, class OutputIterator>
275 reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result);275 reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result);
276276
277template <class ForwardIterator>277template <class ForwardIterator>
278 ForwardIterator278 constexpr ForwardIterator // constexpr in C++20
279 rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last);279 rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last);
280280
281template <class ForwardIterator, class OutputIterator>281template <class ForwardIterator, class OutputIterator>
282 OutputIterator282 constexpr OutputIterator // constexpr in C++20
283 rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, OutputIterator result);283 rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, OutputIterator result);
284284
285template <class RandomAccessIterator>285template <class RandomAccessIterator>
...@@ -301,12 +301,22 @@ template<class RandomAccessIterator, class UniformRandomNumberGenerator>...@@ -301,12 +301,22 @@ template<class RandomAccessIterator, class UniformRandomNumberGenerator>
301 void shuffle(RandomAccessIterator first, RandomAccessIterator last,301 void shuffle(RandomAccessIterator first, RandomAccessIterator last,
302 UniformRandomNumberGenerator&& g);302 UniformRandomNumberGenerator&& g);
303303
304template<class ForwardIterator>
305 constexpr ForwardIterator
306 shift_left(ForwardIterator first, ForwardIterator last,
307 typename iterator_traits<ForwardIterator>::difference_type n); // C++20
308
309template<class ForwardIterator>
310 constexpr ForwardIterator
311 shift_right(ForwardIterator first, ForwardIterator last,
312 typename iterator_traits<ForwardIterator>::difference_type n); // C++20
313
304template <class InputIterator, class Predicate>314template <class InputIterator, class Predicate>
305 constexpr bool // constexpr in C++20315 constexpr bool // constexpr in C++20
306 is_partitioned(InputIterator first, InputIterator last, Predicate pred);316 is_partitioned(InputIterator first, InputIterator last, Predicate pred);
307317
308template <class ForwardIterator, class Predicate>318template <class ForwardIterator, class Predicate>
309 ForwardIterator319 constexpr ForwardIterator // constexpr in C++20
310 partition(ForwardIterator first, ForwardIterator last, Predicate pred);320 partition(ForwardIterator first, ForwardIterator last, Predicate pred);
311321
312template <class InputIterator, class OutputIterator1,322template <class InputIterator, class OutputIterator1,
...@@ -329,7 +339,7 @@ template <class ForwardIterator>...@@ -329,7 +339,7 @@ template <class ForwardIterator>
329 is_sorted(ForwardIterator first, ForwardIterator last);339 is_sorted(ForwardIterator first, ForwardIterator last);
330340
331template <class ForwardIterator, class Compare>341template <class ForwardIterator, class Compare>
332 bool342 constexpr bool // constexpr in C++20
333 is_sorted(ForwardIterator first, ForwardIterator last, Compare comp);343 is_sorted(ForwardIterator first, ForwardIterator last, Compare comp);
334344
335template<class ForwardIterator>345template<class ForwardIterator>
...@@ -415,12 +425,12 @@ template <class ForwardIterator, class T, class Compare>...@@ -415,12 +425,12 @@ template <class ForwardIterator, class T, class Compare>
415 binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);425 binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);
416426
417template <class InputIterator1, class InputIterator2, class OutputIterator>427template <class InputIterator1, class InputIterator2, class OutputIterator>
418 OutputIterator428 constexpr OutputIterator // constexpr in C++20
419 merge(InputIterator1 first1, InputIterator1 last1,429 merge(InputIterator1 first1, InputIterator1 last1,
420 InputIterator2 first2, InputIterator2 last2, OutputIterator result);430 InputIterator2 first2, InputIterator2 last2, OutputIterator result);
421431
422template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>432template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
423 OutputIterator433 constexpr OutputIterator // constexpr in C++20
424 merge(InputIterator1 first1, InputIterator1 last1,434 merge(InputIterator1 first1, InputIterator1 last1,
425 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);435 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
426436
...@@ -441,12 +451,12 @@ template <class InputIterator1, class InputIterator2, class Compare>...@@ -441,12 +451,12 @@ template <class InputIterator1, class InputIterator2, class Compare>
441 includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp);451 includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp);
442452
443template <class InputIterator1, class InputIterator2, class OutputIterator>453template <class InputIterator1, class InputIterator2, class OutputIterator>
444 OutputIterator454 constexpr OutputIterator // constexpr in C++20
445 set_union(InputIterator1 first1, InputIterator1 last1,455 set_union(InputIterator1 first1, InputIterator1 last1,
446 InputIterator2 first2, InputIterator2 last2, OutputIterator result);456 InputIterator2 first2, InputIterator2 last2, OutputIterator result);
447457
448template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>458template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
449 OutputIterator459 constexpr OutputIterator // constexpr in C++20
450 set_union(InputIterator1 first1, InputIterator1 last1,460 set_union(InputIterator1 first1, InputIterator1 last1,
451 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);461 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
452462
...@@ -461,22 +471,22 @@ template <class InputIterator1, class InputIterator2, class OutputIterator, clas...@@ -461,22 +471,22 @@ template <class InputIterator1, class InputIterator2, class OutputIterator, clas
461 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);471 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
462472
463template <class InputIterator1, class InputIterator2, class OutputIterator>473template <class InputIterator1, class InputIterator2, class OutputIterator>
464 OutputIterator474 constexpr OutputIterator // constexpr in C++20
465 set_difference(InputIterator1 first1, InputIterator1 last1,475 set_difference(InputIterator1 first1, InputIterator1 last1,
466 InputIterator2 first2, InputIterator2 last2, OutputIterator result);476 InputIterator2 first2, InputIterator2 last2, OutputIterator result);
467477
468template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>478template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
469 OutputIterator479 constexpr OutputIterator // constexpr in C++20
470 set_difference(InputIterator1 first1, InputIterator1 last1,480 set_difference(InputIterator1 first1, InputIterator1 last1,
471 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);481 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
472482
473template <class InputIterator1, class InputIterator2, class OutputIterator>483template <class InputIterator1, class InputIterator2, class OutputIterator>
474 OutputIterator484 constexpr OutputIterator // constexpr in C++20
475 set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,485 set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,
476 InputIterator2 first2, InputIterator2 last2, OutputIterator result);486 InputIterator2 first2, InputIterator2 last2, OutputIterator result);
477487
478template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>488template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
479 OutputIterator489 constexpr OutputIterator // constexpr in C++20
480 set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,490 set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,
481 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);491 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
482492
...@@ -529,82 +539,82 @@ template <class RandomAccessIterator, class Compare>...@@ -529,82 +539,82 @@ template <class RandomAccessIterator, class Compare>
529 is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp);539 is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp);
530540
531template <class ForwardIterator>541template <class ForwardIterator>
532 ForwardIterator542 constexpr ForwardIterator // constexpr in C++14
533 min_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14543 min_element(ForwardIterator first, ForwardIterator last);
534544
535template <class ForwardIterator, class Compare>545template <class ForwardIterator, class Compare>
536 ForwardIterator546 constexpr ForwardIterator // constexpr in C++14
537 min_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14547 min_element(ForwardIterator first, ForwardIterator last, Compare comp);
538548
539template <class T>549template <class T>
540 const T&550 constexpr const T& // constexpr in C++14
541 min(const T& a, const T& b); // constexpr in C++14551 min(const T& a, const T& b);
542552
543template <class T, class Compare>553template <class T, class Compare>
544 const T&554 constexpr const T& // constexpr in C++14
545 min(const T& a, const T& b, Compare comp); // constexpr in C++14555 min(const T& a, const T& b, Compare comp);
546556
547template<class T>557template<class T>
548 T558 constexpr T // constexpr in C++14
549 min(initializer_list<T> t); // constexpr in C++14559 min(initializer_list<T> t);
550560
551template<class T, class Compare>561template<class T, class Compare>
552 T562 constexpr T // constexpr in C++14
553 min(initializer_list<T> t, Compare comp); // constexpr in C++14563 min(initializer_list<T> t, Compare comp);
554564
555template<class T>565template<class T>
556 constexpr const T& clamp( const T& v, const T& lo, const T& hi ); // C++17566 constexpr const T& clamp(const T& v, const T& lo, const T& hi); // C++17
557567
558template<class T, class Compare>568template<class T, class Compare>
559 constexpr const T& clamp( const T& v, const T& lo, const T& hi, Compare comp ); // C++17569 constexpr const T& clamp(const T& v, const T& lo, const T& hi, Compare comp); // C++17
560570
561template <class ForwardIterator>571template <class ForwardIterator>
562 ForwardIterator572 constexpr ForwardIterator // constexpr in C++14
563 max_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14573 max_element(ForwardIterator first, ForwardIterator last);
564574
565template <class ForwardIterator, class Compare>575template <class ForwardIterator, class Compare>
566 ForwardIterator576 constexpr ForwardIterator // constexpr in C++14
567 max_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14577 max_element(ForwardIterator first, ForwardIterator last, Compare comp);
568578
569template <class T>579template <class T>
570 const T&580 constexpr const T& // constexpr in C++14
571 max(const T& a, const T& b); // constexpr in C++14581 max(const T& a, const T& b);
572582
573template <class T, class Compare>583template <class T, class Compare>
574 const T&584 constexpr const T& // constexpr in C++14
575 max(const T& a, const T& b, Compare comp); // constexpr in C++14585 max(const T& a, const T& b, Compare comp);
576586
577template<class T>587template<class T>
578 T588 constexpr T // constexpr in C++14
579 max(initializer_list<T> t); // constexpr in C++14589 max(initializer_list<T> t);
580590
581template<class T, class Compare>591template<class T, class Compare>
582 T592 constexpr T // constexpr in C++14
583 max(initializer_list<T> t, Compare comp); // constexpr in C++14593 max(initializer_list<T> t, Compare comp);
584594
585template<class ForwardIterator>595template<class ForwardIterator>
586 pair<ForwardIterator, ForwardIterator>596 constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14
587 minmax_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14597 minmax_element(ForwardIterator first, ForwardIterator last);
588598
589template<class ForwardIterator, class Compare>599template<class ForwardIterator, class Compare>
590 pair<ForwardIterator, ForwardIterator>600 constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14
591 minmax_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14601 minmax_element(ForwardIterator first, ForwardIterator last, Compare comp);
592602
593template<class T>603template<class T>
594 pair<const T&, const T&>604 constexpr pair<const T&, const T&> // constexpr in C++14
595 minmax(const T& a, const T& b); // constexpr in C++14605 minmax(const T& a, const T& b);
596606
597template<class T, class Compare>607template<class T, class Compare>
598 pair<const T&, const T&>608 constexpr pair<const T&, const T&> // constexpr in C++14
599 minmax(const T& a, const T& b, Compare comp); // constexpr in C++14609 minmax(const T& a, const T& b, Compare comp);
600610
601template<class T>611template<class T>
602 pair<T, T>612 constexpr pair<T, T> // constexpr in C++14
603 minmax(initializer_list<T> t); // constexpr in C++14613 minmax(initializer_list<T> t);
604614
605template<class T, class Compare>615template<class T, class Compare>
606 pair<T, T>616 constexpr pair<T, T> // constexpr in C++14
607 minmax(initializer_list<T> t, Compare comp); // constexpr in C++14617 minmax(initializer_list<T> t, Compare comp);
608618
609template <class InputIterator1, class InputIterator2>619template <class InputIterator1, class InputIterator2>
610 constexpr bool // constexpr in C++20620 constexpr bool // constexpr in C++20
...@@ -616,19 +626,19 @@ template <class InputIterator1, class InputIterator2, class Compare>...@@ -616,19 +626,19 @@ template <class InputIterator1, class InputIterator2, class Compare>
616 InputIterator2 first2, InputIterator2 last2, Compare comp);626 InputIterator2 first2, InputIterator2 last2, Compare comp);
617627
618template <class BidirectionalIterator>628template <class BidirectionalIterator>
619 bool629 constexpr bool // constexpr in C++20
620 next_permutation(BidirectionalIterator first, BidirectionalIterator last);630 next_permutation(BidirectionalIterator first, BidirectionalIterator last);
621631
622template <class BidirectionalIterator, class Compare>632template <class BidirectionalIterator, class Compare>
623 bool633 constexpr bool // constexpr in C++20
624 next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp);634 next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp);
625635
626template <class BidirectionalIterator>636template <class BidirectionalIterator>
627 bool637 constexpr bool // constexpr in C++20
628 prev_permutation(BidirectionalIterator first, BidirectionalIterator last);638 prev_permutation(BidirectionalIterator first, BidirectionalIterator last);
629639
630template <class BidirectionalIterator, class Compare>640template <class BidirectionalIterator, class Compare>
631 bool641 constexpr bool // constexpr in C++20
632 prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp);642 prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp);
633643
634} // std644} // std
...@@ -895,7 +905,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17...@@ -895,7 +905,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
895_InputIterator905_InputIterator
896for_each_n(_InputIterator __first, _Size __orig_n, _Function __f)906for_each_n(_InputIterator __first, _Size __orig_n, _Function __f)
897{907{
898 typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;908 typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
899 _IntegralSize __n = __orig_n;909 _IntegralSize __n = __orig_n;
900 while (__n > 0)910 while (__n > 0)
901 {911 {
...@@ -1614,7 +1624,7 @@ search_n(_ForwardIterator __first, _ForwardIterator __last,...@@ -1614,7 +1624,7 @@ search_n(_ForwardIterator __first, _ForwardIterator __last,
1614 _Size __count, const _Tp& __value_, _BinaryPredicate __pred)1624 _Size __count, const _Tp& __value_, _BinaryPredicate __pred)
1615{1625{
1616 return _VSTD::__search_n<typename add_lvalue_reference<_BinaryPredicate>::type>1626 return _VSTD::__search_n<typename add_lvalue_reference<_BinaryPredicate>::type>
1617 (__first, __last, __convert_to_integral(__count), __value_, __pred,1627 (__first, __last, _VSTD::__convert_to_integral(__count), __value_, __pred,
1618 typename iterator_traits<_ForwardIterator>::iterator_category());1628 typename iterator_traits<_ForwardIterator>::iterator_category());
1619}1629}
16201630
...@@ -1625,13 +1635,13 @@ _ForwardIterator...@@ -1625,13 +1635,13 @@ _ForwardIterator
1625search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_)1635search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_)
1626{1636{
1627 typedef typename iterator_traits<_ForwardIterator>::value_type __v;1637 typedef typename iterator_traits<_ForwardIterator>::value_type __v;
1628 return _VSTD::search_n(__first, __last, __convert_to_integral(__count),1638 return _VSTD::search_n(__first, __last, _VSTD::__convert_to_integral(__count),
1629 __value_, __equal_to<__v, _Tp>());1639 __value_, __equal_to<__v, _Tp>());
1630}1640}
16311641
1632// copy1642// copy
1633template <class _Iter>1643template <class _Iter>
1634inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX171644inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
1635_Iter1645_Iter
1636__unwrap_iter(_Iter __i)1646__unwrap_iter(_Iter __i)
1637{1647{
...@@ -1639,7 +1649,7 @@ __unwrap_iter(_Iter __i)...@@ -1639,7 +1649,7 @@ __unwrap_iter(_Iter __i)
1639}1649}
16401650
1641template <class _Tp>1651template <class _Tp>
1642inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX171652inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
1643typename enable_if1653typename enable_if
1644<1654<
1645 is_trivially_copy_assignable<_Tp>::value,1655 is_trivially_copy_assignable<_Tp>::value,
...@@ -1653,7 +1663,7 @@ __unwrap_iter(move_iterator<_Tp*> __i)...@@ -1653,7 +1663,7 @@ __unwrap_iter(move_iterator<_Tp*> __i)
1653#if _LIBCPP_DEBUG_LEVEL < 21663#if _LIBCPP_DEBUG_LEVEL < 2
16541664
1655template <class _Tp>1665template <class _Tp>
1656inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG1666inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
1657typename enable_if1667typename enable_if
1658<1668<
1659 is_trivially_copy_assignable<_Tp>::value,1669 is_trivially_copy_assignable<_Tp>::value,
...@@ -1665,7 +1675,7 @@ __unwrap_iter(__wrap_iter<_Tp*> __i)...@@ -1665,7 +1675,7 @@ __unwrap_iter(__wrap_iter<_Tp*> __i)
1665}1675}
16661676
1667template <class _Tp>1677template <class _Tp>
1668inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG1678inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
1669typename enable_if1679typename enable_if
1670<1680<
1671 is_trivially_copy_assignable<_Tp>::value,1681 is_trivially_copy_assignable<_Tp>::value,
...@@ -1679,7 +1689,7 @@ __unwrap_iter(__wrap_iter<const _Tp*> __i)...@@ -1679,7 +1689,7 @@ __unwrap_iter(__wrap_iter<const _Tp*> __i)
1679#else1689#else
16801690
1681template <class _Tp>1691template <class _Tp>
1682inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG1692inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
1683typename enable_if1693typename enable_if
1684<1694<
1685 is_trivially_copy_assignable<_Tp>::value,1695 is_trivially_copy_assignable<_Tp>::value,
...@@ -1707,7 +1717,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -1707,7 +1717,7 @@ inline _LIBCPP_INLINE_VISIBILITY
1707_OutputIterator1717_OutputIterator
1708__copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)1718__copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
1709{1719{
1710 return __copy_constexpr(__first, __last, __result);1720 return _VSTD::__copy_constexpr(__first, __last, __result);
1711}1721}
17121722
1713template <class _Tp, class _Up>1723template <class _Tp, class _Up>
...@@ -1727,16 +1737,16 @@ __copy(_Tp* __first, _Tp* __last, _Up* __result)...@@ -1727,16 +1737,16 @@ __copy(_Tp* __first, _Tp* __last, _Up* __result)
1727}1737}
17281738
1729template <class _InputIterator, class _OutputIterator>1739template <class _InputIterator, class _OutputIterator>
1730inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED1740inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1731_OutputIterator1741_OutputIterator
1732copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)1742copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
1733{1743{
1734 if (__libcpp_is_constant_evaluated()) {1744 if (__libcpp_is_constant_evaluated()) {
1735 return _VSTD::__copy_constexpr(1745 return _VSTD::__copy_constexpr(
1736 __unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));1746 _VSTD::__unwrap_iter(__first), _VSTD::__unwrap_iter(__last), _VSTD::__unwrap_iter(__result));
1737 } else {1747 } else {
1738 return _VSTD::__copy(1748 return _VSTD::__copy(
1739 __unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));1749 _VSTD::__unwrap_iter(__first), _VSTD::__unwrap_iter(__last), _VSTD::__unwrap_iter(__result));
1740 }1750 }
1741}1751}
17421752
...@@ -1757,7 +1767,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -1757,7 +1767,7 @@ inline _LIBCPP_INLINE_VISIBILITY
1757_OutputIterator1767_OutputIterator
1758__copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)1768__copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
1759{1769{
1760 return __copy_backward_constexpr(__first, __last, __result);1770 return _VSTD::__copy_backward_constexpr(__first, __last, __result);
1761}1771}
17621772
1763template <class _Tp, class _Up>1773template <class _Tp, class _Up>
...@@ -1780,19 +1790,19 @@ __copy_backward(_Tp* __first, _Tp* __last, _Up* __result)...@@ -1780,19 +1790,19 @@ __copy_backward(_Tp* __first, _Tp* __last, _Up* __result)
1780}1790}
17811791
1782template <class _BidirectionalIterator1, class _BidirectionalIterator2>1792template <class _BidirectionalIterator1, class _BidirectionalIterator2>
1783inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED1793inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1784_BidirectionalIterator21794_BidirectionalIterator2
1785copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,1795copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
1786 _BidirectionalIterator2 __result)1796 _BidirectionalIterator2 __result)
1787{1797{
1788 if (__libcpp_is_constant_evaluated()) {1798 if (__libcpp_is_constant_evaluated()) {
1789 return _VSTD::__copy_backward_constexpr(__unwrap_iter(__first),1799 return _VSTD::__copy_backward_constexpr(_VSTD::__unwrap_iter(__first),
1790 __unwrap_iter(__last),1800 _VSTD::__unwrap_iter(__last),
1791 __unwrap_iter(__result));1801 _VSTD::__unwrap_iter(__result));
1792 } else {1802 } else {
1793 return _VSTD::__copy_backward(__unwrap_iter(__first),1803 return _VSTD::__copy_backward(_VSTD::__unwrap_iter(__first),
1794 __unwrap_iter(__last),1804 _VSTD::__unwrap_iter(__last),
1795 __unwrap_iter(__result));1805 _VSTD::__unwrap_iter(__result));
1796 }1806 }
1797}1807}
17981808
...@@ -1818,7 +1828,7 @@ copy_if(_InputIterator __first, _InputIterator __last,...@@ -1818,7 +1828,7 @@ copy_if(_InputIterator __first, _InputIterator __last,
1818// copy_n1828// copy_n
18191829
1820template<class _InputIterator, class _Size, class _OutputIterator>1830template<class _InputIterator, class _Size, class _OutputIterator>
1821inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED1831inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1822typename enable_if1832typename enable_if
1823<1833<
1824 __is_cpp17_input_iterator<_InputIterator>::value &&1834 __is_cpp17_input_iterator<_InputIterator>::value &&
...@@ -1827,7 +1837,7 @@ typename enable_if...@@ -1827,7 +1837,7 @@ typename enable_if
1827>::type1837>::type
1828copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)1838copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
1829{1839{
1830 typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;1840 typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
1831 _IntegralSize __n = __orig_n;1841 _IntegralSize __n = __orig_n;
1832 if (__n > 0)1842 if (__n > 0)
1833 {1843 {
...@@ -1844,7 +1854,7 @@ copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)...@@ -1844,7 +1854,7 @@ copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
1844}1854}
18451855
1846template<class _InputIterator, class _Size, class _OutputIterator>1856template<class _InputIterator, class _Size, class _OutputIterator>
1847inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED1857inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1848typename enable_if1858typename enable_if
1849<1859<
1850 __is_cpp17_random_access_iterator<_InputIterator>::value,1860 __is_cpp17_random_access_iterator<_InputIterator>::value,
...@@ -1852,25 +1862,35 @@ typename enable_if...@@ -1852,25 +1862,35 @@ typename enable_if
1852>::type1862>::type
1853copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)1863copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
1854{1864{
1855 typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;1865 typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
1856 _IntegralSize __n = __orig_n;1866 _IntegralSize __n = __orig_n;
1857 return _VSTD::copy(__first, __first + __n, __result);1867 return _VSTD::copy(__first, __first + __n, __result);
1858}1868}
18591869
1860// move1870// move
18611871
1872// __move_constexpr exists so that __move doesn't call itself when delegating to the constexpr
1873// version of __move.
1862template <class _InputIterator, class _OutputIterator>1874template <class _InputIterator, class _OutputIterator>
1863inline _LIBCPP_INLINE_VISIBILITY1875inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
1864_OutputIterator1876_OutputIterator
1865__move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)1877__move_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
1866{1878{
1867 for (; __first != __last; ++__first, (void) ++__result)1879 for (; __first != __last; ++__first, (void) ++__result)
1868 *__result = _VSTD::move(*__first);1880 *__result = _VSTD::move(*__first);
1869 return __result;1881 return __result;
1870}1882}
18711883
1884template <class _InputIterator, class _OutputIterator>
1885inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
1886_OutputIterator
1887__move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
1888{
1889 return _VSTD::__move_constexpr(__first, __last, __result);
1890}
1891
1872template <class _Tp, class _Up>1892template <class _Tp, class _Up>
1873inline _LIBCPP_INLINE_VISIBILITY1893inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
1874typename enable_if1894typename enable_if
1875<1895<
1876 is_same<typename remove_const<_Tp>::type, _Up>::value &&1896 is_same<typename remove_const<_Tp>::type, _Up>::value &&
...@@ -1879,6 +1899,8 @@ typename enable_if...@@ -1879,6 +1899,8 @@ typename enable_if
1879>::type1899>::type
1880__move(_Tp* __first, _Tp* __last, _Up* __result)1900__move(_Tp* __first, _Tp* __last, _Up* __result)
1881{1901{
1902 if (__libcpp_is_constant_evaluated())
1903 return _VSTD::__move_constexpr(__first, __last, __result);
1882 const size_t __n = static_cast<size_t>(__last - __first);1904 const size_t __n = static_cast<size_t>(__last - __first);
1883 if (__n > 0)1905 if (__n > 0)
1884 _VSTD::memmove(__result, __first, __n * sizeof(_Up));1906 _VSTD::memmove(__result, __first, __n * sizeof(_Up));
...@@ -1886,27 +1908,37 @@ __move(_Tp* __first, _Tp* __last, _Up* __result)...@@ -1886,27 +1908,37 @@ __move(_Tp* __first, _Tp* __last, _Up* __result)
1886}1908}
18871909
1888template <class _InputIterator, class _OutputIterator>1910template <class _InputIterator, class _OutputIterator>
1889inline _LIBCPP_INLINE_VISIBILITY1911inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1890_OutputIterator1912_OutputIterator
1891move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)1913move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
1892{1914{
1893 return _VSTD::__move(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));1915 return _VSTD::__move(_VSTD::__unwrap_iter(__first), _VSTD::__unwrap_iter(__last), _VSTD::__unwrap_iter(__result));
1894}1916}
18951917
1896// move_backward1918// move_backward
18971919
1920// __move_backward_constexpr exists so that __move_backward doesn't call itself when delegating to
1921// the constexpr version of __move_backward.
1898template <class _InputIterator, class _OutputIterator>1922template <class _InputIterator, class _OutputIterator>
1899inline _LIBCPP_INLINE_VISIBILITY1923inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
1900_OutputIterator1924_OutputIterator
1901__move_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result)1925__move_backward_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
1902{1926{
1903 while (__first != __last)1927 while (__first != __last)
1904 *--__result = _VSTD::move(*--__last);1928 *--__result = _VSTD::move(*--__last);
1905 return __result;1929 return __result;
1906}1930}
19071931
1932template <class _InputIterator, class _OutputIterator>
1933inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
1934_OutputIterator
1935__move_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
1936{
1937 return _VSTD::__move_backward_constexpr(__first, __last, __result);
1938}
1939
1908template <class _Tp, class _Up>1940template <class _Tp, class _Up>
1909inline _LIBCPP_INLINE_VISIBILITY1941inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
1910typename enable_if1942typename enable_if
1911<1943<
1912 is_same<typename remove_const<_Tp>::type, _Up>::value &&1944 is_same<typename remove_const<_Tp>::type, _Up>::value &&
...@@ -1915,6 +1947,8 @@ typename enable_if...@@ -1915,6 +1947,8 @@ typename enable_if
1915>::type1947>::type
1916__move_backward(_Tp* __first, _Tp* __last, _Up* __result)1948__move_backward(_Tp* __first, _Tp* __last, _Up* __result)
1917{1949{
1950 if (__libcpp_is_constant_evaluated())
1951 return _VSTD::__move_backward_constexpr(__first, __last, __result);
1918 const size_t __n = static_cast<size_t>(__last - __first);1952 const size_t __n = static_cast<size_t>(__last - __first);
1919 if (__n > 0)1953 if (__n > 0)
1920 {1954 {
...@@ -1925,12 +1959,12 @@ __move_backward(_Tp* __first, _Tp* __last, _Up* __result)...@@ -1925,12 +1959,12 @@ __move_backward(_Tp* __first, _Tp* __last, _Up* __result)
1925}1959}
19261960
1927template <class _BidirectionalIterator1, class _BidirectionalIterator2>1961template <class _BidirectionalIterator1, class _BidirectionalIterator2>
1928inline _LIBCPP_INLINE_VISIBILITY1962inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1929_BidirectionalIterator21963_BidirectionalIterator2
1930move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,1964move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
1931 _BidirectionalIterator2 __result)1965 _BidirectionalIterator2 __result)
1932{1966{
1933 return _VSTD::__move_backward(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));1967 return _VSTD::__move_backward(_VSTD::__unwrap_iter(__first), _VSTD::__unwrap_iter(__last), _VSTD::__unwrap_iter(__result));
1934}1968}
19351969
1936// iter_swap1970// iter_swap
...@@ -2033,7 +2067,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17...@@ -2033,7 +2067,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2033_OutputIterator2067_OutputIterator
2034fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)2068fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)
2035{2069{
2036 return _VSTD::__fill_n(__first, __convert_to_integral(__n), __value_);2070 return _VSTD::__fill_n(__first, _VSTD::__convert_to_integral(__n), __value_);
2037}2071}
20382072
2039// fill2073// fill
...@@ -2081,7 +2115,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17...@@ -2081,7 +2115,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2081_OutputIterator2115_OutputIterator
2082generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen)2116generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen)
2083{2117{
2084 typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;2118 typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
2085 _IntegralSize __n = __orig_n;2119 _IntegralSize __n = __orig_n;
2086 for (; __n > 0; ++__first, (void) --__n)2120 for (; __n > 0; ++__first, (void) --__n)
2087 *__first = __gen();2121 *__first = __gen();
...@@ -2287,7 +2321,7 @@ unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __res...@@ -2287,7 +2321,7 @@ unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __res
2287// reverse2321// reverse
22882322
2289template <class _BidirectionalIterator>2323template <class _BidirectionalIterator>
2290inline _LIBCPP_INLINE_VISIBILITY2324inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2291void2325void
2292__reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirectional_iterator_tag)2326__reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirectional_iterator_tag)
2293{2327{
...@@ -2301,7 +2335,7 @@ __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirec...@@ -2301,7 +2335,7 @@ __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirec
2301}2335}
23022336
2303template <class _RandomAccessIterator>2337template <class _RandomAccessIterator>
2304inline _LIBCPP_INLINE_VISIBILITY2338inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2305void2339void
2306__reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag)2340__reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag)
2307{2341{
...@@ -2311,7 +2345,7 @@ __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_ac...@@ -2311,7 +2345,7 @@ __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_ac
2311}2345}
23122346
2313template <class _BidirectionalIterator>2347template <class _BidirectionalIterator>
2314inline _LIBCPP_INLINE_VISIBILITY2348inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2315void2349void
2316reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)2350reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
2317{2351{
...@@ -2333,7 +2367,7 @@ reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _Out...@@ -2333,7 +2367,7 @@ reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _Out
2333// rotate2367// rotate
23342368
2335template <class _ForwardIterator>2369template <class _ForwardIterator>
2336_ForwardIterator2370_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator
2337__rotate_left(_ForwardIterator __first, _ForwardIterator __last)2371__rotate_left(_ForwardIterator __first, _ForwardIterator __last)
2338{2372{
2339 typedef typename iterator_traits<_ForwardIterator>::value_type value_type;2373 typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
...@@ -2344,7 +2378,7 @@ __rotate_left(_ForwardIterator __first, _ForwardIterator __last)...@@ -2344,7 +2378,7 @@ __rotate_left(_ForwardIterator __first, _ForwardIterator __last)
2344}2378}
23452379
2346template <class _BidirectionalIterator>2380template <class _BidirectionalIterator>
2347_BidirectionalIterator2381_LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator
2348__rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last)2382__rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last)
2349{2383{
2350 typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;2384 typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
...@@ -2356,7 +2390,7 @@ __rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last)...@@ -2356,7 +2390,7 @@ __rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last)
2356}2390}
23572391
2358template <class _ForwardIterator>2392template <class _ForwardIterator>
2359_ForwardIterator2393_LIBCPP_CONSTEXPR_AFTER_CXX14 _ForwardIterator
2360__rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)2394__rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
2361{2395{
2362 _ForwardIterator __i = __middle;2396 _ForwardIterator __i = __middle;
...@@ -2392,7 +2426,7 @@ __rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIt...@@ -2392,7 +2426,7 @@ __rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIt
23922426
2393template<typename _Integral>2427template<typename _Integral>
2394inline _LIBCPP_INLINE_VISIBILITY2428inline _LIBCPP_INLINE_VISIBILITY
2395_Integral2429_LIBCPP_CONSTEXPR_AFTER_CXX14 _Integral
2396__algo_gcd(_Integral __x, _Integral __y)2430__algo_gcd(_Integral __x, _Integral __y)
2397{2431{
2398 do2432 do
...@@ -2405,7 +2439,7 @@ __algo_gcd(_Integral __x, _Integral __y)...@@ -2405,7 +2439,7 @@ __algo_gcd(_Integral __x, _Integral __y)
2405}2439}
24062440
2407template<typename _RandomAccessIterator>2441template<typename _RandomAccessIterator>
2408_RandomAccessIterator2442_LIBCPP_CONSTEXPR_AFTER_CXX14 _RandomAccessIterator
2409__rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)2443__rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
2410{2444{
2411 typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;2445 typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
...@@ -2441,7 +2475,7 @@ __rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _Ran...@@ -2441,7 +2475,7 @@ __rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _Ran
24412475
2442template <class _ForwardIterator>2476template <class _ForwardIterator>
2443inline _LIBCPP_INLINE_VISIBILITY2477inline _LIBCPP_INLINE_VISIBILITY
2444_ForwardIterator2478_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator
2445__rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,2479__rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
2446 _VSTD::forward_iterator_tag)2480 _VSTD::forward_iterator_tag)
2447{2481{
...@@ -2456,7 +2490,7 @@ __rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator _...@@ -2456,7 +2490,7 @@ __rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator _
24562490
2457template <class _BidirectionalIterator>2491template <class _BidirectionalIterator>
2458inline _LIBCPP_INLINE_VISIBILITY2492inline _LIBCPP_INLINE_VISIBILITY
2459_BidirectionalIterator2493_LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator
2460__rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,2494__rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
2461 _VSTD::bidirectional_iterator_tag)2495 _VSTD::bidirectional_iterator_tag)
2462{2496{
...@@ -2473,7 +2507,7 @@ __rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _Bidir...@@ -2473,7 +2507,7 @@ __rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _Bidir
24732507
2474template <class _RandomAccessIterator>2508template <class _RandomAccessIterator>
2475inline _LIBCPP_INLINE_VISIBILITY2509inline _LIBCPP_INLINE_VISIBILITY
2476_RandomAccessIterator2510_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator
2477__rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,2511__rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
2478 _VSTD::random_access_iterator_tag)2512 _VSTD::random_access_iterator_tag)
2479{2513{
...@@ -2491,7 +2525,7 @@ __rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomA...@@ -2491,7 +2525,7 @@ __rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomA
24912525
2492template <class _ForwardIterator>2526template <class _ForwardIterator>
2493inline _LIBCPP_INLINE_VISIBILITY2527inline _LIBCPP_INLINE_VISIBILITY
2494_ForwardIterator2528_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
2495rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)2529rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
2496{2530{
2497 if (__first == __middle)2531 if (__first == __middle)
...@@ -2505,7 +2539,7 @@ rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __l...@@ -2505,7 +2539,7 @@ rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __l
2505// rotate_copy2539// rotate_copy
25062540
2507template <class _ForwardIterator, class _OutputIterator>2541template <class _ForwardIterator, class _OutputIterator>
2508inline _LIBCPP_INLINE_VISIBILITY2542inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2509_OutputIterator2543_OutputIterator
2510rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIterator __result)2544rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIterator __result)
2511{2545{
...@@ -2684,12 +2718,12 @@ clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi)...@@ -2684,12 +2718,12 @@ clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi)
26842718
2685template <class _ForwardIterator, class _Compare>2719template <class _ForwardIterator, class _Compare>
2686_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX112720_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX11
2687std::pair<_ForwardIterator, _ForwardIterator>2721pair<_ForwardIterator, _ForwardIterator>
2688minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)2722minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
2689{2723{
2690 static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,2724 static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
2691 "std::minmax_element requires a ForwardIterator");2725 "std::minmax_element requires a ForwardIterator");
2692 std::pair<_ForwardIterator, _ForwardIterator> __result(__first, __first);2726 pair<_ForwardIterator, _ForwardIterator> __result(__first, __first);
2693 if (__first != __last)2727 if (__first != __last)
2694 {2728 {
2695 if (++__first != __last)2729 if (++__first != __last)
...@@ -2735,7 +2769,7 @@ minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __com...@@ -2735,7 +2769,7 @@ minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __com
2735template <class _ForwardIterator>2769template <class _ForwardIterator>
2736_LIBCPP_NODISCARD_EXT inline2770_LIBCPP_NODISCARD_EXT inline
2737_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX112771_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
2738std::pair<_ForwardIterator, _ForwardIterator>2772pair<_ForwardIterator, _ForwardIterator>
2739minmax_element(_ForwardIterator __first, _ForwardIterator __last)2773minmax_element(_ForwardIterator __first, _ForwardIterator __last)
2740{2774{
2741 return _VSTD::minmax_element(__first, __last,2775 return _VSTD::minmax_element(__first, __last,
...@@ -2774,7 +2808,7 @@ minmax(initializer_list<_Tp> __t, _Compare __comp)...@@ -2774,7 +2808,7 @@ minmax(initializer_list<_Tp> __t, _Compare __comp)
2774 typedef typename initializer_list<_Tp>::const_iterator _Iter;2808 typedef typename initializer_list<_Tp>::const_iterator _Iter;
2775 _Iter __first = __t.begin();2809 _Iter __first = __t.begin();
2776 _Iter __last = __t.end();2810 _Iter __last = __t.end();
2777 std::pair<_Tp, _Tp> __result(*__first, *__first);2811 pair<_Tp, _Tp> __result(*__first, *__first);
27782812
2779 ++__first;2813 ++__first;
2780 if (__t.size() % 2 == 0)2814 if (__t.size() % 2 == 0)
...@@ -3005,9 +3039,17 @@ private:...@@ -3005,9 +3039,17 @@ private:
30053039
3006public:3040public:
3007 // constructors and reset functions3041 // constructors and reset functions
3008 explicit uniform_int_distribution(result_type __a = 0,3042#ifndef _LIBCPP_CXX03_LANG
3009 result_type __b = numeric_limits<result_type>::max())3043 uniform_int_distribution() : uniform_int_distribution(0) {}
3044 explicit uniform_int_distribution(
3045 result_type __a, result_type __b = numeric_limits<result_type>::max())
3046 : __p_(param_type(__a, __b)) {}
3047#else
3048 explicit uniform_int_distribution(
3049 result_type __a = 0,
3050 result_type __b = numeric_limits<result_type>::max())
3010 : __p_(param_type(__a, __b)) {}3051 : __p_(param_type(__a, __b)) {}
3052#endif
3011 explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {}3053 explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {}
3012 void reset() {}3054 void reset() {}
30133055
...@@ -3050,7 +3092,7 @@ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK...@@ -3050,7 +3092,7 @@ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
3050 if (_Rp == 0)3092 if (_Rp == 0)
3051 return static_cast<result_type>(_Eng(__g, _Dt)());3093 return static_cast<result_type>(_Eng(__g, _Dt)());
3052 size_t __w = _Dt - __libcpp_clz(_Rp) - 1;3094 size_t __w = _Dt - __libcpp_clz(_Rp) - 1;
3053 if ((_Rp & (std::numeric_limits<_UIntType>::max() >> (_Dt - __w))) != 0)3095 if ((_Rp & (numeric_limits<_UIntType>::max() >> (_Dt - __w))) != 0)
3054 ++__w;3096 ++__w;
3055 _Eng __e(__g, __w);3097 _Eng __e(__g, __w);
3056 _UIntType __u;3098 _UIntType __u;
...@@ -3227,6 +3269,111 @@ template<class _RandomAccessIterator, class _UniformRandomNumberGenerator>...@@ -3227,6 +3269,111 @@ template<class _RandomAccessIterator, class _UniformRandomNumberGenerator>
3227 }3269 }
3228}3270}
32293271
3272#if _LIBCPP_STD_VER > 17
3273
3274// shift_left, shift_right
3275
3276template <class _ForwardIterator>
3277inline _LIBCPP_INLINE_VISIBILITY constexpr
3278_ForwardIterator
3279shift_left(_ForwardIterator __first, _ForwardIterator __last,
3280 typename iterator_traits<_ForwardIterator>::difference_type __n)
3281{
3282 if (__n == 0) {
3283 return __last;
3284 }
3285
3286 _ForwardIterator __m = __first;
3287 if constexpr (__is_cpp17_random_access_iterator<_ForwardIterator>::value) {
3288 if (__n >= __last - __first) {
3289 return __first;
3290 }
3291 __m += __n;
3292 } else {
3293 for (; __n > 0; --__n) {
3294 if (__m == __last) {
3295 return __first;
3296 }
3297 ++__m;
3298 }
3299 }
3300 return _VSTD::move(__m, __last, __first);
3301}
3302
3303template <class _ForwardIterator>
3304inline _LIBCPP_INLINE_VISIBILITY constexpr
3305_ForwardIterator
3306shift_right(_ForwardIterator __first, _ForwardIterator __last,
3307 typename iterator_traits<_ForwardIterator>::difference_type __n)
3308{
3309 if (__n == 0) {
3310 return __first;
3311 }
3312
3313 if constexpr (__is_cpp17_random_access_iterator<_ForwardIterator>::value) {
3314 decltype(__n) __d = __last - __first;
3315 if (__n >= __d) {
3316 return __last;
3317 }
3318 _ForwardIterator __m = __first + (__d - __n);
3319 return _VSTD::move_backward(__first, __m, __last);
3320 } else if constexpr (__is_cpp17_bidirectional_iterator<_ForwardIterator>::value) {
3321 _ForwardIterator __m = __last;
3322 for (; __n > 0; --__n) {
3323 if (__m == __first) {
3324 return __last;
3325 }
3326 --__m;
3327 }
3328 return _VSTD::move_backward(__first, __m, __last);
3329 } else {
3330 _ForwardIterator __ret = __first;
3331 for (; __n > 0; --__n) {
3332 if (__ret == __last) {
3333 return __last;
3334 }
3335 ++__ret;
3336 }
3337
3338 // We have an __n-element scratch space from __first to __ret.
3339 // Slide an __n-element window [__trail, __lead) from left to right.
3340 // We're essentially doing swap_ranges(__first, __ret, __trail, __lead)
3341 // over and over; but once __lead reaches __last we needn't bother
3342 // to save the values of elements [__trail, __last).
3343
3344 auto __trail = __first;
3345 auto __lead = __ret;
3346 while (__trail != __ret) {
3347 if (__lead == __last) {
3348 _VSTD::move(__first, __trail, __ret);
3349 return __ret;
3350 }
3351 ++__trail;
3352 ++__lead;
3353 }
3354
3355 _ForwardIterator __mid = __first;
3356 while (true) {
3357 if (__lead == __last) {
3358 __trail = _VSTD::move(__mid, __ret, __trail);
3359 _VSTD::move(__first, __mid, __trail);
3360 return __ret;
3361 }
3362 swap(*__mid, *__trail);
3363 ++__mid;
3364 ++__trail;
3365 ++__lead;
3366 if (__mid == __ret) {
3367 __mid = __first;
3368 }
3369 }
3370 }
3371}
3372
3373#endif // _LIBCPP_STD_VER > 17
3374
3375// is_partitioned
3376
3230template <class _InputIterator, class _Predicate>3377template <class _InputIterator, class _Predicate>
3231_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool3378_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
3232is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred)3379is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred)
...@@ -3246,7 +3393,7 @@ is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred)...@@ -3246,7 +3393,7 @@ is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred)
3246// partition3393// partition
32473394
3248template <class _Predicate, class _ForwardIterator>3395template <class _Predicate, class _ForwardIterator>
3249_ForwardIterator3396_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
3250__partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, forward_iterator_tag)3397__partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, forward_iterator_tag)
3251{3398{
3252 while (true)3399 while (true)
...@@ -3269,7 +3416,7 @@ __partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred...@@ -3269,7 +3416,7 @@ __partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred
3269}3416}
32703417
3271template <class _Predicate, class _BidirectionalIterator>3418template <class _Predicate, class _BidirectionalIterator>
3272_BidirectionalIterator3419_LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator
3273__partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,3420__partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,
3274 bidirectional_iterator_tag)3421 bidirectional_iterator_tag)
3275{3422{
...@@ -3294,7 +3441,7 @@ __partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Pred...@@ -3294,7 +3441,7 @@ __partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Pred
3294}3441}
32953442
3296template <class _ForwardIterator, class _Predicate>3443template <class _ForwardIterator, class _Predicate>
3297inline _LIBCPP_INLINE_VISIBILITY3444inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3298_ForwardIterator3445_ForwardIterator
3299partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)3446partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
3300{3447{
...@@ -3380,8 +3527,8 @@ __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate...@@ -3380,8 +3527,8 @@ __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate
3380 // Move the falses into the temporary buffer, and the trues to the front of the line3527 // Move the falses into the temporary buffer, and the trues to the front of the line
3381 // Update __first to always point to the end of the trues3528 // Update __first to always point to the end of the trues
3382 value_type* __t = __p.first;3529 value_type* __t = __p.first;
3383 ::new(__t) value_type(_VSTD::move(*__first));3530 ::new ((void*)__t) value_type(_VSTD::move(*__first));
3384 __d.__incr((value_type*)0);3531 __d.template __incr<value_type>();
3385 ++__t;3532 ++__t;
3386 _ForwardIterator __i = __first;3533 _ForwardIterator __i = __first;
3387 while (++__i != __last)3534 while (++__i != __last)
...@@ -3393,8 +3540,8 @@ __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate...@@ -3393,8 +3540,8 @@ __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate
3393 }3540 }
3394 else3541 else
3395 {3542 {
3396 ::new(__t) value_type(_VSTD::move(*__i));3543 ::new ((void*)__t) value_type(_VSTD::move(*__i));
3397 __d.__incr((value_type*)0);3544 __d.template __incr<value_type>();
3398 ++__t;3545 ++__t;
3399 }3546 }
3400 }3547 }
...@@ -3415,7 +3562,7 @@ __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate...@@ -3415,7 +3562,7 @@ __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate
3415 // F?????????????????3562 // F?????????????????
3416 // f m l3563 // f m l
3417 typedef typename add_lvalue_reference<_Predicate>::type _PredRef;3564 typedef typename add_lvalue_reference<_Predicate>::type _PredRef;
3418 _ForwardIterator __first_false = __stable_partition<_PredRef>(__first, __m, __pred, __len2, __p, __fit);3565 _ForwardIterator __first_false = _VSTD::__stable_partition<_PredRef>(__first, __m, __pred, __len2, __p, __fit);
3419 // TTTFFFFF??????????3566 // TTTFFFFF??????????
3420 // f ff m l3567 // f ff m l
3421 // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true3568 // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true
...@@ -3430,7 +3577,7 @@ __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate...@@ -3430,7 +3577,7 @@ __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate
3430 }3577 }
3431 // TTTFFFFFTTTF??????3578 // TTTFFFFFTTTF??????
3432 // f ff m m1 l3579 // f ff m m1 l
3433 __second_false = __stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __fit);3580 __second_false = _VSTD::__stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __fit);
3434__second_half_done:3581__second_half_done:
3435 // TTTFFFFFTTTTTFFFFF3582 // TTTFFFFFTTTTTFFFFF
3436 // f ff m sf l3583 // f ff m sf l
...@@ -3472,7 +3619,7 @@ __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate...@@ -3472,7 +3619,7 @@ __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate
3472 __p = _VSTD::get_temporary_buffer<value_type>(__len);3619 __p = _VSTD::get_temporary_buffer<value_type>(__len);
3473 __h.reset(__p.first);3620 __h.reset(__p.first);
3474 }3621 }
3475 return __stable_partition<typename add_lvalue_reference<_Predicate>::type>3622 return _VSTD::__stable_partition<typename add_lvalue_reference<_Predicate>::type>
3476 (__first, __last, __pred, __len, __p, forward_iterator_tag());3623 (__first, __last, __pred, __len, __p, forward_iterator_tag());
3477}3624}
34783625
...@@ -3510,8 +3657,8 @@ __stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last...@@ -3510,8 +3657,8 @@ __stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last
3510 // Move the falses into the temporary buffer, and the trues to the front of the line3657 // Move the falses into the temporary buffer, and the trues to the front of the line
3511 // Update __first to always point to the end of the trues3658 // Update __first to always point to the end of the trues
3512 value_type* __t = __p.first;3659 value_type* __t = __p.first;
3513 ::new(__t) value_type(_VSTD::move(*__first));3660 ::new ((void*)__t) value_type(_VSTD::move(*__first));
3514 __d.__incr((value_type*)0);3661 __d.template __incr<value_type>();
3515 ++__t;3662 ++__t;
3516 _BidirectionalIterator __i = __first;3663 _BidirectionalIterator __i = __first;
3517 while (++__i != __last)3664 while (++__i != __last)
...@@ -3523,8 +3670,8 @@ __stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last...@@ -3523,8 +3670,8 @@ __stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last
3523 }3670 }
3524 else3671 else
3525 {3672 {
3526 ::new(__t) value_type(_VSTD::move(*__i));3673 ::new ((void*)__t) value_type(_VSTD::move(*__i));
3527 __d.__incr((value_type*)0);3674 __d.template __incr<value_type>();
3528 ++__t;3675 ++__t;
3529 }3676 }
3530 }3677 }
...@@ -3558,7 +3705,7 @@ __stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last...@@ -3558,7 +3705,7 @@ __stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last
3558 // F???TFFF?????????T3705 // F???TFFF?????????T
3559 // f m1 m l3706 // f m1 m l
3560 typedef typename add_lvalue_reference<_Predicate>::type _PredRef;3707 typedef typename add_lvalue_reference<_Predicate>::type _PredRef;
3561 __first_false = __stable_partition<_PredRef>(__first, __m1, __pred, __len_half, __p, __bit);3708 __first_false = _VSTD::__stable_partition<_PredRef>(__first, __m1, __pred, __len_half, __p, __bit);
3562__first_half_done:3709__first_half_done:
3563 // TTTFFFFF?????????T3710 // TTTFFFFF?????????T
3564 // f ff m l3711 // f ff m l
...@@ -3575,7 +3722,7 @@ __first_half_done:...@@ -3575,7 +3722,7 @@ __first_half_done:
3575 }3722 }
3576 // TTTFFFFFTTTF?????T3723 // TTTFFFFFTTTF?????T
3577 // f ff m m1 l3724 // f ff m m1 l
3578 __second_false = __stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __bit);3725 __second_false = _VSTD::__stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __bit);
3579__second_half_done:3726__second_half_done:
3580 // TTTFFFFFTTTTTFFFFF3727 // TTTFFFFFTTTTTFFFFF
3581 // f ff m sf l3728 // f ff m sf l
...@@ -3620,7 +3767,7 @@ __stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last...@@ -3620,7 +3767,7 @@ __stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last
3620 __p = _VSTD::get_temporary_buffer<value_type>(__len);3767 __p = _VSTD::get_temporary_buffer<value_type>(__len);
3621 __h.reset(__p.first);3768 __h.reset(__p.first);
3622 }3769 }
3623 return __stable_partition<typename add_lvalue_reference<_Predicate>::type>3770 return _VSTD::__stable_partition<typename add_lvalue_reference<_Predicate>::type>
3624 (__first, __last, __pred, __len, __p, bidirectional_iterator_tag());3771 (__first, __last, __pred, __len, __p, bidirectional_iterator_tag());
3625}3772}
36263773
...@@ -3629,7 +3776,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -3629,7 +3776,7 @@ inline _LIBCPP_INLINE_VISIBILITY
3629_ForwardIterator3776_ForwardIterator
3630stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)3777stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
3631{3778{
3632 return __stable_partition<typename add_lvalue_reference<_Predicate>::type>3779 return _VSTD::__stable_partition<typename add_lvalue_reference<_Predicate>::type>
3633 (__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category());3780 (__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category());
3634}3781}
36353782
...@@ -3727,7 +3874,7 @@ unsigned...@@ -3727,7 +3874,7 @@ unsigned
3727__sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,3874__sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
3728 _ForwardIterator __x4, _Compare __c)3875 _ForwardIterator __x4, _Compare __c)
3729{3876{
3730 unsigned __r = __sort3<_Compare>(__x1, __x2, __x3, __c);3877 unsigned __r = _VSTD::__sort3<_Compare>(__x1, __x2, __x3, __c);
3731 if (__c(*__x4, *__x3))3878 if (__c(*__x4, *__x3))
3732 {3879 {
3733 swap(*__x3, *__x4);3880 swap(*__x3, *__x4);
...@@ -3754,7 +3901,7 @@ unsigned...@@ -3754,7 +3901,7 @@ unsigned
3754__sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,3901__sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
3755 _ForwardIterator __x4, _ForwardIterator __x5, _Compare __c)3902 _ForwardIterator __x4, _ForwardIterator __x5, _Compare __c)
3756{3903{
3757 unsigned __r = __sort4<_Compare>(__x1, __x2, __x3, __x4, __c);3904 unsigned __r = _VSTD::__sort4<_Compare>(__x1, __x2, __x3, __x4, __c);
3758 if (__c(*__x5, *__x4))3905 if (__c(*__x5, *__x4))
3759 {3906 {
3760 swap(*__x4, *__x5);3907 swap(*__x4, *__x5);
...@@ -3779,14 +3926,14 @@ __sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,...@@ -3779,14 +3926,14 @@ __sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
3779}3926}
37803927
3781// Assumes size > 03928// Assumes size > 0
3782template <class _Compare, class _BirdirectionalIterator>3929template <class _Compare, class _BidirectionalIterator>
3783void3930void
3784__selection_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last, _Compare __comp)3931__selection_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
3785{3932{
3786 _BirdirectionalIterator __lm1 = __last;3933 _BidirectionalIterator __lm1 = __last;
3787 for (--__lm1; __first != __lm1; ++__first)3934 for (--__lm1; __first != __lm1; ++__first)
3788 {3935 {
3789 _BirdirectionalIterator __i = _VSTD::min_element<_BirdirectionalIterator,3936 _BidirectionalIterator __i = _VSTD::min_element<_BidirectionalIterator,
3790 typename add_lvalue_reference<_Compare>::type>3937 typename add_lvalue_reference<_Compare>::type>
3791 (__first, __last, __comp);3938 (__first, __last, __comp);
3792 if (__i != __first)3939 if (__i != __first)
...@@ -3794,19 +3941,19 @@ __selection_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last...@@ -3794,19 +3941,19 @@ __selection_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last
3794 }3941 }
3795}3942}
37963943
3797template <class _Compare, class _BirdirectionalIterator>3944template <class _Compare, class _BidirectionalIterator>
3798void3945void
3799__insertion_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last, _Compare __comp)3946__insertion_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
3800{3947{
3801 typedef typename iterator_traits<_BirdirectionalIterator>::value_type value_type;3948 typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
3802 if (__first != __last)3949 if (__first != __last)
3803 {3950 {
3804 _BirdirectionalIterator __i = __first;3951 _BidirectionalIterator __i = __first;
3805 for (++__i; __i != __last; ++__i)3952 for (++__i; __i != __last; ++__i)
3806 {3953 {
3807 _BirdirectionalIterator __j = __i;3954 _BidirectionalIterator __j = __i;
3808 value_type __t(_VSTD::move(*__j));3955 value_type __t(_VSTD::move(*__j));
3809 for (_BirdirectionalIterator __k = __i; __k != __first && __comp(__t, *--__k); --__j)3956 for (_BidirectionalIterator __k = __i; __k != __first && __comp(__t, *--__k); --__j)
3810 *__j = _VSTD::move(*__k);3957 *__j = _VSTD::move(*__k);
3811 *__j = _VSTD::move(__t);3958 *__j = _VSTD::move(__t);
3812 }3959 }
...@@ -3819,7 +3966,7 @@ __insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __last,...@@ -3819,7 +3966,7 @@ __insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __last,
3819{3966{
3820 typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;3967 typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
3821 _RandomAccessIterator __j = __first+2;3968 _RandomAccessIterator __j = __first+2;
3822 __sort3<_Compare>(__first, __first+1, __j, __comp);3969 _VSTD::__sort3<_Compare>(__first, __first+1, __j, __comp);
3823 for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)3970 for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)
3824 {3971 {
3825 if (__comp(*__i, *__j))3972 if (__comp(*__i, *__j))
...@@ -3863,7 +4010,7 @@ __insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator...@@ -3863,7 +4010,7 @@ __insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator
3863 }4010 }
3864 typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;4011 typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
3865 _RandomAccessIterator __j = __first+2;4012 _RandomAccessIterator __j = __first+2;
3866 __sort3<_Compare>(__first, __first+1, __j, __comp);4013 _VSTD::__sort3<_Compare>(__first, __first+1, __j, __comp);
3867 const unsigned __limit = 8;4014 const unsigned __limit = 8;
3868 unsigned __count = 0;4015 unsigned __count = 0;
3869 for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)4016 for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)
...@@ -3887,35 +4034,35 @@ __insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator...@@ -3887,35 +4034,35 @@ __insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator
3887 return true;4034 return true;
3888}4035}
38894036
3890template <class _Compare, class _BirdirectionalIterator>4037template <class _Compare, class _BidirectionalIterator>
3891void4038void
3892__insertion_sort_move(_BirdirectionalIterator __first1, _BirdirectionalIterator __last1,4039__insertion_sort_move(_BidirectionalIterator __first1, _BidirectionalIterator __last1,
3893 typename iterator_traits<_BirdirectionalIterator>::value_type* __first2, _Compare __comp)4040 typename iterator_traits<_BidirectionalIterator>::value_type* __first2, _Compare __comp)
3894{4041{
3895 typedef typename iterator_traits<_BirdirectionalIterator>::value_type value_type;4042 typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
3896 if (__first1 != __last1)4043 if (__first1 != __last1)
3897 {4044 {
3898 __destruct_n __d(0);4045 __destruct_n __d(0);
3899 unique_ptr<value_type, __destruct_n&> __h(__first2, __d);4046 unique_ptr<value_type, __destruct_n&> __h(__first2, __d);
3900 value_type* __last2 = __first2;4047 value_type* __last2 = __first2;
3901 ::new(__last2) value_type(_VSTD::move(*__first1));4048 ::new ((void*)__last2) value_type(_VSTD::move(*__first1));
3902 __d.__incr((value_type*)0);4049 __d.template __incr<value_type>();
3903 for (++__last2; ++__first1 != __last1; ++__last2)4050 for (++__last2; ++__first1 != __last1; ++__last2)
3904 {4051 {
3905 value_type* __j2 = __last2;4052 value_type* __j2 = __last2;
3906 value_type* __i2 = __j2;4053 value_type* __i2 = __j2;
3907 if (__comp(*__first1, *--__i2))4054 if (__comp(*__first1, *--__i2))
3908 {4055 {
3909 ::new(__j2) value_type(_VSTD::move(*__i2));4056 ::new ((void*)__j2) value_type(_VSTD::move(*__i2));
3910 __d.__incr((value_type*)0);4057 __d.template __incr<value_type>();
3911 for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2)4058 for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2)
3912 *__j2 = _VSTD::move(*__i2);4059 *__j2 = _VSTD::move(*__i2);
3913 *__j2 = _VSTD::move(*__first1);4060 *__j2 = _VSTD::move(*__first1);
3914 }4061 }
3915 else4062 else
3916 {4063 {
3917 ::new(__j2) value_type(_VSTD::move(*__first1));4064 ::new ((void*)__j2) value_type(_VSTD::move(*__first1));
3918 __d.__incr((value_type*)0);4065 __d.template __incr<value_type>();
3919 }4066 }
3920 }4067 }
3921 __h.release();4068 __h.release();
...@@ -4032,7 +4179,7 @@ __sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __c...@@ -4032,7 +4179,7 @@ __sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __c
4032 ++__i;4179 ++__i;
4033 }4180 }
4034 // [__first, __i) == *__first and *__first < [__i, __last)4181 // [__first, __i) == *__first and *__first < [__i, __last)
4035 // The first part is sorted, sort the secod part4182 // The first part is sorted, sort the second part
4036 // _VSTD::__sort<_Compare>(__i, __last, __comp);4183 // _VSTD::__sort<_Compare>(__i, __last, __comp);
4037 __first = __i;4184 __first = __i;
4038 goto __restart;4185 goto __restart;
...@@ -4138,7 +4285,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -4138,7 +4285,7 @@ inline _LIBCPP_INLINE_VISIBILITY
4138void4285void
4139sort(_Tp** __first, _Tp** __last)4286sort(_Tp** __first, _Tp** __last)
4140{4287{
4141 _VSTD::sort((size_t*)__first, (size_t*)__last, __less<size_t>());4288 _VSTD::sort((uintptr_t*)__first, (uintptr_t*)__last, __less<uintptr_t>());
4142}4289}
41434290
4144template <class _Tp>4291template <class _Tp>
...@@ -4223,7 +4370,7 @@ _ForwardIterator...@@ -4223,7 +4370,7 @@ _ForwardIterator
4223lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)4370lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
4224{4371{
4225 typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;4372 typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;
4226 return __lower_bound<_Comp_ref>(__first, __last, __value_, __comp);4373 return _VSTD::__lower_bound<_Comp_ref>(__first, __last, __value_, __comp);
4227}4374}
42284375
4229template <class _ForwardIterator, class _Tp>4376template <class _ForwardIterator, class _Tp>
...@@ -4267,7 +4414,7 @@ _ForwardIterator...@@ -4267,7 +4414,7 @@ _ForwardIterator
4267upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)4414upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
4268{4415{
4269 typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;4416 typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;
4270 return __upper_bound<_Comp_ref>(__first, __last, __value_, __comp);4417 return _VSTD::__upper_bound<_Comp_ref>(__first, __last, __value_, __comp);
4271}4418}
42724419
4273template <class _ForwardIterator, class _Tp>4420template <class _ForwardIterator, class _Tp>
...@@ -4308,8 +4455,8 @@ __equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va...@@ -4308,8 +4455,8 @@ __equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va
4308 _ForwardIterator __mp1 = __m;4455 _ForwardIterator __mp1 = __m;
4309 return pair<_ForwardIterator, _ForwardIterator>4456 return pair<_ForwardIterator, _ForwardIterator>
4310 (4457 (
4311 __lower_bound<_Compare>(__first, __m, __value_, __comp),4458 _VSTD::__lower_bound<_Compare>(__first, __m, __value_, __comp),
4312 __upper_bound<_Compare>(++__mp1, __last, __value_, __comp)4459 _VSTD::__upper_bound<_Compare>(++__mp1, __last, __value_, __comp)
4313 );4460 );
4314 }4461 }
4315 }4462 }
...@@ -4323,7 +4470,7 @@ pair<_ForwardIterator, _ForwardIterator>...@@ -4323,7 +4470,7 @@ pair<_ForwardIterator, _ForwardIterator>
4323equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)4470equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
4324{4471{
4325 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;4472 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
4326 return __equal_range<_Comp_ref>(__first, __last, __value_, __comp);4473 return _VSTD::__equal_range<_Comp_ref>(__first, __last, __value_, __comp);
4327}4474}
43284475
4329template <class _ForwardIterator, class _Tp>4476template <class _ForwardIterator, class _Tp>
...@@ -4343,7 +4490,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17...@@ -4343,7 +4490,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
4343bool4490bool
4344__binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)4491__binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
4345{4492{
4346 __first = __lower_bound<_Compare>(__first, __last, __value_, __comp);4493 __first = _VSTD::__lower_bound<_Compare>(__first, __last, __value_, __comp);
4347 return __first != __last && !__comp(__value_, *__first);4494 return __first != __last && !__comp(__value_, *__first);
4348}4495}
43494496
...@@ -4354,7 +4501,7 @@ bool...@@ -4354,7 +4501,7 @@ bool
4354binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)4501binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
4355{4502{
4356 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;4503 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
4357 return __binary_search<_Comp_ref>(__first, __last, __value_, __comp);4504 return _VSTD::__binary_search<_Comp_ref>(__first, __last, __value_, __comp);
4358}4505}
43594506
4360template <class _ForwardIterator, class _Tp>4507template <class _ForwardIterator, class _Tp>
...@@ -4370,6 +4517,7 @@ binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va...@@ -4370,6 +4517,7 @@ binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va
4370// merge4517// merge
43714518
4372template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>4519template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
4520_LIBCPP_CONSTEXPR_AFTER_CXX17
4373_OutputIterator4521_OutputIterator
4374__merge(_InputIterator1 __first1, _InputIterator1 __last1,4522__merge(_InputIterator1 __first1, _InputIterator1 __last1,
4375 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)4523 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
...@@ -4393,7 +4541,7 @@ __merge(_InputIterator1 __first1, _InputIterator1 __last1,...@@ -4393,7 +4541,7 @@ __merge(_InputIterator1 __first1, _InputIterator1 __last1,
4393}4541}
43944542
4395template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>4543template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
4396inline _LIBCPP_INLINE_VISIBILITY4544inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
4397_OutputIterator4545_OutputIterator
4398merge(_InputIterator1 __first1, _InputIterator1 __last1,4546merge(_InputIterator1 __first1, _InputIterator1 __last1,
4399 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)4547 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
...@@ -4403,7 +4551,7 @@ merge(_InputIterator1 __first1, _InputIterator1 __last1,...@@ -4403,7 +4551,7 @@ merge(_InputIterator1 __first1, _InputIterator1 __last1,
4403}4551}
44044552
4405template <class _InputIterator1, class _InputIterator2, class _OutputIterator>4553template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
4406inline _LIBCPP_INLINE_VISIBILITY4554inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
4407_OutputIterator4555_OutputIterator
4408merge(_InputIterator1 __first1, _InputIterator1 __last1,4556merge(_InputIterator1 __first1, _InputIterator1 __last1,
4409 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)4557 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
...@@ -4456,20 +4604,21 @@ __buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator...@@ -4456,20 +4604,21 @@ __buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator
4456 if (__len1 <= __len2)4604 if (__len1 <= __len2)
4457 {4605 {
4458 value_type* __p = __buff;4606 value_type* __p = __buff;
4459 for (_BidirectionalIterator __i = __first; __i != __middle; __d.__incr((value_type*)0), (void) ++__i, (void) ++__p)4607 for (_BidirectionalIterator __i = __first; __i != __middle; __d.template __incr<value_type>(), (void) ++__i, (void) ++__p)
4460 ::new(__p) value_type(_VSTD::move(*__i));4608 ::new ((void*)__p) value_type(_VSTD::move(*__i));
4461 __half_inplace_merge(__buff, __p, __middle, __last, __first, __comp);4609 _VSTD::__half_inplace_merge<_Compare>(__buff, __p, __middle, __last, __first, __comp);
4462 }4610 }
4463 else4611 else
4464 {4612 {
4465 value_type* __p = __buff;4613 value_type* __p = __buff;
4466 for (_BidirectionalIterator __i = __middle; __i != __last; __d.__incr((value_type*)0), (void) ++__i, (void) ++__p)4614 for (_BidirectionalIterator __i = __middle; __i != __last; __d.template __incr<value_type>(), (void) ++__i, (void) ++__p)
4467 ::new(__p) value_type(_VSTD::move(*__i));4615 ::new ((void*)__p) value_type(_VSTD::move(*__i));
4468 typedef reverse_iterator<_BidirectionalIterator> _RBi;4616 typedef reverse_iterator<_BidirectionalIterator> _RBi;
4469 typedef reverse_iterator<value_type*> _Rv;4617 typedef reverse_iterator<value_type*> _Rv;
4470 __half_inplace_merge(_Rv(__p), _Rv(__buff),4618 typedef __invert<_Compare> _Inverted;
4471 _RBi(__middle), _RBi(__first),4619 _VSTD::__half_inplace_merge<_Inverted>(_Rv(__p), _Rv(__buff),
4472 _RBi(__last), __invert<_Compare>(__comp));4620 _RBi(__middle), _RBi(__first),
4621 _RBi(__last), _Inverted(__comp));
4473 }4622 }
4474}4623}
44754624
...@@ -4487,7 +4636,7 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,...@@ -4487,7 +4636,7 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,
4487 if (__len2 == 0)4636 if (__len2 == 0)
4488 return;4637 return;
4489 if (__len1 <= __buff_size || __len2 <= __buff_size)4638 if (__len1 <= __buff_size || __len2 <= __buff_size)
4490 return __buffered_inplace_merge<_Compare>4639 return _VSTD::__buffered_inplace_merge<_Compare>
4491 (__first, __middle, __last, __comp, __len1, __len2, __buff);4640 (__first, __middle, __last, __comp, __len1, __len2, __buff);
4492 // shrink [__first, __middle) as much as possible (with no moves), returning if it shrinks to 04641 // shrink [__first, __middle) as much as possible (with no moves), returning if it shrinks to 0
4493 for (; true; ++__first, (void) --__len1)4642 for (; true; ++__first, (void) --__len1)
...@@ -4515,7 +4664,7 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,...@@ -4515,7 +4664,7 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,
4515 __len21 = __len2 / 2;4664 __len21 = __len2 / 2;
4516 __m2 = __middle;4665 __m2 = __middle;
4517 _VSTD::advance(__m2, __len21);4666 _VSTD::advance(__m2, __len21);
4518 __m1 = __upper_bound<_Compare>(__first, __middle, *__m2, __comp);4667 __m1 = _VSTD::__upper_bound<_Compare>(__first, __middle, *__m2, __comp);
4519 __len11 = _VSTD::distance(__first, __m1);4668 __len11 = _VSTD::distance(__first, __m1);
4520 }4669 }
4521 else4670 else
...@@ -4530,7 +4679,7 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,...@@ -4530,7 +4679,7 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,
4530 __len11 = __len1 / 2;4679 __len11 = __len1 / 2;
4531 __m1 = __first;4680 __m1 = __first;
4532 _VSTD::advance(__m1, __len11);4681 _VSTD::advance(__m1, __len11);
4533 __m2 = __lower_bound<_Compare>(__middle, __last, *__m1, __comp);4682 __m2 = _VSTD::__lower_bound<_Compare>(__middle, __last, *__m1, __comp);
4534 __len21 = _VSTD::distance(__middle, __m2);4683 __len21 = _VSTD::distance(__middle, __m2);
4535 }4684 }
4536 difference_type __len12 = __len1 - __len11; // distance(__m1, __middle)4685 difference_type __len12 = __len1 - __len11; // distance(__m1, __middle)
...@@ -4539,11 +4688,11 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,...@@ -4539,11 +4688,11 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,
4539 // swap middle two partitions4688 // swap middle two partitions
4540 __middle = _VSTD::rotate(__m1, __middle, __m2);4689 __middle = _VSTD::rotate(__m1, __middle, __m2);
4541 // __len12 and __len21 now have swapped meanings4690 // __len12 and __len21 now have swapped meanings
4542 // merge smaller range with recurisve call and larger with tail recursion elimination4691 // merge smaller range with recursive call and larger with tail recursion elimination
4543 if (__len11 + __len21 < __len12 + __len22)4692 if (__len11 + __len21 < __len12 + __len22)
4544 {4693 {
4545 __inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size);4694 _VSTD::__inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size);
4546// __inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);4695// _VSTD::__inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);
4547 __first = __middle;4696 __first = __middle;
4548 __middle = __m2;4697 __middle = __m2;
4549 __len1 = __len12;4698 __len1 = __len12;
...@@ -4551,8 +4700,8 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,...@@ -4551,8 +4700,8 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,
4551 }4700 }
4552 else4701 else
4553 {4702 {
4554 __inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);4703 _VSTD::__inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);
4555// __inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size);4704// _VSTD::__inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size);
4556 __last = __middle;4705 __last = __middle;
4557 __middle = __m1;4706 __middle = __m1;
4558 __len1 = __len11;4707 __len1 = __len11;
...@@ -4603,28 +4752,28 @@ __merge_move_construct(_InputIterator1 __first1, _InputIterator1 __last1,...@@ -4603,28 +4752,28 @@ __merge_move_construct(_InputIterator1 __first1, _InputIterator1 __last1,
4603 {4752 {
4604 if (__first1 == __last1)4753 if (__first1 == __last1)
4605 {4754 {
4606 for (; __first2 != __last2; ++__first2, ++__result, (void) __d.__incr((value_type*)0))4755 for (; __first2 != __last2; ++__first2, ++__result, (void)__d.template __incr<value_type>())
4607 ::new (__result) value_type(_VSTD::move(*__first2));4756 ::new ((void*)__result) value_type(_VSTD::move(*__first2));
4608 __h.release();4757 __h.release();
4609 return;4758 return;
4610 }4759 }
4611 if (__first2 == __last2)4760 if (__first2 == __last2)
4612 {4761 {
4613 for (; __first1 != __last1; ++__first1, ++__result, (void) __d.__incr((value_type*)0))4762 for (; __first1 != __last1; ++__first1, ++__result, (void)__d.template __incr<value_type>())
4614 ::new (__result) value_type(_VSTD::move(*__first1));4763 ::new ((void*)__result) value_type(_VSTD::move(*__first1));
4615 __h.release();4764 __h.release();
4616 return;4765 return;
4617 }4766 }
4618 if (__comp(*__first2, *__first1))4767 if (__comp(*__first2, *__first1))
4619 {4768 {
4620 ::new (__result) value_type(_VSTD::move(*__first2));4769 ::new ((void*)__result) value_type(_VSTD::move(*__first2));
4621 __d.__incr((value_type*)0);4770 __d.template __incr<value_type>();
4622 ++__first2;4771 ++__first2;
4623 }4772 }
4624 else4773 else
4625 {4774 {
4626 ::new (__result) value_type(_VSTD::move(*__first1));4775 ::new ((void*)__result) value_type(_VSTD::move(*__first1));
4627 __d.__incr((value_type*)0);4776 __d.template __incr<value_type>();
4628 ++__first1;4777 ++__first1;
4629 }4778 }
4630 }4779 }
...@@ -4677,38 +4826,38 @@ __stable_sort_move(_RandomAccessIterator __first1, _RandomAccessIterator __last1...@@ -4677,38 +4826,38 @@ __stable_sort_move(_RandomAccessIterator __first1, _RandomAccessIterator __last1
4677 case 0:4826 case 0:
4678 return;4827 return;
4679 case 1:4828 case 1:
4680 ::new(__first2) value_type(_VSTD::move(*__first1));4829 ::new ((void*)__first2) value_type(_VSTD::move(*__first1));
4681 return;4830 return;
4682 case 2:4831 case 2:
4683 __destruct_n __d(0);4832 __destruct_n __d(0);
4684 unique_ptr<value_type, __destruct_n&> __h2(__first2, __d);4833 unique_ptr<value_type, __destruct_n&> __h2(__first2, __d);
4685 if (__comp(*--__last1, *__first1))4834 if (__comp(*--__last1, *__first1))
4686 {4835 {
4687 ::new(__first2) value_type(_VSTD::move(*__last1));4836 ::new ((void*)__first2) value_type(_VSTD::move(*__last1));
4688 __d.__incr((value_type*)0);4837 __d.template __incr<value_type>();
4689 ++__first2;4838 ++__first2;
4690 ::new(__first2) value_type(_VSTD::move(*__first1));4839 ::new ((void*)__first2) value_type(_VSTD::move(*__first1));
4691 }4840 }
4692 else4841 else
4693 {4842 {
4694 ::new(__first2) value_type(_VSTD::move(*__first1));4843 ::new ((void*)__first2) value_type(_VSTD::move(*__first1));
4695 __d.__incr((value_type*)0);4844 __d.template __incr<value_type>();
4696 ++__first2;4845 ++__first2;
4697 ::new(__first2) value_type(_VSTD::move(*__last1));4846 ::new ((void*)__first2) value_type(_VSTD::move(*__last1));
4698 }4847 }
4699 __h2.release();4848 __h2.release();
4700 return;4849 return;
4701 }4850 }
4702 if (__len <= 8)4851 if (__len <= 8)
4703 {4852 {
4704 __insertion_sort_move<_Compare>(__first1, __last1, __first2, __comp);4853 _VSTD::__insertion_sort_move<_Compare>(__first1, __last1, __first2, __comp);
4705 return;4854 return;
4706 }4855 }
4707 typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2;4856 typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2;
4708 _RandomAccessIterator __m = __first1 + __l2;4857 _RandomAccessIterator __m = __first1 + __l2;
4709 __stable_sort<_Compare>(__first1, __m, __comp, __l2, __first2, __l2);4858 _VSTD::__stable_sort<_Compare>(__first1, __m, __comp, __l2, __first2, __l2);
4710 __stable_sort<_Compare>(__m, __last1, __comp, __len - __l2, __first2 + __l2, __len - __l2);4859 _VSTD::__stable_sort<_Compare>(__m, __last1, __comp, __len - __l2, __first2 + __l2, __len - __l2);
4711 __merge_move_construct<_Compare>(__first1, __m, __m, __last1, __first2, __comp);4860 _VSTD::__merge_move_construct<_Compare>(__first1, __m, __m, __last1, __first2, __comp);
4712}4861}
47134862
4714template <class _Tp>4863template <class _Tp>
...@@ -4737,7 +4886,7 @@ __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp...@@ -4737,7 +4886,7 @@ __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp
4737 }4886 }
4738 if (__len <= static_cast<difference_type>(__stable_sort_switch<value_type>::value))4887 if (__len <= static_cast<difference_type>(__stable_sort_switch<value_type>::value))
4739 {4888 {
4740 __insertion_sort<_Compare>(__first, __last, __comp);4889 _VSTD::__insertion_sort<_Compare>(__first, __last, __comp);
4741 return;4890 return;
4742 }4891 }
4743 typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2;4892 typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2;
...@@ -4746,21 +4895,21 @@ __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp...@@ -4746,21 +4895,21 @@ __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp
4746 {4895 {
4747 __destruct_n __d(0);4896 __destruct_n __d(0);
4748 unique_ptr<value_type, __destruct_n&> __h2(__buff, __d);4897 unique_ptr<value_type, __destruct_n&> __h2(__buff, __d);
4749 __stable_sort_move<_Compare>(__first, __m, __comp, __l2, __buff);4898 _VSTD::__stable_sort_move<_Compare>(__first, __m, __comp, __l2, __buff);
4750 __d.__set(__l2, (value_type*)0);4899 __d.__set(__l2, (value_type*)nullptr);
4751 __stable_sort_move<_Compare>(__m, __last, __comp, __len - __l2, __buff + __l2);4900 _VSTD::__stable_sort_move<_Compare>(__m, __last, __comp, __len - __l2, __buff + __l2);
4752 __d.__set(__len, (value_type*)0);4901 __d.__set(__len, (value_type*)nullptr);
4753 __merge_move_assign<_Compare>(__buff, __buff + __l2, __buff + __l2, __buff + __len, __first, __comp);4902 _VSTD::__merge_move_assign<_Compare>(__buff, __buff + __l2, __buff + __l2, __buff + __len, __first, __comp);
4754// __merge<_Compare>(move_iterator<value_type*>(__buff),4903// _VSTD::__merge<_Compare>(move_iterator<value_type*>(__buff),
4755// move_iterator<value_type*>(__buff + __l2),4904// move_iterator<value_type*>(__buff + __l2),
4756// move_iterator<_RandomAccessIterator>(__buff + __l2),4905// move_iterator<_RandomAccessIterator>(__buff + __l2),
4757// move_iterator<_RandomAccessIterator>(__buff + __len),4906// move_iterator<_RandomAccessIterator>(__buff + __len),
4758// __first, __comp);4907// __first, __comp);
4759 return;4908 return;
4760 }4909 }
4761 __stable_sort<_Compare>(__first, __m, __comp, __l2, __buff, __buff_size);4910 _VSTD::__stable_sort<_Compare>(__first, __m, __comp, __l2, __buff, __buff_size);
4762 __stable_sort<_Compare>(__m, __last, __comp, __len - __l2, __buff, __buff_size);4911 _VSTD::__stable_sort<_Compare>(__m, __last, __comp, __len - __l2, __buff, __buff_size);
4763 __inplace_merge<_Compare>(__first, __m, __last, __comp, __l2, __len - __l2, __buff, __buff_size);4912 _VSTD::__inplace_merge<_Compare>(__first, __m, __last, __comp, __l2, __len - __l2, __buff, __buff_size);
4764}4913}
47654914
4766template <class _RandomAccessIterator, class _Compare>4915template <class _RandomAccessIterator, class _Compare>
...@@ -4779,7 +4928,7 @@ stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compar...@@ -4779,7 +4928,7 @@ stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compar
4779 __h.reset(__buf.first);4928 __h.reset(__buf.first);
4780 }4929 }
4781 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;4930 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
4782 __stable_sort<_Comp_ref>(__first, __last, __comp, __len, __buf.first, __buf.second);4931 _VSTD::__stable_sort<_Comp_ref>(__first, __last, __comp, __len, __buf.first, __buf.second);
4783}4932}
47844933
4785template <class _RandomAccessIterator>4934template <class _RandomAccessIterator>
...@@ -4883,7 +5032,7 @@ void...@@ -4883,7 +5032,7 @@ void
4883push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)5032push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
4884{5033{
4885 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5034 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
4886 __sift_up<_Comp_ref>(__first, __last, __comp, __last - __first);5035 _VSTD::__sift_up<_Comp_ref>(__first, __last, __comp, __last - __first);
4887}5036}
48885037
4889template <class _RandomAccessIterator>5038template <class _RandomAccessIterator>
...@@ -4960,7 +5109,7 @@ __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare...@@ -4960,7 +5109,7 @@ __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare
4960 if (__len > 1)5109 if (__len > 1)
4961 {5110 {
4962 swap(*__first, *--__last);5111 swap(*__first, *--__last);
4963 __sift_down<_Compare>(__first, __last, __comp, __len - 1, __first);5112 _VSTD::__sift_down<_Compare>(__first, __last, __comp, __len - 1, __first);
4964 }5113 }
4965}5114}
49665115
...@@ -4970,7 +5119,7 @@ void...@@ -4970,7 +5119,7 @@ void
4970pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)5119pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
4971{5120{
4972 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5121 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
4973 __pop_heap<_Comp_ref>(__first, __last, __comp, __last - __first);5122 _VSTD::__pop_heap<_Comp_ref>(__first, __last, __comp, __last - __first);
4974}5123}
49755124
4976template <class _RandomAccessIterator>5125template <class _RandomAccessIterator>
...@@ -4994,7 +5143,7 @@ __make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compar...@@ -4994,7 +5143,7 @@ __make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compar
4994 // start from the first parent, there is no need to consider children5143 // start from the first parent, there is no need to consider children
4995 for (difference_type __start = (__n - 2) / 2; __start >= 0; --__start)5144 for (difference_type __start = (__n - 2) / 2; __start >= 0; --__start)
4996 {5145 {
4997 __sift_down<_Compare>(__first, __last, __comp, __n, __first + __start);5146 _VSTD::__sift_down<_Compare>(__first, __last, __comp, __n, __first + __start);
4998 }5147 }
4999 }5148 }
5000}5149}
...@@ -5005,7 +5154,7 @@ void...@@ -5005,7 +5154,7 @@ void
5005make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)5154make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
5006{5155{
5007 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5156 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
5008 __make_heap<_Comp_ref>(__first, __last, __comp);5157 _VSTD::__make_heap<_Comp_ref>(__first, __last, __comp);
5009}5158}
50105159
5011template <class _RandomAccessIterator>5160template <class _RandomAccessIterator>
...@@ -5024,7 +5173,7 @@ __sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compar...@@ -5024,7 +5173,7 @@ __sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compar
5024{5173{
5025 typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;5174 typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
5026 for (difference_type __n = __last - __first; __n > 1; --__last, (void) --__n)5175 for (difference_type __n = __last - __first; __n > 1; --__last, (void) --__n)
5027 __pop_heap<_Compare>(__first, __last, __comp, __n);5176 _VSTD::__pop_heap<_Compare>(__first, __last, __comp, __n);
5028}5177}
50295178
5030template <class _RandomAccessIterator, class _Compare>5179template <class _RandomAccessIterator, class _Compare>
...@@ -5033,7 +5182,7 @@ void...@@ -5033,7 +5182,7 @@ void
5033sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)5182sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
5034{5183{
5035 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5184 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
5036 __sort_heap<_Comp_ref>(__first, __last, __comp);5185 _VSTD::__sort_heap<_Comp_ref>(__first, __last, __comp);
5037}5186}
50385187
5039template <class _RandomAccessIterator>5188template <class _RandomAccessIterator>
...@@ -5051,17 +5200,17 @@ void...@@ -5051,17 +5200,17 @@ void
5051__partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,5200__partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
5052 _Compare __comp)5201 _Compare __comp)
5053{5202{
5054 __make_heap<_Compare>(__first, __middle, __comp);5203 _VSTD::__make_heap<_Compare>(__first, __middle, __comp);
5055 typename iterator_traits<_RandomAccessIterator>::difference_type __len = __middle - __first;5204 typename iterator_traits<_RandomAccessIterator>::difference_type __len = __middle - __first;
5056 for (_RandomAccessIterator __i = __middle; __i != __last; ++__i)5205 for (_RandomAccessIterator __i = __middle; __i != __last; ++__i)
5057 {5206 {
5058 if (__comp(*__i, *__first))5207 if (__comp(*__i, *__first))
5059 {5208 {
5060 swap(*__i, *__first);5209 swap(*__i, *__first);
5061 __sift_down<_Compare>(__first, __middle, __comp, __len, __first);5210 _VSTD::__sift_down<_Compare>(__first, __middle, __comp, __len, __first);
5062 }5211 }
5063 }5212 }
5064 __sort_heap<_Compare>(__first, __middle, __comp);5213 _VSTD::__sort_heap<_Compare>(__first, __middle, __comp);
5065}5214}
50665215
5067template <class _RandomAccessIterator, class _Compare>5216template <class _RandomAccessIterator, class _Compare>
...@@ -5071,7 +5220,7 @@ partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _Ran...@@ -5071,7 +5220,7 @@ partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _Ran
5071 _Compare __comp)5220 _Compare __comp)
5072{5221{
5073 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5222 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
5074 __partial_sort<_Comp_ref>(__first, __middle, __last, __comp);5223 _VSTD::__partial_sort<_Comp_ref>(__first, __middle, __last, __comp);
5075}5224}
50765225
5077template <class _RandomAccessIterator>5226template <class _RandomAccessIterator>
...@@ -5095,15 +5244,15 @@ __partial_sort_copy(_InputIterator __first, _InputIterator __last,...@@ -5095,15 +5244,15 @@ __partial_sort_copy(_InputIterator __first, _InputIterator __last,
5095 {5244 {
5096 for (; __first != __last && __r != __result_last; ++__first, (void) ++__r)5245 for (; __first != __last && __r != __result_last; ++__first, (void) ++__r)
5097 *__r = *__first;5246 *__r = *__first;
5098 __make_heap<_Compare>(__result_first, __r, __comp);5247 _VSTD::__make_heap<_Compare>(__result_first, __r, __comp);
5099 typename iterator_traits<_RandomAccessIterator>::difference_type __len = __r - __result_first;5248 typename iterator_traits<_RandomAccessIterator>::difference_type __len = __r - __result_first;
5100 for (; __first != __last; ++__first)5249 for (; __first != __last; ++__first)
5101 if (__comp(*__first, *__result_first))5250 if (__comp(*__first, *__result_first))
5102 {5251 {
5103 *__result_first = *__first;5252 *__result_first = *__first;
5104 __sift_down<_Compare>(__result_first, __r, __comp, __len, __result_first);5253 _VSTD::__sift_down<_Compare>(__result_first, __r, __comp, __len, __result_first);
5105 }5254 }
5106 __sort_heap<_Compare>(__result_first, __r, __comp);5255 _VSTD::__sort_heap<_Compare>(__result_first, __r, __comp);
5107 }5256 }
5108 return __r;5257 return __r;
5109}5258}
...@@ -5115,7 +5264,7 @@ partial_sort_copy(_InputIterator __first, _InputIterator __last,...@@ -5115,7 +5264,7 @@ partial_sort_copy(_InputIterator __first, _InputIterator __last,
5115 _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp)5264 _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp)
5116{5265{
5117 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5266 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
5118 return __partial_sort_copy<_Comp_ref>(__first, __last, __result_first, __result_last, __comp);5267 return _VSTD::__partial_sort_copy<_Comp_ref>(__first, __last, __result_first, __result_last, __comp);
5119}5268}
51205269
5121template <class _InputIterator, class _RandomAccessIterator>5270template <class _InputIterator, class _RandomAccessIterator>
...@@ -5161,7 +5310,7 @@ __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _Rando...@@ -5161,7 +5310,7 @@ __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _Rando
5161 }5310 }
5162 if (__len <= __limit)5311 if (__len <= __limit)
5163 {5312 {
5164 __selection_sort<_Compare>(__first, __last, __comp);5313 _VSTD::__selection_sort<_Compare>(__first, __last, __comp);
5165 return;5314 return;
5166 }5315 }
5167 // __len > __limit >= 35316 // __len > __limit >= 3
...@@ -5185,7 +5334,7 @@ __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _Rando...@@ -5185,7 +5334,7 @@ __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _Rando
5185 if (__i == --__j)5334 if (__i == --__j)
5186 {5335 {
5187 // *__first == *__m, *__m <= all other elements5336 // *__first == *__m, *__m <= all other elements
5188 // Parition instead into [__first, __i) == *__first and *__first < [__i, __last)5337 // Partition instead into [__first, __i) == *__first and *__first < [__i, __last)
5189 ++__i; // __first + 15338 ++__i; // __first + 1
5190 __j = __last;5339 __j = __last;
5191 if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1)5340 if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1)
...@@ -5223,8 +5372,8 @@ __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _Rando...@@ -5223,8 +5372,8 @@ __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _Rando
5223 // The first part is sorted,5372 // The first part is sorted,
5224 if (__nth < __i)5373 if (__nth < __i)
5225 return;5374 return;
5226 // __nth_element the secod part5375 // __nth_element the second part
5227 // __nth_element<_Compare>(__i, __nth, __last, __comp);5376 // _VSTD::__nth_element<_Compare>(__i, __nth, __last, __comp);
5228 __first = __i;5377 __first = __i;
5229 goto __restart;5378 goto __restart;
5230 }5379 }
...@@ -5306,12 +5455,12 @@ not_sorted:...@@ -5306,12 +5455,12 @@ not_sorted:
5306 // __nth_element on range containing __nth5455 // __nth_element on range containing __nth
5307 if (__nth < __i)5456 if (__nth < __i)
5308 {5457 {
5309 // __nth_element<_Compare>(__first, __nth, __i, __comp);5458 // _VSTD::__nth_element<_Compare>(__first, __nth, __i, __comp);
5310 __last = __i;5459 __last = __i;
5311 }5460 }
5312 else5461 else
5313 {5462 {
5314 // __nth_element<_Compare>(__i+1, __nth, __last, __comp);5463 // _VSTD::__nth_element<_Compare>(__i+1, __nth, __last, __comp);
5315 __first = ++__i;5464 __first = ++__i;
5316 }5465 }
5317 }5466 }
...@@ -5323,7 +5472,7 @@ void...@@ -5323,7 +5472,7 @@ void
5323nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp)5472nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp)
5324{5473{
5325 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5474 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
5326 __nth_element<_Comp_ref>(__first, __nth, __last, __comp);5475 _VSTD::__nth_element<_Comp_ref>(__first, __nth, __last, __comp);
5327}5476}
53285477
5329template <class _RandomAccessIterator>5478template <class _RandomAccessIterator>
...@@ -5359,7 +5508,7 @@ includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi...@@ -5359,7 +5508,7 @@ includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi
5359 _Compare __comp)5508 _Compare __comp)
5360{5509{
5361 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5510 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
5362 return __includes<_Comp_ref>(__first1, __last1, __first2, __last2, __comp);5511 return _VSTD::__includes<_Comp_ref>(__first1, __last1, __first2, __last2, __comp);
5363}5512}
53645513
5365template <class _InputIterator1, class _InputIterator2>5514template <class _InputIterator1, class _InputIterator2>
...@@ -5376,7 +5525,7 @@ includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi...@@ -5376,7 +5525,7 @@ includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi
5376// set_union5525// set_union
53775526
5378template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>5527template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
5379_OutputIterator5528_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
5380__set_union(_InputIterator1 __first1, _InputIterator1 __last1,5529__set_union(_InputIterator1 __first1, _InputIterator1 __last1,
5381 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)5530 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
5382{5531{
...@@ -5401,17 +5550,17 @@ __set_union(_InputIterator1 __first1, _InputIterator1 __last1,...@@ -5401,17 +5550,17 @@ __set_union(_InputIterator1 __first1, _InputIterator1 __last1,
5401}5550}
54025551
5403template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>5552template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
5404inline _LIBCPP_INLINE_VISIBILITY5553inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
5405_OutputIterator5554_OutputIterator
5406set_union(_InputIterator1 __first1, _InputIterator1 __last1,5555set_union(_InputIterator1 __first1, _InputIterator1 __last1,
5407 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)5556 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
5408{5557{
5409 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5558 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
5410 return __set_union<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);5559 return _VSTD::__set_union<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
5411}5560}
54125561
5413template <class _InputIterator1, class _InputIterator2, class _OutputIterator>5562template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
5414inline _LIBCPP_INLINE_VISIBILITY5563inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
5415_OutputIterator5564_OutputIterator
5416set_union(_InputIterator1 __first1, _InputIterator1 __last1,5565set_union(_InputIterator1 __first1, _InputIterator1 __last1,
5417 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)5566 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
...@@ -5453,7 +5602,7 @@ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,...@@ -5453,7 +5602,7 @@ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
5453 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)5602 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
5454{5603{
5455 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5604 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
5456 return __set_intersection<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);5605 return _VSTD::__set_intersection<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
5457}5606}
54585607
5459template <class _InputIterator1, class _InputIterator2, class _OutputIterator>5608template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
...@@ -5470,7 +5619,7 @@ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,...@@ -5470,7 +5619,7 @@ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
5470// set_difference5619// set_difference
54715620
5472template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>5621template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
5473_OutputIterator5622_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
5474__set_difference(_InputIterator1 __first1, _InputIterator1 __last1,5623__set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
5475 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)5624 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
5476{5625{
...@@ -5495,17 +5644,17 @@ __set_difference(_InputIterator1 __first1, _InputIterator1 __last1,...@@ -5495,17 +5644,17 @@ __set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
5495}5644}
54965645
5497template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>5646template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
5498inline _LIBCPP_INLINE_VISIBILITY5647inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
5499_OutputIterator5648_OutputIterator
5500set_difference(_InputIterator1 __first1, _InputIterator1 __last1,5649set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
5501 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)5650 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
5502{5651{
5503 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5652 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
5504 return __set_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);5653 return _VSTD::__set_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
5505}5654}
55065655
5507template <class _InputIterator1, class _InputIterator2, class _OutputIterator>5656template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
5508inline _LIBCPP_INLINE_VISIBILITY5657inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
5509_OutputIterator5658_OutputIterator
5510set_difference(_InputIterator1 __first1, _InputIterator1 __last1,5659set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
5511 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)5660 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
...@@ -5518,7 +5667,7 @@ set_difference(_InputIterator1 __first1, _InputIterator1 __last1,...@@ -5518,7 +5667,7 @@ set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
5518// set_symmetric_difference5667// set_symmetric_difference
55195668
5520template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>5669template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
5521_OutputIterator5670_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
5522__set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,5671__set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
5523 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)5672 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
5524{5673{
...@@ -5548,17 +5697,17 @@ __set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,...@@ -5548,17 +5697,17 @@ __set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
5548}5697}
55495698
5550template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>5699template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
5551inline _LIBCPP_INLINE_VISIBILITY5700inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
5552_OutputIterator5701_OutputIterator
5553set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,5702set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
5554 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)5703 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
5555{5704{
5556 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5705 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
5557 return __set_symmetric_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);5706 return _VSTD::__set_symmetric_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);
5558}5707}
55595708
5560template <class _InputIterator1, class _InputIterator2, class _OutputIterator>5709template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
5561inline _LIBCPP_INLINE_VISIBILITY5710inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
5562_OutputIterator5711_OutputIterator
5563set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,5712set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
5564 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)5713 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
...@@ -5593,7 +5742,7 @@ lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,...@@ -5593,7 +5742,7 @@ lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
5593 _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)5742 _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
5594{5743{
5595 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5744 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
5596 return __lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __comp);5745 return _VSTD::__lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __comp);
5597}5746}
55985747
5599template <class _InputIterator1, class _InputIterator2>5748template <class _InputIterator1, class _InputIterator2>
...@@ -5611,7 +5760,7 @@ lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,...@@ -5611,7 +5760,7 @@ lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
5611// next_permutation5760// next_permutation
56125761
5613template <class _Compare, class _BidirectionalIterator>5762template <class _Compare, class _BidirectionalIterator>
5614bool5763_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
5615__next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)5764__next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
5616{5765{
5617 _BidirectionalIterator __i = __last;5766 _BidirectionalIterator __i = __last;
...@@ -5638,16 +5787,16 @@ __next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last...@@ -5638,16 +5787,16 @@ __next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last
5638}5787}
56395788
5640template <class _BidirectionalIterator, class _Compare>5789template <class _BidirectionalIterator, class _Compare>
5641inline _LIBCPP_INLINE_VISIBILITY5790inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
5642bool5791bool
5643next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)5792next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
5644{5793{
5645 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5794 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
5646 return __next_permutation<_Comp_ref>(__first, __last, __comp);5795 return _VSTD::__next_permutation<_Comp_ref>(__first, __last, __comp);
5647}5796}
56485797
5649template <class _BidirectionalIterator>5798template <class _BidirectionalIterator>
5650inline _LIBCPP_INLINE_VISIBILITY5799inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
5651bool5800bool
5652next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)5801next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
5653{5802{
...@@ -5658,7 +5807,7 @@ next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)...@@ -5658,7 +5807,7 @@ next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
5658// prev_permutation5807// prev_permutation
56595808
5660template <class _Compare, class _BidirectionalIterator>5809template <class _Compare, class _BidirectionalIterator>
5661bool5810_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
5662__prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)5811__prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
5663{5812{
5664 _BidirectionalIterator __i = __last;5813 _BidirectionalIterator __i = __last;
...@@ -5685,16 +5834,16 @@ __prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last...@@ -5685,16 +5834,16 @@ __prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last
5685}5834}
56865835
5687template <class _BidirectionalIterator, class _Compare>5836template <class _BidirectionalIterator, class _Compare>
5688inline _LIBCPP_INLINE_VISIBILITY5837inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
5689bool5838bool
5690prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)5839prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
5691{5840{
5692 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;5841 typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
5693 return __prev_permutation<_Comp_ref>(__first, __last, __comp);5842 return _VSTD::__prev_permutation<_Comp_ref>(__first, __last, __comp);
5694}5843}
56955844
5696template <class _BidirectionalIterator>5845template <class _BidirectionalIterator>
5697inline _LIBCPP_INLINE_VISIBILITY5846inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
5698bool5847bool
5699prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)5848prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
5700{5849{
lib/libcxx/include/any+22-8
...@@ -81,8 +81,8 @@ namespace std {...@@ -81,8 +81,8 @@ namespace std {
81*/81*/
8282
83#include <experimental/__config>83#include <experimental/__config>
84#include <__availability>
84#include <memory>85#include <memory>
85#include <new>
86#include <typeinfo>86#include <typeinfo>
87#include <type_traits>87#include <type_traits>
88#include <cstdlib>88#include <cstdlib>
...@@ -157,7 +157,7 @@ namespace __any_imp...@@ -157,7 +157,7 @@ namespace __any_imp
157 template <class _Tp>157 template <class _Tp>
158 inline _LIBCPP_INLINE_VISIBILITY158 inline _LIBCPP_INLINE_VISIBILITY
159 constexpr const void* __get_fallback_typeid() {159 constexpr const void* __get_fallback_typeid() {
160 return &__unique_typeinfo<decay_t<_Tp>>::__id;160 return &__unique_typeinfo<remove_cv_t<remove_reference_t<_Tp>>>::__id;
161 }161 }
162162
163 template <class _Tp>163 template <class _Tp>
...@@ -368,7 +368,11 @@ namespace __any_imp...@@ -368,7 +368,11 @@ namespace __any_imp
368 template <class ..._Args>368 template <class ..._Args>
369 _LIBCPP_INLINE_VISIBILITY369 _LIBCPP_INLINE_VISIBILITY
370 static _Tp& __create(any & __dest, _Args&&... __args) {370 static _Tp& __create(any & __dest, _Args&&... __args) {
371 _Tp* __ret = ::new (static_cast<void*>(&__dest.__s.__buf)) _Tp(_VSTD::forward<_Args>(__args)...);371 typedef allocator<_Tp> _Alloc;
372 typedef allocator_traits<_Alloc> _ATraits;
373 _Alloc __a;
374 _Tp * __ret = static_cast<_Tp*>(static_cast<void*>(&__dest.__s.__buf));
375 _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...);
372 __dest.__h = &_SmallHandler::__handle;376 __dest.__h = &_SmallHandler::__handle;
373 return *__ret;377 return *__ret;
374 }378 }
...@@ -376,8 +380,11 @@ namespace __any_imp...@@ -376,8 +380,11 @@ namespace __any_imp
376 private:380 private:
377 _LIBCPP_INLINE_VISIBILITY381 _LIBCPP_INLINE_VISIBILITY
378 static void __destroy(any & __this) {382 static void __destroy(any & __this) {
379 _Tp & __value = *static_cast<_Tp *>(static_cast<void*>(&__this.__s.__buf));383 typedef allocator<_Tp> _Alloc;
380 __value.~_Tp();384 typedef allocator_traits<_Alloc> _ATraits;
385 _Alloc __a;
386 _Tp * __p = static_cast<_Tp *>(static_cast<void*>(&__this.__s.__buf));
387 _ATraits::destroy(__a, __p);
381 __this.__h = nullptr;388 __this.__h = nullptr;
382 }389 }
383390
...@@ -445,10 +452,12 @@ namespace __any_imp...@@ -445,10 +452,12 @@ namespace __any_imp
445 _LIBCPP_INLINE_VISIBILITY452 _LIBCPP_INLINE_VISIBILITY
446 static _Tp& __create(any & __dest, _Args&&... __args) {453 static _Tp& __create(any & __dest, _Args&&... __args) {
447 typedef allocator<_Tp> _Alloc;454 typedef allocator<_Tp> _Alloc;
455 typedef allocator_traits<_Alloc> _ATraits;
448 typedef __allocator_destructor<_Alloc> _Dp;456 typedef __allocator_destructor<_Alloc> _Dp;
449 _Alloc __a;457 _Alloc __a;
450 unique_ptr<_Tp, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));458 unique_ptr<_Tp, _Dp> __hold(_ATraits::allocate(__a, 1), _Dp(__a, 1));
451 _Tp* __ret = ::new ((void*)__hold.get()) _Tp(_VSTD::forward<_Args>(__args)...);459 _Tp * __ret = __hold.get();
460 _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...);
452 __dest.__s.__ptr = __hold.release();461 __dest.__s.__ptr = __hold.release();
453 __dest.__h = &_LargeHandler::__handle;462 __dest.__h = &_LargeHandler::__handle;
454 return *__ret;463 return *__ret;
...@@ -458,7 +467,12 @@ namespace __any_imp...@@ -458,7 +467,12 @@ namespace __any_imp
458467
459 _LIBCPP_INLINE_VISIBILITY468 _LIBCPP_INLINE_VISIBILITY
460 static void __destroy(any & __this){469 static void __destroy(any & __this){
461 delete static_cast<_Tp*>(__this.__s.__ptr);470 typedef allocator<_Tp> _Alloc;
471 typedef allocator_traits<_Alloc> _ATraits;
472 _Alloc __a;
473 _Tp * __p = static_cast<_Tp *>(__this.__s.__ptr);
474 _ATraits::destroy(__a, __p);
475 _ATraits::deallocate(__a, __p, 1);
462 __this.__h = nullptr;476 __this.__h = nullptr;
463 }477 }
464478
lib/libcxx/include/array+8-12
...@@ -142,8 +142,8 @@ struct _LIBCPP_TEMPLATE_VIS array...@@ -142,8 +142,8 @@ struct _LIBCPP_TEMPLATE_VIS array
142 typedef const value_type* const_pointer;142 typedef const value_type* const_pointer;
143 typedef size_t size_type;143 typedef size_t size_type;
144 typedef ptrdiff_t difference_type;144 typedef ptrdiff_t difference_type;
145 typedef std::reverse_iterator<iterator> reverse_iterator;145 typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
146 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;146 typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
147147
148 _Tp __elems_[_Size];148 _Tp __elems_[_Size];
149149
...@@ -155,7 +155,7 @@ struct _LIBCPP_TEMPLATE_VIS array...@@ -155,7 +155,7 @@ struct _LIBCPP_TEMPLATE_VIS array
155155
156 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17156 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
157 void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) {157 void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) {
158 std::swap_ranges(data(), data() + _Size, __a.data());158 _VSTD::swap_ranges(data(), data() + _Size, __a.data());
159 }159 }
160160
161 // iterators:161 // iterators:
...@@ -245,8 +245,8 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0>...@@ -245,8 +245,8 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0>
245 typedef const value_type* const_pointer;245 typedef const value_type* const_pointer;
246 typedef size_t size_type;246 typedef size_t size_type;
247 typedef ptrdiff_t difference_type;247 typedef ptrdiff_t difference_type;
248 typedef std::reverse_iterator<iterator> reverse_iterator;248 typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
249 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;249 typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
250250
251 typedef typename conditional<is_const<_Tp>::value, const char,251 typedef typename conditional<is_const<_Tp>::value, const char,
252 char>::type _CharType;252 char>::type _CharType;
...@@ -459,8 +459,6 @@ get(const array<_Tp, _Size>& __a) _NOEXCEPT...@@ -459,8 +459,6 @@ get(const array<_Tp, _Size>& __a) _NOEXCEPT
459 return __a.__elems_[_Ip];459 return __a.__elems_[_Ip];
460}460}
461461
462#ifndef _LIBCPP_CXX03_LANG
463
464template <size_t _Ip, class _Tp, size_t _Size>462template <size_t _Ip, class _Tp, size_t _Size>
465inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11463inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
466_Tp&&464_Tp&&
...@@ -479,8 +477,6 @@ get(const array<_Tp, _Size>&& __a) _NOEXCEPT...@@ -479,8 +477,6 @@ get(const array<_Tp, _Size>&& __a) _NOEXCEPT
479 return _VSTD::move(__a.__elems_[_Ip]);477 return _VSTD::move(__a.__elems_[_Ip]);
480}478}
481479
482#endif // !_LIBCPP_CXX03_LANG
483
484#if _LIBCPP_STD_VER > 17480#if _LIBCPP_STD_VER > 17
485481
486template <typename _Tp, size_t _Size, size_t... _Index>482template <typename _Tp, size_t _Size, size_t... _Index>
...@@ -504,7 +500,7 @@ to_array(_Tp (&__arr)[_Size]) noexcept(is_nothrow_constructible_v<_Tp, _Tp&>) {...@@ -504,7 +500,7 @@ to_array(_Tp (&__arr)[_Size]) noexcept(is_nothrow_constructible_v<_Tp, _Tp&>) {
504 static_assert(500 static_assert(
505 is_constructible_v<_Tp, _Tp&>,501 is_constructible_v<_Tp, _Tp&>,
506 "[array.creation]/1: to_array requires copy constructible elements.");502 "[array.creation]/1: to_array requires copy constructible elements.");
507 return __to_array_lvalue_impl(__arr, make_index_sequence<_Size>());503 return _VSTD::__to_array_lvalue_impl(__arr, make_index_sequence<_Size>());
508}504}
509505
510template <typename _Tp, size_t _Size>506template <typename _Tp, size_t _Size>
...@@ -516,8 +512,8 @@ to_array(_Tp(&&__arr)[_Size]) noexcept(is_nothrow_move_constructible_v<_Tp>) {...@@ -516,8 +512,8 @@ to_array(_Tp(&&__arr)[_Size]) noexcept(is_nothrow_move_constructible_v<_Tp>) {
516 static_assert(512 static_assert(
517 is_move_constructible_v<_Tp>,513 is_move_constructible_v<_Tp>,
518 "[array.creation]/4: to_array requires move constructible elements.");514 "[array.creation]/4: to_array requires move constructible elements.");
519 return __to_array_rvalue_impl(_VSTD::move(__arr),515 return _VSTD::__to_array_rvalue_impl(_VSTD::move(__arr),
520 make_index_sequence<_Size>());516 make_index_sequence<_Size>());
521}517}
522518
523#endif // _LIBCPP_STD_VER > 17519#endif // _LIBCPP_STD_VER > 17
lib/libcxx/include/atomic+93-77
...@@ -16,9 +16,12 @@...@@ -16,9 +16,12 @@
16namespace std16namespace std
17{17{
1818
19// feature test macro19// feature test macro [version.syn]
2020
21#define __cpp_lib_atomic_is_always_lock_free // as specified by SG1021#define __cpp_lib_atomic_is_always_lock_free
22#define __cpp_lib_atomic_flag_test
23#define __cpp_lib_atomic_lock_free_type_aliases
24#define __cpp_lib_atomic_wait
2225
23 // order and consistency26 // order and consistency
2427
...@@ -45,6 +48,7 @@ template <class T> T kill_dependency(T y) noexcept;...@@ -45,6 +48,7 @@ template <class T> T kill_dependency(T y) noexcept;
4548
46#define ATOMIC_BOOL_LOCK_FREE unspecified49#define ATOMIC_BOOL_LOCK_FREE unspecified
47#define ATOMIC_CHAR_LOCK_FREE unspecified50#define ATOMIC_CHAR_LOCK_FREE unspecified
51#define ATOMIC_CHAR8_T_LOCK_FREE unspecified // C++20
48#define ATOMIC_CHAR16_T_LOCK_FREE unspecified52#define ATOMIC_CHAR16_T_LOCK_FREE unspecified
49#define ATOMIC_CHAR32_T_LOCK_FREE unspecified53#define ATOMIC_CHAR32_T_LOCK_FREE unspecified
50#define ATOMIC_WCHAR_T_LOCK_FREE unspecified54#define ATOMIC_WCHAR_T_LOCK_FREE unspecified
...@@ -108,6 +112,7 @@ template <>...@@ -108,6 +112,7 @@ template <>
108struct atomic<integral>112struct atomic<integral>
109{113{
110 using value_type = integral;114 using value_type = integral;
115 using difference_type = value_type;
111116
112 static constexpr bool is_always_lock_free;117 static constexpr bool is_always_lock_free;
113 bool is_lock_free() const volatile noexcept;118 bool is_lock_free() const volatile noexcept;
...@@ -190,6 +195,7 @@ template <class T>...@@ -190,6 +195,7 @@ template <class T>
190struct atomic<T*>195struct atomic<T*>
191{196{
192 using value_type = T*;197 using value_type = T*;
198 using difference_type = ptrdiff_t;
193199
194 static constexpr bool is_always_lock_free;200 static constexpr bool is_always_lock_free;
195 bool is_lock_free() const volatile noexcept;201 bool is_lock_free() const volatile noexcept;
...@@ -460,6 +466,7 @@ typedef atomic<long> atomic_long;...@@ -460,6 +466,7 @@ typedef atomic<long> atomic_long;
460typedef atomic<unsigned long> atomic_ulong;466typedef atomic<unsigned long> atomic_ulong;
461typedef atomic<long long> atomic_llong;467typedef atomic<long long> atomic_llong;
462typedef atomic<unsigned long long> atomic_ullong;468typedef atomic<unsigned long long> atomic_ullong;
469typedef atomic<char8_t> atomic_char8_t; // C++20
463typedef atomic<char16_t> atomic_char16_t;470typedef atomic<char16_t> atomic_char16_t;
464typedef atomic<char32_t> atomic_char32_t;471typedef atomic<char32_t> atomic_char32_t;
465typedef atomic<wchar_t> atomic_wchar_t;472typedef atomic<wchar_t> atomic_wchar_t;
...@@ -477,7 +484,7 @@ typedef atomic<int_fast8_t> atomic_int_fast8_t;...@@ -477,7 +484,7 @@ typedef atomic<int_fast8_t> atomic_int_fast8_t;
477typedef atomic<uint_fast8_t> atomic_uint_fast8_t;484typedef atomic<uint_fast8_t> atomic_uint_fast8_t;
478typedef atomic<int_fast16_t> atomic_int_fast16_t;485typedef atomic<int_fast16_t> atomic_int_fast16_t;
479typedef atomic<uint_fast16_t> atomic_uint_fast16_t;486typedef atomic<uint_fast16_t> atomic_uint_fast16_t;
480typedef atomic<int_fast32_t> atomic_int_fast32_t; 487typedef atomic<int_fast32_t> atomic_int_fast32_t;
481typedef atomic<uint_fast32_t> atomic_uint_fast32_t;488typedef atomic<uint_fast32_t> atomic_uint_fast32_t;
482typedef atomic<int_fast64_t> atomic_int_fast64_t;489typedef atomic<int_fast64_t> atomic_int_fast64_t;
483typedef atomic<uint_fast64_t> atomic_uint_fast64_t;490typedef atomic<uint_fast64_t> atomic_uint_fast64_t;
...@@ -568,6 +575,7 @@ template <class T>...@@ -568,6 +575,7 @@ template <class T>
568*/575*/
569576
570#include <__config>577#include <__config>
578#include <__availability>
571#include <__threading_support>579#include <__threading_support>
572#include <cstddef>580#include <cstddef>
573#include <cstdint>581#include <cstdint>
...@@ -654,7 +662,7 @@ typedef enum memory_order {...@@ -654,7 +662,7 @@ typedef enum memory_order {
654662
655template <typename _Tp> _LIBCPP_INLINE_VISIBILITY663template <typename _Tp> _LIBCPP_INLINE_VISIBILITY
656bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp const& __rhs) {664bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp const& __rhs) {
657 return memcmp(&__lhs, &__rhs, sizeof(_Tp)) == 0;665 return _VSTD::memcmp(&__lhs, &__rhs, sizeof(_Tp)) == 0;
658}666}
659667
660static_assert((is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value),668static_assert((is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value),
...@@ -1119,6 +1127,9 @@ _Tp kill_dependency(_Tp __y) _NOEXCEPT...@@ -1119,6 +1127,9 @@ _Tp kill_dependency(_Tp __y) _NOEXCEPT
1119#if defined(__CLANG_ATOMIC_BOOL_LOCK_FREE)1127#if defined(__CLANG_ATOMIC_BOOL_LOCK_FREE)
1120# define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE1128# define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE
1121# define ATOMIC_CHAR_LOCK_FREE __CLANG_ATOMIC_CHAR_LOCK_FREE1129# define ATOMIC_CHAR_LOCK_FREE __CLANG_ATOMIC_CHAR_LOCK_FREE
1130#ifndef _LIBCPP_NO_HAS_CHAR8_T
1131# define ATOMIC_CHAR8_T_LOCK_FREE __CLANG_ATOMIC_CHAR8_T_LOCK_FREE
1132#endif
1122# define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE1133# define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
1123# define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE1134# define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE
1124# define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE1135# define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE
...@@ -1130,6 +1141,9 @@ _Tp kill_dependency(_Tp __y) _NOEXCEPT...@@ -1130,6 +1141,9 @@ _Tp kill_dependency(_Tp __y) _NOEXCEPT
1130#elif defined(__GCC_ATOMIC_BOOL_LOCK_FREE)1141#elif defined(__GCC_ATOMIC_BOOL_LOCK_FREE)
1131# define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE1142# define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
1132# define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE1143# define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
1144#ifndef _LIBCPP_NO_HAS_CHAR8_T
1145# define ATOMIC_CHAR8_T_LOCK_FREE __GCC_ATOMIC_CHAR8_T_LOCK_FREE
1146#endif
1133# define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE1147# define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
1134# define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE1148# define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
1135# define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE1149# define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
...@@ -1245,10 +1259,10 @@ template <typename _Tp>...@@ -1245,10 +1259,10 @@ template <typename _Tp>
1245_LIBCPP_INLINE_VISIBILITY1259_LIBCPP_INLINE_VISIBILITY
1246bool __cxx_atomic_compare_exchange_strong(volatile __cxx_atomic_lock_impl<_Tp>* __a,1260bool __cxx_atomic_compare_exchange_strong(volatile __cxx_atomic_lock_impl<_Tp>* __a,
1247 _Tp* __expected, _Tp __value, memory_order, memory_order) {1261 _Tp* __expected, _Tp __value, memory_order, memory_order) {
1248 __a->__lock();
1249 _Tp __temp;1262 _Tp __temp;
1263 __a->__lock();
1250 __cxx_atomic_assign_volatile(__temp, __a->__a_value);1264 __cxx_atomic_assign_volatile(__temp, __a->__a_value);
1251 bool __ret = __temp == *__expected;1265 bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
1252 if(__ret)1266 if(__ret)
1253 __cxx_atomic_assign_volatile(__a->__a_value, __value);1267 __cxx_atomic_assign_volatile(__a->__a_value, __value);
1254 else1268 else
...@@ -1261,11 +1275,11 @@ _LIBCPP_INLINE_VISIBILITY...@@ -1261,11 +1275,11 @@ _LIBCPP_INLINE_VISIBILITY
1261bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_lock_impl<_Tp>* __a,1275bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_lock_impl<_Tp>* __a,
1262 _Tp* __expected, _Tp __value, memory_order, memory_order) {1276 _Tp* __expected, _Tp __value, memory_order, memory_order) {
1263 __a->__lock();1277 __a->__lock();
1264 bool __ret = __a->__a_value == *__expected;1278 bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
1265 if(__ret)1279 if(__ret)
1266 __a->__a_value = __value;1280 _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
1267 else1281 else
1268 *__expected = __a->__a_value;1282 _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
1269 __a->__unlock();1283 __a->__unlock();
1270 return __ret;1284 return __ret;
1271}1285}
...@@ -1274,10 +1288,10 @@ template <typename _Tp>...@@ -1274,10 +1288,10 @@ template <typename _Tp>
1274_LIBCPP_INLINE_VISIBILITY1288_LIBCPP_INLINE_VISIBILITY
1275bool __cxx_atomic_compare_exchange_weak(volatile __cxx_atomic_lock_impl<_Tp>* __a,1289bool __cxx_atomic_compare_exchange_weak(volatile __cxx_atomic_lock_impl<_Tp>* __a,
1276 _Tp* __expected, _Tp __value, memory_order, memory_order) {1290 _Tp* __expected, _Tp __value, memory_order, memory_order) {
1277 __a->__lock();
1278 _Tp __temp;1291 _Tp __temp;
1292 __a->__lock();
1279 __cxx_atomic_assign_volatile(__temp, __a->__a_value);1293 __cxx_atomic_assign_volatile(__temp, __a->__a_value);
1280 bool __ret = __temp == *__expected;1294 bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
1281 if(__ret)1295 if(__ret)
1282 __cxx_atomic_assign_volatile(__a->__a_value, __value);1296 __cxx_atomic_assign_volatile(__a->__a_value, __value);
1283 else1297 else
...@@ -1290,11 +1304,11 @@ _LIBCPP_INLINE_VISIBILITY...@@ -1290,11 +1304,11 @@ _LIBCPP_INLINE_VISIBILITY
1290bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_lock_impl<_Tp>* __a,1304bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_lock_impl<_Tp>* __a,
1291 _Tp* __expected, _Tp __value, memory_order, memory_order) {1305 _Tp* __expected, _Tp __value, memory_order, memory_order) {
1292 __a->__lock();1306 __a->__lock();
1293 bool __ret = __a->__a_value == *__expected;1307 bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
1294 if(__ret)1308 if(__ret)
1295 __a->__a_value = __value;1309 _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
1296 else1310 else
1297 *__expected = __a->__a_value;1311 _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
1298 __a->__unlock();1312 __a->__unlock();
1299 return __ret;1313 return __ret;
1300}1314}
...@@ -1444,6 +1458,9 @@ template<> struct __cxx_is_always_lock_free<bool> { enum { __value = 2 == ATOMIC...@@ -1444,6 +1458,9 @@ template<> struct __cxx_is_always_lock_free<bool> { enum { __value = 2 == ATOMIC
1444template<> struct __cxx_is_always_lock_free<char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };1458template<> struct __cxx_is_always_lock_free<char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
1445template<> struct __cxx_is_always_lock_free<signed char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };1459template<> struct __cxx_is_always_lock_free<signed char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
1446template<> struct __cxx_is_always_lock_free<unsigned char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };1460template<> struct __cxx_is_always_lock_free<unsigned char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
1461#ifndef _LIBCPP_NO_HAS_CHAR8_T
1462template<> struct __cxx_is_always_lock_free<char8_t> { enum { __value = 2 == ATOMIC_CHAR8_T_LOCK_FREE }; };
1463#endif
1447template<> struct __cxx_is_always_lock_free<char16_t> { enum { __value = 2 == ATOMIC_CHAR16_T_LOCK_FREE }; };1464template<> struct __cxx_is_always_lock_free<char16_t> { enum { __value = 2 == ATOMIC_CHAR16_T_LOCK_FREE }; };
1448template<> struct __cxx_is_always_lock_free<char32_t> { enum { __value = 2 == ATOMIC_CHAR32_T_LOCK_FREE }; };1465template<> struct __cxx_is_always_lock_free<char32_t> { enum { __value = 2 == ATOMIC_CHAR32_T_LOCK_FREE }; };
1449template<> struct __cxx_is_always_lock_free<wchar_t> { enum { __value = 2 == ATOMIC_WCHAR_T_LOCK_FREE }; };1466template<> struct __cxx_is_always_lock_free<wchar_t> { enum { __value = 2 == ATOMIC_WCHAR_T_LOCK_FREE }; };
...@@ -1486,8 +1503,6 @@ struct __cxx_atomic_impl : public _Base {...@@ -1486,8 +1503,6 @@ struct __cxx_atomic_impl : public _Base {
1486 using __cxx_contention_t = int64_t;1503 using __cxx_contention_t = int64_t;
1487#endif //__linux__1504#endif //__linux__
14881505
1489#if _LIBCPP_STD_VER >= 11
1490
1491using __cxx_atomic_contention_t = __cxx_atomic_impl<__cxx_contention_t>;1506using __cxx_atomic_contention_t = __cxx_atomic_impl<__cxx_contention_t>;
14921507
1493#ifndef _LIBCPP_HAS_NO_PLATFORM_WAIT1508#ifndef _LIBCPP_HAS_NO_PLATFORM_WAIT
...@@ -1519,7 +1534,7 @@ struct __libcpp_atomic_wait_backoff_impl {...@@ -1519,7 +1534,7 @@ struct __libcpp_atomic_wait_backoff_impl {
1519 else if(__elapsed > chrono::microseconds(4))1534 else if(__elapsed > chrono::microseconds(4))
1520 __libcpp_thread_yield();1535 __libcpp_thread_yield();
1521 else1536 else
1522 ; // poll1537 {} // poll
1523 return false;1538 return false;
1524 }1539 }
1525};1540};
...@@ -1565,8 +1580,6 @@ _LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp* __a, _Tp const __val, mem...@@ -1565,8 +1580,6 @@ _LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp* __a, _Tp const __val, mem
1565 return __cxx_atomic_wait(__a, __test_fn);1580 return __cxx_atomic_wait(__a, __test_fn);
1566}1581}
15671582
1568#endif //_LIBCPP_STD_VER >= 11
1569
1570// general atomic<T>1583// general atomic<T>
15711584
1572template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value>1585template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value>
...@@ -1775,6 +1788,7 @@ struct atomic...@@ -1775,6 +1788,7 @@ struct atomic
1775{1788{
1776 typedef __atomic_base<_Tp> __base;1789 typedef __atomic_base<_Tp> __base;
1777 typedef _Tp value_type;1790 typedef _Tp value_type;
1791 typedef value_type difference_type;
1778 _LIBCPP_INLINE_VISIBILITY1792 _LIBCPP_INLINE_VISIBILITY
1779 atomic() _NOEXCEPT _LIBCPP_DEFAULT1793 atomic() _NOEXCEPT _LIBCPP_DEFAULT
1780 _LIBCPP_INLINE_VISIBILITY1794 _LIBCPP_INLINE_VISIBILITY
...@@ -1796,6 +1810,7 @@ struct atomic<_Tp*>...@@ -1796,6 +1810,7 @@ struct atomic<_Tp*>
1796{1810{
1797 typedef __atomic_base<_Tp*> __base;1811 typedef __atomic_base<_Tp*> __base;
1798 typedef _Tp* value_type;1812 typedef _Tp* value_type;
1813 typedef ptrdiff_t difference_type;
1799 _LIBCPP_INLINE_VISIBILITY1814 _LIBCPP_INLINE_VISIBILITY
1800 atomic() _NOEXCEPT _LIBCPP_DEFAULT1815 atomic() _NOEXCEPT _LIBCPP_DEFAULT
1801 _LIBCPP_INLINE_VISIBILITY1816 _LIBCPP_INLINE_VISIBILITY
...@@ -1872,7 +1887,7 @@ atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT...@@ -1872,7 +1887,7 @@ atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT
1872template <class _Tp>1887template <class _Tp>
1873_LIBCPP_INLINE_VISIBILITY1888_LIBCPP_INLINE_VISIBILITY
1874void1889void
1875atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT1890atomic_init(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
1876{1891{
1877 __cxx_atomic_init(&__o->__a_, __d);1892 __cxx_atomic_init(&__o->__a_, __d);
1878}1893}
...@@ -1880,7 +1895,7 @@ atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT...@@ -1880,7 +1895,7 @@ atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
1880template <class _Tp>1895template <class _Tp>
1881_LIBCPP_INLINE_VISIBILITY1896_LIBCPP_INLINE_VISIBILITY
1882void1897void
1883atomic_init(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT1898atomic_init(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
1884{1899{
1885 __cxx_atomic_init(&__o->__a_, __d);1900 __cxx_atomic_init(&__o->__a_, __d);
1886}1901}
...@@ -1890,7 +1905,7 @@ atomic_init(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT...@@ -1890,7 +1905,7 @@ atomic_init(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
1890template <class _Tp>1905template <class _Tp>
1891_LIBCPP_INLINE_VISIBILITY1906_LIBCPP_INLINE_VISIBILITY
1892void1907void
1893atomic_store(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT1908atomic_store(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
1894{1909{
1895 __o->store(__d);1910 __o->store(__d);
1896}1911}
...@@ -1898,7 +1913,7 @@ atomic_store(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT...@@ -1898,7 +1913,7 @@ atomic_store(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
1898template <class _Tp>1913template <class _Tp>
1899_LIBCPP_INLINE_VISIBILITY1914_LIBCPP_INLINE_VISIBILITY
1900void1915void
1901atomic_store(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT1916atomic_store(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
1902{1917{
1903 __o->store(__d);1918 __o->store(__d);
1904}1919}
...@@ -1908,7 +1923,7 @@ atomic_store(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT...@@ -1908,7 +1923,7 @@ atomic_store(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
1908template <class _Tp>1923template <class _Tp>
1909_LIBCPP_INLINE_VISIBILITY1924_LIBCPP_INLINE_VISIBILITY
1910void1925void
1911atomic_store_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT1926atomic_store_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
1912 _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)1927 _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
1913{1928{
1914 __o->store(__d, __m);1929 __o->store(__d, __m);
...@@ -1917,7 +1932,7 @@ atomic_store_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOE...@@ -1917,7 +1932,7 @@ atomic_store_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOE
1917template <class _Tp>1932template <class _Tp>
1918_LIBCPP_INLINE_VISIBILITY1933_LIBCPP_INLINE_VISIBILITY
1919void1934void
1920atomic_store_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT1935atomic_store_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
1921 _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)1936 _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
1922{1937{
1923 __o->store(__d, __m);1938 __o->store(__d, __m);
...@@ -1966,7 +1981,7 @@ atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT...@@ -1966,7 +1981,7 @@ atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
1966template <class _Tp>1981template <class _Tp>
1967_LIBCPP_INLINE_VISIBILITY1982_LIBCPP_INLINE_VISIBILITY
1968_Tp1983_Tp
1969atomic_exchange(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT1984atomic_exchange(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
1970{1985{
1971 return __o->exchange(__d);1986 return __o->exchange(__d);
1972}1987}
...@@ -1974,7 +1989,7 @@ atomic_exchange(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT...@@ -1974,7 +1989,7 @@ atomic_exchange(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
1974template <class _Tp>1989template <class _Tp>
1975_LIBCPP_INLINE_VISIBILITY1990_LIBCPP_INLINE_VISIBILITY
1976_Tp1991_Tp
1977atomic_exchange(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT1992atomic_exchange(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
1978{1993{
1979 return __o->exchange(__d);1994 return __o->exchange(__d);
1980}1995}
...@@ -1984,7 +1999,7 @@ atomic_exchange(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT...@@ -1984,7 +1999,7 @@ atomic_exchange(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
1984template <class _Tp>1999template <class _Tp>
1985_LIBCPP_INLINE_VISIBILITY2000_LIBCPP_INLINE_VISIBILITY
1986_Tp2001_Tp
1987atomic_exchange_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT2002atomic_exchange_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
1988{2003{
1989 return __o->exchange(__d, __m);2004 return __o->exchange(__d, __m);
1990}2005}
...@@ -1992,7 +2007,7 @@ atomic_exchange_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _...@@ -1992,7 +2007,7 @@ atomic_exchange_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _
1992template <class _Tp>2007template <class _Tp>
1993_LIBCPP_INLINE_VISIBILITY2008_LIBCPP_INLINE_VISIBILITY
1994_Tp2009_Tp
1995atomic_exchange_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT2010atomic_exchange_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
1996{2011{
1997 return __o->exchange(__d, __m);2012 return __o->exchange(__d, __m);
1998}2013}
...@@ -2002,7 +2017,7 @@ atomic_exchange_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT...@@ -2002,7 +2017,7 @@ atomic_exchange_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
2002template <class _Tp>2017template <class _Tp>
2003_LIBCPP_INLINE_VISIBILITY2018_LIBCPP_INLINE_VISIBILITY
2004bool2019bool
2005atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT2020atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
2006{2021{
2007 return __o->compare_exchange_weak(*__e, __d);2022 return __o->compare_exchange_weak(*__e, __d);
2008}2023}
...@@ -2010,7 +2025,7 @@ atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEX...@@ -2010,7 +2025,7 @@ atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEX
2010template <class _Tp>2025template <class _Tp>
2011_LIBCPP_INLINE_VISIBILITY2026_LIBCPP_INLINE_VISIBILITY
2012bool2027bool
2013atomic_compare_exchange_weak(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT2028atomic_compare_exchange_weak(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
2014{2029{
2015 return __o->compare_exchange_weak(*__e, __d);2030 return __o->compare_exchange_weak(*__e, __d);
2016}2031}
...@@ -2020,7 +2035,7 @@ atomic_compare_exchange_weak(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT...@@ -2020,7 +2035,7 @@ atomic_compare_exchange_weak(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
2020template <class _Tp>2035template <class _Tp>
2021_LIBCPP_INLINE_VISIBILITY2036_LIBCPP_INLINE_VISIBILITY
2022bool2037bool
2023atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT2038atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
2024{2039{
2025 return __o->compare_exchange_strong(*__e, __d);2040 return __o->compare_exchange_strong(*__e, __d);
2026}2041}
...@@ -2028,7 +2043,7 @@ atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NO...@@ -2028,7 +2043,7 @@ atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NO
2028template <class _Tp>2043template <class _Tp>
2029_LIBCPP_INLINE_VISIBILITY2044_LIBCPP_INLINE_VISIBILITY
2030bool2045bool
2031atomic_compare_exchange_strong(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT2046atomic_compare_exchange_strong(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
2032{2047{
2033 return __o->compare_exchange_strong(*__e, __d);2048 return __o->compare_exchange_strong(*__e, __d);
2034}2049}
...@@ -2038,8 +2053,8 @@ atomic_compare_exchange_strong(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT...@@ -2038,8 +2053,8 @@ atomic_compare_exchange_strong(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
2038template <class _Tp>2053template <class _Tp>
2039_LIBCPP_INLINE_VISIBILITY2054_LIBCPP_INLINE_VISIBILITY
2040bool2055bool
2041atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, _Tp* __e,2056atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
2042 _Tp __d,2057 typename atomic<_Tp>::value_type __d,
2043 memory_order __s, memory_order __f) _NOEXCEPT2058 memory_order __s, memory_order __f) _NOEXCEPT
2044 _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)2059 _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
2045{2060{
...@@ -2049,7 +2064,7 @@ atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, _Tp* __e,...@@ -2049,7 +2064,7 @@ atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, _Tp* __e,
2049template <class _Tp>2064template <class _Tp>
2050_LIBCPP_INLINE_VISIBILITY2065_LIBCPP_INLINE_VISIBILITY
2051bool2066bool
2052atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, _Tp* __e, _Tp __d,2067atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d,
2053 memory_order __s, memory_order __f) _NOEXCEPT2068 memory_order __s, memory_order __f) _NOEXCEPT
2054 _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)2069 _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
2055{2070{
...@@ -2062,7 +2077,7 @@ template <class _Tp>...@@ -2062,7 +2077,7 @@ template <class _Tp>
2062_LIBCPP_INLINE_VISIBILITY2077_LIBCPP_INLINE_VISIBILITY
2063bool2078bool
2064atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o,2079atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o,
2065 _Tp* __e, _Tp __d,2080 typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d,
2066 memory_order __s, memory_order __f) _NOEXCEPT2081 memory_order __s, memory_order __f) _NOEXCEPT
2067 _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)2082 _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
2068{2083{
...@@ -2072,8 +2087,8 @@ atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o,...@@ -2072,8 +2087,8 @@ atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o,
2072template <class _Tp>2087template <class _Tp>
2073_LIBCPP_INLINE_VISIBILITY2088_LIBCPP_INLINE_VISIBILITY
2074bool2089bool
2075atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, _Tp* __e,2090atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
2076 _Tp __d,2091 typename atomic<_Tp>::value_type __d,
2077 memory_order __s, memory_order __f) _NOEXCEPT2092 memory_order __s, memory_order __f) _NOEXCEPT
2078 _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)2093 _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
2079{2094{
...@@ -2156,10 +2171,10 @@ template <class _Tp>...@@ -2156,10 +2171,10 @@ template <class _Tp>
2156_LIBCPP_INLINE_VISIBILITY2171_LIBCPP_INLINE_VISIBILITY
2157typename enable_if2172typename enable_if
2158<2173<
2159 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2174 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
2160 _Tp2175 _Tp
2161>::type2176>::type
2162atomic_fetch_add(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT2177atomic_fetch_add(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
2163{2178{
2164 return __o->fetch_add(__op);2179 return __o->fetch_add(__op);
2165}2180}
...@@ -2168,10 +2183,10 @@ template <class _Tp>...@@ -2168,10 +2183,10 @@ template <class _Tp>
2168_LIBCPP_INLINE_VISIBILITY2183_LIBCPP_INLINE_VISIBILITY
2169typename enable_if2184typename enable_if
2170<2185<
2171 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2186 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
2172 _Tp2187 _Tp
2173>::type2188>::type
2174atomic_fetch_add(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT2189atomic_fetch_add(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
2175{2190{
2176 return __o->fetch_add(__op);2191 return __o->fetch_add(__op);
2177}2192}
...@@ -2179,7 +2194,7 @@ atomic_fetch_add(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT...@@ -2179,7 +2194,7 @@ atomic_fetch_add(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
2179template <class _Tp>2194template <class _Tp>
2180_LIBCPP_INLINE_VISIBILITY2195_LIBCPP_INLINE_VISIBILITY
2181_Tp*2196_Tp*
2182atomic_fetch_add(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT2197atomic_fetch_add(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) _NOEXCEPT
2183{2198{
2184 return __o->fetch_add(__op);2199 return __o->fetch_add(__op);
2185}2200}
...@@ -2187,7 +2202,7 @@ atomic_fetch_add(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT...@@ -2187,7 +2202,7 @@ atomic_fetch_add(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
2187template <class _Tp>2202template <class _Tp>
2188_LIBCPP_INLINE_VISIBILITY2203_LIBCPP_INLINE_VISIBILITY
2189_Tp*2204_Tp*
2190atomic_fetch_add(atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT2205atomic_fetch_add(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) _NOEXCEPT
2191{2206{
2192 return __o->fetch_add(__op);2207 return __o->fetch_add(__op);
2193}2208}
...@@ -2198,10 +2213,10 @@ template <class _Tp>...@@ -2198,10 +2213,10 @@ template <class _Tp>
2198_LIBCPP_INLINE_VISIBILITY2213_LIBCPP_INLINE_VISIBILITY
2199typename enable_if2214typename enable_if
2200<2215<
2201 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2216 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
2202 _Tp2217 _Tp
2203>::type2218>::type
2204atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT2219atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
2205{2220{
2206 return __o->fetch_add(__op, __m);2221 return __o->fetch_add(__op, __m);
2207}2222}
...@@ -2210,10 +2225,10 @@ template <class _Tp>...@@ -2210,10 +2225,10 @@ template <class _Tp>
2210_LIBCPP_INLINE_VISIBILITY2225_LIBCPP_INLINE_VISIBILITY
2211typename enable_if2226typename enable_if
2212<2227<
2213 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2228 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
2214 _Tp2229 _Tp
2215>::type2230>::type
2216atomic_fetch_add_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT2231atomic_fetch_add_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
2217{2232{
2218 return __o->fetch_add(__op, __m);2233 return __o->fetch_add(__op, __m);
2219}2234}
...@@ -2221,8 +2236,7 @@ atomic_fetch_add_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEP...@@ -2221,8 +2236,7 @@ atomic_fetch_add_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEP
2221template <class _Tp>2236template <class _Tp>
2222_LIBCPP_INLINE_VISIBILITY2237_LIBCPP_INLINE_VISIBILITY
2223_Tp*2238_Tp*
2224atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,2239atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) _NOEXCEPT
2225 memory_order __m) _NOEXCEPT
2226{2240{
2227 return __o->fetch_add(__op, __m);2241 return __o->fetch_add(__op, __m);
2228}2242}
...@@ -2230,7 +2244,7 @@ atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,...@@ -2230,7 +2244,7 @@ atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,
2230template <class _Tp>2244template <class _Tp>
2231_LIBCPP_INLINE_VISIBILITY2245_LIBCPP_INLINE_VISIBILITY
2232_Tp*2246_Tp*
2233atomic_fetch_add_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m) _NOEXCEPT2247atomic_fetch_add_explicit(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) _NOEXCEPT
2234{2248{
2235 return __o->fetch_add(__op, __m);2249 return __o->fetch_add(__op, __m);
2236}2250}
...@@ -2241,10 +2255,10 @@ template <class _Tp>...@@ -2241,10 +2255,10 @@ template <class _Tp>
2241_LIBCPP_INLINE_VISIBILITY2255_LIBCPP_INLINE_VISIBILITY
2242typename enable_if2256typename enable_if
2243<2257<
2244 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2258 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
2245 _Tp2259 _Tp
2246>::type2260>::type
2247atomic_fetch_sub(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT2261atomic_fetch_sub(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
2248{2262{
2249 return __o->fetch_sub(__op);2263 return __o->fetch_sub(__op);
2250}2264}
...@@ -2253,10 +2267,10 @@ template <class _Tp>...@@ -2253,10 +2267,10 @@ template <class _Tp>
2253_LIBCPP_INLINE_VISIBILITY2267_LIBCPP_INLINE_VISIBILITY
2254typename enable_if2268typename enable_if
2255<2269<
2256 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2270 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
2257 _Tp2271 _Tp
2258>::type2272>::type
2259atomic_fetch_sub(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT2273atomic_fetch_sub(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
2260{2274{
2261 return __o->fetch_sub(__op);2275 return __o->fetch_sub(__op);
2262}2276}
...@@ -2264,7 +2278,7 @@ atomic_fetch_sub(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT...@@ -2264,7 +2278,7 @@ atomic_fetch_sub(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
2264template <class _Tp>2278template <class _Tp>
2265_LIBCPP_INLINE_VISIBILITY2279_LIBCPP_INLINE_VISIBILITY
2266_Tp*2280_Tp*
2267atomic_fetch_sub(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT2281atomic_fetch_sub(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) _NOEXCEPT
2268{2282{
2269 return __o->fetch_sub(__op);2283 return __o->fetch_sub(__op);
2270}2284}
...@@ -2272,7 +2286,7 @@ atomic_fetch_sub(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT...@@ -2272,7 +2286,7 @@ atomic_fetch_sub(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
2272template <class _Tp>2286template <class _Tp>
2273_LIBCPP_INLINE_VISIBILITY2287_LIBCPP_INLINE_VISIBILITY
2274_Tp*2288_Tp*
2275atomic_fetch_sub(atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT2289atomic_fetch_sub(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) _NOEXCEPT
2276{2290{
2277 return __o->fetch_sub(__op);2291 return __o->fetch_sub(__op);
2278}2292}
...@@ -2283,10 +2297,10 @@ template <class _Tp>...@@ -2283,10 +2297,10 @@ template <class _Tp>
2283_LIBCPP_INLINE_VISIBILITY2297_LIBCPP_INLINE_VISIBILITY
2284typename enable_if2298typename enable_if
2285<2299<
2286 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2300 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
2287 _Tp2301 _Tp
2288>::type2302>::type
2289atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT2303atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
2290{2304{
2291 return __o->fetch_sub(__op, __m);2305 return __o->fetch_sub(__op, __m);
2292}2306}
...@@ -2295,10 +2309,10 @@ template <class _Tp>...@@ -2295,10 +2309,10 @@ template <class _Tp>
2295_LIBCPP_INLINE_VISIBILITY2309_LIBCPP_INLINE_VISIBILITY
2296typename enable_if2310typename enable_if
2297<2311<
2298 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2312 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
2299 _Tp2313 _Tp
2300>::type2314>::type
2301atomic_fetch_sub_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT2315atomic_fetch_sub_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
2302{2316{
2303 return __o->fetch_sub(__op, __m);2317 return __o->fetch_sub(__op, __m);
2304}2318}
...@@ -2306,8 +2320,7 @@ atomic_fetch_sub_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEP...@@ -2306,8 +2320,7 @@ atomic_fetch_sub_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEP
2306template <class _Tp>2320template <class _Tp>
2307_LIBCPP_INLINE_VISIBILITY2321_LIBCPP_INLINE_VISIBILITY
2308_Tp*2322_Tp*
2309atomic_fetch_sub_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,2323atomic_fetch_sub_explicit(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) _NOEXCEPT
2310 memory_order __m) _NOEXCEPT
2311{2324{
2312 return __o->fetch_sub(__op, __m);2325 return __o->fetch_sub(__op, __m);
2313}2326}
...@@ -2315,7 +2328,7 @@ atomic_fetch_sub_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,...@@ -2315,7 +2328,7 @@ atomic_fetch_sub_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,
2315template <class _Tp>2328template <class _Tp>
2316_LIBCPP_INLINE_VISIBILITY2329_LIBCPP_INLINE_VISIBILITY
2317_Tp*2330_Tp*
2318atomic_fetch_sub_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m) _NOEXCEPT2331atomic_fetch_sub_explicit(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) _NOEXCEPT
2319{2332{
2320 return __o->fetch_sub(__op, __m);2333 return __o->fetch_sub(__op, __m);
2321}2334}
...@@ -2329,7 +2342,7 @@ typename enable_if...@@ -2329,7 +2342,7 @@ typename enable_if
2329 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2342 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2330 _Tp2343 _Tp
2331>::type2344>::type
2332atomic_fetch_and(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT2345atomic_fetch_and(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
2333{2346{
2334 return __o->fetch_and(__op);2347 return __o->fetch_and(__op);
2335}2348}
...@@ -2341,7 +2354,7 @@ typename enable_if...@@ -2341,7 +2354,7 @@ typename enable_if
2341 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2354 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2342 _Tp2355 _Tp
2343>::type2356>::type
2344atomic_fetch_and(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT2357atomic_fetch_and(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
2345{2358{
2346 return __o->fetch_and(__op);2359 return __o->fetch_and(__op);
2347}2360}
...@@ -2355,7 +2368,7 @@ typename enable_if...@@ -2355,7 +2368,7 @@ typename enable_if
2355 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2368 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2356 _Tp2369 _Tp
2357>::type2370>::type
2358atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT2371atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
2359{2372{
2360 return __o->fetch_and(__op, __m);2373 return __o->fetch_and(__op, __m);
2361}2374}
...@@ -2367,7 +2380,7 @@ typename enable_if...@@ -2367,7 +2380,7 @@ typename enable_if
2367 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2380 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2368 _Tp2381 _Tp
2369>::type2382>::type
2370atomic_fetch_and_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT2383atomic_fetch_and_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
2371{2384{
2372 return __o->fetch_and(__op, __m);2385 return __o->fetch_and(__op, __m);
2373}2386}
...@@ -2381,7 +2394,7 @@ typename enable_if...@@ -2381,7 +2394,7 @@ typename enable_if
2381 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2394 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2382 _Tp2395 _Tp
2383>::type2396>::type
2384atomic_fetch_or(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT2397atomic_fetch_or(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
2385{2398{
2386 return __o->fetch_or(__op);2399 return __o->fetch_or(__op);
2387}2400}
...@@ -2393,7 +2406,7 @@ typename enable_if...@@ -2393,7 +2406,7 @@ typename enable_if
2393 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2406 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2394 _Tp2407 _Tp
2395>::type2408>::type
2396atomic_fetch_or(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT2409atomic_fetch_or(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
2397{2410{
2398 return __o->fetch_or(__op);2411 return __o->fetch_or(__op);
2399}2412}
...@@ -2407,7 +2420,7 @@ typename enable_if...@@ -2407,7 +2420,7 @@ typename enable_if
2407 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2420 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2408 _Tp2421 _Tp
2409>::type2422>::type
2410atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT2423atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
2411{2424{
2412 return __o->fetch_or(__op, __m);2425 return __o->fetch_or(__op, __m);
2413}2426}
...@@ -2419,7 +2432,7 @@ typename enable_if...@@ -2419,7 +2432,7 @@ typename enable_if
2419 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2432 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2420 _Tp2433 _Tp
2421>::type2434>::type
2422atomic_fetch_or_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT2435atomic_fetch_or_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
2423{2436{
2424 return __o->fetch_or(__op, __m);2437 return __o->fetch_or(__op, __m);
2425}2438}
...@@ -2433,7 +2446,7 @@ typename enable_if...@@ -2433,7 +2446,7 @@ typename enable_if
2433 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2446 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2434 _Tp2447 _Tp
2435>::type2448>::type
2436atomic_fetch_xor(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT2449atomic_fetch_xor(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
2437{2450{
2438 return __o->fetch_xor(__op);2451 return __o->fetch_xor(__op);
2439}2452}
...@@ -2445,7 +2458,7 @@ typename enable_if...@@ -2445,7 +2458,7 @@ typename enable_if
2445 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2458 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2446 _Tp2459 _Tp
2447>::type2460>::type
2448atomic_fetch_xor(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT2461atomic_fetch_xor(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
2449{2462{
2450 return __o->fetch_xor(__op);2463 return __o->fetch_xor(__op);
2451}2464}
...@@ -2459,7 +2472,7 @@ typename enable_if...@@ -2459,7 +2472,7 @@ typename enable_if
2459 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2472 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2460 _Tp2473 _Tp
2461>::type2474>::type
2462atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT2475atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
2463{2476{
2464 return __o->fetch_xor(__op, __m);2477 return __o->fetch_xor(__op, __m);
2465}2478}
...@@ -2471,7 +2484,7 @@ typename enable_if...@@ -2471,7 +2484,7 @@ typename enable_if
2471 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,2484 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2472 _Tp2485 _Tp
2473>::type2486>::type
2474atomic_fetch_xor_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT2487atomic_fetch_xor_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
2475{2488{
2476 return __o->fetch_xor(__op, __m);2489 return __o->fetch_xor(__op, __m);
2477}2490}
...@@ -2715,6 +2728,9 @@ typedef atomic<long> atomic_long;...@@ -2715,6 +2728,9 @@ typedef atomic<long> atomic_long;
2715typedef atomic<unsigned long> atomic_ulong;2728typedef atomic<unsigned long> atomic_ulong;
2716typedef atomic<long long> atomic_llong;2729typedef atomic<long long> atomic_llong;
2717typedef atomic<unsigned long long> atomic_ullong;2730typedef atomic<unsigned long long> atomic_ullong;
2731#ifndef _LIBCPP_NO_HAS_CHAR8_T
2732typedef atomic<char8_t> atomic_char8_t;
2733#endif
2718typedef atomic<char16_t> atomic_char16_t;2734typedef atomic<char16_t> atomic_char16_t;
2719typedef atomic<char32_t> atomic_char32_t;2735typedef atomic<char32_t> atomic_char32_t;
2720typedef atomic<wchar_t> atomic_wchar_t;2736typedef atomic<wchar_t> atomic_wchar_t;
lib/libcxx/include/barrier+10-2
...@@ -22,6 +22,8 @@ namespace std...@@ -22,6 +22,8 @@ namespace std
22 public:22 public:
23 using arrival_token = see below;23 using arrival_token = see below;
2424
25 static constexpr ptrdiff_t max() noexcept;
26
25 constexpr explicit barrier(ptrdiff_t phase_count,27 constexpr explicit barrier(ptrdiff_t phase_count,
26 CompletionFunction f = CompletionFunction());28 CompletionFunction f = CompletionFunction());
27 ~barrier();29 ~barrier();
...@@ -44,6 +46,7 @@ namespace std...@@ -44,6 +46,7 @@ namespace std
44*/46*/
4547
46#include <__config>48#include <__config>
49#include <__availability>
47#include <atomic>50#include <atomic>
48#ifndef _LIBCPP_HAS_NO_TREE_BARRIER51#ifndef _LIBCPP_HAS_NO_TREE_BARRIER
49# include <memory>52# include <memory>
...@@ -57,6 +60,9 @@ namespace std...@@ -57,6 +60,9 @@ namespace std
57# error <barrier> is not supported on this single threaded system60# error <barrier> is not supported on this single threaded system
58#endif61#endif
5962
63_LIBCPP_PUSH_MACROS
64#include <__undef_macros>
65
60#if _LIBCPP_STD_VER >= 1466#if _LIBCPP_STD_VER >= 14
6167
62_LIBCPP_BEGIN_NAMESPACE_STD68_LIBCPP_BEGIN_NAMESPACE_STD
...@@ -287,7 +293,7 @@ public:...@@ -287,7 +293,7 @@ public:
287293
288 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY294 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
289 barrier(ptrdiff_t __count, _CompletionF __completion = _CompletionF())295 barrier(ptrdiff_t __count, _CompletionF __completion = _CompletionF())
290 : __b(__count, std::move(__completion)) {296 : __b(__count, _VSTD::move(__completion)) {
291 }297 }
292298
293 barrier(barrier const&) = delete;299 barrier(barrier const&) = delete;
...@@ -301,7 +307,7 @@ public:...@@ -301,7 +307,7 @@ public:
301 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY307 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
302 void wait(arrival_token&& __phase) const308 void wait(arrival_token&& __phase) const
303 {309 {
304 __b.wait(std::move(__phase));310 __b.wait(_VSTD::move(__phase));
305 }311 }
306 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY312 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
307 void arrive_and_wait()313 void arrive_and_wait()
...@@ -319,4 +325,6 @@ _LIBCPP_END_NAMESPACE_STD...@@ -319,4 +325,6 @@ _LIBCPP_END_NAMESPACE_STD
319325
320#endif // _LIBCPP_STD_VER >= 14326#endif // _LIBCPP_STD_VER >= 14
321327
328_LIBCPP_POP_MACROS
329
322#endif //_LIBCPP_BARRIER330#endif //_LIBCPP_BARRIER
lib/libcxx/include/bit+16-132
...@@ -17,13 +17,13 @@ namespace std {...@@ -17,13 +17,13 @@ namespace std {
1717
18 // [bit.pow.two], integral powers of 218 // [bit.pow.two], integral powers of 2
19 template <class T>19 template <class T>
20 constexpr bool ispow2(T x) noexcept; // C++2020 constexpr bool has_single_bit(T x) noexcept; // C++20
21 template <class T>21 template <class T>
22 constexpr T ceil2(T x); // C++2022 constexpr T bit_ceil(T x); // C++20
23 template <class T>23 template <class T>
24 constexpr T floor2(T x) noexcept; // C++2024 constexpr T bit_floor(T x) noexcept; // C++20
25 template <class T>25 template <class T>
26 constexpr T log2p1(T x) noexcept; // C++2026 constexpr T bit_width(T x) noexcept; // C++20
2727
28 // [bit.rotate], rotating28 // [bit.rotate], rotating
29 template<class T>29 template<class T>
...@@ -55,13 +55,14 @@ namespace std {...@@ -55,13 +55,14 @@ namespace std {
55*/55*/
5656
57#include <__config>57#include <__config>
58#include <__bits>
58#include <limits>59#include <limits>
59#include <type_traits>60#include <type_traits>
60#include <version>61#include <version>
61#include <__debug>62#include <__debug>
6263
63#if defined(__IBMCPP__)64#if defined(__IBMCPP__)
64#include "support/ibm/support.h"65#include "__support/ibm/support.h"
65#endif66#endif
66#if defined(_LIBCPP_COMPILER_MSVC)67#if defined(_LIBCPP_COMPILER_MSVC)
67#include <intrin.h>68#include <intrin.h>
...@@ -76,122 +77,6 @@ _LIBCPP_PUSH_MACROS...@@ -76,122 +77,6 @@ _LIBCPP_PUSH_MACROS
7677
77_LIBCPP_BEGIN_NAMESPACE_STD78_LIBCPP_BEGIN_NAMESPACE_STD
7879
79#ifndef _LIBCPP_COMPILER_MSVC
80
81inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
82int __libcpp_ctz(unsigned __x) _NOEXCEPT { return __builtin_ctz(__x); }
83
84inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
85int __libcpp_ctz(unsigned long __x) _NOEXCEPT { return __builtin_ctzl(__x); }
86
87inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
88int __libcpp_ctz(unsigned long long __x) _NOEXCEPT { return __builtin_ctzll(__x); }
89
90
91inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
92int __libcpp_clz(unsigned __x) _NOEXCEPT { return __builtin_clz(__x); }
93
94inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
95int __libcpp_clz(unsigned long __x) _NOEXCEPT { return __builtin_clzl(__x); }
96
97inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
98int __libcpp_clz(unsigned long long __x) _NOEXCEPT { return __builtin_clzll(__x); }
99
100
101inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
102int __libcpp_popcount(unsigned __x) _NOEXCEPT { return __builtin_popcount(__x); }
103
104inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
105int __libcpp_popcount(unsigned long __x) _NOEXCEPT { return __builtin_popcountl(__x); }
106
107inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
108int __libcpp_popcount(unsigned long long __x) _NOEXCEPT { return __builtin_popcountll(__x); }
109
110#else // _LIBCPP_COMPILER_MSVC
111
112// Precondition: __x != 0
113inline _LIBCPP_INLINE_VISIBILITY
114int __libcpp_ctz(unsigned __x) {
115 static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
116 static_assert(sizeof(unsigned long) == 4, "");
117 unsigned long __where;
118 if (_BitScanForward(&__where, __x))
119 return static_cast<int>(__where);
120 return 32;
121}
122
123inline _LIBCPP_INLINE_VISIBILITY
124int __libcpp_ctz(unsigned long __x) {
125 static_assert(sizeof(unsigned long) == sizeof(unsigned), "");
126 return __ctz(static_cast<unsigned>(__x));
127}
128
129inline _LIBCPP_INLINE_VISIBILITY
130int __libcpp_ctz(unsigned long long __x) {
131 unsigned long __where;
132#if defined(_LIBCPP_HAS_BITSCAN64)
133 (defined(_M_AMD64) || defined(__x86_64__))
134 if (_BitScanForward64(&__where, __x))
135 return static_cast<int>(__where);
136#else
137 // Win32 doesn't have _BitScanForward64 so emulate it with two 32 bit calls.
138 if (_BitScanForward(&__where, static_cast<unsigned long>(__x)))
139 return static_cast<int>(__where);
140 if (_BitScanForward(&__where, static_cast<unsigned long>(__x >> 32)))
141 return static_cast<int>(__where + 32);
142#endif
143 return 64;
144}
145
146// Precondition: __x != 0
147inline _LIBCPP_INLINE_VISIBILITY
148int __libcpp_clz(unsigned __x) {
149 static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
150 static_assert(sizeof(unsigned long) == 4, "");
151 unsigned long __where;
152 if (_BitScanReverse(&__where, __x))
153 return static_cast<int>(31 - __where);
154 return 32; // Undefined Behavior.
155}
156
157inline _LIBCPP_INLINE_VISIBILITY
158int __libcpp_clz(unsigned long __x) {
159 static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
160 return __libcpp_clz(static_cast<unsigned>(__x));
161}
162
163inline _LIBCPP_INLINE_VISIBILITY
164int __libcpp_clz(unsigned long long __x) {
165 unsigned long __where;
166#if defined(_LIBCPP_HAS_BITSCAN64)
167 if (_BitScanReverse64(&__where, __x))
168 return static_cast<int>(63 - __where);
169#else
170 // Win32 doesn't have _BitScanReverse64 so emulate it with two 32 bit calls.
171 if (_BitScanReverse(&__where, static_cast<unsigned long>(__x >> 32)))
172 return static_cast<int>(63 - (__where + 32));
173 if (_BitScanReverse(&__where, static_cast<unsigned long>(__x)))
174 return static_cast<int>(63 - __where);
175#endif
176 return 64; // Undefined Behavior.
177}
178
179inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned __x) {
180 static_assert(sizeof(unsigned) == 4, "");
181 return __popcnt(__x);
182}
183
184inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned long __x) {
185 static_assert(sizeof(unsigned long) == 4, "");
186 return __popcnt(__x);
187}
188
189inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned long long __x) {
190 static_assert(sizeof(unsigned long long) == 8, "");
191 return __popcnt64(__x);
192}
193
194#endif // _LIBCPP_COMPILER_MSVC
19580
196template <class _Tp>81template <class _Tp>
197using __bitop_unsigned_integer _LIBCPP_NODEBUG_TYPE = integral_constant<bool,82using __bitop_unsigned_integer _LIBCPP_NODEBUG_TYPE = integral_constant<bool,
...@@ -343,14 +228,14 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11...@@ -343,14 +228,14 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
343unsigned __bit_log2(_Tp __t) _NOEXCEPT228unsigned __bit_log2(_Tp __t) _NOEXCEPT
344{229{
345 static_assert(__bitop_unsigned_integer<_Tp>::value, "__bit_log2 requires unsigned");230 static_assert(__bitop_unsigned_integer<_Tp>::value, "__bit_log2 requires unsigned");
346 return std::numeric_limits<_Tp>::digits - 1 - __countl_zero(__t);231 return numeric_limits<_Tp>::digits - 1 - __countl_zero(__t);
347}232}
348233
349template <class _Tp>234template <class _Tp>
350_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR235_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
351bool __ispow2(_Tp __t) _NOEXCEPT236bool __has_single_bit(_Tp __t) _NOEXCEPT
352{237{
353 static_assert(__bitop_unsigned_integer<_Tp>::value, "__ispow2 requires unsigned");238 static_assert(__bitop_unsigned_integer<_Tp>::value, "__has_single_bit requires unsigned");
354 return __t != 0 && (((__t & (__t - 1)) == 0));239 return __t != 0 && (((__t & (__t - 1)) == 0));
355}240}
356241
...@@ -399,7 +284,7 @@ _LIBCPP_INLINE_VISIBILITY constexpr...@@ -399,7 +284,7 @@ _LIBCPP_INLINE_VISIBILITY constexpr
399enable_if_t<__bitop_unsigned_integer<_Tp>::value, int>284enable_if_t<__bitop_unsigned_integer<_Tp>::value, int>
400countr_zero(_Tp __t) noexcept285countr_zero(_Tp __t) noexcept
401{286{
402 return __countr_zero(__t);287 return __countr_zero(__t);
403}288}
404289
405290
...@@ -424,15 +309,15 @@ popcount(_Tp __t) noexcept...@@ -424,15 +309,15 @@ popcount(_Tp __t) noexcept
424template <class _Tp>309template <class _Tp>
425_LIBCPP_INLINE_VISIBILITY constexpr310_LIBCPP_INLINE_VISIBILITY constexpr
426enable_if_t<__bitop_unsigned_integer<_Tp>::value, bool>311enable_if_t<__bitop_unsigned_integer<_Tp>::value, bool>
427ispow2(_Tp __t) noexcept312has_single_bit(_Tp __t) noexcept
428{313{
429 return __ispow2(__t);314 return __has_single_bit(__t);
430}315}
431316
432template <class _Tp>317template <class _Tp>
433_LIBCPP_INLINE_VISIBILITY constexpr318_LIBCPP_INLINE_VISIBILITY constexpr
434enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>319enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>
435floor2(_Tp __t) noexcept320bit_floor(_Tp __t) noexcept
436{321{
437 return __t == 0 ? 0 : _Tp{1} << __bit_log2(__t);322 return __t == 0 ? 0 : _Tp{1} << __bit_log2(__t);
438}323}
...@@ -440,11 +325,11 @@ floor2(_Tp __t) noexcept...@@ -440,11 +325,11 @@ floor2(_Tp __t) noexcept
440template <class _Tp>325template <class _Tp>
441_LIBCPP_INLINE_VISIBILITY constexpr326_LIBCPP_INLINE_VISIBILITY constexpr
442enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>327enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>
443ceil2(_Tp __t) noexcept328bit_ceil(_Tp __t) noexcept
444{329{
445 if (__t < 2) return 1;330 if (__t < 2) return 1;
446 const unsigned __n = numeric_limits<_Tp>::digits - countl_zero((_Tp)(__t - 1u));331 const unsigned __n = numeric_limits<_Tp>::digits - countl_zero((_Tp)(__t - 1u));
447 _LIBCPP_DEBUG_ASSERT(__libcpp_is_constant_evaluated() || __n != numeric_limits<_Tp>::digits, "Bad input to ceil2");332 _LIBCPP_DEBUG_ASSERT(__libcpp_is_constant_evaluated() || __n != numeric_limits<_Tp>::digits, "Bad input to bit_ceil");
448333
449 if constexpr (sizeof(_Tp) >= sizeof(unsigned))334 if constexpr (sizeof(_Tp) >= sizeof(unsigned))
450 return _Tp{1} << __n;335 return _Tp{1} << __n;
...@@ -459,12 +344,11 @@ ceil2(_Tp __t) noexcept...@@ -459,12 +344,11 @@ ceil2(_Tp __t) noexcept
459template <class _Tp>344template <class _Tp>
460_LIBCPP_INLINE_VISIBILITY constexpr345_LIBCPP_INLINE_VISIBILITY constexpr
461enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>346enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>
462log2p1(_Tp __t) noexcept347bit_width(_Tp __t) noexcept
463{348{
464 return __t == 0 ? 0 : __bit_log2(__t) + 1;349 return __t == 0 ? 0 : __bit_log2(__t) + 1;
465}350}
466351
467
468enum class endian352enum class endian
469{353{
470 little = 0xDEAD,354 little = 0xDEAD,
lib/libcxx/include/bitset+6-6
...@@ -380,7 +380,7 @@ unsigned long long...@@ -380,7 +380,7 @@ unsigned long long
380__bitset<_N_words, _Size>::to_ullong(true_type, true_type) const380__bitset<_N_words, _Size>::to_ullong(true_type, true_type) const
381{381{
382 unsigned long long __r = __first_[0];382 unsigned long long __r = __first_[0];
383 for (std::size_t __i = 1; __i < sizeof(unsigned long long) / sizeof(__storage_type); ++__i)383 for (size_t __i = 1; __i < sizeof(unsigned long long) / sizeof(__storage_type); ++__i)
384 __r |= static_cast<unsigned long long>(__first_[__i]) << (sizeof(__storage_type) * CHAR_BIT);384 __r |= static_cast<unsigned long long>(__first_[__i]) << (sizeof(__storage_type) * CHAR_BIT);
385 return __r;385 return __r;
386}386}
...@@ -625,13 +625,13 @@ protected:...@@ -625,13 +625,13 @@ protected:
625 explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long) _NOEXCEPT;625 explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long) _NOEXCEPT;
626626
627 _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT627 _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT
628 {return reference(0, 1);}628 {return reference(nullptr, 1);}
629 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t) const _NOEXCEPT629 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t) const _NOEXCEPT
630 {return const_reference(0, 1);}630 {return const_reference(nullptr, 1);}
631 _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t) _NOEXCEPT631 _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t) _NOEXCEPT
632 {return iterator(0, 0);}632 {return iterator(nullptr, 0);}
633 _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t) const _NOEXCEPT633 _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t) const _NOEXCEPT
634 {return const_iterator(0, 0);}634 {return const_iterator(nullptr, 0);}
635635
636 _LIBCPP_INLINE_VISIBILITY void operator&=(const __bitset&) _NOEXCEPT {}636 _LIBCPP_INLINE_VISIBILITY void operator&=(const __bitset&) _NOEXCEPT {}
637 _LIBCPP_INLINE_VISIBILITY void operator|=(const __bitset&) _NOEXCEPT {}637 _LIBCPP_INLINE_VISIBILITY void operator|=(const __bitset&) _NOEXCEPT {}
...@@ -990,7 +990,7 @@ inline...@@ -990,7 +990,7 @@ inline
990size_t990size_t
991bitset<_Size>::count() const _NOEXCEPT991bitset<_Size>::count() const _NOEXCEPT
992{992{
993 return static_cast<size_t>(__count_bool_true(base::__make_iter(0), _Size));993 return static_cast<size_t>(_VSTD::__count_bool_true(base::__make_iter(0), _Size));
994}994}
995995
996template <size_t _Size>996template <size_t _Size>
lib/libcxx/include/charconv+14-13
...@@ -74,12 +74,13 @@ namespace std {...@@ -74,12 +74,13 @@ namespace std {
74*/74*/
7575
76#include <__config>76#include <__config>
77#include <__availability>
77#include <__errc>78#include <__errc>
78#include <type_traits>79#include <cmath> // for log2f
80#include <cstdint>
81#include <cstring>
79#include <limits>82#include <limits>
80#include <stdint.h>83#include <type_traits>
81#include <string.h>
82#include <math.h>
8384
84#include <__debug>85#include <__debug>
8586
...@@ -206,7 +207,7 @@ __mul_overflowed(unsigned char __a, _Tp __b, unsigned char& __r)...@@ -206,7 +207,7 @@ __mul_overflowed(unsigned char __a, _Tp __b, unsigned char& __r)
206{207{
207 auto __c = __a * __b;208 auto __c = __a * __b;
208 __r = __c;209 __r = __c;
209 return __c > (numeric_limits<unsigned char>::max)();210 return __c > numeric_limits<unsigned char>::max();
210}211}
211212
212template <typename _Tp>213template <typename _Tp>
...@@ -215,7 +216,7 @@ __mul_overflowed(unsigned short __a, _Tp __b, unsigned short& __r)...@@ -215,7 +216,7 @@ __mul_overflowed(unsigned short __a, _Tp __b, unsigned short& __r)
215{216{
216 auto __c = __a * __b;217 auto __c = __a * __b;
217 __r = __c;218 __r = __c;
218 return __c > (numeric_limits<unsigned short>::max)();219 return __c > numeric_limits<unsigned short>::max();
219}220}
220221
221template <typename _Tp>222template <typename _Tp>
...@@ -226,7 +227,7 @@ __mul_overflowed(_Tp __a, _Tp __b, _Tp& __r)...@@ -226,7 +227,7 @@ __mul_overflowed(_Tp __a, _Tp __b, _Tp& __r)
226#if !defined(_LIBCPP_COMPILER_MSVC)227#if !defined(_LIBCPP_COMPILER_MSVC)
227 return __builtin_mul_overflow(__a, __b, &__r);228 return __builtin_mul_overflow(__a, __b, &__r);
228#else229#else
229 bool __did = __b && ((numeric_limits<_Tp>::max)() / __b) < __a;230 bool __did = __b && (numeric_limits<_Tp>::max() / __b) < __a;
230 __r = __a * __b;231 __r = __a * __b;
231 return __did;232 return __did;
232#endif233#endif
...@@ -332,7 +333,7 @@ __to_chars_itoa(char* __first, char* __last, _Tp __value, false_type)...@@ -332,7 +333,7 @@ __to_chars_itoa(char* __first, char* __last, _Tp __value, false_type)
332 auto __len = __p - __buf;333 auto __len = __p - __buf;
333 if (__len <= __diff)334 if (__len <= __diff)
334 {335 {
335 memcpy(__first, __buf, __len);336 _VSTD::memcpy(__first, __buf, __len);
336 return {__first + __len, {}};337 return {__first + __len, {}};
337 }338 }
338 else339 else
...@@ -381,7 +382,7 @@ __to_chars_integral(char* __first, char* __last, _Tp __value, int __base,...@@ -381,7 +382,7 @@ __to_chars_integral(char* __first, char* __last, _Tp __value, int __base,
381 return {__last, errc::value_too_large};382 return {__last, errc::value_too_large};
382 else383 else
383 {384 {
384 memmove(__first, __p, __len);385 _VSTD::memmove(__first, __p, __len);
385 return {__first + __len, {}};386 return {__first + __len, {}};
386 }387 }
387}388}
...@@ -428,13 +429,13 @@ __sign_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, _Ts... __args)...@@ -428,13 +429,13 @@ __sign_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, _Ts... __args)
428 if (__x <= __complement(__to_unsigned(__tl::min())))429 if (__x <= __complement(__to_unsigned(__tl::min())))
429 {430 {
430 __x = __complement(__x);431 __x = __complement(__x);
431 memcpy(&__value, &__x, sizeof(__x));432 _VSTD::memcpy(&__value, &__x, sizeof(__x));
432 return __r;433 return __r;
433 }434 }
434 }435 }
435 else436 else
436 {437 {
437 if (__x <= (__tl::max)())438 if (__x <= __tl::max())
438 {439 {
439 __value = __x;440 __value = __x;
440 return __r;441 return __r;
...@@ -525,7 +526,7 @@ __from_chars_atoi(const char* __first, const char* __last, _Tp& __value)...@@ -525,7 +526,7 @@ __from_chars_atoi(const char* __first, const char* __last, _Tp& __value)
525 auto __p = __tx::__read(__first, __last, __a, __b);526 auto __p = __tx::__read(__first, __last, __a, __b);
526 if (__p == __last || !__in_pattern(*__p))527 if (__p == __last || !__in_pattern(*__p))
527 {528 {
528 __output_type __m = (numeric_limits<_Tp>::max)();529 __output_type __m = numeric_limits<_Tp>::max();
529 if (__m >= __a && __m - __a >= __b)530 if (__m >= __a && __m - __a >= __b)
530 {531 {
531 __value = __a + __b;532 __value = __a + __b;
...@@ -580,7 +581,7 @@ __from_chars_integral(const char* __first, const char* __last, _Tp& __value,...@@ -580,7 +581,7 @@ __from_chars_integral(const char* __first, const char* __last, _Tp& __value,
580581
581 if (__p == __last || !__in_pattern(*__p, __base))582 if (__p == __last || !__in_pattern(*__p, __base))
582 {583 {
583 if ((__tl::max)() - __a >= __b)584 if (__tl::max() - __a >= __b)
584 {585 {
585 __value = __a + __b;586 __value = __a + __b;
586 return {__p, {}};587 return {__p, {}};
lib/libcxx/include/chrono+4-3
...@@ -824,6 +824,7 @@ constexpr chrono::year operator ""y(unsigned lo...@@ -824,6 +824,7 @@ constexpr chrono::year operator ""y(unsigned lo
824*/824*/
825825
826#include <__config>826#include <__config>
827#include <__availability>
827#include <ctime>828#include <ctime>
828#include <type_traits>829#include <type_traits>
829#include <ratio>830#include <ratio>
...@@ -1076,7 +1077,7 @@ public:...@@ -1076,7 +1077,7 @@ public:
1076 is_convertible<_Rep2, rep>::value &&1077 is_convertible<_Rep2, rep>::value &&
1077 (treat_as_floating_point<rep>::value ||1078 (treat_as_floating_point<rep>::value ||
1078 !treat_as_floating_point<_Rep2>::value)1079 !treat_as_floating_point<_Rep2>::value)
1079 >::type* = 0)1080 >::type* = nullptr)
1080 : __rep_(__r) {}1081 : __rep_(__r) {}
10811082
1082 // conversions1083 // conversions
...@@ -1089,7 +1090,7 @@ public:...@@ -1089,7 +1090,7 @@ public:
1089 treat_as_floating_point<rep>::value ||1090 treat_as_floating_point<rep>::value ||
1090 (__no_overflow<_Period2, period>::type::den == 1 &&1091 (__no_overflow<_Period2, period>::type::den == 1 &&
1091 !treat_as_floating_point<_Rep2>::value))1092 !treat_as_floating_point<_Rep2>::value))
1092 >::type* = 0)1093 >::type* = nullptr)
1093 : __rep_(_VSTD::chrono::duration_cast<duration>(__d).count()) {}1094 : __rep_(_VSTD::chrono::duration_cast<duration>(__d).count()) {}
10941095
1095 // observer1096 // observer
...@@ -1375,7 +1376,7 @@ public:...@@ -1375,7 +1376,7 @@ public:
1375 typename enable_if1376 typename enable_if
1376 <1377 <
1377 is_convertible<_Duration2, duration>::value1378 is_convertible<_Duration2, duration>::value
1378 >::type* = 0)1379 >::type* = nullptr)
1379 : __d_(t.time_since_epoch()) {}1380 : __d_(t.time_since_epoch()) {}
13801381
1381 // observer1382 // observer
lib/libcxx/include/cmath+2-2
...@@ -660,8 +660,8 @@ _LIBCPP_CONSTEXPR _IntT __max_representable_int_for_float() _NOEXCEPT {...@@ -660,8 +660,8 @@ _LIBCPP_CONSTEXPR _IntT __max_representable_int_for_float() _NOEXCEPT {
660template <class _IntT, class _RealT>660template <class _IntT, class _RealT>
661_LIBCPP_INLINE_VISIBILITY661_LIBCPP_INLINE_VISIBILITY
662_IntT __clamp_to_integral(_RealT __r) _NOEXCEPT {662_IntT __clamp_to_integral(_RealT __r) _NOEXCEPT {
663 using _Lim = std::numeric_limits<_IntT>;663 using _Lim = numeric_limits<_IntT>;
664 const _IntT _MaxVal = std::__max_representable_int_for_float<_IntT, _RealT>();664 const _IntT _MaxVal = __max_representable_int_for_float<_IntT, _RealT>();
665 if (__r >= ::nextafter(static_cast<_RealT>(_MaxVal), INFINITY)) {665 if (__r >= ::nextafter(static_cast<_RealT>(_MaxVal), INFINITY)) {
666 return _Lim::max();666 return _Lim::max();
667 } else if (__r <= _Lim::lowest()) {667 } else if (__r <= _Lim::lowest()) {
lib/libcxx/include/codecvt+24
...@@ -109,6 +109,7 @@ protected:...@@ -109,6 +109,7 @@ protected:
109 virtual int do_max_length() const _NOEXCEPT;109 virtual int do_max_length() const _NOEXCEPT;
110};110};
111111
112_LIBCPP_SUPPRESS_DEPRECATED_PUSH
112template <>113template <>
113class _LIBCPP_TYPE_VIS __codecvt_utf8<char16_t>114class _LIBCPP_TYPE_VIS __codecvt_utf8<char16_t>
114 : public codecvt<char16_t, char, mbstate_t>115 : public codecvt<char16_t, char, mbstate_t>
...@@ -125,6 +126,8 @@ public:...@@ -125,6 +126,8 @@ public:
125 codecvt_mode _Mode)126 codecvt_mode _Mode)
126 : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),127 : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
127 _Mode_(_Mode) {}128 _Mode_(_Mode) {}
129_LIBCPP_SUPPRESS_DEPRECATED_POP
130
128protected:131protected:
129 virtual result132 virtual result
130 do_out(state_type& __st,133 do_out(state_type& __st,
...@@ -144,6 +147,7 @@ protected:...@@ -144,6 +147,7 @@ protected:
144 virtual int do_max_length() const _NOEXCEPT;147 virtual int do_max_length() const _NOEXCEPT;
145};148};
146149
150_LIBCPP_SUPPRESS_DEPRECATED_PUSH
147template <>151template <>
148class _LIBCPP_TYPE_VIS __codecvt_utf8<char32_t>152class _LIBCPP_TYPE_VIS __codecvt_utf8<char32_t>
149 : public codecvt<char32_t, char, mbstate_t>153 : public codecvt<char32_t, char, mbstate_t>
...@@ -160,6 +164,8 @@ public:...@@ -160,6 +164,8 @@ public:
160 codecvt_mode _Mode)164 codecvt_mode _Mode)
161 : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),165 : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
162 _Mode_(_Mode) {}166 _Mode_(_Mode) {}
167_LIBCPP_SUPPRESS_DEPRECATED_POP
168
163protected:169protected:
164 virtual result170 virtual result
165 do_out(state_type& __st,171 do_out(state_type& __st,
...@@ -267,6 +273,7 @@ protected:...@@ -267,6 +273,7 @@ protected:
267 virtual int do_max_length() const _NOEXCEPT;273 virtual int do_max_length() const _NOEXCEPT;
268};274};
269275
276_LIBCPP_SUPPRESS_DEPRECATED_PUSH
270template <>277template <>
271class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, false>278class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, false>
272 : public codecvt<char16_t, char, mbstate_t>279 : public codecvt<char16_t, char, mbstate_t>
...@@ -283,6 +290,8 @@ public:...@@ -283,6 +290,8 @@ public:
283 codecvt_mode _Mode)290 codecvt_mode _Mode)
284 : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),291 : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
285 _Mode_(_Mode) {}292 _Mode_(_Mode) {}
293_LIBCPP_SUPPRESS_DEPRECATED_POP
294
286protected:295protected:
287 virtual result296 virtual result
288 do_out(state_type& __st,297 do_out(state_type& __st,
...@@ -302,6 +311,7 @@ protected:...@@ -302,6 +311,7 @@ protected:
302 virtual int do_max_length() const _NOEXCEPT;311 virtual int do_max_length() const _NOEXCEPT;
303};312};
304313
314_LIBCPP_SUPPRESS_DEPRECATED_PUSH
305template <>315template <>
306class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, true>316class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, true>
307 : public codecvt<char16_t, char, mbstate_t>317 : public codecvt<char16_t, char, mbstate_t>
...@@ -318,6 +328,8 @@ public:...@@ -318,6 +328,8 @@ public:
318 codecvt_mode _Mode)328 codecvt_mode _Mode)
319 : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),329 : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
320 _Mode_(_Mode) {}330 _Mode_(_Mode) {}
331_LIBCPP_SUPPRESS_DEPRECATED_POP
332
321protected:333protected:
322 virtual result334 virtual result
323 do_out(state_type& __st,335 do_out(state_type& __st,
...@@ -337,6 +349,7 @@ protected:...@@ -337,6 +349,7 @@ protected:
337 virtual int do_max_length() const _NOEXCEPT;349 virtual int do_max_length() const _NOEXCEPT;
338};350};
339351
352_LIBCPP_SUPPRESS_DEPRECATED_PUSH
340template <>353template <>
341class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, false>354class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, false>
342 : public codecvt<char32_t, char, mbstate_t>355 : public codecvt<char32_t, char, mbstate_t>
...@@ -353,6 +366,8 @@ public:...@@ -353,6 +366,8 @@ public:
353 codecvt_mode _Mode)366 codecvt_mode _Mode)
354 : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),367 : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
355 _Mode_(_Mode) {}368 _Mode_(_Mode) {}
369_LIBCPP_SUPPRESS_DEPRECATED_POP
370
356protected:371protected:
357 virtual result372 virtual result
358 do_out(state_type& __st,373 do_out(state_type& __st,
...@@ -372,6 +387,7 @@ protected:...@@ -372,6 +387,7 @@ protected:
372 virtual int do_max_length() const _NOEXCEPT;387 virtual int do_max_length() const _NOEXCEPT;
373};388};
374389
390_LIBCPP_SUPPRESS_DEPRECATED_PUSH
375template <>391template <>
376class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, true>392class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, true>
377 : public codecvt<char32_t, char, mbstate_t>393 : public codecvt<char32_t, char, mbstate_t>
...@@ -388,6 +404,8 @@ public:...@@ -388,6 +404,8 @@ public:
388 codecvt_mode _Mode)404 codecvt_mode _Mode)
389 : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),405 : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
390 _Mode_(_Mode) {}406 _Mode_(_Mode) {}
407_LIBCPP_SUPPRESS_DEPRECATED_POP
408
391protected:409protected:
392 virtual result410 virtual result
393 do_out(state_type& __st,411 do_out(state_type& __st,
...@@ -460,6 +478,7 @@ protected:...@@ -460,6 +478,7 @@ protected:
460 virtual int do_max_length() const _NOEXCEPT;478 virtual int do_max_length() const _NOEXCEPT;
461};479};
462480
481_LIBCPP_SUPPRESS_DEPRECATED_PUSH
463template <>482template <>
464class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char32_t>483class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char32_t>
465 : public codecvt<char32_t, char, mbstate_t>484 : public codecvt<char32_t, char, mbstate_t>
...@@ -476,6 +495,8 @@ public:...@@ -476,6 +495,8 @@ public:
476 codecvt_mode _Mode)495 codecvt_mode _Mode)
477 : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),496 : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
478 _Mode_(_Mode) {}497 _Mode_(_Mode) {}
498_LIBCPP_SUPPRESS_DEPRECATED_POP
499
479protected:500protected:
480 virtual result501 virtual result
481 do_out(state_type& __st,502 do_out(state_type& __st,
...@@ -495,6 +516,7 @@ protected:...@@ -495,6 +516,7 @@ protected:
495 virtual int do_max_length() const _NOEXCEPT;516 virtual int do_max_length() const _NOEXCEPT;
496};517};
497518
519_LIBCPP_SUPPRESS_DEPRECATED_PUSH
498template <>520template <>
499class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char16_t>521class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char16_t>
500 : public codecvt<char16_t, char, mbstate_t>522 : public codecvt<char16_t, char, mbstate_t>
...@@ -511,6 +533,8 @@ public:...@@ -511,6 +533,8 @@ public:
511 codecvt_mode _Mode)533 codecvt_mode _Mode)
512 : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),534 : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
513 _Mode_(_Mode) {}535 _Mode_(_Mode) {}
536_LIBCPP_SUPPRESS_DEPRECATED_POP
537
514protected:538protected:
515 virtual result539 virtual result
516 do_out(state_type& __st,540 do_out(state_type& __st,
lib/libcxx/include/compare+9-4
...@@ -154,8 +154,13 @@ enum class _LIBCPP_ENUM_VIS _NCmpResult : signed char {...@@ -154,8 +154,13 @@ enum class _LIBCPP_ENUM_VIS _NCmpResult : signed char {
154 __unordered = -127154 __unordered = -127
155};155};
156156
157struct _CmpUnspecifiedType;157struct _CmpUnspecifiedParam {
158using _CmpUnspecifiedParam = void (_CmpUnspecifiedType::*)();158 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEVAL
159 _CmpUnspecifiedParam(int _CmpUnspecifiedParam::*) noexcept {}
160
161 template<typename _Tp, typename = _VSTD::enable_if_t<!_VSTD::is_same_v<_Tp, int>>>
162 _CmpUnspecifiedParam(_Tp) = delete;
163};
159164
160class weak_equality {165class weak_equality {
161 _LIBCPP_INLINE_VISIBILITY166 _LIBCPP_INLINE_VISIBILITY
...@@ -696,8 +701,8 @@ constexpr _ClassifyCompCategory __type_to_enum() noexcept {...@@ -696,8 +701,8 @@ constexpr _ClassifyCompCategory __type_to_enum() noexcept {
696701
697template <size_t _Size>702template <size_t _Size>
698constexpr _ClassifyCompCategory703constexpr _ClassifyCompCategory
699__compute_comp_type(std::array<_ClassifyCompCategory, _Size> __types) {704__compute_comp_type(array<_ClassifyCompCategory, _Size> __types) {
700 std::array<int, _CCC_Size> __seen = {};705 array<int, _CCC_Size> __seen = {};
701 for (auto __type : __types)706 for (auto __type : __types)
702 ++__seen[__type];707 ++__seen[__type];
703 if (__seen[_None])708 if (__seen[_None])
lib/libcxx/include/complex+7-10
...@@ -227,14 +227,6 @@ template<class T> complex<T> sqrt (const complex<T>&);...@@ -227,14 +227,6 @@ template<class T> complex<T> sqrt (const complex<T>&);
227template<class T> complex<T> tan (const complex<T>&);227template<class T> complex<T> tan (const complex<T>&);
228template<class T> complex<T> tanh (const complex<T>&);228template<class T> complex<T> tanh (const complex<T>&);
229229
230template<class T, class charT, class traits>
231 basic_istream<charT, traits>&
232 operator>>(basic_istream<charT, traits>& is, complex<T>& x);
233
234template<class T, class charT, class traits>
235 basic_ostream<charT, traits>&
236 operator<<(basic_ostream<charT, traits>& o, const complex<T>& x);
237
238} // std230} // std
239231
240*/232*/
...@@ -244,9 +236,12 @@ template<class T, class charT, class traits>...@@ -244,9 +236,12 @@ template<class T, class charT, class traits>
244#include <stdexcept>236#include <stdexcept>
245#include <cmath>237#include <cmath>
246#include <iosfwd>238#include <iosfwd>
247#include <sstream>
248#include <version>239#include <version>
249240
241#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
242# include <sstream> // for std::basic_ostringstream
243#endif
244
250#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)245#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
251#pragma GCC system_header246#pragma GCC system_header
252#endif247#endif
...@@ -955,7 +950,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -955,7 +950,7 @@ inline _LIBCPP_INLINE_VISIBILITY
955complex<_Tp>950complex<_Tp>
956proj(const complex<_Tp>& __c)951proj(const complex<_Tp>& __c)
957{952{
958 std::complex<_Tp> __r = __c;953 complex<_Tp> __r = __c;
959 if (__libcpp_isinf_or_builtin(__c.real()) || __libcpp_isinf_or_builtin(__c.imag()))954 if (__libcpp_isinf_or_builtin(__c.real()) || __libcpp_isinf_or_builtin(__c.imag()))
960 __r = complex<_Tp>(INFINITY, copysign(_Tp(0), __c.imag()));955 __r = complex<_Tp>(INFINITY, copysign(_Tp(0), __c.imag()));
961 return __r;956 return __r;
...@@ -1438,6 +1433,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)...@@ -1438,6 +1433,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
1438 return __is;1433 return __is;
1439}1434}
14401435
1436#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
1441template<class _Tp, class _CharT, class _Traits>1437template<class _Tp, class _CharT, class _Traits>
1442basic_ostream<_CharT, _Traits>&1438basic_ostream<_CharT, _Traits>&
1443operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)1439operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
...@@ -1449,6 +1445,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)...@@ -1449,6 +1445,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
1449 __s << '(' << __x.real() << ',' << __x.imag() << ')';1445 __s << '(' << __x.real() << ',' << __x.imag() << ')';
1450 return __os << __s.str();1446 return __os << __s.str();
1451}1447}
1448#endif // !_LIBCPP_HAS_NO_LOCALIZATION
14521449
1453#if _LIBCPP_STD_VER > 111450#if _LIBCPP_STD_VER > 11
1454// Literal suffix for complex number literals [complex.literals]1451// Literal suffix for complex number literals [complex.literals]
lib/libcxx/include/concepts+5
...@@ -157,6 +157,11 @@ concept __same_as_impl = _VSTD::_IsSame<_Tp, _Up>::value;...@@ -157,6 +157,11 @@ concept __same_as_impl = _VSTD::_IsSame<_Tp, _Up>::value;
157template<class _Tp, class _Up>157template<class _Tp, class _Up>
158concept same_as = __same_as_impl<_Tp, _Up> && __same_as_impl<_Up, _Tp>;158concept same_as = __same_as_impl<_Tp, _Up> && __same_as_impl<_Up, _Tp>;
159159
160// [concept.destructible]
161
162template<class _Tp>
163concept destructible = _VSTD::is_nothrow_destructible_v<_Tp>;
164
160#endif //_LIBCPP_STD_VER > 17 && defined(__cpp_concepts) && __cpp_concepts >= 201811L165#endif //_LIBCPP_STD_VER > 17 && defined(__cpp_concepts) && __cpp_concepts >= 201811L
161166
162_LIBCPP_END_NAMESPACE_STD167_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/ctime+15-1
...@@ -52,6 +52,20 @@ int timespec_get( struct timespec *ts, int base); // C++17...@@ -52,6 +52,20 @@ int timespec_get( struct timespec *ts, int base); // C++17
52#pragma GCC system_header52#pragma GCC system_header
53#endif53#endif
5454
55// FIXME:
56// Apple SDKs don't define ::timespec_get unconditionally in C++ mode. This
57// should be fixed in future SDKs, but for the time being we need to avoid
58// trying to use that declaration when the SDK doesn't provide it. Note that
59// we're detecting this here instead of in <__config> because we can't include
60// system headers from <__config>, since it leads to circular module dependencies.
61// This is also meant to be a very temporary workaround until the SDKs are fixed.
62#if defined(__APPLE__)
63# include <sys/cdefs.h>
64# if defined(_LIBCPP_HAS_TIMESPEC_GET) && (__DARWIN_C_LEVEL < __DARWIN_C_FULL)
65# define _LIBCPP_HAS_TIMESPEC_GET_NOT_ACTUALLY_PROVIDED
66# endif
67#endif
68
55_LIBCPP_BEGIN_NAMESPACE_STD69_LIBCPP_BEGIN_NAMESPACE_STD
5670
57using ::clock_t;71using ::clock_t;
...@@ -72,7 +86,7 @@ using ::gmtime;...@@ -72,7 +86,7 @@ using ::gmtime;
72using ::localtime;86using ::localtime;
73#endif87#endif
74using ::strftime;88using ::strftime;
75#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET)89#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET) && !defined(_LIBCPP_HAS_TIMESPEC_GET_NOT_ACTUALLY_PROVIDED)
76using ::timespec_get;90using ::timespec_get;
77#endif91#endif
7892
lib/libcxx/include/deque+8-8
...@@ -1237,7 +1237,7 @@ __deque_base<_Tp, _Allocator>::swap(__deque_base& __c)...@@ -1237,7 +1237,7 @@ __deque_base<_Tp, _Allocator>::swap(__deque_base& __c)
1237 __map_.swap(__c.__map_);1237 __map_.swap(__c.__map_);
1238 _VSTD::swap(__start_, __c.__start_);1238 _VSTD::swap(__start_, __c.__start_);
1239 _VSTD::swap(size(), __c.size());1239 _VSTD::swap(size(), __c.size());
1240 __swap_allocator(__alloc(), __c.__alloc());1240 _VSTD::__swap_allocator(__alloc(), __c.__alloc());
1241}1241}
12421242
1243template <class _Tp, class _Allocator>1243template <class _Tp, class _Allocator>
...@@ -1393,7 +1393,7 @@ public:...@@ -1393,7 +1393,7 @@ public:
1393 size_type size() const _NOEXCEPT {return __base::size();}1393 size_type size() const _NOEXCEPT {return __base::size();}
1394 _LIBCPP_INLINE_VISIBILITY1394 _LIBCPP_INLINE_VISIBILITY
1395 size_type max_size() const _NOEXCEPT1395 size_type max_size() const _NOEXCEPT
1396 {return std::min<size_type>(1396 {return _VSTD::min<size_type>(
1397 __alloc_traits::max_size(__base::__alloc()),1397 __alloc_traits::max_size(__base::__alloc()),
1398 numeric_limits<difference_type>::max());}1398 numeric_limits<difference_type>::max());}
1399 void resize(size_type __n);1399 void resize(size_type __n);
...@@ -1586,7 +1586,7 @@ public:...@@ -1586,7 +1586,7 @@ public:
15861586
1587#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES1587#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
1588template<class _InputIterator,1588template<class _InputIterator,
1589 class _Alloc = typename std::allocator<typename iterator_traits<_InputIterator>::value_type>,1589 class _Alloc = allocator<typename iterator_traits<_InputIterator>::value_type>,
1590 class = typename enable_if<__is_allocator<_Alloc>::value, void>::type1590 class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
1591 >1591 >
1592deque(_InputIterator, _InputIterator)1592deque(_InputIterator, _InputIterator)
...@@ -2376,7 +2376,7 @@ deque<_Tp, _Allocator>::__append(_ForIter __f, _ForIter __l,...@@ -2376,7 +2376,7 @@ deque<_Tp, _Allocator>::__append(_ForIter __f, _ForIter __l,
2376 for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {2376 for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
2377 _ConstructTransaction __tx(this, __br);2377 _ConstructTransaction __tx(this, __br);
2378 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, (void)++__f) {2378 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, (void)++__f) {
2379 __alloc_traits::construct(__a, std::__to_address(__tx.__pos_), *__f);2379 __alloc_traits::construct(__a, _VSTD::__to_address(__tx.__pos_), *__f);
2380 }2380 }
2381 }2381 }
2382}2382}
...@@ -2393,7 +2393,7 @@ deque<_Tp, _Allocator>::__append(size_type __n)...@@ -2393,7 +2393,7 @@ deque<_Tp, _Allocator>::__append(size_type __n)
2393 for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {2393 for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
2394 _ConstructTransaction __tx(this, __br);2394 _ConstructTransaction __tx(this, __br);
2395 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {2395 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {
2396 __alloc_traits::construct(__a, std::__to_address(__tx.__pos_));2396 __alloc_traits::construct(__a, _VSTD::__to_address(__tx.__pos_));
2397 }2397 }
2398 }2398 }
2399}2399}
...@@ -2410,7 +2410,7 @@ deque<_Tp, _Allocator>::__append(size_type __n, const value_type& __v)...@@ -2410,7 +2410,7 @@ deque<_Tp, _Allocator>::__append(size_type __n, const value_type& __v)
2410 for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {2410 for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
2411 _ConstructTransaction __tx(this, __br);2411 _ConstructTransaction __tx(this, __br);
2412 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {2412 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) {
2413 __alloc_traits::construct(__a, std::__to_address(__tx.__pos_), __v);2413 __alloc_traits::construct(__a, _VSTD::__to_address(__tx.__pos_), __v);
2414 }2414 }
2415 }2415 }
24162416
...@@ -2708,7 +2708,7 @@ void...@@ -2708,7 +2708,7 @@ void
2708deque<_Tp, _Allocator>::pop_front()2708deque<_Tp, _Allocator>::pop_front()
2709{2709{
2710 allocator_type& __a = __base::__alloc();2710 allocator_type& __a = __base::__alloc();
2711 __alloc_traits::destroy(__a, __to_address(*(__base::__map_.begin() +2711 __alloc_traits::destroy(__a, _VSTD::__to_address(*(__base::__map_.begin() +
2712 __base::__start_ / __base::__block_size) +2712 __base::__start_ / __base::__block_size) +
2713 __base::__start_ % __base::__block_size));2713 __base::__start_ % __base::__block_size));
2714 --__base::size();2714 --__base::size();
...@@ -2723,7 +2723,7 @@ deque<_Tp, _Allocator>::pop_back()...@@ -2723,7 +2723,7 @@ deque<_Tp, _Allocator>::pop_back()
2723 _LIBCPP_ASSERT(!empty(), "deque::pop_back called for empty deque");2723 _LIBCPP_ASSERT(!empty(), "deque::pop_back called for empty deque");
2724 allocator_type& __a = __base::__alloc();2724 allocator_type& __a = __base::__alloc();
2725 size_type __p = __base::size() + __base::__start_ - 1;2725 size_type __p = __base::size() + __base::__start_ - 1;
2726 __alloc_traits::destroy(__a, __to_address(*(__base::__map_.begin() +2726 __alloc_traits::destroy(__a, _VSTD::__to_address(*(__base::__map_.begin() +
2727 __p / __base::__block_size) +2727 __p / __base::__block_size) +
2728 __p % __base::__block_size));2728 __p % __base::__block_size));
2729 --__base::size();2729 --__base::size();
lib/libcxx/include/exception+2
...@@ -77,6 +77,8 @@ template <class E> void rethrow_if_nested(const E& e);...@@ -77,6 +77,8 @@ template <class E> void rethrow_if_nested(const E& e);
77*/77*/
7878
79#include <__config>79#include <__config>
80#include <__availability>
81#include <__memory/base.h>
80#include <cstddef>82#include <cstddef>
81#include <cstdlib>83#include <cstdlib>
82#include <type_traits>84#include <type_traits>
lib/libcxx/include/experimental/memory_resource+2-3
...@@ -116,7 +116,7 @@ public:...@@ -116,7 +116,7 @@ public:
116 { return do_is_equal(__other); }116 { return do_is_equal(__other); }
117117
118// 8.5.3, memory.resource.priv118// 8.5.3, memory.resource.priv
119protected:119private:
120 virtual void* do_allocate(size_t, size_t) = 0;120 virtual void* do_allocate(size_t, size_t) = 0;
121 virtual void do_deallocate(void*, size_t, size_t) = 0;121 virtual void do_deallocate(void*, size_t, size_t) = 0;
122 virtual bool do_is_equal(memory_resource const &) const _NOEXCEPT = 0;122 virtual bool do_is_equal(memory_resource const &) const _NOEXCEPT = 0;
...@@ -381,7 +381,7 @@ public:...@@ -381,7 +381,7 @@ public:
381 { return __alloc_; }381 { return __alloc_; }
382382
383// 8.7.3, memory.resource.adaptor.mem383// 8.7.3, memory.resource.adaptor.mem
384protected:384private:
385 virtual void * do_allocate(size_t __bytes, size_t)385 virtual void * do_allocate(size_t __bytes, size_t)
386 {386 {
387 if (__bytes > __max_size()) {387 if (__bytes > __max_size()) {
...@@ -407,7 +407,6 @@ protected:...@@ -407,7 +407,6 @@ protected:
407 return __p ? __alloc_ == __p->__alloc_ : false;407 return __p ? __alloc_ == __p->__alloc_ : false;
408 }408 }
409409
410private:
411 _LIBCPP_INLINE_VISIBILITY410 _LIBCPP_INLINE_VISIBILITY
412 size_t __max_size() const _NOEXCEPT {411 size_t __max_size() const _NOEXCEPT {
413 return numeric_limits<size_t>::max() - _MaxAlign;412 return numeric_limits<size_t>::max() - _MaxAlign;
lib/libcxx/include/experimental/simd+5
...@@ -659,6 +659,9 @@ public:...@@ -659,6 +659,9 @@ public:
659#pragma GCC system_header659#pragma GCC system_header
660#endif660#endif
661661
662_LIBCPP_PUSH_MACROS
663#include <__undef_macros>
664
662_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD665_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD
663666
664#if _LIBCPP_STD_VER >= 17667#if _LIBCPP_STD_VER >= 17
...@@ -1566,4 +1569,6 @@ public:...@@ -1566,4 +1569,6 @@ public:
15661569
1567_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD1570_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD
15681571
1572_LIBCPP_POP_MACROS
1573
1569#endif /* _LIBCPP_EXPERIMENTAL_SIMD */1574#endif /* _LIBCPP_EXPERIMENTAL_SIMD */
lib/libcxx/include/ext/hash_map+1-1
...@@ -671,7 +671,7 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k)...@@ -671,7 +671,7 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k)
671 __h.get_deleter().__first_constructed = true;671 __h.get_deleter().__first_constructed = true;
672 __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));672 __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
673 __h.get_deleter().__second_constructed = true;673 __h.get_deleter().__second_constructed = true;
674 return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03674 return __h;
675}675}
676676
677template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>677template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
lib/libcxx/include/filesystem+346-59
...@@ -230,23 +230,31 @@...@@ -230,23 +230,31 @@
230*/230*/
231231
232#include <__config>232#include <__config>
233#include <__availability>
233#include <cstddef>234#include <cstddef>
234#include <cstdlib>235#include <cstdlib>
235#include <chrono>236#include <chrono>
236#include <iterator>237#include <iterator>
237#include <iosfwd>238#include <iosfwd>
238#include <locale>
239#include <memory>239#include <memory>
240#include <stack>240#include <stack>
241#include <string>241#include <string>
242#include <system_error>242#include <system_error>
243#include <utility>243#include <utility>
244#include <iomanip> // for quoted
245#include <string_view>244#include <string_view>
246#include <version>245#include <version>
247246
247#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
248# include <locale>
249# include <iomanip> // for quoted
250#endif
251
248#include <__debug>252#include <__debug>
249253
254#if defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
255# error "The Filesystem library is not supported by this configuration of libc++"
256#endif
257
250#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)258#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
251#pragma GCC system_header259#pragma GCC system_header
252#endif260#endif
...@@ -543,6 +551,13 @@ struct __can_convert_char<wchar_t> {...@@ -543,6 +551,13 @@ struct __can_convert_char<wchar_t> {
543 static const bool value = true;551 static const bool value = true;
544 using __char_type = wchar_t;552 using __char_type = wchar_t;
545};553};
554#ifndef _LIBCPP_NO_HAS_CHAR8_T
555template <>
556struct __can_convert_char<char8_t> {
557 static const bool value = true;
558 using __char_type = char8_t;
559};
560#endif
546template <>561template <>
547struct __can_convert_char<char16_t> {562struct __can_convert_char<char16_t> {
548 static const bool value = true;563 static const bool value = true;
...@@ -557,10 +572,20 @@ struct __can_convert_char<char32_t> {...@@ -557,10 +572,20 @@ struct __can_convert_char<char32_t> {
557template <class _ECharT>572template <class _ECharT>
558typename enable_if<__can_convert_char<_ECharT>::value, bool>::type573typename enable_if<__can_convert_char<_ECharT>::value, bool>::type
559__is_separator(_ECharT __e) {574__is_separator(_ECharT __e) {
575#if defined(_LIBCPP_WIN32API)
576 return __e == _ECharT('/') || __e == _ECharT('\\');
577#else
560 return __e == _ECharT('/');578 return __e == _ECharT('/');
579#endif
561}580}
562581
563struct _NullSentinal {};582#ifndef _LIBCPP_NO_HAS_CHAR8_T
583typedef u8string __u8_string;
584#else
585typedef string __u8_string;
586#endif
587
588struct _NullSentinel {};
564589
565template <class _Tp>590template <class _Tp>
566using _Void = void;591using _Void = void;
...@@ -615,9 +640,9 @@ struct __is_pathable_char_array<_Source, _ECharT*, _UPtr, true>...@@ -615,9 +640,9 @@ struct __is_pathable_char_array<_Source, _ECharT*, _UPtr, true>
615 static _ECharT const* __range_begin(const _ECharT* __b) { return __b; }640 static _ECharT const* __range_begin(const _ECharT* __b) { return __b; }
616 static _ECharT const* __range_end(const _ECharT* __b) {641 static _ECharT const* __range_end(const _ECharT* __b) {
617 using _Iter = const _ECharT*;642 using _Iter = const _ECharT*;
618 const _ECharT __sentinal = _ECharT{};643 const _ECharT __sentinel = _ECharT{};
619 _Iter __e = __b;644 _Iter __e = __b;
620 for (; *__e != __sentinal; ++__e)645 for (; *__e != __sentinel; ++__e)
621 ;646 ;
622 return __e;647 return __e;
623 }648 }
...@@ -639,7 +664,7 @@ struct __is_pathable_iter<...@@ -639,7 +664,7 @@ struct __is_pathable_iter<
639 using _Base = __can_convert_char<_ECharT>;664 using _Base = __can_convert_char<_ECharT>;
640665
641 static _Iter __range_begin(_Iter __b) { return __b; }666 static _Iter __range_begin(_Iter __b) { return __b; }
642 static _NullSentinal __range_end(_Iter) { return _NullSentinal{}; }667 static _NullSentinel __range_end(_Iter) { return _NullSentinel{}; }
643668
644 static _ECharT __first_or_null(_Iter __b) { return *__b; }669 static _ECharT __first_or_null(_Iter __b) { return *__b; }
645};670};
...@@ -661,80 +686,219 @@ struct __is_pathable<_Tp, false, true, false> : __is_pathable_char_array<_Tp> {...@@ -661,80 +686,219 @@ struct __is_pathable<_Tp, false, true, false> : __is_pathable_char_array<_Tp> {
661template <class _Tp>686template <class _Tp>
662struct __is_pathable<_Tp, false, false, true> : __is_pathable_iter<_Tp> {};687struct __is_pathable<_Tp, false, false, true> : __is_pathable_iter<_Tp> {};
663688
689#if defined(_LIBCPP_WIN32API)
690typedef wstring __path_string;
691typedef wchar_t __path_value;
692#else
693typedef string __path_string;
694typedef char __path_value;
695#endif
696
697#if defined(_LIBCPP_WIN32API)
698_LIBCPP_FUNC_VIS
699size_t __wide_to_char(const wstring&, char*, size_t);
700_LIBCPP_FUNC_VIS
701size_t __char_to_wide(const string&, wchar_t*, size_t);
702#endif
703
704template <class _ECharT>
705struct _PathCVT;
706
707#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
664template <class _ECharT>708template <class _ECharT>
665struct _PathCVT {709struct _PathCVT {
666 static_assert(__can_convert_char<_ECharT>::value,710 static_assert(__can_convert_char<_ECharT>::value,
667 "Char type not convertible");711 "Char type not convertible");
668712
669 typedef __narrow_to_utf8<sizeof(_ECharT) * __CHAR_BIT__> _Narrower;713 typedef __narrow_to_utf8<sizeof(_ECharT) * __CHAR_BIT__> _Narrower;
714#if defined(_LIBCPP_WIN32API)
715 typedef __widen_from_utf8<sizeof(wchar_t) * __CHAR_BIT__> _Widener;
716#endif
670717
671 static void __append_range(string& __dest, _ECharT const* __b,718 static void __append_range(__path_string& __dest, _ECharT const* __b,
672 _ECharT const* __e) {719 _ECharT const* __e) {
720#if defined(_LIBCPP_WIN32API)
721 string __utf8;
722 _Narrower()(back_inserter(__utf8), __b, __e);
723 _Widener()(back_inserter(__dest), __utf8.data(), __utf8.data() + __utf8.size());
724#else
673 _Narrower()(back_inserter(__dest), __b, __e);725 _Narrower()(back_inserter(__dest), __b, __e);
726#endif
674 }727 }
675728
676 template <class _Iter>729 template <class _Iter>
677 static void __append_range(string& __dest, _Iter __b, _Iter __e) {730 static void __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
678 static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload");731 static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload");
679 if (__b == __e)732 if (__b == __e)
680 return;733 return;
681 basic_string<_ECharT> __tmp(__b, __e);734 basic_string<_ECharT> __tmp(__b, __e);
735#if defined(_LIBCPP_WIN32API)
736 string __utf8;
737 _Narrower()(back_inserter(__utf8), __tmp.data(),
738 __tmp.data() + __tmp.length());
739 _Widener()(back_inserter(__dest), __utf8.data(), __utf8.data() + __utf8.size());
740#else
682 _Narrower()(back_inserter(__dest), __tmp.data(),741 _Narrower()(back_inserter(__dest), __tmp.data(),
683 __tmp.data() + __tmp.length());742 __tmp.data() + __tmp.length());
743#endif
684 }744 }
685745
686 template <class _Iter>746 template <class _Iter>
687 static void __append_range(string& __dest, _Iter __b, _NullSentinal) {747 static void __append_range(__path_string& __dest, _Iter __b, _NullSentinel) {
688 static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload");748 static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload");
689 const _ECharT __sentinal = _ECharT{};749 const _ECharT __sentinel = _ECharT{};
690 if (*__b == __sentinal)750 if (*__b == __sentinel)
691 return;751 return;
692 basic_string<_ECharT> __tmp;752 basic_string<_ECharT> __tmp;
693 for (; *__b != __sentinal; ++__b)753 for (; *__b != __sentinel; ++__b)
694 __tmp.push_back(*__b);754 __tmp.push_back(*__b);
755#if defined(_LIBCPP_WIN32API)
756 string __utf8;
757 _Narrower()(back_inserter(__utf8), __tmp.data(),
758 __tmp.data() + __tmp.length());
759 _Widener()(back_inserter(__dest), __utf8.data(), __utf8.data() + __utf8.size());
760#else
695 _Narrower()(back_inserter(__dest), __tmp.data(),761 _Narrower()(back_inserter(__dest), __tmp.data(),
696 __tmp.data() + __tmp.length());762 __tmp.data() + __tmp.length());
763#endif
697 }764 }
698765
699 template <class _Source>766 template <class _Source>
700 static void __append_source(string& __dest, _Source const& __s) {767 static void __append_source(__path_string& __dest, _Source const& __s) {
701 using _Traits = __is_pathable<_Source>;768 using _Traits = __is_pathable<_Source>;
702 __append_range(__dest, _Traits::__range_begin(__s),769 __append_range(__dest, _Traits::__range_begin(__s),
703 _Traits::__range_end(__s));770 _Traits::__range_end(__s));
704 }771 }
705};772};
773#endif // !_LIBCPP_HAS_NO_LOCALIZATION
706774
707template <>775template <>
708struct _PathCVT<char> {776struct _PathCVT<__path_value> {
709777
710 template <class _Iter>778 template <class _Iter>
711 static typename enable_if<__is_exactly_cpp17_input_iterator<_Iter>::value>::type779 static typename enable_if<__is_exactly_cpp17_input_iterator<_Iter>::value>::type
712 __append_range(string& __dest, _Iter __b, _Iter __e) {780 __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
713 for (; __b != __e; ++__b)781 for (; __b != __e; ++__b)
714 __dest.push_back(*__b);782 __dest.push_back(*__b);
715 }783 }
716784
717 template <class _Iter>785 template <class _Iter>
718 static typename enable_if<__is_cpp17_forward_iterator<_Iter>::value>::type786 static typename enable_if<__is_cpp17_forward_iterator<_Iter>::value>::type
719 __append_range(string& __dest, _Iter __b, _Iter __e) {787 __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
720 __dest.__append_forward_unsafe(__b, __e);788 __dest.__append_forward_unsafe(__b, __e);
721 }789 }
722790
723 template <class _Iter>791 template <class _Iter>
724 static void __append_range(string& __dest, _Iter __b, _NullSentinal) {792 static void __append_range(__path_string& __dest, _Iter __b, _NullSentinel) {
725 const char __sentinal = char{};793 const char __sentinel = char{};
726 for (; *__b != __sentinal; ++__b)794 for (; *__b != __sentinel; ++__b)
727 __dest.push_back(*__b);795 __dest.push_back(*__b);
728 }796 }
729797
730 template <class _Source>798 template <class _Source>
731 static void __append_source(string& __dest, _Source const& __s) {799 static void __append_source(__path_string& __dest, _Source const& __s) {
800 using _Traits = __is_pathable<_Source>;
801 __append_range(__dest, _Traits::__range_begin(__s),
802 _Traits::__range_end(__s));
803 }
804};
805
806#if defined(_LIBCPP_WIN32API)
807template <>
808struct _PathCVT<char> {
809
810 static void
811 __append_string(__path_string& __dest, const basic_string<char> &__str) {
812 size_t __size = __char_to_wide(__str, nullptr, 0);
813 size_t __pos = __dest.size();
814 __dest.resize(__pos + __size);
815 __char_to_wide(__str, const_cast<__path_value*>(__dest.data()) + __pos, __size);
816 }
817
818 template <class _Iter>
819 static typename enable_if<__is_exactly_cpp17_input_iterator<_Iter>::value>::type
820 __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
821 basic_string<char> __tmp(__b, __e);
822 __append_string(__dest, __tmp);
823 }
824
825 template <class _Iter>
826 static typename enable_if<__is_cpp17_forward_iterator<_Iter>::value>::type
827 __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
828 basic_string<char> __tmp(__b, __e);
829 __append_string(__dest, __tmp);
830 }
831
832 template <class _Iter>
833 static void __append_range(__path_string& __dest, _Iter __b, _NullSentinel) {
834 const char __sentinel = char{};
835 basic_string<char> __tmp;
836 for (; *__b != __sentinel; ++__b)
837 __tmp.push_back(*__b);
838 __append_string(__dest, __tmp);
839 }
840
841 template <class _Source>
842 static void __append_source(__path_string& __dest, _Source const& __s) {
732 using _Traits = __is_pathable<_Source>;843 using _Traits = __is_pathable<_Source>;
733 __append_range(__dest, _Traits::__range_begin(__s),844 __append_range(__dest, _Traits::__range_begin(__s),
734 _Traits::__range_end(__s));845 _Traits::__range_end(__s));
735 }846 }
736};847};
737848
849template <class _ECharT>
850struct _PathExport {
851 typedef __narrow_to_utf8<sizeof(wchar_t) * __CHAR_BIT__> _Narrower;
852 typedef __widen_from_utf8<sizeof(_ECharT) * __CHAR_BIT__> _Widener;
853
854 template <class _Str>
855 static void __append(_Str& __dest, const __path_string& __src) {
856 string __utf8;
857 _Narrower()(back_inserter(__utf8), __src.data(), __src.data() + __src.size());
858 _Widener()(back_inserter(__dest), __utf8.data(), __utf8.data() + __utf8.size());
859 }
860};
861
862template <>
863struct _PathExport<char> {
864 template <class _Str>
865 static void __append(_Str& __dest, const __path_string& __src) {
866 size_t __size = __wide_to_char(__src, nullptr, 0);
867 size_t __pos = __dest.size();
868 __dest.resize(__size);
869 __wide_to_char(__src, const_cast<char*>(__dest.data()) + __pos, __size);
870 }
871};
872
873template <>
874struct _PathExport<wchar_t> {
875 template <class _Str>
876 static void __append(_Str& __dest, const __path_string& __src) {
877 __dest.append(__src.begin(), __src.end());
878 }
879};
880
881template <>
882struct _PathExport<char16_t> {
883 template <class _Str>
884 static void __append(_Str& __dest, const __path_string& __src) {
885 __dest.append(__src.begin(), __src.end());
886 }
887};
888
889#ifndef _LIBCPP_NO_HAS_CHAR8_T
890template <>
891struct _PathExport<char8_t> {
892 typedef __narrow_to_utf8<sizeof(wchar_t) * __CHAR_BIT__> _Narrower;
893
894 template <class _Str>
895 static void __append(_Str& __dest, const __path_string& __src) {
896 _Narrower()(back_inserter(__dest), __src.data(), __src.data() + __src.size());
897 }
898};
899#endif /* !_LIBCPP_NO_HAS_CHAR8_T */
900#endif /* _LIBCPP_WIN32API */
901
738class _LIBCPP_TYPE_VIS path {902class _LIBCPP_TYPE_VIS path {
739 template <class _SourceOrIter, class _Tp = path&>903 template <class _SourceOrIter, class _Tp = path&>
740 using _EnableIfPathable =904 using _EnableIfPathable =
...@@ -747,10 +911,15 @@ class _LIBCPP_TYPE_VIS path {...@@ -747,10 +911,15 @@ class _LIBCPP_TYPE_VIS path {
747 using _SourceCVT = _PathCVT<_SourceChar<_Tp> >;911 using _SourceCVT = _PathCVT<_SourceChar<_Tp> >;
748912
749public:913public:
914#if defined(_LIBCPP_WIN32API)
915 typedef wchar_t value_type;
916 static constexpr value_type preferred_separator = L'\\';
917#else
750 typedef char value_type;918 typedef char value_type;
751 typedef basic_string<value_type> string_type;
752 typedef _VSTD::string_view __string_view;
753 static constexpr value_type preferred_separator = '/';919 static constexpr value_type preferred_separator = '/';
920#endif
921 typedef basic_string<value_type> string_type;
922 typedef basic_string_view<value_type> __string_view;
754923
755 enum class _LIBCPP_ENUM_VIS format : unsigned char {924 enum class _LIBCPP_ENUM_VIS format : unsigned char {
756 auto_format,925 auto_format,
...@@ -779,12 +948,14 @@ public:...@@ -779,12 +948,14 @@ public:
779 _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);948 _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);
780 }949 }
781950
951#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
782 // TODO Implement locale conversions.952 // TODO Implement locale conversions.
783 template <class _Source, class = _EnableIfPathable<_Source, void> >953 template <class _Source, class = _EnableIfPathable<_Source, void> >
784 path(const _Source& __src, const locale& __loc, format = format::auto_format);954 path(const _Source& __src, const locale& __loc, format = format::auto_format);
785 template <class _InputIt>955 template <class _InputIt>
786 path(_InputIt __first, _InputIt _last, const locale& __loc,956 path(_InputIt __first, _InputIt _last, const locale& __loc,
787 format = format::auto_format);957 format = format::auto_format);
958#endif
788959
789 _LIBCPP_INLINE_VISIBILITY960 _LIBCPP_INLINE_VISIBILITY
790 ~path() = default;961 ~path() = default;
...@@ -922,9 +1093,8 @@ public:...@@ -922,9 +1093,8 @@ public:
922 template <class _ECharT>1093 template <class _ECharT>
923 typename enable_if<__can_convert_char<_ECharT>::value, path&>::type1094 typename enable_if<__can_convert_char<_ECharT>::value, path&>::type
924 operator+=(_ECharT __x) {1095 operator+=(_ECharT __x) {
925 basic_string<_ECharT> __tmp;1096 _PathCVT<_ECharT>::__append_source(__pn_,
926 __tmp += __x;1097 basic_string_view<_ECharT>(&__x, 1));
927 _PathCVT<_ECharT>::__append_source(__pn_, __tmp);
928 return *this;1098 return *this;
929 }1099 }
9301100
...@@ -950,7 +1120,12 @@ public:...@@ -950,7 +1120,12 @@ public:
950 _LIBCPP_INLINE_VISIBILITY1120 _LIBCPP_INLINE_VISIBILITY
951 void clear() noexcept { __pn_.clear(); }1121 void clear() noexcept { __pn_.clear(); }
9521122
953 path& make_preferred() { return *this; }1123 path& make_preferred() {
1124#if defined(_LIBCPP_WIN32API)
1125 _VSTD::replace(__pn_.begin(), __pn_.end(), L'/', L'\\');
1126#endif
1127 return *this;
1128 }
9541129
955 _LIBCPP_INLINE_VISIBILITY1130 _LIBCPP_INLINE_VISIBILITY
956 path& remove_filename() {1131 path& remove_filename() {
...@@ -983,6 +1158,64 @@ public:...@@ -983,6 +1158,64 @@ public:
9831158
984 _LIBCPP_INLINE_VISIBILITY operator string_type() const { return __pn_; }1159 _LIBCPP_INLINE_VISIBILITY operator string_type() const { return __pn_; }
9851160
1161#if defined(_LIBCPP_WIN32API)
1162 _LIBCPP_INLINE_VISIBILITY _VSTD::wstring wstring() const { return __pn_; }
1163
1164 _VSTD::wstring generic_wstring() const { return __pn_; }
1165
1166#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
1167 template <class _ECharT, class _Traits = char_traits<_ECharT>,
1168 class _Allocator = allocator<_ECharT> >
1169 basic_string<_ECharT, _Traits, _Allocator>
1170 string(const _Allocator& __a = _Allocator()) const {
1171 using _Str = basic_string<_ECharT, _Traits, _Allocator>;
1172 _Str __s(__a);
1173 __s.reserve(__pn_.size());
1174 _PathExport<_ECharT>::__append(__s, __pn_);
1175 return __s;
1176 }
1177
1178 _LIBCPP_INLINE_VISIBILITY _VSTD::string string() const {
1179 return string<char>();
1180 }
1181 _LIBCPP_INLINE_VISIBILITY __u8_string u8string() const {
1182 using _CVT = __narrow_to_utf8<sizeof(wchar_t) * __CHAR_BIT__>;
1183 __u8_string __s;
1184 __s.reserve(__pn_.size());
1185 _CVT()(back_inserter(__s), __pn_.data(), __pn_.data() + __pn_.size());
1186 return __s;
1187 }
1188
1189 _LIBCPP_INLINE_VISIBILITY _VSTD::u16string u16string() const {
1190 return string<char16_t>();
1191 }
1192 _LIBCPP_INLINE_VISIBILITY _VSTD::u32string u32string() const {
1193 return string<char32_t>();
1194 }
1195
1196 // generic format observers
1197 template <class _ECharT, class _Traits = char_traits<_ECharT>,
1198 class _Allocator = allocator<_ECharT> >
1199 basic_string<_ECharT, _Traits, _Allocator>
1200 generic_string(const _Allocator& __a = _Allocator()) const {
1201 return string<_ECharT, _Traits, _Allocator>(__a);
1202 }
1203
1204 _VSTD::string generic_string() const { return generic_string<char>(); }
1205 _VSTD::u16string generic_u16string() const { return generic_string<char16_t>(); }
1206 _VSTD::u32string generic_u32string() const { return generic_string<char32_t>(); }
1207 __u8_string generic_u8string() const { return u8string(); }
1208#endif /* !_LIBCPP_HAS_NO_LOCALIZATION */
1209#else /* _LIBCPP_WIN32API */
1210
1211 _LIBCPP_INLINE_VISIBILITY _VSTD::string string() const { return __pn_; }
1212#ifndef _LIBCPP_NO_HAS_CHAR8_T
1213 _LIBCPP_INLINE_VISIBILITY _VSTD::u8string u8string() const { return _VSTD::u8string(__pn_.begin(), __pn_.end()); }
1214#else
1215 _LIBCPP_INLINE_VISIBILITY _VSTD::string u8string() const { return __pn_; }
1216#endif
1217
1218#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
986 template <class _ECharT, class _Traits = char_traits<_ECharT>,1219 template <class _ECharT, class _Traits = char_traits<_ECharT>,
987 class _Allocator = allocator<_ECharT> >1220 class _Allocator = allocator<_ECharT> >
988 basic_string<_ECharT, _Traits, _Allocator>1221 basic_string<_ECharT, _Traits, _Allocator>
...@@ -995,19 +1228,26 @@ public:...@@ -995,19 +1228,26 @@ public:
995 return __s;1228 return __s;
996 }1229 }
9971230
998 _LIBCPP_INLINE_VISIBILITY std::string string() const { return __pn_; }1231 _LIBCPP_INLINE_VISIBILITY _VSTD::wstring wstring() const {
999 _LIBCPP_INLINE_VISIBILITY std::wstring wstring() const {
1000 return string<wchar_t>();1232 return string<wchar_t>();
1001 }1233 }
1002 _LIBCPP_INLINE_VISIBILITY std::string u8string() const { return __pn_; }1234 _LIBCPP_INLINE_VISIBILITY _VSTD::u16string u16string() const {
1003 _LIBCPP_INLINE_VISIBILITY std::u16string u16string() const {
1004 return string<char16_t>();1235 return string<char16_t>();
1005 }1236 }
1006 _LIBCPP_INLINE_VISIBILITY std::u32string u32string() const {1237 _LIBCPP_INLINE_VISIBILITY _VSTD::u32string u32string() const {
1007 return string<char32_t>();1238 return string<char32_t>();
1008 }1239 }
1240#endif /* !_LIBCPP_HAS_NO_LOCALIZATION */
10091241
1010 // generic format observers1242 // generic format observers
1243 _VSTD::string generic_string() const { return __pn_; }
1244#ifndef _LIBCPP_NO_HAS_CHAR8_T
1245 _VSTD::u8string generic_u8string() const { return _VSTD::u8string(__pn_.begin(), __pn_.end()); }
1246#else
1247 _VSTD::string generic_u8string() const { return __pn_; }
1248#endif
1249
1250#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
1011 template <class _ECharT, class _Traits = char_traits<_ECharT>,1251 template <class _ECharT, class _Traits = char_traits<_ECharT>,
1012 class _Allocator = allocator<_ECharT> >1252 class _Allocator = allocator<_ECharT> >
1013 basic_string<_ECharT, _Traits, _Allocator>1253 basic_string<_ECharT, _Traits, _Allocator>
...@@ -1015,11 +1255,11 @@ public:...@@ -1015,11 +1255,11 @@ public:
1015 return string<_ECharT, _Traits, _Allocator>(__a);1255 return string<_ECharT, _Traits, _Allocator>(__a);
1016 }1256 }
10171257
1018 std::string generic_string() const { return __pn_; }1258 _VSTD::wstring generic_wstring() const { return string<wchar_t>(); }
1019 std::wstring generic_wstring() const { return string<wchar_t>(); }1259 _VSTD::u16string generic_u16string() const { return string<char16_t>(); }
1020 std::string generic_u8string() const { return __pn_; }1260 _VSTD::u32string generic_u32string() const { return string<char32_t>(); }
1021 std::u16string generic_u16string() const { return string<char16_t>(); }1261#endif /* !_LIBCPP_HAS_NO_LOCALIZATION */
1022 std::u32string generic_u32string() const { return string<char32_t>(); }1262#endif /* !_LIBCPP_WIN32API */
10231263
1024private:1264private:
1025 int __compare(__string_view) const;1265 int __compare(__string_view) const;
...@@ -1123,23 +1363,24 @@ public:...@@ -1123,23 +1363,24 @@ public:
1123 iterator begin() const;1363 iterator begin() const;
1124 iterator end() const;1364 iterator end() const;
11251365
1366#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
1126 template <class _CharT, class _Traits>1367 template <class _CharT, class _Traits>
1127 _LIBCPP_INLINE_VISIBILITY friend1368 _LIBCPP_INLINE_VISIBILITY friend
1128 typename enable_if<is_same<_CharT, char>::value &&1369 typename enable_if<is_same<_CharT, value_type>::value &&
1129 is_same<_Traits, char_traits<char> >::value,1370 is_same<_Traits, char_traits<value_type> >::value,
1130 basic_ostream<_CharT, _Traits>&>::type1371 basic_ostream<_CharT, _Traits>&>::type
1131 operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {1372 operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
1132 __os << std::__quoted(__p.native());1373 __os << _VSTD::__quoted(__p.native());
1133 return __os;1374 return __os;
1134 }1375 }
11351376
1136 template <class _CharT, class _Traits>1377 template <class _CharT, class _Traits>
1137 _LIBCPP_INLINE_VISIBILITY friend1378 _LIBCPP_INLINE_VISIBILITY friend
1138 typename enable_if<!is_same<_CharT, char>::value ||1379 typename enable_if<!is_same<_CharT, value_type>::value ||
1139 !is_same<_Traits, char_traits<char> >::value,1380 !is_same<_Traits, char_traits<value_type> >::value,
1140 basic_ostream<_CharT, _Traits>&>::type1381 basic_ostream<_CharT, _Traits>&>::type
1141 operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {1382 operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
1142 __os << std::__quoted(__p.string<_CharT, _Traits>());1383 __os << _VSTD::__quoted(__p.string<_CharT, _Traits>());
1143 return __os;1384 return __os;
1144 }1385 }
11451386
...@@ -1151,6 +1392,7 @@ public:...@@ -1151,6 +1392,7 @@ public:
1151 __p = __tmp;1392 __p = __tmp;
1152 return __is;1393 return __is;
1153 }1394 }
1395#endif // !_LIBCPP_HAS_NO_LOCALIZATION
11541396
1155 friend _LIBCPP_INLINE_VISIBILITY bool operator==(const path& __lhs, const path& __rhs) noexcept {1397 friend _LIBCPP_INLINE_VISIBILITY bool operator==(const path& __lhs, const path& __rhs) noexcept {
1156 return __lhs.compare(__rhs) == 0;1398 return __lhs.compare(__rhs) == 0;
...@@ -1193,25 +1435,70 @@ inline _LIBCPP_INLINE_VISIBILITY void swap(path& __lhs, path& __rhs) noexcept {...@@ -1193,25 +1435,70 @@ inline _LIBCPP_INLINE_VISIBILITY void swap(path& __lhs, path& __rhs) noexcept {
1193_LIBCPP_FUNC_VIS1435_LIBCPP_FUNC_VIS
1194size_t hash_value(const path& __p) noexcept;1436size_t hash_value(const path& __p) noexcept;
11951437
1196template <class _Source>1438template <class _InputIt>
1197_LIBCPP_INLINE_VISIBILITY1439_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
1198 typename enable_if<__is_pathable<_Source>::value, path>::type1440 typename enable_if<__is_pathable<_InputIt>::value, path>::type
1199 u8path(const _Source& __s) {1441 u8path(_InputIt __f, _InputIt __l) {
1200 static_assert(1442 static_assert(
1201 is_same<typename __is_pathable<_Source>::__char_type, char>::value,1443#ifndef _LIBCPP_NO_HAS_CHAR8_T
1202 "u8path(Source const&) requires Source have a character type of type "1444 is_same<typename __is_pathable<_InputIt>::__char_type, char8_t>::value ||
1203 "'char'");1445#endif
1204 return path(__s);1446 is_same<typename __is_pathable<_InputIt>::__char_type, char>::value,
1447 "u8path(Iter, Iter) requires Iter have a value_type of type 'char'"
1448 " or 'char8_t'");
1449#if defined(_LIBCPP_WIN32API)
1450 string __tmp(__f, __l);
1451 using _CVT = __widen_from_utf8<sizeof(wchar_t) * __CHAR_BIT__>;
1452 _VSTD::wstring __w;
1453 __w.reserve(__tmp.size());
1454 _CVT()(back_inserter(__w), __tmp.data(), __tmp.data() + __tmp.size());
1455 return path(__w);
1456#else
1457 return path(__f, __l);
1458#endif /* !_LIBCPP_WIN32API */
1205}1459}
12061460
1461#if defined(_LIBCPP_WIN32API)
1207template <class _InputIt>1462template <class _InputIt>
1208_LIBCPP_INLINE_VISIBILITY1463_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
1209 typename enable_if<__is_pathable<_InputIt>::value, path>::type1464 typename enable_if<__is_pathable<_InputIt>::value, path>::type
1210 u8path(_InputIt __f, _InputIt __l) {1465 u8path(_InputIt __f, _NullSentinel) {
1211 static_assert(1466 static_assert(
1467#ifndef _LIBCPP_NO_HAS_CHAR8_T
1468 is_same<typename __is_pathable<_InputIt>::__char_type, char8_t>::value ||
1469#endif
1212 is_same<typename __is_pathable<_InputIt>::__char_type, char>::value,1470 is_same<typename __is_pathable<_InputIt>::__char_type, char>::value,
1213 "u8path(Iter, Iter) requires Iter have a value_type of type 'char'");1471 "u8path(Iter, Iter) requires Iter have a value_type of type 'char'"
1214 return path(__f, __l);1472 " or 'char8_t'");
1473 string __tmp;
1474 const char __sentinel = char{};
1475 for (; *__f != __sentinel; ++__f)
1476 __tmp.push_back(*__f);
1477 using _CVT = __widen_from_utf8<sizeof(wchar_t) * __CHAR_BIT__>;
1478 _VSTD::wstring __w;
1479 __w.reserve(__tmp.size());
1480 _CVT()(back_inserter(__w), __tmp.data(), __tmp.data() + __tmp.size());
1481 return path(__w);
1482}
1483#endif /* _LIBCPP_WIN32API */
1484
1485template <class _Source>
1486_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
1487 typename enable_if<__is_pathable<_Source>::value, path>::type
1488 u8path(const _Source& __s) {
1489 static_assert(
1490#ifndef _LIBCPP_NO_HAS_CHAR8_T
1491 is_same<typename __is_pathable<_Source>::__char_type, char8_t>::value ||
1492#endif
1493 is_same<typename __is_pathable<_Source>::__char_type, char>::value,
1494 "u8path(Source const&) requires Source have a character type of type "
1495 "'char' or 'char8_t'");
1496#if defined(_LIBCPP_WIN32API)
1497 using _Traits = __is_pathable<_Source>;
1498 return u8path(__unwrap_iter(_Traits::__range_begin(__s)), __unwrap_iter(_Traits::__range_end(__s)));
1499#else
1500 return path(__s);
1501#endif
1215}1502}
12161503
1217class _LIBCPP_TYPE_VIS path::iterator {1504class _LIBCPP_TYPE_VIS path::iterator {
...@@ -1230,7 +1517,7 @@ public:...@@ -1230,7 +1517,7 @@ public:
1230 typedef bidirectional_iterator_tag iterator_category;1517 typedef bidirectional_iterator_tag iterator_category;
12311518
1232 typedef path value_type;1519 typedef path value_type;
1233 typedef std::ptrdiff_t difference_type;1520 typedef ptrdiff_t difference_type;
1234 typedef const path* pointer;1521 typedef const path* pointer;
1235 typedef const path& reference;1522 typedef const path& reference;
12361523
...@@ -1374,7 +1661,7 @@ template <class... _Args>...@@ -1374,7 +1661,7 @@ template <class... _Args>
1374_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY1661_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
1375#ifndef _LIBCPP_NO_EXCEPTIONS1662#ifndef _LIBCPP_NO_EXCEPTIONS
1376void __throw_filesystem_error(_Args&&... __args) {1663void __throw_filesystem_error(_Args&&... __args) {
1377 throw filesystem_error(std::forward<_Args>(__args)...);1664 throw filesystem_error(_VSTD::forward<_Args>(__args)...);
1378}1665}
1379#else1666#else
1380void __throw_filesystem_error(_Args&&...) {1667void __throw_filesystem_error(_Args&&...) {
...@@ -2204,7 +2491,7 @@ private:...@@ -2204,7 +2491,7 @@ private:
22042491
2205 _LIBCPP_INLINE_VISIBILITY2492 _LIBCPP_INLINE_VISIBILITY
2206 void __assign_iter_entry(_Path&& __p, __cached_data __dt) {2493 void __assign_iter_entry(_Path&& __p, __cached_data __dt) {
2207 __p_ = std::move(__p);2494 __p_ = _VSTD::move(__p);
2208 __data_ = __dt;2495 __data_ = __dt;
2209 }2496 }
22102497
...@@ -2505,10 +2792,10 @@ end(const directory_iterator&) noexcept {...@@ -2505,10 +2792,10 @@ end(const directory_iterator&) noexcept {
2505class recursive_directory_iterator {2792class recursive_directory_iterator {
2506public:2793public:
2507 using value_type = directory_entry;2794 using value_type = directory_entry;
2508 using difference_type = std::ptrdiff_t;2795 using difference_type = ptrdiff_t;
2509 using pointer = directory_entry const*;2796 using pointer = directory_entry const*;
2510 using reference = directory_entry const&;2797 using reference = directory_entry const&;
2511 using iterator_category = std::input_iterator_tag;2798 using iterator_category = input_iterator_tag;
25122799
2513public:2800public:
2514 // constructors and destructor2801 // constructors and destructor
lib/libcxx/include/forward_list+3-3
...@@ -603,7 +603,7 @@ __forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x)...@@ -603,7 +603,7 @@ __forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x)
603 __is_nothrow_swappable<__node_allocator>::value)603 __is_nothrow_swappable<__node_allocator>::value)
604#endif604#endif
605{605{
606 __swap_allocator(__alloc(), __x.__alloc(),606 _VSTD::__swap_allocator(__alloc(), __x.__alloc(),
607 integral_constant<bool, __node_traits::propagate_on_container_swap::value>());607 integral_constant<bool, __node_traits::propagate_on_container_swap::value>());
608 using _VSTD::swap;608 using _VSTD::swap;
609 swap(__before_begin()->__next_, __x.__before_begin()->__next_);609 swap(__before_begin()->__next_, __x.__before_begin()->__next_);
...@@ -758,7 +758,7 @@ public:...@@ -758,7 +758,7 @@ public:
758 {return base::__before_begin()->__next_ == nullptr;}758 {return base::__before_begin()->__next_ == nullptr;}
759 _LIBCPP_INLINE_VISIBILITY759 _LIBCPP_INLINE_VISIBILITY
760 size_type max_size() const _NOEXCEPT {760 size_type max_size() const _NOEXCEPT {
761 return std::min<size_type>(761 return _VSTD::min<size_type>(
762 __node_traits::max_size(base::__alloc()),762 __node_traits::max_size(base::__alloc()),
763 numeric_limits<difference_type>::max());763 numeric_limits<difference_type>::max());
764 }764 }
...@@ -871,7 +871,7 @@ private:...@@ -871,7 +871,7 @@ private:
871871
872#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES872#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
873template<class _InputIterator,873template<class _InputIterator,
874 class _Alloc = typename std::allocator<typename iterator_traits<_InputIterator>::value_type>,874 class _Alloc = allocator<typename iterator_traits<_InputIterator>::value_type>,
875 class = typename enable_if<__is_allocator<_Alloc>::value, void>::type875 class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
876 >876 >
877forward_list(_InputIterator, _InputIterator)877forward_list(_InputIterator, _InputIterator)
lib/libcxx/include/fstream+83-72
...@@ -180,12 +180,16 @@ typedef basic_fstream<wchar_t> wfstream;...@@ -180,12 +180,16 @@ typedef basic_fstream<wchar_t> wfstream;
180*/180*/
181181
182#include <__config>182#include <__config>
183#include <__availability>
183#include <ostream>184#include <ostream>
184#include <istream>185#include <istream>
185#include <__locale>186#include <__locale>
186#include <cstdio>187#include <cstdio>
187#include <cstdlib>188#include <cstdlib>
188#include <filesystem>189
190#if !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
191# include <filesystem>
192#endif
189193
190#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)194#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
191#pragma GCC system_header195#pragma GCC system_header
...@@ -234,13 +238,13 @@ public:...@@ -234,13 +238,13 @@ public:
234 _LIBCPP_INLINE_VISIBILITY238 _LIBCPP_INLINE_VISIBILITY
235 basic_filebuf* open(const string& __s, ios_base::openmode __mode);239 basic_filebuf* open(const string& __s, ios_base::openmode __mode);
236240
237#if _LIBCPP_STD_VER >= 17241#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
238 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY242 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
239 basic_filebuf* open(const _VSTD_FS::path& __p, ios_base::openmode __mode) {243 basic_filebuf* open(const _VSTD_FS::path& __p, ios_base::openmode __mode) {
240 return open(__p.c_str(), __mode);244 return open(__p.c_str(), __mode);
241 }245 }
242#endif246#endif
243 _LIBCPP_INLINE_VISIBILITY247 inline _LIBCPP_INLINE_VISIBILITY
244 basic_filebuf* __open(int __fd, ios_base::openmode __mode);248 basic_filebuf* __open(int __fd, ios_base::openmode __mode);
245#endif249#endif
246 basic_filebuf* close();250 basic_filebuf* close();
...@@ -286,13 +290,13 @@ private:...@@ -286,13 +290,13 @@ private:
286290
287template <class _CharT, class _Traits>291template <class _CharT, class _Traits>
288basic_filebuf<_CharT, _Traits>::basic_filebuf()292basic_filebuf<_CharT, _Traits>::basic_filebuf()
289 : __extbuf_(0),293 : __extbuf_(nullptr),
290 __extbufnext_(0),294 __extbufnext_(nullptr),
291 __extbufend_(0),295 __extbufend_(nullptr),
292 __ebs_(0),296 __ebs_(0),
293 __intbuf_(0),297 __intbuf_(nullptr),
294 __ibs_(0),298 __ibs_(0),
295 __file_(0),299 __file_(nullptr),
296 __cv_(nullptr),300 __cv_(nullptr),
297 __st_(),301 __st_(),
298 __st_last_(),302 __st_last_(),
...@@ -307,7 +311,7 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf()...@@ -307,7 +311,7 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf()
307 __cv_ = &use_facet<codecvt<char_type, char, state_type> >(this->getloc());311 __cv_ = &use_facet<codecvt<char_type, char, state_type> >(this->getloc());
308 __always_noconv_ = __cv_->always_noconv();312 __always_noconv_ = __cv_->always_noconv();
309 }313 }
310 setbuf(0, 4096);314 setbuf(nullptr, 4096);
311}315}
312316
313#ifndef _LIBCPP_CXX03_LANG317#ifndef _LIBCPP_CXX03_LANG
...@@ -359,13 +363,13 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs)...@@ -359,13 +363,13 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs)
359 (char_type*)__extbuf_ + (__rhs.gptr() - __rhs.eback()),363 (char_type*)__extbuf_ + (__rhs.gptr() - __rhs.eback()),
360 (char_type*)__extbuf_ + (__rhs.egptr() - __rhs.eback()));364 (char_type*)__extbuf_ + (__rhs.egptr() - __rhs.eback()));
361 }365 }
362 __rhs.__extbuf_ = 0;366 __rhs.__extbuf_ = nullptr;
363 __rhs.__extbufnext_ = 0;367 __rhs.__extbufnext_ = nullptr;
364 __rhs.__extbufend_ = 0;368 __rhs.__extbufend_ = nullptr;
365 __rhs.__ebs_ = 0;369 __rhs.__ebs_ = 0;
366 __rhs.__intbuf_ = 0;370 __rhs.__intbuf_ = 0;
367 __rhs.__ibs_ = 0;371 __rhs.__ibs_ = 0;
368 __rhs.__file_ = 0;372 __rhs.__file_ = nullptr;
369 __rhs.__st_ = state_type();373 __rhs.__st_ = state_type();
370 __rhs.__st_last_ = state_type();374 __rhs.__st_last_ = state_type();
371 __rhs.__om_ = 0;375 __rhs.__om_ = 0;
...@@ -499,7 +503,7 @@ inline...@@ -499,7 +503,7 @@ inline
499bool503bool
500basic_filebuf<_CharT, _Traits>::is_open() const504basic_filebuf<_CharT, _Traits>::is_open() const
501{505{
502 return __file_ != 0;506 return __file_ != nullptr;
503}507}
504508
505template <class _CharT, class _Traits>509template <class _CharT, class _Traits>
...@@ -547,8 +551,8 @@ template <class _CharT, class _Traits>...@@ -547,8 +551,8 @@ template <class _CharT, class _Traits>
547basic_filebuf<_CharT, _Traits>*551basic_filebuf<_CharT, _Traits>*
548basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)552basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)
549{553{
550 basic_filebuf<_CharT, _Traits>* __rt = 0;554 basic_filebuf<_CharT, _Traits>* __rt = nullptr;
551 if (__file_ == 0)555 if (__file_ == nullptr)
552 {556 {
553 if (const char* __mdstr = __make_mdstring(__mode)) {557 if (const char* __mdstr = __make_mdstring(__mode)) {
554 __rt = this;558 __rt = this;
...@@ -558,22 +562,23 @@ basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)...@@ -558,22 +562,23 @@ basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)
558 if (__mode & ios_base::ate) {562 if (__mode & ios_base::ate) {
559 if (fseek(__file_, 0, SEEK_END)) {563 if (fseek(__file_, 0, SEEK_END)) {
560 fclose(__file_);564 fclose(__file_);
561 __file_ = 0;565 __file_ = nullptr;
562 __rt = 0;566 __rt = nullptr;
563 }567 }
564 }568 }
565 } else569 } else
566 __rt = 0;570 __rt = nullptr;
567 }571 }
568 }572 }
569 return __rt;573 return __rt;
570}574}
571575
572template <class _CharT, class _Traits>576template <class _CharT, class _Traits>
573_LIBCPP_INLINE_VISIBILITY basic_filebuf<_CharT, _Traits>*577inline _LIBCPP_INLINE_VISIBILITY
578basic_filebuf<_CharT, _Traits>*
574basic_filebuf<_CharT, _Traits>::__open(int __fd, ios_base::openmode __mode) {579basic_filebuf<_CharT, _Traits>::__open(int __fd, ios_base::openmode __mode) {
575 basic_filebuf<_CharT, _Traits>* __rt = 0;580 basic_filebuf<_CharT, _Traits>* __rt = nullptr;
576 if (__file_ == 0) {581 if (__file_ == nullptr) {
577 if (const char* __mdstr = __make_mdstring(__mode)) {582 if (const char* __mdstr = __make_mdstring(__mode)) {
578 __rt = this;583 __rt = this;
579 __file_ = fdopen(__fd, __mdstr);584 __file_ = fdopen(__fd, __mdstr);
...@@ -582,12 +587,12 @@ basic_filebuf<_CharT, _Traits>::__open(int __fd, ios_base::openmode __mode) {...@@ -582,12 +587,12 @@ basic_filebuf<_CharT, _Traits>::__open(int __fd, ios_base::openmode __mode) {
582 if (__mode & ios_base::ate) {587 if (__mode & ios_base::ate) {
583 if (fseek(__file_, 0, SEEK_END)) {588 if (fseek(__file_, 0, SEEK_END)) {
584 fclose(__file_);589 fclose(__file_);
585 __file_ = 0;590 __file_ = nullptr;
586 __rt = 0;591 __rt = nullptr;
587 }592 }
588 }593 }
589 } else594 } else
590 __rt = 0;595 __rt = nullptr;
591 }596 }
592 }597 }
593 return __rt;598 return __rt;
...@@ -600,8 +605,8 @@ template <class _CharT, class _Traits>...@@ -600,8 +605,8 @@ template <class _CharT, class _Traits>
600basic_filebuf<_CharT, _Traits>*605basic_filebuf<_CharT, _Traits>*
601basic_filebuf<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode)606basic_filebuf<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode)
602{607{
603 basic_filebuf<_CharT, _Traits>* __rt = 0;608 basic_filebuf<_CharT, _Traits>* __rt = nullptr;
604 if (__file_ == 0)609 if (__file_ == nullptr)
605 {610 {
606 __rt = this;611 __rt = this;
607 const wchar_t* __mdstr;612 const wchar_t* __mdstr;
...@@ -650,7 +655,7 @@ basic_filebuf<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mo...@@ -650,7 +655,7 @@ basic_filebuf<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mo
650 __mdstr = L"a+b";655 __mdstr = L"a+b";
651 break;656 break;
652 default:657 default:
653 __rt = 0;658 __rt = nullptr;
654 break;659 break;
655 }660 }
656 if (__rt)661 if (__rt)
...@@ -664,13 +669,13 @@ basic_filebuf<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mo...@@ -664,13 +669,13 @@ basic_filebuf<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mo
664 if (fseek(__file_, 0, SEEK_END))669 if (fseek(__file_, 0, SEEK_END))
665 {670 {
666 fclose(__file_);671 fclose(__file_);
667 __file_ = 0;672 __file_ = nullptr;
668 __rt = 0;673 __rt = nullptr;
669 }674 }
670 }675 }
671 }676 }
672 else677 else
673 __rt = 0;678 __rt = nullptr;
674 }679 }
675 }680 }
676 return __rt;681 return __rt;
...@@ -690,16 +695,16 @@ template <class _CharT, class _Traits>...@@ -690,16 +695,16 @@ template <class _CharT, class _Traits>
690basic_filebuf<_CharT, _Traits>*695basic_filebuf<_CharT, _Traits>*
691basic_filebuf<_CharT, _Traits>::close()696basic_filebuf<_CharT, _Traits>::close()
692{697{
693 basic_filebuf<_CharT, _Traits>* __rt = 0;698 basic_filebuf<_CharT, _Traits>* __rt = nullptr;
694 if (__file_)699 if (__file_)
695 {700 {
696 __rt = this;701 __rt = this;
697 unique_ptr<FILE, int(*)(FILE*)> __h(__file_, fclose);702 unique_ptr<FILE, int(*)(FILE*)> __h(__file_, fclose);
698 if (sync())703 if (sync())
699 __rt = 0;704 __rt = nullptr;
700 if (fclose(__h.release()))705 if (fclose(__h.release()))
701 __rt = 0;706 __rt = nullptr;
702 __file_ = 0;707 __file_ = nullptr;
703 setbuf(0, 0);708 setbuf(0, 0);
704 }709 }
705 return __rt;710 return __rt;
...@@ -709,17 +714,17 @@ template <class _CharT, class _Traits>...@@ -709,17 +714,17 @@ template <class _CharT, class _Traits>
709typename basic_filebuf<_CharT, _Traits>::int_type714typename basic_filebuf<_CharT, _Traits>::int_type
710basic_filebuf<_CharT, _Traits>::underflow()715basic_filebuf<_CharT, _Traits>::underflow()
711{716{
712 if (__file_ == 0)717 if (__file_ == nullptr)
713 return traits_type::eof();718 return traits_type::eof();
714 bool __initial = __read_mode();719 bool __initial = __read_mode();
715 char_type __1buf;720 char_type __1buf;
716 if (this->gptr() == 0)721 if (this->gptr() == nullptr)
717 this->setg(&__1buf, &__1buf+1, &__1buf+1);722 this->setg(&__1buf, &__1buf+1, &__1buf+1);
718 const size_t __unget_sz = __initial ? 0 : min<size_t>((this->egptr() - this->eback()) / 2, 4);723 const size_t __unget_sz = __initial ? 0 : min<size_t>((this->egptr() - this->eback()) / 2, 4);
719 int_type __c = traits_type::eof();724 int_type __c = traits_type::eof();
720 if (this->gptr() == this->egptr())725 if (this->gptr() == this->egptr())
721 {726 {
722 memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type));727 _VSTD::memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type));
723 if (__always_noconv_)728 if (__always_noconv_)
724 {729 {
725 size_t __nmemb = static_cast<size_t>(this->egptr() - this->eback() - __unget_sz);730 size_t __nmemb = static_cast<size_t>(this->egptr() - this->eback() - __unget_sz);
...@@ -736,7 +741,7 @@ basic_filebuf<_CharT, _Traits>::underflow()...@@ -736,7 +741,7 @@ basic_filebuf<_CharT, _Traits>::underflow()
736 {741 {
737 _LIBCPP_ASSERT ( !(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" );742 _LIBCPP_ASSERT ( !(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" );
738 if (__extbufend_ != __extbufnext_)743 if (__extbufend_ != __extbufnext_)
739 memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);744 _VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
740 __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);745 __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
741 __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);746 __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
742 size_t __nmemb = _VSTD::min(static_cast<size_t>(__ibs_ - __unget_sz),747 size_t __nmemb = _VSTD::min(static_cast<size_t>(__ibs_ - __unget_sz),
...@@ -771,7 +776,7 @@ basic_filebuf<_CharT, _Traits>::underflow()...@@ -771,7 +776,7 @@ basic_filebuf<_CharT, _Traits>::underflow()
771 else776 else
772 __c = traits_type::to_int_type(*this->gptr());777 __c = traits_type::to_int_type(*this->gptr());
773 if (this->eback() == &__1buf)778 if (this->eback() == &__1buf)
774 this->setg(0, 0, 0);779 this->setg(nullptr, nullptr, nullptr);
775 return __c;780 return __c;
776}781}
777782
...@@ -801,7 +806,7 @@ template <class _CharT, class _Traits>...@@ -801,7 +806,7 @@ template <class _CharT, class _Traits>
801typename basic_filebuf<_CharT, _Traits>::int_type806typename basic_filebuf<_CharT, _Traits>::int_type
802basic_filebuf<_CharT, _Traits>::overflow(int_type __c)807basic_filebuf<_CharT, _Traits>::overflow(int_type __c)
803{808{
804 if (__file_ == 0)809 if (__file_ == nullptr)
805 return traits_type::eof();810 return traits_type::eof();
806 __write_mode();811 __write_mode();
807 char_type __1buf;812 char_type __1buf;
...@@ -809,7 +814,7 @@ basic_filebuf<_CharT, _Traits>::overflow(int_type __c)...@@ -809,7 +814,7 @@ basic_filebuf<_CharT, _Traits>::overflow(int_type __c)
809 char_type* __epb_save = this->epptr();814 char_type* __epb_save = this->epptr();
810 if (!traits_type::eq_int_type(__c, traits_type::eof()))815 if (!traits_type::eq_int_type(__c, traits_type::eof()))
811 {816 {
812 if (this->pptr() == 0)817 if (this->pptr() == nullptr)
813 this->setp(&__1buf, &__1buf+1);818 this->setp(&__1buf, &__1buf+1);
814 *this->pptr() = traits_type::to_char_type(__c);819 *this->pptr() = traits_type::to_char_type(__c);
815 this->pbump(1);820 this->pbump(1);
...@@ -866,8 +871,8 @@ template <class _CharT, class _Traits>...@@ -866,8 +871,8 @@ template <class _CharT, class _Traits>
866basic_streambuf<_CharT, _Traits>*871basic_streambuf<_CharT, _Traits>*
867basic_filebuf<_CharT, _Traits>::setbuf(char_type* __s, streamsize __n)872basic_filebuf<_CharT, _Traits>::setbuf(char_type* __s, streamsize __n)
868{873{
869 this->setg(0, 0, 0);874 this->setg(nullptr, nullptr, nullptr);
870 this->setp(0, 0);875 this->setp(nullptr, nullptr);
871 if (__owns_eb_)876 if (__owns_eb_)
872 delete [] __extbuf_;877 delete [] __extbuf_;
873 if (__owns_ib_)878 if (__owns_ib_)
...@@ -909,7 +914,7 @@ basic_filebuf<_CharT, _Traits>::setbuf(char_type* __s, streamsize __n)...@@ -909,7 +914,7 @@ basic_filebuf<_CharT, _Traits>::setbuf(char_type* __s, streamsize __n)
909 else914 else
910 {915 {
911 __ibs_ = 0;916 __ibs_ = 0;
912 __intbuf_ = 0;917 __intbuf_ = nullptr;
913 __owns_ib_ = false;918 __owns_ib_ = false;
914 }919 }
915 return this;920 return this;
...@@ -924,7 +929,7 @@ basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,...@@ -924,7 +929,7 @@ basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,
924 __throw_bad_cast();929 __throw_bad_cast();
925930
926 int __width = __cv_->encoding();931 int __width = __cv_->encoding();
927 if (__file_ == 0 || (__width <= 0 && __off != 0) || sync())932 if (__file_ == nullptr || (__width <= 0 && __off != 0) || sync())
928 return pos_type(off_type(-1));933 return pos_type(off_type(-1));
929 // __width > 0 || __off == 0934 // __width > 0 || __off == 0
930 int __whence;935 int __whence;
...@@ -959,7 +964,7 @@ template <class _CharT, class _Traits>...@@ -959,7 +964,7 @@ template <class _CharT, class _Traits>
959typename basic_filebuf<_CharT, _Traits>::pos_type964typename basic_filebuf<_CharT, _Traits>::pos_type
960basic_filebuf<_CharT, _Traits>::seekpos(pos_type __sp, ios_base::openmode)965basic_filebuf<_CharT, _Traits>::seekpos(pos_type __sp, ios_base::openmode)
961{966{
962 if (__file_ == 0 || sync())967 if (__file_ == nullptr || sync())
963 return pos_type(off_type(-1));968 return pos_type(off_type(-1));
964#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)969#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
965 if (fseek(__file_, __sp, SEEK_SET))970 if (fseek(__file_, __sp, SEEK_SET))
...@@ -976,7 +981,7 @@ template <class _CharT, class _Traits>...@@ -976,7 +981,7 @@ template <class _CharT, class _Traits>
976int981int
977basic_filebuf<_CharT, _Traits>::sync()982basic_filebuf<_CharT, _Traits>::sync()
978{983{
979 if (__file_ == 0)984 if (__file_ == nullptr)
980 return 0;985 return 0;
981 if (!__cv_)986 if (!__cv_)
982 __throw_bad_cast();987 __throw_bad_cast();
...@@ -1035,7 +1040,7 @@ basic_filebuf<_CharT, _Traits>::sync()...@@ -1035,7 +1040,7 @@ basic_filebuf<_CharT, _Traits>::sync()
1035 if (__update_st)1040 if (__update_st)
1036 __st_ = __state;1041 __st_ = __state;
1037 __extbufnext_ = __extbufend_ = __extbuf_;1042 __extbufnext_ = __extbufend_ = __extbuf_;
1038 this->setg(0, 0, 0);1043 this->setg(nullptr, nullptr, nullptr);
1039 __cm_ = 0;1044 __cm_ = 0;
1040 }1045 }
1041 return 0;1046 return 0;
...@@ -1051,8 +1056,8 @@ basic_filebuf<_CharT, _Traits>::imbue(const locale& __loc)...@@ -1051,8 +1056,8 @@ basic_filebuf<_CharT, _Traits>::imbue(const locale& __loc)
1051 __always_noconv_ = __cv_->always_noconv();1056 __always_noconv_ = __cv_->always_noconv();
1052 if (__old_anc != __always_noconv_)1057 if (__old_anc != __always_noconv_)
1053 {1058 {
1054 this->setg(0, 0, 0);1059 this->setg(nullptr, nullptr, nullptr);
1055 this->setp(0, 0);1060 this->setp(nullptr, nullptr);
1056 // invariant, char_type is char, else we couldn't get here1061 // invariant, char_type is char, else we couldn't get here
1057 if (__always_noconv_) // need to dump __intbuf_1062 if (__always_noconv_) // need to dump __intbuf_
1058 {1063 {
...@@ -1062,7 +1067,7 @@ basic_filebuf<_CharT, _Traits>::imbue(const locale& __loc)...@@ -1062,7 +1067,7 @@ basic_filebuf<_CharT, _Traits>::imbue(const locale& __loc)
1062 __ebs_ = __ibs_;1067 __ebs_ = __ibs_;
1063 __extbuf_ = (char*)__intbuf_;1068 __extbuf_ = (char*)__intbuf_;
1064 __ibs_ = 0;1069 __ibs_ = 0;
1065 __intbuf_ = 0;1070 __intbuf_ = nullptr;
1066 __owns_ib_ = false;1071 __owns_ib_ = false;
1067 }1072 }
1068 else // need to obtain an __intbuf_.1073 else // need to obtain an __intbuf_.
...@@ -1091,7 +1096,7 @@ basic_filebuf<_CharT, _Traits>::__read_mode()...@@ -1091,7 +1096,7 @@ basic_filebuf<_CharT, _Traits>::__read_mode()
1091{1096{
1092 if (!(__cm_ & ios_base::in))1097 if (!(__cm_ & ios_base::in))
1093 {1098 {
1094 this->setp(0, 0);1099 this->setp(nullptr, nullptr);
1095 if (__always_noconv_)1100 if (__always_noconv_)
1096 this->setg((char_type*)__extbuf_,1101 this->setg((char_type*)__extbuf_,
1097 (char_type*)__extbuf_ + __ebs_,1102 (char_type*)__extbuf_ + __ebs_,
...@@ -1110,7 +1115,7 @@ basic_filebuf<_CharT, _Traits>::__write_mode()...@@ -1110,7 +1115,7 @@ basic_filebuf<_CharT, _Traits>::__write_mode()
1110{1115{
1111 if (!(__cm_ & ios_base::out))1116 if (!(__cm_ & ios_base::out))
1112 {1117 {
1113 this->setg(0, 0, 0);1118 this->setg(nullptr, nullptr, nullptr);
1114 if (__ebs_ > sizeof(__extbuf_min_))1119 if (__ebs_ > sizeof(__extbuf_min_))
1115 {1120 {
1116 if (__always_noconv_)1121 if (__always_noconv_)
...@@ -1120,7 +1125,7 @@ basic_filebuf<_CharT, _Traits>::__write_mode()...@@ -1120,7 +1125,7 @@ basic_filebuf<_CharT, _Traits>::__write_mode()
1120 this->setp(__intbuf_, __intbuf_ + (__ibs_ - 1));1125 this->setp(__intbuf_, __intbuf_ + (__ibs_ - 1));
1121 }1126 }
1122 else1127 else
1123 this->setp(0, 0);1128 this->setp(nullptr, nullptr);
1124 __cm_ = ios_base::out;1129 __cm_ = ios_base::out;
1125 }1130 }
1126}1131}
...@@ -1149,7 +1154,7 @@ public:...@@ -1149,7 +1154,7 @@ public:
1149#endif1154#endif
1150 _LIBCPP_INLINE_VISIBILITY1155 _LIBCPP_INLINE_VISIBILITY
1151 explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);1156 explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
1152#if _LIBCPP_STD_VER >= 171157#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
1153 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY1158 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
1154 explicit basic_ifstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in)1159 explicit basic_ifstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in)
1155 : basic_ifstream(__p.c_str(), __mode) {}1160 : basic_ifstream(__p.c_str(), __mode) {}
...@@ -1175,7 +1180,7 @@ public:...@@ -1175,7 +1180,7 @@ public:
1175 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);
1176#endif1181#endif
1177 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);
1178#if _LIBCPP_STD_VER >= 171183#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
1179 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY1184 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
1180 void open(const filesystem::path& __p,1185 void open(const filesystem::path& __p,
1181 ios_base::openmode __mode = ios_base::in) {1186 ios_base::openmode __mode = ios_base::in) {
...@@ -1206,7 +1211,7 @@ inline...@@ -1206,7 +1211,7 @@ inline
1206basic_ifstream<_CharT, _Traits>::basic_ifstream(const char* __s, ios_base::openmode __mode)1211basic_ifstream<_CharT, _Traits>::basic_ifstream(const char* __s, ios_base::openmode __mode)
1207 : basic_istream<char_type, traits_type>(&__sb_)1212 : basic_istream<char_type, traits_type>(&__sb_)
1208{1213{
1209 if (__sb_.open(__s, __mode | ios_base::in) == 0)1214 if (__sb_.open(__s, __mode | ios_base::in) == nullptr)
1210 this->setstate(ios_base::failbit);1215 this->setstate(ios_base::failbit);
1211}1216}
12121217
...@@ -1216,7 +1221,7 @@ inline...@@ -1216,7 +1221,7 @@ inline
1216basic_ifstream<_CharT, _Traits>::basic_ifstream(const wchar_t* __s, ios_base::openmode __mode)1221basic_ifstream<_CharT, _Traits>::basic_ifstream(const wchar_t* __s, ios_base::openmode __mode)
1217 : basic_istream<char_type, traits_type>(&__sb_)1222 : basic_istream<char_type, traits_type>(&__sb_)
1218{1223{
1219 if (__sb_.open(__s, __mode | ios_base::in) == 0)1224 if (__sb_.open(__s, __mode | ios_base::in) == nullptr)
1220 this->setstate(ios_base::failbit);1225 this->setstate(ios_base::failbit);
1221}1226}
1222#endif1227#endif
...@@ -1226,7 +1231,7 @@ inline...@@ -1226,7 +1231,7 @@ inline
1226basic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::openmode __mode)1231basic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::openmode __mode)
1227 : basic_istream<char_type, traits_type>(&__sb_)1232 : basic_istream<char_type, traits_type>(&__sb_)
1228{1233{
1229 if (__sb_.open(__s, __mode | ios_base::in) == 0)1234 if (__sb_.open(__s, __mode | ios_base::in) == nullptr)
1230 this->setstate(ios_base::failbit);1235 this->setstate(ios_base::failbit);
1231}1236}
1232#endif1237#endif
...@@ -1363,7 +1368,7 @@ public:...@@ -1363,7 +1368,7 @@ public:
1363 _LIBCPP_INLINE_VISIBILITY1368 _LIBCPP_INLINE_VISIBILITY
1364 explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);1369 explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
13651370
1366#if _LIBCPP_STD_VER >= 171371#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
1367 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY1372 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
1368 explicit basic_ofstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)1373 explicit basic_ofstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
1369 : basic_ofstream(__p.c_str(), __mode) {}1374 : basic_ofstream(__p.c_str(), __mode) {}
...@@ -1390,7 +1395,7 @@ public:...@@ -1390,7 +1395,7 @@ public:
1390#endif1395#endif
1391 void open(const string& __s, ios_base::openmode __mode = ios_base::out);1396 void open(const string& __s, ios_base::openmode __mode = ios_base::out);
13921397
1393#if _LIBCPP_STD_VER >= 171398#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
1394 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY1399 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
1395 void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)1400 void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
1396 { return open(__p.c_str(), __mode); }1401 { return open(__p.c_str(), __mode); }
...@@ -1419,7 +1424,7 @@ inline...@@ -1419,7 +1424,7 @@ inline
1419basic_ofstream<_CharT, _Traits>::basic_ofstream(const char* __s, ios_base::openmode __mode)1424basic_ofstream<_CharT, _Traits>::basic_ofstream(const char* __s, ios_base::openmode __mode)
1420 : basic_ostream<char_type, traits_type>(&__sb_)1425 : basic_ostream<char_type, traits_type>(&__sb_)
1421{1426{
1422 if (__sb_.open(__s, __mode | ios_base::out) == 0)1427 if (__sb_.open(__s, __mode | ios_base::out) == nullptr)
1423 this->setstate(ios_base::failbit);1428 this->setstate(ios_base::failbit);
1424}1429}
14251430
...@@ -1429,7 +1434,7 @@ inline...@@ -1429,7 +1434,7 @@ inline
1429basic_ofstream<_CharT, _Traits>::basic_ofstream(const wchar_t* __s, ios_base::openmode __mode)1434basic_ofstream<_CharT, _Traits>::basic_ofstream(const wchar_t* __s, ios_base::openmode __mode)
1430 : basic_ostream<char_type, traits_type>(&__sb_)1435 : basic_ostream<char_type, traits_type>(&__sb_)
1431{1436{
1432 if (__sb_.open(__s, __mode | ios_base::out) == 0)1437 if (__sb_.open(__s, __mode | ios_base::out) == nullptr)
1433 this->setstate(ios_base::failbit);1438 this->setstate(ios_base::failbit);
1434}1439}
1435#endif1440#endif
...@@ -1439,7 +1444,7 @@ inline...@@ -1439,7 +1444,7 @@ inline
1439basic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::openmode __mode)1444basic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::openmode __mode)
1440 : basic_ostream<char_type, traits_type>(&__sb_)1445 : basic_ostream<char_type, traits_type>(&__sb_)
1441{1446{
1442 if (__sb_.open(__s, __mode | ios_base::out) == 0)1447 if (__sb_.open(__s, __mode | ios_base::out) == nullptr)
1443 this->setstate(ios_base::failbit);1448 this->setstate(ios_base::failbit);
1444}1449}
1445#endif1450#endif
...@@ -1548,7 +1553,7 @@ inline...@@ -1548,7 +1553,7 @@ inline
1548void1553void
1549basic_ofstream<_CharT, _Traits>::close()1554basic_ofstream<_CharT, _Traits>::close()
1550{1555{
1551 if (__sb_.close() == 0)1556 if (__sb_.close() == nullptr)
1552 this->setstate(ios_base::failbit);1557 this->setstate(ios_base::failbit);
1553}1558}
15541559
...@@ -1577,7 +1582,7 @@ public:...@@ -1577,7 +1582,7 @@ public:
1577 _LIBCPP_INLINE_VISIBILITY1582 _LIBCPP_INLINE_VISIBILITY
1578 explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);1583 explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
15791584
1580#if _LIBCPP_STD_VER >= 171585#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
1581 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY1586 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
1582 explicit basic_fstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out)1587 explicit basic_fstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out)
1583 : basic_fstream(__p.c_str(), __mode) {}1588 : basic_fstream(__p.c_str(), __mode) {}
...@@ -1605,7 +1610,7 @@ public:...@@ -1605,7 +1610,7 @@ public:
1605#endif1610#endif
1606 void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);1611 void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
16071612
1608#if _LIBCPP_STD_VER >= 171613#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
1609 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY1614 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
1610 void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in|ios_base::out)1615 void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in|ios_base::out)
1611 { return open(__p.c_str(), __mode); }1616 { return open(__p.c_str(), __mode); }
...@@ -1632,7 +1637,7 @@ inline...@@ -1632,7 +1637,7 @@ inline
1632basic_fstream<_CharT, _Traits>::basic_fstream(const char* __s, ios_base::openmode __mode)1637basic_fstream<_CharT, _Traits>::basic_fstream(const char* __s, ios_base::openmode __mode)
1633 : basic_iostream<char_type, traits_type>(&__sb_)1638 : basic_iostream<char_type, traits_type>(&__sb_)
1634{1639{
1635 if (__sb_.open(__s, __mode) == 0)1640 if (__sb_.open(__s, __mode) == nullptr)
1636 this->setstate(ios_base::failbit);1641 this->setstate(ios_base::failbit);
1637}1642}
16381643
...@@ -1642,7 +1647,7 @@ inline...@@ -1642,7 +1647,7 @@ inline
1642basic_fstream<_CharT, _Traits>::basic_fstream(const wchar_t* __s, ios_base::openmode __mode)1647basic_fstream<_CharT, _Traits>::basic_fstream(const wchar_t* __s, ios_base::openmode __mode)
1643 : basic_iostream<char_type, traits_type>(&__sb_)1648 : basic_iostream<char_type, traits_type>(&__sb_)
1644{1649{
1645 if (__sb_.open(__s, __mode) == 0)1650 if (__sb_.open(__s, __mode) == nullptr)
1646 this->setstate(ios_base::failbit);1651 this->setstate(ios_base::failbit);
1647}1652}
1648#endif1653#endif
...@@ -1652,7 +1657,7 @@ inline...@@ -1652,7 +1657,7 @@ inline
1652basic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openmode __mode)1657basic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openmode __mode)
1653 : basic_iostream<char_type, traits_type>(&__sb_)1658 : basic_iostream<char_type, traits_type>(&__sb_)
1654{1659{
1655 if (__sb_.open(__s, __mode) == 0)1660 if (__sb_.open(__s, __mode) == nullptr)
1656 this->setstate(ios_base::failbit);1661 this->setstate(ios_base::failbit);
1657}1662}
1658#endif1663#endif
...@@ -1752,10 +1757,16 @@ inline...@@ -1752,10 +1757,16 @@ inline
1752void1757void
1753basic_fstream<_CharT, _Traits>::close()1758basic_fstream<_CharT, _Traits>::close()
1754{1759{
1755 if (__sb_.close() == 0)1760 if (__sb_.close() == nullptr)
1756 this->setstate(ios_base::failbit);1761 this->setstate(ios_base::failbit);
1757}1762}
17581763
1764#if defined(_LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1)
1765_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ifstream<char>)
1766_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ofstream<char>)
1767_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_filebuf<char>)
1768#endif
1769
1759_LIBCPP_END_NAMESPACE_STD1770_LIBCPP_END_NAMESPACE_STD
17601771
1761_LIBCPP_POP_MACROS1772_LIBCPP_POP_MACROS
lib/libcxx/include/functional+82-78
...@@ -213,7 +213,8 @@ public:...@@ -213,7 +213,8 @@ public:
213template <class Predicate> // deprecated in C++17213template <class Predicate> // deprecated in C++17
214binary_negate<Predicate> not2(const Predicate& pred);214binary_negate<Predicate> not2(const Predicate& pred);
215215
216template <class F> unspecified not_fn(F&& f); // C++17216template <class F>
217constexpr unspecified not_fn(F&& f); // C++17, constexpr in C++20
217218
218template<class T> struct is_bind_expression;219template<class T> struct is_bind_expression;
219template<class T> struct is_placeholder;220template<class T> struct is_placeholder;
...@@ -226,11 +227,12 @@ template <class T> inline constexpr int is_placeholder_v...@@ -226,11 +227,12 @@ template <class T> inline constexpr int is_placeholder_v
226227
227228
228template<class Fn, class... BoundArgs>229template<class Fn, class... BoundArgs>
229 unspecified bind(Fn&&, BoundArgs&&...);230 constexpr unspecified bind(Fn&&, BoundArgs&&...); // constexpr in C++20
230template<class R, class Fn, class... BoundArgs>231template<class R, class Fn, class... BoundArgs>
231 unspecified bind(Fn&&, BoundArgs&&...);232 constexpr unspecified bind(Fn&&, BoundArgs&&...); // constexpr in C++20
232233
233template<class F, class... Args>234template<class F, class... Args>
235 constexpr // constexpr in C++20
234 invoke_result_t<F, Args...> invoke(F&& f, Args&&... args) // C++17236 invoke_result_t<F, Args...> invoke(F&& f, Args&&... args) // C++17
235 noexcept(is_nothrow_invocable_v<F, Args...>);237 noexcept(is_nothrow_invocable_v<F, Args...>);
236238
...@@ -376,7 +378,8 @@ public:...@@ -376,7 +378,8 @@ public:
376template <class S, class T> const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const); // deprecated in C++11, removed in C++17378template <class S, class T> const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const); // deprecated in C++11, removed in C++17
377template <class S, class T, class A> const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const); // deprecated in C++11, removed in C++17379template <class S, class T, class A> const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const); // deprecated in C++11, removed in C++17
378380
379template<class R, class T> unspecified mem_fn(R T::*);381template<class R, class T>
382constexpr unspecified mem_fn(R T::*); // constexpr in C++20
380383
381class bad_function_call384class bad_function_call
382 : public exception385 : public exception
...@@ -470,6 +473,7 @@ template <> struct hash<bool>;...@@ -470,6 +473,7 @@ template <> struct hash<bool>;
470template <> struct hash<char>;473template <> struct hash<char>;
471template <> struct hash<signed char>;474template <> struct hash<signed char>;
472template <> struct hash<unsigned char>;475template <> struct hash<unsigned char>;
476template <> struct hash<char8_t>; // since C++20
473template <> struct hash<char16_t>;477template <> struct hash<char16_t>;
474template <> struct hash<char32_t>;478template <> struct hash<char32_t>;
475template <> struct hash<wchar_t>;479template <> struct hash<wchar_t>;
...@@ -508,10 +512,6 @@ POLICY: For non-variadic implementations, the number of arguments is limited...@@ -508,10 +512,6 @@ POLICY: For non-variadic implementations, the number of arguments is limited
508512
509#include <__functional_base>513#include <__functional_base>
510514
511#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME) && !defined(_LIBCPP_HAS_OBJC_ARC)
512#include <Block.h>
513#endif
514
515#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)515#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
516#pragma GCC system_header516#pragma GCC system_header
517#endif517#endif
...@@ -1291,15 +1291,16 @@ private:...@@ -1291,15 +1291,16 @@ private:
1291 type __f_;1291 type __f_;
12921292
1293public:1293public:
1294 _LIBCPP_INLINE_VISIBILITY __mem_fn(type __f) _NOEXCEPT : __f_(__f) {}1294 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1295 __mem_fn(type __f) _NOEXCEPT : __f_(__f) {}
12951296
1296#ifndef _LIBCPP_CXX03_LANG1297#ifndef _LIBCPP_CXX03_LANG
1297 // invoke1298 // invoke
1298 template <class... _ArgTypes>1299 template <class... _ArgTypes>
1299 _LIBCPP_INLINE_VISIBILITY1300 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1300 typename __invoke_return<type, _ArgTypes...>::type1301 typename __invoke_return<type, _ArgTypes...>::type
1301 operator() (_ArgTypes&&... __args) const {1302 operator() (_ArgTypes&&... __args) const {
1302 return __invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...);1303 return _VSTD::__invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...);
1303 }1304 }
1304#else1305#else
13051306
...@@ -1307,104 +1308,104 @@ public:...@@ -1307,104 +1308,104 @@ public:
1307 _LIBCPP_INLINE_VISIBILITY1308 _LIBCPP_INLINE_VISIBILITY
1308 typename __invoke_return0<type, _A0>::type1309 typename __invoke_return0<type, _A0>::type
1309 operator() (_A0& __a0) const {1310 operator() (_A0& __a0) const {
1310 return __invoke(__f_, __a0);1311 return _VSTD::__invoke(__f_, __a0);
1311 }1312 }
13121313
1313 template <class _A0>1314 template <class _A0>
1314 _LIBCPP_INLINE_VISIBILITY1315 _LIBCPP_INLINE_VISIBILITY
1315 typename __invoke_return0<type, _A0 const>::type1316 typename __invoke_return0<type, _A0 const>::type
1316 operator() (_A0 const& __a0) const {1317 operator() (_A0 const& __a0) const {
1317 return __invoke(__f_, __a0);1318 return _VSTD::__invoke(__f_, __a0);
1318 }1319 }
13191320
1320 template <class _A0, class _A1>1321 template <class _A0, class _A1>
1321 _LIBCPP_INLINE_VISIBILITY1322 _LIBCPP_INLINE_VISIBILITY
1322 typename __invoke_return1<type, _A0, _A1>::type1323 typename __invoke_return1<type, _A0, _A1>::type
1323 operator() (_A0& __a0, _A1& __a1) const {1324 operator() (_A0& __a0, _A1& __a1) const {
1324 return __invoke(__f_, __a0, __a1);1325 return _VSTD::__invoke(__f_, __a0, __a1);
1325 }1326 }
13261327
1327 template <class _A0, class _A1>1328 template <class _A0, class _A1>
1328 _LIBCPP_INLINE_VISIBILITY1329 _LIBCPP_INLINE_VISIBILITY
1329 typename __invoke_return1<type, _A0 const, _A1>::type1330 typename __invoke_return1<type, _A0 const, _A1>::type
1330 operator() (_A0 const& __a0, _A1& __a1) const {1331 operator() (_A0 const& __a0, _A1& __a1) const {
1331 return __invoke(__f_, __a0, __a1);1332 return _VSTD::__invoke(__f_, __a0, __a1);
1332 }1333 }
13331334
1334 template <class _A0, class _A1>1335 template <class _A0, class _A1>
1335 _LIBCPP_INLINE_VISIBILITY1336 _LIBCPP_INLINE_VISIBILITY
1336 typename __invoke_return1<type, _A0, _A1 const>::type1337 typename __invoke_return1<type, _A0, _A1 const>::type
1337 operator() (_A0& __a0, _A1 const& __a1) const {1338 operator() (_A0& __a0, _A1 const& __a1) const {
1338 return __invoke(__f_, __a0, __a1);1339 return _VSTD::__invoke(__f_, __a0, __a1);
1339 }1340 }
13401341
1341 template <class _A0, class _A1>1342 template <class _A0, class _A1>
1342 _LIBCPP_INLINE_VISIBILITY1343 _LIBCPP_INLINE_VISIBILITY
1343 typename __invoke_return1<type, _A0 const, _A1 const>::type1344 typename __invoke_return1<type, _A0 const, _A1 const>::type
1344 operator() (_A0 const& __a0, _A1 const& __a1) const {1345 operator() (_A0 const& __a0, _A1 const& __a1) const {
1345 return __invoke(__f_, __a0, __a1);1346 return _VSTD::__invoke(__f_, __a0, __a1);
1346 }1347 }
13471348
1348 template <class _A0, class _A1, class _A2>1349 template <class _A0, class _A1, class _A2>
1349 _LIBCPP_INLINE_VISIBILITY1350 _LIBCPP_INLINE_VISIBILITY
1350 typename __invoke_return2<type, _A0, _A1, _A2>::type1351 typename __invoke_return2<type, _A0, _A1, _A2>::type
1351 operator() (_A0& __a0, _A1& __a1, _A2& __a2) const {1352 operator() (_A0& __a0, _A1& __a1, _A2& __a2) const {
1352 return __invoke(__f_, __a0, __a1, __a2);1353 return _VSTD::__invoke(__f_, __a0, __a1, __a2);
1353 }1354 }
13541355
1355 template <class _A0, class _A1, class _A2>1356 template <class _A0, class _A1, class _A2>
1356 _LIBCPP_INLINE_VISIBILITY1357 _LIBCPP_INLINE_VISIBILITY
1357 typename __invoke_return2<type, _A0 const, _A1, _A2>::type1358 typename __invoke_return2<type, _A0 const, _A1, _A2>::type
1358 operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const {1359 operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const {
1359 return __invoke(__f_, __a0, __a1, __a2);1360 return _VSTD::__invoke(__f_, __a0, __a1, __a2);
1360 }1361 }
13611362
1362 template <class _A0, class _A1, class _A2>1363 template <class _A0, class _A1, class _A2>
1363 _LIBCPP_INLINE_VISIBILITY1364 _LIBCPP_INLINE_VISIBILITY
1364 typename __invoke_return2<type, _A0, _A1 const, _A2>::type1365 typename __invoke_return2<type, _A0, _A1 const, _A2>::type
1365 operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const {1366 operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const {
1366 return __invoke(__f_, __a0, __a1, __a2);1367 return _VSTD::__invoke(__f_, __a0, __a1, __a2);
1367 }1368 }
13681369
1369 template <class _A0, class _A1, class _A2>1370 template <class _A0, class _A1, class _A2>
1370 _LIBCPP_INLINE_VISIBILITY1371 _LIBCPP_INLINE_VISIBILITY
1371 typename __invoke_return2<type, _A0, _A1, _A2 const>::type1372 typename __invoke_return2<type, _A0, _A1, _A2 const>::type
1372 operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const {1373 operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const {
1373 return __invoke(__f_, __a0, __a1, __a2);1374 return _VSTD::__invoke(__f_, __a0, __a1, __a2);
1374 }1375 }
13751376
1376 template <class _A0, class _A1, class _A2>1377 template <class _A0, class _A1, class _A2>
1377 _LIBCPP_INLINE_VISIBILITY1378 _LIBCPP_INLINE_VISIBILITY
1378 typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type1379 typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type
1379 operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const {1380 operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const {
1380 return __invoke(__f_, __a0, __a1, __a2);1381 return _VSTD::__invoke(__f_, __a0, __a1, __a2);
1381 }1382 }
13821383
1383 template <class _A0, class _A1, class _A2>1384 template <class _A0, class _A1, class _A2>
1384 _LIBCPP_INLINE_VISIBILITY1385 _LIBCPP_INLINE_VISIBILITY
1385 typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type1386 typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type
1386 operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const {1387 operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const {
1387 return __invoke(__f_, __a0, __a1, __a2);1388 return _VSTD::__invoke(__f_, __a0, __a1, __a2);
1388 }1389 }
13891390
1390 template <class _A0, class _A1, class _A2>1391 template <class _A0, class _A1, class _A2>
1391 _LIBCPP_INLINE_VISIBILITY1392 _LIBCPP_INLINE_VISIBILITY
1392 typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type1393 typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type
1393 operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const {1394 operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const {
1394 return __invoke(__f_, __a0, __a1, __a2);1395 return _VSTD::__invoke(__f_, __a0, __a1, __a2);
1395 }1396 }
13961397
1397 template <class _A0, class _A1, class _A2>1398 template <class _A0, class _A1, class _A2>
1398 _LIBCPP_INLINE_VISIBILITY1399 _LIBCPP_INLINE_VISIBILITY
1399 typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type1400 typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type
1400 operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const {1401 operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const {
1401 return __invoke(__f_, __a0, __a1, __a2);1402 return _VSTD::__invoke(__f_, __a0, __a1, __a2);
1402 }1403 }
1403#endif1404#endif
1404};1405};
14051406
1406template<class _Rp, class _Tp>1407template<class _Rp, class _Tp>
1407inline _LIBCPP_INLINE_VISIBILITY1408inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1408__mem_fn<_Rp _Tp::*>1409__mem_fn<_Rp _Tp::*>
1409mem_fn(_Rp _Tp::* __pm) _NOEXCEPT1410mem_fn(_Rp _Tp::* __pm) _NOEXCEPT
1410{1411{
...@@ -1596,7 +1597,7 @@ public:...@@ -1596,7 +1597,7 @@ public:
1596 const _Target& __target() const { return __f_; }1597 const _Target& __target() const { return __f_; }
15971598
1598 _LIBCPP_INLINE_VISIBILITY1599 _LIBCPP_INLINE_VISIBILITY
1599 explicit __default_alloc_func(_Target&& __f) : __f_(std::move(__f)) {}1600 explicit __default_alloc_func(_Target&& __f) : __f_(_VSTD::move(__f)) {}
16001601
1601 _LIBCPP_INLINE_VISIBILITY1602 _LIBCPP_INLINE_VISIBILITY
1602 explicit __default_alloc_func(const _Target& __f) : __f_(__f) {}1603 explicit __default_alloc_func(const _Target& __f) : __f_(__f) {}
...@@ -1612,7 +1613,7 @@ public:...@@ -1612,7 +1613,7 @@ public:
1612 __builtin_new_allocator::__holder_t __hold =1613 __builtin_new_allocator::__holder_t __hold =
1613 __builtin_new_allocator::__allocate_type<__default_alloc_func>(1);1614 __builtin_new_allocator::__allocate_type<__default_alloc_func>(1);
1614 __default_alloc_func* __res =1615 __default_alloc_func* __res =
1615 ::new (__hold.get()) __default_alloc_func(__f_);1616 ::new ((void*)__hold.get()) __default_alloc_func(__f_);
1616 (void)__hold.release();1617 (void)__hold.release();
1617 return __res;1618 return __res;
1618 }1619 }
...@@ -1703,7 +1704,7 @@ template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>...@@ -1703,7 +1704,7 @@ template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
1703void1704void
1704__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone(__base<_Rp(_ArgTypes...)>* __p) const1705__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone(__base<_Rp(_ArgTypes...)>* __p) const
1705{1706{
1706 ::new (__p) __func(__f_.__target(), __f_.__get_allocator());1707 ::new ((void*)__p) __func(__f_.__target(), __f_.__get_allocator());
1707}1708}
17081709
1709template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>1710template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
...@@ -1739,7 +1740,7 @@ __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target(const type_info& __ti) const _NOE...@@ -1739,7 +1740,7 @@ __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target(const type_info& __ti) const _NOE
1739{1740{
1740 if (__ti == typeid(_Fp))1741 if (__ti == typeid(_Fp))
1741 return &__f_.__target();1742 return &__f_.__target();
1742 return (const void*)0;1743 return nullptr;
1743}1744}
17441745
1745template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>1746template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
...@@ -1769,11 +1770,11 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>...@@ -1769,11 +1770,11 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
17691770
1770 public:1771 public:
1771 _LIBCPP_INLINE_VISIBILITY1772 _LIBCPP_INLINE_VISIBILITY
1772 __value_func() _NOEXCEPT : __f_(0) {}1773 __value_func() _NOEXCEPT : __f_(nullptr) {}
17731774
1774 template <class _Fp, class _Alloc>1775 template <class _Fp, class _Alloc>
1775 _LIBCPP_INLINE_VISIBILITY __value_func(_Fp&& __f, const _Alloc& __a)1776 _LIBCPP_INLINE_VISIBILITY __value_func(_Fp&& __f, const _Alloc& __a)
1776 : __f_(0)1777 : __f_(nullptr)
1777 {1778 {
1778 typedef allocator_traits<_Alloc> __alloc_traits;1779 typedef allocator_traits<_Alloc> __alloc_traits;
1779 typedef __function::__func<_Fp, _Alloc, _Rp(_ArgTypes...)> _Fun;1780 typedef __function::__func<_Fp, _Alloc, _Rp(_ArgTypes...)> _Fun;
...@@ -1803,13 +1804,13 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>...@@ -1803,13 +1804,13 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
1803 template <class _Fp,1804 template <class _Fp,
1804 class = typename enable_if<!is_same<typename decay<_Fp>::type, __value_func>::value>::type>1805 class = typename enable_if<!is_same<typename decay<_Fp>::type, __value_func>::value>::type>
1805 _LIBCPP_INLINE_VISIBILITY explicit __value_func(_Fp&& __f)1806 _LIBCPP_INLINE_VISIBILITY explicit __value_func(_Fp&& __f)
1806 : __value_func(std::forward<_Fp>(__f), allocator<_Fp>()) {}1807 : __value_func(_VSTD::forward<_Fp>(__f), allocator<_Fp>()) {}
18071808
1808 _LIBCPP_INLINE_VISIBILITY1809 _LIBCPP_INLINE_VISIBILITY
1809 __value_func(const __value_func& __f)1810 __value_func(const __value_func& __f)
1810 {1811 {
1811 if (__f.__f_ == 0)1812 if (__f.__f_ == nullptr)
1812 __f_ = 0;1813 __f_ = nullptr;
1813 else if ((void*)__f.__f_ == &__f.__buf_)1814 else if ((void*)__f.__f_ == &__f.__buf_)
1814 {1815 {
1815 __f_ = __as_base(&__buf_);1816 __f_ = __as_base(&__buf_);
...@@ -1822,8 +1823,8 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>...@@ -1822,8 +1823,8 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
1822 _LIBCPP_INLINE_VISIBILITY1823 _LIBCPP_INLINE_VISIBILITY
1823 __value_func(__value_func&& __f) _NOEXCEPT1824 __value_func(__value_func&& __f) _NOEXCEPT
1824 {1825 {
1825 if (__f.__f_ == 0)1826 if (__f.__f_ == nullptr)
1826 __f_ = 0;1827 __f_ = nullptr;
1827 else if ((void*)__f.__f_ == &__f.__buf_)1828 else if ((void*)__f.__f_ == &__f.__buf_)
1828 {1829 {
1829 __f_ = __as_base(&__buf_);1830 __f_ = __as_base(&__buf_);
...@@ -1832,7 +1833,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>...@@ -1832,7 +1833,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
1832 else1833 else
1833 {1834 {
1834 __f_ = __f.__f_;1835 __f_ = __f.__f_;
1835 __f.__f_ = 0;1836 __f.__f_ = nullptr;
1836 }1837 }
1837 }1838 }
18381839
...@@ -1849,8 +1850,8 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>...@@ -1849,8 +1850,8 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
1849 __value_func& operator=(__value_func&& __f)1850 __value_func& operator=(__value_func&& __f)
1850 {1851 {
1851 *this = nullptr;1852 *this = nullptr;
1852 if (__f.__f_ == 0)1853 if (__f.__f_ == nullptr)
1853 __f_ = 0;1854 __f_ = nullptr;
1854 else if ((void*)__f.__f_ == &__f.__buf_)1855 else if ((void*)__f.__f_ == &__f.__buf_)
1855 {1856 {
1856 __f_ = __as_base(&__buf_);1857 __f_ = __as_base(&__buf_);
...@@ -1859,7 +1860,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>...@@ -1859,7 +1860,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
1859 else1860 else
1860 {1861 {
1861 __f_ = __f.__f_;1862 __f_ = __f.__f_;
1862 __f.__f_ = 0;1863 __f.__f_ = nullptr;
1863 }1864 }
1864 return *this;1865 return *this;
1865 }1866 }
...@@ -1868,7 +1869,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>...@@ -1868,7 +1869,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
1868 __value_func& operator=(nullptr_t)1869 __value_func& operator=(nullptr_t)
1869 {1870 {
1870 __func* __f = __f_;1871 __func* __f = __f_;
1871 __f_ = 0;1872 __f_ = nullptr;
1872 if ((void*)__f == &__buf_)1873 if ((void*)__f == &__buf_)
1873 __f->destroy();1874 __f->destroy();
1874 else if (__f)1875 else if (__f)
...@@ -1879,7 +1880,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>...@@ -1879,7 +1880,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
1879 _LIBCPP_INLINE_VISIBILITY1880 _LIBCPP_INLINE_VISIBILITY
1880 _Rp operator()(_ArgTypes&&... __args) const1881 _Rp operator()(_ArgTypes&&... __args) const
1881 {1882 {
1882 if (__f_ == 0)1883 if (__f_ == nullptr)
1883 __throw_bad_function_call();1884 __throw_bad_function_call();
1884 return (*__f_)(_VSTD::forward<_ArgTypes>(__args)...);1885 return (*__f_)(_VSTD::forward<_ArgTypes>(__args)...);
1885 }1886 }
...@@ -1895,10 +1896,10 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>...@@ -1895,10 +1896,10 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
1895 __func* __t = __as_base(&__tempbuf);1896 __func* __t = __as_base(&__tempbuf);
1896 __f_->__clone(__t);1897 __f_->__clone(__t);
1897 __f_->destroy();1898 __f_->destroy();
1898 __f_ = 0;1899 __f_ = nullptr;
1899 __f.__f_->__clone(__as_base(&__buf_));1900 __f.__f_->__clone(__as_base(&__buf_));
1900 __f.__f_->destroy();1901 __f.__f_->destroy();
1901 __f.__f_ = 0;1902 __f.__f_ = nullptr;
1902 __f_ = __as_base(&__buf_);1903 __f_ = __as_base(&__buf_);
1903 __t->__clone(__as_base(&__f.__buf_));1904 __t->__clone(__as_base(&__f.__buf_));
1904 __t->destroy();1905 __t->destroy();
...@@ -1923,13 +1924,13 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>...@@ -1923,13 +1924,13 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
1923 }1924 }
19241925
1925 _LIBCPP_INLINE_VISIBILITY1926 _LIBCPP_INLINE_VISIBILITY
1926 _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT { return __f_ != 0; }1927 _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT { return __f_ != nullptr; }
19271928
1928#ifndef _LIBCPP_NO_RTTI1929#ifndef _LIBCPP_NO_RTTI
1929 _LIBCPP_INLINE_VISIBILITY1930 _LIBCPP_INLINE_VISIBILITY
1930 const std::type_info& target_type() const _NOEXCEPT1931 const std::type_info& target_type() const _NOEXCEPT
1931 {1932 {
1932 if (__f_ == 0)1933 if (__f_ == nullptr)
1933 return typeid(void);1934 return typeid(void);
1934 return __f_->target_type();1935 return __f_->target_type();
1935 }1936 }
...@@ -1937,8 +1938,8 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>...@@ -1937,8 +1938,8 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
1937 template <typename _Tp>1938 template <typename _Tp>
1938 _LIBCPP_INLINE_VISIBILITY const _Tp* target() const _NOEXCEPT1939 _LIBCPP_INLINE_VISIBILITY const _Tp* target() const _NOEXCEPT
1939 {1940 {
1940 if (__f_ == 0)1941 if (__f_ == nullptr)
1941 return 0;1942 return nullptr;
1942 return (const _Tp*)__f_->target(typeid(_Tp));1943 return (const _Tp*)__f_->target(typeid(_Tp));
1943 }1944 }
1944#endif // _LIBCPP_NO_RTTI1945#endif // _LIBCPP_NO_RTTI
...@@ -2157,7 +2158,7 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>...@@ -2157,7 +2158,7 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
2157 } else {2158 } else {
2158 __builtin_new_allocator::__holder_t __hold =2159 __builtin_new_allocator::__holder_t __hold =
2159 __builtin_new_allocator::__allocate_type<_Fun>(1);2160 __builtin_new_allocator::__allocate_type<_Fun>(1);
2160 __buf_.__large = ::new (__hold.get()) _Fun(_VSTD::move(__f));2161 __buf_.__large = ::new ((void*)__hold.get()) _Fun(_VSTD::move(__f));
2161 (void)__hold.release();2162 (void)__hold.release();
2162 }2163 }
2163 }2164 }
...@@ -2257,6 +2258,9 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>...@@ -2257,6 +2258,9 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
22572258
2258#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME) && !defined(_LIBCPP_HAS_OBJC_ARC)2259#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME) && !defined(_LIBCPP_HAS_OBJC_ARC)
22592260
2261extern "C" void *_Block_copy(const void *);
2262extern "C" void _Block_release(const void *);
2263
2260template<class _Rp1, class ..._ArgTypes1, class _Alloc, class _Rp, class ..._ArgTypes>2264template<class _Rp1, class ..._ArgTypes1, class _Alloc, class _Rp, class ..._ArgTypes>
2261class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>2265class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
2262 : public __base<_Rp(_ArgTypes...)>2266 : public __base<_Rp(_ArgTypes...)>
...@@ -2267,14 +2271,14 @@ class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>...@@ -2267,14 +2271,14 @@ class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
2267public:2271public:
2268 _LIBCPP_INLINE_VISIBILITY2272 _LIBCPP_INLINE_VISIBILITY
2269 explicit __func(__block_type const& __f)2273 explicit __func(__block_type const& __f)
2270 : __f_(__f ? Block_copy(__f) : (__block_type)0)2274 : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
2271 { }2275 { }
22722276
2273 // [TODO] add && to save on a retain2277 // [TODO] add && to save on a retain
22742278
2275 _LIBCPP_INLINE_VISIBILITY2279 _LIBCPP_INLINE_VISIBILITY
2276 explicit __func(__block_type __f, const _Alloc& /* unused */)2280 explicit __func(__block_type __f, const _Alloc& /* unused */)
2277 : __f_(__f ? Block_copy(__f) : (__block_type)0)2281 : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr))
2278 { }2282 { }
22792283
2280 virtual __base<_Rp(_ArgTypes...)>* __clone() const {2284 virtual __base<_Rp(_ArgTypes...)>* __clone() const {
...@@ -2286,12 +2290,12 @@ public:...@@ -2286,12 +2290,12 @@ public:
2286 }2290 }
22872291
2288 virtual void __clone(__base<_Rp(_ArgTypes...)>* __p) const {2292 virtual void __clone(__base<_Rp(_ArgTypes...)>* __p) const {
2289 ::new (__p) __func(__f_);2293 ::new ((void*)__p) __func(__f_);
2290 }2294 }
22912295
2292 virtual void destroy() _NOEXCEPT {2296 virtual void destroy() _NOEXCEPT {
2293 if (__f_)2297 if (__f_)
2294 Block_release(__f_);2298 _Block_release(__f_);
2295 __f_ = 0;2299 __f_ = 0;
2296 }2300 }
22972301
...@@ -2303,7 +2307,7 @@ public:...@@ -2303,7 +2307,7 @@ public:
2303 }2307 }
23042308
2305 virtual _Rp operator()(_ArgTypes&& ... __arg) {2309 virtual _Rp operator()(_ArgTypes&& ... __arg) {
2306 return __invoke(__f_, _VSTD::forward<_ArgTypes>(__arg)...);2310 return _VSTD::__invoke(__f_, _VSTD::forward<_ArgTypes>(__arg)...);
2307 }2311 }
23082312
2309#ifndef _LIBCPP_NO_RTTI2313#ifndef _LIBCPP_NO_RTTI
...@@ -2344,9 +2348,9 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>...@@ -2344,9 +2348,9 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
2344 template <class _Fp>2348 template <class _Fp>
2345 struct __callable<_Fp, true>2349 struct __callable<_Fp, true>
2346 {2350 {
2347 static const bool value = is_same<void, _Rp>::value ||2351 static const bool value = is_void<_Rp>::value ||
2348 is_convertible<typename __invoke_of<_Fp, _ArgTypes...>::type,2352 __is_core_convertible<typename __invoke_of<_Fp, _ArgTypes...>::type,
2349 _Rp>::value;2353 _Rp>::value;
2350 };2354 };
2351 template <class _Fp>2355 template <class _Fp>
2352 struct __callable<_Fp, false>2356 struct __callable<_Fp, false>
...@@ -2518,7 +2522,7 @@ template<class _Rp, class ..._ArgTypes>...@@ -2518,7 +2522,7 @@ template<class _Rp, class ..._ArgTypes>
2518function<_Rp(_ArgTypes...)>&2522function<_Rp(_ArgTypes...)>&
2519function<_Rp(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT2523function<_Rp(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT
2520{2524{
2521 __f_ = std::move(__f.__f_);2525 __f_ = _VSTD::move(__f.__f_);
2522 return *this;2526 return *this;
2523}2527}
25242528
...@@ -2701,7 +2705,7 @@ typename _EnableIf...@@ -2701,7 +2705,7 @@ typename _EnableIf
2701__mu(_Ti& __ti, tuple<_Uj...>& __uj)2705__mu(_Ti& __ti, tuple<_Uj...>& __uj)
2702{2706{
2703 typedef typename __make_tuple_indices<sizeof...(_Uj)>::type __indices;2707 typedef typename __make_tuple_indices<sizeof...(_Uj)>::type __indices;
2704 return __mu_expand(__ti, __uj, __indices());2708 return _VSTD::__mu_expand(__ti, __uj, __indices());
2705}2709}
27062710
2707template <bool IsPh, class _Ti, class _Uj>2711template <bool IsPh, class _Ti, class _Uj>
...@@ -2873,13 +2877,13 @@ public:...@@ -2873,13 +2877,13 @@ public:
2873 !is_same<typename remove_reference<_Gp>::type,2877 !is_same<typename remove_reference<_Gp>::type,
2874 __bind>::value2878 __bind>::value
2875 >::type>2879 >::type>
2876 _LIBCPP_INLINE_VISIBILITY2880 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2877 explicit __bind(_Gp&& __f, _BA&& ...__bound_args)2881 explicit __bind(_Gp&& __f, _BA&& ...__bound_args)
2878 : __f_(_VSTD::forward<_Gp>(__f)),2882 : __f_(_VSTD::forward<_Gp>(__f)),
2879 __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}2883 __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}
28802884
2881 template <class ..._Args>2885 template <class ..._Args>
2882 _LIBCPP_INLINE_VISIBILITY2886 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2883 typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type2887 typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
2884 operator()(_Args&& ...__args)2888 operator()(_Args&& ...__args)
2885 {2889 {
...@@ -2888,7 +2892,7 @@ public:...@@ -2888,7 +2892,7 @@ public:
2888 }2892 }
28892893
2890 template <class ..._Args>2894 template <class ..._Args>
2891 _LIBCPP_INLINE_VISIBILITY2895 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2892 typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type2896 typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type
2893 operator()(_Args&& ...__args) const2897 operator()(_Args&& ...__args) const
2894 {2898 {
...@@ -2918,13 +2922,13 @@ public:...@@ -2918,13 +2922,13 @@ public:
2918 !is_same<typename remove_reference<_Gp>::type,2922 !is_same<typename remove_reference<_Gp>::type,
2919 __bind_r>::value2923 __bind_r>::value
2920 >::type>2924 >::type>
2921 _LIBCPP_INLINE_VISIBILITY2925 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2922 explicit __bind_r(_Gp&& __f, _BA&& ...__bound_args)2926 explicit __bind_r(_Gp&& __f, _BA&& ...__bound_args)
2923 : base(_VSTD::forward<_Gp>(__f),2927 : base(_VSTD::forward<_Gp>(__f),
2924 _VSTD::forward<_BA>(__bound_args)...) {}2928 _VSTD::forward<_BA>(__bound_args)...) {}
29252929
2926 template <class ..._Args>2930 template <class ..._Args>
2927 _LIBCPP_INLINE_VISIBILITY2931 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2928 typename enable_if2932 typename enable_if
2929 <2933 <
2930 is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type,2934 is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type,
...@@ -2938,7 +2942,7 @@ public:...@@ -2938,7 +2942,7 @@ public:
2938 }2942 }
29392943
2940 template <class ..._Args>2944 template <class ..._Args>
2941 _LIBCPP_INLINE_VISIBILITY2945 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2942 typename enable_if2946 typename enable_if
2943 <2947 <
2944 is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type,2948 is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type,
...@@ -2956,7 +2960,7 @@ template<class _Rp, class _Fp, class ..._BoundArgs>...@@ -2956,7 +2960,7 @@ template<class _Rp, class _Fp, class ..._BoundArgs>
2956struct __is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {};2960struct __is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {};
29572961
2958template<class _Fp, class ..._BoundArgs>2962template<class _Fp, class ..._BoundArgs>
2959inline _LIBCPP_INLINE_VISIBILITY2963inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2960__bind<_Fp, _BoundArgs...>2964__bind<_Fp, _BoundArgs...>
2961bind(_Fp&& __f, _BoundArgs&&... __bound_args)2965bind(_Fp&& __f, _BoundArgs&&... __bound_args)
2962{2966{
...@@ -2965,7 +2969,7 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args)...@@ -2965,7 +2969,7 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args)
2965}2969}
29662970
2967template<class _Rp, class _Fp, class ..._BoundArgs>2971template<class _Rp, class _Fp, class ..._BoundArgs>
2968inline _LIBCPP_INLINE_VISIBILITY2972inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2969__bind_r<_Rp, _Fp, _BoundArgs...>2973__bind_r<_Rp, _Fp, _BoundArgs...>
2970bind(_Fp&& __f, _BoundArgs&&... __bound_args)2974bind(_Fp&& __f, _BoundArgs&&... __bound_args)
2971{2975{
...@@ -2978,7 +2982,7 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args)...@@ -2978,7 +2982,7 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args)
2978#if _LIBCPP_STD_VER > 142982#if _LIBCPP_STD_VER > 14
29792983
2980template <class _Fn, class ..._Args>2984template <class _Fn, class ..._Args>
2981invoke_result_t<_Fn, _Args...>2985_LIBCPP_CONSTEXPR_AFTER_CXX17 invoke_result_t<_Fn, _Args...>
2982invoke(_Fn&& __f, _Args&&... __args)2986invoke(_Fn&& __f, _Args&&... __args)
2983 noexcept(is_nothrow_invocable_v<_Fn, _Args...>)2987 noexcept(is_nothrow_invocable_v<_Fn, _Args...>)
2984{2988{
...@@ -2993,21 +2997,21 @@ public:...@@ -2993,21 +2997,21 @@ public:
2993 __not_fn_imp() = delete;2997 __not_fn_imp() = delete;
29942998
2995 template <class ..._Args>2999 template <class ..._Args>
2996 _LIBCPP_INLINE_VISIBILITY3000 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
2997 auto operator()(_Args&& ...__args) &3001 auto operator()(_Args&& ...__args) &
2998 noexcept(noexcept(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))3002 noexcept(noexcept(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))
2999 -> decltype( !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))3003 -> decltype( !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
3000 { return !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...); }3004 { return !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...); }
30013005
3002 template <class ..._Args>3006 template <class ..._Args>
3003 _LIBCPP_INLINE_VISIBILITY3007 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3004 auto operator()(_Args&& ...__args) &&3008 auto operator()(_Args&& ...__args) &&
3005 noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))3009 noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))
3006 -> decltype( !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))3010 -> decltype( !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
3007 { return !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...); }3011 { return !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...); }
30083012
3009 template <class ..._Args>3013 template <class ..._Args>
3010 _LIBCPP_INLINE_VISIBILITY3014 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3011 auto operator()(_Args&& ...__args) const&3015 auto operator()(_Args&& ...__args) const&
3012 noexcept(noexcept(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))3016 noexcept(noexcept(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))
3013 -> decltype( !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))3017 -> decltype( !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
...@@ -3015,7 +3019,7 @@ public:...@@ -3015,7 +3019,7 @@ public:
30153019
30163020
3017 template <class ..._Args>3021 template <class ..._Args>
3018 _LIBCPP_INLINE_VISIBILITY3022 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3019 auto operator()(_Args&& ...__args) const&&3023 auto operator()(_Args&& ...__args) const&&
3020 noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))3024 noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))
3021 -> decltype( !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))3025 -> decltype( !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
...@@ -3024,17 +3028,17 @@ public:...@@ -3024,17 +3028,17 @@ public:
3024private:3028private:
3025 template <class _RawFunc,3029 template <class _RawFunc,
3026 class = enable_if_t<!is_same<decay_t<_RawFunc>, __not_fn_imp>::value>>3030 class = enable_if_t<!is_same<decay_t<_RawFunc>, __not_fn_imp>::value>>
3027 _LIBCPP_INLINE_VISIBILITY3031 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3028 explicit __not_fn_imp(_RawFunc&& __rf)3032 explicit __not_fn_imp(_RawFunc&& __rf)
3029 : __fd(_VSTD::forward<_RawFunc>(__rf)) {}3033 : __fd(_VSTD::forward<_RawFunc>(__rf)) {}
30303034
3031 template <class _RawFunc>3035 template <class _RawFunc>
3032 friend inline _LIBCPP_INLINE_VISIBILITY3036 friend inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3033 __not_fn_imp<decay_t<_RawFunc>> not_fn(_RawFunc&&);3037 __not_fn_imp<decay_t<_RawFunc>> not_fn(_RawFunc&&);
3034};3038};
30353039
3036template <class _RawFunc>3040template <class _RawFunc>
3037inline _LIBCPP_INLINE_VISIBILITY3041inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3038__not_fn_imp<decay_t<_RawFunc>> not_fn(_RawFunc&& __fn) {3042__not_fn_imp<decay_t<_RawFunc>> not_fn(_RawFunc&& __fn) {
3039 return __not_fn_imp<decay_t<_RawFunc>>(_VSTD::forward<_RawFunc>(__fn));3043 return __not_fn_imp<decay_t<_RawFunc>>(_VSTD::forward<_RawFunc>(__fn));
3040}3044}
...@@ -3131,13 +3135,13 @@ __search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,...@@ -3131,13 +3135,13 @@ __search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
3131template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>3135template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
3132class _LIBCPP_TYPE_VIS default_searcher {3136class _LIBCPP_TYPE_VIS default_searcher {
3133public:3137public:
3134 _LIBCPP_INLINE_VISIBILITY3138 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3135 default_searcher(_ForwardIterator __f, _ForwardIterator __l,3139 default_searcher(_ForwardIterator __f, _ForwardIterator __l,
3136 _BinaryPredicate __p = _BinaryPredicate())3140 _BinaryPredicate __p = _BinaryPredicate())
3137 : __first_(__f), __last_(__l), __pred_(__p) {}3141 : __first_(__f), __last_(__l), __pred_(__p) {}
31383142
3139 template <typename _ForwardIterator2>3143 template <typename _ForwardIterator2>
3140 _LIBCPP_INLINE_VISIBILITY3144 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3141 pair<_ForwardIterator2, _ForwardIterator2>3145 pair<_ForwardIterator2, _ForwardIterator2>
3142 operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const3146 operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const
3143 {3147 {
lib/libcxx/include/future+49-199
...@@ -362,6 +362,7 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;...@@ -362,6 +362,7 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
362*/362*/
363363
364#include <__config>364#include <__config>
365#include <__availability>
365#include <system_error>366#include <system_error>
366#include <memory>367#include <memory>
367#include <chrono>368#include <chrono>
...@@ -624,18 +625,10 @@ protected:...@@ -624,18 +625,10 @@ protected:
624public:625public:
625626
626 template <class _Arg>627 template <class _Arg>
627#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES628 void set_value(_Arg&& __arg);
628 void set_value(_Arg&& __arg);
629#else
630 void set_value(_Arg& __arg);
631#endif
632629
633 template <class _Arg>630 template <class _Arg>
634#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES631 void set_value_at_thread_exit(_Arg&& __arg);
635 void set_value_at_thread_exit(_Arg&& __arg);
636#else
637 void set_value_at_thread_exit(_Arg& __arg);
638#endif
639632
640 _Rp move();633 _Rp move();
641 typename add_lvalue_reference<_Rp>::type copy();634 typename add_lvalue_reference<_Rp>::type copy();
...@@ -654,16 +647,12 @@ template <class _Rp>...@@ -654,16 +647,12 @@ template <class _Rp>
654template <class _Arg>647template <class _Arg>
655_LIBCPP_AVAILABILITY_FUTURE648_LIBCPP_AVAILABILITY_FUTURE
656void649void
657#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
658__assoc_state<_Rp>::set_value(_Arg&& __arg)650__assoc_state<_Rp>::set_value(_Arg&& __arg)
659#else
660__assoc_state<_Rp>::set_value(_Arg& __arg)
661#endif
662{651{
663 unique_lock<mutex> __lk(this->__mut_);652 unique_lock<mutex> __lk(this->__mut_);
664 if (this->__has_value())653 if (this->__has_value())
665 __throw_future_error(future_errc::promise_already_satisfied);654 __throw_future_error(future_errc::promise_already_satisfied);
666 ::new(&__value_) _Rp(_VSTD::forward<_Arg>(__arg));655 ::new ((void*)&__value_) _Rp(_VSTD::forward<_Arg>(__arg));
667 this->__state_ |= base::__constructed | base::ready;656 this->__state_ |= base::__constructed | base::ready;
668 __cv_.notify_all();657 __cv_.notify_all();
669}658}
...@@ -671,16 +660,12 @@ __assoc_state<_Rp>::set_value(_Arg& __arg)...@@ -671,16 +660,12 @@ __assoc_state<_Rp>::set_value(_Arg& __arg)
671template <class _Rp>660template <class _Rp>
672template <class _Arg>661template <class _Arg>
673void662void
674#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
675__assoc_state<_Rp>::set_value_at_thread_exit(_Arg&& __arg)663__assoc_state<_Rp>::set_value_at_thread_exit(_Arg&& __arg)
676#else
677__assoc_state<_Rp>::set_value_at_thread_exit(_Arg& __arg)
678#endif
679{664{
680 unique_lock<mutex> __lk(this->__mut_);665 unique_lock<mutex> __lk(this->__mut_);
681 if (this->__has_value())666 if (this->__has_value())
682 __throw_future_error(future_errc::promise_already_satisfied);667 __throw_future_error(future_errc::promise_already_satisfied);
683 ::new(&__value_) _Rp(_VSTD::forward<_Arg>(__arg));668 ::new ((void*)&__value_) _Rp(_VSTD::forward<_Arg>(__arg));
684 this->__state_ |= base::__constructed;669 this->__state_ |= base::__constructed;
685 __thread_local_data()->__make_ready_at_thread_exit(this);670 __thread_local_data()->__make_ready_at_thread_exit(this);
686}671}
...@@ -856,16 +841,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state...@@ -856,16 +841,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state
856 _Fp __func_;841 _Fp __func_;
857842
858public:843public:
859#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
860 _LIBCPP_INLINE_VISIBILITY844 _LIBCPP_INLINE_VISIBILITY
861 explicit __deferred_assoc_state(_Fp&& __f);845 explicit __deferred_assoc_state(_Fp&& __f);
862#endif
863846
864 virtual void __execute();847 virtual void __execute();
865};848};
866849
867#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
868
869template <class _Rp, class _Fp>850template <class _Rp, class _Fp>
870inline851inline
871__deferred_assoc_state<_Rp, _Fp>::__deferred_assoc_state(_Fp&& __f)852__deferred_assoc_state<_Rp, _Fp>::__deferred_assoc_state(_Fp&& __f)
...@@ -874,8 +855,6 @@ __deferred_assoc_state<_Rp, _Fp>::__deferred_assoc_state(_Fp&& __f)...@@ -874,8 +855,6 @@ __deferred_assoc_state<_Rp, _Fp>::__deferred_assoc_state(_Fp&& __f)
874 this->__set_deferred();855 this->__set_deferred();
875}856}
876857
877#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
878
879template <class _Rp, class _Fp>858template <class _Rp, class _Fp>
880void859void
881__deferred_assoc_state<_Rp, _Fp>::__execute()860__deferred_assoc_state<_Rp, _Fp>::__execute()
...@@ -903,16 +882,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state<void, _Fp>...@@ -903,16 +882,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state<void, _Fp>
903 _Fp __func_;882 _Fp __func_;
904883
905public:884public:
906#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
907 _LIBCPP_INLINE_VISIBILITY885 _LIBCPP_INLINE_VISIBILITY
908 explicit __deferred_assoc_state(_Fp&& __f);886 explicit __deferred_assoc_state(_Fp&& __f);
909#endif
910887
911 virtual void __execute();888 virtual void __execute();
912};889};
913890
914#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
915
916template <class _Fp>891template <class _Fp>
917inline892inline
918__deferred_assoc_state<void, _Fp>::__deferred_assoc_state(_Fp&& __f)893__deferred_assoc_state<void, _Fp>::__deferred_assoc_state(_Fp&& __f)
...@@ -921,8 +896,6 @@ __deferred_assoc_state<void, _Fp>::__deferred_assoc_state(_Fp&& __f)...@@ -921,8 +896,6 @@ __deferred_assoc_state<void, _Fp>::__deferred_assoc_state(_Fp&& __f)
921 this->__set_deferred();896 this->__set_deferred();
922}897}
923898
924#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
925
926template <class _Fp>899template <class _Fp>
927void900void
928__deferred_assoc_state<void, _Fp>::__execute()901__deferred_assoc_state<void, _Fp>::__execute()
...@@ -952,16 +925,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state...@@ -952,16 +925,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state
952925
953 virtual void __on_zero_shared() _NOEXCEPT;926 virtual void __on_zero_shared() _NOEXCEPT;
954public:927public:
955#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
956 _LIBCPP_INLINE_VISIBILITY928 _LIBCPP_INLINE_VISIBILITY
957 explicit __async_assoc_state(_Fp&& __f);929 explicit __async_assoc_state(_Fp&& __f);
958#endif
959930
960 virtual void __execute();931 virtual void __execute();
961};932};
962933
963#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
964
965template <class _Rp, class _Fp>934template <class _Rp, class _Fp>
966inline935inline
967__async_assoc_state<_Rp, _Fp>::__async_assoc_state(_Fp&& __f)936__async_assoc_state<_Rp, _Fp>::__async_assoc_state(_Fp&& __f)
...@@ -969,8 +938,6 @@ __async_assoc_state<_Rp, _Fp>::__async_assoc_state(_Fp&& __f)...@@ -969,8 +938,6 @@ __async_assoc_state<_Rp, _Fp>::__async_assoc_state(_Fp&& __f)
969{938{
970}939}
971940
972#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
973
974template <class _Rp, class _Fp>941template <class _Rp, class _Fp>
975void942void
976__async_assoc_state<_Rp, _Fp>::__execute()943__async_assoc_state<_Rp, _Fp>::__execute()
...@@ -1007,16 +974,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state<void, _Fp>...@@ -1007,16 +974,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state<void, _Fp>
1007974
1008 virtual void __on_zero_shared() _NOEXCEPT;975 virtual void __on_zero_shared() _NOEXCEPT;
1009public:976public:
1010#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1011 _LIBCPP_INLINE_VISIBILITY977 _LIBCPP_INLINE_VISIBILITY
1012 explicit __async_assoc_state(_Fp&& __f);978 explicit __async_assoc_state(_Fp&& __f);
1013#endif
1014979
1015 virtual void __execute();980 virtual void __execute();
1016};981};
1017982
1018#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1019
1020template <class _Fp>983template <class _Fp>
1021inline984inline
1022__async_assoc_state<void, _Fp>::__async_assoc_state(_Fp&& __f)985__async_assoc_state<void, _Fp>::__async_assoc_state(_Fp&& __f)
...@@ -1024,8 +987,6 @@ __async_assoc_state<void, _Fp>::__async_assoc_state(_Fp&& __f)...@@ -1024,8 +987,6 @@ __async_assoc_state<void, _Fp>::__async_assoc_state(_Fp&& __f)
1024{987{
1025}988}
1026989
1027#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1028
1029template <class _Fp>990template <class _Fp>
1030void991void
1031__async_assoc_state<void, _Fp>::__execute()992__async_assoc_state<void, _Fp>::__execute()
...@@ -1062,19 +1023,11 @@ template <class _Rp> class _LIBCPP_TEMPLATE_VIS future;...@@ -1062,19 +1023,11 @@ template <class _Rp> class _LIBCPP_TEMPLATE_VIS future;
10621023
1063template <class _Rp, class _Fp>1024template <class _Rp, class _Fp>
1064_LIBCPP_INLINE_VISIBILITY future<_Rp>1025_LIBCPP_INLINE_VISIBILITY future<_Rp>
1065#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1066__make_deferred_assoc_state(_Fp&& __f);1026__make_deferred_assoc_state(_Fp&& __f);
1067#else
1068__make_deferred_assoc_state(_Fp __f);
1069#endif
10701027
1071template <class _Rp, class _Fp>1028template <class _Rp, class _Fp>
1072_LIBCPP_INLINE_VISIBILITY future<_Rp>1029_LIBCPP_INLINE_VISIBILITY future<_Rp>
1073#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1074__make_async_assoc_state(_Fp&& __f);1030__make_async_assoc_state(_Fp&& __f);
1075#else
1076__make_async_assoc_state(_Fp __f);
1077#endif
10781031
1079template <class _Rp>1032template <class _Rp>
1080class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future1033class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future
...@@ -1086,22 +1039,14 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future...@@ -1086,22 +1039,14 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future
1086 template <class> friend class promise;1039 template <class> friend class promise;
1087 template <class> friend class shared_future;1040 template <class> friend class shared_future;
10881041
1089#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1090 template <class _R1, class _Fp>1042 template <class _R1, class _Fp>
1091 friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);1043 friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);
1092 template <class _R1, class _Fp>1044 template <class _R1, class _Fp>
1093 friend future<_R1> __make_async_assoc_state(_Fp&& __f);1045 friend future<_R1> __make_async_assoc_state(_Fp&& __f);
1094#else
1095 template <class _R1, class _Fp>
1096 friend future<_R1> __make_deferred_assoc_state(_Fp __f);
1097 template <class _R1, class _Fp>
1098 friend future<_R1> __make_async_assoc_state(_Fp __f);
1099#endif
11001046
1101public:1047public:
1102 _LIBCPP_INLINE_VISIBILITY1048 _LIBCPP_INLINE_VISIBILITY
1103 future() _NOEXCEPT : __state_(nullptr) {}1049 future() _NOEXCEPT : __state_(nullptr) {}
1104#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1105 _LIBCPP_INLINE_VISIBILITY1050 _LIBCPP_INLINE_VISIBILITY
1106 future(future&& __rhs) _NOEXCEPT1051 future(future&& __rhs) _NOEXCEPT
1107 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}1052 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
...@@ -1110,15 +1055,10 @@ public:...@@ -1110,15 +1055,10 @@ public:
1110 _LIBCPP_INLINE_VISIBILITY1055 _LIBCPP_INLINE_VISIBILITY
1111 future& operator=(future&& __rhs) _NOEXCEPT1056 future& operator=(future&& __rhs) _NOEXCEPT
1112 {1057 {
1113 future(std::move(__rhs)).swap(*this);1058 future(_VSTD::move(__rhs)).swap(*this);
1114 return *this;1059 return *this;
1115 }1060 }
1116#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES1061
1117private:
1118 future(const future&);
1119 future& operator=(const future&);
1120public:
1121#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1122 ~future();1062 ~future();
1123 _LIBCPP_INLINE_VISIBILITY1063 _LIBCPP_INLINE_VISIBILITY
1124 shared_future<_Rp> share() _NOEXCEPT;1064 shared_future<_Rp> share() _NOEXCEPT;
...@@ -1186,22 +1126,14 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future<_Rp&>...@@ -1186,22 +1126,14 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future<_Rp&>
1186 template <class> friend class promise;1126 template <class> friend class promise;
1187 template <class> friend class shared_future;1127 template <class> friend class shared_future;
11881128
1189#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1190 template <class _R1, class _Fp>1129 template <class _R1, class _Fp>
1191 friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);1130 friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);
1192 template <class _R1, class _Fp>1131 template <class _R1, class _Fp>
1193 friend future<_R1> __make_async_assoc_state(_Fp&& __f);1132 friend future<_R1> __make_async_assoc_state(_Fp&& __f);
1194#else
1195 template <class _R1, class _Fp>
1196 friend future<_R1> __make_deferred_assoc_state(_Fp __f);
1197 template <class _R1, class _Fp>
1198 friend future<_R1> __make_async_assoc_state(_Fp __f);
1199#endif
12001133
1201public:1134public:
1202 _LIBCPP_INLINE_VISIBILITY1135 _LIBCPP_INLINE_VISIBILITY
1203 future() _NOEXCEPT : __state_(nullptr) {}1136 future() _NOEXCEPT : __state_(nullptr) {}
1204#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1205 _LIBCPP_INLINE_VISIBILITY1137 _LIBCPP_INLINE_VISIBILITY
1206 future(future&& __rhs) _NOEXCEPT1138 future(future&& __rhs) _NOEXCEPT
1207 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}1139 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
...@@ -1210,15 +1142,10 @@ public:...@@ -1210,15 +1142,10 @@ public:
1210 _LIBCPP_INLINE_VISIBILITY1142 _LIBCPP_INLINE_VISIBILITY
1211 future& operator=(future&& __rhs) _NOEXCEPT1143 future& operator=(future&& __rhs) _NOEXCEPT
1212 {1144 {
1213 future(std::move(__rhs)).swap(*this);1145 future(_VSTD::move(__rhs)).swap(*this);
1214 return *this;1146 return *this;
1215 }1147 }
1216#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES1148
1217private:
1218 future(const future&);
1219 future& operator=(const future&);
1220public:
1221#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1222 ~future();1149 ~future();
1223 _LIBCPP_INLINE_VISIBILITY1150 _LIBCPP_INLINE_VISIBILITY
1224 shared_future<_Rp&> share() _NOEXCEPT;1151 shared_future<_Rp&> share() _NOEXCEPT;
...@@ -1281,22 +1208,14 @@ class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE future<void>...@@ -1281,22 +1208,14 @@ class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE future<void>
1281 template <class> friend class promise;1208 template <class> friend class promise;
1282 template <class> friend class shared_future;1209 template <class> friend class shared_future;
12831210
1284#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1285 template <class _R1, class _Fp>1211 template <class _R1, class _Fp>
1286 friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);1212 friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);
1287 template <class _R1, class _Fp>1213 template <class _R1, class _Fp>
1288 friend future<_R1> __make_async_assoc_state(_Fp&& __f);1214 friend future<_R1> __make_async_assoc_state(_Fp&& __f);
1289#else
1290 template <class _R1, class _Fp>
1291 friend future<_R1> __make_deferred_assoc_state(_Fp __f);
1292 template <class _R1, class _Fp>
1293 friend future<_R1> __make_async_assoc_state(_Fp __f);
1294#endif
12951215
1296public:1216public:
1297 _LIBCPP_INLINE_VISIBILITY1217 _LIBCPP_INLINE_VISIBILITY
1298 future() _NOEXCEPT : __state_(nullptr) {}1218 future() _NOEXCEPT : __state_(nullptr) {}
1299#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1300 _LIBCPP_INLINE_VISIBILITY1219 _LIBCPP_INLINE_VISIBILITY
1301 future(future&& __rhs) _NOEXCEPT1220 future(future&& __rhs) _NOEXCEPT
1302 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}1221 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
...@@ -1305,15 +1224,10 @@ public:...@@ -1305,15 +1224,10 @@ public:
1305 _LIBCPP_INLINE_VISIBILITY1224 _LIBCPP_INLINE_VISIBILITY
1306 future& operator=(future&& __rhs) _NOEXCEPT1225 future& operator=(future&& __rhs) _NOEXCEPT
1307 {1226 {
1308 future(std::move(__rhs)).swap(*this);1227 future(_VSTD::move(__rhs)).swap(*this);
1309 return *this;1228 return *this;
1310 }1229 }
1311#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES1230
1312private:
1313 future(const future&);
1314 future& operator=(const future&);
1315public:
1316#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1317 ~future();1231 ~future();
1318 _LIBCPP_INLINE_VISIBILITY1232 _LIBCPP_INLINE_VISIBILITY
1319 shared_future<void> share() _NOEXCEPT;1233 shared_future<void> share() _NOEXCEPT;
...@@ -1367,32 +1281,21 @@ public:...@@ -1367,32 +1281,21 @@ public:
1367 promise();1281 promise();
1368 template <class _Alloc>1282 template <class _Alloc>
1369 promise(allocator_arg_t, const _Alloc& __a);1283 promise(allocator_arg_t, const _Alloc& __a);
1370#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1371 _LIBCPP_INLINE_VISIBILITY1284 _LIBCPP_INLINE_VISIBILITY
1372 promise(promise&& __rhs) _NOEXCEPT1285 promise(promise&& __rhs) _NOEXCEPT
1373 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}1286 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
1374 promise(const promise& __rhs) = delete;1287 promise(const promise& __rhs) = delete;
1375#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1376private:
1377 promise(const promise& __rhs);
1378public:
1379#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1380 ~promise();1288 ~promise();
13811289
1382 // assignment1290 // assignment
1383#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1384 _LIBCPP_INLINE_VISIBILITY1291 _LIBCPP_INLINE_VISIBILITY
1385 promise& operator=(promise&& __rhs) _NOEXCEPT1292 promise& operator=(promise&& __rhs) _NOEXCEPT
1386 {1293 {
1387 promise(std::move(__rhs)).swap(*this);1294 promise(_VSTD::move(__rhs)).swap(*this);
1388 return *this;1295 return *this;
1389 }1296 }
1390 promise& operator=(const promise& __rhs) = delete;1297 promise& operator=(const promise& __rhs) = delete;
1391#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES1298
1392private:
1393 promise& operator=(const promise& __rhs);
1394public:
1395#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1396 _LIBCPP_INLINE_VISIBILITY1299 _LIBCPP_INLINE_VISIBILITY
1397 void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}1300 void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
13981301
...@@ -1401,16 +1304,12 @@ public:...@@ -1401,16 +1304,12 @@ public:
14011304
1402 // setting the result1305 // setting the result
1403 void set_value(const _Rp& __r);1306 void set_value(const _Rp& __r);
1404#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1405 void set_value(_Rp&& __r);1307 void set_value(_Rp&& __r);
1406#endif
1407 void set_exception(exception_ptr __p);1308 void set_exception(exception_ptr __p);
14081309
1409 // setting the result with deferred notification1310 // setting the result with deferred notification
1410 void set_value_at_thread_exit(const _Rp& __r);1311 void set_value_at_thread_exit(const _Rp& __r);
1411#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1412 void set_value_at_thread_exit(_Rp&& __r);1312 void set_value_at_thread_exit(_Rp&& __r);
1413#endif
1414 void set_exception_at_thread_exit(exception_ptr __p);1313 void set_exception_at_thread_exit(exception_ptr __p);
1415};1314};
14161315
...@@ -1429,7 +1328,7 @@ promise<_Rp>::promise(allocator_arg_t, const _Alloc& __a0)...@@ -1429,7 +1328,7 @@ promise<_Rp>::promise(allocator_arg_t, const _Alloc& __a0)
1429 typedef __allocator_destructor<_A2> _D2;1328 typedef __allocator_destructor<_A2> _D2;
1430 _A2 __a(__a0);1329 _A2 __a(__a0);
1431 unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));1330 unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));
1432 ::new(static_cast<void*>(_VSTD::addressof(*__hold.get()))) _State(__a0);1331 ::new ((void*)_VSTD::addressof(*__hold.get())) _State(__a0);
1433 __state_ = _VSTD::addressof(*__hold.release());1332 __state_ = _VSTD::addressof(*__hold.release());
1434}1333}
14351334
...@@ -1464,8 +1363,6 @@ promise<_Rp>::set_value(const _Rp& __r)...@@ -1464,8 +1363,6 @@ promise<_Rp>::set_value(const _Rp& __r)
1464 __state_->set_value(__r);1363 __state_->set_value(__r);
1465}1364}
14661365
1467#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1468
1469template <class _Rp>1366template <class _Rp>
1470void1367void
1471promise<_Rp>::set_value(_Rp&& __r)1368promise<_Rp>::set_value(_Rp&& __r)
...@@ -1475,8 +1372,6 @@ promise<_Rp>::set_value(_Rp&& __r)...@@ -1475,8 +1372,6 @@ promise<_Rp>::set_value(_Rp&& __r)
1475 __state_->set_value(_VSTD::move(__r));1372 __state_->set_value(_VSTD::move(__r));
1476}1373}
14771374
1478#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1479
1480template <class _Rp>1375template <class _Rp>
1481void1376void
1482promise<_Rp>::set_exception(exception_ptr __p)1377promise<_Rp>::set_exception(exception_ptr __p)
...@@ -1496,8 +1391,6 @@ promise<_Rp>::set_value_at_thread_exit(const _Rp& __r)...@@ -1496,8 +1391,6 @@ promise<_Rp>::set_value_at_thread_exit(const _Rp& __r)
1496 __state_->set_value_at_thread_exit(__r);1391 __state_->set_value_at_thread_exit(__r);
1497}1392}
14981393
1499#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1500
1501template <class _Rp>1394template <class _Rp>
1502void1395void
1503promise<_Rp>::set_value_at_thread_exit(_Rp&& __r)1396promise<_Rp>::set_value_at_thread_exit(_Rp&& __r)
...@@ -1507,8 +1400,6 @@ promise<_Rp>::set_value_at_thread_exit(_Rp&& __r)...@@ -1507,8 +1400,6 @@ promise<_Rp>::set_value_at_thread_exit(_Rp&& __r)
1507 __state_->set_value_at_thread_exit(_VSTD::move(__r));1400 __state_->set_value_at_thread_exit(_VSTD::move(__r));
1508}1401}
15091402
1510#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1511
1512template <class _Rp>1403template <class _Rp>
1513void1404void
1514promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)1405promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)
...@@ -1535,32 +1426,21 @@ public:...@@ -1535,32 +1426,21 @@ public:
1535 promise();1426 promise();
1536 template <class _Allocator>1427 template <class _Allocator>
1537 promise(allocator_arg_t, const _Allocator& __a);1428 promise(allocator_arg_t, const _Allocator& __a);
1538#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1539 _LIBCPP_INLINE_VISIBILITY1429 _LIBCPP_INLINE_VISIBILITY
1540 promise(promise&& __rhs) _NOEXCEPT1430 promise(promise&& __rhs) _NOEXCEPT
1541 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}1431 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
1542 promise(const promise& __rhs) = delete;1432 promise(const promise& __rhs) = delete;
1543#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1544private:
1545 promise(const promise& __rhs);
1546public:
1547#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1548 ~promise();1433 ~promise();
15491434
1550 // assignment1435 // assignment
1551#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1552 _LIBCPP_INLINE_VISIBILITY1436 _LIBCPP_INLINE_VISIBILITY
1553 promise& operator=(promise&& __rhs) _NOEXCEPT1437 promise& operator=(promise&& __rhs) _NOEXCEPT
1554 {1438 {
1555 promise(std::move(__rhs)).swap(*this);1439 promise(_VSTD::move(__rhs)).swap(*this);
1556 return *this;1440 return *this;
1557 }1441 }
1558 promise& operator=(const promise& __rhs) = delete;1442 promise& operator=(const promise& __rhs) = delete;
1559#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES1443
1560private:
1561 promise& operator=(const promise& __rhs);
1562public:
1563#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1564 _LIBCPP_INLINE_VISIBILITY1444 _LIBCPP_INLINE_VISIBILITY
1565 void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}1445 void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
15661446
...@@ -1591,7 +1471,7 @@ promise<_Rp&>::promise(allocator_arg_t, const _Alloc& __a0)...@@ -1591,7 +1471,7 @@ promise<_Rp&>::promise(allocator_arg_t, const _Alloc& __a0)
1591 typedef __allocator_destructor<_A2> _D2;1471 typedef __allocator_destructor<_A2> _D2;
1592 _A2 __a(__a0);1472 _A2 __a(__a0);
1593 unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));1473 unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));
1594 ::new(static_cast<void*>(_VSTD::addressof(*__hold.get()))) _State(__a0);1474 ::new ((void*)_VSTD::addressof(*__hold.get())) _State(__a0);
1595 __state_ = _VSTD::addressof(*__hold.release());1475 __state_ = _VSTD::addressof(*__hold.release());
1596}1476}
15971477
...@@ -1672,32 +1552,21 @@ public:...@@ -1672,32 +1552,21 @@ public:
1672 template <class _Allocator>1552 template <class _Allocator>
1673 _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS1553 _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
1674 promise(allocator_arg_t, const _Allocator& __a);1554 promise(allocator_arg_t, const _Allocator& __a);
1675#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1676 _LIBCPP_INLINE_VISIBILITY1555 _LIBCPP_INLINE_VISIBILITY
1677 promise(promise&& __rhs) _NOEXCEPT1556 promise(promise&& __rhs) _NOEXCEPT
1678 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}1557 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
1679 promise(const promise& __rhs) = delete;1558 promise(const promise& __rhs) = delete;
1680#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1681private:
1682 promise(const promise& __rhs);
1683public:
1684#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1685 ~promise();1559 ~promise();
16861560
1687 // assignment1561 // assignment
1688#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1689 _LIBCPP_INLINE_VISIBILITY1562 _LIBCPP_INLINE_VISIBILITY
1690 promise& operator=(promise&& __rhs) _NOEXCEPT1563 promise& operator=(promise&& __rhs) _NOEXCEPT
1691 {1564 {
1692 promise(std::move(__rhs)).swap(*this);1565 promise(_VSTD::move(__rhs)).swap(*this);
1693 return *this;1566 return *this;
1694 }1567 }
1695 promise& operator=(const promise& __rhs) = delete;1568 promise& operator=(const promise& __rhs) = delete;
1696#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES1569
1697private:
1698 promise& operator=(const promise& __rhs);
1699public:
1700#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1701 _LIBCPP_INLINE_VISIBILITY1570 _LIBCPP_INLINE_VISIBILITY
1702 void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}1571 void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
17031572
...@@ -1721,7 +1590,7 @@ promise<void>::promise(allocator_arg_t, const _Alloc& __a0)...@@ -1721,7 +1590,7 @@ promise<void>::promise(allocator_arg_t, const _Alloc& __a0)
1721 typedef __allocator_destructor<_A2> _D2;1590 typedef __allocator_destructor<_A2> _D2;
1722 _A2 __a(__a0);1591 _A2 __a(__a0);
1723 unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));1592 unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));
1724 ::new(static_cast<void*>(_VSTD::addressof(*__hold.get()))) _State(__a0);1593 ::new ((void*)_VSTD::addressof(*__hold.get())) _State(__a0);
1725 __state_ = _VSTD::addressof(*__hold.release());1594 __state_ = _VSTD::addressof(*__hold.release());
1726}1595}
17271596
...@@ -1737,8 +1606,6 @@ template <class _Rp, class _Alloc>...@@ -1737,8 +1606,6 @@ template <class _Rp, class _Alloc>
1737 struct _LIBCPP_TEMPLATE_VIS uses_allocator<promise<_Rp>, _Alloc>1606 struct _LIBCPP_TEMPLATE_VIS uses_allocator<promise<_Rp>, _Alloc>
1738 : public true_type {};1607 : public true_type {};
17391608
1740#ifndef _LIBCPP_HAS_NO_VARIADICS
1741
1742// packaged_task1609// packaged_task
17431610
1744template<class _Fp> class __packaged_task_base;1611template<class _Fp> class __packaged_task_base;
...@@ -1788,7 +1655,7 @@ void...@@ -1788,7 +1655,7 @@ void
1788__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__move_to(1655__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__move_to(
1789 __packaged_task_base<_Rp(_ArgTypes...)>* __p) _NOEXCEPT1656 __packaged_task_base<_Rp(_ArgTypes...)>* __p) _NOEXCEPT
1790{1657{
1791 ::new (__p) __packaged_task_func(_VSTD::move(__f_.first()), _VSTD::move(__f_.second()));1658 ::new ((void*)__p) __packaged_task_func(_VSTD::move(__f_.first()), _VSTD::move(__f_.second()));
1792}1659}
17931660
1794template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>1661template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
...@@ -1814,7 +1681,7 @@ template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>...@@ -1814,7 +1681,7 @@ template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
1814_Rp1681_Rp
1815__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)1682__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
1816{1683{
1817 return __invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...);1684 return _VSTD::__invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...);
1818}1685}
18191686
1820template <class _Callable> class __packaged_task_function;1687template <class _Callable> class __packaged_task_function;
...@@ -1823,6 +1690,10 @@ template<class _Rp, class ..._ArgTypes>...@@ -1823,6 +1690,10 @@ template<class _Rp, class ..._ArgTypes>
1823class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_function<_Rp(_ArgTypes...)>1690class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_function<_Rp(_ArgTypes...)>
1824{1691{
1825 typedef __packaged_task_base<_Rp(_ArgTypes...)> __base;1692 typedef __packaged_task_base<_Rp(_ArgTypes...)> __base;
1693
1694 _LIBCPP_INLINE_VISIBILITY _LIBCPP_NO_CFI
1695 __base* __get_buf() { return (__base*)&__buf_; }
1696
1826 typename aligned_storage<3*sizeof(void*)>::type __buf_;1697 typename aligned_storage<3*sizeof(void*)>::type __buf_;
1827 __base* __f_;1698 __base* __f_;
18281699
...@@ -1856,10 +1727,10 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(__packaged...@@ -1856,10 +1727,10 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(__packaged
1856{1727{
1857 if (__f.__f_ == nullptr)1728 if (__f.__f_ == nullptr)
1858 __f_ = nullptr;1729 __f_ = nullptr;
1859 else if (__f.__f_ == (__base*)&__f.__buf_)1730 else if (__f.__f_ == __f.__get_buf())
1860 {1731 {
1732 __f.__f_->__move_to(__get_buf());
1861 __f_ = (__base*)&__buf_;1733 __f_ = (__base*)&__buf_;
1862 __f.__f_->__move_to(__f_);
1863 }1734 }
1864 else1735 else
1865 {1736 {
...@@ -1877,8 +1748,8 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(_Fp&& __f)...@@ -1877,8 +1748,8 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(_Fp&& __f)
1877 typedef __packaged_task_func<_FR, allocator<_FR>, _Rp(_ArgTypes...)> _FF;1748 typedef __packaged_task_func<_FR, allocator<_FR>, _Rp(_ArgTypes...)> _FF;
1878 if (sizeof(_FF) <= sizeof(__buf_))1749 if (sizeof(_FF) <= sizeof(__buf_))
1879 {1750 {
1751 ::new ((void*)&__buf_) _FF(_VSTD::forward<_Fp>(__f));
1880 __f_ = (__base*)&__buf_;1752 __f_ = (__base*)&__buf_;
1881 ::new (__f_) _FF(_VSTD::forward<_Fp>(__f));
1882 }1753 }
1883 else1754 else
1884 {1755 {
...@@ -1886,7 +1757,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(_Fp&& __f)...@@ -1886,7 +1757,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(_Fp&& __f)
1886 _Ap __a;1757 _Ap __a;
1887 typedef __allocator_destructor<_Ap> _Dp;1758 typedef __allocator_destructor<_Ap> _Dp;
1888 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));1759 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
1889 ::new (__hold.get()) _FF(_VSTD::forward<_Fp>(__f), allocator<_FR>(__a));1760 ::new ((void*)__hold.get()) _FF(_VSTD::forward<_Fp>(__f), allocator<_FR>(__a));
1890 __f_ = __hold.release();1761 __f_ = __hold.release();
1891 }1762 }
1892}1763}
...@@ -1902,7 +1773,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(...@@ -1902,7 +1773,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(
1902 if (sizeof(_FF) <= sizeof(__buf_))1773 if (sizeof(_FF) <= sizeof(__buf_))
1903 {1774 {
1904 __f_ = (__base*)&__buf_;1775 __f_ = (__base*)&__buf_;
1905 ::new (__f_) _FF(_VSTD::forward<_Fp>(__f));1776 ::new ((void*)__f_) _FF(_VSTD::forward<_Fp>(__f));
1906 }1777 }
1907 else1778 else
1908 {1779 {
...@@ -1910,7 +1781,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(...@@ -1910,7 +1781,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(
1910 _Ap __a(__a0);1781 _Ap __a(__a0);
1911 typedef __allocator_destructor<_Ap> _Dp;1782 typedef __allocator_destructor<_Ap> _Dp;
1912 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));1783 unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
1913 ::new (static_cast<void*>(_VSTD::addressof(*__hold.get())))1784 ::new ((void*)_VSTD::addressof(*__hold.get()))
1914 _FF(_VSTD::forward<_Fp>(__f), _Alloc(__a));1785 _FF(_VSTD::forward<_Fp>(__f), _Alloc(__a));
1915 __f_ = _VSTD::addressof(*__hold.release());1786 __f_ = _VSTD::addressof(*__hold.release());
1916 }1787 }
...@@ -1920,17 +1791,17 @@ template<class _Rp, class ..._ArgTypes>...@@ -1920,17 +1791,17 @@ template<class _Rp, class ..._ArgTypes>
1920__packaged_task_function<_Rp(_ArgTypes...)>&1791__packaged_task_function<_Rp(_ArgTypes...)>&
1921__packaged_task_function<_Rp(_ArgTypes...)>::operator=(__packaged_task_function&& __f) _NOEXCEPT1792__packaged_task_function<_Rp(_ArgTypes...)>::operator=(__packaged_task_function&& __f) _NOEXCEPT
1922{1793{
1923 if (__f_ == (__base*)&__buf_)1794 if (__f_ == __get_buf())
1924 __f_->destroy();1795 __f_->destroy();
1925 else if (__f_)1796 else if (__f_)
1926 __f_->destroy_deallocate();1797 __f_->destroy_deallocate();
1927 __f_ = nullptr;1798 __f_ = nullptr;
1928 if (__f.__f_ == nullptr)1799 if (__f.__f_ == nullptr)
1929 __f_ = nullptr;1800 __f_ = nullptr;
1930 else if (__f.__f_ == (__base*)&__f.__buf_)1801 else if (__f.__f_ == __f.__get_buf())
1931 {1802 {
1932 __f_ = (__base*)&__buf_;1803 __f.__f_->__move_to(__get_buf());
1933 __f.__f_->__move_to(__f_);1804 __f_ = __get_buf();
1934 }1805 }
1935 else1806 else
1936 {1807 {
...@@ -1943,13 +1814,14 @@ __packaged_task_function<_Rp(_ArgTypes...)>::operator=(__packaged_task_function&...@@ -1943,13 +1814,14 @@ __packaged_task_function<_Rp(_ArgTypes...)>::operator=(__packaged_task_function&
1943template<class _Rp, class ..._ArgTypes>1814template<class _Rp, class ..._ArgTypes>
1944__packaged_task_function<_Rp(_ArgTypes...)>::~__packaged_task_function()1815__packaged_task_function<_Rp(_ArgTypes...)>::~__packaged_task_function()
1945{1816{
1946 if (__f_ == (__base*)&__buf_)1817 if (__f_ == __get_buf())
1947 __f_->destroy();1818 __f_->destroy();
1948 else if (__f_)1819 else if (__f_)
1949 __f_->destroy_deallocate();1820 __f_->destroy_deallocate();
1950}1821}
19511822
1952template<class _Rp, class ..._ArgTypes>1823template<class _Rp, class ..._ArgTypes>
1824_LIBCPP_NO_CFI
1953void1825void
1954__packaged_task_function<_Rp(_ArgTypes...)>::swap(__packaged_task_function& __f) _NOEXCEPT1826__packaged_task_function<_Rp(_ArgTypes...)>::swap(__packaged_task_function& __f) _NOEXCEPT
1955{1827{
...@@ -2268,11 +2140,7 @@ struct _LIBCPP_TEMPLATE_VIS uses_allocator<packaged_task<_Callable>, _Alloc>...@@ -2268,11 +2140,7 @@ struct _LIBCPP_TEMPLATE_VIS uses_allocator<packaged_task<_Callable>, _Alloc>
22682140
2269template <class _Rp, class _Fp>2141template <class _Rp, class _Fp>
2270_LIBCPP_INLINE_VISIBILITY future<_Rp>2142_LIBCPP_INLINE_VISIBILITY future<_Rp>
2271#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2272__make_deferred_assoc_state(_Fp&& __f)2143__make_deferred_assoc_state(_Fp&& __f)
2273#else
2274__make_deferred_assoc_state(_Fp __f)
2275#endif
2276{2144{
2277 unique_ptr<__deferred_assoc_state<_Rp, _Fp>, __release_shared_count>2145 unique_ptr<__deferred_assoc_state<_Rp, _Fp>, __release_shared_count>
2278 __h(new __deferred_assoc_state<_Rp, _Fp>(_VSTD::forward<_Fp>(__f)));2146 __h(new __deferred_assoc_state<_Rp, _Fp>(_VSTD::forward<_Fp>(__f)));
...@@ -2281,11 +2149,7 @@ __make_deferred_assoc_state(_Fp __f)...@@ -2281,11 +2149,7 @@ __make_deferred_assoc_state(_Fp __f)
22812149
2282template <class _Rp, class _Fp>2150template <class _Rp, class _Fp>
2283_LIBCPP_INLINE_VISIBILITY future<_Rp>2151_LIBCPP_INLINE_VISIBILITY future<_Rp>
2284#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2285__make_async_assoc_state(_Fp&& __f)2152__make_async_assoc_state(_Fp&& __f)
2286#else
2287__make_async_assoc_state(_Fp __f)
2288#endif
2289{2153{
2290 unique_ptr<__async_assoc_state<_Rp, _Fp>, __release_shared_count>2154 unique_ptr<__async_assoc_state<_Rp, _Fp>, __release_shared_count>
2291 __h(new __async_assoc_state<_Rp, _Fp>(_VSTD::forward<_Fp>(__f)));2155 __h(new __async_assoc_state<_Rp, _Fp>(_VSTD::forward<_Fp>(__f)));
...@@ -2293,6 +2157,8 @@ __make_async_assoc_state(_Fp __f)...@@ -2293,6 +2157,8 @@ __make_async_assoc_state(_Fp __f)
2293 return future<_Rp>(__h.get());2157 return future<_Rp>(__h.get());
2294}2158}
22952159
2160#ifndef _LIBCPP_CXX03_LANG
2161
2296template <class _Fp, class... _Args>2162template <class _Fp, class... _Args>
2297class _LIBCPP_HIDDEN __async_func2163class _LIBCPP_HIDDEN __async_func
2298{2164{
...@@ -2318,7 +2184,7 @@ private:...@@ -2318,7 +2184,7 @@ private:
2318 _Rp2184 _Rp
2319 __execute(__tuple_indices<_Indices...>)2185 __execute(__tuple_indices<_Indices...>)
2320 {2186 {
2321 return __invoke(_VSTD::move(_VSTD::get<0>(__f_)), _VSTD::move(_VSTD::get<_Indices>(__f_))...);2187 return _VSTD::__invoke(_VSTD::move(_VSTD::get<0>(__f_)), _VSTD::move(_VSTD::get<_Indices>(__f_))...);
2322 }2188 }
2323};2189};
23242190
...@@ -2338,16 +2204,16 @@ async(launch __policy, _Fp&& __f, _Args&&... __args)...@@ -2338,16 +2204,16 @@ async(launch __policy, _Fp&& __f, _Args&&... __args)
2338 {2204 {
2339#endif2205#endif
2340 if (__does_policy_contain(__policy, launch::async))2206 if (__does_policy_contain(__policy, launch::async))
2341 return _VSTD::__make_async_assoc_state<_Rp>(_BF(__decay_copy(_VSTD::forward<_Fp>(__f)),2207 return _VSTD::__make_async_assoc_state<_Rp>(_BF(_VSTD::__decay_copy(_VSTD::forward<_Fp>(__f)),
2342 __decay_copy(_VSTD::forward<_Args>(__args))...));2208 _VSTD::__decay_copy(_VSTD::forward<_Args>(__args))...));
2343#ifndef _LIBCPP_NO_EXCEPTIONS2209#ifndef _LIBCPP_NO_EXCEPTIONS
2344 }2210 }
2345 catch ( ... ) { if (__policy == launch::async) throw ; }2211 catch ( ... ) { if (__policy == launch::async) throw ; }
2346#endif2212#endif
23472213
2348 if (__does_policy_contain(__policy, launch::deferred))2214 if (__does_policy_contain(__policy, launch::deferred))
2349 return _VSTD::__make_deferred_assoc_state<_Rp>(_BF(__decay_copy(_VSTD::forward<_Fp>(__f)),2215 return _VSTD::__make_deferred_assoc_state<_Rp>(_BF(_VSTD::__decay_copy(_VSTD::forward<_Fp>(__f)),
2350 __decay_copy(_VSTD::forward<_Args>(__args))...));2216 _VSTD::__decay_copy(_VSTD::forward<_Args>(__args))...));
2351 return future<_Rp>{};2217 return future<_Rp>{};
2352}2218}
23532219
...@@ -2360,7 +2226,7 @@ async(_Fp&& __f, _Args&&... __args)...@@ -2360,7 +2226,7 @@ async(_Fp&& __f, _Args&&... __args)
2360 _VSTD::forward<_Args>(__args)...);2226 _VSTD::forward<_Args>(__args)...);
2361}2227}
23622228
2363#endif // _LIBCPP_HAS_NO_VARIADICS2229#endif // C++03
23642230
2365// shared_future2231// shared_future
23662232
...@@ -2375,24 +2241,20 @@ public:...@@ -2375,24 +2241,20 @@ public:
2375 _LIBCPP_INLINE_VISIBILITY2241 _LIBCPP_INLINE_VISIBILITY
2376 shared_future(const shared_future& __rhs) _NOEXCEPT : __state_(__rhs.__state_)2242 shared_future(const shared_future& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
2377 {if (__state_) __state_->__add_shared();}2243 {if (__state_) __state_->__add_shared();}
2378#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2379 _LIBCPP_INLINE_VISIBILITY2244 _LIBCPP_INLINE_VISIBILITY
2380 shared_future(future<_Rp>&& __f) _NOEXCEPT : __state_(__f.__state_)2245 shared_future(future<_Rp>&& __f) _NOEXCEPT : __state_(__f.__state_)
2381 {__f.__state_ = nullptr;}2246 {__f.__state_ = nullptr;}
2382 _LIBCPP_INLINE_VISIBILITY2247 _LIBCPP_INLINE_VISIBILITY
2383 shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)2248 shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
2384 {__rhs.__state_ = nullptr;}2249 {__rhs.__state_ = nullptr;}
2385#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2386 ~shared_future();2250 ~shared_future();
2387 shared_future& operator=(const shared_future& __rhs) _NOEXCEPT;2251 shared_future& operator=(const shared_future& __rhs) _NOEXCEPT;
2388#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2389 _LIBCPP_INLINE_VISIBILITY2252 _LIBCPP_INLINE_VISIBILITY
2390 shared_future& operator=(shared_future&& __rhs) _NOEXCEPT2253 shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
2391 {2254 {
2392 shared_future(std::move(__rhs)).swap(*this);2255 shared_future(_VSTD::move(__rhs)).swap(*this);
2393 return *this;2256 return *this;
2394 }2257 }
2395#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
23962258
2397 // retrieving the value2259 // retrieving the value
2398 _LIBCPP_INLINE_VISIBILITY2260 _LIBCPP_INLINE_VISIBILITY
...@@ -2449,24 +2311,20 @@ public:...@@ -2449,24 +2311,20 @@ public:
2449 _LIBCPP_INLINE_VISIBILITY2311 _LIBCPP_INLINE_VISIBILITY
2450 shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)2312 shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
2451 {if (__state_) __state_->__add_shared();}2313 {if (__state_) __state_->__add_shared();}
2452#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2453 _LIBCPP_INLINE_VISIBILITY2314 _LIBCPP_INLINE_VISIBILITY
2454 shared_future(future<_Rp&>&& __f) _NOEXCEPT : __state_(__f.__state_)2315 shared_future(future<_Rp&>&& __f) _NOEXCEPT : __state_(__f.__state_)
2455 {__f.__state_ = nullptr;}2316 {__f.__state_ = nullptr;}
2456 _LIBCPP_INLINE_VISIBILITY2317 _LIBCPP_INLINE_VISIBILITY
2457 shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)2318 shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
2458 {__rhs.__state_ = nullptr;}2319 {__rhs.__state_ = nullptr;}
2459#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2460 ~shared_future();2320 ~shared_future();
2461 shared_future& operator=(const shared_future& __rhs);2321 shared_future& operator=(const shared_future& __rhs);
2462#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2463 _LIBCPP_INLINE_VISIBILITY2322 _LIBCPP_INLINE_VISIBILITY
2464 shared_future& operator=(shared_future&& __rhs) _NOEXCEPT2323 shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
2465 {2324 {
2466 shared_future(std::move(__rhs)).swap(*this);2325 shared_future(_VSTD::move(__rhs)).swap(*this);
2467 return *this;2326 return *this;
2468 }2327 }
2469#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
24702328
2471 // retrieving the value2329 // retrieving the value
2472 _LIBCPP_INLINE_VISIBILITY2330 _LIBCPP_INLINE_VISIBILITY
...@@ -2523,24 +2381,20 @@ public:...@@ -2523,24 +2381,20 @@ public:
2523 _LIBCPP_INLINE_VISIBILITY2381 _LIBCPP_INLINE_VISIBILITY
2524 shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)2382 shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
2525 {if (__state_) __state_->__add_shared();}2383 {if (__state_) __state_->__add_shared();}
2526#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2527 _LIBCPP_INLINE_VISIBILITY2384 _LIBCPP_INLINE_VISIBILITY
2528 shared_future(future<void>&& __f) _NOEXCEPT : __state_(__f.__state_)2385 shared_future(future<void>&& __f) _NOEXCEPT : __state_(__f.__state_)
2529 {__f.__state_ = nullptr;}2386 {__f.__state_ = nullptr;}
2530 _LIBCPP_INLINE_VISIBILITY2387 _LIBCPP_INLINE_VISIBILITY
2531 shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)2388 shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
2532 {__rhs.__state_ = nullptr;}2389 {__rhs.__state_ = nullptr;}
2533#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2534 ~shared_future();2390 ~shared_future();
2535 shared_future& operator=(const shared_future& __rhs);2391 shared_future& operator=(const shared_future& __rhs);
2536#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2537 _LIBCPP_INLINE_VISIBILITY2392 _LIBCPP_INLINE_VISIBILITY
2538 shared_future& operator=(shared_future&& __rhs) _NOEXCEPT2393 shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
2539 {2394 {
2540 shared_future(std::move(__rhs)).swap(*this);2395 shared_future(_VSTD::move(__rhs)).swap(*this);
2541 return *this;2396 return *this;
2542 }2397 }
2543#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
25442398
2545 // retrieving the value2399 // retrieving the value
2546 _LIBCPP_INLINE_VISIBILITY2400 _LIBCPP_INLINE_VISIBILITY
...@@ -2591,8 +2445,6 @@ future<_Rp&>::share() _NOEXCEPT...@@ -2591,8 +2445,6 @@ future<_Rp&>::share() _NOEXCEPT
2591 return shared_future<_Rp&>(_VSTD::move(*this));2445 return shared_future<_Rp&>(_VSTD::move(*this));
2592}2446}
25932447
2594#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2595
2596inline2448inline
2597shared_future<void>2449shared_future<void>
2598future<void>::share() _NOEXCEPT2450future<void>::share() _NOEXCEPT
...@@ -2600,8 +2452,6 @@ future<void>::share() _NOEXCEPT...@@ -2600,8 +2452,6 @@ future<void>::share() _NOEXCEPT
2600 return shared_future<void>(_VSTD::move(*this));2452 return shared_future<void>(_VSTD::move(*this));
2601}2453}
26022454
2603#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2604
2605_LIBCPP_END_NAMESPACE_STD2455_LIBCPP_END_NAMESPACE_STD
26062456
2607#endif // !_LIBCPP_HAS_NO_THREADS2457#endif // !_LIBCPP_HAS_NO_THREADS
lib/libcxx/include/iomanip+2-2
...@@ -514,7 +514,7 @@ put_time(const tm* __tm, const _CharT* __fmt)...@@ -514,7 +514,7 @@ put_time(const tm* __tm, const _CharT* __fmt)
514}514}
515515
516template <class _CharT, class _Traits, class _ForwardIterator>516template <class _CharT, class _Traits, class _ForwardIterator>
517std::basic_ostream<_CharT, _Traits> &517basic_ostream<_CharT, _Traits> &
518__quoted_output ( basic_ostream<_CharT, _Traits> &__os,518__quoted_output ( basic_ostream<_CharT, _Traits> &__os,
519 _ForwardIterator __first, _ForwardIterator __last, _CharT __delim, _CharT __escape )519 _ForwardIterator __first, _ForwardIterator __last, _CharT __delim, _CharT __escape )
520{520{
...@@ -527,7 +527,7 @@ __quoted_output ( basic_ostream<_CharT, _Traits> &__os,...@@ -527,7 +527,7 @@ __quoted_output ( basic_ostream<_CharT, _Traits> &__os,
527 __str.push_back(*__first);527 __str.push_back(*__first);
528 }528 }
529 __str.push_back(__delim);529 __str.push_back(__delim);
530 return __put_character_sequence(__os, __str.data(), __str.size());530 return _VSTD::__put_character_sequence(__os, __str.data(), __str.size());
531}531}
532532
533template <class _CharT, class _Traits, class _String>533template <class _CharT, class _Traits, class _String>
lib/libcxx/include/ios+2-29
...@@ -710,7 +710,7 @@ void...@@ -710,7 +710,7 @@ void
710basic_ios<_CharT, _Traits>::init(basic_streambuf<char_type, traits_type>* __sb)710basic_ios<_CharT, _Traits>::init(basic_streambuf<char_type, traits_type>* __sb)
711{711{
712 ios_base::init(__sb);712 ios_base::init(__sb);
713 __tie_ = 0;713 __tie_ = nullptr;
714 __fill_ = traits_type::eof();714 __fill_ = traits_type::eof();
715}715}
716716
...@@ -821,7 +821,7 @@ basic_ios<_CharT, _Traits>::move(basic_ios& __rhs)...@@ -821,7 +821,7 @@ basic_ios<_CharT, _Traits>::move(basic_ios& __rhs)
821{821{
822 ios_base::move(__rhs);822 ios_base::move(__rhs);
823 __tie_ = __rhs.__tie_;823 __tie_ = __rhs.__tie_;
824 __rhs.__tie_ = 0;824 __rhs.__tie_ = nullptr;
825 __fill_ = __rhs.__fill_;825 __fill_ = __rhs.__fill_;
826}826}
827827
...@@ -1035,33 +1035,6 @@ defaultfloat(ios_base& __str)...@@ -1035,33 +1035,6 @@ defaultfloat(ios_base& __str)
1035 return __str;1035 return __str;
1036}1036}
10371037
1038template <class _CharT, class _Traits>
1039class __save_flags
1040{
1041 typedef basic_ios<_CharT, _Traits> __stream_type;
1042 typedef typename __stream_type::fmtflags fmtflags;
1043
1044 __stream_type& __stream_;
1045 fmtflags __fmtflags_;
1046 _CharT __fill_;
1047
1048 __save_flags(const __save_flags&);
1049 __save_flags& operator=(const __save_flags&);
1050public:
1051 _LIBCPP_INLINE_VISIBILITY
1052 explicit __save_flags(__stream_type& __stream)
1053 : __stream_(__stream),
1054 __fmtflags_(__stream.flags()),
1055 __fill_(__stream.fill())
1056 {}
1057 _LIBCPP_INLINE_VISIBILITY
1058 ~__save_flags()
1059 {
1060 __stream_.flags(__fmtflags_);
1061 __stream_.fill(__fill_);
1062 }
1063};
1064
1065_LIBCPP_END_NAMESPACE_STD1038_LIBCPP_END_NAMESPACE_STD
10661039
1067#endif // _LIBCPP_IOS1040#endif // _LIBCPP_IOS
lib/libcxx/include/iosfwd+59
...@@ -185,6 +185,36 @@ typedef basic_ifstream<wchar_t> wifstream;...@@ -185,6 +185,36 @@ typedef basic_ifstream<wchar_t> wifstream;
185typedef basic_ofstream<wchar_t> wofstream;185typedef basic_ofstream<wchar_t> wofstream;
186typedef basic_fstream<wchar_t> wfstream;186typedef basic_fstream<wchar_t> wfstream;
187187
188template <class _CharT, class _Traits>
189 class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_PREFERRED_NAME(wios) basic_ios;
190
191template <class _CharT, class _Traits>
192 class _LIBCPP_PREFERRED_NAME(streambuf) _LIBCPP_PREFERRED_NAME(wstreambuf) basic_streambuf;
193template <class _CharT, class _Traits>
194 class _LIBCPP_PREFERRED_NAME(istream) _LIBCPP_PREFERRED_NAME(wistream) basic_istream;
195template <class _CharT, class _Traits>
196 class _LIBCPP_PREFERRED_NAME(ostream) _LIBCPP_PREFERRED_NAME(wostream) basic_ostream;
197template <class _CharT, class _Traits>
198 class _LIBCPP_PREFERRED_NAME(iostream) _LIBCPP_PREFERRED_NAME(wiostream) basic_iostream;
199
200template <class _CharT, class _Traits, class _Allocator>
201 class _LIBCPP_PREFERRED_NAME(stringbuf) _LIBCPP_PREFERRED_NAME(wstringbuf) basic_stringbuf;
202template <class _CharT, class _Traits, class _Allocator>
203 class _LIBCPP_PREFERRED_NAME(istringstream) _LIBCPP_PREFERRED_NAME(wistringstream) basic_istringstream;
204template <class _CharT, class _Traits, class _Allocator>
205 class _LIBCPP_PREFERRED_NAME(ostringstream) _LIBCPP_PREFERRED_NAME(wostringstream) basic_ostringstream;
206template <class _CharT, class _Traits, class _Allocator>
207 class _LIBCPP_PREFERRED_NAME(stringstream) _LIBCPP_PREFERRED_NAME(wstringstream) basic_stringstream;
208
209template <class _CharT, class _Traits>
210 class _LIBCPP_PREFERRED_NAME(filebuf) _LIBCPP_PREFERRED_NAME(wfilebuf) basic_filebuf;
211template <class _CharT, class _Traits>
212 class _LIBCPP_PREFERRED_NAME(ifstream) _LIBCPP_PREFERRED_NAME(wifstream) basic_ifstream;
213template <class _CharT, class _Traits>
214 class _LIBCPP_PREFERRED_NAME(ofstream) _LIBCPP_PREFERRED_NAME(wofstream) basic_ofstream;
215template <class _CharT, class _Traits>
216 class _LIBCPP_PREFERRED_NAME(fstream) _LIBCPP_PREFERRED_NAME(wfstream) basic_fstream;
217
188template <class _State> class _LIBCPP_TEMPLATE_VIS fpos;218template <class _State> class _LIBCPP_TEMPLATE_VIS fpos;
189typedef fpos<mbstate_t> streampos;219typedef fpos<mbstate_t> streampos;
190typedef fpos<mbstate_t> wstreampos;220typedef fpos<mbstate_t> wstreampos;
...@@ -210,11 +240,40 @@ template <class _CharT, // for <stdexcept>...@@ -210,11 +240,40 @@ template <class _CharT, // for <stdexcept>
210typedef basic_string<char, char_traits<char>, allocator<char> > string;240typedef basic_string<char, char_traits<char>, allocator<char> > string;
211typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;241typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
212242
243template <class _CharT, class _Traits, class _Allocator>
244 class _LIBCPP_PREFERRED_NAME(string) _LIBCPP_PREFERRED_NAME(wstring) basic_string;
213245
214// Include other forward declarations here246// Include other forward declarations here
215template <class _Tp, class _Alloc = allocator<_Tp> >247template <class _Tp, class _Alloc = allocator<_Tp> >
216class _LIBCPP_TEMPLATE_VIS vector;248class _LIBCPP_TEMPLATE_VIS vector;
217249
250template <class _CharT, class _Traits>
251class __save_flags
252{
253 typedef basic_ios<_CharT, _Traits> __stream_type;
254 typedef typename __stream_type::fmtflags fmtflags;
255
256 __stream_type& __stream_;
257 fmtflags __fmtflags_;
258 _CharT __fill_;
259
260 __save_flags(const __save_flags&);
261 __save_flags& operator=(const __save_flags&);
262public:
263 _LIBCPP_INLINE_VISIBILITY
264 explicit __save_flags(__stream_type& __stream)
265 : __stream_(__stream),
266 __fmtflags_(__stream.flags()),
267 __fill_(__stream.fill())
268 {}
269 _LIBCPP_INLINE_VISIBILITY
270 ~__save_flags()
271 {
272 __stream_.flags(__fmtflags_);
273 __stream_.fill(__fill_);
274 }
275};
276
218_LIBCPP_END_NAMESPACE_STD277_LIBCPP_END_NAMESPACE_STD
219278
220#endif // _LIBCPP_IOSFWD279#endif // _LIBCPP_IOSFWD
lib/libcxx/include/istream+21-13
...@@ -150,9 +150,9 @@ template <class charT, class traits>...@@ -150,9 +150,9 @@ template <class charT, class traits>
150 basic_istream<charT,traits>&150 basic_istream<charT,traits>&
151 ws(basic_istream<charT,traits>& is);151 ws(basic_istream<charT,traits>& is);
152152
153template <class charT, class traits, class T>153// rvalue stream extraction
154 basic_istream<charT, traits>&154template <class Stream, class T>
155 operator>>(basic_istream<charT, traits>&& is, T& x);155 Stream&& operator>>(Stream&& is, T&& x);
156156
157} // std157} // std
158158
...@@ -1142,7 +1142,7 @@ basic_istream<_CharT, _Traits>::putback(char_type __c)...@@ -1142,7 +1142,7 @@ basic_istream<_CharT, _Traits>::putback(char_type __c)
1142 try1142 try
1143 {1143 {
1144#endif // _LIBCPP_NO_EXCEPTIONS1144#endif // _LIBCPP_NO_EXCEPTIONS
1145 if (this->rdbuf() == 0 || this->rdbuf()->sputbackc(__c) == traits_type::eof())1145 if (this->rdbuf() == nullptr || this->rdbuf()->sputbackc(__c) == traits_type::eof())
1146 __state |= ios_base::badbit;1146 __state |= ios_base::badbit;
1147#ifndef _LIBCPP_NO_EXCEPTIONS1147#ifndef _LIBCPP_NO_EXCEPTIONS
1148 }1148 }
...@@ -1179,7 +1179,7 @@ basic_istream<_CharT, _Traits>::unget()...@@ -1179,7 +1179,7 @@ basic_istream<_CharT, _Traits>::unget()
1179 try1179 try
1180 {1180 {
1181#endif // _LIBCPP_NO_EXCEPTIONS1181#endif // _LIBCPP_NO_EXCEPTIONS
1182 if (this->rdbuf() == 0 || this->rdbuf()->sungetc() == traits_type::eof())1182 if (this->rdbuf() == nullptr || this->rdbuf()->sungetc() == traits_type::eof())
1183 __state |= ios_base::badbit;1183 __state |= ios_base::badbit;
1184#ifndef _LIBCPP_NO_EXCEPTIONS1184#ifndef _LIBCPP_NO_EXCEPTIONS
1185 }1185 }
...@@ -1215,7 +1215,7 @@ basic_istream<_CharT, _Traits>::sync()...@@ -1215,7 +1215,7 @@ basic_istream<_CharT, _Traits>::sync()
1215 try1215 try
1216 {1216 {
1217#endif // _LIBCPP_NO_EXCEPTIONS1217#endif // _LIBCPP_NO_EXCEPTIONS
1218 if (this->rdbuf() == 0)1218 if (this->rdbuf() == nullptr)
1219 return -1;1219 return -1;
1220 if (this->rdbuf()->pubsync() == -1)1220 if (this->rdbuf()->pubsync() == -1)
1221 {1221 {
...@@ -1378,13 +1378,23 @@ ws(basic_istream<_CharT, _Traits>& __is)...@@ -1378,13 +1378,23 @@ ws(basic_istream<_CharT, _Traits>& __is)
13781378
1379#ifndef _LIBCPP_CXX03_LANG1379#ifndef _LIBCPP_CXX03_LANG
13801380
1381template <class _CharT, class _Traits, class _Tp>1381template <class _Stream, class _Tp, class = void>
1382inline _LIBCPP_INLINE_VISIBILITY1382struct __is_istreamable : false_type { };
1383basic_istream<_CharT, _Traits>&1383
1384operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp&& __x)1384template <class _Stream, class _Tp>
1385struct __is_istreamable<_Stream, _Tp, decltype(
1386 _VSTD::declval<_Stream>() >> _VSTD::declval<_Tp>(), void()
1387)> : true_type { };
1388
1389template <class _Stream, class _Tp, class = typename enable_if<
1390 _And<is_base_of<ios_base, _Stream>,
1391 __is_istreamable<_Stream&, _Tp&&>>::value
1392>::type>
1393_LIBCPP_INLINE_VISIBILITY
1394_Stream&& operator>>(_Stream&& __is, _Tp&& __x)
1385{1395{
1386 __is >> _VSTD::forward<_Tp>(__x);1396 __is >> _VSTD::forward<_Tp>(__x);
1387 return __is;1397 return _VSTD::move(__is);
1388}1398}
13891399
1390#endif // _LIBCPP_CXX03_LANG1400#endif // _LIBCPP_CXX03_LANG
...@@ -1638,11 +1648,9 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)...@@ -1638,11 +1648,9 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
1638 return __is;1648 return __is;
1639}1649}
16401650
1641#ifndef _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
1642_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>)1651_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>)
1643_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>)1652_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>)
1644_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>)1653_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>)
1645#endif
16461654
1647_LIBCPP_END_NAMESPACE_STD1655_LIBCPP_END_NAMESPACE_STD
16481656
lib/libcxx/include/iterator+69-52
...@@ -420,10 +420,8 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;...@@ -420,10 +420,8 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
420#include <type_traits>420#include <type_traits>
421#include <cstddef>421#include <cstddef>
422#include <initializer_list>422#include <initializer_list>
423#include <__memory/base.h>
423#include <version>424#include <version>
424#ifdef __APPLE__
425#include <Availability.h>
426#endif
427425
428#include <__debug>426#include <__debug>
429427
...@@ -498,12 +496,11 @@ struct __has_iterator_typedefs...@@ -498,12 +496,11 @@ struct __has_iterator_typedefs
498private:496private:
499 struct __two {char __lx; char __lxx;};497 struct __two {char __lx; char __lxx;};
500 template <class _Up> static __two __test(...);498 template <class _Up> static __two __test(...);
501 template <class _Up> static char __test(typename std::__void_t<typename _Up::iterator_category>::type* = 0,499 template <class _Up> static char __test(typename __void_t<typename _Up::iterator_category>::type* = 0,
502 typename std::__void_t<typename _Up::difference_type>::type* = 0,500 typename __void_t<typename _Up::difference_type>::type* = 0,
503 typename std::__void_t<typename _Up::value_type>::type* = 0,501 typename __void_t<typename _Up::value_type>::type* = 0,
504 typename std::__void_t<typename _Up::reference>::type* = 0,502 typename __void_t<typename _Up::reference>::type* = 0,
505 typename std::__void_t<typename _Up::pointer>::type* = 0503 typename __void_t<typename _Up::pointer>::type* = 0);
506 );
507public:504public:
508 static const bool value = sizeof(__test<_Tp>(0,0,0,0,0)) == 1;505 static const bool value = sizeof(__test<_Tp>(0,0,0,0,0)) == 1;
509};506};
...@@ -515,9 +512,9 @@ struct __has_iterator_category...@@ -515,9 +512,9 @@ struct __has_iterator_category
515private:512private:
516 struct __two {char __lx; char __lxx;};513 struct __two {char __lx; char __lxx;};
517 template <class _Up> static __two __test(...);514 template <class _Up> static __two __test(...);
518 template <class _Up> static char __test(typename _Up::iterator_category* = 0);515 template <class _Up> static char __test(typename _Up::iterator_category* = nullptr);
519public:516public:
520 static const bool value = sizeof(__test<_Tp>(0)) == 1;517 static const bool value = sizeof(__test<_Tp>(nullptr)) == 1;
521};518};
522519
523template <class _Iter, bool> struct __iterator_traits_impl {};520template <class _Iter, bool> struct __iterator_traits_impl {};
...@@ -667,9 +664,9 @@ void advance(_InputIter& __i, _Distance __orig_n)...@@ -667,9 +664,9 @@ void advance(_InputIter& __i, _Distance __orig_n)
667{664{
668 _LIBCPP_ASSERT(__orig_n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,665 _LIBCPP_ASSERT(__orig_n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
669 "Attempt to advance(it, n) with negative n on a non-bidirectional iterator");666 "Attempt to advance(it, n) with negative n on a non-bidirectional iterator");
670 typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;667 typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
671 _IntegralSize __n = __orig_n;668 _IntegralSize __n = __orig_n;
672 __advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());669 _VSTD::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
673}670}
674671
675template <class _InputIter>672template <class _InputIter>
...@@ -696,7 +693,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14...@@ -696,7 +693,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
696typename iterator_traits<_InputIter>::difference_type693typename iterator_traits<_InputIter>::difference_type
697distance(_InputIter __first, _InputIter __last)694distance(_InputIter __first, _InputIter __last)
698{695{
699 return __distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());696 return _VSTD::__distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());
700}697}
701698
702template <class _InputIter>699template <class _InputIter>
...@@ -998,11 +995,11 @@ private:...@@ -998,11 +995,11 @@ private:
998 istream_type* __in_stream_;995 istream_type* __in_stream_;
999 _Tp __value_;996 _Tp __value_;
1000public:997public:
1001 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(0), __value_() {}998 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(nullptr), __value_() {}
1002 _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(_VSTD::addressof(__s))999 _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(_VSTD::addressof(__s))
1003 {1000 {
1004 if (!(*__in_stream_ >> __value_))1001 if (!(*__in_stream_ >> __value_))
1005 __in_stream_ = 0;1002 __in_stream_ = nullptr;
1006 }1003 }
10071004
1008 _LIBCPP_INLINE_VISIBILITY const _Tp& operator*() const {return __value_;}1005 _LIBCPP_INLINE_VISIBILITY const _Tp& operator*() const {return __value_;}
...@@ -1010,7 +1007,7 @@ public:...@@ -1010,7 +1007,7 @@ public:
1010 _LIBCPP_INLINE_VISIBILITY istream_iterator& operator++()1007 _LIBCPP_INLINE_VISIBILITY istream_iterator& operator++()
1011 {1008 {
1012 if (!(*__in_stream_ >> __value_))1009 if (!(*__in_stream_ >> __value_))
1013 __in_stream_ = 0;1010 __in_stream_ = nullptr;
1014 return *this;1011 return *this;
1015 }1012 }
1016 _LIBCPP_INLINE_VISIBILITY istream_iterator operator++(int)1013 _LIBCPP_INLINE_VISIBILITY istream_iterator operator++(int)
...@@ -1052,15 +1049,25 @@ class _LIBCPP_TEMPLATE_VIS ostream_iterator...@@ -1052,15 +1049,25 @@ class _LIBCPP_TEMPLATE_VIS ostream_iterator
1052 : public iterator<output_iterator_tag, void, void, void, void>1049 : public iterator<output_iterator_tag, void, void, void, void>
1053{1050{
1054public:1051public:
1055 typedef _CharT char_type;1052 typedef output_iterator_tag iterator_category;
1056 typedef _Traits traits_type;1053 typedef void value_type;
1057 typedef basic_ostream<_CharT,_Traits> ostream_type;1054#if _LIBCPP_STD_VER > 17
1055 typedef std::ptrdiff_t difference_type;
1056#else
1057 typedef void difference_type;
1058#endif
1059 typedef void pointer;
1060 typedef void reference;
1061 typedef _CharT char_type;
1062 typedef _Traits traits_type;
1063 typedef basic_ostream<_CharT, _Traits> ostream_type;
1064
1058private:1065private:
1059 ostream_type* __out_stream_;1066 ostream_type* __out_stream_;
1060 const char_type* __delim_;1067 const char_type* __delim_;
1061public:1068public:
1062 _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s) _NOEXCEPT1069 _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s) _NOEXCEPT
1063 : __out_stream_(_VSTD::addressof(__s)), __delim_(0) {}1070 : __out_stream_(_VSTD::addressof(__s)), __delim_(nullptr) {}
1064 _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter) _NOEXCEPT1071 _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter) _NOEXCEPT
1065 : __out_stream_(_VSTD::addressof(__s)), __delim_(__delimiter) {}1072 : __out_stream_(_VSTD::addressof(__s)), __delim_(__delimiter) {}
1066 _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator=(const _Tp& __value_)1073 _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator=(const _Tp& __value_)
...@@ -1106,11 +1113,11 @@ private:...@@ -1106,11 +1113,11 @@ private:
1106 bool __test_for_eof() const1113 bool __test_for_eof() const
1107 {1114 {
1108 if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof()))1115 if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof()))
1109 __sbuf_ = 0;1116 __sbuf_ = nullptr;
1110 return __sbuf_ == 0;1117 return __sbuf_ == nullptr;
1111 }1118 }
1112public:1119public:
1113 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {}1120 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(nullptr) {}
1114 _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT1121 _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT
1115 : __sbuf_(__s.rdbuf()) {}1122 : __sbuf_(__s.rdbuf()) {}
1116 _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT1123 _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT
...@@ -1151,10 +1158,20 @@ class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator...@@ -1151,10 +1158,20 @@ class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator
1151 : public iterator<output_iterator_tag, void, void, void, void>1158 : public iterator<output_iterator_tag, void, void, void, void>
1152{1159{
1153public:1160public:
1154 typedef _CharT char_type;1161 typedef output_iterator_tag iterator_category;
1155 typedef _Traits traits_type;1162 typedef void value_type;
1156 typedef basic_streambuf<_CharT,_Traits> streambuf_type;1163#if _LIBCPP_STD_VER > 17
1157 typedef basic_ostream<_CharT,_Traits> ostream_type;1164 typedef std::ptrdiff_t difference_type;
1165#else
1166 typedef void difference_type;
1167#endif
1168 typedef void pointer;
1169 typedef void reference;
1170 typedef _CharT char_type;
1171 typedef _Traits traits_type;
1172 typedef basic_streambuf<_CharT, _Traits> streambuf_type;
1173 typedef basic_ostream<_CharT, _Traits> ostream_type;
1174
1158private:1175private:
1159 streambuf_type* __sbuf_;1176 streambuf_type* __sbuf_;
1160public:1177public:
...@@ -1165,13 +1182,13 @@ public:...@@ -1165,13 +1182,13 @@ public:
1165 _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator=(_CharT __c)1182 _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator=(_CharT __c)
1166 {1183 {
1167 if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sputc(__c), traits_type::eof()))1184 if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sputc(__c), traits_type::eof()))
1168 __sbuf_ = 0;1185 __sbuf_ = nullptr;
1169 return *this;1186 return *this;
1170 }1187 }
1171 _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator*() {return *this;}1188 _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator*() {return *this;}
1172 _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++() {return *this;}1189 _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++() {return *this;}
1173 _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;}1190 _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;}
1174 _LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == 0;}1191 _LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == nullptr;}
11751192
1176 template <class _Ch, class _Tr>1193 template <class _Ch, class _Tr>
1177 friend1194 friend
...@@ -1373,13 +1390,13 @@ operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOE...@@ -1373,13 +1390,13 @@ operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOE
13731390
1374template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 copy(_Ip, _Ip, _Op);1391template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 copy(_Ip, _Ip, _Op);
1375template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 copy_backward(_B1, _B1, _B2);1392template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 copy_backward(_B1, _B1, _B2);
1376template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY move(_Ip, _Ip, _Op);1393template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 move(_Ip, _Ip, _Op);
1377template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY move_backward(_B1, _B1, _B2);1394template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 move_backward(_B1, _B1, _B2);
13781395
1379#if _LIBCPP_DEBUG_LEVEL < 21396#if _LIBCPP_DEBUG_LEVEL < 2
13801397
1381template <class _Tp>1398template <class _Tp>
1382_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG1399_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
1383typename enable_if1400typename enable_if
1384<1401<
1385 is_trivially_copy_assignable<_Tp>::value,1402 is_trivially_copy_assignable<_Tp>::value,
...@@ -1390,7 +1407,7 @@ __unwrap_iter(__wrap_iter<_Tp*>);...@@ -1390,7 +1407,7 @@ __unwrap_iter(__wrap_iter<_Tp*>);
1390#else1407#else
13911408
1392template <class _Tp>1409template <class _Tp>
1393inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG1410inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
1394typename enable_if1411typename enable_if
1395<1412<
1396 is_trivially_copy_assignable<_Tp>::value,1413 is_trivially_copy_assignable<_Tp>::value,
...@@ -1418,20 +1435,20 @@ public:...@@ -1418,20 +1435,20 @@ public:
1418 : __i{}1435 : __i{}
1419#endif1436#endif
1420 {1437 {
1421#if _LIBCPP_DEBUG_LEVEL >= 21438#if _LIBCPP_DEBUG_LEVEL == 2
1422 __get_db()->__insert_i(this);1439 __get_db()->__insert_i(this);
1423#endif1440#endif
1424 }1441 }
1425 template <class _Up> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG1442 template <class _Up> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
1426 __wrap_iter(const __wrap_iter<_Up>& __u,1443 __wrap_iter(const __wrap_iter<_Up>& __u,
1427 typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT1444 typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = nullptr) _NOEXCEPT
1428 : __i(__u.base())1445 : __i(__u.base())
1429 {1446 {
1430#if _LIBCPP_DEBUG_LEVEL >= 21447#if _LIBCPP_DEBUG_LEVEL == 2
1431 __get_db()->__iterator_copy(this, &__u);1448 __get_db()->__iterator_copy(this, &__u);
1432#endif1449#endif
1433 }1450 }
1434#if _LIBCPP_DEBUG_LEVEL >= 21451#if _LIBCPP_DEBUG_LEVEL == 2
1435 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG1452 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
1436 __wrap_iter(const __wrap_iter& __x)1453 __wrap_iter(const __wrap_iter& __x)
1437 : __i(__x.base())1454 : __i(__x.base())
...@@ -1456,7 +1473,7 @@ public:...@@ -1456,7 +1473,7 @@ public:
1456#endif1473#endif
1457 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator*() const _NOEXCEPT1474 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator*() const _NOEXCEPT
1458 {1475 {
1459#if _LIBCPP_DEBUG_LEVEL >= 21476#if _LIBCPP_DEBUG_LEVEL == 2
1460 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),1477 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
1461 "Attempted to dereference a non-dereferenceable iterator");1478 "Attempted to dereference a non-dereferenceable iterator");
1462#endif1479#endif
...@@ -1464,7 +1481,7 @@ public:...@@ -1464,7 +1481,7 @@ public:
1464 }1481 }
1465 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG pointer operator->() const _NOEXCEPT1482 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG pointer operator->() const _NOEXCEPT
1466 {1483 {
1467#if _LIBCPP_DEBUG_LEVEL >= 21484#if _LIBCPP_DEBUG_LEVEL == 2
1468 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),1485 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
1469 "Attempted to dereference a non-dereferenceable iterator");1486 "Attempted to dereference a non-dereferenceable iterator");
1470#endif1487#endif
...@@ -1472,7 +1489,7 @@ public:...@@ -1472,7 +1489,7 @@ public:
1472 }1489 }
1473 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator++() _NOEXCEPT1490 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator++() _NOEXCEPT
1474 {1491 {
1475#if _LIBCPP_DEBUG_LEVEL >= 21492#if _LIBCPP_DEBUG_LEVEL == 2
1476 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),1493 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
1477 "Attempted to increment non-incrementable iterator");1494 "Attempted to increment non-incrementable iterator");
1478#endif1495#endif
...@@ -1484,7 +1501,7 @@ public:...@@ -1484,7 +1501,7 @@ public:
14841501
1485 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator--() _NOEXCEPT1502 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator--() _NOEXCEPT
1486 {1503 {
1487#if _LIBCPP_DEBUG_LEVEL >= 21504#if _LIBCPP_DEBUG_LEVEL == 2
1488 _LIBCPP_ASSERT(__get_const_db()->__decrementable(this),1505 _LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
1489 "Attempted to decrement non-decrementable iterator");1506 "Attempted to decrement non-decrementable iterator");
1490#endif1507#endif
...@@ -1497,7 +1514,7 @@ public:...@@ -1497,7 +1514,7 @@ public:
1497 {__wrap_iter __w(*this); __w += __n; return __w;}1514 {__wrap_iter __w(*this); __w += __n; return __w;}
1498 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator+=(difference_type __n) _NOEXCEPT1515 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator+=(difference_type __n) _NOEXCEPT
1499 {1516 {
1500#if _LIBCPP_DEBUG_LEVEL >= 21517#if _LIBCPP_DEBUG_LEVEL == 2
1501 _LIBCPP_ASSERT(__get_const_db()->__addable(this, __n),1518 _LIBCPP_ASSERT(__get_const_db()->__addable(this, __n),
1502 "Attempted to add/subtract iterator outside of valid range");1519 "Attempted to add/subtract iterator outside of valid range");
1503#endif1520#endif
...@@ -1510,7 +1527,7 @@ public:...@@ -1510,7 +1527,7 @@ public:
1510 {*this += -__n; return *this;}1527 {*this += -__n; return *this;}
1511 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator[](difference_type __n) const _NOEXCEPT1528 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator[](difference_type __n) const _NOEXCEPT
1512 {1529 {
1513#if _LIBCPP_DEBUG_LEVEL >= 21530#if _LIBCPP_DEBUG_LEVEL == 2
1514 _LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n),1531 _LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n),
1515 "Attempted to subscript iterator outside of valid range");1532 "Attempted to subscript iterator outside of valid range");
1516#endif1533#endif
...@@ -1520,7 +1537,7 @@ public:...@@ -1520,7 +1537,7 @@ public:
1520 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG iterator_type base() const _NOEXCEPT {return __i;}1537 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG iterator_type base() const _NOEXCEPT {return __i;}
15211538
1522private:1539private:
1523#if _LIBCPP_DEBUG_LEVEL >= 21540#if _LIBCPP_DEBUG_LEVEL == 2
1524 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter(const void* __p, iterator_type __x) : __i(__x)1541 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter(const void* __p, iterator_type __x) : __i(__x)
1525 {1542 {
1526 __get_db()->__insert_ic(this, __p);1543 __get_db()->__insert_ic(this, __p);
...@@ -1584,12 +1601,12 @@ private:...@@ -1584,12 +1601,12 @@ private:
15841601
1585 template <class _Ip, class _Op> friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _Op copy(_Ip, _Ip, _Op);1602 template <class _Ip, class _Op> friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _Op copy(_Ip, _Ip, _Op);
1586 template <class _B1, class _B2> friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _B2 copy_backward(_B1, _B1, _B2);1603 template <class _B1, class _B2> friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _B2 copy_backward(_B1, _B1, _B2);
1587 template <class _Ip, class _Op> friend _Op move(_Ip, _Ip, _Op);1604 template <class _Ip, class _Op> friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _Op move(_Ip, _Ip, _Op);
1588 template <class _B1, class _B2> friend _B2 move_backward(_B1, _B1, _B2);1605 template <class _B1, class _B2> friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _B2 move_backward(_B1, _B1, _B2);
15891606
1590#if _LIBCPP_DEBUG_LEVEL < 21607#if _LIBCPP_DEBUG_LEVEL < 2
1591 template <class _Tp>1608 template <class _Tp>
1592 _LIBCPP_CONSTEXPR_IF_NODEBUG friend1609 _LIBCPP_CONSTEXPR friend
1593 typename enable_if1610 typename enable_if
1594 <1611 <
1595 is_trivially_copy_assignable<_Tp>::value,1612 is_trivially_copy_assignable<_Tp>::value,
...@@ -1598,7 +1615,7 @@ private:...@@ -1598,7 +1615,7 @@ private:
1598 __unwrap_iter(__wrap_iter<_Tp*>);1615 __unwrap_iter(__wrap_iter<_Tp*>);
1599#else1616#else
1600 template <class _Tp>1617 template <class _Tp>
1601 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG1618 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR friend
1602 typename enable_if1619 typename enable_if
1603 <1620 <
1604 is_trivially_copy_assignable<_Tp>::value,1621 is_trivially_copy_assignable<_Tp>::value,
...@@ -1621,7 +1638,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG...@@ -1621,7 +1638,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
1621bool1638bool
1622operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT1639operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
1623{1640{
1624#if _LIBCPP_DEBUG_LEVEL >= 21641#if _LIBCPP_DEBUG_LEVEL == 2
1625 _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),1642 _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
1626 "Attempted to compare incomparable iterators");1643 "Attempted to compare incomparable iterators");
1627#endif1644#endif
...@@ -1699,7 +1716,7 @@ auto...@@ -1699,7 +1716,7 @@ auto
1699operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT1716operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
1700-> decltype(__x.base() - __y.base())1717-> decltype(__x.base() - __y.base())
1701{1718{
1702#if _LIBCPP_DEBUG_LEVEL >= 21719#if _LIBCPP_DEBUG_LEVEL == 2
1703 _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),1720 _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
1704 "Attempted to subtract incompatible iterators");1721 "Attempted to subtract incompatible iterators");
1705#endif1722#endif
...@@ -1711,7 +1728,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG...@@ -1711,7 +1728,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
1711typename __wrap_iter<_Iter1>::difference_type1728typename __wrap_iter<_Iter1>::difference_type
1712operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT1729operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
1713{1730{
1714#if _LIBCPP_DEBUG_LEVEL >= 21731#if _LIBCPP_DEBUG_LEVEL == 2
1715 _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),1732 _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
1716 "Attempted to subtract incompatible iterators");1733 "Attempted to subtract incompatible iterators");
1717#endif1734#endif
lib/libcxx/include/latch+8
...@@ -19,6 +19,8 @@ namespace std...@@ -19,6 +19,8 @@ namespace std
19 class latch19 class latch
20 {20 {
21 public:21 public:
22 static constexpr ptrdiff_t max() noexcept;
23
22 constexpr explicit latch(ptrdiff_t __expected);24 constexpr explicit latch(ptrdiff_t __expected);
23 ~latch();25 ~latch();
2426
...@@ -39,6 +41,7 @@ namespace std...@@ -39,6 +41,7 @@ namespace std
39*/41*/
4042
41#include <__config>43#include <__config>
44#include <__availability>
42#include <atomic>45#include <atomic>
4346
44#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)47#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
...@@ -49,6 +52,9 @@ namespace std...@@ -49,6 +52,9 @@ namespace std
49# error <latch> is not supported on this single threaded system52# error <latch> is not supported on this single threaded system
50#endif53#endif
5154
55_LIBCPP_PUSH_MACROS
56#include <__undef_macros>
57
52#if _LIBCPP_STD_VER >= 1458#if _LIBCPP_STD_VER >= 14
5359
54_LIBCPP_BEGIN_NAMESPACE_STD60_LIBCPP_BEGIN_NAMESPACE_STD
...@@ -101,4 +107,6 @@ _LIBCPP_END_NAMESPACE_STD...@@ -101,4 +107,6 @@ _LIBCPP_END_NAMESPACE_STD
101107
102#endif // _LIBCPP_STD_VER >= 14108#endif // _LIBCPP_STD_VER >= 14
103109
110_LIBCPP_POP_MACROS
111
104#endif //_LIBCPP_LATCH112#endif //_LIBCPP_LATCH
lib/libcxx/include/limits+2-2
...@@ -105,11 +105,11 @@ template<> class numeric_limits<cv long double>;...@@ -105,11 +105,11 @@ template<> class numeric_limits<cv long double>;
105#include <type_traits>105#include <type_traits>
106106
107#if defined(_LIBCPP_COMPILER_MSVC)107#if defined(_LIBCPP_COMPILER_MSVC)
108#include "support/win32/limits_msvc_win32.h"108#include "__support/win32/limits_msvc_win32.h"
109#endif // _LIBCPP_MSVCRT109#endif // _LIBCPP_MSVCRT
110110
111#if defined(__IBMCPP__)111#if defined(__IBMCPP__)
112#include "support/ibm/limits.h"112#include "__support/ibm/limits.h"
113#endif // __IBMCPP__113#endif // __IBMCPP__
114114
115#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)115#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
lib/libcxx/include/list+93-93
...@@ -293,7 +293,7 @@ class _LIBCPP_TEMPLATE_VIS __list_iterator...@@ -293,7 +293,7 @@ class _LIBCPP_TEMPLATE_VIS __list_iterator
293293
294 __link_pointer __ptr_;294 __link_pointer __ptr_;
295295
296#if _LIBCPP_DEBUG_LEVEL >= 2296#if _LIBCPP_DEBUG_LEVEL == 2
297 _LIBCPP_INLINE_VISIBILITY297 _LIBCPP_INLINE_VISIBILITY
298 explicit __list_iterator(__link_pointer __p, const void* __c) _NOEXCEPT298 explicit __list_iterator(__link_pointer __p, const void* __c) _NOEXCEPT
299 : __ptr_(__p)299 : __ptr_(__p)
...@@ -320,12 +320,12 @@ public:...@@ -320,12 +320,12 @@ public:
320 _LIBCPP_INLINE_VISIBILITY320 _LIBCPP_INLINE_VISIBILITY
321 __list_iterator() _NOEXCEPT : __ptr_(nullptr)321 __list_iterator() _NOEXCEPT : __ptr_(nullptr)
322 {322 {
323#if _LIBCPP_DEBUG_LEVEL >= 2323#if _LIBCPP_DEBUG_LEVEL == 2
324 __get_db()->__insert_i(this);324 __get_db()->__insert_i(this);
325#endif325#endif
326 }326 }
327327
328#if _LIBCPP_DEBUG_LEVEL >= 2328#if _LIBCPP_DEBUG_LEVEL == 2
329329
330 _LIBCPP_INLINE_VISIBILITY330 _LIBCPP_INLINE_VISIBILITY
331 __list_iterator(const __list_iterator& __p)331 __list_iterator(const __list_iterator& __p)
...@@ -351,12 +351,12 @@ public:...@@ -351,12 +351,12 @@ public:
351 return *this;351 return *this;
352 }352 }
353353
354#endif // _LIBCPP_DEBUG_LEVEL >= 2354#endif // _LIBCPP_DEBUG_LEVEL == 2
355355
356 _LIBCPP_INLINE_VISIBILITY356 _LIBCPP_INLINE_VISIBILITY
357 reference operator*() const357 reference operator*() const
358 {358 {
359#if _LIBCPP_DEBUG_LEVEL >= 2359#if _LIBCPP_DEBUG_LEVEL == 2
360 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),360 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
361 "Attempted to dereference a non-dereferenceable list::iterator");361 "Attempted to dereference a non-dereferenceable list::iterator");
362#endif362#endif
...@@ -365,7 +365,7 @@ public:...@@ -365,7 +365,7 @@ public:
365 _LIBCPP_INLINE_VISIBILITY365 _LIBCPP_INLINE_VISIBILITY
366 pointer operator->() const366 pointer operator->() const
367 {367 {
368#if _LIBCPP_DEBUG_LEVEL >= 2368#if _LIBCPP_DEBUG_LEVEL == 2
369 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),369 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
370 "Attempted to dereference a non-dereferenceable list::iterator");370 "Attempted to dereference a non-dereferenceable list::iterator");
371#endif371#endif
...@@ -375,7 +375,7 @@ public:...@@ -375,7 +375,7 @@ public:
375 _LIBCPP_INLINE_VISIBILITY375 _LIBCPP_INLINE_VISIBILITY
376 __list_iterator& operator++()376 __list_iterator& operator++()
377 {377 {
378#if _LIBCPP_DEBUG_LEVEL >= 2378#if _LIBCPP_DEBUG_LEVEL == 2
379 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),379 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
380 "Attempted to increment non-incrementable list::iterator");380 "Attempted to increment non-incrementable list::iterator");
381#endif381#endif
...@@ -388,7 +388,7 @@ public:...@@ -388,7 +388,7 @@ public:
388 _LIBCPP_INLINE_VISIBILITY388 _LIBCPP_INLINE_VISIBILITY
389 __list_iterator& operator--()389 __list_iterator& operator--()
390 {390 {
391#if _LIBCPP_DEBUG_LEVEL >= 2391#if _LIBCPP_DEBUG_LEVEL == 2
392 _LIBCPP_ASSERT(__get_const_db()->__decrementable(this),392 _LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
393 "Attempted to decrement non-decrementable list::iterator");393 "Attempted to decrement non-decrementable list::iterator");
394#endif394#endif
...@@ -416,7 +416,7 @@ class _LIBCPP_TEMPLATE_VIS __list_const_iterator...@@ -416,7 +416,7 @@ class _LIBCPP_TEMPLATE_VIS __list_const_iterator
416416
417 __link_pointer __ptr_;417 __link_pointer __ptr_;
418418
419#if _LIBCPP_DEBUG_LEVEL >= 2419#if _LIBCPP_DEBUG_LEVEL == 2
420 _LIBCPP_INLINE_VISIBILITY420 _LIBCPP_INLINE_VISIBILITY
421 explicit __list_const_iterator(__link_pointer __p, const void* __c) _NOEXCEPT421 explicit __list_const_iterator(__link_pointer __p, const void* __c) _NOEXCEPT
422 : __ptr_(__p)422 : __ptr_(__p)
...@@ -440,7 +440,7 @@ public:...@@ -440,7 +440,7 @@ public:
440 _LIBCPP_INLINE_VISIBILITY440 _LIBCPP_INLINE_VISIBILITY
441 __list_const_iterator() _NOEXCEPT : __ptr_(nullptr)441 __list_const_iterator() _NOEXCEPT : __ptr_(nullptr)
442 {442 {
443#if _LIBCPP_DEBUG_LEVEL >= 2443#if _LIBCPP_DEBUG_LEVEL == 2
444 __get_db()->__insert_i(this);444 __get_db()->__insert_i(this);
445#endif445#endif
446 }446 }
...@@ -448,12 +448,12 @@ public:...@@ -448,12 +448,12 @@ public:
448 __list_const_iterator(const __list_iterator<_Tp, _VoidPtr>& __p) _NOEXCEPT448 __list_const_iterator(const __list_iterator<_Tp, _VoidPtr>& __p) _NOEXCEPT
449 : __ptr_(__p.__ptr_)449 : __ptr_(__p.__ptr_)
450 {450 {
451#if _LIBCPP_DEBUG_LEVEL >= 2451#if _LIBCPP_DEBUG_LEVEL == 2
452 __get_db()->__iterator_copy(this, &__p);452 __get_db()->__iterator_copy(this, &__p);
453#endif453#endif
454 }454 }
455455
456#if _LIBCPP_DEBUG_LEVEL >= 2456#if _LIBCPP_DEBUG_LEVEL == 2
457457
458 _LIBCPP_INLINE_VISIBILITY458 _LIBCPP_INLINE_VISIBILITY
459 __list_const_iterator(const __list_const_iterator& __p)459 __list_const_iterator(const __list_const_iterator& __p)
...@@ -479,11 +479,11 @@ public:...@@ -479,11 +479,11 @@ public:
479 return *this;479 return *this;
480 }480 }
481481
482#endif // _LIBCPP_DEBUG_LEVEL >= 2482#endif // _LIBCPP_DEBUG_LEVEL == 2
483 _LIBCPP_INLINE_VISIBILITY483 _LIBCPP_INLINE_VISIBILITY
484 reference operator*() const484 reference operator*() const
485 {485 {
486#if _LIBCPP_DEBUG_LEVEL >= 2486#if _LIBCPP_DEBUG_LEVEL == 2
487 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),487 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
488 "Attempted to dereference a non-dereferenceable list::const_iterator");488 "Attempted to dereference a non-dereferenceable list::const_iterator");
489#endif489#endif
...@@ -492,7 +492,7 @@ public:...@@ -492,7 +492,7 @@ public:
492 _LIBCPP_INLINE_VISIBILITY492 _LIBCPP_INLINE_VISIBILITY
493 pointer operator->() const493 pointer operator->() const
494 {494 {
495#if _LIBCPP_DEBUG_LEVEL >= 2495#if _LIBCPP_DEBUG_LEVEL == 2
496 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),496 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
497 "Attempted to dereference a non-dereferenceable list::const_iterator");497 "Attempted to dereference a non-dereferenceable list::const_iterator");
498#endif498#endif
...@@ -502,7 +502,7 @@ public:...@@ -502,7 +502,7 @@ public:
502 _LIBCPP_INLINE_VISIBILITY502 _LIBCPP_INLINE_VISIBILITY
503 __list_const_iterator& operator++()503 __list_const_iterator& operator++()
504 {504 {
505#if _LIBCPP_DEBUG_LEVEL >= 2505#if _LIBCPP_DEBUG_LEVEL == 2
506 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),506 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
507 "Attempted to increment non-incrementable list::const_iterator");507 "Attempted to increment non-incrementable list::const_iterator");
508#endif508#endif
...@@ -515,7 +515,7 @@ public:...@@ -515,7 +515,7 @@ public:
515 _LIBCPP_INLINE_VISIBILITY515 _LIBCPP_INLINE_VISIBILITY
516 __list_const_iterator& operator--()516 __list_const_iterator& operator--()
517 {517 {
518#if _LIBCPP_DEBUG_LEVEL >= 2518#if _LIBCPP_DEBUG_LEVEL == 2
519 _LIBCPP_ASSERT(__get_const_db()->__decrementable(this),519 _LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
520 "Attempted to decrement non-decrementable list::const_iterator");520 "Attempted to decrement non-decrementable list::const_iterator");
521#endif521#endif
...@@ -614,7 +614,7 @@ protected:...@@ -614,7 +614,7 @@ protected:
614 _LIBCPP_INLINE_VISIBILITY614 _LIBCPP_INLINE_VISIBILITY
615 iterator begin() _NOEXCEPT615 iterator begin() _NOEXCEPT
616 {616 {
617#if _LIBCPP_DEBUG_LEVEL >= 2617#if _LIBCPP_DEBUG_LEVEL == 2
618 return iterator(__end_.__next_, this);618 return iterator(__end_.__next_, this);
619#else619#else
620 return iterator(__end_.__next_);620 return iterator(__end_.__next_);
...@@ -623,7 +623,7 @@ protected:...@@ -623,7 +623,7 @@ protected:
623 _LIBCPP_INLINE_VISIBILITY623 _LIBCPP_INLINE_VISIBILITY
624 const_iterator begin() const _NOEXCEPT624 const_iterator begin() const _NOEXCEPT
625 {625 {
626#if _LIBCPP_DEBUG_LEVEL >= 2626#if _LIBCPP_DEBUG_LEVEL == 2
627 return const_iterator(__end_.__next_, this);627 return const_iterator(__end_.__next_, this);
628#else628#else
629 return const_iterator(__end_.__next_);629 return const_iterator(__end_.__next_);
...@@ -632,7 +632,7 @@ protected:...@@ -632,7 +632,7 @@ protected:
632 _LIBCPP_INLINE_VISIBILITY632 _LIBCPP_INLINE_VISIBILITY
633 iterator end() _NOEXCEPT633 iterator end() _NOEXCEPT
634 {634 {
635#if _LIBCPP_DEBUG_LEVEL >= 2635#if _LIBCPP_DEBUG_LEVEL == 2
636 return iterator(__end_as_link(), this);636 return iterator(__end_as_link(), this);
637#else637#else
638 return iterator(__end_as_link());638 return iterator(__end_as_link());
...@@ -641,7 +641,7 @@ protected:...@@ -641,7 +641,7 @@ protected:
641 _LIBCPP_INLINE_VISIBILITY641 _LIBCPP_INLINE_VISIBILITY
642 const_iterator end() const _NOEXCEPT642 const_iterator end() const _NOEXCEPT
643 {643 {
644#if _LIBCPP_DEBUG_LEVEL >= 2644#if _LIBCPP_DEBUG_LEVEL == 2
645 return const_iterator(__end_as_link(), this);645 return const_iterator(__end_as_link(), this);
646#else646#else
647 return const_iterator(__end_as_link());647 return const_iterator(__end_as_link());
...@@ -696,7 +696,7 @@ private:...@@ -696,7 +696,7 @@ private:
696696
697 _LIBCPP_INLINE_VISIBILITY697 _LIBCPP_INLINE_VISIBILITY
698 void __invalidate_all_iterators() {698 void __invalidate_all_iterators() {
699#if _LIBCPP_DEBUG_LEVEL >= 2699#if _LIBCPP_DEBUG_LEVEL == 2
700 __get_db()->__invalidate_all(this);700 __get_db()->__invalidate_all(this);
701#endif701#endif
702 }702 }
...@@ -735,13 +735,13 @@ inline __list_imp<_Tp, _Alloc>::__list_imp(const __node_allocator& __a)...@@ -735,13 +735,13 @@ inline __list_imp<_Tp, _Alloc>::__list_imp(const __node_allocator& __a)
735#ifndef _LIBCPP_CXX03_LANG735#ifndef _LIBCPP_CXX03_LANG
736template <class _Tp, class _Alloc>736template <class _Tp, class _Alloc>
737inline __list_imp<_Tp, _Alloc>::__list_imp(__node_allocator&& __a) _NOEXCEPT737inline __list_imp<_Tp, _Alloc>::__list_imp(__node_allocator&& __a) _NOEXCEPT
738 : __size_alloc_(0, std::move(__a)) {}738 : __size_alloc_(0, _VSTD::move(__a)) {}
739#endif739#endif
740740
741template <class _Tp, class _Alloc>741template <class _Tp, class _Alloc>
742__list_imp<_Tp, _Alloc>::~__list_imp() {742__list_imp<_Tp, _Alloc>::~__list_imp() {
743 clear();743 clear();
744#if _LIBCPP_DEBUG_LEVEL >= 2744#if _LIBCPP_DEBUG_LEVEL == 2
745 __get_db()->__erase_c(this);745 __get_db()->__erase_c(this);
746#endif746#endif
747}747}
...@@ -783,7 +783,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)...@@ -783,7 +783,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
783 "list::swap: Either propagate_on_container_swap must be true"783 "list::swap: Either propagate_on_container_swap must be true"
784 " or the allocators must compare equal");784 " or the allocators must compare equal");
785 using _VSTD::swap;785 using _VSTD::swap;
786 __swap_allocator(__node_alloc(), __c.__node_alloc());786 _VSTD::__swap_allocator(__node_alloc(), __c.__node_alloc());
787 swap(__sz(), __c.__sz());787 swap(__sz(), __c.__sz());
788 swap(__end_, __c.__end_);788 swap(__end_, __c.__end_);
789 if (__sz() == 0)789 if (__sz() == 0)
...@@ -795,13 +795,13 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)...@@ -795,13 +795,13 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
795 else795 else
796 __c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_ = __c.__end_as_link();796 __c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_ = __c.__end_as_link();
797797
798#if _LIBCPP_DEBUG_LEVEL >= 2798#if _LIBCPP_DEBUG_LEVEL == 2
799 __libcpp_db* __db = __get_db();799 __libcpp_db* __db = __get_db();
800 __c_node* __cn1 = __db->__find_c_and_lock(this);800 __c_node* __cn1 = __db->__find_c_and_lock(this);
801 __c_node* __cn2 = __db->__find_c(&__c);801 __c_node* __cn2 = __db->__find_c(&__c);
802 std::swap(__cn1->beg_, __cn2->beg_);802 _VSTD::swap(__cn1->beg_, __cn2->beg_);
803 std::swap(__cn1->end_, __cn2->end_);803 _VSTD::swap(__cn1->end_, __cn2->end_);
804 std::swap(__cn1->cap_, __cn2->cap_);804 _VSTD::swap(__cn1->cap_, __cn2->cap_);
805 for (__i_node** __p = __cn1->end_; __p != __cn1->beg_;)805 for (__i_node** __p = __cn1->end_; __p != __cn1->beg_;)
806 {806 {
807 --__p;807 --__p;
...@@ -810,7 +810,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)...@@ -810,7 +810,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
810 {810 {
811 __cn2->__add(*__p);811 __cn2->__add(*__p);
812 if (--__cn1->end_ != __p)812 if (--__cn1->end_ != __p)
813 memmove(__p, __p+1, (__cn1->end_ - __p)*sizeof(__i_node*));813 _VSTD::memmove(__p, __p+1, (__cn1->end_ - __p)*sizeof(__i_node*));
814 }814 }
815 else815 else
816 (*__p)->__c_ = __cn1;816 (*__p)->__c_ = __cn1;
...@@ -823,7 +823,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)...@@ -823,7 +823,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
823 {823 {
824 __cn1->__add(*__p);824 __cn1->__add(*__p);
825 if (--__cn2->end_ != __p)825 if (--__cn2->end_ != __p)
826 memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));826 _VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
827 }827 }
828 else828 else
829 (*__p)->__c_ = __cn2;829 (*__p)->__c_ = __cn2;
...@@ -870,14 +870,14 @@ public:...@@ -870,14 +870,14 @@ public:
870 list()870 list()
871 _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)871 _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
872 {872 {
873#if _LIBCPP_DEBUG_LEVEL >= 2873#if _LIBCPP_DEBUG_LEVEL == 2
874 __get_db()->__insert_c(this);874 __get_db()->__insert_c(this);
875#endif875#endif
876 }876 }
877 _LIBCPP_INLINE_VISIBILITY877 _LIBCPP_INLINE_VISIBILITY
878 explicit list(const allocator_type& __a) : base(__a)878 explicit list(const allocator_type& __a) : base(__a)
879 {879 {
880#if _LIBCPP_DEBUG_LEVEL >= 2880#if _LIBCPP_DEBUG_LEVEL == 2
881 __get_db()->__insert_c(this);881 __get_db()->__insert_c(this);
882#endif882#endif
883 }883 }
...@@ -937,7 +937,7 @@ public:...@@ -937,7 +937,7 @@ public:
937 _LIBCPP_INLINE_VISIBILITY937 _LIBCPP_INLINE_VISIBILITY
938 size_type max_size() const _NOEXCEPT938 size_type max_size() const _NOEXCEPT
939 {939 {
940 return std::min<size_type>(940 return _VSTD::min<size_type>(
941 base::__node_alloc_max_size(),941 base::__node_alloc_max_size(),
942 numeric_limits<difference_type >::max());942 numeric_limits<difference_type >::max());
943 }943 }
...@@ -1117,14 +1117,14 @@ public:...@@ -1117,14 +1117,14 @@ public:
1117 return __hold_pointer(__p, __node_destructor(__na, 1));1117 return __hold_pointer(__p, __node_destructor(__na, 1));
1118 }1118 }
11191119
1120#if _LIBCPP_DEBUG_LEVEL >= 21120#if _LIBCPP_DEBUG_LEVEL == 2
11211121
1122 bool __dereferenceable(const const_iterator* __i) const;1122 bool __dereferenceable(const const_iterator* __i) const;
1123 bool __decrementable(const const_iterator* __i) const;1123 bool __decrementable(const const_iterator* __i) const;
1124 bool __addable(const const_iterator* __i, ptrdiff_t __n) const;1124 bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
1125 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;1125 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
11261126
1127#endif // _LIBCPP_DEBUG_LEVEL >= 21127#endif // _LIBCPP_DEBUG_LEVEL == 2
11281128
1129private:1129private:
1130 _LIBCPP_INLINE_VISIBILITY1130 _LIBCPP_INLINE_VISIBILITY
...@@ -1144,7 +1144,7 @@ private:...@@ -1144,7 +1144,7 @@ private:
11441144
1145#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES1145#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
1146template<class _InputIterator,1146template<class _InputIterator,
1147 class _Alloc = typename std::allocator<typename iterator_traits<_InputIterator>::value_type>,1147 class _Alloc = allocator<typename iterator_traits<_InputIterator>::value_type>,
1148 class = typename enable_if<__is_allocator<_Alloc>::value, void>::type1148 class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
1149 >1149 >
1150list(_InputIterator, _InputIterator)1150list(_InputIterator, _InputIterator)
...@@ -1207,7 +1207,7 @@ list<_Tp, _Alloc>::__iterator(size_type __n)...@@ -1207,7 +1207,7 @@ list<_Tp, _Alloc>::__iterator(size_type __n)
1207template <class _Tp, class _Alloc>1207template <class _Tp, class _Alloc>
1208list<_Tp, _Alloc>::list(size_type __n)1208list<_Tp, _Alloc>::list(size_type __n)
1209{1209{
1210#if _LIBCPP_DEBUG_LEVEL >= 21210#if _LIBCPP_DEBUG_LEVEL == 2
1211 __get_db()->__insert_c(this);1211 __get_db()->__insert_c(this);
1212#endif1212#endif
1213 for (; __n > 0; --__n)1213 for (; __n > 0; --__n)
...@@ -1222,7 +1222,7 @@ list<_Tp, _Alloc>::list(size_type __n)...@@ -1222,7 +1222,7 @@ list<_Tp, _Alloc>::list(size_type __n)
1222template <class _Tp, class _Alloc>1222template <class _Tp, class _Alloc>
1223list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)1223list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)
1224{1224{
1225#if _LIBCPP_DEBUG_LEVEL >= 21225#if _LIBCPP_DEBUG_LEVEL == 2
1226 __get_db()->__insert_c(this);1226 __get_db()->__insert_c(this);
1227#endif1227#endif
1228 for (; __n > 0; --__n)1228 for (; __n > 0; --__n)
...@@ -1233,7 +1233,7 @@ list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)...@@ -1233,7 +1233,7 @@ list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)
1233template <class _Tp, class _Alloc>1233template <class _Tp, class _Alloc>
1234list<_Tp, _Alloc>::list(size_type __n, const value_type& __x)1234list<_Tp, _Alloc>::list(size_type __n, const value_type& __x)
1235{1235{
1236#if _LIBCPP_DEBUG_LEVEL >= 21236#if _LIBCPP_DEBUG_LEVEL == 2
1237 __get_db()->__insert_c(this);1237 __get_db()->__insert_c(this);
1238#endif1238#endif
1239 for (; __n > 0; --__n)1239 for (; __n > 0; --__n)
...@@ -1244,7 +1244,7 @@ template <class _Tp, class _Alloc>...@@ -1244,7 +1244,7 @@ template <class _Tp, class _Alloc>
1244list<_Tp, _Alloc>::list(size_type __n, const value_type& __x, const allocator_type& __a)1244list<_Tp, _Alloc>::list(size_type __n, const value_type& __x, const allocator_type& __a)
1245 : base(__a)1245 : base(__a)
1246{1246{
1247#if _LIBCPP_DEBUG_LEVEL >= 21247#if _LIBCPP_DEBUG_LEVEL == 2
1248 __get_db()->__insert_c(this);1248 __get_db()->__insert_c(this);
1249#endif1249#endif
1250 for (; __n > 0; --__n)1250 for (; __n > 0; --__n)
...@@ -1256,7 +1256,7 @@ template <class _InpIter>...@@ -1256,7 +1256,7 @@ template <class _InpIter>
1256list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l,1256list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l,
1257 typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*)1257 typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*)
1258{1258{
1259#if _LIBCPP_DEBUG_LEVEL >= 21259#if _LIBCPP_DEBUG_LEVEL == 2
1260 __get_db()->__insert_c(this);1260 __get_db()->__insert_c(this);
1261#endif1261#endif
1262 for (; __f != __l; ++__f)1262 for (; __f != __l; ++__f)
...@@ -1269,7 +1269,7 @@ list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, const allocator_type& __a,...@@ -1269,7 +1269,7 @@ list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, const allocator_type& __a,
1269 typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*)1269 typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*)
1270 : base(__a)1270 : base(__a)
1271{1271{
1272#if _LIBCPP_DEBUG_LEVEL >= 21272#if _LIBCPP_DEBUG_LEVEL == 2
1273 __get_db()->__insert_c(this);1273 __get_db()->__insert_c(this);
1274#endif1274#endif
1275 for (; __f != __l; ++__f)1275 for (; __f != __l; ++__f)
...@@ -1280,7 +1280,7 @@ template <class _Tp, class _Alloc>...@@ -1280,7 +1280,7 @@ template <class _Tp, class _Alloc>
1280list<_Tp, _Alloc>::list(const list& __c)1280list<_Tp, _Alloc>::list(const list& __c)
1281 : base(__node_alloc_traits::select_on_container_copy_construction(1281 : base(__node_alloc_traits::select_on_container_copy_construction(
1282 __c.__node_alloc())) {1282 __c.__node_alloc())) {
1283#if _LIBCPP_DEBUG_LEVEL >= 21283#if _LIBCPP_DEBUG_LEVEL == 2
1284 __get_db()->__insert_c(this);1284 __get_db()->__insert_c(this);
1285#endif1285#endif
1286 for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i)1286 for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i)
...@@ -1291,7 +1291,7 @@ template <class _Tp, class _Alloc>...@@ -1291,7 +1291,7 @@ template <class _Tp, class _Alloc>
1291list<_Tp, _Alloc>::list(const list& __c, const allocator_type& __a)1291list<_Tp, _Alloc>::list(const list& __c, const allocator_type& __a)
1292 : base(__a)1292 : base(__a)
1293{1293{
1294#if _LIBCPP_DEBUG_LEVEL >= 21294#if _LIBCPP_DEBUG_LEVEL == 2
1295 __get_db()->__insert_c(this);1295 __get_db()->__insert_c(this);
1296#endif1296#endif
1297 for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i)1297 for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i)
...@@ -1304,7 +1304,7 @@ template <class _Tp, class _Alloc>...@@ -1304,7 +1304,7 @@ template <class _Tp, class _Alloc>
1304list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type& __a)1304list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type& __a)
1305 : base(__a)1305 : base(__a)
1306{1306{
1307#if _LIBCPP_DEBUG_LEVEL >= 21307#if _LIBCPP_DEBUG_LEVEL == 2
1308 __get_db()->__insert_c(this);1308 __get_db()->__insert_c(this);
1309#endif1309#endif
1310 for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),1310 for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),
...@@ -1315,7 +1315,7 @@ list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type&...@@ -1315,7 +1315,7 @@ list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type&
1315template <class _Tp, class _Alloc>1315template <class _Tp, class _Alloc>
1316list<_Tp, _Alloc>::list(initializer_list<value_type> __il)1316list<_Tp, _Alloc>::list(initializer_list<value_type> __il)
1317{1317{
1318#if _LIBCPP_DEBUG_LEVEL >= 21318#if _LIBCPP_DEBUG_LEVEL == 2
1319 __get_db()->__insert_c(this);1319 __get_db()->__insert_c(this);
1320#endif1320#endif
1321 for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),1321 for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),
...@@ -1327,7 +1327,7 @@ template <class _Tp, class _Alloc>...@@ -1327,7 +1327,7 @@ template <class _Tp, class _Alloc>
1327inline list<_Tp, _Alloc>::list(list&& __c)1327inline list<_Tp, _Alloc>::list(list&& __c)
1328 _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)1328 _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
1329 : base(_VSTD::move(__c.__node_alloc())) {1329 : base(_VSTD::move(__c.__node_alloc())) {
1330#if _LIBCPP_DEBUG_LEVEL >= 21330#if _LIBCPP_DEBUG_LEVEL == 2
1331 __get_db()->__insert_c(this);1331 __get_db()->__insert_c(this);
1332#endif1332#endif
1333 splice(end(), __c);1333 splice(end(), __c);
...@@ -1338,7 +1338,7 @@ inline...@@ -1338,7 +1338,7 @@ inline
1338list<_Tp, _Alloc>::list(list&& __c, const allocator_type& __a)1338list<_Tp, _Alloc>::list(list&& __c, const allocator_type& __a)
1339 : base(__a)1339 : base(__a)
1340{1340{
1341#if _LIBCPP_DEBUG_LEVEL >= 21341#if _LIBCPP_DEBUG_LEVEL == 2
1342 __get_db()->__insert_c(this);1342 __get_db()->__insert_c(this);
1343#endif1343#endif
1344 if (__a == __c.get_allocator())1344 if (__a == __c.get_allocator())
...@@ -1415,7 +1415,7 @@ list<_Tp, _Alloc>::assign(_InpIter __f, _InpIter __l,...@@ -1415,7 +1415,7 @@ list<_Tp, _Alloc>::assign(_InpIter __f, _InpIter __l,
1415 insert(__e, __f, __l);1415 insert(__e, __f, __l);
1416 else1416 else
1417 erase(__i, __e);1417 erase(__i, __e);
1418#if _LIBCPP_DEBUG_LEVEL >= 21418#if _LIBCPP_DEBUG_LEVEL == 2
1419 __get_db()->__invalidate_all(this);1419 __get_db()->__invalidate_all(this);
1420#endif1420#endif
1421}1421}
...@@ -1432,7 +1432,7 @@ list<_Tp, _Alloc>::assign(size_type __n, const value_type& __x)...@@ -1432,7 +1432,7 @@ list<_Tp, _Alloc>::assign(size_type __n, const value_type& __x)
1432 insert(__e, __n, __x);1432 insert(__e, __n, __x);
1433 else1433 else
1434 erase(__i, __e);1434 erase(__i, __e);
1435#if _LIBCPP_DEBUG_LEVEL >= 21435#if _LIBCPP_DEBUG_LEVEL == 2
1436 __get_db()->__invalidate_all(this);1436 __get_db()->__invalidate_all(this);
1437#endif1437#endif
1438}1438}
...@@ -1449,7 +1449,7 @@ template <class _Tp, class _Alloc>...@@ -1449,7 +1449,7 @@ template <class _Tp, class _Alloc>
1449typename list<_Tp, _Alloc>::iterator1449typename list<_Tp, _Alloc>::iterator
1450list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x)1450list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x)
1451{1451{
1452#if _LIBCPP_DEBUG_LEVEL >= 21452#if _LIBCPP_DEBUG_LEVEL == 2
1453 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,1453 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
1454 "list::insert(iterator, x) called with an iterator not"1454 "list::insert(iterator, x) called with an iterator not"
1455 " referring to this list");1455 " referring to this list");
...@@ -1459,7 +1459,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x)...@@ -1459,7 +1459,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x)
1459 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);1459 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
1460 __link_nodes(__p.__ptr_, __hold->__as_link(), __hold->__as_link());1460 __link_nodes(__p.__ptr_, __hold->__as_link(), __hold->__as_link());
1461 ++base::__sz();1461 ++base::__sz();
1462#if _LIBCPP_DEBUG_LEVEL >= 21462#if _LIBCPP_DEBUG_LEVEL == 2
1463 return iterator(__hold.release()->__as_link(), this);1463 return iterator(__hold.release()->__as_link(), this);
1464#else1464#else
1465 return iterator(__hold.release()->__as_link());1465 return iterator(__hold.release()->__as_link());
...@@ -1470,7 +1470,7 @@ template <class _Tp, class _Alloc>...@@ -1470,7 +1470,7 @@ template <class _Tp, class _Alloc>
1470typename list<_Tp, _Alloc>::iterator1470typename list<_Tp, _Alloc>::iterator
1471list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& __x)1471list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& __x)
1472{1472{
1473#if _LIBCPP_DEBUG_LEVEL >= 21473#if _LIBCPP_DEBUG_LEVEL == 2
1474 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,1474 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
1475 "list::insert(iterator, n, x) called with an iterator not"1475 "list::insert(iterator, n, x) called with an iterator not"
1476 " referring to this list");1476 " referring to this list");
...@@ -1485,7 +1485,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _...@@ -1485,7 +1485,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
1485 __hold_pointer __hold = __allocate_node(__na);1485 __hold_pointer __hold = __allocate_node(__na);
1486 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);1486 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
1487 ++__ds;1487 ++__ds;
1488#if _LIBCPP_DEBUG_LEVEL >= 21488#if _LIBCPP_DEBUG_LEVEL == 2
1489 __r = iterator(__hold->__as_link(), this);1489 __r = iterator(__hold->__as_link(), this);
1490#else1490#else
1491 __r = iterator(__hold->__as_link());1491 __r = iterator(__hold->__as_link());
...@@ -1515,7 +1515,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _...@@ -1515,7 +1515,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
1515 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);1515 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
1516 if (__prev == 0)1516 if (__prev == 0)
1517 break;1517 break;
1518#if _LIBCPP_DEBUG_LEVEL >= 21518#if _LIBCPP_DEBUG_LEVEL == 2
1519 __e = iterator(__prev, this);1519 __e = iterator(__prev, this);
1520#else1520#else
1521 __e = iterator(__prev);1521 __e = iterator(__prev);
...@@ -1536,7 +1536,7 @@ typename list<_Tp, _Alloc>::iterator...@@ -1536,7 +1536,7 @@ typename list<_Tp, _Alloc>::iterator
1536list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,1536list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
1537 typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*)1537 typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*)
1538{1538{
1539#if _LIBCPP_DEBUG_LEVEL >= 21539#if _LIBCPP_DEBUG_LEVEL == 2
1540 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,1540 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
1541 "list::insert(iterator, range) called with an iterator not"1541 "list::insert(iterator, range) called with an iterator not"
1542 " referring to this list");1542 " referring to this list");
...@@ -1551,7 +1551,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,...@@ -1551,7 +1551,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
1551 __hold_pointer __hold = __allocate_node(__na);1551 __hold_pointer __hold = __allocate_node(__na);
1552 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);1552 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);
1553 ++__ds;1553 ++__ds;
1554#if _LIBCPP_DEBUG_LEVEL >= 21554#if _LIBCPP_DEBUG_LEVEL == 2
1555 __r = iterator(__hold.get()->__as_link(), this);1555 __r = iterator(__hold.get()->__as_link(), this);
1556#else1556#else
1557 __r = iterator(__hold.get()->__as_link());1557 __r = iterator(__hold.get()->__as_link());
...@@ -1581,7 +1581,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,...@@ -1581,7 +1581,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
1581 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);1581 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
1582 if (__prev == 0)1582 if (__prev == 0)
1583 break;1583 break;
1584#if _LIBCPP_DEBUG_LEVEL >= 21584#if _LIBCPP_DEBUG_LEVEL == 2
1585 __e = iterator(__prev, this);1585 __e = iterator(__prev, this);
1586#else1586#else
1587 __e = iterator(__prev);1587 __e = iterator(__prev);
...@@ -1695,7 +1695,7 @@ template <class... _Args>...@@ -1695,7 +1695,7 @@ template <class... _Args>
1695typename list<_Tp, _Alloc>::iterator1695typename list<_Tp, _Alloc>::iterator
1696list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)1696list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
1697{1697{
1698#if _LIBCPP_DEBUG_LEVEL >= 21698#if _LIBCPP_DEBUG_LEVEL == 2
1699 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,1699 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
1700 "list::emplace(iterator, args...) called with an iterator not"1700 "list::emplace(iterator, args...) called with an iterator not"
1701 " referring to this list");1701 " referring to this list");
...@@ -1707,7 +1707,7 @@ list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)...@@ -1707,7 +1707,7 @@ list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
1707 __link_nodes(__p.__ptr_, __nl, __nl);1707 __link_nodes(__p.__ptr_, __nl, __nl);
1708 ++base::__sz();1708 ++base::__sz();
1709 __hold.release();1709 __hold.release();
1710#if _LIBCPP_DEBUG_LEVEL >= 21710#if _LIBCPP_DEBUG_LEVEL == 2
1711 return iterator(__nl, this);1711 return iterator(__nl, this);
1712#else1712#else
1713 return iterator(__nl);1713 return iterator(__nl);
...@@ -1718,7 +1718,7 @@ template <class _Tp, class _Alloc>...@@ -1718,7 +1718,7 @@ template <class _Tp, class _Alloc>
1718typename list<_Tp, _Alloc>::iterator1718typename list<_Tp, _Alloc>::iterator
1719list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)1719list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
1720{1720{
1721#if _LIBCPP_DEBUG_LEVEL >= 21721#if _LIBCPP_DEBUG_LEVEL == 2
1722 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,1722 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
1723 "list::insert(iterator, x) called with an iterator not"1723 "list::insert(iterator, x) called with an iterator not"
1724 " referring to this list");1724 " referring to this list");
...@@ -1730,7 +1730,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)...@@ -1730,7 +1730,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
1730 __link_nodes(__p.__ptr_, __nl, __nl);1730 __link_nodes(__p.__ptr_, __nl, __nl);
1731 ++base::__sz();1731 ++base::__sz();
1732 __hold.release();1732 __hold.release();
1733#if _LIBCPP_DEBUG_LEVEL >= 21733#if _LIBCPP_DEBUG_LEVEL == 2
1734 return iterator(__nl, this);1734 return iterator(__nl, this);
1735#else1735#else
1736 return iterator(__nl);1736 return iterator(__nl);
...@@ -1748,7 +1748,7 @@ list<_Tp, _Alloc>::pop_front()...@@ -1748,7 +1748,7 @@ list<_Tp, _Alloc>::pop_front()
1748 __link_pointer __n = base::__end_.__next_;1748 __link_pointer __n = base::__end_.__next_;
1749 base::__unlink_nodes(__n, __n);1749 base::__unlink_nodes(__n, __n);
1750 --base::__sz();1750 --base::__sz();
1751#if _LIBCPP_DEBUG_LEVEL >= 21751#if _LIBCPP_DEBUG_LEVEL == 2
1752 __c_node* __c = __get_db()->__find_c_and_lock(this);1752 __c_node* __c = __get_db()->__find_c_and_lock(this);
1753 for (__i_node** __p = __c->end_; __p != __c->beg_; )1753 for (__i_node** __p = __c->end_; __p != __c->beg_; )
1754 {1754 {
...@@ -1758,7 +1758,7 @@ list<_Tp, _Alloc>::pop_front()...@@ -1758,7 +1758,7 @@ list<_Tp, _Alloc>::pop_front()
1758 {1758 {
1759 (*__p)->__c_ = nullptr;1759 (*__p)->__c_ = nullptr;
1760 if (--__c->end_ != __p)1760 if (--__c->end_ != __p)
1761 memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));1761 _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
1762 }1762 }
1763 }1763 }
1764 __get_db()->unlock();1764 __get_db()->unlock();
...@@ -1777,7 +1777,7 @@ list<_Tp, _Alloc>::pop_back()...@@ -1777,7 +1777,7 @@ list<_Tp, _Alloc>::pop_back()
1777 __link_pointer __n = base::__end_.__prev_;1777 __link_pointer __n = base::__end_.__prev_;
1778 base::__unlink_nodes(__n, __n);1778 base::__unlink_nodes(__n, __n);
1779 --base::__sz();1779 --base::__sz();
1780#if _LIBCPP_DEBUG_LEVEL >= 21780#if _LIBCPP_DEBUG_LEVEL == 2
1781 __c_node* __c = __get_db()->__find_c_and_lock(this);1781 __c_node* __c = __get_db()->__find_c_and_lock(this);
1782 for (__i_node** __p = __c->end_; __p != __c->beg_; )1782 for (__i_node** __p = __c->end_; __p != __c->beg_; )
1783 {1783 {
...@@ -1787,7 +1787,7 @@ list<_Tp, _Alloc>::pop_back()...@@ -1787,7 +1787,7 @@ list<_Tp, _Alloc>::pop_back()
1787 {1787 {
1788 (*__p)->__c_ = nullptr;1788 (*__p)->__c_ = nullptr;
1789 if (--__c->end_ != __p)1789 if (--__c->end_ != __p)
1790 memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));1790 _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
1791 }1791 }
1792 }1792 }
1793 __get_db()->unlock();1793 __get_db()->unlock();
...@@ -1801,7 +1801,7 @@ template <class _Tp, class _Alloc>...@@ -1801,7 +1801,7 @@ template <class _Tp, class _Alloc>
1801typename list<_Tp, _Alloc>::iterator1801typename list<_Tp, _Alloc>::iterator
1802list<_Tp, _Alloc>::erase(const_iterator __p)1802list<_Tp, _Alloc>::erase(const_iterator __p)
1803{1803{
1804#if _LIBCPP_DEBUG_LEVEL >= 21804#if _LIBCPP_DEBUG_LEVEL == 2
1805 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,1805 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
1806 "list::erase(iterator) called with an iterator not"1806 "list::erase(iterator) called with an iterator not"
1807 " referring to this list");1807 " referring to this list");
...@@ -1813,7 +1813,7 @@ list<_Tp, _Alloc>::erase(const_iterator __p)...@@ -1813,7 +1813,7 @@ list<_Tp, _Alloc>::erase(const_iterator __p)
1813 __link_pointer __r = __n->__next_;1813 __link_pointer __r = __n->__next_;
1814 base::__unlink_nodes(__n, __n);1814 base::__unlink_nodes(__n, __n);
1815 --base::__sz();1815 --base::__sz();
1816#if _LIBCPP_DEBUG_LEVEL >= 21816#if _LIBCPP_DEBUG_LEVEL == 2
1817 __c_node* __c = __get_db()->__find_c_and_lock(this);1817 __c_node* __c = __get_db()->__find_c_and_lock(this);
1818 for (__i_node** __ip = __c->end_; __ip != __c->beg_; )1818 for (__i_node** __ip = __c->end_; __ip != __c->beg_; )
1819 {1819 {
...@@ -1823,7 +1823,7 @@ list<_Tp, _Alloc>::erase(const_iterator __p)...@@ -1823,7 +1823,7 @@ list<_Tp, _Alloc>::erase(const_iterator __p)
1823 {1823 {
1824 (*__ip)->__c_ = nullptr;1824 (*__ip)->__c_ = nullptr;
1825 if (--__c->end_ != __ip)1825 if (--__c->end_ != __ip)
1826 memmove(__ip, __ip+1, (__c->end_ - __ip)*sizeof(__i_node*));1826 _VSTD::memmove(__ip, __ip+1, (__c->end_ - __ip)*sizeof(__i_node*));
1827 }1827 }
1828 }1828 }
1829 __get_db()->unlock();1829 __get_db()->unlock();
...@@ -1831,7 +1831,7 @@ list<_Tp, _Alloc>::erase(const_iterator __p)...@@ -1831,7 +1831,7 @@ list<_Tp, _Alloc>::erase(const_iterator __p)
1831 __node_pointer __np = __n->__as_node();1831 __node_pointer __np = __n->__as_node();
1832 __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));1832 __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
1833 __node_alloc_traits::deallocate(__na, __np, 1);1833 __node_alloc_traits::deallocate(__na, __np, 1);
1834#if _LIBCPP_DEBUG_LEVEL >= 21834#if _LIBCPP_DEBUG_LEVEL == 2
1835 return iterator(__r, this);1835 return iterator(__r, this);
1836#else1836#else
1837 return iterator(__r);1837 return iterator(__r);
...@@ -1842,7 +1842,7 @@ template <class _Tp, class _Alloc>...@@ -1842,7 +1842,7 @@ template <class _Tp, class _Alloc>
1842typename list<_Tp, _Alloc>::iterator1842typename list<_Tp, _Alloc>::iterator
1843list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)1843list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
1844{1844{
1845#if _LIBCPP_DEBUG_LEVEL >= 21845#if _LIBCPP_DEBUG_LEVEL == 2
1846 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == this,1846 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == this,
1847 "list::erase(iterator, iterator) called with an iterator not"1847 "list::erase(iterator, iterator) called with an iterator not"
1848 " referring to this list");1848 " referring to this list");
...@@ -1859,7 +1859,7 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)...@@ -1859,7 +1859,7 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
1859 __link_pointer __n = __f.__ptr_;1859 __link_pointer __n = __f.__ptr_;
1860 ++__f;1860 ++__f;
1861 --base::__sz();1861 --base::__sz();
1862#if _LIBCPP_DEBUG_LEVEL >= 21862#if _LIBCPP_DEBUG_LEVEL == 2
1863 __c_node* __c = __get_db()->__find_c_and_lock(this);1863 __c_node* __c = __get_db()->__find_c_and_lock(this);
1864 for (__i_node** __p = __c->end_; __p != __c->beg_; )1864 for (__i_node** __p = __c->end_; __p != __c->beg_; )
1865 {1865 {
...@@ -1869,7 +1869,7 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)...@@ -1869,7 +1869,7 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
1869 {1869 {
1870 (*__p)->__c_ = nullptr;1870 (*__p)->__c_ = nullptr;
1871 if (--__c->end_ != __p)1871 if (--__c->end_ != __p)
1872 memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));1872 _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
1873 }1873 }
1874 }1874 }
1875 __get_db()->unlock();1875 __get_db()->unlock();
...@@ -1879,7 +1879,7 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)...@@ -1879,7 +1879,7 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
1879 __node_alloc_traits::deallocate(__na, __np, 1);1879 __node_alloc_traits::deallocate(__na, __np, 1);
1880 }1880 }
1881 }1881 }
1882#if _LIBCPP_DEBUG_LEVEL >= 21882#if _LIBCPP_DEBUG_LEVEL == 2
1883 return iterator(__l.__ptr_, this);1883 return iterator(__l.__ptr_, this);
1884#else1884#else
1885 return iterator(__l.__ptr_);1885 return iterator(__l.__ptr_);
...@@ -1900,7 +1900,7 @@ list<_Tp, _Alloc>::resize(size_type __n)...@@ -1900,7 +1900,7 @@ list<_Tp, _Alloc>::resize(size_type __n)
1900 __hold_pointer __hold = __allocate_node(__na);1900 __hold_pointer __hold = __allocate_node(__na);
1901 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));1901 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));
1902 ++__ds;1902 ++__ds;
1903#if _LIBCPP_DEBUG_LEVEL >= 21903#if _LIBCPP_DEBUG_LEVEL == 2
1904 iterator __r = iterator(__hold.release()->__as_link(), this);1904 iterator __r = iterator(__hold.release()->__as_link(), this);
1905#else1905#else
1906 iterator __r = iterator(__hold.release()->__as_link());1906 iterator __r = iterator(__hold.release()->__as_link());
...@@ -1929,7 +1929,7 @@ list<_Tp, _Alloc>::resize(size_type __n)...@@ -1929,7 +1929,7 @@ list<_Tp, _Alloc>::resize(size_type __n)
1929 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);1929 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
1930 if (__prev == 0)1930 if (__prev == 0)
1931 break;1931 break;
1932#if _LIBCPP_DEBUG_LEVEL >= 21932#if _LIBCPP_DEBUG_LEVEL == 2
1933 __e = iterator(__prev, this);1933 __e = iterator(__prev, this);
1934#else1934#else
1935 __e = iterator(__prev);1935 __e = iterator(__prev);
...@@ -1958,7 +1958,7 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)...@@ -1958,7 +1958,7 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
1958 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);1958 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
1959 ++__ds;1959 ++__ds;
1960 __link_pointer __nl = __hold.release()->__as_link();1960 __link_pointer __nl = __hold.release()->__as_link();
1961#if _LIBCPP_DEBUG_LEVEL >= 21961#if _LIBCPP_DEBUG_LEVEL == 2
1962 iterator __r = iterator(__nl, this);1962 iterator __r = iterator(__nl, this);
1963#else1963#else
1964 iterator __r = iterator(__nl);1964 iterator __r = iterator(__nl);
...@@ -1987,7 +1987,7 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)...@@ -1987,7 +1987,7 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
1987 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);1987 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
1988 if (__prev == 0)1988 if (__prev == 0)
1989 break;1989 break;
1990#if _LIBCPP_DEBUG_LEVEL >= 21990#if _LIBCPP_DEBUG_LEVEL == 2
1991 __e = iterator(__prev, this);1991 __e = iterator(__prev, this);
1992#else1992#else
1993 __e = iterator(__prev);1993 __e = iterator(__prev);
...@@ -2007,7 +2007,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)...@@ -2007,7 +2007,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
2007{2007{
2008 _LIBCPP_ASSERT(this != &__c,2008 _LIBCPP_ASSERT(this != &__c,
2009 "list::splice(iterator, list) called with this == &list");2009 "list::splice(iterator, list) called with this == &list");
2010#if _LIBCPP_DEBUG_LEVEL >= 22010#if _LIBCPP_DEBUG_LEVEL == 2
2011 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,2011 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
2012 "list::splice(iterator, list) called with an iterator not"2012 "list::splice(iterator, list) called with an iterator not"
2013 " referring to this list");2013 " referring to this list");
...@@ -2020,7 +2020,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)...@@ -2020,7 +2020,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
2020 __link_nodes(__p.__ptr_, __f, __l);2020 __link_nodes(__p.__ptr_, __f, __l);
2021 base::__sz() += __c.__sz();2021 base::__sz() += __c.__sz();
2022 __c.__sz() = 0;2022 __c.__sz() = 0;
2023#if _LIBCPP_DEBUG_LEVEL >= 22023#if _LIBCPP_DEBUG_LEVEL == 2
2024 if (&__c != this) {2024 if (&__c != this) {
2025 __libcpp_db* __db = __get_db();2025 __libcpp_db* __db = __get_db();
2026 __c_node* __cn1 = __db->__find_c_and_lock(this);2026 __c_node* __cn1 = __db->__find_c_and_lock(this);
...@@ -2034,7 +2034,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)...@@ -2034,7 +2034,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
2034 __cn1->__add(*__ip);2034 __cn1->__add(*__ip);
2035 (*__ip)->__c_ = __cn1;2035 (*__ip)->__c_ = __cn1;
2036 if (--__cn2->end_ != __ip)2036 if (--__cn2->end_ != __ip)
2037 memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));2037 _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
2038 }2038 }
2039 }2039 }
2040 __db->unlock();2040 __db->unlock();
...@@ -2047,7 +2047,7 @@ template <class _Tp, class _Alloc>...@@ -2047,7 +2047,7 @@ template <class _Tp, class _Alloc>
2047void2047void
2048list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)2048list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
2049{2049{
2050#if _LIBCPP_DEBUG_LEVEL >= 22050#if _LIBCPP_DEBUG_LEVEL == 2
2051 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,2051 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
2052 "list::splice(iterator, list, iterator) called with first iterator not"2052 "list::splice(iterator, list, iterator) called with first iterator not"
2053 " referring to this list");2053 " referring to this list");
...@@ -2056,7 +2056,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)...@@ -2056,7 +2056,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
2056 " referring to list argument");2056 " referring to list argument");
2057 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(&__i),2057 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(&__i),
2058 "list::splice(iterator, list, iterator) called with second iterator not"2058 "list::splice(iterator, list, iterator) called with second iterator not"
2059 " derefereceable");2059 " dereferenceable");
2060#endif2060#endif
2061 if (__p.__ptr_ != __i.__ptr_ && __p.__ptr_ != __i.__ptr_->__next_)2061 if (__p.__ptr_ != __i.__ptr_ && __p.__ptr_ != __i.__ptr_->__next_)
2062 {2062 {
...@@ -2065,7 +2065,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)...@@ -2065,7 +2065,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
2065 __link_nodes(__p.__ptr_, __f, __f);2065 __link_nodes(__p.__ptr_, __f, __f);
2066 --__c.__sz();2066 --__c.__sz();
2067 ++base::__sz();2067 ++base::__sz();
2068#if _LIBCPP_DEBUG_LEVEL >= 22068#if _LIBCPP_DEBUG_LEVEL == 2
2069 if (&__c != this) {2069 if (&__c != this) {
2070 __libcpp_db* __db = __get_db();2070 __libcpp_db* __db = __get_db();
2071 __c_node* __cn1 = __db->__find_c_and_lock(this);2071 __c_node* __cn1 = __db->__find_c_and_lock(this);
...@@ -2079,7 +2079,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)...@@ -2079,7 +2079,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
2079 __cn1->__add(*__ip);2079 __cn1->__add(*__ip);
2080 (*__ip)->__c_ = __cn1;2080 (*__ip)->__c_ = __cn1;
2081 if (--__cn2->end_ != __ip)2081 if (--__cn2->end_ != __ip)
2082 memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));2082 _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
2083 }2083 }
2084 }2084 }
2085 __db->unlock();2085 __db->unlock();
...@@ -2092,7 +2092,7 @@ template <class _Tp, class _Alloc>...@@ -2092,7 +2092,7 @@ template <class _Tp, class _Alloc>
2092void2092void
2093list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l)2093list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l)
2094{2094{
2095#if _LIBCPP_DEBUG_LEVEL >= 22095#if _LIBCPP_DEBUG_LEVEL == 2
2096 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,2096 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
2097 "list::splice(iterator, list, iterator, iterator) called with first iterator not"2097 "list::splice(iterator, list, iterator, iterator) called with first iterator not"
2098 " referring to this list");2098 " referring to this list");
...@@ -2121,7 +2121,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, con...@@ -2121,7 +2121,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, con
2121 }2121 }
2122 base::__unlink_nodes(__first, __last);2122 base::__unlink_nodes(__first, __last);
2123 __link_nodes(__p.__ptr_, __first, __last);2123 __link_nodes(__p.__ptr_, __first, __last);
2124#if _LIBCPP_DEBUG_LEVEL >= 22124#if _LIBCPP_DEBUG_LEVEL == 2
2125 if (&__c != this) {2125 if (&__c != this) {
2126 __libcpp_db* __db = __get_db();2126 __libcpp_db* __db = __get_db();
2127 __c_node* __cn1 = __db->__find_c_and_lock(this);2127 __c_node* __cn1 = __db->__find_c_and_lock(this);
...@@ -2138,7 +2138,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, con...@@ -2138,7 +2138,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, con
2138 __cn1->__add(*__ip);2138 __cn1->__add(*__ip);
2139 (*__ip)->__c_ = __cn1;2139 (*__ip)->__c_ = __cn1;
2140 if (--__cn2->end_ != __ip)2140 if (--__cn2->end_ != __ip)
2141 memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));2141 _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
2142 }2142 }
2143 }2143 }
2144 }2144 }
...@@ -2258,7 +2258,7 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)...@@ -2258,7 +2258,7 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
2258 ++__f1;2258 ++__f1;
2259 }2259 }
2260 splice(__e1, __c);2260 splice(__e1, __c);
2261#if _LIBCPP_DEBUG_LEVEL >= 22261#if _LIBCPP_DEBUG_LEVEL == 2
2262 __libcpp_db* __db = __get_db();2262 __libcpp_db* __db = __get_db();
2263 __c_node* __cn1 = __db->__find_c_and_lock(this);2263 __c_node* __cn1 = __db->__find_c_and_lock(this);
2264 __c_node* __cn2 = __db->__find_c(&__c);2264 __c_node* __cn2 = __db->__find_c(&__c);
...@@ -2271,7 +2271,7 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)...@@ -2271,7 +2271,7 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
2271 __cn1->__add(*__p);2271 __cn1->__add(*__p);
2272 (*__p)->__c_ = __cn1;2272 (*__p)->__c_ = __cn1;
2273 if (--__cn2->end_ != __p)2273 if (--__cn2->end_ != __p)
2274 memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));2274 _VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
2275 }2275 }
2276 }2276 }
2277 __db->unlock();2277 __db->unlock();
...@@ -2382,7 +2382,7 @@ list<_Tp, _Alloc>::__invariants() const...@@ -2382,7 +2382,7 @@ list<_Tp, _Alloc>::__invariants() const
2382 return size() == _VSTD::distance(begin(), end());2382 return size() == _VSTD::distance(begin(), end());
2383}2383}
23842384
2385#if _LIBCPP_DEBUG_LEVEL >= 22385#if _LIBCPP_DEBUG_LEVEL == 2
23862386
2387template <class _Tp, class _Alloc>2387template <class _Tp, class _Alloc>
2388bool2388bool
...@@ -2412,7 +2412,7 @@ list<_Tp, _Alloc>::__subscriptable(const const_iterator*, ptrdiff_t) const...@@ -2412,7 +2412,7 @@ list<_Tp, _Alloc>::__subscriptable(const const_iterator*, ptrdiff_t) const
2412 return false;2412 return false;
2413}2413}
24142414
2415#endif // _LIBCPP_DEBUG_LEVEL >= 22415#endif // _LIBCPP_DEBUG_LEVEL == 2
24162416
2417template <class _Tp, class _Alloc>2417template <class _Tp, class _Alloc>
2418inline _LIBCPP_INLINE_VISIBILITY2418inline _LIBCPP_INLINE_VISIBILITY
lib/libcxx/include/locale+105-79
...@@ -92,7 +92,11 @@ public:...@@ -92,7 +92,11 @@ public:
92 typedef typename Codecvt::state_type state_type;92 typedef typename Codecvt::state_type state_type;
93 typedef typename wide_string::traits_type::int_type int_type;93 typedef typename wide_string::traits_type::int_type int_type;
9494
95 explicit wstring_convert(Codecvt* pcvt = new Codecvt); // explicit in C++1495 wstring_convert(Codecvt* pcvt = new Codecvt); // before C++14
96 explicit wstring_convert(Codecvt* pcvt = new Codecvt); // before C++20
97 wstring_convert() : wstring_convert(new Codecvt) {} // C++20
98 explicit wstring_convert(Codecvt* pcvt); // C++20
99
96 wstring_convert(Codecvt* pcvt, state_type state);100 wstring_convert(Codecvt* pcvt, state_type state);
97 explicit wstring_convert(const byte_string& byte_err, // explicit in C++14101 explicit wstring_convert(const byte_string& byte_err, // explicit in C++14
98 const wide_string& wide_err = wide_string());102 const wide_string& wide_err = wide_string());
...@@ -121,8 +125,14 @@ class wbuffer_convert...@@ -121,8 +125,14 @@ class wbuffer_convert
121public:125public:
122 typedef typename Tr::state_type state_type;126 typedef typename Tr::state_type state_type;
123127
124 explicit wbuffer_convert(streambuf* bytebuf = 0, Codecvt* pcvt = new Codecvt,128 wbuffer_convert(streambuf* bytebuf = 0, Codecvt* pcvt = new Codecvt,
125 state_type state = state_type()); // explicit in C++14129 state_type state = state_type()); // before C++14
130 explicit wbuffer_convert(streambuf* bytebuf = nullptr, Codecvt* pcvt = new Codecvt,
131 state_type state = state_type()); // before C++20
132 wbuffer_convert() : wbuffer_convert(nullptr) {} // C++20
133 explicit wbuffer_convert(streambuf* bytebuf, Codecvt* pcvt = new Codecvt,
134 state_type state = state_type()); // C++20
135
126 wbuffer_convert(const wbuffer_convert&) = delete; // C++14136 wbuffer_convert(const wbuffer_convert&) = delete; // C++14
127 wbuffer_convert & operator=(const wbuffer_convert &) = delete; // C++14137 wbuffer_convert & operator=(const wbuffer_convert &) = delete; // C++14
128 ~wbuffer_convert(); // C++14138 ~wbuffer_convert(); // C++14
...@@ -197,10 +207,6 @@ template <class charT> class messages_byname;...@@ -197,10 +207,6 @@ template <class charT> class messages_byname;
197#include <nl_types.h>207#include <nl_types.h>
198#endif208#endif
199209
200#ifdef __APPLE__
201#include <Availability.h>
202#endif
203
204#ifdef _LIBCPP_LOCALE__L_EXTENSIONS210#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
205#include <__bsd_locale_defaults.h>211#include <__bsd_locale_defaults.h>
206#else212#else
...@@ -261,11 +267,11 @@ __scan_keyword(_InputIterator& __b, _InputIterator __e,...@@ -261,11 +267,11 @@ __scan_keyword(_InputIterator& __b, _InputIterator __e,
261 const unsigned char __does_match = '\2';267 const unsigned char __does_match = '\2';
262 unsigned char __statbuf[100];268 unsigned char __statbuf[100];
263 unsigned char* __status = __statbuf;269 unsigned char* __status = __statbuf;
264 unique_ptr<unsigned char, void(*)(void*)> __stat_hold(0, free);270 unique_ptr<unsigned char, void(*)(void*)> __stat_hold(nullptr, free);
265 if (__nkw > sizeof(__statbuf))271 if (__nkw > sizeof(__statbuf))
266 {272 {
267 __status = (unsigned char*)malloc(__nkw);273 __status = (unsigned char*)malloc(__nkw);
268 if (__status == 0)274 if (__status == nullptr)
269 __throw_bad_alloc();275 __throw_bad_alloc();
270 __stat_hold.reset(__status);276 __stat_hold.reset(__status);
271 }277 }
...@@ -561,8 +567,8 @@ __num_get<_CharT>::__stage2_float_loop(_CharT __ct, bool& __in_units, char& __ex...@@ -561,8 +567,8 @@ __num_get<_CharT>::__stage2_float_loop(_CharT __ct, bool& __in_units, char& __ex
561 return 0;567 return 0;
562}568}
563569
564_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<char>)570_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<char>)
565_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<wchar_t>)571_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<wchar_t>)
566572
567template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >573template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
568class _LIBCPP_TEMPLATE_VIS num_get574class _LIBCPP_TEMPLATE_VIS num_get
...@@ -877,8 +883,8 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,...@@ -877,8 +883,8 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
877 const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__iob.getloc());883 const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__iob.getloc());
878 typedef typename numpunct<_CharT>::string_type string_type;884 typedef typename numpunct<_CharT>::string_type string_type;
879 const string_type __names[2] = {__np.truename(), __np.falsename()};885 const string_type __names[2] = {__np.truename(), __np.falsename()};
880 const string_type* __i = __scan_keyword(__b, __e, __names, __names+2,886 const string_type* __i = _VSTD::__scan_keyword(__b, __e, __names, __names+2,
881 __ct, __err);887 __ct, __err);
882 __v = __i == __names;888 __v = __i == __names;
883 return __b;889 return __b;
884}890}
...@@ -1099,8 +1105,8 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,...@@ -1099,8 +1105,8 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
1099 return __b;1105 return __b;
1100}1106}
11011107
1102_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<char>)1108_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<char>)
1103_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<wchar_t>)1109_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<wchar_t>)
11041110
1105struct _LIBCPP_TYPE_VIS __num_put_base1111struct _LIBCPP_TYPE_VIS __num_put_base
1106{1112{
...@@ -1249,8 +1255,8 @@ __num_put<_CharT>::__widen_and_group_float(char* __nb, char* __np, char* __ne,...@@ -1249,8 +1255,8 @@ __num_put<_CharT>::__widen_and_group_float(char* __nb, char* __np, char* __ne,
1249 __op = __ob + (__np - __nb);1255 __op = __ob + (__np - __nb);
1250}1256}
12511257
1252_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<char>)1258_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<char>)
1253_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<wchar_t>)1259_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<wchar_t>)
12541260
1255template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >1261template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
1256class _LIBCPP_TEMPLATE_VIS num_put1262class _LIBCPP_TEMPLATE_VIS num_put
...@@ -1427,7 +1433,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,...@@ -1427,7 +1433,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
1427 return do_put(__s, __iob, __fl, (unsigned long)__v);1433 return do_put(__s, __iob, __fl, (unsigned long)__v);
1428 const numpunct<char_type>& __np = use_facet<numpunct<char_type> >(__iob.getloc());1434 const numpunct<char_type>& __np = use_facet<numpunct<char_type> >(__iob.getloc());
1429 typedef typename numpunct<char_type>::string_type string_type;1435 typedef typename numpunct<char_type>::string_type string_type;
1430#if _LIBCPP_DEBUG_LEVEL >= 21436#if _LIBCPP_DEBUG_LEVEL == 2
1431 string_type __tmp(__v ? __np.truename() : __np.falsename());1437 string_type __tmp(__v ? __np.truename() : __np.falsename());
1432 string_type __nm = _VSTD::move(__tmp);1438 string_type __nm = _VSTD::move(__tmp);
1433#else1439#else
...@@ -1564,14 +1570,14 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,...@@ -1564,14 +1570,14 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
1564 (int)__iob.precision(), __v);1570 (int)__iob.precision(), __v);
1565 else1571 else
1566 __nc = __libcpp_snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v);1572 __nc = __libcpp_snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v);
1567 unique_ptr<char, void(*)(void*)> __nbh(0, free);1573 unique_ptr<char, void(*)(void*)> __nbh(nullptr, free);
1568 if (__nc > static_cast<int>(__nbuf-1))1574 if (__nc > static_cast<int>(__nbuf-1))
1569 {1575 {
1570 if (__specify_precision)1576 if (__specify_precision)
1571 __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);1577 __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
1572 else1578 else
1573 __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v);1579 __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v);
1574 if (__nb == 0)1580 if (__nc == -1)
1575 __throw_bad_alloc();1581 __throw_bad_alloc();
1576 __nbh.reset(__nb);1582 __nbh.reset(__nb);
1577 }1583 }
...@@ -1615,14 +1621,14 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,...@@ -1615,14 +1621,14 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
1615 (int)__iob.precision(), __v);1621 (int)__iob.precision(), __v);
1616 else1622 else
1617 __nc = __libcpp_snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v);1623 __nc = __libcpp_snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v);
1618 unique_ptr<char, void(*)(void*)> __nbh(0, free);1624 unique_ptr<char, void(*)(void*)> __nbh(nullptr, free);
1619 if (__nc > static_cast<int>(__nbuf-1))1625 if (__nc > static_cast<int>(__nbuf-1))
1620 {1626 {
1621 if (__specify_precision)1627 if (__specify_precision)
1622 __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);1628 __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
1623 else1629 else
1624 __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v);1630 __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v);
1625 if (__nb == 0)1631 if (__nc == -1)
1626 __throw_bad_alloc();1632 __throw_bad_alloc();
1627 __nbh.reset(__nb);1633 __nbh.reset(__nb);
1628 }1634 }
...@@ -1676,8 +1682,8 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,...@@ -1676,8 +1682,8 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
1676 return __pad_and_output(__s, __o, __op, __oe, __iob, __fl);1682 return __pad_and_output(__s, __o, __op, __oe, __iob, __fl);
1677}1683}
16781684
1679_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<char>)1685_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<char>)
1680_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<wchar_t>)1686_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<wchar_t>)
16811687
1682template <class _CharT, class _InputIterator>1688template <class _CharT, class _InputIterator>
1683_LIBCPP_HIDDEN1689_LIBCPP_HIDDEN
...@@ -1916,7 +1922,7 @@ time_get<_CharT, _InputIterator>::__get_weekdayname(int& __w,...@@ -1916,7 +1922,7 @@ time_get<_CharT, _InputIterator>::__get_weekdayname(int& __w,
1916{1922{
1917 // Note: ignoring case comes from the POSIX strptime spec1923 // Note: ignoring case comes from the POSIX strptime spec
1918 const string_type* __wk = this->__weeks();1924 const string_type* __wk = this->__weeks();
1919 ptrdiff_t __i = __scan_keyword(__b, __e, __wk, __wk+14, __ct, __err, false) - __wk;1925 ptrdiff_t __i = _VSTD::__scan_keyword(__b, __e, __wk, __wk+14, __ct, __err, false) - __wk;
1920 if (__i < 14)1926 if (__i < 14)
1921 __w = __i % 7;1927 __w = __i % 7;
1922}1928}
...@@ -1930,7 +1936,7 @@ time_get<_CharT, _InputIterator>::__get_monthname(int& __m,...@@ -1930,7 +1936,7 @@ time_get<_CharT, _InputIterator>::__get_monthname(int& __m,
1930{1936{
1931 // Note: ignoring case comes from the POSIX strptime spec1937 // Note: ignoring case comes from the POSIX strptime spec
1932 const string_type* __month = this->__months();1938 const string_type* __month = this->__months();
1933 ptrdiff_t __i = __scan_keyword(__b, __e, __month, __month+24, __ct, __err, false) - __month;1939 ptrdiff_t __i = _VSTD::__scan_keyword(__b, __e, __month, __month+24, __ct, __err, false) - __month;
1934 if (__i < 24)1940 if (__i < 24)
1935 __m = __i % 12;1941 __m = __i % 12;
1936}1942}
...@@ -1942,7 +1948,7 @@ time_get<_CharT, _InputIterator>::__get_day(int& __d,...@@ -1942,7 +1948,7 @@ time_get<_CharT, _InputIterator>::__get_day(int& __d,
1942 ios_base::iostate& __err,1948 ios_base::iostate& __err,
1943 const ctype<char_type>& __ct) const1949 const ctype<char_type>& __ct) const
1944{1950{
1945 int __t = __get_up_to_n_digits(__b, __e, __err, __ct, 2);1951 int __t = _VSTD::__get_up_to_n_digits(__b, __e, __err, __ct, 2);
1946 if (!(__err & ios_base::failbit) && 1 <= __t && __t <= 31)1952 if (!(__err & ios_base::failbit) && 1 <= __t && __t <= 31)
1947 __d = __t;1953 __d = __t;
1948 else1954 else
...@@ -2102,7 +2108,7 @@ time_get<_CharT, _InputIterator>::__get_am_pm(int& __h,...@@ -2102,7 +2108,7 @@ time_get<_CharT, _InputIterator>::__get_am_pm(int& __h,
2102 __err |= ios_base::failbit;2108 __err |= ios_base::failbit;
2103 return;2109 return;
2104 }2110 }
2105 ptrdiff_t __i = __scan_keyword(__b, __e, __ap, __ap+2, __ct, __err, false) - __ap;2111 ptrdiff_t __i = _VSTD::__scan_keyword(__b, __e, __ap, __ap+2, __ct, __err, false) - __ap;
2106 if (__i == 0 && __h == 12)2112 if (__i == 0 && __h == 12)
2107 __h = 0;2113 __h = 0;
2108 else if (__i == 1 && __h < 12)2114 else if (__i == 1 && __h < 12)
...@@ -2362,8 +2368,8 @@ time_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,...@@ -2362,8 +2368,8 @@ time_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
2362 return __b;2368 return __b;
2363}2369}
23642370
2365_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<char>)2371_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<char>)
2366_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<wchar_t>)2372_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<wchar_t>)
23672373
2368class _LIBCPP_TYPE_VIS __time_get2374class _LIBCPP_TYPE_VIS __time_get
2369{2375{
...@@ -2462,8 +2468,8 @@ private:...@@ -2462,8 +2468,8 @@ private:
2462 virtual const string_type& __X() const {return this->__X_;}2468 virtual const string_type& __X() const {return this->__X_;}
2463};2469};
24642470
2465_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<char>)2471_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<char>)
2466_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<wchar_t>)2472_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<wchar_t>)
24672473
2468class _LIBCPP_TYPE_VIS __time_put2474class _LIBCPP_TYPE_VIS __time_put
2469{2475{
...@@ -2575,8 +2581,8 @@ time_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base&,...@@ -2575,8 +2581,8 @@ time_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base&,
2575 return _VSTD::copy(__nb, __ne, __s);2581 return _VSTD::copy(__nb, __ne, __s);
2576}2582}
25772583
2578_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<char>)2584_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<char>)
2579_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<wchar_t>)2585_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<wchar_t>)
25802586
2581template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >2587template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
2582class _LIBCPP_TEMPLATE_VIS time_put_byname2588class _LIBCPP_TEMPLATE_VIS time_put_byname
...@@ -2596,8 +2602,8 @@ protected:...@@ -2596,8 +2602,8 @@ protected:
2596 ~time_put_byname() {}2602 ~time_put_byname() {}
2597};2603};
25982604
2599_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>)2605_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>)
2600_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<wchar_t>)2606_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<wchar_t>)
26012607
2602// money_base2608// money_base
26032609
...@@ -2663,10 +2669,10 @@ template <class _CharT, bool _International>...@@ -2663,10 +2669,10 @@ template <class _CharT, bool _International>
2663const bool2669const bool
2664moneypunct<_CharT, _International>::intl;2670moneypunct<_CharT, _International>::intl;
26652671
2666_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, false>)2672_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, false>)
2667_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, true>)2673_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, true>)
2668_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, false>)2674_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, false>)
2669_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, true>)2675_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, true>)
26702676
2671// moneypunct_byname2677// moneypunct_byname
26722678
...@@ -2720,10 +2726,10 @@ template<> _LIBCPP_FUNC_VIS void moneypunct_byname<char, true>::init(const char*...@@ -2720,10 +2726,10 @@ template<> _LIBCPP_FUNC_VIS void moneypunct_byname<char, true>::init(const char*
2720template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, false>::init(const char*);2726template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, false>::init(const char*);
2721template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, true>::init(const char*);2727template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, true>::init(const char*);
27222728
2723_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, false>)2729_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, false>)
2724_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, true>)2730_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, true>)
2725_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, false>)2731_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, false>)
2726_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, true>)2732_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, true>)
27272733
2728// money_get2734// money_get
27292735
...@@ -2779,8 +2785,8 @@ __money_get<_CharT>::__gather_info(bool __intl, const locale& __loc,...@@ -2779,8 +2785,8 @@ __money_get<_CharT>::__gather_info(bool __intl, const locale& __loc,
2779 }2785 }
2780}2786}
27812787
2782_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<char>)2788_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<char>)
2783_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<wchar_t>)2789_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<wchar_t>)
27842790
2785template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >2791template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
2786class _LIBCPP_TEMPLATE_VIS money_get2792class _LIBCPP_TEMPLATE_VIS money_get
...@@ -3108,11 +3114,11 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,...@@ -3108,11 +3114,11 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
3108 __ct.widen(__src, __src + (sizeof(__src)-1), __atoms);3114 __ct.widen(__src, __src + (sizeof(__src)-1), __atoms);
3109 char __nbuf[__bz];3115 char __nbuf[__bz];
3110 char* __nc = __nbuf;3116 char* __nc = __nbuf;
3111 unique_ptr<char, void(*)(void*)> __h(0, free);3117 unique_ptr<char, void(*)(void*)> __h(nullptr, free);
3112 if (__wn - __wb.get() > __bz-2)3118 if (__wn - __wb.get() > __bz-2)
3113 {3119 {
3114 __h.reset((char*)malloc(static_cast<size_t>(__wn - __wb.get() + 2)));3120 __h.reset((char*)malloc(static_cast<size_t>(__wn - __wb.get() + 2)));
3115 if (__h.get() == 0)3121 if (__h.get() == nullptr)
3116 __throw_bad_alloc();3122 __throw_bad_alloc();
3117 __nc = __h.get();3123 __nc = __h.get();
3118 }3124 }
...@@ -3162,8 +3168,8 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,...@@ -3162,8 +3168,8 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
3162 return __b;3168 return __b;
3163}3169}
31643170
3165_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<char>)3171_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<char>)
3166_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<wchar_t>)3172_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<wchar_t>)
31673173
3168// money_put3174// money_put
31693175
...@@ -3337,8 +3343,8 @@ __money_put<_CharT>::__format(char_type* __mb, char_type*& __mi, char_type*& __m...@@ -3337,8 +3343,8 @@ __money_put<_CharT>::__format(char_type* __mb, char_type*& __mi, char_type*& __m
3337 __mi = __mb;3343 __mi = __mb;
3338}3344}
33393345
3340_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<char>)3346_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<char>)
3341_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<wchar_t>)3347_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<wchar_t>)
33423348
3343template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >3349template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
3344class _LIBCPP_TEMPLATE_VIS money_put3350class _LIBCPP_TEMPLATE_VIS money_put
...@@ -3396,17 +3402,17 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,...@@ -3396,17 +3402,17 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,
3396 char* __bb = __buf;3402 char* __bb = __buf;
3397 char_type __digits[__bs];3403 char_type __digits[__bs];
3398 char_type* __db = __digits;3404 char_type* __db = __digits;
3399 size_t __n = static_cast<size_t>(snprintf(__bb, __bs, "%.0Lf", __units));3405 int __n = snprintf(__bb, __bs, "%.0Lf", __units);
3400 unique_ptr<char, void(*)(void*)> __hn(0, free);3406 unique_ptr<char, void(*)(void*)> __hn(nullptr, free);
3401 unique_ptr<char_type, void(*)(void*)> __hd(0, free);3407 unique_ptr<char_type, void(*)(void*)> __hd(0, free);
3402 // secure memory for digit storage3408 // secure memory for digit storage
3403 if (__n > __bs-1)3409 if (static_cast<size_t>(__n) > __bs-1)
3404 {3410 {
3405 __n = static_cast<size_t>(__libcpp_asprintf_l(&__bb, _LIBCPP_GET_C_LOCALE, "%.0Lf", __units));3411 __n = __libcpp_asprintf_l(&__bb, _LIBCPP_GET_C_LOCALE, "%.0Lf", __units);
3406 if (__bb == 0)3412 if (__n == -1)
3407 __throw_bad_alloc();3413 __throw_bad_alloc();
3408 __hn.reset(__bb);3414 __hn.reset(__bb);
3409 __hd.reset((char_type*)malloc(__n * sizeof(char_type)));3415 __hd.reset((char_type*)malloc(static_cast<size_t>(__n) * sizeof(char_type)));
3410 if (__hd == nullptr)3416 if (__hd == nullptr)
3411 __throw_bad_alloc();3417 __throw_bad_alloc();
3412 __db = __hd.get();3418 __db = __hd.get();
...@@ -3428,9 +3434,9 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,...@@ -3428,9 +3434,9 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,
3428 char_type __mbuf[__bs];3434 char_type __mbuf[__bs];
3429 char_type* __mb = __mbuf;3435 char_type* __mb = __mbuf;
3430 unique_ptr<char_type, void(*)(void*)> __hw(0, free);3436 unique_ptr<char_type, void(*)(void*)> __hw(0, free);
3431 size_t __exn = static_cast<int>(__n) > __fd ?3437 size_t __exn = __n > __fd ?
3432 (__n - static_cast<size_t>(__fd)) * 2 + __sn.size() +3438 (static_cast<size_t>(__n) - static_cast<size_t>(__fd)) * 2 +
3433 __sym.size() + static_cast<size_t>(__fd) + 13439 __sn.size() + __sym.size() + static_cast<size_t>(__fd) + 1
3434 : __sn.size() + __sym.size() + static_cast<size_t>(__fd) + 2;3440 : __sn.size() + __sym.size() + static_cast<size_t>(__fd) + 2;
3435 if (__exn > __bs)3441 if (__exn > __bs)
3436 {3442 {
...@@ -3490,8 +3496,8 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,...@@ -3490,8 +3496,8 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,
3490 return __pad_and_output(__s, __mb, __mi, __me, __iob, __fl);3496 return __pad_and_output(__s, __mb, __mi, __me, __iob, __fl);
3491}3497}
34923498
3493_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<char>)3499_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<char>)
3494_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<wchar_t>)3500_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<wchar_t>)
34953501
3496// messages3502// messages
34973503
...@@ -3582,7 +3588,7 @@ messages<_CharT>::do_get(catalog __c, int __set, int __msgid,...@@ -3582,7 +3588,7 @@ messages<_CharT>::do_get(catalog __c, int __set, int __msgid,
3582 char* __n = catgets(__cat, __set, __msgid, __ndflt.c_str());3588 char* __n = catgets(__cat, __set, __msgid, __ndflt.c_str());
3583 string_type __w;3589 string_type __w;
3584 __widen_from_utf8<sizeof(char_type)*__CHAR_BIT__>()(back_inserter(__w),3590 __widen_from_utf8<sizeof(char_type)*__CHAR_BIT__>()(back_inserter(__w),
3585 __n, __n + strlen(__n));3591 __n, __n + _VSTD::strlen(__n));
3586 return __w;3592 return __w;
3587#else // !_LIBCPP_HAS_CATOPEN3593#else // !_LIBCPP_HAS_CATOPEN
3588 _LIBCPP_UNUSED_VAR(__c);3594 _LIBCPP_UNUSED_VAR(__c);
...@@ -3606,8 +3612,8 @@ messages<_CharT>::do_close(catalog __c) const...@@ -3606,8 +3612,8 @@ messages<_CharT>::do_close(catalog __c) const
3606#endif // _LIBCPP_HAS_CATOPEN3612#endif // _LIBCPP_HAS_CATOPEN
3607}3613}
36083614
3609_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<char>)3615_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<char>)
3610_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<wchar_t>)3616_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<wchar_t>)
36113617
3612template <class _CharT>3618template <class _CharT>
3613class _LIBCPP_TEMPLATE_VIS messages_byname3619class _LIBCPP_TEMPLATE_VIS messages_byname
...@@ -3630,8 +3636,8 @@ protected:...@@ -3630,8 +3636,8 @@ protected:
3630 ~messages_byname() {}3636 ~messages_byname() {}
3631};3637};
36323638
3633_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>)3639_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>)
3634_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>)3640_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>)
36353641
3636template<class _Codecvt, class _Elem = wchar_t,3642template<class _Codecvt, class _Elem = wchar_t,
3637 class _Wide_alloc = allocator<_Elem>,3643 class _Wide_alloc = allocator<_Elem>,
...@@ -3654,8 +3660,17 @@ private:...@@ -3654,8 +3660,17 @@ private:
3654 wstring_convert(const wstring_convert& __wc);3660 wstring_convert(const wstring_convert& __wc);
3655 wstring_convert& operator=(const wstring_convert& __wc);3661 wstring_convert& operator=(const wstring_convert& __wc);
3656public:3662public:
3663#ifndef _LIBCPP_CXX03_LANG
3657 _LIBCPP_INLINE_VISIBILITY3664 _LIBCPP_INLINE_VISIBILITY
3658 _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(_Codecvt* __pcvt = new _Codecvt);3665 wstring_convert() : wstring_convert(new _Codecvt) {}
3666 _LIBCPP_INLINE_VISIBILITY
3667 explicit wstring_convert(_Codecvt* __pcvt);
3668#else
3669 _LIBCPP_INLINE_VISIBILITY
3670 _LIBCPP_EXPLICIT_AFTER_CXX11
3671 wstring_convert(_Codecvt* __pcvt = new _Codecvt);
3672#endif
3673
3659 _LIBCPP_INLINE_VISIBILITY3674 _LIBCPP_INLINE_VISIBILITY
3660 wstring_convert(_Codecvt* __pcvt, state_type __state);3675 wstring_convert(_Codecvt* __pcvt, state_type __state);
3661 _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err,3676 _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err,
...@@ -3922,9 +3937,20 @@ private:...@@ -3922,9 +3937,20 @@ private:
39223937
3923 wbuffer_convert(const wbuffer_convert&);3938 wbuffer_convert(const wbuffer_convert&);
3924 wbuffer_convert& operator=(const wbuffer_convert&);3939 wbuffer_convert& operator=(const wbuffer_convert&);
3940
3925public:3941public:
3926 _LIBCPP_EXPLICIT_AFTER_CXX11 wbuffer_convert(streambuf* __bytebuf = 0,3942#ifndef _LIBCPP_CXX03_LANG
3927 _Codecvt* __pcvt = new _Codecvt, state_type __state = state_type());3943 wbuffer_convert() : wbuffer_convert(nullptr) {}
3944 explicit wbuffer_convert(streambuf* __bytebuf,
3945 _Codecvt* __pcvt = new _Codecvt,
3946 state_type __state = state_type());
3947#else
3948 _LIBCPP_EXPLICIT_AFTER_CXX11
3949 wbuffer_convert(streambuf* __bytebuf = nullptr,
3950 _Codecvt* __pcvt = new _Codecvt,
3951 state_type __state = state_type());
3952#endif
3953
3928 ~wbuffer_convert();3954 ~wbuffer_convert();
39293955
3930 _LIBCPP_INLINE_VISIBILITY3956 _LIBCPP_INLINE_VISIBILITY
...@@ -3961,9 +3987,9 @@ private:...@@ -3961,9 +3987,9 @@ private:
3961template <class _Codecvt, class _Elem, class _Tr>3987template <class _Codecvt, class _Elem, class _Tr>
3962wbuffer_convert<_Codecvt, _Elem, _Tr>::3988wbuffer_convert<_Codecvt, _Elem, _Tr>::
3963 wbuffer_convert(streambuf* __bytebuf, _Codecvt* __pcvt, state_type __state)3989 wbuffer_convert(streambuf* __bytebuf, _Codecvt* __pcvt, state_type __state)
3964 : __extbuf_(0),3990 : __extbuf_(nullptr),
3965 __extbufnext_(0),3991 __extbufnext_(nullptr),
3966 __extbufend_(0),3992 __extbufend_(nullptr),
3967 __ebs_(0),3993 __ebs_(0),
3968 __intbuf_(0),3994 __intbuf_(0),
3969 __ibs_(0),3995 __ibs_(0),
...@@ -4003,7 +4029,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow()...@@ -4003,7 +4029,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow()
4003 int_type __c = traits_type::eof();4029 int_type __c = traits_type::eof();
4004 if (this->gptr() == this->egptr())4030 if (this->gptr() == this->egptr())
4005 {4031 {
4006 memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type));4032 _VSTD::memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type));
4007 if (__always_noconv_)4033 if (__always_noconv_)
4008 {4034 {
4009 streamsize __nmemb = static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz);4035 streamsize __nmemb = static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz);
...@@ -4020,7 +4046,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow()...@@ -4020,7 +4046,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow()
4020 {4046 {
4021 _LIBCPP_ASSERT(!(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" );4047 _LIBCPP_ASSERT(!(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" );
4022 if (__extbufend_ != __extbufnext_)4048 if (__extbufend_ != __extbufnext_)
4023 memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);4049 _VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
4024 __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);4050 __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
4025 __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);4051 __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
4026 streamsize __nmemb = _VSTD::min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),4052 streamsize __nmemb = _VSTD::min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),
...@@ -4336,12 +4362,12 @@ template <class _Codecvt, class _Elem, class _Tr>...@@ -4336,12 +4362,12 @@ template <class _Codecvt, class _Elem, class _Tr>
4336wbuffer_convert<_Codecvt, _Elem, _Tr>*4362wbuffer_convert<_Codecvt, _Elem, _Tr>*
4337wbuffer_convert<_Codecvt, _Elem, _Tr>::__close()4363wbuffer_convert<_Codecvt, _Elem, _Tr>::__close()
4338{4364{
4339 wbuffer_convert* __rt = 0;4365 wbuffer_convert* __rt = nullptr;
4340 if (__cv_ != 0 && __bufptr_ != 0)4366 if (__cv_ != nullptr && __bufptr_ != nullptr)
4341 {4367 {
4342 __rt = this;4368 __rt = this;
4343 if ((__cm_ & ios_base::out) && sync())4369 if ((__cm_ & ios_base::out) && sync())
4344 __rt = 0;4370 __rt = nullptr;
4345 }4371 }
4346 return __rt;4372 return __rt;
4347}4373}
lib/libcxx/include/locale.h+5-1
...@@ -35,8 +35,12 @@ Functions:...@@ -35,8 +35,12 @@ Functions:
3535
36#include <__config>36#include <__config>
3737
38#if defined(_LIBCPP_HAS_NO_LOCALIZATION)
39# error "Localization is not supported by this configuration of libc++"
40#endif
41
38#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)42#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
39#pragma GCC system_header43# pragma GCC system_header
40#endif44#endif
4145
42#include_next <locale.h>46#include_next <locale.h>
lib/libcxx/include/map+25-25
...@@ -1230,7 +1230,7 @@ public:...@@ -1230,7 +1230,7 @@ public:
1230 return __tree_.__emplace_hint_unique_key_args(__h.__i_, __k,1230 return __tree_.__emplace_hint_unique_key_args(__h.__i_, __k,
1231 _VSTD::piecewise_construct,1231 _VSTD::piecewise_construct,
1232 _VSTD::forward_as_tuple(__k),1232 _VSTD::forward_as_tuple(__k),
1233 _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));1233 _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)).first;
1234 }1234 }
12351235
1236 template <class... _Args>1236 template <class... _Args>
...@@ -1240,7 +1240,7 @@ public:...@@ -1240,7 +1240,7 @@ public:
1240 return __tree_.__emplace_hint_unique_key_args(__h.__i_, __k,1240 return __tree_.__emplace_hint_unique_key_args(__h.__i_, __k,
1241 _VSTD::piecewise_construct,1241 _VSTD::piecewise_construct,
1242 _VSTD::forward_as_tuple(_VSTD::move(__k)),1242 _VSTD::forward_as_tuple(_VSTD::move(__k)),
1243 _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));1243 _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)).first;
1244 }1244 }
12451245
1246 template <class _Vp>1246 template <class _Vp>
...@@ -1270,30 +1270,30 @@ public:...@@ -1270,30 +1270,30 @@ public:
1270 }1270 }
12711271
1272 template <class _Vp>1272 template <class _Vp>
1273 _LIBCPP_INLINE_VISIBILITY1273 _LIBCPP_INLINE_VISIBILITY iterator insert_or_assign(const_iterator __h,
1274 iterator insert_or_assign(const_iterator __h, const key_type& __k, _Vp&& __v)1274 const key_type& __k,
1275 {1275 _Vp&& __v) {
1276 iterator __p = lower_bound(__k);1276 auto [__r, __inserted] = __tree_.__emplace_hint_unique_key_args(
1277 if ( __p != end() && !key_comp()(__k, __p->first))1277 __h.__i_, __k, __k, _VSTD::forward<_Vp>(__v));
1278 {1278
1279 __p->second = _VSTD::forward<_Vp>(__v);1279 if (!__inserted)
1280 return __p;1280 __r->__get_value().second = _VSTD::forward<_Vp>(__v);
1281 }1281
1282 return emplace_hint(__h, __k, _VSTD::forward<_Vp>(__v));1282 return __r;
1283 }1283 }
12841284
1285 template <class _Vp>1285 template <class _Vp>
1286 _LIBCPP_INLINE_VISIBILITY1286 _LIBCPP_INLINE_VISIBILITY iterator insert_or_assign(const_iterator __h,
1287 iterator insert_or_assign(const_iterator __h, key_type&& __k, _Vp&& __v)1287 key_type&& __k,
1288 {1288 _Vp&& __v) {
1289 iterator __p = lower_bound(__k);1289 auto [__r, __inserted] = __tree_.__emplace_hint_unique_key_args(
1290 if ( __p != end() && !key_comp()(__k, __p->first))1290 __h.__i_, __k, _VSTD::move(__k), _VSTD::forward<_Vp>(__v));
1291 {1291
1292 __p->second = _VSTD::forward<_Vp>(__v);1292 if (!__inserted)
1293 return __p;1293 __r->__get_value().second = _VSTD::forward<_Vp>(__v);
1294 }1294
1295 return emplace_hint(__h, _VSTD::move(__k), _VSTD::forward<_Vp>(__v));1295 return __r;
1296 }1296 }
12971297
1298#endif // _LIBCPP_STD_VER > 141298#endif // _LIBCPP_STD_VER > 14
12991299
...@@ -1546,7 +1546,7 @@ map<_Key, _Tp, _Compare, _Allocator>::__construct_node_with_key(const key_type&...@@ -1546,7 +1546,7 @@ map<_Key, _Tp, _Compare, _Allocator>::__construct_node_with_key(const key_type&
1546 __h.get_deleter().__first_constructed = true;1546 __h.get_deleter().__first_constructed = true;
1547 __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__get_value().second));1547 __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__get_value().second));
1548 __h.get_deleter().__second_constructed = true;1548 __h.get_deleter().__second_constructed = true;
1549 return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++031549 return __h;
1550}1550}
15511551
1552template <class _Key, class _Tp, class _Compare, class _Allocator>1552template <class _Key, class _Tp, class _Compare, class _Allocator>
lib/libcxx/include/memory+418-1383
...@@ -46,7 +46,7 @@ struct pointer_traits<T*>...@@ -46,7 +46,7 @@ struct pointer_traits<T*>
46};46};
4747
48template <class T> constexpr T* to_address(T* p) noexcept; // C++2048template <class T> constexpr T* to_address(T* p) noexcept; // C++20
49template <class Ptr> auto to_address(const Ptr& p) noexcept; // C++2049template <class Ptr> constexpr auto to_address(const Ptr& p) noexcept; // C++20
5050
51template <class Alloc>51template <class Alloc>
52struct allocator_traits52struct allocator_traits
...@@ -83,21 +83,19 @@ struct allocator_traits...@@ -83,21 +83,19 @@ struct allocator_traits
83 template <class T> using rebind_alloc = Alloc::rebind<T>::other | Alloc<T, Args...>;83 template <class T> using rebind_alloc = Alloc::rebind<T>::other | Alloc<T, Args...>;
84 template <class T> using rebind_traits = allocator_traits<rebind_alloc<T>>;84 template <class T> using rebind_traits = allocator_traits<rebind_alloc<T>>;
8585
86 static pointer allocate(allocator_type& a, size_type n); // [[nodiscard]] in C++2086 static pointer allocate(allocator_type& a, size_type n); // constexpr and [[nodiscard]] in C++20
87 static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint); // [[nodiscard]] in C++2087 static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint); // constexpr and [[nodiscard]] in C++20
8888
89 static void deallocate(allocator_type& a, pointer p, size_type n) noexcept;89 static void deallocate(allocator_type& a, pointer p, size_type n) noexcept; // constexpr in C++20
9090
91 template <class T, class... Args>91 template <class T, class... Args>
92 static void construct(allocator_type& a, T* p, Args&&... args);92 static void construct(allocator_type& a, T* p, Args&&... args); // constexpr in C++20
9393
94 template <class T>94 template <class T>
95 static void destroy(allocator_type& a, T* p);95 static void destroy(allocator_type& a, T* p); // constexpr in C++20
9696
97 static size_type max_size(const allocator_type& a); // noexcept in C++1497 static size_type max_size(const allocator_type& a); // noexcept in C++14, constexpr in C++20
9898 static allocator_type select_on_container_copy_construction(const allocator_type& a); // constexpr in C++20
99 static allocator_type
100 select_on_container_copy_construction(const allocator_type& a);
101};99};
102100
103template <>101template <>
...@@ -115,8 +113,8 @@ template <class T>...@@ -115,8 +113,8 @@ template <class T>
115class allocator113class allocator
116{114{
117public:115public:
118 typedef size_t size_type; // deprecated in C++17, removed in C++20116 typedef size_t size_type;
119 typedef ptrdiff_t difference_type; // deprecated in C++17, removed in C++20117 typedef ptrdiff_t difference_type;
120 typedef T* pointer; // deprecated in C++17, removed in C++20118 typedef T* pointer; // deprecated in C++17, removed in C++20
121 typedef const T* const_pointer; // deprecated in C++17, removed in C++20119 typedef const T* const_pointer; // deprecated in C++17, removed in C++20
122 typedef typename add_lvalue_reference<T>::type120 typedef typename add_lvalue_reference<T>::type
...@@ -135,12 +133,12 @@ public:...@@ -135,12 +133,12 @@ public:
135 constexpr allocator(const allocator&) noexcept; // constexpr in C++20133 constexpr allocator(const allocator&) noexcept; // constexpr in C++20
136 template <class U>134 template <class U>
137 constexpr allocator(const allocator<U>&) noexcept; // constexpr in C++20135 constexpr allocator(const allocator<U>&) noexcept; // constexpr in C++20
138 ~allocator();136 ~allocator(); // constexpr in C++20
139 pointer address(reference x) const noexcept; // deprecated in C++17, removed in C++20137 pointer address(reference x) const noexcept; // deprecated in C++17, removed in C++20
140 const_pointer address(const_reference x) const noexcept; // deprecated in C++17, removed in C++20138 const_pointer address(const_reference x) const noexcept; // deprecated in C++17, removed in C++20
141 T* allocate(size_t n, const void* hint); // deprecated in C++17, removed in C++20139 T* allocate(size_t n, const void* hint); // deprecated in C++17, removed in C++20
142 T* allocate(size_t n);140 T* allocate(size_t n); // constexpr in C++20
143 void deallocate(T* p, size_t n) noexcept;141 void deallocate(T* p, size_t n) noexcept; // constexpr in C++20
144 size_type max_size() const noexcept; // deprecated in C++17, removed in C++20142 size_type max_size() const noexcept; // deprecated in C++17, removed in C++20
145 template<class U, class... Args>143 template<class U, class... Args>
146 void construct(U* p, Args&&... args); // deprecated in C++17, removed in C++20144 void construct(U* p, Args&&... args); // deprecated in C++17, removed in C++20
...@@ -149,10 +147,10 @@ public:...@@ -149,10 +147,10 @@ public:
149};147};
150148
151template <class T, class U>149template <class T, class U>
152bool operator==(const allocator<T>&, const allocator<U>&) noexcept;150bool operator==(const allocator<T>&, const allocator<U>&) noexcept; // constexpr in C++20
153151
154template <class T, class U>152template <class T, class U>
155bool operator!=(const allocator<T>&, const allocator<U>&) noexcept;153bool operator!=(const allocator<T>&, const allocator<U>&) noexcept; // constexpr in C++20
156154
157template <class OutputIterator, class T>155template <class OutputIterator, class T>
158class raw_storage_iterator156class raw_storage_iterator
...@@ -191,14 +189,17 @@ template <class ForwardIterator, class Size, class T>...@@ -191,14 +189,17 @@ template <class ForwardIterator, class Size, class T>
191ForwardIterator189ForwardIterator
192uninitialized_fill_n(ForwardIterator first, Size n, const T& x);190uninitialized_fill_n(ForwardIterator first, Size n, const T& x);
193191
192template <class T, class ...Args>
193constexpr T* construct_at(T* location, Args&& ...args); // since C++20
194
194template <class T>195template <class T>
195void destroy_at(T* location);196void destroy_at(T* location); // constexpr in C++20
196197
197template <class ForwardIterator>198template <class ForwardIterator>
198 void destroy(ForwardIterator first, ForwardIterator last);199void destroy(ForwardIterator first, ForwardIterator last); // constexpr in C++20
199200
200template <class ForwardIterator, class Size>201template <class ForwardIterator, class Size>
201 ForwardIterator destroy_n(ForwardIterator first, Size n);202ForwardIterator destroy_n(ForwardIterator first, Size n); // constexpr in C++20
202203
203template <class InputIterator, class ForwardIterator>204template <class InputIterator, class ForwardIterator>
204 ForwardIterator uninitialized_move(InputIterator first, InputIterator last, ForwardIterator result);205 ForwardIterator uninitialized_move(InputIterator first, InputIterator last, ForwardIterator result);
...@@ -338,7 +339,7 @@ public:...@@ -338,7 +339,7 @@ public:
338 pointer release() noexcept;339 pointer release() noexcept;
339 void reset(pointer p = pointer()) noexcept;340 void reset(pointer p = pointer()) noexcept;
340 void reset(nullptr_t) noexcept;341 void reset(nullptr_t) noexcept;
341 template <class U> void reset(U) = delete;342 template <class U> void reset(U) = delete;
342 void swap(unique_ptr& u) noexcept;343 void swap(unique_ptr& u) noexcept;
343};344};
344345
...@@ -664,6 +665,7 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);...@@ -664,6 +665,7 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
664*/665*/
665666
666#include <__config>667#include <__config>
668#include <__availability>
667#include <type_traits>669#include <type_traits>
668#include <typeinfo>670#include <typeinfo>
669#include <cstddef>671#include <cstddef>
...@@ -677,6 +679,10 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);...@@ -677,6 +679,10 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
677#include <tuple>679#include <tuple>
678#include <stdexcept>680#include <stdexcept>
679#include <cstring>681#include <cstring>
682#include <__memory/allocator_traits.h>
683#include <__memory/base.h>
684#include <__memory/pointer_traits.h>
685#include <__memory/utilities.h>
680#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)686#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
681# include <atomic>687# include <atomic>
682#endif688#endif
...@@ -716,413 +722,11 @@ _ValueType __libcpp_acquire_load(_ValueType const* __value) {...@@ -716,413 +722,11 @@ _ValueType __libcpp_acquire_load(_ValueType const* __value) {
716#endif722#endif
717}723}
718724
719// addressof moved to <type_traits>
720
721template <class _Tp> class allocator;
722
723#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
724template <>
725class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 allocator<void>
726{
727public:
728 typedef void* pointer;
729 typedef const void* const_pointer;
730 typedef void value_type;
731
732 template <class _Up> struct rebind {typedef allocator<_Up> other;};
733};
734
735template <>
736class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 allocator<const void>
737{
738public:
739 typedef const void* pointer;
740 typedef const void* const_pointer;
741 typedef const void value_type;
742
743 template <class _Up> struct rebind {typedef allocator<_Up> other;};
744};
745#endif
746
747// pointer_traits
748
749template <class _Tp, class = void>
750struct __has_element_type : false_type {};
751
752template <class _Tp>
753struct __has_element_type<_Tp,
754 typename __void_t<typename _Tp::element_type>::type> : true_type {};
755
756template <class _Ptr, bool = __has_element_type<_Ptr>::value>
757struct __pointer_traits_element_type;
758
759template <class _Ptr>
760struct __pointer_traits_element_type<_Ptr, true>
761{
762 typedef _LIBCPP_NODEBUG_TYPE typename _Ptr::element_type type;
763};
764
765#ifndef _LIBCPP_HAS_NO_VARIADICS
766
767template <template <class, class...> class _Sp, class _Tp, class ..._Args>
768struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, true>
769{
770 typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::element_type type;
771};
772
773template <template <class, class...> class _Sp, class _Tp, class ..._Args>
774struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, false>
775{
776 typedef _LIBCPP_NODEBUG_TYPE _Tp type;
777};
778
779#else // _LIBCPP_HAS_NO_VARIADICS
780
781template <template <class> class _Sp, class _Tp>
782struct __pointer_traits_element_type<_Sp<_Tp>, true>
783{
784 typedef typename _Sp<_Tp>::element_type type;
785};
786
787template <template <class> class _Sp, class _Tp>
788struct __pointer_traits_element_type<_Sp<_Tp>, false>
789{
790 typedef _Tp type;
791};
792
793template <template <class, class> class _Sp, class _Tp, class _A0>
794struct __pointer_traits_element_type<_Sp<_Tp, _A0>, true>
795{
796 typedef typename _Sp<_Tp, _A0>::element_type type;
797};
798
799template <template <class, class> class _Sp, class _Tp, class _A0>
800struct __pointer_traits_element_type<_Sp<_Tp, _A0>, false>
801{
802 typedef _Tp type;
803};
804
805template <template <class, class, class> class _Sp, class _Tp, class _A0, class _A1>
806struct __pointer_traits_element_type<_Sp<_Tp, _A0, _A1>, true>
807{
808 typedef typename _Sp<_Tp, _A0, _A1>::element_type type;
809};
810
811template <template <class, class, class> class _Sp, class _Tp, class _A0, class _A1>
812struct __pointer_traits_element_type<_Sp<_Tp, _A0, _A1>, false>
813{
814 typedef _Tp type;
815};
816
817template <template <class, class, class, class> class _Sp, class _Tp, class _A0,
818 class _A1, class _A2>
819struct __pointer_traits_element_type<_Sp<_Tp, _A0, _A1, _A2>, true>
820{
821 typedef typename _Sp<_Tp, _A0, _A1, _A2>::element_type type;
822};
823
824template <template <class, class, class, class> class _Sp, class _Tp, class _A0,
825 class _A1, class _A2>
826struct __pointer_traits_element_type<_Sp<_Tp, _A0, _A1, _A2>, false>
827{
828 typedef _Tp type;
829};
830
831#endif // _LIBCPP_HAS_NO_VARIADICS
832
833template <class _Tp, class = void>
834struct __has_difference_type : false_type {};
835
836template <class _Tp>
837struct __has_difference_type<_Tp,
838 typename __void_t<typename _Tp::difference_type>::type> : true_type {};
839
840template <class _Ptr, bool = __has_difference_type<_Ptr>::value>
841struct __pointer_traits_difference_type
842{
843 typedef _LIBCPP_NODEBUG_TYPE ptrdiff_t type;
844};
845
846template <class _Ptr>
847struct __pointer_traits_difference_type<_Ptr, true>
848{
849 typedef _LIBCPP_NODEBUG_TYPE typename _Ptr::difference_type type;
850};
851
852template <class _Tp, class _Up>
853struct __has_rebind
854{
855private:
856 struct __two {char __lx; char __lxx;};
857 template <class _Xp> static __two __test(...);
858 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
859 template <class _Xp> static char __test(typename _Xp::template rebind<_Up>* = 0);
860 _LIBCPP_SUPPRESS_DEPRECATED_POP
861public:
862 static const bool value = sizeof(__test<_Tp>(0)) == 1;
863};
864
865template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
866struct __pointer_traits_rebind
867{
868#ifndef _LIBCPP_CXX03_LANG
869 typedef _LIBCPP_NODEBUG_TYPE typename _Tp::template rebind<_Up> type;
870#else
871 typedef _LIBCPP_NODEBUG_TYPE typename _Tp::template rebind<_Up>::other type;
872#endif
873};
874
875#ifndef _LIBCPP_HAS_NO_VARIADICS
876
877template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up>
878struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, true>
879{
880#ifndef _LIBCPP_CXX03_LANG
881 typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::template rebind<_Up> type;
882#else
883 typedef _LIBCPP_NODEBUG_TYPE typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type;
884#endif
885};
886
887template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up>
888struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, false>
889{
890 typedef _Sp<_Up, _Args...> type;
891};
892
893#else // _LIBCPP_HAS_NO_VARIADICS
894
895template <template <class> class _Sp, class _Tp, class _Up>
896struct __pointer_traits_rebind<_Sp<_Tp>, _Up, true>
897{
898#ifndef _LIBCPP_CXX03_LANG
899 typedef typename _Sp<_Tp>::template rebind<_Up> type;
900#else
901 typedef typename _Sp<_Tp>::template rebind<_Up>::other type;
902#endif
903};
904
905template <template <class> class _Sp, class _Tp, class _Up>
906struct __pointer_traits_rebind<_Sp<_Tp>, _Up, false>
907{
908 typedef _Sp<_Up> type;
909};
910
911template <template <class, class> class _Sp, class _Tp, class _A0, class _Up>
912struct __pointer_traits_rebind<_Sp<_Tp, _A0>, _Up, true>
913{
914#ifndef _LIBCPP_CXX03_LANG
915 typedef typename _Sp<_Tp, _A0>::template rebind<_Up> type;
916#else
917 typedef typename _Sp<_Tp, _A0>::template rebind<_Up>::other type;
918#endif
919};
920
921template <template <class, class> class _Sp, class _Tp, class _A0, class _Up>
922struct __pointer_traits_rebind<_Sp<_Tp, _A0>, _Up, false>
923{
924 typedef _Sp<_Up, _A0> type;
925};
926
927template <template <class, class, class> class _Sp, class _Tp, class _A0,
928 class _A1, class _Up>
929struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1>, _Up, true>
930{
931#ifndef _LIBCPP_CXX03_LANG
932 typedef typename _Sp<_Tp, _A0, _A1>::template rebind<_Up> type;
933#else
934 typedef typename _Sp<_Tp, _A0, _A1>::template rebind<_Up>::other type;
935#endif
936};
937
938template <template <class, class, class> class _Sp, class _Tp, class _A0,
939 class _A1, class _Up>
940struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1>, _Up, false>
941{
942 typedef _Sp<_Up, _A0, _A1> type;
943};
944
945template <template <class, class, class, class> class _Sp, class _Tp, class _A0,
946 class _A1, class _A2, class _Up>
947struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1, _A2>, _Up, true>
948{
949#ifndef _LIBCPP_CXX03_LANG
950 typedef typename _Sp<_Tp, _A0, _A1, _A2>::template rebind<_Up> type;
951#else
952 typedef typename _Sp<_Tp, _A0, _A1, _A2>::template rebind<_Up>::other type;
953#endif
954};
955
956template <template <class, class, class, class> class _Sp, class _Tp, class _A0,
957 class _A1, class _A2, class _Up>
958struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1, _A2>, _Up, false>
959{
960 typedef _Sp<_Up, _A0, _A1, _A2> type;
961};
962
963#endif // _LIBCPP_HAS_NO_VARIADICS
964
965template <class _Ptr>
966struct _LIBCPP_TEMPLATE_VIS pointer_traits
967{
968 typedef _Ptr pointer;
969 typedef typename __pointer_traits_element_type<pointer>::type element_type;
970 typedef typename __pointer_traits_difference_type<pointer>::type difference_type;
971
972#ifndef _LIBCPP_CXX03_LANG
973 template <class _Up> using rebind = typename __pointer_traits_rebind<pointer, _Up>::type;
974#else
975 template <class _Up> struct rebind
976 {typedef typename __pointer_traits_rebind<pointer, _Up>::type other;};
977#endif // _LIBCPP_CXX03_LANG
978
979private:
980 struct __nat {};
981public:
982 _LIBCPP_INLINE_VISIBILITY
983 static pointer pointer_to(typename conditional<is_void<element_type>::value,
984 __nat, element_type>::type& __r)
985 {return pointer::pointer_to(__r);}
986};
987
988template <class _Tp>
989struct _LIBCPP_TEMPLATE_VIS pointer_traits<_Tp*>
990{
991 typedef _Tp* pointer;
992 typedef _Tp element_type;
993 typedef ptrdiff_t difference_type;
994
995#ifndef _LIBCPP_CXX03_LANG
996 template <class _Up> using rebind = _Up*;
997#else
998 template <class _Up> struct rebind {typedef _Up* other;};
999#endif
1000
1001private:
1002 struct __nat {};
1003public:
1004 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1005 static pointer pointer_to(typename conditional<is_void<element_type>::value,
1006 __nat, element_type>::type& __r) _NOEXCEPT
1007 {return _VSTD::addressof(__r);}
1008};
1009
1010template <class _From, class _To>
1011struct __rebind_pointer {
1012#ifndef _LIBCPP_CXX03_LANG
1013 typedef typename pointer_traits<_From>::template rebind<_To> type;
1014#else
1015 typedef typename pointer_traits<_From>::template rebind<_To>::other type;
1016#endif
1017};
1018
1019// allocator_traits
1020
1021template <class _Tp, class = void>
1022struct __has_pointer_type : false_type {};
1023
1024template <class _Tp>
1025struct __has_pointer_type<_Tp,
1026 typename __void_t<typename _Tp::pointer>::type> : true_type {};
1027
1028namespace __pointer_type_imp
1029{
1030
1031template <class _Tp, class _Dp, bool = __has_pointer_type<_Dp>::value>
1032struct __pointer_type
1033{
1034 typedef _LIBCPP_NODEBUG_TYPE typename _Dp::pointer type;
1035};
1036
1037template <class _Tp, class _Dp>
1038struct __pointer_type<_Tp, _Dp, false>
1039{
1040 typedef _LIBCPP_NODEBUG_TYPE _Tp* type;
1041};
1042
1043} // __pointer_type_imp
1044
1045template <class _Tp, class _Dp>
1046struct __pointer_type
1047{
1048 typedef _LIBCPP_NODEBUG_TYPE typename __pointer_type_imp::__pointer_type<_Tp, typename remove_reference<_Dp>::type>::type type;
1049};
1050
1051template <class _Tp, class = void>
1052struct __has_const_pointer : false_type {};
1053
1054template <class _Tp>
1055struct __has_const_pointer<_Tp,
1056 typename __void_t<typename _Tp::const_pointer>::type> : true_type {};
1057
1058template <class _Tp, class _Ptr, class _Alloc, bool = __has_const_pointer<_Alloc>::value>
1059struct __const_pointer
1060{
1061 typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::const_pointer type;
1062};
1063
1064template <class _Tp, class _Ptr, class _Alloc>
1065struct __const_pointer<_Tp, _Ptr, _Alloc, false>
1066{
1067#ifndef _LIBCPP_CXX03_LANG
1068 typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<const _Tp> type;
1069#else
1070 typedef typename pointer_traits<_Ptr>::template rebind<const _Tp>::other type;
1071#endif
1072};
1073
1074template <class _Tp, class = void>
1075struct __has_void_pointer : false_type {};
1076
1077template <class _Tp>
1078struct __has_void_pointer<_Tp,
1079 typename __void_t<typename _Tp::void_pointer>::type> : true_type {};
1080
1081template <class _Ptr, class _Alloc, bool = __has_void_pointer<_Alloc>::value>
1082struct __void_pointer
1083{
1084 typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::void_pointer type;
1085};
1086
1087template <class _Ptr, class _Alloc>
1088struct __void_pointer<_Ptr, _Alloc, false>
1089{
1090#ifndef _LIBCPP_CXX03_LANG
1091 typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<void> type;
1092#else
1093 typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<void>::other type;
1094#endif
1095};
1096
1097template <class _Tp, class = void>
1098struct __has_const_void_pointer : false_type {};
1099
1100template <class _Tp>
1101struct __has_const_void_pointer<_Tp,
1102 typename __void_t<typename _Tp::const_void_pointer>::type> : true_type {};
1103
1104template <class _Ptr, class _Alloc, bool = __has_const_void_pointer<_Alloc>::value>
1105struct __const_void_pointer
1106{
1107 typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::const_void_pointer type;
1108};
1109
1110template <class _Ptr, class _Alloc>
1111struct __const_void_pointer<_Ptr, _Alloc, false>
1112{
1113#ifndef _LIBCPP_CXX03_LANG
1114 typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<const void> type;
1115#else
1116 typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::template rebind<const void>::other type;
1117#endif
1118};
1119
1120
1121template <bool _UsePointerTraits> struct __to_address_helper;725template <bool _UsePointerTraits> struct __to_address_helper;
1122726
1123template <> struct __to_address_helper<true> {727template <> struct __to_address_helper<true> {
1124 template <class _Pointer>728 template <class _Pointer>
1125 using __return_type = decltype(pointer_traits<_Pointer>::to_address(std::declval<const _Pointer&>()));729 using __return_type = decltype(pointer_traits<_Pointer>::to_address(_VSTD::declval<const _Pointer&>()));
1126730
1127 template <class _Pointer>731 template <class _Pointer>
1128 _LIBCPP_CONSTEXPR732 _LIBCPP_CONSTEXPR
...@@ -1157,7 +761,7 @@ template <> struct __to_address_helper<false> {...@@ -1157,7 +761,7 @@ template <> struct __to_address_helper<false> {
1157 template <class _Pointer>761 template <class _Pointer>
1158 _LIBCPP_CONSTEXPR762 _LIBCPP_CONSTEXPR
1159 static __return_type<_Pointer>763 static __return_type<_Pointer>
1160 __do_it(const _Pointer &__p) _NOEXCEPT { return std::__to_address(__p.operator->()); }764 __do_it(const _Pointer &__p) _NOEXCEPT { return _VSTD::__to_address(__p.operator->()); }
1161};765};
1162766
1163767
...@@ -1172,7 +776,7 @@ to_address(_Tp* __p) _NOEXCEPT...@@ -1172,7 +776,7 @@ to_address(_Tp* __p) _NOEXCEPT
1172}776}
1173777
1174template <class _Pointer>778template <class _Pointer>
1175inline _LIBCPP_INLINE_VISIBILITY779inline _LIBCPP_INLINE_VISIBILITY constexpr
1176auto780auto
1177to_address(const _Pointer& __p) _NOEXCEPT781to_address(const _Pointer& __p) _NOEXCEPT
1178{782{
...@@ -1180,765 +784,287 @@ to_address(const _Pointer& __p) _NOEXCEPT...@@ -1180,765 +784,287 @@ to_address(const _Pointer& __p) _NOEXCEPT
1180}784}
1181#endif785#endif
1182786
1183template <class _Tp, class = void>787template <class _Tp> class allocator;
1184struct __has_size_type : false_type {};
1185
1186template <class _Tp>
1187struct __has_size_type<_Tp,
1188 typename __void_t<typename _Tp::size_type>::type> : true_type {};
1189788
1190template <class _Alloc, class _DiffType, bool = __has_size_type<_Alloc>::value>789#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
1191struct __size_type790template <>
791class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 allocator<void>
1192{792{
1193 typedef _LIBCPP_NODEBUG_TYPE typename make_unsigned<_DiffType>::type type;793public:
1194};794 typedef void* pointer;
795 typedef const void* const_pointer;
796 typedef void value_type;
1195797
1196template <class _Alloc, class _DiffType>798 template <class _Up> struct rebind {typedef allocator<_Up> other;};
1197struct __size_type<_Alloc, _DiffType, true>
1198{
1199 typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::size_type type;
1200};799};
1201800
1202template <class _Tp, class = void>801template <>
1203struct __has_propagate_on_container_copy_assignment : false_type {};802class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 allocator<const void>
1204
1205template <class _Tp>
1206struct __has_propagate_on_container_copy_assignment<_Tp,
1207 typename __void_t<typename _Tp::propagate_on_container_copy_assignment>::type>
1208 : true_type {};
1209
1210template <class _Alloc, bool = __has_propagate_on_container_copy_assignment<_Alloc>::value>
1211struct __propagate_on_container_copy_assignment
1212{803{
1213 typedef _LIBCPP_NODEBUG_TYPE false_type type;804public:
1214};805 typedef const void* pointer;
806 typedef const void* const_pointer;
807 typedef const void value_type;
1215808
1216template <class _Alloc>809 template <class _Up> struct rebind {typedef allocator<_Up> other;};
1217struct __propagate_on_container_copy_assignment<_Alloc, true>
1218{
1219 typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::propagate_on_container_copy_assignment type;
1220};810};
811#endif
1221812
1222template <class _Tp, class = void>813// allocator
1223struct __has_propagate_on_container_move_assignment : false_type {};
1224814
1225template <class _Tp>815template <class _Tp>
1226struct __has_propagate_on_container_move_assignment<_Tp,816class _LIBCPP_TEMPLATE_VIS allocator
1227 typename __void_t<typename _Tp::propagate_on_container_move_assignment>::type>
1228 : true_type {};
1229
1230template <class _Alloc, bool = __has_propagate_on_container_move_assignment<_Alloc>::value>
1231struct __propagate_on_container_move_assignment
1232{817{
1233 typedef false_type type;
1234};
1235
1236template <class _Alloc>
1237struct __propagate_on_container_move_assignment<_Alloc, true>
1238{
1239 typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::propagate_on_container_move_assignment type;
1240};
1241
1242template <class _Tp, class = void>
1243struct __has_propagate_on_container_swap : false_type {};
1244
1245template <class _Tp>
1246struct __has_propagate_on_container_swap<_Tp,
1247 typename __void_t<typename _Tp::propagate_on_container_swap>::type>
1248 : true_type {};
1249
1250template <class _Alloc, bool = __has_propagate_on_container_swap<_Alloc>::value>
1251struct __propagate_on_container_swap
1252{
1253 typedef false_type type;
1254};
1255
1256template <class _Alloc>
1257struct __propagate_on_container_swap<_Alloc, true>
1258{
1259 typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::propagate_on_container_swap type;
1260};
1261
1262template <class _Tp, class = void>
1263struct __has_is_always_equal : false_type {};
1264
1265template <class _Tp>
1266struct __has_is_always_equal<_Tp,
1267 typename __void_t<typename _Tp::is_always_equal>::type>
1268 : true_type {};
1269
1270template <class _Alloc, bool = __has_is_always_equal<_Alloc>::value>
1271struct __is_always_equal
1272{
1273 typedef _LIBCPP_NODEBUG_TYPE typename _VSTD::is_empty<_Alloc>::type type;
1274};
1275
1276template <class _Alloc>
1277struct __is_always_equal<_Alloc, true>
1278{
1279 typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::is_always_equal type;
1280};
1281
1282template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
1283struct __has_rebind_other
1284{
1285private:
1286 struct __two {char __lx; char __lxx;};
1287 template <class _Xp> static __two __test(...);
1288 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
1289 template <class _Xp> static char __test(typename _Xp::template rebind<_Up>::other* = 0);
1290 _LIBCPP_SUPPRESS_DEPRECATED_POP
1291public:818public:
1292 static const bool value = sizeof(__test<_Tp>(0)) == 1;819 typedef size_t size_type;
1293};820 typedef ptrdiff_t difference_type;
1294821 typedef _Tp value_type;
1295template <class _Tp, class _Up>822 typedef true_type propagate_on_container_move_assignment;
1296struct __has_rebind_other<_Tp, _Up, false>823 typedef true_type is_always_equal;
1297{
1298 static const bool value = false;
1299};
1300
1301template <class _Tp, class _Up, bool = __has_rebind_other<_Tp, _Up>::value>
1302struct __allocator_traits_rebind
1303{
1304 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
1305 typedef _LIBCPP_NODEBUG_TYPE typename _Tp::template rebind<_Up>::other type;
1306 _LIBCPP_SUPPRESS_DEPRECATED_POP
1307};
1308
1309template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up>
1310struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, true>
1311{
1312 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
1313 typedef _LIBCPP_NODEBUG_TYPE typename _Alloc<_Tp, _Args...>::template rebind<_Up>::other type;
1314 _LIBCPP_SUPPRESS_DEPRECATED_POP
1315};
1316
1317template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up>
1318struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, false>
1319{
1320 typedef _LIBCPP_NODEBUG_TYPE _Alloc<_Up, _Args...> type;
1321};
1322
1323#ifndef _LIBCPP_CXX03_LANG
1324
1325_LIBCPP_SUPPRESS_DEPRECATED_PUSH
1326template <class _Alloc, class _SizeType, class _ConstVoidPtr>
1327auto
1328__has_allocate_hint_test(_Alloc&& __a, _SizeType&& __sz, _ConstVoidPtr&& __p)
1329 -> decltype((void)__a.allocate(__sz, __p), true_type());
1330_LIBCPP_SUPPRESS_DEPRECATED_POP
1331
1332template <class _Alloc, class _SizeType, class _ConstVoidPtr>
1333auto
1334__has_allocate_hint_test(const _Alloc& __a, _SizeType&& __sz, _ConstVoidPtr&& __p)
1335 -> false_type;
1336
1337template <class _Alloc, class _SizeType, class _ConstVoidPtr>
1338struct __has_allocate_hint
1339 : decltype(_VSTD::__has_allocate_hint_test(declval<_Alloc>(),
1340 declval<_SizeType>(),
1341 declval<_ConstVoidPtr>()))
1342{
1343};
1344
1345#else // _LIBCPP_CXX03_LANG
1346
1347template <class _Alloc, class _SizeType, class _ConstVoidPtr>
1348struct __has_allocate_hint
1349 : true_type
1350{
1351};
1352
1353#endif // _LIBCPP_CXX03_LANG
1354
1355_LIBCPP_SUPPRESS_DEPRECATED_PUSH
1356template <class _Alloc, class ..._Args,
1357 class = decltype(_VSTD::declval<_Alloc>().construct(_VSTD::declval<_Args>()...))>
1358static true_type __test_has_construct(int);
1359_LIBCPP_SUPPRESS_DEPRECATED_POP
1360
1361template <class _Alloc, class...>
1362static false_type __test_has_construct(...);
1363
1364template <class _Alloc, class ..._Args>
1365struct __has_construct : decltype(__test_has_construct<_Alloc, _Args...>(0)) {};
1366
1367#if !defined(_LIBCPP_CXX03_LANG)
1368
1369_LIBCPP_SUPPRESS_DEPRECATED_PUSH
1370template <class _Alloc, class _Pointer>
1371auto
1372__has_destroy_test(_Alloc&& __a, _Pointer&& __p)
1373 -> decltype(__a.destroy(__p), true_type());
1374_LIBCPP_SUPPRESS_DEPRECATED_POP
1375
1376template <class _Alloc, class _Pointer>
1377auto
1378__has_destroy_test(const _Alloc& __a, _Pointer&& __p)
1379 -> false_type;
1380
1381template <class _Alloc, class _Pointer>
1382struct __has_destroy
1383 : decltype(_VSTD::__has_destroy_test(declval<_Alloc>(),
1384 declval<_Pointer>()))
1385{
1386};
1387
1388_LIBCPP_SUPPRESS_DEPRECATED_PUSH
1389template <class _Alloc>
1390auto
1391__has_max_size_test(_Alloc&& __a)
1392 -> decltype(__a.max_size(), true_type());
1393_LIBCPP_SUPPRESS_DEPRECATED_POP
1394
1395template <class _Alloc>
1396auto
1397__has_max_size_test(const volatile _Alloc& __a)
1398 -> false_type;
1399
1400template <class _Alloc>
1401struct __has_max_size
1402 : decltype(_VSTD::__has_max_size_test(declval<_Alloc&>()))
1403{
1404};
1405
1406template <class _Alloc>
1407auto
1408__has_select_on_container_copy_construction_test(_Alloc&& __a)
1409 -> decltype(__a.select_on_container_copy_construction(), true_type());
1410
1411template <class _Alloc>
1412auto
1413__has_select_on_container_copy_construction_test(const volatile _Alloc& __a)
1414 -> false_type;
1415
1416template <class _Alloc>
1417struct __has_select_on_container_copy_construction
1418 : decltype(_VSTD::__has_select_on_container_copy_construction_test(declval<_Alloc&>()))
1419{
1420};
1421
1422#else // _LIBCPP_CXX03_LANG
1423
1424template <class _Alloc, class _Pointer, class = void>
1425struct __has_destroy : false_type {};
1426
1427template <class _Alloc, class _Pointer>
1428struct __has_destroy<_Alloc, _Pointer, typename __void_t<
1429 decltype(_VSTD::declval<_Alloc>().destroy(_VSTD::declval<_Pointer>()))
1430>::type> : std::true_type {};
1431
1432template <class _Alloc>
1433struct __has_max_size
1434 : true_type
1435{
1436};
1437
1438template <class _Alloc>
1439struct __has_select_on_container_copy_construction
1440 : false_type
1441{
1442};
1443
1444#endif // _LIBCPP_CXX03_LANG
1445
1446template <class _Alloc, class _Ptr, bool = __has_difference_type<_Alloc>::value>
1447struct __alloc_traits_difference_type
1448{
1449 typedef _LIBCPP_NODEBUG_TYPE typename pointer_traits<_Ptr>::difference_type type;
1450};
1451
1452template <class _Alloc, class _Ptr>
1453struct __alloc_traits_difference_type<_Alloc, _Ptr, true>
1454{
1455 typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::difference_type type;
1456};
1457
1458template <class _Tp>
1459struct __is_default_allocator : false_type {};
1460
1461template <class _Tp>
1462struct __is_default_allocator<_VSTD::allocator<_Tp> > : true_type {};
1463
1464
1465
1466template <class _Alloc,
1467 bool = __has_construct<_Alloc, typename _Alloc::value_type*, typename _Alloc::value_type&&>::value && !__is_default_allocator<_Alloc>::value
1468 >
1469struct __is_cpp17_move_insertable;
1470template <class _Alloc>
1471struct __is_cpp17_move_insertable<_Alloc, true> : std::true_type {};
1472template <class _Alloc>
1473struct __is_cpp17_move_insertable<_Alloc, false> : std::is_move_constructible<typename _Alloc::value_type> {};
1474
1475template <class _Alloc,
1476 bool = __has_construct<_Alloc, typename _Alloc::value_type*, const typename _Alloc::value_type&>::value && !__is_default_allocator<_Alloc>::value
1477 >
1478struct __is_cpp17_copy_insertable;
1479template <class _Alloc>
1480struct __is_cpp17_copy_insertable<_Alloc, true> : __is_cpp17_move_insertable<_Alloc> {};
1481template <class _Alloc>
1482struct __is_cpp17_copy_insertable<_Alloc, false> : integral_constant<bool,
1483 std::is_copy_constructible<typename _Alloc::value_type>::value &&
1484 __is_cpp17_move_insertable<_Alloc>::value>
1485 {};
1486
1487
1488
1489template <class _Alloc>
1490struct _LIBCPP_TEMPLATE_VIS allocator_traits
1491{
1492 typedef _Alloc allocator_type;
1493 typedef typename allocator_type::value_type value_type;
1494
1495 typedef typename __pointer_type<value_type, allocator_type>::type pointer;
1496 typedef typename __const_pointer<value_type, pointer, allocator_type>::type const_pointer;
1497 typedef typename __void_pointer<pointer, allocator_type>::type void_pointer;
1498 typedef typename __const_void_pointer<pointer, allocator_type>::type const_void_pointer;
1499
1500 typedef typename __alloc_traits_difference_type<allocator_type, pointer>::type difference_type;
1501 typedef typename __size_type<allocator_type, difference_type>::type size_type;
1502
1503 typedef typename __propagate_on_container_copy_assignment<allocator_type>::type
1504 propagate_on_container_copy_assignment;
1505 typedef typename __propagate_on_container_move_assignment<allocator_type>::type
1506 propagate_on_container_move_assignment;
1507 typedef typename __propagate_on_container_swap<allocator_type>::type
1508 propagate_on_container_swap;
1509 typedef typename __is_always_equal<allocator_type>::type
1510 is_always_equal;
1511
1512#ifndef _LIBCPP_CXX03_LANG
1513 template <class _Tp> using rebind_alloc =
1514 typename __allocator_traits_rebind<allocator_type, _Tp>::type;
1515 template <class _Tp> using rebind_traits = allocator_traits<rebind_alloc<_Tp> >;
1516#else // _LIBCPP_CXX03_LANG
1517 template <class _Tp> struct rebind_alloc
1518 {typedef typename __allocator_traits_rebind<allocator_type, _Tp>::type other;};
1519 template <class _Tp> struct rebind_traits
1520 {typedef allocator_traits<typename rebind_alloc<_Tp>::other> other;};
1521#endif // _LIBCPP_CXX03_LANG
1522
1523 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
1524 static pointer allocate(allocator_type& __a, size_type __n)
1525 {return __a.allocate(__n);}
1526 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
1527 static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint)
1528 {return __allocate(__a, __n, __hint,
1529 __has_allocate_hint<allocator_type, size_type, const_void_pointer>());}
1530
1531 _LIBCPP_INLINE_VISIBILITY
1532 static void deallocate(allocator_type& __a, pointer __p, size_type __n) _NOEXCEPT
1533 {__a.deallocate(__p, __n);}
1534
1535 template <class _Tp, class... _Args>
1536 _LIBCPP_INLINE_VISIBILITY
1537 static void construct(allocator_type& __a, _Tp* __p, _Args&&... __args)
1538 {__construct(__has_construct<allocator_type, _Tp*, _Args...>(),
1539 __a, __p, _VSTD::forward<_Args>(__args)...);}
1540
1541 template <class _Tp>
1542 _LIBCPP_INLINE_VISIBILITY
1543 static void destroy(allocator_type& __a, _Tp* __p)
1544 {__destroy(__has_destroy<allocator_type, _Tp*>(), __a, __p);}
1545
1546 _LIBCPP_INLINE_VISIBILITY
1547 static size_type max_size(const allocator_type& __a) _NOEXCEPT
1548 {return __max_size(__has_max_size<const allocator_type>(), __a);}
1549
1550 _LIBCPP_INLINE_VISIBILITY
1551 static allocator_type
1552 select_on_container_copy_construction(const allocator_type& __a)
1553 {return __select_on_container_copy_construction(
1554 __has_select_on_container_copy_construction<const allocator_type>(),
1555 __a);}
1556
1557 template <class _Ptr>
1558 _LIBCPP_INLINE_VISIBILITY
1559 static
1560 void
1561 __construct_forward_with_exception_guarantees(allocator_type& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __begin2)
1562 {
1563 static_assert(__is_cpp17_move_insertable<allocator_type>::value,
1564 "The specified type does not meet the requirements of Cpp17MoveInsertible");
1565 for (; __begin1 != __end1; ++__begin1, (void) ++__begin2)
1566 construct(__a, _VSTD::__to_address(__begin2),
1567#ifdef _LIBCPP_NO_EXCEPTIONS
1568 _VSTD::move(*__begin1)
1569#else
1570 _VSTD::move_if_noexcept(*__begin1)
1571#endif
1572 );
1573 }
1574
1575 template <class _Tp>
1576 _LIBCPP_INLINE_VISIBILITY
1577 static
1578 typename enable_if
1579 <
1580 (__is_default_allocator<allocator_type>::value
1581 || !__has_construct<allocator_type, _Tp*, _Tp>::value) &&
1582 is_trivially_move_constructible<_Tp>::value,
1583 void
1584 >::type
1585 __construct_forward_with_exception_guarantees(allocator_type&, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
1586 {
1587 ptrdiff_t _Np = __end1 - __begin1;
1588 if (_Np > 0)
1589 {
1590 _VSTD::memcpy(__begin2, __begin1, _Np * sizeof(_Tp));
1591 __begin2 += _Np;
1592 }
1593 }
1594
1595 template <class _Iter, class _Ptr>
1596 _LIBCPP_INLINE_VISIBILITY
1597 static
1598 void
1599 __construct_range_forward(allocator_type& __a, _Iter __begin1, _Iter __end1, _Ptr& __begin2)
1600 {
1601 for (; __begin1 != __end1; ++__begin1, (void) ++__begin2)
1602 construct(__a, _VSTD::__to_address(__begin2), *__begin1);
1603 }
1604824
1605 template <class _SourceTp, class _DestTp,825 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1606 class _RawSourceTp = typename remove_const<_SourceTp>::type,826 allocator() _NOEXCEPT { }
1607 class _RawDestTp = typename remove_const<_DestTp>::type>
1608 _LIBCPP_INLINE_VISIBILITY
1609 static
1610 typename enable_if
1611 <
1612 is_trivially_copy_constructible<_DestTp>::value &&
1613 is_same<_RawSourceTp, _RawDestTp>::value &&
1614 (__is_default_allocator<allocator_type>::value ||
1615 !__has_construct<allocator_type, _DestTp*, _SourceTp&>::value),
1616 void
1617 >::type
1618 __construct_range_forward(allocator_type&, _SourceTp* __begin1, _SourceTp* __end1, _DestTp*& __begin2)
1619 {
1620 ptrdiff_t _Np = __end1 - __begin1;
1621 if (_Np > 0)
1622 {
1623 _VSTD::memcpy(const_cast<_RawDestTp*>(__begin2), __begin1, _Np * sizeof(_DestTp));
1624 __begin2 += _Np;
1625 }
1626 }
1627827
1628 template <class _Ptr>828 template <class _Up>
1629 _LIBCPP_INLINE_VISIBILITY829 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1630 static830 allocator(const allocator<_Up>&) _NOEXCEPT { }
1631 void
1632 __construct_backward_with_exception_guarantees(allocator_type& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __end2)
1633 {
1634 static_assert(__is_cpp17_move_insertable<allocator_type>::value,
1635 "The specified type does not meet the requirements of Cpp17MoveInsertable");
1636 while (__end1 != __begin1)
1637 {
1638 construct(__a, _VSTD::__to_address(__end2 - 1),
1639#ifdef _LIBCPP_NO_EXCEPTIONS
1640 _VSTD::move(*--__end1)
1641#else
1642 _VSTD::move_if_noexcept(*--__end1)
1643#endif
1644 );
1645 --__end2;
1646 }
1647 }
1648831
1649 template <class _Tp>832 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1650 _LIBCPP_INLINE_VISIBILITY833 _Tp* allocate(size_t __n) {
1651 static834 if (__n > allocator_traits<allocator>::max_size(*this))
1652 typename enable_if835 __throw_length_error("allocator<T>::allocate(size_t n)"
1653 <836 " 'n' exceeds maximum supported size");
1654 (__is_default_allocator<allocator_type>::value837 if (__libcpp_is_constant_evaluated()) {
1655 || !__has_construct<allocator_type, _Tp*, _Tp>::value) &&838 return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
1656 is_trivially_move_constructible<_Tp>::value,839 } else {
1657 void840 return static_cast<_Tp*>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));
1658 >::type
1659 __construct_backward_with_exception_guarantees(allocator_type&, _Tp* __begin1, _Tp* __end1, _Tp*& __end2)
1660 {
1661 ptrdiff_t _Np = __end1 - __begin1;
1662 __end2 -= _Np;
1663 if (_Np > 0)
1664 _VSTD::memcpy(__end2, __begin1, _Np * sizeof(_Tp));
1665 }841 }
842 }
1666843
1667private:844 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1668845 void deallocate(_Tp* __p, size_t __n) _NOEXCEPT {
1669 _LIBCPP_INLINE_VISIBILITY846 if (__libcpp_is_constant_evaluated()) {
1670 static pointer __allocate(allocator_type& __a, size_type __n,847 ::operator delete(__p);
1671 const_void_pointer __hint, true_type)848 } else {
1672 {849 _VSTD::__libcpp_deallocate((void*)__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
1673 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
1674 return __a.allocate(__n, __hint);
1675 _LIBCPP_SUPPRESS_DEPRECATED_POP
1676 }850 }
1677 _LIBCPP_INLINE_VISIBILITY851 }
1678 static pointer __allocate(allocator_type& __a, size_type __n,
1679 const_void_pointer, false_type)
1680 {return __a.allocate(__n);}
1681852
1682 template <class _Tp, class... _Args>853 // C++20 Removed members
1683 _LIBCPP_INLINE_VISIBILITY854#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
1684 static void __construct(true_type, allocator_type& __a, _Tp* __p, _Args&&... __args)855 _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp* pointer;
1685 {856 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
1686 _LIBCPP_SUPPRESS_DEPRECATED_PUSH857 _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp& reference;
1687 __a.construct(__p, _VSTD::forward<_Args>(__args)...);858 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference;
1688 _LIBCPP_SUPPRESS_DEPRECATED_POP
1689 }
1690859
1691 template <class _Tp, class... _Args>860 template <class _Up>
1692 _LIBCPP_INLINE_VISIBILITY861 struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {
1693 static void __construct(false_type, allocator_type&, _Tp* __p, _Args&&... __args)862 typedef allocator<_Up> other;
1694 {863 };
1695 ::new ((void*)__p) _Tp(_VSTD::forward<_Args>(__args)...);
1696 }
1697864
1698 template <class _Tp>865 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
1699 _LIBCPP_INLINE_VISIBILITY866 pointer address(reference __x) const _NOEXCEPT {
1700 static void __destroy(true_type, allocator_type& __a, _Tp* __p)867 return _VSTD::addressof(__x);
1701 {868 }
1702 _LIBCPP_SUPPRESS_DEPRECATED_PUSH869 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
1703 __a.destroy(__p);870 const_pointer address(const_reference __x) const _NOEXCEPT {
1704 _LIBCPP_SUPPRESS_DEPRECATED_POP871 return _VSTD::addressof(__x);
1705 }872 }
1706 template <class _Tp>
1707 _LIBCPP_INLINE_VISIBILITY
1708 static void __destroy(false_type, allocator_type&, _Tp* __p)
1709 {
1710 __p->~_Tp();
1711 }
1712873
1713 _LIBCPP_INLINE_VISIBILITY874 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17
1714 static size_type __max_size(true_type, const allocator_type& __a) _NOEXCEPT875 _Tp* allocate(size_t __n, const void*) {
1715 {876 return allocate(__n);
1716 _LIBCPP_SUPPRESS_DEPRECATED_PUSH877 }
1717 return __a.max_size();
1718 _LIBCPP_SUPPRESS_DEPRECATED_POP
1719 }
1720878
1721 _LIBCPP_INLINE_VISIBILITY879 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {
1722 static size_type __max_size(false_type, const allocator_type&) _NOEXCEPT880 return size_type(~0) / sizeof(_Tp);
1723 {return numeric_limits<size_type>::max() / sizeof(value_type);}881 }
1724882
1725 _LIBCPP_INLINE_VISIBILITY883 template <class _Up, class... _Args>
1726 static allocator_type884 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
1727 __select_on_container_copy_construction(true_type, const allocator_type& __a)885 void construct(_Up* __p, _Args&&... __args) {
1728 {return __a.select_on_container_copy_construction();}886 ::new ((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
1729 _LIBCPP_INLINE_VISIBILITY887 }
1730 static allocator_type
1731 __select_on_container_copy_construction(false_type, const allocator_type& __a)
1732 {return __a;}
1733};
1734888
1735template <class _Traits, class _Tp>889 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
1736struct __rebind_alloc_helper890 void destroy(pointer __p) {
1737{891 __p->~_Tp();
1738#ifndef _LIBCPP_CXX03_LANG892 }
1739 typedef _LIBCPP_NODEBUG_TYPE typename _Traits::template rebind_alloc<_Tp> type;
1740#else
1741 typedef typename _Traits::template rebind_alloc<_Tp>::other type;
1742#endif893#endif
1743};894};
1744895
1745// allocator
1746
1747template <class _Tp>896template <class _Tp>
1748class _LIBCPP_TEMPLATE_VIS allocator897class _LIBCPP_TEMPLATE_VIS allocator<const _Tp>
1749{898{
1750public:899public:
1751#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)900 typedef size_t size_type;
1752 _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t size_type;901 typedef ptrdiff_t difference_type;
1753 _LIBCPP_DEPRECATED_IN_CXX17 typedef ptrdiff_t difference_type;902 typedef const _Tp value_type;
1754 _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp* pointer;903 typedef true_type propagate_on_container_move_assignment;
1755 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;904 typedef true_type is_always_equal;
1756 _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp& reference;
1757 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference;
1758
1759 template <class _Up> struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {typedef allocator<_Up> other;};
1760#endif
1761
1762 typedef _Tp value_type;
1763
1764 typedef true_type propagate_on_container_move_assignment;
1765 typedef true_type is_always_equal;
1766905
1767 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17906 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1768 allocator() _NOEXCEPT {}907 allocator() _NOEXCEPT { }
1769908
1770 template <class _Up>909 template <class _Up>
1771 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17910 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1772 allocator(const allocator<_Up>&) _NOEXCEPT {}911 allocator(const allocator<_Up>&) _NOEXCEPT { }
1773912
1774#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)913 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1775 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY914 const _Tp* allocate(size_t __n) {
1776 pointer address(reference __x) const _NOEXCEPT915 if (__n > allocator_traits<allocator>::max_size(*this))
1777 {return _VSTD::addressof(__x);}916 __throw_length_error("allocator<const T>::allocate(size_t n)"
1778 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
1779 const_pointer address(const_reference __x) const _NOEXCEPT
1780 {return _VSTD::addressof(__x);}
1781#endif
1782
1783 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _Tp* allocate(size_t __n)
1784 {
1785 // TODO(mpark): Replace with `allocator_traits<allocator>::max_size(*this)`.
1786 if (__n > (size_t(~0) / sizeof(_Tp)))
1787 __throw_length_error("allocator<T>::allocate(size_t n)"
1788 " 'n' exceeds maximum supported size");917 " 'n' exceeds maximum supported size");
1789 return static_cast<_Tp*>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));918 if (__libcpp_is_constant_evaluated()) {
919 return static_cast<const _Tp*>(::operator new(__n * sizeof(_Tp)));
920 } else {
921 return static_cast<const _Tp*>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));
1790 }922 }
923 }
1791924
1792#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)925 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1793 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17926 void deallocate(const _Tp* __p, size_t __n) {
1794 _Tp* allocate(size_t __n, const void*) { return allocate(__n); }927 if (__libcpp_is_constant_evaluated()) {
1795#endif928 ::operator delete(const_cast<_Tp*>(__p));
1796929 } else {
1797 _LIBCPP_INLINE_VISIBILITY void deallocate(_Tp* __p, size_t __n) _NOEXCEPT930 _VSTD::__libcpp_deallocate((void*) const_cast<_Tp *>(__p), __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
1798 {_VSTD::__libcpp_deallocate((void*)__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));}
1799
1800#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
1801 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT
1802 {return size_type(~0) / sizeof(_Tp);}
1803
1804 template <class _Up, class... _Args>
1805 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
1806 void
1807 construct(_Up* __p, _Args&&... __args)
1808 {
1809 ::new((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
1810 }931 }
1811 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}932 }
1812#endif
1813};
1814933
1815template <class _Tp>934 // C++20 Removed members
1816class _LIBCPP_TEMPLATE_VIS allocator<const _Tp>
1817{
1818public:
1819#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)935#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
1820 _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t size_type;
1821 _LIBCPP_DEPRECATED_IN_CXX17 typedef ptrdiff_t difference_type;
1822 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* pointer;936 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* pointer;
1823 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;937 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
1824 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& reference;938 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& reference;
1825 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference;939 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference;
1826940
1827 template <class _Up> struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {typedef allocator<_Up> other;};
1828#endif
1829
1830 typedef const _Tp value_type;
1831
1832 typedef true_type propagate_on_container_move_assignment;
1833 typedef true_type is_always_equal;
1834
1835 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1836 allocator() _NOEXCEPT {}
1837
1838 template <class _Up>941 template <class _Up>
1839 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17942 struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {
1840 allocator(const allocator<_Up>&) _NOEXCEPT {}943 typedef allocator<_Up> other;
944 };
1841945
1842#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
1843 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY946 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
1844 const_pointer address(const_reference __x) const _NOEXCEPT947 const_pointer address(const_reference __x) const _NOEXCEPT {
1845 {return _VSTD::addressof(__x);}948 return _VSTD::addressof(__x);
1846#endif
1847
1848 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY const _Tp* allocate(size_t __n)
1849 {
1850 // TODO(mpark): Replace with `allocator_traits<allocator>::max_size(*this)`.
1851 if (__n > (size_t(~0) / sizeof(_Tp)))
1852 __throw_length_error("allocator<const T>::allocate(size_t n)"
1853 " 'n' exceeds maximum supported size");
1854 return static_cast<const _Tp*>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));
1855 }949 }
1856950
1857#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
1858 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17951 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17
1859 const _Tp* allocate(size_t __n, const void*) { return allocate(__n); }952 const _Tp* allocate(size_t __n, const void*) {
1860#endif953 return allocate(__n);
1861954 }
1862 _LIBCPP_INLINE_VISIBILITY void deallocate(const _Tp* __p, size_t __n)
1863 {_VSTD::__libcpp_deallocate((void*) const_cast<_Tp *>(__p), __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));}
1864955
1865#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)956 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {
1866 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT957 return size_type(~0) / sizeof(_Tp);
1867 {return size_type(~0) / sizeof(_Tp);}958 }
1868959
1869#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
1870 template <class _Up, class... _Args>960 template <class _Up, class... _Args>
1871 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY961 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
1872 void962 void construct(_Up* __p, _Args&&... __args) {
1873 construct(_Up* __p, _Args&&... __args)963 ::new ((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
1874 {964 }
1875 ::new((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
1876 }
1877#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
1878 _LIBCPP_INLINE_VISIBILITY
1879 void
1880 construct(pointer __p)
1881 {
1882 ::new((void*) const_cast<_Tp *>(__p)) _Tp();
1883 }
1884# if defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
1885965
1886 template <class _A0>966 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
1887 _LIBCPP_INLINE_VISIBILITY967 void destroy(pointer __p) {
1888 void968 __p->~_Tp();
1889 construct(pointer __p, _A0& __a0)969 }
1890 {
1891 ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0);
1892 }
1893 template <class _A0>
1894 _LIBCPP_INLINE_VISIBILITY
1895 void
1896 construct(pointer __p, const _A0& __a0)
1897 {
1898 ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0);
1899 }
1900# endif // defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
1901 template <class _A0, class _A1>
1902 _LIBCPP_INLINE_VISIBILITY
1903 void
1904 construct(pointer __p, _A0& __a0, _A1& __a1)
1905 {
1906 ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1);
1907 }
1908 template <class _A0, class _A1>
1909 _LIBCPP_INLINE_VISIBILITY
1910 void
1911 construct(pointer __p, const _A0& __a0, _A1& __a1)
1912 {
1913 ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1);
1914 }
1915 template <class _A0, class _A1>
1916 _LIBCPP_INLINE_VISIBILITY
1917 void
1918 construct(pointer __p, _A0& __a0, const _A1& __a1)
1919 {
1920 ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1);
1921 }
1922 template <class _A0, class _A1>
1923 _LIBCPP_INLINE_VISIBILITY
1924 void
1925 construct(pointer __p, const _A0& __a0, const _A1& __a1)
1926 {
1927 ::new((void*) const_cast<_Tp *>(__p)) _Tp(__a0, __a1);
1928 }
1929#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
1930 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}
1931#endif970#endif
1932};971};
1933972
1934template <class _Tp, class _Up>973template <class _Tp, class _Up>
1935inline _LIBCPP_INLINE_VISIBILITY974inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1936bool operator==(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return true;}975bool operator==(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return true;}
1937976
1938template <class _Tp, class _Up>977template <class _Tp, class _Up>
1939inline _LIBCPP_INLINE_VISIBILITY978inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1940bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;}979bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;}
1941980
981template <class _Alloc, class _Ptr>
982_LIBCPP_INLINE_VISIBILITY
983void __construct_forward_with_exception_guarantees(_Alloc& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __begin2) {
984 static_assert(__is_cpp17_move_insertable<_Alloc>::value,
985 "The specified type does not meet the requirements of Cpp17MoveInsertable");
986 typedef allocator_traits<_Alloc> _Traits;
987 for (; __begin1 != __end1; ++__begin1, (void)++__begin2) {
988 _Traits::construct(__a, _VSTD::__to_address(__begin2),
989#ifdef _LIBCPP_NO_EXCEPTIONS
990 _VSTD::move(*__begin1)
991#else
992 _VSTD::move_if_noexcept(*__begin1)
993#endif
994 );
995 }
996}
997
998template <class _Alloc, class _Tp, typename enable_if<
999 (__is_default_allocator<_Alloc>::value || !__has_construct<_Alloc, _Tp*, _Tp>::value) &&
1000 is_trivially_move_constructible<_Tp>::value
1001>::type>
1002_LIBCPP_INLINE_VISIBILITY
1003void __construct_forward_with_exception_guarantees(_Alloc&, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2) {
1004 ptrdiff_t _Np = __end1 - __begin1;
1005 if (_Np > 0) {
1006 _VSTD::memcpy(__begin2, __begin1, _Np * sizeof(_Tp));
1007 __begin2 += _Np;
1008 }
1009}
1010
1011template <class _Alloc, class _Iter, class _Ptr>
1012_LIBCPP_INLINE_VISIBILITY
1013void __construct_range_forward(_Alloc& __a, _Iter __begin1, _Iter __end1, _Ptr& __begin2) {
1014 typedef allocator_traits<_Alloc> _Traits;
1015 for (; __begin1 != __end1; ++__begin1, (void) ++__begin2) {
1016 _Traits::construct(__a, _VSTD::__to_address(__begin2), *__begin1);
1017 }
1018}
1019
1020template <class _Alloc, class _Source, class _Dest,
1021 class _RawSource = typename remove_const<_Source>::type,
1022 class _RawDest = typename remove_const<_Dest>::type,
1023 class =
1024 typename enable_if<
1025 is_trivially_copy_constructible<_Dest>::value &&
1026 is_same<_RawSource, _RawDest>::value &&
1027 (__is_default_allocator<_Alloc>::value || !__has_construct<_Alloc, _Dest*, _Source&>::value)
1028 >::type>
1029_LIBCPP_INLINE_VISIBILITY
1030void __construct_range_forward(_Alloc&, _Source* __begin1, _Source* __end1, _Dest*& __begin2) {
1031 ptrdiff_t _Np = __end1 - __begin1;
1032 if (_Np > 0) {
1033 _VSTD::memcpy(const_cast<_RawDest*>(__begin2), __begin1, _Np * sizeof(_Dest));
1034 __begin2 += _Np;
1035 }
1036}
1037
1038template <class _Alloc, class _Ptr>
1039_LIBCPP_INLINE_VISIBILITY
1040void __construct_backward_with_exception_guarantees(_Alloc& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __end2) {
1041 static_assert(__is_cpp17_move_insertable<_Alloc>::value,
1042 "The specified type does not meet the requirements of Cpp17MoveInsertable");
1043 typedef allocator_traits<_Alloc> _Traits;
1044 while (__end1 != __begin1) {
1045 _Traits::construct(__a, _VSTD::__to_address(__end2 - 1),
1046#ifdef _LIBCPP_NO_EXCEPTIONS
1047 _VSTD::move(*--__end1)
1048#else
1049 _VSTD::move_if_noexcept(*--__end1)
1050#endif
1051 );
1052 --__end2;
1053 }
1054}
1055
1056template <class _Alloc, class _Tp, class = typename enable_if<
1057 (__is_default_allocator<_Alloc>::value || !__has_construct<_Alloc, _Tp*, _Tp>::value) &&
1058 is_trivially_move_constructible<_Tp>::value
1059>::type>
1060_LIBCPP_INLINE_VISIBILITY
1061void __construct_backward_with_exception_guarantees(_Alloc&, _Tp* __begin1, _Tp* __end1, _Tp*& __end2) {
1062 ptrdiff_t _Np = __end1 - __begin1;
1063 __end2 -= _Np;
1064 if (_Np > 0)
1065 _VSTD::memcpy(__end2, __begin1, _Np * sizeof(_Tp));
1066}
1067
1942template <class _OutputIterator, class _Tp>1068template <class _OutputIterator, class _Tp>
1943class _LIBCPP_TEMPLATE_VIS raw_storage_iterator1069class _LIBCPP_TEMPLATE_VIS raw_storage_iterator
1944 : public iterator<output_iterator_tag,1070 : public iterator<output_iterator_tag,
...@@ -1953,10 +1079,10 @@ public:...@@ -1953,10 +1079,10 @@ public:
1953 _LIBCPP_INLINE_VISIBILITY explicit raw_storage_iterator(_OutputIterator __x) : __x_(__x) {}1079 _LIBCPP_INLINE_VISIBILITY explicit raw_storage_iterator(_OutputIterator __x) : __x_(__x) {}
1954 _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator*() {return *this;}1080 _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator*() {return *this;}
1955 _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(const _Tp& __element)1081 _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(const _Tp& __element)
1956 {::new(_VSTD::addressof(*__x_)) _Tp(__element); return *this;}1082 {::new ((void*)_VSTD::addressof(*__x_)) _Tp(__element); return *this;}
1957#if _LIBCPP_STD_VER >= 141083#if _LIBCPP_STD_VER >= 14
1958 _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(_Tp&& __element)1084 _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(_Tp&& __element)
1959 {::new(_VSTD::addressof(*__x_)) _Tp(_VSTD::move(__element)); return *this;}1085 {::new ((void*)_VSTD::addressof(*__x_)) _Tp(_VSTD::move(__element)); return *this;}
1960#endif1086#endif
1961 _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator++() {++__x_; return *this;}1087 _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator++() {++__x_; return *this;}
1962 _LIBCPP_INLINE_VISIBILITY raw_storage_iterator operator++(int)1088 _LIBCPP_INLINE_VISIBILITY raw_storage_iterator operator++(int)
...@@ -1982,8 +1108,8 @@ get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT...@@ -1982,8 +1108,8 @@ get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT
1982#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)1108#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
1983 if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp)))1109 if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp)))
1984 {1110 {
1985 std::align_val_t __al =1111 align_val_t __al =
1986 std::align_val_t(std::alignment_of<_Tp>::value);1112 align_val_t(alignment_of<_Tp>::value);
1987 __r.first = static_cast<_Tp*>(::operator new(1113 __r.first = static_cast<_Tp*>(::operator new(
1988 __n * sizeof(_Tp), __al, nothrow));1114 __n * sizeof(_Tp), __al, nothrow));
1989 } else {1115 } else {
...@@ -2052,7 +1178,7 @@ public:...@@ -2052,7 +1178,7 @@ public:
2052 _LIBCPP_INLINE_VISIBILITY _Tp* release() _NOEXCEPT1178 _LIBCPP_INLINE_VISIBILITY _Tp* release() _NOEXCEPT
2053 {1179 {
2054 _Tp* __t = __ptr_;1180 _Tp* __t = __ptr_;
2055 __ptr_ = 0;1181 __ptr_ = nullptr;
2056 return __t;1182 return __t;
2057 }1183 }
2058 _LIBCPP_INLINE_VISIBILITY void reset(_Tp* __p = 0) _NOEXCEPT1184 _LIBCPP_INLINE_VISIBILITY void reset(_Tp* __p = 0) _NOEXCEPT
...@@ -2160,19 +1286,19 @@ struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {...@@ -2160,19 +1286,19 @@ struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {
2160template <class _T1, class _T2>1286template <class _T1, class _T2>
2161class __compressed_pair : private __compressed_pair_elem<_T1, 0>,1287class __compressed_pair : private __compressed_pair_elem<_T1, 0>,
2162 private __compressed_pair_elem<_T2, 1> {1288 private __compressed_pair_elem<_T2, 1> {
2163 typedef _LIBCPP_NODEBUG_TYPE __compressed_pair_elem<_T1, 0> _Base1;1289public:
2164 typedef _LIBCPP_NODEBUG_TYPE __compressed_pair_elem<_T2, 1> _Base2;
2165
2166 // NOTE: This static assert should never fire because __compressed_pair1290 // NOTE: This static assert should never fire because __compressed_pair
2167 // is *almost never* used in a scenario where it's possible for T1 == T2.1291 // is *almost never* used in a scenario where it's possible for T1 == T2.
2168 // (The exception is std::function where it is possible that the function1292 // (The exception is std::function where it is possible that the function
2169 // object and the allocator have the same type).1293 // object and the allocator have the same type).
2170 static_assert((!is_same<_T1, _T2>::value),1294 static_assert((!is_same<_T1, _T2>::value),
2171 "__compressed_pair cannot be instantated when T1 and T2 are the same type; "1295 "__compressed_pair cannot be instantiated when T1 and T2 are the same type; "
2172 "The current implementation is NOT ABI-compatible with the previous "1296 "The current implementation is NOT ABI-compatible with the previous "
2173 "implementation for this configuration");1297 "implementation for this configuration");
21741298
2175public:1299 typedef _LIBCPP_NODEBUG_TYPE __compressed_pair_elem<_T1, 0> _Base1;
1300 typedef _LIBCPP_NODEBUG_TYPE __compressed_pair_elem<_T2, 1> _Base2;
1301
2176 template <bool _Dummy = true,1302 template <bool _Dummy = true,
2177 class = typename enable_if<1303 class = typename enable_if<
2178 __dependent_type<is_default_constructible<_T1>, _Dummy>::value &&1304 __dependent_type<is_default_constructible<_T1>, _Dummy>::value &&
...@@ -2185,7 +1311,7 @@ public:...@@ -2185,7 +1311,7 @@ public:
2185 template <class _U1, class _U2>1311 template <class _U1, class _U2>
2186 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR1312 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
2187 __compressed_pair(_U1&& __t1, _U2&& __t2)1313 __compressed_pair(_U1&& __t1, _U2&& __t2)
2188 : _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}1314 : _Base1(_VSTD::forward<_U1>(__t1)), _Base2(_VSTD::forward<_U2>(__t2)) {}
21891315
2190#ifndef _LIBCPP_CXX03_LANG1316#ifndef _LIBCPP_CXX03_LANG
2191 template <class... _Args1, class... _Args2>1317 template <class... _Args1, class... _Args2>
...@@ -2218,12 +1344,21 @@ public:...@@ -2218,12 +1344,21 @@ public:
2218 return static_cast<_Base2 const&>(*this).__get();1344 return static_cast<_Base2 const&>(*this).__get();
2219 }1345 }
22201346
1347 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
1348 static _Base1* __get_first_base(__compressed_pair* __pair) _NOEXCEPT {
1349 return static_cast<_Base1*>(__pair);
1350 }
1351 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
1352 static _Base2* __get_second_base(__compressed_pair* __pair) _NOEXCEPT {
1353 return static_cast<_Base2*>(__pair);
1354 }
1355
2221 _LIBCPP_INLINE_VISIBILITY1356 _LIBCPP_INLINE_VISIBILITY
2222 void swap(__compressed_pair& __x)1357 void swap(__compressed_pair& __x)
2223 _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&1358 _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
2224 __is_nothrow_swappable<_T2>::value)1359 __is_nothrow_swappable<_T2>::value)
2225 {1360 {
2226 using std::swap;1361 using _VSTD::swap;
2227 swap(first(), __x.first());1362 swap(first(), __x.first());
2228 swap(second(), __x.second());1363 swap(second(), __x.second());
2229 }1364 }
...@@ -2316,12 +1451,18 @@ struct __unique_ptr_deleter_sfinae<_Deleter&> {...@@ -2316,12 +1451,18 @@ struct __unique_ptr_deleter_sfinae<_Deleter&> {
2316 typedef false_type __enable_rval_overload;1451 typedef false_type __enable_rval_overload;
2317};1452};
23181453
1454#if defined(_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI)
1455# define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI __attribute__((trivial_abi))
1456#else
1457# define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI
1458#endif
1459
2319template <class _Tp, class _Dp = default_delete<_Tp> >1460template <class _Tp, class _Dp = default_delete<_Tp> >
2320class _LIBCPP_TEMPLATE_VIS unique_ptr {1461class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
2321public:1462public:
2322 typedef _Tp element_type;1463 typedef _Tp element_type;
2323 typedef _Dp deleter_type;1464 typedef _Dp deleter_type;
2324 typedef _LIBCPP_NODEBUG_TYPE typename __pointer_type<_Tp, deleter_type>::type pointer;1465 typedef _LIBCPP_NODEBUG_TYPE typename __pointer<_Tp, deleter_type>::type pointer;
23251466
2326 static_assert(!is_rvalue_reference<deleter_type>::value,1467 static_assert(!is_rvalue_reference<deleter_type>::value,
2327 "the specified deleter type cannot be an rvalue reference");1468 "the specified deleter type cannot be an rvalue reference");
...@@ -2525,11 +1666,11 @@ public:...@@ -2525,11 +1666,11 @@ public:
25251666
25261667
2527template <class _Tp, class _Dp>1668template <class _Tp, class _Dp>
2528class _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {1669class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {
2529public:1670public:
2530 typedef _Tp element_type;1671 typedef _Tp element_type;
2531 typedef _Dp deleter_type;1672 typedef _Dp deleter_type;
2532 typedef typename __pointer_type<_Tp, deleter_type>::type pointer;1673 typedef typename __pointer<_Tp, deleter_type>::type pointer;
25331674
2534private:1675private:
2535 __compressed_pair<pointer, deleter_type> __ptr_;1676 __compressed_pair<pointer, deleter_type> __ptr_;
...@@ -2987,7 +2128,7 @@ public:...@@ -2987,7 +2128,7 @@ public:
2987 : __size_(__s) {}2128 : __size_(__s) {}
29882129
2989 template <class _Tp>2130 template <class _Tp>
2990 _LIBCPP_INLINE_VISIBILITY void __incr(_Tp*) _NOEXCEPT2131 _LIBCPP_INLINE_VISIBILITY void __incr() _NOEXCEPT
2991 {__incr(integral_constant<bool, is_trivially_destructible<_Tp>::value>());}2132 {__incr(integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
29922133
2993 template <class _Tp>2134 template <class _Tp>
...@@ -3029,7 +2170,7 @@ uninitialized_copy(_InputIterator __f, _InputIterator __l, _ForwardIterator __r)...@@ -3029,7 +2170,7 @@ uninitialized_copy(_InputIterator __f, _InputIterator __l, _ForwardIterator __r)
3029 {2170 {
3030#endif2171#endif
3031 for (; __f != __l; ++__f, (void) ++__r)2172 for (; __f != __l; ++__f, (void) ++__r)
3032 ::new (static_cast<void*>(_VSTD::addressof(*__r))) value_type(*__f);2173 ::new ((void*)_VSTD::addressof(*__r)) value_type(*__f);
3033#ifndef _LIBCPP_NO_EXCEPTIONS2174#ifndef _LIBCPP_NO_EXCEPTIONS
3034 }2175 }
3035 catch (...)2176 catch (...)
...@@ -3053,7 +2194,7 @@ uninitialized_copy_n(_InputIterator __f, _Size __n, _ForwardIterator __r)...@@ -3053,7 +2194,7 @@ uninitialized_copy_n(_InputIterator __f, _Size __n, _ForwardIterator __r)
3053 {2194 {
3054#endif2195#endif
3055 for (; __n > 0; ++__f, (void) ++__r, (void) --__n)2196 for (; __n > 0; ++__f, (void) ++__r, (void) --__n)
3056 ::new (static_cast<void*>(_VSTD::addressof(*__r))) value_type(*__f);2197 ::new ((void*)_VSTD::addressof(*__r)) value_type(*__f);
3057#ifndef _LIBCPP_NO_EXCEPTIONS2198#ifndef _LIBCPP_NO_EXCEPTIONS
3058 }2199 }
3059 catch (...)2200 catch (...)
...@@ -3077,7 +2218,7 @@ uninitialized_fill(_ForwardIterator __f, _ForwardIterator __l, const _Tp& __x)...@@ -3077,7 +2218,7 @@ uninitialized_fill(_ForwardIterator __f, _ForwardIterator __l, const _Tp& __x)
3077 {2218 {
3078#endif2219#endif
3079 for (; __f != __l; ++__f)2220 for (; __f != __l; ++__f)
3080 ::new (static_cast<void*>(_VSTD::addressof(*__f))) value_type(__x);2221 ::new ((void*)_VSTD::addressof(*__f)) value_type(__x);
3081#ifndef _LIBCPP_NO_EXCEPTIONS2222#ifndef _LIBCPP_NO_EXCEPTIONS
3082 }2223 }
3083 catch (...)2224 catch (...)
...@@ -3100,7 +2241,7 @@ uninitialized_fill_n(_ForwardIterator __f, _Size __n, const _Tp& __x)...@@ -3100,7 +2241,7 @@ uninitialized_fill_n(_ForwardIterator __f, _Size __n, const _Tp& __x)
3100 {2241 {
3101#endif2242#endif
3102 for (; __n > 0; ++__f, (void) --__n)2243 for (; __n > 0; ++__f, (void) --__n)
3103 ::new (static_cast<void*>(_VSTD::addressof(*__f))) value_type(__x);2244 ::new ((void*)_VSTD::addressof(*__f)) value_type(__x);
3104#ifndef _LIBCPP_NO_EXCEPTIONS2245#ifndef _LIBCPP_NO_EXCEPTIONS
3105 }2246 }
3106 catch (...)2247 catch (...)
...@@ -3115,22 +2256,15 @@ uninitialized_fill_n(_ForwardIterator __f, _Size __n, const _Tp& __x)...@@ -3115,22 +2256,15 @@ uninitialized_fill_n(_ForwardIterator __f, _Size __n, const _Tp& __x)
31152256
3116#if _LIBCPP_STD_VER > 142257#if _LIBCPP_STD_VER > 14
31172258
3118template <class _Tp>
3119inline _LIBCPP_INLINE_VISIBILITY
3120void destroy_at(_Tp* __loc) {
3121 _LIBCPP_ASSERT(__loc, "null pointer given to destroy_at");
3122 __loc->~_Tp();
3123}
3124
3125template <class _ForwardIterator>2259template <class _ForwardIterator>
3126inline _LIBCPP_INLINE_VISIBILITY2260inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3127void destroy(_ForwardIterator __first, _ForwardIterator __last) {2261void destroy(_ForwardIterator __first, _ForwardIterator __last) {
3128 for (; __first != __last; ++__first)2262 for (; __first != __last; ++__first)
3129 _VSTD::destroy_at(_VSTD::addressof(*__first));2263 _VSTD::destroy_at(_VSTD::addressof(*__first));
3130}2264}
31312265
3132template <class _ForwardIterator, class _Size>2266template <class _ForwardIterator, class _Size>
3133inline _LIBCPP_INLINE_VISIBILITY2267inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
3134_ForwardIterator destroy_n(_ForwardIterator __first, _Size __n) {2268_ForwardIterator destroy_n(_ForwardIterator __first, _Size __n) {
3135 for (; __n > 0; (void)++__first, --__n)2269 for (; __n > 0; (void)++__first, --__n)
3136 _VSTD::destroy_at(_VSTD::addressof(*__first));2270 _VSTD::destroy_at(_VSTD::addressof(*__first));
...@@ -3146,7 +2280,7 @@ void uninitialized_default_construct(_ForwardIterator __first, _ForwardIterator...@@ -3146,7 +2280,7 @@ void uninitialized_default_construct(_ForwardIterator __first, _ForwardIterator
3146 try {2280 try {
3147#endif2281#endif
3148 for (; __idx != __last; ++__idx)2282 for (; __idx != __last; ++__idx)
3149 ::new((void*)_VSTD::addressof(*__idx)) _Vt;2283 ::new ((void*)_VSTD::addressof(*__idx)) _Vt;
3150#ifndef _LIBCPP_NO_EXCEPTIONS2284#ifndef _LIBCPP_NO_EXCEPTIONS
3151 } catch (...) {2285 } catch (...) {
3152 _VSTD::destroy(__first, __idx);2286 _VSTD::destroy(__first, __idx);
...@@ -3164,7 +2298,7 @@ _ForwardIterator uninitialized_default_construct_n(_ForwardIterator __first, _Si...@@ -3164,7 +2298,7 @@ _ForwardIterator uninitialized_default_construct_n(_ForwardIterator __first, _Si
3164 try {2298 try {
3165#endif2299#endif
3166 for (; __n > 0; (void)++__idx, --__n)2300 for (; __n > 0; (void)++__idx, --__n)
3167 ::new((void*)_VSTD::addressof(*__idx)) _Vt;2301 ::new ((void*)_VSTD::addressof(*__idx)) _Vt;
3168 return __idx;2302 return __idx;
3169#ifndef _LIBCPP_NO_EXCEPTIONS2303#ifndef _LIBCPP_NO_EXCEPTIONS
3170 } catch (...) {2304 } catch (...) {
...@@ -3184,7 +2318,7 @@ void uninitialized_value_construct(_ForwardIterator __first, _ForwardIterator __...@@ -3184,7 +2318,7 @@ void uninitialized_value_construct(_ForwardIterator __first, _ForwardIterator __
3184 try {2318 try {
3185#endif2319#endif
3186 for (; __idx != __last; ++__idx)2320 for (; __idx != __last; ++__idx)
3187 ::new((void*)_VSTD::addressof(*__idx)) _Vt();2321 ::new ((void*)_VSTD::addressof(*__idx)) _Vt();
3188#ifndef _LIBCPP_NO_EXCEPTIONS2322#ifndef _LIBCPP_NO_EXCEPTIONS
3189 } catch (...) {2323 } catch (...) {
3190 _VSTD::destroy(__first, __idx);2324 _VSTD::destroy(__first, __idx);
...@@ -3202,7 +2336,7 @@ _ForwardIterator uninitialized_value_construct_n(_ForwardIterator __first, _Size...@@ -3202,7 +2336,7 @@ _ForwardIterator uninitialized_value_construct_n(_ForwardIterator __first, _Size
3202 try {2336 try {
3203#endif2337#endif
3204 for (; __n > 0; (void)++__idx, --__n)2338 for (; __n > 0; (void)++__idx, --__n)
3205 ::new((void*)_VSTD::addressof(*__idx)) _Vt();2339 ::new ((void*)_VSTD::addressof(*__idx)) _Vt();
3206 return __idx;2340 return __idx;
3207#ifndef _LIBCPP_NO_EXCEPTIONS2341#ifndef _LIBCPP_NO_EXCEPTIONS
3208 } catch (...) {2342 } catch (...) {
...@@ -3222,7 +2356,7 @@ _ForwardIt uninitialized_move(_InputIt __first, _InputIt __last, _ForwardIt __fi...@@ -3222,7 +2356,7 @@ _ForwardIt uninitialized_move(_InputIt __first, _InputIt __last, _ForwardIt __fi
3222 try {2356 try {
3223#endif2357#endif
3224 for (; __first != __last; (void)++__idx, ++__first)2358 for (; __first != __last; (void)++__idx, ++__first)
3225 ::new((void*)_VSTD::addressof(*__idx)) _Vt(std::move(*__first));2359 ::new ((void*)_VSTD::addressof(*__idx)) _Vt(_VSTD::move(*__first));
3226 return __idx;2360 return __idx;
3227#ifndef _LIBCPP_NO_EXCEPTIONS2361#ifndef _LIBCPP_NO_EXCEPTIONS
3228 } catch (...) {2362 } catch (...) {
...@@ -3242,7 +2376,7 @@ uninitialized_move_n(_InputIt __first, _Size __n, _ForwardIt __first_res) {...@@ -3242,7 +2376,7 @@ uninitialized_move_n(_InputIt __first, _Size __n, _ForwardIt __first_res) {
3242 try {2376 try {
3243#endif2377#endif
3244 for (; __n > 0; ++__idx, (void)++__first, --__n)2378 for (; __n > 0; ++__idx, (void)++__first, --__n)
3245 ::new((void*)_VSTD::addressof(*__idx)) _Vt(std::move(*__first));2379 ::new ((void*)_VSTD::addressof(*__idx)) _Vt(_VSTD::move(*__first));
3246 return {__first, __idx};2380 return {__first, __idx};
3247#ifndef _LIBCPP_NO_EXCEPTIONS2381#ifndef _LIBCPP_NO_EXCEPTIONS
3248 } catch (...) {2382 } catch (...) {
...@@ -3389,13 +2523,7 @@ public:...@@ -3389,13 +2523,7 @@ public:
3389 long use_count() const _NOEXCEPT {return __shared_count::use_count();}2523 long use_count() const _NOEXCEPT {return __shared_count::use_count();}
3390 __shared_weak_count* lock() _NOEXCEPT;2524 __shared_weak_count* lock() _NOEXCEPT;
33912525
3392 // Define the function out only if we build static libc++ without RTTI.
3393 // Otherwise we may break clients who need to compile their projects with
3394 // -fno-rtti and yet link against a libc++.dylib compiled
3395 // without -fno-rtti.
3396#if !defined(_LIBCPP_NO_RTTI) || !defined(_LIBCPP_BUILD_STATIC)
3397 virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;2526 virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
3398#endif
3399private:2527private:
3400 virtual void __on_zero_shared_weak() _NOEXCEPT = 0;2528 virtual void __on_zero_shared_weak() _NOEXCEPT = 0;
3401};2529};
...@@ -3452,69 +2580,86 @@ __shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT...@@ -3452,69 +2580,86 @@ __shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT
3452}2580}
34532581
3454template <class _Tp, class _Alloc>2582template <class _Tp, class _Alloc>
3455class __shared_ptr_emplace2583struct __shared_ptr_emplace
3456 : public __shared_weak_count2584 : __shared_weak_count
3457{2585{
3458 __compressed_pair<_Alloc, _Tp> __data_;2586 template<class ..._Args>
3459public:2587 _LIBCPP_HIDE_FROM_ABI
34602588 explicit __shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
3461 _LIBCPP_INLINE_VISIBILITY2589 : __storage_(_VSTD::move(__a))
3462 __shared_ptr_emplace(_Alloc __a)2590 {
3463 : __data_(_VSTD::move(__a), __value_init_tag()) {}2591#if _LIBCPP_STD_VER > 17
34642592 using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
2593 _TpAlloc __tmp(*__get_alloc());
2594 allocator_traits<_TpAlloc>::construct(__tmp, __get_elem(), _VSTD::forward<_Args>(__args)...);
2595#else
2596 ::new ((void*)__get_elem()) _Tp(_VSTD::forward<_Args>(__args)...);
2597#endif
2598 }
34652599
3466#ifndef _LIBCPP_HAS_NO_VARIADICS2600 _LIBCPP_HIDE_FROM_ABI
3467 template <class ..._Args>2601 _Alloc* __get_alloc() _NOEXCEPT { return __storage_.__get_alloc(); }
3468 _LIBCPP_INLINE_VISIBILITY
3469 __shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
3470 : __data_(piecewise_construct, _VSTD::forward_as_tuple(__a),
3471 _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)) {}
3472#else // _LIBCPP_HAS_NO_VARIADICS
34732602
3474 template <class _A0>2603 _LIBCPP_HIDE_FROM_ABI
3475 _LIBCPP_INLINE_VISIBILITY2604 _Tp* __get_elem() _NOEXCEPT { return __storage_.__get_elem(); }
3476 __shared_ptr_emplace(_Alloc __a, _A0& __a0)
3477 : __data_(__a, _Tp(__a0)) {}
34782605
3479 template <class _A0, class _A1>2606private:
3480 _LIBCPP_INLINE_VISIBILITY2607 virtual void __on_zero_shared() _NOEXCEPT {
3481 __shared_ptr_emplace(_Alloc __a, _A0& __a0, _A1& __a1)2608#if _LIBCPP_STD_VER > 17
3482 : __data_(__a, _Tp(__a0, __a1)) {}2609 using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type;
2610 _TpAlloc __tmp(*__get_alloc());
2611 allocator_traits<_TpAlloc>::destroy(__tmp, __get_elem());
2612#else
2613 __get_elem()->~_Tp();
2614#endif
2615 }
34832616
3484 template <class _A0, class _A1, class _A2>2617 virtual void __on_zero_shared_weak() _NOEXCEPT {
3485 _LIBCPP_INLINE_VISIBILITY2618 using _ControlBlockAlloc = typename __allocator_traits_rebind<_Alloc, __shared_ptr_emplace>::type;
3486 __shared_ptr_emplace(_Alloc __a, _A0& __a0, _A1& __a1, _A2& __a2)2619 using _ControlBlockPointer = typename allocator_traits<_ControlBlockAlloc>::pointer;
3487 : __data_(__a, _Tp(__a0, __a1, __a2)) {}2620 _ControlBlockAlloc __tmp(*__get_alloc());
2621 __storage_.~_Storage();
2622 allocator_traits<_ControlBlockAlloc>::deallocate(__tmp,
2623 pointer_traits<_ControlBlockPointer>::pointer_to(*this), 1);
2624 }
34882625
3489#endif // _LIBCPP_HAS_NO_VARIADICS2626 // This class implements the control block for non-array shared pointers created
2627 // through `std::allocate_shared` and `std::make_shared`.
2628 //
2629 // In previous versions of the library, we used a compressed pair to store
2630 // both the _Alloc and the _Tp. This implies using EBO, which is incompatible
2631 // with Allocator construction for _Tp. To allow implementing P0674 in C++20,
2632 // we now use a properly aligned char buffer while making sure that we maintain
2633 // the same layout that we had when we used a compressed pair.
2634 using _CompressedPair = __compressed_pair<_Alloc, _Tp>;
2635 struct _ALIGNAS_TYPE(_CompressedPair) _Storage {
2636 char __blob_[sizeof(_CompressedPair)];
2637
2638 _LIBCPP_HIDE_FROM_ABI explicit _Storage(_Alloc&& __a) {
2639 ::new ((void*)__get_alloc()) _Alloc(_VSTD::move(__a));
2640 }
2641 _LIBCPP_HIDE_FROM_ABI ~_Storage() {
2642 __get_alloc()->~_Alloc();
2643 }
2644 _Alloc* __get_alloc() _NOEXCEPT {
2645 _CompressedPair *__as_pair = reinterpret_cast<_CompressedPair*>(__blob_);
2646 typename _CompressedPair::_Base1* __first = _CompressedPair::__get_first_base(__as_pair);
2647 _Alloc *__alloc = reinterpret_cast<_Alloc*>(__first);
2648 return __alloc;
2649 }
2650 _LIBCPP_NO_CFI _Tp* __get_elem() _NOEXCEPT {
2651 _CompressedPair *__as_pair = reinterpret_cast<_CompressedPair*>(__blob_);
2652 typename _CompressedPair::_Base2* __second = _CompressedPair::__get_second_base(__as_pair);
2653 _Tp *__elem = reinterpret_cast<_Tp*>(__second);
2654 return __elem;
2655 }
2656 };
34902657
3491private:2658 static_assert(_LIBCPP_ALIGNOF(_Storage) == _LIBCPP_ALIGNOF(_CompressedPair), "");
3492 virtual void __on_zero_shared() _NOEXCEPT;2659 static_assert(sizeof(_Storage) == sizeof(_CompressedPair), "");
3493 virtual void __on_zero_shared_weak() _NOEXCEPT;2660 _Storage __storage_;
3494public:
3495 _LIBCPP_INLINE_VISIBILITY
3496 _Tp* get() _NOEXCEPT {return _VSTD::addressof(__data_.second());}
3497};2661};
34982662
3499template <class _Tp, class _Alloc>
3500void
3501__shared_ptr_emplace<_Tp, _Alloc>::__on_zero_shared() _NOEXCEPT
3502{
3503 __data_.second().~_Tp();
3504}
3505
3506template <class _Tp, class _Alloc>
3507void
3508__shared_ptr_emplace<_Tp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT
3509{
3510 typedef typename __allocator_traits_rebind<_Alloc, __shared_ptr_emplace>::type _Al;
3511 typedef allocator_traits<_Al> _ATraits;
3512 typedef pointer_traits<typename _ATraits::pointer> _PTraits;
3513 _Al __a(__data_.first());
3514 __data_.first().~_Alloc();
3515 __a.deallocate(_PTraits::pointer_to(*this), 1);
3516}
3517
3518struct __shared_ptr_dummy_rebind_allocator_type;2663struct __shared_ptr_dummy_rebind_allocator_type;
3519template <>2664template <>
3520class _LIBCPP_TEMPLATE_VIS allocator<__shared_ptr_dummy_rebind_allocator_type>2665class _LIBCPP_TEMPLATE_VIS allocator<__shared_ptr_dummy_rebind_allocator_type>
...@@ -3537,8 +2682,14 @@ struct __compatible_with...@@ -3537,8 +2682,14 @@ struct __compatible_with
3537 : is_convertible<_Tp*, _Up*> {};2682 : is_convertible<_Tp*, _Up*> {};
3538#endif // _LIBCPP_STD_VER > 142683#endif // _LIBCPP_STD_VER > 14
35392684
2685#if defined(_LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI)
2686# define _LIBCPP_SHARED_PTR_TRIVIAL_ABI __attribute__((trivial_abi))
2687#else
2688# define _LIBCPP_SHARED_PTR_TRIVIAL_ABI
2689#endif
2690
3540template<class _Tp>2691template<class _Tp>
3541class _LIBCPP_TEMPLATE_VIS shared_ptr2692class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
3542{2693{
3543public:2694public:
3544#if _LIBCPP_STD_VER > 142695#if _LIBCPP_STD_VER > 14
...@@ -3577,25 +2728,17 @@ public:...@@ -3577,25 +2728,17 @@ public:
3577 shared_ptr(const shared_ptr<_Yp>& __r,2728 shared_ptr(const shared_ptr<_Yp>& __r,
3578 typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat())2729 typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat())
3579 _NOEXCEPT;2730 _NOEXCEPT;
3580#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
3581 _LIBCPP_INLINE_VISIBILITY2731 _LIBCPP_INLINE_VISIBILITY
3582 shared_ptr(shared_ptr&& __r) _NOEXCEPT;2732 shared_ptr(shared_ptr&& __r) _NOEXCEPT;
3583 template<class _Yp> _LIBCPP_INLINE_VISIBILITY shared_ptr(shared_ptr<_Yp>&& __r,2733 template<class _Yp> _LIBCPP_INLINE_VISIBILITY shared_ptr(shared_ptr<_Yp>&& __r,
3584 typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat())2734 typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat())
3585 _NOEXCEPT;2735 _NOEXCEPT;
3586#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
3587 template<class _Yp> explicit shared_ptr(const weak_ptr<_Yp>& __r,2736 template<class _Yp> explicit shared_ptr(const weak_ptr<_Yp>& __r,
3588 typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type= __nat());2737 typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type= __nat());
3589#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)2738#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
3590#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
3591 template<class _Yp>2739 template<class _Yp>
3592 shared_ptr(auto_ptr<_Yp>&& __r,2740 shared_ptr(auto_ptr<_Yp>&& __r,
3593 typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat());2741 typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat());
3594#else
3595 template<class _Yp>
3596 shared_ptr(auto_ptr<_Yp> __r,
3597 typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat());
3598#endif
3599#endif2742#endif
3600 template <class _Yp, class _Dp>2743 template <class _Yp, class _Dp>
3601 shared_ptr(unique_ptr<_Yp, _Dp>&&,2744 shared_ptr(unique_ptr<_Yp, _Dp>&&,
...@@ -3628,7 +2771,6 @@ public:...@@ -3628,7 +2771,6 @@ public:
3628 >::type2771 >::type
3629 _LIBCPP_INLINE_VISIBILITY2772 _LIBCPP_INLINE_VISIBILITY
3630 operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT;2773 operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT;
3631#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
3632 _LIBCPP_INLINE_VISIBILITY2774 _LIBCPP_INLINE_VISIBILITY
3633 shared_ptr& operator=(shared_ptr&& __r) _NOEXCEPT;2775 shared_ptr& operator=(shared_ptr&& __r) _NOEXCEPT;
3634 template<class _Yp>2776 template<class _Yp>
...@@ -3649,19 +2791,6 @@ public:...@@ -3649,19 +2791,6 @@ public:
3649 shared_ptr2791 shared_ptr
3650 >::type&2792 >::type&
3651 operator=(auto_ptr<_Yp>&& __r);2793 operator=(auto_ptr<_Yp>&& __r);
3652#endif
3653#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
3654#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
3655 template<class _Yp>
3656 _LIBCPP_INLINE_VISIBILITY
3657 typename enable_if
3658 <
3659 !is_array<_Yp>::value &&
3660 is_convertible<_Yp*, element_type*>::value,
3661 shared_ptr&
3662 >::type
3663 operator=(auto_ptr<_Yp> __r);
3664#endif
3665#endif2794#endif
3666 template <class _Yp, class _Dp>2795 template <class _Yp, class _Dp>
3667 typename enable_if2796 typename enable_if
...@@ -3670,13 +2799,8 @@ public:...@@ -3670,13 +2799,8 @@ public:
3670 is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,2799 is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
3671 shared_ptr&2800 shared_ptr&
3672 >::type2801 >::type
3673#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
3674 _LIBCPP_INLINE_VISIBILITY2802 _LIBCPP_INLINE_VISIBILITY
3675 operator=(unique_ptr<_Yp, _Dp>&& __r);2803 operator=(unique_ptr<_Yp, _Dp>&& __r);
3676#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
3677 _LIBCPP_INLINE_VISIBILITY
3678 operator=(unique_ptr<_Yp, _Dp> __r);
3679#endif
36802804
3681 _LIBCPP_INLINE_VISIBILITY2805 _LIBCPP_INLINE_VISIBILITY
3682 void swap(shared_ptr& __r) _NOEXCEPT;2806 void swap(shared_ptr& __r) _NOEXCEPT;
...@@ -3724,7 +2848,7 @@ public:...@@ -3724,7 +2848,7 @@ public:
3724 _LIBCPP_INLINE_VISIBILITY2848 _LIBCPP_INLINE_VISIBILITY
3725 bool unique() const _NOEXCEPT {return use_count() == 1;}2849 bool unique() const _NOEXCEPT {return use_count() == 1;}
3726 _LIBCPP_INLINE_VISIBILITY2850 _LIBCPP_INLINE_VISIBILITY
3727 _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {return get() != 0;}2851 _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {return get() != nullptr;}
3728 template <class _Up>2852 template <class _Up>
3729 _LIBCPP_INLINE_VISIBILITY2853 _LIBCPP_INLINE_VISIBILITY
3730 bool owner_before(shared_ptr<_Up> const& __p) const _NOEXCEPT2854 bool owner_before(shared_ptr<_Up> const& __p) const _NOEXCEPT
...@@ -3828,8 +2952,8 @@ template<class _Tp>...@@ -3828,8 +2952,8 @@ template<class _Tp>
3828inline2952inline
3829_LIBCPP_CONSTEXPR2953_LIBCPP_CONSTEXPR
3830shared_ptr<_Tp>::shared_ptr() _NOEXCEPT2954shared_ptr<_Tp>::shared_ptr() _NOEXCEPT
3831 : __ptr_(0),2955 : __ptr_(nullptr),
3832 __cntrl_(0)2956 __cntrl_(nullptr)
3833{2957{
3834}2958}
38352959
...@@ -3837,8 +2961,8 @@ template<class _Tp>...@@ -3837,8 +2961,8 @@ template<class _Tp>
3837inline2961inline
3838_LIBCPP_CONSTEXPR2962_LIBCPP_CONSTEXPR
3839shared_ptr<_Tp>::shared_ptr(nullptr_t) _NOEXCEPT2963shared_ptr<_Tp>::shared_ptr(nullptr_t) _NOEXCEPT
3840 : __ptr_(0),2964 : __ptr_(nullptr),
3841 __cntrl_(0)2965 __cntrl_(nullptr)
3842{2966{
3843}2967}
38442968
...@@ -3883,7 +3007,7 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d,...@@ -3883,7 +3007,7 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d,
3883template<class _Tp>3007template<class _Tp>
3884template<class _Dp>3008template<class _Dp>
3885shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d)3009shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d)
3886 : __ptr_(0)3010 : __ptr_(nullptr)
3887{3011{
3888#ifndef _LIBCPP_NO_EXCEPTIONS3012#ifndef _LIBCPP_NO_EXCEPTIONS
3889 try3013 try
...@@ -3917,8 +3041,7 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d, _Alloc __a,...@@ -3917,8 +3041,7 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d, _Alloc __a,
3917 typedef __allocator_destructor<_A2> _D2;3041 typedef __allocator_destructor<_A2> _D2;
3918 _A2 __a2(__a);3042 _A2 __a2(__a);
3919 unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));3043 unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
3920 ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))3044 ::new ((void*)_VSTD::addressof(*__hold2.get())) _CntrlBlk(__p, __d, __a);
3921 _CntrlBlk(__p, __d, __a);
3922 __cntrl_ = _VSTD::addressof(*__hold2.release());3045 __cntrl_ = _VSTD::addressof(*__hold2.release());
3923 __enable_weak_this(__p, __p);3046 __enable_weak_this(__p, __p);
3924#ifndef _LIBCPP_NO_EXCEPTIONS3047#ifndef _LIBCPP_NO_EXCEPTIONS
...@@ -3934,7 +3057,7 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d, _Alloc __a,...@@ -3934,7 +3057,7 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d, _Alloc __a,
3934template<class _Tp>3057template<class _Tp>
3935template<class _Dp, class _Alloc>3058template<class _Dp, class _Alloc>
3936shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a)3059shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a)
3937 : __ptr_(0)3060 : __ptr_(nullptr)
3938{3061{
3939#ifndef _LIBCPP_NO_EXCEPTIONS3062#ifndef _LIBCPP_NO_EXCEPTIONS
3940 try3063 try
...@@ -3945,8 +3068,7 @@ shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a)...@@ -3945,8 +3068,7 @@ shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a)
3945 typedef __allocator_destructor<_A2> _D2;3068 typedef __allocator_destructor<_A2> _D2;
3946 _A2 __a2(__a);3069 _A2 __a2(__a);
3947 unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));3070 unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
3948 ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))3071 ::new ((void*)_VSTD::addressof(*__hold2.get())) _CntrlBlk(__p, __d, __a);
3949 _CntrlBlk(__p, __d, __a);
3950 __cntrl_ = _VSTD::addressof(*__hold2.release());3072 __cntrl_ = _VSTD::addressof(*__hold2.release());
3951#ifndef _LIBCPP_NO_EXCEPTIONS3073#ifndef _LIBCPP_NO_EXCEPTIONS
3952 }3074 }
...@@ -3992,16 +3114,14 @@ shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r,...@@ -3992,16 +3114,14 @@ shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r,
3992 __cntrl_->__add_shared();3114 __cntrl_->__add_shared();
3993}3115}
39943116
3995#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
3996
3997template<class _Tp>3117template<class _Tp>
3998inline3118inline
3999shared_ptr<_Tp>::shared_ptr(shared_ptr&& __r) _NOEXCEPT3119shared_ptr<_Tp>::shared_ptr(shared_ptr&& __r) _NOEXCEPT
4000 : __ptr_(__r.__ptr_),3120 : __ptr_(__r.__ptr_),
4001 __cntrl_(__r.__cntrl_)3121 __cntrl_(__r.__cntrl_)
4002{3122{
4003 __r.__ptr_ = 0;3123 __r.__ptr_ = nullptr;
4004 __r.__cntrl_ = 0;3124 __r.__cntrl_ = nullptr;
4005}3125}
40063126
4007template<class _Tp>3127template<class _Tp>
...@@ -4013,20 +3133,14 @@ shared_ptr<_Tp>::shared_ptr(shared_ptr<_Yp>&& __r,...@@ -4013,20 +3133,14 @@ shared_ptr<_Tp>::shared_ptr(shared_ptr<_Yp>&& __r,
4013 : __ptr_(__r.__ptr_),3133 : __ptr_(__r.__ptr_),
4014 __cntrl_(__r.__cntrl_)3134 __cntrl_(__r.__cntrl_)
4015{3135{
4016 __r.__ptr_ = 0;3136 __r.__ptr_ = nullptr;
4017 __r.__cntrl_ = 0;3137 __r.__cntrl_ = nullptr;
4018}3138}
40193139
4020#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4021
4022#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)3140#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
4023template<class _Tp>3141template<class _Tp>
4024template<class _Yp>3142template<class _Yp>
4025#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4026shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp>&& __r,3143shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp>&& __r,
4027#else
4028shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp> __r,
4029#endif
4030 typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type)3144 typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type)
4031 : __ptr_(__r.get())3145 : __ptr_(__r.get())
4032{3146{
...@@ -4121,8 +3235,6 @@ shared_ptr<_Tp>::operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT...@@ -4121,8 +3235,6 @@ shared_ptr<_Tp>::operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT
4121 return *this;3235 return *this;
4122}3236}
41233237
4124#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4125
4126template<class _Tp>3238template<class _Tp>
4127inline3239inline
4128shared_ptr<_Tp>&3240shared_ptr<_Tp>&
...@@ -4179,43 +3291,6 @@ shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp>&& __r)...@@ -4179,43 +3291,6 @@ shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp>&& __r)
4179 return *this;3291 return *this;
4180}3292}
41813293
4182#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4183
4184#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
4185template<class _Tp>
4186template<class _Yp>
4187inline _LIBCPP_INLINE_VISIBILITY
4188typename enable_if
4189<
4190 !is_array<_Yp>::value &&
4191 is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
4192 shared_ptr<_Tp>&
4193>::type
4194shared_ptr<_Tp>::operator=(auto_ptr<_Yp> __r)
4195{
4196 shared_ptr(__r).swap(*this);
4197 return *this;
4198}
4199#endif
4200
4201template<class _Tp>
4202template <class _Yp, class _Dp>
4203inline _LIBCPP_INLINE_VISIBILITY
4204typename enable_if
4205<
4206 !is_array<_Yp>::value &&
4207 is_convertible<typename unique_ptr<_Yp, _Dp>::pointer,
4208 typename shared_ptr<_Tp>::element_type*>::value,
4209 shared_ptr<_Tp>&
4210>::type
4211shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp> __r)
4212{
4213 shared_ptr(_VSTD::move(__r)).swap(*this);
4214 return *this;
4215}
4216
4217#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4218
4219template<class _Tp>3294template<class _Tp>
4220inline3295inline
4221void3296void
...@@ -4272,50 +3347,26 @@ shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d, _Alloc __a)...@@ -4272,50 +3347,26 @@ shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d, _Alloc __a)
4272 shared_ptr(__p, __d, __a).swap(*this);3347 shared_ptr(__p, __d, __a).swap(*this);
4273}3348}
42743349
4275template<class _Tp, class ..._Args>3350//
4276inline _LIBCPP_INLINE_VISIBILITY3351// std::allocate_shared and std::make_shared
4277typename enable_if3352//
4278<3353template<class _Tp, class _Alloc, class ..._Args, class = _EnableIf<!is_array<_Tp>::value> >
4279 !is_array<_Tp>::value,3354_LIBCPP_HIDE_FROM_ABI
4280 shared_ptr<_Tp>3355shared_ptr<_Tp> allocate_shared(const _Alloc& __a, _Args&& ...__args)
4281>::type
4282make_shared(_Args&& ...__args)
4283{3356{
4284 static_assert(is_constructible<_Tp, _Args...>::value, "Can't construct object in make_shared");3357 using _ControlBlock = __shared_ptr_emplace<_Tp, _Alloc>;
4285 typedef __shared_ptr_emplace<_Tp, allocator<_Tp> > _CntrlBlk;3358 using _ControlBlockAllocator = typename __allocator_traits_rebind<_Alloc, _ControlBlock>::type;
4286 typedef allocator<_CntrlBlk> _A2;3359 __allocation_guard<_ControlBlockAllocator> __guard(__a, 1);
4287 typedef __allocator_destructor<_A2> _D2;3360 ::new ((void*)_VSTD::addressof(*__guard.__get())) _ControlBlock(__a, _VSTD::forward<_Args>(__args)...);
42883361 auto __control_block = __guard.__release_ptr();
4289 _A2 __a2;3362 return shared_ptr<_Tp>::__create_with_control_block((*__control_block).__get_elem(), _VSTD::addressof(*__control_block));
4290 unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
4291 ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
4292
4293 _Tp *__ptr = __hold2.get()->get();
4294 return shared_ptr<_Tp>::__create_with_control_block(__ptr, __hold2.release());
4295}3363}
42963364
4297template<class _Tp, class _Alloc, class ..._Args>3365template<class _Tp, class ..._Args, class = _EnableIf<!is_array<_Tp>::value> >
4298inline _LIBCPP_INLINE_VISIBILITY3366_LIBCPP_HIDE_FROM_ABI
4299typename enable_if3367shared_ptr<_Tp> make_shared(_Args&& ...__args)
4300<
4301 !is_array<_Tp>::value,
4302 shared_ptr<_Tp>
4303>::type
4304allocate_shared(const _Alloc& __a, _Args&& ...__args)
4305{3368{
4306 static_assert( is_constructible<_Tp, _Args...>::value, "Can't construct object in allocate_shared");3369 return _VSTD::allocate_shared<_Tp>(allocator<_Tp>(), _VSTD::forward<_Args>(__args)...);
4307
4308 typedef __shared_ptr_emplace<_Tp, _Alloc> _CntrlBlk;
4309 typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
4310 typedef __allocator_destructor<_A2> _D2;
4311
4312 _A2 __a2(__a);
4313 unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
4314 ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))
4315 _CntrlBlk(__a, _VSTD::forward<_Args>(__args)...);
4316
4317 typename shared_ptr<_Tp>::element_type *__p = __hold2.get()->get();
4318 return shared_ptr<_Tp>::__create_with_control_block(__p, _VSTD::addressof(*__hold2.release()));
4319}3370}
43203371
4321template<class _Tp, class _Up>3372template<class _Tp, class _Up>
...@@ -4526,7 +3577,7 @@ get_deleter(const shared_ptr<_Tp>& __p) _NOEXCEPT...@@ -4526,7 +3577,7 @@ get_deleter(const shared_ptr<_Tp>& __p) _NOEXCEPT
4526#endif // _LIBCPP_NO_RTTI3577#endif // _LIBCPP_NO_RTTI
45273578
4528template<class _Tp>3579template<class _Tp>
4529class _LIBCPP_TEMPLATE_VIS weak_ptr3580class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr
4530{3581{
4531public:3582public:
4532 typedef _Tp element_type;3583 typedef _Tp element_type;
...@@ -4546,13 +3597,11 @@ public:...@@ -4546,13 +3597,11 @@ public:
4546 typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)3597 typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
4547 _NOEXCEPT;3598 _NOEXCEPT;
45483599
4549#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4550 _LIBCPP_INLINE_VISIBILITY3600 _LIBCPP_INLINE_VISIBILITY
4551 weak_ptr(weak_ptr&& __r) _NOEXCEPT;3601 weak_ptr(weak_ptr&& __r) _NOEXCEPT;
4552 template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r,3602 template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r,
4553 typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)3603 typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
4554 _NOEXCEPT;3604 _NOEXCEPT;
4555#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4556 ~weak_ptr();3605 ~weak_ptr();
45573606
4558 _LIBCPP_INLINE_VISIBILITY3607 _LIBCPP_INLINE_VISIBILITY
...@@ -4566,8 +3615,6 @@ public:...@@ -4566,8 +3615,6 @@ public:
4566 _LIBCPP_INLINE_VISIBILITY3615 _LIBCPP_INLINE_VISIBILITY
4567 operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT;3616 operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT;
45683617
4569#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4570
4571 _LIBCPP_INLINE_VISIBILITY3618 _LIBCPP_INLINE_VISIBILITY
4572 weak_ptr& operator=(weak_ptr&& __r) _NOEXCEPT;3619 weak_ptr& operator=(weak_ptr&& __r) _NOEXCEPT;
4573 template<class _Yp>3620 template<class _Yp>
...@@ -4579,8 +3626,6 @@ public:...@@ -4579,8 +3626,6 @@ public:
4579 _LIBCPP_INLINE_VISIBILITY3626 _LIBCPP_INLINE_VISIBILITY
4580 operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT;3627 operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT;
45813628
4582#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4583
4584 template<class _Yp>3629 template<class _Yp>
4585 typename enable_if3630 typename enable_if
4586 <3631 <
...@@ -4600,7 +3645,7 @@ public:...@@ -4600,7 +3645,7 @@ public:
4600 {return __cntrl_ ? __cntrl_->use_count() : 0;}3645 {return __cntrl_ ? __cntrl_->use_count() : 0;}
4601 _LIBCPP_INLINE_VISIBILITY3646 _LIBCPP_INLINE_VISIBILITY
4602 bool expired() const _NOEXCEPT3647 bool expired() const _NOEXCEPT
4603 {return __cntrl_ == 0 || __cntrl_->use_count() == 0;}3648 {return __cntrl_ == nullptr || __cntrl_->use_count() == 0;}
4604 shared_ptr<_Tp> lock() const _NOEXCEPT;3649 shared_ptr<_Tp> lock() const _NOEXCEPT;
4605 template<class _Up>3650 template<class _Up>
4606 _LIBCPP_INLINE_VISIBILITY3651 _LIBCPP_INLINE_VISIBILITY
...@@ -4624,8 +3669,8 @@ template<class _Tp>...@@ -4624,8 +3669,8 @@ template<class _Tp>
4624inline3669inline
4625_LIBCPP_CONSTEXPR3670_LIBCPP_CONSTEXPR
4626weak_ptr<_Tp>::weak_ptr() _NOEXCEPT3671weak_ptr<_Tp>::weak_ptr() _NOEXCEPT
4627 : __ptr_(0),3672 : __ptr_(nullptr),
4628 __cntrl_(0)3673 __cntrl_(nullptr)
4629{3674{
4630}3675}
46313676
...@@ -4665,16 +3710,14 @@ weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp> const& __r,...@@ -4665,16 +3710,14 @@ weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp> const& __r,
4665 __cntrl_->__add_weak();3710 __cntrl_->__add_weak();
4666}3711}
46673712
4668#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4669
4670template<class _Tp>3713template<class _Tp>
4671inline3714inline
4672weak_ptr<_Tp>::weak_ptr(weak_ptr&& __r) _NOEXCEPT3715weak_ptr<_Tp>::weak_ptr(weak_ptr&& __r) _NOEXCEPT
4673 : __ptr_(__r.__ptr_),3716 : __ptr_(__r.__ptr_),
4674 __cntrl_(__r.__cntrl_)3717 __cntrl_(__r.__cntrl_)
4675{3718{
4676 __r.__ptr_ = 0;3719 __r.__ptr_ = nullptr;
4677 __r.__cntrl_ = 0;3720 __r.__cntrl_ = nullptr;
4678}3721}
46793722
4680template<class _Tp>3723template<class _Tp>
...@@ -4686,12 +3729,10 @@ weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp>&& __r,...@@ -4686,12 +3729,10 @@ weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp>&& __r,
4686 : __ptr_(__r.__ptr_),3729 : __ptr_(__r.__ptr_),
4687 __cntrl_(__r.__cntrl_)3730 __cntrl_(__r.__cntrl_)
4688{3731{
4689 __r.__ptr_ = 0;3732 __r.__ptr_ = nullptr;
4690 __r.__cntrl_ = 0;3733 __r.__cntrl_ = nullptr;
4691}3734}
46923735
4693#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4694
4695template<class _Tp>3736template<class _Tp>
4696weak_ptr<_Tp>::~weak_ptr()3737weak_ptr<_Tp>::~weak_ptr()
4697{3738{
...@@ -4722,8 +3763,6 @@ weak_ptr<_Tp>::operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT...@@ -4722,8 +3763,6 @@ weak_ptr<_Tp>::operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT
4722 return *this;3763 return *this;
4723}3764}
47243765
4725#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4726
4727template<class _Tp>3766template<class _Tp>
4728inline3767inline
4729weak_ptr<_Tp>&3768weak_ptr<_Tp>&
...@@ -4747,8 +3786,6 @@ weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT...@@ -4747,8 +3786,6 @@ weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT
4747 return *this;3786 return *this;
4748}3787}
47493788
4750#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4751
4752template<class _Tp>3789template<class _Tp>
4753template<class _Yp>3790template<class _Yp>
4754inline3791inline
...@@ -4795,7 +3832,7 @@ shared_ptr<_Tp>::shared_ptr(const weak_ptr<_Yp>& __r,...@@ -4795,7 +3832,7 @@ shared_ptr<_Tp>::shared_ptr(const weak_ptr<_Yp>& __r,
4795 : __ptr_(__r.__ptr_),3832 : __ptr_(__r.__ptr_),
4796 __cntrl_(__r.__cntrl_ ? __r.__cntrl_->lock() : __r.__cntrl_)3833 __cntrl_(__r.__cntrl_ ? __r.__cntrl_->lock() : __r.__cntrl_)
4797{3834{
4798 if (__cntrl_ == 0)3835 if (__cntrl_ == nullptr)
4799 __throw_bad_weak_ptr();3836 __throw_bad_weak_ptr();
4800}3837}
48013838
...@@ -5130,35 +4167,35 @@ _LIBCPP_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t&...@@ -5130,35 +4167,35 @@ _LIBCPP_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t&
51304167
5131// --- Helper for container swap --4168// --- Helper for container swap --
5132template <typename _Alloc>4169template <typename _Alloc>
5133inline _LIBCPP_INLINE_VISIBILITY4170_LIBCPP_INLINE_VISIBILITY
5134void __swap_allocator(_Alloc & __a1, _Alloc & __a2)4171void __swap_allocator(_Alloc & __a1, _Alloc & __a2, true_type)
5135#if _LIBCPP_STD_VER >= 144172#if _LIBCPP_STD_VER >= 14
5136 _NOEXCEPT4173 _NOEXCEPT
5137#else4174#else
5138 _NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)4175 _NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
5139#endif4176#endif
5140{4177{
5141 __swap_allocator(__a1, __a2,4178 using _VSTD::swap;
5142 integral_constant<bool, _VSTD::allocator_traits<_Alloc>::propagate_on_container_swap::value>());4179 swap(__a1, __a2);
5143}4180}
51444181
5145template <typename _Alloc>4182template <typename _Alloc>
5146_LIBCPP_INLINE_VISIBILITY4183inline _LIBCPP_INLINE_VISIBILITY
5147void __swap_allocator(_Alloc & __a1, _Alloc & __a2, true_type)4184void __swap_allocator(_Alloc &, _Alloc &, false_type) _NOEXCEPT {}
4185
4186template <typename _Alloc>
4187inline _LIBCPP_INLINE_VISIBILITY
4188void __swap_allocator(_Alloc & __a1, _Alloc & __a2)
5148#if _LIBCPP_STD_VER >= 144189#if _LIBCPP_STD_VER >= 14
5149 _NOEXCEPT4190 _NOEXCEPT
5150#else4191#else
5151 _NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)4192 _NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
5152#endif4193#endif
5153{4194{
5154 using _VSTD::swap;4195 _VSTD::__swap_allocator(__a1, __a2,
5155 swap(__a1, __a2);4196 integral_constant<bool, _VSTD::allocator_traits<_Alloc>::propagate_on_container_swap::value>());
5156}4197}
51574198
5158template <typename _Alloc>
5159inline _LIBCPP_INLINE_VISIBILITY
5160void __swap_allocator(_Alloc &, _Alloc &, false_type) _NOEXCEPT {}
5161
5162template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >4199template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >
5163struct __noexcept_move_assign_container : public integral_constant<bool,4200struct __noexcept_move_assign_container : public integral_constant<bool,
5164 _Traits::propagate_on_container_move_assignment::value4201 _Traits::propagate_on_container_move_assignment::value
...@@ -5170,7 +4207,6 @@ struct __noexcept_move_assign_container : public integral_constant<bool,...@@ -5170,7 +4207,6 @@ struct __noexcept_move_assign_container : public integral_constant<bool,
5170 > {};4207 > {};
51714208
51724209
5173#ifndef _LIBCPP_HAS_NO_VARIADICS
5174template <class _Tp, class _Alloc>4210template <class _Tp, class _Alloc>
5175struct __temp_value {4211struct __temp_value {
5176 typedef allocator_traits<_Alloc> _Traits;4212 typedef allocator_traits<_Alloc> _Traits;
...@@ -5190,7 +4226,6 @@ struct __temp_value {...@@ -5190,7 +4226,6 @@ struct __temp_value {
51904226
5191 ~__temp_value() { _Traits::destroy(__a, __addr()); }4227 ~__temp_value() { _Traits::destroy(__a, __addr()); }
5192 };4228 };
5193#endif
51944229
5195template<typename _Alloc, typename = void, typename = void>4230template<typename _Alloc, typename = void, typename = void>
5196struct __is_allocator : false_type {};4231struct __is_allocator : false_type {};
...@@ -5214,7 +4249,7 @@ struct __builtin_new_allocator {...@@ -5214,7 +4249,7 @@ struct __builtin_new_allocator {
5214 : __size_(__size), __align_(__align) {}4249 : __size_(__size), __align_(__align) {}
52154250
5216 void operator()(void* p) const _NOEXCEPT {4251 void operator()(void* p) const _NOEXCEPT {
5217 std::__libcpp_deallocate(p, __size_, __align_);4252 _VSTD::__libcpp_deallocate(p, __size_, __align_);
5218 }4253 }
52194254
5220 private:4255 private:
...@@ -5225,13 +4260,13 @@ struct __builtin_new_allocator {...@@ -5225,13 +4260,13 @@ struct __builtin_new_allocator {
5225 typedef unique_ptr<void, __builtin_new_deleter> __holder_t;4260 typedef unique_ptr<void, __builtin_new_deleter> __holder_t;
52264261
5227 static __holder_t __allocate_bytes(size_t __s, size_t __align) {4262 static __holder_t __allocate_bytes(size_t __s, size_t __align) {
5228 return __holder_t(std::__libcpp_allocate(__s, __align),4263 return __holder_t(_VSTD::__libcpp_allocate(__s, __align),
5229 __builtin_new_deleter(__s, __align));4264 __builtin_new_deleter(__s, __align));
5230 }4265 }
52314266
5232 static void __deallocate_bytes(void* __p, size_t __s,4267 static void __deallocate_bytes(void* __p, size_t __s,
5233 size_t __align) _NOEXCEPT {4268 size_t __align) _NOEXCEPT {
5234 std::__libcpp_deallocate(__p, __s, __align);4269 _VSTD::__libcpp_deallocate(__p, __s, __align);
5235 }4270 }
52364271
5237 template <class _Tp>4272 template <class _Tp>
lib/libcxx/include/module.modulemap+1
...@@ -522,6 +522,7 @@ module std [system] {...@@ -522,6 +522,7 @@ module std [system] {
522 }522 }
523523
524 // FIXME: These should be private.524 // FIXME: These should be private.
525 module __bits { header "__bits" export * }
525 module __bit_reference { header "__bit_reference" export * }526 module __bit_reference { header "__bit_reference" export * }
526 module __debug { header "__debug" export * }527 module __debug { header "__debug" export * }
527 module __errc { header "__errc" export * }528 module __errc { header "__errc" export * }
lib/libcxx/include/mutex+1-1
...@@ -626,7 +626,7 @@ private:...@@ -626,7 +626,7 @@ private:
626 _LIBCPP_INLINE_VISIBILITY626 _LIBCPP_INLINE_VISIBILITY
627 void __execute(__tuple_indices<_Indices...>)627 void __execute(__tuple_indices<_Indices...>)
628 {628 {
629 __invoke(_VSTD::get<0>(_VSTD::move(__f_)), _VSTD::get<_Indices>(_VSTD::move(__f_))...);629 _VSTD::__invoke(_VSTD::get<0>(_VSTD::move(__f_)), _VSTD::get<_Indices>(_VSTD::move(__f_))...);
630 }630 }
631};631};
632632
lib/libcxx/include/new+80-93
...@@ -49,11 +49,11 @@ new_handler get_new_handler() noexcept;...@@ -49,11 +49,11 @@ new_handler get_new_handler() noexcept;
49template <class T> constexpr T* launder(T* p) noexcept; // C++1749template <class T> constexpr T* launder(T* p) noexcept; // C++17
50} // std50} // std
5151
52void* operator new(std::size_t size); // replaceable, nodiscard in C++2a52void* operator new(std::size_t size); // replaceable, nodiscard in C++20
53void* operator new(std::size_t size, std::align_val_t alignment); // replaceable, C++17, nodiscard in C++2a53void* operator new(std::size_t size, std::align_val_t alignment); // replaceable, C++17, nodiscard in C++20
54void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++2a54void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++20
55void* operator new(std::size_t size, std::align_val_t alignment,55void* operator new(std::size_t size, std::align_val_t alignment,
56 const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++2a56 const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++20
57void operator delete(void* ptr) noexcept; // replaceable57void operator delete(void* ptr) noexcept; // replaceable
58void operator delete(void* ptr, std::size_t size) noexcept; // replaceable, C++1458void operator delete(void* ptr, std::size_t size) noexcept; // replaceable, C++14
59void operator delete(void* ptr, std::align_val_t alignment) noexcept; // replaceable, C++1759void operator delete(void* ptr, std::align_val_t alignment) noexcept; // replaceable, C++17
...@@ -63,12 +63,12 @@ void operator delete(void* ptr, const std::nothrow_t&) noexcept; // repla...@@ -63,12 +63,12 @@ void operator delete(void* ptr, const std::nothrow_t&) noexcept; // repla
63void operator delete(void* ptr, std:align_val_t alignment,63void operator delete(void* ptr, std:align_val_t alignment,
64 const std::nothrow_t&) noexcept; // replaceable, C++1764 const std::nothrow_t&) noexcept; // replaceable, C++17
6565
66void* operator new[](std::size_t size); // replaceable, nodiscard in C++2a66void* operator new[](std::size_t size); // replaceable, nodiscard in C++20
67void* operator new[](std::size_t size,67void* operator new[](std::size_t size,
68 std::align_val_t alignment) noexcept; // replaceable, C++17, nodiscard in C++2a68 std::align_val_t alignment) noexcept; // replaceable, C++17, nodiscard in C++20
69void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++2a69void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++20
70void* operator new[](std::size_t size, std::align_val_t alignment,70void* operator new[](std::size_t size, std::align_val_t alignment,
71 const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++2a71 const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++20
72void operator delete[](void* ptr) noexcept; // replaceable72void operator delete[](void* ptr) noexcept; // replaceable
73void operator delete[](void* ptr, std::size_t size) noexcept; // replaceable, C++1473void operator delete[](void* ptr, std::size_t size) noexcept; // replaceable, C++14
74void operator delete[](void* ptr,74void operator delete[](void* ptr,
...@@ -79,21 +79,20 @@ void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // repla...@@ -79,21 +79,20 @@ void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // repla
79void operator delete[](void* ptr, std::align_val_t alignment,79void operator delete[](void* ptr, std::align_val_t alignment,
80 const std::nothrow_t&) noexcept; // replaceable, C++1780 const std::nothrow_t&) noexcept; // replaceable, C++17
8181
82void* operator new (std::size_t size, void* ptr) noexcept; // nodiscard in C++2a82void* operator new (std::size_t size, void* ptr) noexcept; // nodiscard in C++20
83void* operator new[](std::size_t size, void* ptr) noexcept; // nodiscard in C++2a83void* operator new[](std::size_t size, void* ptr) noexcept; // nodiscard in C++20
84void operator delete (void* ptr, void*) noexcept;84void operator delete (void* ptr, void*) noexcept;
85void operator delete[](void* ptr, void*) noexcept;85void operator delete[](void* ptr, void*) noexcept;
8686
87*/87*/
8888
89#include <__config>89#include <__config>
90#include <__availability>
91#include <cstddef>
92#include <cstdlib>
90#include <exception>93#include <exception>
91#include <type_traits>94#include <type_traits>
92#include <cstddef>
93#include <version>95#include <version>
94#ifdef _LIBCPP_NO_EXCEPTIONS
95#include <cstdlib>
96#endif
9796
98#if defined(_LIBCPP_ABI_VCRUNTIME)97#if defined(_LIBCPP_ABI_VCRUNTIME)
99#include <new.h>98#include <new.h>
...@@ -117,11 +116,6 @@ void operator delete[](void* ptr, void*) noexcept;...@@ -117,11 +116,6 @@ void operator delete[](void* ptr, void*) noexcept;
117# define _LIBCPP_HAS_NO_SIZED_DEALLOCATION116# define _LIBCPP_HAS_NO_SIZED_DEALLOCATION
118#endif117#endif
119118
120#if !__has_builtin(__builtin_operator_new) || \
121 __has_builtin(__builtin_operator_new) < 201802L
122#define _LIBCPP_HAS_NO_BUILTIN_OVERLOADED_OPERATOR_NEW_DELETE
123#endif
124
125namespace std // purposefully not using versioning namespace119namespace std // purposefully not using versioning namespace
126{120{
127121
...@@ -234,31 +228,54 @@ _LIBCPP_CONSTEXPR inline _LIBCPP_INLINE_VISIBILITY bool __is_overaligned_for_new...@@ -234,31 +228,54 @@ _LIBCPP_CONSTEXPR inline _LIBCPP_INLINE_VISIBILITY bool __is_overaligned_for_new
234#endif228#endif
235}229}
236230
237inline _LIBCPP_INLINE_VISIBILITY void *__libcpp_allocate(size_t __size, size_t __align) {231template <class ..._Args>
232_LIBCPP_INLINE_VISIBILITY
233void* __libcpp_operator_new(_Args ...__args) {
234#if __has_builtin(__builtin_operator_new) && __has_builtin(__builtin_operator_delete)
235 return __builtin_operator_new(__args...);
236#else
237 return ::operator new(__args...);
238#endif
239}
240
241template <class ..._Args>
242_LIBCPP_INLINE_VISIBILITY
243void __libcpp_operator_delete(_Args ...__args) {
244#if __has_builtin(__builtin_operator_new) && __has_builtin(__builtin_operator_delete)
245 __builtin_operator_delete(__args...);
246#else
247 ::operator delete(__args...);
248#endif
249}
250
251inline _LIBCPP_INLINE_VISIBILITY
252void *__libcpp_allocate(size_t __size, size_t __align) {
238#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION253#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
239 if (__is_overaligned_for_new(__align)) {254 if (__is_overaligned_for_new(__align)) {
240 const align_val_t __align_val = static_cast<align_val_t>(__align);255 const align_val_t __align_val = static_cast<align_val_t>(__align);
241# ifdef _LIBCPP_HAS_NO_BUILTIN_OVERLOADED_OPERATOR_NEW_DELETE256 return __libcpp_operator_new(__size, __align_val);
242 return ::operator new(__size, __align_val);
243# else
244 return __builtin_operator_new(__size, __align_val);
245# endif
246 }257 }
247#else
248 ((void)__align);
249#endif258#endif
250#ifdef _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE259
251 return ::operator new(__size);260 (void)__align;
261 return __libcpp_operator_new(__size);
262}
263
264template <class ..._Args>
265_LIBCPP_INLINE_VISIBILITY
266void __do_deallocate_handle_size(void *__ptr, size_t __size, _Args ...__args) {
267#ifdef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
268 (void)__size;
269 return __libcpp_operator_delete(__ptr, __args...);
252#else270#else
253 return __builtin_operator_new(__size);271 return __libcpp_operator_delete(__ptr, __size, __args...);
254#endif272#endif
255}273}
256274
257struct _DeallocateCaller {275inline _LIBCPP_INLINE_VISIBILITY
258 static inline _LIBCPP_INLINE_VISIBILITY276void __libcpp_deallocate(void* __ptr, size_t __size, size_t __align) {
259 void __do_deallocate_handle_size_align(void *__ptr, size_t __size, size_t __align) {
260#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)277#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
261 ((void)__align);278 (void)__align;
262 return __do_deallocate_handle_size(__ptr, __size);279 return __do_deallocate_handle_size(__ptr, __size);
263#else280#else
264 if (__is_overaligned_for_new(__align)) {281 if (__is_overaligned_for_new(__align)) {
...@@ -268,81 +285,51 @@ struct _DeallocateCaller {...@@ -268,81 +285,51 @@ struct _DeallocateCaller {
268 return __do_deallocate_handle_size(__ptr, __size);285 return __do_deallocate_handle_size(__ptr, __size);
269 }286 }
270#endif287#endif
271 }288}
272289
273 static inline _LIBCPP_INLINE_VISIBILITY290inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate_unsized(void* __ptr, size_t __align) {
274 void __do_deallocate_handle_align(void *__ptr, size_t __align) {
275#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)291#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
276 ((void)__align);292 (void)__align;
277 return __do_call(__ptr);293 return __libcpp_operator_delete(__ptr);
278#else294#else
279 if (__is_overaligned_for_new(__align)) {295 if (__is_overaligned_for_new(__align)) {
280 const align_val_t __align_val = static_cast<align_val_t>(__align);296 const align_val_t __align_val = static_cast<align_val_t>(__align);
281 return __do_call(__ptr, __align_val);297 return __libcpp_operator_delete(__ptr, __align_val);
282 } else {298 } else {
283 return __do_call(__ptr);299 return __libcpp_operator_delete(__ptr);
284 }300 }
285#endif301#endif
286 }302}
287
288 private:
289 static inline void __do_deallocate_handle_size(void *__ptr, size_t __size) {
290#ifdef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
291 ((void)__size);
292 return __do_call(__ptr);
293#else
294 return __do_call(__ptr, __size);
295#endif
296 }
297
298#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
299 static inline void __do_deallocate_handle_size(void *__ptr, size_t __size, align_val_t __align) {
300#ifdef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
301 ((void)__size);
302 return __do_call(__ptr, __align);
303#else
304 return __do_call(__ptr, __size, __align);
305#endif
306 }
307#endif
308
309private:
310 template <class _A1, class _A2>
311 static inline void __do_call(void *__ptr, _A1 __a1, _A2 __a2) {
312#if defined(_LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE) || \
313 defined(_LIBCPP_HAS_NO_BUILTIN_OVERLOADED_OPERATOR_NEW_DELETE)
314 return ::operator delete(__ptr, __a1, __a2);
315#else
316 return __builtin_operator_delete(__ptr, __a1, __a2);
317#endif
318 }
319303
320 template <class _A1>304#if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
321 static inline void __do_call(void *__ptr, _A1 __a1) {305// Low-level helpers to call the aligned allocation and deallocation functions
322#if defined(_LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE) || \306// on the target platform. This is used to implement libc++'s own memory
323 defined(_LIBCPP_HAS_NO_BUILTIN_OVERLOADED_OPERATOR_NEW_DELETE)307// allocation routines -- if you need to allocate memory inside the library,
324 return ::operator delete(__ptr, __a1);308// chances are that you want to use `__libcpp_allocate` instead.
309//
310// Returns the allocated memory, or `nullptr` on failure.
311inline _LIBCPP_INLINE_VISIBILITY
312void* __libcpp_aligned_alloc(std::size_t __alignment, std::size_t __size) {
313#if defined(_LIBCPP_MSVCRT_LIKE)
314 return ::_aligned_malloc(__size, __alignment);
325#else315#else
326 return __builtin_operator_delete(__ptr, __a1);316 void* __result = nullptr;
317 ::posix_memalign(&__result, __alignment, __size);
318 // If posix_memalign fails, __result is unmodified so we still return `nullptr`.
319 return __result;
327#endif320#endif
328 }321}
329322
330 static inline void __do_call(void *__ptr) {323inline _LIBCPP_INLINE_VISIBILITY
331#ifdef _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE324void __libcpp_aligned_free(void* __ptr) {
332 return ::operator delete(__ptr);325#if defined(_LIBCPP_MSVCRT_LIKE)
326 ::_aligned_free(__ptr);
333#else327#else
334 return __builtin_operator_delete(__ptr);328 ::free(__ptr);
335#endif329#endif
336 }
337};
338
339inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate(void* __ptr, size_t __size, size_t __align) {
340 _DeallocateCaller::__do_deallocate_handle_size_align(__ptr, __size, __align);
341}330}
331#endif // !_LIBCPP_HAS_NO_ALIGNED_ALLOCATION
342332
343inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate_unsized(void* __ptr, size_t __align) {
344 _DeallocateCaller::__do_deallocate_handle_align(__ptr, __align);
345}
346333
347template <class _Tp>334template <class _Tp>
348_LIBCPP_NODISCARD_AFTER_CXX17 inline335_LIBCPP_NODISCARD_AFTER_CXX17 inline
lib/libcxx/include/numbers+1-1
...@@ -100,7 +100,7 @@ template <class T> inline constexpr T egamma_v = __illformed<T>{};...@@ -100,7 +100,7 @@ template <class T> inline constexpr T egamma_v = __illformed<T>{};
100template <class T> inline constexpr T phi_v = __illformed<T>{};100template <class T> inline constexpr T phi_v = __illformed<T>{};
101101
102template <class T>102template <class T>
103concept __floating_point = std::is_floating_point_v<T>;103concept __floating_point = is_floating_point_v<T>;
104104
105template <__floating_point T> inline constexpr T e_v<T> = 2.718281828459045235360287471352662;105template <__floating_point T> inline constexpr T e_v<T> = 2.718281828459045235360287471352662;
106template <__floating_point T> inline constexpr T log2e_v<T> = 1.442695040888963407359924681001892;106template <__floating_point T> inline constexpr T log2e_v<T> = 1.442695040888963407359924681001892;
lib/libcxx/include/numeric+118-73
...@@ -17,115 +17,116 @@ namespace std...@@ -17,115 +17,116 @@ namespace std
17{17{
1818
19template <class InputIterator, class T>19template <class InputIterator, class T>
20 T20 constexpr T // constexpr since C++20
21 accumulate(InputIterator first, InputIterator last, T init);21 accumulate(InputIterator first, InputIterator last, T init);
2222
23template <class InputIterator, class T, class BinaryOperation>23template <class InputIterator, class T, class BinaryOperation>
24 T24 constexpr T // constexpr since C++20
25 accumulate(InputIterator first, InputIterator last, T init, BinaryOperation binary_op);25 accumulate(InputIterator first, InputIterator last, T init, BinaryOperation binary_op);
2626
27template<class InputIterator>27template<class InputIterator>
28 typename iterator_traits<InputIterator>::value_type28 constexpr typename iterator_traits<InputIterator>::value_type // constexpr since C++20
29 reduce(InputIterator first, InputIterator last); // C++1729 reduce(InputIterator first, InputIterator last); // C++17
3030
31template<class InputIterator, class T>31template<class InputIterator, class T>
32 T32 constexpr T // constexpr since C++20
33 reduce(InputIterator first, InputIterator last, T init); // C++1733 reduce(InputIterator first, InputIterator last, T init); // C++17
3434
35template<class InputIterator, class T, class BinaryOperation>35template<class InputIterator, class T, class BinaryOperation>
36 T36 constexpr T // constexpr since C++20
37 reduce(InputIterator first, InputIterator last, T init, BinaryOperation binary_op); // C++1737 reduce(InputIterator first, InputIterator last, T init, BinaryOperation binary_op); // C++17
3838
39template <class InputIterator1, class InputIterator2, class T>39template <class InputIterator1, class InputIterator2, class T>
40 T40 constexpr T // constexpr since C++20
41 inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T init);41 inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T init);
4242
43template <class InputIterator1, class InputIterator2, class T, class BinaryOperation1, class BinaryOperation2>43template <class InputIterator1, class InputIterator2, class T, class BinaryOperation1, class BinaryOperation2>
44 T44 constexpr T // constexpr since C++20
45 inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2,45 inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2,
46 T init, BinaryOperation1 binary_op1, BinaryOperation2 binary_op2);46 T init, BinaryOperation1 binary_op1, BinaryOperation2 binary_op2);
4747
4848
49template<class InputIterator1, class InputIterator2, class T>49template<class InputIterator1, class InputIterator2, class T>
50 T50 constexpr T // constexpr since C++20
51 transform_reduce(InputIterator1 first1, InputIterator1 last1,51 transform_reduce(InputIterator1 first1, InputIterator1 last1,
52 InputIterator2 first2, T init); // C++1752 InputIterator2 first2, T init); // C++17
5353
54template<class InputIterator1, class InputIterator2, class T, class BinaryOperation1, class BinaryOperation2>54template<class InputIterator1, class InputIterator2, class T, class BinaryOperation1, class BinaryOperation2>
55 T55 constexpr T // constexpr since C++20
56 transform_reduce(InputIterator1 first1, InputIterator1 last1,56 transform_reduce(InputIterator1 first1, InputIterator1 last1,
57 InputIterator2 first2, T init,57 InputIterator2 first2, T init,
58 BinaryOperation1 binary_op1, BinaryOperation2 binary_op2); // C++1758 BinaryOperation1 binary_op1, BinaryOperation2 binary_op2); // C++17
5959
60template<class InputIterator, class T, class BinaryOperation, class UnaryOperation>60template<class InputIterator, class T, class BinaryOperation, class UnaryOperation>
61 T61 constexpr T // constexpr since C++20
62 transform_reduce(InputIterator first, InputIterator last, T init,62 transform_reduce(InputIterator first, InputIterator last, T init,
63 BinaryOperation binary_op, UnaryOperation unary_op); // C++1763 BinaryOperation binary_op, UnaryOperation unary_op); // C++17
6464
65template <class InputIterator, class OutputIterator>65template <class InputIterator, class OutputIterator>
66 OutputIterator66 constexpr OutputIterator // constexpr since C++20
67 partial_sum(InputIterator first, InputIterator last, OutputIterator result);67 partial_sum(InputIterator first, InputIterator last, OutputIterator result);
6868
69template <class InputIterator, class OutputIterator, class BinaryOperation>69template <class InputIterator, class OutputIterator, class BinaryOperation>
70 OutputIterator70 constexpr OutputIterator // constexpr since C++20
71 partial_sum(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op);71 partial_sum(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op);
7272
73template<class InputIterator, class OutputIterator, class T>73template<class InputIterator, class OutputIterator, class T>
74 OutputIterator74 constexpr OutputIterator // constexpr since C++20
75 exclusive_scan(InputIterator first, InputIterator last,75 exclusive_scan(InputIterator first, InputIterator last,
76 OutputIterator result, T init); // C++1776 OutputIterator result, T init); // C++17
7777
78template<class InputIterator, class OutputIterator, class T, class BinaryOperation>78template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
79 OutputIterator79 constexpr OutputIterator // constexpr since C++20
80 exclusive_scan(InputIterator first, InputIterator last,80 exclusive_scan(InputIterator first, InputIterator last,
81 OutputIterator result, T init, BinaryOperation binary_op); // C++1781 OutputIterator result, T init, BinaryOperation binary_op); // C++17
8282
83template<class InputIterator, class OutputIterator>83template<class InputIterator, class OutputIterator>
84 OutputIterator84 constexpr OutputIterator // constexpr since C++20
85 inclusive_scan(InputIterator first, InputIterator last, OutputIterator result); // C++1785 inclusive_scan(InputIterator first, InputIterator last, OutputIterator result); // C++17
8686
87template<class InputIterator, class OutputIterator, class BinaryOperation>87template<class InputIterator, class OutputIterator, class BinaryOperation>
88 OutputIterator88 constexpr OutputIterator // constexpr since C++20
89 inclusive_scan(InputIterator first, InputIterator last,89 inclusive_scan(InputIterator first, InputIterator last,
90 OutputIterator result, BinaryOperation binary_op); // C++1790 OutputIterator result, BinaryOperation binary_op); // C++17
9191
92template<class InputIterator, class OutputIterator, class BinaryOperation, class T>92template<class InputIterator, class OutputIterator, class BinaryOperation, class T>
93 OutputIterator93 constexpr OutputIterator // constexpr since C++20
94 inclusive_scan(InputIterator first, InputIterator last,94 inclusive_scan(InputIterator first, InputIterator last,
95 OutputIterator result, BinaryOperation binary_op, T init); // C++1795 OutputIterator result, BinaryOperation binary_op, T init); // C++17
9696
97template<class InputIterator, class OutputIterator, class T,97template<class InputIterator, class OutputIterator, class T,
98 class BinaryOperation, class UnaryOperation>98 class BinaryOperation, class UnaryOperation>
99 OutputIterator99 constexpr OutputIterator // constexpr since C++20
100 transform_exclusive_scan(InputIterator first, InputIterator last,100 transform_exclusive_scan(InputIterator first, InputIterator last,
101 OutputIterator result, T init,101 OutputIterator result, T init,
102 BinaryOperation binary_op, UnaryOperation unary_op); // C++17102 BinaryOperation binary_op, UnaryOperation unary_op); // C++17
103103
104template<class InputIterator, class OutputIterator,104template<class InputIterator, class OutputIterator,
105 class BinaryOperation, class UnaryOperation>105 class BinaryOperation, class UnaryOperation>
106 OutputIterator106 constexpr OutputIterator // constexpr since C++20
107 transform_inclusive_scan(InputIterator first, InputIterator last,107 transform_inclusive_scan(InputIterator first, InputIterator last,
108 OutputIterator result,108 OutputIterator result,
109 BinaryOperation binary_op, UnaryOperation unary_op); // C++17109 BinaryOperation binary_op, UnaryOperation unary_op); // C++17
110110
111template<class InputIterator, class OutputIterator,111template<class InputIterator, class OutputIterator,
112 class BinaryOperation, class UnaryOperation, class T>112 class BinaryOperation, class UnaryOperation, class T>
113 OutputIterator113 constexpr OutputIterator // constexpr since C++20
114 transform_inclusive_scan(InputIterator first, InputIterator last,114 transform_inclusive_scan(InputIterator first, InputIterator last,
115 OutputIterator result,115 OutputIterator result,
116 BinaryOperation binary_op, UnaryOperation unary_op,116 BinaryOperation binary_op, UnaryOperation unary_op,
117 T init); // C++17117 T init); // C++17
118118
119template <class InputIterator, class OutputIterator>119template <class InputIterator, class OutputIterator>
120 OutputIterator120 constexpr OutputIterator // constexpr since C++20
121 adjacent_difference(InputIterator first, InputIterator last, OutputIterator result);121 adjacent_difference(InputIterator first, InputIterator last, OutputIterator result);
122122
123template <class InputIterator, class OutputIterator, class BinaryOperation>123template <class InputIterator, class OutputIterator, class BinaryOperation>
124 OutputIterator124 constexpr OutputIterator // constexpr since C++20
125 adjacent_difference(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op);125 adjacent_difference(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op);
126126
127template <class ForwardIterator, class T>127template <class ForwardIterator, class T>
128 void iota(ForwardIterator first, ForwardIterator last, T value);128 constexpr void // constexpr since C++20
129 iota(ForwardIterator first, ForwardIterator last, T value);
129130
130template <class M, class N>131template <class M, class N>
131 constexpr common_type_t<M,N> gcd(M m, N n); // C++17132 constexpr common_type_t<M,N> gcd(M m, N n); // C++17
...@@ -133,9 +134,11 @@ template <class M, class N>...@@ -133,9 +134,11 @@ template <class M, class N>
133template <class M, class N>134template <class M, class N>
134 constexpr common_type_t<M,N> lcm(M m, N n); // C++17135 constexpr common_type_t<M,N> lcm(M m, N n); // C++17
135136
136integer midpoint(integer a, integer b); // C++20137template<class T>
137pointer midpoint(pointer a, pointer b); // C++20138 constexpr T midpoint(T a, T b) noexcept; // C++20
138floating_point midpoint(floating_point a, floating_point b); // C++20139
140template<class T>
141 constexpr T* midpoint(T* a, T* b); // C++20
139142
140} // std143} // std
141144
...@@ -158,28 +161,36 @@ _LIBCPP_PUSH_MACROS...@@ -158,28 +161,36 @@ _LIBCPP_PUSH_MACROS
158_LIBCPP_BEGIN_NAMESPACE_STD161_LIBCPP_BEGIN_NAMESPACE_STD
159162
160template <class _InputIterator, class _Tp>163template <class _InputIterator, class _Tp>
161inline _LIBCPP_INLINE_VISIBILITY164_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
162_Tp165_Tp
163accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)166accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
164{167{
165 for (; __first != __last; ++__first)168 for (; __first != __last; ++__first)
169#if _LIBCPP_STD_VER > 17
170 __init = _VSTD::move(__init) + *__first;
171#else
166 __init = __init + *__first;172 __init = __init + *__first;
173#endif
167 return __init;174 return __init;
168}175}
169176
170template <class _InputIterator, class _Tp, class _BinaryOperation>177template <class _InputIterator, class _Tp, class _BinaryOperation>
171inline _LIBCPP_INLINE_VISIBILITY178_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
172_Tp179_Tp
173accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op)180accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op)
174{181{
175 for (; __first != __last; ++__first)182 for (; __first != __last; ++__first)
183#if _LIBCPP_STD_VER > 17
184 __init = __binary_op(_VSTD::move(__init), *__first);
185#else
176 __init = __binary_op(__init, *__first);186 __init = __binary_op(__init, *__first);
187#endif
177 return __init;188 return __init;
178}189}
179190
180#if _LIBCPP_STD_VER > 14191#if _LIBCPP_STD_VER > 14
181template <class _InputIterator, class _Tp, class _BinaryOp>192template <class _InputIterator, class _Tp, class _BinaryOp>
182inline _LIBCPP_INLINE_VISIBILITY193_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
183_Tp194_Tp
184reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b)195reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b)
185{196{
...@@ -189,7 +200,7 @@ reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b)...@@ -189,7 +200,7 @@ reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b)
189}200}
190201
191template <class _InputIterator, class _Tp>202template <class _InputIterator, class _Tp>
192inline _LIBCPP_INLINE_VISIBILITY203_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
193_Tp204_Tp
194reduce(_InputIterator __first, _InputIterator __last, _Tp __init)205reduce(_InputIterator __first, _InputIterator __last, _Tp __init)
195{206{
...@@ -197,7 +208,7 @@ reduce(_InputIterator __first, _InputIterator __last, _Tp __init)...@@ -197,7 +208,7 @@ reduce(_InputIterator __first, _InputIterator __last, _Tp __init)
197}208}
198209
199template <class _InputIterator>210template <class _InputIterator>
200inline _LIBCPP_INLINE_VISIBILITY211_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
201typename iterator_traits<_InputIterator>::value_type212typename iterator_traits<_InputIterator>::value_type
202reduce(_InputIterator __first, _InputIterator __last)213reduce(_InputIterator __first, _InputIterator __last)
203{214{
...@@ -207,29 +218,37 @@ reduce(_InputIterator __first, _InputIterator __last)...@@ -207,29 +218,37 @@ reduce(_InputIterator __first, _InputIterator __last)
207#endif218#endif
208219
209template <class _InputIterator1, class _InputIterator2, class _Tp>220template <class _InputIterator1, class _InputIterator2, class _Tp>
210inline _LIBCPP_INLINE_VISIBILITY221_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
211_Tp222_Tp
212inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init)223inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init)
213{224{
214 for (; __first1 != __last1; ++__first1, (void) ++__first2)225 for (; __first1 != __last1; ++__first1, (void) ++__first2)
226#if _LIBCPP_STD_VER > 17
227 __init = _VSTD::move(__init) + *__first1 * *__first2;
228#else
215 __init = __init + *__first1 * *__first2;229 __init = __init + *__first1 * *__first2;
230#endif
216 return __init;231 return __init;
217}232}
218233
219template <class _InputIterator1, class _InputIterator2, class _Tp, class _BinaryOperation1, class _BinaryOperation2>234template <class _InputIterator1, class _InputIterator2, class _Tp, class _BinaryOperation1, class _BinaryOperation2>
220inline _LIBCPP_INLINE_VISIBILITY235_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
221_Tp236_Tp
222inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,237inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,
223 _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2)238 _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2)
224{239{
225 for (; __first1 != __last1; ++__first1, (void) ++__first2)240 for (; __first1 != __last1; ++__first1, (void) ++__first2)
241#if _LIBCPP_STD_VER > 17
242 __init = __binary_op1(_VSTD::move(__init), __binary_op2(*__first1, *__first2));
243#else
226 __init = __binary_op1(__init, __binary_op2(*__first1, *__first2));244 __init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
245#endif
227 return __init;246 return __init;
228}247}
229248
230#if _LIBCPP_STD_VER > 14249#if _LIBCPP_STD_VER > 14
231template <class _InputIterator, class _Tp, class _BinaryOp, class _UnaryOp>250template <class _InputIterator, class _Tp, class _BinaryOp, class _UnaryOp>
232inline _LIBCPP_INLINE_VISIBILITY251_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
233_Tp252_Tp
234transform_reduce(_InputIterator __first, _InputIterator __last,253transform_reduce(_InputIterator __first, _InputIterator __last,
235 _Tp __init, _BinaryOp __b, _UnaryOp __u)254 _Tp __init, _BinaryOp __b, _UnaryOp __u)
...@@ -241,7 +260,7 @@ transform_reduce(_InputIterator __first, _InputIterator __last,...@@ -241,7 +260,7 @@ transform_reduce(_InputIterator __first, _InputIterator __last,
241260
242template <class _InputIterator1, class _InputIterator2,261template <class _InputIterator1, class _InputIterator2,
243 class _Tp, class _BinaryOp1, class _BinaryOp2>262 class _Tp, class _BinaryOp1, class _BinaryOp2>
244inline _LIBCPP_INLINE_VISIBILITY263_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
245_Tp264_Tp
246transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1,265transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1,
247 _InputIterator2 __first2, _Tp __init, _BinaryOp1 __b1, _BinaryOp2 __b2)266 _InputIterator2 __first2, _Tp __init, _BinaryOp1 __b1, _BinaryOp2 __b2)
...@@ -252,7 +271,7 @@ transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1,...@@ -252,7 +271,7 @@ transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1,
252}271}
253272
254template <class _InputIterator1, class _InputIterator2, class _Tp>273template <class _InputIterator1, class _InputIterator2, class _Tp>
255inline _LIBCPP_INLINE_VISIBILITY274_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
256_Tp275_Tp
257transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1,276transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1,
258 _InputIterator2 __first2, _Tp __init)277 _InputIterator2 __first2, _Tp __init)
...@@ -263,7 +282,7 @@ transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1,...@@ -263,7 +282,7 @@ transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1,
263#endif282#endif
264283
265template <class _InputIterator, class _OutputIterator>284template <class _InputIterator, class _OutputIterator>
266inline _LIBCPP_INLINE_VISIBILITY285_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
267_OutputIterator286_OutputIterator
268partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __result)287partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
269{288{
...@@ -273,7 +292,11 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res...@@ -273,7 +292,11 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
273 *__result = __t;292 *__result = __t;
274 for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)293 for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
275 {294 {
295#if _LIBCPP_STD_VER > 17
296 __t = _VSTD::move(__t) + *__first;
297#else
276 __t = __t + *__first;298 __t = __t + *__first;
299#endif
277 *__result = __t;300 *__result = __t;
278 }301 }
279 }302 }
...@@ -281,7 +304,7 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res...@@ -281,7 +304,7 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
281}304}
282305
283template <class _InputIterator, class _OutputIterator, class _BinaryOperation>306template <class _InputIterator, class _OutputIterator, class _BinaryOperation>
284inline _LIBCPP_INLINE_VISIBILITY307_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
285_OutputIterator308_OutputIterator
286partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __result,309partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
287 _BinaryOperation __binary_op)310 _BinaryOperation __binary_op)
...@@ -292,7 +315,11 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res...@@ -292,7 +315,11 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
292 *__result = __t;315 *__result = __t;
293 for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)316 for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
294 {317 {
318#if _LIBCPP_STD_VER > 17
319 __t = __binary_op(_VSTD::move(__t), *__first);
320#else
295 __t = __binary_op(__t, *__first);321 __t = __binary_op(__t, *__first);
322#endif
296 *__result = __t;323 *__result = __t;
297 }324 }
298 }325 }
...@@ -301,27 +328,30 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res...@@ -301,27 +328,30 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
301328
302#if _LIBCPP_STD_VER > 14329#if _LIBCPP_STD_VER > 14
303template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp>330template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp>
304inline _LIBCPP_INLINE_VISIBILITY331_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
305_OutputIterator332_OutputIterator
306exclusive_scan(_InputIterator __first, _InputIterator __last,333exclusive_scan(_InputIterator __first, _InputIterator __last,
307 _OutputIterator __result, _Tp __init, _BinaryOp __b)334 _OutputIterator __result, _Tp __init, _BinaryOp __b)
308{335{
309 if (__first != __last)336 if (__first != __last)
310 {337 {
311 _Tp __saved = __init;338 _Tp __tmp(__b(__init, *__first));
312 do339 while (true)
313 {340 {
314 __init = __b(__init, *__first);341 *__result = _VSTD::move(__init);
315 *__result = __saved;
316 __saved = __init;
317 ++__result;342 ++__result;
318 } while (++__first != __last);343 ++__first;
344 if (__first == __last)
345 break;
346 __init = _VSTD::move(__tmp);
347 __tmp = __b(__init, *__first);
348 }
319 }349 }
320 return __result;350 return __result;
321}351}
322352
323template <class _InputIterator, class _OutputIterator, class _Tp>353template <class _InputIterator, class _OutputIterator, class _Tp>
324inline _LIBCPP_INLINE_VISIBILITY354_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
325_OutputIterator355_OutputIterator
326exclusive_scan(_InputIterator __first, _InputIterator __last,356exclusive_scan(_InputIterator __first, _InputIterator __last,
327 _OutputIterator __result, _Tp __init)357 _OutputIterator __result, _Tp __init)
...@@ -330,40 +360,43 @@ exclusive_scan(_InputIterator __first, _InputIterator __last,...@@ -330,40 +360,43 @@ exclusive_scan(_InputIterator __first, _InputIterator __last,
330}360}
331361
332template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp>362template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp>
363_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
333_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,364_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,
334 _OutputIterator __result, _BinaryOp __b, _Tp __init)365 _OutputIterator __result, _BinaryOp __b, _Tp __init)
335{366{
336 for (; __first != __last; ++__first, (void) ++__result) {367 for (; __first != __last; ++__first, (void) ++__result) {
337 __init = __b(__init, *__first);368 __init = __b(__init, *__first);
338 *__result = __init;369 *__result = __init;
339 }370 }
340 return __result;371 return __result;
341}372}
342373
343template <class _InputIterator, class _OutputIterator, class _BinaryOp>374template <class _InputIterator, class _OutputIterator, class _BinaryOp>
375_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
344_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,376_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,
345 _OutputIterator __result, _BinaryOp __b)377 _OutputIterator __result, _BinaryOp __b)
346{378{
347 if (__first != __last) {379 if (__first != __last) {
348 typename std::iterator_traits<_InputIterator>::value_type __init = *__first;380 typename iterator_traits<_InputIterator>::value_type __init = *__first;
349 *__result++ = __init;381 *__result++ = __init;
350 if (++__first != __last)382 if (++__first != __last)
351 return _VSTD::inclusive_scan(__first, __last, __result, __b, __init);383 return _VSTD::inclusive_scan(__first, __last, __result, __b, __init);
352 }384 }
353385
354 return __result;386 return __result;
355}387}
356388
357template <class _InputIterator, class _OutputIterator>389template <class _InputIterator, class _OutputIterator>
390_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
358_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,391_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,
359 _OutputIterator __result)392 _OutputIterator __result)
360{393{
361 return _VSTD::inclusive_scan(__first, __last, __result, std::plus<>());394 return _VSTD::inclusive_scan(__first, __last, __result, _VSTD::plus<>());
362}395}
363396
364template <class _InputIterator, class _OutputIterator, class _Tp,397template <class _InputIterator, class _OutputIterator, class _Tp,
365 class _BinaryOp, class _UnaryOp>398 class _BinaryOp, class _UnaryOp>
366inline _LIBCPP_INLINE_VISIBILITY399_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
367_OutputIterator400_OutputIterator
368transform_exclusive_scan(_InputIterator __first, _InputIterator __last,401transform_exclusive_scan(_InputIterator __first, _InputIterator __last,
369 _OutputIterator __result, _Tp __init,402 _OutputIterator __result, _Tp __init,
...@@ -384,7 +417,9 @@ transform_exclusive_scan(_InputIterator __first, _InputIterator __last,...@@ -384,7 +417,9 @@ transform_exclusive_scan(_InputIterator __first, _InputIterator __last,
384}417}
385418
386template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp, class _UnaryOp>419template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp, class _UnaryOp>
387_OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator __last,420_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
421_OutputIterator
422transform_inclusive_scan(_InputIterator __first, _InputIterator __last,
388 _OutputIterator __result, _BinaryOp __b, _UnaryOp __u, _Tp __init)423 _OutputIterator __result, _BinaryOp __b, _UnaryOp __u, _Tp __init)
389{424{
390 for (; __first != __last; ++__first, (void) ++__result) {425 for (; __first != __last; ++__first, (void) ++__result) {
...@@ -396,61 +431,71 @@ _OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator...@@ -396,61 +431,71 @@ _OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator
396}431}
397432
398template <class _InputIterator, class _OutputIterator, class _BinaryOp, class _UnaryOp>433template <class _InputIterator, class _OutputIterator, class _BinaryOp, class _UnaryOp>
399_OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator __last,434_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
435_OutputIterator
436transform_inclusive_scan(_InputIterator __first, _InputIterator __last,
400 _OutputIterator __result, _BinaryOp __b, _UnaryOp __u)437 _OutputIterator __result, _BinaryOp __b, _UnaryOp __u)
401{438{
402 if (__first != __last) {439 if (__first != __last) {
403 typename std::iterator_traits<_InputIterator>::value_type __init = __u(*__first);440 typename iterator_traits<_InputIterator>::value_type __init = __u(*__first);
404 *__result++ = __init;441 *__result++ = __init;
405 if (++__first != __last)442 if (++__first != __last)
406 return _VSTD::transform_inclusive_scan(__first, __last, __result, __b, __u, __init);443 return _VSTD::transform_inclusive_scan(__first, __last, __result, __b, __u, __init);
407 }444 }
408445
409 return __result;446 return __result;
410}447}
411#endif448#endif
412449
413template <class _InputIterator, class _OutputIterator>450template <class _InputIterator, class _OutputIterator>
414inline _LIBCPP_INLINE_VISIBILITY451_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
415_OutputIterator452_OutputIterator
416adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterator __result)453adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
417{454{
418 if (__first != __last)455 if (__first != __last)
419 {456 {
420 typename iterator_traits<_InputIterator>::value_type __t1(*__first);457 typename iterator_traits<_InputIterator>::value_type __acc(*__first);
421 *__result = __t1;458 *__result = __acc;
422 for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)459 for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
423 {460 {
424 typename iterator_traits<_InputIterator>::value_type __t2(*__first);461 typename iterator_traits<_InputIterator>::value_type __val(*__first);
425 *__result = __t2 - __t1;462#if _LIBCPP_STD_VER > 17
426 __t1 = _VSTD::move(__t2);463 *__result = __val - _VSTD::move(__acc);
464#else
465 *__result = __val - __acc;
466#endif
467 __acc = _VSTD::move(__val);
427 }468 }
428 }469 }
429 return __result;470 return __result;
430}471}
431472
432template <class _InputIterator, class _OutputIterator, class _BinaryOperation>473template <class _InputIterator, class _OutputIterator, class _BinaryOperation>
433inline _LIBCPP_INLINE_VISIBILITY474_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
434_OutputIterator475_OutputIterator
435adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterator __result,476adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
436 _BinaryOperation __binary_op)477 _BinaryOperation __binary_op)
437{478{
438 if (__first != __last)479 if (__first != __last)
439 {480 {
440 typename iterator_traits<_InputIterator>::value_type __t1(*__first);481 typename iterator_traits<_InputIterator>::value_type __acc(*__first);
441 *__result = __t1;482 *__result = __acc;
442 for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)483 for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
443 {484 {
444 typename iterator_traits<_InputIterator>::value_type __t2(*__first);485 typename iterator_traits<_InputIterator>::value_type __val(*__first);
445 *__result = __binary_op(__t2, __t1);486#if _LIBCPP_STD_VER > 17
446 __t1 = _VSTD::move(__t2);487 *__result = __binary_op(__val, _VSTD::move(__acc));
488#else
489 *__result = __binary_op(__val, __acc);
490#endif
491 __acc = _VSTD::move(__val);
447 }492 }
448 }493 }
449 return __result;494 return __result;
450}495}
451496
452template <class _ForwardIterator, class _Tp>497template <class _ForwardIterator, class _Tp>
453inline _LIBCPP_INLINE_VISIBILITY498_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
454void499void
455iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value_)500iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value_)
456{501{
...@@ -467,9 +512,9 @@ struct __ct_abs<_Result, _Source, true> {...@@ -467,9 +512,9 @@ struct __ct_abs<_Result, _Source, true> {
467 _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY512 _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
468 _Result operator()(_Source __t) const noexcept513 _Result operator()(_Source __t) const noexcept
469 {514 {
470 if (__t >= 0) return __t;515 if (__t >= 0) return __t;
471 if (__t == numeric_limits<_Source>::min()) return -static_cast<_Result>(__t);516 if (__t == numeric_limits<_Source>::min()) return -static_cast<_Result>(__t);
472 return -__t;517 return -__t;
473 }518 }
474};519};
475520
...@@ -531,8 +576,8 @@ enable_if_t<is_integral_v<_Tp> && !is_same_v<bool, _Tp> && !is_null_pointer_v<_T...@@ -531,8 +576,8 @@ enable_if_t<is_integral_v<_Tp> && !is_same_v<bool, _Tp> && !is_null_pointer_v<_T
531midpoint(_Tp __a, _Tp __b) noexcept576midpoint(_Tp __a, _Tp __b) noexcept
532_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK577_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
533{578{
534 using _Up = std::make_unsigned_t<_Tp>;579 using _Up = make_unsigned_t<_Tp>;
535 constexpr _Up __bitshift = std::numeric_limits<_Up>::digits - 1;580 constexpr _Up __bitshift = numeric_limits<_Up>::digits - 1;
536581
537 _Up __diff = _Up(__b) - _Up(__a);582 _Up __diff = _Up(__b) - _Up(__a);
538 _Up __sign_bit = __b < __a;583 _Up __sign_bit = __b < __a;
lib/libcxx/include/optional+3-2
...@@ -147,6 +147,7 @@ template<class T>...@@ -147,6 +147,7 @@ template<class T>
147*/147*/
148148
149#include <__config>149#include <__config>
150#include <__availability>
150#include <__debug>151#include <__debug>
151#include <__functional_base>152#include <__functional_base>
152#include <functional>153#include <functional>
...@@ -320,7 +321,7 @@ struct __optional_storage_base : __optional_destruct_base<_Tp>...@@ -320,7 +321,7 @@ struct __optional_storage_base : __optional_destruct_base<_Tp>
320 void __construct(_Args&&... __args)321 void __construct(_Args&&... __args)
321 {322 {
322 _LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");323 _LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
323 ::new((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Args>(__args)...);324 ::new ((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Args>(__args)...);
324 this->__engaged_ = true;325 this->__engaged_ = true;
325 }326 }
326327
...@@ -656,7 +657,7 @@ private:...@@ -656,7 +657,7 @@ private:
656 }657 }
657 template <class _Up, class _QUp = _QualUp>658 template <class _Up, class _QUp = _QualUp>
658 static constexpr bool __enable_assign() {659 static constexpr bool __enable_assign() {
659 // Construction and assignability of _Qup to _Tp has already been660 // Construction and assignability of _QUp to _Tp has already been
660 // checked.661 // checked.
661 return !__check_constructible_from_opt<_Up>::value &&662 return !__check_constructible_from_opt<_Up>::value &&
662 !__check_assignable_from_opt<_Up>::value;663 !__check_assignable_from_opt<_Up>::value;
lib/libcxx/include/ostream+15-13
...@@ -126,9 +126,8 @@ template <class charT, class traits>...@@ -126,9 +126,8 @@ template <class charT, class traits>
126 basic_ostream<charT,traits>& flush(basic_ostream<charT,traits>& os);126 basic_ostream<charT,traits>& flush(basic_ostream<charT,traits>& os);
127127
128// rvalue stream insertion128// rvalue stream insertion
129template <class charT, class traits, class T>129template <class Stream, class T>
130 basic_ostream<charT, traits>&130 Stream&& operator<<(Stream&& os, const T& x);
131 operator<<(basic_ostream<charT, traits>&& os, const T& x);
132131
133} // std132} // std
134133
...@@ -1028,15 +1027,20 @@ flush(basic_ostream<_CharT, _Traits>& __os)...@@ -1028,15 +1027,20 @@ flush(basic_ostream<_CharT, _Traits>& __os)
10281027
1029#ifndef _LIBCPP_CXX03_LANG1028#ifndef _LIBCPP_CXX03_LANG
10301029
1030template <class _Stream, class _Tp, class = void>
1031struct __is_ostreamable : false_type { };
1032
1031template <class _Stream, class _Tp>1033template <class _Stream, class _Tp>
1032inline _LIBCPP_INLINE_VISIBILITY1034struct __is_ostreamable<_Stream, _Tp, decltype(
1033typename enable_if1035 _VSTD::declval<_Stream>() << _VSTD::declval<_Tp>(), void()
1034<1036)> : true_type { };
1035 !is_lvalue_reference<_Stream>::value &&1037
1036 is_base_of<ios_base, _Stream>::value,1038template <class _Stream, class _Tp, class = typename enable_if<
1037 _Stream&&1039 _And<is_base_of<ios_base, _Stream>,
1038>::type1040 __is_ostreamable<_Stream&, const _Tp&>>::value
1039operator<<(_Stream&& __os, const _Tp& __x)1041>::type>
1042_LIBCPP_INLINE_VISIBILITY
1043_Stream&& operator<<(_Stream&& __os, const _Tp& __x)
1040{1044{
1041 __os << __x;1045 __os << __x;
1042 return _VSTD::move(__os);1046 return _VSTD::move(__os);
...@@ -1097,10 +1101,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)...@@ -1097,10 +1101,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
1097 use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));1101 use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
1098}1102}
10991103
1100#ifndef _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
1101_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>)1104_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>)
1102_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>)1105_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>)
1103#endif
11041106
1105_LIBCPP_END_NAMESPACE_STD1107_LIBCPP_END_NAMESPACE_STD
11061108
lib/libcxx/include/queue+6-13
...@@ -112,18 +112,11 @@ protected:...@@ -112,18 +112,11 @@ protected:
112 Compare comp;112 Compare comp;
113113
114public:114public:
115 priority_queue() = default;115 priority_queue() : priority_queue(Compare()) {} // C++20
116 ~priority_queue() = default;116 explicit priority_queue(const Compare& x) : priority_queue(x, Container()) {}
117117 priority_queue(const Compare& x, const Container&);
118 priority_queue(const priority_queue& q) = default;118 explicit priority_queue(const Compare& x = Compare(), Container&&= Container()); // before C++20
119 priority_queue(priority_queue&& q) = default;119 priority_queue(const Compare& x, Container&&); // C++20
120
121 priority_queue& operator=(const priority_queue& q) = default;
122 priority_queue& operator=(priority_queue&& q) = default;
123
124 explicit priority_queue(const Compare& comp);
125 priority_queue(const Compare& comp, const container_type& c);
126 explicit priority_queue(const Compare& comp, container_type&& c);
127 template <class InputIterator>120 template <class InputIterator>
128 priority_queue(InputIterator first, InputIterator last,121 priority_queue(InputIterator first, InputIterator last,
129 const Compare& comp = Compare());122 const Compare& comp = Compare());
...@@ -474,7 +467,7 @@ public:...@@ -474,7 +467,7 @@ public:
474 priority_queue(const value_compare& __comp, const container_type& __c);467 priority_queue(const value_compare& __comp, const container_type& __c);
475#ifndef _LIBCPP_CXX03_LANG468#ifndef _LIBCPP_CXX03_LANG
476 _LIBCPP_INLINE_VISIBILITY469 _LIBCPP_INLINE_VISIBILITY
477 explicit priority_queue(const value_compare& __comp, container_type&& __c);470 priority_queue(const value_compare& __comp, container_type&& __c);
478#endif471#endif
479 template <class _InputIter>472 template <class _InputIter>
480 _LIBCPP_INLINE_VISIBILITY473 _LIBCPP_INLINE_VISIBILITY
lib/libcxx/include/random+385-113
...@@ -36,7 +36,9 @@ public:...@@ -36,7 +36,9 @@ public:
36 static constexpr result_type default_seed = 1u;36 static constexpr result_type default_seed = 1u;
3737
38 // constructors and seeding functions38 // constructors and seeding functions
39 explicit linear_congruential_engine(result_type s = default_seed);39 explicit linear_congruential_engine(result_type s = default_seed); // before C++20
40 linear_congruential_engine() : linear_congruential_engine(default_seed) {} // C++20
41 explicit linear_congruential_engine(result_type s); // C++20
40 template<class Sseq> explicit linear_congruential_engine(Sseq& q);42 template<class Sseq> explicit linear_congruential_engine(Sseq& q);
41 void seed(result_type s = default_seed);43 void seed(result_type s = default_seed);
42 template<class Sseq> void seed(Sseq& q);44 template<class Sseq> void seed(Sseq& q);
...@@ -96,7 +98,9 @@ public:...@@ -96,7 +98,9 @@ public:
96 static constexpr result_type default_seed = 5489u;98 static constexpr result_type default_seed = 5489u;
9799
98 // constructors and seeding functions100 // constructors and seeding functions
99 explicit mersenne_twister_engine(result_type value = default_seed);101 explicit mersenne_twister_engine(result_type s = default_seed); // before C++20
102 mersenne_twister_engine() : mersenne_twister_engine(default_seed) {} // C++20
103 explicit mersenne_twister_engine(result_type s); // C++20
100 template<class Sseq> explicit mersenne_twister_engine(Sseq& q);104 template<class Sseq> explicit mersenne_twister_engine(Sseq& q);
101 void seed(result_type value = default_seed);105 void seed(result_type value = default_seed);
102 template<class Sseq> void seed(Sseq& q);106 template<class Sseq> void seed(Sseq& q);
...@@ -154,7 +158,9 @@ public:...@@ -154,7 +158,9 @@ public:
154 static constexpr result_type default_seed = 19780503u;158 static constexpr result_type default_seed = 19780503u;
155159
156 // constructors and seeding functions160 // constructors and seeding functions
157 explicit subtract_with_carry_engine(result_type value = default_seed);161 explicit subtract_with_carry_engine(result_type value = default_seed); // before C++20
162 subtract_with_carry_engine() : subtract_with_carry_engine(default_seed) {} // C++20
163 explicit subtract_with_carry_engine(result_type value); // C++20
158 template<class Sseq> explicit subtract_with_carry_engine(Sseq& q);164 template<class Sseq> explicit subtract_with_carry_engine(Sseq& q);
159 void seed(result_type value = default_seed);165 void seed(result_type value = default_seed);
160 template<class Sseq> void seed(Sseq& q);166 template<class Sseq> void seed(Sseq& q);
...@@ -385,7 +391,9 @@ public:...@@ -385,7 +391,9 @@ public:
385 static constexpr result_type max() { return numeric_limits<result_type>::max(); }391 static constexpr result_type max() { return numeric_limits<result_type>::max(); }
386392
387 // constructors393 // constructors
388 explicit random_device(const string& token = "/dev/urandom");394 explicit random_device(const string& token = implementation-defined); // before C++20
395 random_device() : random_device(implementation-defined) {} // C++20
396 explicit random_device(const string& token); // C++20
389397
390 // generating functions398 // generating functions
391 result_type operator()();399 result_type operator()();
...@@ -456,7 +464,10 @@ public:...@@ -456,7 +464,10 @@ public:
456464
457 // constructors and reset functions465 // constructors and reset functions
458 explicit uniform_int_distribution(IntType a = 0,466 explicit uniform_int_distribution(IntType a = 0,
459 IntType b = numeric_limits<IntType>::max());467 IntType b = numeric_limits<IntType>::max()); // before C++20
468 uniform_int_distribution() : uniform_int_distribution(0) {} // C++20
469 explicit uniform_int_distribution(IntType a,
470 IntType b = numeric_limits<IntType>::max()); // C++20
460 explicit uniform_int_distribution(const param_type& parm);471 explicit uniform_int_distribution(const param_type& parm);
461 void reset();472 void reset();
462473
...@@ -515,7 +526,9 @@ public:...@@ -515,7 +526,9 @@ public:
515 };526 };
516527
517 // constructors and reset functions528 // constructors and reset functions
518 explicit uniform_real_distribution(RealType a = 0.0, RealType b = 1.0);529 explicit uniform_real_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20
530 uniform_real_distribution() : uniform_real_distribution(0.0) {} // C++20
531 explicit uniform_real_distribution(RealType a, RealType b = 1.0); // C++20
519 explicit uniform_real_distribution(const param_type& parm);532 explicit uniform_real_distribution(const param_type& parm);
520 void reset();533 void reset();
521534
...@@ -571,7 +584,9 @@ public:...@@ -571,7 +584,9 @@ public:
571 };584 };
572585
573 // constructors and reset functions586 // constructors and reset functions
574 explicit bernoulli_distribution(double p = 0.5);587 explicit bernoulli_distribution(double p = 0.5); // before C++20
588 bernoulli_distribution() : bernoulli_distribution(0.5) {} // C++20
589 explicit bernoulli_distribution(double p); // C++20
575 explicit bernoulli_distribution(const param_type& parm);590 explicit bernoulli_distribution(const param_type& parm);
576 void reset();591 void reset();
577592
...@@ -628,7 +643,9 @@ public:...@@ -628,7 +643,9 @@ public:
628 };643 };
629644
630 // constructors and reset functions645 // constructors and reset functions
631 explicit binomial_distribution(IntType t = 1, double p = 0.5);646 explicit binomial_distribution(IntType t = 1, double p = 0.5); // before C++20
647 binomial_distribution() : binomial_distribution(1) {} // C++20
648 explicit binomial_distribution(IntType t, double p = 0.5); // C++20
632 explicit binomial_distribution(const param_type& parm);649 explicit binomial_distribution(const param_type& parm);
633 void reset();650 void reset();
634651
...@@ -685,7 +702,9 @@ public:...@@ -685,7 +702,9 @@ public:
685 };702 };
686703
687 // constructors and reset functions704 // constructors and reset functions
688 explicit geometric_distribution(double p = 0.5);705 explicit geometric_distribution(double p = 0.5); // before C++20
706 geometric_distribution() : geometric_distribution(0.5) {} // C++20
707 explicit geometric_distribution(double p); // C++20
689 explicit geometric_distribution(const param_type& parm);708 explicit geometric_distribution(const param_type& parm);
690 void reset();709 void reset();
691710
...@@ -742,7 +761,9 @@ public:...@@ -742,7 +761,9 @@ public:
742 };761 };
743762
744 // constructor and reset functions763 // constructor and reset functions
745 explicit negative_binomial_distribution(result_type k = 1, double p = 0.5);764 explicit negative_binomial_distribution(IntType k = 1, double p = 0.5); // before C++20
765 negative_binomial_distribution() : negative_binomial_distribution(1) {} // C++20
766 explicit negative_binomial_distribution(IntType k, double p = 0.5); // C++20
746 explicit negative_binomial_distribution(const param_type& parm);767 explicit negative_binomial_distribution(const param_type& parm);
747 void reset();768 void reset();
748769
...@@ -799,7 +820,9 @@ public:...@@ -799,7 +820,9 @@ public:
799 };820 };
800821
801 // constructors and reset functions822 // constructors and reset functions
802 explicit poisson_distribution(double mean = 1.0);823 explicit poisson_distribution(double mean = 1.0); // before C++20
824 poisson_distribution() : poisson_distribution(1.0) {} // C++20
825 explicit poisson_distribution(double mean); // C++20
803 explicit poisson_distribution(const param_type& parm);826 explicit poisson_distribution(const param_type& parm);
804 void reset();827 void reset();
805828
...@@ -855,7 +878,9 @@ public:...@@ -855,7 +878,9 @@ public:
855 };878 };
856879
857 // constructors and reset functions880 // constructors and reset functions
858 explicit exponential_distribution(result_type lambda = 1.0);881 explicit exponential_distribution(RealType lambda = 1.0); // before C++20
882 exponential_distribution() : exponential_distribution(1.0) {} // C++20
883 explicit exponential_distribution(RealType lambda); // C++20
859 explicit exponential_distribution(const param_type& parm);884 explicit exponential_distribution(const param_type& parm);
860 void reset();885 void reset();
861886
...@@ -912,7 +937,9 @@ public:...@@ -912,7 +937,9 @@ public:
912 };937 };
913938
914 // constructors and reset functions939 // constructors and reset functions
915 explicit gamma_distribution(result_type alpha = 1, result_type beta = 1);940 explicit gamma_distribution(RealType alpha = 0.0, RealType beta = 1.0); // before C++20
941 gamma_distribution() : gamma_distribution(0.0) {} // C++20
942 explicit gamma_distribution(RealType alpha, RealType beta = 1.0); // C++20
916 explicit gamma_distribution(const param_type& parm);943 explicit gamma_distribution(const param_type& parm);
917 void reset();944 void reset();
918945
...@@ -970,7 +997,9 @@ public:...@@ -970,7 +997,9 @@ public:
970 };997 };
971998
972 // constructor and reset functions999 // constructor and reset functions
973 explicit weibull_distribution(result_type a = 1, result_type b = 1);1000 explicit weibull_distribution(RealType a = 1.0, RealType b = 1.0); // before C++20
1001 weibull_distribution() : weibull_distribution(1.0) {} // C++20
1002 explicit weibull_distribution(RealType a, RealType b = 1.0); // C++20
974 explicit weibull_distribution(const param_type& parm);1003 explicit weibull_distribution(const param_type& parm);
975 void reset();1004 void reset();
9761005
...@@ -1028,7 +1057,9 @@ public:...@@ -1028,7 +1057,9 @@ public:
1028 };1057 };
10291058
1030 // constructor and reset functions1059 // constructor and reset functions
1031 explicit extreme_value_distribution(result_type a = 0, result_type b = 1);1060 explicit extreme_value_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20
1061 extreme_value_distribution() : extreme_value_distribution(0.0) {} // C++20
1062 explicit extreme_value_distribution(RealType a, RealType b = 1.0); // C++20
1032 explicit extreme_value_distribution(const param_type& parm);1063 explicit extreme_value_distribution(const param_type& parm);
1033 void reset();1064 void reset();
10341065
...@@ -1086,7 +1117,9 @@ public:...@@ -1086,7 +1117,9 @@ public:
1086 };1117 };
10871118
1088 // constructors and reset functions1119 // constructors and reset functions
1089 explicit normal_distribution(result_type mean = 0, result_type stddev = 1);1120 explicit normal_distribution(RealType mean = 0.0, RealType stddev = 1.0); // before C++20
1121 normal_distribution() : normal_distribution(0.0) {} // C++20
1122 explicit normal_distribution(RealType mean, RealType stddev = 1.0); // C++20
1090 explicit normal_distribution(const param_type& parm);1123 explicit normal_distribution(const param_type& parm);
1091 void reset();1124 void reset();
10921125
...@@ -1144,7 +1177,9 @@ public:...@@ -1144,7 +1177,9 @@ public:
1144 };1177 };
11451178
1146 // constructor and reset functions1179 // constructor and reset functions
1147 explicit lognormal_distribution(result_type m = 0, result_type s = 1);1180 explicit lognormal_distribution(RealType mean = 0.0, RealType stddev = 1.0); // before C++20
1181 lognormal_distribution() : lognormal_distribution(0.0) {} // C++20
1182 explicit lognormal_distribution(RealType mean, RealType stddev = 1.0); // C++20
1148 explicit lognormal_distribution(const param_type& parm);1183 explicit lognormal_distribution(const param_type& parm);
1149 void reset();1184 void reset();
11501185
...@@ -1201,7 +1236,9 @@ public:...@@ -1201,7 +1236,9 @@ public:
1201 };1236 };
12021237
1203 // constructor and reset functions1238 // constructor and reset functions
1204 explicit chi_squared_distribution(result_type n = 1);1239 explicit chi_squared_distribution(RealType n = 1.0); // before C++20
1240 chi_squared_distribution() : chi_squared_distribution(1.0) {} // C++20
1241 explicit chi_squared_distribution(RealType n); // C++20
1205 explicit chi_squared_distribution(const param_type& parm);1242 explicit chi_squared_distribution(const param_type& parm);
1206 void reset();1243 void reset();
12071244
...@@ -1258,7 +1295,9 @@ public:...@@ -1258,7 +1295,9 @@ public:
1258 };1295 };
12591296
1260 // constructor and reset functions1297 // constructor and reset functions
1261 explicit cauchy_distribution(result_type a = 0, result_type b = 1);1298 explicit cauchy_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20
1299 cauchy_distribution() : cauchy_distribution(0.0) {} // C++20
1300 explicit cauchy_distribution(RealType a, RealType b = 1.0); // C++20
1262 explicit cauchy_distribution(const param_type& parm);1301 explicit cauchy_distribution(const param_type& parm);
1263 void reset();1302 void reset();
12641303
...@@ -1316,7 +1355,9 @@ public:...@@ -1316,7 +1355,9 @@ public:
1316 };1355 };
13171356
1318 // constructor and reset functions1357 // constructor and reset functions
1319 explicit fisher_f_distribution(result_type m = 1, result_type n = 1);1358 explicit fisher_f_distribution(RealType m = 1.0, RealType n = 1.0); // before C++20
1359 fisher_f_distribution() : fisher_f_distribution(1.0) {} // C++20
1360 explicit fisher_f_distribution(RealType m, RealType n = 1.0); // C++20
1320 explicit fisher_f_distribution(const param_type& parm);1361 explicit fisher_f_distribution(const param_type& parm);
1321 void reset();1362 void reset();
13221363
...@@ -1373,7 +1414,9 @@ public:...@@ -1373,7 +1414,9 @@ public:
1373 };1414 };
13741415
1375 // constructor and reset functions1416 // constructor and reset functions
1376 explicit student_t_distribution(result_type n = 1);1417 explicit student_t_distribution(RealType n = 1.0); // before C++20
1418 student_t_distribution() : student_t_distribution(1.0) {} // C++20
1419 explicit student_t_distribution(RealType n); // C++20
1377 explicit student_t_distribution(const param_type& parm);1420 explicit student_t_distribution(const param_type& parm);
1378 void reset();1421 void reset();
13791422
...@@ -1642,8 +1685,7 @@ class piecewise_linear_distribution...@@ -1642,8 +1685,7 @@ class piecewise_linear_distribution
1642#include <numeric>1685#include <numeric>
1643#include <vector>1686#include <vector>
1644#include <string>1687#include <string>
1645#include <istream>1688#include <iosfwd>
1646#include <ostream>
16471689
1648#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)1690#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1649#pragma GCC system_header1691#pragma GCC system_header
...@@ -1669,7 +1711,23 @@ struct __is_seed_sequence...@@ -1669,7 +1711,23 @@ struct __is_seed_sequence
16691711
1670template <unsigned long long __a, unsigned long long __c,1712template <unsigned long long __a, unsigned long long __c,
1671 unsigned long long __m, unsigned long long _Mp,1713 unsigned long long __m, unsigned long long _Mp,
1672 bool _MightOverflow = (__a != 0 && __m != 0 && __m-1 > (_Mp-__c)/__a)>1714 bool _MightOverflow = (__a != 0 && __m != 0 && __m-1 > (_Mp-__c)/__a),
1715 bool _OverflowOK = ((__m|__m-1) > __m), // m = 2^n
1716 bool _SchrageOK = (__a != 0 && __m != 0 && __m % __a <= __m / __a)> // r <= q
1717struct __lce_alg_picker
1718{
1719 static_assert(__a != 0 || __m != 0 || !_MightOverflow || _OverflowOK || _SchrageOK,
1720 "The current values of a, c, and m cannot generate a number "
1721 "within bounds of linear_congruential_engine.");
1722
1723 static _LIBCPP_CONSTEXPR const bool __use_schrage = _MightOverflow &&
1724 !_OverflowOK &&
1725 _SchrageOK;
1726};
1727
1728template <unsigned long long __a, unsigned long long __c,
1729 unsigned long long __m, unsigned long long _Mp,
1730 bool _UseSchrage = __lce_alg_picker<__a, __c, __m, _Mp>::__use_schrage>
1673struct __lce_ta;1731struct __lce_ta;
16741732
1675// 641733// 64
...@@ -1843,6 +1901,7 @@ private:...@@ -1843,6 +1901,7 @@ private:
18431901
1844 static_assert(__m == 0 || __a < __m, "linear_congruential_engine invalid parameters");1902 static_assert(__m == 0 || __a < __m, "linear_congruential_engine invalid parameters");
1845 static_assert(__m == 0 || __c < __m, "linear_congruential_engine invalid parameters");1903 static_assert(__m == 0 || __c < __m, "linear_congruential_engine invalid parameters");
1904 static_assert(_VSTD::is_unsigned<_UIntType>::value, "_UIntType must be unsigned type");
1846public:1905public:
1847 static _LIBCPP_CONSTEXPR const result_type _Min = __c == 0u ? 1u: 0u;1906 static _LIBCPP_CONSTEXPR const result_type _Min = __c == 0u ? 1u: 0u;
1848 static _LIBCPP_CONSTEXPR const result_type _Max = __m - 1u;1907 static _LIBCPP_CONSTEXPR const result_type _Max = __m - 1u;
...@@ -1859,9 +1918,17 @@ public:...@@ -1859,9 +1918,17 @@ public:
1859 static _LIBCPP_CONSTEXPR const result_type default_seed = 1u;1918 static _LIBCPP_CONSTEXPR const result_type default_seed = 1u;
18601919
1861 // constructors and seeding functions1920 // constructors and seeding functions
1921#ifndef _LIBCPP_CXX03_LANG
1922 _LIBCPP_INLINE_VISIBILITY
1923 linear_congruential_engine() : linear_congruential_engine(default_seed) {}
1924 _LIBCPP_INLINE_VISIBILITY
1925 explicit linear_congruential_engine(result_type __s) { seed(__s); }
1926#else
1862 _LIBCPP_INLINE_VISIBILITY1927 _LIBCPP_INLINE_VISIBILITY
1863 explicit linear_congruential_engine(result_type __s = default_seed)1928 explicit linear_congruential_engine(result_type __s = default_seed) {
1864 {seed(__s);}1929 seed(__s);
1930 }
1931#endif
1865 template<class _Sseq>1932 template<class _Sseq>
1866 _LIBCPP_INLINE_VISIBILITY1933 _LIBCPP_INLINE_VISIBILITY
1867 explicit linear_congruential_engine(_Sseq& __q,1934 explicit linear_congruential_engine(_Sseq& __q,
...@@ -1982,7 +2049,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -1982,7 +2049,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
1982 const linear_congruential_engine<_UIntType, __a, __c, __m>& __x)2049 const linear_congruential_engine<_UIntType, __a, __c, __m>& __x)
1983{2050{
1984 __save_flags<_CharT, _Traits> __lx(__os);2051 __save_flags<_CharT, _Traits> __lx(__os);
1985 __os.flags(ios_base::dec | ios_base::left);2052 typedef basic_ostream<_CharT, _Traits> _Ostream;
2053 __os.flags(_Ostream::dec | _Ostream::left);
1986 __os.fill(__os.widen(' '));2054 __os.fill(__os.widen(' '));
1987 return __os << __x.__x_;2055 return __os << __x.__x_;
1988}2056}
...@@ -1994,7 +2062,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -1994,7 +2062,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
1994 linear_congruential_engine<_UIntType, __a, __c, __m>& __x)2062 linear_congruential_engine<_UIntType, __a, __c, __m>& __x)
1995{2063{
1996 __save_flags<_CharT, _Traits> __lx(__is);2064 __save_flags<_CharT, _Traits> __lx(__is);
1997 __is.flags(ios_base::dec | ios_base::skipws);2065 typedef basic_istream<_CharT, _Traits> _Istream;
2066 __is.flags(_Istream::dec | _Istream::skipws);
1998 _UIntType __t;2067 _UIntType __t;
1999 __is >> __t;2068 __is >> __t;
2000 if (!__is.fail())2069 if (!__is.fail())
...@@ -2106,9 +2175,17 @@ public:...@@ -2106,9 +2175,17 @@ public:
2106 static _LIBCPP_CONSTEXPR const result_type default_seed = 5489u;2175 static _LIBCPP_CONSTEXPR const result_type default_seed = 5489u;
21072176
2108 // constructors and seeding functions2177 // constructors and seeding functions
2178#ifndef _LIBCPP_CXX03_LANG
2109 _LIBCPP_INLINE_VISIBILITY2179 _LIBCPP_INLINE_VISIBILITY
2110 explicit mersenne_twister_engine(result_type __sd = default_seed)2180 mersenne_twister_engine() : mersenne_twister_engine(default_seed) {}
2111 {seed(__sd);}2181 _LIBCPP_INLINE_VISIBILITY
2182 explicit mersenne_twister_engine(result_type __sd) { seed(__sd); }
2183#else
2184 _LIBCPP_INLINE_VISIBILITY
2185 explicit mersenne_twister_engine(result_type __sd = default_seed) {
2186 seed(__sd);
2187 }
2188#endif
2112 template<class _Sseq>2189 template<class _Sseq>
2113 _LIBCPP_INLINE_VISIBILITY2190 _LIBCPP_INLINE_VISIBILITY
2114 explicit mersenne_twister_engine(_Sseq& __q,2191 explicit mersenne_twister_engine(_Sseq& __q,
...@@ -2453,7 +2530,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -2453,7 +2530,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
2453 _Bp, _Tp, _Cp, _Lp, _Fp>& __x)2530 _Bp, _Tp, _Cp, _Lp, _Fp>& __x)
2454{2531{
2455 __save_flags<_CharT, _Traits> __lx(__os);2532 __save_flags<_CharT, _Traits> __lx(__os);
2456 __os.flags(ios_base::dec | ios_base::left);2533 typedef basic_ostream<_CharT, _Traits> _Ostream;
2534 __os.flags(_Ostream::dec | _Ostream::left);
2457 _CharT __sp = __os.widen(' ');2535 _CharT __sp = __os.widen(' ');
2458 __os.fill(__sp);2536 __os.fill(__sp);
2459 __os << __x.__x_[__x.__i_];2537 __os << __x.__x_[__x.__i_];
...@@ -2474,7 +2552,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -2474,7 +2552,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
2474 _Bp, _Tp, _Cp, _Lp, _Fp>& __x)2552 _Bp, _Tp, _Cp, _Lp, _Fp>& __x)
2475{2553{
2476 __save_flags<_CharT, _Traits> __lx(__is);2554 __save_flags<_CharT, _Traits> __lx(__is);
2477 __is.flags(ios_base::dec | ios_base::skipws);2555 typedef basic_istream<_CharT, _Traits> _Istream;
2556 __is.flags(_Istream::dec | _Istream::skipws);
2478 _UInt __t[_Np];2557 _UInt __t[_Np];
2479 for (size_t __i = 0; __i < _Np; ++__i)2558 for (size_t __i = 0; __i < _Np; ++__i)
2480 __is >> __t[__i];2559 __is >> __t[__i];
...@@ -2562,9 +2641,17 @@ public:...@@ -2562,9 +2641,17 @@ public:
2562 static _LIBCPP_CONSTEXPR const result_type default_seed = 19780503u;2641 static _LIBCPP_CONSTEXPR const result_type default_seed = 19780503u;
25632642
2564 // constructors and seeding functions2643 // constructors and seeding functions
2644#ifndef _LIBCPP_CXX03_LANG
2645 _LIBCPP_INLINE_VISIBILITY
2646 subtract_with_carry_engine() : subtract_with_carry_engine(default_seed) {}
2647 _LIBCPP_INLINE_VISIBILITY
2648 explicit subtract_with_carry_engine(result_type __sd) { seed(__sd); }
2649#else
2565 _LIBCPP_INLINE_VISIBILITY2650 _LIBCPP_INLINE_VISIBILITY
2566 explicit subtract_with_carry_engine(result_type __sd = default_seed)2651 explicit subtract_with_carry_engine(result_type __sd = default_seed) {
2567 {seed(__sd);}2652 seed(__sd);
2653 }
2654#endif
2568 template<class _Sseq>2655 template<class _Sseq>
2569 _LIBCPP_INLINE_VISIBILITY2656 _LIBCPP_INLINE_VISIBILITY
2570 explicit subtract_with_carry_engine(_Sseq& __q,2657 explicit subtract_with_carry_engine(_Sseq& __q,
...@@ -2773,7 +2860,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -2773,7 +2860,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
2773 const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x)2860 const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x)
2774{2861{
2775 __save_flags<_CharT, _Traits> __lx(__os);2862 __save_flags<_CharT, _Traits> __lx(__os);
2776 __os.flags(ios_base::dec | ios_base::left);2863 typedef basic_ostream<_CharT, _Traits> _Ostream;
2864 __os.flags(_Ostream::dec | _Ostream::left);
2777 _CharT __sp = __os.widen(' ');2865 _CharT __sp = __os.widen(' ');
2778 __os.fill(__sp);2866 __os.fill(__sp);
2779 __os << __x.__x_[__x.__i_];2867 __os << __x.__x_[__x.__i_];
...@@ -2792,7 +2880,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -2792,7 +2880,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
2792 subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x)2880 subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x)
2793{2881{
2794 __save_flags<_CharT, _Traits> __lx(__is);2882 __save_flags<_CharT, _Traits> __lx(__is);
2795 __is.flags(ios_base::dec | ios_base::skipws);2883 typedef basic_istream<_CharT, _Traits> _Istream;
2884 __is.flags(_Istream::dec | _Istream::skipws);
2796 _UInt __t[_Rp+1];2885 _UInt __t[_Rp+1];
2797 for (size_t __i = 0; __i < _Rp+1; ++__i)2886 for (size_t __i = 0; __i < _Rp+1; ++__i)
2798 __is >> __t[__i];2887 __is >> __t[__i];
...@@ -2955,7 +3044,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -2955,7 +3044,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
2955 const discard_block_engine<_Eng, _Pp, _Rp>& __x)3044 const discard_block_engine<_Eng, _Pp, _Rp>& __x)
2956{3045{
2957 __save_flags<_CharT, _Traits> __lx(__os);3046 __save_flags<_CharT, _Traits> __lx(__os);
2958 __os.flags(ios_base::dec | ios_base::left);3047 typedef basic_ostream<_CharT, _Traits> _Ostream;
3048 __os.flags(_Ostream::dec | _Ostream::left);
2959 _CharT __sp = __os.widen(' ');3049 _CharT __sp = __os.widen(' ');
2960 __os.fill(__sp);3050 __os.fill(__sp);
2961 return __os << __x.__e_ << __sp << __x.__n_;3051 return __os << __x.__e_ << __sp << __x.__n_;
...@@ -2968,7 +3058,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -2968,7 +3058,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
2968 discard_block_engine<_Eng, _Pp, _Rp>& __x)3058 discard_block_engine<_Eng, _Pp, _Rp>& __x)
2969{3059{
2970 __save_flags<_CharT, _Traits> __lx(__is);3060 __save_flags<_CharT, _Traits> __lx(__is);
2971 __is.flags(ios_base::dec | ios_base::skipws);3061 typedef basic_istream<_CharT, _Traits> _Istream;
3062 __is.flags(_Istream::dec | _Istream::skipws);
2972 _Eng __e;3063 _Eng __e;
2973 int __n;3064 int __n;
2974 __is >> __e >> __n;3065 __is >> __e >> __n;
...@@ -3440,7 +3531,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -3440,7 +3531,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
3440 const shuffle_order_engine<_Eng, _Kp>& __x)3531 const shuffle_order_engine<_Eng, _Kp>& __x)
3441{3532{
3442 __save_flags<_CharT, _Traits> __lx(__os);3533 __save_flags<_CharT, _Traits> __lx(__os);
3443 __os.flags(ios_base::dec | ios_base::left);3534 typedef basic_ostream<_CharT, _Traits> _Ostream;
3535 __os.flags(_Ostream::dec | _Ostream::left);
3444 _CharT __sp = __os.widen(' ');3536 _CharT __sp = __os.widen(' ');
3445 __os.fill(__sp);3537 __os.fill(__sp);
3446 __os << __x.__e_ << __sp << __x._V_[0];3538 __os << __x.__e_ << __sp << __x._V_[0];
...@@ -3457,7 +3549,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -3457,7 +3549,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
3457{3549{
3458 typedef typename shuffle_order_engine<_Eng, _Kp>::result_type result_type;3550 typedef typename shuffle_order_engine<_Eng, _Kp>::result_type result_type;
3459 __save_flags<_CharT, _Traits> __lx(__is);3551 __save_flags<_CharT, _Traits> __lx(__is);
3460 __is.flags(ios_base::dec | ios_base::skipws);3552 typedef basic_istream<_CharT, _Traits> _Istream;
3553 __is.flags(_Istream::dec | _Istream::skipws);
3461 _Eng __e;3554 _Eng __e;
3462 result_type _Vp[_Kp+1];3555 result_type _Vp[_Kp+1];
3463 __is >> __e;3556 __is >> __e;
...@@ -3477,6 +3570,8 @@ typedef shuffle_order_engine<minstd_rand0, 256> knuth_b;...@@ -3477,6 +3570,8 @@ typedef shuffle_order_engine<minstd_rand0, 256> knuth_b;
34773570
3478// random_device3571// random_device
34793572
3573#if !defined(_LIBCPP_HAS_NO_RANDOM_DEVICE)
3574
3480class _LIBCPP_TYPE_VIS random_device3575class _LIBCPP_TYPE_VIS random_device
3481{3576{
3482#ifdef _LIBCPP_USING_DEV_RANDOM3577#ifdef _LIBCPP_USING_DEV_RANDOM
...@@ -3496,7 +3591,12 @@ public:...@@ -3496,7 +3591,12 @@ public:
3496 static _LIBCPP_CONSTEXPR result_type max() { return _Max;}3591 static _LIBCPP_CONSTEXPR result_type max() { return _Max;}
34973592
3498 // constructors3593 // constructors
3594#ifndef _LIBCPP_CXX03_LANG
3595 random_device() : random_device("/dev/urandom") {}
3596 explicit random_device(const string& __token);
3597#else
3499 explicit random_device(const string& __token = "/dev/urandom");3598 explicit random_device(const string& __token = "/dev/urandom");
3599#endif
3500 ~random_device();3600 ~random_device();
35013601
3502 // generating functions3602 // generating functions
...@@ -3511,6 +3611,8 @@ private:...@@ -3511,6 +3611,8 @@ private:
3511 random_device& operator=(const random_device&); // = delete;3611 random_device& operator=(const random_device&); // = delete;
3512};3612};
35133613
3614#endif // !_LIBCPP_HAS_NO_RANDOM_DEVICE
3615
3514// seed_seq3616// seed_seq
35153617
3516class _LIBCPP_TEMPLATE_VIS seed_seq3618class _LIBCPP_TEMPLATE_VIS seed_seq
...@@ -3663,7 +3765,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -3663,7 +3765,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
3663 const uniform_int_distribution<_IT>& __x)3765 const uniform_int_distribution<_IT>& __x)
3664{3766{
3665 __save_flags<_CharT, _Traits> __lx(__os);3767 __save_flags<_CharT, _Traits> __lx(__os);
3666 __os.flags(ios_base::dec | ios_base::left);3768 typedef basic_ostream<_CharT, _Traits> _Ostream;
3769 __os.flags(_Ostream::dec | _Ostream::left);
3667 _CharT __sp = __os.widen(' ');3770 _CharT __sp = __os.widen(' ');
3668 __os.fill(__sp);3771 __os.fill(__sp);
3669 return __os << __x.a() << __sp << __x.b();3772 return __os << __x.a() << __sp << __x.b();
...@@ -3678,7 +3781,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -3678,7 +3781,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
3678 typedef typename _Eng::result_type result_type;3781 typedef typename _Eng::result_type result_type;
3679 typedef typename _Eng::param_type param_type;3782 typedef typename _Eng::param_type param_type;
3680 __save_flags<_CharT, _Traits> __lx(__is);3783 __save_flags<_CharT, _Traits> __lx(__is);
3681 __is.flags(ios_base::dec | ios_base::skipws);3784 typedef basic_istream<_CharT, _Traits> _Istream;
3785 __is.flags(_Istream::dec | _Istream::skipws);
3682 result_type __a;3786 result_type __a;
3683 result_type __b;3787 result_type __b;
3684 __is >> __a >> __b;3788 __is >> __a >> __b;
...@@ -3726,9 +3830,16 @@ private:...@@ -3726,9 +3830,16 @@ private:
37263830
3727public:3831public:
3728 // constructors and reset functions3832 // constructors and reset functions
3833#ifndef _LIBCPP_CXX03_LANG
3834 _LIBCPP_INLINE_VISIBILITY
3835 uniform_real_distribution() : uniform_real_distribution(0) {}
3836 explicit uniform_real_distribution(result_type __a, result_type __b = 1)
3837 : __p_(param_type(__a, __b)) {}
3838#else
3729 _LIBCPP_INLINE_VISIBILITY3839 _LIBCPP_INLINE_VISIBILITY
3730 explicit uniform_real_distribution(result_type __a = 0, result_type __b = 1)3840 explicit uniform_real_distribution(result_type __a = 0, result_type __b = 1)
3731 : __p_(param_type(__a, __b)) {}3841 : __p_(param_type(__a, __b)) {}
3842#endif
3732 _LIBCPP_INLINE_VISIBILITY3843 _LIBCPP_INLINE_VISIBILITY
3733 explicit uniform_real_distribution(const param_type& __p) : __p_(__p) {}3844 explicit uniform_real_distribution(const param_type& __p) : __p_(__p) {}
3734 _LIBCPP_INLINE_VISIBILITY3845 _LIBCPP_INLINE_VISIBILITY
...@@ -3784,8 +3895,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -3784,8 +3895,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
3784 const uniform_real_distribution<_RT>& __x)3895 const uniform_real_distribution<_RT>& __x)
3785{3896{
3786 __save_flags<_CharT, _Traits> __lx(__os);3897 __save_flags<_CharT, _Traits> __lx(__os);
3787 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |3898 typedef basic_ostream<_CharT, _Traits> _OStream;
3788 ios_base::scientific);3899 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
3900 _OStream::scientific);
3789 _CharT __sp = __os.widen(' ');3901 _CharT __sp = __os.widen(' ');
3790 __os.fill(__sp);3902 __os.fill(__sp);
3791 return __os << __x.a() << __sp << __x.b();3903 return __os << __x.a() << __sp << __x.b();
...@@ -3800,7 +3912,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -3800,7 +3912,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
3800 typedef typename _Eng::result_type result_type;3912 typedef typename _Eng::result_type result_type;
3801 typedef typename _Eng::param_type param_type;3913 typedef typename _Eng::param_type param_type;
3802 __save_flags<_CharT, _Traits> __lx(__is);3914 __save_flags<_CharT, _Traits> __lx(__is);
3803 __is.flags(ios_base::dec | ios_base::skipws);3915 typedef basic_istream<_CharT, _Traits> _Istream;
3916 __is.flags(_Istream::dec | _Istream::skipws);
3804 result_type __a;3917 result_type __a;
3805 result_type __b;3918 result_type __b;
3806 __is >> __a >> __b;3919 __is >> __a >> __b;
...@@ -3842,9 +3955,15 @@ private:...@@ -3842,9 +3955,15 @@ private:
38423955
3843public:3956public:
3844 // constructors and reset functions3957 // constructors and reset functions
3958#ifndef _LIBCPP_CXX03_LANG
3959 _LIBCPP_INLINE_VISIBILITY
3960 bernoulli_distribution() : bernoulli_distribution(0.5) {}
3845 _LIBCPP_INLINE_VISIBILITY3961 _LIBCPP_INLINE_VISIBILITY
3846 explicit bernoulli_distribution(double __p = 0.5)3962 explicit bernoulli_distribution(double __p) : __p_(param_type(__p)) {}
3847 : __p_(param_type(__p)) {}3963#else
3964 _LIBCPP_INLINE_VISIBILITY
3965 explicit bernoulli_distribution(double __p = 0.5) : __p_(param_type(__p)) {}
3966#endif
3848 _LIBCPP_INLINE_VISIBILITY3967 _LIBCPP_INLINE_VISIBILITY
3849 explicit bernoulli_distribution(const param_type& __p) : __p_(__p) {}3968 explicit bernoulli_distribution(const param_type& __p) : __p_(__p) {}
3850 _LIBCPP_INLINE_VISIBILITY3969 _LIBCPP_INLINE_VISIBILITY
...@@ -3895,8 +4014,9 @@ basic_ostream<_CharT, _Traits>&...@@ -3895,8 +4014,9 @@ basic_ostream<_CharT, _Traits>&
3895operator<<(basic_ostream<_CharT, _Traits>& __os, const bernoulli_distribution& __x)4014operator<<(basic_ostream<_CharT, _Traits>& __os, const bernoulli_distribution& __x)
3896{4015{
3897 __save_flags<_CharT, _Traits> __lx(__os);4016 __save_flags<_CharT, _Traits> __lx(__os);
3898 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |4017 typedef basic_ostream<_CharT, _Traits> _OStream;
3899 ios_base::scientific);4018 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
4019 _OStream::scientific);
3900 _CharT __sp = __os.widen(' ');4020 _CharT __sp = __os.widen(' ');
3901 __os.fill(__sp);4021 __os.fill(__sp);
3902 return __os << __x.p();4022 return __os << __x.p();
...@@ -3909,7 +4029,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bernoulli_distribution& __x)...@@ -3909,7 +4029,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bernoulli_distribution& __x)
3909 typedef bernoulli_distribution _Eng;4029 typedef bernoulli_distribution _Eng;
3910 typedef typename _Eng::param_type param_type;4030 typedef typename _Eng::param_type param_type;
3911 __save_flags<_CharT, _Traits> __lx(__is);4031 __save_flags<_CharT, _Traits> __lx(__is);
3912 __is.flags(ios_base::dec | ios_base::skipws);4032 typedef basic_istream<_CharT, _Traits> _Istream;
4033 __is.flags(_Istream::dec | _Istream::skipws);
3913 double __p;4034 double __p;
3914 __is >> __p;4035 __is >> __p;
3915 if (!__is.fail())4036 if (!__is.fail())
...@@ -3958,9 +4079,17 @@ private:...@@ -3958,9 +4079,17 @@ private:
39584079
3959public:4080public:
3960 // constructors and reset functions4081 // constructors and reset functions
4082#ifndef _LIBCPP_CXX03_LANG
4083 _LIBCPP_INLINE_VISIBILITY
4084 binomial_distribution() : binomial_distribution(1) {}
4085 _LIBCPP_INLINE_VISIBILITY
4086 explicit binomial_distribution(result_type __t, double __p = 0.5)
4087 : __p_(param_type(__t, __p)) {}
4088#else
3961 _LIBCPP_INLINE_VISIBILITY4089 _LIBCPP_INLINE_VISIBILITY
3962 explicit binomial_distribution(result_type __t = 1, double __p = 0.5)4090 explicit binomial_distribution(result_type __t = 1, double __p = 0.5)
3963 : __p_(param_type(__t, __p)) {}4091 : __p_(param_type(__t, __p)) {}
4092#endif
3964 _LIBCPP_INLINE_VISIBILITY4093 _LIBCPP_INLINE_VISIBILITY
3965 explicit binomial_distribution(const param_type& __p) : __p_(__p) {}4094 explicit binomial_distribution(const param_type& __p) : __p_(__p) {}
3966 _LIBCPP_INLINE_VISIBILITY4095 _LIBCPP_INLINE_VISIBILITY
...@@ -3999,12 +4128,12 @@ public:...@@ -3999,12 +4128,12 @@ public:
3999 {return !(__x == __y);}4128 {return !(__x == __y);}
4000};4129};
40014130
4002#ifndef _LIBCPP_MSVCRT4131#ifndef _LIBCPP_MSVCRT_LIKE
4003extern "C" double lgamma_r(double, int *);4132extern "C" double lgamma_r(double, int *);
4004#endif4133#endif
40054134
4006inline _LIBCPP_INLINE_VISIBILITY double __libcpp_lgamma(double __d) {4135inline _LIBCPP_INLINE_VISIBILITY double __libcpp_lgamma(double __d) {
4007#if defined(_LIBCPP_MSVCRT)4136#if defined(_LIBCPP_MSVCRT_LIKE)
4008 return lgamma(__d);4137 return lgamma(__d);
4009#else4138#else
4010 int __sign;4139 int __sign;
...@@ -4079,8 +4208,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -4079,8 +4208,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
4079 const binomial_distribution<_IntType>& __x)4208 const binomial_distribution<_IntType>& __x)
4080{4209{
4081 __save_flags<_CharT, _Traits> __lx(__os);4210 __save_flags<_CharT, _Traits> __lx(__os);
4082 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |4211 typedef basic_ostream<_CharT, _Traits> _OStream;
4083 ios_base::scientific);4212 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
4213 _OStream::scientific);
4084 _CharT __sp = __os.widen(' ');4214 _CharT __sp = __os.widen(' ');
4085 __os.fill(__sp);4215 __os.fill(__sp);
4086 return __os << __x.t() << __sp << __x.p();4216 return __os << __x.t() << __sp << __x.p();
...@@ -4095,7 +4225,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -4095,7 +4225,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
4095 typedef typename _Eng::result_type result_type;4225 typedef typename _Eng::result_type result_type;
4096 typedef typename _Eng::param_type param_type;4226 typedef typename _Eng::param_type param_type;
4097 __save_flags<_CharT, _Traits> __lx(__is);4227 __save_flags<_CharT, _Traits> __lx(__is);
4098 __is.flags(ios_base::dec | ios_base::skipws);4228 typedef basic_istream<_CharT, _Traits> _Istream;
4229 __is.flags(_Istream::dec | _Istream::skipws);
4099 result_type __t;4230 result_type __t;
4100 double __p;4231 double __p;
4101 __is >> __t >> __p;4232 __is >> __t >> __p;
...@@ -4138,9 +4269,17 @@ private:...@@ -4138,9 +4269,17 @@ private:
41384269
4139public:4270public:
4140 // constructors and reset functions4271 // constructors and reset functions
4272#ifndef _LIBCPP_CXX03_LANG
4273 _LIBCPP_INLINE_VISIBILITY
4274 exponential_distribution() : exponential_distribution(1) {}
4275 _LIBCPP_INLINE_VISIBILITY
4276 explicit exponential_distribution(result_type __lambda)
4277 : __p_(param_type(__lambda)) {}
4278#else
4141 _LIBCPP_INLINE_VISIBILITY4279 _LIBCPP_INLINE_VISIBILITY
4142 explicit exponential_distribution(result_type __lambda = 1)4280 explicit exponential_distribution(result_type __lambda = 1)
4143 : __p_(param_type(__lambda)) {}4281 : __p_(param_type(__lambda)) {}
4282#endif
4144 _LIBCPP_INLINE_VISIBILITY4283 _LIBCPP_INLINE_VISIBILITY
4145 explicit exponential_distribution(const param_type& __p) : __p_(__p) {}4284 explicit exponential_distribution(const param_type& __p) : __p_(__p) {}
4146 _LIBCPP_INLINE_VISIBILITY4285 _LIBCPP_INLINE_VISIBILITY
...@@ -4197,8 +4336,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -4197,8 +4336,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
4197 const exponential_distribution<_RealType>& __x)4336 const exponential_distribution<_RealType>& __x)
4198{4337{
4199 __save_flags<_CharT, _Traits> __lx(__os);4338 __save_flags<_CharT, _Traits> __lx(__os);
4200 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |4339 typedef basic_ostream<_CharT, _Traits> _OStream;
4201 ios_base::scientific);4340 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
4341 _OStream::scientific);
4202 return __os << __x.lambda();4342 return __os << __x.lambda();
4203}4343}
42044344
...@@ -4211,7 +4351,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -4211,7 +4351,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
4211 typedef typename _Eng::result_type result_type;4351 typedef typename _Eng::result_type result_type;
4212 typedef typename _Eng::param_type param_type;4352 typedef typename _Eng::param_type param_type;
4213 __save_flags<_CharT, _Traits> __lx(__is);4353 __save_flags<_CharT, _Traits> __lx(__is);
4214 __is.flags(ios_base::dec | ios_base::skipws);4354 typedef basic_istream<_CharT, _Traits> _Istream;
4355 __is.flags(_Istream::dec | _Istream::skipws);
4215 result_type __lambda;4356 result_type __lambda;
4216 __is >> __lambda;4357 __is >> __lambda;
4217 if (!__is.fail())4358 if (!__is.fail())
...@@ -4259,9 +4400,18 @@ private:...@@ -4259,9 +4400,18 @@ private:
42594400
4260public:4401public:
4261 // constructors and reset functions4402 // constructors and reset functions
4403#ifndef _LIBCPP_CXX03_LANG
4404 _LIBCPP_INLINE_VISIBILITY
4405 normal_distribution() : normal_distribution(0) {}
4262 _LIBCPP_INLINE_VISIBILITY4406 _LIBCPP_INLINE_VISIBILITY
4263 explicit normal_distribution(result_type __mean = 0, result_type __stddev = 1)4407 explicit normal_distribution(result_type __mean, result_type __stddev = 1)
4264 : __p_(param_type(__mean, __stddev)), _V_hot_(false) {}4408 : __p_(param_type(__mean, __stddev)), _V_hot_(false) {}
4409#else
4410 _LIBCPP_INLINE_VISIBILITY
4411 explicit normal_distribution(result_type __mean = 0,
4412 result_type __stddev = 1)
4413 : __p_(param_type(__mean, __stddev)), _V_hot_(false) {}
4414#endif
4265 _LIBCPP_INLINE_VISIBILITY4415 _LIBCPP_INLINE_VISIBILITY
4266 explicit normal_distribution(const param_type& __p)4416 explicit normal_distribution(const param_type& __p)
4267 : __p_(__p), _V_hot_(false) {}4417 : __p_(__p), _V_hot_(false) {}
...@@ -4351,8 +4501,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -4351,8 +4501,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
4351 const normal_distribution<_RT>& __x)4501 const normal_distribution<_RT>& __x)
4352{4502{
4353 __save_flags<_CharT, _Traits> __lx(__os);4503 __save_flags<_CharT, _Traits> __lx(__os);
4354 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |4504 typedef basic_ostream<_CharT, _Traits> _OStream;
4355 ios_base::scientific);4505 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
4506 _OStream::scientific);
4356 _CharT __sp = __os.widen(' ');4507 _CharT __sp = __os.widen(' ');
4357 __os.fill(__sp);4508 __os.fill(__sp);
4358 __os << __x.mean() << __sp << __x.stddev() << __sp << __x._V_hot_;4509 __os << __x.mean() << __sp << __x.stddev() << __sp << __x._V_hot_;
...@@ -4370,7 +4521,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -4370,7 +4521,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
4370 typedef typename _Eng::result_type result_type;4521 typedef typename _Eng::result_type result_type;
4371 typedef typename _Eng::param_type param_type;4522 typedef typename _Eng::param_type param_type;
4372 __save_flags<_CharT, _Traits> __lx(__is);4523 __save_flags<_CharT, _Traits> __lx(__is);
4373 __is.flags(ios_base::dec | ios_base::skipws);4524 typedef basic_istream<_CharT, _Traits> _Istream;
4525 __is.flags(_Istream::dec | _Istream::skipws);
4374 result_type __mean;4526 result_type __mean;
4375 result_type __stddev;4527 result_type __stddev;
4376 result_type _Vp = 0;4528 result_type _Vp = 0;
...@@ -4437,9 +4589,18 @@ private:...@@ -4437,9 +4589,18 @@ private:
44374589
4438public:4590public:
4439 // constructor and reset functions4591 // constructor and reset functions
4592#ifndef _LIBCPP_CXX03_LANG
4593 _LIBCPP_INLINE_VISIBILITY
4594 lognormal_distribution() : lognormal_distribution(0) {}
4595 _LIBCPP_INLINE_VISIBILITY
4596 explicit lognormal_distribution(result_type __m, result_type __s = 1)
4597 : __p_(param_type(__m, __s)) {}
4598#else
4440 _LIBCPP_INLINE_VISIBILITY4599 _LIBCPP_INLINE_VISIBILITY
4441 explicit lognormal_distribution(result_type __m = 0, result_type __s = 1)4600 explicit lognormal_distribution(result_type __m = 0,
4601 result_type __s = 1)
4442 : __p_(param_type(__m, __s)) {}4602 : __p_(param_type(__m, __s)) {}
4603#endif
4443 _LIBCPP_INLINE_VISIBILITY4604 _LIBCPP_INLINE_VISIBILITY
4444 explicit lognormal_distribution(const param_type& __p)4605 explicit lognormal_distribution(const param_type& __p)
4445 : __p_(__p) {}4606 : __p_(__p) {}
...@@ -4557,8 +4718,17 @@ private:...@@ -4557,8 +4718,17 @@ private:
45574718
4558public:4719public:
4559 // constructors and reset functions4720 // constructors and reset functions
4721#ifndef _LIBCPP_CXX03_LANG
4722 _LIBCPP_INLINE_VISIBILITY
4723 poisson_distribution() : poisson_distribution(1.0) {}
4724 _LIBCPP_INLINE_VISIBILITY
4725 explicit poisson_distribution(double __mean)
4726 : __p_(__mean) {}
4727#else
4560 _LIBCPP_INLINE_VISIBILITY4728 _LIBCPP_INLINE_VISIBILITY
4561 explicit poisson_distribution(double __mean = 1.0) : __p_(__mean) {}4729 explicit poisson_distribution(double __mean = 1.0)
4730 : __p_(__mean) {}
4731#endif
4562 _LIBCPP_INLINE_VISIBILITY4732 _LIBCPP_INLINE_VISIBILITY
4563 explicit poisson_distribution(const param_type& __p) : __p_(__p) {}4733 explicit poisson_distribution(const param_type& __p) : __p_(__p) {}
4564 _LIBCPP_INLINE_VISIBILITY4734 _LIBCPP_INLINE_VISIBILITY
...@@ -4618,7 +4788,7 @@ poisson_distribution<_IntType>::param_type::param_type(double __mean)...@@ -4618,7 +4788,7 @@ poisson_distribution<_IntType>::param_type::param_type(double __mean)
4618 {4788 {
4619 __s_ = _VSTD::sqrt(__mean_);4789 __s_ = _VSTD::sqrt(__mean_);
4620 __d_ = 6 * __mean_ * __mean_;4790 __d_ = 6 * __mean_ * __mean_;
4621 __l_ = std::trunc(__mean_ - 1.1484);4791 __l_ = _VSTD::trunc(__mean_ - 1.1484);
4622 __omega_ = .3989423 / __s_;4792 __omega_ = .3989423 / __s_;
4623 double __b1_ = .4166667E-1 / __mean_;4793 double __b1_ = .4166667E-1 / __mean_;
4624 double __b2_ = .3 * __b1_ * __b1_;4794 double __b2_ = .3 * __b1_ * __b1_;
...@@ -4650,13 +4820,13 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr...@@ -4650,13 +4820,13 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr
4650 double __u;4820 double __u;
4651 if (__g > 0)4821 if (__g > 0)
4652 {4822 {
4653 __tx = std::trunc(__g);4823 __tx = _VSTD::trunc(__g);
4654 if (__tx >= __pr.__l_)4824 if (__tx >= __pr.__l_)
4655 return std::__clamp_to_integral<result_type>(__tx);4825 return _VSTD::__clamp_to_integral<result_type>(__tx);
4656 __difmuk = __pr.__mean_ - __tx;4826 __difmuk = __pr.__mean_ - __tx;
4657 __u = __urd(__urng);4827 __u = __urd(__urng);
4658 if (__pr.__d_ * __u >= __difmuk * __difmuk * __difmuk)4828 if (__pr.__d_ * __u >= __difmuk * __difmuk * __difmuk)
4659 return std::__clamp_to_integral<result_type>(__tx);4829 return _VSTD::__clamp_to_integral<result_type>(__tx);
4660 }4830 }
4661 exponential_distribution<double> __edist;4831 exponential_distribution<double> __edist;
4662 for (bool __using_exp_dist = false; true; __using_exp_dist = true)4832 for (bool __using_exp_dist = false; true; __using_exp_dist = true)
...@@ -4672,7 +4842,7 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr...@@ -4672,7 +4842,7 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr
4672 __u += __u - 1;4842 __u += __u - 1;
4673 __t = 1.8 + (__u < 0 ? -__e : __e);4843 __t = 1.8 + (__u < 0 ? -__e : __e);
4674 } while (__t <= -.6744);4844 } while (__t <= -.6744);
4675 __tx = std::trunc(__pr.__mean_ + __pr.__s_ * __t);4845 __tx = _VSTD::trunc(__pr.__mean_ + __pr.__s_ * __t);
4676 __difmuk = __pr.__mean_ - __tx;4846 __difmuk = __pr.__mean_ - __tx;
4677 __using_exp_dist = true;4847 __using_exp_dist = true;
4678 }4848 }
...@@ -4716,7 +4886,7 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr...@@ -4716,7 +4886,7 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr
4716 }4886 }
4717 }4887 }
4718 }4888 }
4719 return std::__clamp_to_integral<result_type>(__tx);4889 return _VSTD::__clamp_to_integral<result_type>(__tx);
4720}4890}
47214891
4722template <class _CharT, class _Traits, class _IntType>4892template <class _CharT, class _Traits, class _IntType>
...@@ -4725,8 +4895,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -4725,8 +4895,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
4725 const poisson_distribution<_IntType>& __x)4895 const poisson_distribution<_IntType>& __x)
4726{4896{
4727 __save_flags<_CharT, _Traits> __lx(__os);4897 __save_flags<_CharT, _Traits> __lx(__os);
4728 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |4898 typedef basic_ostream<_CharT, _Traits> _OStream;
4729 ios_base::scientific);4899 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
4900 _OStream::scientific);
4730 return __os << __x.mean();4901 return __os << __x.mean();
4731}4902}
47324903
...@@ -4738,7 +4909,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -4738,7 +4909,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
4738 typedef poisson_distribution<_IntType> _Eng;4909 typedef poisson_distribution<_IntType> _Eng;
4739 typedef typename _Eng::param_type param_type;4910 typedef typename _Eng::param_type param_type;
4740 __save_flags<_CharT, _Traits> __lx(__is);4911 __save_flags<_CharT, _Traits> __lx(__is);
4741 __is.flags(ios_base::dec | ios_base::skipws);4912 typedef basic_istream<_CharT, _Traits> _Istream;
4913 __is.flags(_Istream::dec | _Istream::skipws);
4742 double __mean;4914 double __mean;
4743 __is >> __mean;4915 __is >> __mean;
4744 if (!__is.fail())4916 if (!__is.fail())
...@@ -4784,9 +4956,17 @@ private:...@@ -4784,9 +4956,17 @@ private:
47844956
4785public:4957public:
4786 // constructor and reset functions4958 // constructor and reset functions
4959#ifndef _LIBCPP_CXX03_LANG
4960 _LIBCPP_INLINE_VISIBILITY
4961 weibull_distribution() : weibull_distribution(1) {}
4962 _LIBCPP_INLINE_VISIBILITY
4963 explicit weibull_distribution(result_type __a, result_type __b = 1)
4964 : __p_(param_type(__a, __b)) {}
4965#else
4787 _LIBCPP_INLINE_VISIBILITY4966 _LIBCPP_INLINE_VISIBILITY
4788 explicit weibull_distribution(result_type __a = 1, result_type __b = 1)4967 explicit weibull_distribution(result_type __a = 1, result_type __b = 1)
4789 : __p_(param_type(__a, __b)) {}4968 : __p_(param_type(__a, __b)) {}
4969#endif
4790 _LIBCPP_INLINE_VISIBILITY4970 _LIBCPP_INLINE_VISIBILITY
4791 explicit weibull_distribution(const param_type& __p)4971 explicit weibull_distribution(const param_type& __p)
4792 : __p_(__p) {}4972 : __p_(__p) {}
...@@ -4836,8 +5016,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -4836,8 +5016,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
4836 const weibull_distribution<_RT>& __x)5016 const weibull_distribution<_RT>& __x)
4837{5017{
4838 __save_flags<_CharT, _Traits> __lx(__os);5018 __save_flags<_CharT, _Traits> __lx(__os);
4839 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |5019 typedef basic_ostream<_CharT, _Traits> _OStream;
4840 ios_base::scientific);5020 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5021 _OStream::scientific);
4841 _CharT __sp = __os.widen(' ');5022 _CharT __sp = __os.widen(' ');
4842 __os.fill(__sp);5023 __os.fill(__sp);
4843 __os << __x.a() << __sp << __x.b();5024 __os << __x.a() << __sp << __x.b();
...@@ -4853,7 +5034,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -4853,7 +5034,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
4853 typedef typename _Eng::result_type result_type;5034 typedef typename _Eng::result_type result_type;
4854 typedef typename _Eng::param_type param_type;5035 typedef typename _Eng::param_type param_type;
4855 __save_flags<_CharT, _Traits> __lx(__is);5036 __save_flags<_CharT, _Traits> __lx(__is);
4856 __is.flags(ios_base::dec | ios_base::skipws);5037 typedef basic_istream<_CharT, _Traits> _Istream;
5038 __is.flags(_Istream::dec | _Istream::skipws);
4857 result_type __a;5039 result_type __a;
4858 result_type __b;5040 result_type __b;
4859 __is >> __a >> __b;5041 __is >> __a >> __b;
...@@ -4898,9 +5080,18 @@ private:...@@ -4898,9 +5080,18 @@ private:
48985080
4899public:5081public:
4900 // constructor and reset functions5082 // constructor and reset functions
5083#ifndef _LIBCPP_CXX03_LANG
5084 _LIBCPP_INLINE_VISIBILITY
5085 extreme_value_distribution() : extreme_value_distribution(0) {}
4901 _LIBCPP_INLINE_VISIBILITY5086 _LIBCPP_INLINE_VISIBILITY
4902 explicit extreme_value_distribution(result_type __a = 0, result_type __b = 1)5087 explicit extreme_value_distribution(result_type __a, result_type __b = 1)
4903 : __p_(param_type(__a, __b)) {}5088 : __p_(param_type(__a, __b)) {}
5089#else
5090 _LIBCPP_INLINE_VISIBILITY
5091 explicit extreme_value_distribution(result_type __a = 0,
5092 result_type __b = 1)
5093 : __p_(param_type(__a, __b)) {}
5094#endif
4904 _LIBCPP_INLINE_VISIBILITY5095 _LIBCPP_INLINE_VISIBILITY
4905 explicit extreme_value_distribution(const param_type& __p)5096 explicit extreme_value_distribution(const param_type& __p)
4906 : __p_(__p) {}5097 : __p_(__p) {}
...@@ -4955,8 +5146,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -4955,8 +5146,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
4955 const extreme_value_distribution<_RT>& __x)5146 const extreme_value_distribution<_RT>& __x)
4956{5147{
4957 __save_flags<_CharT, _Traits> __lx(__os);5148 __save_flags<_CharT, _Traits> __lx(__os);
4958 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |5149 typedef basic_ostream<_CharT, _Traits> _OStream;
4959 ios_base::scientific);5150 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5151 _OStream::scientific);
4960 _CharT __sp = __os.widen(' ');5152 _CharT __sp = __os.widen(' ');
4961 __os.fill(__sp);5153 __os.fill(__sp);
4962 __os << __x.a() << __sp << __x.b();5154 __os << __x.a() << __sp << __x.b();
...@@ -4972,7 +5164,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -4972,7 +5164,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
4972 typedef typename _Eng::result_type result_type;5164 typedef typename _Eng::result_type result_type;
4973 typedef typename _Eng::param_type param_type;5165 typedef typename _Eng::param_type param_type;
4974 __save_flags<_CharT, _Traits> __lx(__is);5166 __save_flags<_CharT, _Traits> __lx(__is);
4975 __is.flags(ios_base::dec | ios_base::skipws);5167 typedef basic_istream<_CharT, _Traits> _Istream;
5168 __is.flags(_Istream::dec | _Istream::skipws);
4976 result_type __a;5169 result_type __a;
4977 result_type __b;5170 result_type __b;
4978 __is >> __a >> __b;5171 __is >> __a >> __b;
...@@ -5019,9 +5212,18 @@ private:...@@ -5019,9 +5212,18 @@ private:
50195212
5020public:5213public:
5021 // constructors and reset functions5214 // constructors and reset functions
5215#ifndef _LIBCPP_CXX03_LANG
5216 _LIBCPP_INLINE_VISIBILITY
5217 gamma_distribution() : gamma_distribution(1) {}
5022 _LIBCPP_INLINE_VISIBILITY5218 _LIBCPP_INLINE_VISIBILITY
5023 explicit gamma_distribution(result_type __alpha = 1, result_type __beta = 1)5219 explicit gamma_distribution(result_type __alpha, result_type __beta = 1)
5024 : __p_(param_type(__alpha, __beta)) {}5220 : __p_(param_type(__alpha, __beta)) {}
5221#else
5222 _LIBCPP_INLINE_VISIBILITY
5223 explicit gamma_distribution(result_type __alpha = 1,
5224 result_type __beta = 1)
5225 : __p_(param_type(__alpha, __beta)) {}
5226#endif
5025 _LIBCPP_INLINE_VISIBILITY5227 _LIBCPP_INLINE_VISIBILITY
5026 explicit gamma_distribution(const param_type& __p)5228 explicit gamma_distribution(const param_type& __p)
5027 : __p_(__p) {}5229 : __p_(__p) {}
...@@ -5127,8 +5329,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -5127,8 +5329,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
5127 const gamma_distribution<_RT>& __x)5329 const gamma_distribution<_RT>& __x)
5128{5330{
5129 __save_flags<_CharT, _Traits> __lx(__os);5331 __save_flags<_CharT, _Traits> __lx(__os);
5130 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |5332 typedef basic_ostream<_CharT, _Traits> _OStream;
5131 ios_base::scientific);5333 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5334 _OStream::scientific);
5132 _CharT __sp = __os.widen(' ');5335 _CharT __sp = __os.widen(' ');
5133 __os.fill(__sp);5336 __os.fill(__sp);
5134 __os << __x.alpha() << __sp << __x.beta();5337 __os << __x.alpha() << __sp << __x.beta();
...@@ -5144,7 +5347,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -5144,7 +5347,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
5144 typedef typename _Eng::result_type result_type;5347 typedef typename _Eng::result_type result_type;
5145 typedef typename _Eng::param_type param_type;5348 typedef typename _Eng::param_type param_type;
5146 __save_flags<_CharT, _Traits> __lx(__is);5349 __save_flags<_CharT, _Traits> __lx(__is);
5147 __is.flags(ios_base::dec | ios_base::skipws);5350 typedef basic_istream<_CharT, _Traits> _Istream;
5351 __is.flags(_Istream::dec | _Istream::skipws);
5148 result_type __alpha;5352 result_type __alpha;
5149 result_type __beta;5353 result_type __beta;
5150 __is >> __alpha >> __beta;5354 __is >> __alpha >> __beta;
...@@ -5191,9 +5395,18 @@ private:...@@ -5191,9 +5395,18 @@ private:
51915395
5192public:5396public:
5193 // constructor and reset functions5397 // constructor and reset functions
5398#ifndef _LIBCPP_CXX03_LANG
5399 _LIBCPP_INLINE_VISIBILITY
5400 negative_binomial_distribution() : negative_binomial_distribution(1) {}
5194 _LIBCPP_INLINE_VISIBILITY5401 _LIBCPP_INLINE_VISIBILITY
5195 explicit negative_binomial_distribution(result_type __k = 1, double __p = 0.5)5402 explicit negative_binomial_distribution(result_type __k, double __p = 0.5)
5196 : __p_(__k, __p) {}5403 : __p_(__k, __p) {}
5404#else
5405 _LIBCPP_INLINE_VISIBILITY
5406 explicit negative_binomial_distribution(result_type __k = 1,
5407 double __p = 0.5)
5408 : __p_(__k, __p) {}
5409#endif
5197 _LIBCPP_INLINE_VISIBILITY5410 _LIBCPP_INLINE_VISIBILITY
5198 explicit negative_binomial_distribution(const param_type& __p) : __p_(__p) {}5411 explicit negative_binomial_distribution(const param_type& __p) : __p_(__p) {}
5199 _LIBCPP_INLINE_VISIBILITY5412 _LIBCPP_INLINE_VISIBILITY
...@@ -5263,8 +5476,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -5263,8 +5476,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
5263 const negative_binomial_distribution<_IntType>& __x)5476 const negative_binomial_distribution<_IntType>& __x)
5264{5477{
5265 __save_flags<_CharT, _Traits> __lx(__os);5478 __save_flags<_CharT, _Traits> __lx(__os);
5266 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |5479 typedef basic_ostream<_CharT, _Traits> _OStream;
5267 ios_base::scientific);5480 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5481 _OStream::scientific);
5268 _CharT __sp = __os.widen(' ');5482 _CharT __sp = __os.widen(' ');
5269 __os.fill(__sp);5483 __os.fill(__sp);
5270 return __os << __x.k() << __sp << __x.p();5484 return __os << __x.k() << __sp << __x.p();
...@@ -5279,7 +5493,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -5279,7 +5493,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
5279 typedef typename _Eng::result_type result_type;5493 typedef typename _Eng::result_type result_type;
5280 typedef typename _Eng::param_type param_type;5494 typedef typename _Eng::param_type param_type;
5281 __save_flags<_CharT, _Traits> __lx(__is);5495 __save_flags<_CharT, _Traits> __lx(__is);
5282 __is.flags(ios_base::dec | ios_base::skipws);5496 typedef basic_istream<_CharT, _Traits> _Istream;
5497 __is.flags(_Istream::dec | _Istream::skipws);
5283 result_type __k;5498 result_type __k;
5284 double __p;5499 double __p;
5285 __is >> __k >> __p;5500 __is >> __k >> __p;
...@@ -5322,8 +5537,17 @@ private:...@@ -5322,8 +5537,17 @@ private:
53225537
5323public:5538public:
5324 // constructors and reset functions5539 // constructors and reset functions
5540#ifndef _LIBCPP_CXX03_LANG
5325 _LIBCPP_INLINE_VISIBILITY5541 _LIBCPP_INLINE_VISIBILITY
5326 explicit geometric_distribution(double __p = 0.5) : __p_(__p) {}5542 geometric_distribution() : geometric_distribution(0.5) {}
5543 _LIBCPP_INLINE_VISIBILITY
5544 explicit geometric_distribution(double __p)
5545 : __p_(__p) {}
5546#else
5547 _LIBCPP_INLINE_VISIBILITY
5548 explicit geometric_distribution(double __p = 0.5)
5549 : __p_(__p) {}
5550#endif
5327 _LIBCPP_INLINE_VISIBILITY5551 _LIBCPP_INLINE_VISIBILITY
5328 explicit geometric_distribution(const param_type& __p) : __p_(__p) {}5552 explicit geometric_distribution(const param_type& __p) : __p_(__p) {}
5329 _LIBCPP_INLINE_VISIBILITY5553 _LIBCPP_INLINE_VISIBILITY
...@@ -5369,8 +5593,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -5369,8 +5593,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
5369 const geometric_distribution<_IntType>& __x)5593 const geometric_distribution<_IntType>& __x)
5370{5594{
5371 __save_flags<_CharT, _Traits> __lx(__os);5595 __save_flags<_CharT, _Traits> __lx(__os);
5372 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |5596 typedef basic_ostream<_CharT, _Traits> _OStream;
5373 ios_base::scientific);5597 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5598 _OStream::scientific);
5374 return __os << __x.p();5599 return __os << __x.p();
5375}5600}
53765601
...@@ -5382,7 +5607,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -5382,7 +5607,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
5382 typedef geometric_distribution<_IntType> _Eng;5607 typedef geometric_distribution<_IntType> _Eng;
5383 typedef typename _Eng::param_type param_type;5608 typedef typename _Eng::param_type param_type;
5384 __save_flags<_CharT, _Traits> __lx(__is);5609 __save_flags<_CharT, _Traits> __lx(__is);
5385 __is.flags(ios_base::dec | ios_base::skipws);5610 typedef basic_istream<_CharT, _Traits> _Istream;
5611 __is.flags(_Istream::dec | _Istream::skipws);
5386 double __p;5612 double __p;
5387 __is >> __p;5613 __is >> __p;
5388 if (!__is.fail())5614 if (!__is.fail())
...@@ -5424,9 +5650,17 @@ private:...@@ -5424,9 +5650,17 @@ private:
54245650
5425public:5651public:
5426 // constructor and reset functions5652 // constructor and reset functions
5653#ifndef _LIBCPP_CXX03_LANG
5654 _LIBCPP_INLINE_VISIBILITY
5655 chi_squared_distribution() : chi_squared_distribution(1) {}
5656 _LIBCPP_INLINE_VISIBILITY
5657 explicit chi_squared_distribution(result_type __n)
5658 : __p_(param_type(__n)) {}
5659#else
5427 _LIBCPP_INLINE_VISIBILITY5660 _LIBCPP_INLINE_VISIBILITY
5428 explicit chi_squared_distribution(result_type __n = 1)5661 explicit chi_squared_distribution(result_type __n = 1)
5429 : __p_(param_type(__n)) {}5662 : __p_(param_type(__n)) {}
5663#endif
5430 _LIBCPP_INLINE_VISIBILITY5664 _LIBCPP_INLINE_VISIBILITY
5431 explicit chi_squared_distribution(const param_type& __p)5665 explicit chi_squared_distribution(const param_type& __p)
5432 : __p_(__p) {}5666 : __p_(__p) {}
...@@ -5473,8 +5707,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -5473,8 +5707,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
5473 const chi_squared_distribution<_RT>& __x)5707 const chi_squared_distribution<_RT>& __x)
5474{5708{
5475 __save_flags<_CharT, _Traits> __lx(__os);5709 __save_flags<_CharT, _Traits> __lx(__os);
5476 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |5710 typedef basic_ostream<_CharT, _Traits> _OStream;
5477 ios_base::scientific);5711 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5712 _OStream::scientific);
5478 __os << __x.n();5713 __os << __x.n();
5479 return __os;5714 return __os;
5480}5715}
...@@ -5488,7 +5723,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -5488,7 +5723,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
5488 typedef typename _Eng::result_type result_type;5723 typedef typename _Eng::result_type result_type;
5489 typedef typename _Eng::param_type param_type;5724 typedef typename _Eng::param_type param_type;
5490 __save_flags<_CharT, _Traits> __lx(__is);5725 __save_flags<_CharT, _Traits> __lx(__is);
5491 __is.flags(ios_base::dec | ios_base::skipws);5726 typedef basic_istream<_CharT, _Traits> _Istream;
5727 __is.flags(_Istream::dec | _Istream::skipws);
5492 result_type __n;5728 result_type __n;
5493 __is >> __n;5729 __is >> __n;
5494 if (!__is.fail())5730 if (!__is.fail())
...@@ -5534,9 +5770,17 @@ private:...@@ -5534,9 +5770,17 @@ private:
55345770
5535public:5771public:
5536 // constructor and reset functions5772 // constructor and reset functions
5773#ifndef _LIBCPP_CXX03_LANG
5774 _LIBCPP_INLINE_VISIBILITY
5775 cauchy_distribution() : cauchy_distribution(0) {}
5776 _LIBCPP_INLINE_VISIBILITY
5777 explicit cauchy_distribution(result_type __a, result_type __b = 1)
5778 : __p_(param_type(__a, __b)) {}
5779#else
5537 _LIBCPP_INLINE_VISIBILITY5780 _LIBCPP_INLINE_VISIBILITY
5538 explicit cauchy_distribution(result_type __a = 0, result_type __b = 1)5781 explicit cauchy_distribution(result_type __a = 0, result_type __b = 1)
5539 : __p_(param_type(__a, __b)) {}5782 : __p_(param_type(__a, __b)) {}
5783#endif
5540 _LIBCPP_INLINE_VISIBILITY5784 _LIBCPP_INLINE_VISIBILITY
5541 explicit cauchy_distribution(const param_type& __p)5785 explicit cauchy_distribution(const param_type& __p)
5542 : __p_(__p) {}5786 : __p_(__p) {}
...@@ -5593,8 +5837,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -5593,8 +5837,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
5593 const cauchy_distribution<_RT>& __x)5837 const cauchy_distribution<_RT>& __x)
5594{5838{
5595 __save_flags<_CharT, _Traits> __lx(__os);5839 __save_flags<_CharT, _Traits> __lx(__os);
5596 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |5840 typedef basic_ostream<_CharT, _Traits> _OStream;
5597 ios_base::scientific);5841 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5842 _OStream::scientific);
5598 _CharT __sp = __os.widen(' ');5843 _CharT __sp = __os.widen(' ');
5599 __os.fill(__sp);5844 __os.fill(__sp);
5600 __os << __x.a() << __sp << __x.b();5845 __os << __x.a() << __sp << __x.b();
...@@ -5610,7 +5855,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -5610,7 +5855,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
5610 typedef typename _Eng::result_type result_type;5855 typedef typename _Eng::result_type result_type;
5611 typedef typename _Eng::param_type param_type;5856 typedef typename _Eng::param_type param_type;
5612 __save_flags<_CharT, _Traits> __lx(__is);5857 __save_flags<_CharT, _Traits> __lx(__is);
5613 __is.flags(ios_base::dec | ios_base::skipws);5858 typedef basic_istream<_CharT, _Traits> _Istream;
5859 __is.flags(_Istream::dec | _Istream::skipws);
5614 result_type __a;5860 result_type __a;
5615 result_type __b;5861 result_type __b;
5616 __is >> __a >> __b;5862 __is >> __a >> __b;
...@@ -5657,9 +5903,17 @@ private:...@@ -5657,9 +5903,17 @@ private:
56575903
5658public:5904public:
5659 // constructor and reset functions5905 // constructor and reset functions
5906#ifndef _LIBCPP_CXX03_LANG
5907 _LIBCPP_INLINE_VISIBILITY
5908 fisher_f_distribution() : fisher_f_distribution(1) {}
5909 _LIBCPP_INLINE_VISIBILITY
5910 explicit fisher_f_distribution(result_type __m, result_type __n = 1)
5911 : __p_(param_type(__m, __n)) {}
5912#else
5660 _LIBCPP_INLINE_VISIBILITY5913 _LIBCPP_INLINE_VISIBILITY
5661 explicit fisher_f_distribution(result_type __m = 1, result_type __n = 1)5914 explicit fisher_f_distribution(result_type __m = 1, result_type __n = 1)
5662 : __p_(param_type(__m, __n)) {}5915 : __p_(param_type(__m, __n)) {}
5916#endif
5663 _LIBCPP_INLINE_VISIBILITY5917 _LIBCPP_INLINE_VISIBILITY
5664 explicit fisher_f_distribution(const param_type& __p)5918 explicit fisher_f_distribution(const param_type& __p)
5665 : __p_(__p) {}5919 : __p_(__p) {}
...@@ -5715,8 +5969,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -5715,8 +5969,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
5715 const fisher_f_distribution<_RT>& __x)5969 const fisher_f_distribution<_RT>& __x)
5716{5970{
5717 __save_flags<_CharT, _Traits> __lx(__os);5971 __save_flags<_CharT, _Traits> __lx(__os);
5718 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |5972 typedef basic_ostream<_CharT, _Traits> _OStream;
5719 ios_base::scientific);5973 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5974 _OStream::scientific);
5720 _CharT __sp = __os.widen(' ');5975 _CharT __sp = __os.widen(' ');
5721 __os.fill(__sp);5976 __os.fill(__sp);
5722 __os << __x.m() << __sp << __x.n();5977 __os << __x.m() << __sp << __x.n();
...@@ -5732,7 +5987,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -5732,7 +5987,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
5732 typedef typename _Eng::result_type result_type;5987 typedef typename _Eng::result_type result_type;
5733 typedef typename _Eng::param_type param_type;5988 typedef typename _Eng::param_type param_type;
5734 __save_flags<_CharT, _Traits> __lx(__is);5989 __save_flags<_CharT, _Traits> __lx(__is);
5735 __is.flags(ios_base::dec | ios_base::skipws);5990 typedef basic_istream<_CharT, _Traits> _Istream;
5991 __is.flags(_Istream::dec | _Istream::skipws);
5736 result_type __m;5992 result_type __m;
5737 result_type __n;5993 result_type __n;
5738 __is >> __m >> __n;5994 __is >> __m >> __n;
...@@ -5776,9 +6032,17 @@ private:...@@ -5776,9 +6032,17 @@ private:
57766032
5777public:6033public:
5778 // constructor and reset functions6034 // constructor and reset functions
6035#ifndef _LIBCPP_CXX03_LANG
6036 _LIBCPP_INLINE_VISIBILITY
6037 student_t_distribution() : student_t_distribution(1) {}
6038 _LIBCPP_INLINE_VISIBILITY
6039 explicit student_t_distribution(result_type __n)
6040 : __p_(param_type(__n)) {}
6041#else
5779 _LIBCPP_INLINE_VISIBILITY6042 _LIBCPP_INLINE_VISIBILITY
5780 explicit student_t_distribution(result_type __n = 1)6043 explicit student_t_distribution(result_type __n = 1)
5781 : __p_(param_type(__n)) {}6044 : __p_(param_type(__n)) {}
6045#endif
5782 _LIBCPP_INLINE_VISIBILITY6046 _LIBCPP_INLINE_VISIBILITY
5783 explicit student_t_distribution(const param_type& __p)6047 explicit student_t_distribution(const param_type& __p)
5784 : __p_(__p) {}6048 : __p_(__p) {}
...@@ -5831,8 +6095,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -5831,8 +6095,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
5831 const student_t_distribution<_RT>& __x)6095 const student_t_distribution<_RT>& __x)
5832{6096{
5833 __save_flags<_CharT, _Traits> __lx(__os);6097 __save_flags<_CharT, _Traits> __lx(__os);
5834 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |6098 typedef basic_ostream<_CharT, _Traits> _OStream;
5835 ios_base::scientific);6099 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
6100 _OStream::scientific);
5836 __os << __x.n();6101 __os << __x.n();
5837 return __os;6102 return __os;
5838}6103}
...@@ -5846,7 +6111,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -5846,7 +6111,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
5846 typedef typename _Eng::result_type result_type;6111 typedef typename _Eng::result_type result_type;
5847 typedef typename _Eng::param_type param_type;6112 typedef typename _Eng::param_type param_type;
5848 __save_flags<_CharT, _Traits> __lx(__is);6113 __save_flags<_CharT, _Traits> __lx(__is);
5849 __is.flags(ios_base::dec | ios_base::skipws);6114 typedef basic_istream<_CharT, _Traits> _Istream;
6115 __is.flags(_Istream::dec | _Istream::skipws);
5850 result_type __n;6116 result_type __n;
5851 __is >> __n;6117 __is >> __n;
5852 if (!__is.fail())6118 if (!__is.fail())
...@@ -6054,8 +6320,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -6054,8 +6320,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
6054 const discrete_distribution<_IT>& __x)6320 const discrete_distribution<_IT>& __x)
6055{6321{
6056 __save_flags<_CharT, _Traits> __lx(__os);6322 __save_flags<_CharT, _Traits> __lx(__os);
6057 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |6323 typedef basic_ostream<_CharT, _Traits> _OStream;
6058 ios_base::scientific);6324 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
6325 _OStream::scientific);
6059 _CharT __sp = __os.widen(' ');6326 _CharT __sp = __os.widen(' ');
6060 __os.fill(__sp);6327 __os.fill(__sp);
6061 size_t __n = __x.__p_.__p_.size();6328 size_t __n = __x.__p_.__p_.size();
...@@ -6071,7 +6338,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -6071,7 +6338,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
6071 discrete_distribution<_IT>& __x)6338 discrete_distribution<_IT>& __x)
6072{6339{
6073 __save_flags<_CharT, _Traits> __lx(__is);6340 __save_flags<_CharT, _Traits> __lx(__is);
6074 __is.flags(ios_base::dec | ios_base::skipws);6341 typedef basic_istream<_CharT, _Traits> _Istream;
6342 __is.flags(_Istream::dec | _Istream::skipws);
6075 size_t __n;6343 size_t __n;
6076 __is >> __n;6344 __is >> __n;
6077 vector<double> __p(__n);6345 vector<double> __p(__n);
...@@ -6356,8 +6624,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -6356,8 +6624,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
6356 const piecewise_constant_distribution<_RT>& __x)6624 const piecewise_constant_distribution<_RT>& __x)
6357{6625{
6358 __save_flags<_CharT, _Traits> __lx(__os);6626 __save_flags<_CharT, _Traits> __lx(__os);
6359 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |6627 typedef basic_ostream<_CharT, _Traits> _OStream;
6360 ios_base::scientific);6628 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
6629 _OStream::scientific);
6361 _CharT __sp = __os.widen(' ');6630 _CharT __sp = __os.widen(' ');
6362 __os.fill(__sp);6631 __os.fill(__sp);
6363 size_t __n = __x.__p_.__b_.size();6632 size_t __n = __x.__p_.__b_.size();
...@@ -6383,7 +6652,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -6383,7 +6652,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
6383 typedef piecewise_constant_distribution<_RT> _Eng;6652 typedef piecewise_constant_distribution<_RT> _Eng;
6384 typedef typename _Eng::result_type result_type;6653 typedef typename _Eng::result_type result_type;
6385 __save_flags<_CharT, _Traits> __lx(__is);6654 __save_flags<_CharT, _Traits> __lx(__is);
6386 __is.flags(ios_base::dec | ios_base::skipws);6655 typedef basic_istream<_CharT, _Traits> _Istream;
6656 __is.flags(_Istream::dec | _Istream::skipws);
6387 size_t __n;6657 size_t __n;
6388 __is >> __n;6658 __is >> __n;
6389 vector<result_type> __b(__n);6659 vector<result_type> __b(__n);
...@@ -6696,8 +6966,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,...@@ -6696,8 +6966,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
6696 const piecewise_linear_distribution<_RT>& __x)6966 const piecewise_linear_distribution<_RT>& __x)
6697{6967{
6698 __save_flags<_CharT, _Traits> __lx(__os);6968 __save_flags<_CharT, _Traits> __lx(__os);
6699 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |6969 typedef basic_ostream<_CharT, _Traits> _OStream;
6700 ios_base::scientific);6970 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
6971 _OStream::scientific);
6701 _CharT __sp = __os.widen(' ');6972 _CharT __sp = __os.widen(' ');
6702 __os.fill(__sp);6973 __os.fill(__sp);
6703 size_t __n = __x.__p_.__b_.size();6974 size_t __n = __x.__p_.__b_.size();
...@@ -6723,7 +6994,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,...@@ -6723,7 +6994,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
6723 typedef piecewise_linear_distribution<_RT> _Eng;6994 typedef piecewise_linear_distribution<_RT> _Eng;
6724 typedef typename _Eng::result_type result_type;6995 typedef typename _Eng::result_type result_type;
6725 __save_flags<_CharT, _Traits> __lx(__is);6996 __save_flags<_CharT, _Traits> __lx(__is);
6726 __is.flags(ios_base::dec | ios_base::skipws);6997 typedef basic_istream<_CharT, _Traits> _Istream;
6998 __is.flags(_Istream::dec | _Istream::skipws);
6727 size_t __n;6999 size_t __n;
6728 __is >> __n;7000 __is >> __n;
6729 vector<result_type> __b(__n);7001 vector<result_type> __b(__n);
lib/libcxx/include/regex+131-52
...@@ -32,7 +32,8 @@ enum syntax_option_type...@@ -32,7 +32,8 @@ enum syntax_option_type
32 extended = unspecified,32 extended = unspecified,
33 awk = unspecified,33 awk = unspecified,
34 grep = unspecified,34 grep = unspecified,
35 egrep = unspecified35 egrep = unspecified,
36 multiline = unspecified
36};37};
3738
38constexpr syntax_option_type operator~(syntax_option_type f);39constexpr syntax_option_type operator~(syntax_option_type f);
...@@ -142,6 +143,7 @@ public:...@@ -142,6 +143,7 @@ public:
142 static constexpr regex_constants::syntax_option_type awk = regex_constants::awk;143 static constexpr regex_constants::syntax_option_type awk = regex_constants::awk;
143 static constexpr regex_constants::syntax_option_type grep = regex_constants::grep;144 static constexpr regex_constants::syntax_option_type grep = regex_constants::grep;
144 static constexpr regex_constants::syntax_option_type egrep = regex_constants::egrep;145 static constexpr regex_constants::syntax_option_type egrep = regex_constants::egrep;
146 static constexpr regex_constants::syntax_option_type multiline = regex_constants::multiline;
145147
146 // construct/copy/destroy:148 // construct/copy/destroy:
147 basic_regex();149 basic_regex();
...@@ -453,7 +455,9 @@ public:...@@ -453,7 +455,9 @@ public:
453 typedef basic_string<char_type> string_type;455 typedef basic_string<char_type> string_type;
454456
455 // construct/copy/destroy:457 // construct/copy/destroy:
456 explicit match_results(const Allocator& a = Allocator());458 explicit match_results(const Allocator& a = Allocator()); // before C++20
459 match_results() : match_results(Allocator()) {} // C++20
460 explicit match_results(const Allocator& a); // C++20
457 match_results(const match_results& m);461 match_results(const match_results& m);
458 match_results(match_results&& m) noexcept;462 match_results(match_results&& m) noexcept;
459 match_results& operator=(const match_results& m);463 match_results& operator=(const match_results& m);
...@@ -802,7 +806,9 @@ enum syntax_option_type...@@ -802,7 +806,9 @@ enum syntax_option_type
802 extended = 1 << 5,806 extended = 1 << 5,
803 awk = 1 << 6,807 awk = 1 << 6,
804 grep = 1 << 7,808 grep = 1 << 7,
805 egrep = 1 << 8809 egrep = 1 << 8,
810 // 1 << 9 may be used by ECMAScript
811 multiline = 1 << 10
806};812};
807813
808inline _LIBCPP_CONSTEXPR814inline _LIBCPP_CONSTEXPR
...@@ -1982,24 +1988,33 @@ __word_boundary<_CharT, _Traits>::__exec(__state& __s) const...@@ -1982,24 +1988,33 @@ __word_boundary<_CharT, _Traits>::__exec(__state& __s) const
1982// __l_anchor1988// __l_anchor
19831989
1984template <class _CharT>1990template <class _CharT>
1985class __l_anchor1991_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
1992bool __is_eol(_CharT c)
1993{
1994 return c == '\r' || c == '\n';
1995}
1996
1997template <class _CharT>
1998class __l_anchor_multiline
1986 : public __owns_one_state<_CharT>1999 : public __owns_one_state<_CharT>
1987{2000{
1988 typedef __owns_one_state<_CharT> base;2001 typedef __owns_one_state<_CharT> base;
19892002
2003 bool __multiline;
2004
1990public:2005public:
1991 typedef _VSTD::__state<_CharT> __state;2006 typedef _VSTD::__state<_CharT> __state;
19922007
1993 _LIBCPP_INLINE_VISIBILITY2008 _LIBCPP_INLINE_VISIBILITY
1994 __l_anchor(__node<_CharT>* __s)2009 __l_anchor_multiline(bool __multiline, __node<_CharT>* __s)
1995 : base(__s) {}2010 : base(__s), __multiline(__multiline) {}
19962011
1997 virtual void __exec(__state&) const;2012 virtual void __exec(__state&) const;
1998};2013};
19992014
2000template <class _CharT>2015template <class _CharT>
2001void2016void
2002__l_anchor<_CharT>::__exec(__state& __s) const2017__l_anchor_multiline<_CharT>::__exec(__state& __s) const
2003{2018{
2004 if (__s.__at_first_ && __s.__current_ == __s.__first_ &&2019 if (__s.__at_first_ && __s.__current_ == __s.__first_ &&
2005 !(__s.__flags_ & regex_constants::match_not_bol))2020 !(__s.__flags_ & regex_constants::match_not_bol))
...@@ -2007,6 +2022,13 @@ __l_anchor<_CharT>::__exec(__state& __s) const...@@ -2007,6 +2022,13 @@ __l_anchor<_CharT>::__exec(__state& __s) const
2007 __s.__do_ = __state::__accept_but_not_consume;2022 __s.__do_ = __state::__accept_but_not_consume;
2008 __s.__node_ = this->first();2023 __s.__node_ = this->first();
2009 }2024 }
2025 else if (__multiline &&
2026 !__s.__at_first_ &&
2027 __is_eol(*_VSTD::prev(__s.__current_)))
2028 {
2029 __s.__do_ = __state::__accept_but_not_consume;
2030 __s.__node_ = this->first();
2031 }
2010 else2032 else
2011 {2033 {
2012 __s.__do_ = __state::__reject;2034 __s.__do_ = __state::__reject;
...@@ -2017,24 +2039,26 @@ __l_anchor<_CharT>::__exec(__state& __s) const...@@ -2017,24 +2039,26 @@ __l_anchor<_CharT>::__exec(__state& __s) const
2017// __r_anchor2039// __r_anchor
20182040
2019template <class _CharT>2041template <class _CharT>
2020class __r_anchor2042class __r_anchor_multiline
2021 : public __owns_one_state<_CharT>2043 : public __owns_one_state<_CharT>
2022{2044{
2023 typedef __owns_one_state<_CharT> base;2045 typedef __owns_one_state<_CharT> base;
20242046
2047 bool __multiline;
2048
2025public:2049public:
2026 typedef _VSTD::__state<_CharT> __state;2050 typedef _VSTD::__state<_CharT> __state;
20272051
2028 _LIBCPP_INLINE_VISIBILITY2052 _LIBCPP_INLINE_VISIBILITY
2029 __r_anchor(__node<_CharT>* __s)2053 __r_anchor_multiline(bool __multiline, __node<_CharT>* __s)
2030 : base(__s) {}2054 : base(__s), __multiline(__multiline) {}
20312055
2032 virtual void __exec(__state&) const;2056 virtual void __exec(__state&) const;
2033};2057};
20342058
2035template <class _CharT>2059template <class _CharT>
2036void2060void
2037__r_anchor<_CharT>::__exec(__state& __s) const2061__r_anchor_multiline<_CharT>::__exec(__state& __s) const
2038{2062{
2039 if (__s.__current_ == __s.__last_ &&2063 if (__s.__current_ == __s.__last_ &&
2040 !(__s.__flags_ & regex_constants::match_not_eol))2064 !(__s.__flags_ & regex_constants::match_not_eol))
...@@ -2042,6 +2066,11 @@ __r_anchor<_CharT>::__exec(__state& __s) const...@@ -2042,6 +2066,11 @@ __r_anchor<_CharT>::__exec(__state& __s) const
2042 __s.__do_ = __state::__accept_but_not_consume;2066 __s.__do_ = __state::__accept_but_not_consume;
2043 __s.__node_ = this->first();2067 __s.__node_ = this->first();
2044 }2068 }
2069 else if (__multiline && __is_eol(*__s.__current_))
2070 {
2071 __s.__do_ = __state::__accept_but_not_consume;
2072 __s.__node_ = this->first();
2073 }
2045 else2074 else
2046 {2075 {
2047 __s.__do_ = __state::__reject;2076 __s.__do_ = __state::__reject;
...@@ -2448,7 +2477,7 @@ __bracket_expression<_CharT, _Traits>::__exec(__state& __s) const...@@ -2448,7 +2477,7 @@ __bracket_expression<_CharT, _Traits>::__exec(__state& __s) const
2448 {2477 {
2449 const bool __in_neg_mask = __traits_.isctype(__ch, __neg_mask_);2478 const bool __in_neg_mask = __traits_.isctype(__ch, __neg_mask_);
2450 const bool __in_neg_chars =2479 const bool __in_neg_chars =
2451 std::find(__neg_chars_.begin(), __neg_chars_.end(), __ch) !=2480 _VSTD::find(__neg_chars_.begin(), __neg_chars_.end(), __ch) !=
2452 __neg_chars_.end();2481 __neg_chars_.end();
2453 if (!(__in_neg_mask || __in_neg_chars))2482 if (!(__in_neg_mask || __in_neg_chars))
2454 {2483 {
...@@ -2507,7 +2536,17 @@ __exit:...@@ -2507,7 +2536,17 @@ __exit:
2507template <class _CharT, class _Traits> class __lookahead;2536template <class _CharT, class _Traits> class __lookahead;
25082537
2509template <class _CharT, class _Traits = regex_traits<_CharT> >2538template <class _CharT, class _Traits = regex_traits<_CharT> >
2510class _LIBCPP_TEMPLATE_VIS basic_regex2539 class _LIBCPP_TEMPLATE_VIS basic_regex;
2540
2541typedef basic_regex<char> regex;
2542typedef basic_regex<wchar_t> wregex;
2543
2544template <class _CharT, class _Traits>
2545class
2546 _LIBCPP_TEMPLATE_VIS
2547 _LIBCPP_PREFERRED_NAME(regex)
2548 _LIBCPP_PREFERRED_NAME(wregex)
2549 basic_regex
2511{2550{
2512public:2551public:
2513 // types:2552 // types:
...@@ -2541,17 +2580,18 @@ public:...@@ -2541,17 +2580,18 @@ public:
2541 static const regex_constants::syntax_option_type awk = regex_constants::awk;2580 static const regex_constants::syntax_option_type awk = regex_constants::awk;
2542 static const regex_constants::syntax_option_type grep = regex_constants::grep;2581 static const regex_constants::syntax_option_type grep = regex_constants::grep;
2543 static const regex_constants::syntax_option_type egrep = regex_constants::egrep;2582 static const regex_constants::syntax_option_type egrep = regex_constants::egrep;
2583 static const regex_constants::syntax_option_type multiline = regex_constants::multiline;
25442584
2545 // construct/copy/destroy:2585 // construct/copy/destroy:
2546 _LIBCPP_INLINE_VISIBILITY2586 _LIBCPP_INLINE_VISIBILITY
2547 basic_regex()2587 basic_regex()
2548 : __flags_(regex_constants::ECMAScript), __marked_count_(0), __loop_count_(0), __open_count_(0),2588 : __flags_(regex_constants::ECMAScript), __marked_count_(0), __loop_count_(0), __open_count_(0),
2549 __end_(0)2589 __end_(nullptr)
2550 {}2590 {}
2551 _LIBCPP_INLINE_VISIBILITY2591 _LIBCPP_INLINE_VISIBILITY
2552 explicit basic_regex(const value_type* __p, flag_type __f = regex_constants::ECMAScript)2592 explicit basic_regex(const value_type* __p, flag_type __f = regex_constants::ECMAScript)
2553 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),2593 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
2554 __end_(0)2594 __end_(nullptr)
2555 {2595 {
2556 __init(__p, __p + __traits_.length(__p));2596 __init(__p, __p + __traits_.length(__p));
2557 }2597 }
...@@ -2559,7 +2599,7 @@ public:...@@ -2559,7 +2599,7 @@ public:
2559 _LIBCPP_INLINE_VISIBILITY2599 _LIBCPP_INLINE_VISIBILITY
2560 basic_regex(const value_type* __p, size_t __len, flag_type __f = regex_constants::ECMAScript)2600 basic_regex(const value_type* __p, size_t __len, flag_type __f = regex_constants::ECMAScript)
2561 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),2601 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
2562 __end_(0)2602 __end_(nullptr)
2563 {2603 {
2564 __init(__p, __p + __len);2604 __init(__p, __p + __len);
2565 }2605 }
...@@ -2571,7 +2611,7 @@ public:...@@ -2571,7 +2611,7 @@ public:
2571 explicit basic_regex(const basic_string<value_type, _ST, _SA>& __p,2611 explicit basic_regex(const basic_string<value_type, _ST, _SA>& __p,
2572 flag_type __f = regex_constants::ECMAScript)2612 flag_type __f = regex_constants::ECMAScript)
2573 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),2613 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
2574 __end_(0)2614 __end_(nullptr)
2575 {2615 {
2576 __init(__p.begin(), __p.end());2616 __init(__p.begin(), __p.end());
2577 }2617 }
...@@ -2581,7 +2621,7 @@ public:...@@ -2581,7 +2621,7 @@ public:
2581 basic_regex(_ForwardIterator __first, _ForwardIterator __last,2621 basic_regex(_ForwardIterator __first, _ForwardIterator __last,
2582 flag_type __f = regex_constants::ECMAScript)2622 flag_type __f = regex_constants::ECMAScript)
2583 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),2623 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
2584 __end_(0)2624 __end_(nullptr)
2585 {2625 {
2586 __init(__first, __last);2626 __init(__first, __last);
2587 }2627 }
...@@ -2590,7 +2630,7 @@ public:...@@ -2590,7 +2630,7 @@ public:
2590 basic_regex(initializer_list<value_type> __il,2630 basic_regex(initializer_list<value_type> __il,
2591 flag_type __f = regex_constants::ECMAScript)2631 flag_type __f = regex_constants::ECMAScript)
2592 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),2632 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
2593 __end_(0)2633 __end_(nullptr)
2594 {2634 {
2595 __init(__il.begin(), __il.end());2635 __init(__il.begin(), __il.end());
2596 }2636 }
...@@ -2707,6 +2747,12 @@ private:...@@ -2707,6 +2747,12 @@ private:
2707 _LIBCPP_INLINE_VISIBILITY2747 _LIBCPP_INLINE_VISIBILITY
2708 unsigned __loop_count() const {return __loop_count_;}2748 unsigned __loop_count() const {return __loop_count_;}
27092749
2750 _LIBCPP_INLINE_VISIBILITY
2751 bool __use_multiline() const
2752 {
2753 return __get_grammar(__flags_) == ECMAScript && (__flags_ & multiline);
2754 }
2755
2710 template <class _ForwardIterator>2756 template <class _ForwardIterator>
2711 void2757 void
2712 __init(_ForwardIterator __first, _ForwardIterator __last);2758 __init(_ForwardIterator __first, _ForwardIterator __last);
...@@ -4119,7 +4165,7 @@ basic_regex<_CharT, _Traits>::__parse_DUP_COUNT(_ForwardIterator __first,...@@ -4119,7 +4165,7 @@ basic_regex<_CharT, _Traits>::__parse_DUP_COUNT(_ForwardIterator __first,
4119 __first != __last && ( __val = __traits_.value(*__first, 10)) != -1;4165 __first != __last && ( __val = __traits_.value(*__first, 10)) != -1;
4120 ++__first)4166 ++__first)
4121 {4167 {
4122 if (__c >= std::numeric_limits<int>::max() / 10)4168 if (__c >= numeric_limits<int>::max() / 10)
4123 __throw_regex_error<regex_constants::error_badbrace>();4169 __throw_regex_error<regex_constants::error_badbrace>();
4124 __c *= 10;4170 __c *= 10;
4125 __c += __val;4171 __c += __val;
...@@ -4383,7 +4429,7 @@ basic_regex<_CharT, _Traits>::__parse_decimal_escape(_ForwardIterator __first,...@@ -4383,7 +4429,7 @@ basic_regex<_CharT, _Traits>::__parse_decimal_escape(_ForwardIterator __first,
4383 for (++__first;4429 for (++__first;
4384 __first != __last && '0' <= *__first && *__first <= '9'; ++__first)4430 __first != __last && '0' <= *__first && *__first <= '9'; ++__first)
4385 {4431 {
4386 if (__v >= std::numeric_limits<unsigned>::max() / 10)4432 if (__v >= numeric_limits<unsigned>::max() / 10)
4387 __throw_regex_error<regex_constants::error_backref>();4433 __throw_regex_error<regex_constants::error_backref>();
4388 __v = 10 * __v + *__first - '0';4434 __v = 10 * __v + *__first - '0';
4389 }4435 }
...@@ -4746,7 +4792,7 @@ template <class _CharT, class _Traits>...@@ -4746,7 +4792,7 @@ template <class _CharT, class _Traits>
4746void4792void
4747basic_regex<_CharT, _Traits>::__push_l_anchor()4793basic_regex<_CharT, _Traits>::__push_l_anchor()
4748{4794{
4749 __end_->first() = new __l_anchor<_CharT>(__end_->first());4795 __end_->first() = new __l_anchor_multiline<_CharT>(__use_multiline(), __end_->first());
4750 __end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());4796 __end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());
4751}4797}
47524798
...@@ -4754,7 +4800,7 @@ template <class _CharT, class _Traits>...@@ -4754,7 +4800,7 @@ template <class _CharT, class _Traits>
4754void4800void
4755basic_regex<_CharT, _Traits>::__push_r_anchor()4801basic_regex<_CharT, _Traits>::__push_r_anchor()
4756{4802{
4757 __end_->first() = new __r_anchor<_CharT>(__end_->first());4803 __end_->first() = new __r_anchor_multiline<_CharT>(__use_multiline(), __end_->first());
4758 __end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());4804 __end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());
4759}4805}
47604806
...@@ -4845,13 +4891,21 @@ basic_regex<_CharT, _Traits>::__push_lookahead(const basic_regex& __exp,...@@ -4845,13 +4891,21 @@ basic_regex<_CharT, _Traits>::__push_lookahead(const basic_regex& __exp,
4845 __end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());4891 __end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());
4846}4892}
48474893
4848typedef basic_regex<char> regex;
4849typedef basic_regex<wchar_t> wregex;
4850
4851// sub_match4894// sub_match
48524895
4896typedef sub_match<const char*> csub_match;
4897typedef sub_match<const wchar_t*> wcsub_match;
4898typedef sub_match<string::const_iterator> ssub_match;
4899typedef sub_match<wstring::const_iterator> wssub_match;
4900
4853template <class _BidirectionalIterator>4901template <class _BidirectionalIterator>
4854class _LIBCPP_TEMPLATE_VIS sub_match4902class
4903 _LIBCPP_TEMPLATE_VIS
4904 _LIBCPP_PREFERRED_NAME(csub_match)
4905 _LIBCPP_PREFERRED_NAME(wcsub_match)
4906 _LIBCPP_PREFERRED_NAME(ssub_match)
4907 _LIBCPP_PREFERRED_NAME(wssub_match)
4908 sub_match
4855 : public pair<_BidirectionalIterator, _BidirectionalIterator>4909 : public pair<_BidirectionalIterator, _BidirectionalIterator>
4856{4910{
4857public:4911public:
...@@ -4886,11 +4940,6 @@ public:...@@ -4886,11 +4940,6 @@ public:
4886 {return str().compare(__s);}4940 {return str().compare(__s);}
4887};4941};
48884942
4889typedef sub_match<const char*> csub_match;
4890typedef sub_match<const wchar_t*> wcsub_match;
4891typedef sub_match<string::const_iterator> ssub_match;
4892typedef sub_match<wstring::const_iterator> wssub_match;
4893
4894template <class _BiIter>4943template <class _BiIter>
4895inline _LIBCPP_INLINE_VISIBILITY4944inline _LIBCPP_INLINE_VISIBILITY
4896bool4945bool
...@@ -5273,8 +5322,19 @@ operator<<(basic_ostream<_CharT, _ST>& __os, const sub_match<_BiIter>& __m)...@@ -5273,8 +5322,19 @@ operator<<(basic_ostream<_CharT, _ST>& __os, const sub_match<_BiIter>& __m)
5273 return __os << __m.str();5322 return __os << __m.str();
5274}5323}
52755324
5325typedef match_results<const char*> cmatch;
5326typedef match_results<const wchar_t*> wcmatch;
5327typedef match_results<string::const_iterator> smatch;
5328typedef match_results<wstring::const_iterator> wsmatch;
5329
5276template <class _BidirectionalIterator, class _Allocator>5330template <class _BidirectionalIterator, class _Allocator>
5277class _LIBCPP_TEMPLATE_VIS match_results5331class
5332 _LIBCPP_TEMPLATE_VIS
5333 _LIBCPP_PREFERRED_NAME(cmatch)
5334 _LIBCPP_PREFERRED_NAME(wcmatch)
5335 _LIBCPP_PREFERRED_NAME(smatch)
5336 _LIBCPP_PREFERRED_NAME(wsmatch)
5337 match_results
5278{5338{
5279public:5339public:
5280 typedef _Allocator allocator_type;5340 typedef _Allocator allocator_type;
...@@ -5299,7 +5359,13 @@ public:...@@ -5299,7 +5359,13 @@ public:
5299 typedef basic_string<char_type> string_type;5359 typedef basic_string<char_type> string_type;
53005360
5301 // construct/copy/destroy:5361 // construct/copy/destroy:
5362#ifndef _LIBCPP_CXX03_LANG
5363 match_results() : match_results(allocator_type()) {}
5364 explicit match_results(const allocator_type& __a);
5365#else
5302 explicit match_results(const allocator_type& __a = allocator_type());5366 explicit match_results(const allocator_type& __a = allocator_type());
5367#endif
5368
5303// match_results(const match_results&) = default;5369// match_results(const match_results&) = default;
5304// match_results& operator=(const match_results&) = default;5370// match_results& operator=(const match_results&) = default;
5305// match_results(match_results&& __m) = default;5371// match_results(match_results&& __m) = default;
...@@ -5556,7 +5622,7 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output_i...@@ -5556,7 +5622,7 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output_i
5556 '0' <= __fmt_first[1] && __fmt_first[1] <= '9')5622 '0' <= __fmt_first[1] && __fmt_first[1] <= '9')
5557 {5623 {
5558 ++__fmt_first;5624 ++__fmt_first;
5559 if (__idx >= std::numeric_limits<size_t>::max() / 10)5625 if (__idx >= numeric_limits<size_t>::max() / 10)
5560 __throw_regex_error<regex_constants::error_escape>();5626 __throw_regex_error<regex_constants::error_escape>();
5561 __idx = 10 * __idx + *__fmt_first - '0';5627 __idx = 10 * __idx + *__fmt_first - '0';
5562 }5628 }
...@@ -5594,11 +5660,6 @@ match_results<_BidirectionalIterator, _Allocator>::swap(match_results& __m)...@@ -5594,11 +5660,6 @@ match_results<_BidirectionalIterator, _Allocator>::swap(match_results& __m)
5594 swap(__ready_, __m.__ready_);5660 swap(__ready_, __m.__ready_);
5595}5661}
55965662
5597typedef match_results<const char*> cmatch;
5598typedef match_results<const wchar_t*> wcmatch;
5599typedef match_results<string::const_iterator> smatch;
5600typedef match_results<wstring::const_iterator> wsmatch;
5601
5602template <class _BidirectionalIterator, class _Allocator>5663template <class _BidirectionalIterator, class _Allocator>
5603bool5664bool
5604operator==(const match_results<_BidirectionalIterator, _Allocator>& __x,5665operator==(const match_results<_BidirectionalIterator, _Allocator>& __x,
...@@ -6182,7 +6243,21 @@ regex_match(const basic_string<_CharT, _ST, _SA>& __s,...@@ -6182,7 +6243,21 @@ regex_match(const basic_string<_CharT, _ST, _SA>& __s,
6182template <class _BidirectionalIterator,6243template <class _BidirectionalIterator,
6183 class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,6244 class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
6184 class _Traits = regex_traits<_CharT> >6245 class _Traits = regex_traits<_CharT> >
6185class _LIBCPP_TEMPLATE_VIS regex_iterator6246 class _LIBCPP_TEMPLATE_VIS regex_iterator;
6247
6248typedef regex_iterator<const char*> cregex_iterator;
6249typedef regex_iterator<const wchar_t*> wcregex_iterator;
6250typedef regex_iterator<string::const_iterator> sregex_iterator;
6251typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
6252
6253template <class _BidirectionalIterator, class _CharT, class _Traits>
6254class
6255 _LIBCPP_TEMPLATE_VIS
6256 _LIBCPP_PREFERRED_NAME(cregex_iterator)
6257 _LIBCPP_PREFERRED_NAME(wcregex_iterator)
6258 _LIBCPP_PREFERRED_NAME(sregex_iterator)
6259 _LIBCPP_PREFERRED_NAME(wsregex_iterator)
6260 regex_iterator
6186{6261{
6187public:6262public:
6188 typedef basic_regex<_CharT, _Traits> regex_type;6263 typedef basic_regex<_CharT, _Traits> regex_type;
...@@ -6291,17 +6366,26 @@ regex_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()...@@ -6291,17 +6366,26 @@ regex_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()
6291 return *this;6366 return *this;
6292}6367}
62936368
6294typedef regex_iterator<const char*> cregex_iterator;
6295typedef regex_iterator<const wchar_t*> wcregex_iterator;
6296typedef regex_iterator<string::const_iterator> sregex_iterator;
6297typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
6298
6299// regex_token_iterator6369// regex_token_iterator
63006370
6301template <class _BidirectionalIterator,6371template <class _BidirectionalIterator,
6302 class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,6372 class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
6303 class _Traits = regex_traits<_CharT> >6373 class _Traits = regex_traits<_CharT> >
6304class _LIBCPP_TEMPLATE_VIS regex_token_iterator6374 class _LIBCPP_TEMPLATE_VIS regex_token_iterator;
6375
6376typedef regex_token_iterator<const char*> cregex_token_iterator;
6377typedef regex_token_iterator<const wchar_t*> wcregex_token_iterator;
6378typedef regex_token_iterator<string::const_iterator> sregex_token_iterator;
6379typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
6380
6381template <class _BidirectionalIterator, class _CharT, class _Traits>
6382class
6383 _LIBCPP_TEMPLATE_VIS
6384 _LIBCPP_PREFERRED_NAME(cregex_token_iterator)
6385 _LIBCPP_PREFERRED_NAME(wcregex_token_iterator)
6386 _LIBCPP_PREFERRED_NAME(sregex_token_iterator)
6387 _LIBCPP_PREFERRED_NAME(wsregex_token_iterator)
6388 regex_token_iterator
6305{6389{
6306public:6390public:
6307 typedef basic_regex<_CharT, _Traits> regex_type;6391 typedef basic_regex<_CharT, _Traits> regex_type;
...@@ -6367,7 +6451,7 @@ public:...@@ -6367,7 +6451,7 @@ public:
6367 regex_constants::match_flag_type __m =6451 regex_constants::match_flag_type __m =
6368 regex_constants::match_default);6452 regex_constants::match_default);
6369#if _LIBCPP_STD_VER > 116453#if _LIBCPP_STD_VER > 11
6370 template <std::size_t _Np>6454 template <size_t _Np>
6371 regex_token_iterator(_BidirectionalIterator __a,6455 regex_token_iterator(_BidirectionalIterator __a,
6372 _BidirectionalIterator __b,6456 _BidirectionalIterator __b,
6373 const regex_type&& __re,6457 const regex_type&& __re,
...@@ -6579,11 +6663,6 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()...@@ -6579,11 +6663,6 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()
6579 return *this;6663 return *this;
6580}6664}
65816665
6582typedef regex_token_iterator<const char*> cregex_token_iterator;
6583typedef regex_token_iterator<const wchar_t*> wcregex_token_iterator;
6584typedef regex_token_iterator<string::const_iterator> sregex_token_iterator;
6585typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
6586
6587// regex_replace6666// regex_replace
65886667
6589template <class _OutputIterator, class _BidirectionalIterator,6668template <class _OutputIterator, class _BidirectionalIterator,
lib/libcxx/include/semaphore+7-2
...@@ -46,9 +46,9 @@ using binary_semaphore = counting_semaphore<1>;...@@ -46,9 +46,9 @@ using binary_semaphore = counting_semaphore<1>;
46*/46*/
4747
48#include <__config>48#include <__config>
49#include <__availability>
49#include <__threading_support>50#include <__threading_support>
50#include <atomic>51#include <atomic>
51#include <cassert>
5252
53#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)53#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
54#pragma GCC system_header54#pragma GCC system_header
...@@ -58,6 +58,9 @@ using binary_semaphore = counting_semaphore<1>;...@@ -58,6 +58,9 @@ using binary_semaphore = counting_semaphore<1>;
58# error <semaphore> is not supported on this single threaded system58# error <semaphore> is not supported on this single threaded system
59#endif59#endif
6060
61_LIBCPP_PUSH_MACROS
62#include <__undef_macros>
63
61#if _LIBCPP_STD_VER >= 1464#if _LIBCPP_STD_VER >= 14
6265
63_LIBCPP_BEGIN_NAMESPACE_STD66_LIBCPP_BEGIN_NAMESPACE_STD
...@@ -68,7 +71,7 @@ __atomic_semaphore_base is the general-case implementation, to be used for...@@ -68,7 +71,7 @@ __atomic_semaphore_base is the general-case implementation, to be used for
68user-requested least-max values that exceed the OS implementation support71user-requested least-max values that exceed the OS implementation support
69(incl. when the OS has no support of its own) and for binary semaphores.72(incl. when the OS has no support of its own) and for binary semaphores.
7073
71It is a typical Dijsktra semaphore algorithm over atomics, wait and notify74It is a typical Dijkstra semaphore algorithm over atomics, wait and notify
72functions. It avoids contention against users' own use of those facilities.75functions. It avoids contention against users' own use of those facilities.
7376
74*/77*/
...@@ -232,4 +235,6 @@ _LIBCPP_END_NAMESPACE_STD...@@ -232,4 +235,6 @@ _LIBCPP_END_NAMESPACE_STD
232235
233#endif // _LIBCPP_STD_VER >= 14236#endif // _LIBCPP_STD_VER >= 14
234237
238_LIBCPP_POP_MACROS
239
235#endif //_LIBCPP_SEMAPHORE240#endif //_LIBCPP_SEMAPHORE
lib/libcxx/include/shared_mutex+1
...@@ -123,6 +123,7 @@ template <class Mutex>...@@ -123,6 +123,7 @@ template <class Mutex>
123*/123*/
124124
125#include <__config>125#include <__config>
126#include <__availability>
126#include <version>127#include <version>
127128
128_LIBCPP_PUSH_MACROS129_LIBCPP_PUSH_MACROS
lib/libcxx/include/span+6-1
...@@ -132,11 +132,14 @@ template<class Container>...@@ -132,11 +132,14 @@ template<class Container>
132#pragma GCC system_header132#pragma GCC system_header
133#endif133#endif
134134
135_LIBCPP_PUSH_MACROS
136#include <__undef_macros>
137
135_LIBCPP_BEGIN_NAMESPACE_STD138_LIBCPP_BEGIN_NAMESPACE_STD
136139
137#if _LIBCPP_STD_VER > 17140#if _LIBCPP_STD_VER > 17
138141
139inline constexpr size_t dynamic_extent = (numeric_limits<size_t>::max)();142inline constexpr size_t dynamic_extent = numeric_limits<size_t>::max();
140template <typename _Tp, size_t _Extent = dynamic_extent> class span;143template <typename _Tp, size_t _Extent = dynamic_extent> class span;
141144
142145
...@@ -546,4 +549,6 @@ template<class _Container>...@@ -546,4 +549,6 @@ template<class _Container>
546549
547_LIBCPP_END_NAMESPACE_STD550_LIBCPP_END_NAMESPACE_STD
548551
552_LIBCPP_POP_MACROS
553
549#endif // _LIBCPP_SPAN554#endif // _LIBCPP_SPAN
lib/libcxx/include/sstream+202-292
...@@ -25,8 +25,10 @@ public:...@@ -25,8 +25,10 @@ public:
25 typedef typename traits_type::off_type off_type;25 typedef typename traits_type::off_type off_type;
26 typedef Allocator allocator_type;26 typedef Allocator allocator_type;
2727
28 // 27.8.1.1 Constructors:28 // 27.8.1.1 [stringbuf.cons], constructors:
29 explicit basic_stringbuf(ios_base::openmode which = ios_base::in | ios_base::out);29 explicit basic_stringbuf(ios_base::openmode which = ios_base::in | ios_base::out); // before C++20
30 basic_stringbuf() : basic_stringbuf(ios_base::in | ios_base::out) {} // C++20
31 explicit basic_stringbuf(ios_base::openmode which); // C++20
30 explicit basic_stringbuf(const basic_string<char_type, traits_type, allocator_type>& str,32 explicit basic_stringbuf(const basic_string<char_type, traits_type, allocator_type>& str,
31 ios_base::openmode which = ios_base::in | ios_base::out);33 ios_base::openmode which = ios_base::in | ios_base::out);
32 basic_stringbuf(basic_stringbuf&& rhs);34 basic_stringbuf(basic_stringbuf&& rhs);
...@@ -71,7 +73,10 @@ public:...@@ -71,7 +73,10 @@ public:
71 typedef Allocator allocator_type;73 typedef Allocator allocator_type;
7274
73 // 27.8.2.1 Constructors:75 // 27.8.2.1 Constructors:
74 explicit basic_istringstream(ios_base::openmode which = ios_base::in);76 explicit basic_istringstream(ios_base::openmode which = ios_base::in); // before C++20
77 basic_istringstream() : basic_istringstream(ios_base::in) {} // C++20
78 explicit basic_istringstream(ios_base::openmode which); // C++20
79
75 explicit basic_istringstream(const basic_string<char_type, traits_type,allocator_type>& str,80 explicit basic_istringstream(const basic_string<char_type, traits_type,allocator_type>& str,
76 ios_base::openmode which = ios_base::in);81 ios_base::openmode which = ios_base::in);
77 basic_istringstream(basic_istringstream&& rhs);82 basic_istringstream(basic_istringstream&& rhs);
...@@ -107,7 +112,10 @@ public:...@@ -107,7 +112,10 @@ public:
107 typedef Allocator allocator_type;112 typedef Allocator allocator_type;
108113
109 // 27.8.3.1 Constructors/destructor:114 // 27.8.3.1 Constructors/destructor:
110 explicit basic_ostringstream(ios_base::openmode which = ios_base::out);115 explicit basic_ostringstream(ios_base::openmode which = ios_base::out); // before C++20
116 basic_ostringstream() : basic_ostringstream(ios_base::out) {} // C++20
117 explicit basic_ostringstream(ios_base::openmode which); // C++20
118
111 explicit basic_ostringstream(const basic_string<char_type, traits_type, allocator_type>& str,119 explicit basic_ostringstream(const basic_string<char_type, traits_type, allocator_type>& str,
112 ios_base::openmode which = ios_base::out);120 ios_base::openmode which = ios_base::out);
113 basic_ostringstream(basic_ostringstream&& rhs);121 basic_ostringstream(basic_ostringstream&& rhs);
...@@ -143,7 +151,10 @@ public:...@@ -143,7 +151,10 @@ public:
143 typedef Allocator allocator_type;151 typedef Allocator allocator_type;
144152
145 // constructors/destructor153 // constructors/destructor
146 explicit basic_stringstream(ios_base::openmode which = ios_base::out|ios_base::in);154 explicit basic_stringstream(ios_base::openmode which = ios_base::out | ios_base::in); // before C++20
155 basic_stringstream() : basic_stringstream(ios_base::out | ios_base::in) {} // C++20
156 explicit basic_stringstream(ios_base::openmode which); // C++20
157
147 explicit basic_stringstream(const basic_string<char_type, traits_type, allocator_type>& str,158 explicit basic_stringstream(const basic_string<char_type, traits_type, allocator_type>& str,
148 ios_base::openmode which = ios_base::out|ios_base::in);159 ios_base::openmode which = ios_base::out|ios_base::in);
149 basic_stringstream(basic_stringstream&& rhs);160 basic_stringstream(basic_stringstream&& rhs);
...@@ -207,18 +218,33 @@ private:...@@ -207,18 +218,33 @@ private:
207 ios_base::openmode __mode_;218 ios_base::openmode __mode_;
208219
209public:220public:
210 // 27.8.1.1 Constructors:221 // 30.8.2.1 [stringbuf.cons], constructors
211 inline _LIBCPP_INLINE_VISIBILITY
212 explicit basic_stringbuf(ios_base::openmode __wch = ios_base::in | ios_base::out);
213 inline _LIBCPP_INLINE_VISIBILITY
214 explicit basic_stringbuf(const string_type& __s,
215 ios_base::openmode __wch = ios_base::in | ios_base::out);
216#ifndef _LIBCPP_CXX03_LANG222#ifndef _LIBCPP_CXX03_LANG
223 _LIBCPP_INLINE_VISIBILITY
224 basic_stringbuf() : basic_stringbuf(ios_base::in | ios_base::out) {}
225
226 _LIBCPP_INLINE_VISIBILITY
227 explicit basic_stringbuf(ios_base::openmode __wch)
228 : __hm_(nullptr), __mode_(__wch) {}
229#else
230 _LIBCPP_INLINE_VISIBILITY
231 explicit basic_stringbuf(ios_base::openmode __wch = ios_base::in |
232 ios_base::out)
233 : __hm_(nullptr), __mode_(__wch) {}
234#endif
235
236 _LIBCPP_INLINE_VISIBILITY
237 explicit basic_stringbuf(const string_type& __s,
238 ios_base::openmode __wch = ios_base::in | ios_base::out)
239 : __str_(__s.get_allocator()), __hm_(nullptr), __mode_(__wch)
240 {
241 str(__s);
242 }
243
217 basic_stringbuf(basic_stringbuf&& __rhs);244 basic_stringbuf(basic_stringbuf&& __rhs);
218245
219 // 27.8.1.2 Assign and swap:246 // 27.8.1.2 Assign and swap:
220 basic_stringbuf& operator=(basic_stringbuf&& __rhs);247 basic_stringbuf& operator=(basic_stringbuf&& __rhs);
221#endif
222 void swap(basic_stringbuf& __rhs);248 void swap(basic_stringbuf& __rhs);
223249
224 // 27.8.1.3 Get and set:250 // 27.8.1.3 Get and set:
...@@ -232,30 +258,13 @@ protected:...@@ -232,30 +258,13 @@ protected:
232 virtual int_type overflow (int_type __c = traits_type::eof());258 virtual int_type overflow (int_type __c = traits_type::eof());
233 virtual pos_type seekoff(off_type __off, ios_base::seekdir __way,259 virtual pos_type seekoff(off_type __off, ios_base::seekdir __way,
234 ios_base::openmode __wch = ios_base::in | ios_base::out);260 ios_base::openmode __wch = ios_base::in | ios_base::out);
235 inline _LIBCPP_INLINE_VISIBILITY261 _LIBCPP_INLINE_VISIBILITY
236 virtual pos_type seekpos(pos_type __sp,262 virtual pos_type seekpos(pos_type __sp,
237 ios_base::openmode __wch = ios_base::in | ios_base::out);263 ios_base::openmode __wch = ios_base::in | ios_base::out) {
264 return seekoff(__sp, ios_base::beg, __wch);
265 }
238};266};
239267
240template <class _CharT, class _Traits, class _Allocator>
241basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(ios_base::openmode __wch)
242 : __hm_(0),
243 __mode_(__wch)
244{
245}
246
247template <class _CharT, class _Traits, class _Allocator>
248basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(const string_type& __s,
249 ios_base::openmode __wch)
250 : __str_(__s.get_allocator()),
251 __hm_(0),
252 __mode_(__wch)
253{
254 str(__s);
255}
256
257#ifndef _LIBCPP_CXX03_LANG
258
259template <class _CharT, class _Traits, class _Allocator>268template <class _CharT, class _Traits, class _Allocator>
260basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&& __rhs)269basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&& __rhs)
261 : __mode_(__rhs.__mode_)270 : __mode_(__rhs.__mode_)
...@@ -345,8 +354,6 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)...@@ -345,8 +354,6 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
345 return *this;354 return *this;
346}355}
347356
348#endif // _LIBCPP_CXX03_LANG
349
350template <class _CharT, class _Traits, class _Allocator>357template <class _CharT, class _Traits, class _Allocator>
351void358void
352basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)359basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
...@@ -453,7 +460,7 @@ void...@@ -453,7 +460,7 @@ void
453basic_stringbuf<_CharT, _Traits, _Allocator>::str(const string_type& __s)460basic_stringbuf<_CharT, _Traits, _Allocator>::str(const string_type& __s)
454{461{
455 __str_ = __s;462 __str_ = __s;
456 __hm_ = 0;463 __hm_ = nullptr;
457 if (__mode_ & ios_base::in)464 if (__mode_ & ios_base::in)
458 {465 {
459 __hm_ = const_cast<char_type*>(__str_.data()) + __str_.size();466 __hm_ = const_cast<char_type*>(__str_.data()) + __str_.size();
...@@ -600,9 +607,9 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff(off_type __off,...@@ -600,9 +607,9 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff(off_type __off,
600 return pos_type(-1);607 return pos_type(-1);
601 if (__noff != 0)608 if (__noff != 0)
602 {609 {
603 if ((__wch & ios_base::in) && this->gptr() == 0)610 if ((__wch & ios_base::in) && this->gptr() == nullptr)
604 return pos_type(-1);611 return pos_type(-1);
605 if ((__wch & ios_base::out) && this->pptr() == 0)612 if ((__wch & ios_base::out) && this->pptr() == nullptr)
606 return pos_type(-1);613 return pos_type(-1);
607 }614 }
608 if (__wch & ios_base::in)615 if (__wch & ios_base::in)
...@@ -615,14 +622,6 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff(off_type __off,...@@ -615,14 +622,6 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff(off_type __off,
615 return pos_type(__noff);622 return pos_type(__noff);
616}623}
617624
618template <class _CharT, class _Traits, class _Allocator>
619typename basic_stringbuf<_CharT, _Traits, _Allocator>::pos_type
620basic_stringbuf<_CharT, _Traits, _Allocator>::seekpos(pos_type __sp,
621 ios_base::openmode __wch)
622{
623 return seekoff(__sp, ios_base::beg, __wch);
624}
625
626// basic_istringstream625// basic_istringstream
627626
628template <class _CharT, class _Traits, class _Allocator>627template <class _CharT, class _Traits, class _Allocator>
...@@ -643,74 +642,62 @@ private:...@@ -643,74 +642,62 @@ private:
643 basic_stringbuf<char_type, traits_type, allocator_type> __sb_;642 basic_stringbuf<char_type, traits_type, allocator_type> __sb_;
644643
645public:644public:
646 // 27.8.2.1 Constructors:645 // 30.8.3.1 [istringstream.cons], constructors
647 inline _LIBCPP_INLINE_VISIBILITY
648 explicit basic_istringstream(ios_base::openmode __wch = ios_base::in);
649 inline _LIBCPP_INLINE_VISIBILITY
650 explicit basic_istringstream(const string_type& __s,
651 ios_base::openmode __wch = ios_base::in);
652#ifndef _LIBCPP_CXX03_LANG646#ifndef _LIBCPP_CXX03_LANG
653 inline _LIBCPP_INLINE_VISIBILITY647 _LIBCPP_INLINE_VISIBILITY
654 basic_istringstream(basic_istringstream&& __rhs);648 basic_istringstream() : basic_istringstream(ios_base::in) {}
649
650 _LIBCPP_INLINE_VISIBILITY
651 explicit basic_istringstream(ios_base::openmode __wch)
652 : basic_istream<_CharT, _Traits>(&__sb_), __sb_(__wch | ios_base::in) {}
653#else
654 _LIBCPP_INLINE_VISIBILITY
655 explicit basic_istringstream(ios_base::openmode __wch = ios_base::in)
656 : basic_istream<_CharT, _Traits>(&__sb_), __sb_(__wch | ios_base::in) {}
657#endif
658
659 _LIBCPP_INLINE_VISIBILITY
660 explicit basic_istringstream(const string_type& __s,
661 ios_base::openmode __wch = ios_base::in)
662 : basic_istream<_CharT, _Traits>(&__sb_)
663 , __sb_(__s, __wch | ios_base::in)
664 { }
665
666 _LIBCPP_INLINE_VISIBILITY
667 basic_istringstream(basic_istringstream&& __rhs)
668 : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))
669 , __sb_(_VSTD::move(__rhs.__sb_))
670 {
671 basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
672 }
655673
656 // 27.8.2.2 Assign and swap:674 // 27.8.2.2 Assign and swap:
657 basic_istringstream& operator=(basic_istringstream&& __rhs);675 basic_istringstream& operator=(basic_istringstream&& __rhs) {
658#endif // _LIBCPP_CXX03_LANG676 basic_istream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
659 inline _LIBCPP_INLINE_VISIBILITY677 __sb_ = _VSTD::move(__rhs.__sb_);
660 void swap(basic_istringstream& __rhs);678 return *this;
679 }
680 _LIBCPP_INLINE_VISIBILITY
681 void swap(basic_istringstream& __rhs) {
682 basic_istream<char_type, traits_type>::swap(__rhs);
683 __sb_.swap(__rhs.__sb_);
684 }
661685
662 // 27.8.2.3 Members:686 // 27.8.2.3 Members:
663 inline _LIBCPP_INLINE_VISIBILITY687 _LIBCPP_INLINE_VISIBILITY
664 basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;688 basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
665 inline _LIBCPP_INLINE_VISIBILITY689 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
666 string_type str() const;690 }
667 inline _LIBCPP_INLINE_VISIBILITY691 _LIBCPP_INLINE_VISIBILITY
668 void str(const string_type& __s);692 string_type str() const {
693 return __sb_.str();
694 }
695 _LIBCPP_INLINE_VISIBILITY
696 void str(const string_type& __s) {
697 __sb_.str(__s);
698 }
669};699};
670700
671template <class _CharT, class _Traits, class _Allocator>
672basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(ios_base::openmode __wch)
673 : basic_istream<_CharT, _Traits>(&__sb_),
674 __sb_(__wch | ios_base::in)
675{
676}
677
678template <class _CharT, class _Traits, class _Allocator>
679basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(const string_type& __s,
680 ios_base::openmode __wch)
681 : basic_istream<_CharT, _Traits>(&__sb_),
682 __sb_(__s, __wch | ios_base::in)
683{
684}
685
686#ifndef _LIBCPP_CXX03_LANG
687
688template <class _CharT, class _Traits, class _Allocator>
689basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(basic_istringstream&& __rhs)
690 : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs)),
691 __sb_(_VSTD::move(__rhs.__sb_))
692{
693 basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
694}
695
696template <class _CharT, class _Traits, class _Allocator>
697basic_istringstream<_CharT, _Traits, _Allocator>&
698basic_istringstream<_CharT, _Traits, _Allocator>::operator=(basic_istringstream&& __rhs)
699{
700 basic_istream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
701 __sb_ = _VSTD::move(__rhs.__sb_);
702 return *this;
703}
704
705#endif // _LIBCPP_CXX03_LANG
706
707template <class _CharT, class _Traits, class _Allocator>
708void basic_istringstream<_CharT, _Traits, _Allocator>::swap(basic_istringstream& __rhs)
709{
710 basic_istream<char_type, traits_type>::swap(__rhs);
711 __sb_.swap(__rhs.__sb_);
712}
713
714template <class _CharT, class _Traits, class _Allocator>701template <class _CharT, class _Traits, class _Allocator>
715inline _LIBCPP_INLINE_VISIBILITY702inline _LIBCPP_INLINE_VISIBILITY
716void703void
...@@ -720,26 +707,6 @@ swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x,...@@ -720,26 +707,6 @@ swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x,
720 __x.swap(__y);707 __x.swap(__y);
721}708}
722709
723template <class _CharT, class _Traits, class _Allocator>
724basic_stringbuf<_CharT, _Traits, _Allocator>*
725basic_istringstream<_CharT, _Traits, _Allocator>::rdbuf() const
726{
727 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
728}
729
730template <class _CharT, class _Traits, class _Allocator>
731basic_string<_CharT, _Traits, _Allocator>
732basic_istringstream<_CharT, _Traits, _Allocator>::str() const
733{
734 return __sb_.str();
735}
736
737template <class _CharT, class _Traits, class _Allocator>
738void basic_istringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
739{
740 __sb_.str(__s);
741}
742
743// basic_ostringstream710// basic_ostringstream
744711
745template <class _CharT, class _Traits, class _Allocator>712template <class _CharT, class _Traits, class _Allocator>
...@@ -760,75 +727,65 @@ private:...@@ -760,75 +727,65 @@ private:
760 basic_stringbuf<char_type, traits_type, allocator_type> __sb_;727 basic_stringbuf<char_type, traits_type, allocator_type> __sb_;
761728
762public:729public:
763 // 27.8.2.1 Constructors:730 // 30.8.4.1 [ostringstream.cons], constructors
764 inline _LIBCPP_INLINE_VISIBILITY
765 explicit basic_ostringstream(ios_base::openmode __wch = ios_base::out);
766 inline _LIBCPP_INLINE_VISIBILITY
767 explicit basic_ostringstream(const string_type& __s,
768 ios_base::openmode __wch = ios_base::out);
769#ifndef _LIBCPP_CXX03_LANG731#ifndef _LIBCPP_CXX03_LANG
770 inline _LIBCPP_INLINE_VISIBILITY732 _LIBCPP_INLINE_VISIBILITY
771 basic_ostringstream(basic_ostringstream&& __rhs);733 basic_ostringstream() : basic_ostringstream(ios_base::out) {}
734
735 _LIBCPP_INLINE_VISIBILITY
736 explicit basic_ostringstream(ios_base::openmode __wch)
737 : basic_ostream<_CharT, _Traits>(&__sb_),
738 __sb_(__wch | ios_base::out) {}
739#else
740 _LIBCPP_INLINE_VISIBILITY
741 explicit basic_ostringstream(ios_base::openmode __wch = ios_base::out)
742 : basic_ostream<_CharT, _Traits>(&__sb_),
743 __sb_(__wch | ios_base::out) {}
744#endif
745
746 _LIBCPP_INLINE_VISIBILITY
747 explicit basic_ostringstream(const string_type& __s,
748 ios_base::openmode __wch = ios_base::out)
749 : basic_ostream<_CharT, _Traits>(&__sb_)
750 , __sb_(__s, __wch | ios_base::out)
751 { }
752
753 _LIBCPP_INLINE_VISIBILITY
754 basic_ostringstream(basic_ostringstream&& __rhs)
755 : basic_ostream<_CharT, _Traits>(_VSTD::move(__rhs))
756 , __sb_(_VSTD::move(__rhs.__sb_))
757 {
758 basic_ostream<_CharT, _Traits>::set_rdbuf(&__sb_);
759 }
772760
773 // 27.8.2.2 Assign and swap:761 // 27.8.2.2 Assign and swap:
774 basic_ostringstream& operator=(basic_ostringstream&& __rhs);762 basic_ostringstream& operator=(basic_ostringstream&& __rhs) {
775#endif // _LIBCPP_CXX03_LANG763 basic_ostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
776 inline _LIBCPP_INLINE_VISIBILITY764 __sb_ = _VSTD::move(__rhs.__sb_);
777 void swap(basic_ostringstream& __rhs);765 return *this;
766 }
767
768 _LIBCPP_INLINE_VISIBILITY
769 void swap(basic_ostringstream& __rhs) {
770 basic_ostream<char_type, traits_type>::swap(__rhs);
771 __sb_.swap(__rhs.__sb_);
772 }
778773
779 // 27.8.2.3 Members:774 // 27.8.2.3 Members:
780 inline _LIBCPP_INLINE_VISIBILITY775 _LIBCPP_INLINE_VISIBILITY
781 basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;776 basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
782 inline _LIBCPP_INLINE_VISIBILITY777 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
783 string_type str() const;778 }
784 inline _LIBCPP_INLINE_VISIBILITY779 _LIBCPP_INLINE_VISIBILITY
785 void str(const string_type& __s);780 string_type str() const {
781 return __sb_.str();
782 }
783 _LIBCPP_INLINE_VISIBILITY
784 void str(const string_type& __s) {
785 __sb_.str(__s);
786 }
786};787};
787788
788template <class _CharT, class _Traits, class _Allocator>
789basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(ios_base::openmode __wch)
790 : basic_ostream<_CharT, _Traits>(&__sb_),
791 __sb_(__wch | ios_base::out)
792{
793}
794
795template <class _CharT, class _Traits, class _Allocator>
796basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(const string_type& __s,
797 ios_base::openmode __wch)
798 : basic_ostream<_CharT, _Traits>(&__sb_),
799 __sb_(__s, __wch | ios_base::out)
800{
801}
802
803#ifndef _LIBCPP_CXX03_LANG
804
805template <class _CharT, class _Traits, class _Allocator>
806basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(basic_ostringstream&& __rhs)
807 : basic_ostream<_CharT, _Traits>(_VSTD::move(__rhs)),
808 __sb_(_VSTD::move(__rhs.__sb_))
809{
810 basic_ostream<_CharT, _Traits>::set_rdbuf(&__sb_);
811}
812
813template <class _CharT, class _Traits, class _Allocator>
814basic_ostringstream<_CharT, _Traits, _Allocator>&
815basic_ostringstream<_CharT, _Traits, _Allocator>::operator=(basic_ostringstream&& __rhs)
816{
817 basic_ostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
818 __sb_ = _VSTD::move(__rhs.__sb_);
819 return *this;
820}
821
822#endif // _LIBCPP_CXX03_LANG
823
824template <class _CharT, class _Traits, class _Allocator>
825void
826basic_ostringstream<_CharT, _Traits, _Allocator>::swap(basic_ostringstream& __rhs)
827{
828 basic_ostream<char_type, traits_type>::swap(__rhs);
829 __sb_.swap(__rhs.__sb_);
830}
831
832template <class _CharT, class _Traits, class _Allocator>789template <class _CharT, class _Traits, class _Allocator>
833inline _LIBCPP_INLINE_VISIBILITY790inline _LIBCPP_INLINE_VISIBILITY
834void791void
...@@ -838,27 +795,6 @@ swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x,...@@ -838,27 +795,6 @@ swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x,
838 __x.swap(__y);795 __x.swap(__y);
839}796}
840797
841template <class _CharT, class _Traits, class _Allocator>
842basic_stringbuf<_CharT, _Traits, _Allocator>*
843basic_ostringstream<_CharT, _Traits, _Allocator>::rdbuf() const
844{
845 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
846}
847
848template <class _CharT, class _Traits, class _Allocator>
849basic_string<_CharT, _Traits, _Allocator>
850basic_ostringstream<_CharT, _Traits, _Allocator>::str() const
851{
852 return __sb_.str();
853}
854
855template <class _CharT, class _Traits, class _Allocator>
856void
857basic_ostringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
858{
859 __sb_.str(__s);
860}
861
862// basic_stringstream798// basic_stringstream
863799
864template <class _CharT, class _Traits, class _Allocator>800template <class _CharT, class _Traits, class _Allocator>
...@@ -879,75 +815,63 @@ private:...@@ -879,75 +815,63 @@ private:
879 basic_stringbuf<char_type, traits_type, allocator_type> __sb_;815 basic_stringbuf<char_type, traits_type, allocator_type> __sb_;
880816
881public:817public:
882 // 27.8.2.1 Constructors:818 // 30.8.5.1 [stringstream.cons], constructors
883 inline _LIBCPP_INLINE_VISIBILITY
884 explicit basic_stringstream(ios_base::openmode __wch = ios_base::in | ios_base::out);
885 inline _LIBCPP_INLINE_VISIBILITY
886 explicit basic_stringstream(const string_type& __s,
887 ios_base::openmode __wch = ios_base::in | ios_base::out);
888#ifndef _LIBCPP_CXX03_LANG819#ifndef _LIBCPP_CXX03_LANG
889 inline _LIBCPP_INLINE_VISIBILITY820 _LIBCPP_INLINE_VISIBILITY
890 basic_stringstream(basic_stringstream&& __rhs);821 basic_stringstream() : basic_stringstream(ios_base::in | ios_base::out) {}
822
823 _LIBCPP_INLINE_VISIBILITY
824 explicit basic_stringstream(ios_base::openmode __wch)
825 : basic_iostream<_CharT, _Traits>(&__sb_), __sb_(__wch) {}
826#else
827 _LIBCPP_INLINE_VISIBILITY
828 explicit basic_stringstream(ios_base::openmode __wch = ios_base::in |
829 ios_base::out)
830 : basic_iostream<_CharT, _Traits>(&__sb_), __sb_(__wch) {}
831#endif
832
833 _LIBCPP_INLINE_VISIBILITY
834 explicit basic_stringstream(const string_type& __s,
835 ios_base::openmode __wch = ios_base::in | ios_base::out)
836 : basic_iostream<_CharT, _Traits>(&__sb_)
837 , __sb_(__s, __wch)
838 { }
839
840 _LIBCPP_INLINE_VISIBILITY
841 basic_stringstream(basic_stringstream&& __rhs)
842 : basic_iostream<_CharT, _Traits>(_VSTD::move(__rhs))
843 , __sb_(_VSTD::move(__rhs.__sb_))
844 {
845 basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
846 }
891847
892 // 27.8.2.2 Assign and swap:848 // 27.8.2.2 Assign and swap:
893 basic_stringstream& operator=(basic_stringstream&& __rhs);849 basic_stringstream& operator=(basic_stringstream&& __rhs) {
894#endif // _LIBCPP_CXX03_LANG850 basic_iostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
895 inline _LIBCPP_INLINE_VISIBILITY851 __sb_ = _VSTD::move(__rhs.__sb_);
896 void swap(basic_stringstream& __rhs);852 return *this;
853 }
854 _LIBCPP_INLINE_VISIBILITY
855 void swap(basic_stringstream& __rhs) {
856 basic_iostream<char_type, traits_type>::swap(__rhs);
857 __sb_.swap(__rhs.__sb_);
858 }
897859
898 // 27.8.2.3 Members:860 // 27.8.2.3 Members:
899 inline _LIBCPP_INLINE_VISIBILITY861 _LIBCPP_INLINE_VISIBILITY
900 basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;862 basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
901 inline _LIBCPP_INLINE_VISIBILITY863 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
902 string_type str() const;864 }
903 inline _LIBCPP_INLINE_VISIBILITY865 _LIBCPP_INLINE_VISIBILITY
904 void str(const string_type& __s);866 string_type str() const {
867 return __sb_.str();
868 }
869 _LIBCPP_INLINE_VISIBILITY
870 void str(const string_type& __s) {
871 __sb_.str(__s);
872 }
905};873};
906874
907template <class _CharT, class _Traits, class _Allocator>
908basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(ios_base::openmode __wch)
909 : basic_iostream<_CharT, _Traits>(&__sb_),
910 __sb_(__wch)
911{
912}
913
914template <class _CharT, class _Traits, class _Allocator>
915basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(const string_type& __s,
916 ios_base::openmode __wch)
917 : basic_iostream<_CharT, _Traits>(&__sb_),
918 __sb_(__s, __wch)
919{
920}
921
922#ifndef _LIBCPP_CXX03_LANG
923
924template <class _CharT, class _Traits, class _Allocator>
925basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(basic_stringstream&& __rhs)
926 : basic_iostream<_CharT, _Traits>(_VSTD::move(__rhs)),
927 __sb_(_VSTD::move(__rhs.__sb_))
928{
929 basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
930}
931
932template <class _CharT, class _Traits, class _Allocator>
933basic_stringstream<_CharT, _Traits, _Allocator>&
934basic_stringstream<_CharT, _Traits, _Allocator>::operator=(basic_stringstream&& __rhs)
935{
936 basic_iostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
937 __sb_ = _VSTD::move(__rhs.__sb_);
938 return *this;
939}
940
941#endif // _LIBCPP_CXX03_LANG
942
943template <class _CharT, class _Traits, class _Allocator>
944void
945basic_stringstream<_CharT, _Traits, _Allocator>::swap(basic_stringstream& __rhs)
946{
947 basic_iostream<char_type, traits_type>::swap(__rhs);
948 __sb_.swap(__rhs.__sb_);
949}
950
951template <class _CharT, class _Traits, class _Allocator>875template <class _CharT, class _Traits, class _Allocator>
952inline _LIBCPP_INLINE_VISIBILITY876inline _LIBCPP_INLINE_VISIBILITY
953void877void
...@@ -957,26 +881,12 @@ swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x,...@@ -957,26 +881,12 @@ swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x,
957 __x.swap(__y);881 __x.swap(__y);
958}882}
959883
960template <class _CharT, class _Traits, class _Allocator>884#if defined(_LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1)
961basic_stringbuf<_CharT, _Traits, _Allocator>*885_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_stringbuf<char>)
962basic_stringstream<_CharT, _Traits, _Allocator>::rdbuf() const886_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_stringstream<char>)
963{887_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostringstream<char>)
964 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);888_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istringstream<char>)
965}889#endif
966
967template <class _CharT, class _Traits, class _Allocator>
968basic_string<_CharT, _Traits, _Allocator>
969basic_stringstream<_CharT, _Traits, _Allocator>::str() const
970{
971 return __sb_.str();
972}
973
974template <class _CharT, class _Traits, class _Allocator>
975void
976basic_stringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
977{
978 __sb_.str(__s);
979}
980890
981_LIBCPP_END_NAMESPACE_STD891_LIBCPP_END_NAMESPACE_STD
982892
lib/libcxx/include/stdexcept+1-3
...@@ -42,11 +42,9 @@ public:...@@ -42,11 +42,9 @@ public:
42*/42*/
4343
44#include <__config>44#include <__config>
45#include <cstdlib>
45#include <exception>46#include <exception>
46#include <iosfwd> // for string forward decl47#include <iosfwd> // for string forward decl
47#ifdef _LIBCPP_NO_EXCEPTIONS
48#include <cstdlib>
49#endif
5048
51#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)49#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
52#pragma GCC system_header50#pragma GCC system_header
lib/libcxx/include/streambuf+6-8
...@@ -308,12 +308,12 @@ basic_streambuf<_CharT, _Traits>::~basic_streambuf()...@@ -308,12 +308,12 @@ basic_streambuf<_CharT, _Traits>::~basic_streambuf()
308308
309template <class _CharT, class _Traits>309template <class _CharT, class _Traits>
310basic_streambuf<_CharT, _Traits>::basic_streambuf()310basic_streambuf<_CharT, _Traits>::basic_streambuf()
311 : __binp_(0),311 : __binp_(nullptr),
312 __ninp_(0),312 __ninp_(nullptr),
313 __einp_(0),313 __einp_(nullptr),
314 __bout_(0),314 __bout_(nullptr),
315 __nout_(0),315 __nout_(nullptr),
316 __eout_(0)316 __eout_(nullptr)
317{317{
318}318}
319319
...@@ -485,13 +485,11 @@ basic_streambuf<_CharT, _Traits>::overflow(int_type)...@@ -485,13 +485,11 @@ basic_streambuf<_CharT, _Traits>::overflow(int_type)
485 return traits_type::eof();485 return traits_type::eof();
486}486}
487487
488#ifndef _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
489_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>)488_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>)
490_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>)489_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>)
491490
492_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>)491_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>)
493_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>)492_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>)
494#endif
495493
496_LIBCPP_END_NAMESPACE_STD494_LIBCPP_END_NAMESPACE_STD
497495
lib/libcxx/include/string+198-144
...@@ -153,7 +153,8 @@ public:...@@ -153,7 +153,8 @@ public:
153 void resize(size_type n, value_type c);153 void resize(size_type n, value_type c);
154 void resize(size_type n);154 void resize(size_type n);
155155
156 void reserve(size_type res_arg = 0);156 void reserve(size_type res_arg);
157 void reserve(); // deprecated in C++20
157 void shrink_to_fit();158 void shrink_to_fit();
158 void clear() noexcept;159 void clear() noexcept;
159 bool empty() const noexcept;160 bool empty() const noexcept;
...@@ -316,12 +317,16 @@ public:...@@ -316,12 +317,16 @@ public:
316 int compare(size_type pos1, size_type n1, const value_type* s) const;317 int compare(size_type pos1, size_type n1, const value_type* s) const;
317 int compare(size_type pos1, size_type n1, const value_type* s, size_type n2) const;318 int compare(size_type pos1, size_type n1, const value_type* s, size_type n2) const;
318319
319 bool starts_with(basic_string_view<charT, traits> sv) const noexcept; // C++2a320 bool starts_with(basic_string_view<charT, traits> sv) const noexcept; // C++20
320 bool starts_with(charT c) const noexcept; // C++2a321 bool starts_with(charT c) const noexcept; // C++20
321 bool starts_with(const charT* s) const; // C++2a322 bool starts_with(const charT* s) const; // C++20
322 bool ends_with(basic_string_view<charT, traits> sv) const noexcept; // C++2a323 bool ends_with(basic_string_view<charT, traits> sv) const noexcept; // C++20
323 bool ends_with(charT c) const noexcept; // C++2a324 bool ends_with(charT c) const noexcept; // C++20
324 bool ends_with(const charT* s) const; // C++2a325 bool ends_with(const charT* s) const; // C++20
326
327 constexpr bool contains(basic_string_view<charT, traits> sv) const noexcept; // C++2b
328 constexpr bool contains(charT c) const noexcept; // C++2b
329 constexpr bool contains(const charT* s) const; // C++2b
325330
326 bool __invariants() const;331 bool __invariants() const;
327};332};
...@@ -448,15 +453,15 @@ typedef basic_string<wchar_t> wstring;...@@ -448,15 +453,15 @@ typedef basic_string<wchar_t> wstring;
448typedef basic_string<char16_t> u16string;453typedef basic_string<char16_t> u16string;
449typedef basic_string<char32_t> u32string;454typedef basic_string<char32_t> u32string;
450455
451int stoi (const string& str, size_t* idx = 0, int base = 10);456int stoi (const string& str, size_t* idx = nullptr, int base = 10);
452long stol (const string& str, size_t* idx = 0, int base = 10);457long stol (const string& str, size_t* idx = nullptr, int base = 10);
453unsigned long stoul (const string& str, size_t* idx = 0, int base = 10);458unsigned long stoul (const string& str, size_t* idx = nullptr, int base = 10);
454long long stoll (const string& str, size_t* idx = 0, int base = 10);459long long stoll (const string& str, size_t* idx = nullptr, int base = 10);
455unsigned long long stoull(const string& str, size_t* idx = 0, int base = 10);460unsigned long long stoull(const string& str, size_t* idx = nullptr, int base = 10);
456461
457float stof (const string& str, size_t* idx = 0);462float stof (const string& str, size_t* idx = nullptr);
458double stod (const string& str, size_t* idx = 0);463double stod (const string& str, size_t* idx = nullptr);
459long double stold(const string& str, size_t* idx = 0);464long double stold(const string& str, size_t* idx = nullptr);
460465
461string to_string(int val);466string to_string(int val);
462string to_string(unsigned val);467string to_string(unsigned val);
...@@ -468,15 +473,15 @@ string to_string(float val);...@@ -468,15 +473,15 @@ string to_string(float val);
468string to_string(double val);473string to_string(double val);
469string to_string(long double val);474string to_string(long double val);
470475
471int stoi (const wstring& str, size_t* idx = 0, int base = 10);476int stoi (const wstring& str, size_t* idx = nullptr, int base = 10);
472long stol (const wstring& str, size_t* idx = 0, int base = 10);477long stol (const wstring& str, size_t* idx = nullptr, int base = 10);
473unsigned long stoul (const wstring& str, size_t* idx = 0, int base = 10);478unsigned long stoul (const wstring& str, size_t* idx = nullptr, int base = 10);
474long long stoll (const wstring& str, size_t* idx = 0, int base = 10);479long long stoll (const wstring& str, size_t* idx = nullptr, int base = 10);
475unsigned long long stoull(const wstring& str, size_t* idx = 0, int base = 10);480unsigned long long stoull(const wstring& str, size_t* idx = nullptr, int base = 10);
476481
477float stof (const wstring& str, size_t* idx = 0);482float stof (const wstring& str, size_t* idx = nullptr);
478double stod (const wstring& str, size_t* idx = 0);483double stod (const wstring& str, size_t* idx = nullptr);
479long double stold(const wstring& str, size_t* idx = 0);484long double stold(const wstring& str, size_t* idx = nullptr);
480485
481wstring to_wstring(int val);486wstring to_wstring(int val);
482wstring to_wstring(unsigned val);487wstring to_wstring(unsigned val);
...@@ -665,8 +670,26 @@ struct __padding<_CharT, 1>...@@ -665,8 +670,26 @@ struct __padding<_CharT, 1>
665670
666#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT671#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
667672
673#ifndef _LIBCPP_NO_HAS_CHAR8_T
674typedef basic_string<char8_t> u8string;
675#endif
676
677#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
678typedef basic_string<char16_t> u16string;
679typedef basic_string<char32_t> u32string;
680#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
681
668template<class _CharT, class _Traits, class _Allocator>682template<class _CharT, class _Traits, class _Allocator>
669class _LIBCPP_TEMPLATE_VIS basic_string683class
684 _LIBCPP_TEMPLATE_VIS
685#ifndef _LIBCPP_NO_HAS_CHAR8_T
686 _LIBCPP_PREFERRED_NAME(u8string)
687#endif
688#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
689 _LIBCPP_PREFERRED_NAME(u16string)
690 _LIBCPP_PREFERRED_NAME(u32string)
691#endif
692 basic_string
670 : private __basic_string_common<true>693 : private __basic_string_common<true>
671{694{
672public:695public:
...@@ -816,7 +839,7 @@ public:...@@ -816,7 +839,7 @@ public:
816 basic_string(const _CharT* __s) : __r_(__default_init_tag(), __default_init_tag()) {839 basic_string(const _CharT* __s) : __r_(__default_init_tag(), __default_init_tag()) {
817 _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr");840 _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr");
818 __init(__s, traits_type::length(__s));841 __init(__s, traits_type::length(__s));
819# if _LIBCPP_DEBUG_LEVEL >= 2842# if _LIBCPP_DEBUG_LEVEL == 2
820 __get_db()->__insert_c(this);843 __get_db()->__insert_c(this);
821# endif844# endif
822 }845 }
...@@ -890,7 +913,7 @@ public:...@@ -890,7 +913,7 @@ public:
890 _LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);}913 _LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);}
891 basic_string& operator=(value_type __c);914 basic_string& operator=(value_type __c);
892915
893#if _LIBCPP_DEBUG_LEVEL >= 2916#if _LIBCPP_DEBUG_LEVEL == 2
894 _LIBCPP_INLINE_VISIBILITY917 _LIBCPP_INLINE_VISIBILITY
895 iterator begin() _NOEXCEPT918 iterator begin() _NOEXCEPT
896 {return iterator(this, __get_pointer());}919 {return iterator(this, __get_pointer());}
...@@ -916,7 +939,7 @@ public:...@@ -916,7 +939,7 @@ public:
916 _LIBCPP_INLINE_VISIBILITY939 _LIBCPP_INLINE_VISIBILITY
917 const_iterator end() const _NOEXCEPT940 const_iterator end() const _NOEXCEPT
918 {return const_iterator(__get_pointer() + size());}941 {return const_iterator(__get_pointer() + size());}
919#endif // _LIBCPP_DEBUG_LEVEL >= 2942#endif // _LIBCPP_DEBUG_LEVEL == 2
920 _LIBCPP_INLINE_VISIBILITY943 _LIBCPP_INLINE_VISIBILITY
921 reverse_iterator rbegin() _NOEXCEPT944 reverse_iterator rbegin() _NOEXCEPT
922 {return reverse_iterator(end());}945 {return reverse_iterator(end());}
...@@ -954,13 +977,13 @@ public:...@@ -954,13 +977,13 @@ public:
954 void resize(size_type __n, value_type __c);977 void resize(size_type __n, value_type __c);
955 _LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());}978 _LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());}
956979
957 void reserve(size_type __res_arg);980 void reserve(size_type __requested_capacity);
958 _LIBCPP_INLINE_VISIBILITY void __resize_default_init(size_type __n);981 _LIBCPP_INLINE_VISIBILITY void __resize_default_init(size_type __n);
959982
983 _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_INLINE_VISIBILITY
984 void reserve() _NOEXCEPT {shrink_to_fit();}
960 _LIBCPP_INLINE_VISIBILITY985 _LIBCPP_INLINE_VISIBILITY
961 void reserve() _NOEXCEPT {reserve(0);}986 void shrink_to_fit() _NOEXCEPT;
962 _LIBCPP_INLINE_VISIBILITY
963 void shrink_to_fit() _NOEXCEPT {reserve();}
964 _LIBCPP_INLINE_VISIBILITY987 _LIBCPP_INLINE_VISIBILITY
965 void clear() _NOEXCEPT;988 void clear() _NOEXCEPT;
966 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY989 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
...@@ -1414,22 +1437,38 @@ public:...@@ -1414,22 +1437,38 @@ public:
1414 { return ends_with(__self_view(__s)); }1437 { return ends_with(__self_view(__s)); }
1415#endif1438#endif
14161439
1440#if _LIBCPP_STD_VER > 20
1441 constexpr _LIBCPP_INLINE_VISIBILITY
1442 bool contains(__self_view __sv) const noexcept
1443 { return __self_view(data(), size()).contains(__sv); }
1444
1445 constexpr _LIBCPP_INLINE_VISIBILITY
1446 bool contains(value_type __c) const noexcept
1447 { return __self_view(data(), size()).contains(__c); }
1448
1449 constexpr _LIBCPP_INLINE_VISIBILITY
1450 bool contains(const value_type* __s) const
1451 { return __self_view(data(), size()).contains(__s); }
1452#endif
1453
1417 _LIBCPP_INLINE_VISIBILITY bool __invariants() const;1454 _LIBCPP_INLINE_VISIBILITY bool __invariants() const;
14181455
1419 _LIBCPP_INLINE_VISIBILITY void __clear_and_shrink() _NOEXCEPT;1456 _LIBCPP_INLINE_VISIBILITY void __clear_and_shrink() _NOEXCEPT;
14201457
1458 _LIBCPP_INLINE_VISIBILITY void __shrink_or_extend(size_type __target_capacity);
1459
1421 _LIBCPP_INLINE_VISIBILITY1460 _LIBCPP_INLINE_VISIBILITY
1422 bool __is_long() const _NOEXCEPT1461 bool __is_long() const _NOEXCEPT
1423 {return bool(__r_.first().__s.__size_ & __short_mask);}1462 {return bool(__r_.first().__s.__size_ & __short_mask);}
14241463
1425#if _LIBCPP_DEBUG_LEVEL >= 21464#if _LIBCPP_DEBUG_LEVEL == 2
14261465
1427 bool __dereferenceable(const const_iterator* __i) const;1466 bool __dereferenceable(const const_iterator* __i) const;
1428 bool __decrementable(const const_iterator* __i) const;1467 bool __decrementable(const const_iterator* __i) const;
1429 bool __addable(const const_iterator* __i, ptrdiff_t __n) const;1468 bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
1430 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;1469 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
14311470
1432#endif // _LIBCPP_DEBUG_LEVEL >= 21471#endif // _LIBCPP_DEBUG_LEVEL == 2
14331472
1434private:1473private:
1435 _LIBCPP_INLINE_VISIBILITY1474 _LIBCPP_INLINE_VISIBILITY
...@@ -1726,21 +1765,21 @@ inline...@@ -1726,21 +1765,21 @@ inline
1726void1765void
1727basic_string<_CharT, _Traits, _Allocator>::__invalidate_all_iterators()1766basic_string<_CharT, _Traits, _Allocator>::__invalidate_all_iterators()
1728{1767{
1729#if _LIBCPP_DEBUG_LEVEL >= 21768#if _LIBCPP_DEBUG_LEVEL == 2
1730 __get_db()->__invalidate_all(this);1769 __get_db()->__invalidate_all(this);
1731#endif // _LIBCPP_DEBUG_LEVEL >= 21770#endif
1732}1771}
17331772
1734template <class _CharT, class _Traits, class _Allocator>1773template <class _CharT, class _Traits, class _Allocator>
1735inline1774inline
1736void1775void
1737basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type1776basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type
1738#if _LIBCPP_DEBUG_LEVEL >= 21777#if _LIBCPP_DEBUG_LEVEL == 2
1739 __pos1778 __pos
1740#endif1779#endif
1741 )1780 )
1742{1781{
1743#if _LIBCPP_DEBUG_LEVEL >= 21782#if _LIBCPP_DEBUG_LEVEL == 2
1744 __c_node* __c = __get_db()->__find_c_and_lock(this);1783 __c_node* __c = __get_db()->__find_c_and_lock(this);
1745 if (__c)1784 if (__c)
1746 {1785 {
...@@ -1753,12 +1792,12 @@ basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type...@@ -1753,12 +1792,12 @@ basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type
1753 {1792 {
1754 (*__p)->__c_ = nullptr;1793 (*__p)->__c_ = nullptr;
1755 if (--__c->end_ != __p)1794 if (--__c->end_ != __p)
1756 memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));1795 _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
1757 }1796 }
1758 }1797 }
1759 __get_db()->unlock();1798 __get_db()->unlock();
1760 }1799 }
1761#endif // _LIBCPP_DEBUG_LEVEL >= 21800#endif // _LIBCPP_DEBUG_LEVEL == 2
1762}1801}
17631802
1764template <class _CharT, class _Traits, class _Allocator>1803template <class _CharT, class _Traits, class _Allocator>
...@@ -1767,7 +1806,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string()...@@ -1767,7 +1806,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string()
1767 _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)1806 _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
1768 : __r_(__default_init_tag(), __default_init_tag())1807 : __r_(__default_init_tag(), __default_init_tag())
1769{1808{
1770#if _LIBCPP_DEBUG_LEVEL >= 21809#if _LIBCPP_DEBUG_LEVEL == 2
1771 __get_db()->__insert_c(this);1810 __get_db()->__insert_c(this);
1772#endif1811#endif
1773 __zero();1812 __zero();
...@@ -1783,7 +1822,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __...@@ -1783,7 +1822,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __
1783#endif1822#endif
1784: __r_(__default_init_tag(), __a)1823: __r_(__default_init_tag(), __a)
1785{1824{
1786#if _LIBCPP_DEBUG_LEVEL >= 21825#if _LIBCPP_DEBUG_LEVEL == 2
1787 __get_db()->__insert_c(this);1826 __get_db()->__insert_c(this);
1788#endif1827#endif
1789 __zero();1828 __zero();
...@@ -1845,7 +1884,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, const...@@ -1845,7 +1884,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, const
1845{1884{
1846 _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");1885 _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
1847 __init(__s, traits_type::length(__s));1886 __init(__s, traits_type::length(__s));
1848#if _LIBCPP_DEBUG_LEVEL >= 21887#if _LIBCPP_DEBUG_LEVEL == 2
1849 __get_db()->__insert_c(this);1888 __get_db()->__insert_c(this);
1850#endif1889#endif
1851}1890}
...@@ -1857,7 +1896,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, size_...@@ -1857,7 +1896,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, size_
1857{1896{
1858 _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");1897 _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
1859 __init(__s, __n);1898 __init(__s, __n);
1860#if _LIBCPP_DEBUG_LEVEL >= 21899#if _LIBCPP_DEBUG_LEVEL == 2
1861 __get_db()->__insert_c(this);1900 __get_db()->__insert_c(this);
1862#endif1901#endif
1863}1902}
...@@ -1869,7 +1908,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, size_...@@ -1869,7 +1908,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, size_
1869{1908{
1870 _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");1909 _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");
1871 __init(__s, __n);1910 __init(__s, __n);
1872#if _LIBCPP_DEBUG_LEVEL >= 21911#if _LIBCPP_DEBUG_LEVEL == 2
1873 __get_db()->__insert_c(this);1912 __get_db()->__insert_c(this);
1874#endif1913#endif
1875}1914}
...@@ -1884,7 +1923,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st...@@ -1884,7 +1923,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
1884 __init_copy_ctor_external(_VSTD::__to_address(__str.__get_long_pointer()),1923 __init_copy_ctor_external(_VSTD::__to_address(__str.__get_long_pointer()),
1885 __str.__get_long_size());1924 __str.__get_long_size());
18861925
1887#if _LIBCPP_DEBUG_LEVEL >= 21926#if _LIBCPP_DEBUG_LEVEL == 2
1888 __get_db()->__insert_c(this);1927 __get_db()->__insert_c(this);
1889#endif1928#endif
1890}1929}
...@@ -1899,7 +1938,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(...@@ -1899,7 +1938,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(
1899 else1938 else
1900 __init_copy_ctor_external(_VSTD::__to_address(__str.__get_long_pointer()),1939 __init_copy_ctor_external(_VSTD::__to_address(__str.__get_long_pointer()),
1901 __str.__get_long_size());1940 __str.__get_long_size());
1902#if _LIBCPP_DEBUG_LEVEL >= 21941#if _LIBCPP_DEBUG_LEVEL == 2
1903 __get_db()->__insert_c(this);1942 __get_db()->__insert_c(this);
1904#endif1943#endif
1905}1944}
...@@ -1936,7 +1975,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str)...@@ -1936,7 +1975,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str)
1936 : __r_(_VSTD::move(__str.__r_))1975 : __r_(_VSTD::move(__str.__r_))
1937{1976{
1938 __str.__zero();1977 __str.__zero();
1939#if _LIBCPP_DEBUG_LEVEL >= 21978#if _LIBCPP_DEBUG_LEVEL == 2
1940 __get_db()->__insert_c(this);1979 __get_db()->__insert_c(this);
1941 if (__is_long())1980 if (__is_long())
1942 __get_db()->swap(this, &__str);1981 __get_db()->swap(this, &__str);
...@@ -1955,7 +1994,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, co...@@ -1955,7 +1994,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, co
1955 __r_.first().__r = __str.__r_.first().__r;1994 __r_.first().__r = __str.__r_.first().__r;
1956 __str.__zero();1995 __str.__zero();
1957 }1996 }
1958#if _LIBCPP_DEBUG_LEVEL >= 21997#if _LIBCPP_DEBUG_LEVEL == 2
1959 __get_db()->__insert_c(this);1998 __get_db()->__insert_c(this);
1960 if (__is_long())1999 if (__is_long())
1961 __get_db()->swap(this, &__str);2000 __get_db()->swap(this, &__str);
...@@ -1994,7 +2033,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __...@@ -1994,7 +2033,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __
1994 : __r_(__default_init_tag(), __default_init_tag())2033 : __r_(__default_init_tag(), __default_init_tag())
1995{2034{
1996 __init(__n, __c);2035 __init(__n, __c);
1997#if _LIBCPP_DEBUG_LEVEL >= 22036#if _LIBCPP_DEBUG_LEVEL == 2
1998 __get_db()->__insert_c(this);2037 __get_db()->__insert_c(this);
1999#endif2038#endif
2000}2039}
...@@ -2005,7 +2044,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __...@@ -2005,7 +2044,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __
2005 : __r_(__default_init_tag(), __a)2044 : __r_(__default_init_tag(), __a)
2006{2045{
2007 __init(__n, __c);2046 __init(__n, __c);
2008#if _LIBCPP_DEBUG_LEVEL >= 22047#if _LIBCPP_DEBUG_LEVEL == 2
2009 __get_db()->__insert_c(this);2048 __get_db()->__insert_c(this);
2010#endif2049#endif
2011}2050}
...@@ -2020,7 +2059,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st...@@ -2020,7 +2059,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
2020 if (__pos > __str_sz)2059 if (__pos > __str_sz)
2021 this->__throw_out_of_range();2060 this->__throw_out_of_range();
2022 __init(__str.data() + __pos, _VSTD::min(__n, __str_sz - __pos));2061 __init(__str.data() + __pos, _VSTD::min(__n, __str_sz - __pos));
2023#if _LIBCPP_DEBUG_LEVEL >= 22062#if _LIBCPP_DEBUG_LEVEL == 2
2024 __get_db()->__insert_c(this);2063 __get_db()->__insert_c(this);
2025#endif2064#endif
2026}2065}
...@@ -2035,7 +2074,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st...@@ -2035,7 +2074,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
2035 if (__pos > __str_sz)2074 if (__pos > __str_sz)
2036 this->__throw_out_of_range();2075 this->__throw_out_of_range();
2037 __init(__str.data() + __pos, __str_sz - __pos);2076 __init(__str.data() + __pos, __str_sz - __pos);
2038#if _LIBCPP_DEBUG_LEVEL >= 22077#if _LIBCPP_DEBUG_LEVEL == 2
2039 __get_db()->__insert_c(this);2078 __get_db()->__insert_c(this);
2040#endif2079#endif
2041}2080}
...@@ -2049,7 +2088,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(...@@ -2049,7 +2088,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(
2049 __self_view __sv0 = __t;2088 __self_view __sv0 = __t;
2050 __self_view __sv = __sv0.substr(__pos, __n);2089 __self_view __sv = __sv0.substr(__pos, __n);
2051 __init(__sv.data(), __sv.size());2090 __init(__sv.data(), __sv.size());
2052#if _LIBCPP_DEBUG_LEVEL >= 22091#if _LIBCPP_DEBUG_LEVEL == 2
2053 __get_db()->__insert_c(this);2092 __get_db()->__insert_c(this);
2054#endif2093#endif
2055}2094}
...@@ -2061,7 +2100,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t)...@@ -2061,7 +2100,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t)
2061{2100{
2062 __self_view __sv = __t;2101 __self_view __sv = __t;
2063 __init(__sv.data(), __sv.size());2102 __init(__sv.data(), __sv.size());
2064#if _LIBCPP_DEBUG_LEVEL >= 22103#if _LIBCPP_DEBUG_LEVEL == 2
2065 __get_db()->__insert_c(this);2104 __get_db()->__insert_c(this);
2066#endif2105#endif
2067}2106}
...@@ -2073,7 +2112,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t, const _...@@ -2073,7 +2112,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t, const _
2073{2112{
2074 __self_view __sv = __t;2113 __self_view __sv = __t;
2075 __init(__sv.data(), __sv.size());2114 __init(__sv.data(), __sv.size());
2076#if _LIBCPP_DEBUG_LEVEL >= 22115#if _LIBCPP_DEBUG_LEVEL == 2
2077 __get_db()->__insert_c(this);2116 __get_db()->__insert_c(this);
2078#endif2117#endif
2079}2118}
...@@ -2141,7 +2180,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first,...@@ -2141,7 +2180,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first,
2141 : __r_(__default_init_tag(), __default_init_tag())2180 : __r_(__default_init_tag(), __default_init_tag())
2142{2181{
2143 __init(__first, __last);2182 __init(__first, __last);
2144#if _LIBCPP_DEBUG_LEVEL >= 22183#if _LIBCPP_DEBUG_LEVEL == 2
2145 __get_db()->__insert_c(this);2184 __get_db()->__insert_c(this);
2146#endif2185#endif
2147}2186}
...@@ -2154,7 +2193,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first,...@@ -2154,7 +2193,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first,
2154 : __r_(__default_init_tag(), __a)2193 : __r_(__default_init_tag(), __a)
2155{2194{
2156 __init(__first, __last);2195 __init(__first, __last);
2157#if _LIBCPP_DEBUG_LEVEL >= 22196#if _LIBCPP_DEBUG_LEVEL == 2
2158 __get_db()->__insert_c(this);2197 __get_db()->__insert_c(this);
2159#endif2198#endif
2160}2199}
...@@ -2168,7 +2207,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(...@@ -2168,7 +2207,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(
2168 : __r_(__default_init_tag(), __default_init_tag())2207 : __r_(__default_init_tag(), __default_init_tag())
2169{2208{
2170 __init(__il.begin(), __il.end());2209 __init(__il.begin(), __il.end());
2171#if _LIBCPP_DEBUG_LEVEL >= 22210#if _LIBCPP_DEBUG_LEVEL == 2
2172 __get_db()->__insert_c(this);2211 __get_db()->__insert_c(this);
2173#endif2212#endif
2174}2213}
...@@ -2181,7 +2220,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(...@@ -2181,7 +2220,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(
2181 : __r_(__default_init_tag(), __a)2220 : __r_(__default_init_tag(), __a)
2182{2221{
2183 __init(__il.begin(), __il.end());2222 __init(__il.begin(), __il.end());
2184#if _LIBCPP_DEBUG_LEVEL >= 22223#if _LIBCPP_DEBUG_LEVEL == 2
2185 __get_db()->__insert_c(this);2224 __get_db()->__insert_c(this);
2186#endif2225#endif
2187}2226}
...@@ -2191,7 +2230,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(...@@ -2191,7 +2230,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(
2191template <class _CharT, class _Traits, class _Allocator>2230template <class _CharT, class _Traits, class _Allocator>
2192basic_string<_CharT, _Traits, _Allocator>::~basic_string()2231basic_string<_CharT, _Traits, _Allocator>::~basic_string()
2193{2232{
2194#if _LIBCPP_DEBUG_LEVEL >= 22233#if _LIBCPP_DEBUG_LEVEL == 2
2195 __get_db()->__erase_c(this);2234 __get_db()->__erase_c(this);
2196#endif2235#endif
2197 if (__is_long())2236 if (__is_long())
...@@ -2768,7 +2807,7 @@ _EnableIf...@@ -2768,7 +2807,7 @@ _EnableIf
2768>2807>
2769basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _InputIterator __first, _InputIterator __last)2808basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _InputIterator __first, _InputIterator __last)
2770{2809{
2771#if _LIBCPP_DEBUG_LEVEL >= 22810#if _LIBCPP_DEBUG_LEVEL == 2
2772 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,2811 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
2773 "string::insert(iterator, range) called with an iterator not"2812 "string::insert(iterator, range) called with an iterator not"
2774 " referring to this string");2813 " referring to this string");
...@@ -2787,7 +2826,7 @@ _EnableIf...@@ -2787,7 +2826,7 @@ _EnableIf
2787>2826>
2788basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last)2827basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last)
2789{2828{
2790#if _LIBCPP_DEBUG_LEVEL >= 22829#if _LIBCPP_DEBUG_LEVEL == 2
2791 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,2830 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
2792 "string::insert(iterator, range) called with an iterator not"2831 "string::insert(iterator, range) called with an iterator not"
2793 " referring to this string");2832 " referring to this string");
...@@ -2903,7 +2942,7 @@ inline...@@ -2903,7 +2942,7 @@ inline
2903typename basic_string<_CharT, _Traits, _Allocator>::iterator2942typename basic_string<_CharT, _Traits, _Allocator>::iterator
2904basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, size_type __n, value_type __c)2943basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, size_type __n, value_type __c)
2905{2944{
2906#if _LIBCPP_DEBUG_LEVEL >= 22945#if _LIBCPP_DEBUG_LEVEL == 2
2907 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,2946 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
2908 "string::insert(iterator, n, value) called with an iterator not"2947 "string::insert(iterator, n, value) called with an iterator not"
2909 " referring to this string");2948 " referring to this string");
...@@ -3137,7 +3176,7 @@ inline...@@ -3137,7 +3176,7 @@ inline
3137typename basic_string<_CharT, _Traits, _Allocator>::iterator3176typename basic_string<_CharT, _Traits, _Allocator>::iterator
3138basic_string<_CharT, _Traits, _Allocator>::erase(const_iterator __pos)3177basic_string<_CharT, _Traits, _Allocator>::erase(const_iterator __pos)
3139{3178{
3140#if _LIBCPP_DEBUG_LEVEL >= 23179#if _LIBCPP_DEBUG_LEVEL == 2
3141 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,3180 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
3142 "string::erase(iterator) called with an iterator not"3181 "string::erase(iterator) called with an iterator not"
3143 " referring to this string");3182 " referring to this string");
...@@ -3155,7 +3194,7 @@ inline...@@ -3155,7 +3194,7 @@ inline
3155typename basic_string<_CharT, _Traits, _Allocator>::iterator3194typename basic_string<_CharT, _Traits, _Allocator>::iterator
3156basic_string<_CharT, _Traits, _Allocator>::erase(const_iterator __first, const_iterator __last)3195basic_string<_CharT, _Traits, _Allocator>::erase(const_iterator __first, const_iterator __last)
3157{3196{
3158#if _LIBCPP_DEBUG_LEVEL >= 23197#if _LIBCPP_DEBUG_LEVEL == 2
3159 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,3198 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,
3160 "string::erase(iterator, iterator) called with an iterator not"3199 "string::erase(iterator, iterator) called with an iterator not"
3161 " referring to this string");3200 " referring to this string");
...@@ -3262,65 +3301,88 @@ basic_string<_CharT, _Traits, _Allocator>::max_size() const _NOEXCEPT...@@ -3262,65 +3301,88 @@ basic_string<_CharT, _Traits, _Allocator>::max_size() const _NOEXCEPT
32623301
3263template <class _CharT, class _Traits, class _Allocator>3302template <class _CharT, class _Traits, class _Allocator>
3264void3303void
3265basic_string<_CharT, _Traits, _Allocator>::reserve(size_type __res_arg)3304basic_string<_CharT, _Traits, _Allocator>::reserve(size_type __requested_capacity)
3266{3305{
3267 if (__res_arg > max_size())3306 if (__requested_capacity > max_size())
3268 this->__throw_length_error();3307 this->__throw_length_error();
3308
3309#if _LIBCPP_STD_VER > 17
3310 // Reserve never shrinks as of C++20.
3311 if (__requested_capacity <= capacity()) return;
3312#endif
3313
3314 size_type __target_capacity = _VSTD::max(__requested_capacity, size());
3315 __target_capacity = __recommend(__target_capacity);
3316 if (__target_capacity == capacity()) return;
3317
3318 __shrink_or_extend(__target_capacity);
3319}
3320
3321template <class _CharT, class _Traits, class _Allocator>
3322void
3323basic_string<_CharT, _Traits, _Allocator>::shrink_to_fit() _NOEXCEPT
3324{
3325 size_type __target_capacity = __recommend(size());
3326 if (__target_capacity == capacity()) return;
3327
3328 __shrink_or_extend(__target_capacity);
3329}
3330
3331template <class _CharT, class _Traits, class _Allocator>
3332void
3333basic_string<_CharT, _Traits, _Allocator>::__shrink_or_extend(size_type __target_capacity)
3334{
3269 size_type __cap = capacity();3335 size_type __cap = capacity();
3270 size_type __sz = size();3336 size_type __sz = size();
3271 __res_arg = _VSTD::max(__res_arg, __sz);3337
3272 __res_arg = __recommend(__res_arg);3338 pointer __new_data, __p;
3273 if (__res_arg != __cap)3339 bool __was_long, __now_long;
3340 if (__target_capacity == __min_cap - 1)
3274 {3341 {
3275 pointer __new_data, __p;3342 __was_long = true;
3276 bool __was_long, __now_long;3343 __now_long = false;
3277 if (__res_arg == __min_cap - 1)3344 __new_data = __get_short_pointer();
3278 {3345 __p = __get_long_pointer();
3279 __was_long = true;3346 }
3280 __now_long = false;3347 else
3281 __new_data = __get_short_pointer();3348 {
3282 __p = __get_long_pointer();3349 if (__target_capacity > __cap)
3283 }3350 __new_data = __alloc_traits::allocate(__alloc(), __target_capacity+1);
3284 else3351 else
3285 {3352 {
3286 if (__res_arg > __cap)3353 #ifndef _LIBCPP_NO_EXCEPTIONS
3287 __new_data = __alloc_traits::allocate(__alloc(), __res_arg+1);3354 try
3288 else
3289 {3355 {
3290 #ifndef _LIBCPP_NO_EXCEPTIONS3356 #endif // _LIBCPP_NO_EXCEPTIONS
3291 try3357 __new_data = __alloc_traits::allocate(__alloc(), __target_capacity+1);
3292 {3358 #ifndef _LIBCPP_NO_EXCEPTIONS
3293 #endif // _LIBCPP_NO_EXCEPTIONS
3294 __new_data = __alloc_traits::allocate(__alloc(), __res_arg+1);
3295 #ifndef _LIBCPP_NO_EXCEPTIONS
3296 }
3297 catch (...)
3298 {
3299 return;
3300 }
3301 #else // _LIBCPP_NO_EXCEPTIONS
3302 if (__new_data == nullptr)
3303 return;
3304 #endif // _LIBCPP_NO_EXCEPTIONS
3305 }3359 }
3306 __now_long = true;3360 catch (...)
3307 __was_long = __is_long();3361 {
3308 __p = __get_pointer();3362 return;
3309 }3363 }
3310 traits_type::copy(_VSTD::__to_address(__new_data),3364 #else // _LIBCPP_NO_EXCEPTIONS
3311 _VSTD::__to_address(__p), size()+1);3365 if (__new_data == nullptr)
3312 if (__was_long)3366 return;
3313 __alloc_traits::deallocate(__alloc(), __p, __cap+1);3367 #endif // _LIBCPP_NO_EXCEPTIONS
3314 if (__now_long)
3315 {
3316 __set_long_cap(__res_arg+1);
3317 __set_long_size(__sz);
3318 __set_long_pointer(__new_data);
3319 }3368 }
3320 else3369 __now_long = true;
3321 __set_short_size(__sz);3370 __was_long = __is_long();
3322 __invalidate_all_iterators();3371 __p = __get_pointer();
3323 }3372 }
3373 traits_type::copy(_VSTD::__to_address(__new_data),
3374 _VSTD::__to_address(__p), size()+1);
3375 if (__was_long)
3376 __alloc_traits::deallocate(__alloc(), __p, __cap+1);
3377 if (__now_long)
3378 {
3379 __set_long_cap(__target_capacity+1);
3380 __set_long_size(__sz);
3381 __set_long_pointer(__new_data);
3382 }
3383 else
3384 __set_short_size(__sz);
3385 __invalidate_all_iterators();
3324}3386}
33253387
3326template <class _CharT, class _Traits, class _Allocator>3388template <class _CharT, class _Traits, class _Allocator>
...@@ -3426,7 +3488,7 @@ basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)...@@ -3426,7 +3488,7 @@ basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)
3426 __is_nothrow_swappable<allocator_type>::value)3488 __is_nothrow_swappable<allocator_type>::value)
3427#endif3489#endif
3428{3490{
3429#if _LIBCPP_DEBUG_LEVEL >= 23491#if _LIBCPP_DEBUG_LEVEL == 2
3430 if (!__is_long())3492 if (!__is_long())
3431 __get_db()->__invalidate_all(this);3493 __get_db()->__invalidate_all(this);
3432 if (!__str.__is_long())3494 if (!__str.__is_long())
...@@ -3438,7 +3500,7 @@ basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)...@@ -3438,7 +3500,7 @@ basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)
3438 __alloc_traits::is_always_equal::value ||3500 __alloc_traits::is_always_equal::value ||
3439 __alloc() == __str.__alloc(), "swapping non-equal allocators");3501 __alloc() == __str.__alloc(), "swapping non-equal allocators");
3440 _VSTD::swap(__r_.first(), __str.__r_.first());3502 _VSTD::swap(__r_.first(), __str.__r_.first());
3441 __swap_allocator(__alloc(), __str.__alloc());3503 _VSTD::__swap_allocator(__alloc(), __str.__alloc());
3442}3504}
34433505
3444// find3506// find
...@@ -3939,9 +4001,9 @@ basic_string<_CharT, _Traits, _Allocator>::__invariants() const...@@ -3939,9 +4001,9 @@ basic_string<_CharT, _Traits, _Allocator>::__invariants() const
3939 return false;4001 return false;
3940 if (capacity() < __min_cap - 1)4002 if (capacity() < __min_cap - 1)
3941 return false;4003 return false;
3942 if (data() == 0)4004 if (data() == nullptr)
3943 return false;4005 return false;
3944 if (data()[size()] != value_type(0))4006 if (data()[size()] != value_type())
3945 return false;4007 return false;
3946 return true;4008 return true;
3947}4009}
...@@ -3959,6 +4021,7 @@ basic_string<_CharT, _Traits, _Allocator>::__clear_and_shrink() _NOEXCEPT...@@ -3959,6 +4021,7 @@ basic_string<_CharT, _Traits, _Allocator>::__clear_and_shrink() _NOEXCEPT
3959 __alloc_traits::deallocate(__alloc(), __get_long_pointer(), capacity() + 1);4021 __alloc_traits::deallocate(__alloc(), __get_long_pointer(), capacity() + 1);
3960 __set_long_cap(0);4022 __set_long_cap(0);
3961 __set_short_size(0);4023 __set_short_size(0);
4024 traits_type::assign(*__get_short_pointer(), value_type());
3962 }4025 }
3963}4026}
39644027
...@@ -4300,24 +4363,15 @@ swap(basic_string<_CharT, _Traits, _Allocator>& __lhs,...@@ -4300,24 +4363,15 @@ swap(basic_string<_CharT, _Traits, _Allocator>& __lhs,
4300 __lhs.swap(__rhs);4363 __lhs.swap(__rhs);
4301}4364}
43024365
4303#ifndef _LIBCPP_NO_HAS_CHAR8_T4366_LIBCPP_FUNC_VIS int stoi (const string& __str, size_t* __idx = nullptr, int __base = 10);
4304typedef basic_string<char8_t> u8string;4367_LIBCPP_FUNC_VIS long stol (const string& __str, size_t* __idx = nullptr, int __base = 10);
4305#endif4368_LIBCPP_FUNC_VIS unsigned long stoul (const string& __str, size_t* __idx = nullptr, int __base = 10);
43064369_LIBCPP_FUNC_VIS long long stoll (const string& __str, size_t* __idx = nullptr, int __base = 10);
4307#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS4370_LIBCPP_FUNC_VIS unsigned long long stoull(const string& __str, size_t* __idx = nullptr, int __base = 10);
4308typedef basic_string<char16_t> u16string;
4309typedef basic_string<char32_t> u32string;
4310#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
4311
4312_LIBCPP_FUNC_VIS int stoi (const string& __str, size_t* __idx = 0, int __base = 10);
4313_LIBCPP_FUNC_VIS long stol (const string& __str, size_t* __idx = 0, int __base = 10);
4314_LIBCPP_FUNC_VIS unsigned long stoul (const string& __str, size_t* __idx = 0, int __base = 10);
4315_LIBCPP_FUNC_VIS long long stoll (const string& __str, size_t* __idx = 0, int __base = 10);
4316_LIBCPP_FUNC_VIS unsigned long long stoull(const string& __str, size_t* __idx = 0, int __base = 10);
43174371
4318_LIBCPP_FUNC_VIS float stof (const string& __str, size_t* __idx = 0);4372_LIBCPP_FUNC_VIS float stof (const string& __str, size_t* __idx = nullptr);
4319_LIBCPP_FUNC_VIS double stod (const string& __str, size_t* __idx = 0);4373_LIBCPP_FUNC_VIS double stod (const string& __str, size_t* __idx = nullptr);
4320_LIBCPP_FUNC_VIS long double stold(const string& __str, size_t* __idx = 0);4374_LIBCPP_FUNC_VIS long double stold(const string& __str, size_t* __idx = nullptr);
43214375
4322_LIBCPP_FUNC_VIS string to_string(int __val);4376_LIBCPP_FUNC_VIS string to_string(int __val);
4323_LIBCPP_FUNC_VIS string to_string(unsigned __val);4377_LIBCPP_FUNC_VIS string to_string(unsigned __val);
...@@ -4329,15 +4383,15 @@ _LIBCPP_FUNC_VIS string to_string(float __val);...@@ -4329,15 +4383,15 @@ _LIBCPP_FUNC_VIS string to_string(float __val);
4329_LIBCPP_FUNC_VIS string to_string(double __val);4383_LIBCPP_FUNC_VIS string to_string(double __val);
4330_LIBCPP_FUNC_VIS string to_string(long double __val);4384_LIBCPP_FUNC_VIS string to_string(long double __val);
43314385
4332_LIBCPP_FUNC_VIS int stoi (const wstring& __str, size_t* __idx = 0, int __base = 10);4386_LIBCPP_FUNC_VIS int stoi (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
4333_LIBCPP_FUNC_VIS long stol (const wstring& __str, size_t* __idx = 0, int __base = 10);4387_LIBCPP_FUNC_VIS long stol (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
4334_LIBCPP_FUNC_VIS unsigned long stoul (const wstring& __str, size_t* __idx = 0, int __base = 10);4388_LIBCPP_FUNC_VIS unsigned long stoul (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
4335_LIBCPP_FUNC_VIS long long stoll (const wstring& __str, size_t* __idx = 0, int __base = 10);4389_LIBCPP_FUNC_VIS long long stoll (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
4336_LIBCPP_FUNC_VIS unsigned long long stoull(const wstring& __str, size_t* __idx = 0, int __base = 10);4390_LIBCPP_FUNC_VIS unsigned long long stoull(const wstring& __str, size_t* __idx = nullptr, int __base = 10);
43374391
4338_LIBCPP_FUNC_VIS float stof (const wstring& __str, size_t* __idx = 0);4392_LIBCPP_FUNC_VIS float stof (const wstring& __str, size_t* __idx = nullptr);
4339_LIBCPP_FUNC_VIS double stod (const wstring& __str, size_t* __idx = 0);4393_LIBCPP_FUNC_VIS double stod (const wstring& __str, size_t* __idx = nullptr);
4340_LIBCPP_FUNC_VIS long double stold(const wstring& __str, size_t* __idx = 0);4394_LIBCPP_FUNC_VIS long double stold(const wstring& __str, size_t* __idx = nullptr);
43414395
4342_LIBCPP_FUNC_VIS wstring to_wstring(int __val);4396_LIBCPP_FUNC_VIS wstring to_wstring(int __val);
4343_LIBCPP_FUNC_VIS wstring to_wstring(unsigned __val);4397_LIBCPP_FUNC_VIS wstring to_wstring(unsigned __val);
...@@ -4425,7 +4479,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -4425,7 +4479,7 @@ inline _LIBCPP_INLINE_VISIBILITY
4425}4479}
4426#endif4480#endif
44274481
4428#if _LIBCPP_DEBUG_LEVEL >= 24482#if _LIBCPP_DEBUG_LEVEL == 2
44294483
4430template<class _CharT, class _Traits, class _Allocator>4484template<class _CharT, class _Traits, class _Allocator>
4431bool4485bool
...@@ -4459,7 +4513,7 @@ basic_string<_CharT, _Traits, _Allocator>::__subscriptable(const const_iterator*...@@ -4459,7 +4513,7 @@ basic_string<_CharT, _Traits, _Allocator>::__subscriptable(const const_iterator*
4459 return this->data() <= __p && __p < this->data() + this->size();4513 return this->data() <= __p && __p < this->data() + this->size();
4460}4514}
44614515
4462#endif // _LIBCPP_DEBUG_LEVEL >= 24516#endif // _LIBCPP_DEBUG_LEVEL == 2
44634517
4464#if _LIBCPP_STD_VER > 114518#if _LIBCPP_STD_VER > 11
4465// Literal suffixes for basic_string [basic.string.literals]4519// Literal suffixes for basic_string [basic.string.literals]
lib/libcxx/include/string_view+48-17
...@@ -142,12 +142,16 @@ namespace std {...@@ -142,12 +142,16 @@ namespace std {
142 constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const;142 constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const;
143 constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const;143 constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const;
144144
145 constexpr bool starts_with(basic_string_view s) const noexcept; // C++2a145 constexpr bool starts_with(basic_string_view s) const noexcept; // C++20
146 constexpr bool starts_with(charT c) const noexcept; // C++2a146 constexpr bool starts_with(charT c) const noexcept; // C++20
147 constexpr bool starts_with(const charT* s) const; // C++2a147 constexpr bool starts_with(const charT* s) const; // C++20
148 constexpr bool ends_with(basic_string_view s) const noexcept; // C++2a148 constexpr bool ends_with(basic_string_view s) const noexcept; // C++20
149 constexpr bool ends_with(charT c) const noexcept; // C++2a149 constexpr bool ends_with(charT c) const noexcept; // C++20
150 constexpr bool ends_with(const charT* s) const; // C++2a150 constexpr bool ends_with(const charT* s) const; // C++20
151
152 constexpr bool contains(basic_string_view s) const noexcept; // C++2b
153 constexpr bool contains(charT c) const noexcept; // C++2b
154 constexpr bool contains(const charT* s) const; // C++2b
151155
152 private:156 private:
153 const_pointer data_; // exposition only157 const_pointer data_; // exposition only
...@@ -192,7 +196,26 @@ _LIBCPP_PUSH_MACROS...@@ -192,7 +196,26 @@ _LIBCPP_PUSH_MACROS
192_LIBCPP_BEGIN_NAMESPACE_STD196_LIBCPP_BEGIN_NAMESPACE_STD
193197
194template<class _CharT, class _Traits = char_traits<_CharT> >198template<class _CharT, class _Traits = char_traits<_CharT> >
195class _LIBCPP_TEMPLATE_VIS basic_string_view {199 class _LIBCPP_TEMPLATE_VIS basic_string_view;
200
201typedef basic_string_view<char> string_view;
202#ifndef _LIBCPP_NO_HAS_CHAR8_T
203typedef basic_string_view<char8_t> u8string_view;
204#endif
205typedef basic_string_view<char16_t> u16string_view;
206typedef basic_string_view<char32_t> u32string_view;
207typedef basic_string_view<wchar_t> wstring_view;
208
209template<class _CharT, class _Traits>
210class
211 _LIBCPP_PREFERRED_NAME(string_view)
212#ifndef _LIBCPP_NO_HAS_CHAR8_T
213 _LIBCPP_PREFERRED_NAME(u8string_view)
214#endif
215 _LIBCPP_PREFERRED_NAME(u16string_view)
216 _LIBCPP_PREFERRED_NAME(u32string_view)
217 _LIBCPP_PREFERRED_NAME(wstring_view)
218 basic_string_view {
196public:219public:
197 // types220 // types
198 typedef _Traits traits_type;221 typedef _Traits traits_type;
...@@ -236,7 +259,7 @@ public:...@@ -236,7 +259,7 @@ public:
236259
237 _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY260 _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
238 basic_string_view(const _CharT* __s)261 basic_string_view(const _CharT* __s)
239 : __data(__s), __size(std::__char_traits_length_checked<_Traits>(__s)) {}262 : __data(__s), __size(_VSTD::__char_traits_length_checked<_Traits>(__s)) {}
240263
241 // [string.view.iterators], iterators264 // [string.view.iterators], iterators
242 _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY265 _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
...@@ -278,7 +301,9 @@ public:...@@ -278,7 +301,9 @@ public:
278301
279 // [string.view.access], element access302 // [string.view.access], element access
280 _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY303 _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
281 const_reference operator[](size_type __pos) const _NOEXCEPT { return __data[__pos]; }304 const_reference operator[](size_type __pos) const _NOEXCEPT {
305 return _LIBCPP_ASSERT(__pos < size(), "string_view[] index out of bounds"), __data[__pos];
306 }
282307
283 _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY308 _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
284 const_reference at(size_type __pos) const309 const_reference at(size_type __pos) const
...@@ -601,6 +626,20 @@ public:...@@ -601,6 +626,20 @@ public:
601 { return ends_with(basic_string_view(__s)); }626 { return ends_with(basic_string_view(__s)); }
602#endif627#endif
603628
629#if _LIBCPP_STD_VER > 20
630 constexpr _LIBCPP_INLINE_VISIBILITY
631 bool contains(basic_string_view __sv) const noexcept
632 { return find(__sv) != npos; }
633
634 constexpr _LIBCPP_INLINE_VISIBILITY
635 bool contains(value_type __c) const noexcept
636 { return find(__c) != npos; }
637
638 constexpr _LIBCPP_INLINE_VISIBILITY
639 bool contains(const value_type* __s) const
640 { return find(__s) != npos; }
641#endif
642
604private:643private:
605 const value_type* __data;644 const value_type* __data;
606 size_type __size;645 size_type __size;
...@@ -774,14 +813,6 @@ basic_ostream<_CharT, _Traits>&...@@ -774,14 +813,6 @@ basic_ostream<_CharT, _Traits>&
774operator<<(basic_ostream<_CharT, _Traits>& __os,813operator<<(basic_ostream<_CharT, _Traits>& __os,
775 basic_string_view<_CharT, _Traits> __str);814 basic_string_view<_CharT, _Traits> __str);
776815
777typedef basic_string_view<char> string_view;
778#ifndef _LIBCPP_NO_HAS_CHAR8_T
779typedef basic_string_view<char8_t> u8string_view;
780#endif
781typedef basic_string_view<char16_t> u16string_view;
782typedef basic_string_view<char32_t> u32string_view;
783typedef basic_string_view<wchar_t> wstring_view;
784
785// [string.view.hash]816// [string.view.hash]
786template<class _CharT>817template<class _CharT>
787struct _LIBCPP_TEMPLATE_VIS hash<basic_string_view<_CharT, char_traits<_CharT> > >818struct _LIBCPP_TEMPLATE_VIS hash<basic_string_view<_CharT, char_traits<_CharT> > >
lib/libcxx/include/strstream+17-9
...@@ -17,14 +17,17 @@ class strstreambuf...@@ -17,14 +17,17 @@ class strstreambuf
17 : public basic_streambuf<char>17 : public basic_streambuf<char>
18{18{
19public:19public:
20 explicit strstreambuf(streamsize alsize_arg = 0);20 explicit strstreambuf(streamsize alsize_arg = 0); // before C++20
21 strstreambuf() : strstreambuf(0) {} // C++20
22 explicit strstreambuf(streamsize alsize_arg); // C++20
23
21 strstreambuf(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*));24 strstreambuf(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*));
22 strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = 0);25 strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = nullptr);
23 strstreambuf(const char* gnext_arg, streamsize n);26 strstreambuf(const char* gnext_arg, streamsize n);
2427
25 strstreambuf(signed char* gnext_arg, streamsize n, signed char* pbeg_arg = 0);28 strstreambuf(signed char* gnext_arg, streamsize n, signed char* pbeg_arg = nullptr);
26 strstreambuf(const signed char* gnext_arg, streamsize n);29 strstreambuf(const signed char* gnext_arg, streamsize n);
27 strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char* pbeg_arg = 0);30 strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char* pbeg_arg = nullptr);
28 strstreambuf(const unsigned char* gnext_arg, streamsize n);31 strstreambuf(const unsigned char* gnext_arg, streamsize n);
2932
30 strstreambuf(strstreambuf&& rhs);33 strstreambuf(strstreambuf&& rhs);
...@@ -140,14 +143,19 @@ class _LIBCPP_TYPE_VIS strstreambuf...@@ -140,14 +143,19 @@ class _LIBCPP_TYPE_VIS strstreambuf
140 : public streambuf143 : public streambuf
141{144{
142public:145public:
146#ifndef _LIBCPP_CXX03_LANG
147 strstreambuf() : strstreambuf(0) {}
148 explicit strstreambuf(streamsize __alsize);
149#else
143 explicit strstreambuf(streamsize __alsize = 0);150 explicit strstreambuf(streamsize __alsize = 0);
151#endif
144 strstreambuf(void* (*__palloc)(size_t), void (*__pfree)(void*));152 strstreambuf(void* (*__palloc)(size_t), void (*__pfree)(void*));
145 strstreambuf(char* __gnext, streamsize __n, char* __pbeg = 0);153 strstreambuf(char* __gnext, streamsize __n, char* __pbeg = nullptr);
146 strstreambuf(const char* __gnext, streamsize __n);154 strstreambuf(const char* __gnext, streamsize __n);
147155
148 strstreambuf(signed char* __gnext, streamsize __n, signed char* __pbeg = 0);156 strstreambuf(signed char* __gnext, streamsize __n, signed char* __pbeg = nullptr);
149 strstreambuf(const signed char* __gnext, streamsize __n);157 strstreambuf(const signed char* __gnext, streamsize __n);
150 strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = 0);158 strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = nullptr);
151 strstreambuf(const unsigned char* __gnext, streamsize __n);159 strstreambuf(const unsigned char* __gnext, streamsize __n);
152160
153#ifndef _LIBCPP_CXX03_LANG161#ifndef _LIBCPP_CXX03_LANG
...@@ -290,7 +298,7 @@ public:...@@ -290,7 +298,7 @@ public:
290 _LIBCPP_INLINE_VISIBILITY298 _LIBCPP_INLINE_VISIBILITY
291 ostrstream(char* __s, int __n, ios_base::openmode __mode = ios_base::out)299 ostrstream(char* __s, int __n, ios_base::openmode __mode = ios_base::out)
292 : ostream(&__sb_),300 : ostream(&__sb_),
293 __sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0))301 __sb_(__s, __n, __s + (__mode & ios::app ? _VSTD::strlen(__s) : 0))
294 {}302 {}
295303
296#ifndef _LIBCPP_CXX03_LANG304#ifndef _LIBCPP_CXX03_LANG
...@@ -350,7 +358,7 @@ public:...@@ -350,7 +358,7 @@ public:
350 _LIBCPP_INLINE_VISIBILITY358 _LIBCPP_INLINE_VISIBILITY
351 strstream(char* __s, int __n, ios_base::openmode __mode = ios_base::in | ios_base::out)359 strstream(char* __s, int __n, ios_base::openmode __mode = ios_base::in | ios_base::out)
352 : iostream(&__sb_),360 : iostream(&__sb_),
353 __sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0))361 __sb_(__s, __n, __s + (__mode & ios::app ? _VSTD::strlen(__s) : 0))
354 {}362 {}
355363
356#ifndef _LIBCPP_CXX03_LANG364#ifndef _LIBCPP_CXX03_LANG
lib/libcxx/include/support/android/locale_bionic.h deleted-69
...@@ -1,69 +0,0 @@
1// -*- C++ -*-
2//===------------------- support/android/locale_bionic.h ------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
11#define _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
12
13#if defined(__BIONIC__)
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19#include <stdlib.h>
20#include <xlocale.h>
21
22#ifdef __cplusplus
23}
24#endif
25
26#if defined(__ANDROID__)
27
28#include <android/api-level.h>
29#include <android/ndk-version.h>
30#if __ANDROID_API__ < 21
31#include <support/xlocale/__posix_l_fallback.h>
32#endif
33// In NDK versions later than 16, locale-aware functions are provided by
34// legacy_stdlib_inlines.h
35#if __NDK_MAJOR__ <= 16
36#if __ANDROID_API__ < 21
37#include <support/xlocale/__strtonum_fallback.h>
38#elif __ANDROID_API__ < 26
39
40#if defined(__cplusplus)
41extern "C" {
42#endif
43
44inline _LIBCPP_INLINE_VISIBILITY float strtof_l(const char* __nptr, char** __endptr,
45 locale_t) {
46 return ::strtof(__nptr, __endptr);
47}
48
49inline _LIBCPP_INLINE_VISIBILITY double strtod_l(const char* __nptr,
50 char** __endptr, locale_t) {
51 return ::strtod(__nptr, __endptr);
52}
53
54inline _LIBCPP_INLINE_VISIBILITY long strtol_l(const char* __nptr, char** __endptr,
55 int __base, locale_t) {
56 return ::strtol(__nptr, __endptr, __base);
57}
58
59#if defined(__cplusplus)
60}
61#endif
62
63#endif // __ANDROID_API__ < 26
64
65#endif // __NDK_MAJOR__ <= 16
66#endif // defined(__ANDROID__)
67
68#endif // defined(__BIONIC__)
69#endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
lib/libcxx/include/support/fuchsia/xlocale.h deleted-22
...@@ -1,22 +0,0 @@
1// -*- C++ -*-
2//===------------------- support/fuchsia/xlocale.h ------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
11#define _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
12
13#if defined(__Fuchsia__)
14
15#include <cstdlib>
16#include <cwchar>
17#include <support/xlocale/__posix_l_fallback.h>
18#include <support/xlocale/__strtonum_fallback.h>
19
20#endif // defined(__Fuchsia__)
21
22#endif // _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
lib/libcxx/include/support/ibm/limits.h deleted-98
...@@ -1,98 +0,0 @@
1// -*- C++ -*-
2//===--------------------- support/ibm/limits.h ---------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_IBM_LIMITS_H
11#define _LIBCPP_SUPPORT_IBM_LIMITS_H
12
13#if !defined(_AIX) // Linux
14#include <math.h> // for HUGE_VAL, HUGE_VALF, HUGE_VALL, and NAN
15
16static const unsigned int _QNAN_F = 0x7fc00000;
17#define NANF (*((float *)(&_QNAN_F)))
18static const unsigned int _QNAN_LDBL128[4] = {0x7ff80000, 0x0, 0x0, 0x0};
19#define NANL (*((long double *)(&_QNAN_LDBL128)))
20static const unsigned int _SNAN_F= 0x7f855555;
21#define NANSF (*((float *)(&_SNAN_F)))
22static const unsigned int _SNAN_D[2] = {0x7ff55555, 0x55555555};
23#define NANS (*((double *)(&_SNAN_D)))
24static const unsigned int _SNAN_LDBL128[4] = {0x7ff55555, 0x55555555, 0x0, 0x0};
25#define NANSL (*((long double *)(&_SNAN_LDBL128)))
26
27#define __builtin_huge_val() HUGE_VAL
28#define __builtin_huge_valf() HUGE_VALF
29#define __builtin_huge_vall() HUGE_VALL
30#define __builtin_nan(__dummy) NAN
31#define __builtin_nanf(__dummy) NANF
32#define __builtin_nanl(__dummy) NANL
33#define __builtin_nans(__dummy) NANS
34#define __builtin_nansf(__dummy) NANSF
35#define __builtin_nansl(__dummy) NANSL
36
37#else
38
39#include <math.h>
40#include <float.h> // limit constants
41
42#define __builtin_huge_val() HUGE_VAL //0x7ff0000000000000
43#define __builtin_huge_valf() HUGE_VALF //0x7f800000
44#define __builtin_huge_vall() HUGE_VALL //0x7ff0000000000000
45#define __builtin_nan(__dummy) nan(__dummy) //0x7ff8000000000000
46#define __builtin_nanf(__dummy) nanf(__dummy) // 0x7ff80000
47#define __builtin_nanl(__dummy) nanl(__dummy) //0x7ff8000000000000
48#define __builtin_nans(__dummy) DBL_SNAN //0x7ff5555555555555
49#define __builtin_nansf(__dummy) FLT_SNAN //0x7f855555
50#define __builtin_nansl(__dummy) DBL_SNAN //0x7ff5555555555555
51
52#define __FLT_MANT_DIG__ FLT_MANT_DIG
53#define __FLT_DIG__ FLT_DIG
54#define __FLT_RADIX__ FLT_RADIX
55#define __FLT_MIN_EXP__ FLT_MIN_EXP
56#define __FLT_MIN_10_EXP__ FLT_MIN_10_EXP
57#define __FLT_MAX_EXP__ FLT_MAX_EXP
58#define __FLT_MAX_10_EXP__ FLT_MAX_10_EXP
59#define __FLT_MIN__ FLT_MIN
60#define __FLT_MAX__ FLT_MAX
61#define __FLT_EPSILON__ FLT_EPSILON
62// predefined by XLC on LoP
63#define __FLT_DENORM_MIN__ 1.40129846e-45F
64
65#define __DBL_MANT_DIG__ DBL_MANT_DIG
66#define __DBL_DIG__ DBL_DIG
67#define __DBL_MIN_EXP__ DBL_MIN_EXP
68#define __DBL_MIN_10_EXP__ DBL_MIN_10_EXP
69#define __DBL_MAX_EXP__ DBL_MAX_EXP
70#define __DBL_MAX_10_EXP__ DBL_MAX_10_EXP
71#define __DBL_MIN__ DBL_MIN
72#define __DBL_MAX__ DBL_MAX
73#define __DBL_EPSILON__ DBL_EPSILON
74// predefined by XLC on LoP
75#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
76
77#define __LDBL_MANT_DIG__ LDBL_MANT_DIG
78#define __LDBL_DIG__ LDBL_DIG
79#define __LDBL_MIN_EXP__ LDBL_MIN_EXP
80#define __LDBL_MIN_10_EXP__ LDBL_MIN_10_EXP
81#define __LDBL_MAX_EXP__ LDBL_MAX_EXP
82#define __LDBL_MAX_10_EXP__ LDBL_MAX_10_EXP
83#define __LDBL_MIN__ LDBL_MIN
84#define __LDBL_MAX__ LDBL_MAX
85#define __LDBL_EPSILON__ LDBL_EPSILON
86// predefined by XLC on LoP
87#if __LONGDOUBLE128
88#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
89#else
90#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
91#endif
92
93// predefined by XLC on LoP
94#define __CHAR_BIT__ 8
95
96#endif // _AIX
97
98#endif // _LIBCPP_SUPPORT_IBM_LIMITS_H
lib/libcxx/include/support/ibm/locale_mgmt_aix.h deleted-84
...@@ -1,84 +0,0 @@
1// -*- C++ -*-
2//===------------------- support/ibm/locale_mgmt_aix.h --------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_AIX_H
11#define _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_AIX_H
12
13#if defined(_AIX)
14#include "cstdlib"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#if !defined(_AIX71)
21// AIX 7.1 and higher has these definitions. Definitions and stubs
22// are provied here as a temporary workaround on AIX 6.1.
23
24#define LC_COLLATE_MASK 1
25#define LC_CTYPE_MASK 2
26#define LC_MESSAGES_MASK 4
27#define LC_MONETARY_MASK 8
28#define LC_NUMERIC_MASK 16
29#define LC_TIME_MASK 32
30#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | \
31 LC_MESSAGES_MASK | LC_MONETARY_MASK |\
32 LC_NUMERIC_MASK | LC_TIME_MASK)
33
34typedef void* locale_t;
35
36// The following are stubs. They are not supported on AIX 6.1.
37static inline
38locale_t newlocale(int category_mask, const char *locale, locale_t base)
39{
40 _LC_locale_t *newloc, *loc;
41 if ((loc = (_LC_locale_t *)__xopen_locale(locale)) == NULL)
42 {
43 errno = EINVAL;
44 return (locale_t)0;
45 }
46 if ((newloc = (_LC_locale_t *)calloc(1, sizeof(_LC_locale_t))) == NULL)
47 {
48 errno = ENOMEM;
49 return (locale_t)0;
50 }
51 if (!base)
52 base = (_LC_locale_t *)__xopen_locale("C");
53 memcpy(newloc, base, sizeof (_LC_locale_t));
54 if (category_mask & LC_COLLATE_MASK)
55 newloc->lc_collate = loc->lc_collate;
56 if (category_mask & LC_CTYPE_MASK)
57 newloc->lc_ctype = loc->lc_ctype;
58 //if (category_mask & LC_MESSAGES_MASK)
59 // newloc->lc_messages = loc->lc_messages;
60 if (category_mask & LC_MONETARY_MASK)
61 newloc->lc_monetary = loc->lc_monetary;
62 if (category_mask & LC_TIME_MASK)
63 newloc->lc_time = loc->lc_time;
64 if (category_mask & LC_NUMERIC_MASK)
65 newloc->lc_numeric = loc->lc_numeric;
66 return (locale_t)newloc;
67}
68static inline
69void freelocale(locale_t locobj)
70{
71 free(locobj);
72}
73static inline
74locale_t uselocale(locale_t newloc)
75{
76 return (locale_t)0;
77}
78#endif // !defined(_AIX71)
79
80#ifdef __cplusplus
81}
82#endif
83#endif // defined(_AIX)
84#endif // _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_AIX_H
lib/libcxx/include/support/ibm/support.h deleted-53
...@@ -1,53 +0,0 @@
1// -*- C++ -*-
2//===----------------------- support/ibm/support.h ----------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_IBM_SUPPORT_H
11#define _LIBCPP_SUPPORT_IBM_SUPPORT_H
12
13extern "builtin" int __popcnt4(unsigned int);
14extern "builtin" int __popcnt8(unsigned long long);
15extern "builtin" unsigned int __cnttz4(unsigned int);
16extern "builtin" unsigned int __cnttz8(unsigned long long);
17extern "builtin" unsigned int __cntlz4(unsigned int);
18extern "builtin" unsigned int __cntlz8(unsigned long long);
19
20// Builtin functions for counting population
21#define __builtin_popcount(x) __popcnt4(x)
22#define __builtin_popcountll(x) __popcnt8(x)
23#if defined(__64BIT__)
24#define __builtin_popcountl(x) __builtin_popcountll(x)
25#else
26#define __builtin_popcountl(x) __builtin_popcount(x)
27#endif
28
29// Builtin functions for counting trailing zeros
30#define __builtin_ctz(x) __cnttz4(x)
31#define __builtin_ctzll(x) __cnttz8(x)
32#if defined(__64BIT__)
33#define __builtin_ctzl(x) __builtin_ctzll(x)
34#else
35#define __builtin_ctzl(x) __builtin_ctz(x)
36#endif
37
38// Builtin functions for counting leading zeros
39#define __builtin_clz(x) __cntlz4(x)
40#define __builtin_clzll(x) __cntlz8(x)
41#if defined(__64BIT__)
42#define __builtin_clzl(x) __builtin_clzll(x)
43#else
44#define __builtin_clzl(x) __builtin_clz(x)
45#endif
46
47#if defined(__64BIT__)
48#define __SIZE_WIDTH__ 64
49#else
50#define __SIZE_WIDTH__ 32
51#endif
52
53#endif // _LIBCPP_SUPPORT_IBM_SUPPORT_H
lib/libcxx/include/support/ibm/xlocale.h deleted-270
...@@ -1,270 +0,0 @@
1// -*- C++ -*-
2//===--------------------- support/ibm/xlocale.h -------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_IBM_XLOCALE_H
11#define _LIBCPP_SUPPORT_IBM_XLOCALE_H
12#include <support/ibm/locale_mgmt_aix.h>
13
14#if defined(_AIX)
15#include "cstdlib"
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21#if !defined(_AIX71)
22// AIX 7.1 and higher has these definitions. Definitions and stubs
23// are provied here as a temporary workaround on AIX 6.1.
24static inline
25int isalnum_l(int c, locale_t locale)
26{
27 return __xisalnum(locale, c);
28}
29static inline
30int isalpha_l(int c, locale_t locale)
31{
32 return __xisalpha(locale, c);
33}
34static inline
35int isblank_l(int c, locale_t locale)
36{
37 return __xisblank(locale, c);
38}
39static inline
40int iscntrl_l(int c, locale_t locale)
41{
42 return __xiscntrl(locale, c);
43}
44static inline
45int isdigit_l(int c, locale_t locale)
46{
47 return __xisdigit(locale, c);
48}
49static inline
50int isgraph_l(int c, locale_t locale)
51{
52 return __xisgraph(locale, c);
53}
54static inline
55int islower_l(int c, locale_t locale)
56{
57 return __xislower(locale, c);
58}
59static inline
60int isprint_l(int c, locale_t locale)
61{
62 return __xisprint(locale, c);
63}
64
65static inline
66int ispunct_l(int c, locale_t locale)
67{
68 return __xispunct(locale, c);
69}
70static inline
71int isspace_l(int c, locale_t locale)
72{
73 return __xisspace(locale, c);
74}
75static inline
76int isupper_l(int c, locale_t locale)
77{
78 return __xisupper(locale, c);
79}
80
81static inline
82int isxdigit_l(int c, locale_t locale)
83{
84 return __xisxdigit(locale, c);
85}
86
87static inline
88int iswalnum_l(wchar_t wc, locale_t locale)
89{
90 return __xiswalnum(locale, wc);
91}
92
93static inline
94int iswalpha_l(wchar_t wc, locale_t locale)
95{
96 return __xiswalpha(locale, wc);
97}
98
99static inline
100int iswblank_l(wchar_t wc, locale_t locale)
101{
102 return __xiswblank(locale, wc);
103}
104
105static inline
106int iswcntrl_l(wchar_t wc, locale_t locale)
107{
108 return __xiswcntrl(locale, wc);
109}
110
111static inline
112int iswdigit_l(wchar_t wc, locale_t locale)
113{
114 return __xiswdigit(locale, wc);
115}
116
117static inline
118int iswgraph_l(wchar_t wc, locale_t locale)
119{
120 return __xiswgraph(locale, wc);
121}
122
123static inline
124int iswlower_l(wchar_t wc, locale_t locale)
125{
126 return __xiswlower(locale, wc);
127}
128
129static inline
130int iswprint_l(wchar_t wc, locale_t locale)
131{
132 return __xiswprint(locale, wc);
133}
134
135static inline
136int iswpunct_l(wchar_t wc, locale_t locale)
137{
138 return __xiswpunct(locale, wc);
139}
140
141static inline
142int iswspace_l(wchar_t wc, locale_t locale)
143{
144 return __xiswspace(locale, wc);
145}
146
147static inline
148int iswupper_l(wchar_t wc, locale_t locale)
149{
150 return __xiswupper(locale, wc);
151}
152
153static inline
154int iswxdigit_l(wchar_t wc, locale_t locale)
155{
156 return __xiswxdigit(locale, wc);
157}
158
159static inline
160int iswctype_l(wint_t wc, wctype_t desc, locale_t locale)
161{
162 return __xiswctype(locale, wc, desc);
163}
164
165static inline
166int toupper_l(int c, locale_t locale)
167{
168 return __xtoupper(locale, c);
169}
170static inline
171int tolower_l(int c, locale_t locale)
172{
173 return __xtolower(locale, c);
174}
175static inline
176wint_t towupper_l(wint_t wc, locale_t locale)
177{
178 return __xtowupper(locale, wc);
179}
180static inline
181wint_t towlower_l(wint_t wc, locale_t locale)
182{
183 return __xtowlower(locale, wc);
184}
185
186static inline
187int strcoll_l(const char *__s1, const char *__s2, locale_t locale)
188{
189 return __xstrcoll(locale, __s1, __s2);
190}
191static inline
192int wcscoll_l(const wchar_t *__s1, const wchar_t *__s2, locale_t locale)
193{
194 return __xwcscoll(locale, __s1, __s2);
195}
196static inline
197size_t strxfrm_l(char *__s1, const char *__s2, size_t __n, locale_t locale)
198{
199 return __xstrxfrm(locale, __s1, __s2, __n);
200}
201
202static inline
203size_t wcsxfrm_l(wchar_t *__ws1, const wchar_t *__ws2, size_t __n,
204 locale_t locale)
205{
206 return __xwcsxfrm(locale, __ws1, __ws2, __n);
207}
208#endif // !defined(_AIX71)
209
210// strftime_l() is defined by POSIX. However, AIX 7.1 does not have it
211// implemented yet.
212static inline
213size_t strftime_l(char *__s, size_t __size, const char *__fmt,
214 const struct tm *__tm, locale_t locale) {
215 return __xstrftime(locale, __s, __size, __fmt, __tm);
216}
217
218// The following are not POSIX routines. These are quick-and-dirty hacks
219// to make things pretend to work
220static inline
221long long strtoll_l(const char *__nptr, char **__endptr,
222 int __base, locale_t locale) {
223 return strtoll(__nptr, __endptr, __base);
224}
225static inline
226long strtol_l(const char *__nptr, char **__endptr,
227 int __base, locale_t locale) {
228 return strtol(__nptr, __endptr, __base);
229}
230static inline
231long double strtold_l(const char *__nptr, char **__endptr,
232 locale_t locale) {
233 return strtold(__nptr, __endptr);
234}
235static inline
236unsigned long long strtoull_l(const char *__nptr, char **__endptr,
237 int __base, locale_t locale) {
238 return strtoull(__nptr, __endptr, __base);
239}
240static inline
241unsigned long strtoul_l(const char *__nptr, char **__endptr,
242 int __base, locale_t locale) {
243 return strtoul(__nptr, __endptr, __base);
244}
245
246static inline
247int vasprintf(char **strp, const char *fmt, va_list ap)
248{
249 const size_t buff_size = 256;
250 int str_size;
251 if ((*strp = (char *)malloc(buff_size)) == NULL)
252 {
253 return -1;
254 }
255 if ((str_size = vsnprintf(*strp, buff_size, fmt, ap)) >= buff_size)
256 {
257 if ((*strp = (char *)realloc(*strp, str_size + 1)) == NULL)
258 {
259 return -1;
260 }
261 str_size = vsnprintf(*strp, str_size + 1, fmt, ap);
262 }
263 return str_size;
264}
265
266#ifdef __cplusplus
267}
268#endif
269#endif // defined(_AIX)
270#endif // _LIBCPP_SUPPORT_IBM_XLOCALE_H
lib/libcxx/include/support/musl/xlocale.h deleted-57
...@@ -1,57 +0,0 @@
1// -*- C++ -*-
2//===------------------- support/musl/xlocale.h ------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9// This adds support for the extended locale functions that are currently
10// missing from the Musl C library.
11//
12// This only works when the specified locale is "C" or "POSIX", but that's
13// about as good as we can do without implementing full xlocale support
14// in Musl.
15//===----------------------------------------------------------------------===//
16
17#ifndef _LIBCPP_SUPPORT_MUSL_XLOCALE_H
18#define _LIBCPP_SUPPORT_MUSL_XLOCALE_H
19
20#include <cstdlib>
21#include <cwchar>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27static inline long long strtoll_l(const char *nptr, char **endptr, int base,
28 locale_t) {
29 return strtoll(nptr, endptr, base);
30}
31
32static inline unsigned long long strtoull_l(const char *nptr, char **endptr,
33 int base, locale_t) {
34 return strtoull(nptr, endptr, base);
35}
36
37static inline long long wcstoll_l(const wchar_t *nptr, wchar_t **endptr,
38 int base, locale_t) {
39 return wcstoll(nptr, endptr, base);
40}
41
42static inline unsigned long long wcstoull_l(const wchar_t *nptr,
43 wchar_t **endptr, int base,
44 locale_t) {
45 return wcstoull(nptr, endptr, base);
46}
47
48static inline long double wcstold_l(const wchar_t *nptr, wchar_t **endptr,
49 locale_t) {
50 return wcstold(nptr, endptr);
51}
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif // _LIBCPP_SUPPORT_MUSL_XLOCALE_H
lib/libcxx/include/support/newlib/xlocale.h deleted-27
...@@ -1,27 +0,0 @@
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
10#define _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
11
12#if defined(_NEWLIB_VERSION)
13
14#include <cstdlib>
15#include <clocale>
16#include <cwctype>
17#include <ctype.h>
18#if !defined(__NEWLIB__) || __NEWLIB__ < 2 || \
19 __NEWLIB__ == 2 && __NEWLIB_MINOR__ < 5
20#include <support/xlocale/__nop_locale_mgmt.h>
21#include <support/xlocale/__posix_l_fallback.h>
22#include <support/xlocale/__strtonum_fallback.h>
23#endif
24
25#endif // _NEWLIB_VERSION
26
27#endif
lib/libcxx/include/support/solaris/floatingpoint.h deleted-13
...@@ -1,13 +0,0 @@
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#define atof sun_atof
10#define strtod sun_strtod
11#include_next "floatingpoint.h"
12#undef atof
13#undef strtod
lib/libcxx/include/support/solaris/wchar.h deleted-46
...@@ -1,46 +0,0 @@
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#define iswalpha sun_iswalpha
10#define iswupper sun_iswupper
11#define iswlower sun_iswlower
12#define iswdigit sun_iswdigit
13#define iswxdigit sun_iswxdigit
14#define iswalnum sun_iswalnum
15#define iswspace sun_iswspace
16#define iswpunct sun_iswpunct
17#define iswprint sun_iswprint
18#define iswgraph sun_iswgraph
19#define iswcntrl sun_iswcntrl
20#define iswctype sun_iswctype
21#define towlower sun_towlower
22#define towupper sun_towupper
23#define wcswcs sun_wcswcs
24#define wcswidth sun_wcswidth
25#define wcwidth sun_wcwidth
26#define wctype sun_wctype
27#define _WCHAR_T 1
28#include_next "wchar.h"
29#undef iswalpha
30#undef iswupper
31#undef iswlower
32#undef iswdigit
33#undef iswxdigit
34#undef iswalnum
35#undef iswspace
36#undef iswpunct
37#undef iswprint
38#undef iswgraph
39#undef iswcntrl
40#undef iswctype
41#undef towlower
42#undef towupper
43#undef wcswcs
44#undef wcswidth
45#undef wcwidth
46#undef wctype
lib/libcxx/include/support/solaris/xlocale.h deleted-76
...@@ -1,76 +0,0 @@
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9////////////////////////////////////////////////////////////////////////////////
10// Minimal xlocale implementation for Solaris. This implements the subset of
11// the xlocale APIs that libc++ depends on.
12////////////////////////////////////////////////////////////////////////////////
13#ifndef __XLOCALE_H_INCLUDED
14#define __XLOCALE_H_INCLUDED
15
16#include <stdlib.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22
23int snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...);
24int asprintf_l(char **__s, locale_t __l, const char *__format, ...);
25
26int sscanf_l(const char *__s, locale_t __l, const char *__format, ...);
27
28int toupper_l(int __c, locale_t __l);
29int tolower_l(int __c, locale_t __l);
30
31struct lconv *localeconv(void);
32struct lconv *localeconv_l(locale_t __l);
33
34// FIXME: These are quick-and-dirty hacks to make things pretend to work
35static inline
36long long strtoll_l(const char *__nptr, char **__endptr,
37 int __base, locale_t __loc) {
38 return strtoll(__nptr, __endptr, __base);
39}
40static inline
41long strtol_l(const char *__nptr, char **__endptr,
42 int __base, locale_t __loc) {
43 return strtol(__nptr, __endptr, __base);
44}
45static inline
46unsigned long long strtoull_l(const char *__nptr, char **__endptr,
47 int __base, locale_t __loc) {
48 return strtoull(__nptr, __endptr, __base);
49}
50static inline
51unsigned long strtoul_l(const char *__nptr, char **__endptr,
52 int __base, locale_t __loc) {
53 return strtoul(__nptr, __endptr, __base);
54}
55static inline
56float strtof_l(const char *__nptr, char **__endptr,
57 locale_t __loc) {
58 return strtof(__nptr, __endptr);
59}
60static inline
61double strtod_l(const char *__nptr, char **__endptr,
62 locale_t __loc) {
63 return strtod(__nptr, __endptr);
64}
65static inline
66long double strtold_l(const char *__nptr, char **__endptr,
67 locale_t __loc) {
68 return strtold(__nptr, __endptr);
69}
70
71
72#ifdef __cplusplus
73}
74#endif
75
76#endif
lib/libcxx/include/support/win32/limits_msvc_win32.h deleted-71
...@@ -1,71 +0,0 @@
1// -*- C++ -*-
2//===------------------ support/win32/limits_msvc_win32.h -----------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
11#define _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
12
13#if !defined(_LIBCPP_MSVCRT)
14#error "This header complements the Microsoft C Runtime library, and should not be included otherwise."
15#endif
16#if defined(__clang__)
17#error "This header should only be included when using Microsofts C1XX frontend"
18#endif
19
20#include <limits.h> // CHAR_BIT
21#include <float.h> // limit constants
22#include <math.h> // HUGE_VAL
23#include <ymath.h> // internal MSVC header providing the needed functionality
24
25#define __CHAR_BIT__ CHAR_BIT
26
27#define __FLT_MANT_DIG__ FLT_MANT_DIG
28#define __FLT_DIG__ FLT_DIG
29#define __FLT_RADIX__ FLT_RADIX
30#define __FLT_MIN_EXP__ FLT_MIN_EXP
31#define __FLT_MIN_10_EXP__ FLT_MIN_10_EXP
32#define __FLT_MAX_EXP__ FLT_MAX_EXP
33#define __FLT_MAX_10_EXP__ FLT_MAX_10_EXP
34#define __FLT_MIN__ FLT_MIN
35#define __FLT_MAX__ FLT_MAX
36#define __FLT_EPSILON__ FLT_EPSILON
37// predefined by MinGW GCC
38#define __FLT_DENORM_MIN__ 1.40129846432481707092e-45F
39
40#define __DBL_MANT_DIG__ DBL_MANT_DIG
41#define __DBL_DIG__ DBL_DIG
42#define __DBL_RADIX__ DBL_RADIX
43#define __DBL_MIN_EXP__ DBL_MIN_EXP
44#define __DBL_MIN_10_EXP__ DBL_MIN_10_EXP
45#define __DBL_MAX_EXP__ DBL_MAX_EXP
46#define __DBL_MAX_10_EXP__ DBL_MAX_10_EXP
47#define __DBL_MIN__ DBL_MIN
48#define __DBL_MAX__ DBL_MAX
49#define __DBL_EPSILON__ DBL_EPSILON
50// predefined by MinGW GCC
51#define __DBL_DENORM_MIN__ double(4.94065645841246544177e-324L)
52
53#define __LDBL_MANT_DIG__ LDBL_MANT_DIG
54#define __LDBL_DIG__ LDBL_DIG
55#define __LDBL_RADIX__ LDBL_RADIX
56#define __LDBL_MIN_EXP__ LDBL_MIN_EXP
57#define __LDBL_MIN_10_EXP__ LDBL_MIN_10_EXP
58#define __LDBL_MAX_EXP__ LDBL_MAX_EXP
59#define __LDBL_MAX_10_EXP__ LDBL_MAX_10_EXP
60#define __LDBL_MIN__ LDBL_MIN
61#define __LDBL_MAX__ LDBL_MAX
62#define __LDBL_EPSILON__ LDBL_EPSILON
63// predefined by MinGW GCC
64#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
65
66// __builtin replacements/workarounds
67#define __builtin_huge_vall() _LInf._Long_double
68#define __builtin_nanl(__dummmy) _LNan._Long_double
69#define __builtin_nansl(__dummy) _LSnan._Long_double
70
71#endif // _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
lib/libcxx/include/support/win32/locale_win32.h deleted-264
...@@ -1,264 +0,0 @@
1// -*- C++ -*-
2//===--------------------- support/win32/locale_win32.h -------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
11#define _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
12
13#include <__config>
14#include <stdio.h>
15#include <xlocinfo.h> // _locale_t
16#include <__nullptr>
17
18#define LC_COLLATE_MASK _M_COLLATE
19#define LC_CTYPE_MASK _M_CTYPE
20#define LC_MONETARY_MASK _M_MONETARY
21#define LC_NUMERIC_MASK _M_NUMERIC
22#define LC_TIME_MASK _M_TIME
23#define LC_MESSAGES_MASK _M_MESSAGES
24#define LC_ALL_MASK ( LC_COLLATE_MASK \
25 | LC_CTYPE_MASK \
26 | LC_MESSAGES_MASK \
27 | LC_MONETARY_MASK \
28 | LC_NUMERIC_MASK \
29 | LC_TIME_MASK )
30
31class __lconv_storage {
32public:
33 __lconv_storage(const lconv *__lc_input) {
34 __lc = *__lc_input;
35
36 __decimal_point = __lc_input->decimal_point;
37 __thousands_sep = __lc_input->thousands_sep;
38 __grouping = __lc_input->grouping;
39 __int_curr_symbol = __lc_input->int_curr_symbol;
40 __currency_symbol = __lc_input->currency_symbol;
41 __mon_decimal_point = __lc_input->mon_decimal_point;
42 __mon_thousands_sep = __lc_input->mon_thousands_sep;
43 __mon_grouping = __lc_input->mon_grouping;
44 __positive_sign = __lc_input->positive_sign;
45 __negative_sign = __lc_input->negative_sign;
46
47 __lc.decimal_point = const_cast<char *>(__decimal_point.c_str());
48 __lc.thousands_sep = const_cast<char *>(__thousands_sep.c_str());
49 __lc.grouping = const_cast<char *>(__grouping.c_str());
50 __lc.int_curr_symbol = const_cast<char *>(__int_curr_symbol.c_str());
51 __lc.currency_symbol = const_cast<char *>(__currency_symbol.c_str());
52 __lc.mon_decimal_point = const_cast<char *>(__mon_decimal_point.c_str());
53 __lc.mon_thousands_sep = const_cast<char *>(__mon_thousands_sep.c_str());
54 __lc.mon_grouping = const_cast<char *>(__mon_grouping.c_str());
55 __lc.positive_sign = const_cast<char *>(__positive_sign.c_str());
56 __lc.negative_sign = const_cast<char *>(__negative_sign.c_str());
57 }
58
59 lconv *__get() {
60 return &__lc;
61 }
62private:
63 lconv __lc;
64 std::string __decimal_point;
65 std::string __thousands_sep;
66 std::string __grouping;
67 std::string __int_curr_symbol;
68 std::string __currency_symbol;
69 std::string __mon_decimal_point;
70 std::string __mon_thousands_sep;
71 std::string __mon_grouping;
72 std::string __positive_sign;
73 std::string __negative_sign;
74};
75
76class locale_t {
77public:
78 locale_t()
79 : __locale(nullptr), __locale_str(nullptr), __lc(nullptr) {}
80 locale_t(std::nullptr_t)
81 : __locale(nullptr), __locale_str(nullptr), __lc(nullptr) {}
82 locale_t(_locale_t __xlocale, const char* __xlocale_str)
83 : __locale(__xlocale), __locale_str(__xlocale_str), __lc(nullptr) {}
84 locale_t(const locale_t &__l)
85 : __locale(__l.__locale), __locale_str(__l.__locale_str), __lc(nullptr) {}
86
87 ~locale_t() {
88 delete __lc;
89 }
90
91 locale_t &operator =(const locale_t &__l) {
92 __locale = __l.__locale;
93 __locale_str = __l.__locale_str;
94 // __lc not copied
95 return *this;
96 }
97
98 friend bool operator==(const locale_t& __left, const locale_t& __right) {
99 return __left.__locale == __right.__locale;
100 }
101
102 friend bool operator==(const locale_t& __left, int __right) {
103 return __left.__locale == nullptr && __right == 0;
104 }
105
106 friend bool operator==(const locale_t& __left, long long __right) {
107 return __left.__locale == nullptr && __right == 0;
108 }
109
110 friend bool operator==(const locale_t& __left, std::nullptr_t) {
111 return __left.__locale == nullptr;
112 }
113
114 friend bool operator==(int __left, const locale_t& __right) {
115 return __left == 0 && nullptr == __right.__locale;
116 }
117
118 friend bool operator==(std::nullptr_t, const locale_t& __right) {
119 return nullptr == __right.__locale;
120 }
121
122 friend bool operator!=(const locale_t& __left, const locale_t& __right) {
123 return !(__left == __right);
124 }
125
126 friend bool operator!=(const locale_t& __left, int __right) {
127 return !(__left == __right);
128 }
129
130 friend bool operator!=(const locale_t& __left, long long __right) {
131 return !(__left == __right);
132 }
133
134 friend bool operator!=(const locale_t& __left, std::nullptr_t __right) {
135 return !(__left == __right);
136 }
137
138 friend bool operator!=(int __left, const locale_t& __right) {
139 return !(__left == __right);
140 }
141
142 friend bool operator!=(std::nullptr_t __left, const locale_t& __right) {
143 return !(__left == __right);
144 }
145
146 operator bool() const {
147 return __locale != nullptr;
148 }
149
150 const char* __get_locale() const { return __locale_str; }
151
152 operator _locale_t() const {
153 return __locale;
154 }
155
156 lconv *__store_lconv(const lconv *__input_lc) {
157 delete __lc;
158 __lc = new __lconv_storage(__input_lc);
159 return __lc->__get();
160 }
161private:
162 _locale_t __locale;
163 const char* __locale_str;
164 __lconv_storage *__lc = nullptr;
165};
166
167// Locale management functions
168#define freelocale _free_locale
169// FIXME: base currently unused. Needs manual work to construct the new locale
170locale_t newlocale( int mask, const char * locale, locale_t base );
171// uselocale can't be implemented on Windows because Windows allows partial modification
172// of thread-local locale and so _get_current_locale() returns a copy while uselocale does
173// not create any copies.
174// We can still implement raii even without uselocale though.
175
176
177lconv *localeconv_l( locale_t &loc );
178size_t mbrlen_l( const char *__restrict s, size_t n,
179 mbstate_t *__restrict ps, locale_t loc);
180size_t mbsrtowcs_l( wchar_t *__restrict dst, const char **__restrict src,
181 size_t len, mbstate_t *__restrict ps, locale_t loc );
182size_t wcrtomb_l( char *__restrict s, wchar_t wc, mbstate_t *__restrict ps,
183 locale_t loc);
184size_t mbrtowc_l( wchar_t *__restrict pwc, const char *__restrict s,
185 size_t n, mbstate_t *__restrict ps, locale_t loc);
186size_t mbsnrtowcs_l( wchar_t *__restrict dst, const char **__restrict src,
187 size_t nms, size_t len, mbstate_t *__restrict ps, locale_t loc);
188size_t wcsnrtombs_l( char *__restrict dst, const wchar_t **__restrict src,
189 size_t nwc, size_t len, mbstate_t *__restrict ps, locale_t loc);
190wint_t btowc_l( int c, locale_t loc );
191int wctob_l( wint_t c, locale_t loc );
192
193decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l );
194
195// the *_l functions are prefixed on Windows, only available for msvcr80+, VS2005+
196#define mbtowc_l _mbtowc_l
197#define strtoll_l _strtoi64_l
198#define strtoull_l _strtoui64_l
199#define strtod_l _strtod_l
200#if defined(_LIBCPP_MSVCRT)
201#define strtof_l _strtof_l
202#define strtold_l _strtold_l
203#else
204float strtof_l(const char*, char**, locale_t);
205long double strtold_l(const char*, char**, locale_t);
206#endif
207inline _LIBCPP_INLINE_VISIBILITY
208int
209islower_l(int c, _locale_t loc)
210{
211 return _islower_l((int)c, loc);
212}
213
214inline _LIBCPP_INLINE_VISIBILITY
215int
216isupper_l(int c, _locale_t loc)
217{
218 return _isupper_l((int)c, loc);
219}
220
221#define isdigit_l _isdigit_l
222#define isxdigit_l _isxdigit_l
223#define strcoll_l _strcoll_l
224#define strxfrm_l _strxfrm_l
225#define wcscoll_l _wcscoll_l
226#define wcsxfrm_l _wcsxfrm_l
227#define toupper_l _toupper_l
228#define tolower_l _tolower_l
229#define iswspace_l _iswspace_l
230#define iswprint_l _iswprint_l
231#define iswcntrl_l _iswcntrl_l
232#define iswupper_l _iswupper_l
233#define iswlower_l _iswlower_l
234#define iswalpha_l _iswalpha_l
235#define iswdigit_l _iswdigit_l
236#define iswpunct_l _iswpunct_l
237#define iswxdigit_l _iswxdigit_l
238#define towupper_l _towupper_l
239#define towlower_l _towlower_l
240#if defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x0800
241_LIBCPP_FUNC_VIS size_t strftime_l(char *ret, size_t n, const char *format,
242 const struct tm *tm, locale_t loc);
243#else
244#define strftime_l _strftime_l
245#endif
246#define sscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ )
247#define sprintf_l( __s, __l, __f, ... ) _sprintf_l( __s, __f, __l, __VA_ARGS__ )
248#define vsprintf_l( __s, __l, __f, ... ) _vsprintf_l( __s, __f, __l, __VA_ARGS__ )
249#define vsnprintf_l( __s, __n, __l, __f, ... ) _vsnprintf_l( __s, __n, __f, __l, __VA_ARGS__ )
250_LIBCPP_FUNC_VIS int snprintf_l(char *ret, size_t n, locale_t loc, const char *format, ...);
251_LIBCPP_FUNC_VIS int asprintf_l( char **ret, locale_t loc, const char *format, ... );
252_LIBCPP_FUNC_VIS int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap );
253
254// not-so-pressing FIXME: use locale to determine blank characters
255inline int isblank_l( int c, locale_t /*loc*/ )
256{
257 return ( c == ' ' || c == '\t' );
258}
259inline int iswblank_l( wint_t c, locale_t /*loc*/ )
260{
261 return ( c == L' ' || c == L'\t' );
262}
263
264#endif // _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
lib/libcxx/include/support/xlocale/__nop_locale_mgmt.h deleted-51
...@@ -1,51 +0,0 @@
1// -*- C++ -*-
2//===------------ support/xlocale/__nop_locale_mgmt.h -----------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
11#define _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17// Patch over lack of extended locale support
18typedef void *locale_t;
19static inline locale_t duplocale(locale_t) {
20 return NULL;
21}
22
23static inline void freelocale(locale_t) {
24}
25
26static inline locale_t newlocale(int, const char *, locale_t) {
27 return NULL;
28}
29
30static inline locale_t uselocale(locale_t) {
31 return NULL;
32}
33
34#define LC_COLLATE_MASK (1 << LC_COLLATE)
35#define LC_CTYPE_MASK (1 << LC_CTYPE)
36#define LC_MESSAGES_MASK (1 << LC_MESSAGES)
37#define LC_MONETARY_MASK (1 << LC_MONETARY)
38#define LC_NUMERIC_MASK (1 << LC_NUMERIC)
39#define LC_TIME_MASK (1 << LC_TIME)
40#define LC_ALL_MASK (LC_COLLATE_MASK|\
41 LC_CTYPE_MASK|\
42 LC_MONETARY_MASK|\
43 LC_NUMERIC_MASK|\
44 LC_TIME_MASK|\
45 LC_MESSAGES_MASK)
46
47#ifdef __cplusplus
48} // extern "C"
49#endif
50
51#endif // _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
lib/libcxx/include/support/xlocale/__posix_l_fallback.h deleted-164
...@@ -1,164 +0,0 @@
1// -*- C++ -*-
2//===--------------- support/xlocale/__posix_l_fallback.h -----------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9// These are reimplementations of some extended locale functions ( *_l ) that
10// are normally part of POSIX. This shared implementation provides parts of the
11// extended locale support for libc's that normally don't have any (like
12// Android's bionic and Newlib).
13//===----------------------------------------------------------------------===//
14
15#ifndef _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
16#define _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22inline _LIBCPP_INLINE_VISIBILITY int isalnum_l(int c, locale_t) {
23 return ::isalnum(c);
24}
25
26inline _LIBCPP_INLINE_VISIBILITY int isalpha_l(int c, locale_t) {
27 return ::isalpha(c);
28}
29
30inline _LIBCPP_INLINE_VISIBILITY int isblank_l(int c, locale_t) {
31 return ::isblank(c);
32}
33
34inline _LIBCPP_INLINE_VISIBILITY int iscntrl_l(int c, locale_t) {
35 return ::iscntrl(c);
36}
37
38inline _LIBCPP_INLINE_VISIBILITY int isdigit_l(int c, locale_t) {
39 return ::isdigit(c);
40}
41
42inline _LIBCPP_INLINE_VISIBILITY int isgraph_l(int c, locale_t) {
43 return ::isgraph(c);
44}
45
46inline _LIBCPP_INLINE_VISIBILITY int islower_l(int c, locale_t) {
47 return ::islower(c);
48}
49
50inline _LIBCPP_INLINE_VISIBILITY int isprint_l(int c, locale_t) {
51 return ::isprint(c);
52}
53
54inline _LIBCPP_INLINE_VISIBILITY int ispunct_l(int c, locale_t) {
55 return ::ispunct(c);
56}
57
58inline _LIBCPP_INLINE_VISIBILITY int isspace_l(int c, locale_t) {
59 return ::isspace(c);
60}
61
62inline _LIBCPP_INLINE_VISIBILITY int isupper_l(int c, locale_t) {
63 return ::isupper(c);
64}
65
66inline _LIBCPP_INLINE_VISIBILITY int isxdigit_l(int c, locale_t) {
67 return ::isxdigit(c);
68}
69
70inline _LIBCPP_INLINE_VISIBILITY int iswalnum_l(wint_t c, locale_t) {
71 return ::iswalnum(c);
72}
73
74inline _LIBCPP_INLINE_VISIBILITY int iswalpha_l(wint_t c, locale_t) {
75 return ::iswalpha(c);
76}
77
78inline _LIBCPP_INLINE_VISIBILITY int iswblank_l(wint_t c, locale_t) {
79 return ::iswblank(c);
80}
81
82inline _LIBCPP_INLINE_VISIBILITY int iswcntrl_l(wint_t c, locale_t) {
83 return ::iswcntrl(c);
84}
85
86inline _LIBCPP_INLINE_VISIBILITY int iswdigit_l(wint_t c, locale_t) {
87 return ::iswdigit(c);
88}
89
90inline _LIBCPP_INLINE_VISIBILITY int iswgraph_l(wint_t c, locale_t) {
91 return ::iswgraph(c);
92}
93
94inline _LIBCPP_INLINE_VISIBILITY int iswlower_l(wint_t c, locale_t) {
95 return ::iswlower(c);
96}
97
98inline _LIBCPP_INLINE_VISIBILITY int iswprint_l(wint_t c, locale_t) {
99 return ::iswprint(c);
100}
101
102inline _LIBCPP_INLINE_VISIBILITY int iswpunct_l(wint_t c, locale_t) {
103 return ::iswpunct(c);
104}
105
106inline _LIBCPP_INLINE_VISIBILITY int iswspace_l(wint_t c, locale_t) {
107 return ::iswspace(c);
108}
109
110inline _LIBCPP_INLINE_VISIBILITY int iswupper_l(wint_t c, locale_t) {
111 return ::iswupper(c);
112}
113
114inline _LIBCPP_INLINE_VISIBILITY int iswxdigit_l(wint_t c, locale_t) {
115 return ::iswxdigit(c);
116}
117
118inline _LIBCPP_INLINE_VISIBILITY int toupper_l(int c, locale_t) {
119 return ::toupper(c);
120}
121
122inline _LIBCPP_INLINE_VISIBILITY int tolower_l(int c, locale_t) {
123 return ::tolower(c);
124}
125
126inline _LIBCPP_INLINE_VISIBILITY wint_t towupper_l(wint_t c, locale_t) {
127 return ::towupper(c);
128}
129
130inline _LIBCPP_INLINE_VISIBILITY wint_t towlower_l(wint_t c, locale_t) {
131 return ::towlower(c);
132}
133
134inline _LIBCPP_INLINE_VISIBILITY int strcoll_l(const char *s1, const char *s2,
135 locale_t) {
136 return ::strcoll(s1, s2);
137}
138
139inline _LIBCPP_INLINE_VISIBILITY size_t strxfrm_l(char *dest, const char *src,
140 size_t n, locale_t) {
141 return ::strxfrm(dest, src, n);
142}
143
144inline _LIBCPP_INLINE_VISIBILITY size_t strftime_l(char *s, size_t max,
145 const char *format,
146 const struct tm *tm, locale_t) {
147 return ::strftime(s, max, format, tm);
148}
149
150inline _LIBCPP_INLINE_VISIBILITY int wcscoll_l(const wchar_t *ws1,
151 const wchar_t *ws2, locale_t) {
152 return ::wcscoll(ws1, ws2);
153}
154
155inline _LIBCPP_INLINE_VISIBILITY size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src,
156 size_t n, locale_t) {
157 return ::wcsxfrm(dest, src, n);
158}
159
160#ifdef __cplusplus
161}
162#endif
163
164#endif // _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
lib/libcxx/include/support/xlocale/__strtonum_fallback.h deleted-66
...@@ -1,66 +0,0 @@
1// -*- C++ -*-
2//===-------------- support/xlocale/__strtonum_fallback.h -----------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9// These are reimplementations of some extended locale functions ( *_l ) that
10// aren't part of POSIX. They are widely available though (GLIBC, BSD, maybe
11// others). The unifying aspect in this case is that all of these functions
12// convert strings to some numeric type.
13//===----------------------------------------------------------------------===//
14
15#ifndef _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
16#define _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22inline _LIBCPP_INLINE_VISIBILITY float strtof_l(const char *nptr,
23 char **endptr, locale_t) {
24 return ::strtof(nptr, endptr);
25}
26
27inline _LIBCPP_INLINE_VISIBILITY double strtod_l(const char *nptr,
28 char **endptr, locale_t) {
29 return ::strtod(nptr, endptr);
30}
31
32inline _LIBCPP_INLINE_VISIBILITY long double strtold_l(const char *nptr,
33 char **endptr, locale_t) {
34 return ::strtold(nptr, endptr);
35}
36
37inline _LIBCPP_INLINE_VISIBILITY long long
38strtoll_l(const char *nptr, char **endptr, int base, locale_t) {
39 return ::strtoll(nptr, endptr, base);
40}
41
42inline _LIBCPP_INLINE_VISIBILITY unsigned long long
43strtoull_l(const char *nptr, char **endptr, int base, locale_t) {
44 return ::strtoull(nptr, endptr, base);
45}
46
47inline _LIBCPP_INLINE_VISIBILITY long long
48wcstoll_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t) {
49 return ::wcstoll(nptr, endptr, base);
50}
51
52inline _LIBCPP_INLINE_VISIBILITY unsigned long long
53wcstoull_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t) {
54 return ::wcstoull(nptr, endptr, base);
55}
56
57inline _LIBCPP_INLINE_VISIBILITY long double wcstold_l(const wchar_t *nptr,
58 wchar_t **endptr, locale_t) {
59 return ::wcstold(nptr, endptr);
60}
61
62#ifdef __cplusplus
63}
64#endif
65
66#endif // _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
lib/libcxx/include/system_error+2-2
...@@ -253,7 +253,7 @@ public:...@@ -253,7 +253,7 @@ public:
253 template <class _Ep>253 template <class _Ep>
254 _LIBCPP_INLINE_VISIBILITY254 _LIBCPP_INLINE_VISIBILITY
255 error_condition(_Ep __e,255 error_condition(_Ep __e,
256 typename enable_if<is_error_condition_enum<_Ep>::value>::type* = 0256 typename enable_if<is_error_condition_enum<_Ep>::value>::type* = nullptr
257 ) _NOEXCEPT257 ) _NOEXCEPT
258 {*this = make_error_condition(__e);}258 {*this = make_error_condition(__e);}
259259
...@@ -325,7 +325,7 @@ public:...@@ -325,7 +325,7 @@ public:
325 template <class _Ep>325 template <class _Ep>
326 _LIBCPP_INLINE_VISIBILITY326 _LIBCPP_INLINE_VISIBILITY
327 error_code(_Ep __e,327 error_code(_Ep __e,
328 typename enable_if<is_error_code_enum<_Ep>::value>::type* = 0328 typename enable_if<is_error_code_enum<_Ep>::value>::type* = nullptr
329 ) _NOEXCEPT329 ) _NOEXCEPT
330 {*this = make_error_code(__e);}330 {*this = make_error_code(__e);}
331331
lib/libcxx/include/thread+21-24
...@@ -277,18 +277,18 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -277,18 +277,18 @@ inline _LIBCPP_INLINE_VISIBILITY
277void277void
278__thread_execute(tuple<_TSp, _Fp, _Args...>& __t, __tuple_indices<_Indices...>)278__thread_execute(tuple<_TSp, _Fp, _Args...>& __t, __tuple_indices<_Indices...>)
279{279{
280 __invoke(_VSTD::move(_VSTD::get<1>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);280 _VSTD::__invoke(_VSTD::move(_VSTD::get<1>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
281}281}
282282
283template <class _Fp>283template <class _Fp>
284_LIBCPP_INLINE_VISIBILITY284_LIBCPP_INLINE_VISIBILITY
285void* __thread_proxy(void* __vp)285void* __thread_proxy(void* __vp)
286{286{
287 // _Fp = std::tuple< unique_ptr<__thread_struct>, Functor, Args...>287 // _Fp = tuple< unique_ptr<__thread_struct>, Functor, Args...>
288 std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));288 unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
289 __thread_local_data().set_pointer(_VSTD::get<0>(*__p).release());289 __thread_local_data().set_pointer(_VSTD::get<0>(*__p.get()).release());
290 typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 2>::type _Index;290 typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 2>::type _Index;
291 __thread_execute(*__p, _Index());291 _VSTD::__thread_execute(*__p.get(), _Index());
292 return nullptr;292 return nullptr;
293}293}
294294
...@@ -300,11 +300,11 @@ thread::thread(_Fp&& __f, _Args&&... __args)...@@ -300,11 +300,11 @@ thread::thread(_Fp&& __f, _Args&&... __args)
300 typedef unique_ptr<__thread_struct> _TSPtr;300 typedef unique_ptr<__thread_struct> _TSPtr;
301 _TSPtr __tsp(new __thread_struct);301 _TSPtr __tsp(new __thread_struct);
302 typedef tuple<_TSPtr, typename decay<_Fp>::type, typename decay<_Args>::type...> _Gp;302 typedef tuple<_TSPtr, typename decay<_Fp>::type, typename decay<_Args>::type...> _Gp;
303 _VSTD::unique_ptr<_Gp> __p(303 unique_ptr<_Gp> __p(
304 new _Gp(std::move(__tsp),304 new _Gp(_VSTD::move(__tsp),
305 __decay_copy(_VSTD::forward<_Fp>(__f)),305 _VSTD::__decay_copy(_VSTD::forward<_Fp>(__f)),
306 __decay_copy(_VSTD::forward<_Args>(__args))...));306 _VSTD::__decay_copy(_VSTD::forward<_Args>(__args))...));
307 int __ec = __libcpp_thread_create(&__t_, &__thread_proxy<_Gp>, __p.get());307 int __ec = _VSTD::__libcpp_thread_create(&__t_, &__thread_proxy<_Gp>, __p.get());
308 if (__ec == 0)308 if (__ec == 0)
309 __p.release();309 __p.release();
310 else310 else
...@@ -326,7 +326,7 @@ struct __thread_invoke_pair {...@@ -326,7 +326,7 @@ struct __thread_invoke_pair {
326template <class _Fp>326template <class _Fp>
327void* __thread_proxy_cxx03(void* __vp)327void* __thread_proxy_cxx03(void* __vp)
328{328{
329 std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));329 unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
330 __thread_local_data().set_pointer(__p->__tsp_.release());330 __thread_local_data().set_pointer(__p->__tsp_.release());
331 (__p->__fn_)();331 (__p->__fn_)();
332 return nullptr;332 return nullptr;
...@@ -337,9 +337,9 @@ thread::thread(_Fp __f)...@@ -337,9 +337,9 @@ thread::thread(_Fp __f)
337{337{
338338
339 typedef __thread_invoke_pair<_Fp> _InvokePair;339 typedef __thread_invoke_pair<_Fp> _InvokePair;
340 typedef std::unique_ptr<_InvokePair> _PairPtr;340 typedef unique_ptr<_InvokePair> _PairPtr;
341 _PairPtr __pp(new _InvokePair(__f));341 _PairPtr __pp(new _InvokePair(__f));
342 int __ec = __libcpp_thread_create(&__t_, &__thread_proxy_cxx03<_InvokePair>, __pp.get());342 int __ec = _VSTD::__libcpp_thread_create(&__t_, &__thread_proxy_cxx03<_InvokePair>, __pp.get());
343 if (__ec == 0)343 if (__ec == 0)
344 __pp.release();344 __pp.release();
345 else345 else
...@@ -360,25 +360,24 @@ template <class _Rep, class _Period>...@@ -360,25 +360,24 @@ template <class _Rep, class _Period>
360void360void
361sleep_for(const chrono::duration<_Rep, _Period>& __d)361sleep_for(const chrono::duration<_Rep, _Period>& __d)
362{362{
363 using namespace chrono;363 if (__d > chrono::duration<_Rep, _Period>::zero())
364 if (__d > duration<_Rep, _Period>::zero())
365 {364 {
366#if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)365#if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)
367 // GCC's long double const folding is incomplete for IBM128 long doubles.366 // GCC's long double const folding is incomplete for IBM128 long doubles.
368 _LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ;367 _LIBCPP_CONSTEXPR chrono::duration<long double> _Max = chrono::duration<long double>(ULLONG_MAX/1000000000ULL) ;
369#else368#else
370 _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();369 _LIBCPP_CONSTEXPR chrono::duration<long double> _Max = chrono::nanoseconds::max();
371#endif370#endif
372 nanoseconds __ns;371 chrono::nanoseconds __ns;
373 if (__d < _Max)372 if (__d < _Max)
374 {373 {
375 __ns = duration_cast<nanoseconds>(__d);374 __ns = chrono::duration_cast<chrono::nanoseconds>(__d);
376 if (__ns < __d)375 if (__ns < __d)
377 ++__ns;376 ++__ns;
378 }377 }
379 else378 else
380 __ns = nanoseconds::max();379 __ns = chrono::nanoseconds::max();
381 sleep_for(__ns);380 this_thread::sleep_for(__ns);
382 }381 }
383}382}
384383
...@@ -386,7 +385,6 @@ template <class _Clock, class _Duration>...@@ -386,7 +385,6 @@ template <class _Clock, class _Duration>
386void385void
387sleep_until(const chrono::time_point<_Clock, _Duration>& __t)386sleep_until(const chrono::time_point<_Clock, _Duration>& __t)
388{387{
389 using namespace chrono;
390 mutex __mut;388 mutex __mut;
391 condition_variable __cv;389 condition_variable __cv;
392 unique_lock<mutex> __lk(__mut);390 unique_lock<mutex> __lk(__mut);
...@@ -399,8 +397,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -399,8 +397,7 @@ inline _LIBCPP_INLINE_VISIBILITY
399void397void
400sleep_until(const chrono::time_point<chrono::steady_clock, _Duration>& __t)398sleep_until(const chrono::time_point<chrono::steady_clock, _Duration>& __t)
401{399{
402 using namespace chrono;400 this_thread::sleep_for(__t - chrono::steady_clock::now());
403 sleep_for(__t - steady_clock::now());
404}401}
405402
406inline _LIBCPP_INLINE_VISIBILITY403inline _LIBCPP_INLINE_VISIBILITY
lib/libcxx/include/tuple+1-1
...@@ -1393,7 +1393,7 @@ struct _LIBCPP_TEMPLATE_VIS uses_allocator<tuple<_Tp...>, _Alloc>...@@ -1393,7 +1393,7 @@ struct _LIBCPP_TEMPLATE_VIS uses_allocator<tuple<_Tp...>, _Alloc>
13931393
1394template <class _T1, class _T2>1394template <class _T1, class _T2>
1395template <class... _Args1, class... _Args2, size_t ..._I1, size_t ..._I2>1395template <class... _Args1, class... _Args2, size_t ..._I1, size_t ..._I2>
1396inline _LIBCPP_INLINE_VISIBILITY1396inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1397pair<_T1, _T2>::pair(piecewise_construct_t,1397pair<_T1, _T2>::pair(piecewise_construct_t,
1398 tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,1398 tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
1399 __tuple_indices<_I1...>, __tuple_indices<_I2...>)1399 __tuple_indices<_I1...>, __tuple_indices<_I2...>)
lib/libcxx/include/type_traits+137-245
...@@ -51,6 +51,7 @@ namespace std...@@ -51,6 +51,7 @@ namespace std
51 template <class T> struct is_arithmetic;51 template <class T> struct is_arithmetic;
52 template <class T> struct is_fundamental;52 template <class T> struct is_fundamental;
53 template <class T> struct is_member_pointer;53 template <class T> struct is_member_pointer;
54 template <class T> struct is_scoped_enum; // C++2b
54 template <class T> struct is_scalar;55 template <class T> struct is_scalar;
55 template <class T> struct is_object;56 template <class T> struct is_object;
56 template <class T> struct is_compound;57 template <class T> struct is_compound;
...@@ -284,6 +285,8 @@ namespace std...@@ -284,6 +285,8 @@ namespace std
284 = is_compound<T>::value; // C++17285 = is_compound<T>::value; // C++17
285 template <class T> inline constexpr bool is_member_pointer_v286 template <class T> inline constexpr bool is_member_pointer_v
286 = is_member_pointer<T>::value; // C++17287 = is_member_pointer<T>::value; // C++17
288 template <class T> inline constexpr bool is_scoped_enum_v
289 = is_scoped_enum<T>::value; // C++2b
287290
288 // See C++14 20.10.4.3, type properties291 // See C++14 20.10.4.3, type properties
289 template <class T> inline constexpr bool is_const_v292 template <class T> inline constexpr bool is_const_v
...@@ -514,7 +517,7 @@ template <template <class...> class, class ...>...@@ -514,7 +517,7 @@ template <template <class...> class, class ...>
514false_type __sfinae_test_impl(...);517false_type __sfinae_test_impl(...);
515518
516template <template <class ...> class _Templ, class ..._Args>519template <template <class ...> class _Templ, class ..._Args>
517using _IsValidExpansion _LIBCPP_NODEBUG_TYPE = decltype(std::__sfinae_test_impl<_Templ, _Args...>(0));520using _IsValidExpansion _LIBCPP_NODEBUG_TYPE = decltype(__sfinae_test_impl<_Templ, _Args...>(0));
518521
519template <class>522template <class>
520struct __void_t { typedef void type; };523struct __void_t { typedef void type; };
...@@ -595,75 +598,6 @@ using __is_primary_template = _IsValidExpansion<...@@ -595,75 +598,6 @@ using __is_primary_template = _IsValidExpansion<
595 __test_for_primary_template, _Tp598 __test_for_primary_template, _Tp
596 >;599 >;
597600
598// addressof
599#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
600
601template <class _Tp>
602inline _LIBCPP_CONSTEXPR_AFTER_CXX14
603_LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
604_Tp*
605addressof(_Tp& __x) _NOEXCEPT
606{
607 return __builtin_addressof(__x);
608}
609
610#else
611
612template <class _Tp>
613inline _LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
614_Tp*
615addressof(_Tp& __x) _NOEXCEPT
616{
617 return reinterpret_cast<_Tp *>(
618 const_cast<char *>(&reinterpret_cast<const volatile char &>(__x)));
619}
620
621#endif // _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
622
623#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
624// Objective-C++ Automatic Reference Counting uses qualified pointers
625// that require special addressof() signatures. When
626// _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler
627// itself is providing these definitions. Otherwise, we provide them.
628template <class _Tp>
629inline _LIBCPP_INLINE_VISIBILITY
630__strong _Tp*
631addressof(__strong _Tp& __x) _NOEXCEPT
632{
633 return &__x;
634}
635
636#ifdef _LIBCPP_HAS_OBJC_ARC_WEAK
637template <class _Tp>
638inline _LIBCPP_INLINE_VISIBILITY
639__weak _Tp*
640addressof(__weak _Tp& __x) _NOEXCEPT
641{
642 return &__x;
643}
644#endif
645
646template <class _Tp>
647inline _LIBCPP_INLINE_VISIBILITY
648__autoreleasing _Tp*
649addressof(__autoreleasing _Tp& __x) _NOEXCEPT
650{
651 return &__x;
652}
653
654template <class _Tp>
655inline _LIBCPP_INLINE_VISIBILITY
656__unsafe_unretained _Tp*
657addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
658{
659 return &__x;
660}
661#endif
662
663#if !defined(_LIBCPP_CXX03_LANG)
664template <class _Tp> _Tp* addressof(const _Tp&&) noexcept = delete;
665#endif
666
667struct __two {char __lx[2];};601struct __two {char __lx[2];};
668602
669// helper class:603// helper class:
...@@ -1731,6 +1665,21 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_base_of_v...@@ -1731,6 +1665,21 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_base_of_v
1731 = is_base_of<_Bp, _Dp>::value;1665 = is_base_of<_Bp, _Dp>::value;
1732#endif1666#endif
17331667
1668// __is_core_convertible
1669
1670// [conv.general]/3 says "E is convertible to T" whenever "T t=E;" is well-formed.
1671// We can't test for that, but we can test implicit convertibility by passing it
1672// to a function. Notice that __is_core_convertible<void,void> is false,
1673// and __is_core_convertible<immovable-type,immovable-type> is true in C++17 and later.
1674
1675template <class _Tp, class _Up, class = void>
1676struct __is_core_convertible : public false_type {};
1677
1678template <class _Tp, class _Up>
1679struct __is_core_convertible<_Tp, _Up, decltype(
1680 static_cast<void(*)(_Up)>(0) ( static_cast<_Tp(*)()>(0)() )
1681)> : public true_type {};
1682
1734// is_convertible1683// is_convertible
17351684
1736#if __has_feature(is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)1685#if __has_feature(is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
...@@ -1821,7 +1770,7 @@ template <typename _Tp>...@@ -1821,7 +1770,7 @@ template <typename _Tp>
1821static void __test_noexcept(_Tp) noexcept;1770static void __test_noexcept(_Tp) noexcept;
18221771
1823template<typename _Fm, typename _To>1772template<typename _Fm, typename _To>
1824static bool_constant<noexcept(__test_noexcept<_To>(declval<_Fm>()))>1773static bool_constant<noexcept(_VSTD::__test_noexcept<_To>(declval<_Fm>()))>
1825__is_nothrow_convertible_test();1774__is_nothrow_convertible_test();
18261775
1827template <typename _Fm, typename _To>1776template <typename _Fm, typename _To>
...@@ -2550,7 +2499,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_destructible_v = __is_destructible(...@@ -2550,7 +2499,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_destructible_v = __is_destructible(
2550// if it's a function, return false2499// if it's a function, return false
2551// if it's void, return false2500// if it's void, return false
2552// if it's an array of unknown bound, return false2501// if it's an array of unknown bound, return false
2553// Otherwise, return "std::declval<_Up&>().~_Up()" is well-formed2502// Otherwise, return "declval<_Up&>().~_Up()" is well-formed
2554// where _Up is remove_all_extents<_Tp>::type2503// where _Up is remove_all_extents<_Tp>::type
25552504
2556template <class>2505template <class>
...@@ -2876,167 +2825,13 @@ struct __member_pointer_class_type<_Ret _ClassType::*> {...@@ -2876,167 +2825,13 @@ struct __member_pointer_class_type<_Ret _ClassType::*> {
2876 typedef _ClassType type;2825 typedef _ClassType type;
2877};2826};
28782827
2879// result_of
2880
2881template <class _Callable> class result_of;
2882
2883#ifdef _LIBCPP_HAS_NO_VARIADICS
2884
2885template <class _Fn, bool, bool>
2886class __result_of
2887{
2888};
2889
2890template <class _Fn>
2891class __result_of<_Fn(), true, false>
2892{
2893public:
2894 typedef decltype(declval<_Fn>()()) type;
2895};
2896
2897template <class _Fn, class _A0>
2898class __result_of<_Fn(_A0), true, false>
2899{
2900public:
2901 typedef decltype(declval<_Fn>()(declval<_A0>())) type;
2902};
2903
2904template <class _Fn, class _A0, class _A1>
2905class __result_of<_Fn(_A0, _A1), true, false>
2906{
2907public:
2908 typedef decltype(declval<_Fn>()(declval<_A0>(), declval<_A1>())) type;
2909};
2910
2911template <class _Fn, class _A0, class _A1, class _A2>
2912class __result_of<_Fn(_A0, _A1, _A2), true, false>
2913{
2914public:
2915 typedef decltype(declval<_Fn>()(declval<_A0>(), declval<_A1>(), declval<_A2>())) type;
2916};
2917
2918template <class _MP, class _Tp, bool _IsMemberFunctionPtr>
2919struct __result_of_mp;
2920
2921// member function pointer
2922
2923template <class _MP, class _Tp>
2924struct __result_of_mp<_MP, _Tp, true>
2925 : public __identity<typename __member_pointer_traits<_MP>::_ReturnType>
2926{
2927};
2928
2929// member data pointer
2930
2931template <class _MP, class _Tp, bool>
2932struct __result_of_mdp;
2933
2934template <class _Rp, class _Class, class _Tp>
2935struct __result_of_mdp<_Rp _Class::*, _Tp, false>
2936{
2937 typedef typename __apply_cv<decltype(*_VSTD::declval<_Tp>()), _Rp>::type& type;
2938};
2939
2940template <class _Rp, class _Class, class _Tp>
2941struct __result_of_mdp<_Rp _Class::*, _Tp, true>
2942{
2943 typedef typename __apply_cv<_Tp, _Rp>::type& type;
2944};
2945
2946template <class _Rp, class _Class, class _Tp>
2947struct __result_of_mp<_Rp _Class::*, _Tp, false>
2948 : public __result_of_mdp<_Rp _Class::*, _Tp,
2949 is_base_of<_Class, typename remove_reference<_Tp>::type>::value>
2950{
2951};
2952
2953
2954
2955template <class _Fn, class _Tp>
2956class __result_of<_Fn(_Tp), false, true> // _Fn must be member pointer
2957 : public __result_of_mp<typename remove_reference<_Fn>::type,
2958 _Tp,
2959 is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
2960{
2961};
2962
2963template <class _Fn, class _Tp, class _A0>
2964class __result_of<_Fn(_Tp, _A0), false, true> // _Fn must be member pointer
2965 : public __result_of_mp<typename remove_reference<_Fn>::type,
2966 _Tp,
2967 is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
2968{
2969};
2970
2971template <class _Fn, class _Tp, class _A0, class _A1>
2972class __result_of<_Fn(_Tp, _A0, _A1), false, true> // _Fn must be member pointer
2973 : public __result_of_mp<typename remove_reference<_Fn>::type,
2974 _Tp,
2975 is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
2976{
2977};
2978
2979template <class _Fn, class _Tp, class _A0, class _A1, class _A2>
2980class __result_of<_Fn(_Tp, _A0, _A1, _A2), false, true> // _Fn must be member pointer
2981 : public __result_of_mp<typename remove_reference<_Fn>::type,
2982 _Tp,
2983 is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
2984{
2985};
2986
2987// result_of
2988
2989template <class _Fn>
2990class _LIBCPP_TEMPLATE_VIS result_of<_Fn()>
2991 : public __result_of<_Fn(),
2992 is_class<typename remove_reference<_Fn>::type>::value ||
2993 is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
2994 is_member_pointer<typename remove_reference<_Fn>::type>::value
2995 >
2996{
2997};
2998
2999template <class _Fn, class _A0>
3000class _LIBCPP_TEMPLATE_VIS result_of<_Fn(_A0)>
3001 : public __result_of<_Fn(_A0),
3002 is_class<typename remove_reference<_Fn>::type>::value ||
3003 is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
3004 is_member_pointer<typename remove_reference<_Fn>::type>::value
3005 >
3006{
3007};
3008
3009template <class _Fn, class _A0, class _A1>
3010class _LIBCPP_TEMPLATE_VIS result_of<_Fn(_A0, _A1)>
3011 : public __result_of<_Fn(_A0, _A1),
3012 is_class<typename remove_reference<_Fn>::type>::value ||
3013 is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
3014 is_member_pointer<typename remove_reference<_Fn>::type>::value
3015 >
3016{
3017};
3018
3019template <class _Fn, class _A0, class _A1, class _A2>
3020class _LIBCPP_TEMPLATE_VIS result_of<_Fn(_A0, _A1, _A2)>
3021 : public __result_of<_Fn(_A0, _A1, _A2),
3022 is_class<typename remove_reference<_Fn>::type>::value ||
3023 is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
3024 is_member_pointer<typename remove_reference<_Fn>::type>::value
3025 >
3026{
3027};
3028
3029#endif // _LIBCPP_HAS_NO_VARIADICS
3030
3031// template <class T, class... Args> struct is_constructible;2828// template <class T, class... Args> struct is_constructible;
30322829
3033namespace __is_construct2830#if defined(_LIBCPP_COMPILER_GCC) && _GNUC_VER_NEW >= 10000
3034{2831# define _LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE
3035struct __nat {};2832#endif
3036}
30372833
3038#if !defined(_LIBCPP_CXX03_LANG) && (!__has_feature(is_constructible) || \2834#if !defined(_LIBCPP_CXX03_LANG) && !__has_feature(is_constructible) && !defined(_LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE)
3039 defined(_LIBCPP_TESTING_FALLBACK_IS_CONSTRUCTIBLE))
30402835
3041template <class _Tp, class... _Args>2836template <class _Tp, class... _Args>
3042struct __libcpp_is_constructible;2837struct __libcpp_is_constructible;
...@@ -3151,7 +2946,7 @@ struct __libcpp_is_constructible<_Tp&&, _A0>...@@ -3151,7 +2946,7 @@ struct __libcpp_is_constructible<_Tp&&, _A0>
31512946
3152#endif2947#endif
31532948
3154#if __has_feature(is_constructible)2949#if __has_feature(is_constructible) || defined(_LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE)
3155template <class _Tp, class ..._Args>2950template <class _Tp, class ..._Args>
3156struct _LIBCPP_TEMPLATE_VIS is_constructible2951struct _LIBCPP_TEMPLATE_VIS is_constructible
3157 : public integral_constant<bool, __is_constructible(_Tp, _Args...)>2952 : public integral_constant<bool, __is_constructible(_Tp, _Args...)>
...@@ -3442,7 +3237,7 @@ void __implicit_conversion_to(_Tp) noexcept { }...@@ -3442,7 +3237,7 @@ void __implicit_conversion_to(_Tp) noexcept { }
34423237
3443template <class _Tp, class _Arg>3238template <class _Tp, class _Arg>
3444struct __libcpp_is_nothrow_constructible</*is constructible*/true, /*is reference*/true, _Tp, _Arg>3239struct __libcpp_is_nothrow_constructible</*is constructible*/true, /*is reference*/true, _Tp, _Arg>
3445 : public integral_constant<bool, noexcept(__implicit_conversion_to<_Tp>(declval<_Arg>()))>3240 : public integral_constant<bool, noexcept(_VSTD::__implicit_conversion_to<_Tp>(declval<_Arg>()))>
3446{3241{
3447};3242};
34483243
...@@ -3807,7 +3602,7 @@ auto __invoke_constexpr(__any, _Args&& ...__args) -> __nat;...@@ -3807,7 +3602,7 @@ auto __invoke_constexpr(__any, _Args&& ...__args) -> __nat;
3807template <class _Fp, class _A0, class ..._Args,3602template <class _Fp, class _A0, class ..._Args,
3808 class = __enable_if_bullet1<_Fp, _A0>>3603 class = __enable_if_bullet1<_Fp, _A0>>
3809inline _LIBCPP_INLINE_VISIBILITY3604inline _LIBCPP_INLINE_VISIBILITY
3810auto3605_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
3811__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)3606__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
3812_LIBCPP_INVOKE_RETURN((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))3607_LIBCPP_INVOKE_RETURN((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
38133608
...@@ -3821,7 +3616,7 @@ _LIBCPP_INVOKE_RETURN((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__a...@@ -3821,7 +3616,7 @@ _LIBCPP_INVOKE_RETURN((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__a
3821template <class _Fp, class _A0, class ..._Args,3616template <class _Fp, class _A0, class ..._Args,
3822 class = __enable_if_bullet2<_Fp, _A0>>3617 class = __enable_if_bullet2<_Fp, _A0>>
3823inline _LIBCPP_INLINE_VISIBILITY3618inline _LIBCPP_INLINE_VISIBILITY
3824auto3619_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
3825__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)3620__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
3826_LIBCPP_INVOKE_RETURN((__a0.get().*__f)(_VSTD::forward<_Args>(__args)...))3621_LIBCPP_INVOKE_RETURN((__a0.get().*__f)(_VSTD::forward<_Args>(__args)...))
38273622
...@@ -3835,7 +3630,7 @@ _LIBCPP_INVOKE_RETURN((__a0.get().*__f)(_VSTD::forward<_Args>(__args)...))...@@ -3835,7 +3630,7 @@ _LIBCPP_INVOKE_RETURN((__a0.get().*__f)(_VSTD::forward<_Args>(__args)...))
3835template <class _Fp, class _A0, class ..._Args,3630template <class _Fp, class _A0, class ..._Args,
3836 class = __enable_if_bullet3<_Fp, _A0>>3631 class = __enable_if_bullet3<_Fp, _A0>>
3837inline _LIBCPP_INLINE_VISIBILITY3632inline _LIBCPP_INLINE_VISIBILITY
3838auto3633_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
3839__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)3634__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
3840_LIBCPP_INVOKE_RETURN(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))3635_LIBCPP_INVOKE_RETURN(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
38413636
...@@ -3851,7 +3646,7 @@ _LIBCPP_INVOKE_RETURN(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(...@@ -3851,7 +3646,7 @@ _LIBCPP_INVOKE_RETURN(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(
3851template <class _Fp, class _A0,3646template <class _Fp, class _A0,
3852 class = __enable_if_bullet4<_Fp, _A0>>3647 class = __enable_if_bullet4<_Fp, _A0>>
3853inline _LIBCPP_INLINE_VISIBILITY3648inline _LIBCPP_INLINE_VISIBILITY
3854auto3649_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
3855__invoke(_Fp&& __f, _A0&& __a0)3650__invoke(_Fp&& __f, _A0&& __a0)
3856_LIBCPP_INVOKE_RETURN(_VSTD::forward<_A0>(__a0).*__f)3651_LIBCPP_INVOKE_RETURN(_VSTD::forward<_A0>(__a0).*__f)
38573652
...@@ -3865,7 +3660,7 @@ _LIBCPP_INVOKE_RETURN(_VSTD::forward<_A0>(__a0).*__f)...@@ -3865,7 +3660,7 @@ _LIBCPP_INVOKE_RETURN(_VSTD::forward<_A0>(__a0).*__f)
3865template <class _Fp, class _A0,3660template <class _Fp, class _A0,
3866 class = __enable_if_bullet5<_Fp, _A0>>3661 class = __enable_if_bullet5<_Fp, _A0>>
3867inline _LIBCPP_INLINE_VISIBILITY3662inline _LIBCPP_INLINE_VISIBILITY
3868auto3663_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
3869__invoke(_Fp&& __f, _A0&& __a0)3664__invoke(_Fp&& __f, _A0&& __a0)
3870_LIBCPP_INVOKE_RETURN(__a0.get().*__f)3665_LIBCPP_INVOKE_RETURN(__a0.get().*__f)
38713666
...@@ -3879,7 +3674,7 @@ _LIBCPP_INVOKE_RETURN(__a0.get().*__f)...@@ -3879,7 +3674,7 @@ _LIBCPP_INVOKE_RETURN(__a0.get().*__f)
3879template <class _Fp, class _A0,3674template <class _Fp, class _A0,
3880 class = __enable_if_bullet6<_Fp, _A0>>3675 class = __enable_if_bullet6<_Fp, _A0>>
3881inline _LIBCPP_INLINE_VISIBILITY3676inline _LIBCPP_INLINE_VISIBILITY
3882auto3677_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
3883__invoke(_Fp&& __f, _A0&& __a0)3678__invoke(_Fp&& __f, _A0&& __a0)
3884_LIBCPP_INVOKE_RETURN((*_VSTD::forward<_A0>(__a0)).*__f)3679_LIBCPP_INVOKE_RETURN((*_VSTD::forward<_A0>(__a0)).*__f)
38853680
...@@ -3894,7 +3689,7 @@ _LIBCPP_INVOKE_RETURN((*_VSTD::forward<_A0>(__a0)).*__f)...@@ -3894,7 +3689,7 @@ _LIBCPP_INVOKE_RETURN((*_VSTD::forward<_A0>(__a0)).*__f)
38943689
3895template <class _Fp, class ..._Args>3690template <class _Fp, class ..._Args>
3896inline _LIBCPP_INLINE_VISIBILITY3691inline _LIBCPP_INLINE_VISIBILITY
3897auto3692_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
3898__invoke(_Fp&& __f, _Args&& ...__args)3693__invoke(_Fp&& __f, _Args&& ...__args)
3899_LIBCPP_INVOKE_RETURN(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))3694_LIBCPP_INVOKE_RETURN(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))
39003695
...@@ -3982,14 +3777,97 @@ struct __invoke_of...@@ -3982,14 +3777,97 @@ struct __invoke_of
3982{3777{
3983};3778};
39843779
3780#endif // _LIBCPP_CXX03_LANG
3781
3985// result_of3782// result_of
39863783
3784template <class _Callable> class result_of;
3785
3786#ifndef _LIBCPP_CXX03_LANG
3787
3987template <class _Fp, class ..._Args>3788template <class _Fp, class ..._Args>
3988class _LIBCPP_TEMPLATE_VIS result_of<_Fp(_Args...)>3789class _LIBCPP_TEMPLATE_VIS result_of<_Fp(_Args...)>
3989 : public __invoke_of<_Fp, _Args...>3790 : public __invoke_of<_Fp, _Args...>
3990{3791{
3991};3792};
39923793
3794#else // C++03
3795
3796template <class _Fn, bool, bool>
3797class __result_of
3798{
3799};
3800
3801template <class _Fn, class ..._Args>
3802class __result_of<_Fn(_Args...), true, false>
3803{
3804public:
3805 typedef decltype(declval<_Fn>()(declval<_Args>()...)) type;
3806};
3807
3808template <class _MP, class _Tp, bool _IsMemberFunctionPtr>
3809struct __result_of_mp;
3810
3811// member function pointer
3812
3813template <class _MP, class _Tp>
3814struct __result_of_mp<_MP, _Tp, true>
3815 : public __identity<typename __member_pointer_traits<_MP>::_ReturnType>
3816{
3817};
3818
3819// member data pointer
3820
3821template <class _MP, class _Tp, bool>
3822struct __result_of_mdp;
3823
3824template <class _Rp, class _Class, class _Tp>
3825struct __result_of_mdp<_Rp _Class::*, _Tp, false>
3826{
3827 typedef typename __apply_cv<decltype(*_VSTD::declval<_Tp>()), _Rp>::type& type;
3828};
3829
3830template <class _Rp, class _Class, class _Tp>
3831struct __result_of_mdp<_Rp _Class::*, _Tp, true>
3832{
3833 typedef typename __apply_cv<_Tp, _Rp>::type& type;
3834};
3835
3836template <class _Rp, class _Class, class _Tp>
3837struct __result_of_mp<_Rp _Class::*, _Tp, false>
3838 : public __result_of_mdp<_Rp _Class::*, _Tp,
3839 is_base_of<_Class, typename remove_reference<_Tp>::type>::value>
3840{
3841};
3842
3843template <class _Fn, class _Tp>
3844class __result_of<_Fn(_Tp), false, true> // _Fn must be member pointer
3845 : public __result_of_mp<typename remove_reference<_Fn>::type,
3846 _Tp,
3847 is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
3848{
3849};
3850
3851template <class _Fn, class _Tp, class ..._Args>
3852class __result_of<_Fn(_Tp, _Args...), false, true> // _Fn must be member pointer
3853 : public __result_of_mp<typename remove_reference<_Fn>::type,
3854 _Tp,
3855 is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
3856{
3857};
3858
3859template <class _Fn, class ..._Args>
3860class _LIBCPP_TEMPLATE_VIS result_of<_Fn(_Args...)>
3861 : public __result_of<_Fn(_Args...),
3862 is_class<typename remove_reference<_Fn>::type>::value ||
3863 is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
3864 is_member_pointer<typename remove_reference<_Fn>::type>::value
3865 >
3866{
3867};
3868
3869#endif // C++03
3870
3993#if _LIBCPP_STD_VER > 113871#if _LIBCPP_STD_VER > 11
3994template <class _Tp> using result_of_t = typename result_of<_Tp>::type;3872template <class _Tp> using result_of_t = typename result_of<_Tp>::type;
3995#endif3873#endif
...@@ -4045,8 +3923,6 @@ _LIBCPP_INLINE_VAR constexpr bool is_nothrow_invocable_r_v...@@ -4045,8 +3923,6 @@ _LIBCPP_INLINE_VAR constexpr bool is_nothrow_invocable_r_v
40453923
4046#endif // _LIBCPP_STD_VER > 143924#endif // _LIBCPP_STD_VER > 14
40473925
4048#endif // !defined(_LIBCPP_CXX03_LANG)
4049
4050template <class _Tp> struct __is_swappable;3926template <class _Tp> struct __is_swappable;
4051template <class _Tp> struct __is_nothrow_swappable;3927template <class _Tp> struct __is_nothrow_swappable;
40523928
...@@ -4319,6 +4195,25 @@ struct __has_operator_addressof...@@ -4319,6 +4195,25 @@ struct __has_operator_addressof
43194195
4320#endif // _LIBCPP_CXX03_LANG4196#endif // _LIBCPP_CXX03_LANG
43214197
4198// is_scoped_enum [meta.unary.prop]
4199
4200#if _LIBCPP_STD_VER > 20
4201template <class _Tp, bool = is_enum_v<_Tp> >
4202struct __is_scoped_enum_helper : false_type {};
4203
4204template <class _Tp>
4205struct __is_scoped_enum_helper<_Tp, true>
4206 : public bool_constant<!is_convertible_v<_Tp, underlying_type_t<_Tp> > > {};
4207
4208template <class _Tp>
4209struct _LIBCPP_TEMPLATE_VIS is_scoped_enum
4210 : public __is_scoped_enum_helper<_Tp> {};
4211
4212template <class _Tp>
4213_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_scoped_enum_v =
4214 is_scoped_enum<_Tp>::value;
4215#endif
4216
4322#if _LIBCPP_STD_VER > 144217#if _LIBCPP_STD_VER > 14
43234218
4324template <class... _Args>4219template <class... _Args>
...@@ -4341,7 +4236,6 @@ _LIBCPP_INLINE_VAR constexpr bool negation_v...@@ -4341,7 +4236,6 @@ _LIBCPP_INLINE_VAR constexpr bool negation_v
4341#endif // _LIBCPP_STD_VER > 144236#endif // _LIBCPP_STD_VER > 14
43424237
4343// These traits are used in __tree and __hash_table4238// These traits are used in __tree and __hash_table
4344#ifndef _LIBCPP_CXX03_LANG
4345struct __extract_key_fail_tag {};4239struct __extract_key_fail_tag {};
4346struct __extract_key_self_tag {};4240struct __extract_key_self_tag {};
4347struct __extract_key_first_tag {};4241struct __extract_key_first_tag {};
...@@ -4353,7 +4247,7 @@ struct __can_extract_key...@@ -4353,7 +4247,7 @@ struct __can_extract_key
4353 __extract_key_fail_tag>::type {};4247 __extract_key_fail_tag>::type {};
43544248
4355template <class _Pair, class _Key, class _First, class _Second>4249template <class _Pair, class _Key, class _First, class _Second>
4356struct __can_extract_key<_Pair, _Key, pair<_First, _Second>>4250struct __can_extract_key<_Pair, _Key, pair<_First, _Second> >
4357 : conditional<_IsSame<typename remove_const<_First>::type, _Key>::value,4251 : conditional<_IsSame<typename remove_const<_First>::type, _Key>::value,
4358 __extract_key_first_tag, __extract_key_fail_tag>::type {};4252 __extract_key_first_tag, __extract_key_fail_tag>::type {};
43594253
...@@ -4371,8 +4265,6 @@ template <class _ValTy, class _Key, class _RawValTy>...@@ -4371,8 +4265,6 @@ template <class _ValTy, class _Key, class _RawValTy>
4371struct __can_extract_map_key<_ValTy, _Key, _Key, _RawValTy>4265struct __can_extract_map_key<_ValTy, _Key, _Key, _RawValTy>
4372 : false_type {};4266 : false_type {};
43734267
4374#endif
4375
4376#ifndef _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED4268#ifndef _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED
4377#if _LIBCPP_STD_VER > 174269#if _LIBCPP_STD_VER > 17
4378_LIBCPP_INLINE_VISIBILITY4270_LIBCPP_INLINE_VISIBILITY
lib/libcxx/include/typeinfo+24-5
...@@ -57,6 +57,7 @@ public:...@@ -57,6 +57,7 @@ public:
57*/57*/
5858
59#include <__config>59#include <__config>
60#include <__availability>
60#include <exception>61#include <exception>
61#include <cstddef>62#include <cstddef>
62#include <cstdint>63#include <cstdint>
...@@ -141,7 +142,7 @@ public:...@@ -141,7 +142,7 @@ public:
141// comparison is equal.142// comparison is equal.
142// -------------------------------------------------------------------------- //143// -------------------------------------------------------------------------- //
143// NonUniqueARMRTTIBit144// NonUniqueARMRTTIBit
144// (selected on ARM64 regardless of _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION)145// (_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION = 3)
145// -------------------------------------------------------------------------- //146// -------------------------------------------------------------------------- //
146// This implementation of type_info does not assume always a unique copy of147// This implementation of type_info does not assume always a unique copy of
147// the RTTI for a given type inside a program. It packs the pointer to the148// the RTTI for a given type inside a program. It packs the pointer to the
...@@ -160,6 +161,24 @@ public:...@@ -160,6 +161,24 @@ public:
160// the pointer when it constructs the type_info, depending on whether it can161// the pointer when it constructs the type_info, depending on whether it can
161// guarantee uniqueness for that specific type_info.162// guarantee uniqueness for that specific type_info.
162163
164// This value can be overriden in the __config_site. When it's not overriden,
165// we pick a default implementation based on the platform here.
166#ifndef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION
167
168 // Windows binaries can't merge typeinfos, so use the NonUnique implementation.
169# ifdef _LIBCPP_OBJECT_FORMAT_COFF
170# define _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION 2
171
172 // On arm64 on Apple platforms, use the special NonUniqueARMRTTIBit implementation.
173# elif defined(__APPLE__) && defined(__LP64__) && !defined(__x86_64__)
174# define _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION 3
175
176 // On all other platforms, assume the Itanium C++ ABI and use the Unique implementation.
177# else
178# define _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION 1
179# endif
180#endif
181
163struct __type_info_implementations {182struct __type_info_implementations {
164 struct __string_impl_base {183 struct __string_impl_base {
165 typedef const char* __type_name_t;184 typedef const char* __type_name_t;
...@@ -243,7 +262,7 @@ struct __type_info_implementations {...@@ -243,7 +262,7 @@ struct __type_info_implementations {
243 private:262 private:
244 // The unique bit is the top bit. It is expected that __type_name_t is 64 bits when263 // The unique bit is the top bit. It is expected that __type_name_t is 64 bits when
245 // this implementation is actually used.264 // this implementation is actually used.
246 typedef std::integral_constant<__type_name_t,265 typedef integral_constant<__type_name_t,
247 (1ULL << ((__CHAR_BIT__ * sizeof(__type_name_t)) - 1))> __non_unique_rtti_bit;266 (1ULL << ((__CHAR_BIT__ * sizeof(__type_name_t)) - 1))> __non_unique_rtti_bit;
248267
249 _LIBCPP_INLINE_VISIBILITY268 _LIBCPP_INLINE_VISIBILITY
...@@ -257,12 +276,12 @@ struct __type_info_implementations {...@@ -257,12 +276,12 @@ struct __type_info_implementations {
257 };276 };
258277
259 typedef278 typedef
260#if defined(__APPLE__) && defined(__LP64__) && !defined(__x86_64__)279#if _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 1
261 __non_unique_arm_rtti_bit_impl
262#elif _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 1
263 __unique_impl280 __unique_impl
264#elif _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 2281#elif _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 2
265 __non_unique_impl282 __non_unique_impl
283#elif _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 3
284 __non_unique_arm_rtti_bit_impl
266#else285#else
267# error invalid configuration for _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION286# error invalid configuration for _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION
268#endif287#endif
lib/libcxx/include/unordered_map+203-67
...@@ -173,10 +173,22 @@ public:...@@ -173,10 +173,22 @@ public:
173173
174 iterator find(const key_type& k);174 iterator find(const key_type& k);
175 const_iterator find(const key_type& k) const;175 const_iterator find(const key_type& k) const;
176 template<typename K>
177 iterator find(const K& x); // C++20
178 template<typename K>
179 const_iterator find(const K& x) const; // C++20
176 size_type count(const key_type& k) const;180 size_type count(const key_type& k) const;
181 template<typename K>
182 size_type count(const K& k) const; // C++20
177 bool contains(const key_type& k) const; // C++20183 bool contains(const key_type& k) const; // C++20
184 template<typename K>
185 bool contains(const K& k) const; // C++20
178 pair<iterator, iterator> equal_range(const key_type& k);186 pair<iterator, iterator> equal_range(const key_type& k);
179 pair<const_iterator, const_iterator> equal_range(const key_type& k) const;187 pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
188 template<typename K>
189 pair<iterator, iterator> equal_range(const K& k); // C++20
190 template<typename K>
191 pair<const_iterator, const_iterator> equal_range(const K& k) const; // C++20
180192
181 mapped_type& operator[](const key_type& k);193 mapped_type& operator[](const key_type& k);
182 mapped_type& operator[](key_type&& k);194 mapped_type& operator[](key_type&& k);
...@@ -355,10 +367,22 @@ public:...@@ -355,10 +367,22 @@ public:
355367
356 iterator find(const key_type& k);368 iterator find(const key_type& k);
357 const_iterator find(const key_type& k) const;369 const_iterator find(const key_type& k) const;
370 template<typename K>
371 iterator find(const K& x); // C++20
372 template<typename K>
373 const_iterator find(const K& x) const; // C++20
358 size_type count(const key_type& k) const;374 size_type count(const key_type& k) const;
375 template<typename K>
376 size_type count(const K& k) const; // C++20
359 bool contains(const key_type& k) const; // C++20377 bool contains(const key_type& k) const; // C++20
378 template<typename K>
379 bool contains(const K& k) const; // C++20
360 pair<iterator, iterator> equal_range(const key_type& k);380 pair<iterator, iterator> equal_range(const key_type& k);
361 pair<const_iterator, const_iterator> equal_range(const key_type& k) const;381 pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
382 template<typename K>
383 pair<iterator, iterator> equal_range(const K& k); // C++20
384 template<typename K>
385 pair<const_iterator, const_iterator> equal_range(const K& k) const; // C++20
362386
363 size_type bucket_count() const noexcept;387 size_type bucket_count() const noexcept;
364 size_type max_bucket_count() const noexcept;388 size_type max_bucket_count() const noexcept;
...@@ -423,7 +447,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>...@@ -423,7 +447,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
423447
424_LIBCPP_BEGIN_NAMESPACE_STD448_LIBCPP_BEGIN_NAMESPACE_STD
425449
426template <class _Key, class _Cp, class _Hash,450template <class _Key, class _Cp, class _Hash, class _Pred,
427 bool = is_empty<_Hash>::value && !__libcpp_is_final<_Hash>::value>451 bool = is_empty<_Hash>::value && !__libcpp_is_final<_Hash>::value>
428class __unordered_map_hasher452class __unordered_map_hasher
429 : private _Hash453 : private _Hash
...@@ -445,6 +469,12 @@ public:...@@ -445,6 +469,12 @@ public:
445 _LIBCPP_INLINE_VISIBILITY469 _LIBCPP_INLINE_VISIBILITY
446 size_t operator()(const _Key& __x) const470 size_t operator()(const _Key& __x) const
447 {return static_cast<const _Hash&>(*this)(__x);}471 {return static_cast<const _Hash&>(*this)(__x);}
472#if _LIBCPP_STD_VER > 17
473 template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
474 _LIBCPP_INLINE_VISIBILITY
475 size_t operator()(const _K2& __x) const
476 {return static_cast<const _Hash&>(*this)(__x);}
477#endif
448 void swap(__unordered_map_hasher&__y)478 void swap(__unordered_map_hasher&__y)
449 _NOEXCEPT_(__is_nothrow_swappable<_Hash>::value)479 _NOEXCEPT_(__is_nothrow_swappable<_Hash>::value)
450 {480 {
...@@ -453,8 +483,8 @@ public:...@@ -453,8 +483,8 @@ public:
453 }483 }
454};484};
455485
456template <class _Key, class _Cp, class _Hash>486template <class _Key, class _Cp, class _Hash, class _Pred>
457class __unordered_map_hasher<_Key, _Cp, _Hash, false>487class __unordered_map_hasher<_Key, _Cp, _Hash, _Pred, false>
458{488{
459 _Hash __hash_;489 _Hash __hash_;
460public:490public:
...@@ -474,6 +504,12 @@ public:...@@ -474,6 +504,12 @@ public:
474 _LIBCPP_INLINE_VISIBILITY504 _LIBCPP_INLINE_VISIBILITY
475 size_t operator()(const _Key& __x) const505 size_t operator()(const _Key& __x) const
476 {return __hash_(__x);}506 {return __hash_(__x);}
507#if _LIBCPP_STD_VER > 17
508 template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
509 _LIBCPP_INLINE_VISIBILITY
510 size_t operator()(const _K2& __x) const
511 {return __hash_(__x);}
512#endif
477 void swap(__unordered_map_hasher&__y)513 void swap(__unordered_map_hasher&__y)
478 _NOEXCEPT_(__is_nothrow_swappable<_Hash>::value)514 _NOEXCEPT_(__is_nothrow_swappable<_Hash>::value)
479 {515 {
...@@ -482,17 +518,17 @@ public:...@@ -482,17 +518,17 @@ public:
482 }518 }
483};519};
484520
485template <class _Key, class _Cp, class _Hash, bool __b>521template <class _Key, class _Cp, class _Hash, class _Pred, bool __b>
486inline _LIBCPP_INLINE_VISIBILITY522inline _LIBCPP_INLINE_VISIBILITY
487void523void
488swap(__unordered_map_hasher<_Key, _Cp, _Hash, __b>& __x,524swap(__unordered_map_hasher<_Key, _Cp, _Hash, _Pred, __b>& __x,
489 __unordered_map_hasher<_Key, _Cp, _Hash, __b>& __y)525 __unordered_map_hasher<_Key, _Cp, _Hash, _Pred, __b>& __y)
490 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))526 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
491{527{
492 __x.swap(__y);528 __x.swap(__y);
493}529}
494530
495template <class _Key, class _Cp, class _Pred,531template <class _Key, class _Cp, class _Pred, class _Hash,
496 bool = is_empty<_Pred>::value && !__libcpp_is_final<_Pred>::value>532 bool = is_empty<_Pred>::value && !__libcpp_is_final<_Pred>::value>
497class __unordered_map_equal533class __unordered_map_equal
498 : private _Pred534 : private _Pred
...@@ -517,6 +553,24 @@ public:...@@ -517,6 +553,24 @@ public:
517 _LIBCPP_INLINE_VISIBILITY553 _LIBCPP_INLINE_VISIBILITY
518 bool operator()(const _Key& __x, const _Cp& __y) const554 bool operator()(const _Key& __x, const _Cp& __y) const
519 {return static_cast<const _Pred&>(*this)(__x, __y.__get_value().first);}555 {return static_cast<const _Pred&>(*this)(__x, __y.__get_value().first);}
556#if _LIBCPP_STD_VER > 17
557 template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
558 _LIBCPP_INLINE_VISIBILITY
559 bool operator()(const _Cp& __x, const _K2& __y) const
560 {return static_cast<const _Pred&>(*this)(__x.__get_value().first, __y);}
561 template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
562 _LIBCPP_INLINE_VISIBILITY
563 bool operator()(const _K2& __x, const _Cp& __y) const
564 {return static_cast<const _Pred&>(*this)(__x, __y.__get_value().first);}
565 template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
566 _LIBCPP_INLINE_VISIBILITY
567 bool operator()(const _Key& __x, const _K2& __y) const
568 {return static_cast<const _Pred&>(*this)(__x, __y);}
569 template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
570 _LIBCPP_INLINE_VISIBILITY
571 bool operator()(const _K2& __x, const _Key& __y) const
572 {return static_cast<const _Pred&>(*this)(__x, __y);}
573#endif
520 void swap(__unordered_map_equal&__y)574 void swap(__unordered_map_equal&__y)
521 _NOEXCEPT_(__is_nothrow_swappable<_Pred>::value)575 _NOEXCEPT_(__is_nothrow_swappable<_Pred>::value)
522 {576 {
...@@ -525,8 +579,8 @@ public:...@@ -525,8 +579,8 @@ public:
525 }579 }
526};580};
527581
528template <class _Key, class _Cp, class _Pred>582template <class _Key, class _Cp, class _Pred, class _Hash>
529class __unordered_map_equal<_Key, _Cp, _Pred, false>583class __unordered_map_equal<_Key, _Cp, _Pred, _Hash, false>
530{584{
531 _Pred __pred_;585 _Pred __pred_;
532public:586public:
...@@ -549,6 +603,24 @@ public:...@@ -549,6 +603,24 @@ public:
549 _LIBCPP_INLINE_VISIBILITY603 _LIBCPP_INLINE_VISIBILITY
550 bool operator()(const _Key& __x, const _Cp& __y) const604 bool operator()(const _Key& __x, const _Cp& __y) const
551 {return __pred_(__x, __y.__get_value().first);}605 {return __pred_(__x, __y.__get_value().first);}
606#if _LIBCPP_STD_VER > 17
607 template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
608 _LIBCPP_INLINE_VISIBILITY
609 bool operator()(const _Cp& __x, const _K2& __y) const
610 {return __pred_(__x.__get_value().first, __y);}
611 template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
612 _LIBCPP_INLINE_VISIBILITY
613 bool operator()(const _K2& __x, const _Cp& __y) const
614 {return __pred_(__x, __y.__get_value().first);}
615 template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
616 _LIBCPP_INLINE_VISIBILITY
617 bool operator()(const _Key& __x, const _K2& __y) const
618 {return __pred_(__x, __y);}
619 template <typename _K2, typename = _EnableIf<__is_transparent<_Hash, _K2>::value && __is_transparent<_Pred, _K2>::value>>
620 _LIBCPP_INLINE_VISIBILITY
621 bool operator()(const _K2& __x, const _Key& __y) const
622 {return __pred_(__x, __y);}
623#endif
552 void swap(__unordered_map_equal&__y)624 void swap(__unordered_map_equal&__y)
553 _NOEXCEPT_(__is_nothrow_swappable<_Pred>::value)625 _NOEXCEPT_(__is_nothrow_swappable<_Pred>::value)
554 {626 {
...@@ -557,11 +629,11 @@ public:...@@ -557,11 +629,11 @@ public:
557 }629 }
558};630};
559631
560template <class _Key, class _Cp, class _Pred, bool __b>632template <class _Key, class _Cp, class _Pred, class _Hash, bool __b>
561inline _LIBCPP_INLINE_VISIBILITY633inline _LIBCPP_INLINE_VISIBILITY
562void634void
563swap(__unordered_map_equal<_Key, _Cp, _Pred, __b>& __x,635swap(__unordered_map_equal<_Key, _Cp, _Pred, _Hash, __b>& __x,
564 __unordered_map_equal<_Key, _Cp, _Pred, __b>& __y)636 __unordered_map_equal<_Key, _Cp, _Pred, _Hash, __b>& __y)
565 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))637 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
566{638{
567 __x.swap(__y);639 __x.swap(__y);
...@@ -858,11 +930,11 @@ public:...@@ -858,11 +930,11 @@ public:
858 "Invalid allocator::value_type");930 "Invalid allocator::value_type");
859931
860private:932private:
861 typedef __hash_value_type<key_type, mapped_type> __value_type;933 typedef __hash_value_type<key_type, mapped_type> __value_type;
862 typedef __unordered_map_hasher<key_type, __value_type, hasher> __hasher;934 typedef __unordered_map_hasher<key_type, __value_type, hasher, key_equal> __hasher;
863 typedef __unordered_map_equal<key_type, __value_type, key_equal> __key_equal;935 typedef __unordered_map_equal<key_type, __value_type, key_equal, hasher> __key_equal;
864 typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>,936 typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>,
865 __value_type>::type __allocator_type;937 __value_type>::type __allocator_type;
866938
867 typedef __hash_table<__value_type, __hasher,939 typedef __hash_table<__value_type, __hasher,
868 __key_equal, __allocator_type> __table;940 __key_equal, __allocator_type> __table;
...@@ -906,7 +978,7 @@ public:...@@ -906,7 +978,7 @@ public:
906 unordered_map()978 unordered_map()
907 _NOEXCEPT_(is_nothrow_default_constructible<__table>::value)979 _NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
908 {980 {
909#if _LIBCPP_DEBUG_LEVEL >= 2981#if _LIBCPP_DEBUG_LEVEL == 2
910 __get_db()->__insert_c(this);982 __get_db()->__insert_c(this);
911#endif983#endif
912 }984 }
...@@ -1025,7 +1097,7 @@ public:...@@ -1025,7 +1097,7 @@ public:
1025 {return __table_.__insert_unique(__x);}1097 {return __table_.__insert_unique(__x);}
10261098
1027 iterator insert(const_iterator __p, const value_type& __x) {1099 iterator insert(const_iterator __p, const value_type& __x) {
1028#if _LIBCPP_DEBUG_LEVEL >= 21100#if _LIBCPP_DEBUG_LEVEL == 2
1029 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,1101 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
1030 "unordered_map::insert(const_iterator, const value_type&) called with an iterator not"1102 "unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
1031 " referring to this unordered_map");1103 " referring to this unordered_map");
...@@ -1049,7 +1121,7 @@ public:...@@ -1049,7 +1121,7 @@ public:
1049 {return __table_.__insert_unique(_VSTD::move(__x));}1121 {return __table_.__insert_unique(_VSTD::move(__x));}
10501122
1051 iterator insert(const_iterator __p, value_type&& __x) {1123 iterator insert(const_iterator __p, value_type&& __x) {
1052#if _LIBCPP_DEBUG_LEVEL >= 21124#if _LIBCPP_DEBUG_LEVEL == 2
1053 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,1125 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
1054 "unordered_map::insert(const_iterator, const value_type&) called with an iterator not"1126 "unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
1055 " referring to this unordered_map");1127 " referring to this unordered_map");
...@@ -1070,7 +1142,7 @@ public:...@@ -1070,7 +1142,7 @@ public:
1070 _LIBCPP_INLINE_VISIBILITY1142 _LIBCPP_INLINE_VISIBILITY
1071 iterator insert(const_iterator __p, _Pp&& __x)1143 iterator insert(const_iterator __p, _Pp&& __x)
1072 {1144 {
1073#if _LIBCPP_DEBUG_LEVEL >= 21145#if _LIBCPP_DEBUG_LEVEL == 2
1074 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,1146 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
1075 "unordered_map::insert(const_iterator, value_type&&) called with an iterator not"1147 "unordered_map::insert(const_iterator, value_type&&) called with an iterator not"
1076 " referring to this unordered_map");1148 " referring to this unordered_map");
...@@ -1089,7 +1161,7 @@ public:...@@ -1089,7 +1161,7 @@ public:
1089 template <class... _Args>1161 template <class... _Args>
1090 _LIBCPP_INLINE_VISIBILITY1162 _LIBCPP_INLINE_VISIBILITY
1091 iterator emplace_hint(const_iterator __p, _Args&&... __args) {1163 iterator emplace_hint(const_iterator __p, _Args&&... __args) {
1092#if _LIBCPP_DEBUG_LEVEL >= 21164#if _LIBCPP_DEBUG_LEVEL == 2
1093 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,1165 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
1094 "unordered_map::emplace_hint(const_iterator, args...) called with an iterator not"1166 "unordered_map::emplace_hint(const_iterator, args...) called with an iterator not"
1095 " referring to this unordered_map");1167 " referring to this unordered_map");
...@@ -1106,7 +1178,7 @@ public:...@@ -1106,7 +1178,7 @@ public:
1106 _LIBCPP_INLINE_VISIBILITY1178 _LIBCPP_INLINE_VISIBILITY
1107 pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args)1179 pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args)
1108 {1180 {
1109 return __table_.__emplace_unique_key_args(__k, _VSTD::piecewise_construct,1181 return __table_.__emplace_unique_key_args(__k, piecewise_construct,
1110 _VSTD::forward_as_tuple(__k),1182 _VSTD::forward_as_tuple(__k),
1111 _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));1183 _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
1112 }1184 }
...@@ -1115,7 +1187,7 @@ public:...@@ -1115,7 +1187,7 @@ public:
1115 _LIBCPP_INLINE_VISIBILITY1187 _LIBCPP_INLINE_VISIBILITY
1116 pair<iterator, bool> try_emplace(key_type&& __k, _Args&&... __args)1188 pair<iterator, bool> try_emplace(key_type&& __k, _Args&&... __args)
1117 {1189 {
1118 return __table_.__emplace_unique_key_args(__k, _VSTD::piecewise_construct,1190 return __table_.__emplace_unique_key_args(__k, piecewise_construct,
1119 _VSTD::forward_as_tuple(_VSTD::move(__k)),1191 _VSTD::forward_as_tuple(_VSTD::move(__k)),
1120 _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));1192 _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
1121 }1193 }
...@@ -1124,7 +1196,7 @@ public:...@@ -1124,7 +1196,7 @@ public:
1124 _LIBCPP_INLINE_VISIBILITY1196 _LIBCPP_INLINE_VISIBILITY
1125 iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args)1197 iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args)
1126 {1198 {
1127#if _LIBCPP_DEBUG_LEVEL >= 21199#if _LIBCPP_DEBUG_LEVEL == 2
1128 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this,1200 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this,
1129 "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"1201 "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"
1130 " referring to this unordered_map");1202 " referring to this unordered_map");
...@@ -1138,7 +1210,7 @@ public:...@@ -1138,7 +1210,7 @@ public:
1138 _LIBCPP_INLINE_VISIBILITY1210 _LIBCPP_INLINE_VISIBILITY
1139 iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args)1211 iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args)
1140 {1212 {
1141#if _LIBCPP_DEBUG_LEVEL >= 21213#if _LIBCPP_DEBUG_LEVEL == 2
1142 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this,1214 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this,
1143 "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"1215 "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"
1144 " referring to this unordered_map");1216 " referring to this unordered_map");
...@@ -1280,11 +1352,34 @@ public:...@@ -1280,11 +1352,34 @@ public:
1280 iterator find(const key_type& __k) {return __table_.find(__k);}1352 iterator find(const key_type& __k) {return __table_.find(__k);}
1281 _LIBCPP_INLINE_VISIBILITY1353 _LIBCPP_INLINE_VISIBILITY
1282 const_iterator find(const key_type& __k) const {return __table_.find(__k);}1354 const_iterator find(const key_type& __k) const {return __table_.find(__k);}
1355
1356 #if _LIBCPP_STD_VER > 17
1357 template <typename _K2>
1358 _LIBCPP_INLINE_VISIBILITY
1359 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, iterator>
1360 find(const _K2& __k) {return __table_.find(__k);}
1361 template <typename _K2>
1362 _LIBCPP_INLINE_VISIBILITY
1363 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, const_iterator>
1364 find(const _K2& __k) const {return __table_.find(__k);}
1365 #endif // _LIBCPP_STD_VER > 17
1366
1283 _LIBCPP_INLINE_VISIBILITY1367 _LIBCPP_INLINE_VISIBILITY
1284 size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}1368 size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
1369 #if _LIBCPP_STD_VER > 17
1370 template <typename _K2>
1371 _LIBCPP_INLINE_VISIBILITY
1372 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, size_type>
1373 count(const _K2& __k) const {return __table_.__count_unique(__k);}
1374 #endif // _LIBCPP_STD_VER > 17
1285 #if _LIBCPP_STD_VER > 171375 #if _LIBCPP_STD_VER > 17
1286 _LIBCPP_INLINE_VISIBILITY1376 _LIBCPP_INLINE_VISIBILITY
1287 bool contains(const key_type& __k) const {return find(__k) != end();}1377 bool contains(const key_type& __k) const {return find(__k) != end();}
1378
1379 template <typename _K2>
1380 _LIBCPP_INLINE_VISIBILITY
1381 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, bool>
1382 contains(const _K2& __k) const {return find(__k) != end();}
1288 #endif // _LIBCPP_STD_VER > 171383 #endif // _LIBCPP_STD_VER > 17
1289 _LIBCPP_INLINE_VISIBILITY1384 _LIBCPP_INLINE_VISIBILITY
1290 pair<iterator, iterator> equal_range(const key_type& __k)1385 pair<iterator, iterator> equal_range(const key_type& __k)
...@@ -1292,6 +1387,16 @@ public:...@@ -1292,6 +1387,16 @@ public:
1292 _LIBCPP_INLINE_VISIBILITY1387 _LIBCPP_INLINE_VISIBILITY
1293 pair<const_iterator, const_iterator> equal_range(const key_type& __k) const1388 pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
1294 {return __table_.__equal_range_unique(__k);}1389 {return __table_.__equal_range_unique(__k);}
1390 #if _LIBCPP_STD_VER > 17
1391 template <typename _K2>
1392 _LIBCPP_INLINE_VISIBILITY
1393 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<iterator, iterator>>
1394 equal_range(const _K2& __k) {return __table_.__equal_range_unique(__k);}
1395 template <typename _K2>
1396 _LIBCPP_INLINE_VISIBILITY
1397 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<const_iterator, const_iterator>>
1398 equal_range(const _K2& __k) const {return __table_.__equal_range_unique(__k);}
1399 #endif // _LIBCPP_STD_VER > 17
12951400
1296 mapped_type& operator[](const key_type& __k);1401 mapped_type& operator[](const key_type& __k);
1297#ifndef _LIBCPP_CXX03_LANG1402#ifndef _LIBCPP_CXX03_LANG
...@@ -1336,7 +1441,7 @@ public:...@@ -1336,7 +1441,7 @@ public:
1336 _LIBCPP_INLINE_VISIBILITY1441 _LIBCPP_INLINE_VISIBILITY
1337 void reserve(size_type __n) {__table_.reserve(__n);}1442 void reserve(size_type __n) {__table_.reserve(__n);}
13381443
1339#if _LIBCPP_DEBUG_LEVEL >= 21444#if _LIBCPP_DEBUG_LEVEL == 2
13401445
1341 bool __dereferenceable(const const_iterator* __i) const1446 bool __dereferenceable(const const_iterator* __i) const
1342 {return __table_.__dereferenceable(&__i->__i_);}1447 {return __table_.__dereferenceable(&__i->__i_);}
...@@ -1347,7 +1452,7 @@ public:...@@ -1347,7 +1452,7 @@ public:
1347 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const1452 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
1348 {return __table_.__addable(&__i->__i_, __n);}1453 {return __table_.__addable(&__i->__i_, __n);}
13491454
1350#endif // _LIBCPP_DEBUG_LEVEL >= 21455#endif // _LIBCPP_DEBUG_LEVEL == 2
13511456
1352private:1457private:
13531458
...@@ -1428,7 +1533,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(...@@ -1428,7 +1533,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1428 size_type __n, const hasher& __hf, const key_equal& __eql)1533 size_type __n, const hasher& __hf, const key_equal& __eql)
1429 : __table_(__hf, __eql)1534 : __table_(__hf, __eql)
1430{1535{
1431#if _LIBCPP_DEBUG_LEVEL >= 21536#if _LIBCPP_DEBUG_LEVEL == 2
1432 __get_db()->__insert_c(this);1537 __get_db()->__insert_c(this);
1433#endif1538#endif
1434 __table_.rehash(__n);1539 __table_.rehash(__n);
...@@ -1440,7 +1545,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(...@@ -1440,7 +1545,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1440 const allocator_type& __a)1545 const allocator_type& __a)
1441 : __table_(__hf, __eql, typename __table::allocator_type(__a))1546 : __table_(__hf, __eql, typename __table::allocator_type(__a))
1442{1547{
1443#if _LIBCPP_DEBUG_LEVEL >= 21548#if _LIBCPP_DEBUG_LEVEL == 2
1444 __get_db()->__insert_c(this);1549 __get_db()->__insert_c(this);
1445#endif1550#endif
1446 __table_.rehash(__n);1551 __table_.rehash(__n);
...@@ -1452,7 +1557,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(...@@ -1452,7 +1557,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1452 const allocator_type& __a)1557 const allocator_type& __a)
1453 : __table_(typename __table::allocator_type(__a))1558 : __table_(typename __table::allocator_type(__a))
1454{1559{
1455#if _LIBCPP_DEBUG_LEVEL >= 21560#if _LIBCPP_DEBUG_LEVEL == 2
1456 __get_db()->__insert_c(this);1561 __get_db()->__insert_c(this);
1457#endif1562#endif
1458}1563}
...@@ -1462,7 +1567,7 @@ template <class _InputIterator>...@@ -1462,7 +1567,7 @@ template <class _InputIterator>
1462unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(1567unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1463 _InputIterator __first, _InputIterator __last)1568 _InputIterator __first, _InputIterator __last)
1464{1569{
1465#if _LIBCPP_DEBUG_LEVEL >= 21570#if _LIBCPP_DEBUG_LEVEL == 2
1466 __get_db()->__insert_c(this);1571 __get_db()->__insert_c(this);
1467#endif1572#endif
1468 insert(__first, __last);1573 insert(__first, __last);
...@@ -1475,7 +1580,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(...@@ -1475,7 +1580,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1475 const hasher& __hf, const key_equal& __eql)1580 const hasher& __hf, const key_equal& __eql)
1476 : __table_(__hf, __eql)1581 : __table_(__hf, __eql)
1477{1582{
1478#if _LIBCPP_DEBUG_LEVEL >= 21583#if _LIBCPP_DEBUG_LEVEL == 2
1479 __get_db()->__insert_c(this);1584 __get_db()->__insert_c(this);
1480#endif1585#endif
1481 __table_.rehash(__n);1586 __table_.rehash(__n);
...@@ -1489,7 +1594,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(...@@ -1489,7 +1594,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1489 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)1594 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
1490 : __table_(__hf, __eql, typename __table::allocator_type(__a))1595 : __table_(__hf, __eql, typename __table::allocator_type(__a))
1491{1596{
1492#if _LIBCPP_DEBUG_LEVEL >= 21597#if _LIBCPP_DEBUG_LEVEL == 2
1493 __get_db()->__insert_c(this);1598 __get_db()->__insert_c(this);
1494#endif1599#endif
1495 __table_.rehash(__n);1600 __table_.rehash(__n);
...@@ -1501,7 +1606,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(...@@ -1501,7 +1606,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1501 const unordered_map& __u)1606 const unordered_map& __u)
1502 : __table_(__u.__table_)1607 : __table_(__u.__table_)
1503{1608{
1504#if _LIBCPP_DEBUG_LEVEL >= 21609#if _LIBCPP_DEBUG_LEVEL == 2
1505 __get_db()->__insert_c(this);1610 __get_db()->__insert_c(this);
1506#endif1611#endif
1507 __table_.rehash(__u.bucket_count());1612 __table_.rehash(__u.bucket_count());
...@@ -1513,7 +1618,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(...@@ -1513,7 +1618,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1513 const unordered_map& __u, const allocator_type& __a)1618 const unordered_map& __u, const allocator_type& __a)
1514 : __table_(__u.__table_, typename __table::allocator_type(__a))1619 : __table_(__u.__table_, typename __table::allocator_type(__a))
1515{1620{
1516#if _LIBCPP_DEBUG_LEVEL >= 21621#if _LIBCPP_DEBUG_LEVEL == 2
1517 __get_db()->__insert_c(this);1622 __get_db()->__insert_c(this);
1518#endif1623#endif
1519 __table_.rehash(__u.bucket_count());1624 __table_.rehash(__u.bucket_count());
...@@ -1529,7 +1634,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(...@@ -1529,7 +1634,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1529 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)1634 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
1530 : __table_(_VSTD::move(__u.__table_))1635 : __table_(_VSTD::move(__u.__table_))
1531{1636{
1532#if _LIBCPP_DEBUG_LEVEL >= 21637#if _LIBCPP_DEBUG_LEVEL == 2
1533 __get_db()->__insert_c(this);1638 __get_db()->__insert_c(this);
1534 __get_db()->swap(this, &__u);1639 __get_db()->swap(this, &__u);
1535#endif1640#endif
...@@ -1540,7 +1645,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(...@@ -1540,7 +1645,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1540 unordered_map&& __u, const allocator_type& __a)1645 unordered_map&& __u, const allocator_type& __a)
1541 : __table_(_VSTD::move(__u.__table_), typename __table::allocator_type(__a))1646 : __table_(_VSTD::move(__u.__table_), typename __table::allocator_type(__a))
1542{1647{
1543#if _LIBCPP_DEBUG_LEVEL >= 21648#if _LIBCPP_DEBUG_LEVEL == 2
1544 __get_db()->__insert_c(this);1649 __get_db()->__insert_c(this);
1545#endif1650#endif
1546 if (__a != __u.get_allocator())1651 if (__a != __u.get_allocator())
...@@ -1551,7 +1656,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(...@@ -1551,7 +1656,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1551 __u.__table_.remove((__i++).__i_)->__value_.__move());1656 __u.__table_.remove((__i++).__i_)->__value_.__move());
1552 }1657 }
1553 }1658 }
1554#if _LIBCPP_DEBUG_LEVEL >= 21659#if _LIBCPP_DEBUG_LEVEL == 2
1555 else1660 else
1556 __get_db()->swap(this, &__u);1661 __get_db()->swap(this, &__u);
1557#endif1662#endif
...@@ -1561,7 +1666,7 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>...@@ -1561,7 +1666,7 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1561unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(1666unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1562 initializer_list<value_type> __il)1667 initializer_list<value_type> __il)
1563{1668{
1564#if _LIBCPP_DEBUG_LEVEL >= 21669#if _LIBCPP_DEBUG_LEVEL == 2
1565 __get_db()->__insert_c(this);1670 __get_db()->__insert_c(this);
1566#endif1671#endif
1567 insert(__il.begin(), __il.end());1672 insert(__il.begin(), __il.end());
...@@ -1573,7 +1678,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(...@@ -1573,7 +1678,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1573 const key_equal& __eql)1678 const key_equal& __eql)
1574 : __table_(__hf, __eql)1679 : __table_(__hf, __eql)
1575{1680{
1576#if _LIBCPP_DEBUG_LEVEL >= 21681#if _LIBCPP_DEBUG_LEVEL == 2
1577 __get_db()->__insert_c(this);1682 __get_db()->__insert_c(this);
1578#endif1683#endif
1579 __table_.rehash(__n);1684 __table_.rehash(__n);
...@@ -1586,7 +1691,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(...@@ -1586,7 +1691,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
1586 const key_equal& __eql, const allocator_type& __a)1691 const key_equal& __eql, const allocator_type& __a)
1587 : __table_(__hf, __eql, typename __table::allocator_type(__a))1692 : __table_(__hf, __eql, typename __table::allocator_type(__a))
1588{1693{
1589#if _LIBCPP_DEBUG_LEVEL >= 21694#if _LIBCPP_DEBUG_LEVEL == 2
1590 __get_db()->__insert_c(this);1695 __get_db()->__insert_c(this);
1591#endif1696#endif
1592 __table_.rehash(__n);1697 __table_.rehash(__n);
...@@ -1633,8 +1738,8 @@ _Tp&...@@ -1633,8 +1738,8 @@ _Tp&
1633unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k)1738unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k)
1634{1739{
1635 return __table_.__emplace_unique_key_args(__k,1740 return __table_.__emplace_unique_key_args(__k,
1636 std::piecewise_construct, std::forward_as_tuple(__k),1741 piecewise_construct, _VSTD::forward_as_tuple(__k),
1637 std::forward_as_tuple()).first->__get_value().second;1742 _VSTD::forward_as_tuple()).first->__get_value().second;
1638}1743}
16391744
1640template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>1745template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
...@@ -1642,8 +1747,8 @@ _Tp&...@@ -1642,8 +1747,8 @@ _Tp&
1642unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&& __k)1747unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&& __k)
1643{1748{
1644 return __table_.__emplace_unique_key_args(__k,1749 return __table_.__emplace_unique_key_args(__k,
1645 std::piecewise_construct, std::forward_as_tuple(std::move(__k)),1750 piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__k)),
1646 std::forward_as_tuple()).first->__get_value().second;1751 _VSTD::forward_as_tuple()).first->__get_value().second;
1647}1752}
1648#else // _LIBCPP_CXX03_LANG1753#else // _LIBCPP_CXX03_LANG
16491754
...@@ -1657,7 +1762,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(const...@@ -1657,7 +1762,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(const
1657 __h.get_deleter().__first_constructed = true;1762 __h.get_deleter().__first_constructed = true;
1658 __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__get_value().second));1763 __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__get_value().second));
1659 __h.get_deleter().__second_constructed = true;1764 __h.get_deleter().__second_constructed = true;
1660 return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++031765 return __h;
1661}1766}
16621767
1663template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>1768template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
...@@ -1762,11 +1867,11 @@ public:...@@ -1762,11 +1867,11 @@ public:
1762 "Invalid allocator::value_type");1867 "Invalid allocator::value_type");
17631868
1764private:1869private:
1765 typedef __hash_value_type<key_type, mapped_type> __value_type;1870 typedef __hash_value_type<key_type, mapped_type> __value_type;
1766 typedef __unordered_map_hasher<key_type, __value_type, hasher> __hasher;1871 typedef __unordered_map_hasher<key_type, __value_type, hasher, key_equal> __hasher;
1767 typedef __unordered_map_equal<key_type, __value_type, key_equal> __key_equal;1872 typedef __unordered_map_equal<key_type, __value_type, key_equal, hasher> __key_equal;
1768 typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>,1873 typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>,
1769 __value_type>::type __allocator_type;1874 __value_type>::type __allocator_type;
17701875
1771 typedef __hash_table<__value_type, __hasher,1876 typedef __hash_table<__value_type, __hasher,
1772 __key_equal, __allocator_type> __table;1877 __key_equal, __allocator_type> __table;
...@@ -1807,7 +1912,7 @@ public:...@@ -1807,7 +1912,7 @@ public:
1807 unordered_multimap()1912 unordered_multimap()
1808 _NOEXCEPT_(is_nothrow_default_constructible<__table>::value)1913 _NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
1809 {1914 {
1810#if _LIBCPP_DEBUG_LEVEL >= 21915#if _LIBCPP_DEBUG_LEVEL == 2
1811 __get_db()->__insert_c(this);1916 __get_db()->__insert_c(this);
1812#endif1917#endif
1813 }1918 }
...@@ -2059,11 +2164,32 @@ public:...@@ -2059,11 +2164,32 @@ public:
2059 iterator find(const key_type& __k) {return __table_.find(__k);}2164 iterator find(const key_type& __k) {return __table_.find(__k);}
2060 _LIBCPP_INLINE_VISIBILITY2165 _LIBCPP_INLINE_VISIBILITY
2061 const_iterator find(const key_type& __k) const {return __table_.find(__k);}2166 const_iterator find(const key_type& __k) const {return __table_.find(__k);}
2167 #if _LIBCPP_STD_VER > 17
2168 template <typename _K2>
2169 _LIBCPP_INLINE_VISIBILITY
2170 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, iterator>
2171 find(const _K2& __k) {return __table_.find(__k);}
2172 template <typename _K2>
2173 _LIBCPP_INLINE_VISIBILITY
2174 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, const_iterator>
2175 find(const _K2& __k) const {return __table_.find(__k);}
2176 #endif // _LIBCPP_STD_VER > 17
2062 _LIBCPP_INLINE_VISIBILITY2177 _LIBCPP_INLINE_VISIBILITY
2063 size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}2178 size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
2179 #if _LIBCPP_STD_VER > 17
2180 template <typename _K2>
2181 _LIBCPP_INLINE_VISIBILITY
2182 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, size_type>
2183 count(const _K2& __k) const {return __table_.__count_multi(__k);}
2184 #endif // _LIBCPP_STD_VER > 17
2064 #if _LIBCPP_STD_VER > 172185 #if _LIBCPP_STD_VER > 17
2065 _LIBCPP_INLINE_VISIBILITY2186 _LIBCPP_INLINE_VISIBILITY
2066 bool contains(const key_type& __k) const {return find(__k) != end();}2187 bool contains(const key_type& __k) const {return find(__k) != end();}
2188
2189 template <typename _K2>
2190 _LIBCPP_INLINE_VISIBILITY
2191 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, bool>
2192 contains(const _K2& __k) const {return find(__k) != end();}
2067 #endif // _LIBCPP_STD_VER > 172193 #endif // _LIBCPP_STD_VER > 17
2068 _LIBCPP_INLINE_VISIBILITY2194 _LIBCPP_INLINE_VISIBILITY
2069 pair<iterator, iterator> equal_range(const key_type& __k)2195 pair<iterator, iterator> equal_range(const key_type& __k)
...@@ -2071,6 +2197,16 @@ public:...@@ -2071,6 +2197,16 @@ public:
2071 _LIBCPP_INLINE_VISIBILITY2197 _LIBCPP_INLINE_VISIBILITY
2072 pair<const_iterator, const_iterator> equal_range(const key_type& __k) const2198 pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
2073 {return __table_.__equal_range_multi(__k);}2199 {return __table_.__equal_range_multi(__k);}
2200 #if _LIBCPP_STD_VER > 17
2201 template <typename _K2>
2202 _LIBCPP_INLINE_VISIBILITY
2203 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<iterator, iterator>>
2204 equal_range(const _K2& __k) {return __table_.__equal_range_multi(__k);}
2205 template <typename _K2>
2206 _LIBCPP_INLINE_VISIBILITY
2207 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<const_iterator, const_iterator>>
2208 equal_range(const _K2& __k) const {return __table_.__equal_range_multi(__k);}
2209 #endif // _LIBCPP_STD_VER > 17
20742210
2075 _LIBCPP_INLINE_VISIBILITY2211 _LIBCPP_INLINE_VISIBILITY
2076 size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}2212 size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
...@@ -2108,7 +2244,7 @@ public:...@@ -2108,7 +2244,7 @@ public:
2108 _LIBCPP_INLINE_VISIBILITY2244 _LIBCPP_INLINE_VISIBILITY
2109 void reserve(size_type __n) {__table_.reserve(__n);}2245 void reserve(size_type __n) {__table_.reserve(__n);}
21102246
2111#if _LIBCPP_DEBUG_LEVEL >= 22247#if _LIBCPP_DEBUG_LEVEL == 2
21122248
2113 bool __dereferenceable(const const_iterator* __i) const2249 bool __dereferenceable(const const_iterator* __i) const
2114 {return __table_.__dereferenceable(&__i->__i_);}2250 {return __table_.__dereferenceable(&__i->__i_);}
...@@ -2119,7 +2255,7 @@ public:...@@ -2119,7 +2255,7 @@ public:
2119 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const2255 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
2120 {return __table_.__addable(&__i->__i_, __n);}2256 {return __table_.__addable(&__i->__i_, __n);}
21212257
2122#endif // _LIBCPP_DEBUG_LEVEL >= 22258#endif // _LIBCPP_DEBUG_LEVEL == 2
21232259
21242260
2125};2261};
...@@ -2196,7 +2332,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(...@@ -2196,7 +2332,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2196 size_type __n, const hasher& __hf, const key_equal& __eql)2332 size_type __n, const hasher& __hf, const key_equal& __eql)
2197 : __table_(__hf, __eql)2333 : __table_(__hf, __eql)
2198{2334{
2199#if _LIBCPP_DEBUG_LEVEL >= 22335#if _LIBCPP_DEBUG_LEVEL == 2
2200 __get_db()->__insert_c(this);2336 __get_db()->__insert_c(this);
2201#endif2337#endif
2202 __table_.rehash(__n);2338 __table_.rehash(__n);
...@@ -2208,7 +2344,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(...@@ -2208,7 +2344,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2208 const allocator_type& __a)2344 const allocator_type& __a)
2209 : __table_(__hf, __eql, typename __table::allocator_type(__a))2345 : __table_(__hf, __eql, typename __table::allocator_type(__a))
2210{2346{
2211#if _LIBCPP_DEBUG_LEVEL >= 22347#if _LIBCPP_DEBUG_LEVEL == 2
2212 __get_db()->__insert_c(this);2348 __get_db()->__insert_c(this);
2213#endif2349#endif
2214 __table_.rehash(__n);2350 __table_.rehash(__n);
...@@ -2219,7 +2355,7 @@ template <class _InputIterator>...@@ -2219,7 +2355,7 @@ template <class _InputIterator>
2219unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(2355unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2220 _InputIterator __first, _InputIterator __last)2356 _InputIterator __first, _InputIterator __last)
2221{2357{
2222#if _LIBCPP_DEBUG_LEVEL >= 22358#if _LIBCPP_DEBUG_LEVEL == 2
2223 __get_db()->__insert_c(this);2359 __get_db()->__insert_c(this);
2224#endif2360#endif
2225 insert(__first, __last);2361 insert(__first, __last);
...@@ -2232,7 +2368,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(...@@ -2232,7 +2368,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2232 const hasher& __hf, const key_equal& __eql)2368 const hasher& __hf, const key_equal& __eql)
2233 : __table_(__hf, __eql)2369 : __table_(__hf, __eql)
2234{2370{
2235#if _LIBCPP_DEBUG_LEVEL >= 22371#if _LIBCPP_DEBUG_LEVEL == 2
2236 __get_db()->__insert_c(this);2372 __get_db()->__insert_c(this);
2237#endif2373#endif
2238 __table_.rehash(__n);2374 __table_.rehash(__n);
...@@ -2246,7 +2382,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(...@@ -2246,7 +2382,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2246 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)2382 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
2247 : __table_(__hf, __eql, typename __table::allocator_type(__a))2383 : __table_(__hf, __eql, typename __table::allocator_type(__a))
2248{2384{
2249#if _LIBCPP_DEBUG_LEVEL >= 22385#if _LIBCPP_DEBUG_LEVEL == 2
2250 __get_db()->__insert_c(this);2386 __get_db()->__insert_c(this);
2251#endif2387#endif
2252 __table_.rehash(__n);2388 __table_.rehash(__n);
...@@ -2259,7 +2395,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(...@@ -2259,7 +2395,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2259 const allocator_type& __a)2395 const allocator_type& __a)
2260 : __table_(typename __table::allocator_type(__a))2396 : __table_(typename __table::allocator_type(__a))
2261{2397{
2262#if _LIBCPP_DEBUG_LEVEL >= 22398#if _LIBCPP_DEBUG_LEVEL == 2
2263 __get_db()->__insert_c(this);2399 __get_db()->__insert_c(this);
2264#endif2400#endif
2265}2401}
...@@ -2269,7 +2405,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(...@@ -2269,7 +2405,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2269 const unordered_multimap& __u)2405 const unordered_multimap& __u)
2270 : __table_(__u.__table_)2406 : __table_(__u.__table_)
2271{2407{
2272#if _LIBCPP_DEBUG_LEVEL >= 22408#if _LIBCPP_DEBUG_LEVEL == 2
2273 __get_db()->__insert_c(this);2409 __get_db()->__insert_c(this);
2274#endif2410#endif
2275 __table_.rehash(__u.bucket_count());2411 __table_.rehash(__u.bucket_count());
...@@ -2281,7 +2417,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(...@@ -2281,7 +2417,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2281 const unordered_multimap& __u, const allocator_type& __a)2417 const unordered_multimap& __u, const allocator_type& __a)
2282 : __table_(__u.__table_, typename __table::allocator_type(__a))2418 : __table_(__u.__table_, typename __table::allocator_type(__a))
2283{2419{
2284#if _LIBCPP_DEBUG_LEVEL >= 22420#if _LIBCPP_DEBUG_LEVEL == 2
2285 __get_db()->__insert_c(this);2421 __get_db()->__insert_c(this);
2286#endif2422#endif
2287 __table_.rehash(__u.bucket_count());2423 __table_.rehash(__u.bucket_count());
...@@ -2297,7 +2433,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(...@@ -2297,7 +2433,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2297 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)2433 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
2298 : __table_(_VSTD::move(__u.__table_))2434 : __table_(_VSTD::move(__u.__table_))
2299{2435{
2300#if _LIBCPP_DEBUG_LEVEL >= 22436#if _LIBCPP_DEBUG_LEVEL == 2
2301 __get_db()->__insert_c(this);2437 __get_db()->__insert_c(this);
2302 __get_db()->swap(this, &__u);2438 __get_db()->swap(this, &__u);
2303#endif2439#endif
...@@ -2308,7 +2444,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(...@@ -2308,7 +2444,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2308 unordered_multimap&& __u, const allocator_type& __a)2444 unordered_multimap&& __u, const allocator_type& __a)
2309 : __table_(_VSTD::move(__u.__table_), typename __table::allocator_type(__a))2445 : __table_(_VSTD::move(__u.__table_), typename __table::allocator_type(__a))
2310{2446{
2311#if _LIBCPP_DEBUG_LEVEL >= 22447#if _LIBCPP_DEBUG_LEVEL == 2
2312 __get_db()->__insert_c(this);2448 __get_db()->__insert_c(this);
2313#endif2449#endif
2314 if (__a != __u.get_allocator())2450 if (__a != __u.get_allocator())
...@@ -2320,7 +2456,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(...@@ -2320,7 +2456,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2320 __u.__table_.remove((__i++).__i_)->__value_.__move());2456 __u.__table_.remove((__i++).__i_)->__value_.__move());
2321 }2457 }
2322 }2458 }
2323#if _LIBCPP_DEBUG_LEVEL >= 22459#if _LIBCPP_DEBUG_LEVEL == 2
2324 else2460 else
2325 __get_db()->swap(this, &__u);2461 __get_db()->swap(this, &__u);
2326#endif2462#endif
...@@ -2330,7 +2466,7 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>...@@ -2330,7 +2466,7 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
2330unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(2466unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2331 initializer_list<value_type> __il)2467 initializer_list<value_type> __il)
2332{2468{
2333#if _LIBCPP_DEBUG_LEVEL >= 22469#if _LIBCPP_DEBUG_LEVEL == 2
2334 __get_db()->__insert_c(this);2470 __get_db()->__insert_c(this);
2335#endif2471#endif
2336 insert(__il.begin(), __il.end());2472 insert(__il.begin(), __il.end());
...@@ -2342,7 +2478,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(...@@ -2342,7 +2478,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2342 const key_equal& __eql)2478 const key_equal& __eql)
2343 : __table_(__hf, __eql)2479 : __table_(__hf, __eql)
2344{2480{
2345#if _LIBCPP_DEBUG_LEVEL >= 22481#if _LIBCPP_DEBUG_LEVEL == 2
2346 __get_db()->__insert_c(this);2482 __get_db()->__insert_c(this);
2347#endif2483#endif
2348 __table_.rehash(__n);2484 __table_.rehash(__n);
...@@ -2355,7 +2491,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(...@@ -2355,7 +2491,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
2355 const key_equal& __eql, const allocator_type& __a)2491 const key_equal& __eql, const allocator_type& __a)
2356 : __table_(__hf, __eql, typename __table::allocator_type(__a))2492 : __table_(__hf, __eql, typename __table::allocator_type(__a))
2357{2493{
2358#if _LIBCPP_DEBUG_LEVEL >= 22494#if _LIBCPP_DEBUG_LEVEL == 2
2359 __get_db()->__insert_c(this);2495 __get_db()->__insert_c(this);
2360#endif2496#endif
2361 __table_.rehash(__n);2497 __table_.rehash(__n);
lib/libcxx/include/unordered_set+123-37
...@@ -145,10 +145,22 @@ public:...@@ -145,10 +145,22 @@ public:
145145
146 iterator find(const key_type& k);146 iterator find(const key_type& k);
147 const_iterator find(const key_type& k) const;147 const_iterator find(const key_type& k) const;
148 template<typename K>
149 iterator find(const K& x); // C++20
150 template<typename K>
151 const_iterator find(const K& x) const; // C++20
148 size_type count(const key_type& k) const;152 size_type count(const key_type& k) const;
153 template<typename K>
154 size_type count(const K& k) const; // C++20
149 bool contains(const key_type& k) const; // C++20155 bool contains(const key_type& k) const; // C++20
156 template<typename K>
157 bool contains(const K& k) const; // C++20
150 pair<iterator, iterator> equal_range(const key_type& k);158 pair<iterator, iterator> equal_range(const key_type& k);
151 pair<const_iterator, const_iterator> equal_range(const key_type& k) const;159 pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
160 template<typename K>
161 pair<iterator, iterator> equal_range(const K& k); // C++20
162 template<typename K>
163 pair<const_iterator, const_iterator> equal_range(const K& k) const; // C++20
152164
153 size_type bucket_count() const noexcept;165 size_type bucket_count() const noexcept;
154 size_type max_bucket_count() const noexcept;166 size_type max_bucket_count() const noexcept;
...@@ -310,10 +322,22 @@ public:...@@ -310,10 +322,22 @@ public:
310322
311 iterator find(const key_type& k);323 iterator find(const key_type& k);
312 const_iterator find(const key_type& k) const;324 const_iterator find(const key_type& k) const;
325 template<typename K>
326 iterator find(const K& x); // C++20
327 template<typename K>
328 const_iterator find(const K& x) const; // C++20
313 size_type count(const key_type& k) const;329 size_type count(const key_type& k) const;
330 template<typename K>
331 size_type count(const K& k) const; // C++20
314 bool contains(const key_type& k) const; // C++20332 bool contains(const key_type& k) const; // C++20
333 template<typename K>
334 bool contains(const K& k) const; // C++20
315 pair<iterator, iterator> equal_range(const key_type& k);335 pair<iterator, iterator> equal_range(const key_type& k);
316 pair<const_iterator, const_iterator> equal_range(const key_type& k) const;336 pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
337 template<typename K>
338 pair<iterator, iterator> equal_range(const K& k); // C++20
339 template<typename K>
340 pair<const_iterator, const_iterator> equal_range(const K& k) const; // C++20
317341
318 size_type bucket_count() const noexcept;342 size_type bucket_count() const noexcept;
319 size_type max_bucket_count() const noexcept;343 size_type max_bucket_count() const noexcept;
...@@ -425,7 +449,7 @@ public:...@@ -425,7 +449,7 @@ public:
425 unordered_set()449 unordered_set()
426 _NOEXCEPT_(is_nothrow_default_constructible<__table>::value)450 _NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
427 {451 {
428#if _LIBCPP_DEBUG_LEVEL >= 2452#if _LIBCPP_DEBUG_LEVEL == 2
429 __get_db()->__insert_c(this);453 __get_db()->__insert_c(this);
430#endif454#endif
431 }455 }
...@@ -539,7 +563,7 @@ public:...@@ -539,7 +563,7 @@ public:
539 {return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...);}563 {return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...);}
540 template <class... _Args>564 template <class... _Args>
541 _LIBCPP_INLINE_VISIBILITY565 _LIBCPP_INLINE_VISIBILITY
542#if _LIBCPP_DEBUG_LEVEL >= 2566#if _LIBCPP_DEBUG_LEVEL == 2
543 iterator emplace_hint(const_iterator __p, _Args&&... __args)567 iterator emplace_hint(const_iterator __p, _Args&&... __args)
544 {568 {
545 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,569 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
...@@ -556,7 +580,7 @@ public:...@@ -556,7 +580,7 @@ public:
556 pair<iterator, bool> insert(value_type&& __x)580 pair<iterator, bool> insert(value_type&& __x)
557 {return __table_.__insert_unique(_VSTD::move(__x));}581 {return __table_.__insert_unique(_VSTD::move(__x));}
558 _LIBCPP_INLINE_VISIBILITY582 _LIBCPP_INLINE_VISIBILITY
559#if _LIBCPP_DEBUG_LEVEL >= 2583#if _LIBCPP_DEBUG_LEVEL == 2
560 iterator insert(const_iterator __p, value_type&& __x)584 iterator insert(const_iterator __p, value_type&& __x)
561 {585 {
562 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,586 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
...@@ -577,7 +601,7 @@ public:...@@ -577,7 +601,7 @@ public:
577 {return __table_.__insert_unique(__x);}601 {return __table_.__insert_unique(__x);}
578602
579 _LIBCPP_INLINE_VISIBILITY603 _LIBCPP_INLINE_VISIBILITY
580#if _LIBCPP_DEBUG_LEVEL >= 2604#if _LIBCPP_DEBUG_LEVEL == 2
581 iterator insert(const_iterator __p, const value_type& __x)605 iterator insert(const_iterator __p, const value_type& __x)
582 {606 {
583 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,607 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
...@@ -679,11 +703,32 @@ public:...@@ -679,11 +703,32 @@ public:
679 iterator find(const key_type& __k) {return __table_.find(__k);}703 iterator find(const key_type& __k) {return __table_.find(__k);}
680 _LIBCPP_INLINE_VISIBILITY704 _LIBCPP_INLINE_VISIBILITY
681 const_iterator find(const key_type& __k) const {return __table_.find(__k);}705 const_iterator find(const key_type& __k) const {return __table_.find(__k);}
706 #if _LIBCPP_STD_VER > 17
707 template <typename _K2>
708 _LIBCPP_INLINE_VISIBILITY
709 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, iterator>
710 find(const _K2& __k) {return __table_.find(__k);}
711 template <typename _K2>
712 _LIBCPP_INLINE_VISIBILITY
713 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, const_iterator>
714 find(const _K2& __k) const {return __table_.find(__k);}
715 #endif // _LIBCPP_STD_VER > 17
682 _LIBCPP_INLINE_VISIBILITY716 _LIBCPP_INLINE_VISIBILITY
683 size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}717 size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
718 #if _LIBCPP_STD_VER > 17
719 template <typename _K2>
720 _LIBCPP_INLINE_VISIBILITY
721 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, size_type>
722 count(const _K2& __k) const {return __table_.__count_unique(__k);}
723 #endif // _LIBCPP_STD_VER > 17
684 #if _LIBCPP_STD_VER > 17724 #if _LIBCPP_STD_VER > 17
685 _LIBCPP_INLINE_VISIBILITY725 _LIBCPP_INLINE_VISIBILITY
686 bool contains(const key_type& __k) const {return find(__k) != end();}726 bool contains(const key_type& __k) const {return find(__k) != end();}
727
728 template <typename _K2>
729 _LIBCPP_INLINE_VISIBILITY
730 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, bool>
731 contains(const _K2& __k) const {return find(__k) != end();}
687 #endif // _LIBCPP_STD_VER > 17732 #endif // _LIBCPP_STD_VER > 17
688 _LIBCPP_INLINE_VISIBILITY733 _LIBCPP_INLINE_VISIBILITY
689 pair<iterator, iterator> equal_range(const key_type& __k)734 pair<iterator, iterator> equal_range(const key_type& __k)
...@@ -691,6 +736,16 @@ public:...@@ -691,6 +736,16 @@ public:
691 _LIBCPP_INLINE_VISIBILITY736 _LIBCPP_INLINE_VISIBILITY
692 pair<const_iterator, const_iterator> equal_range(const key_type& __k) const737 pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
693 {return __table_.__equal_range_unique(__k);}738 {return __table_.__equal_range_unique(__k);}
739 #if _LIBCPP_STD_VER > 17
740 template <typename _K2>
741 _LIBCPP_INLINE_VISIBILITY
742 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<iterator, iterator>>
743 equal_range(const _K2& __k) {return __table_.__equal_range_unique(__k);}
744 template <typename _K2>
745 _LIBCPP_INLINE_VISIBILITY
746 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<const_iterator, const_iterator>>
747 equal_range(const _K2& __k) const {return __table_.__equal_range_unique(__k);}
748 #endif // _LIBCPP_STD_VER > 17
694749
695 _LIBCPP_INLINE_VISIBILITY750 _LIBCPP_INLINE_VISIBILITY
696 size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}751 size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
...@@ -726,7 +781,7 @@ public:...@@ -726,7 +781,7 @@ public:
726 _LIBCPP_INLINE_VISIBILITY781 _LIBCPP_INLINE_VISIBILITY
727 void reserve(size_type __n) {__table_.reserve(__n);}782 void reserve(size_type __n) {__table_.reserve(__n);}
728783
729#if _LIBCPP_DEBUG_LEVEL >= 2784#if _LIBCPP_DEBUG_LEVEL == 2
730785
731 bool __dereferenceable(const const_iterator* __i) const786 bool __dereferenceable(const const_iterator* __i) const
732 {return __table_.__dereferenceable(__i);}787 {return __table_.__dereferenceable(__i);}
...@@ -737,7 +792,7 @@ public:...@@ -737,7 +792,7 @@ public:
737 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const792 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
738 {return __table_.__addable(__i, __n);}793 {return __table_.__addable(__i, __n);}
739794
740#endif // _LIBCPP_DEBUG_LEVEL >= 2795#endif // _LIBCPP_DEBUG_LEVEL == 2
741796
742};797};
743798
...@@ -802,7 +857,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(size_type __n,...@@ -802,7 +857,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(size_type __n,
802 const hasher& __hf, const key_equal& __eql)857 const hasher& __hf, const key_equal& __eql)
803 : __table_(__hf, __eql)858 : __table_(__hf, __eql)
804{859{
805#if _LIBCPP_DEBUG_LEVEL >= 2860#if _LIBCPP_DEBUG_LEVEL == 2
806 __get_db()->__insert_c(this);861 __get_db()->__insert_c(this);
807#endif862#endif
808 __table_.rehash(__n);863 __table_.rehash(__n);
...@@ -813,7 +868,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(size_type __n,...@@ -813,7 +868,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(size_type __n,
813 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)868 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
814 : __table_(__hf, __eql, __a)869 : __table_(__hf, __eql, __a)
815{870{
816#if _LIBCPP_DEBUG_LEVEL >= 2871#if _LIBCPP_DEBUG_LEVEL == 2
817 __get_db()->__insert_c(this);872 __get_db()->__insert_c(this);
818#endif873#endif
819 __table_.rehash(__n);874 __table_.rehash(__n);
...@@ -824,7 +879,7 @@ template <class _InputIterator>...@@ -824,7 +879,7 @@ template <class _InputIterator>
824unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(879unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
825 _InputIterator __first, _InputIterator __last)880 _InputIterator __first, _InputIterator __last)
826{881{
827#if _LIBCPP_DEBUG_LEVEL >= 2882#if _LIBCPP_DEBUG_LEVEL == 2
828 __get_db()->__insert_c(this);883 __get_db()->__insert_c(this);
829#endif884#endif
830 insert(__first, __last);885 insert(__first, __last);
...@@ -837,7 +892,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(...@@ -837,7 +892,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
837 const hasher& __hf, const key_equal& __eql)892 const hasher& __hf, const key_equal& __eql)
838 : __table_(__hf, __eql)893 : __table_(__hf, __eql)
839{894{
840#if _LIBCPP_DEBUG_LEVEL >= 2895#if _LIBCPP_DEBUG_LEVEL == 2
841 __get_db()->__insert_c(this);896 __get_db()->__insert_c(this);
842#endif897#endif
843 __table_.rehash(__n);898 __table_.rehash(__n);
...@@ -851,7 +906,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(...@@ -851,7 +906,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
851 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)906 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
852 : __table_(__hf, __eql, __a)907 : __table_(__hf, __eql, __a)
853{908{
854#if _LIBCPP_DEBUG_LEVEL >= 2909#if _LIBCPP_DEBUG_LEVEL == 2
855 __get_db()->__insert_c(this);910 __get_db()->__insert_c(this);
856#endif911#endif
857 __table_.rehash(__n);912 __table_.rehash(__n);
...@@ -864,7 +919,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(...@@ -864,7 +919,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
864 const allocator_type& __a)919 const allocator_type& __a)
865 : __table_(__a)920 : __table_(__a)
866{921{
867#if _LIBCPP_DEBUG_LEVEL >= 2922#if _LIBCPP_DEBUG_LEVEL == 2
868 __get_db()->__insert_c(this);923 __get_db()->__insert_c(this);
869#endif924#endif
870}925}
...@@ -874,7 +929,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(...@@ -874,7 +929,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
874 const unordered_set& __u)929 const unordered_set& __u)
875 : __table_(__u.__table_)930 : __table_(__u.__table_)
876{931{
877#if _LIBCPP_DEBUG_LEVEL >= 2932#if _LIBCPP_DEBUG_LEVEL == 2
878 __get_db()->__insert_c(this);933 __get_db()->__insert_c(this);
879#endif934#endif
880 __table_.rehash(__u.bucket_count());935 __table_.rehash(__u.bucket_count());
...@@ -886,7 +941,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(...@@ -886,7 +941,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
886 const unordered_set& __u, const allocator_type& __a)941 const unordered_set& __u, const allocator_type& __a)
887 : __table_(__u.__table_, __a)942 : __table_(__u.__table_, __a)
888{943{
889#if _LIBCPP_DEBUG_LEVEL >= 2944#if _LIBCPP_DEBUG_LEVEL == 2
890 __get_db()->__insert_c(this);945 __get_db()->__insert_c(this);
891#endif946#endif
892 __table_.rehash(__u.bucket_count());947 __table_.rehash(__u.bucket_count());
...@@ -902,7 +957,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(...@@ -902,7 +957,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
902 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)957 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
903 : __table_(_VSTD::move(__u.__table_))958 : __table_(_VSTD::move(__u.__table_))
904{959{
905#if _LIBCPP_DEBUG_LEVEL >= 2960#if _LIBCPP_DEBUG_LEVEL == 2
906 __get_db()->__insert_c(this);961 __get_db()->__insert_c(this);
907 __get_db()->swap(this, &__u);962 __get_db()->swap(this, &__u);
908#endif963#endif
...@@ -913,7 +968,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(...@@ -913,7 +968,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
913 unordered_set&& __u, const allocator_type& __a)968 unordered_set&& __u, const allocator_type& __a)
914 : __table_(_VSTD::move(__u.__table_), __a)969 : __table_(_VSTD::move(__u.__table_), __a)
915{970{
916#if _LIBCPP_DEBUG_LEVEL >= 2971#if _LIBCPP_DEBUG_LEVEL == 2
917 __get_db()->__insert_c(this);972 __get_db()->__insert_c(this);
918#endif973#endif
919 if (__a != __u.get_allocator())974 if (__a != __u.get_allocator())
...@@ -922,7 +977,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(...@@ -922,7 +977,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
922 while (__u.size() != 0)977 while (__u.size() != 0)
923 __table_.__insert_unique(_VSTD::move(__u.__table_.remove(__i++)->__value_));978 __table_.__insert_unique(_VSTD::move(__u.__table_.remove(__i++)->__value_));
924 }979 }
925#if _LIBCPP_DEBUG_LEVEL >= 2980#if _LIBCPP_DEBUG_LEVEL == 2
926 else981 else
927 __get_db()->swap(this, &__u);982 __get_db()->swap(this, &__u);
928#endif983#endif
...@@ -932,7 +987,7 @@ template <class _Value, class _Hash, class _Pred, class _Alloc>...@@ -932,7 +987,7 @@ template <class _Value, class _Hash, class _Pred, class _Alloc>
932unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(987unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
933 initializer_list<value_type> __il)988 initializer_list<value_type> __il)
934{989{
935#if _LIBCPP_DEBUG_LEVEL >= 2990#if _LIBCPP_DEBUG_LEVEL == 2
936 __get_db()->__insert_c(this);991 __get_db()->__insert_c(this);
937#endif992#endif
938 insert(__il.begin(), __il.end());993 insert(__il.begin(), __il.end());
...@@ -944,7 +999,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(...@@ -944,7 +999,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
944 const key_equal& __eql)999 const key_equal& __eql)
945 : __table_(__hf, __eql)1000 : __table_(__hf, __eql)
946{1001{
947#if _LIBCPP_DEBUG_LEVEL >= 21002#if _LIBCPP_DEBUG_LEVEL == 2
948 __get_db()->__insert_c(this);1003 __get_db()->__insert_c(this);
949#endif1004#endif
950 __table_.rehash(__n);1005 __table_.rehash(__n);
...@@ -957,7 +1012,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(...@@ -957,7 +1012,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
957 const key_equal& __eql, const allocator_type& __a)1012 const key_equal& __eql, const allocator_type& __a)
958 : __table_(__hf, __eql, __a)1013 : __table_(__hf, __eql, __a)
959{1014{
960#if _LIBCPP_DEBUG_LEVEL >= 21015#if _LIBCPP_DEBUG_LEVEL == 2
961 __get_db()->__insert_c(this);1016 __get_db()->__insert_c(this);
962#endif1017#endif
963 __table_.rehash(__n);1018 __table_.rehash(__n);
...@@ -1091,7 +1146,7 @@ public:...@@ -1091,7 +1146,7 @@ public:
1091 unordered_multiset()1146 unordered_multiset()
1092 _NOEXCEPT_(is_nothrow_default_constructible<__table>::value)1147 _NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
1093 {1148 {
1094#if _LIBCPP_DEBUG_LEVEL >= 21149#if _LIBCPP_DEBUG_LEVEL == 2
1095 __get_db()->__insert_c(this);1150 __get_db()->__insert_c(this);
1096#endif1151#endif
1097 }1152 }
...@@ -1314,11 +1369,32 @@ public:...@@ -1314,11 +1369,32 @@ public:
1314 iterator find(const key_type& __k) {return __table_.find(__k);}1369 iterator find(const key_type& __k) {return __table_.find(__k);}
1315 _LIBCPP_INLINE_VISIBILITY1370 _LIBCPP_INLINE_VISIBILITY
1316 const_iterator find(const key_type& __k) const {return __table_.find(__k);}1371 const_iterator find(const key_type& __k) const {return __table_.find(__k);}
1372 #if _LIBCPP_STD_VER > 17
1373 template <typename _K2>
1374 _LIBCPP_INLINE_VISIBILITY
1375 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, iterator>
1376 find(const _K2& __k) {return __table_.find(__k);}
1377 template <typename _K2>
1378 _LIBCPP_INLINE_VISIBILITY
1379 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, const_iterator>
1380 find(const _K2& __k) const {return __table_.find(__k);}
1381 #endif // _LIBCPP_STD_VER > 17
1317 _LIBCPP_INLINE_VISIBILITY1382 _LIBCPP_INLINE_VISIBILITY
1318 size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}1383 size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
1384 #if _LIBCPP_STD_VER > 17
1385 template <typename _K2>
1386 _LIBCPP_INLINE_VISIBILITY
1387 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, size_type>
1388 count(const _K2& __k) const {return __table_.__count_multi(__k);}
1389 #endif // _LIBCPP_STD_VER > 17
1319 #if _LIBCPP_STD_VER > 171390 #if _LIBCPP_STD_VER > 17
1320 _LIBCPP_INLINE_VISIBILITY1391 _LIBCPP_INLINE_VISIBILITY
1321 bool contains(const key_type& __k) const {return find(__k) != end();}1392 bool contains(const key_type& __k) const {return find(__k) != end();}
1393
1394 template <typename _K2>
1395 _LIBCPP_INLINE_VISIBILITY
1396 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, bool>
1397 contains(const _K2& __k) const {return find(__k) != end();}
1322 #endif // _LIBCPP_STD_VER > 171398 #endif // _LIBCPP_STD_VER > 17
1323 _LIBCPP_INLINE_VISIBILITY1399 _LIBCPP_INLINE_VISIBILITY
1324 pair<iterator, iterator> equal_range(const key_type& __k)1400 pair<iterator, iterator> equal_range(const key_type& __k)
...@@ -1326,6 +1402,16 @@ public:...@@ -1326,6 +1402,16 @@ public:
1326 _LIBCPP_INLINE_VISIBILITY1402 _LIBCPP_INLINE_VISIBILITY
1327 pair<const_iterator, const_iterator> equal_range(const key_type& __k) const1403 pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
1328 {return __table_.__equal_range_multi(__k);}1404 {return __table_.__equal_range_multi(__k);}
1405 #if _LIBCPP_STD_VER > 17
1406 template <typename _K2>
1407 _LIBCPP_INLINE_VISIBILITY
1408 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<iterator, iterator>>
1409 equal_range(const _K2& __k) {return __table_.__equal_range_multi(__k);}
1410 template <typename _K2>
1411 _LIBCPP_INLINE_VISIBILITY
1412 _EnableIf<__is_transparent<hasher, _K2>::value && __is_transparent<key_equal, _K2>::value, pair<const_iterator, const_iterator>>
1413 equal_range(const _K2& __k) const {return __table_.__equal_range_multi(__k);}
1414 #endif // _LIBCPP_STD_VER > 17
13291415
1330 _LIBCPP_INLINE_VISIBILITY1416 _LIBCPP_INLINE_VISIBILITY
1331 size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}1417 size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
...@@ -1361,7 +1447,7 @@ public:...@@ -1361,7 +1447,7 @@ public:
1361 _LIBCPP_INLINE_VISIBILITY1447 _LIBCPP_INLINE_VISIBILITY
1362 void reserve(size_type __n) {__table_.reserve(__n);}1448 void reserve(size_type __n) {__table_.reserve(__n);}
13631449
1364#if _LIBCPP_DEBUG_LEVEL >= 21450#if _LIBCPP_DEBUG_LEVEL == 2
13651451
1366 bool __dereferenceable(const const_iterator* __i) const1452 bool __dereferenceable(const const_iterator* __i) const
1367 {return __table_.__dereferenceable(__i);}1453 {return __table_.__dereferenceable(__i);}
...@@ -1372,7 +1458,7 @@ public:...@@ -1372,7 +1458,7 @@ public:
1372 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const1458 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
1373 {return __table_.__addable(__i, __n);}1459 {return __table_.__addable(__i, __n);}
13741460
1375#endif // _LIBCPP_DEBUG_LEVEL >= 21461#endif // _LIBCPP_DEBUG_LEVEL == 2
13761462
1377};1463};
13781464
...@@ -1435,7 +1521,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(...@@ -1435,7 +1521,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1435 size_type __n, const hasher& __hf, const key_equal& __eql)1521 size_type __n, const hasher& __hf, const key_equal& __eql)
1436 : __table_(__hf, __eql)1522 : __table_(__hf, __eql)
1437{1523{
1438#if _LIBCPP_DEBUG_LEVEL >= 21524#if _LIBCPP_DEBUG_LEVEL == 2
1439 __get_db()->__insert_c(this);1525 __get_db()->__insert_c(this);
1440#endif1526#endif
1441 __table_.rehash(__n);1527 __table_.rehash(__n);
...@@ -1447,7 +1533,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(...@@ -1447,7 +1533,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1447 const allocator_type& __a)1533 const allocator_type& __a)
1448 : __table_(__hf, __eql, __a)1534 : __table_(__hf, __eql, __a)
1449{1535{
1450#if _LIBCPP_DEBUG_LEVEL >= 21536#if _LIBCPP_DEBUG_LEVEL == 2
1451 __get_db()->__insert_c(this);1537 __get_db()->__insert_c(this);
1452#endif1538#endif
1453 __table_.rehash(__n);1539 __table_.rehash(__n);
...@@ -1458,7 +1544,7 @@ template <class _InputIterator>...@@ -1458,7 +1544,7 @@ template <class _InputIterator>
1458unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(1544unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1459 _InputIterator __first, _InputIterator __last)1545 _InputIterator __first, _InputIterator __last)
1460{1546{
1461#if _LIBCPP_DEBUG_LEVEL >= 21547#if _LIBCPP_DEBUG_LEVEL == 2
1462 __get_db()->__insert_c(this);1548 __get_db()->__insert_c(this);
1463#endif1549#endif
1464 insert(__first, __last);1550 insert(__first, __last);
...@@ -1471,7 +1557,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(...@@ -1471,7 +1557,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1471 const hasher& __hf, const key_equal& __eql)1557 const hasher& __hf, const key_equal& __eql)
1472 : __table_(__hf, __eql)1558 : __table_(__hf, __eql)
1473{1559{
1474#if _LIBCPP_DEBUG_LEVEL >= 21560#if _LIBCPP_DEBUG_LEVEL == 2
1475 __get_db()->__insert_c(this);1561 __get_db()->__insert_c(this);
1476#endif1562#endif
1477 __table_.rehash(__n);1563 __table_.rehash(__n);
...@@ -1485,7 +1571,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(...@@ -1485,7 +1571,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1485 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)1571 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
1486 : __table_(__hf, __eql, __a)1572 : __table_(__hf, __eql, __a)
1487{1573{
1488#if _LIBCPP_DEBUG_LEVEL >= 21574#if _LIBCPP_DEBUG_LEVEL == 2
1489 __get_db()->__insert_c(this);1575 __get_db()->__insert_c(this);
1490#endif1576#endif
1491 __table_.rehash(__n);1577 __table_.rehash(__n);
...@@ -1498,7 +1584,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(...@@ -1498,7 +1584,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1498 const allocator_type& __a)1584 const allocator_type& __a)
1499 : __table_(__a)1585 : __table_(__a)
1500{1586{
1501#if _LIBCPP_DEBUG_LEVEL >= 21587#if _LIBCPP_DEBUG_LEVEL == 2
1502 __get_db()->__insert_c(this);1588 __get_db()->__insert_c(this);
1503#endif1589#endif
1504}1590}
...@@ -1508,7 +1594,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(...@@ -1508,7 +1594,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1508 const unordered_multiset& __u)1594 const unordered_multiset& __u)
1509 : __table_(__u.__table_)1595 : __table_(__u.__table_)
1510{1596{
1511#if _LIBCPP_DEBUG_LEVEL >= 21597#if _LIBCPP_DEBUG_LEVEL == 2
1512 __get_db()->__insert_c(this);1598 __get_db()->__insert_c(this);
1513#endif1599#endif
1514 __table_.rehash(__u.bucket_count());1600 __table_.rehash(__u.bucket_count());
...@@ -1520,7 +1606,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(...@@ -1520,7 +1606,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1520 const unordered_multiset& __u, const allocator_type& __a)1606 const unordered_multiset& __u, const allocator_type& __a)
1521 : __table_(__u.__table_, __a)1607 : __table_(__u.__table_, __a)
1522{1608{
1523#if _LIBCPP_DEBUG_LEVEL >= 21609#if _LIBCPP_DEBUG_LEVEL == 2
1524 __get_db()->__insert_c(this);1610 __get_db()->__insert_c(this);
1525#endif1611#endif
1526 __table_.rehash(__u.bucket_count());1612 __table_.rehash(__u.bucket_count());
...@@ -1536,7 +1622,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(...@@ -1536,7 +1622,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1536 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)1622 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
1537 : __table_(_VSTD::move(__u.__table_))1623 : __table_(_VSTD::move(__u.__table_))
1538{1624{
1539#if _LIBCPP_DEBUG_LEVEL >= 21625#if _LIBCPP_DEBUG_LEVEL == 2
1540 __get_db()->__insert_c(this);1626 __get_db()->__insert_c(this);
1541 __get_db()->swap(this, &__u);1627 __get_db()->swap(this, &__u);
1542#endif1628#endif
...@@ -1547,7 +1633,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(...@@ -1547,7 +1633,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1547 unordered_multiset&& __u, const allocator_type& __a)1633 unordered_multiset&& __u, const allocator_type& __a)
1548 : __table_(_VSTD::move(__u.__table_), __a)1634 : __table_(_VSTD::move(__u.__table_), __a)
1549{1635{
1550#if _LIBCPP_DEBUG_LEVEL >= 21636#if _LIBCPP_DEBUG_LEVEL == 2
1551 __get_db()->__insert_c(this);1637 __get_db()->__insert_c(this);
1552#endif1638#endif
1553 if (__a != __u.get_allocator())1639 if (__a != __u.get_allocator())
...@@ -1556,7 +1642,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(...@@ -1556,7 +1642,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1556 while (__u.size() != 0)1642 while (__u.size() != 0)
1557 __table_.__insert_multi(_VSTD::move(__u.__table_.remove(__i++)->__value_));1643 __table_.__insert_multi(_VSTD::move(__u.__table_.remove(__i++)->__value_));
1558 }1644 }
1559#if _LIBCPP_DEBUG_LEVEL >= 21645#if _LIBCPP_DEBUG_LEVEL == 2
1560 else1646 else
1561 __get_db()->swap(this, &__u);1647 __get_db()->swap(this, &__u);
1562#endif1648#endif
...@@ -1566,7 +1652,7 @@ template <class _Value, class _Hash, class _Pred, class _Alloc>...@@ -1566,7 +1652,7 @@ template <class _Value, class _Hash, class _Pred, class _Alloc>
1566unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(1652unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1567 initializer_list<value_type> __il)1653 initializer_list<value_type> __il)
1568{1654{
1569#if _LIBCPP_DEBUG_LEVEL >= 21655#if _LIBCPP_DEBUG_LEVEL == 2
1570 __get_db()->__insert_c(this);1656 __get_db()->__insert_c(this);
1571#endif1657#endif
1572 insert(__il.begin(), __il.end());1658 insert(__il.begin(), __il.end());
...@@ -1578,7 +1664,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(...@@ -1578,7 +1664,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1578 const key_equal& __eql)1664 const key_equal& __eql)
1579 : __table_(__hf, __eql)1665 : __table_(__hf, __eql)
1580{1666{
1581#if _LIBCPP_DEBUG_LEVEL >= 21667#if _LIBCPP_DEBUG_LEVEL == 2
1582 __get_db()->__insert_c(this);1668 __get_db()->__insert_c(this);
1583#endif1669#endif
1584 __table_.rehash(__n);1670 __table_.rehash(__n);
...@@ -1591,7 +1677,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(...@@ -1591,7 +1677,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
1591 const key_equal& __eql, const allocator_type& __a)1677 const key_equal& __eql, const allocator_type& __a)
1592 : __table_(__hf, __eql, __a)1678 : __table_(__hf, __eql, __a)
1593{1679{
1594#if _LIBCPP_DEBUG_LEVEL >= 21680#if _LIBCPP_DEBUG_LEVEL == 2
1595 __get_db()->__insert_c(this);1681 __get_db()->__insert_c(this);
1596#endif1682#endif
1597 __table_.rehash(__n);1683 __table_.rehash(__n);
lib/libcxx/include/utility+24-14
...@@ -499,7 +499,7 @@ struct _LIBCPP_TEMPLATE_VIS pair...@@ -499,7 +499,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
499 second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}499 second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
500500
501 template <class... _Args1, class... _Args2>501 template <class... _Args1, class... _Args2>
502 _LIBCPP_INLINE_VISIBILITY502 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
503 pair(piecewise_construct_t __pc,503 pair(piecewise_construct_t __pc,
504 tuple<_Args1...> __first_args, tuple<_Args2...> __second_args)504 tuple<_Args1...> __first_args, tuple<_Args2...> __second_args)
505 _NOEXCEPT_((is_nothrow_constructible<first_type, _Args1...>::value &&505 _NOEXCEPT_((is_nothrow_constructible<first_type, _Args1...>::value &&
...@@ -508,7 +508,7 @@ struct _LIBCPP_TEMPLATE_VIS pair...@@ -508,7 +508,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
508 typename __make_tuple_indices<sizeof...(_Args1)>::type(),508 typename __make_tuple_indices<sizeof...(_Args1)>::type(),
509 typename __make_tuple_indices<sizeof...(_Args2) >::type()) {}509 typename __make_tuple_indices<sizeof...(_Args2) >::type()) {}
510510
511 _LIBCPP_INLINE_VISIBILITY511 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
512 pair& operator=(typename conditional<512 pair& operator=(typename conditional<
513 is_copy_assignable<first_type>::value &&513 is_copy_assignable<first_type>::value &&
514 is_copy_assignable<second_type>::value,514 is_copy_assignable<second_type>::value,
...@@ -521,7 +521,7 @@ struct _LIBCPP_TEMPLATE_VIS pair...@@ -521,7 +521,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
521 return *this;521 return *this;
522 }522 }
523523
524 _LIBCPP_INLINE_VISIBILITY524 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
525 pair& operator=(typename conditional<525 pair& operator=(typename conditional<
526 is_move_assignable<first_type>::value &&526 is_move_assignable<first_type>::value &&
527 is_move_assignable<second_type>::value,527 is_move_assignable<second_type>::value,
...@@ -537,7 +537,7 @@ struct _LIBCPP_TEMPLATE_VIS pair...@@ -537,7 +537,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
537 template <class _Tuple, _EnableB<537 template <class _Tuple, _EnableB<
538 _CheckTLC<_Tuple>::template __enable_assign<_Tuple>()538 _CheckTLC<_Tuple>::template __enable_assign<_Tuple>()
539 > = false>539 > = false>
540 _LIBCPP_INLINE_VISIBILITY540 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
541 pair& operator=(_Tuple&& __p) {541 pair& operator=(_Tuple&& __p) {
542 first = _VSTD::get<0>(_VSTD::forward<_Tuple>(__p));542 first = _VSTD::get<0>(_VSTD::forward<_Tuple>(__p));
543 second = _VSTD::get<1>(_VSTD::forward<_Tuple>(__p));543 second = _VSTD::get<1>(_VSTD::forward<_Tuple>(__p));
...@@ -545,7 +545,7 @@ struct _LIBCPP_TEMPLATE_VIS pair...@@ -545,7 +545,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
545 }545 }
546#endif546#endif
547547
548 _LIBCPP_INLINE_VISIBILITY548 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
549 void549 void
550 swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&550 swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
551 __is_nothrow_swappable<second_type>::value)551 __is_nothrow_swappable<second_type>::value)
...@@ -558,10 +558,10 @@ private:...@@ -558,10 +558,10 @@ private:
558558
559#ifndef _LIBCPP_CXX03_LANG559#ifndef _LIBCPP_CXX03_LANG
560 template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>560 template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
561 _LIBCPP_INLINE_VISIBILITY561 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
562 pair(piecewise_construct_t,562 pair(piecewise_construct_t,
563 tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,563 tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
564 __tuple_indices<_I1...>, __tuple_indices<_I2...>);564 __tuple_indices<_I1...>, __tuple_indices<_I2...>);
565#endif565#endif
566};566};
567567
...@@ -619,7 +619,7 @@ operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)...@@ -619,7 +619,7 @@ operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
619}619}
620620
621template <class _T1, class _T2>621template <class _T1, class _T2>
622inline _LIBCPP_INLINE_VISIBILITY622inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
623typename enable_if623typename enable_if
624<624<
625 __is_swappable<_T1>::value &&625 __is_swappable<_T1>::value &&
...@@ -970,7 +970,7 @@ _Size...@@ -970,7 +970,7 @@ _Size
970__loadword(const void* __p)970__loadword(const void* __p)
971{971{
972 _Size __r;972 _Size __r;
973 std::memcpy(&__r, __p, sizeof(__r));973 _VSTD::memcpy(&__r, __p, sizeof(__r));
974 return __r;974 return __r;
975}975}
976976
...@@ -1189,7 +1189,7 @@ __murmur2_or_cityhash<_Size, 64>::operator()(const void* __key, _Size __len)...@@ -1189,7 +1189,7 @@ __murmur2_or_cityhash<_Size, 64>::operator()(const void* __key, _Size __len)
1189 __v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first);1189 __v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first);
1190 __w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second,1190 __w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second,
1191 __y + __loadword<_Size>(__s + 16));1191 __y + __loadword<_Size>(__s + 16));
1192 std::swap(__z, __x);1192 _VSTD::swap(__z, __x);
1193 __s += 64;1193 __s += 64;
1194 __len -= 64;1194 __len -= 64;
1195 } while (__len != 0);1195 } while (__len != 0);
...@@ -1364,6 +1364,16 @@ struct _LIBCPP_TEMPLATE_VIS hash<unsigned char>...@@ -1364,6 +1364,16 @@ struct _LIBCPP_TEMPLATE_VIS hash<unsigned char>
1364 size_t operator()(unsigned char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}1364 size_t operator()(unsigned char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
1365};1365};
13661366
1367#ifndef _LIBCPP_NO_HAS_CHAR8_T
1368template <>
1369struct _LIBCPP_TEMPLATE_VIS hash<char8_t>
1370 : public unary_function<char8_t, size_t>
1371{
1372 _LIBCPP_INLINE_VISIBILITY
1373 size_t operator()(char8_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
1374};
1375#endif // !_LIBCPP_NO_HAS_CHAR8_T
1376
1367#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS1377#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
13681378
1369template <>1379template <>
...@@ -1506,7 +1516,7 @@ struct _LIBCPP_TEMPLATE_VIS hash<long double>...@@ -1506,7 +1516,7 @@ struct _LIBCPP_TEMPLATE_VIS hash<long double>
1506 // -0.0 and 0.0 should return same hash1516 // -0.0 and 0.0 should return same hash
1507 if (__v == 0.0L)1517 if (__v == 0.0L)
1508 return 0;1518 return 0;
1509#if defined(__i386__)1519#if defined(__i386__) || (defined(__x86_64__) && defined(__ILP32__))
1510 // Zero out padding bits1520 // Zero out padding bits
1511 union1521 union
1512 {1522 {
...@@ -1593,7 +1603,7 @@ using __check_hash_requirements _LIBCPP_NODEBUG_TYPE = integral_constant<bool,...@@ -1593,7 +1603,7 @@ using __check_hash_requirements _LIBCPP_NODEBUG_TYPE = integral_constant<bool,
1593 __invokable_r<size_t, _Hash, _Key const&>::value1603 __invokable_r<size_t, _Hash, _Key const&>::value
1594>;1604>;
15951605
1596template <class _Key, class _Hash = std::hash<_Key> >1606template <class _Key, class _Hash = hash<_Key> >
1597using __has_enabled_hash _LIBCPP_NODEBUG_TYPE = integral_constant<bool,1607using __has_enabled_hash _LIBCPP_NODEBUG_TYPE = integral_constant<bool,
1598 __check_hash_requirements<_Key, _Hash>::value &&1608 __check_hash_requirements<_Key, _Hash>::value &&
1599 is_default_constructible<_Hash>::value1609 is_default_constructible<_Hash>::value
lib/libcxx/include/valarray+73-95
...@@ -136,6 +136,7 @@ public:...@@ -136,6 +136,7 @@ public:
136 void operator>>=(const valarray<value_type>& v) const;136 void operator>>=(const valarray<value_type>& v) const;
137137
138 void operator=(const value_type& x) const;138 void operator=(const value_type& x) const;
139 void operator=(const valarray<T>& val_arr) const;
139140
140 slice_array() = delete;141 slice_array() = delete;
141};142};
...@@ -802,7 +803,7 @@ private:...@@ -802,7 +803,7 @@ private:
802public:803public:
803 // construct/destroy:804 // construct/destroy:
804 _LIBCPP_INLINE_VISIBILITY805 _LIBCPP_INLINE_VISIBILITY
805 valarray() : __begin_(0), __end_(0) {}806 valarray() : __begin_(nullptr), __end_(nullptr) {}
806 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1807 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
807 explicit valarray(size_t __n);808 explicit valarray(size_t __n);
808 _LIBCPP_INLINE_VISIBILITY809 _LIBCPP_INLINE_VISIBILITY
...@@ -1264,6 +1265,9 @@ public:...@@ -1264,6 +1265,9 @@ public:
1264 _LIBCPP_INLINE_VISIBILITY1265 _LIBCPP_INLINE_VISIBILITY
1265 void operator=(const value_type& __x) const;1266 void operator=(const value_type& __x) const;
12661267
1268 _LIBCPP_INLINE_VISIBILITY
1269 void operator=(const valarray<value_type>& __va) const;
1270
1267private:1271private:
1268 _LIBCPP_INLINE_VISIBILITY1272 _LIBCPP_INLINE_VISIBILITY
1269 slice_array(const slice& __sl, const valarray<value_type>& __v)1273 slice_array(const slice& __sl, const valarray<value_type>& __v)
...@@ -1303,6 +1307,15 @@ slice_array<_Tp>::operator=(const _Expr& __v) const...@@ -1303,6 +1307,15 @@ slice_array<_Tp>::operator=(const _Expr& __v) const
1303 *__t = __v[__i];1307 *__t = __v[__i];
1304}1308}
13051309
1310template <class _Tp>
1311inline void
1312slice_array<_Tp>::operator=(const valarray<value_type>& __va) const
1313{
1314 value_type* __t = __vp_;
1315 for (size_t __i = 0; __i < __va.size(); ++__i, __t += __stride_)
1316 *__t = __va[__i];
1317}
1318
1306template <class _Tp>1319template <class _Tp>
1307template <class _Expr>1320template <class _Expr>
1308inline1321inline
...@@ -2738,11 +2751,9 @@ __val_expr<_ValExpr>::operator valarray<__val_expr::result_type>() const...@@ -2738,11 +2751,9 @@ __val_expr<_ValExpr>::operator valarray<__val_expr::result_type>() const
2738 if (__n)2751 if (__n)
2739 {2752 {
2740 __r.__begin_ =2753 __r.__begin_ =
2741 __r.__end_ =2754 __r.__end_ = allocator<result_type>().allocate(__n);
2742 static_cast<result_type*>(
2743 _VSTD::__libcpp_allocate(__n * sizeof(result_type), _LIBCPP_ALIGNOF(result_type)));
2744 for (size_t __i = 0; __i != __n; ++__r.__end_, ++__i)2755 for (size_t __i = 0; __i != __n; ++__r.__end_, ++__i)
2745 ::new (__r.__end_) result_type(__expr_[__i]);2756 ::new ((void*)__r.__end_) result_type(__expr_[__i]);
2746 }2757 }
2747 return __r;2758 return __r;
2748}2759}
...@@ -2752,19 +2763,18 @@ __val_expr<_ValExpr>::operator valarray<__val_expr::result_type>() const...@@ -2752,19 +2763,18 @@ __val_expr<_ValExpr>::operator valarray<__val_expr::result_type>() const
2752template <class _Tp>2763template <class _Tp>
2753inline2764inline
2754valarray<_Tp>::valarray(size_t __n)2765valarray<_Tp>::valarray(size_t __n)
2755 : __begin_(0),2766 : __begin_(nullptr),
2756 __end_(0)2767 __end_(nullptr)
2757{2768{
2758 if (__n)2769 if (__n)
2759 {2770 {
2760 __begin_ = __end_ = static_cast<value_type*>(2771 __begin_ = __end_ = allocator<value_type>().allocate(__n);
2761 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2762#ifndef _LIBCPP_NO_EXCEPTIONS2772#ifndef _LIBCPP_NO_EXCEPTIONS
2763 try2773 try
2764 {2774 {
2765#endif // _LIBCPP_NO_EXCEPTIONS2775#endif // _LIBCPP_NO_EXCEPTIONS
2766 for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)2776 for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)
2767 ::new (__end_) value_type();2777 ::new ((void*)__end_) value_type();
2768#ifndef _LIBCPP_NO_EXCEPTIONS2778#ifndef _LIBCPP_NO_EXCEPTIONS
2769 }2779 }
2770 catch (...)2780 catch (...)
...@@ -2779,27 +2789,26 @@ valarray<_Tp>::valarray(size_t __n)...@@ -2779,27 +2789,26 @@ valarray<_Tp>::valarray(size_t __n)
2779template <class _Tp>2789template <class _Tp>
2780inline2790inline
2781valarray<_Tp>::valarray(const value_type& __x, size_t __n)2791valarray<_Tp>::valarray(const value_type& __x, size_t __n)
2782 : __begin_(0),2792 : __begin_(nullptr),
2783 __end_(0)2793 __end_(nullptr)
2784{2794{
2785 resize(__n, __x);2795 resize(__n, __x);
2786}2796}
27872797
2788template <class _Tp>2798template <class _Tp>
2789valarray<_Tp>::valarray(const value_type* __p, size_t __n)2799valarray<_Tp>::valarray(const value_type* __p, size_t __n)
2790 : __begin_(0),2800 : __begin_(nullptr),
2791 __end_(0)2801 __end_(nullptr)
2792{2802{
2793 if (__n)2803 if (__n)
2794 {2804 {
2795 __begin_ = __end_ = static_cast<value_type*>(2805 __begin_ = __end_ = allocator<value_type>().allocate(__n);
2796 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2797#ifndef _LIBCPP_NO_EXCEPTIONS2806#ifndef _LIBCPP_NO_EXCEPTIONS
2798 try2807 try
2799 {2808 {
2800#endif // _LIBCPP_NO_EXCEPTIONS2809#endif // _LIBCPP_NO_EXCEPTIONS
2801 for (size_t __n_left = __n; __n_left; ++__end_, ++__p, --__n_left)2810 for (size_t __n_left = __n; __n_left; ++__end_, ++__p, --__n_left)
2802 ::new (__end_) value_type(*__p);2811 ::new ((void*)__end_) value_type(*__p);
2803#ifndef _LIBCPP_NO_EXCEPTIONS2812#ifndef _LIBCPP_NO_EXCEPTIONS
2804 }2813 }
2805 catch (...)2814 catch (...)
...@@ -2813,19 +2822,18 @@ valarray<_Tp>::valarray(const value_type* __p, size_t __n)...@@ -2813,19 +2822,18 @@ valarray<_Tp>::valarray(const value_type* __p, size_t __n)
28132822
2814template <class _Tp>2823template <class _Tp>
2815valarray<_Tp>::valarray(const valarray& __v)2824valarray<_Tp>::valarray(const valarray& __v)
2816 : __begin_(0),2825 : __begin_(nullptr),
2817 __end_(0)2826 __end_(nullptr)
2818{2827{
2819 if (__v.size())2828 if (__v.size())
2820 {2829 {
2821 __begin_ = __end_ = static_cast<value_type*>(2830 __begin_ = __end_ = allocator<value_type>().allocate(__v.size());
2822 _VSTD::__libcpp_allocate(__v.size() * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2823#ifndef _LIBCPP_NO_EXCEPTIONS2831#ifndef _LIBCPP_NO_EXCEPTIONS
2824 try2832 try
2825 {2833 {
2826#endif // _LIBCPP_NO_EXCEPTIONS2834#endif // _LIBCPP_NO_EXCEPTIONS
2827 for (value_type* __p = __v.__begin_; __p != __v.__end_; ++__end_, ++__p)2835 for (value_type* __p = __v.__begin_; __p != __v.__end_; ++__end_, ++__p)
2828 ::new (__end_) value_type(*__p);2836 ::new ((void*)__end_) value_type(*__p);
2829#ifndef _LIBCPP_NO_EXCEPTIONS2837#ifndef _LIBCPP_NO_EXCEPTIONS
2830 }2838 }
2831 catch (...)2839 catch (...)
...@@ -2850,21 +2858,20 @@ valarray<_Tp>::valarray(valarray&& __v) _NOEXCEPT...@@ -2850,21 +2858,20 @@ valarray<_Tp>::valarray(valarray&& __v) _NOEXCEPT
28502858
2851template <class _Tp>2859template <class _Tp>
2852valarray<_Tp>::valarray(initializer_list<value_type> __il)2860valarray<_Tp>::valarray(initializer_list<value_type> __il)
2853 : __begin_(0),2861 : __begin_(nullptr),
2854 __end_(0)2862 __end_(nullptr)
2855{2863{
2856 const size_t __n = __il.size();2864 const size_t __n = __il.size();
2857 if (__n)2865 if (__n)
2858 {2866 {
2859 __begin_ = __end_ = static_cast<value_type*>(2867 __begin_ = __end_ = allocator<value_type>().allocate(__n);
2860_VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2861#ifndef _LIBCPP_NO_EXCEPTIONS2868#ifndef _LIBCPP_NO_EXCEPTIONS
2862 try2869 try
2863 {2870 {
2864#endif // _LIBCPP_NO_EXCEPTIONS2871#endif // _LIBCPP_NO_EXCEPTIONS
2865 size_t __n_left = __n;2872 size_t __n_left = __n;
2866 for (const value_type* __p = __il.begin(); __n_left; ++__end_, ++__p, --__n_left)2873 for (const value_type* __p = __il.begin(); __n_left; ++__end_, ++__p, --__n_left)
2867 ::new (__end_) value_type(*__p);2874 ::new ((void*)__end_) value_type(*__p);
2868#ifndef _LIBCPP_NO_EXCEPTIONS2875#ifndef _LIBCPP_NO_EXCEPTIONS
2869 }2876 }
2870 catch (...)2877 catch (...)
...@@ -2880,21 +2887,20 @@ _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)))...@@ -2880,21 +2887,20 @@ _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)))
28802887
2881template <class _Tp>2888template <class _Tp>
2882valarray<_Tp>::valarray(const slice_array<value_type>& __sa)2889valarray<_Tp>::valarray(const slice_array<value_type>& __sa)
2883 : __begin_(0),2890 : __begin_(nullptr),
2884 __end_(0)2891 __end_(nullptr)
2885{2892{
2886 const size_t __n = __sa.__size_;2893 const size_t __n = __sa.__size_;
2887 if (__n)2894 if (__n)
2888 {2895 {
2889 __begin_ = __end_ = static_cast<value_type*>(2896 __begin_ = __end_ = allocator<value_type>().allocate(__n);
2890 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2891#ifndef _LIBCPP_NO_EXCEPTIONS2897#ifndef _LIBCPP_NO_EXCEPTIONS
2892 try2898 try
2893 {2899 {
2894#endif // _LIBCPP_NO_EXCEPTIONS2900#endif // _LIBCPP_NO_EXCEPTIONS
2895 size_t __n_left = __n;2901 size_t __n_left = __n;
2896 for (const value_type* __p = __sa.__vp_; __n_left; ++__end_, __p += __sa.__stride_, --__n_left)2902 for (const value_type* __p = __sa.__vp_; __n_left; ++__end_, __p += __sa.__stride_, --__n_left)
2897 ::new (__end_) value_type(*__p);2903 ::new ((void*)__end_) value_type(*__p);
2898#ifndef _LIBCPP_NO_EXCEPTIONS2904#ifndef _LIBCPP_NO_EXCEPTIONS
2899 }2905 }
2900 catch (...)2906 catch (...)
...@@ -2908,14 +2914,13 @@ valarray<_Tp>::valarray(const slice_array<value_type>& __sa)...@@ -2908,14 +2914,13 @@ valarray<_Tp>::valarray(const slice_array<value_type>& __sa)
29082914
2909template <class _Tp>2915template <class _Tp>
2910valarray<_Tp>::valarray(const gslice_array<value_type>& __ga)2916valarray<_Tp>::valarray(const gslice_array<value_type>& __ga)
2911 : __begin_(0),2917 : __begin_(nullptr),
2912 __end_(0)2918 __end_(nullptr)
2913{2919{
2914 const size_t __n = __ga.__1d_.size();2920 const size_t __n = __ga.__1d_.size();
2915 if (__n)2921 if (__n)
2916 {2922 {
2917 __begin_ = __end_ = static_cast<value_type*>(2923 __begin_ = __end_ = allocator<value_type>().allocate(__n);
2918 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2919#ifndef _LIBCPP_NO_EXCEPTIONS2924#ifndef _LIBCPP_NO_EXCEPTIONS
2920 try2925 try
2921 {2926 {
...@@ -2924,7 +2929,7 @@ valarray<_Tp>::valarray(const gslice_array<value_type>& __ga)...@@ -2924,7 +2929,7 @@ valarray<_Tp>::valarray(const gslice_array<value_type>& __ga)
2924 const value_type* __s = __ga.__vp_;2929 const value_type* __s = __ga.__vp_;
2925 for (_Ip __i = __ga.__1d_.__begin_, __e = __ga.__1d_.__end_;2930 for (_Ip __i = __ga.__1d_.__begin_, __e = __ga.__1d_.__end_;
2926 __i != __e; ++__i, ++__end_)2931 __i != __e; ++__i, ++__end_)
2927 ::new (__end_) value_type(__s[*__i]);2932 ::new ((void*)__end_) value_type(__s[*__i]);
2928#ifndef _LIBCPP_NO_EXCEPTIONS2933#ifndef _LIBCPP_NO_EXCEPTIONS
2929 }2934 }
2930 catch (...)2935 catch (...)
...@@ -2938,14 +2943,13 @@ valarray<_Tp>::valarray(const gslice_array<value_type>& __ga)...@@ -2938,14 +2943,13 @@ valarray<_Tp>::valarray(const gslice_array<value_type>& __ga)
29382943
2939template <class _Tp>2944template <class _Tp>
2940valarray<_Tp>::valarray(const mask_array<value_type>& __ma)2945valarray<_Tp>::valarray(const mask_array<value_type>& __ma)
2941 : __begin_(0),2946 : __begin_(nullptr),
2942 __end_(0)2947 __end_(nullptr)
2943{2948{
2944 const size_t __n = __ma.__1d_.size();2949 const size_t __n = __ma.__1d_.size();
2945 if (__n)2950 if (__n)
2946 {2951 {
2947 __begin_ = __end_ = static_cast<value_type*>(2952 __begin_ = __end_ = allocator<value_type>().allocate(__n);
2948 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2949#ifndef _LIBCPP_NO_EXCEPTIONS2953#ifndef _LIBCPP_NO_EXCEPTIONS
2950 try2954 try
2951 {2955 {
...@@ -2954,7 +2958,7 @@ valarray<_Tp>::valarray(const mask_array<value_type>& __ma)...@@ -2954,7 +2958,7 @@ valarray<_Tp>::valarray(const mask_array<value_type>& __ma)
2954 const value_type* __s = __ma.__vp_;2958 const value_type* __s = __ma.__vp_;
2955 for (_Ip __i = __ma.__1d_.__begin_, __e = __ma.__1d_.__end_;2959 for (_Ip __i = __ma.__1d_.__begin_, __e = __ma.__1d_.__end_;
2956 __i != __e; ++__i, ++__end_)2960 __i != __e; ++__i, ++__end_)
2957 ::new (__end_) value_type(__s[*__i]);2961 ::new ((void*)__end_) value_type(__s[*__i]);
2958#ifndef _LIBCPP_NO_EXCEPTIONS2962#ifndef _LIBCPP_NO_EXCEPTIONS
2959 }2963 }
2960 catch (...)2964 catch (...)
...@@ -2968,14 +2972,13 @@ valarray<_Tp>::valarray(const mask_array<value_type>& __ma)...@@ -2968,14 +2972,13 @@ valarray<_Tp>::valarray(const mask_array<value_type>& __ma)
29682972
2969template <class _Tp>2973template <class _Tp>
2970valarray<_Tp>::valarray(const indirect_array<value_type>& __ia)2974valarray<_Tp>::valarray(const indirect_array<value_type>& __ia)
2971 : __begin_(0),2975 : __begin_(nullptr),
2972 __end_(0)2976 __end_(nullptr)
2973{2977{
2974 const size_t __n = __ia.__1d_.size();2978 const size_t __n = __ia.__1d_.size();
2975 if (__n)2979 if (__n)
2976 {2980 {
2977 __begin_ = __end_ = static_cast<value_type*>(2981 __begin_ = __end_ = allocator<value_type>().allocate(__n);
2978 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2979#ifndef _LIBCPP_NO_EXCEPTIONS2982#ifndef _LIBCPP_NO_EXCEPTIONS
2980 try2983 try
2981 {2984 {
...@@ -2984,7 +2987,7 @@ valarray<_Tp>::valarray(const indirect_array<value_type>& __ia)...@@ -2984,7 +2987,7 @@ valarray<_Tp>::valarray(const indirect_array<value_type>& __ia)
2984 const value_type* __s = __ia.__vp_;2987 const value_type* __s = __ia.__vp_;
2985 for (_Ip __i = __ia.__1d_.__begin_, __e = __ia.__1d_.__end_;2988 for (_Ip __i = __ia.__1d_.__begin_, __e = __ia.__1d_.__end_;
2986 __i != __e; ++__i, ++__end_)2989 __i != __e; ++__i, ++__end_)
2987 ::new (__end_) value_type(__s[*__i]);2990 ::new ((void*)__end_) value_type(__s[*__i]);
2988#ifndef _LIBCPP_NO_EXCEPTIONS2991#ifndef _LIBCPP_NO_EXCEPTIONS
2989 }2992 }
2990 catch (...)2993 catch (...)
...@@ -3011,8 +3014,7 @@ valarray<_Tp>::__assign_range(const value_type* __f, const value_type* __l)...@@ -3011,8 +3014,7 @@ valarray<_Tp>::__assign_range(const value_type* __f, const value_type* __l)
3011 if (size() != __n)3014 if (size() != __n)
3012 {3015 {
3013 __clear(size());3016 __clear(size());
3014 __begin_ = static_cast<value_type*>(3017 __begin_ = allocator<value_type>().allocate(__n);
3015 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3016 __end_ = __begin_ + __n;3018 __end_ = __begin_ + __n;
3017 _VSTD::uninitialized_copy(__f, __l, __begin_);3019 _VSTD::uninitialized_copy(__f, __l, __begin_);
3018 } else {3020 } else {
...@@ -3265,12 +3267,9 @@ valarray<_Tp>::operator+() const...@@ -3265,12 +3267,9 @@ valarray<_Tp>::operator+() const
3265 size_t __n = size();3267 size_t __n = size();
3266 if (__n)3268 if (__n)
3267 {3269 {
3268 __r.__begin_ =3270 __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
3269 __r.__end_ =
3270 static_cast<value_type*>(
3271 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3272 for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)3271 for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
3273 ::new (__r.__end_) value_type(+*__p);3272 ::new ((void*)__r.__end_) value_type(+*__p);
3274 }3273 }
3275 return __r;3274 return __r;
3276}3275}
...@@ -3283,12 +3282,9 @@ valarray<_Tp>::operator-() const...@@ -3283,12 +3282,9 @@ valarray<_Tp>::operator-() const
3283 size_t __n = size();3282 size_t __n = size();
3284 if (__n)3283 if (__n)
3285 {3284 {
3286 __r.__begin_ =3285 __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
3287 __r.__end_ =
3288 static_cast<value_type*>(
3289 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3290 for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)3286 for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
3291 ::new (__r.__end_) value_type(-*__p);3287 ::new ((void*)__r.__end_) value_type(-*__p);
3292 }3288 }
3293 return __r;3289 return __r;
3294}3290}
...@@ -3301,12 +3297,9 @@ valarray<_Tp>::operator~() const...@@ -3301,12 +3297,9 @@ valarray<_Tp>::operator~() const
3301 size_t __n = size();3297 size_t __n = size();
3302 if (__n)3298 if (__n)
3303 {3299 {
3304 __r.__begin_ =3300 __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
3305 __r.__end_ =
3306 static_cast<value_type*>(
3307 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3308 for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)3301 for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
3309 ::new (__r.__end_) value_type(~*__p);3302 ::new ((void*)__r.__end_) value_type(~*__p);
3310 }3303 }
3311 return __r;3304 return __r;
3312}3305}
...@@ -3319,11 +3312,9 @@ valarray<_Tp>::operator!() const...@@ -3319,11 +3312,9 @@ valarray<_Tp>::operator!() const
3319 size_t __n = size();3312 size_t __n = size();
3320 if (__n)3313 if (__n)
3321 {3314 {
3322 __r.__begin_ =3315 __r.__begin_ = __r.__end_ = allocator<bool>().allocate(__n);
3323 __r.__end_ =
3324 static_cast<bool*>(_VSTD::__libcpp_allocate(__n * sizeof(bool), _LIBCPP_ALIGNOF(bool)));
3325 for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)3316 for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
3326 ::new (__r.__end_) bool(!*__p);3317 ::new ((void*)__r.__end_) bool(!*__p);
3327 }3318 }
3328 return __r;3319 return __r;
3329}3320}
...@@ -3639,10 +3630,7 @@ valarray<_Tp>::shift(int __i) const...@@ -3639,10 +3630,7 @@ valarray<_Tp>::shift(int __i) const
3639 size_t __n = size();3630 size_t __n = size();
3640 if (__n)3631 if (__n)
3641 {3632 {
3642 __r.__begin_ =3633 __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
3643 __r.__end_ =
3644 static_cast<value_type*>(
3645 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3646 const value_type* __sb;3634 const value_type* __sb;
3647 value_type* __tb;3635 value_type* __tb;
3648 value_type* __te;3636 value_type* __te;
...@@ -3661,11 +3649,11 @@ valarray<_Tp>::shift(int __i) const...@@ -3661,11 +3649,11 @@ valarray<_Tp>::shift(int __i) const
3661 __te = __r.__begin_ + __n;3649 __te = __r.__begin_ + __n;
3662 }3650 }
3663 for (; __r.__end_ != __tb; ++__r.__end_)3651 for (; __r.__end_ != __tb; ++__r.__end_)
3664 ::new (__r.__end_) value_type();3652 ::new ((void*)__r.__end_) value_type();
3665 for (; __r.__end_ != __te; ++__r.__end_, ++__sb)3653 for (; __r.__end_ != __te; ++__r.__end_, ++__sb)
3666 ::new (__r.__end_) value_type(*__sb);3654 ::new ((void*)__r.__end_) value_type(*__sb);
3667 for (__te = __r.__begin_ + __n; __r.__end_ != __te; ++__r.__end_)3655 for (__te = __r.__begin_ + __n; __r.__end_ != __te; ++__r.__end_)
3668 ::new (__r.__end_) value_type();3656 ::new ((void*)__r.__end_) value_type();
3669 }3657 }
3670 return __r;3658 return __r;
3671}3659}
...@@ -3678,16 +3666,13 @@ valarray<_Tp>::cshift(int __i) const...@@ -3678,16 +3666,13 @@ valarray<_Tp>::cshift(int __i) const
3678 size_t __n = size();3666 size_t __n = size();
3679 if (__n)3667 if (__n)
3680 {3668 {
3681 __r.__begin_ =3669 __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
3682 __r.__end_ =
3683 static_cast<value_type*>(
3684 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3685 __i %= static_cast<int>(__n);3670 __i %= static_cast<int>(__n);
3686 const value_type* __m = __i >= 0 ? __begin_ + __i : __end_ + __i;3671 const value_type* __m = __i >= 0 ? __begin_ + __i : __end_ + __i;
3687 for (const value_type* __s = __m; __s != __end_; ++__r.__end_, ++__s)3672 for (const value_type* __s = __m; __s != __end_; ++__r.__end_, ++__s)
3688 ::new (__r.__end_) value_type(*__s);3673 ::new ((void*)__r.__end_) value_type(*__s);
3689 for (const value_type* __s = __begin_; __s != __m; ++__r.__end_, ++__s)3674 for (const value_type* __s = __begin_; __s != __m; ++__r.__end_, ++__s)
3690 ::new (__r.__end_) value_type(*__s);3675 ::new ((void*)__r.__end_) value_type(*__s);
3691 }3676 }
3692 return __r;3677 return __r;
3693}3678}
...@@ -3700,12 +3685,9 @@ valarray<_Tp>::apply(value_type __f(value_type)) const...@@ -3700,12 +3685,9 @@ valarray<_Tp>::apply(value_type __f(value_type)) const
3700 size_t __n = size();3685 size_t __n = size();
3701 if (__n)3686 if (__n)
3702 {3687 {
3703 __r.__begin_ =3688 __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
3704 __r.__end_ =
3705 static_cast<value_type*>(
3706 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3707 for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)3689 for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
3708 ::new (__r.__end_) value_type(__f(*__p));3690 ::new ((void*)__r.__end_) value_type(__f(*__p));
3709 }3691 }
3710 return __r;3692 return __r;
3711}3693}
...@@ -3718,12 +3700,9 @@ valarray<_Tp>::apply(value_type __f(const value_type&)) const...@@ -3718,12 +3700,9 @@ valarray<_Tp>::apply(value_type __f(const value_type&)) const
3718 size_t __n = size();3700 size_t __n = size();
3719 if (__n)3701 if (__n)
3720 {3702 {
3721 __r.__begin_ =3703 __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
3722 __r.__end_ =
3723 static_cast<value_type*>(
3724 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3725 for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)3704 for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
3726 ::new (__r.__end_) value_type(__f(*__p));3705 ::new ((void*)__r.__end_) value_type(__f(*__p));
3727 }3706 }
3728 return __r;3707 return __r;
3729}3708}
...@@ -3736,7 +3715,7 @@ void valarray<_Tp>::__clear(size_t __capacity)...@@ -3736,7 +3715,7 @@ void valarray<_Tp>::__clear(size_t __capacity)
3736 {3715 {
3737 while (__end_ != __begin_)3716 while (__end_ != __begin_)
3738 (--__end_)->~value_type();3717 (--__end_)->~value_type();
3739 _VSTD::__libcpp_deallocate(__begin_, __capacity * sizeof(value_type), _LIBCPP_ALIGNOF(value_type));3718 allocator<value_type>().deallocate(__begin_, __capacity);
3740 __begin_ = __end_ = nullptr;3719 __begin_ = __end_ = nullptr;
3741 }3720 }
3742}3721}
...@@ -3748,14 +3727,13 @@ valarray<_Tp>::resize(size_t __n, value_type __x)...@@ -3748,14 +3727,13 @@ valarray<_Tp>::resize(size_t __n, value_type __x)
3748 __clear(size());3727 __clear(size());
3749 if (__n)3728 if (__n)
3750 {3729 {
3751 __begin_ = __end_ = static_cast<value_type*>(3730 __begin_ = __end_ = allocator<value_type>().allocate(__n);
3752 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3753#ifndef _LIBCPP_NO_EXCEPTIONS3731#ifndef _LIBCPP_NO_EXCEPTIONS
3754 try3732 try
3755 {3733 {
3756#endif // _LIBCPP_NO_EXCEPTIONS3734#endif // _LIBCPP_NO_EXCEPTIONS
3757 for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)3735 for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)
3758 ::new (__end_) value_type(__x);3736 ::new ((void*)__end_) value_type(__x);
3759#ifndef _LIBCPP_NO_EXCEPTIONS3737#ifndef _LIBCPP_NO_EXCEPTIONS
3760 }3738 }
3761 catch (...)3739 catch (...)
lib/libcxx/include/variant+96-31
...@@ -169,6 +169,9 @@ namespace std {...@@ -169,6 +169,9 @@ namespace std {
169 template <class Visitor, class... Variants>169 template <class Visitor, class... Variants>
170 constexpr see below visit(Visitor&&, Variants&&...);170 constexpr see below visit(Visitor&&, Variants&&...);
171171
172 template <class R, class Visitor, class... Variants>
173 constexpr R visit(Visitor&&, Variants&&...); // since C++20
174
172 // 20.7.7, class monostate175 // 20.7.7, class monostate
173 struct monostate;176 struct monostate;
174177
...@@ -197,6 +200,7 @@ namespace std {...@@ -197,6 +200,7 @@ namespace std {
197*/200*/
198201
199#include <__config>202#include <__config>
203#include <__availability>
200#include <__tuple>204#include <__tuple>
201#include <array>205#include <array>
202#include <exception>206#include <exception>
...@@ -227,7 +231,10 @@ public:...@@ -227,7 +231,10 @@ public:
227231
228_LIBCPP_BEGIN_NAMESPACE_STD232_LIBCPP_BEGIN_NAMESPACE_STD
229233
230#if _LIBCPP_STD_VER > 14234// TODO: GCC 5 lies about its support for C++17 (it says it supports it but it
235// really doesn't). That breaks variant, which uses some C++17 features.
236// Remove this once we drop support for GCC 5.
237#if _LIBCPP_STD_VER > 14 && !(defined(_LIBCPP_COMPILER_GCC) && _GNUC_VER_NEW < 6000)
231238
232_LIBCPP_NORETURN239_LIBCPP_NORETURN
233inline _LIBCPP_INLINE_VISIBILITY240inline _LIBCPP_INLINE_VISIBILITY
...@@ -290,9 +297,9 @@ struct _LIBCPP_TEMPLATE_VIS variant_alternative<_Ip, variant<_Types...>> {...@@ -290,9 +297,9 @@ struct _LIBCPP_TEMPLATE_VIS variant_alternative<_Ip, variant<_Types...>> {
290_LIBCPP_INLINE_VAR constexpr size_t variant_npos = static_cast<size_t>(-1);297_LIBCPP_INLINE_VAR constexpr size_t variant_npos = static_cast<size_t>(-1);
291298
292constexpr int __choose_index_type(unsigned int __num_elem) {299constexpr int __choose_index_type(unsigned int __num_elem) {
293 if (__num_elem < std::numeric_limits<unsigned char>::max())300 if (__num_elem < numeric_limits<unsigned char>::max())
294 return 0;301 return 0;
295 if (__num_elem < std::numeric_limits<unsigned short>::max())302 if (__num_elem < numeric_limits<unsigned short>::max())
296 return 1;303 return 1;
297 return 2;304 return 2;
298}305}
...@@ -482,12 +489,12 @@ private:...@@ -482,12 +489,12 @@ private:
482 return __result{{_VSTD::forward<_Fs>(__fs)...}};489 return __result{{_VSTD::forward<_Fs>(__fs)...}};
483 }490 }
484491
485 template <std::size_t... _Is>492 template <size_t... _Is>
486 struct __dispatcher {493 struct __dispatcher {
487 template <class _Fp, class... _Vs>494 template <class _Fp, class... _Vs>
488 inline _LIBCPP_INLINE_VISIBILITY495 inline _LIBCPP_INLINE_VISIBILITY
489 static constexpr decltype(auto) __dispatch(_Fp __f, _Vs... __vs) {496 static constexpr decltype(auto) __dispatch(_Fp __f, _Vs... __vs) {
490 return __invoke_constexpr(497 return _VSTD::__invoke_constexpr(
491 static_cast<_Fp>(__f),498 static_cast<_Fp>(__f),
492 __access::__base::__get_alt<_Is>(static_cast<_Vs>(__vs))...);499 __access::__base::__get_alt<_Is>(static_cast<_Vs>(__vs))...);
493 }500 }
...@@ -579,6 +586,16 @@ struct __variant {...@@ -579,6 +586,16 @@ struct __variant {
579 __make_value_visitor(_VSTD::forward<_Visitor>(__visitor)),586 __make_value_visitor(_VSTD::forward<_Visitor>(__visitor)),
580 _VSTD::forward<_Vs>(__vs)...);587 _VSTD::forward<_Vs>(__vs)...);
581 }588 }
589#if _LIBCPP_STD_VER > 17
590 template <class _Rp, class _Visitor, class... _Vs>
591 inline _LIBCPP_INLINE_VISIBILITY
592 static constexpr _Rp __visit_value(_Visitor&& __visitor,
593 _Vs&&... __vs) {
594 return __visit_alt(
595 __make_value_visitor<_Rp>(_VSTD::forward<_Visitor>(__visitor)),
596 _VSTD::forward<_Vs>(__vs)...);
597 }
598#endif
582599
583private:600private:
584 template <class _Visitor, class... _Values>601 template <class _Visitor, class... _Values>
...@@ -595,17 +612,48 @@ private:...@@ -595,17 +612,48 @@ private:
595 __std_visit_exhaustive_visitor_check<612 __std_visit_exhaustive_visitor_check<
596 _Visitor,613 _Visitor,
597 decltype((_VSTD::forward<_Alts>(__alts).__value))...>();614 decltype((_VSTD::forward<_Alts>(__alts).__value))...>();
598 return __invoke_constexpr(_VSTD::forward<_Visitor>(__visitor),615 return _VSTD::__invoke_constexpr(_VSTD::forward<_Visitor>(__visitor),
599 _VSTD::forward<_Alts>(__alts).__value...);616 _VSTD::forward<_Alts>(__alts).__value...);
600 }617 }
601 _Visitor&& __visitor;618 _Visitor&& __visitor;
602 };619 };
603620
621#if _LIBCPP_STD_VER > 17
622 template <class _Rp, class _Visitor>
623 struct __value_visitor_return_type {
624 template <class... _Alts>
625 inline _LIBCPP_INLINE_VISIBILITY
626 constexpr _Rp operator()(_Alts&&... __alts) const {
627 __std_visit_exhaustive_visitor_check<
628 _Visitor,
629 decltype((_VSTD::forward<_Alts>(__alts).__value))...>();
630 if constexpr (is_void_v<_Rp>) {
631 _VSTD::__invoke_constexpr(_VSTD::forward<_Visitor>(__visitor),
632 _VSTD::forward<_Alts>(__alts).__value...);
633 }
634 else {
635 return _VSTD::__invoke_constexpr(_VSTD::forward<_Visitor>(__visitor),
636 _VSTD::forward<_Alts>(__alts).__value...);
637 }
638 }
639
640 _Visitor&& __visitor;
641 };
642#endif
643
604 template <class _Visitor>644 template <class _Visitor>
605 inline _LIBCPP_INLINE_VISIBILITY645 inline _LIBCPP_INLINE_VISIBILITY
606 static constexpr auto __make_value_visitor(_Visitor&& __visitor) {646 static constexpr auto __make_value_visitor(_Visitor&& __visitor) {
607 return __value_visitor<_Visitor>{_VSTD::forward<_Visitor>(__visitor)};647 return __value_visitor<_Visitor>{_VSTD::forward<_Visitor>(__visitor)};
608 }648 }
649
650#if _LIBCPP_STD_VER > 17
651 template <class _Rp, class _Visitor>
652 inline _LIBCPP_INLINE_VISIBILITY
653 static constexpr auto __make_value_visitor(_Visitor&& __visitor) {
654 return __value_visitor_return_type<_Rp, _Visitor>{_VSTD::forward<_Visitor>(__visitor)};
655 }
656#endif
609};657};
610658
611} // namespace __visitation659} // namespace __visitation
...@@ -720,12 +768,12 @@ protected:...@@ -720,12 +768,12 @@ protected:
720};768};
721769
722template <class _Traits, _Trait = _Traits::__destructible_trait>770template <class _Traits, _Trait = _Traits::__destructible_trait>
723class _LIBCPP_TEMPLATE_VIS __destructor;771class _LIBCPP_TEMPLATE_VIS __dtor;
724772
725#define _LIBCPP_VARIANT_DESTRUCTOR(destructible_trait, destructor, destroy) \773#define _LIBCPP_VARIANT_DESTRUCTOR(destructible_trait, destructor, destroy) \
726 template <class... _Types> \774 template <class... _Types> \
727 class _LIBCPP_TEMPLATE_VIS __destructor<__traits<_Types...>, \775 class _LIBCPP_TEMPLATE_VIS __dtor<__traits<_Types...>, \
728 destructible_trait> \776 destructible_trait> \
729 : public __base<destructible_trait, _Types...> { \777 : public __base<destructible_trait, _Types...> { \
730 using __base_type = __base<destructible_trait, _Types...>; \778 using __base_type = __base<destructible_trait, _Types...>; \
731 using __index_t = typename __base_type::__index_t; \779 using __index_t = typename __base_type::__index_t; \
...@@ -734,11 +782,11 @@ class _LIBCPP_TEMPLATE_VIS __destructor;...@@ -734,11 +782,11 @@ class _LIBCPP_TEMPLATE_VIS __destructor;
734 using __base_type::__base_type; \782 using __base_type::__base_type; \
735 using __base_type::operator=; \783 using __base_type::operator=; \
736 \784 \
737 __destructor(const __destructor&) = default; \785 __dtor(const __dtor&) = default; \
738 __destructor(__destructor&&) = default; \786 __dtor(__dtor&&) = default; \
739 destructor \787 destructor \
740 __destructor& operator=(const __destructor&) = default; \788 __dtor& operator=(const __dtor&) = default; \
741 __destructor& operator=(__destructor&&) = default; \789 __dtor& operator=(__dtor&&) = default; \
742 \790 \
743 protected: \791 protected: \
744 inline _LIBCPP_INLINE_VISIBILITY \792 inline _LIBCPP_INLINE_VISIBILITY \
...@@ -747,12 +795,12 @@ class _LIBCPP_TEMPLATE_VIS __destructor;...@@ -747,12 +795,12 @@ class _LIBCPP_TEMPLATE_VIS __destructor;
747795
748_LIBCPP_VARIANT_DESTRUCTOR(796_LIBCPP_VARIANT_DESTRUCTOR(
749 _Trait::_TriviallyAvailable,797 _Trait::_TriviallyAvailable,
750 ~__destructor() = default;,798 ~__dtor() = default;,
751 void __destroy() noexcept { this->__index = __variant_npos<__index_t>; });799 void __destroy() noexcept { this->__index = __variant_npos<__index_t>; });
752800
753_LIBCPP_VARIANT_DESTRUCTOR(801_LIBCPP_VARIANT_DESTRUCTOR(
754 _Trait::_Available,802 _Trait::_Available,
755 ~__destructor() { __destroy(); },803 ~__dtor() { __destroy(); },
756 void __destroy() noexcept {804 void __destroy() noexcept {
757 if (!this->valueless_by_exception()) {805 if (!this->valueless_by_exception()) {
758 __visitation::__base::__visit_alt(806 __visitation::__base::__visit_alt(
...@@ -767,14 +815,14 @@ _LIBCPP_VARIANT_DESTRUCTOR(...@@ -767,14 +815,14 @@ _LIBCPP_VARIANT_DESTRUCTOR(
767815
768_LIBCPP_VARIANT_DESTRUCTOR(816_LIBCPP_VARIANT_DESTRUCTOR(
769 _Trait::_Unavailable,817 _Trait::_Unavailable,
770 ~__destructor() = delete;,818 ~__dtor() = delete;,
771 void __destroy() noexcept = delete;);819 void __destroy() noexcept = delete;);
772820
773#undef _LIBCPP_VARIANT_DESTRUCTOR821#undef _LIBCPP_VARIANT_DESTRUCTOR
774822
775template <class _Traits>823template <class _Traits>
776class _LIBCPP_TEMPLATE_VIS __constructor : public __destructor<_Traits> {824class _LIBCPP_TEMPLATE_VIS __ctor : public __dtor<_Traits> {
777 using __base_type = __destructor<_Traits>;825 using __base_type = __dtor<_Traits>;
778826
779public:827public:
780 using __base_type::__base_type;828 using __base_type::__base_type;
...@@ -791,7 +839,7 @@ protected:...@@ -791,7 +839,7 @@ protected:
791839
792 template <class _Rhs>840 template <class _Rhs>
793 inline _LIBCPP_INLINE_VISIBILITY841 inline _LIBCPP_INLINE_VISIBILITY
794 static void __generic_construct(__constructor& __lhs, _Rhs&& __rhs) {842 static void __generic_construct(__ctor& __lhs, _Rhs&& __rhs) {
795 __lhs.__destroy();843 __lhs.__destroy();
796 if (!__rhs.valueless_by_exception()) {844 if (!__rhs.valueless_by_exception()) {
797 __visitation::__base::__visit_alt_at(845 __visitation::__base::__visit_alt_at(
...@@ -813,10 +861,10 @@ class _LIBCPP_TEMPLATE_VIS __move_constructor;...@@ -813,10 +861,10 @@ class _LIBCPP_TEMPLATE_VIS __move_constructor;
813#define _LIBCPP_VARIANT_MOVE_CONSTRUCTOR(move_constructible_trait, \861#define _LIBCPP_VARIANT_MOVE_CONSTRUCTOR(move_constructible_trait, \
814 move_constructor) \862 move_constructor) \
815 template <class... _Types> \863 template <class... _Types> \
816 class _LIBCPP_TEMPLATE_VIS __move_constructor<__traits<_Types...>, \864 class _LIBCPP_TEMPLATE_VIS __move_constructor<__traits<_Types...>, \
817 move_constructible_trait> \865 move_constructible_trait> \
818 : public __constructor<__traits<_Types...>> { \866 : public __ctor<__traits<_Types...>> { \
819 using __base_type = __constructor<__traits<_Types...>>; \867 using __base_type = __ctor<__traits<_Types...>>; \
820 \868 \
821 public: \869 public: \
822 using __base_type::__base_type; \870 using __base_type::__base_type; \
...@@ -1104,7 +1152,7 @@ struct __narrowing_check {...@@ -1104,7 +1152,7 @@ struct __narrowing_check {
1104 template <class _Dest>1152 template <class _Dest>
1105 static auto __test_impl(_Dest (&&)[1]) -> __identity<_Dest>;1153 static auto __test_impl(_Dest (&&)[1]) -> __identity<_Dest>;
1106 template <class _Dest, class _Source>1154 template <class _Dest, class _Source>
1107 using _Apply _LIBCPP_NODEBUG_TYPE = decltype(__test_impl<_Dest>({std::declval<_Source>()}));1155 using _Apply _LIBCPP_NODEBUG_TYPE = decltype(__test_impl<_Dest>({_VSTD::declval<_Source>()}));
1108};1156};
11091157
1110template <class _Dest, class _Source>1158template <class _Dest, class _Source>
...@@ -1510,7 +1558,7 @@ template <class _Operator>...@@ -1510,7 +1558,7 @@ template <class _Operator>
1510struct __convert_to_bool {1558struct __convert_to_bool {
1511 template <class _T1, class _T2>1559 template <class _T1, class _T2>
1512 _LIBCPP_INLINE_VISIBILITY constexpr bool operator()(_T1 && __t1, _T2&& __t2) const {1560 _LIBCPP_INLINE_VISIBILITY constexpr bool operator()(_T1 && __t1, _T2&& __t2) const {
1513 static_assert(std::is_convertible<decltype(_Operator{}(_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2))), bool>::value,1561 static_assert(is_convertible<decltype(_Operator{}(_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2))), bool>::value,
1514 "the relational operator does not return a type which is implicitly convertible to bool");1562 "the relational operator does not return a type which is implicitly convertible to bool");
1515 return _Operator{}(_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2));1563 return _Operator{}(_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2));
1516 }1564 }
...@@ -1587,21 +1635,38 @@ constexpr bool operator>=(const variant<_Types...>& __lhs,...@@ -1587,21 +1635,38 @@ constexpr bool operator>=(const variant<_Types...>& __lhs,
1587 __lhs.index(), __convert_to_bool<greater_equal<>>{}, __lhs, __rhs);1635 __lhs.index(), __convert_to_bool<greater_equal<>>{}, __lhs, __rhs);
1588}1636}
15891637
1638template <class... _Vs>
1639inline _LIBCPP_INLINE_VISIBILITY
1640_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
1641constexpr void __throw_if_valueless(_Vs&&... __vs) {
1642 const bool __valueless = (... || __vs.valueless_by_exception());
1643 if (__valueless) {
1644 __throw_bad_variant_access();
1645 }
1646}
1647
1590template <class _Visitor, class... _Vs>1648template <class _Visitor, class... _Vs>
1591inline _LIBCPP_INLINE_VISIBILITY1649inline _LIBCPP_INLINE_VISIBILITY
1592_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS1650_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
1593constexpr decltype(auto) visit(_Visitor&& __visitor, _Vs&&... __vs) {1651constexpr decltype(auto) visit(_Visitor&& __visitor, _Vs&&... __vs) {
1594 using __variant_detail::__visitation::__variant;1652 using __variant_detail::__visitation::__variant;
1595 bool __results[] = {__vs.valueless_by_exception()...};1653 _VSTD::__throw_if_valueless(_VSTD::forward<_Vs>(__vs)...);
1596 for (bool __result : __results) {
1597 if (__result) {
1598 __throw_bad_variant_access();
1599 }
1600 }
1601 return __variant::__visit_value(_VSTD::forward<_Visitor>(__visitor),1654 return __variant::__visit_value(_VSTD::forward<_Visitor>(__visitor),
1602 _VSTD::forward<_Vs>(__vs)...);1655 _VSTD::forward<_Vs>(__vs)...);
1603}1656}
16041657
1658#if _LIBCPP_STD_VER > 17
1659template <class _Rp, class _Visitor, class... _Vs>
1660inline _LIBCPP_INLINE_VISIBILITY
1661_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
1662constexpr _Rp visit(_Visitor&& __visitor, _Vs&&... __vs) {
1663 using __variant_detail::__visitation::__variant;
1664 _VSTD::__throw_if_valueless(_VSTD::forward<_Vs>(__vs)...);
1665 return __variant::__visit_value<_Rp>(_VSTD::forward<_Visitor>(__visitor),
1666 _VSTD::forward<_Vs>(__vs)...);
1667}
1668#endif
1669
1605struct _LIBCPP_TEMPLATE_VIS monostate {};1670struct _LIBCPP_TEMPLATE_VIS monostate {};
16061671
1607inline _LIBCPP_INLINE_VISIBILITY1672inline _LIBCPP_INLINE_VISIBILITY
lib/libcxx/include/vector+48-51
...@@ -454,7 +454,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -454,7 +454,7 @@ inline _LIBCPP_INLINE_VISIBILITY
454__vector_base<_Tp, _Allocator>::__vector_base(allocator_type&& __a) _NOEXCEPT454__vector_base<_Tp, _Allocator>::__vector_base(allocator_type&& __a) _NOEXCEPT
455 : __begin_(nullptr),455 : __begin_(nullptr),
456 __end_(nullptr),456 __end_(nullptr),
457 __end_cap_(nullptr, std::move(__a)) {}457 __end_cap_(nullptr, _VSTD::move(__a)) {}
458#endif458#endif
459459
460template <class _Tp, class _Allocator>460template <class _Tp, class _Allocator>
...@@ -496,7 +496,7 @@ public:...@@ -496,7 +496,7 @@ public:
496 _LIBCPP_INLINE_VISIBILITY496 _LIBCPP_INLINE_VISIBILITY
497 vector() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)497 vector() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
498 {498 {
499#if _LIBCPP_DEBUG_LEVEL >= 2499#if _LIBCPP_DEBUG_LEVEL == 2
500 __get_db()->__insert_c(this);500 __get_db()->__insert_c(this);
501#endif501#endif
502 }502 }
...@@ -508,7 +508,7 @@ public:...@@ -508,7 +508,7 @@ public:
508#endif508#endif
509 : __base(__a)509 : __base(__a)
510 {510 {
511#if _LIBCPP_DEBUG_LEVEL >= 2511#if _LIBCPP_DEBUG_LEVEL == 2
512 __get_db()->__insert_c(this);512 __get_db()->__insert_c(this);
513#endif513#endif
514 }514 }
...@@ -551,7 +551,7 @@ public:...@@ -551,7 +551,7 @@ public:
551 ~vector()551 ~vector()
552 {552 {
553 __annotate_delete();553 __annotate_delete();
554#if _LIBCPP_DEBUG_LEVEL >= 2554#if _LIBCPP_DEBUG_LEVEL == 2
555 __get_db()->__erase_c(this);555 __get_db()->__erase_c(this);
556#endif556#endif
557 }557 }
...@@ -789,14 +789,14 @@ public:...@@ -789,14 +789,14 @@ public:
789789
790 bool __invariants() const;790 bool __invariants() const;
791791
792#if _LIBCPP_DEBUG_LEVEL >= 2792#if _LIBCPP_DEBUG_LEVEL == 2
793793
794 bool __dereferenceable(const const_iterator* __i) const;794 bool __dereferenceable(const const_iterator* __i) const;
795 bool __decrementable(const const_iterator* __i) const;795 bool __decrementable(const const_iterator* __i) const;
796 bool __addable(const const_iterator* __i, ptrdiff_t __n) const;796 bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
797 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;797 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
798798
799#endif // _LIBCPP_DEBUG_LEVEL >= 2799#endif // _LIBCPP_DEBUG_LEVEL == 2
800800
801private:801private:
802 _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();802 _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
...@@ -931,7 +931,7 @@ private:...@@ -931,7 +931,7 @@ private:
931931
932#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES932#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
933template<class _InputIterator,933template<class _InputIterator,
934 class _Alloc = typename std::allocator<typename iterator_traits<_InputIterator>::value_type>,934 class _Alloc = allocator<typename iterator_traits<_InputIterator>::value_type>,
935 class = typename enable_if<__is_allocator<_Alloc>::value, void>::type935 class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
936 >936 >
937vector(_InputIterator, _InputIterator)937vector(_InputIterator, _InputIterator)
...@@ -951,8 +951,7 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a...@@ -951,8 +951,7 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a
951{951{
952952
953 __annotate_delete();953 __annotate_delete();
954 __alloc_traits::__construct_backward_with_exception_guarantees(954 _VSTD::__construct_backward_with_exception_guarantees(this->__alloc(), this->__begin_, this->__end_, __v.__begin_);
955 this->__alloc(), this->__begin_, this->__end_, __v.__begin_);
956 _VSTD::swap(this->__begin_, __v.__begin_);955 _VSTD::swap(this->__begin_, __v.__begin_);
957 _VSTD::swap(this->__end_, __v.__end_);956 _VSTD::swap(this->__end_, __v.__end_);
958 _VSTD::swap(this->__end_cap(), __v.__end_cap());957 _VSTD::swap(this->__end_cap(), __v.__end_cap());
...@@ -967,10 +966,8 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a...@@ -967,10 +966,8 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a
967{966{
968 __annotate_delete();967 __annotate_delete();
969 pointer __r = __v.__begin_;968 pointer __r = __v.__begin_;
970 __alloc_traits::__construct_backward_with_exception_guarantees(969 _VSTD::__construct_backward_with_exception_guarantees(this->__alloc(), this->__begin_, __p, __v.__begin_);
971 this->__alloc(), this->__begin_, __p, __v.__begin_);970 _VSTD::__construct_forward_with_exception_guarantees(this->__alloc(), __p, this->__end_, __v.__end_);
972 __alloc_traits::__construct_forward_with_exception_guarantees(
973 this->__alloc(), __p, this->__end_, __v.__end_);
974 _VSTD::swap(this->__begin_, __v.__begin_);971 _VSTD::swap(this->__begin_, __v.__begin_);
975 _VSTD::swap(this->__end_, __v.__end_);972 _VSTD::swap(this->__end_, __v.__end_);
976 _VSTD::swap(this->__end_cap(), __v.__end_cap());973 _VSTD::swap(this->__end_cap(), __v.__end_cap());
...@@ -1077,7 +1074,7 @@ typename enable_if...@@ -1077,7 +1074,7 @@ typename enable_if
1077vector<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n)1074vector<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n)
1078{1075{
1079 _ConstructTransaction __tx(*this, __n);1076 _ConstructTransaction __tx(*this, __n);
1080 __alloc_traits::__construct_range_forward(this->__alloc(), __first, __last, __tx.__pos_);1077 _VSTD::__construct_range_forward(this->__alloc(), __first, __last, __tx.__pos_);
1081}1078}
10821079
1083// Default constructs __n objects starting at __end_1080// Default constructs __n objects starting at __end_
...@@ -1121,7 +1118,7 @@ vector<_Tp, _Allocator>::__append(size_type __n, const_reference __x)...@@ -1121,7 +1118,7 @@ vector<_Tp, _Allocator>::__append(size_type __n, const_reference __x)
1121template <class _Tp, class _Allocator>1118template <class _Tp, class _Allocator>
1122vector<_Tp, _Allocator>::vector(size_type __n)1119vector<_Tp, _Allocator>::vector(size_type __n)
1123{1120{
1124#if _LIBCPP_DEBUG_LEVEL >= 21121#if _LIBCPP_DEBUG_LEVEL == 2
1125 __get_db()->__insert_c(this);1122 __get_db()->__insert_c(this);
1126#endif1123#endif
1127 if (__n > 0)1124 if (__n > 0)
...@@ -1136,7 +1133,7 @@ template <class _Tp, class _Allocator>...@@ -1136,7 +1133,7 @@ template <class _Tp, class _Allocator>
1136vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)1133vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)
1137 : __base(__a)1134 : __base(__a)
1138{1135{
1139#if _LIBCPP_DEBUG_LEVEL >= 21136#if _LIBCPP_DEBUG_LEVEL == 2
1140 __get_db()->__insert_c(this);1137 __get_db()->__insert_c(this);
1141#endif1138#endif
1142 if (__n > 0)1139 if (__n > 0)
...@@ -1150,7 +1147,7 @@ vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)...@@ -1150,7 +1147,7 @@ vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)
1150template <class _Tp, class _Allocator>1147template <class _Tp, class _Allocator>
1151vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x)1148vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x)
1152{1149{
1153#if _LIBCPP_DEBUG_LEVEL >= 21150#if _LIBCPP_DEBUG_LEVEL == 2
1154 __get_db()->__insert_c(this);1151 __get_db()->__insert_c(this);
1155#endif1152#endif
1156 if (__n > 0)1153 if (__n > 0)
...@@ -1164,7 +1161,7 @@ template <class _Tp, class _Allocator>...@@ -1164,7 +1161,7 @@ template <class _Tp, class _Allocator>
1164vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x, const allocator_type& __a)1161vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x, const allocator_type& __a)
1165 : __base(__a)1162 : __base(__a)
1166{1163{
1167#if _LIBCPP_DEBUG_LEVEL >= 21164#if _LIBCPP_DEBUG_LEVEL == 2
1168 __get_db()->__insert_c(this);1165 __get_db()->__insert_c(this);
1169#endif1166#endif
1170 if (__n > 0)1167 if (__n > 0)
...@@ -1184,7 +1181,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first,...@@ -1184,7 +1181,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first,
1184 typename iterator_traits<_InputIterator>::reference>::value,1181 typename iterator_traits<_InputIterator>::reference>::value,
1185 _InputIterator>::type __last)1182 _InputIterator>::type __last)
1186{1183{
1187#if _LIBCPP_DEBUG_LEVEL >= 21184#if _LIBCPP_DEBUG_LEVEL == 2
1188 __get_db()->__insert_c(this);1185 __get_db()->__insert_c(this);
1189#endif1186#endif
1190 for (; __first != __last; ++__first)1187 for (; __first != __last; ++__first)
...@@ -1201,7 +1198,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, c...@@ -1201,7 +1198,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, c
1201 typename iterator_traits<_InputIterator>::reference>::value>::type*)1198 typename iterator_traits<_InputIterator>::reference>::value>::type*)
1202 : __base(__a)1199 : __base(__a)
1203{1200{
1204#if _LIBCPP_DEBUG_LEVEL >= 21201#if _LIBCPP_DEBUG_LEVEL == 2
1205 __get_db()->__insert_c(this);1202 __get_db()->__insert_c(this);
1206#endif1203#endif
1207 for (; __first != __last; ++__first)1204 for (; __first != __last; ++__first)
...@@ -1217,7 +1214,7 @@ vector<_Tp, _Allocator>::vector(_ForwardIterator __first,...@@ -1217,7 +1214,7 @@ vector<_Tp, _Allocator>::vector(_ForwardIterator __first,
1217 typename iterator_traits<_ForwardIterator>::reference>::value,1214 typename iterator_traits<_ForwardIterator>::reference>::value,
1218 _ForwardIterator>::type __last)1215 _ForwardIterator>::type __last)
1219{1216{
1220#if _LIBCPP_DEBUG_LEVEL >= 21217#if _LIBCPP_DEBUG_LEVEL == 2
1221 __get_db()->__insert_c(this);1218 __get_db()->__insert_c(this);
1222#endif1219#endif
1223 size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));1220 size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
...@@ -1237,7 +1234,7 @@ vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __las...@@ -1237,7 +1234,7 @@ vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __las
1237 typename iterator_traits<_ForwardIterator>::reference>::value>::type*)1234 typename iterator_traits<_ForwardIterator>::reference>::value>::type*)
1238 : __base(__a)1235 : __base(__a)
1239{1236{
1240#if _LIBCPP_DEBUG_LEVEL >= 21237#if _LIBCPP_DEBUG_LEVEL == 2
1241 __get_db()->__insert_c(this);1238 __get_db()->__insert_c(this);
1242#endif1239#endif
1243 size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));1240 size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
...@@ -1252,7 +1249,7 @@ template <class _Tp, class _Allocator>...@@ -1252,7 +1249,7 @@ template <class _Tp, class _Allocator>
1252vector<_Tp, _Allocator>::vector(const vector& __x)1249vector<_Tp, _Allocator>::vector(const vector& __x)
1253 : __base(__alloc_traits::select_on_container_copy_construction(__x.__alloc()))1250 : __base(__alloc_traits::select_on_container_copy_construction(__x.__alloc()))
1254{1251{
1255#if _LIBCPP_DEBUG_LEVEL >= 21252#if _LIBCPP_DEBUG_LEVEL == 2
1256 __get_db()->__insert_c(this);1253 __get_db()->__insert_c(this);
1257#endif1254#endif
1258 size_type __n = __x.size();1255 size_type __n = __x.size();
...@@ -1267,7 +1264,7 @@ template <class _Tp, class _Allocator>...@@ -1267,7 +1264,7 @@ template <class _Tp, class _Allocator>
1267vector<_Tp, _Allocator>::vector(const vector& __x, const allocator_type& __a)1264vector<_Tp, _Allocator>::vector(const vector& __x, const allocator_type& __a)
1268 : __base(__a)1265 : __base(__a)
1269{1266{
1270#if _LIBCPP_DEBUG_LEVEL >= 21267#if _LIBCPP_DEBUG_LEVEL == 2
1271 __get_db()->__insert_c(this);1268 __get_db()->__insert_c(this);
1272#endif1269#endif
1273 size_type __n = __x.size();1270 size_type __n = __x.size();
...@@ -1290,7 +1287,7 @@ vector<_Tp, _Allocator>::vector(vector&& __x)...@@ -1290,7 +1287,7 @@ vector<_Tp, _Allocator>::vector(vector&& __x)
1290#endif1287#endif
1291 : __base(_VSTD::move(__x.__alloc()))1288 : __base(_VSTD::move(__x.__alloc()))
1292{1289{
1293#if _LIBCPP_DEBUG_LEVEL >= 21290#if _LIBCPP_DEBUG_LEVEL == 2
1294 __get_db()->__insert_c(this);1291 __get_db()->__insert_c(this);
1295 __get_db()->swap(this, &__x);1292 __get_db()->swap(this, &__x);
1296#endif1293#endif
...@@ -1305,7 +1302,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -1305,7 +1302,7 @@ inline _LIBCPP_INLINE_VISIBILITY
1305vector<_Tp, _Allocator>::vector(vector&& __x, const allocator_type& __a)1302vector<_Tp, _Allocator>::vector(vector&& __x, const allocator_type& __a)
1306 : __base(__a)1303 : __base(__a)
1307{1304{
1308#if _LIBCPP_DEBUG_LEVEL >= 21305#if _LIBCPP_DEBUG_LEVEL == 2
1309 __get_db()->__insert_c(this);1306 __get_db()->__insert_c(this);
1310#endif1307#endif
1311 if (__a == __x.__alloc())1308 if (__a == __x.__alloc())
...@@ -1314,7 +1311,7 @@ vector<_Tp, _Allocator>::vector(vector&& __x, const allocator_type& __a)...@@ -1314,7 +1311,7 @@ vector<_Tp, _Allocator>::vector(vector&& __x, const allocator_type& __a)
1314 this->__end_ = __x.__end_;1311 this->__end_ = __x.__end_;
1315 this->__end_cap() = __x.__end_cap();1312 this->__end_cap() = __x.__end_cap();
1316 __x.__begin_ = __x.__end_ = __x.__end_cap() = nullptr;1313 __x.__begin_ = __x.__end_ = __x.__end_cap() = nullptr;
1317#if _LIBCPP_DEBUG_LEVEL >= 21314#if _LIBCPP_DEBUG_LEVEL == 2
1318 __get_db()->swap(this, &__x);1315 __get_db()->swap(this, &__x);
1319#endif1316#endif
1320 }1317 }
...@@ -1329,7 +1326,7 @@ template <class _Tp, class _Allocator>...@@ -1329,7 +1326,7 @@ template <class _Tp, class _Allocator>
1329inline _LIBCPP_INLINE_VISIBILITY1326inline _LIBCPP_INLINE_VISIBILITY
1330vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il)1327vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il)
1331{1328{
1332#if _LIBCPP_DEBUG_LEVEL >= 21329#if _LIBCPP_DEBUG_LEVEL == 2
1333 __get_db()->__insert_c(this);1330 __get_db()->__insert_c(this);
1334#endif1331#endif
1335 if (__il.size() > 0)1332 if (__il.size() > 0)
...@@ -1344,7 +1341,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -1344,7 +1341,7 @@ inline _LIBCPP_INLINE_VISIBILITY
1344vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il, const allocator_type& __a)1341vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il, const allocator_type& __a)
1345 : __base(__a)1342 : __base(__a)
1346{1343{
1347#if _LIBCPP_DEBUG_LEVEL >= 21344#if _LIBCPP_DEBUG_LEVEL == 2
1348 __get_db()->__insert_c(this);1345 __get_db()->__insert_c(this);
1349#endif1346#endif
1350 if (__il.size() > 0)1347 if (__il.size() > 0)
...@@ -1390,7 +1387,7 @@ vector<_Tp, _Allocator>::__move_assign(vector& __c, true_type)...@@ -1390,7 +1387,7 @@ vector<_Tp, _Allocator>::__move_assign(vector& __c, true_type)
1390 this->__end_ = __c.__end_;1387 this->__end_ = __c.__end_;
1391 this->__end_cap() = __c.__end_cap();1388 this->__end_cap() = __c.__end_cap();
1392 __c.__begin_ = __c.__end_ = __c.__end_cap() = nullptr;1389 __c.__begin_ = __c.__end_ = __c.__end_cap() = nullptr;
1393#if _LIBCPP_DEBUG_LEVEL >= 21390#if _LIBCPP_DEBUG_LEVEL == 2
1394 __get_db()->swap(this, &__c);1391 __get_db()->swap(this, &__c);
1395#endif1392#endif
1396}1393}
...@@ -1493,7 +1490,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -1493,7 +1490,7 @@ inline _LIBCPP_INLINE_VISIBILITY
1493typename vector<_Tp, _Allocator>::iterator1490typename vector<_Tp, _Allocator>::iterator
1494vector<_Tp, _Allocator>::__make_iter(pointer __p) _NOEXCEPT1491vector<_Tp, _Allocator>::__make_iter(pointer __p) _NOEXCEPT
1495{1492{
1496#if _LIBCPP_DEBUG_LEVEL >= 21493#if _LIBCPP_DEBUG_LEVEL == 2
1497 return iterator(this, __p);1494 return iterator(this, __p);
1498#else1495#else
1499 return iterator(__p);1496 return iterator(__p);
...@@ -1505,7 +1502,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -1505,7 +1502,7 @@ inline _LIBCPP_INLINE_VISIBILITY
1505typename vector<_Tp, _Allocator>::const_iterator1502typename vector<_Tp, _Allocator>::const_iterator
1506vector<_Tp, _Allocator>::__make_iter(const_pointer __p) const _NOEXCEPT1503vector<_Tp, _Allocator>::__make_iter(const_pointer __p) const _NOEXCEPT
1507{1504{
1508#if _LIBCPP_DEBUG_LEVEL >= 21505#if _LIBCPP_DEBUG_LEVEL == 2
1509 return const_iterator(this, __p);1506 return const_iterator(this, __p);
1510#else1507#else
1511 return const_iterator(__p);1508 return const_iterator(__p);
...@@ -1709,7 +1706,7 @@ inline _LIBCPP_INLINE_VISIBILITY...@@ -1709,7 +1706,7 @@ inline _LIBCPP_INLINE_VISIBILITY
1709typename vector<_Tp, _Allocator>::iterator1706typename vector<_Tp, _Allocator>::iterator
1710vector<_Tp, _Allocator>::erase(const_iterator __position)1707vector<_Tp, _Allocator>::erase(const_iterator __position)
1711{1708{
1712#if _LIBCPP_DEBUG_LEVEL >= 21709#if _LIBCPP_DEBUG_LEVEL == 2
1713 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,1710 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
1714 "vector::erase(iterator) called with an iterator not"1711 "vector::erase(iterator) called with an iterator not"
1715 " referring to this vector");1712 " referring to this vector");
...@@ -1728,7 +1725,7 @@ template <class _Tp, class _Allocator>...@@ -1728,7 +1725,7 @@ template <class _Tp, class _Allocator>
1728typename vector<_Tp, _Allocator>::iterator1725typename vector<_Tp, _Allocator>::iterator
1729vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last)1726vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last)
1730{1727{
1731#if _LIBCPP_DEBUG_LEVEL >= 21728#if _LIBCPP_DEBUG_LEVEL == 2
1732 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,1729 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,
1733 "vector::erase(iterator, iterator) called with an iterator not"1730 "vector::erase(iterator, iterator) called with an iterator not"
1734 " referring to this vector");1731 " referring to this vector");
...@@ -1769,7 +1766,7 @@ template <class _Tp, class _Allocator>...@@ -1769,7 +1766,7 @@ template <class _Tp, class _Allocator>
1769typename vector<_Tp, _Allocator>::iterator1766typename vector<_Tp, _Allocator>::iterator
1770vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)1767vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)
1771{1768{
1772#if _LIBCPP_DEBUG_LEVEL >= 21769#if _LIBCPP_DEBUG_LEVEL == 2
1773 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,1770 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
1774 "vector::insert(iterator, x) called with an iterator not"1771 "vector::insert(iterator, x) called with an iterator not"
1775 " referring to this vector");1772 " referring to this vector");
...@@ -1806,7 +1803,7 @@ template <class _Tp, class _Allocator>...@@ -1806,7 +1803,7 @@ template <class _Tp, class _Allocator>
1806typename vector<_Tp, _Allocator>::iterator1803typename vector<_Tp, _Allocator>::iterator
1807vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x)1804vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x)
1808{1805{
1809#if _LIBCPP_DEBUG_LEVEL >= 21806#if _LIBCPP_DEBUG_LEVEL == 2
1810 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,1807 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
1811 "vector::insert(iterator, x) called with an iterator not"1808 "vector::insert(iterator, x) called with an iterator not"
1812 " referring to this vector");1809 " referring to this vector");
...@@ -1839,7 +1836,7 @@ template <class... _Args>...@@ -1839,7 +1836,7 @@ template <class... _Args>
1839typename vector<_Tp, _Allocator>::iterator1836typename vector<_Tp, _Allocator>::iterator
1840vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args)1837vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args)
1841{1838{
1842#if _LIBCPP_DEBUG_LEVEL >= 21839#if _LIBCPP_DEBUG_LEVEL == 2
1843 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,1840 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
1844 "vector::emplace(iterator, x) called with an iterator not"1841 "vector::emplace(iterator, x) called with an iterator not"
1845 " referring to this vector");1842 " referring to this vector");
...@@ -1874,7 +1871,7 @@ template <class _Tp, class _Allocator>...@@ -1874,7 +1871,7 @@ template <class _Tp, class _Allocator>
1874typename vector<_Tp, _Allocator>::iterator1871typename vector<_Tp, _Allocator>::iterator
1875vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_reference __x)1872vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_reference __x)
1876{1873{
1877#if _LIBCPP_DEBUG_LEVEL >= 21874#if _LIBCPP_DEBUG_LEVEL == 2
1878 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,1875 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
1879 "vector::insert(iterator, n, x) called with an iterator not"1876 "vector::insert(iterator, n, x) called with an iterator not"
1880 " referring to this vector");1877 " referring to this vector");
...@@ -1925,7 +1922,7 @@ typename enable_if...@@ -1925,7 +1922,7 @@ typename enable_if
1925>::type1922>::type
1926vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __first, _InputIterator __last)1923vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __first, _InputIterator __last)
1927{1924{
1928#if _LIBCPP_DEBUG_LEVEL >= 21925#if _LIBCPP_DEBUG_LEVEL == 2
1929 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,1926 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
1930 "vector::insert(iterator, range) called with an iterator not"1927 "vector::insert(iterator, range) called with an iterator not"
1931 " referring to this vector");1928 " referring to this vector");
...@@ -1978,7 +1975,7 @@ typename enable_if...@@ -1978,7 +1975,7 @@ typename enable_if
1978>::type1975>::type
1979vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)1976vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
1980{1977{
1981#if _LIBCPP_DEBUG_LEVEL >= 21978#if _LIBCPP_DEBUG_LEVEL == 2
1982 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,1979 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
1983 "vector::insert(iterator, range) called with an iterator not"1980 "vector::insert(iterator, range) called with an iterator not"
1984 " referring to this vector");1981 " referring to this vector");
...@@ -2057,11 +2054,11 @@ vector<_Tp, _Allocator>::swap(vector& __x)...@@ -2057,11 +2054,11 @@ vector<_Tp, _Allocator>::swap(vector& __x)
2057 _VSTD::swap(this->__begin_, __x.__begin_);2054 _VSTD::swap(this->__begin_, __x.__begin_);
2058 _VSTD::swap(this->__end_, __x.__end_);2055 _VSTD::swap(this->__end_, __x.__end_);
2059 _VSTD::swap(this->__end_cap(), __x.__end_cap());2056 _VSTD::swap(this->__end_cap(), __x.__end_cap());
2060 __swap_allocator(this->__alloc(), __x.__alloc(),2057 _VSTD::__swap_allocator(this->__alloc(), __x.__alloc(),
2061 integral_constant<bool,__alloc_traits::propagate_on_container_swap::value>());2058 integral_constant<bool,__alloc_traits::propagate_on_container_swap::value>());
2062#if _LIBCPP_DEBUG_LEVEL >= 22059#if _LIBCPP_DEBUG_LEVEL == 2
2063 __get_db()->swap(this, &__x);2060 __get_db()->swap(this, &__x);
2064#endif // _LIBCPP_DEBUG_LEVEL >= 22061#endif
2065}2062}
20662063
2067template <class _Tp, class _Allocator>2064template <class _Tp, class _Allocator>
...@@ -2085,7 +2082,7 @@ vector<_Tp, _Allocator>::__invariants() const...@@ -2085,7 +2082,7 @@ vector<_Tp, _Allocator>::__invariants() const
2085 return true;2082 return true;
2086}2083}
20872084
2088#if _LIBCPP_DEBUG_LEVEL >= 22085#if _LIBCPP_DEBUG_LEVEL == 2
20892086
2090template <class _Tp, class _Allocator>2087template <class _Tp, class _Allocator>
2091bool2088bool
...@@ -2117,16 +2114,16 @@ vector<_Tp, _Allocator>::__subscriptable(const const_iterator* __i, ptrdiff_t __...@@ -2117,16 +2114,16 @@ vector<_Tp, _Allocator>::__subscriptable(const const_iterator* __i, ptrdiff_t __
2117 return this->__begin_ <= __p && __p < this->__end_;2114 return this->__begin_ <= __p && __p < this->__end_;
2118}2115}
21192116
2120#endif // _LIBCPP_DEBUG_LEVEL >= 22117#endif // _LIBCPP_DEBUG_LEVEL == 2
21212118
2122template <class _Tp, class _Allocator>2119template <class _Tp, class _Allocator>
2123inline _LIBCPP_INLINE_VISIBILITY2120inline _LIBCPP_INLINE_VISIBILITY
2124void2121void
2125vector<_Tp, _Allocator>::__invalidate_all_iterators()2122vector<_Tp, _Allocator>::__invalidate_all_iterators()
2126{2123{
2127#if _LIBCPP_DEBUG_LEVEL >= 22124#if _LIBCPP_DEBUG_LEVEL == 2
2128 __get_db()->__invalidate_all(this);2125 __get_db()->__invalidate_all(this);
2129#endif // _LIBCPP_DEBUG_LEVEL >= 22126#endif
2130}2127}
21312128
21322129
...@@ -2134,7 +2131,7 @@ template <class _Tp, class _Allocator>...@@ -2134,7 +2131,7 @@ template <class _Tp, class _Allocator>
2134inline _LIBCPP_INLINE_VISIBILITY2131inline _LIBCPP_INLINE_VISIBILITY
2135void2132void
2136vector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) {2133vector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) {
2137#if _LIBCPP_DEBUG_LEVEL >= 22134#if _LIBCPP_DEBUG_LEVEL == 2
2138 __c_node* __c = __get_db()->__find_c_and_lock(this);2135 __c_node* __c = __get_db()->__find_c_and_lock(this);
2139 for (__i_node** __p = __c->end_; __p != __c->beg_; ) {2136 for (__i_node** __p = __c->end_; __p != __c->beg_; ) {
2140 --__p;2137 --__p;
...@@ -2142,7 +2139,7 @@ vector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) {...@@ -2142,7 +2139,7 @@ vector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) {
2142 if (__i->base() > __new_last) {2139 if (__i->base() > __new_last) {
2143 (*__p)->__c_ = nullptr;2140 (*__p)->__c_ = nullptr;
2144 if (--__c->end_ != __p)2141 if (--__c->end_ != __p)
2145 memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));2142 _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
2146 }2143 }
2147 }2144 }
2148 __get_db()->unlock();2145 __get_db()->unlock();
...@@ -2883,7 +2880,7 @@ inline _LIBCPP_INLINE_VISIBILITY vector<bool, _Allocator>::vector(vector&& __v)...@@ -2883,7 +2880,7 @@ inline _LIBCPP_INLINE_VISIBILITY vector<bool, _Allocator>::vector(vector&& __v)
2883#endif2880#endif
2884 : __begin_(__v.__begin_),2881 : __begin_(__v.__begin_),
2885 __size_(__v.__size_),2882 __size_(__v.__size_),
2886 __cap_alloc_(std::move(__v.__cap_alloc_)) {2883 __cap_alloc_(_VSTD::move(__v.__cap_alloc_)) {
2887 __v.__begin_ = nullptr;2884 __v.__begin_ = nullptr;
2888 __v.__size_ = 0;2885 __v.__size_ = 0;
2889 __v.__cap() = 0;2886 __v.__cap() = 0;
...@@ -3235,7 +3232,7 @@ vector<bool, _Allocator>::swap(vector& __x)...@@ -3235,7 +3232,7 @@ vector<bool, _Allocator>::swap(vector& __x)
3235 _VSTD::swap(this->__begin_, __x.__begin_);3232 _VSTD::swap(this->__begin_, __x.__begin_);
3236 _VSTD::swap(this->__size_, __x.__size_);3233 _VSTD::swap(this->__size_, __x.__size_);
3237 _VSTD::swap(this->__cap(), __x.__cap());3234 _VSTD::swap(this->__cap(), __x.__cap());
3238 __swap_allocator(this->__alloc(), __x.__alloc(),3235 _VSTD::__swap_allocator(this->__alloc(), __x.__alloc(),
3239 integral_constant<bool, __alloc_traits::propagate_on_container_swap::value>());3236 integral_constant<bool, __alloc_traits::propagate_on_container_swap::value>());
3240}3237}
32413238
lib/libcxx/include/version+142-28
...@@ -15,20 +15,30 @@...@@ -15,20 +15,30 @@
1515
16Macro name Value Headers16Macro name Value Headers
17__cpp_lib_addressof_constexpr 201603L <memory>17__cpp_lib_addressof_constexpr 201603L <memory>
18__cpp_lib_allocator_traits_is_always_equal 201411L <memory> <scoped_allocator> <string>18__cpp_lib_allocator_traits_is_always_equal 201411L <deque> <forward_list> <list>
19 <deque> <forward_list> <list>19 <map> <memory> <scoped_allocator>
20 <vector> <map> <set>20 <set> <string> <unordered_map>
21 <unordered_map> <unordered_set>21 <unordered_set> <vector>
22__cpp_lib_any 201606L <any>22__cpp_lib_any 201606L <any>
23__cpp_lib_apply 201603L <tuple>23__cpp_lib_apply 201603L <tuple>
24__cpp_lib_array_constexpr 201811L <iterator> <array>24__cpp_lib_array_constexpr 201811L <array> <iterator>
25 201603L // C++1725 201603L // C++17
26__cpp_lib_as_const 201510L <utility>26__cpp_lib_as_const 201510L <utility>
27__cpp_lib_assume_aligned 201811L <memory>
28__cpp_lib_atomic_flag_test 201907L <atomic>
29__cpp_lib_atomic_float 201711L <atomic>
27__cpp_lib_atomic_is_always_lock_free 201603L <atomic>30__cpp_lib_atomic_is_always_lock_free 201603L <atomic>
31__cpp_lib_atomic_lock_free_type_aliases 201907L <atomic>
28__cpp_lib_atomic_ref 201806L <atomic>32__cpp_lib_atomic_ref 201806L <atomic>
29__cpp_lib_bind_front 201811L <functional>33__cpp_lib_atomic_shared_ptr 201711L <atomic>
34__cpp_lib_atomic_value_initialization 201911L <atomic> <memory>
35__cpp_lib_atomic_wait 201907L <atomic>
36__cpp_lib_barrier 201907L <barrier>
37__cpp_lib_bind_front 201907L <functional>
30__cpp_lib_bit_cast 201806L <bit>38__cpp_lib_bit_cast 201806L <bit>
39__cpp_lib_bitops 201907L <bit>
31__cpp_lib_bool_constant 201505L <type_traits>40__cpp_lib_bool_constant 201505L <type_traits>
41__cpp_lib_bounded_array_traits 201902L <type_traits>
32__cpp_lib_boyer_moore_searcher 201603L <functional>42__cpp_lib_boyer_moore_searcher 201603L <functional>
33__cpp_lib_byte 201603L <cstddef>43__cpp_lib_byte 201603L <cstddef>
34__cpp_lib_char8_t 201811L <atomic> <filesystem> <istream>44__cpp_lib_char8_t 201811L <atomic> <filesystem> <istream>
...@@ -38,18 +48,29 @@ __cpp_lib_chrono 201611L <chrono>...@@ -38,18 +48,29 @@ __cpp_lib_chrono 201611L <chrono>
38__cpp_lib_chrono_udls 201304L <chrono>48__cpp_lib_chrono_udls 201304L <chrono>
39__cpp_lib_clamp 201603L <algorithm>49__cpp_lib_clamp 201603L <algorithm>
40__cpp_lib_complex_udls 201309L <complex>50__cpp_lib_complex_udls 201309L <complex>
41__cpp_lib_concepts 201806L <concepts>51__cpp_lib_concepts 202002L <concepts>
42__cpp_lib_constexpr_misc 201811L <array> <functional> <iterator>52__cpp_lib_constexpr_algorithms 201806L <algorithm>
43 <string_view> <tuple> <utility>53__cpp_lib_constexpr_complex 201711L <complex>
44__cpp_lib_constexpr_swap_algorithms 201806L <algorithm>54__cpp_lib_constexpr_dynamic_alloc 201907L <memory>
55__cpp_lib_constexpr_functional 201907L <functional>
56__cpp_lib_constexpr_iterator 201811L <iterator>
57__cpp_lib_constexpr_memory 201811L <memory>
58__cpp_lib_constexpr_numeric 201911L <numeric>
59__cpp_lib_constexpr_string 201907L <string>
60__cpp_lib_constexpr_string_view 201811L <string_view>
61__cpp_lib_constexpr_tuple 201811L <tuple>
62__cpp_lib_constexpr_utility 201811L <utility>
63__cpp_lib_constexpr_vector 201907L <vector>
64__cpp_lib_coroutine 201902L <coroutine>
45__cpp_lib_destroying_delete 201806L <new>65__cpp_lib_destroying_delete 201806L <new>
46__cpp_lib_enable_shared_from_this 201603L <memory>66__cpp_lib_enable_shared_from_this 201603L <memory>
47__cpp_lib_endian 201907L <bit>67__cpp_lib_endian 201907L <bit>
48__cpp_lib_erase_if 202002L <string> <deque> <forward_list>68__cpp_lib_erase_if 202002L <deque> <forward_list> <list>
49 <list> <vector> <map>69 <map> <set> <string>
50 <set> <unordered_map> <unordered_set>70 <unordered_map> <unordered_set> <vector>
51__cpp_lib_exchange_function 201304L <utility>71__cpp_lib_exchange_function 201304L <utility>
52__cpp_lib_execution 201603L <execution>72__cpp_lib_execution 201902L <execution>
73 201603L // C++17
53__cpp_lib_filesystem 201703L <filesystem>74__cpp_lib_filesystem 201703L <filesystem>
54__cpp_lib_gcd_lcm 201606L <numeric>75__cpp_lib_gcd_lcm 201606L <numeric>
55__cpp_lib_generic_associative_lookup 201304L <map> <set>76__cpp_lib_generic_associative_lookup 201304L <map> <set>
...@@ -58,16 +79,24 @@ __cpp_lib_hardware_interference_size 201703L <new>...@@ -58,16 +79,24 @@ __cpp_lib_hardware_interference_size 201703L <new>
58__cpp_lib_has_unique_object_representations 201606L <type_traits>79__cpp_lib_has_unique_object_representations 201606L <type_traits>
59__cpp_lib_hypot 201603L <cmath>80__cpp_lib_hypot 201603L <cmath>
60__cpp_lib_incomplete_container_elements 201505L <forward_list> <list> <vector>81__cpp_lib_incomplete_container_elements 201505L <forward_list> <list> <vector>
82__cpp_lib_int_pow2 202002L <bit>
83__cpp_lib_integer_comparison_functions 202002L <utility>
61__cpp_lib_integer_sequence 201304L <utility>84__cpp_lib_integer_sequence 201304L <utility>
62__cpp_lib_integral_constant_callable 201304L <type_traits>85__cpp_lib_integral_constant_callable 201304L <type_traits>
63__cpp_lib_interpolate 201902L <numeric>86__cpp_lib_interpolate 201902L <cmath> <numeric>
64__cpp_lib_invoke 201411L <functional>87__cpp_lib_invoke 201411L <functional>
65__cpp_lib_is_aggregate 201703L <type_traits>88__cpp_lib_is_aggregate 201703L <type_traits>
66__cpp_lib_is_constant_evaluated 201811L <type_traits>89__cpp_lib_is_constant_evaluated 201811L <type_traits>
67__cpp_lib_is_final 201402L <type_traits>90__cpp_lib_is_final 201402L <type_traits>
68__cpp_lib_is_invocable 201703L <type_traits>91__cpp_lib_is_invocable 201703L <type_traits>
92__cpp_lib_is_layout_compatible 201907L <type_traits>
93__cpp_lib_is_nothrow_convertible 201806L <type_traits>
69__cpp_lib_is_null_pointer 201309L <type_traits>94__cpp_lib_is_null_pointer 201309L <type_traits>
95__cpp_lib_is_pointer_interconvertible 201907L <type_traits>
96__cpp_lib_is_scoped_enum 202011L <type_traits>
70__cpp_lib_is_swappable 201603L <type_traits>97__cpp_lib_is_swappable 201603L <type_traits>
98__cpp_lib_jthread 201911L <stop_token> <thread>
99__cpp_lib_latch 201907L <latch>
71__cpp_lib_launder 201606L <new>100__cpp_lib_launder 201606L <new>
72__cpp_lib_list_remove_return_type 201806L <forward_list> <list>101__cpp_lib_list_remove_return_type 201806L <forward_list> <list>
73__cpp_lib_logical_traits 201510L <type_traits>102__cpp_lib_logical_traits 201510L <type_traits>
...@@ -80,40 +109,55 @@ __cpp_lib_math_special_functions 201603L <cmath>...@@ -80,40 +109,55 @@ __cpp_lib_math_special_functions 201603L <cmath>
80__cpp_lib_memory_resource 201603L <memory_resource>109__cpp_lib_memory_resource 201603L <memory_resource>
81__cpp_lib_node_extract 201606L <map> <set> <unordered_map>110__cpp_lib_node_extract 201606L <map> <set> <unordered_map>
82 <unordered_set>111 <unordered_set>
83__cpp_lib_nonmember_container_access 201411L <iterator> <array> <deque>112__cpp_lib_nonmember_container_access 201411L <array> <deque> <forward_list>
84 <forward_list> <list> <map>113 <iterator> <list> <map>
85 <regex> <set> <string>114 <regex> <set> <string>
86 <unordered_map> <unordered_set> <vector>115 <unordered_map> <unordered_set> <vector>
87__cpp_lib_not_fn 201603L <functional>116__cpp_lib_not_fn 201603L <functional>
88__cpp_lib_null_iterators 201304L <iterator>117__cpp_lib_null_iterators 201304L <iterator>
89__cpp_lib_optional 201606L <optional>118__cpp_lib_optional 201606L <optional>
90__cpp_lib_parallel_algorithm 201603L <algorithm> <numeric>119__cpp_lib_parallel_algorithm 201603L <algorithm> <numeric>
120__cpp_lib_polymorphic_allocator 201902L <memory>
91__cpp_lib_quoted_string_io 201304L <iomanip>121__cpp_lib_quoted_string_io 201304L <iomanip>
92__cpp_lib_ranges 201811L <algorithm> <functional> <iterator>122__cpp_lib_ranges 201811L <algorithm> <functional> <iterator>
93 <memory> <ranges>123 <memory> <ranges>
94__cpp_lib_raw_memory_algorithms 201606L <memory>124__cpp_lib_raw_memory_algorithms 201606L <memory>
125__cpp_lib_remove_cvref 201711L <type_traits>
95__cpp_lib_result_of_sfinae 201210L <functional> <type_traits>126__cpp_lib_result_of_sfinae 201210L <functional> <type_traits>
96__cpp_lib_robust_nonmodifying_seq_ops 201304L <algorithm>127__cpp_lib_robust_nonmodifying_seq_ops 201304L <algorithm>
97__cpp_lib_sample 201603L <algorithm>128__cpp_lib_sample 201603L <algorithm>
98__cpp_lib_scoped_lock 201703L <mutex>129__cpp_lib_scoped_lock 201703L <mutex>
130__cpp_lib_semaphore 201907L <semaphore>
99__cpp_lib_shared_mutex 201505L <shared_mutex>131__cpp_lib_shared_mutex 201505L <shared_mutex>
100__cpp_lib_shared_ptr_arrays 201611L <memory>132__cpp_lib_shared_ptr_arrays 201611L <memory>
101__cpp_lib_shared_ptr_weak_type 201606L <memory>133__cpp_lib_shared_ptr_weak_type 201606L <memory>
102__cpp_lib_shared_timed_mutex 201402L <shared_mutex>134__cpp_lib_shared_timed_mutex 201402L <shared_mutex>
135__cpp_lib_shift 201806L <algorithm>
136__cpp_lib_smart_ptr_for_overwrite 202002L <memory>
137__cpp_lib_source_location 201907L <source_location>
103__cpp_lib_span 202002L <span>138__cpp_lib_span 202002L <span>
139__cpp_lib_ssize 201902L <iterator>
140__cpp_lib_stacktrace 202011L <stacktrace>
141__cpp_lib_starts_ends_with 201711L <string> <string_view>
142__cpp_lib_stdatomic_h 202011L <stdatomic.h>
143__cpp_lib_string_contains 202011L <string> <string_view>
104__cpp_lib_string_udls 201304L <string>144__cpp_lib_string_udls 201304L <string>
105__cpp_lib_string_view 201606L <string> <string_view>145__cpp_lib_string_view 201803L <string> <string_view>
106__cpp_lib_three_way_comparison 201711L <compare>146 201606L // C++17
147__cpp_lib_syncbuf 201803L <syncstream>
148__cpp_lib_three_way_comparison 201907L <compare>
149__cpp_lib_to_address 201711L <memory>
107__cpp_lib_to_array 201907L <array>150__cpp_lib_to_array 201907L <array>
108__cpp_lib_to_chars 201611L <utility>151__cpp_lib_to_chars 201611L <utility>
109__cpp_lib_transformation_trait_aliases 201304L <type_traits>152__cpp_lib_transformation_trait_aliases 201304L <type_traits>
110__cpp_lib_transparent_operators 201510L <functional>153__cpp_lib_transparent_operators 201510L <functional> <memory>
111 201210L // C++14154 201210L // C++14
112__cpp_lib_tuple_element_t 201402L <tuple>155__cpp_lib_tuple_element_t 201402L <tuple>
113__cpp_lib_tuples_by_type 201304L <utility> <tuple>156__cpp_lib_tuples_by_type 201304L <tuple> <utility>
114__cpp_lib_type_trait_variable_templates 201510L <type_traits>157__cpp_lib_type_trait_variable_templates 201510L <type_traits>
115__cpp_lib_uncaught_exceptions 201411L <exception>158__cpp_lib_uncaught_exceptions 201411L <exception>
116__cpp_lib_unordered_map_try_emplace 201411L <unordered_map>159__cpp_lib_unordered_map_try_emplace 201411L <unordered_map>
160__cpp_lib_unwrap_ref 201811L <functional>
117__cpp_lib_variant 201606L <variant>161__cpp_lib_variant 201606L <variant>
118__cpp_lib_void_t 201411L <type_traits>162__cpp_lib_void_t 201411L <type_traits>
119163
...@@ -200,7 +244,7 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -200,7 +244,7 @@ __cpp_lib_void_t 201411L <type_traits>
200# if !defined(_LIBCPP_HAS_NO_THREADS)244# if !defined(_LIBCPP_HAS_NO_THREADS)
201# define __cpp_lib_shared_mutex 201505L245# define __cpp_lib_shared_mutex 201505L
202# endif246# endif
203// # define __cpp_lib_shared_ptr_arrays 201611L247# define __cpp_lib_shared_ptr_arrays 201611L
204# define __cpp_lib_shared_ptr_weak_type 201606L248# define __cpp_lib_shared_ptr_weak_type 201606L
205# define __cpp_lib_string_view 201606L249# define __cpp_lib_string_view 201606L
206// # define __cpp_lib_to_chars 201611L250// # define __cpp_lib_to_chars 201611L
...@@ -216,35 +260,105 @@ __cpp_lib_void_t 201411L <type_traits>...@@ -216,35 +260,105 @@ __cpp_lib_void_t 201411L <type_traits>
216#if _LIBCPP_STD_VER > 17260#if _LIBCPP_STD_VER > 17
217# undef __cpp_lib_array_constexpr261# undef __cpp_lib_array_constexpr
218# define __cpp_lib_array_constexpr 201811L262# define __cpp_lib_array_constexpr 201811L
263// # define __cpp_lib_assume_aligned 201811L
264# if !defined(_LIBCPP_HAS_NO_THREADS)
265# define __cpp_lib_atomic_flag_test 201907L
266# endif
267# if !defined(_LIBCPP_HAS_NO_THREADS)
268// # define __cpp_lib_atomic_float 201711L
269# endif
270# if !defined(_LIBCPP_HAS_NO_THREADS)
271# define __cpp_lib_atomic_lock_free_type_aliases 201907L
272# endif
219# if !defined(_LIBCPP_HAS_NO_THREADS)273# if !defined(_LIBCPP_HAS_NO_THREADS)
220// # define __cpp_lib_atomic_ref 201806L274// # define __cpp_lib_atomic_ref 201806L
221# endif275# endif
222// # define __cpp_lib_bind_front 201811L276# if !defined(_LIBCPP_HAS_NO_THREADS)
277// # define __cpp_lib_atomic_shared_ptr 201711L
278# endif
279# if !defined(_LIBCPP_HAS_NO_THREADS)
280// # define __cpp_lib_atomic_value_initialization 201911L
281# endif
282# if !defined(_LIBCPP_HAS_NO_THREADS)
283# define __cpp_lib_atomic_wait 201907L
284# endif
285# if !defined(_LIBCPP_HAS_NO_THREADS)
286# define __cpp_lib_barrier 201907L
287# endif
288// # define __cpp_lib_bind_front 201907L
223// # define __cpp_lib_bit_cast 201806L289// # define __cpp_lib_bit_cast 201806L
290// # define __cpp_lib_bitops 201907L
291# define __cpp_lib_bounded_array_traits 201902L
224# if !defined(_LIBCPP_NO_HAS_CHAR8_T)292# if !defined(_LIBCPP_NO_HAS_CHAR8_T)
225# define __cpp_lib_char8_t 201811L293# define __cpp_lib_char8_t 201811L
226# endif294# endif
227// # define __cpp_lib_concepts 201806L295// # define __cpp_lib_concepts 202002L
228// # define __cpp_lib_constexpr_misc 201811L296// # define __cpp_lib_constexpr_algorithms 201806L
229// # define __cpp_lib_constexpr_swap_algorithms 201806L297// # define __cpp_lib_constexpr_complex 201711L
298# define __cpp_lib_constexpr_dynamic_alloc 201907L
299# define __cpp_lib_constexpr_functional 201907L
300// # define __cpp_lib_constexpr_iterator 201811L
301// # define __cpp_lib_constexpr_memory 201811L
302# define __cpp_lib_constexpr_numeric 201911L
303// # define __cpp_lib_constexpr_string 201907L
304// # define __cpp_lib_constexpr_string_view 201811L
305// # define __cpp_lib_constexpr_tuple 201811L
306# define __cpp_lib_constexpr_utility 201811L
307// # define __cpp_lib_constexpr_vector 201907L
308// # define __cpp_lib_coroutine 201902L
230# if _LIBCPP_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L309# if _LIBCPP_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
231# define __cpp_lib_destroying_delete 201806L310# define __cpp_lib_destroying_delete 201806L
232# endif311# endif
233# define __cpp_lib_endian 201907L312# define __cpp_lib_endian 201907L
234# define __cpp_lib_erase_if 202002L313# define __cpp_lib_erase_if 202002L
235// # define __cpp_lib_generic_unordered_lookup 201811L314# undef __cpp_lib_execution
315// # define __cpp_lib_execution 201902L
316# define __cpp_lib_generic_unordered_lookup 201811L
317# define __cpp_lib_int_pow2 202002L
318// # define __cpp_lib_integer_comparison_functions 202002L
236# define __cpp_lib_interpolate 201902L319# define __cpp_lib_interpolate 201902L
237# if !defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED)320# if !defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED)
238# define __cpp_lib_is_constant_evaluated 201811L321# define __cpp_lib_is_constant_evaluated 201811L
239# endif322# endif
323// # define __cpp_lib_is_layout_compatible 201907L
324# define __cpp_lib_is_nothrow_convertible 201806L
325// # define __cpp_lib_is_pointer_interconvertible 201907L
326# if !defined(_LIBCPP_HAS_NO_THREADS)
327// # define __cpp_lib_jthread 201911L
328# endif
329# if !defined(_LIBCPP_HAS_NO_THREADS)
330# define __cpp_lib_latch 201907L
331# endif
240# define __cpp_lib_list_remove_return_type 201806L332# define __cpp_lib_list_remove_return_type 201806L
241# if defined(__cpp_concepts) && __cpp_concepts >= 201811L333# if defined(__cpp_concepts) && __cpp_concepts >= 201811L
242# define __cpp_lib_math_constants 201907L334# define __cpp_lib_math_constants 201907L
243# endif335# endif
336// # define __cpp_lib_polymorphic_allocator 201902L
244// # define __cpp_lib_ranges 201811L337// # define __cpp_lib_ranges 201811L
338# define __cpp_lib_remove_cvref 201711L
339# if !defined(_LIBCPP_HAS_NO_THREADS)
340# define __cpp_lib_semaphore 201907L
341# endif
342# define __cpp_lib_shift 201806L
343// # define __cpp_lib_smart_ptr_for_overwrite 202002L
344// # define __cpp_lib_source_location 201907L
245# define __cpp_lib_span 202002L345# define __cpp_lib_span 202002L
246// # define __cpp_lib_three_way_comparison 201711L346# define __cpp_lib_ssize 201902L
347# define __cpp_lib_starts_ends_with 201711L
348# undef __cpp_lib_string_view
349# define __cpp_lib_string_view 201803L
350// # define __cpp_lib_syncbuf 201803L
351// # define __cpp_lib_three_way_comparison 201907L
352# define __cpp_lib_to_address 201711L
247# define __cpp_lib_to_array 201907L353# define __cpp_lib_to_array 201907L
354# define __cpp_lib_unwrap_ref 201811L
355#endif
356
357#if _LIBCPP_STD_VER > 20
358# define __cpp_lib_is_scoped_enum 202011L
359// # define __cpp_lib_stacktrace 202011L
360// # define __cpp_lib_stdatomic_h 202011L
361# define __cpp_lib_string_contains 202011L
248#endif362#endif
249363
250#endif // _LIBCPP_VERSIONH364#endif // _LIBCPP_VERSIONH
lib/libcxx/include/wctype.h+3-1
...@@ -50,7 +50,9 @@ wctrans_t wctrans(const char* property);...@@ -50,7 +50,9 @@ wctrans_t wctrans(const char* property);
50#pragma GCC system_header50#pragma GCC system_header
51#endif51#endif
5252
53#include_next <wctype.h>53#if __has_include_next(<wctype.h>)
54# include_next <wctype.h>
55#endif
5456
55#ifdef __cplusplus57#ifdef __cplusplus
5658
lib/libcxx/src/atomic.cpp+6-2
...@@ -13,14 +13,18 @@...@@ -13,14 +13,18 @@
13#include <atomic>13#include <atomic>
14#include <functional>14#include <functional>
1515
16#include <iostream>
17
18#ifdef __linux__16#ifdef __linux__
1917
20#include <unistd.h>18#include <unistd.h>
21#include <linux/futex.h>19#include <linux/futex.h>
22#include <sys/syscall.h>20#include <sys/syscall.h>
2321
22// libc++ uses SYS_futex as a universal syscall name. However, on 32 bit architectures
23// with a 64 bit time_t, we need to specify SYS_futex_time64.
24#if !defined(SYS_futex) && defined(SYS_futex_time64)
25# define SYS_futex SYS_futex_time64
26#endif
27
24#else // <- Add other operating systems here28#else // <- Add other operating systems here
2529
26// Baseline needs no new headers30// Baseline needs no new headers
lib/libcxx/src/barrier.cpp+3-9
...@@ -26,21 +26,15 @@ public:...@@ -26,21 +26,15 @@ public:
26 } __tickets[64];26 } __tickets[64];
27 };27 };
2828
29 ptrdiff_t& __expected;29 ptrdiff_t& __expected;
30 unique_ptr<char[]> __state_allocation;30 unique_ptr<__state_t[]> __state;
31 __state_t* __state;
3231
33 _LIBCPP_HIDDEN32 _LIBCPP_HIDDEN
34 __barrier_algorithm_base(ptrdiff_t& __expected)33 __barrier_algorithm_base(ptrdiff_t& __expected)
35 : __expected(__expected)34 : __expected(__expected)
36 {35 {
37 size_t const __count = (__expected + 1) >> 1;36 size_t const __count = (__expected + 1) >> 1;
38 size_t const __size = sizeof(__state_t) * __count;37 __state = unique_ptr<__state_t[]>(new __state_t[__count]);
39 size_t __allocation_size = __size + alignof(__state_t);
40 __state_allocation = unique_ptr<char[]>(new char[__allocation_size]);
41 void* __allocation = __state_allocation.get();
42 void* const __state_ = align(alignof(__state_t), __size, __allocation, __allocation_size);
43 __state = new (__state_) __barrier_algorithm_base::__state_t[__count];
44 }38 }
45 _LIBCPP_HIDDEN39 _LIBCPP_HIDDEN
46 bool __arrive(__barrier_phase_t __old_phase)40 bool __arrive(__barrier_phase_t __old_phase)
lib/libcxx/src/chrono.cpp+113-42
...@@ -13,11 +13,15 @@...@@ -13,11 +13,15 @@
13#include "include/apple_availability.h"13#include "include/apple_availability.h"
1414
15#if __has_include(<unistd.h>)15#if __has_include(<unistd.h>)
16#include <unistd.h>16# include <unistd.h>
17#endif
18
19#if __has_include(<sys/time.h>)
20# include <sys/time.h> // for gettimeofday and timeval
17#endif21#endif
1822
19#if !defined(__APPLE__) && _POSIX_TIMERS > 023#if !defined(__APPLE__) && _POSIX_TIMERS > 0
20#define _LIBCPP_USE_CLOCK_GETTIME24# define _LIBCPP_USE_CLOCK_GETTIME
21#endif25#endif
2226
23#if defined(_LIBCPP_WIN32API)27#if defined(_LIBCPP_WIN32API)
...@@ -27,12 +31,12 @@...@@ -27,12 +31,12 @@
27# if _WIN32_WINNT >= _WIN32_WINNT_WIN831# if _WIN32_WINNT >= _WIN32_WINNT_WIN8
28# include <winapifamily.h>32# include <winapifamily.h>
29# endif33# endif
30#else
31# if !defined(CLOCK_REALTIME)
32# include <sys/time.h> // for gettimeofday and timeval
33# endif // !defined(CLOCK_REALTIME)
34#endif // defined(_LIBCPP_WIN32API)34#endif // defined(_LIBCPP_WIN32API)
3535
36#if __has_include(<mach/mach_time.h>)
37# include <mach/mach_time.h>
38#endif
39
36#if defined(__ELF__) && defined(_LIBCPP_LINK_RT_LIB)40#if defined(__ELF__) && defined(_LIBCPP_LINK_RT_LIB)
37# pragma comment(lib, "rt")41# pragma comment(lib, "rt")
38#endif42#endif
...@@ -42,14 +46,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD...@@ -42,14 +46,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
42namespace chrono46namespace chrono
43{47{
4448
49//
45// system_clock50// system_clock
51//
4652
47const bool system_clock::is_steady;
48
49system_clock::time_point
50system_clock::now() _NOEXCEPT
51{
52#if defined(_LIBCPP_WIN32API)53#if defined(_LIBCPP_WIN32API)
54
55static system_clock::time_point __libcpp_system_clock_now() {
53 // FILETIME is in 100ns units56 // FILETIME is in 100ns units
54 using filetime_duration =57 using filetime_duration =
55 _VSTD::chrono::duration<__int64,58 _VSTD::chrono::duration<__int64,
...@@ -60,31 +63,42 @@ system_clock::now() _NOEXCEPT...@@ -60,31 +63,42 @@ system_clock::now() _NOEXCEPT
60 static _LIBCPP_CONSTEXPR const seconds nt_to_unix_epoch{11644473600};63 static _LIBCPP_CONSTEXPR const seconds nt_to_unix_epoch{11644473600};
6164
62 FILETIME ft;65 FILETIME ft;
63#if _WIN32_WINNT >= _WIN32_WINNT_WIN866#if _WIN32_WINNT >= _WIN32_WINNT_WIN8 && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
64#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
65 GetSystemTimePreciseAsFileTime(&ft);67 GetSystemTimePreciseAsFileTime(&ft);
66#else
67 GetSystemTimeAsFileTime(&ft);
68#endif
69#else68#else
70 GetSystemTimeAsFileTime(&ft);69 GetSystemTimeAsFileTime(&ft);
71#endif70#endif
7271
73 filetime_duration d{(static_cast<__int64>(ft.dwHighDateTime) << 32) |72 filetime_duration d{(static_cast<__int64>(ft.dwHighDateTime) << 32) |
74 static_cast<__int64>(ft.dwLowDateTime)};73 static_cast<__int64>(ft.dwLowDateTime)};
75 return time_point(duration_cast<duration>(d - nt_to_unix_epoch));74 return system_clock::time_point(duration_cast<system_clock::duration>(d - nt_to_unix_epoch));
76#else75}
77#if defined(CLOCK_REALTIME)76
77#elif defined(CLOCK_REALTIME) && defined(_LIBCPP_USE_CLOCK_GETTIME)
78
79static system_clock::time_point __libcpp_system_clock_now() {
78 struct timespec tp;80 struct timespec tp;
79 if (0 != clock_gettime(CLOCK_REALTIME, &tp))81 if (0 != clock_gettime(CLOCK_REALTIME, &tp))
80 __throw_system_error(errno, "clock_gettime(CLOCK_REALTIME) failed");82 __throw_system_error(errno, "clock_gettime(CLOCK_REALTIME) failed");
81 return time_point(seconds(tp.tv_sec) + microseconds(tp.tv_nsec / 1000));83 return system_clock::time_point(seconds(tp.tv_sec) + microseconds(tp.tv_nsec / 1000));
84}
85
82#else86#else
87
88static system_clock::time_point __libcpp_system_clock_now() {
83 timeval tv;89 timeval tv;
84 gettimeofday(&tv, 0);90 gettimeofday(&tv, 0);
85 return time_point(seconds(tv.tv_sec) + microseconds(tv.tv_usec));91 return system_clock::time_point(seconds(tv.tv_sec) + microseconds(tv.tv_usec));
86#endif // CLOCK_REALTIME92}
93
87#endif94#endif
95
96const bool system_clock::is_steady;
97
98system_clock::time_point
99system_clock::now() _NOEXCEPT
100{
101 return __libcpp_system_clock_now();
88}102}
89103
90time_t104time_t
...@@ -99,35 +113,85 @@ system_clock::from_time_t(time_t t) _NOEXCEPT...@@ -99,35 +113,85 @@ system_clock::from_time_t(time_t t) _NOEXCEPT
99 return system_clock::time_point(seconds(t));113 return system_clock::time_point(seconds(t));
100}114}
101115
102#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK116//
103// steady_clock117// steady_clock
104//118//
105// Warning: If this is not truly steady, then it is non-conforming. It is119// Warning: If this is not truly steady, then it is non-conforming. It is
106// better for it to not exist and have the rest of libc++ use system_clock120// better for it to not exist and have the rest of libc++ use system_clock
107// instead.121// instead.
122//
108123
109const bool steady_clock::is_steady;124#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
110125
111#if defined(__APPLE__)126#if defined(__APPLE__)
112127
113#if !defined(CLOCK_MONOTONIC_RAW)128// TODO(ldionne):
114# error "Building libc++ on Apple platforms requires CLOCK_MONOTONIC_RAW"129// This old implementation of steady_clock is retained until Chrome drops supports
130// for macOS < 10.12. The issue is that they link libc++ statically into their
131// application, which means that libc++ must support being built for such deployment
132// targets. See https://llvm.org/D74489 for details.
133#if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \
134 (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \
135 (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \
136 (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000)
137# define _LIBCPP_USE_OLD_MACH_ABSOLUTE_TIME
115#endif138#endif
116139
140#if defined(_LIBCPP_USE_OLD_MACH_ABSOLUTE_TIME)
141
142// mach_absolute_time() * MachInfo.numer / MachInfo.denom is the number of
143// nanoseconds since the computer booted up. MachInfo.numer and MachInfo.denom
144// are run time constants supplied by the OS. This clock has no relationship
145// to the Gregorian calendar. It's main use is as a high resolution timer.
146
147// MachInfo.numer / MachInfo.denom is often 1 on the latest equipment. Specialize
148// for that case as an optimization.
149
150static steady_clock::rep steady_simplified() {
151 return static_cast<steady_clock::rep>(mach_absolute_time());
152}
153static double compute_steady_factor() {
154 mach_timebase_info_data_t MachInfo;
155 mach_timebase_info(&MachInfo);
156 return static_cast<double>(MachInfo.numer) / MachInfo.denom;
157}
158
159static steady_clock::rep steady_full() {
160 static const double factor = compute_steady_factor();
161 return static_cast<steady_clock::rep>(mach_absolute_time() * factor);
162}
163
164typedef steady_clock::rep (*FP)();
165
166static FP init_steady_clock() {
167 mach_timebase_info_data_t MachInfo;
168 mach_timebase_info(&MachInfo);
169 if (MachInfo.numer == MachInfo.denom)
170 return &steady_simplified;
171 return &steady_full;
172}
173
174static steady_clock::time_point __libcpp_steady_clock_now() {
175 static FP fp = init_steady_clock();
176 return steady_clock::time_point(steady_clock::duration(fp()));
177}
178
179#else // vvvvv default behavior for Apple platforms vvvvv
180
117// On Apple platforms, only CLOCK_UPTIME_RAW, CLOCK_MONOTONIC_RAW or181// On Apple platforms, only CLOCK_UPTIME_RAW, CLOCK_MONOTONIC_RAW or
118// mach_absolute_time are able to time functions in the nanosecond range.182// mach_absolute_time are able to time functions in the nanosecond range.
119// Furthermore, only CLOCK_MONOTONIC_RAW is truly monotonic, because it183// Furthermore, only CLOCK_MONOTONIC_RAW is truly monotonic, because it
120// also counts cycles when the system is asleep. Thus, it is the only184// also counts cycles when the system is asleep. Thus, it is the only
121// acceptable implementation of steady_clock.185// acceptable implementation of steady_clock.
122steady_clock::time_point186static steady_clock::time_point __libcpp_steady_clock_now() {
123steady_clock::now() _NOEXCEPT
124{
125 struct timespec tp;187 struct timespec tp;
126 if (0 != clock_gettime(CLOCK_MONOTONIC_RAW, &tp))188 if (0 != clock_gettime(CLOCK_MONOTONIC_RAW, &tp))
127 __throw_system_error(errno, "clock_gettime(CLOCK_MONOTONIC_RAW) failed");189 __throw_system_error(errno, "clock_gettime(CLOCK_MONOTONIC_RAW) failed");
128 return time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));190 return steady_clock::time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
129}191}
130192
193#endif
194
131#elif defined(_LIBCPP_WIN32API)195#elif defined(_LIBCPP_WIN32API)
132196
133// https://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx says:197// https://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx says:
...@@ -138,36 +202,43 @@ steady_clock::now() _NOEXCEPT...@@ -138,36 +202,43 @@ steady_clock::now() _NOEXCEPT
138static LARGE_INTEGER202static LARGE_INTEGER
139__QueryPerformanceFrequency()203__QueryPerformanceFrequency()
140{204{
141 LARGE_INTEGER val;205 LARGE_INTEGER val;
142 (void) QueryPerformanceFrequency(&val);206 (void) QueryPerformanceFrequency(&val);
143 return val;207 return val;
144}208}
145209
146steady_clock::time_point210static steady_clock::time_point __libcpp_steady_clock_now() {
147steady_clock::now() _NOEXCEPT
148{
149 static const LARGE_INTEGER freq = __QueryPerformanceFrequency();211 static const LARGE_INTEGER freq = __QueryPerformanceFrequency();
150212
151 LARGE_INTEGER counter;213 LARGE_INTEGER counter;
152 (void) QueryPerformanceCounter(&counter);214 (void) QueryPerformanceCounter(&counter);
153 return time_point(duration(counter.QuadPart * nano::den / freq.QuadPart));215 auto seconds = counter.QuadPart / freq.QuadPart;
216 auto fractions = counter.QuadPart % freq.QuadPart;
217 auto dur = seconds * nano::den + fractions * nano::den / freq.QuadPart;
218 return steady_clock::time_point(steady_clock::duration(dur));
154}219}
155220
156#elif defined(CLOCK_MONOTONIC)221#elif defined(CLOCK_MONOTONIC)
157222
158steady_clock::time_point223static steady_clock::time_point __libcpp_steady_clock_now() {
159steady_clock::now() _NOEXCEPT
160{
161 struct timespec tp;224 struct timespec tp;
162 if (0 != clock_gettime(CLOCK_MONOTONIC, &tp))225 if (0 != clock_gettime(CLOCK_MONOTONIC, &tp))
163 __throw_system_error(errno, "clock_gettime(CLOCK_MONOTONIC) failed");226 __throw_system_error(errno, "clock_gettime(CLOCK_MONOTONIC) failed");
164 return time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));227 return steady_clock::time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
165}228}
166229
167#else230#else
168# error "Monotonic clock not implemented"231# error "Monotonic clock not implemented on this platform"
169#endif232#endif
170233
234const bool steady_clock::is_steady;
235
236steady_clock::time_point
237steady_clock::now() _NOEXCEPT
238{
239 return __libcpp_steady_clock_now();
240}
241
171#endif // !_LIBCPP_HAS_NO_MONOTONIC_CLOCK242#endif // !_LIBCPP_HAS_NO_MONOTONIC_CLOCK
172243
173}244}
lib/libcxx/src/experimental/memory_resource.cpp-10
...@@ -76,16 +76,6 @@ union ResourceInitHelper {...@@ -76,16 +76,6 @@ union ResourceInitHelper {
76 ~ResourceInitHelper() {}76 ~ResourceInitHelper() {}
77};77};
7878
79// Detect if the init_priority attribute is supported.
80#if (defined(_LIBCPP_COMPILER_GCC) && defined(__APPLE__)) \
81 || defined(_LIBCPP_COMPILER_MSVC)
82// GCC on Apple doesn't support the init priority attribute,
83// and MSVC doesn't support any GCC attributes.
84# define _LIBCPP_INIT_PRIORITY_MAX
85#else
86# define _LIBCPP_INIT_PRIORITY_MAX __attribute__((init_priority(101)))
87#endif
88
89// When compiled in C++14 this initialization should be a constant expression.79// When compiled in C++14 this initialization should be a constant expression.
90// Only in C++11 is "init_priority" needed to ensure initialization order.80// Only in C++11 is "init_priority" needed to ensure initialization order.
91#if _LIBCPP_STD_VER > 1181#if _LIBCPP_STD_VER > 11
lib/libcxx/src/filesystem/directory_iterator.cpp+39-24
...@@ -10,6 +10,7 @@...@@ -10,6 +10,7 @@
10#include "__config"10#include "__config"
11#if defined(_LIBCPP_WIN32API)11#if defined(_LIBCPP_WIN32API)
12#define WIN32_LEAN_AND_MEAN12#define WIN32_LEAN_AND_MEAN
13#define NOMINMAX
13#include <windows.h>14#include <windows.h>
14#else15#else
15#include <dirent.h>16#include <dirent.h>
...@@ -72,16 +73,20 @@ static pair<string_view, file_type> posix_readdir(DIR* dir_stream,...@@ -72,16 +73,20 @@ static pair<string_view, file_type> posix_readdir(DIR* dir_stream,
72 }73 }
73}74}
74#else75#else
76// defined(_LIBCPP_WIN32API)
7577
76static file_type get_file_type(const WIN32_FIND_DATA& data) {78static file_type get_file_type(const WIN32_FIND_DATAW& data) {
77 //auto attrs = data.dwFileAttributes;79 if (data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT &&
78 // FIXME(EricWF)80 data.dwReserved0 == IO_REPARSE_TAG_SYMLINK)
79 return file_type::unknown;81 return file_type::symlink;
82 if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
83 return file_type::directory;
84 return file_type::regular;
80}85}
81static uintmax_t get_file_size(const WIN32_FIND_DATA& data) {86static uintmax_t get_file_size(const WIN32_FIND_DATAW& data) {
82 return (data.nFileSizeHigh * (MAXDWORD + 1)) + data.nFileSizeLow;87 return (static_cast<uint64_t>(data.nFileSizeHigh) << 32) + data.nFileSizeLow;
83}88}
84static file_time_type get_write_time(const WIN32_FIND_DATA& data) {89static file_time_type get_write_time(const WIN32_FIND_DATAW& data) {
85 ULARGE_INTEGER tmp;90 ULARGE_INTEGER tmp;
86 const FILETIME& time = data.ftLastWriteTime;91 const FILETIME& time = data.ftLastWriteTime;
87 tmp.u.LowPart = time.dwLowDateTime;92 tmp.u.LowPart = time.dwLowDateTime;
...@@ -110,15 +115,21 @@ public:...@@ -110,15 +115,21 @@ public:
110115
111 __dir_stream(const path& root, directory_options opts, error_code& ec)116 __dir_stream(const path& root, directory_options opts, error_code& ec)
112 : __stream_(INVALID_HANDLE_VALUE), __root_(root) {117 : __stream_(INVALID_HANDLE_VALUE), __root_(root) {
113 __stream_ = ::FindFirstFile(root.c_str(), &__data_);118 if (root.native().empty()) {
119 ec = make_error_code(errc::no_such_file_or_directory);
120 return;
121 }
122 __stream_ = ::FindFirstFileW((root / "*").c_str(), &__data_);
114 if (__stream_ == INVALID_HANDLE_VALUE) {123 if (__stream_ == INVALID_HANDLE_VALUE) {
115 ec = error_code(::GetLastError(), generic_category());124 ec = detail::make_windows_error(GetLastError());
116 const bool ignore_permission_denied =125 const bool ignore_permission_denied =
117 bool(opts & directory_options::skip_permission_denied);126 bool(opts & directory_options::skip_permission_denied);
118 if (ignore_permission_denied && ec.value() == ERROR_ACCESS_DENIED)127 if (ignore_permission_denied && ec.value() == ERROR_ACCESS_DENIED)
119 ec.clear();128 ec.clear();
120 return;129 return;
121 }130 }
131 if (!assign())
132 advance(ec);
122 }133 }
123134
124 ~__dir_stream() noexcept {135 ~__dir_stream() noexcept {
...@@ -130,35 +141,39 @@ public:...@@ -130,35 +141,39 @@ public:
130 bool good() const noexcept { return __stream_ != INVALID_HANDLE_VALUE; }141 bool good() const noexcept { return __stream_ != INVALID_HANDLE_VALUE; }
131142
132 bool advance(error_code& ec) {143 bool advance(error_code& ec) {
133 while (::FindNextFile(__stream_, &__data_)) {144 while (::FindNextFileW(__stream_, &__data_)) {
134 if (!strcmp(__data_.cFileName, ".") || strcmp(__data_.cFileName, ".."))145 if (assign())
135 continue;146 return true;
136 // FIXME: Cache more of this
137 //directory_entry::__cached_data cdata;
138 //cdata.__type_ = get_file_type(__data_);
139 //cdata.__size_ = get_file_size(__data_);
140 //cdata.__write_time_ = get_write_time(__data_);
141 __entry_.__assign_iter_entry(
142 __root_ / __data_.cFileName,
143 directory_entry::__create_iter_result(detail::get_file_type(__data)));
144 return true;
145 }147 }
146 ec = error_code(::GetLastError(), generic_category());
147 close();148 close();
148 return false;149 return false;
149 }150 }
150151
152 bool assign() {
153 if (!wcscmp(__data_.cFileName, L".") || !wcscmp(__data_.cFileName, L".."))
154 return false;
155 // FIXME: Cache more of this
156 //directory_entry::__cached_data cdata;
157 //cdata.__type_ = get_file_type(__data_);
158 //cdata.__size_ = get_file_size(__data_);
159 //cdata.__write_time_ = get_write_time(__data_);
160 __entry_.__assign_iter_entry(
161 __root_ / __data_.cFileName,
162 directory_entry::__create_iter_result(detail::get_file_type(__data_)));
163 return true;
164 }
165
151private:166private:
152 error_code close() noexcept {167 error_code close() noexcept {
153 error_code ec;168 error_code ec;
154 if (!::FindClose(__stream_))169 if (!::FindClose(__stream_))
155 ec = error_code(::GetLastError(), generic_category());170 ec = detail::make_windows_error(GetLastError());
156 __stream_ = INVALID_HANDLE_VALUE;171 __stream_ = INVALID_HANDLE_VALUE;
157 return ec;172 return ec;
158 }173 }
159174
160 HANDLE __stream_{INVALID_HANDLE_VALUE};175 HANDLE __stream_{INVALID_HANDLE_VALUE};
161 WIN32_FIND_DATA __data_;176 WIN32_FIND_DATAW __data_;
162177
163public:178public:
164 path __root_;179 path __root_;
lib/libcxx/src/filesystem/filesystem_common.h+87-47
...@@ -13,14 +13,17 @@...@@ -13,14 +13,17 @@
13#include "filesystem"13#include "filesystem"
14#include "array"14#include "array"
15#include "chrono"15#include "chrono"
16#include "cstdlib"
17#include "climits"16#include "climits"
1817#include "cstdlib"
19#include <unistd.h>18#include "ctime"
20#include <sys/stat.h>19
21#include <sys/statvfs.h>20#if !defined(_LIBCPP_WIN32API)
22#include <sys/time.h> // for ::utimes as used in __last_write_time21# include <unistd.h>
23#include <fcntl.h> /* values for fchmodat */22# include <sys/stat.h>
23# include <sys/statvfs.h>
24# include <sys/time.h> // for ::utimes as used in __last_write_time
25# include <fcntl.h> /* values for fchmodat */
26#endif
2427
25#include "../include/apple_availability.h"28#include "../include/apple_availability.h"
2629
...@@ -37,9 +40,21 @@...@@ -37,9 +40,21 @@
37#pragma GCC diagnostic ignored "-Wunused-function"40#pragma GCC diagnostic ignored "-Wunused-function"
38#endif41#endif
3942
43#if defined(_LIBCPP_WIN32API)
44#define PS(x) (L##x)
45#else
46#define PS(x) (x)
47#endif
48
40_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM49_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
4150
42namespace detail {51namespace detail {
52
53#if defined(_LIBCPP_WIN32API)
54// Non anonymous, to allow access from two translation units.
55errc __win_err_to_errc(int err);
56#endif
57
43namespace {58namespace {
4459
45static string format_string_imp(const char* msg, ...) {60static string format_string_imp(const char* msg, ...) {
...@@ -47,7 +62,7 @@ static string format_string_imp(const char* msg, ...) {...@@ -47,7 +62,7 @@ static string format_string_imp(const char* msg, ...) {
47 struct GuardVAList {62 struct GuardVAList {
48 va_list& target;63 va_list& target;
49 bool active = true;64 bool active = true;
50 GuardVAList(va_list& target) : target(target), active(true) {}65 GuardVAList(va_list& tgt) : target(tgt), active(true) {}
51 void clear() {66 void clear() {
52 if (active)67 if (active)
53 va_end(target);68 va_end(target);
...@@ -93,8 +108,8 @@ static string format_string_imp(const char* msg, ...) {...@@ -93,8 +108,8 @@ static string format_string_imp(const char* msg, ...) {
93 return result;108 return result;
94}109}
95110
96const char* unwrap(string const& s) { return s.c_str(); }111const path::value_type* unwrap(path::string_type const& s) { return s.c_str(); }
97const char* unwrap(path const& p) { return p.native().c_str(); }112const path::value_type* unwrap(path const& p) { return p.native().c_str(); }
98template <class Arg>113template <class Arg>
99Arg const& unwrap(Arg const& a) {114Arg const& unwrap(Arg const& a) {
100 static_assert(!is_class<Arg>::value, "cannot pass class here");115 static_assert(!is_class<Arg>::value, "cannot pass class here");
...@@ -111,6 +126,12 @@ error_code capture_errno() {...@@ -111,6 +126,12 @@ error_code capture_errno() {
111 return error_code(errno, generic_category());126 return error_code(errno, generic_category());
112}127}
113128
129#if defined(_LIBCPP_WIN32API)
130error_code make_windows_error(int err) {
131 return make_error_code(__win_err_to_errc(err));
132}
133#endif
134
114template <class T>135template <class T>
115T error_value();136T error_value();
116template <>137template <>
...@@ -119,6 +140,12 @@ template <>...@@ -119,6 +140,12 @@ template <>
119bool error_value<bool>() {140bool error_value<bool>() {
120 return false;141 return false;
121}142}
143#if __SIZEOF_SIZE_T__ != __SIZEOF_LONG_LONG__
144template <>
145size_t error_value<size_t>() {
146 return size_t(-1);
147}
148#endif
122template <>149template <>
123uintmax_t error_value<uintmax_t>() {150uintmax_t error_value<uintmax_t>() {
124 return uintmax_t(-1);151 return uintmax_t(-1);
...@@ -134,50 +161,50 @@ path error_value<path>() {...@@ -134,50 +161,50 @@ path error_value<path>() {
134161
135template <class T>162template <class T>
136struct ErrorHandler {163struct ErrorHandler {
137 const char* func_name;164 const char* func_name_;
138 error_code* ec = nullptr;165 error_code* ec_ = nullptr;
139 const path* p1 = nullptr;166 const path* p1_ = nullptr;
140 const path* p2 = nullptr;167 const path* p2_ = nullptr;
141168
142 ErrorHandler(const char* fname, error_code* ec, const path* p1 = nullptr,169 ErrorHandler(const char* fname, error_code* ec, const path* p1 = nullptr,
143 const path* p2 = nullptr)170 const path* p2 = nullptr)
144 : func_name(fname), ec(ec), p1(p1), p2(p2) {171 : func_name_(fname), ec_(ec), p1_(p1), p2_(p2) {
145 if (ec)172 if (ec_)
146 ec->clear();173 ec_->clear();
147 }174 }
148175
149 T report(const error_code& m_ec) const {176 T report(const error_code& ec) const {
150 if (ec) {177 if (ec_) {
151 *ec = m_ec;178 *ec_ = ec;
152 return error_value<T>();179 return error_value<T>();
153 }180 }
154 string what = string("in ") + func_name;181 string what = string("in ") + func_name_;
155 switch (bool(p1) + bool(p2)) {182 switch (bool(p1_) + bool(p2_)) {
156 case 0:183 case 0:
157 __throw_filesystem_error(what, m_ec);184 __throw_filesystem_error(what, ec);
158 case 1:185 case 1:
159 __throw_filesystem_error(what, *p1, m_ec);186 __throw_filesystem_error(what, *p1_, ec);
160 case 2:187 case 2:
161 __throw_filesystem_error(what, *p1, *p2, m_ec);188 __throw_filesystem_error(what, *p1_, *p2_, ec);
162 }189 }
163 _LIBCPP_UNREACHABLE();190 _LIBCPP_UNREACHABLE();
164 }191 }
165192
166 template <class... Args>193 template <class... Args>
167 T report(const error_code& m_ec, const char* msg, Args const&... args) const {194 T report(const error_code& ec, const char* msg, Args const&... args) const {
168 if (ec) {195 if (ec_) {
169 *ec = m_ec;196 *ec_ = ec;
170 return error_value<T>();197 return error_value<T>();
171 }198 }
172 string what =199 string what =
173 string("in ") + func_name + ": " + format_string(msg, args...);200 string("in ") + func_name_ + ": " + format_string(msg, args...);
174 switch (bool(p1) + bool(p2)) {201 switch (bool(p1_) + bool(p2_)) {
175 case 0:202 case 0:
176 __throw_filesystem_error(what, m_ec);203 __throw_filesystem_error(what, ec);
177 case 1:204 case 1:
178 __throw_filesystem_error(what, *p1, m_ec);205 __throw_filesystem_error(what, *p1_, ec);
179 case 2:206 case 2:
180 __throw_filesystem_error(what, *p1, *p2, m_ec);207 __throw_filesystem_error(what, *p1_, *p2_, ec);
181 }208 }
182 _LIBCPP_UNREACHABLE();209 _LIBCPP_UNREACHABLE();
183 }210 }
...@@ -197,8 +224,9 @@ private:...@@ -197,8 +224,9 @@ private:
197using chrono::duration;224using chrono::duration;
198using chrono::duration_cast;225using chrono::duration_cast;
199226
200using TimeSpec = struct ::timespec;227using TimeSpec = struct timespec;
201using StatT = struct ::stat;228using TimeVal = struct timeval;
229using StatT = struct stat;
202230
203template <class FileTimeT, class TimeT,231template <class FileTimeT, class TimeT,
204 bool IsFloat = is_floating_point<typename FileTimeT::rep>::value>232 bool IsFloat = is_floating_point<typename FileTimeT::rep>::value>
...@@ -380,26 +408,38 @@ public:...@@ -380,26 +408,38 @@ public:
380using fs_time = time_util<file_time_type, time_t, TimeSpec>;408using fs_time = time_util<file_time_type, time_t, TimeSpec>;
381409
382#if defined(__APPLE__)410#if defined(__APPLE__)
383TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }411inline TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }
384TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; }412inline TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; }
413#elif defined(__MVS__)
414inline TimeSpec extract_mtime(StatT const& st) {
415 TimeSpec TS = {st.st_mtime, 0};
416 return TS;
417}
418inline TimeSpec extract_atime(StatT const& st) {
419 TimeSpec TS = {st.st_atime, 0};
420 return TS;
421}
385#else422#else
386TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; }423inline TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; }
387TimeSpec extract_atime(StatT const& st) { return st.st_atim; }424inline TimeSpec extract_atime(StatT const& st) { return st.st_atim; }
388#endif425#endif
389426
390// allow the utimes implementation to compile even it we're not going427inline TimeVal make_timeval(TimeSpec const& ts) {
391// to use it.
392
393bool posix_utimes(const path& p, std::array<TimeSpec, 2> const& TS,
394 error_code& ec) {
395 using namespace chrono;428 using namespace chrono;
396 auto Convert = [](long nsec) {429 auto Convert = [](long nsec) {
397 using int_type = decltype(std::declval< ::timeval>().tv_usec);430 using int_type = decltype(std::declval<TimeVal>().tv_usec);
398 auto dur = duration_cast<microseconds>(nanoseconds(nsec)).count();431 auto dur = duration_cast<microseconds>(nanoseconds(nsec)).count();
399 return static_cast<int_type>(dur);432 return static_cast<int_type>(dur);
400 };433 };
401 struct ::timeval ConvertedTS[2] = {{TS[0].tv_sec, Convert(TS[0].tv_nsec)},434 TimeVal TV = {};
402 {TS[1].tv_sec, Convert(TS[1].tv_nsec)}};435 TV.tv_sec = ts.tv_sec;
436 TV.tv_usec = Convert(ts.tv_nsec);
437 return TV;
438}
439
440inline bool posix_utimes(const path& p, std::array<TimeSpec, 2> const& TS,
441 error_code& ec) {
442 TimeVal ConvertedTS[2] = {make_timeval(TS[0]), make_timeval(TS[1])};
403 if (::utimes(p.c_str(), ConvertedTS) == -1) {443 if (::utimes(p.c_str(), ConvertedTS) == -1) {
404 ec = capture_errno();444 ec = capture_errno();
405 return true;445 return true;
lib/libcxx/src/filesystem/operations.cpp+263-135
...@@ -9,8 +9,6 @@...@@ -9,8 +9,6 @@
9#include "filesystem"9#include "filesystem"
10#include "array"10#include "array"
11#include "iterator"11#include "iterator"
12#include "fstream"
13#include "random" /* for unique_path */
14#include "string_view"12#include "string_view"
15#include "type_traits"13#include "type_traits"
16#include "vector"14#include "vector"
...@@ -19,40 +17,51 @@...@@ -19,40 +17,51 @@
1917
20#include "filesystem_common.h"18#include "filesystem_common.h"
2119
22#include <unistd.h>20#if defined(_LIBCPP_WIN32API)
23#include <sys/stat.h>21# define WIN32_LEAN_AND_MEAN
24#include <sys/statvfs.h>22# define NOMINMAX
23# include <windows.h>
24#else
25# include <unistd.h>
26# include <sys/stat.h>
27# include <sys/statvfs.h>
28#endif
25#include <time.h>29#include <time.h>
26#include <fcntl.h> /* values for fchmodat */30#include <fcntl.h> /* values for fchmodat */
2731
28#if defined(__linux__)32#if __has_include(<sys/sendfile.h>)
29#include <linux/version.h>33# include <sys/sendfile.h>
30#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)34# define _LIBCPP_FILESYSTEM_USE_SENDFILE
31#include <sys/sendfile.h>
32#define _LIBCPP_USE_SENDFILE
33#endif
34#elif defined(__APPLE__) || __has_include(<copyfile.h>)35#elif defined(__APPLE__) || __has_include(<copyfile.h>)
35#include <copyfile.h>36# include <copyfile.h>
36#define _LIBCPP_USE_COPYFILE37# define _LIBCPP_FILESYSTEM_USE_COPYFILE
38#else
39# include "fstream"
40# define _LIBCPP_FILESYSTEM_USE_FSTREAM
37#endif41#endif
3842
39#if !defined(CLOCK_REALTIME)43#if !defined(CLOCK_REALTIME)
40#include <sys/time.h> // for gettimeofday and timeval44# include <sys/time.h> // for gettimeofday and timeval
41#endif // !defined(CLOCK_REALTIME)
42
43#if defined(__ELF__) && defined(_LIBCPP_LINK_RT_LIB)
44#pragma comment(lib, "rt")
45#endif45#endif
4646
47#if defined(_LIBCPP_COMPILER_GCC)47#if defined(__ELF__) && defined(_LIBCPP_LINK_RT_LIB)
48#if _GNUC_VER < 50048# pragma comment(lib, "rt")
49#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
50#endif
51#endif49#endif
5250
53_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM51_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
5452
55namespace {53namespace {
54
55bool isSeparator(path::value_type C) {
56 if (C == '/')
57 return true;
58#if defined(_LIBCPP_WIN32API)
59 if (C == '\\')
60 return true;
61#endif
62 return false;
63}
64
56namespace parser {65namespace parser {
5766
58using string_view_t = path::__string_view;67using string_view_t = path::__string_view;
...@@ -179,11 +188,14 @@ public:...@@ -179,11 +188,14 @@ public:
179 switch (State) {188 switch (State) {
180 case PS_BeforeBegin:189 case PS_BeforeBegin:
181 case PS_AtEnd:190 case PS_AtEnd:
182 return "";191 return PS("");
183 case PS_InRootDir:192 case PS_InRootDir:
184 return "/";193 if (RawEntry[0] == '\\')
194 return PS("\\");
195 else
196 return PS("/");
185 case PS_InTrailingSep:197 case PS_InTrailingSep:
186 return "";198 return PS("");
187 case PS_InRootName:199 case PS_InRootName:
188 case PS_InFilenames:200 case PS_InFilenames:
189 return RawEntry;201 return RawEntry;
...@@ -270,29 +282,29 @@ private:...@@ -270,29 +282,29 @@ private:
270 }282 }
271283
272 PosPtr consumeSeparator(PosPtr P, PosPtr End) const noexcept {284 PosPtr consumeSeparator(PosPtr P, PosPtr End) const noexcept {
273 if (P == End || *P != '/')285 if (P == End || !isSeparator(*P))
274 return nullptr;286 return nullptr;
275 const int Inc = P < End ? 1 : -1;287 const int Inc = P < End ? 1 : -1;
276 P += Inc;288 P += Inc;
277 while (P != End && *P == '/')289 while (P != End && isSeparator(*P))
278 P += Inc;290 P += Inc;
279 return P;291 return P;
280 }292 }
281293
282 PosPtr consumeName(PosPtr P, PosPtr End) const noexcept {294 PosPtr consumeName(PosPtr P, PosPtr End) const noexcept {
283 if (P == End || *P == '/')295 if (P == End || isSeparator(*P))
284 return nullptr;296 return nullptr;
285 const int Inc = P < End ? 1 : -1;297 const int Inc = P < End ? 1 : -1;
286 P += Inc;298 P += Inc;
287 while (P != End && *P != '/')299 while (P != End && !isSeparator(*P))
288 P += Inc;300 P += Inc;
289 return P;301 return P;
290 }302 }
291};303};
292304
293string_view_pair separate_filename(string_view_t const& s) {305string_view_pair separate_filename(string_view_t const& s) {
294 if (s == "." || s == ".." || s.empty())306 if (s == PS(".") || s == PS("..") || s.empty())
295 return string_view_pair{s, ""};307 return string_view_pair{s, PS("")};
296 auto pos = s.find_last_of('.');308 auto pos = s.find_last_of('.');
297 if (pos == string_view_t::npos || pos == 0)309 if (pos == string_view_t::npos || pos == 0)
298 return string_view_pair{s, string_view_t{}};310 return string_view_pair{s, string_view_t{}};
...@@ -308,6 +320,73 @@ string_view_t createView(PosPtr S, PosPtr E) noexcept {...@@ -308,6 +320,73 @@ string_view_t createView(PosPtr S, PosPtr E) noexcept {
308320
309// POSIX HELPERS321// POSIX HELPERS
310322
323#if defined(_LIBCPP_WIN32API)
324namespace detail {
325
326errc __win_err_to_errc(int err) {
327 constexpr struct {
328 DWORD win;
329 errc errc;
330 } win_error_mapping[] = {
331 {ERROR_ACCESS_DENIED, errc::permission_denied},
332 {ERROR_ALREADY_EXISTS, errc::file_exists},
333 {ERROR_BAD_NETPATH, errc::no_such_file_or_directory},
334 {ERROR_BAD_UNIT, errc::no_such_device},
335 {ERROR_BROKEN_PIPE, errc::broken_pipe},
336 {ERROR_BUFFER_OVERFLOW, errc::filename_too_long},
337 {ERROR_BUSY, errc::device_or_resource_busy},
338 {ERROR_BUSY_DRIVE, errc::device_or_resource_busy},
339 {ERROR_CANNOT_MAKE, errc::permission_denied},
340 {ERROR_CANTOPEN, errc::io_error},
341 {ERROR_CANTREAD, errc::io_error},
342 {ERROR_CANTWRITE, errc::io_error},
343 {ERROR_CURRENT_DIRECTORY, errc::permission_denied},
344 {ERROR_DEV_NOT_EXIST, errc::no_such_device},
345 {ERROR_DEVICE_IN_USE, errc::device_or_resource_busy},
346 {ERROR_DIR_NOT_EMPTY, errc::directory_not_empty},
347 {ERROR_DIRECTORY, errc::invalid_argument},
348 {ERROR_DISK_FULL, errc::no_space_on_device},
349 {ERROR_FILE_EXISTS, errc::file_exists},
350 {ERROR_FILE_NOT_FOUND, errc::no_such_file_or_directory},
351 {ERROR_HANDLE_DISK_FULL, errc::no_space_on_device},
352 {ERROR_INVALID_ACCESS, errc::permission_denied},
353 {ERROR_INVALID_DRIVE, errc::no_such_device},
354 {ERROR_INVALID_FUNCTION, errc::function_not_supported},
355 {ERROR_INVALID_HANDLE, errc::invalid_argument},
356 {ERROR_INVALID_NAME, errc::no_such_file_or_directory},
357 {ERROR_INVALID_PARAMETER, errc::invalid_argument},
358 {ERROR_LOCK_VIOLATION, errc::no_lock_available},
359 {ERROR_LOCKED, errc::no_lock_available},
360 {ERROR_NEGATIVE_SEEK, errc::invalid_argument},
361 {ERROR_NOACCESS, errc::permission_denied},
362 {ERROR_NOT_ENOUGH_MEMORY, errc::not_enough_memory},
363 {ERROR_NOT_READY, errc::resource_unavailable_try_again},
364 {ERROR_NOT_SAME_DEVICE, errc::cross_device_link},
365 {ERROR_NOT_SUPPORTED, errc::not_supported},
366 {ERROR_OPEN_FAILED, errc::io_error},
367 {ERROR_OPEN_FILES, errc::device_or_resource_busy},
368 {ERROR_OPERATION_ABORTED, errc::operation_canceled},
369 {ERROR_OUTOFMEMORY, errc::not_enough_memory},
370 {ERROR_PATH_NOT_FOUND, errc::no_such_file_or_directory},
371 {ERROR_READ_FAULT, errc::io_error},
372 {ERROR_REPARSE_TAG_INVALID, errc::invalid_argument},
373 {ERROR_RETRY, errc::resource_unavailable_try_again},
374 {ERROR_SEEK, errc::io_error},
375 {ERROR_SHARING_VIOLATION, errc::permission_denied},
376 {ERROR_TOO_MANY_OPEN_FILES, errc::too_many_files_open},
377 {ERROR_WRITE_FAULT, errc::io_error},
378 {ERROR_WRITE_PROTECT, errc::permission_denied},
379 };
380
381 for (const auto &pair : win_error_mapping)
382 if (pair.win == static_cast<DWORD>(err))
383 return pair.errc;
384 return errc::invalid_argument;
385}
386
387} // namespace detail
388#endif
389
311namespace detail {390namespace detail {
312namespace {391namespace {
313392
...@@ -503,19 +582,25 @@ _FilesystemClock::time_point _FilesystemClock::now() noexcept {...@@ -503,19 +582,25 @@ _FilesystemClock::time_point _FilesystemClock::now() noexcept {
503582
504filesystem_error::~filesystem_error() {}583filesystem_error::~filesystem_error() {}
505584
585#if defined(_LIBCPP_WIN32API)
586#define PS_FMT "%ls"
587#else
588#define PS_FMT "%s"
589#endif
590
506void filesystem_error::__create_what(int __num_paths) {591void filesystem_error::__create_what(int __num_paths) {
507 const char* derived_what = system_error::what();592 const char* derived_what = system_error::what();
508 __storage_->__what_ = [&]() -> string {593 __storage_->__what_ = [&]() -> string {
509 const char* p1 = path1().native().empty() ? "\"\"" : path1().c_str();594 const path::value_type* p1 = path1().native().empty() ? PS("\"\"") : path1().c_str();
510 const char* p2 = path2().native().empty() ? "\"\"" : path2().c_str();595 const path::value_type* p2 = path2().native().empty() ? PS("\"\"") : path2().c_str();
511 switch (__num_paths) {596 switch (__num_paths) {
512 default:597 default:
513 return detail::format_string("filesystem error: %s", derived_what);598 return detail::format_string("filesystem error: %s", derived_what);
514 case 1:599 case 1:
515 return detail::format_string("filesystem error: %s [%s]", derived_what,600 return detail::format_string("filesystem error: %s [" PS_FMT "]", derived_what,
516 p1);601 p1);
517 case 2:602 case 2:
518 return detail::format_string("filesystem error: %s [%s] [%s]",603 return detail::format_string("filesystem error: %s [" PS_FMT "] [" PS_FMT "]",
519 derived_what, p1, p2);604 derived_what, p1, p2);
520 }605 }
521 }();606 }();
...@@ -542,14 +627,18 @@ path __canonical(path const& orig_p, error_code* ec) {...@@ -542,14 +627,18 @@ path __canonical(path const& orig_p, error_code* ec) {
542 ErrorHandler<path> err("canonical", ec, &orig_p, &cwd);627 ErrorHandler<path> err("canonical", ec, &orig_p, &cwd);
543628
544 path p = __do_absolute(orig_p, &cwd, ec);629 path p = __do_absolute(orig_p, &cwd, ec);
545#if _POSIX_VERSION >= 200112630#if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112
546 std::unique_ptr<char, decltype(&::free)>631 std::unique_ptr<char, decltype(&::free)>
547 hold(::realpath(p.c_str(), nullptr), &::free);632 hold(::realpath(p.c_str(), nullptr), &::free);
548 if (hold.get() == nullptr)633 if (hold.get() == nullptr)
549 return err.report(capture_errno());634 return err.report(capture_errno());
550 return {hold.get()};635 return {hold.get()};
551#else636#else
552 char buff[PATH_MAX + 1];637 #if defined(__MVS__) && !defined(PATH_MAX)
638 char buff[ _XOPEN_PATH_MAX + 1 ];
639 #else
640 char buff[PATH_MAX + 1];
641 #endif
553 char* ret;642 char* ret;
554 if ((ret = ::realpath(p.c_str(), buff)) == nullptr)643 if ((ret = ::realpath(p.c_str(), buff)) == nullptr)
555 return err.report(capture_errno());644 return err.report(capture_errno());
...@@ -646,96 +735,83 @@ void __copy(const path& from, const path& to, copy_options options,...@@ -646,96 +735,83 @@ void __copy(const path& from, const path& to, copy_options options,
646namespace detail {735namespace detail {
647namespace {736namespace {
648737
649#ifdef _LIBCPP_USE_SENDFILE738#if defined(_LIBCPP_FILESYSTEM_USE_SENDFILE)
650bool copy_file_impl_sendfile(FileDescriptor& read_fd, FileDescriptor& write_fd,739 bool copy_file_impl(FileDescriptor& read_fd, FileDescriptor& write_fd, error_code& ec) {
651 error_code& ec) {740 size_t count = read_fd.get_stat().st_size;
652741 do {
653 size_t count = read_fd.get_stat().st_size;742 ssize_t res;
654 do {743 if ((res = ::sendfile(write_fd.fd, read_fd.fd, nullptr, count)) == -1) {
655 ssize_t res;744 ec = capture_errno();
656 if ((res = ::sendfile(write_fd.fd, read_fd.fd, nullptr, count)) == -1) {745 return false;
657 ec = capture_errno();746 }
658 return false;747 count -= res;
659 }748 } while (count > 0);
660 count -= res;
661 } while (count > 0);
662
663 ec.clear();
664749
665 return true;750 ec.clear();
666}
667#elif defined(_LIBCPP_USE_COPYFILE)
668bool copy_file_impl_copyfile(FileDescriptor& read_fd, FileDescriptor& write_fd,
669 error_code& ec) {
670 struct CopyFileState {
671 copyfile_state_t state;
672 CopyFileState() { state = copyfile_state_alloc(); }
673 ~CopyFileState() { copyfile_state_free(state); }
674
675 private:
676 CopyFileState(CopyFileState const&) = delete;
677 CopyFileState& operator=(CopyFileState const&) = delete;
678 };
679751
680 CopyFileState cfs;752 return true;
681 if (fcopyfile(read_fd.fd, write_fd.fd, cfs.state, COPYFILE_DATA) < 0) {
682 ec = capture_errno();
683 return false;
684 }753 }
754#elif defined(_LIBCPP_FILESYSTEM_USE_COPYFILE)
755 bool copy_file_impl(FileDescriptor& read_fd, FileDescriptor& write_fd, error_code& ec) {
756 struct CopyFileState {
757 copyfile_state_t state;
758 CopyFileState() { state = copyfile_state_alloc(); }
759 ~CopyFileState() { copyfile_state_free(state); }
685760
686 ec.clear();761 private:
687 return true;762 CopyFileState(CopyFileState const&) = delete;
688}763 CopyFileState& operator=(CopyFileState const&) = delete;
689#endif764 };
690765
691// Note: This function isn't guarded by ifdef's even though it may be unused766 CopyFileState cfs;
692// in order to assure it still compiles.767 if (fcopyfile(read_fd.fd, write_fd.fd, cfs.state, COPYFILE_DATA) < 0) {
693__attribute__((unused)) bool copy_file_impl_default(FileDescriptor& read_fd,768 ec = capture_errno();
694 FileDescriptor& write_fd,769 return false;
695 error_code& ec) {770 }
696 ifstream in;
697 in.__open(read_fd.fd, ios::binary);
698 if (!in.is_open()) {
699 // This assumes that __open didn't reset the error code.
700 ec = capture_errno();
701 return false;
702 }
703 ofstream out;
704 out.__open(write_fd.fd, ios::binary);
705 if (!out.is_open()) {
706 ec = capture_errno();
707 return false;
708 }
709771
710 if (in.good() && out.good()) {772 ec.clear();
711 using InIt = istreambuf_iterator<char>;773 return true;
712 using OutIt = ostreambuf_iterator<char>;
713 InIt bin(in);
714 InIt ein;
715 OutIt bout(out);
716 copy(bin, ein, bout);
717 }
718 if (out.fail() || in.fail()) {
719 ec = make_error_code(errc::io_error);
720 return false;
721 }774 }
775#elif defined(_LIBCPP_FILESYSTEM_USE_FSTREAM)
776 bool copy_file_impl(FileDescriptor& read_fd, FileDescriptor& write_fd, error_code& ec) {
777 ifstream in;
778 in.__open(read_fd.fd, ios::binary);
779 if (!in.is_open()) {
780 // This assumes that __open didn't reset the error code.
781 ec = capture_errno();
782 return false;
783 }
784 read_fd.fd = -1;
785 ofstream out;
786 out.__open(write_fd.fd, ios::binary);
787 if (!out.is_open()) {
788 ec = capture_errno();
789 return false;
790 }
791 write_fd.fd = -1;
792
793 if (in.good() && out.good()) {
794 using InIt = istreambuf_iterator<char>;
795 using OutIt = ostreambuf_iterator<char>;
796 InIt bin(in);
797 InIt ein;
798 OutIt bout(out);
799 copy(bin, ein, bout);
800 }
801 if (out.fail() || in.fail()) {
802 ec = make_error_code(errc::io_error);
803 return false;
804 }
722805
723 ec.clear();806 ec.clear();
724 return true;807 return true;
725}808 }
726
727bool copy_file_impl(FileDescriptor& from, FileDescriptor& to, error_code& ec) {
728#if defined(_LIBCPP_USE_SENDFILE)
729 return copy_file_impl_sendfile(from, to, ec);
730#elif defined(_LIBCPP_USE_COPYFILE)
731 return copy_file_impl_copyfile(from, to, ec);
732#else809#else
733 return copy_file_impl_default(from, to, ec);810# error "Unknown implementation for copy_file_impl"
734#endif811#endif // copy_file_impl implementation
735}
736812
737} // namespace813} // end anonymous namespace
738} // namespace detail814} // end namespace detail
739815
740bool __copy_file(const path& from, const path& to, copy_options options,816bool __copy_file(const path& from, const path& to, copy_options options,
741 error_code* ec) {817 error_code* ec) {
...@@ -870,8 +946,17 @@ bool __create_directory(const path& p, error_code* ec) {...@@ -870,8 +946,17 @@ bool __create_directory(const path& p, error_code* ec) {
870946
871 if (::mkdir(p.c_str(), static_cast<int>(perms::all)) == 0)947 if (::mkdir(p.c_str(), static_cast<int>(perms::all)) == 0)
872 return true;948 return true;
873 if (errno != EEXIST)949
950 if (errno == EEXIST) {
951 error_code mec = capture_errno();
952 error_code ignored_ec;
953 const file_status st = status(p, ignored_ec);
954 if (!is_directory(st)) {
955 err.report(mec);
956 }
957 } else {
874 err.report(capture_errno());958 err.report(capture_errno());
959 }
875 return false;960 return false;
876}961}
877962
...@@ -889,8 +974,17 @@ bool __create_directory(path const& p, path const& attributes, error_code* ec) {...@@ -889,8 +974,17 @@ bool __create_directory(path const& p, path const& attributes, error_code* ec) {
889974
890 if (::mkdir(p.c_str(), attr_stat.st_mode) == 0)975 if (::mkdir(p.c_str(), attr_stat.st_mode) == 0)
891 return true;976 return true;
892 if (errno != EEXIST)977
978 if (errno == EEXIST) {
979 error_code mec = capture_errno();
980 error_code ignored_ec;
981 const file_status st = status(p, ignored_ec);
982 if (!is_directory(st)) {
983 err.report(mec);
984 }
985 } else {
893 err.report(capture_errno());986 err.report(capture_errno());
987 }
894 return false;988 return false;
895}989}
896990
...@@ -1225,10 +1319,10 @@ path __temp_directory_path(error_code* ec) {...@@ -1225,10 +1319,10 @@ path __temp_directory_path(error_code* ec) {
1225 error_code m_ec;1319 error_code m_ec;
1226 file_status st = detail::posix_stat(p, &m_ec);1320 file_status st = detail::posix_stat(p, &m_ec);
1227 if (!status_known(st))1321 if (!status_known(st))
1228 return err.report(m_ec, "cannot access path \"%s\"", p);1322 return err.report(m_ec, "cannot access path \"" PS_FMT "\"", p);
12291323
1230 if (!exists(st) || !is_directory(st))1324 if (!exists(st) || !is_directory(st))
1231 return err.report(errc::not_a_directory, "path \"%s\" is not a directory",1325 return err.report(errc::not_a_directory, "path \"" PS_FMT "\" is not a directory",
1232 p);1326 p);
12331327
1234 return p;1328 return p;
...@@ -1284,7 +1378,7 @@ path& path::replace_extension(path const& replacement) {...@@ -1284,7 +1378,7 @@ path& path::replace_extension(path const& replacement) {
1284 }1378 }
1285 if (!replacement.empty()) {1379 if (!replacement.empty()) {
1286 if (replacement.native()[0] != '.') {1380 if (replacement.native()[0] != '.') {
1287 __pn_ += ".";1381 __pn_ += PS(".");
1288 }1382 }
1289 __pn_.append(replacement.__pn_);1383 __pn_.append(replacement.__pn_);
1290 }1384 }
...@@ -1314,7 +1408,7 @@ string_view_t path::__root_path_raw() const {...@@ -1314,7 +1408,7 @@ string_view_t path::__root_path_raw() const {
1314 auto PP = PathParser::CreateBegin(__pn_);1408 auto PP = PathParser::CreateBegin(__pn_);
1315 if (PP.State == PathParser::PS_InRootName) {1409 if (PP.State == PathParser::PS_InRootName) {
1316 auto NextCh = PP.peek();1410 auto NextCh = PP.peek();
1317 if (NextCh && *NextCh == '/') {1411 if (NextCh && isSeparator(*NextCh)) {
1318 ++PP;1412 ++PP;
1319 return createView(__pn_.data(), &PP.RawEntry.back());1413 return createView(__pn_.data(), &PP.RawEntry.back());
1320 }1414 }
...@@ -1406,12 +1500,16 @@ enum PathPartKind : unsigned char {...@@ -1406,12 +1500,16 @@ enum PathPartKind : unsigned char {
1406static PathPartKind ClassifyPathPart(string_view_t Part) {1500static PathPartKind ClassifyPathPart(string_view_t Part) {
1407 if (Part.empty())1501 if (Part.empty())
1408 return PK_TrailingSep;1502 return PK_TrailingSep;
1409 if (Part == ".")1503 if (Part == PS("."))
1410 return PK_Dot;1504 return PK_Dot;
1411 if (Part == "..")1505 if (Part == PS(".."))
1412 return PK_DotDot;1506 return PK_DotDot;
1413 if (Part == "/")1507 if (Part == PS("/"))
1508 return PK_RootSep;
1509#if defined(_LIBCPP_WIN32API)
1510 if (Part == PS("\\"))
1414 return PK_RootSep;1511 return PK_RootSep;
1512#endif
1415 return PK_Filename;1513 return PK_Filename;
1416}1514}
14171515
...@@ -1459,7 +1557,7 @@ path path::lexically_normal() const {...@@ -1459,7 +1557,7 @@ path path::lexically_normal() const {
1459 NewPathSize -= Parts.back().first.size();1557 NewPathSize -= Parts.back().first.size();
1460 Parts.pop_back();1558 Parts.pop_back();
1461 } else if (LastKind != PK_RootSep)1559 } else if (LastKind != PK_RootSep)
1462 AddPart(PK_DotDot, "..");1560 AddPart(PK_DotDot, PS(".."));
1463 MaybeNeedTrailingSep = LastKind == PK_Filename;1561 MaybeNeedTrailingSep = LastKind == PK_Filename;
1464 break;1562 break;
1465 }1563 }
...@@ -1474,7 +1572,7 @@ path path::lexically_normal() const {...@@ -1474,7 +1572,7 @@ path path::lexically_normal() const {
1474 }1572 }
1475 // [fs.path.generic]p6.8: If the path is empty, add a dot.1573 // [fs.path.generic]p6.8: If the path is empty, add a dot.
1476 if (Parts.empty())1574 if (Parts.empty())
1477 return ".";1575 return PS(".");
14781576
1479 // [fs.path.generic]p6.7: If the last filename is dot-dot, remove any1577 // [fs.path.generic]p6.7: If the last filename is dot-dot, remove any
1480 // trailing directory-separator.1578 // trailing directory-separator.
...@@ -1486,7 +1584,7 @@ path path::lexically_normal() const {...@@ -1486,7 +1584,7 @@ path path::lexically_normal() const {
1486 Result /= PK.first;1584 Result /= PK.first;
14871585
1488 if (NeedTrailingSep)1586 if (NeedTrailingSep)
1489 Result /= "";1587 Result /= PS("");
14901588
1491 return Result;1589 return Result;
1492}1590}
...@@ -1495,9 +1593,9 @@ static int DetermineLexicalElementCount(PathParser PP) {...@@ -1495,9 +1593,9 @@ static int DetermineLexicalElementCount(PathParser PP) {
1495 int Count = 0;1593 int Count = 0;
1496 for (; PP; ++PP) {1594 for (; PP; ++PP) {
1497 auto Elem = *PP;1595 auto Elem = *PP;
1498 if (Elem == "..")1596 if (Elem == PS(".."))
1499 --Count;1597 --Count;
1500 else if (Elem != "." && Elem != "")1598 else if (Elem != PS(".") && Elem != PS(""))
1501 ++Count;1599 ++Count;
1502 }1600 }
1503 return Count;1601 return Count;
...@@ -1544,15 +1642,15 @@ path path::lexically_relative(const path& base) const {...@@ -1544,15 +1642,15 @@ path path::lexically_relative(const path& base) const {
1544 return {};1642 return {};
15451643
1546 // if n == 0 and (a == end() || a->empty()), returns path("."); otherwise1644 // if n == 0 and (a == end() || a->empty()), returns path("."); otherwise
1547 if (ElemCount == 0 && (PP.atEnd() || *PP == ""))1645 if (ElemCount == 0 && (PP.atEnd() || *PP == PS("")))
1548 return ".";1646 return PS(".");
15491647
1550 // return a path constructed with 'n' dot-dot elements, followed by the the1648 // return a path constructed with 'n' dot-dot elements, followed by the the
1551 // elements of '*this' after the mismatch.1649 // elements of '*this' after the mismatch.
1552 path Result;1650 path Result;
1553 // FIXME: Reserve enough room in Result that it won't have to re-allocate.1651 // FIXME: Reserve enough room in Result that it won't have to re-allocate.
1554 while (ElemCount--)1652 while (ElemCount--)
1555 Result /= "..";1653 Result /= PS("..");
1556 for (; PP; ++PP)1654 for (; PP; ++PP)
1557 Result /= *PP;1655 Result /= *PP;
1558 return Result;1656 return Result;
...@@ -1565,7 +1663,7 @@ static int CompareRootName(PathParser *LHS, PathParser *RHS) {...@@ -1565,7 +1663,7 @@ static int CompareRootName(PathParser *LHS, PathParser *RHS) {
1565 return 0;1663 return 0;
15661664
1567 auto GetRootName = [](PathParser *Parser) -> string_view_t {1665 auto GetRootName = [](PathParser *Parser) -> string_view_t {
1568 return Parser->inRootName() ? **Parser : "";1666 return Parser->inRootName() ? **Parser : PS("");
1569 };1667 };
1570 int res = GetRootName(LHS).compare(GetRootName(RHS));1668 int res = GetRootName(LHS).compare(GetRootName(RHS));
1571 ConsumeRootName(LHS);1669 ConsumeRootName(LHS);
...@@ -1674,6 +1772,36 @@ path::iterator& path::iterator::__decrement() {...@@ -1674,6 +1772,36 @@ path::iterator& path::iterator::__decrement() {
1674 return *this;1772 return *this;
1675}1773}
16761774
1775#if defined(_LIBCPP_WIN32API)
1776////////////////////////////////////////////////////////////////////////////
1777// Windows path conversions
1778size_t __wide_to_char(const wstring &str, char *out, size_t outlen) {
1779 if (str.empty())
1780 return 0;
1781 ErrorHandler<size_t> err("__wide_to_char", nullptr);
1782 UINT codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
1783 BOOL used_default = FALSE;
1784 int ret = WideCharToMultiByte(codepage, 0, str.data(), str.size(), out,
1785 outlen, nullptr, &used_default);
1786 if (ret <= 0 || used_default)
1787 return err.report(errc::illegal_byte_sequence);
1788 return ret;
1789}
1790
1791size_t __char_to_wide(const string &str, wchar_t *out, size_t outlen) {
1792 if (str.empty())
1793 return 0;
1794 ErrorHandler<size_t> err("__char_to_wide", nullptr);
1795 UINT codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
1796 int ret = MultiByteToWideChar(codepage, MB_ERR_INVALID_CHARS, str.data(),
1797 str.size(), out, outlen);
1798 if (ret <= 0)
1799 return err.report(errc::illegal_byte_sequence);
1800 return ret;
1801}
1802#endif
1803
1804
1677///////////////////////////////////////////////////////////////////////////////1805///////////////////////////////////////////////////////////////////////////////
1678// directory entry definitions1806// directory entry definitions
1679///////////////////////////////////////////////////////////////////////////////1807///////////////////////////////////////////////////////////////////////////////
lib/libcxx/src/include/config_elast.h+4
...@@ -17,10 +17,14 @@...@@ -17,10 +17,14 @@
17#include <errno.h>17#include <errno.h>
18#endif18#endif
1919
20// Note: _LIBCPP_ELAST needs to be defined only on platforms
21// where strerror/strerror_r can't handle out-of-range errno values.
20#if defined(ELAST)22#if defined(ELAST)
21#define _LIBCPP_ELAST ELAST23#define _LIBCPP_ELAST ELAST
22#elif defined(_NEWLIB_VERSION)24#elif defined(_NEWLIB_VERSION)
23#define _LIBCPP_ELAST __ELASTERROR25#define _LIBCPP_ELAST __ELASTERROR
26#elif defined(__NuttX__)
27// No _LIBCPP_ELAST needed on NuttX
24#elif defined(__Fuchsia__)28#elif defined(__Fuchsia__)
25// No _LIBCPP_ELAST needed on Fuchsia29// No _LIBCPP_ELAST needed on Fuchsia
26#elif defined(__wasi__)30#elif defined(__wasi__)
lib/libcxx/src/include/refstring.h+19-6
...@@ -13,12 +13,25 @@...@@ -13,12 +13,25 @@
13#include <stdexcept>13#include <stdexcept>
14#include <cstddef>14#include <cstddef>
15#include <cstring>15#include <cstring>
16#ifdef __APPLE__
17#include <dlfcn.h>
18#include <mach-o/dyld.h>
19#endif
20#include "atomic_support.h"16#include "atomic_support.h"
2117
18// MacOS and iOS used to ship with libstdc++, and still support old applications
19// linking against libstdc++. The libc++ and libstdc++ exceptions are supposed
20// to be ABI compatible, such that they can be thrown from one library and caught
21// in the other.
22//
23// For that reason, we must look for libstdc++ in the same process and if found,
24// check the string stored in the exception object to see if it is the GCC empty
25// string singleton before manipulating the reference count. This is done so that
26// if an exception is created with a zero-length string in libstdc++, libc++abi
27// won't try to delete the memory.
28#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \
29 defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
30# define _LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE
31# include <dlfcn.h>
32# include <mach-o/dyld.h>
33#endif
34
22_LIBCPP_BEGIN_NAMESPACE_STD35_LIBCPP_BEGIN_NAMESPACE_STD
2336
24namespace __refstring_imp { namespace {37namespace __refstring_imp { namespace {
...@@ -40,7 +53,7 @@ inline char * data_from_rep(_Rep_base *rep) noexcept {...@@ -40,7 +53,7 @@ inline char * data_from_rep(_Rep_base *rep) noexcept {
40 return data + sizeof(*rep);53 return data + sizeof(*rep);
41}54}
4255
43#if defined(__APPLE__)56#if defined(_LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE)
44inline57inline
45const char* compute_gcc_empty_string_storage() _NOEXCEPT58const char* compute_gcc_empty_string_storage() _NOEXCEPT
46{59{
...@@ -115,7 +128,7 @@ __libcpp_refstring::~__libcpp_refstring() {...@@ -115,7 +128,7 @@ __libcpp_refstring::~__libcpp_refstring() {
115128
116inline129inline
117bool __libcpp_refstring::__uses_refcount() const {130bool __libcpp_refstring::__uses_refcount() const {
118#ifdef __APPLE__131#if defined(_LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE)
119 return __imp_ != get_gcc_empty_string_storage();132 return __imp_ != get_gcc_empty_string_storage();
120#else133#else
121 return true;134 return true;
lib/libcxx/src/ios.cpp-16
...@@ -15,30 +15,14 @@...@@ -15,30 +15,14 @@
15#include "__locale"15#include "__locale"
16#include "algorithm"16#include "algorithm"
17#include "include/config_elast.h"17#include "include/config_elast.h"
18#include "istream"
19#include "limits"18#include "limits"
20#include "memory"19#include "memory"
21#include "new"20#include "new"
22#include "streambuf"
23#include "string"21#include "string"
24#include "__undef_macros"22#include "__undef_macros"
2523
26_LIBCPP_BEGIN_NAMESPACE_STD24_LIBCPP_BEGIN_NAMESPACE_STD
2725
28template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<char>;
29template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<wchar_t>;
30
31template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<char>;
32template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<wchar_t>;
33
34template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<char>;
35template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<wchar_t>;
36
37template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<char>;
38template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<wchar_t>;
39
40template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_iostream<char>;
41
42class _LIBCPP_HIDDEN __iostream_category26class _LIBCPP_HIDDEN __iostream_category
43 : public __do_message27 : public __do_message
44{28{
lib/libcxx/src/ios.instantiations.cpp created+43
...@@ -0,0 +1,43 @@
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "__config"
10#include "fstream"
11#include "ios"
12#include "istream"
13#include "ostream"
14#include "sstream"
15#include "streambuf"
16
17
18_LIBCPP_BEGIN_NAMESPACE_STD
19
20// Original explicit instantiations provided in the library
21template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<char>;
22template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<wchar_t>;
23template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<char>;
24template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<wchar_t>;
25template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<char>;
26template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<wchar_t>;
27template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<char>;
28template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<wchar_t>;
29template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_iostream<char>;
30
31// Additional instantiations added later. Whether programs rely on these being
32// available is protected by _LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1.
33template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_stringbuf<char>;
34template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_stringstream<char>;
35template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostringstream<char>;
36template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istringstream<char>;
37template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ifstream<char>;
38template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ofstream<char>;
39template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_filebuf<char>;
40
41// Add more here if needed...
42
43_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/iostream.cpp+1-1
...@@ -77,7 +77,7 @@ __asm__("?wclog@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@_WU?$char_t...@@ -77,7 +77,7 @@ __asm__("?wclog@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream@_WU?$char_t
77#endif77#endif
78;78;
7979
80_LIBCPP_HIDDEN ios_base::Init __start_std_streams;80_LIBCPP_HIDDEN ios_base::Init __start_std_streams _LIBCPP_INIT_PRIORITY_MAX;
8181
82// On Windows the TLS storage for locales needs to be initialized before we create82// On Windows the TLS storage for locales needs to be initialized before we create
83// the standard streams, otherwise it may not be alive during program termination83// the standard streams, otherwise it may not be alive during program termination
lib/libcxx/src/locale.cpp+200-10
...@@ -29,8 +29,8 @@...@@ -29,8 +29,8 @@
29#include "cwctype"29#include "cwctype"
30#include "__sso_allocator"30#include "__sso_allocator"
31#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)31#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
32#include "support/win32/locale_win32.h"32#include "__support/win32/locale_win32.h"
33#elif !defined(__BIONIC__)33#elif !defined(__BIONIC__) && !defined(__NuttX__)
34#include <langinfo.h>34#include <langinfo.h>
35#endif35#endif
36#include <stdlib.h>36#include <stdlib.h>
...@@ -158,7 +158,7 @@ const locale::category locale::all;...@@ -158,7 +158,7 @@ const locale::category locale::all;
158class _LIBCPP_HIDDEN locale::__imp158class _LIBCPP_HIDDEN locale::__imp
159 : public facet159 : public facet
160{160{
161 enum {N = 28};161 enum {N = 30};
162#if defined(_LIBCPP_COMPILER_MSVC)162#if defined(_LIBCPP_COMPILER_MSVC)
163// FIXME: MSVC doesn't support aligned parameters by value.163// FIXME: MSVC doesn't support aligned parameters by value.
164// I can't get the __sso_allocator to work here164// I can't get the __sso_allocator to work here
...@@ -202,8 +202,14 @@ locale::__imp::__imp(size_t refs)...@@ -202,8 +202,14 @@ locale::__imp::__imp(size_t refs)
202 install(&make<_VSTD::ctype<wchar_t> >(1u));202 install(&make<_VSTD::ctype<wchar_t> >(1u));
203 install(&make<codecvt<char, char, mbstate_t> >(1u));203 install(&make<codecvt<char, char, mbstate_t> >(1u));
204 install(&make<codecvt<wchar_t, char, mbstate_t> >(1u));204 install(&make<codecvt<wchar_t, char, mbstate_t> >(1u));
205_LIBCPP_SUPPRESS_DEPRECATED_PUSH
205 install(&make<codecvt<char16_t, char, mbstate_t> >(1u));206 install(&make<codecvt<char16_t, char, mbstate_t> >(1u));
206 install(&make<codecvt<char32_t, char, mbstate_t> >(1u));207 install(&make<codecvt<char32_t, char, mbstate_t> >(1u));
208_LIBCPP_SUPPRESS_DEPRECATED_POP
209#ifndef _LIBCPP_NO_HAS_CHAR8_T
210 install(&make<codecvt<char16_t, char8_t, mbstate_t> >(1u));
211 install(&make<codecvt<char32_t, char8_t, mbstate_t> >(1u));
212#endif
207 install(&make<numpunct<char> >(1u));213 install(&make<numpunct<char> >(1u));
208 install(&make<numpunct<wchar_t> >(1u));214 install(&make<numpunct<wchar_t> >(1u));
209 install(&make<num_get<char> >(1u));215 install(&make<num_get<char> >(1u));
...@@ -245,8 +251,14 @@ locale::__imp::__imp(const string& name, size_t refs)...@@ -245,8 +251,14 @@ locale::__imp::__imp(const string& name, size_t refs)
245 install(new ctype_byname<wchar_t>(name_));251 install(new ctype_byname<wchar_t>(name_));
246 install(new codecvt_byname<char, char, mbstate_t>(name_));252 install(new codecvt_byname<char, char, mbstate_t>(name_));
247 install(new codecvt_byname<wchar_t, char, mbstate_t>(name_));253 install(new codecvt_byname<wchar_t, char, mbstate_t>(name_));
254_LIBCPP_SUPPRESS_DEPRECATED_PUSH
248 install(new codecvt_byname<char16_t, char, mbstate_t>(name_));255 install(new codecvt_byname<char16_t, char, mbstate_t>(name_));
249 install(new codecvt_byname<char32_t, char, mbstate_t>(name_));256 install(new codecvt_byname<char32_t, char, mbstate_t>(name_));
257_LIBCPP_SUPPRESS_DEPRECATED_POP
258#ifndef _LIBCPP_NO_HAS_CHAR8_T
259 install(new codecvt_byname<char16_t, char8_t, mbstate_t>(name_));
260 install(new codecvt_byname<char32_t, char8_t, mbstate_t>(name_));
261#endif
250 install(new numpunct_byname<char>(name_));262 install(new numpunct_byname<char>(name_));
251 install(new numpunct_byname<wchar_t>(name_));263 install(new numpunct_byname<wchar_t>(name_));
252 install(new moneypunct_byname<char, false>(name_));264 install(new moneypunct_byname<char, false>(name_));
...@@ -315,8 +327,14 @@ locale::__imp::__imp(const __imp& other, const string& name, locale::category c)...@@ -315,8 +327,14 @@ locale::__imp::__imp(const __imp& other, const string& name, locale::category c)
315 install(new ctype_byname<wchar_t>(name));327 install(new ctype_byname<wchar_t>(name));
316 install(new codecvt_byname<char, char, mbstate_t>(name));328 install(new codecvt_byname<char, char, mbstate_t>(name));
317 install(new codecvt_byname<wchar_t, char, mbstate_t>(name));329 install(new codecvt_byname<wchar_t, char, mbstate_t>(name));
330_LIBCPP_SUPPRESS_DEPRECATED_PUSH
318 install(new codecvt_byname<char16_t, char, mbstate_t>(name));331 install(new codecvt_byname<char16_t, char, mbstate_t>(name));
319 install(new codecvt_byname<char32_t, char, mbstate_t>(name));332 install(new codecvt_byname<char32_t, char, mbstate_t>(name));
333_LIBCPP_SUPPRESS_DEPRECATED_POP
334#ifndef _LIBCPP_NO_HAS_CHAR8_T
335 install(new codecvt_byname<char16_t, char8_t, mbstate_t>(name));
336 install(new codecvt_byname<char32_t, char8_t, mbstate_t>(name));
337#endif
320 }338 }
321 if (c & locale::monetary)339 if (c & locale::monetary)
322 {340 {
...@@ -385,8 +403,14 @@ locale::__imp::__imp(const __imp& other, const __imp& one, locale::category c)...@@ -385,8 +403,14 @@ locale::__imp::__imp(const __imp& other, const __imp& one, locale::category c)
385 install_from<_VSTD::ctype<char> >(one);403 install_from<_VSTD::ctype<char> >(one);
386 install_from<_VSTD::ctype<wchar_t> >(one);404 install_from<_VSTD::ctype<wchar_t> >(one);
387 install_from<_VSTD::codecvt<char, char, mbstate_t> >(one);405 install_from<_VSTD::codecvt<char, char, mbstate_t> >(one);
406_LIBCPP_SUPPRESS_DEPRECATED_PUSH
388 install_from<_VSTD::codecvt<char16_t, char, mbstate_t> >(one);407 install_from<_VSTD::codecvt<char16_t, char, mbstate_t> >(one);
389 install_from<_VSTD::codecvt<char32_t, char, mbstate_t> >(one);408 install_from<_VSTD::codecvt<char32_t, char, mbstate_t> >(one);
409_LIBCPP_SUPPRESS_DEPRECATED_POP
410#ifndef _LIBCPP_NO_HAS_CHAR8_T
411 install_from<_VSTD::codecvt<char16_t, char8_t, mbstate_t> >(one);
412 install_from<_VSTD::codecvt<char32_t, char8_t, mbstate_t> >(one);
413#endif
390 install_from<_VSTD::codecvt<wchar_t, char, mbstate_t> >(one);414 install_from<_VSTD::codecvt<wchar_t, char, mbstate_t> >(one);
391 }415 }
392 if (c & locale::monetary)416 if (c & locale::monetary)
...@@ -1149,7 +1173,7 @@ ctype<char>::__classic_upper_table() _NOEXCEPT...@@ -1149,7 +1173,7 @@ ctype<char>::__classic_upper_table() _NOEXCEPT
1149{1173{
1150 return _LIBCPP_GET_C_LOCALE->__ctype_toupper;1174 return _LIBCPP_GET_C_LOCALE->__ctype_toupper;
1151}1175}
1152#elif __NetBSD__1176#elif defined(__NetBSD__)
1153const short*1177const short*
1154ctype<char>::__classic_lower_table() _NOEXCEPT1178ctype<char>::__classic_lower_table() _NOEXCEPT
1155{1179{
...@@ -3171,6 +3195,87 @@ codecvt<char16_t, char, mbstate_t>::do_max_length() const _NOEXCEPT...@@ -3171,6 +3195,87 @@ codecvt<char16_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
3171 return 4;3195 return 4;
3172}3196}
31733197
3198#ifndef _LIBCPP_NO_HAS_CHAR8_T
3199
3200// template <> class codecvt<char16_t, char8_t, mbstate_t>
3201
3202locale::id codecvt<char16_t, char8_t, mbstate_t>::id;
3203
3204codecvt<char16_t, char8_t, mbstate_t>::~codecvt()
3205{
3206}
3207
3208codecvt<char16_t, char8_t, mbstate_t>::result
3209codecvt<char16_t, char8_t, mbstate_t>::do_out(state_type&,
3210 const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt,
3211 extern_type* to, extern_type* to_end, extern_type*& to_nxt) const
3212{
3213 const uint16_t* _frm = reinterpret_cast<const uint16_t*>(frm);
3214 const uint16_t* _frm_end = reinterpret_cast<const uint16_t*>(frm_end);
3215 const uint16_t* _frm_nxt = _frm;
3216 uint8_t* _to = reinterpret_cast<uint8_t*>(to);
3217 uint8_t* _to_end = reinterpret_cast<uint8_t*>(to_end);
3218 uint8_t* _to_nxt = _to;
3219 result r = utf16_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt);
3220 frm_nxt = frm + (_frm_nxt - _frm);
3221 to_nxt = to + (_to_nxt - _to);
3222 return r;
3223}
3224
3225codecvt<char16_t, char8_t, mbstate_t>::result
3226codecvt<char16_t, char8_t, mbstate_t>::do_in(state_type&,
3227 const extern_type* frm, const extern_type* frm_end, const extern_type*& frm_nxt,
3228 intern_type* to, intern_type* to_end, intern_type*& to_nxt) const
3229{
3230 const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
3231 const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
3232 const uint8_t* _frm_nxt = _frm;
3233 uint16_t* _to = reinterpret_cast<uint16_t*>(to);
3234 uint16_t* _to_end = reinterpret_cast<uint16_t*>(to_end);
3235 uint16_t* _to_nxt = _to;
3236 result r = utf8_to_utf16(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt);
3237 frm_nxt = frm + (_frm_nxt - _frm);
3238 to_nxt = to + (_to_nxt - _to);
3239 return r;
3240}
3241
3242codecvt<char16_t, char8_t, mbstate_t>::result
3243codecvt<char16_t, char8_t, mbstate_t>::do_unshift(state_type&,
3244 extern_type* to, extern_type*, extern_type*& to_nxt) const
3245{
3246 to_nxt = to;
3247 return noconv;
3248}
3249
3250int
3251codecvt<char16_t, char8_t, mbstate_t>::do_encoding() const _NOEXCEPT
3252{
3253 return 0;
3254}
3255
3256bool
3257codecvt<char16_t, char8_t, mbstate_t>::do_always_noconv() const _NOEXCEPT
3258{
3259 return false;
3260}
3261
3262int
3263codecvt<char16_t, char8_t, mbstate_t>::do_length(state_type&,
3264 const extern_type* frm, const extern_type* frm_end, size_t mx) const
3265{
3266 const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
3267 const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
3268 return utf8_to_utf16_length(_frm, _frm_end, mx);
3269}
3270
3271int
3272codecvt<char16_t, char8_t, mbstate_t>::do_max_length() const _NOEXCEPT
3273{
3274 return 4;
3275}
3276
3277#endif
3278
3174// template <> class codecvt<char32_t, char, mbstate_t>3279// template <> class codecvt<char32_t, char, mbstate_t>
31753280
3176locale::id codecvt<char32_t, char, mbstate_t>::id;3281locale::id codecvt<char32_t, char, mbstate_t>::id;
...@@ -3248,6 +3353,87 @@ codecvt<char32_t, char, mbstate_t>::do_max_length() const _NOEXCEPT...@@ -3248,6 +3353,87 @@ codecvt<char32_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
3248 return 4;3353 return 4;
3249}3354}
32503355
3356#ifndef _LIBCPP_NO_HAS_CHAR8_T
3357
3358// template <> class codecvt<char32_t, char8_t, mbstate_t>
3359
3360locale::id codecvt<char32_t, char8_t, mbstate_t>::id;
3361
3362codecvt<char32_t, char8_t, mbstate_t>::~codecvt()
3363{
3364}
3365
3366codecvt<char32_t, char8_t, mbstate_t>::result
3367codecvt<char32_t, char8_t, mbstate_t>::do_out(state_type&,
3368 const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt,
3369 extern_type* to, extern_type* to_end, extern_type*& to_nxt) const
3370{
3371 const uint32_t* _frm = reinterpret_cast<const uint32_t*>(frm);
3372 const uint32_t* _frm_end = reinterpret_cast<const uint32_t*>(frm_end);
3373 const uint32_t* _frm_nxt = _frm;
3374 uint8_t* _to = reinterpret_cast<uint8_t*>(to);
3375 uint8_t* _to_end = reinterpret_cast<uint8_t*>(to_end);
3376 uint8_t* _to_nxt = _to;
3377 result r = ucs4_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt);
3378 frm_nxt = frm + (_frm_nxt - _frm);
3379 to_nxt = to + (_to_nxt - _to);
3380 return r;
3381}
3382
3383codecvt<char32_t, char8_t, mbstate_t>::result
3384codecvt<char32_t, char8_t, mbstate_t>::do_in(state_type&,
3385 const extern_type* frm, const extern_type* frm_end, const extern_type*& frm_nxt,
3386 intern_type* to, intern_type* to_end, intern_type*& to_nxt) const
3387{
3388 const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
3389 const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
3390 const uint8_t* _frm_nxt = _frm;
3391 uint32_t* _to = reinterpret_cast<uint32_t*>(to);
3392 uint32_t* _to_end = reinterpret_cast<uint32_t*>(to_end);
3393 uint32_t* _to_nxt = _to;
3394 result r = utf8_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt);
3395 frm_nxt = frm + (_frm_nxt - _frm);
3396 to_nxt = to + (_to_nxt - _to);
3397 return r;
3398}
3399
3400codecvt<char32_t, char8_t, mbstate_t>::result
3401codecvt<char32_t, char8_t, mbstate_t>::do_unshift(state_type&,
3402 extern_type* to, extern_type*, extern_type*& to_nxt) const
3403{
3404 to_nxt = to;
3405 return noconv;
3406}
3407
3408int
3409codecvt<char32_t, char8_t, mbstate_t>::do_encoding() const _NOEXCEPT
3410{
3411 return 0;
3412}
3413
3414bool
3415codecvt<char32_t, char8_t, mbstate_t>::do_always_noconv() const _NOEXCEPT
3416{
3417 return false;
3418}
3419
3420int
3421codecvt<char32_t, char8_t, mbstate_t>::do_length(state_type&,
3422 const extern_type* frm, const extern_type* frm_end, size_t mx) const
3423{
3424 const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
3425 const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
3426 return utf8_to_ucs4_length(_frm, _frm_end, mx);
3427}
3428
3429int
3430codecvt<char32_t, char8_t, mbstate_t>::do_max_length() const _NOEXCEPT
3431{
3432 return 4;
3433}
3434
3435#endif
3436
3251// __codecvt_utf8<wchar_t>3437// __codecvt_utf8<wchar_t>
32523438
3253__codecvt_utf8<wchar_t>::result3439__codecvt_utf8<wchar_t>::result
...@@ -5128,7 +5314,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)...@@ -5128,7 +5314,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
5128 mb = mbstate_t();5314 mb = mbstate_t();
5129 const char* bb = buf;5315 const char* bb = buf;
5130 size_t j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);5316 size_t j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
5131 if (j == size_t(-1))5317 if (j == size_t(-1) || j == 0)
5132 __throw_runtime_error("locale not supported");5318 __throw_runtime_error("locale not supported");
5133 wbe = wbuf + j;5319 wbe = wbuf + j;
5134 __weeks_[i].assign(wbuf, wbe);5320 __weeks_[i].assign(wbuf, wbe);
...@@ -5136,7 +5322,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)...@@ -5136,7 +5322,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
5136 mb = mbstate_t();5322 mb = mbstate_t();
5137 bb = buf;5323 bb = buf;
5138 j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);5324 j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
5139 if (j == size_t(-1))5325 if (j == size_t(-1) || j == 0)
5140 __throw_runtime_error("locale not supported");5326 __throw_runtime_error("locale not supported");
5141 wbe = wbuf + j;5327 wbe = wbuf + j;
5142 __weeks_[i+7].assign(wbuf, wbe);5328 __weeks_[i+7].assign(wbuf, wbe);
...@@ -5149,7 +5335,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)...@@ -5149,7 +5335,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
5149 mb = mbstate_t();5335 mb = mbstate_t();
5150 const char* bb = buf;5336 const char* bb = buf;
5151 size_t j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);5337 size_t j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
5152 if (j == size_t(-1))5338 if (j == size_t(-1) || j == 0)
5153 __throw_runtime_error("locale not supported");5339 __throw_runtime_error("locale not supported");
5154 wbe = wbuf + j;5340 wbe = wbuf + j;
5155 __months_[i].assign(wbuf, wbe);5341 __months_[i].assign(wbuf, wbe);
...@@ -5157,7 +5343,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)...@@ -5157,7 +5343,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
5157 mb = mbstate_t();5343 mb = mbstate_t();
5158 bb = buf;5344 bb = buf;
5159 j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);5345 j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
5160 if (j == size_t(-1))5346 if (j == size_t(-1) || j == 0)
5161 __throw_runtime_error("locale not supported");5347 __throw_runtime_error("locale not supported");
5162 wbe = wbuf + j;5348 wbe = wbuf + j;
5163 __months_[i+12].assign(wbuf, wbe);5349 __months_[i+12].assign(wbuf, wbe);
...@@ -6148,7 +6334,11 @@ template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<wchar_t>...@@ -6148,7 +6334,11 @@ template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<wchar_t>
61486334
6149template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char, char, mbstate_t>;6335template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char, char, mbstate_t>;
6150template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<wchar_t, char, mbstate_t>;6336template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<wchar_t, char, mbstate_t>;
6151template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_t, char, mbstate_t>;6337template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_t, char, mbstate_t>;
6152template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char, mbstate_t>;6338template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char, mbstate_t>;
6339#ifndef _LIBCPP_NO_HAS_CHAR8_T
6340template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_t, char8_t, mbstate_t>;
6341template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char8_t, mbstate_t>;
6342#endif
61536343
6154_LIBCPP_END_NAMESPACE_STD6344_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/memory.cpp-4
...@@ -124,16 +124,12 @@ __shared_weak_count::lock() _NOEXCEPT...@@ -124,16 +124,12 @@ __shared_weak_count::lock() _NOEXCEPT
124 return nullptr;124 return nullptr;
125}125}
126126
127#if !defined(_LIBCPP_NO_RTTI) || !defined(_LIBCPP_BUILD_STATIC)
128
129const void*127const void*
130__shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT128__shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT
131{129{
132 return nullptr;130 return nullptr;
133}131}
134132
135#endif // _LIBCPP_NO_RTTI
136
137#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)133#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
138134
139_LIBCPP_SAFE_STATIC static const std::size_t __sp_mut_count = 16;135_LIBCPP_SAFE_STATIC static const std::size_t __sp_mut_count = 16;
lib/libcxx/src/new.cpp+14-18
...@@ -64,7 +64,7 @@ operator new(std::size_t size) _THROW_BAD_ALLOC...@@ -64,7 +64,7 @@ operator new(std::size_t size) _THROW_BAD_ALLOC
64 if (size == 0)64 if (size == 0)
65 size = 1;65 size = 1;
66 void* p;66 void* p;
67 while ((p = ::malloc(size)) == 0)67 while ((p = ::malloc(size)) == nullptr)
68 {68 {
69 // If malloc fails and there is a new_handler,69 // If malloc fails and there is a new_handler,
70 // call it to try free up memory.70 // call it to try free up memory.
...@@ -85,7 +85,7 @@ _LIBCPP_WEAK...@@ -85,7 +85,7 @@ _LIBCPP_WEAK
85void*85void*
86operator new(size_t size, const std::nothrow_t&) _NOEXCEPT86operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
87{87{
88 void* p = 0;88 void* p = nullptr;
89#ifndef _LIBCPP_NO_EXCEPTIONS89#ifndef _LIBCPP_NO_EXCEPTIONS
90 try90 try
91 {91 {
...@@ -111,7 +111,7 @@ _LIBCPP_WEAK...@@ -111,7 +111,7 @@ _LIBCPP_WEAK
111void*111void*
112operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT112operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
113{113{
114 void* p = 0;114 void* p = nullptr;
115#ifndef _LIBCPP_NO_EXCEPTIONS115#ifndef _LIBCPP_NO_EXCEPTIONS
116 try116 try
117 {117 {
...@@ -178,15 +178,16 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC...@@ -178,15 +178,16 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
178 size = 1;178 size = 1;
179 if (static_cast<size_t>(alignment) < sizeof(void*))179 if (static_cast<size_t>(alignment) < sizeof(void*))
180 alignment = std::align_val_t(sizeof(void*));180 alignment = std::align_val_t(sizeof(void*));
181
182 // Try allocating memory. If allocation fails and there is a new_handler,
183 // call it to try free up memory, and try again until it succeeds, or until
184 // the new_handler decides to terminate.
185 //
186 // If allocation fails and there is no new_handler, we throw bad_alloc
187 // (or return nullptr if exceptions are disabled).
181 void* p;188 void* p;
182#if defined(_LIBCPP_MSVCRT_LIKE)189 while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr)
183 while ((p = _aligned_malloc(size, static_cast<size_t>(alignment))) == nullptr)
184#else
185 while (::posix_memalign(&p, static_cast<size_t>(alignment), size) != 0)
186#endif
187 {190 {
188 // If posix_memalign fails and there is a new_handler,
189 // call it to try free up memory.
190 std::new_handler nh = std::get_new_handler();191 std::new_handler nh = std::get_new_handler();
191 if (nh)192 if (nh)
192 nh();193 nh();
...@@ -194,7 +195,6 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC...@@ -194,7 +195,6 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
194#ifndef _LIBCPP_NO_EXCEPTIONS195#ifndef _LIBCPP_NO_EXCEPTIONS
195 throw std::bad_alloc();196 throw std::bad_alloc();
196#else197#else
197 p = nullptr; // posix_memalign doesn't initialize 'p' on failure
198 break;198 break;
199#endif199#endif
200 }200 }
...@@ -206,7 +206,7 @@ _LIBCPP_WEAK...@@ -206,7 +206,7 @@ _LIBCPP_WEAK
206void*206void*
207operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT207operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
208{208{
209 void* p = 0;209 void* p = nullptr;
210#ifndef _LIBCPP_NO_EXCEPTIONS210#ifndef _LIBCPP_NO_EXCEPTIONS
211 try211 try
212 {212 {
...@@ -232,7 +232,7 @@ _LIBCPP_WEAK...@@ -232,7 +232,7 @@ _LIBCPP_WEAK
232void*232void*
233operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT233operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
234{234{
235 void* p = 0;235 void* p = nullptr;
236#ifndef _LIBCPP_NO_EXCEPTIONS236#ifndef _LIBCPP_NO_EXCEPTIONS
237 try237 try
238 {238 {
...@@ -251,11 +251,7 @@ _LIBCPP_WEAK...@@ -251,11 +251,7 @@ _LIBCPP_WEAK
251void251void
252operator delete(void* ptr, std::align_val_t) _NOEXCEPT252operator delete(void* ptr, std::align_val_t) _NOEXCEPT
253{253{
254#if defined(_LIBCPP_MSVCRT_LIKE)254 std::__libcpp_aligned_free(ptr);
255 ::_aligned_free(ptr);
256#else
257 ::free(ptr);
258#endif
259}255}
260256
261_LIBCPP_WEAK257_LIBCPP_WEAK
lib/libcxx/src/optional.cpp+1
...@@ -7,6 +7,7 @@...@@ -7,6 +7,7 @@
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
88
9#include "optional"9#include "optional"
10#include "__availability"
1011
11namespace std12namespace std
12{13{
lib/libcxx/src/random.cpp+21
...@@ -13,6 +13,7 @@...@@ -13,6 +13,7 @@
13#define _CRT_RAND_S13#define _CRT_RAND_S
14#endif // defined(_LIBCPP_USING_WIN32_RANDOM)14#endif // defined(_LIBCPP_USING_WIN32_RANDOM)
1515
16#include "limits"
16#include "random"17#include "random"
17#include "system_error"18#include "system_error"
1819
...@@ -29,6 +30,10 @@...@@ -29,6 +30,10 @@
29#elif defined(_LIBCPP_USING_DEV_RANDOM)30#elif defined(_LIBCPP_USING_DEV_RANDOM)
30#include <fcntl.h>31#include <fcntl.h>
31#include <unistd.h>32#include <unistd.h>
33#if __has_include(<sys/ioctl.h>) && __has_include(<linux/random.h>)
34#include <sys/ioctl.h>
35#include <linux/random.h>
36#endif
32#elif defined(_LIBCPP_USING_NACL_RANDOM)37#elif defined(_LIBCPP_USING_NACL_RANDOM)
33#include <nacl/nacl_random.h>38#include <nacl/nacl_random.h>
34#endif39#endif
...@@ -172,7 +177,23 @@ random_device::operator()()...@@ -172,7 +177,23 @@ random_device::operator()()
172double177double
173random_device::entropy() const _NOEXCEPT178random_device::entropy() const _NOEXCEPT
174{179{
180#if defined(_LIBCPP_USING_DEV_RANDOM) && defined(RNDGETENTCNT)
181 int ent;
182 if (::ioctl(__f_, RNDGETENTCNT, &ent) < 0)
183 return 0;
184
185 if (ent < 0)
175 return 0;186 return 0;
187
188 if (ent > std::numeric_limits<result_type>::digits)
189 return std::numeric_limits<result_type>::digits;
190
191 return ent;
192#elif defined(__OpenBSD__)
193 return std::numeric_limits<result_type>::digits;
194#else
195 return 0;
196#endif
176}197}
177198
178_LIBCPP_END_NAMESPACE_STD199_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/support/runtime/exception_fallback.ipp-4
...@@ -49,7 +49,6 @@ get_terminate() _NOEXCEPT...@@ -49,7 +49,6 @@ get_terminate() _NOEXCEPT
49 return __libcpp_atomic_load(&__terminate_handler);49 return __libcpp_atomic_load(&__terminate_handler);
50}50}
5151
52#ifndef __EMSCRIPTEN__ // We provide this in JS
53_LIBCPP_NORETURN52_LIBCPP_NORETURN
54void53void
55terminate() _NOEXCEPT54terminate() _NOEXCEPT
...@@ -72,9 +71,7 @@ terminate() _NOEXCEPT...@@ -72,9 +71,7 @@ terminate() _NOEXCEPT
72 }71 }
73#endif // _LIBCPP_NO_EXCEPTIONS72#endif // _LIBCPP_NO_EXCEPTIONS
74}73}
75#endif // !__EMSCRIPTEN__
7674
77#if !defined(__EMSCRIPTEN__)
78bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; }75bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; }
7976
80int uncaught_exceptions() _NOEXCEPT77int uncaught_exceptions() _NOEXCEPT
...@@ -83,7 +80,6 @@ int uncaught_exceptions() _NOEXCEPT...@@ -83,7 +80,6 @@ int uncaught_exceptions() _NOEXCEPT
83 fprintf(stderr, "uncaught_exceptions not yet implemented\n");80 fprintf(stderr, "uncaught_exceptions not yet implemented\n");
84 ::abort();81 ::abort();
85}82}
86#endif // !__EMSCRIPTEN__
8783
8884
89exception::~exception() _NOEXCEPT85exception::~exception() _NOEXCEPT
lib/libcxx/src/support/solaris/xlocale.cpp+1-1
...@@ -8,7 +8,7 @@...@@ -8,7 +8,7 @@
88
9#ifdef __sun__9#ifdef __sun__
1010
11#include "support/solaris/xlocale.h"11#include "__support/solaris/xlocale.h"
12#include <stdarg.h>12#include <stdarg.h>
13#include <stdio.h>13#include <stdio.h>
14#include <sys/localedef.h>14#include <sys/localedef.h>
lib/libcxx/src/support/win32/locale_win32.cpp+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1// -*- C++ -*-1// -*- C++ -*-
2//===-------------------- support/win32/locale_win32.cpp ------------------===//2//===----------------------------------------------------------------------===//
3//3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.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.5// See https://llvm.org/LICENSE.txt for license information.
lib/libcxx/src/support/win32/support.cpp+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1// -*- C++ -*-1// -*- C++ -*-
2//===----------------------- support/win32/support.h ----------------------===//2//===----------------------------------------------------------------------===//
3//3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.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.5// See https://llvm.org/LICENSE.txt for license information.
lib/libcxx/src/support/win32/thread_win32.cpp+1-1
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1// -*- C++ -*-1// -*- C++ -*-
2//===-------------------- support/win32/thread_win32.cpp ------------------===//2//===----------------------------------------------------------------------===//
3//3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.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.5// See https://llvm.org/LICENSE.txt for license information.
lib/libcxx/src/thread.cpp+2-16
...@@ -14,17 +14,9 @@...@@ -14,17 +14,9 @@
14#include "vector"14#include "vector"
15#include "future"15#include "future"
16#include "limits"16#include "limits"
17#include <sys/types.h>
18
19#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
20# include <sys/param.h>
21# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
22# include <sys/sysctl.h>
23# endif
24#endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
2517
26#if __has_include(<unistd.h>)18#if __has_include(<unistd.h>)
27#include <unistd.h>19# include <unistd.h> // for sysconf
28#endif20#endif
2921
30#if defined(__NetBSD__)22#if defined(__NetBSD__)
...@@ -80,13 +72,7 @@ thread::detach()...@@ -80,13 +72,7 @@ thread::detach()
80unsigned72unsigned
81thread::hardware_concurrency() _NOEXCEPT73thread::hardware_concurrency() _NOEXCEPT
82{74{
83#if defined(CTL_HW) && defined(HW_NCPU)75#if defined(_SC_NPROCESSORS_ONLN)
84 unsigned n;
85 int mib[2] = {CTL_HW, HW_NCPU};
86 std::size_t s = sizeof(n);
87 sysctl(mib, 2, &n, &s, 0, 0);
88 return n;
89#elif defined(_SC_NPROCESSORS_ONLN)
90 long result = sysconf(_SC_NPROCESSORS_ONLN);76 long result = sysconf(_SC_NPROCESSORS_ONLN);
91 // sysconf returns -1 if the name is invalid, the option does not exist or77 // sysconf returns -1 if the name is invalid, the option does not exist or
92 // does not have a definite limit.78 // does not have a definite limit.
lib/libcxxabi/include/__cxxabi_config.h+15-2
...@@ -18,6 +18,19 @@...@@ -18,6 +18,19 @@
18#define __has_attribute(_attribute_) 018#define __has_attribute(_attribute_) 0
19#endif19#endif
2020
21#if defined(__clang__)
22# define _LIBCXXABI_COMPILER_CLANG
23# ifndef __apple_build_version__
24# define _LIBCXXABI_CLANG_VER (__clang_major__ * 100 + __clang_minor__)
25# endif
26#elif defined(__GNUC__)
27# define _LIBCXXABI_COMPILER_GCC
28#elif defined(_MSC_VER)
29# define _LIBCXXABI_COMPILER_MSVC
30#elif defined(__IBMCPP__)
31# define _LIBCXXABI_COMPILER_IBM
32#endif
33
21#if defined(_WIN32)34#if defined(_WIN32)
22 #if defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)35 #if defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)
23 #define _LIBCXXABI_HIDDEN36 #define _LIBCXXABI_HIDDEN
...@@ -53,7 +66,7 @@...@@ -53,7 +66,7 @@
53 #endif66 #endif
54#endif67#endif
5568
56#if defined(_WIN32)69#if defined(_LIBCXXABI_COMPILER_MSVC)
57#define _LIBCXXABI_WEAK70#define _LIBCXXABI_WEAK
58#else71#else
59#define _LIBCXXABI_WEAK __attribute__((__weak__))72#define _LIBCXXABI_WEAK __attribute__((__weak__))
...@@ -72,7 +85,7 @@...@@ -72,7 +85,7 @@
72#endif85#endif
7386
74// wasm32 follows the arm32 ABI convention of using 32-bit guard.87// wasm32 follows the arm32 ABI convention of using 32-bit guard.
75#if defined(__arm__) || defined(__wasm32__)88#if defined(__arm__) || defined(__wasm32__) || defined(__ARM64_ARCH_8_32__)
76# define _LIBCXXABI_GUARD_ABI_ARM89# define _LIBCXXABI_GUARD_ABI_ARM
77#endif90#endif
7891
lib/libcxxabi/include/cxxabi.h+10-9
...@@ -21,6 +21,7 @@...@@ -21,6 +21,7 @@
2121
22#define _LIBCPPABI_VERSION 100222#define _LIBCPPABI_VERSION 1002
23#define _LIBCXXABI_NORETURN __attribute__((noreturn))23#define _LIBCXXABI_NORETURN __attribute__((noreturn))
24#define _LIBCXXABI_ALWAYS_COLD __attribute__((cold))
2425
25#ifdef __cplusplus26#ifdef __cplusplus
2627
...@@ -78,13 +79,13 @@ extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_deleted_virtual(void);...@@ -78,13 +79,13 @@ extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_deleted_virtual(void);
7879
79// 3.3.2 One-time Construction API80// 3.3.2 One-time Construction API
80#if defined(_LIBCXXABI_GUARD_ABI_ARM)81#if defined(_LIBCXXABI_GUARD_ABI_ARM)
81extern _LIBCXXABI_FUNC_VIS int __cxa_guard_acquire(uint32_t *);82extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_ALWAYS_COLD int __cxa_guard_acquire(uint32_t *);
82extern _LIBCXXABI_FUNC_VIS void __cxa_guard_release(uint32_t *);83extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_ALWAYS_COLD void __cxa_guard_release(uint32_t *);
83extern _LIBCXXABI_FUNC_VIS void __cxa_guard_abort(uint32_t *);84extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_ALWAYS_COLD void __cxa_guard_abort(uint32_t *);
84#else85#else
85extern _LIBCXXABI_FUNC_VIS int __cxa_guard_acquire(uint64_t *);86extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_ALWAYS_COLD int __cxa_guard_acquire(uint64_t *);
86extern _LIBCXXABI_FUNC_VIS void __cxa_guard_release(uint64_t *);87extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_ALWAYS_COLD void __cxa_guard_release(uint64_t *);
87extern _LIBCXXABI_FUNC_VIS void __cxa_guard_abort(uint64_t *);88extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_ALWAYS_COLD void __cxa_guard_abort(uint64_t *);
88#endif89#endif
8990
90// 3.3.3 Array Construction and Destruction API91// 3.3.3 Array Construction and Destruction API
...@@ -136,9 +137,9 @@ __cxa_vec_cctor(void *dest_array, void *src_array, size_t element_count,...@@ -136,9 +137,9 @@ __cxa_vec_cctor(void *dest_array, void *src_array, size_t element_count,
136 void (*destructor)(void *));137 void (*destructor)(void *));
137138
138// 3.3.5.3 Runtime API139// 3.3.5.3 Runtime API
139extern _LIBCXXABI_FUNC_VIS int __cxa_atexit(void (*f)(void *), void *p,140// These functions are part of the C++ ABI, but they are not defined in libc++abi:
140 void *d);141// int __cxa_atexit(void (*)(void *), void *, void *);
141extern _LIBCXXABI_FUNC_VIS int __cxa_finalize(void *);142// void __cxa_finalize(void *);
142143
143// 3.4 Demangler API144// 3.4 Demangler API
144extern _LIBCXXABI_FUNC_VIS char *__cxa_demangle(const char *mangled_name,145extern _LIBCXXABI_FUNC_VIS char *__cxa_demangle(const char *mangled_name,
lib/libcxxabi/src/cxa_default_handlers.cpp+4
...@@ -45,6 +45,7 @@ static void demangling_terminate_handler()...@@ -45,6 +45,7 @@ static void demangling_terminate_handler()
45 exception_header + 1;45 exception_header + 1;
46 const __shim_type_info* thrown_type =46 const __shim_type_info* thrown_type =
47 static_cast<const __shim_type_info*>(exception_header->exceptionType);47 static_cast<const __shim_type_info*>(exception_header->exceptionType);
48#if !defined(LIBCXXABI_NON_DEMANGLING_TERMINATE)
48 // Try to get demangled name of thrown_type49 // Try to get demangled name of thrown_type
49 int status;50 int status;
50 char buf[1024];51 char buf[1024];
...@@ -52,6 +53,9 @@ static void demangling_terminate_handler()...@@ -52,6 +53,9 @@ static void demangling_terminate_handler()
52 const char* name = __cxa_demangle(thrown_type->name(), buf, &len, &status);53 const char* name = __cxa_demangle(thrown_type->name(), buf, &len, &status);
53 if (status != 0)54 if (status != 0)
54 name = thrown_type->name();55 name = thrown_type->name();
56#else
57 const char* name = thrown_type->name();
58#endif
55 // If the uncaught exception can be caught with std::exception&59 // If the uncaught exception can be caught with std::exception&
56 const __shim_type_info* catch_type =60 const __shim_type_info* catch_type =
57 static_cast<const __shim_type_info*>(&typeid(std::exception));61 static_cast<const __shim_type_info*>(&typeid(std::exception));
lib/libcxxabi/src/cxa_guard_impl.h+24-24
...@@ -54,6 +54,14 @@...@@ -54,6 +54,14 @@
54#endif54#endif
55#endif55#endif
5656
57#if defined(__clang__)
58# pragma clang diagnostic push
59# pragma clang diagnostic ignored "-Wtautological-pointer-compare"
60#elif defined(__GNUC__)
61# pragma GCC diagnostic push
62# pragma GCC diagnostic ignored "-Waddress"
63#endif
64
57// To make testing possible, this header is included from both cxa_guard.cpp65// To make testing possible, this header is included from both cxa_guard.cpp
58// and a number of tests.66// and a number of tests.
59//67//
...@@ -112,25 +120,25 @@ class AtomicInt {...@@ -112,25 +120,25 @@ class AtomicInt {
112public:120public:
113 using MemoryOrder = std::__libcpp_atomic_order;121 using MemoryOrder = std::__libcpp_atomic_order;
114122
115 explicit AtomicInt(IntType *b) : b(b) {}123 explicit AtomicInt(IntType *b) : b_(b) {}
116 AtomicInt(AtomicInt const&) = delete;124 AtomicInt(AtomicInt const&) = delete;
117 AtomicInt& operator=(AtomicInt const&) = delete;125 AtomicInt& operator=(AtomicInt const&) = delete;
118126
119 IntType load(MemoryOrder ord) {127 IntType load(MemoryOrder ord) {
120 return std::__libcpp_atomic_load(b, ord);128 return std::__libcpp_atomic_load(b_, ord);
121 }129 }
122 void store(IntType val, MemoryOrder ord) {130 void store(IntType val, MemoryOrder ord) {
123 std::__libcpp_atomic_store(b, val, ord);131 std::__libcpp_atomic_store(b_, val, ord);
124 }132 }
125 IntType exchange(IntType new_val, MemoryOrder ord) {133 IntType exchange(IntType new_val, MemoryOrder ord) {
126 return std::__libcpp_atomic_exchange(b, new_val, ord);134 return std::__libcpp_atomic_exchange(b_, new_val, ord);
127 }135 }
128 bool compare_exchange(IntType *expected, IntType desired, MemoryOrder ord_success, MemoryOrder ord_failure) {136 bool compare_exchange(IntType *expected, IntType desired, MemoryOrder ord_success, MemoryOrder ord_failure) {
129 return std::__libcpp_atomic_compare_exchange(b, expected, desired, ord_success, ord_failure);137 return std::__libcpp_atomic_compare_exchange(b_, expected, desired, ord_success, ord_failure);
130 }138 }
131139
132private:140private:
133 IntType *b;141 IntType *b_;
134};142};
135143
136//===----------------------------------------------------------------------===//144//===----------------------------------------------------------------------===//
...@@ -154,14 +162,7 @@ constexpr uint32_t (*PlatformThreadID)() = nullptr;...@@ -154,14 +162,7 @@ constexpr uint32_t (*PlatformThreadID)() = nullptr;
154162
155163
156constexpr bool PlatformSupportsThreadID() {164constexpr bool PlatformSupportsThreadID() {
157#ifdef __clang__
158#pragma clang diagnostic push
159#pragma clang diagnostic ignored "-Wtautological-pointer-compare"
160#endif
161 return +PlatformThreadID != nullptr;165 return +PlatformThreadID != nullptr;
162#ifdef __clang__
163#pragma clang diagnostic pop
164#endif
165}166}
166167
167//===----------------------------------------------------------------------===//168//===----------------------------------------------------------------------===//
...@@ -375,18 +376,18 @@ private:...@@ -375,18 +376,18 @@ private:
375 LockGuard& operator=(LockGuard const&) = delete;376 LockGuard& operator=(LockGuard const&) = delete;
376377
377 explicit LockGuard(const char* calling_func)378 explicit LockGuard(const char* calling_func)
378 : calling_func(calling_func) {379 : calling_func_(calling_func) {
379 if (global_mutex.lock())380 if (global_mutex.lock())
380 ABORT_WITH_MESSAGE("%s failed to acquire mutex", calling_func);381 ABORT_WITH_MESSAGE("%s failed to acquire mutex", calling_func_);
381 }382 }
382383
383 ~LockGuard() {384 ~LockGuard() {
384 if (global_mutex.unlock())385 if (global_mutex.unlock())
385 ABORT_WITH_MESSAGE("%s failed to release mutex", calling_func);386 ABORT_WITH_MESSAGE("%s failed to release mutex", calling_func_);
386 }387 }
387388
388 private:389 private:
389 const char* const calling_func;390 const char* const calling_func_;
390 };391 };
391};392};
392393
...@@ -411,14 +412,7 @@ constexpr void (*PlatformFutexWake)(int*) = nullptr;...@@ -411,14 +412,7 @@ constexpr void (*PlatformFutexWake)(int*) = nullptr;
411#endif412#endif
412413
413constexpr bool PlatformSupportsFutex() {414constexpr bool PlatformSupportsFutex() {
414#ifdef __clang__
415#pragma clang diagnostic push
416#pragma clang diagnostic ignored "-Wtautological-pointer-compare"
417#endif
418 return +PlatformFutexWait != nullptr;415 return +PlatformFutexWait != nullptr;
419#ifdef __clang__
420#pragma clang diagnostic pop
421#endif
422}416}
423417
424/// InitByteFutex - Manages initialization using atomics and the futex syscall418/// InitByteFutex - Manages initialization using atomics and the futex syscall
...@@ -589,4 +583,10 @@ using SelectedImplementation =...@@ -589,4 +583,10 @@ using SelectedImplementation =
589} // end namespace583} // end namespace
590} // end namespace __cxxabiv1584} // end namespace __cxxabiv1
591585
586#if defined(__clang__)
587# pragma clang diagnostic pop
588#elif defined(__GNUC__)
589# pragma GCC diagnostic pop
590#endif
591
592#endif // LIBCXXABI_SRC_INCLUDE_CXA_GUARD_IMPL_H592#endif // LIBCXXABI_SRC_INCLUDE_CXA_GUARD_IMPL_H
lib/libcxxabi/src/cxa_personality.cpp+85-178
...@@ -684,27 +684,21 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,...@@ -684,27 +684,21 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
684 return;684 return;
685 }685 }
686 landingPad = (uintptr_t)lpStart + landingPad;686 landingPad = (uintptr_t)lpStart + landingPad;
687 results.landingPad = landingPad;
687#else // __USING_SJLJ_EXCEPTIONS__688#else // __USING_SJLJ_EXCEPTIONS__
688 ++landingPad;689 ++landingPad;
689#endif // __USING_SJLJ_EXCEPTIONS__690#endif // __USING_SJLJ_EXCEPTIONS__
690 if (actionEntry == 0)691 if (actionEntry == 0)
691 {692 {
692 // Found a cleanup693 // Found a cleanup
693 // If this is a type 1 or type 2 search, there are no handlers694 results.reason = actions & _UA_SEARCH_PHASE
694 // If this is a type 3 search, you want to install the cleanup.695 ? _URC_CONTINUE_UNWIND
695 if ((actions & _UA_CLEANUP_PHASE) && !(actions & _UA_HANDLER_FRAME))696 : _URC_HANDLER_FOUND;
696 {
697 results.ttypeIndex = 0; // Redundant but clarifying
698 results.landingPad = landingPad;
699 results.reason = _URC_HANDLER_FOUND;
700 return;
701 }
702 // No handler here
703 results.reason = _URC_CONTINUE_UNWIND;
704 return;697 return;
705 }698 }
706 // Convert 1-based byte offset into699 // Convert 1-based byte offset into
707 const uint8_t* action = actionTableStart + (actionEntry - 1);700 const uint8_t* action = actionTableStart + (actionEntry - 1);
701 bool hasCleanup = false;
708 // Scan action entries until you find a matching handler, cleanup, or the end of action list702 // Scan action entries until you find a matching handler, cleanup, or the end of action list
709 while (true)703 while (true)
710 {704 {
...@@ -720,27 +714,17 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,...@@ -720,27 +714,17 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
720 native_exception, unwind_exception);714 native_exception, unwind_exception);
721 if (catchType == 0)715 if (catchType == 0)
722 {716 {
723 // Found catch (...) catches everything, including foreign exceptions717 // Found catch (...) catches everything, including
724 // If this is a type 1 search save state and return _URC_HANDLER_FOUND718 // foreign exceptions. This is search phase, cleanup
725 // If this is a type 2 search save state and return _URC_HANDLER_FOUND719 // phase with foreign exception, or forced unwinding.
726 // If this is a type 3 search !_UA_FORCE_UNWIND, we should have found this in phase 1!720 assert(actions & (_UA_SEARCH_PHASE | _UA_HANDLER_FRAME |
727 // If this is a type 3 search _UA_FORCE_UNWIND, ignore handler and continue scan721 _UA_FORCE_UNWIND));
728 if ((actions & _UA_SEARCH_PHASE) || (actions & _UA_HANDLER_FRAME))722 results.ttypeIndex = ttypeIndex;
729 {723 results.actionRecord = actionRecord;
730 // Save state and return _URC_HANDLER_FOUND724 results.adjustedPtr =
731 results.ttypeIndex = ttypeIndex;725 get_thrown_object_ptr(unwind_exception);
732 results.actionRecord = actionRecord;726 results.reason = _URC_HANDLER_FOUND;
733 results.landingPad = landingPad;727 return;
734 results.adjustedPtr = get_thrown_object_ptr(unwind_exception);
735 results.reason = _URC_HANDLER_FOUND;
736 return;
737 }
738 else if (!(actions & _UA_FORCE_UNWIND))
739 {
740 // It looks like the exception table has changed
741 // on us. Likely stack corruption!
742 call_terminate(native_exception, unwind_exception);
743 }
744 }728 }
745 // Else this is a catch (T) clause and will never729 // Else this is a catch (T) clause and will never
746 // catch a foreign exception730 // catch a foreign exception
...@@ -757,36 +741,25 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,...@@ -757,36 +741,25 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
757 }741 }
758 if (catchType->can_catch(excpType, adjustedPtr))742 if (catchType->can_catch(excpType, adjustedPtr))
759 {743 {
760 // Found a matching handler744 // Found a matching handler. This is either search
761 // If this is a type 1 search save state and return _URC_HANDLER_FOUND745 // phase or forced unwinding.
762 // If this is a type 3 search and !_UA_FORCE_UNWIND, we should have found this in phase 1!746 assert(actions &
763 // If this is a type 3 search and _UA_FORCE_UNWIND, ignore handler and continue scan747 (_UA_SEARCH_PHASE | _UA_FORCE_UNWIND));
764 if (actions & _UA_SEARCH_PHASE)748 results.ttypeIndex = ttypeIndex;
765 {749 results.actionRecord = actionRecord;
766 // Save state and return _URC_HANDLER_FOUND750 results.adjustedPtr = adjustedPtr;
767 results.ttypeIndex = ttypeIndex;751 results.reason = _URC_HANDLER_FOUND;
768 results.actionRecord = actionRecord;752 return;
769 results.landingPad = landingPad;
770 results.adjustedPtr = adjustedPtr;
771 results.reason = _URC_HANDLER_FOUND;
772 return;
773 }
774 else if (!(actions & _UA_FORCE_UNWIND))
775 {
776 // It looks like the exception table has changed
777 // on us. Likely stack corruption!
778 call_terminate(native_exception, unwind_exception);
779 }
780 }753 }
781 }754 }
782 // Scan next action ...755 // Scan next action ...
783 }756 }
784 else if (ttypeIndex < 0)757 else if (ttypeIndex < 0)
785 {758 {
786 // Found an exception spec. If this is a foreign exception,759 // Found an exception specification.
787 // it is always caught.760 if (actions & _UA_FORCE_UNWIND) {
788 if (native_exception)761 // Skip if forced unwinding.
789 {762 } else if (native_exception) {
790 // Does the exception spec catch this native exception?763 // Does the exception spec catch this native exception?
791 __cxa_exception* exception_header = (__cxa_exception*)(unwind_exception+1) - 1;764 __cxa_exception* exception_header = (__cxa_exception*)(unwind_exception+1) - 1;
792 void* adjustedPtr = get_thrown_object_ptr(unwind_exception);765 void* adjustedPtr = get_thrown_object_ptr(unwind_exception);
...@@ -801,77 +774,38 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,...@@ -801,77 +774,38 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
801 ttypeEncoding, excpType,774 ttypeEncoding, excpType,
802 adjustedPtr, unwind_exception))775 adjustedPtr, unwind_exception))
803 {776 {
804 // native exception caught by exception spec777 // Native exception caught by exception
805 // If this is a type 1 search, save state and return _URC_HANDLER_FOUND778 // specification.
806 // If this is a type 3 search !_UA_FORCE_UNWIND, we should have found this in phase 1!779 assert(actions & _UA_SEARCH_PHASE);
807 // If this is a type 3 search _UA_FORCE_UNWIND, ignore handler and continue scan
808 if (actions & _UA_SEARCH_PHASE)
809 {
810 // Save state and return _URC_HANDLER_FOUND
811 results.ttypeIndex = ttypeIndex;
812 results.actionRecord = actionRecord;
813 results.landingPad = landingPad;
814 results.adjustedPtr = adjustedPtr;
815 results.reason = _URC_HANDLER_FOUND;
816 return;
817 }
818 else if (!(actions & _UA_FORCE_UNWIND))
819 {
820 // It looks like the exception table has changed
821 // on us. Likely stack corruption!
822 call_terminate(native_exception, unwind_exception);
823 }
824 }
825 }
826 else
827 {
828 // foreign exception caught by exception spec
829 // If this is a type 1 search, save state and return _URC_HANDLER_FOUND
830 // If this is a type 2 search, save state and return _URC_HANDLER_FOUND
831 // If this is a type 3 search !_UA_FORCE_UNWIND, we should have found this in phase 1!
832 // If this is a type 3 search _UA_FORCE_UNWIND, ignore handler and continue scan
833 if ((actions & _UA_SEARCH_PHASE) || (actions & _UA_HANDLER_FRAME))
834 {
835 // Save state and return _URC_HANDLER_FOUND
836 results.ttypeIndex = ttypeIndex;780 results.ttypeIndex = ttypeIndex;
837 results.actionRecord = actionRecord;781 results.actionRecord = actionRecord;
838 results.landingPad = landingPad;782 results.adjustedPtr = adjustedPtr;
839 results.adjustedPtr = get_thrown_object_ptr(unwind_exception);
840 results.reason = _URC_HANDLER_FOUND;783 results.reason = _URC_HANDLER_FOUND;
841 return;784 return;
842 }785 }
843 else if (!(actions & _UA_FORCE_UNWIND))786 } else {
844 {787 // foreign exception caught by exception spec
845 // It looks like the exception table has changed
846 // on us. Likely stack corruption!
847 call_terminate(native_exception, unwind_exception);
848 }
849 }
850 // Scan next action ...
851 }
852 else // ttypeIndex == 0
853 {
854 // Found a cleanup
855 // If this is a type 1 search, ignore it and continue scan
856 // If this is a type 2 search, ignore it and continue scan
857 // If this is a type 3 search, save state and return _URC_HANDLER_FOUND
858 if ((actions & _UA_CLEANUP_PHASE) && !(actions & _UA_HANDLER_FRAME))
859 {
860 // Save state and return _URC_HANDLER_FOUND
861 results.ttypeIndex = ttypeIndex;788 results.ttypeIndex = ttypeIndex;
862 results.actionRecord = actionRecord;789 results.actionRecord = actionRecord;
863 results.landingPad = landingPad;790 results.adjustedPtr =
864 results.adjustedPtr = get_thrown_object_ptr(unwind_exception);791 get_thrown_object_ptr(unwind_exception);
865 results.reason = _URC_HANDLER_FOUND;792 results.reason = _URC_HANDLER_FOUND;
866 return;793 return;
867 }794 }
795 // Scan next action ...
796 } else {
797 hasCleanup = true;
868 }798 }
869 const uint8_t* temp = action;799 const uint8_t* temp = action;
870 int64_t actionOffset = readSLEB128(&temp);800 int64_t actionOffset = readSLEB128(&temp);
871 if (actionOffset == 0)801 if (actionOffset == 0)
872 {802 {
873 // End of action list, no matching handler or cleanup found803 // End of action list. If this is phase 2 and we have found
874 results.reason = _URC_CONTINUE_UNWIND;804 // a cleanup (ttypeIndex=0), return _URC_HANDLER_FOUND;
805 // otherwise return _URC_CONTINUE_UNWIND.
806 results.reason = hasCleanup && actions & _UA_CLEANUP_PHASE
807 ? _URC_HANDLER_FOUND
808 : _URC_CONTINUE_UNWIND;
875 return;809 return;
876 }810 }
877 // Go to next action811 // Go to next action
...@@ -962,78 +896,51 @@ __gxx_personality_v0...@@ -962,78 +896,51 @@ __gxx_personality_v0
962 bool native_exception = (exceptionClass & get_vendor_and_language) ==896 bool native_exception = (exceptionClass & get_vendor_and_language) ==
963 (kOurExceptionClass & get_vendor_and_language);897 (kOurExceptionClass & get_vendor_and_language);
964 scan_results results;898 scan_results results;
899 // Process a catch handler for a native exception first.
900 if (actions == (_UA_CLEANUP_PHASE | _UA_HANDLER_FRAME) &&
901 native_exception) {
902 // Reload the results from the phase 1 cache.
903 __cxa_exception* exception_header =
904 (__cxa_exception*)(unwind_exception + 1) - 1;
905 results.ttypeIndex = exception_header->handlerSwitchValue;
906 results.actionRecord = exception_header->actionRecord;
907 results.languageSpecificData = exception_header->languageSpecificData;
908 results.landingPad =
909 reinterpret_cast<uintptr_t>(exception_header->catchTemp);
910 results.adjustedPtr = exception_header->adjustedPtr;
911
912 // Jump to the handler.
913 set_registers(unwind_exception, context, results);
914 return _URC_INSTALL_CONTEXT;
915 }
916
917 // In other cases we need to scan LSDA.
918 scan_eh_tab(results, actions, native_exception, unwind_exception, context);
919 if (results.reason == _URC_CONTINUE_UNWIND ||
920 results.reason == _URC_FATAL_PHASE1_ERROR)
921 return results.reason;
922
965 if (actions & _UA_SEARCH_PHASE)923 if (actions & _UA_SEARCH_PHASE)
966 {924 {
967 // Phase 1 search: All we're looking for in phase 1 is a handler that925 // Phase 1 search: All we're looking for in phase 1 is a handler that
968 // halts unwinding926 // halts unwinding
969 scan_eh_tab(results, actions, native_exception, unwind_exception, context);927 assert(results.reason == _URC_HANDLER_FOUND);
970 if (results.reason == _URC_HANDLER_FOUND)928 if (native_exception) {
971 {929 // For a native exception, cache the LSDA result.
972 // Found one. Can we cache the results somewhere to optimize phase 2?930 __cxa_exception* exc = (__cxa_exception*)(unwind_exception + 1) - 1;
973 if (native_exception)931 exc->handlerSwitchValue = static_cast<int>(results.ttypeIndex);
974 {932 exc->actionRecord = results.actionRecord;
975 __cxa_exception* exception_header = (__cxa_exception*)(unwind_exception+1) - 1;933 exc->languageSpecificData = results.languageSpecificData;
976 exception_header->handlerSwitchValue = static_cast<int>(results.ttypeIndex);934 exc->catchTemp = reinterpret_cast<void*>(results.landingPad);
977 exception_header->actionRecord = results.actionRecord;935 exc->adjustedPtr = results.adjustedPtr;
978 exception_header->languageSpecificData = results.languageSpecificData;
979 exception_header->catchTemp = reinterpret_cast<void*>(results.landingPad);
980 exception_header->adjustedPtr = results.adjustedPtr;
981 }
982 return _URC_HANDLER_FOUND;
983 }
984 // Did not find a catching-handler. Return the results of the scan
985 // (normally _URC_CONTINUE_UNWIND, but could have been _URC_FATAL_PHASE1_ERROR
986 // if we were called improperly).
987 return results.reason;
988 }
989 if (actions & _UA_CLEANUP_PHASE)
990 {
991 // Phase 2 search:
992 // Did we find a catching handler in phase 1?
993 if (actions & _UA_HANDLER_FRAME)
994 {
995 // Yes, phase 1 said we have a catching handler here.
996 // Did we cache the results of the scan?
997 if (native_exception)
998 {
999 // Yes, reload the results from the cache.
1000 __cxa_exception* exception_header = (__cxa_exception*)(unwind_exception+1) - 1;
1001 results.ttypeIndex = exception_header->handlerSwitchValue;
1002 results.actionRecord = exception_header->actionRecord;
1003 results.languageSpecificData = exception_header->languageSpecificData;
1004 results.landingPad = reinterpret_cast<uintptr_t>(exception_header->catchTemp);
1005 results.adjustedPtr = exception_header->adjustedPtr;
1006 }
1007 else
1008 {
1009 // No, do the scan again to reload the results.
1010 scan_eh_tab(results, actions, native_exception, unwind_exception, context);
1011 // Phase 1 told us we would find a handler. Now in Phase 2 we
1012 // didn't find a handler. The eh table should not be changing!
1013 if (results.reason != _URC_HANDLER_FOUND)
1014 call_terminate(native_exception, unwind_exception);
1015 }
1016 // Jump to the handler
1017 set_registers(unwind_exception, context, results);
1018 return _URC_INSTALL_CONTEXT;
1019 }
1020 // Either we didn't do a phase 1 search (due to forced unwinding), or
1021 // phase 1 reported no catching-handlers.
1022 // Search for a (non-catching) cleanup
1023 scan_eh_tab(results, actions, native_exception, unwind_exception, context);
1024 if (results.reason == _URC_HANDLER_FOUND)
1025 {
1026 // Found a non-catching handler. Jump to it:
1027 set_registers(unwind_exception, context, results);
1028 return _URC_INSTALL_CONTEXT;
1029 }936 }
1030 // Did not find a cleanup. Return the results of the scan937 return _URC_HANDLER_FOUND;
1031 // (normally _URC_CONTINUE_UNWIND, but could have been _URC_FATAL_PHASE2_ERROR
1032 // if we were called improperly).
1033 return results.reason;
1034 }938 }
1035 // We were called improperly: neither a phase 1 or phase 2 search939
1036 return _URC_FATAL_PHASE1_ERROR;940 assert(actions & _UA_CLEANUP_PHASE);
941 assert(results.reason == _URC_HANDLER_FOUND);
942 set_registers(unwind_exception, context, results);
943 return _URC_INSTALL_CONTEXT;
1037}944}
1038945
1039#if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)946#if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
lib/libcxxabi/src/demangle/ItaniumDemangle.h+167-36
...@@ -82,6 +82,7 @@...@@ -82,6 +82,7 @@
82 X(PostfixExpr) \82 X(PostfixExpr) \
83 X(ConditionalExpr) \83 X(ConditionalExpr) \
84 X(MemberExpr) \84 X(MemberExpr) \
85 X(SubobjectExpr) \
85 X(EnclosingExpr) \86 X(EnclosingExpr) \
86 X(CastExpr) \87 X(CastExpr) \
87 X(SizeofParamPackExpr) \88 X(SizeofParamPackExpr) \
...@@ -91,10 +92,10 @@...@@ -91,10 +92,10 @@
91 X(PrefixExpr) \92 X(PrefixExpr) \
92 X(FunctionParam) \93 X(FunctionParam) \
93 X(ConversionExpr) \94 X(ConversionExpr) \
95 X(PointerToMemberConversionExpr) \
94 X(InitListExpr) \96 X(InitListExpr) \
95 X(FoldExpr) \97 X(FoldExpr) \
96 X(ThrowExpr) \98 X(ThrowExpr) \
97 X(UUIDOfExpr) \
98 X(BoolExpr) \99 X(BoolExpr) \
99 X(StringLiteral) \100 X(StringLiteral) \
100 X(LambdaExpr) \101 X(LambdaExpr) \
...@@ -1656,6 +1657,40 @@ public:...@@ -1656,6 +1657,40 @@ public:
1656 }1657 }
1657};1658};
16581659
1660class SubobjectExpr : public Node {
1661 const Node *Type;
1662 const Node *SubExpr;
1663 StringView Offset;
1664 NodeArray UnionSelectors;
1665 bool OnePastTheEnd;
1666
1667public:
1668 SubobjectExpr(const Node *Type_, const Node *SubExpr_, StringView Offset_,
1669 NodeArray UnionSelectors_, bool OnePastTheEnd_)
1670 : Node(KSubobjectExpr), Type(Type_), SubExpr(SubExpr_), Offset(Offset_),
1671 UnionSelectors(UnionSelectors_), OnePastTheEnd(OnePastTheEnd_) {}
1672
1673 template<typename Fn> void match(Fn F) const {
1674 F(Type, SubExpr, Offset, UnionSelectors, OnePastTheEnd);
1675 }
1676
1677 void printLeft(OutputStream &S) const override {
1678 SubExpr->print(S);
1679 S += ".<";
1680 Type->print(S);
1681 S += " at offset ";
1682 if (Offset.empty()) {
1683 S += "0";
1684 } else if (Offset[0] == 'n') {
1685 S += "-";
1686 S += Offset.dropFront();
1687 } else {
1688 S += Offset;
1689 }
1690 S += ">";
1691 }
1692};
1693
1659class EnclosingExpr : public Node {1694class EnclosingExpr : public Node {
1660 const StringView Prefix;1695 const StringView Prefix;
1661 const Node *Infix;1696 const Node *Infix;
...@@ -1843,6 +1878,28 @@ public:...@@ -1843,6 +1878,28 @@ public:
1843 }1878 }
1844};1879};
18451880
1881class PointerToMemberConversionExpr : public Node {
1882 const Node *Type;
1883 const Node *SubExpr;
1884 StringView Offset;
1885
1886public:
1887 PointerToMemberConversionExpr(const Node *Type_, const Node *SubExpr_,
1888 StringView Offset_)
1889 : Node(KPointerToMemberConversionExpr), Type(Type_), SubExpr(SubExpr_),
1890 Offset(Offset_) {}
1891
1892 template<typename Fn> void match(Fn F) const { F(Type, SubExpr, Offset); }
1893
1894 void printLeft(OutputStream &S) const override {
1895 S += "(";
1896 Type->print(S);
1897 S += ")(";
1898 SubExpr->print(S);
1899 S += ")";
1900 }
1901};
1902
1846class InitListExpr : public Node {1903class InitListExpr : public Node {
1847 const Node *Ty;1904 const Node *Ty;
1848 NodeArray Inits;1905 NodeArray Inits;
...@@ -1977,21 +2034,6 @@ public:...@@ -1977,21 +2034,6 @@ public:
1977 }2034 }
1978};2035};
19792036
1980// MSVC __uuidof extension, generated by clang in -fms-extensions mode.
1981class UUIDOfExpr : public Node {
1982 Node *Operand;
1983public:
1984 UUIDOfExpr(Node *Operand_) : Node(KUUIDOfExpr), Operand(Operand_) {}
1985
1986 template<typename Fn> void match(Fn F) const { F(Operand); }
1987
1988 void printLeft(OutputStream &S) const override {
1989 S << "__uuidof(";
1990 Operand->print(S);
1991 S << ")";
1992 }
1993};
1994
1995class BoolExpr : public Node {2037class BoolExpr : public Node {
1996 bool Value;2038 bool Value;
19972039
...@@ -2313,9 +2355,9 @@ template <typename Derived, typename Alloc> struct AbstractManglingParser {...@@ -2313,9 +2355,9 @@ template <typename Derived, typename Alloc> struct AbstractManglingParser {
2313 TemplateParamList Params;2355 TemplateParamList Params;
23142356
2315 public:2357 public:
2316 ScopedTemplateParamList(AbstractManglingParser *Parser)2358 ScopedTemplateParamList(AbstractManglingParser *TheParser)
2317 : Parser(Parser),2359 : Parser(TheParser),
2318 OldNumTemplateParamLists(Parser->TemplateParams.size()) {2360 OldNumTemplateParamLists(TheParser->TemplateParams.size()) {
2319 Parser->TemplateParams.push_back(&Params);2361 Parser->TemplateParams.push_back(&Params);
2320 }2362 }
2321 ~ScopedTemplateParamList() {2363 ~ScopedTemplateParamList() {
...@@ -2437,6 +2479,8 @@ template <typename Derived, typename Alloc> struct AbstractManglingParser {...@@ -2437,6 +2479,8 @@ template <typename Derived, typename Alloc> struct AbstractManglingParser {
2437 Node *parseConversionExpr();2479 Node *parseConversionExpr();
2438 Node *parseBracedExpr();2480 Node *parseBracedExpr();
2439 Node *parseFoldExpr();2481 Node *parseFoldExpr();
2482 Node *parsePointerToMemberConversionExpr();
2483 Node *parseSubobjectExpr();
24402484
2441 /// Parse the <type> production.2485 /// Parse the <type> production.
2442 Node *parseType();2486 Node *parseType();
...@@ -4404,6 +4448,50 @@ Node *AbstractManglingParser<Derived, Alloc>::parseFoldExpr() {...@@ -4404,6 +4448,50 @@ Node *AbstractManglingParser<Derived, Alloc>::parseFoldExpr() {
4404 return make<FoldExpr>(IsLeftFold, OperatorName, Pack, Init);4448 return make<FoldExpr>(IsLeftFold, OperatorName, Pack, Init);
4405}4449}
44064450
4451// <expression> ::= mc <parameter type> <expr> [<offset number>] E
4452//
4453// Not yet in the spec: https://github.com/itanium-cxx-abi/cxx-abi/issues/47
4454template <typename Derived, typename Alloc>
4455Node *AbstractManglingParser<Derived, Alloc>::parsePointerToMemberConversionExpr() {
4456 Node *Ty = getDerived().parseType();
4457 if (!Ty)
4458 return nullptr;
4459 Node *Expr = getDerived().parseExpr();
4460 if (!Expr)
4461 return nullptr;
4462 StringView Offset = getDerived().parseNumber(true);
4463 if (!consumeIf('E'))
4464 return nullptr;
4465 return make<PointerToMemberConversionExpr>(Ty, Expr, Offset);
4466}
4467
4468// <expression> ::= so <referent type> <expr> [<offset number>] <union-selector>* [p] E
4469// <union-selector> ::= _ [<number>]
4470//
4471// Not yet in the spec: https://github.com/itanium-cxx-abi/cxx-abi/issues/47
4472template <typename Derived, typename Alloc>
4473Node *AbstractManglingParser<Derived, Alloc>::parseSubobjectExpr() {
4474 Node *Ty = getDerived().parseType();
4475 if (!Ty)
4476 return nullptr;
4477 Node *Expr = getDerived().parseExpr();
4478 if (!Expr)
4479 return nullptr;
4480 StringView Offset = getDerived().parseNumber(true);
4481 size_t SelectorsBegin = Names.size();
4482 while (consumeIf('_')) {
4483 Node *Selector = make<NameType>(parseNumber());
4484 if (!Selector)
4485 return nullptr;
4486 Names.push_back(Selector);
4487 }
4488 bool OnePastTheEnd = consumeIf('p');
4489 if (!consumeIf('E'))
4490 return nullptr;
4491 return make<SubobjectExpr>(
4492 Ty, Expr, Offset, popTrailingNodeArray(SelectorsBegin), OnePastTheEnd);
4493}
4494
4407// <expression> ::= <unary operator-name> <expression>4495// <expression> ::= <unary operator-name> <expression>
4408// ::= <binary operator-name> <expression> <expression>4496// ::= <binary operator-name> <expression> <expression>
4409// ::= <ternary operator-name> <expression> <expression> <expression>4497// ::= <ternary operator-name> <expression> <expression> <expression>
...@@ -4661,6 +4749,9 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {...@@ -4661,6 +4749,9 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {
4661 return nullptr;4749 return nullptr;
4662 case 'm':4750 case 'm':
4663 switch (First[1]) {4751 switch (First[1]) {
4752 case 'c':
4753 First += 2;
4754 return parsePointerToMemberConversionExpr();
4664 case 'i':4755 case 'i':
4665 First += 2;4756 First += 2;
4666 return getDerived().parseBinaryExpr("-");4757 return getDerived().parseBinaryExpr("-");
...@@ -4808,6 +4899,9 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {...@@ -4808,6 +4899,9 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {
4808 return Ex;4899 return Ex;
4809 return make<CastExpr>("static_cast", T, Ex);4900 return make<CastExpr>("static_cast", T, Ex);
4810 }4901 }
4902 case 'o':
4903 First += 2;
4904 return parseSubobjectExpr();
4811 case 'p': {4905 case 'p': {
4812 First += 2;4906 First += 2;
4813 Node *Child = getDerived().parseExpr();4907 Node *Child = getDerived().parseExpr();
...@@ -4903,6 +4997,43 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {...@@ -4903,6 +4997,43 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {
4903 }4997 }
4904 }4998 }
4905 return nullptr;4999 return nullptr;
5000 case 'u': {
5001 ++First;
5002 Node *Name = getDerived().parseSourceName(/*NameState=*/nullptr);
5003 if (!Name)
5004 return nullptr;
5005 // Special case legacy __uuidof mangling. The 't' and 'z' appear where the
5006 // standard encoding expects a <template-arg>, and would be otherwise be
5007 // interpreted as <type> node 'short' or 'ellipsis'. However, neither
5008 // __uuidof(short) nor __uuidof(...) can actually appear, so there is no
5009 // actual conflict here.
5010 if (Name->getBaseName() == "__uuidof") {
5011 if (numLeft() < 2)
5012 return nullptr;
5013 if (*First == 't') {
5014 ++First;
5015 Node *Ty = getDerived().parseType();
5016 if (!Ty)
5017 return nullptr;
5018 return make<CallExpr>(Name, makeNodeArray(&Ty, &Ty + 1));
5019 }
5020 if (*First == 'z') {
5021 ++First;
5022 Node *Ex = getDerived().parseExpr();
5023 if (!Ex)
5024 return nullptr;
5025 return make<CallExpr>(Name, makeNodeArray(&Ex, &Ex + 1));
5026 }
5027 }
5028 size_t ExprsBegin = Names.size();
5029 while (!consumeIf('E')) {
5030 Node *E = getDerived().parseTemplateArg();
5031 if (E == nullptr)
5032 return E;
5033 Names.push_back(E);
5034 }
5035 return make<CallExpr>(Name, popTrailingNodeArray(ExprsBegin));
5036 }
4906 case '1':5037 case '1':
4907 case '2':5038 case '2':
4908 case '3':5039 case '3':
...@@ -4914,21 +5045,6 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {...@@ -4914,21 +5045,6 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {
4914 case '9':5045 case '9':
4915 return getDerived().parseUnresolvedName();5046 return getDerived().parseUnresolvedName();
4916 }5047 }
4917
4918 if (consumeIf("u8__uuidoft")) {
4919 Node *Ty = getDerived().parseType();
4920 if (!Ty)
4921 return nullptr;
4922 return make<UUIDOfExpr>(Ty);
4923 }
4924
4925 if (consumeIf("u8__uuidofz")) {
4926 Node *Ex = getDerived().parseExpr();
4927 if (!Ex)
4928 return nullptr;
4929 return make<UUIDOfExpr>(Ex);
4930 }
4931
4932 return nullptr;5048 return nullptr;
4933}5049}
49345050
...@@ -4975,6 +5091,16 @@ Node *AbstractManglingParser<Derived, Alloc>::parseSpecialName() {...@@ -4975,6 +5091,16 @@ Node *AbstractManglingParser<Derived, Alloc>::parseSpecialName() {
4975 switch (look()) {5091 switch (look()) {
4976 case 'T':5092 case 'T':
4977 switch (look(1)) {5093 switch (look(1)) {
5094 // TA <template-arg> # template parameter object
5095 //
5096 // Not yet in the spec: https://github.com/itanium-cxx-abi/cxx-abi/issues/63
5097 case 'A': {
5098 First += 2;
5099 Node *Arg = getDerived().parseTemplateArg();
5100 if (Arg == nullptr)
5101 return nullptr;
5102 return make<SpecialName>("template parameter object for ", Arg);
5103 }
4978 // TV <type> # virtual table5104 // TV <type> # virtual table
4979 case 'V': {5105 case 'V': {
4980 First += 2;5106 First += 2;
...@@ -5103,7 +5229,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseEncoding() {...@@ -5103,7 +5229,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseEncoding() {
5103 decltype(TemplateParams) OldParams;5229 decltype(TemplateParams) OldParams;
51045230
5105 public:5231 public:
5106 SaveTemplateParams(AbstractManglingParser *Parser) : Parser(Parser) {5232 SaveTemplateParams(AbstractManglingParser *TheParser) : Parser(TheParser) {
5107 OldParams = std::move(Parser->TemplateParams);5233 OldParams = std::move(Parser->TemplateParams);
5108 Parser->TemplateParams.clear();5234 Parser->TemplateParams.clear();
5109 }5235 }
...@@ -5203,7 +5329,12 @@ struct FloatData<long double>...@@ -5203,7 +5329,12 @@ struct FloatData<long double>
5203#else5329#else
5204 static const size_t mangled_size = 20; // May need to be adjusted to 16 or 24 on other platforms5330 static const size_t mangled_size = 20; // May need to be adjusted to 16 or 24 on other platforms
5205#endif5331#endif
5206 static const size_t max_demangled_size = 40;5332 // `-0x1.ffffffffffffffffffffffffffffp+16383` + 'L' + '\0' == 42 bytes.
5333 // 28 'f's * 4 bits == 112 bits, which is the number of mantissa bits.
5334 // Negatives are one character longer than positives.
5335 // `0x1.` and `p` are constant, and exponents `+16383` and `-16382` are the
5336 // same length. 1 sign bit, 112 mantissa bits, and 15 exponent bits == 128.
5337 static const size_t max_demangled_size = 42;
5207 static constexpr const char *spec = "%LaL";5338 static constexpr const char *spec = "%LaL";
5208};5339};
52095340
lib/libcxxabi/src/demangle/Utility.h+1-1
...@@ -52,7 +52,7 @@ class OutputStream {...@@ -52,7 +52,7 @@ class OutputStream {
52 char *TempPtr = std::end(Temp);52 char *TempPtr = std::end(Temp);
5353
54 while (N) {54 while (N) {
55 *--TempPtr = '0' + char(N % 10);55 *--TempPtr = char('0' + N % 10);
56 N /= 10;56 N /= 10;
57 }57 }
5858
lib/libcxxabi/src/fallback_malloc.cpp+16-23
...@@ -6,9 +6,6 @@...@@ -6,9 +6,6 @@
6//6//
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
88
9// Define _LIBCPP_BUILDING_LIBRARY to ensure _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
10// is only defined when libc aligned allocation is not available.
11#define _LIBCPP_BUILDING_LIBRARY
12#include "fallback_malloc.h"9#include "fallback_malloc.h"
1310
14#include <__threading_support>11#include <__threading_support>
...@@ -20,6 +17,7 @@...@@ -20,6 +17,7 @@
2017
21#include <stdlib.h> // for malloc, calloc, free18#include <stdlib.h> // for malloc, calloc, free
22#include <string.h> // for memset19#include <string.h> // for memset
20#include <new> // for std::__libcpp_aligned_{alloc,free}
2321
24// A small, simple heap manager based (loosely) on22// A small, simple heap manager based (loosely) on
25// the startup heap manager from FreeBSD, optimized for space.23// the startup heap manager from FreeBSD, optimized for space.
...@@ -144,29 +142,26 @@ void fallback_free(void* ptr) {...@@ -144,29 +142,26 @@ void fallback_free(void* ptr) {
144 mutexor mtx(&heap_mutex);142 mutexor mtx(&heap_mutex);
145143
146#ifdef DEBUG_FALLBACK_MALLOC144#ifdef DEBUG_FALLBACK_MALLOC
147 std::cout << "Freeing item at " << offset_from_node(cp) << " of size "145 std::printf("Freeing item at %d of size %d\n", offset_from_node(cp), cp->len);
148 << cp->len << std::endl;
149#endif146#endif
150147
151 for (p = freelist, prev = 0; p && p != list_end;148 for (p = freelist, prev = 0; p && p != list_end;
152 prev = p, p = node_from_offset(p->next_node)) {149 prev = p, p = node_from_offset(p->next_node)) {
153#ifdef DEBUG_FALLBACK_MALLOC150#ifdef DEBUG_FALLBACK_MALLOC
154 std::cout << " p, cp, after (p), after(cp) " << offset_from_node(p) << ' '151 std::printf(" p=%d, cp=%d, after(p)=%d, after(cp)=%d\n",
155 << offset_from_node(cp) << ' ' << offset_from_node(after(p))152 offset_from_node(p), offset_from_node(cp),
156 << ' ' << offset_from_node(after(cp)) << std::endl;153 offset_from_node(after(p)), offset_from_node(after(cp)));
157#endif154#endif
158 if (after(p) == cp) {155 if (after(p) == cp) {
159#ifdef DEBUG_FALLBACK_MALLOC156#ifdef DEBUG_FALLBACK_MALLOC
160 std::cout << " Appending onto chunk at " << offset_from_node(p)157 std::printf(" Appending onto chunk at %d\n", offset_from_node(p));
161 << std::endl;
162#endif158#endif
163 p->len = static_cast<heap_size>(159 p->len = static_cast<heap_size>(
164 p->len + cp->len); // make the free heap_node larger160 p->len + cp->len); // make the free heap_node larger
165 return;161 return;
166 } else if (after(cp) == p) { // there's a free heap_node right after162 } else if (after(cp) == p) { // there's a free heap_node right after
167#ifdef DEBUG_FALLBACK_MALLOC163#ifdef DEBUG_FALLBACK_MALLOC
168 std::cout << " Appending free chunk at " << offset_from_node(p)164 std::printf(" Appending free chunk at %d\n", offset_from_node(p));
169 << std::endl;
170#endif165#endif
171 cp->len = static_cast<heap_size>(cp->len + p->len);166 cp->len = static_cast<heap_size>(cp->len + p->len);
172 if (prev == 0) {167 if (prev == 0) {
...@@ -179,8 +174,7 @@ void fallback_free(void* ptr) {...@@ -179,8 +174,7 @@ void fallback_free(void* ptr) {
179 }174 }
180// Nothing to merge with, add it to the start of the free list175// Nothing to merge with, add it to the start of the free list
181#ifdef DEBUG_FALLBACK_MALLOC176#ifdef DEBUG_FALLBACK_MALLOC
182 std::cout << " Making new free list entry " << offset_from_node(cp)177 std::printf(" Making new free list entry %d\n", offset_from_node(cp));
183 << std::endl;
184#endif178#endif
185 cp->next_node = offset_from_node(freelist);179 cp->next_node = offset_from_node(freelist);
186 freelist = cp;180 freelist = cp;
...@@ -195,11 +189,11 @@ size_t print_free_list() {...@@ -195,11 +189,11 @@ size_t print_free_list() {
195189
196 for (p = freelist, prev = 0; p && p != list_end;190 for (p = freelist, prev = 0; p && p != list_end;
197 prev = p, p = node_from_offset(p->next_node)) {191 prev = p, p = node_from_offset(p->next_node)) {
198 std::cout << (prev == 0 ? "" : " ") << "Offset: " << offset_from_node(p)192 std::printf("%sOffset: %d\tsize: %d Next: %d\n",
199 << "\tsize: " << p->len << " Next: " << p->next_node << std::endl;193 (prev == 0 ? "" : " "), offset_from_node(p), p->len, p->next_node);
200 total_free += p->len;194 total_free += p->len;
201 }195 }
202 std::cout << "Total Free space: " << total_free << std::endl;196 std::printf("Total Free space: %d\n", total_free);
203 return total_free;197 return total_free;
204}198}
205#endif199#endif
...@@ -211,7 +205,7 @@ struct __attribute__((aligned)) __aligned_type {};...@@ -211,7 +205,7 @@ struct __attribute__((aligned)) __aligned_type {};
211205
212void* __aligned_malloc_with_fallback(size_t size) {206void* __aligned_malloc_with_fallback(size_t size) {
213#if defined(_WIN32)207#if defined(_WIN32)
214 if (void* dest = _aligned_malloc(size, alignof(__aligned_type)))208 if (void* dest = std::__libcpp_aligned_alloc(alignof(__aligned_type), size))
215 return dest;209 return dest;
216#elif defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)210#elif defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
217 if (void* dest = ::malloc(size))211 if (void* dest = ::malloc(size))
...@@ -219,8 +213,7 @@ void* __aligned_malloc_with_fallback(size_t size) {...@@ -219,8 +213,7 @@ void* __aligned_malloc_with_fallback(size_t size) {
219#else213#else
220 if (size == 0)214 if (size == 0)
221 size = 1;215 size = 1;
222 void* dest;216 if (void* dest = std::__libcpp_aligned_alloc(__alignof(__aligned_type), size))
223 if (::posix_memalign(&dest, __alignof(__aligned_type), size) == 0)
224 return dest;217 return dest;
225#endif218#endif
226 return fallback_malloc(size);219 return fallback_malloc(size);
...@@ -241,10 +234,10 @@ void __aligned_free_with_fallback(void* ptr) {...@@ -241,10 +234,10 @@ void __aligned_free_with_fallback(void* ptr) {
241 if (is_fallback_ptr(ptr))234 if (is_fallback_ptr(ptr))
242 fallback_free(ptr);235 fallback_free(ptr);
243 else {236 else {
244#if defined(_WIN32)237#if defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
245 ::_aligned_free(ptr);
246#else
247 ::free(ptr);238 ::free(ptr);
239#else
240 std::__libcpp_aligned_free(ptr);
248#endif241#endif
249 }242 }
250}243}
lib/libcxxabi/src/include/refstring.h deleted-131
...@@ -1,131 +0,0 @@
1//===------------------------ __refstring ---------------------------------===//
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// FIXME: This file is copied from libcxx/src/include/refstring.h. Instead of
10// duplicating the file in libc++abi we should require that the libc++ sources
11// are available when building libc++abi.
12
13#ifndef _LIBCPPABI_REFSTRING_H
14#define _LIBCPPABI_REFSTRING_H
15
16#include <__config>
17#include <stdexcept>
18#include <cstddef>
19#include <cstring>
20#ifdef __APPLE__
21#include <dlfcn.h>
22#include <mach-o/dyld.h>
23#endif
24#include "atomic_support.h"
25
26_LIBCPP_BEGIN_NAMESPACE_STD
27
28namespace __refstring_imp { namespace {
29typedef int count_t;
30
31struct _Rep_base {
32 std::size_t len;
33 std::size_t cap;
34 count_t count;
35};
36
37inline _Rep_base* rep_from_data(const char *data_) noexcept {
38 char *data = const_cast<char *>(data_);
39 return reinterpret_cast<_Rep_base *>(data - sizeof(_Rep_base));
40}
41
42inline char * data_from_rep(_Rep_base *rep) noexcept {
43 char *data = reinterpret_cast<char *>(rep);
44 return data + sizeof(*rep);
45}
46
47#if defined(__APPLE__)
48inline
49const char* compute_gcc_empty_string_storage() _NOEXCEPT
50{
51 void* handle = dlopen("/usr/lib/libstdc++.6.dylib", RTLD_NOLOAD);
52 if (handle == nullptr)
53 return nullptr;
54 void* sym = dlsym(handle, "_ZNSs4_Rep20_S_empty_rep_storageE");
55 if (sym == nullptr)
56 return nullptr;
57 return data_from_rep(reinterpret_cast<_Rep_base *>(sym));
58}
59
60inline
61const char*
62get_gcc_empty_string_storage() _NOEXCEPT
63{
64 static const char* p = compute_gcc_empty_string_storage();
65 return p;
66}
67#endif
68
69}} // namespace __refstring_imp
70
71using namespace __refstring_imp;
72
73inline
74__libcpp_refstring::__libcpp_refstring(const char* msg) {
75 std::size_t len = strlen(msg);
76 _Rep_base* rep = static_cast<_Rep_base *>(::operator new(sizeof(*rep) + len + 1));
77 rep->len = len;
78 rep->cap = len;
79 rep->count = 0;
80 char *data = data_from_rep(rep);
81 std::memcpy(data, msg, len + 1);
82 __imp_ = data;
83}
84
85inline
86__libcpp_refstring::__libcpp_refstring(const __libcpp_refstring &s) _NOEXCEPT
87 : __imp_(s.__imp_)
88{
89 if (__uses_refcount())
90 __libcpp_atomic_add(&rep_from_data(__imp_)->count, 1);
91}
92
93inline
94__libcpp_refstring& __libcpp_refstring::operator=(__libcpp_refstring const& s) _NOEXCEPT {
95 bool adjust_old_count = __uses_refcount();
96 struct _Rep_base *old_rep = rep_from_data(__imp_);
97 __imp_ = s.__imp_;
98 if (__uses_refcount())
99 __libcpp_atomic_add(&rep_from_data(__imp_)->count, 1);
100 if (adjust_old_count)
101 {
102 if (__libcpp_atomic_add(&old_rep->count, count_t(-1)) < 0)
103 {
104 ::operator delete(old_rep);
105 }
106 }
107 return *this;
108}
109
110inline
111__libcpp_refstring::~__libcpp_refstring() {
112 if (__uses_refcount()) {
113 _Rep_base* rep = rep_from_data(__imp_);
114 if (__libcpp_atomic_add(&rep->count, count_t(-1)) < 0) {
115 ::operator delete(rep);
116 }
117 }
118}
119
120inline
121bool __libcpp_refstring::__uses_refcount() const {
122#ifdef __APPLE__
123 return __imp_ != get_gcc_empty_string_storage();
124#else
125 return true;
126#endif
127}
128
129_LIBCPP_END_NAMESPACE_STD
130
131#endif //_LIBCPPABI_REFSTRING_H
lib/libcxxabi/src/private_typeinfo.cpp+31-3
...@@ -61,6 +61,16 @@ is_equal(const std::type_info* x, const std::type_info* y, bool use_strcmp)...@@ -61,6 +61,16 @@ is_equal(const std::type_info* x, const std::type_info* y, bool use_strcmp)
61 return x == y || strcmp(x->name(), y->name()) == 0;61 return x == y || strcmp(x->name(), y->name()) == 0;
62}62}
6363
64static inline ptrdiff_t update_offset_to_base(const char* vtable,
65 ptrdiff_t offset_to_base) {
66#if __has_feature(cxx_abi_relative_vtable)
67 // VTable components are 32 bits in the relative vtables ABI.
68 return *reinterpret_cast<const int32_t*>(vtable + offset_to_base);
69#else
70 return *reinterpret_cast<const ptrdiff_t*>(vtable + offset_to_base);
71#endif
72}
73
64namespace __cxxabiv174namespace __cxxabiv1
65{75{
6676
...@@ -297,7 +307,7 @@ __base_class_type_info::has_unambiguous_public_base(__dynamic_cast_info* info,...@@ -297,7 +307,7 @@ __base_class_type_info::has_unambiguous_public_base(__dynamic_cast_info* info,
297 if (__offset_flags & __virtual_mask)307 if (__offset_flags & __virtual_mask)
298 {308 {
299 const char* vtable = *static_cast<const char*const*>(adjustedPtr);309 const char* vtable = *static_cast<const char*const*>(adjustedPtr);
300 offset_to_base = *reinterpret_cast<const ptrdiff_t*>(vtable + offset_to_base);310 offset_to_base = update_offset_to_base(vtable, offset_to_base);
301 }311 }
302 }312 }
303 __base_type->has_unambiguous_public_base(313 __base_type->has_unambiguous_public_base(
...@@ -615,10 +625,26 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,...@@ -615,10 +625,26 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,
615 // Possible future optimization: Take advantage of src2dst_offset625 // Possible future optimization: Take advantage of src2dst_offset
616626
617 // Get (dynamic_ptr, dynamic_type) from static_ptr627 // Get (dynamic_ptr, dynamic_type) from static_ptr
628#if __has_feature(cxx_abi_relative_vtable)
629 // The vtable address will point to the first virtual function, which is 8
630 // bytes after the start of the vtable (4 for the offset from top + 4 for the typeinfo component).
631 const int32_t* vtable =
632 *reinterpret_cast<const int32_t* const*>(static_ptr);
633 int32_t offset_to_derived = vtable[-2];
634 const void* dynamic_ptr = static_cast<const char*>(static_ptr) + offset_to_derived;
635
636 // The typeinfo component is now a relative offset to a proxy.
637 int32_t offset_to_ti_proxy = vtable[-1];
638 const uint8_t* ptr_to_ti_proxy =
639 reinterpret_cast<const uint8_t*>(vtable) + offset_to_ti_proxy;
640 const __class_type_info* dynamic_type =
641 *(reinterpret_cast<const __class_type_info* const*>(ptr_to_ti_proxy));
642#else
618 void **vtable = *static_cast<void ** const *>(static_ptr);643 void **vtable = *static_cast<void ** const *>(static_ptr);
619 ptrdiff_t offset_to_derived = reinterpret_cast<ptrdiff_t>(vtable[-2]);644 ptrdiff_t offset_to_derived = reinterpret_cast<ptrdiff_t>(vtable[-2]);
620 const void* dynamic_ptr = static_cast<const char*>(static_ptr) + offset_to_derived;645 const void* dynamic_ptr = static_cast<const char*>(static_ptr) + offset_to_derived;
621 const __class_type_info* dynamic_type = static_cast<const __class_type_info*>(vtable[-1]);646 const __class_type_info* dynamic_type = static_cast<const __class_type_info*>(vtable[-1]);
647#endif
622648
623 // Initialize answer to nullptr. This will be changed from the search649 // Initialize answer to nullptr. This will be changed from the search
624 // results if a non-null answer is found. Regardless, this is what will650 // results if a non-null answer is found. Regardless, this is what will
...@@ -641,6 +667,7 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,...@@ -641,6 +667,7 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,
641 {667 {
642 // We get here only if there is some kind of visibility problem668 // We get here only if there is some kind of visibility problem
643 // in client code.669 // in client code.
670 static_assert(std::atomic<size_t>::is_always_lock_free, "");
644 static std::atomic<size_t> error_count(0);671 static std::atomic<size_t> error_count(0);
645 size_t error_count_snapshot = error_count.fetch_add(1, std::memory_order_relaxed);672 size_t error_count_snapshot = error_count.fetch_add(1, std::memory_order_relaxed);
646 if ((error_count_snapshot & (error_count_snapshot-1)) == 0)673 if ((error_count_snapshot & (error_count_snapshot-1)) == 0)
...@@ -667,6 +694,7 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,...@@ -667,6 +694,7 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,
667 if (info.path_dst_ptr_to_static_ptr == unknown &&694 if (info.path_dst_ptr_to_static_ptr == unknown &&
668 info.path_dynamic_ptr_to_static_ptr == unknown)695 info.path_dynamic_ptr_to_static_ptr == unknown)
669 {696 {
697 static_assert(std::atomic<size_t>::is_always_lock_free, "");
670 static std::atomic<size_t> error_count(0);698 static std::atomic<size_t> error_count(0);
671 size_t error_count_snapshot = error_count.fetch_add(1, std::memory_order_relaxed);699 size_t error_count_snapshot = error_count.fetch_add(1, std::memory_order_relaxed);
672 if ((error_count_snapshot & (error_count_snapshot-1)) == 0)700 if ((error_count_snapshot & (error_count_snapshot-1)) == 0)
...@@ -1265,7 +1293,7 @@ __base_class_type_info::search_above_dst(__dynamic_cast_info* info,...@@ -1265,7 +1293,7 @@ __base_class_type_info::search_above_dst(__dynamic_cast_info* info,
1265 if (__offset_flags & __virtual_mask)1293 if (__offset_flags & __virtual_mask)
1266 {1294 {
1267 const char* vtable = *static_cast<const char*const*>(current_ptr);1295 const char* vtable = *static_cast<const char*const*>(current_ptr);
1268 offset_to_base = *reinterpret_cast<const ptrdiff_t*>(vtable + offset_to_base);1296 offset_to_base = update_offset_to_base(vtable, offset_to_base);
1269 }1297 }
1270 __base_type->search_above_dst(info, dst_ptr,1298 __base_type->search_above_dst(info, dst_ptr,
1271 static_cast<const char*>(current_ptr) + offset_to_base,1299 static_cast<const char*>(current_ptr) + offset_to_base,
...@@ -1285,7 +1313,7 @@ __base_class_type_info::search_below_dst(__dynamic_cast_info* info,...@@ -1285,7 +1313,7 @@ __base_class_type_info::search_below_dst(__dynamic_cast_info* info,
1285 if (__offset_flags & __virtual_mask)1313 if (__offset_flags & __virtual_mask)
1286 {1314 {
1287 const char* vtable = *static_cast<const char*const*>(current_ptr);1315 const char* vtable = *static_cast<const char*const*>(current_ptr);
1288 offset_to_base = *reinterpret_cast<const ptrdiff_t*>(vtable + offset_to_base);1316 offset_to_base = update_offset_to_base(vtable, offset_to_base);
1289 }1317 }
1290 __base_type->search_below_dst(info,1318 __base_type->search_below_dst(info,
1291 static_cast<const char*>(current_ptr) + offset_to_base,1319 static_cast<const char*>(current_ptr) + offset_to_base,
lib/libcxxabi/src/stdlib_exception.cpp-1
...@@ -6,7 +6,6 @@...@@ -6,7 +6,6 @@
6//6//
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
88
9#define _LIBCPP_BUILDING_LIBRARY
10#include <new>9#include <new>
11#include <exception>10#include <exception>
1211
lib/libcxxabi/src/stdlib_new_delete.cpp+15-22
...@@ -8,7 +8,6 @@...@@ -8,7 +8,6 @@
8// This file implements the new and delete operators.8// This file implements the new and delete operators.
9//===----------------------------------------------------------------------===//9//===----------------------------------------------------------------------===//
1010
11#define _LIBCPP_BUILDING_LIBRARY
12#include "__cxxabi_config.h"11#include "__cxxabi_config.h"
13#include <new>12#include <new>
14#include <cstdlib>13#include <cstdlib>
...@@ -28,7 +27,7 @@ operator new(std::size_t size) _THROW_BAD_ALLOC...@@ -28,7 +27,7 @@ operator new(std::size_t size) _THROW_BAD_ALLOC
28 if (size == 0)27 if (size == 0)
29 size = 1;28 size = 1;
30 void* p;29 void* p;
31 while ((p = ::malloc(size)) == 0)30 while ((p = ::malloc(size)) == nullptr)
32 {31 {
33 // If malloc fails and there is a new_handler,32 // If malloc fails and there is a new_handler,
34 // call it to try free up memory.33 // call it to try free up memory.
...@@ -49,7 +48,7 @@ _LIBCXXABI_WEAK...@@ -49,7 +48,7 @@ _LIBCXXABI_WEAK
49void*48void*
50operator new(size_t size, const std::nothrow_t&) _NOEXCEPT49operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
51{50{
52 void* p = 0;51 void* p = nullptr;
53#ifndef _LIBCXXABI_NO_EXCEPTIONS52#ifndef _LIBCXXABI_NO_EXCEPTIONS
54 try53 try
55 {54 {
...@@ -75,7 +74,7 @@ _LIBCXXABI_WEAK...@@ -75,7 +74,7 @@ _LIBCXXABI_WEAK
75void*74void*
76operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT75operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
77{76{
78 void* p = 0;77 void* p = nullptr;
79#ifndef _LIBCXXABI_NO_EXCEPTIONS78#ifndef _LIBCXXABI_NO_EXCEPTIONS
80 try79 try
81 {80 {
...@@ -94,8 +93,7 @@ _LIBCXXABI_WEAK...@@ -94,8 +93,7 @@ _LIBCXXABI_WEAK
94void93void
95operator delete(void* ptr) _NOEXCEPT94operator delete(void* ptr) _NOEXCEPT
96{95{
97 if (ptr)96 ::free(ptr);
98 ::free(ptr);
99}97}
10098
101_LIBCXXABI_WEAK99_LIBCXXABI_WEAK
...@@ -143,15 +141,16 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC...@@ -143,15 +141,16 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
143 size = 1;141 size = 1;
144 if (static_cast<size_t>(alignment) < sizeof(void*))142 if (static_cast<size_t>(alignment) < sizeof(void*))
145 alignment = std::align_val_t(sizeof(void*));143 alignment = std::align_val_t(sizeof(void*));
144
145 // Try allocating memory. If allocation fails and there is a new_handler,
146 // call it to try free up memory, and try again until it succeeds, or until
147 // the new_handler decides to terminate.
148 //
149 // If allocation fails and there is no new_handler, we throw bad_alloc
150 // (or return nullptr if exceptions are disabled).
146 void* p;151 void* p;
147#if defined(_LIBCPP_WIN32API)152 while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr)
148 while ((p = _aligned_malloc(size, static_cast<size_t>(alignment))) == nullptr)
149#else
150 while (::posix_memalign(&p, static_cast<size_t>(alignment), size) != 0)
151#endif
152 {153 {
153 // If posix_memalign fails and there is a new_handler,
154 // call it to try free up memory.
155 std::new_handler nh = std::get_new_handler();154 std::new_handler nh = std::get_new_handler();
156 if (nh)155 if (nh)
157 nh();156 nh();
...@@ -159,7 +158,6 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC...@@ -159,7 +158,6 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
159#ifndef _LIBCXXABI_NO_EXCEPTIONS158#ifndef _LIBCXXABI_NO_EXCEPTIONS
160 throw std::bad_alloc();159 throw std::bad_alloc();
161#else160#else
162 p = nullptr; // posix_memalign doesn't initialize 'p' on failure
163 break;161 break;
164#endif162#endif
165 }163 }
...@@ -171,7 +169,7 @@ _LIBCXXABI_WEAK...@@ -171,7 +169,7 @@ _LIBCXXABI_WEAK
171void*169void*
172operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT170operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
173{171{
174 void* p = 0;172 void* p = nullptr;
175#ifndef _LIBCXXABI_NO_EXCEPTIONS173#ifndef _LIBCXXABI_NO_EXCEPTIONS
176 try174 try
177 {175 {
...@@ -197,7 +195,7 @@ _LIBCXXABI_WEAK...@@ -197,7 +195,7 @@ _LIBCXXABI_WEAK
197void*195void*
198operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT196operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
199{197{
200 void* p = 0;198 void* p = nullptr;
201#ifndef _LIBCXXABI_NO_EXCEPTIONS199#ifndef _LIBCXXABI_NO_EXCEPTIONS
202 try200 try
203 {201 {
...@@ -216,12 +214,7 @@ _LIBCXXABI_WEAK...@@ -216,12 +214,7 @@ _LIBCXXABI_WEAK
216void214void
217operator delete(void* ptr, std::align_val_t) _NOEXCEPT215operator delete(void* ptr, std::align_val_t) _NOEXCEPT
218{216{
219 if (ptr)217 std::__libcpp_aligned_free(ptr);
220#if defined(_LIBCPP_WIN32API)
221 ::_aligned_free(ptr);
222#else
223 ::free(ptr);
224#endif
225}218}
226219
227_LIBCXXABI_WEAK220_LIBCXXABI_WEAK
lib/libcxxabi/src/stdlib_stdexcept.cpp+1-1
...@@ -6,7 +6,7 @@...@@ -6,7 +6,7 @@
6//6//
7//===----------------------------------------------------------------------===//7//===----------------------------------------------------------------------===//
88
9#include "include/refstring.h"9#include "../../libcxx/src/include/refstring.h"
10#include "stdexcept"10#include "stdexcept"
11#include "new"11#include "new"
12#include <cstdlib>12#include <cstdlib>
lib/libunwind/include/__libunwind_config.h+10
...@@ -25,8 +25,12 @@...@@ -25,8 +25,12 @@
25#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC 3125#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC 31
26#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_HEXAGON 3426#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_HEXAGON 34
27#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV 6427#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV 64
28#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE 143
2829
29#if defined(_LIBUNWIND_IS_NATIVE_ONLY)30#if defined(_LIBUNWIND_IS_NATIVE_ONLY)
31# if defined(__linux__)
32# define _LIBUNWIND_TARGET_LINUX 1
33# endif
30# if defined(__i386__)34# if defined(__i386__)
31# define _LIBUNWIND_TARGET_I38635# define _LIBUNWIND_TARGET_I386
32# define _LIBUNWIND_CONTEXT_SIZE 836# define _LIBUNWIND_CONTEXT_SIZE 8
...@@ -135,6 +139,11 @@...@@ -135,6 +139,11 @@
135# error "Unsupported RISC-V ABI"139# error "Unsupported RISC-V ABI"
136# endif140# endif
137# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV141# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV
142# elif defined(__ve__)
143# define _LIBUNWIND_TARGET_VE 1
144# define _LIBUNWIND_CONTEXT_SIZE 67
145# define _LIBUNWIND_CURSOR_SIZE 79
146# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE
138# else147# else
139# error "Unsupported architecture."148# error "Unsupported architecture."
140# endif149# endif
...@@ -151,6 +160,7 @@...@@ -151,6 +160,7 @@
151# define _LIBUNWIND_TARGET_SPARC 1160# define _LIBUNWIND_TARGET_SPARC 1
152# define _LIBUNWIND_TARGET_HEXAGON 1161# define _LIBUNWIND_TARGET_HEXAGON 1
153# define _LIBUNWIND_TARGET_RISCV 1162# define _LIBUNWIND_TARGET_RISCV 1
163# define _LIBUNWIND_TARGET_VE 1
154# define _LIBUNWIND_CONTEXT_SIZE 167164# define _LIBUNWIND_CONTEXT_SIZE 167
155# define _LIBUNWIND_CURSOR_SIZE 179165# define _LIBUNWIND_CURSOR_SIZE 179
156# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287166# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
lib/libunwind/include/libunwind.h+159-1
...@@ -43,6 +43,12 @@...@@ -43,6 +43,12 @@
43 #define LIBUNWIND_AVAIL43 #define LIBUNWIND_AVAIL
44#endif44#endif
4545
46#if defined(_WIN32) && defined(__SEH__)
47 #define LIBUNWIND_CURSOR_ALIGNMENT_ATTR __attribute__((__aligned__(16)))
48#else
49 #define LIBUNWIND_CURSOR_ALIGNMENT_ATTR
50#endif
51
46/* error codes */52/* error codes */
47enum {53enum {
48 UNW_ESUCCESS = 0, /* no error */54 UNW_ESUCCESS = 0, /* no error */
...@@ -68,7 +74,7 @@ typedef struct unw_context_t unw_context_t;...@@ -68,7 +74,7 @@ typedef struct unw_context_t unw_context_t;
6874
69struct unw_cursor_t {75struct unw_cursor_t {
70 uint64_t data[_LIBUNWIND_CURSOR_SIZE];76 uint64_t data[_LIBUNWIND_CURSOR_SIZE];
71};77} LIBUNWIND_CURSOR_ALIGNMENT_ATTR;
72typedef struct unw_cursor_t unw_cursor_t;78typedef struct unw_cursor_t unw_cursor_t;
7379
74typedef struct unw_addr_space *unw_addr_space_t;80typedef struct unw_addr_space *unw_addr_space_t;
...@@ -941,4 +947,156 @@ enum {...@@ -941,4 +947,156 @@ enum {
941 UNW_RISCV_F31 = 63,947 UNW_RISCV_F31 = 63,
942};948};
943949
950// VE register numbers
951enum {
952 UNW_VE_S0 = 0,
953 UNW_VE_S1 = 1,
954 UNW_VE_S2 = 2,
955 UNW_VE_S3 = 3,
956 UNW_VE_S4 = 4,
957 UNW_VE_S5 = 5,
958 UNW_VE_S6 = 6,
959 UNW_VE_S7 = 7,
960 UNW_VE_S8 = 8,
961 UNW_VE_S9 = 9,
962 UNW_VE_S10 = 10,
963 UNW_VE_S11 = 11,
964 UNW_VE_S12 = 12,
965 UNW_VE_S13 = 13,
966 UNW_VE_S14 = 14,
967 UNW_VE_S15 = 15,
968 UNW_VE_S16 = 16,
969 UNW_VE_S17 = 17,
970 UNW_VE_S18 = 18,
971 UNW_VE_S19 = 19,
972 UNW_VE_S20 = 20,
973 UNW_VE_S21 = 21,
974 UNW_VE_S22 = 22,
975 UNW_VE_S23 = 23,
976 UNW_VE_S24 = 24,
977 UNW_VE_S25 = 25,
978 UNW_VE_S26 = 26,
979 UNW_VE_S27 = 27,
980 UNW_VE_S28 = 28,
981 UNW_VE_S29 = 29,
982 UNW_VE_S30 = 30,
983 UNW_VE_S31 = 31,
984 UNW_VE_S32 = 32,
985 UNW_VE_S33 = 33,
986 UNW_VE_S34 = 34,
987 UNW_VE_S35 = 35,
988 UNW_VE_S36 = 36,
989 UNW_VE_S37 = 37,
990 UNW_VE_S38 = 38,
991 UNW_VE_S39 = 39,
992 UNW_VE_S40 = 40,
993 UNW_VE_S41 = 41,
994 UNW_VE_S42 = 42,
995 UNW_VE_S43 = 43,
996 UNW_VE_S44 = 44,
997 UNW_VE_S45 = 45,
998 UNW_VE_S46 = 46,
999 UNW_VE_S47 = 47,
1000 UNW_VE_S48 = 48,
1001 UNW_VE_S49 = 49,
1002 UNW_VE_S50 = 50,
1003 UNW_VE_S51 = 51,
1004 UNW_VE_S52 = 52,
1005 UNW_VE_S53 = 53,
1006 UNW_VE_S54 = 54,
1007 UNW_VE_S55 = 55,
1008 UNW_VE_S56 = 56,
1009 UNW_VE_S57 = 57,
1010 UNW_VE_S58 = 58,
1011 UNW_VE_S59 = 59,
1012 UNW_VE_S60 = 60,
1013 UNW_VE_S61 = 61,
1014 UNW_VE_S62 = 62,
1015 UNW_VE_S63 = 63,
1016 UNW_VE_V0 = 64 + 0,
1017 UNW_VE_V1 = 64 + 1,
1018 UNW_VE_V2 = 64 + 2,
1019 UNW_VE_V3 = 64 + 3,
1020 UNW_VE_V4 = 64 + 4,
1021 UNW_VE_V5 = 64 + 5,
1022 UNW_VE_V6 = 64 + 6,
1023 UNW_VE_V7 = 64 + 7,
1024 UNW_VE_V8 = 64 + 8,
1025 UNW_VE_V9 = 64 + 9,
1026 UNW_VE_V10 = 64 + 10,
1027 UNW_VE_V11 = 64 + 11,
1028 UNW_VE_V12 = 64 + 12,
1029 UNW_VE_V13 = 64 + 13,
1030 UNW_VE_V14 = 64 + 14,
1031 UNW_VE_V15 = 64 + 15,
1032 UNW_VE_V16 = 64 + 16,
1033 UNW_VE_V17 = 64 + 17,
1034 UNW_VE_V18 = 64 + 18,
1035 UNW_VE_V19 = 64 + 19,
1036 UNW_VE_V20 = 64 + 20,
1037 UNW_VE_V21 = 64 + 21,
1038 UNW_VE_V22 = 64 + 22,
1039 UNW_VE_V23 = 64 + 23,
1040 UNW_VE_V24 = 64 + 24,
1041 UNW_VE_V25 = 64 + 25,
1042 UNW_VE_V26 = 64 + 26,
1043 UNW_VE_V27 = 64 + 27,
1044 UNW_VE_V28 = 64 + 28,
1045 UNW_VE_V29 = 64 + 29,
1046 UNW_VE_V30 = 64 + 30,
1047 UNW_VE_V31 = 64 + 31,
1048 UNW_VE_V32 = 64 + 32,
1049 UNW_VE_V33 = 64 + 33,
1050 UNW_VE_V34 = 64 + 34,
1051 UNW_VE_V35 = 64 + 35,
1052 UNW_VE_V36 = 64 + 36,
1053 UNW_VE_V37 = 64 + 37,
1054 UNW_VE_V38 = 64 + 38,
1055 UNW_VE_V39 = 64 + 39,
1056 UNW_VE_V40 = 64 + 40,
1057 UNW_VE_V41 = 64 + 41,
1058 UNW_VE_V42 = 64 + 42,
1059 UNW_VE_V43 = 64 + 43,
1060 UNW_VE_V44 = 64 + 44,
1061 UNW_VE_V45 = 64 + 45,
1062 UNW_VE_V46 = 64 + 46,
1063 UNW_VE_V47 = 64 + 47,
1064 UNW_VE_V48 = 64 + 48,
1065 UNW_VE_V49 = 64 + 49,
1066 UNW_VE_V50 = 64 + 50,
1067 UNW_VE_V51 = 64 + 51,
1068 UNW_VE_V52 = 64 + 52,
1069 UNW_VE_V53 = 64 + 53,
1070 UNW_VE_V54 = 64 + 54,
1071 UNW_VE_V55 = 64 + 55,
1072 UNW_VE_V56 = 64 + 56,
1073 UNW_VE_V57 = 64 + 57,
1074 UNW_VE_V58 = 64 + 58,
1075 UNW_VE_V59 = 64 + 59,
1076 UNW_VE_V60 = 64 + 60,
1077 UNW_VE_V61 = 64 + 61,
1078 UNW_VE_V62 = 64 + 62,
1079 UNW_VE_V63 = 64 + 63,
1080 UNW_VE_VM0 = 128 + 0,
1081 UNW_VE_VM1 = 128 + 1,
1082 UNW_VE_VM2 = 128 + 2,
1083 UNW_VE_VM3 = 128 + 3,
1084 UNW_VE_VM4 = 128 + 4,
1085 UNW_VE_VM5 = 128 + 5,
1086 UNW_VE_VM6 = 128 + 6,
1087 UNW_VE_VM7 = 128 + 7,
1088 UNW_VE_VM8 = 128 + 8,
1089 UNW_VE_VM9 = 128 + 9,
1090 UNW_VE_VM10 = 128 + 10,
1091 UNW_VE_VM11 = 128 + 11,
1092 UNW_VE_VM12 = 128 + 12,
1093 UNW_VE_VM13 = 128 + 13,
1094 UNW_VE_VM14 = 128 + 14,
1095 UNW_VE_VM15 = 128 + 15, // = 143
1096
1097 // Following registers don't have DWARF register numbers.
1098 UNW_VE_VIXR = 144,
1099 UNW_VE_VL = 145,
1100};
1101
944#endif1102#endif
lib/libunwind/src/AddressSpace.hpp+98-162
...@@ -17,6 +17,12 @@...@@ -17,6 +17,12 @@
17#include <stdlib.h>17#include <stdlib.h>
18#include <string.h>18#include <string.h>
1919
20#include "libunwind.h"
21#include "config.h"
22#include "dwarf2.h"
23#include "EHHeaderParser.hpp"
24#include "Registers.hpp"
25
20#ifndef _LIBUNWIND_USE_DLADDR26#ifndef _LIBUNWIND_USE_DLADDR
21 #if !defined(_LIBUNWIND_IS_BAREMETAL) && !defined(_WIN32)27 #if !defined(_LIBUNWIND_IS_BAREMETAL) && !defined(_WIN32)
22 #define _LIBUNWIND_USE_DLADDR 128 #define _LIBUNWIND_USE_DLADDR 1
...@@ -39,19 +45,6 @@ struct EHABIIndexEntry {...@@ -39,19 +45,6 @@ struct EHABIIndexEntry {
39};45};
40#endif46#endif
4147
42#ifdef __APPLE__
43#include <mach-o/getsect.h>
44namespace libunwind {
45 bool checkKeyMgrRegisteredFDEs(uintptr_t targetAddr, void *&fde);
46}
47#endif
48
49#include "libunwind.h"
50#include "config.h"
51#include "dwarf2.h"
52#include "EHHeaderParser.hpp"
53#include "Registers.hpp"
54
55#ifdef __APPLE__48#ifdef __APPLE__
5649
57 struct dyld_unwind_sections50 struct dyld_unwind_sections
...@@ -62,43 +55,9 @@ namespace libunwind {...@@ -62,43 +55,9 @@ namespace libunwind {
62 const void* compact_unwind_section;55 const void* compact_unwind_section;
63 uintptr_t compact_unwind_section_length;56 uintptr_t compact_unwind_section_length;
64 };57 };
65 #if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) \
66 && (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) \
67 || defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
68 // In 10.7.0 or later, libSystem.dylib implements this function.
69 extern "C" bool _dyld_find_unwind_sections(void *, dyld_unwind_sections *);
70 #else
71 // In 10.6.x and earlier, we need to implement this functionality. Note
72 // that this requires a newer version of libmacho (from cctools) than is
73 // present in libSystem on 10.6.x (for getsectiondata).
74 static inline bool _dyld_find_unwind_sections(void* addr,
75 dyld_unwind_sections* info) {
76 // Find mach-o image containing address.
77 Dl_info dlinfo;
78 if (!dladdr(addr, &dlinfo))
79 return false;
80#if __LP64__
81 const struct mach_header_64 *mh = (const struct mach_header_64 *)dlinfo.dli_fbase;
82#else
83 const struct mach_header *mh = (const struct mach_header *)dlinfo.dli_fbase;
84#endif
8558
86 // Initialize the return struct59 // In 10.7.0 or later, libSystem.dylib implements this function.
87 info->mh = (const struct mach_header *)mh;60 extern "C" bool _dyld_find_unwind_sections(void *, dyld_unwind_sections *);
88 info->dwarf_section = getsectiondata(mh, "__TEXT", "__eh_frame", &info->dwarf_section_length);
89 info->compact_unwind_section = getsectiondata(mh, "__TEXT", "__unwind_info", &info->compact_unwind_section_length);
90
91 if (!info->dwarf_section) {
92 info->dwarf_section_length = 0;
93 }
94
95 if (!info->compact_unwind_section) {
96 info->compact_unwind_section_length = 0;
97 }
98
99 return true;
100 }
101 #endif
10261
103#elif defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) && defined(_LIBUNWIND_IS_BAREMETAL)62#elif defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) && defined(_LIBUNWIND_IS_BAREMETAL)
10463
...@@ -139,22 +98,15 @@ extern char __eh_frame_hdr_end;...@@ -139,22 +98,15 @@ extern char __eh_frame_hdr_end;
139extern char __exidx_start;98extern char __exidx_start;
140extern char __exidx_end;99extern char __exidx_end;
141100
142#elif defined(_LIBUNWIND_ARM_EHABI) || defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)101#elif defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) && defined(_WIN32)
143102
144// ELF-based systems may use dl_iterate_phdr() to access sections
145// containing unwinding information. The ElfW() macro for pointer-size
146// independent ELF header traversal is not provided by <link.h> on some
147// systems (e.g., FreeBSD). On these systems the data structures are
148// just called Elf_XXX. Define ElfW() locally.
149#ifndef _WIN32
150#include <link.h>
151#else
152#include <windows.h>103#include <windows.h>
153#include <psapi.h>104#include <psapi.h>
154#endif105
155#if !defined(ElfW)106#elif defined(_LIBUNWIND_USE_DL_ITERATE_PHDR) || \
156#define ElfW(type) Elf_##type107 defined(_LIBUNWIND_USE_DL_UNWIND_FIND_EXIDX)
157#endif108
109#include <link.h>
158110
159#endif111#endif
160112
...@@ -162,11 +114,15 @@ namespace libunwind {...@@ -162,11 +114,15 @@ namespace libunwind {
162114
163/// Used by findUnwindSections() to return info about needed sections.115/// Used by findUnwindSections() to return info about needed sections.
164struct UnwindInfoSections {116struct UnwindInfoSections {
165#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) || defined(_LIBUNWIND_SUPPORT_DWARF_INDEX) || \117#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) || \
166 defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)118 defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND) || \
167 // No dso_base for SEH or ARM EHABI.119 defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)
120 // No dso_base for SEH.
168 uintptr_t dso_base;121 uintptr_t dso_base;
169#endif122#endif
123#if defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)
124 uintptr_t text_segment_length;
125#endif
170#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)126#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
171 uintptr_t dwarf_section;127 uintptr_t dwarf_section;
172 uintptr_t dwarf_section_length;128 uintptr_t dwarf_section_length;
...@@ -290,11 +246,11 @@ inline int64_t LocalAddressSpace::getSLEB128(pint_t &addr, pint_t end) {...@@ -290,11 +246,11 @@ inline int64_t LocalAddressSpace::getSLEB128(pint_t &addr, pint_t end) {
290 if (p == pend)246 if (p == pend)
291 _LIBUNWIND_ABORT("truncated sleb128 expression");247 _LIBUNWIND_ABORT("truncated sleb128 expression");
292 byte = *p++;248 byte = *p++;
293 result |= ((byte & 0x7f) << bit);249 result |= (uint64_t)(byte & 0x7f) << bit;
294 bit += 7;250 bit += 7;
295 } while (byte & 0x80);251 } while (byte & 0x80);
296 // sign extend negative numbers252 // sign extend negative numbers
297 if ((byte & 0x40) != 0)253 if ((byte & 0x40) != 0 && bit < 64)
298 result |= (-1ULL) << bit;254 result |= (-1ULL) << bit;
299 addr = (pint_t) p;255 addr = (pint_t) p;
300 return result;256 return result;
...@@ -392,23 +348,14 @@ LocalAddressSpace::getEncodedP(pint_t &addr, pint_t end, uint8_t encoding,...@@ -392,23 +348,14 @@ LocalAddressSpace::getEncodedP(pint_t &addr, pint_t end, uint8_t encoding,
392 return result;348 return result;
393}349}
394350
395#ifdef __APPLE__351#if defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)
396#elif defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) && defined(_LIBUNWIND_IS_BAREMETAL)
397#elif defined(_LIBUNWIND_ARM_EHABI) && defined(_LIBUNWIND_IS_BAREMETAL)
398#elif defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) && defined(_WIN32)
399#elif defined(_LIBUNWIND_SUPPORT_SEH_UNWIND) && defined(_WIN32)
400#elif defined(_LIBUNWIND_ARM_EHABI) && defined(__BIONIC__)
401// Code inside findUnwindSections handles all these cases.
402//
403// Although the above ifdef chain is ugly, there doesn't seem to be a cleaner
404// way to handle it. The generalized boolean expression is:
405//
406// A OR (B AND C) OR (D AND C) OR (B AND E) OR (F AND E) OR (D AND G)
407//
408// Running it through various boolean expression simplifiers gives expressions
409// that don't help at all.
410#elif defined(_LIBUNWIND_ARM_EHABI) || defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
411352
353// The ElfW() macro for pointer-size independent ELF header traversal is not
354// provided by <link.h> on some systems (e.g., FreeBSD). On these systems the
355// data structures are just called Elf_XXX. Define ElfW() locally.
356#if !defined(ElfW)
357 #define ElfW(type) Elf_##type
358#endif
412#if !defined(Elf_Half)359#if !defined(Elf_Half)
413 typedef ElfW(Half) Elf_Half;360 typedef ElfW(Half) Elf_Half;
414#endif361#endif
...@@ -447,16 +394,12 @@ struct _LIBUNWIND_HIDDEN dl_iterate_cb_data {...@@ -447,16 +394,12 @@ struct _LIBUNWIND_HIDDEN dl_iterate_cb_data {
447 uintptr_t targetAddr;394 uintptr_t targetAddr;
448};395};
449396
450#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
451 #if !defined(_LIBUNWIND_SUPPORT_DWARF_INDEX)
452 #error "_LIBUNWIND_SUPPORT_DWARF_UNWIND requires _LIBUNWIND_SUPPORT_DWARF_INDEX on this platform."
453 #endif
454
455#if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE)397#if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE)
456#include "FrameHeaderCache.hpp"398#include "FrameHeaderCache.hpp"
457399
458// There should be just one of these per process.400// Typically there is one cache per process, but when libunwind is built as a
459static FrameHeaderCache ProcessFrameHeaderCache;401// hermetic static library, then each shared object may have its own cache.
402static FrameHeaderCache TheFrameHeaderCache;
460#endif403#endif
461404
462static bool checkAddrInSegment(const Elf_Phdr *phdr, size_t image_base,405static bool checkAddrInSegment(const Elf_Phdr *phdr, size_t image_base,
...@@ -466,95 +409,93 @@ static bool checkAddrInSegment(const Elf_Phdr *phdr, size_t image_base,...@@ -466,95 +409,93 @@ static bool checkAddrInSegment(const Elf_Phdr *phdr, size_t image_base,
466 uintptr_t end = begin + phdr->p_memsz;409 uintptr_t end = begin + phdr->p_memsz;
467 if (cbdata->targetAddr >= begin && cbdata->targetAddr < end) {410 if (cbdata->targetAddr >= begin && cbdata->targetAddr < end) {
468 cbdata->sects->dso_base = begin;411 cbdata->sects->dso_base = begin;
469 cbdata->sects->dwarf_section_length = phdr->p_memsz;412 cbdata->sects->text_segment_length = phdr->p_memsz;
470 return true;413 return true;
471 }414 }
472 }415 }
473 return false;416 return false;
474}417}
475418
419static bool checkForUnwindInfoSegment(const Elf_Phdr *phdr, size_t image_base,
420 dl_iterate_cb_data *cbdata) {
421#if defined(_LIBUNWIND_SUPPORT_DWARF_INDEX)
422 if (phdr->p_type == PT_GNU_EH_FRAME) {
423 EHHeaderParser<LocalAddressSpace>::EHHeaderInfo hdrInfo;
424 uintptr_t eh_frame_hdr_start = image_base + phdr->p_vaddr;
425 cbdata->sects->dwarf_index_section = eh_frame_hdr_start;
426 cbdata->sects->dwarf_index_section_length = phdr->p_memsz;
427 if (EHHeaderParser<LocalAddressSpace>::decodeEHHdr(
428 *cbdata->addressSpace, eh_frame_hdr_start, phdr->p_memsz,
429 hdrInfo)) {
430 // .eh_frame_hdr records the start of .eh_frame, but not its size.
431 // Rely on a zero terminator to find the end of the section.
432 cbdata->sects->dwarf_section = hdrInfo.eh_frame_ptr;
433 cbdata->sects->dwarf_section_length = UINTPTR_MAX;
434 return true;
435 }
436 }
437 return false;
438#elif defined(_LIBUNWIND_ARM_EHABI)
439 if (phdr->p_type == PT_ARM_EXIDX) {
440 uintptr_t exidx_start = image_base + phdr->p_vaddr;
441 cbdata->sects->arm_section = exidx_start;
442 cbdata->sects->arm_section_length = phdr->p_memsz;
443 return true;
444 }
445 return false;
446#else
447#error Need one of _LIBUNWIND_SUPPORT_DWARF_INDEX or _LIBUNWIND_ARM_EHABI
448#endif
449}
450
476static int findUnwindSectionsByPhdr(struct dl_phdr_info *pinfo,451static int findUnwindSectionsByPhdr(struct dl_phdr_info *pinfo,
477 size_t pinfo_size, void *data) {452 size_t pinfo_size, void *data) {
478 auto cbdata = static_cast<dl_iterate_cb_data *>(data);453 auto cbdata = static_cast<dl_iterate_cb_data *>(data);
479 if (pinfo->dlpi_phnum == 0 || cbdata->targetAddr < pinfo->dlpi_addr)454 if (pinfo->dlpi_phnum == 0 || cbdata->targetAddr < pinfo->dlpi_addr)
480 return 0;455 return 0;
481#if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE)456#if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE)
482 if (ProcessFrameHeaderCache.find(pinfo, pinfo_size, data))457 if (TheFrameHeaderCache.find(pinfo, pinfo_size, data))
483 return 1;458 return 1;
459#else
460 // Avoid warning about unused variable.
461 (void)pinfo_size;
484#endif462#endif
485463
486 Elf_Addr image_base = calculateImageBase(pinfo);464 Elf_Addr image_base = calculateImageBase(pinfo);
487 bool found_obj = false;
488 bool found_hdr = false;
489465
490 // Third phdr is usually the executable phdr.466 // Most shared objects seen in this callback function likely don't contain the
491 if (pinfo->dlpi_phnum > 2)467 // target address, so optimize for that. Scan for a matching PT_LOAD segment
492 found_obj = checkAddrInSegment(&pinfo->dlpi_phdr[2], image_base, cbdata);468 // first and bail when it isn't found.
469 bool found_text = false;
470 for (Elf_Half i = 0; i < pinfo->dlpi_phnum; ++i) {
471 if (checkAddrInSegment(&pinfo->dlpi_phdr[i], image_base, cbdata)) {
472 found_text = true;
473 break;
474 }
475 }
476 if (!found_text)
477 return 0;
493478
494 // PT_GNU_EH_FRAME is usually near the end. Iterate backward. We already know479 // PT_GNU_EH_FRAME and PT_ARM_EXIDX are usually near the end. Iterate
495 // that there is one or more phdrs.480 // backward.
481 bool found_unwind = false;
496 for (Elf_Half i = pinfo->dlpi_phnum; i > 0; i--) {482 for (Elf_Half i = pinfo->dlpi_phnum; i > 0; i--) {
497 const Elf_Phdr *phdr = &pinfo->dlpi_phdr[i - 1];483 const Elf_Phdr *phdr = &pinfo->dlpi_phdr[i - 1];
498 if (!found_hdr && phdr->p_type == PT_GNU_EH_FRAME) {484 if (checkForUnwindInfoSegment(phdr, image_base, cbdata)) {
499 EHHeaderParser<LocalAddressSpace>::EHHeaderInfo hdrInfo;485 found_unwind = true;
500 uintptr_t eh_frame_hdr_start = image_base + phdr->p_vaddr;486 break;
501 cbdata->sects->dwarf_index_section = eh_frame_hdr_start;
502 cbdata->sects->dwarf_index_section_length = phdr->p_memsz;
503 found_hdr = EHHeaderParser<LocalAddressSpace>::decodeEHHdr(
504 *cbdata->addressSpace, eh_frame_hdr_start, phdr->p_memsz,
505 hdrInfo);
506 if (found_hdr)
507 cbdata->sects->dwarf_section = hdrInfo.eh_frame_ptr;
508 } else if (!found_obj) {
509 found_obj = checkAddrInSegment(phdr, image_base, cbdata);
510 }
511 if (found_obj && found_hdr) {
512#if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE)
513 ProcessFrameHeaderCache.add(cbdata->sects);
514#endif
515 return 1;
516 }487 }
517 }488 }
518 cbdata->sects->dwarf_section_length = 0;489 if (!found_unwind)
519 return 0;
520}
521
522#else // defined(LIBUNWIND_SUPPORT_DWARF_UNWIND)
523// Given all the #ifdef's above, the code here is for
524// defined(LIBUNWIND_ARM_EHABI)
525
526static int findUnwindSectionsByPhdr(struct dl_phdr_info *pinfo, size_t,
527 void *data) {
528 auto *cbdata = static_cast<dl_iterate_cb_data *>(data);
529 bool found_obj = false;
530 bool found_hdr = false;
531
532 assert(cbdata);
533 assert(cbdata->sects);
534
535 if (cbdata->targetAddr < pinfo->dlpi_addr)
536 return 0;490 return 0;
537491
538 Elf_Addr image_base = calculateImageBase(pinfo);492#if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE)
539493 TheFrameHeaderCache.add(cbdata->sects);
540 for (Elf_Half i = 0; i < pinfo->dlpi_phnum; i++) {494#endif
541 const Elf_Phdr *phdr = &pinfo->dlpi_phdr[i];495 return 1;
542 if (phdr->p_type == PT_LOAD) {
543 uintptr_t begin = image_base + phdr->p_vaddr;
544 uintptr_t end = begin + phdr->p_memsz;
545 if (cbdata->targetAddr >= begin && cbdata->targetAddr < end)
546 found_obj = true;
547 } else if (phdr->p_type == PT_ARM_EXIDX) {
548 uintptr_t exidx_start = image_base + phdr->p_vaddr;
549 cbdata->sects->arm_section = exidx_start;
550 cbdata->sects->arm_section_length = phdr->p_memsz;
551 found_hdr = true;
552 }
553 }
554 return found_obj && found_hdr;
555}496}
556#endif // defined(LIBUNWIND_SUPPORT_DWARF_UNWIND)497
557#endif // defined(_LIBUNWIND_ARM_EHABI) || defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)498#endif // defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)
558499
559500
560inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,501inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
...@@ -572,6 +513,7 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,...@@ -572,6 +513,7 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
572 return true;513 return true;
573 }514 }
574#elif defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) && defined(_LIBUNWIND_IS_BAREMETAL)515#elif defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) && defined(_LIBUNWIND_IS_BAREMETAL)
516 info.dso_base = 0;
575 // Bare metal is statically linked, so no need to ask the dynamic loader517 // Bare metal is statically linked, so no need to ask the dynamic loader
576 info.dwarf_section_length = (uintptr_t)(&__eh_frame_end - &__eh_frame_start);518 info.dwarf_section_length = (uintptr_t)(&__eh_frame_end - &__eh_frame_start);
577 info.dwarf_section = (uintptr_t)(&__eh_frame_start);519 info.dwarf_section = (uintptr_t)(&__eh_frame_start);
...@@ -638,16 +580,14 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,...@@ -638,16 +580,14 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
638 (void)targetAddr;580 (void)targetAddr;
639 (void)info;581 (void)info;
640 return true;582 return true;
641#elif defined(_LIBUNWIND_ARM_EHABI) && defined(__BIONIC__)583#elif defined(_LIBUNWIND_USE_DL_UNWIND_FIND_EXIDX)
642 // For ARM EHABI, Bionic didn't implement dl_iterate_phdr until API 21. After
643 // API 21, dl_iterate_phdr exists, but dl_unwind_find_exidx is much faster.
644 int length = 0;584 int length = 0;
645 info.arm_section =585 info.arm_section =
646 (uintptr_t)dl_unwind_find_exidx((_Unwind_Ptr)targetAddr, &length);586 (uintptr_t)dl_unwind_find_exidx((_Unwind_Ptr)targetAddr, &length);
647 info.arm_section_length = (uintptr_t)length * sizeof(EHABIIndexEntry);587 info.arm_section_length = (uintptr_t)length * sizeof(EHABIIndexEntry);
648 if (info.arm_section && info.arm_section_length)588 if (info.arm_section && info.arm_section_length)
649 return true;589 return true;
650#elif defined(_LIBUNWIND_ARM_EHABI) || defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)590#elif defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)
651 dl_iterate_cb_data cb_data = {this, &info, targetAddr};591 dl_iterate_cb_data cb_data = {this, &info, targetAddr};
652 int found = dl_iterate_phdr(findUnwindSectionsByPhdr, &cb_data);592 int found = dl_iterate_phdr(findUnwindSectionsByPhdr, &cb_data);
653 return static_cast<bool>(found);593 return static_cast<bool>(found);
...@@ -658,14 +598,10 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,...@@ -658,14 +598,10 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
658598
659599
660inline bool LocalAddressSpace::findOtherFDE(pint_t targetAddr, pint_t &fde) {600inline bool LocalAddressSpace::findOtherFDE(pint_t targetAddr, pint_t &fde) {
661#ifdef __APPLE__
662 return checkKeyMgrRegisteredFDEs(targetAddr, *((void**)&fde));
663#else
664 // TO DO: if OS has way to dynamically register FDEs, check that.601 // TO DO: if OS has way to dynamically register FDEs, check that.
665 (void)targetAddr;602 (void)targetAddr;
666 (void)fde;603 (void)fde;
667 return false;604 return false;
668#endif
669}605}
670606
671inline bool LocalAddressSpace::findFunctionName(pint_t addr, char *buf,607inline bool LocalAddressSpace::findFunctionName(pint_t addr, char *buf,
lib/libunwind/src/DwarfInstructions.hpp+8-1
...@@ -93,7 +93,8 @@ typename A::pint_t DwarfInstructions<A, R>::getSavedRegister(...@@ -93,7 +93,8 @@ typename A::pint_t DwarfInstructions<A, R>::getSavedRegister(
9393
94 case CFI_Parser<A>::kRegisterInRegister:94 case CFI_Parser<A>::kRegisterInRegister:
95 return registers.getRegister((int)savedReg.value);95 return registers.getRegister((int)savedReg.value);
9696 case CFI_Parser<A>::kRegisterUndefined:
97 return 0;
97 case CFI_Parser<A>::kRegisterUnused:98 case CFI_Parser<A>::kRegisterUnused:
98 case CFI_Parser<A>::kRegisterOffsetFromCFA:99 case CFI_Parser<A>::kRegisterOffsetFromCFA:
99 // FIX ME100 // FIX ME
...@@ -117,6 +118,7 @@ double DwarfInstructions<A, R>::getSavedFloatRegister(...@@ -117,6 +118,7 @@ double DwarfInstructions<A, R>::getSavedFloatRegister(
117118
118 case CFI_Parser<A>::kRegisterIsExpression:119 case CFI_Parser<A>::kRegisterIsExpression:
119 case CFI_Parser<A>::kRegisterUnused:120 case CFI_Parser<A>::kRegisterUnused:
121 case CFI_Parser<A>::kRegisterUndefined:
120 case CFI_Parser<A>::kRegisterOffsetFromCFA:122 case CFI_Parser<A>::kRegisterOffsetFromCFA:
121 case CFI_Parser<A>::kRegisterInRegister:123 case CFI_Parser<A>::kRegisterInRegister:
122 // FIX ME124 // FIX ME
...@@ -140,6 +142,7 @@ v128 DwarfInstructions<A, R>::getSavedVectorRegister(...@@ -140,6 +142,7 @@ v128 DwarfInstructions<A, R>::getSavedVectorRegister(
140142
141 case CFI_Parser<A>::kRegisterIsExpression:143 case CFI_Parser<A>::kRegisterIsExpression:
142 case CFI_Parser<A>::kRegisterUnused:144 case CFI_Parser<A>::kRegisterUnused:
145 case CFI_Parser<A>::kRegisterUndefined:
143 case CFI_Parser<A>::kRegisterOffsetFromCFA:146 case CFI_Parser<A>::kRegisterOffsetFromCFA:
144 case CFI_Parser<A>::kRegisterInRegister:147 case CFI_Parser<A>::kRegisterInRegister:
145 // FIX ME148 // FIX ME
...@@ -190,6 +193,10 @@ int DwarfInstructions<A, R>::stepWithDwarf(A &addressSpace, pint_t pc,...@@ -190,6 +193,10 @@ int DwarfInstructions<A, R>::stepWithDwarf(A &addressSpace, pint_t pc,
190 prolog.savedRegisters[i]));193 prolog.savedRegisters[i]));
191 else194 else
192 return UNW_EBADREG;195 return UNW_EBADREG;
196 } else if (i == (int)cieInfo.returnAddressRegister) {
197 // Leaf function keeps the return address in register and there is no
198 // explicit intructions how to restore it.
199 returnAddress = registers.getRegister(cieInfo.returnAddressRegister);
193 }200 }
194 }201 }
195202
lib/libunwind/src/DwarfParser.hpp+407-404
...@@ -69,6 +69,7 @@ public:...@@ -69,6 +69,7 @@ public:
69 };69 };
70 enum RegisterSavedWhere {70 enum RegisterSavedWhere {
71 kRegisterUnused,71 kRegisterUnused,
72 kRegisterUndefined,
72 kRegisterInCFA,73 kRegisterInCFA,
73 kRegisterOffsetFromCFA,74 kRegisterOffsetFromCFA,
74 kRegisterInRegister,75 kRegisterInRegister,
...@@ -87,9 +88,6 @@ public:...@@ -87,9 +88,6 @@ public:
87 int32_t cfaRegisterOffset; // CFA = (cfaRegister)+cfaRegisterOffset88 int32_t cfaRegisterOffset; // CFA = (cfaRegister)+cfaRegisterOffset
88 int64_t cfaExpression; // CFA = expression89 int64_t cfaExpression; // CFA = expression
89 uint32_t spExtraArgSize;90 uint32_t spExtraArgSize;
90 uint32_t codeOffsetAtStackDecrement;
91 bool registersInOtherRegisters;
92 bool sameValueUsed;
93 RegisterLocation savedRegisters[kMaxRegisterNumber + 1];91 RegisterLocation savedRegisters[kMaxRegisterNumber + 1];
94 enum class InitializeTime { kLazy, kNormal };92 enum class InitializeTime { kLazy, kNormal };
9593
...@@ -134,8 +132,26 @@ public:...@@ -134,8 +132,26 @@ public:
134 PrologInfo info;132 PrologInfo info;
135 };133 };
136134
135 struct RememberStack {
136 PrologInfoStackEntry *entry;
137 RememberStack() : entry(nullptr) {}
138 ~RememberStack() {
139#if defined(_LIBUNWIND_REMEMBER_CLEANUP_NEEDED)
140 // Clean up rememberStack. Even in the case where every
141 // DW_CFA_remember_state is paired with a DW_CFA_restore_state,
142 // parseInstructions can skip restore opcodes if it reaches the target PC
143 // and stops interpreting, so we have to make sure we don't leak memory.
144 while (entry) {
145 PrologInfoStackEntry *next = entry->next;
146 _LIBUNWIND_REMEMBER_FREE(entry);
147 entry = next;
148 }
149#endif
150 }
151 };
152
137 static bool findFDE(A &addressSpace, pint_t pc, pint_t ehSectionStart,153 static bool findFDE(A &addressSpace, pint_t pc, pint_t ehSectionStart,
138 uint32_t sectionLength, pint_t fdeHint, FDE_Info *fdeInfo,154 uintptr_t sectionLength, pint_t fdeHint, FDE_Info *fdeInfo,
139 CIE_Info *cieInfo);155 CIE_Info *cieInfo);
140 static const char *decodeFDE(A &addressSpace, pint_t fdeStart,156 static const char *decodeFDE(A &addressSpace, pint_t fdeStart,
141 FDE_Info *fdeInfo, CIE_Info *cieInfo);157 FDE_Info *fdeInfo, CIE_Info *cieInfo);
...@@ -144,13 +160,6 @@ public:...@@ -144,13 +160,6 @@ public:
144 int arch, PrologInfo *results);160 int arch, PrologInfo *results);
145161
146 static const char *parseCIE(A &addressSpace, pint_t cie, CIE_Info *cieInfo);162 static const char *parseCIE(A &addressSpace, pint_t cie, CIE_Info *cieInfo);
147
148private:
149 static bool parseInstructions(A &addressSpace, pint_t instructions,
150 pint_t instructionsEnd, const CIE_Info &cieInfo,
151 pint_t pcoffset,
152 PrologInfoStackEntry *&rememberStack, int arch,
153 PrologInfo *results);
154};163};
155164
156/// Parse a FDE into a CIE_Info and an FDE_Info165/// Parse a FDE into a CIE_Info and an FDE_Info
...@@ -166,7 +175,7 @@ const char *CFI_Parser<A>::decodeFDE(A &addressSpace, pint_t fdeStart,...@@ -166,7 +175,7 @@ const char *CFI_Parser<A>::decodeFDE(A &addressSpace, pint_t fdeStart,
166 p += 8;175 p += 8;
167 }176 }
168 if (cfiLength == 0)177 if (cfiLength == 0)
169 return "FDE has zero length"; // end marker178 return "FDE has zero length"; // zero terminator
170 uint32_t ciePointer = addressSpace.get32(p);179 uint32_t ciePointer = addressSpace.get32(p);
171 if (ciePointer == 0)180 if (ciePointer == 0)
172 return "FDE is really a CIE"; // this is a CIE not an FDE181 return "FDE is really a CIE"; // this is a CIE not an FDE
...@@ -211,11 +220,13 @@ const char *CFI_Parser<A>::decodeFDE(A &addressSpace, pint_t fdeStart,...@@ -211,11 +220,13 @@ const char *CFI_Parser<A>::decodeFDE(A &addressSpace, pint_t fdeStart,
211/// Scan an eh_frame section to find an FDE for a pc220/// Scan an eh_frame section to find an FDE for a pc
212template <typename A>221template <typename A>
213bool CFI_Parser<A>::findFDE(A &addressSpace, pint_t pc, pint_t ehSectionStart,222bool CFI_Parser<A>::findFDE(A &addressSpace, pint_t pc, pint_t ehSectionStart,
214 uint32_t sectionLength, pint_t fdeHint,223 uintptr_t sectionLength, pint_t fdeHint,
215 FDE_Info *fdeInfo, CIE_Info *cieInfo) {224 FDE_Info *fdeInfo, CIE_Info *cieInfo) {
216 //fprintf(stderr, "findFDE(0x%llX)\n", (long long)pc);225 //fprintf(stderr, "findFDE(0x%llX)\n", (long long)pc);
217 pint_t p = (fdeHint != 0) ? fdeHint : ehSectionStart;226 pint_t p = (fdeHint != 0) ? fdeHint : ehSectionStart;
218 const pint_t ehSectionEnd = p + sectionLength;227 const pint_t ehSectionEnd = (sectionLength == UINTPTR_MAX)
228 ? static_cast<pint_t>(-1)
229 : (ehSectionStart + sectionLength);
219 while (p < ehSectionEnd) {230 while (p < ehSectionEnd) {
220 pint_t currentCFI = p;231 pint_t currentCFI = p;
221 //fprintf(stderr, "findFDE() CFI at 0x%llX\n", (long long)p);232 //fprintf(stderr, "findFDE() CFI at 0x%llX\n", (long long)p);
...@@ -227,7 +238,7 @@ bool CFI_Parser<A>::findFDE(A &addressSpace, pint_t pc, pint_t ehSectionStart,...@@ -227,7 +238,7 @@ bool CFI_Parser<A>::findFDE(A &addressSpace, pint_t pc, pint_t ehSectionStart,
227 p += 8;238 p += 8;
228 }239 }
229 if (cfiLength == 0)240 if (cfiLength == 0)
230 return false; // end marker241 return false; // zero terminator
231 uint32_t id = addressSpace.get32(p);242 uint32_t id = addressSpace.get32(p);
232 if (id == 0) {243 if (id == 0) {
233 // Skip over CIEs.244 // Skip over CIEs.
...@@ -336,7 +347,8 @@ const char *CFI_Parser<A>::parseCIE(A &addressSpace, pint_t cie,...@@ -336,7 +347,8 @@ const char *CFI_Parser<A>::parseCIE(A &addressSpace, pint_t cie,
336 // parse data alignment factor347 // parse data alignment factor
337 cieInfo->dataAlignFactor = (int)addressSpace.getSLEB128(p, cieContentEnd);348 cieInfo->dataAlignFactor = (int)addressSpace.getSLEB128(p, cieContentEnd);
338 // parse return address register349 // parse return address register
339 uint64_t raReg = addressSpace.getULEB128(p, cieContentEnd);350 uint64_t raReg = (version == 1) ? addressSpace.get8(p++)
351 : addressSpace.getULEB128(p, cieContentEnd);
340 assert(raReg < 255 && "return address register too large");352 assert(raReg < 255 && "return address register too large");
341 cieInfo->returnAddressRegister = (uint8_t)raReg;353 cieInfo->returnAddressRegister = (uint8_t)raReg;
342 // parse augmentation data based on augmentation string354 // parse augmentation data based on augmentation string
...@@ -390,418 +402,409 @@ bool CFI_Parser<A>::parseFDEInstructions(A &addressSpace,...@@ -390,418 +402,409 @@ bool CFI_Parser<A>::parseFDEInstructions(A &addressSpace,
390 const FDE_Info &fdeInfo,402 const FDE_Info &fdeInfo,
391 const CIE_Info &cieInfo, pint_t upToPC,403 const CIE_Info &cieInfo, pint_t upToPC,
392 int arch, PrologInfo *results) {404 int arch, PrologInfo *results) {
393 PrologInfoStackEntry *rememberStack = NULL;405 // Alloca is used for the allocation of the rememberStack entries. It removes
394406 // the dependency on new/malloc but the below for loop can not be refactored
395 // parse CIE then FDE instructions407 // into functions. Entry could be saved during the processing of a CIE and
396 bool returnValue =408 // restored by an FDE.
397 parseInstructions(addressSpace, cieInfo.cieInstructions,409 RememberStack rememberStack;
398 cieInfo.cieStart + cieInfo.cieLength, cieInfo,410
399 (pint_t)(-1), rememberStack, arch, results) &&411 struct ParseInfo {
400 parseInstructions(addressSpace, fdeInfo.fdeInstructions,412 pint_t instructions;
401 fdeInfo.fdeStart + fdeInfo.fdeLength, cieInfo,413 pint_t instructionsEnd;
402 upToPC - fdeInfo.pcStart, rememberStack, arch, results);414 pint_t pcoffset;
403415 };
404#if !defined(_LIBUNWIND_NO_HEAP)
405 // Clean up rememberStack. Even in the case where every DW_CFA_remember_state
406 // is paired with a DW_CFA_restore_state, parseInstructions can skip restore
407 // opcodes if it reaches the target PC and stops interpreting, so we have to
408 // make sure we don't leak memory.
409 while (rememberStack) {
410 PrologInfoStackEntry *next = rememberStack->next;
411 free(rememberStack);
412 rememberStack = next;
413 }
414#endif
415
416 return returnValue;
417}
418416
419/// "run" the DWARF instructions417 ParseInfo parseInfoArray[] = {
420template <typename A>418 {cieInfo.cieInstructions, cieInfo.cieStart + cieInfo.cieLength,
421bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,419 (pint_t)(-1)},
422 pint_t instructionsEnd,420 {fdeInfo.fdeInstructions, fdeInfo.fdeStart + fdeInfo.fdeLength,
423 const CIE_Info &cieInfo, pint_t pcoffset,421 upToPC - fdeInfo.pcStart}};
424 PrologInfoStackEntry *&rememberStack,422
425 int arch, PrologInfo *results) {423 for (const auto &info : parseInfoArray) {
426 pint_t p = instructions;424 pint_t p = info.instructions;
427 pint_t codeOffset = 0;425 pint_t instructionsEnd = info.instructionsEnd;
428 // initialState initialized as registers in results are modified. Use426 pint_t pcoffset = info.pcoffset;
429 // PrologInfo accessor functions to avoid reading uninitialized data.427 pint_t codeOffset = 0;
430 PrologInfo initialState(PrologInfo::InitializeTime::kLazy);428
431429 // initialState initialized as registers in results are modified. Use
432 _LIBUNWIND_TRACE_DWARF("parseInstructions(instructions=0x%0" PRIx64 ")\n",430 // PrologInfo accessor functions to avoid reading uninitialized data.
433 static_cast<uint64_t>(instructionsEnd));431 PrologInfo initialState(PrologInfo::InitializeTime::kLazy);
434432
435 // see DWARF Spec, section 6.4.2 for details on unwind opcodes433 _LIBUNWIND_TRACE_DWARF("parseFDEInstructions(instructions=0x%0" PRIx64
436 while ((p < instructionsEnd) && (codeOffset < pcoffset)) {434 ")\n",
437 uint64_t reg;435 static_cast<uint64_t>(instructionsEnd));
438 uint64_t reg2;436
439 int64_t offset;437 // see DWARF Spec, section 6.4.2 for details on unwind opcodes
440 uint64_t length;438 while ((p < instructionsEnd) && (codeOffset < pcoffset)) {
441 uint8_t opcode = addressSpace.get8(p);439 uint64_t reg;
442 uint8_t operand;440 uint64_t reg2;
443#if !defined(_LIBUNWIND_NO_HEAP)441 int64_t offset;
444 PrologInfoStackEntry *entry;442 uint64_t length;
445#endif443 uint8_t opcode = addressSpace.get8(p);
446 ++p;444 uint8_t operand;
447 switch (opcode) {445
448 case DW_CFA_nop:446 ++p;
449 _LIBUNWIND_TRACE_DWARF("DW_CFA_nop\n");447 switch (opcode) {
450 break;448 case DW_CFA_nop:
451 case DW_CFA_set_loc:449 _LIBUNWIND_TRACE_DWARF("DW_CFA_nop\n");
452 codeOffset =450 break;
453 addressSpace.getEncodedP(p, instructionsEnd, cieInfo.pointerEncoding);451 case DW_CFA_set_loc:
454 _LIBUNWIND_TRACE_DWARF("DW_CFA_set_loc\n");452 codeOffset = addressSpace.getEncodedP(p, instructionsEnd,
455 break;453 cieInfo.pointerEncoding);
456 case DW_CFA_advance_loc1:454 _LIBUNWIND_TRACE_DWARF("DW_CFA_set_loc\n");
457 codeOffset += (addressSpace.get8(p) * cieInfo.codeAlignFactor);455 break;
458 p += 1;456 case DW_CFA_advance_loc1:
459 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc1: new offset=%" PRIu64 "\n",457 codeOffset += (addressSpace.get8(p) * cieInfo.codeAlignFactor);
460 static_cast<uint64_t>(codeOffset));458 p += 1;
461 break;459 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc1: new offset=%" PRIu64 "\n",
462 case DW_CFA_advance_loc2:460 static_cast<uint64_t>(codeOffset));
463 codeOffset += (addressSpace.get16(p) * cieInfo.codeAlignFactor);461 break;
464 p += 2;462 case DW_CFA_advance_loc2:
465 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc2: new offset=%" PRIu64 "\n",463 codeOffset += (addressSpace.get16(p) * cieInfo.codeAlignFactor);
466 static_cast<uint64_t>(codeOffset));464 p += 2;
467 break;465 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc2: new offset=%" PRIu64 "\n",
468 case DW_CFA_advance_loc4:466 static_cast<uint64_t>(codeOffset));
469 codeOffset += (addressSpace.get32(p) * cieInfo.codeAlignFactor);467 break;
470 p += 4;468 case DW_CFA_advance_loc4:
471 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc4: new offset=%" PRIu64 "\n",469 codeOffset += (addressSpace.get32(p) * cieInfo.codeAlignFactor);
472 static_cast<uint64_t>(codeOffset));470 p += 4;
473 break;471 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc4: new offset=%" PRIu64 "\n",
474 case DW_CFA_offset_extended:472 static_cast<uint64_t>(codeOffset));
475 reg = addressSpace.getULEB128(p, instructionsEnd);473 break;
476 offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd)474 case DW_CFA_offset_extended:
477 * cieInfo.dataAlignFactor;475 reg = addressSpace.getULEB128(p, instructionsEnd);
478 if (reg > kMaxRegisterNumber) {476 offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd) *
479 _LIBUNWIND_LOG0(477 cieInfo.dataAlignFactor;
480 "malformed DW_CFA_offset_extended DWARF unwind, reg too big");478 if (reg > kMaxRegisterNumber) {
481 return false;479 _LIBUNWIND_LOG0(
482 }480 "malformed DW_CFA_offset_extended DWARF unwind, reg too big");
483 results->setRegister(reg, kRegisterInCFA, offset, initialState);481 return false;
484 _LIBUNWIND_TRACE_DWARF("DW_CFA_offset_extended(reg=%" PRIu64 ", "482 }
485 "offset=%" PRId64 ")\n",483 results->setRegister(reg, kRegisterInCFA, offset, initialState);
486 reg, offset);484 _LIBUNWIND_TRACE_DWARF("DW_CFA_offset_extended(reg=%" PRIu64 ", "
487 break;485 "offset=%" PRId64 ")\n",
488 case DW_CFA_restore_extended:486 reg, offset);
489 reg = addressSpace.getULEB128(p, instructionsEnd);487 break;
490 if (reg > kMaxRegisterNumber) {488 case DW_CFA_restore_extended:
491 _LIBUNWIND_LOG0(489 reg = addressSpace.getULEB128(p, instructionsEnd);
492 "malformed DW_CFA_restore_extended DWARF unwind, reg too big");490 if (reg > kMaxRegisterNumber) {
493 return false;491 _LIBUNWIND_LOG0(
494 }492 "malformed DW_CFA_restore_extended DWARF unwind, reg too big");
495 results->restoreRegisterToInitialState(reg, initialState);493 return false;
496 _LIBUNWIND_TRACE_DWARF("DW_CFA_restore_extended(reg=%" PRIu64 ")\n", reg);494 }
497 break;495 results->restoreRegisterToInitialState(reg, initialState);
498 case DW_CFA_undefined:496 _LIBUNWIND_TRACE_DWARF("DW_CFA_restore_extended(reg=%" PRIu64 ")\n",
499 reg = addressSpace.getULEB128(p, instructionsEnd);497 reg);
500 if (reg > kMaxRegisterNumber) {498 break;
501 _LIBUNWIND_LOG0(499 case DW_CFA_undefined:
502 "malformed DW_CFA_undefined DWARF unwind, reg too big");500 reg = addressSpace.getULEB128(p, instructionsEnd);
503 return false;501 if (reg > kMaxRegisterNumber) {
504 }502 _LIBUNWIND_LOG0(
505 results->setRegisterLocation(reg, kRegisterUnused, initialState);503 "malformed DW_CFA_undefined DWARF unwind, reg too big");
506 _LIBUNWIND_TRACE_DWARF("DW_CFA_undefined(reg=%" PRIu64 ")\n", reg);504 return false;
507 break;505 }
508 case DW_CFA_same_value:506 results->setRegisterLocation(reg, kRegisterUndefined, initialState);
509 reg = addressSpace.getULEB128(p, instructionsEnd);507 _LIBUNWIND_TRACE_DWARF("DW_CFA_undefined(reg=%" PRIu64 ")\n", reg);
510 if (reg > kMaxRegisterNumber) {508 break;
511 _LIBUNWIND_LOG0(509 case DW_CFA_same_value:
512 "malformed DW_CFA_same_value DWARF unwind, reg too big");510 reg = addressSpace.getULEB128(p, instructionsEnd);
513 return false;511 if (reg > kMaxRegisterNumber) {
514 }512 _LIBUNWIND_LOG0(
515 // <rdar://problem/8456377> DW_CFA_same_value unsupported513 "malformed DW_CFA_same_value DWARF unwind, reg too big");
516 // "same value" means register was stored in frame, but its current514 return false;
517 // value has not changed, so no need to restore from frame.515 }
518 // We model this as if the register was never saved.516 // <rdar://problem/8456377> DW_CFA_same_value unsupported
519 results->setRegisterLocation(reg, kRegisterUnused, initialState);517 // "same value" means register was stored in frame, but its current
520 // set flag to disable conversion to compact unwind518 // value has not changed, so no need to restore from frame.
521 results->sameValueUsed = true;519 // We model this as if the register was never saved.
522 _LIBUNWIND_TRACE_DWARF("DW_CFA_same_value(reg=%" PRIu64 ")\n", reg);520 results->setRegisterLocation(reg, kRegisterUnused, initialState);
523 break;521 _LIBUNWIND_TRACE_DWARF("DW_CFA_same_value(reg=%" PRIu64 ")\n", reg);
524 case DW_CFA_register:522 break;
525 reg = addressSpace.getULEB128(p, instructionsEnd);523 case DW_CFA_register:
526 reg2 = addressSpace.getULEB128(p, instructionsEnd);524 reg = addressSpace.getULEB128(p, instructionsEnd);
527 if (reg > kMaxRegisterNumber) {525 reg2 = addressSpace.getULEB128(p, instructionsEnd);
528 _LIBUNWIND_LOG0(526 if (reg > kMaxRegisterNumber) {
529 "malformed DW_CFA_register DWARF unwind, reg too big");527 _LIBUNWIND_LOG0(
530 return false;528 "malformed DW_CFA_register DWARF unwind, reg too big");
531 }529 return false;
532 if (reg2 > kMaxRegisterNumber) {530 }
533 _LIBUNWIND_LOG0(531 if (reg2 > kMaxRegisterNumber) {
534 "malformed DW_CFA_register DWARF unwind, reg2 too big");532 _LIBUNWIND_LOG0(
535 return false;533 "malformed DW_CFA_register DWARF unwind, reg2 too big");
536 }534 return false;
537 results->setRegister(reg, kRegisterInRegister, (int64_t)reg2,535 }
538 initialState);536 results->setRegister(reg, kRegisterInRegister, (int64_t)reg2,
539 // set flag to disable conversion to compact unwind537 initialState);
540 results->registersInOtherRegisters = true;538 _LIBUNWIND_TRACE_DWARF(
541 _LIBUNWIND_TRACE_DWARF(539 "DW_CFA_register(reg=%" PRIu64 ", reg2=%" PRIu64 ")\n", reg, reg2);
542 "DW_CFA_register(reg=%" PRIu64 ", reg2=%" PRIu64 ")\n", reg, reg2);540 break;
543 break;541 case DW_CFA_remember_state: {
544#if !defined(_LIBUNWIND_NO_HEAP)542 // Avoid operator new because that would be an upward dependency.
545 case DW_CFA_remember_state:543 // Avoid malloc because it needs heap allocation.
546 // avoid operator new, because that would be an upward dependency544 PrologInfoStackEntry *entry =
547 entry = (PrologInfoStackEntry *)malloc(sizeof(PrologInfoStackEntry));545 (PrologInfoStackEntry *)_LIBUNWIND_REMEMBER_ALLOC(
548 if (entry != NULL) {546 sizeof(PrologInfoStackEntry));
549 entry->next = rememberStack;547 if (entry != NULL) {
550 entry->info = *results;548 entry->next = rememberStack.entry;
551 rememberStack = entry;549 entry->info = *results;
552 } else {550 rememberStack.entry = entry;
553 return false;551 } else {
554 }552 return false;
555 _LIBUNWIND_TRACE_DWARF("DW_CFA_remember_state\n");553 }
556 break;554 _LIBUNWIND_TRACE_DWARF("DW_CFA_remember_state\n");
557 case DW_CFA_restore_state:555 break;
558 if (rememberStack != NULL) {
559 PrologInfoStackEntry *top = rememberStack;
560 *results = top->info;
561 rememberStack = top->next;
562 free((char *)top);
563 } else {
564 return false;
565 }
566 _LIBUNWIND_TRACE_DWARF("DW_CFA_restore_state\n");
567 break;
568#endif
569 case DW_CFA_def_cfa:
570 reg = addressSpace.getULEB128(p, instructionsEnd);
571 offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd);
572 if (reg > kMaxRegisterNumber) {
573 _LIBUNWIND_LOG0("malformed DW_CFA_def_cfa DWARF unwind, reg too big");
574 return false;
575 }
576 results->cfaRegister = (uint32_t)reg;
577 results->cfaRegisterOffset = (int32_t)offset;
578 _LIBUNWIND_TRACE_DWARF(
579 "DW_CFA_def_cfa(reg=%" PRIu64 ", offset=%" PRIu64 ")\n", reg, offset);
580 break;
581 case DW_CFA_def_cfa_register:
582 reg = addressSpace.getULEB128(p, instructionsEnd);
583 if (reg > kMaxRegisterNumber) {
584 _LIBUNWIND_LOG0(
585 "malformed DW_CFA_def_cfa_register DWARF unwind, reg too big");
586 return false;
587 }
588 results->cfaRegister = (uint32_t)reg;
589 _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_register(%" PRIu64 ")\n", reg);
590 break;
591 case DW_CFA_def_cfa_offset:
592 results->cfaRegisterOffset = (int32_t)
593 addressSpace.getULEB128(p, instructionsEnd);
594 results->codeOffsetAtStackDecrement = (uint32_t)codeOffset;
595 _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_offset(%d)\n",
596 results->cfaRegisterOffset);
597 break;
598 case DW_CFA_def_cfa_expression:
599 results->cfaRegister = 0;
600 results->cfaExpression = (int64_t)p;
601 length = addressSpace.getULEB128(p, instructionsEnd);
602 assert(length < static_cast<pint_t>(~0) && "pointer overflow");
603 p += static_cast<pint_t>(length);
604 _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_expression(expression=0x%" PRIx64
605 ", length=%" PRIu64 ")\n",
606 results->cfaExpression, length);
607 break;
608 case DW_CFA_expression:
609 reg = addressSpace.getULEB128(p, instructionsEnd);
610 if (reg > kMaxRegisterNumber) {
611 _LIBUNWIND_LOG0(
612 "malformed DW_CFA_expression DWARF unwind, reg too big");
613 return false;
614 }
615 results->setRegister(reg, kRegisterAtExpression, (int64_t)p,
616 initialState);
617 length = addressSpace.getULEB128(p, instructionsEnd);
618 assert(length < static_cast<pint_t>(~0) && "pointer overflow");
619 p += static_cast<pint_t>(length);
620 _LIBUNWIND_TRACE_DWARF("DW_CFA_expression(reg=%" PRIu64 ", "
621 "expression=0x%" PRIx64 ", "
622 "length=%" PRIu64 ")\n",
623 reg, results->savedRegisters[reg].value, length);
624 break;
625 case DW_CFA_offset_extended_sf:
626 reg = addressSpace.getULEB128(p, instructionsEnd);
627 if (reg > kMaxRegisterNumber) {
628 _LIBUNWIND_LOG0(
629 "malformed DW_CFA_offset_extended_sf DWARF unwind, reg too big");
630 return false;
631 }
632 offset =
633 addressSpace.getSLEB128(p, instructionsEnd) * cieInfo.dataAlignFactor;
634 results->setRegister(reg, kRegisterInCFA, offset, initialState);
635 _LIBUNWIND_TRACE_DWARF("DW_CFA_offset_extended_sf(reg=%" PRIu64 ", "
636 "offset=%" PRId64 ")\n",
637 reg, offset);
638 break;
639 case DW_CFA_def_cfa_sf:
640 reg = addressSpace.getULEB128(p, instructionsEnd);
641 offset =
642 addressSpace.getSLEB128(p, instructionsEnd) * cieInfo.dataAlignFactor;
643 if (reg > kMaxRegisterNumber) {
644 _LIBUNWIND_LOG0(
645 "malformed DW_CFA_def_cfa_sf DWARF unwind, reg too big");
646 return false;
647 }
648 results->cfaRegister = (uint32_t)reg;
649 results->cfaRegisterOffset = (int32_t)offset;
650 _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_sf(reg=%" PRIu64 ", "
651 "offset=%" PRId64 ")\n",
652 reg, offset);
653 break;
654 case DW_CFA_def_cfa_offset_sf:
655 results->cfaRegisterOffset = (int32_t)
656 (addressSpace.getSLEB128(p, instructionsEnd) * cieInfo.dataAlignFactor);
657 results->codeOffsetAtStackDecrement = (uint32_t)codeOffset;
658 _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_offset_sf(%d)\n",
659 results->cfaRegisterOffset);
660 break;
661 case DW_CFA_val_offset:
662 reg = addressSpace.getULEB128(p, instructionsEnd);
663 if (reg > kMaxRegisterNumber) {
664 _LIBUNWIND_LOG(
665 "malformed DW_CFA_val_offset DWARF unwind, reg (%" PRIu64
666 ") out of range\n",
667 reg);
668 return false;
669 }
670 offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd)
671 * cieInfo.dataAlignFactor;
672 results->setRegister(reg, kRegisterOffsetFromCFA, offset, initialState);
673 _LIBUNWIND_TRACE_DWARF("DW_CFA_val_offset(reg=%" PRIu64 ", "
674 "offset=%" PRId64 "\n",
675 reg, offset);
676 break;
677 case DW_CFA_val_offset_sf:
678 reg = addressSpace.getULEB128(p, instructionsEnd);
679 if (reg > kMaxRegisterNumber) {
680 _LIBUNWIND_LOG0(
681 "malformed DW_CFA_val_offset_sf DWARF unwind, reg too big");
682 return false;
683 }
684 offset =
685 addressSpace.getSLEB128(p, instructionsEnd) * cieInfo.dataAlignFactor;
686 results->setRegister(reg, kRegisterOffsetFromCFA, offset, initialState);
687 _LIBUNWIND_TRACE_DWARF("DW_CFA_val_offset_sf(reg=%" PRIu64 ", "
688 "offset=%" PRId64 "\n",
689 reg, offset);
690 break;
691 case DW_CFA_val_expression:
692 reg = addressSpace.getULEB128(p, instructionsEnd);
693 if (reg > kMaxRegisterNumber) {
694 _LIBUNWIND_LOG0(
695 "malformed DW_CFA_val_expression DWARF unwind, reg too big");
696 return false;
697 }
698 results->setRegister(reg, kRegisterIsExpression, (int64_t)p,
699 initialState);
700 length = addressSpace.getULEB128(p, instructionsEnd);
701 assert(length < static_cast<pint_t>(~0) && "pointer overflow");
702 p += static_cast<pint_t>(length);
703 _LIBUNWIND_TRACE_DWARF("DW_CFA_val_expression(reg=%" PRIu64 ", "
704 "expression=0x%" PRIx64 ", length=%" PRIu64 ")\n",
705 reg, results->savedRegisters[reg].value, length);
706 break;
707 case DW_CFA_GNU_args_size:
708 length = addressSpace.getULEB128(p, instructionsEnd);
709 results->spExtraArgSize = (uint32_t)length;
710 _LIBUNWIND_TRACE_DWARF("DW_CFA_GNU_args_size(%" PRIu64 ")\n", length);
711 break;
712 case DW_CFA_GNU_negative_offset_extended:
713 reg = addressSpace.getULEB128(p, instructionsEnd);
714 if (reg > kMaxRegisterNumber) {
715 _LIBUNWIND_LOG0("malformed DW_CFA_GNU_negative_offset_extended DWARF "
716 "unwind, reg too big");
717 return false;
718 }556 }
719 offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd)557 case DW_CFA_restore_state:
720 * cieInfo.dataAlignFactor;558 if (rememberStack.entry != NULL) {
721 results->setRegister(reg, kRegisterInCFA, -offset, initialState);559 PrologInfoStackEntry *top = rememberStack.entry;
722 _LIBUNWIND_TRACE_DWARF(560 *results = top->info;
723 "DW_CFA_GNU_negative_offset_extended(%" PRId64 ")\n", offset);561 rememberStack.entry = top->next;
724 break;562 _LIBUNWIND_REMEMBER_FREE(top);
563 } else {
564 return false;
565 }
566 _LIBUNWIND_TRACE_DWARF("DW_CFA_restore_state\n");
567 break;
568 case DW_CFA_def_cfa:
569 reg = addressSpace.getULEB128(p, instructionsEnd);
570 offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd);
571 if (reg > kMaxRegisterNumber) {
572 _LIBUNWIND_LOG0("malformed DW_CFA_def_cfa DWARF unwind, reg too big");
573 return false;
574 }
575 results->cfaRegister = (uint32_t)reg;
576 results->cfaRegisterOffset = (int32_t)offset;
577 _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa(reg=%" PRIu64 ", offset=%" PRIu64
578 ")\n",
579 reg, offset);
580 break;
581 case DW_CFA_def_cfa_register:
582 reg = addressSpace.getULEB128(p, instructionsEnd);
583 if (reg > kMaxRegisterNumber) {
584 _LIBUNWIND_LOG0(
585 "malformed DW_CFA_def_cfa_register DWARF unwind, reg too big");
586 return false;
587 }
588 results->cfaRegister = (uint32_t)reg;
589 _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_register(%" PRIu64 ")\n", reg);
590 break;
591 case DW_CFA_def_cfa_offset:
592 results->cfaRegisterOffset =
593 (int32_t)addressSpace.getULEB128(p, instructionsEnd);
594 _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_offset(%d)\n",
595 results->cfaRegisterOffset);
596 break;
597 case DW_CFA_def_cfa_expression:
598 results->cfaRegister = 0;
599 results->cfaExpression = (int64_t)p;
600 length = addressSpace.getULEB128(p, instructionsEnd);
601 assert(length < static_cast<pint_t>(~0) && "pointer overflow");
602 p += static_cast<pint_t>(length);
603 _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_expression(expression=0x%" PRIx64
604 ", length=%" PRIu64 ")\n",
605 results->cfaExpression, length);
606 break;
607 case DW_CFA_expression:
608 reg = addressSpace.getULEB128(p, instructionsEnd);
609 if (reg > kMaxRegisterNumber) {
610 _LIBUNWIND_LOG0(
611 "malformed DW_CFA_expression DWARF unwind, reg too big");
612 return false;
613 }
614 results->setRegister(reg, kRegisterAtExpression, (int64_t)p,
615 initialState);
616 length = addressSpace.getULEB128(p, instructionsEnd);
617 assert(length < static_cast<pint_t>(~0) && "pointer overflow");
618 p += static_cast<pint_t>(length);
619 _LIBUNWIND_TRACE_DWARF("DW_CFA_expression(reg=%" PRIu64 ", "
620 "expression=0x%" PRIx64 ", "
621 "length=%" PRIu64 ")\n",
622 reg, results->savedRegisters[reg].value, length);
623 break;
624 case DW_CFA_offset_extended_sf:
625 reg = addressSpace.getULEB128(p, instructionsEnd);
626 if (reg > kMaxRegisterNumber) {
627 _LIBUNWIND_LOG0(
628 "malformed DW_CFA_offset_extended_sf DWARF unwind, reg too big");
629 return false;
630 }
631 offset = addressSpace.getSLEB128(p, instructionsEnd) *
632 cieInfo.dataAlignFactor;
633 results->setRegister(reg, kRegisterInCFA, offset, initialState);
634 _LIBUNWIND_TRACE_DWARF("DW_CFA_offset_extended_sf(reg=%" PRIu64 ", "
635 "offset=%" PRId64 ")\n",
636 reg, offset);
637 break;
638 case DW_CFA_def_cfa_sf:
639 reg = addressSpace.getULEB128(p, instructionsEnd);
640 offset = addressSpace.getSLEB128(p, instructionsEnd) *
641 cieInfo.dataAlignFactor;
642 if (reg > kMaxRegisterNumber) {
643 _LIBUNWIND_LOG0(
644 "malformed DW_CFA_def_cfa_sf DWARF unwind, reg too big");
645 return false;
646 }
647 results->cfaRegister = (uint32_t)reg;
648 results->cfaRegisterOffset = (int32_t)offset;
649 _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_sf(reg=%" PRIu64 ", "
650 "offset=%" PRId64 ")\n",
651 reg, offset);
652 break;
653 case DW_CFA_def_cfa_offset_sf:
654 results->cfaRegisterOffset =
655 (int32_t)(addressSpace.getSLEB128(p, instructionsEnd) *
656 cieInfo.dataAlignFactor);
657 _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_offset_sf(%d)\n",
658 results->cfaRegisterOffset);
659 break;
660 case DW_CFA_val_offset:
661 reg = addressSpace.getULEB128(p, instructionsEnd);
662 if (reg > kMaxRegisterNumber) {
663 _LIBUNWIND_LOG(
664 "malformed DW_CFA_val_offset DWARF unwind, reg (%" PRIu64
665 ") out of range\n",
666 reg);
667 return false;
668 }
669 offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd) *
670 cieInfo.dataAlignFactor;
671 results->setRegister(reg, kRegisterOffsetFromCFA, offset, initialState);
672 _LIBUNWIND_TRACE_DWARF("DW_CFA_val_offset(reg=%" PRIu64 ", "
673 "offset=%" PRId64 "\n",
674 reg, offset);
675 break;
676 case DW_CFA_val_offset_sf:
677 reg = addressSpace.getULEB128(p, instructionsEnd);
678 if (reg > kMaxRegisterNumber) {
679 _LIBUNWIND_LOG0(
680 "malformed DW_CFA_val_offset_sf DWARF unwind, reg too big");
681 return false;
682 }
683 offset = addressSpace.getSLEB128(p, instructionsEnd) *
684 cieInfo.dataAlignFactor;
685 results->setRegister(reg, kRegisterOffsetFromCFA, offset, initialState);
686 _LIBUNWIND_TRACE_DWARF("DW_CFA_val_offset_sf(reg=%" PRIu64 ", "
687 "offset=%" PRId64 "\n",
688 reg, offset);
689 break;
690 case DW_CFA_val_expression:
691 reg = addressSpace.getULEB128(p, instructionsEnd);
692 if (reg > kMaxRegisterNumber) {
693 _LIBUNWIND_LOG0(
694 "malformed DW_CFA_val_expression DWARF unwind, reg too big");
695 return false;
696 }
697 results->setRegister(reg, kRegisterIsExpression, (int64_t)p,
698 initialState);
699 length = addressSpace.getULEB128(p, instructionsEnd);
700 assert(length < static_cast<pint_t>(~0) && "pointer overflow");
701 p += static_cast<pint_t>(length);
702 _LIBUNWIND_TRACE_DWARF("DW_CFA_val_expression(reg=%" PRIu64 ", "
703 "expression=0x%" PRIx64 ", length=%" PRIu64
704 ")\n",
705 reg, results->savedRegisters[reg].value, length);
706 break;
707 case DW_CFA_GNU_args_size:
708 length = addressSpace.getULEB128(p, instructionsEnd);
709 results->spExtraArgSize = (uint32_t)length;
710 _LIBUNWIND_TRACE_DWARF("DW_CFA_GNU_args_size(%" PRIu64 ")\n", length);
711 break;
712 case DW_CFA_GNU_negative_offset_extended:
713 reg = addressSpace.getULEB128(p, instructionsEnd);
714 if (reg > kMaxRegisterNumber) {
715 _LIBUNWIND_LOG0("malformed DW_CFA_GNU_negative_offset_extended DWARF "
716 "unwind, reg too big");
717 return false;
718 }
719 offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd) *
720 cieInfo.dataAlignFactor;
721 results->setRegister(reg, kRegisterInCFA, -offset, initialState);
722 _LIBUNWIND_TRACE_DWARF(
723 "DW_CFA_GNU_negative_offset_extended(%" PRId64 ")\n", offset);
724 break;
725725
726#if defined(_LIBUNWIND_TARGET_AARCH64) || defined(_LIBUNWIND_TARGET_SPARC)726#if defined(_LIBUNWIND_TARGET_AARCH64) || defined(_LIBUNWIND_TARGET_SPARC)
727 // The same constant is used to represent different instructions on727 // The same constant is used to represent different instructions on
728 // AArch64 (negate_ra_state) and SPARC (window_save).728 // AArch64 (negate_ra_state) and SPARC (window_save).
729 static_assert(DW_CFA_AARCH64_negate_ra_state == DW_CFA_GNU_window_save,729 static_assert(DW_CFA_AARCH64_negate_ra_state == DW_CFA_GNU_window_save,
730 "uses the same constant");730 "uses the same constant");
731 case DW_CFA_AARCH64_negate_ra_state:731 case DW_CFA_AARCH64_negate_ra_state:
732 switch (arch) {732 switch (arch) {
733#if defined(_LIBUNWIND_TARGET_AARCH64)733#if defined(_LIBUNWIND_TARGET_AARCH64)
734 case REGISTERS_ARM64: {734 case REGISTERS_ARM64: {
735 int64_t value =735 int64_t value =
736 results->savedRegisters[UNW_ARM64_RA_SIGN_STATE].value ^ 0x1;736 results->savedRegisters[UNW_ARM64_RA_SIGN_STATE].value ^ 0x1;
737 results->setRegisterValue(UNW_ARM64_RA_SIGN_STATE, value, initialState);737 results->setRegisterValue(UNW_ARM64_RA_SIGN_STATE, value,
738 initialState);
738 _LIBUNWIND_TRACE_DWARF("DW_CFA_AARCH64_negate_ra_state\n");739 _LIBUNWIND_TRACE_DWARF("DW_CFA_AARCH64_negate_ra_state\n");
739 } break;740 } break;
740#endif741#endif
741742
742#if defined(_LIBUNWIND_TARGET_SPARC)743#if defined(_LIBUNWIND_TARGET_SPARC)
743 // case DW_CFA_GNU_window_save:744 // case DW_CFA_GNU_window_save:
744 case REGISTERS_SPARC:745 case REGISTERS_SPARC:
745 _LIBUNWIND_TRACE_DWARF("DW_CFA_GNU_window_save()\n");746 _LIBUNWIND_TRACE_DWARF("DW_CFA_GNU_window_save()\n");
746 for (reg = UNW_SPARC_O0; reg <= UNW_SPARC_O7; reg++) {747 for (reg = UNW_SPARC_O0; reg <= UNW_SPARC_O7; reg++) {
747 results->setRegister(reg, kRegisterInRegister,748 results->setRegister(reg, kRegisterInRegister,
748 ((int64_t)reg - UNW_SPARC_O0) + UNW_SPARC_I0,749 ((int64_t)reg - UNW_SPARC_O0) + UNW_SPARC_I0,
749 initialState);750 initialState);
750 }751 }
751752
752 for (reg = UNW_SPARC_L0; reg <= UNW_SPARC_I7; reg++) {753 for (reg = UNW_SPARC_L0; reg <= UNW_SPARC_I7; reg++) {
753 results->setRegister(reg, kRegisterInCFA,754 results->setRegister(reg, kRegisterInCFA,
754 ((int64_t)reg - UNW_SPARC_L0) * 4, initialState);755 ((int64_t)reg - UNW_SPARC_L0) * 4,
756 initialState);
757 }
758 break;
759#endif
755 }760 }
756 break;761 break;
757#endif
758 }
759 break;
760#else762#else
761 (void)arch;763 (void)arch;
762#endif764#endif
763765
764 default:766 default:
765 operand = opcode & 0x3F;767 operand = opcode & 0x3F;
766 switch (opcode & 0xC0) {768 switch (opcode & 0xC0) {
767 case DW_CFA_offset:769 case DW_CFA_offset:
768 reg = operand;770 reg = operand;
769 if (reg > kMaxRegisterNumber) {771 if (reg > kMaxRegisterNumber) {
770 _LIBUNWIND_LOG("malformed DW_CFA_offset DWARF unwind, reg (%" PRIu64772 _LIBUNWIND_LOG("malformed DW_CFA_offset DWARF unwind, reg (%" PRIu64
771 ") out of range",773 ") out of range",
772 reg);774 reg);
773 return false;775 return false;
774 }776 }
775 offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd)777 offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd) *
776 * cieInfo.dataAlignFactor;778 cieInfo.dataAlignFactor;
777 results->setRegister(reg, kRegisterInCFA, offset, initialState);779 results->setRegister(reg, kRegisterInCFA, offset, initialState);
778 _LIBUNWIND_TRACE_DWARF("DW_CFA_offset(reg=%d, offset=%" PRId64 ")\n",780 _LIBUNWIND_TRACE_DWARF("DW_CFA_offset(reg=%d, offset=%" PRId64 ")\n",
779 operand, offset);781 operand, offset);
780 break;782 break;
781 case DW_CFA_advance_loc:783 case DW_CFA_advance_loc:
782 codeOffset += operand * cieInfo.codeAlignFactor;784 codeOffset += operand * cieInfo.codeAlignFactor;
783 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc: new offset=%" PRIu64 "\n",785 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc: new offset=%" PRIu64 "\n",
784 static_cast<uint64_t>(codeOffset));786 static_cast<uint64_t>(codeOffset));
785 break;787 break;
786 case DW_CFA_restore:788 case DW_CFA_restore:
787 reg = operand;789 reg = operand;
788 if (reg > kMaxRegisterNumber) {790 if (reg > kMaxRegisterNumber) {
789 _LIBUNWIND_LOG("malformed DW_CFA_restore DWARF unwind, reg (%" PRIu64791 _LIBUNWIND_LOG(
790 ") out of range",792 "malformed DW_CFA_restore DWARF unwind, reg (%" PRIu64
791 reg);793 ") out of range",
794 reg);
795 return false;
796 }
797 results->restoreRegisterToInitialState(reg, initialState);
798 _LIBUNWIND_TRACE_DWARF("DW_CFA_restore(reg=%" PRIu64 ")\n",
799 static_cast<uint64_t>(operand));
800 break;
801 default:
802 _LIBUNWIND_TRACE_DWARF("unknown CFA opcode 0x%02X\n", opcode);
792 return false;803 return false;
793 }804 }
794 results->restoreRegisterToInitialState(reg, initialState);
795 _LIBUNWIND_TRACE_DWARF("DW_CFA_restore(reg=%" PRIu64 ")\n",
796 static_cast<uint64_t>(operand));
797 break;
798 default:
799 _LIBUNWIND_TRACE_DWARF("unknown CFA opcode 0x%02X\n", opcode);
800 return false;
801 }805 }
802 }806 }
803 }807 }
804
805 return true;808 return true;
806}809}
807810
lib/libunwind/src/FrameHeaderCache.hpp+1-1
...@@ -32,7 +32,7 @@...@@ -32,7 +32,7 @@
32class _LIBUNWIND_HIDDEN FrameHeaderCache {32class _LIBUNWIND_HIDDEN FrameHeaderCache {
33 struct CacheEntry {33 struct CacheEntry {
34 uintptr_t LowPC() { return Info.dso_base; };34 uintptr_t LowPC() { return Info.dso_base; };
35 uintptr_t HighPC() { return Info.dso_base + Info.dwarf_section_length; };35 uintptr_t HighPC() { return Info.dso_base + Info.text_segment_length; };
36 UnwindInfoSections Info;36 UnwindInfoSections Info;
37 CacheEntry *Next;37 CacheEntry *Next;
38 };38 };
lib/libunwind/src/Registers.hpp+453-5
...@@ -36,9 +36,12 @@ enum {...@@ -36,9 +36,12 @@ enum {
36 REGISTERS_SPARC,36 REGISTERS_SPARC,
37 REGISTERS_HEXAGON,37 REGISTERS_HEXAGON,
38 REGISTERS_RISCV,38 REGISTERS_RISCV,
39 REGISTERS_VE,
39};40};
4041
41#if defined(_LIBUNWIND_TARGET_I386)42#if defined(_LIBUNWIND_TARGET_I386)
43class _LIBUNWIND_HIDDEN Registers_x86;
44extern "C" void __libunwind_Registers_x86_jumpto(Registers_x86 *);
42/// Registers_x86 holds the register state of a thread in a 32-bit intel45/// Registers_x86 holds the register state of a thread in a 32-bit intel
43/// process.46/// process.
44class _LIBUNWIND_HIDDEN Registers_x86 {47class _LIBUNWIND_HIDDEN Registers_x86 {
...@@ -56,7 +59,7 @@ public:...@@ -56,7 +59,7 @@ public:
56 v128 getVectorRegister(int num) const;59 v128 getVectorRegister(int num) const;
57 void setVectorRegister(int num, v128 value);60 void setVectorRegister(int num, v128 value);
58 static const char *getRegisterName(int num);61 static const char *getRegisterName(int num);
59 void jumpto();62 void jumpto() { __libunwind_Registers_x86_jumpto(this); }
60 static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86; }63 static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86; }
61 static int getArch() { return REGISTERS_X86; }64 static int getArch() { return REGISTERS_X86; }
6265
...@@ -248,6 +251,8 @@ inline void Registers_x86::setVectorRegister(int, v128) {...@@ -248,6 +251,8 @@ inline void Registers_x86::setVectorRegister(int, v128) {
248#if defined(_LIBUNWIND_TARGET_X86_64)251#if defined(_LIBUNWIND_TARGET_X86_64)
249/// Registers_x86_64 holds the register state of a thread in a 64-bit intel252/// Registers_x86_64 holds the register state of a thread in a 64-bit intel
250/// process.253/// process.
254class _LIBUNWIND_HIDDEN Registers_x86_64;
255extern "C" void __libunwind_Registers_x86_64_jumpto(Registers_x86_64 *);
251class _LIBUNWIND_HIDDEN Registers_x86_64 {256class _LIBUNWIND_HIDDEN Registers_x86_64 {
252public:257public:
253 Registers_x86_64();258 Registers_x86_64();
...@@ -263,7 +268,7 @@ public:...@@ -263,7 +268,7 @@ public:
263 v128 getVectorRegister(int num) const;268 v128 getVectorRegister(int num) const;
264 void setVectorRegister(int num, v128 value);269 void setVectorRegister(int num, v128 value);
265 static const char *getRegisterName(int num);270 static const char *getRegisterName(int num);
266 void jumpto();271 void jumpto() { __libunwind_Registers_x86_64_jumpto(this); }
267 static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_64; }272 static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_64; }
268 static int getArch() { return REGISTERS_X86_64; }273 static int getArch() { return REGISTERS_X86_64; }
269274
...@@ -1510,12 +1515,12 @@ inline void Registers_ppc64::setFloatRegister(int regNum, double value) {...@@ -1510,12 +1515,12 @@ inline void Registers_ppc64::setFloatRegister(int regNum, double value) {
1510}1515}
15111516
1512inline bool Registers_ppc64::validVectorRegister(int regNum) const {1517inline bool Registers_ppc64::validVectorRegister(int regNum) const {
1513#ifdef PPC64_HAS_VMX1518#if defined(__VSX__)
1514 if (regNum >= UNW_PPC64_VS0 && regNum <= UNW_PPC64_VS31)1519 if (regNum >= UNW_PPC64_VS0 && regNum <= UNW_PPC64_VS31)
1515 return true;1520 return true;
1516 if (regNum >= UNW_PPC64_VS32 && regNum <= UNW_PPC64_VS63)1521 if (regNum >= UNW_PPC64_VS32 && regNum <= UNW_PPC64_VS63)
1517 return true;1522 return true;
1518#else1523#elif defined(__ALTIVEC__)
1519 if (regNum >= UNW_PPC64_V0 && regNum <= UNW_PPC64_V31)1524 if (regNum >= UNW_PPC64_V0 && regNum <= UNW_PPC64_V31)
1520 return true;1525 return true;
1521#endif1526#endif
...@@ -1771,6 +1776,8 @@ inline const char *Registers_ppc64::getRegisterName(int regNum) {...@@ -1771,6 +1776,8 @@ inline const char *Registers_ppc64::getRegisterName(int regNum) {
1771#if defined(_LIBUNWIND_TARGET_AARCH64)1776#if defined(_LIBUNWIND_TARGET_AARCH64)
1772/// Registers_arm64 holds the register state of a thread in a 64-bit arm1777/// Registers_arm64 holds the register state of a thread in a 64-bit arm
1773/// process.1778/// process.
1779class _LIBUNWIND_HIDDEN Registers_arm64;
1780extern "C" void __libunwind_Registers_arm64_jumpto(Registers_arm64 *);
1774class _LIBUNWIND_HIDDEN Registers_arm64 {1781class _LIBUNWIND_HIDDEN Registers_arm64 {
1775public:1782public:
1776 Registers_arm64();1783 Registers_arm64();
...@@ -1786,7 +1793,7 @@ public:...@@ -1786,7 +1793,7 @@ public:
1786 v128 getVectorRegister(int num) const;1793 v128 getVectorRegister(int num) const;
1787 void setVectorRegister(int num, v128 value);1794 void setVectorRegister(int num, v128 value);
1788 static const char *getRegisterName(int num);1795 static const char *getRegisterName(int num);
1789 void jumpto();1796 void jumpto() { __libunwind_Registers_arm64_jumpto(this); }
1790 static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64; }1797 static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64; }
1791 static int getArch() { return REGISTERS_ARM64; }1798 static int getArch() { return REGISTERS_ARM64; }
17921799
...@@ -3977,6 +3984,447 @@ inline void Registers_riscv::setVectorRegister(int, v128) {...@@ -3977,6 +3984,447 @@ inline void Registers_riscv::setVectorRegister(int, v128) {
3977 _LIBUNWIND_ABORT("no riscv vector register support yet");3984 _LIBUNWIND_ABORT("no riscv vector register support yet");
3978}3985}
3979#endif // _LIBUNWIND_TARGET_RISCV3986#endif // _LIBUNWIND_TARGET_RISCV
3987
3988#if defined(_LIBUNWIND_TARGET_VE)
3989/// Registers_ve holds the register state of a thread in a VE process.
3990class _LIBUNWIND_HIDDEN Registers_ve {
3991public:
3992 Registers_ve();
3993 Registers_ve(const void *registers);
3994
3995 bool validRegister(int num) const;
3996 uint64_t getRegister(int num) const;
3997 void setRegister(int num, uint64_t value);
3998 bool validFloatRegister(int num) const;
3999 double getFloatRegister(int num) const;
4000 void setFloatRegister(int num, double value);
4001 bool validVectorRegister(int num) const;
4002 v128 getVectorRegister(int num) const;
4003 void setVectorRegister(int num, v128 value);
4004 static const char *getRegisterName(int num);
4005 void jumpto();
4006 static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE; }
4007 static int getArch() { return REGISTERS_VE; }
4008
4009 uint64_t getSP() const { return _registers.__s[11]; }
4010 void setSP(uint64_t value) { _registers.__s[11] = value; }
4011 uint64_t getIP() const { return _registers.__ic; }
4012 void setIP(uint64_t value) { _registers.__ic = value; }
4013
4014private:
4015 // FIXME: Need to store not only scalar registers but also vector and vector
4016 // mask registers. VEOS uses mcontext_t defined in ucontext.h. It takes
4017 // 524288 bytes (65536*8 bytes), though. Currently, we use libunwind for
4018 // SjLj exception support only, so Registers_ve is not implemented completely.
4019 struct ve_thread_state_t {
4020 uint64_t __s[64]; // s0-s64
4021 uint64_t __ic; // Instruction counter (IC)
4022 uint64_t __vixr; // Vector Index Register
4023 uint64_t __vl; // Vector Length Register
4024 };
4025
4026 ve_thread_state_t _registers; // total 67 registers
4027
4028 // Currently no vector register is preserved.
4029};
4030
4031inline Registers_ve::Registers_ve(const void *registers) {
4032 static_assert((check_fit<Registers_ve, unw_context_t>::does_fit),
4033 "ve registers do not fit into unw_context_t");
4034 memcpy(&_registers, static_cast<const uint8_t *>(registers),
4035 sizeof(_registers));
4036 static_assert(sizeof(_registers) == 536,
4037 "expected vector register offset to be 536");
4038}
4039
4040inline Registers_ve::Registers_ve() {
4041 memset(&_registers, 0, sizeof(_registers));
4042}
4043
4044inline bool Registers_ve::validRegister(int regNum) const {
4045 if (regNum >= UNW_VE_S0 && regNum <= UNW_VE_S63)
4046 return true;
4047
4048 switch (regNum) {
4049 case UNW_REG_IP:
4050 case UNW_REG_SP:
4051 case UNW_VE_VIXR:
4052 case UNW_VE_VL:
4053 return true;
4054 default:
4055 return false;
4056 }
4057}
4058
4059inline uint64_t Registers_ve::getRegister(int regNum) const {
4060 if (regNum >= UNW_VE_S0 && regNum <= UNW_VE_S63)
4061 return _registers.__s[regNum - UNW_VE_S0];
4062
4063 switch (regNum) {
4064 case UNW_REG_IP:
4065 return _registers.__ic;
4066 case UNW_REG_SP:
4067 return _registers.__s[11];
4068 case UNW_VE_VIXR:
4069 return _registers.__vixr;
4070 case UNW_VE_VL:
4071 return _registers.__vl;
4072 }
4073 _LIBUNWIND_ABORT("unsupported ve register");
4074}
4075
4076inline void Registers_ve::setRegister(int regNum, uint64_t value) {
4077 if (regNum >= UNW_VE_S0 && regNum <= UNW_VE_S63) {
4078 _registers.__s[regNum - UNW_VE_S0] = value;
4079 return;
4080 }
4081
4082 switch (regNum) {
4083 case UNW_REG_IP:
4084 _registers.__ic = value;
4085 return;
4086 case UNW_REG_SP:
4087 _registers.__s[11] = value;
4088 return;
4089 case UNW_VE_VIXR:
4090 _registers.__vixr = value;
4091 return;
4092 case UNW_VE_VL:
4093 _registers.__vl = value;
4094 return;
4095 }
4096 _LIBUNWIND_ABORT("unsupported ve register");
4097}
4098
4099inline bool Registers_ve::validFloatRegister(int /* regNum */) const {
4100 return false;
4101}
4102
4103inline double Registers_ve::getFloatRegister(int /* regNum */) const {
4104 _LIBUNWIND_ABORT("VE doesn't have float registers");
4105}
4106
4107inline void Registers_ve::setFloatRegister(int /* regNum */,
4108 double /* value */) {
4109 _LIBUNWIND_ABORT("VE doesn't have float registers");
4110}
4111
4112inline bool Registers_ve::validVectorRegister(int /* regNum */) const {
4113 return false;
4114}
4115
4116inline v128 Registers_ve::getVectorRegister(int /* regNum */) const {
4117 _LIBUNWIND_ABORT("VE vector support not implemented");
4118}
4119
4120inline void Registers_ve::setVectorRegister(int /* regNum */,
4121 v128 /* value */) {
4122 _LIBUNWIND_ABORT("VE vector support not implemented");
4123}
4124
4125inline const char *Registers_ve::getRegisterName(int regNum) {
4126 switch (regNum) {
4127 case UNW_REG_IP:
4128 return "ip";
4129 case UNW_REG_SP:
4130 return "sp";
4131 case UNW_VE_VIXR:
4132 return "vixr";
4133 case UNW_VE_VL:
4134 return "vl";
4135 case UNW_VE_S0:
4136 return "s0";
4137 case UNW_VE_S1:
4138 return "s1";
4139 case UNW_VE_S2:
4140 return "s2";
4141 case UNW_VE_S3:
4142 return "s3";
4143 case UNW_VE_S4:
4144 return "s4";
4145 case UNW_VE_S5:
4146 return "s5";
4147 case UNW_VE_S6:
4148 return "s6";
4149 case UNW_VE_S7:
4150 return "s7";
4151 case UNW_VE_S8:
4152 return "s8";
4153 case UNW_VE_S9:
4154 return "s9";
4155 case UNW_VE_S10:
4156 return "s10";
4157 case UNW_VE_S11:
4158 return "s11";
4159 case UNW_VE_S12:
4160 return "s12";
4161 case UNW_VE_S13:
4162 return "s13";
4163 case UNW_VE_S14:
4164 return "s14";
4165 case UNW_VE_S15:
4166 return "s15";
4167 case UNW_VE_S16:
4168 return "s16";
4169 case UNW_VE_S17:
4170 return "s17";
4171 case UNW_VE_S18:
4172 return "s18";
4173 case UNW_VE_S19:
4174 return "s19";
4175 case UNW_VE_S20:
4176 return "s20";
4177 case UNW_VE_S21:
4178 return "s21";
4179 case UNW_VE_S22:
4180 return "s22";
4181 case UNW_VE_S23:
4182 return "s23";
4183 case UNW_VE_S24:
4184 return "s24";
4185 case UNW_VE_S25:
4186 return "s25";
4187 case UNW_VE_S26:
4188 return "s26";
4189 case UNW_VE_S27:
4190 return "s27";
4191 case UNW_VE_S28:
4192 return "s28";
4193 case UNW_VE_S29:
4194 return "s29";
4195 case UNW_VE_S30:
4196 return "s30";
4197 case UNW_VE_S31:
4198 return "s31";
4199 case UNW_VE_S32:
4200 return "s32";
4201 case UNW_VE_S33:
4202 return "s33";
4203 case UNW_VE_S34:
4204 return "s34";
4205 case UNW_VE_S35:
4206 return "s35";
4207 case UNW_VE_S36:
4208 return "s36";
4209 case UNW_VE_S37:
4210 return "s37";
4211 case UNW_VE_S38:
4212 return "s38";
4213 case UNW_VE_S39:
4214 return "s39";
4215 case UNW_VE_S40:
4216 return "s40";
4217 case UNW_VE_S41:
4218 return "s41";
4219 case UNW_VE_S42:
4220 return "s42";
4221 case UNW_VE_S43:
4222 return "s43";
4223 case UNW_VE_S44:
4224 return "s44";
4225 case UNW_VE_S45:
4226 return "s45";
4227 case UNW_VE_S46:
4228 return "s46";
4229 case UNW_VE_S47:
4230 return "s47";
4231 case UNW_VE_S48:
4232 return "s48";
4233 case UNW_VE_S49:
4234 return "s49";
4235 case UNW_VE_S50:
4236 return "s50";
4237 case UNW_VE_S51:
4238 return "s51";
4239 case UNW_VE_S52:
4240 return "s52";
4241 case UNW_VE_S53:
4242 return "s53";
4243 case UNW_VE_S54:
4244 return "s54";
4245 case UNW_VE_S55:
4246 return "s55";
4247 case UNW_VE_S56:
4248 return "s56";
4249 case UNW_VE_S57:
4250 return "s57";
4251 case UNW_VE_S58:
4252 return "s58";
4253 case UNW_VE_S59:
4254 return "s59";
4255 case UNW_VE_S60:
4256 return "s60";
4257 case UNW_VE_S61:
4258 return "s61";
4259 case UNW_VE_S62:
4260 return "s62";
4261 case UNW_VE_S63:
4262 return "s63";
4263 case UNW_VE_V0:
4264 return "v0";
4265 case UNW_VE_V1:
4266 return "v1";
4267 case UNW_VE_V2:
4268 return "v2";
4269 case UNW_VE_V3:
4270 return "v3";
4271 case UNW_VE_V4:
4272 return "v4";
4273 case UNW_VE_V5:
4274 return "v5";
4275 case UNW_VE_V6:
4276 return "v6";
4277 case UNW_VE_V7:
4278 return "v7";
4279 case UNW_VE_V8:
4280 return "v8";
4281 case UNW_VE_V9:
4282 return "v9";
4283 case UNW_VE_V10:
4284 return "v10";
4285 case UNW_VE_V11:
4286 return "v11";
4287 case UNW_VE_V12:
4288 return "v12";
4289 case UNW_VE_V13:
4290 return "v13";
4291 case UNW_VE_V14:
4292 return "v14";
4293 case UNW_VE_V15:
4294 return "v15";
4295 case UNW_VE_V16:
4296 return "v16";
4297 case UNW_VE_V17:
4298 return "v17";
4299 case UNW_VE_V18:
4300 return "v18";
4301 case UNW_VE_V19:
4302 return "v19";
4303 case UNW_VE_V20:
4304 return "v20";
4305 case UNW_VE_V21:
4306 return "v21";
4307 case UNW_VE_V22:
4308 return "v22";
4309 case UNW_VE_V23:
4310 return "v23";
4311 case UNW_VE_V24:
4312 return "v24";
4313 case UNW_VE_V25:
4314 return "v25";
4315 case UNW_VE_V26:
4316 return "v26";
4317 case UNW_VE_V27:
4318 return "v27";
4319 case UNW_VE_V28:
4320 return "v28";
4321 case UNW_VE_V29:
4322 return "v29";
4323 case UNW_VE_V30:
4324 return "v30";
4325 case UNW_VE_V31:
4326 return "v31";
4327 case UNW_VE_V32:
4328 return "v32";
4329 case UNW_VE_V33:
4330 return "v33";
4331 case UNW_VE_V34:
4332 return "v34";
4333 case UNW_VE_V35:
4334 return "v35";
4335 case UNW_VE_V36:
4336 return "v36";
4337 case UNW_VE_V37:
4338 return "v37";
4339 case UNW_VE_V38:
4340 return "v38";
4341 case UNW_VE_V39:
4342 return "v39";
4343 case UNW_VE_V40:
4344 return "v40";
4345 case UNW_VE_V41:
4346 return "v41";
4347 case UNW_VE_V42:
4348 return "v42";
4349 case UNW_VE_V43:
4350 return "v43";
4351 case UNW_VE_V44:
4352 return "v44";
4353 case UNW_VE_V45:
4354 return "v45";
4355 case UNW_VE_V46:
4356 return "v46";
4357 case UNW_VE_V47:
4358 return "v47";
4359 case UNW_VE_V48:
4360 return "v48";
4361 case UNW_VE_V49:
4362 return "v49";
4363 case UNW_VE_V50:
4364 return "v50";
4365 case UNW_VE_V51:
4366 return "v51";
4367 case UNW_VE_V52:
4368 return "v52";
4369 case UNW_VE_V53:
4370 return "v53";
4371 case UNW_VE_V54:
4372 return "v54";
4373 case UNW_VE_V55:
4374 return "v55";
4375 case UNW_VE_V56:
4376 return "v56";
4377 case UNW_VE_V57:
4378 return "v57";
4379 case UNW_VE_V58:
4380 return "v58";
4381 case UNW_VE_V59:
4382 return "v59";
4383 case UNW_VE_V60:
4384 return "v60";
4385 case UNW_VE_V61:
4386 return "v61";
4387 case UNW_VE_V62:
4388 return "v62";
4389 case UNW_VE_V63:
4390 return "v63";
4391 case UNW_VE_VM0:
4392 return "vm0";
4393 case UNW_VE_VM1:
4394 return "vm1";
4395 case UNW_VE_VM2:
4396 return "vm2";
4397 case UNW_VE_VM3:
4398 return "vm3";
4399 case UNW_VE_VM4:
4400 return "vm4";
4401 case UNW_VE_VM5:
4402 return "vm5";
4403 case UNW_VE_VM6:
4404 return "vm6";
4405 case UNW_VE_VM7:
4406 return "vm7";
4407 case UNW_VE_VM8:
4408 return "vm8";
4409 case UNW_VE_VM9:
4410 return "vm9";
4411 case UNW_VE_VM10:
4412 return "vm10";
4413 case UNW_VE_VM11:
4414 return "vm11";
4415 case UNW_VE_VM12:
4416 return "vm12";
4417 case UNW_VE_VM13:
4418 return "vm13";
4419 case UNW_VE_VM14:
4420 return "vm14";
4421 case UNW_VE_VM15:
4422 return "vm15";
4423 }
4424 return "unknown register";
4425}
4426#endif // _LIBUNWIND_TARGET_VE
4427
3980} // namespace libunwind4428} // namespace libunwind
39814429
3982#endif // __REGISTERS_HPP__4430#endif // __REGISTERS_HPP__
lib/libunwind/src/Unwind-seh.cpp+4-16
...@@ -46,18 +46,6 @@ using namespace libunwind;...@@ -46,18 +46,6 @@ using namespace libunwind;
46/// handling.46/// handling.
47#define STATUS_GCC_UNWIND MAKE_GCC_EXCEPTION(1) // 0x2147434347#define STATUS_GCC_UNWIND MAKE_GCC_EXCEPTION(1) // 0x21474343
4848
49/// Class of foreign exceptions based on unrecognized SEH exceptions.
50static const uint64_t kSEHExceptionClass = 0x434C4E4753454800; // CLNGSEH\0
51
52/// Exception cleanup routine used by \c _GCC_specific_handler to
53/// free foreign exceptions.
54static void seh_exc_cleanup(_Unwind_Reason_Code urc, _Unwind_Exception *exc) {
55 (void)urc;
56 if (exc->exception_class != kSEHExceptionClass)
57 _LIBUNWIND_ABORT("SEH cleanup called on non-SEH exception");
58 free(exc);
59}
60
61static int __unw_init_seh(unw_cursor_t *cursor, CONTEXT *ctx);49static int __unw_init_seh(unw_cursor_t *cursor, CONTEXT *ctx);
62static DISPATCHER_CONTEXT *__unw_seh_get_disp_ctx(unw_cursor_t *cursor);50static DISPATCHER_CONTEXT *__unw_seh_get_disp_ctx(unw_cursor_t *cursor);
63static void __unw_seh_set_disp_ctx(unw_cursor_t *cursor,51static void __unw_seh_set_disp_ctx(unw_cursor_t *cursor,
...@@ -108,10 +96,10 @@ _GCC_specific_handler(PEXCEPTION_RECORD ms_exc, PVOID frame, PCONTEXT ms_ctx,...@@ -108,10 +96,10 @@ _GCC_specific_handler(PEXCEPTION_RECORD ms_exc, PVOID frame, PCONTEXT ms_ctx,
108 }96 }
109 } else {97 } else {
110 // Foreign exception.98 // Foreign exception.
111 exc = (_Unwind_Exception *)malloc(sizeof(_Unwind_Exception));99 // We can't interact with them (we don't know the original target frame
112 exc->exception_class = kSEHExceptionClass;100 // that we should pass on to RtlUnwindEx in _Unwind_Resume), so just
113 exc->exception_cleanup = seh_exc_cleanup;101 // pass without calling our destructors here.
114 memset(exc->private_, 0, sizeof(exc->private_));102 return ExceptionContinueSearch;
115 }103 }
116 if (!ctx) {104 if (!ctx) {
117 __unw_init_seh(&cursor, disp->ContextRecord);105 __unw_init_seh(&cursor, disp->ContextRecord);
lib/libunwind/src/Unwind-sjlj.c+12
...@@ -32,11 +32,23 @@ struct _Unwind_FunctionContext {...@@ -32,11 +32,23 @@ struct _Unwind_FunctionContext {
32 // next function in stack of handlers32 // next function in stack of handlers
33 struct _Unwind_FunctionContext *prev;33 struct _Unwind_FunctionContext *prev;
3434
35#if defined(__ve__)
36 // VE requires to store 64 bit pointers in the buffer for SjLj execption.
37 // We expand the size of values defined here. This size must be matched
38 // to the size returned by TargetMachine::getSjLjDataSize().
39
40 // set by calling function before registering to be the landing pad
41 uint64_t resumeLocation;
42
43 // set by personality handler to be parameters passed to landing pad function
44 uint64_t resumeParameters[4];
45#else
35 // set by calling function before registering to be the landing pad46 // set by calling function before registering to be the landing pad
36 uint32_t resumeLocation;47 uint32_t resumeLocation;
3748
38 // set by personality handler to be parameters passed to landing pad function49 // set by personality handler to be parameters passed to landing pad function
39 uint32_t resumeParameters[4];50 uint32_t resumeParameters[4];
51#endif
4052
41 // set by calling function before registering53 // set by calling function before registering
42 _Unwind_Personality_Fn personality; // arm offset=2454 _Unwind_Personality_Fn personality; // arm offset=24
lib/libunwind/src/UnwindCursor.hpp+156-69
...@@ -81,6 +81,7 @@ template <typename A>...@@ -81,6 +81,7 @@ template <typename A>
81class _LIBUNWIND_HIDDEN DwarfFDECache {81class _LIBUNWIND_HIDDEN DwarfFDECache {
82 typedef typename A::pint_t pint_t;82 typedef typename A::pint_t pint_t;
83public:83public:
84 static constexpr pint_t kSearchAll = static_cast<pint_t>(-1);
84 static pint_t findFDE(pint_t mh, pint_t pc);85 static pint_t findFDE(pint_t mh, pint_t pc);
85 static void add(pint_t mh, pint_t ip_start, pint_t ip_end, pint_t fde);86 static void add(pint_t mh, pint_t ip_start, pint_t ip_end, pint_t fde);
86 static void removeAllIn(pint_t mh);87 static void removeAllIn(pint_t mh);
...@@ -138,7 +139,7 @@ typename A::pint_t DwarfFDECache<A>::findFDE(pint_t mh, pint_t pc) {...@@ -138,7 +139,7 @@ typename A::pint_t DwarfFDECache<A>::findFDE(pint_t mh, pint_t pc) {
138 pint_t result = 0;139 pint_t result = 0;
139 _LIBUNWIND_LOG_IF_FALSE(_lock.lock_shared());140 _LIBUNWIND_LOG_IF_FALSE(_lock.lock_shared());
140 for (entry *p = _buffer; p < _bufferUsed; ++p) {141 for (entry *p = _buffer; p < _bufferUsed; ++p) {
141 if ((mh == p->mh) || (mh == 0)) {142 if ((mh == p->mh) || (mh == kSearchAll)) {
142 if ((p->ip_start <= pc) && (pc < p->ip_end)) {143 if ((p->ip_start <= pc) && (pc < p->ip_end)) {
143 result = p->fde;144 result = p->fde;
144 break;145 break;
...@@ -530,6 +531,8 @@ UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as)...@@ -530,6 +531,8 @@ UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as)
530 : _addressSpace(as), _unwindInfoMissing(false) {531 : _addressSpace(as), _unwindInfoMissing(false) {
531 static_assert((check_fit<UnwindCursor<A, R>, unw_cursor_t>::does_fit),532 static_assert((check_fit<UnwindCursor<A, R>, unw_cursor_t>::does_fit),
532 "UnwindCursor<> does not fit in unw_cursor_t");533 "UnwindCursor<> does not fit in unw_cursor_t");
534 static_assert((alignof(UnwindCursor<A, R>) <= alignof(unw_cursor_t)),
535 "UnwindCursor<> requires more alignment than unw_cursor_t");
533 memset(&_info, 0, sizeof(_info));536 memset(&_info, 0, sizeof(_info));
534 memset(&_histTable, 0, sizeof(_histTable));537 memset(&_histTable, 0, sizeof(_histTable));
535 _dispContext.ContextRecord = &_msContext;538 _dispContext.ContextRecord = &_msContext;
...@@ -922,7 +925,29 @@ private:...@@ -922,7 +925,29 @@ private:
922 }925 }
923#endif926#endif
924927
928#if defined(_LIBUNWIND_TARGET_LINUX) && defined(_LIBUNWIND_TARGET_AARCH64)
929 bool setInfoForSigReturn() {
930 R dummy;
931 return setInfoForSigReturn(dummy);
932 }
933 int stepThroughSigReturn() {
934 R dummy;
935 return stepThroughSigReturn(dummy);
936 }
937 bool setInfoForSigReturn(Registers_arm64 &);
938 int stepThroughSigReturn(Registers_arm64 &);
939 template <typename Registers> bool setInfoForSigReturn(Registers &) {
940 return false;
941 }
942 template <typename Registers> int stepThroughSigReturn(Registers &) {
943 return UNW_STEP_END;
944 }
945#endif
946
925#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)947#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
948 bool getInfoFromFdeCie(const typename CFI_Parser<A>::FDE_Info &fdeInfo,
949 const typename CFI_Parser<A>::CIE_Info &cieInfo,
950 pint_t pc, uintptr_t dso_base);
926 bool getInfoFromDwarfSection(pint_t pc, const UnwindInfoSections &sects,951 bool getInfoFromDwarfSection(pint_t pc, const UnwindInfoSections &sects,
927 uint32_t fdeSectionOffsetHint=0);952 uint32_t fdeSectionOffsetHint=0);
928 int stepWithDwarfFDE() {953 int stepWithDwarfFDE() {
...@@ -1173,6 +1198,9 @@ private:...@@ -1173,6 +1198,9 @@ private:
1173 unw_proc_info_t _info;1198 unw_proc_info_t _info;
1174 bool _unwindInfoMissing;1199 bool _unwindInfoMissing;
1175 bool _isSignalFrame;1200 bool _isSignalFrame;
1201#if defined(_LIBUNWIND_TARGET_LINUX) && defined(_LIBUNWIND_TARGET_AARCH64)
1202 bool _isSigReturn = false;
1203#endif
1176};1204};
11771205
11781206
...@@ -1182,6 +1210,8 @@ UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as)...@@ -1182,6 +1210,8 @@ UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as)
1182 _isSignalFrame(false) {1210 _isSignalFrame(false) {
1183 static_assert((check_fit<UnwindCursor<A, R>, unw_cursor_t>::does_fit),1211 static_assert((check_fit<UnwindCursor<A, R>, unw_cursor_t>::does_fit),
1184 "UnwindCursor<> does not fit in unw_cursor_t");1212 "UnwindCursor<> does not fit in unw_cursor_t");
1213 static_assert((alignof(UnwindCursor<A, R>) <= alignof(unw_cursor_t)),
1214 "UnwindCursor<> requires more alignment than unw_cursor_t");
1185 memset(&_info, 0, sizeof(_info));1215 memset(&_info, 0, sizeof(_info));
1186}1216}
11871217
...@@ -1472,6 +1502,32 @@ bool UnwindCursor<A, R>::getInfoFromEHABISection(...@@ -1472,6 +1502,32 @@ bool UnwindCursor<A, R>::getInfoFromEHABISection(
1472#endif1502#endif
14731503
1474#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)1504#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
1505template <typename A, typename R>
1506bool UnwindCursor<A, R>::getInfoFromFdeCie(
1507 const typename CFI_Parser<A>::FDE_Info &fdeInfo,
1508 const typename CFI_Parser<A>::CIE_Info &cieInfo, pint_t pc,
1509 uintptr_t dso_base) {
1510 typename CFI_Parser<A>::PrologInfo prolog;
1511 if (CFI_Parser<A>::parseFDEInstructions(_addressSpace, fdeInfo, cieInfo, pc,
1512 R::getArch(), &prolog)) {
1513 // Save off parsed FDE info
1514 _info.start_ip = fdeInfo.pcStart;
1515 _info.end_ip = fdeInfo.pcEnd;
1516 _info.lsda = fdeInfo.lsda;
1517 _info.handler = cieInfo.personality;
1518 // Some frameless functions need SP altered when resuming in function, so
1519 // propagate spExtraArgSize.
1520 _info.gp = prolog.spExtraArgSize;
1521 _info.flags = 0;
1522 _info.format = dwarfEncoding();
1523 _info.unwind_info = fdeInfo.fdeStart;
1524 _info.unwind_info_size = static_cast<uint32_t>(fdeInfo.fdeLength);
1525 _info.extra = static_cast<unw_word_t>(dso_base);
1526 return true;
1527 }
1528 return false;
1529}
1530
1475template <typename A, typename R>1531template <typename A, typename R>
1476bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,1532bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,
1477 const UnwindInfoSections &sects,1533 const UnwindInfoSections &sects,
...@@ -1483,7 +1539,7 @@ bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,...@@ -1483,7 +1539,7 @@ bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,
1483 // If compact encoding table gave offset into dwarf section, go directly there1539 // If compact encoding table gave offset into dwarf section, go directly there
1484 if (fdeSectionOffsetHint != 0) {1540 if (fdeSectionOffsetHint != 0) {
1485 foundFDE = CFI_Parser<A>::findFDE(_addressSpace, pc, sects.dwarf_section,1541 foundFDE = CFI_Parser<A>::findFDE(_addressSpace, pc, sects.dwarf_section,
1486 (uint32_t)sects.dwarf_section_length,1542 sects.dwarf_section_length,
1487 sects.dwarf_section + fdeSectionOffsetHint,1543 sects.dwarf_section + fdeSectionOffsetHint,
1488 &fdeInfo, &cieInfo);1544 &fdeInfo, &cieInfo);
1489 }1545 }
...@@ -1500,7 +1556,7 @@ bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,...@@ -1500,7 +1556,7 @@ bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,
1500 if (cachedFDE != 0) {1556 if (cachedFDE != 0) {
1501 foundFDE =1557 foundFDE =
1502 CFI_Parser<A>::findFDE(_addressSpace, pc, sects.dwarf_section,1558 CFI_Parser<A>::findFDE(_addressSpace, pc, sects.dwarf_section,
1503 (uint32_t)sects.dwarf_section_length,1559 sects.dwarf_section_length,
1504 cachedFDE, &fdeInfo, &cieInfo);1560 cachedFDE, &fdeInfo, &cieInfo);
1505 foundInCache = foundFDE;1561 foundInCache = foundFDE;
1506 }1562 }
...@@ -1508,25 +1564,11 @@ bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,...@@ -1508,25 +1564,11 @@ bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,
1508 if (!foundFDE) {1564 if (!foundFDE) {
1509 // Still not found, do full scan of __eh_frame section.1565 // Still not found, do full scan of __eh_frame section.
1510 foundFDE = CFI_Parser<A>::findFDE(_addressSpace, pc, sects.dwarf_section,1566 foundFDE = CFI_Parser<A>::findFDE(_addressSpace, pc, sects.dwarf_section,
1511 (uint32_t)sects.dwarf_section_length, 0,1567 sects.dwarf_section_length, 0,
1512 &fdeInfo, &cieInfo);1568 &fdeInfo, &cieInfo);
1513 }1569 }
1514 if (foundFDE) {1570 if (foundFDE) {
1515 typename CFI_Parser<A>::PrologInfo prolog;1571 if (getInfoFromFdeCie(fdeInfo, cieInfo, pc, sects.dso_base)) {
1516 if (CFI_Parser<A>::parseFDEInstructions(_addressSpace, fdeInfo, cieInfo, pc,
1517 R::getArch(), &prolog)) {
1518 // Save off parsed FDE info
1519 _info.start_ip = fdeInfo.pcStart;
1520 _info.end_ip = fdeInfo.pcEnd;
1521 _info.lsda = fdeInfo.lsda;
1522 _info.handler = cieInfo.personality;
1523 _info.gp = prolog.spExtraArgSize;
1524 _info.flags = 0;
1525 _info.format = dwarfEncoding();
1526 _info.unwind_info = fdeInfo.fdeStart;
1527 _info.unwind_info_size = (uint32_t)fdeInfo.fdeLength;
1528 _info.extra = (unw_word_t) sects.dso_base;
1529
1530 // Add to cache (to make next lookup faster) if we had no hint1572 // Add to cache (to make next lookup faster) if we had no hint
1531 // and there was no index.1573 // and there was no index.
1532 if (!foundInCache && (fdeSectionOffsetHint == 0)) {1574 if (!foundInCache && (fdeSectionOffsetHint == 0)) {
...@@ -1759,12 +1801,12 @@ bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(pint_t pc,...@@ -1759,12 +1801,12 @@ bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(pint_t pc,
1759 }1801 }
1760 }1802 }
17611803
1762 // extact personality routine, if encoding says function has one1804 // extract personality routine, if encoding says function has one
1763 uint32_t personalityIndex = (encoding & UNWIND_PERSONALITY_MASK) >>1805 uint32_t personalityIndex = (encoding & UNWIND_PERSONALITY_MASK) >>
1764 (__builtin_ctz(UNWIND_PERSONALITY_MASK));1806 (__builtin_ctz(UNWIND_PERSONALITY_MASK));
1765 if (personalityIndex != 0) {1807 if (personalityIndex != 0) {
1766 --personalityIndex; // change 1-based to zero-based index1808 --personalityIndex; // change 1-based to zero-based index
1767 if (personalityIndex > sectionHeader.personalityArrayCount()) {1809 if (personalityIndex >= sectionHeader.personalityArrayCount()) {
1768 _LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with personality index %d, "1810 _LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with personality index %d, "
1769 "but personality table has only %d entries",1811 "but personality table has only %d entries",
1770 encoding, personalityIndex,1812 encoding, personalityIndex,
...@@ -1853,7 +1895,11 @@ bool UnwindCursor<A, R>::getInfoFromSEH(pint_t pc) {...@@ -1853,7 +1895,11 @@ bool UnwindCursor<A, R>::getInfoFromSEH(pint_t pc) {
18531895
1854template <typename A, typename R>1896template <typename A, typename R>
1855void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {1897void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {
1856 pint_t pc = (pint_t)this->getReg(UNW_REG_IP);1898#if defined(_LIBUNWIND_TARGET_LINUX) && defined(_LIBUNWIND_TARGET_AARCH64)
1899 _isSigReturn = false;
1900#endif
1901
1902 pint_t pc = static_cast<pint_t>(this->getReg(UNW_REG_IP));
1857#if defined(_LIBUNWIND_ARM_EHABI)1903#if defined(_LIBUNWIND_ARM_EHABI)
1858 // Remove the thumb bit so the IP represents the actual instruction address.1904 // Remove the thumb bit so the IP represents the actual instruction address.
1859 // This matches the behaviour of _Unwind_GetIP on arm.1905 // This matches the behaviour of _Unwind_GetIP on arm.
...@@ -1926,68 +1972,102 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {...@@ -1926,68 +1972,102 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {
1926#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)1972#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
1927 // There is no static unwind info for this pc. Look to see if an FDE was1973 // There is no static unwind info for this pc. Look to see if an FDE was
1928 // dynamically registered for it.1974 // dynamically registered for it.
1929 pint_t cachedFDE = DwarfFDECache<A>::findFDE(0, pc);1975 pint_t cachedFDE = DwarfFDECache<A>::findFDE(DwarfFDECache<A>::kSearchAll,
1976 pc);
1930 if (cachedFDE != 0) {1977 if (cachedFDE != 0) {
1931 CFI_Parser<LocalAddressSpace>::FDE_Info fdeInfo;1978 typename CFI_Parser<A>::FDE_Info fdeInfo;
1932 CFI_Parser<LocalAddressSpace>::CIE_Info cieInfo;1979 typename CFI_Parser<A>::CIE_Info cieInfo;
1933 const char *msg = CFI_Parser<A>::decodeFDE(_addressSpace,1980 if (!CFI_Parser<A>::decodeFDE(_addressSpace, cachedFDE, &fdeInfo, &cieInfo))
1934 cachedFDE, &fdeInfo, &cieInfo);1981 if (getInfoFromFdeCie(fdeInfo, cieInfo, pc, 0))
1935 if (msg == NULL) {
1936 typename CFI_Parser<A>::PrologInfo prolog;
1937 if (CFI_Parser<A>::parseFDEInstructions(_addressSpace, fdeInfo, cieInfo,
1938 pc, R::getArch(), &prolog)) {
1939 // save off parsed FDE info
1940 _info.start_ip = fdeInfo.pcStart;
1941 _info.end_ip = fdeInfo.pcEnd;
1942 _info.lsda = fdeInfo.lsda;
1943 _info.handler = cieInfo.personality;
1944 _info.gp = prolog.spExtraArgSize;
1945 // Some frameless functions need SP
1946 // altered when resuming in function.
1947 _info.flags = 0;
1948 _info.format = dwarfEncoding();
1949 _info.unwind_info = fdeInfo.fdeStart;
1950 _info.unwind_info_size = (uint32_t)fdeInfo.fdeLength;
1951 _info.extra = 0;
1952 return;1982 return;
1953 }
1954 }
1955 }1983 }
19561984
1957 // Lastly, ask AddressSpace object about platform specific ways to locate1985 // Lastly, ask AddressSpace object about platform specific ways to locate
1958 // other FDEs.1986 // other FDEs.
1959 pint_t fde;1987 pint_t fde;
1960 if (_addressSpace.findOtherFDE(pc, fde)) {1988 if (_addressSpace.findOtherFDE(pc, fde)) {
1961 CFI_Parser<LocalAddressSpace>::FDE_Info fdeInfo;1989 typename CFI_Parser<A>::FDE_Info fdeInfo;
1962 CFI_Parser<LocalAddressSpace>::CIE_Info cieInfo;1990 typename CFI_Parser<A>::CIE_Info cieInfo;
1963 if (!CFI_Parser<A>::decodeFDE(_addressSpace, fde, &fdeInfo, &cieInfo)) {1991 if (!CFI_Parser<A>::decodeFDE(_addressSpace, fde, &fdeInfo, &cieInfo)) {
1964 // Double check this FDE is for a function that includes the pc.1992 // Double check this FDE is for a function that includes the pc.
1965 if ((fdeInfo.pcStart <= pc) && (pc < fdeInfo.pcEnd)) {1993 if ((fdeInfo.pcStart <= pc) && (pc < fdeInfo.pcEnd))
1966 typename CFI_Parser<A>::PrologInfo prolog;1994 if (getInfoFromFdeCie(fdeInfo, cieInfo, pc, 0))
1967 if (CFI_Parser<A>::parseFDEInstructions(_addressSpace, fdeInfo, cieInfo,
1968 pc, R::getArch(), &prolog)) {
1969 // save off parsed FDE info
1970 _info.start_ip = fdeInfo.pcStart;
1971 _info.end_ip = fdeInfo.pcEnd;
1972 _info.lsda = fdeInfo.lsda;
1973 _info.handler = cieInfo.personality;
1974 _info.gp = prolog.spExtraArgSize;
1975 _info.flags = 0;
1976 _info.format = dwarfEncoding();
1977 _info.unwind_info = fdeInfo.fdeStart;
1978 _info.unwind_info_size = (uint32_t)fdeInfo.fdeLength;
1979 _info.extra = 0;
1980 return;1995 return;
1981 }
1982 }
1983 }1996 }
1984 }1997 }
1985#endif // #if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)1998#endif // #if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
19861999
2000#if defined(_LIBUNWIND_TARGET_LINUX) && defined(_LIBUNWIND_TARGET_AARCH64)
2001 if (setInfoForSigReturn())
2002 return;
2003#endif
2004
1987 // no unwind info, flag that we can't reliably unwind2005 // no unwind info, flag that we can't reliably unwind
1988 _unwindInfoMissing = true;2006 _unwindInfoMissing = true;
1989}2007}
19902008
2009#if defined(_LIBUNWIND_TARGET_LINUX) && defined(_LIBUNWIND_TARGET_AARCH64)
2010template <typename A, typename R>
2011bool UnwindCursor<A, R>::setInfoForSigReturn(Registers_arm64 &) {
2012 // Look for the sigreturn trampoline. The trampoline's body is two
2013 // specific instructions (see below). Typically the trampoline comes from the
2014 // vDSO[1] (i.e. the __kernel_rt_sigreturn function). A libc might provide its
2015 // own restorer function, though, or user-mode QEMU might write a trampoline
2016 // onto the stack.
2017 //
2018 // This special code path is a fallback that is only used if the trampoline
2019 // lacks proper (e.g. DWARF) unwind info. On AArch64, a new DWARF register
2020 // constant for the PC needs to be defined before DWARF can handle a signal
2021 // trampoline. This code may segfault if the target PC is unreadable, e.g.:
2022 // - The PC points at a function compiled without unwind info, and which is
2023 // part of an execute-only mapping (e.g. using -Wl,--execute-only).
2024 // - The PC is invalid and happens to point to unreadable or unmapped memory.
2025 //
2026 // [1] https://github.com/torvalds/linux/blob/master/arch/arm64/kernel/vdso/sigreturn.S
2027 const pint_t pc = static_cast<pint_t>(this->getReg(UNW_REG_IP));
2028 // Look for instructions: mov x8, #0x8b; svc #0x0
2029 if (_addressSpace.get32(pc) == 0xd2801168 &&
2030 _addressSpace.get32(pc + 4) == 0xd4000001) {
2031 _info = {};
2032 _isSigReturn = true;
2033 return true;
2034 }
2035 return false;
2036}
2037
2038template <typename A, typename R>
2039int UnwindCursor<A, R>::stepThroughSigReturn(Registers_arm64 &) {
2040 // In the signal trampoline frame, sp points to an rt_sigframe[1], which is:
2041 // - 128-byte siginfo struct
2042 // - ucontext struct:
2043 // - 8-byte long (uc_flags)
2044 // - 8-byte pointer (uc_link)
2045 // - 24-byte stack_t
2046 // - 128-byte signal set
2047 // - 8 bytes of padding because sigcontext has 16-byte alignment
2048 // - sigcontext/mcontext_t
2049 // [1] https://github.com/torvalds/linux/blob/master/arch/arm64/kernel/signal.c
2050 const pint_t kOffsetSpToSigcontext = (128 + 8 + 8 + 24 + 128 + 8); // 304
2051
2052 // Offsets from sigcontext to each register.
2053 const pint_t kOffsetGprs = 8; // offset to "__u64 regs[31]" field
2054 const pint_t kOffsetSp = 256; // offset to "__u64 sp" field
2055 const pint_t kOffsetPc = 264; // offset to "__u64 pc" field
2056
2057 pint_t sigctx = _registers.getSP() + kOffsetSpToSigcontext;
2058
2059 for (int i = 0; i <= 30; ++i) {
2060 uint64_t value = _addressSpace.get64(sigctx + kOffsetGprs +
2061 static_cast<pint_t>(i * 8));
2062 _registers.setRegister(UNW_ARM64_X0 + i, value);
2063 }
2064 _registers.setSP(_addressSpace.get64(sigctx + kOffsetSp));
2065 _registers.setIP(_addressSpace.get64(sigctx + kOffsetPc));
2066 _isSignalFrame = true;
2067 return UNW_STEP_SUCCESS;
2068}
2069#endif // defined(_LIBUNWIND_TARGET_LINUX) && defined(_LIBUNWIND_TARGET_AARCH64)
2070
1991template <typename A, typename R>2071template <typename A, typename R>
1992int UnwindCursor<A, R>::step() {2072int UnwindCursor<A, R>::step() {
1993 // Bottom of stack is defined is when unwind info cannot be found.2073 // Bottom of stack is defined is when unwind info cannot be found.
...@@ -1996,20 +2076,27 @@ int UnwindCursor<A, R>::step() {...@@ -1996,20 +2076,27 @@ int UnwindCursor<A, R>::step() {
19962076
1997 // Use unwinding info to modify register set as if function returned.2077 // Use unwinding info to modify register set as if function returned.
1998 int result;2078 int result;
2079#if defined(_LIBUNWIND_TARGET_LINUX) && defined(_LIBUNWIND_TARGET_AARCH64)
2080 if (_isSigReturn) {
2081 result = this->stepThroughSigReturn();
2082 } else
2083#endif
2084 {
1999#if defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)2085#if defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)
2000 result = this->stepWithCompactEncoding();2086 result = this->stepWithCompactEncoding();
2001#elif defined(_LIBUNWIND_SUPPORT_SEH_UNWIND)2087#elif defined(_LIBUNWIND_SUPPORT_SEH_UNWIND)
2002 result = this->stepWithSEHData();2088 result = this->stepWithSEHData();
2003#elif defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)2089#elif defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
2004 result = this->stepWithDwarfFDE();2090 result = this->stepWithDwarfFDE();
2005#elif defined(_LIBUNWIND_ARM_EHABI)2091#elif defined(_LIBUNWIND_ARM_EHABI)
2006 result = this->stepWithEHABI();2092 result = this->stepWithEHABI();
2007#else2093#else
2008 #error Need _LIBUNWIND_SUPPORT_COMPACT_UNWIND or \2094 #error Need _LIBUNWIND_SUPPORT_COMPACT_UNWIND or \
2009 _LIBUNWIND_SUPPORT_SEH_UNWIND or \2095 _LIBUNWIND_SUPPORT_SEH_UNWIND or \
2010 _LIBUNWIND_SUPPORT_DWARF_UNWIND or \2096 _LIBUNWIND_SUPPORT_DWARF_UNWIND or \
2011 _LIBUNWIND_ARM_EHABI2097 _LIBUNWIND_ARM_EHABI
2012#endif2098#endif
2099 }
20132100
2014 // update info based on new PC2101 // update info based on new PC
2015 if (result == UNW_STEP_SUCCESS) {2102 if (result == UNW_STEP_SUCCESS) {
lib/libunwind/src/UnwindLevel1.c+1-3
...@@ -39,8 +39,7 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except...@@ -39,8 +39,7 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
39 __unw_init_local(cursor, uc);39 __unw_init_local(cursor, uc);
4040
41 // Walk each frame looking for a place to stop.41 // Walk each frame looking for a place to stop.
42 bool handlerNotFound = true;42 while (true) {
43 while (handlerNotFound) {
44 // Ask libunwind to get next frame (skip over first which is43 // Ask libunwind to get next frame (skip over first which is
45 // _Unwind_RaiseException).44 // _Unwind_RaiseException).
46 int stepResult = __unw_step(cursor);45 int stepResult = __unw_step(cursor);
...@@ -102,7 +101,6 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except...@@ -102,7 +101,6 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
102 case _URC_HANDLER_FOUND:101 case _URC_HANDLER_FOUND:
103 // found a catch clause or locals that need destructing in this frame102 // found a catch clause or locals that need destructing in this frame
104 // stop search and remember stack pointer at the frame103 // stop search and remember stack pointer at the frame
105 handlerNotFound = false;
106 __unw_get_reg(cursor, UNW_REG_SP, &sp);104 __unw_get_reg(cursor, UNW_REG_SP, &sp);
107 exception_object->private_2 = (uintptr_t)sp;105 exception_object->private_2 = (uintptr_t)sp;
108 _LIBUNWIND_TRACE_UNWINDING(106 _LIBUNWIND_TRACE_UNWINDING(
lib/libunwind/src/UnwindRegistersRestore.S+13-12
...@@ -13,14 +13,10 @@...@@ -13,14 +13,10 @@
13#if !defined(__USING_SJLJ_EXCEPTIONS__)13#if !defined(__USING_SJLJ_EXCEPTIONS__)
1414
15#if defined(__i386__)15#if defined(__i386__)
16DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_x866jumptoEv)16DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_jumpto)
17#17#
18# void libunwind::Registers_x86::jumpto()18# extern "C" void __libunwind_Registers_x86_jumpto(Registers_x86 *);
19#19#
20#if defined(_WIN32)
21# On windows, the 'this' pointer is passed in ecx instead of on the stack
22 movl %ecx, %eax
23#else
24# On entry:20# On entry:
25# + +21# + +
26# +-----------------------+22# +-----------------------+
...@@ -30,7 +26,6 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_x866jumptoEv)...@@ -30,7 +26,6 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_x866jumptoEv)
30# +-----------------------+ <-- SP26# +-----------------------+ <-- SP
31# + +27# + +
32 movl 4(%esp), %eax28 movl 4(%esp), %eax
33#endif
34 # set up eax and ret on new stack location29 # set up eax and ret on new stack location
35 movl 28(%eax), %edx # edx holds new stack pointer30 movl 28(%eax), %edx # edx holds new stack pointer
36 subl $8,%edx31 subl $8,%edx
...@@ -60,9 +55,9 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_x866jumptoEv)...@@ -60,9 +55,9 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_x866jumptoEv)
6055
61#elif defined(__x86_64__)56#elif defined(__x86_64__)
6257
63DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind16Registers_x86_646jumptoEv)58DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_64_jumpto)
64#59#
65# void libunwind::Registers_x86_64::jumpto()60# extern "C" void __libunwind_Registers_x86_64_jumpto(Registers_x86_64 *);
66#61#
67#if defined(_WIN64)62#if defined(_WIN64)
68# On entry, thread_state pointer is in rcx; move it into rdi63# On entry, thread_state pointer is in rcx; move it into rdi
...@@ -175,7 +170,7 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_ppc646jumptoEv)...@@ -175,7 +170,7 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_ppc646jumptoEv)
175 PPC64_LR(30)170 PPC64_LR(30)
176 PPC64_LR(31)171 PPC64_LR(31)
177172
178#ifdef PPC64_HAS_VMX173#if defined(__VSX__)
179174
180 // restore VS registers175 // restore VS registers
181 // (note that this also restores floating point registers and V registers,176 // (note that this also restores floating point registers and V registers,
...@@ -317,6 +312,7 @@ PPC64_CLVS_BOTTOM(n)...@@ -317,6 +312,7 @@ PPC64_CLVS_BOTTOM(n)
317 PPC64_LF(30)312 PPC64_LF(30)
318 PPC64_LF(31)313 PPC64_LF(31)
319314
315#if defined(__ALTIVEC__)
320 // restore vector registers if any are in use316 // restore vector registers if any are in use
321 ld %r5, PPC64_OFFS_VRSAVE(%r3) // test VRsave317 ld %r5, PPC64_OFFS_VRSAVE(%r3) // test VRsave
322 cmpwi %r5, 0318 cmpwi %r5, 0
...@@ -378,6 +374,7 @@ PPC64_CLV_UNALIGNED_BOTTOM(n)...@@ -378,6 +374,7 @@ PPC64_CLV_UNALIGNED_BOTTOM(n)
378 PPC64_CLV_UNALIGNEDh(31)374 PPC64_CLV_UNALIGNEDh(31)
379375
380#endif376#endif
377#endif
381378
382Lnovec:379Lnovec:
383 ld %r0, PPC64_OFFS_CR(%r3)380 ld %r0, PPC64_OFFS_CR(%r3)
...@@ -436,6 +433,7 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)...@@ -436,6 +433,7 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
436 lwz %r30,128(%r3)433 lwz %r30,128(%r3)
437 lwz %r31,132(%r3)434 lwz %r31,132(%r3)
438435
436#ifndef __NO_FPRS__
439 // restore float registers437 // restore float registers
440 lfd %f0, 160(%r3)438 lfd %f0, 160(%r3)
441 lfd %f1, 168(%r3)439 lfd %f1, 168(%r3)
...@@ -469,7 +467,9 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)...@@ -469,7 +467,9 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
469 lfd %f29,392(%r3)467 lfd %f29,392(%r3)
470 lfd %f30,400(%r3)468 lfd %f30,400(%r3)
471 lfd %f31,408(%r3)469 lfd %f31,408(%r3)
470#endif
472471
472#if defined(__ALTIVEC__)
473 // restore vector registers if any are in use473 // restore vector registers if any are in use
474 lwz %r5, 156(%r3) // test VRsave474 lwz %r5, 156(%r3) // test VRsave
475 cmpwi %r5, 0475 cmpwi %r5, 0
...@@ -542,6 +542,7 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)...@@ -542,6 +542,7 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
542 LOAD_VECTOR_UNALIGNEDh(29)542 LOAD_VECTOR_UNALIGNEDh(29)
543 LOAD_VECTOR_UNALIGNEDh(30)543 LOAD_VECTOR_UNALIGNEDh(30)
544 LOAD_VECTOR_UNALIGNEDh(31)544 LOAD_VECTOR_UNALIGNEDh(31)
545#endif
545546
546Lnovec:547Lnovec:
547 lwz %r0, 136(%r3) // __cr548 lwz %r0, 136(%r3) // __cr
...@@ -560,13 +561,13 @@ Lnovec:...@@ -560,13 +561,13 @@ Lnovec:
560#elif defined(__aarch64__)561#elif defined(__aarch64__)
561562
562//563//
563// void libunwind::Registers_arm64::jumpto()564// extern "C" void __libunwind_Registers_arm64_jumpto(Registers_arm64 *);
564//565//
565// On entry:566// On entry:
566// thread_state pointer is in x0567// thread_state pointer is in x0
567//568//
568 .p2align 2569 .p2align 2
569DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_arm646jumptoEv)570DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)
570 // skip restore of x0,x1 for now571 // skip restore of x0,x1 for now
571 ldp x2, x3, [x0, #0x010]572 ldp x2, x3, [x0, #0x010]
572 ldp x4, x5, [x0, #0x020]573 ldp x4, x5, [x0, #0x020]
lib/libunwind/src/UnwindRegistersSave.S+7-2
...@@ -384,7 +384,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)...@@ -384,7 +384,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
384 mfvrsave %r0384 mfvrsave %r0
385 std %r0, PPC64_OFFS_VRSAVE(%r3)385 std %r0, PPC64_OFFS_VRSAVE(%r3)
386386
387#ifdef PPC64_HAS_VMX387#if defined(__VSX__)
388 // save VS registers388 // save VS registers
389 // (note that this also saves floating point registers and V registers,389 // (note that this also saves floating point registers and V registers,
390 // because part of VS is mapped to these registers)390 // because part of VS is mapped to these registers)
...@@ -501,6 +501,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)...@@ -501,6 +501,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
501 PPC64_STF(30)501 PPC64_STF(30)
502 PPC64_STF(31)502 PPC64_STF(31)
503503
504#if defined(__ALTIVEC__)
504 // save vector registers505 // save vector registers
505506
506 // Use 16-bytes below the stack pointer as an507 // Use 16-bytes below the stack pointer as an
...@@ -548,6 +549,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)...@@ -548,6 +549,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
548 PPC64_STV_UNALIGNED(30)549 PPC64_STV_UNALIGNED(30)
549 PPC64_STV_UNALIGNED(31)550 PPC64_STV_UNALIGNED(31)
550551
552#endif
551#endif553#endif
552554
553 li %r3, 0 // return UNW_ESUCCESS555 li %r3, 0 // return UNW_ESUCCESS
...@@ -608,6 +610,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)...@@ -608,6 +610,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
608 mfctr %r0610 mfctr %r0
609 stw %r0, 148(%r3)611 stw %r0, 148(%r3)
610612
613#if !defined(__NO_FPRS__)
611 // save float registers614 // save float registers
612 stfd %f0, 160(%r3)615 stfd %f0, 160(%r3)
613 stfd %f1, 168(%r3)616 stfd %f1, 168(%r3)
...@@ -641,8 +644,9 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)...@@ -641,8 +644,9 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
641 stfd %f29,392(%r3)644 stfd %f29,392(%r3)
642 stfd %f30,400(%r3)645 stfd %f30,400(%r3)
643 stfd %f31,408(%r3)646 stfd %f31,408(%r3)
647#endif
644648
645649#if defined(__ALTIVEC__)
646 // save vector registers650 // save vector registers
647651
648 subi %r4, %r1, 16652 subi %r4, %r1, 16
...@@ -692,6 +696,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)...@@ -692,6 +696,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
692 SAVE_VECTOR_UNALIGNED(%v29, 424+0x1D0)696 SAVE_VECTOR_UNALIGNED(%v29, 424+0x1D0)
693 SAVE_VECTOR_UNALIGNED(%v30, 424+0x1E0)697 SAVE_VECTOR_UNALIGNED(%v30, 424+0x1E0)
694 SAVE_VECTOR_UNALIGNED(%v31, 424+0x1F0)698 SAVE_VECTOR_UNALIGNED(%v31, 424+0x1F0)
699#endif
695700
696 li %r3, 0 // return UNW_ESUCCESS701 li %r3, 0 // return UNW_ESUCCESS
697 blr702 blr
lib/libunwind/src/Unwind_AppleExtras.cpp-70
...@@ -8,35 +8,6 @@...@@ -8,35 +8,6 @@
8//===----------------------------------------------------------------------===//8//===----------------------------------------------------------------------===//
99
10#include "config.h"10#include "config.h"
11#include "AddressSpace.hpp"
12#include "DwarfParser.hpp"
13
14
15// private keymgr stuff
16#define KEYMGR_GCC3_DW2_OBJ_LIST 302
17extern "C" {
18 extern void _keymgr_set_and_unlock_processwide_ptr(int key, void *ptr);
19 extern void *_keymgr_get_and_lock_processwide_ptr(int key);
20}
21
22// undocumented libgcc "struct object"
23struct libgcc_object {
24 void *start;
25 void *unused1;
26 void *unused2;
27 void *fde;
28 unsigned long encoding;
29 void *fde_end;
30 libgcc_object *next;
31};
32
33// undocumented libgcc "struct km_object_info" referenced by
34// KEYMGR_GCC3_DW2_OBJ_LIST
35struct libgcc_object_info {
36 libgcc_object *seen_objects;
37 libgcc_object *unseen_objects;
38 unsigned spare[2];
39};
4011
4112
42// static linker symbols to prevent wrong two level namespace for _Unwind symbols13// static linker symbols to prevent wrong two level namespace for _Unwind symbols
...@@ -140,44 +111,3 @@ NOT_HERE_BEFORE_5_0(_Unwind_SjLj_Resume_or_Rethrow)...@@ -140,44 +111,3 @@ NOT_HERE_BEFORE_5_0(_Unwind_SjLj_Resume_or_Rethrow)
140NOT_HERE_BEFORE_5_0(_Unwind_SjLj_Unregister)111NOT_HERE_BEFORE_5_0(_Unwind_SjLj_Unregister)
141112
142#endif // defined(_LIBUNWIND_BUILD_SJLJ_APIS)113#endif // defined(_LIBUNWIND_BUILD_SJLJ_APIS)
143
144
145namespace libunwind {
146
147_LIBUNWIND_HIDDEN
148bool checkKeyMgrRegisteredFDEs(uintptr_t pc, void *&fde) {
149#if __MAC_OS_X_VERSION_MIN_REQUIRED
150 // lastly check for old style keymgr registration of dynamically generated
151 // FDEs acquire exclusive access to libgcc_object_info
152 libgcc_object_info *head = (libgcc_object_info *)
153 _keymgr_get_and_lock_processwide_ptr(KEYMGR_GCC3_DW2_OBJ_LIST);
154 if (head != NULL) {
155 // look at each FDE in keymgr
156 for (libgcc_object *ob = head->unseen_objects; ob != NULL; ob = ob->next) {
157 CFI_Parser<LocalAddressSpace>::FDE_Info fdeInfo;
158 CFI_Parser<LocalAddressSpace>::CIE_Info cieInfo;
159 const char *msg = CFI_Parser<LocalAddressSpace>::decodeFDE(
160 LocalAddressSpace::sThisAddressSpace,
161 (uintptr_t)ob->fde, &fdeInfo, &cieInfo);
162 if (msg == NULL) {
163 // Check if this FDE is for a function that includes the pc
164 if ((fdeInfo.pcStart <= pc) && (pc < fdeInfo.pcEnd)) {
165 fde = (void*)fdeInfo.pcStart;
166 _keymgr_set_and_unlock_processwide_ptr(KEYMGR_GCC3_DW2_OBJ_LIST,
167 head);
168 return true;
169 }
170 }
171 }
172 }
173 // release libgcc_object_info
174 _keymgr_set_and_unlock_processwide_ptr(KEYMGR_GCC3_DW2_OBJ_LIST, head);
175#else
176 (void)pc;
177 (void)fde;
178#endif
179 return false;
180}
181
182}
183
lib/libunwind/src/assembly.h+20-4
...@@ -25,9 +25,6 @@...@@ -25,9 +25,6 @@
25#define PPC64_OFFS_VRSAVE 30425#define PPC64_OFFS_VRSAVE 304
26#define PPC64_OFFS_FP 31226#define PPC64_OFFS_FP 312
27#define PPC64_OFFS_V 82427#define PPC64_OFFS_V 824
28#ifdef _ARCH_PWR8
29#define PPC64_HAS_VMX
30#endif
31#elif defined(__APPLE__) && defined(__aarch64__)28#elif defined(__APPLE__) && defined(__aarch64__)
32#define SEPARATOR %%29#define SEPARATOR %%
33#else30#else
...@@ -48,6 +45,24 @@...@@ -48,6 +45,24 @@
48#define PPC64_OPD245#define PPC64_OPD2
49#endif46#endif
5047
48#if defined(__ARM_FEATURE_BTI_DEFAULT)
49 .pushsection ".note.gnu.property", "a" SEPARATOR \
50 .balign 8 SEPARATOR \
51 .long 4 SEPARATOR \
52 .long 0x10 SEPARATOR \
53 .long 0x5 SEPARATOR \
54 .asciz "GNU" SEPARATOR \
55 .long 0xc0000000 SEPARATOR /* GNU_PROPERTY_AARCH64_FEATURE_1_AND */ \
56 .long 4 SEPARATOR \
57 .long 3 SEPARATOR /* GNU_PROPERTY_AARCH64_FEATURE_1_BTI AND */ \
58 /* GNU_PROPERTY_AARCH64_FEATURE_1_PAC */ \
59 .long 0 SEPARATOR \
60 .popsection SEPARATOR
61#define AARCH64_BTI bti c
62#else
63#define AARCH64_BTI
64#endif
65
51#define GLUE2(a, b) a ## b66#define GLUE2(a, b) a ## b
52#define GLUE(a, b) GLUE2(a, b)67#define GLUE(a, b) GLUE2(a, b)
53#define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name)68#define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name)
...@@ -144,7 +159,8 @@...@@ -144,7 +159,8 @@
144 SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \159 SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \
145 PPC64_OPD1 \160 PPC64_OPD1 \
146 SYMBOL_NAME(name): \161 SYMBOL_NAME(name): \
147 PPC64_OPD2162 PPC64_OPD2 \
163 AARCH64_BTI
148164
149#if defined(__arm__)165#if defined(__arm__)
150#if !defined(__ARM_ARCH)166#if !defined(__ARM_ARCH)
lib/libunwind/src/config.h+39-15
...@@ -18,23 +18,15 @@...@@ -18,23 +18,15 @@
18#include <stdint.h>18#include <stdint.h>
19#include <stdlib.h>19#include <stdlib.h>
2020
21// Define static_assert() unless already defined by compiler.21#include <__libunwind_config.h>
22#ifndef __has_feature
23 #define __has_feature(__x) 0
24#endif
25#if !(__has_feature(cxx_static_assert)) && !defined(static_assert)
26 #define static_assert(__b, __m) \
27 extern int compile_time_assert_failed[ ( __b ) ? 1 : -1 ] \
28 __attribute__( ( unused ) );
29#endif
3022
31// Platform specific configuration defines.23// Platform specific configuration defines.
32#ifdef __APPLE__24#ifdef __APPLE__
33 #if defined(FOR_DYLD)25 #if defined(FOR_DYLD)
34 #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND26 #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND 1
35 #else27 #else
36 #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND28 #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND 1
37 #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 129 #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1
38 #endif30 #endif
39#elif defined(_WIN32)31#elif defined(_WIN32)
40 #ifdef __SEH__32 #ifdef __SEH__
...@@ -42,8 +34,19 @@...@@ -42,8 +34,19 @@
42 #else34 #else
43 #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 135 #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1
44 #endif36 #endif
37#elif defined(_LIBUNWIND_IS_BAREMETAL)
38 #if !defined(_LIBUNWIND_ARM_EHABI)
39 #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1
40 #define _LIBUNWIND_SUPPORT_DWARF_INDEX 1
41 #endif
42#elif defined(__BIONIC__) && defined(_LIBUNWIND_ARM_EHABI)
43 // For ARM EHABI, Bionic didn't implement dl_iterate_phdr until API 21. After
44 // API 21, dl_iterate_phdr exists, but dl_unwind_find_exidx is much faster.
45 #define _LIBUNWIND_USE_DL_UNWIND_FIND_EXIDX 1
45#else46#else
46 #if defined(__ARM_DWARF_EH__) || !defined(__arm__)47 // Assume an ELF system with a dl_iterate_phdr function.
48 #define _LIBUNWIND_USE_DL_ITERATE_PHDR 1
49 #if !defined(_LIBUNWIND_ARM_EHABI)
47 #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 150 #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1
48 #define _LIBUNWIND_SUPPORT_DWARF_INDEX 151 #define _LIBUNWIND_SUPPORT_DWARF_INDEX 1
49 #endif52 #endif
...@@ -91,6 +94,8 @@...@@ -91,6 +94,8 @@
91#error Unsupported target94#error Unsupported target
92#endif95#endif
9396
97// Apple/armv7k defaults to DWARF/Compact unwinding, but its libunwind also
98// needs to include the SJLJ APIs.
94#if (defined(__APPLE__) && defined(__arm__)) || defined(__USING_SJLJ_EXCEPTIONS__)99#if (defined(__APPLE__) && defined(__arm__)) || defined(__USING_SJLJ_EXCEPTIONS__)
95#define _LIBUNWIND_BUILD_SJLJ_APIS100#define _LIBUNWIND_BUILD_SJLJ_APIS
96#endif101#endif
...@@ -111,8 +116,27 @@...@@ -111,8 +116,27 @@
111#endif116#endif
112#endif117#endif
113118
114#if defined(__powerpc64__) && defined(_ARCH_PWR8)119#ifndef _LIBUNWIND_REMEMBER_HEAP_ALLOC
115#define PPC64_HAS_VMX120#if defined(_LIBUNWIND_REMEMBER_STACK_ALLOC) || defined(__APPLE__) || \
121 defined(__linux__) || defined(__ANDROID__) || defined(__MINGW32__) || \
122 defined(_LIBUNWIND_IS_BAREMETAL)
123#define _LIBUNWIND_REMEMBER_ALLOC(_size) alloca(_size)
124#define _LIBUNWIND_REMEMBER_FREE(_ptr) \
125 do { \
126 } while (0)
127#elif defined(_WIN32)
128#define _LIBUNWIND_REMEMBER_ALLOC(_size) _malloca(_size)
129#define _LIBUNWIND_REMEMBER_FREE(_ptr) _freea(_ptr)
130#define _LIBUNWIND_REMEMBER_CLEANUP_NEEDED
131#else
132#define _LIBUNWIND_REMEMBER_ALLOC(_size) malloc(_size)
133#define _LIBUNWIND_REMEMBER_FREE(_ptr) free(_ptr)
134#define _LIBUNWIND_REMEMBER_CLEANUP_NEEDED
135#endif
136#else /* _LIBUNWIND_REMEMBER_HEAP_ALLOC */
137#define _LIBUNWIND_REMEMBER_ALLOC(_size) malloc(_size)
138#define _LIBUNWIND_REMEMBER_FREE(_ptr) free(_ptr)
139#define _LIBUNWIND_REMEMBER_CLEANUP_NEEDED
116#endif140#endif
117141
118#if defined(NDEBUG) && defined(_LIBUNWIND_IS_BAREMETAL)142#if defined(NDEBUG) && defined(_LIBUNWIND_IS_BAREMETAL)
lib/libunwind/src/libunwind.cpp+2
...@@ -62,6 +62,8 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,...@@ -62,6 +62,8 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
62# define REGISTER_KIND Registers_sparc62# define REGISTER_KIND Registers_sparc
63#elif defined(__riscv) && __riscv_xlen == 6463#elif defined(__riscv) && __riscv_xlen == 64
64# define REGISTER_KIND Registers_riscv64# define REGISTER_KIND Registers_riscv
65#elif defined(__ve__)
66# define REGISTER_KIND Registers_ve
65#else67#else
66# error Architecture not supported68# error Architecture not supported
67#endif69#endif
lib/std/dwarf.zig+5-1
...@@ -157,6 +157,7 @@ const LineNumberProgram = struct {...@@ -157,6 +157,7 @@ const LineNumberProgram = struct {
157 include_dirs: []const []const u8,157 include_dirs: []const []const u8,
158 file_entries: *ArrayList(FileEntry),158 file_entries: *ArrayList(FileEntry),
159159
160 prev_valid: bool,
160 prev_address: usize,161 prev_address: usize,
161 prev_file: usize,162 prev_file: usize,
162 prev_line: i64,163 prev_line: i64,
...@@ -175,6 +176,7 @@ const LineNumberProgram = struct {...@@ -175,6 +176,7 @@ const LineNumberProgram = struct {
175 self.basic_block = false;176 self.basic_block = false;
176 self.end_sequence = false;177 self.end_sequence = false;
177 // Invalidate all the remaining fields178 // Invalidate all the remaining fields
179 self.prev_valid = false;
178 self.prev_address = 0;180 self.prev_address = 0;
179 self.prev_file = undefined;181 self.prev_file = undefined;
180 self.prev_line = undefined;182 self.prev_line = undefined;
...@@ -197,6 +199,7 @@ const LineNumberProgram = struct {...@@ -197,6 +199,7 @@ const LineNumberProgram = struct {
197 .file_entries = file_entries,199 .file_entries = file_entries,
198 .default_is_stmt = is_stmt,200 .default_is_stmt = is_stmt,
199 .target_address = target_address,201 .target_address = target_address,
202 .prev_valid = false,
200 .prev_address = 0,203 .prev_address = 0,
201 .prev_file = undefined,204 .prev_file = undefined,
202 .prev_line = undefined,205 .prev_line = undefined,
...@@ -208,7 +211,7 @@ const LineNumberProgram = struct {...@@ -208,7 +211,7 @@ const LineNumberProgram = struct {
208 }211 }
209212
210 pub fn checkLineMatch(self: *LineNumberProgram) !?debug.LineInfo {213 pub fn checkLineMatch(self: *LineNumberProgram) !?debug.LineInfo {
211 if (self.target_address >= self.prev_address and self.target_address < self.address) {214 if (self.prev_valid and self.target_address >= self.prev_address and self.target_address < self.address) {
212 const file_entry = if (self.prev_file == 0) {215 const file_entry = if (self.prev_file == 0) {
213 return error.MissingDebugInfo;216 return error.MissingDebugInfo;
214 } else if (self.prev_file - 1 >= self.file_entries.items.len) {217 } else if (self.prev_file - 1 >= self.file_entries.items.len) {
...@@ -228,6 +231,7 @@ const LineNumberProgram = struct {...@@ -228,6 +231,7 @@ const LineNumberProgram = struct {
228 };231 };
229 }232 }
230233
234 self.prev_valid = true;
231 self.prev_address = self.address;235 self.prev_address = self.address;
232 self.prev_file = self.file;236 self.prev_file = self.file;
233 self.prev_line = self.line;237 self.prev_line = self.line;
lib/std/target.zig+30-18
...@@ -36,11 +36,11 @@ pub const Target = struct {...@@ -36,11 +36,11 @@ pub const Target = struct {
36 openbsd,36 openbsd,
37 solaris,37 solaris,
38 windows,38 windows,
39 zos,
39 haiku,40 haiku,
40 minix,41 minix,
41 rtems,42 rtems,
42 nacl,43 nacl,
43 cnk,
44 aix,44 aix,
45 cuda,45 cuda,
46 nvcl,46 nvcl,
...@@ -232,11 +232,11 @@ pub const Target = struct {...@@ -232,11 +232,11 @@ pub const Target = struct {
232 .kfreebsd,232 .kfreebsd,
233 .lv2,233 .lv2,
234 .solaris,234 .solaris,
235 .zos,
235 .haiku,236 .haiku,
236 .minix,237 .minix,
237 .rtems,238 .rtems,
238 .nacl,239 .nacl,
239 .cnk,
240 .aix,240 .aix,
241 .cuda,241 .cuda,
242 .nvcl,242 .nvcl,
...@@ -391,10 +391,10 @@ pub const Target = struct {...@@ -391,10 +391,10 @@ pub const Target = struct {
391 .kfreebsd,391 .kfreebsd,
392 .lv2,392 .lv2,
393 .solaris,393 .solaris,
394 .zos,
394 .minix,395 .minix,
395 .rtems,396 .rtems,
396 .nacl,397 .nacl,
397 .cnk,
398 .aix,398 .aix,
399 .cuda,399 .cuda,
400 .nvcl,400 .nvcl,
...@@ -430,8 +430,8 @@ pub const Target = struct {...@@ -430,8 +430,8 @@ pub const Target = struct {
430 pub const powerpc = @import("target/powerpc.zig");430 pub const powerpc = @import("target/powerpc.zig");
431 pub const riscv = @import("target/riscv.zig");431 pub const riscv = @import("target/riscv.zig");
432 pub const sparc = @import("target/sparc.zig");432 pub const sparc = @import("target/sparc.zig");
433 pub const spirv = @import("target/spirv.zig");
434 pub const systemz = @import("target/systemz.zig");433 pub const systemz = @import("target/systemz.zig");
434 pub const ve = @import("target/ve.zig");
435 pub const wasm = @import("target/wasm.zig");435 pub const wasm = @import("target/wasm.zig");
436 pub const x86 = @import("target/x86.zig");436 pub const x86 = @import("target/x86.zig");
437437
...@@ -443,6 +443,7 @@ pub const Target = struct {...@@ -443,6 +443,7 @@ pub const Target = struct {
443 gnueabi,443 gnueabi,
444 gnueabihf,444 gnueabihf,
445 gnux32,445 gnux32,
446 gnuilp32,
446 code16,447 code16,
447 eabi,448 eabi,
448 eabihf,449 eabihf,
...@@ -468,10 +469,10 @@ pub const Target = struct {...@@ -468,10 +469,10 @@ pub const Target = struct {
468 .dragonfly,469 .dragonfly,
469 .lv2,470 .lv2,
470 .solaris,471 .solaris,
472 .zos,
471 .minix,473 .minix,
472 .rtems,474 .rtems,
473 .nacl,475 .nacl,
474 .cnk,
475 .aix,476 .aix,
476 .cuda,477 .cuda,
477 .nvcl,478 .nvcl,
...@@ -592,7 +593,7 @@ pub const Target = struct {...@@ -592,7 +593,7 @@ pub const Target = struct {
592 pub const Set = struct {593 pub const Set = struct {
593 ints: [usize_count]usize,594 ints: [usize_count]usize,
594595
595 pub const needed_bit_count = 168;596 pub const needed_bit_count = 172;
596 pub const byte_count = (needed_bit_count + 7) / 8;597 pub const byte_count = (needed_bit_count + 7) / 8;
597 pub const usize_count = (byte_count + (@sizeOf(usize) - 1)) / @sizeOf(usize);598 pub const usize_count = (byte_count + (@sizeOf(usize) - 1)) / @sizeOf(usize);
598 pub const Index = std.math.Log2Int(std.meta.Int(.unsigned, usize_count * @bitSizeOf(usize)));599 pub const Index = std.math.Log2Int(std.meta.Int(.unsigned, usize_count * @bitSizeOf(usize)));
...@@ -714,6 +715,7 @@ pub const Target = struct {...@@ -714,6 +715,7 @@ pub const Target = struct {
714 avr,715 avr,
715 bpfel,716 bpfel,
716 bpfeb,717 bpfeb,
718 csky,
717 hexagon,719 hexagon,
718 mips,720 mips,
719 mipsel,721 mipsel,
...@@ -721,6 +723,7 @@ pub const Target = struct {...@@ -721,6 +723,7 @@ pub const Target = struct {
721 mips64el,723 mips64el,
722 msp430,724 msp430,
723 powerpc,725 powerpc,
726 powerpcle,
724 powerpc64,727 powerpc64,
725 powerpc64le,728 powerpc64le,
726 r600,729 r600,
...@@ -831,7 +834,7 @@ pub const Target = struct {...@@ -831,7 +834,7 @@ pub const Target = struct {
831 .le32 => ._NONE,834 .le32 => ._NONE,
832 .mips => ._MIPS,835 .mips => ._MIPS,
833 .mipsel => ._MIPS_RS3_LE,836 .mipsel => ._MIPS_RS3_LE,
834 .powerpc => ._PPC,837 .powerpc, .powerpcle => ._PPC,
835 .r600 => ._NONE,838 .r600 => ._NONE,
836 .riscv32 => ._RISCV,839 .riscv32 => ._RISCV,
837 .sparc => ._SPARC,840 .sparc => ._SPARC,
...@@ -870,6 +873,7 @@ pub const Target = struct {...@@ -870,6 +873,7 @@ pub const Target = struct {
870 .amdgcn => ._NONE,873 .amdgcn => ._NONE,
871 .bpfel => ._BPF,874 .bpfel => ._BPF,
872 .bpfeb => ._BPF,875 .bpfeb => ._BPF,
876 .csky => ._NONE,
873 .sparcv9 => ._SPARCV9,877 .sparcv9 => ._SPARCV9,
874 .s390x => ._S390,878 .s390x => ._S390,
875 .ve => ._NONE,879 .ve => ._NONE,
...@@ -890,7 +894,7 @@ pub const Target = struct {...@@ -890,7 +894,7 @@ pub const Target = struct {
890 .le32 => .Unknown,894 .le32 => .Unknown,
891 .mips => .Unknown,895 .mips => .Unknown,
892 .mipsel => .Unknown,896 .mipsel => .Unknown,
893 .powerpc => .POWERPC,897 .powerpc, .powerpcle => .POWERPC,
894 .r600 => .Unknown,898 .r600 => .Unknown,
895 .riscv32 => .RISCV32,899 .riscv32 => .RISCV32,
896 .sparc => .Unknown,900 .sparc => .Unknown,
...@@ -929,6 +933,7 @@ pub const Target = struct {...@@ -929,6 +933,7 @@ pub const Target = struct {
929 .amdgcn => .Unknown,933 .amdgcn => .Unknown,
930 .bpfel => .Unknown,934 .bpfel => .Unknown,
931 .bpfeb => .Unknown,935 .bpfeb => .Unknown,
936 .csky => .Unknown,
932 .sparcv9 => .Unknown,937 .sparcv9 => .Unknown,
933 .s390x => .Unknown,938 .s390x => .Unknown,
934 .ve => .Unknown,939 .ve => .Unknown,
...@@ -948,6 +953,7 @@ pub const Target = struct {...@@ -948,6 +953,7 @@ pub const Target = struct {
948 .amdil,953 .amdil,
949 .amdil64,954 .amdil64,
950 .bpfel,955 .bpfel,
956 .csky,
951 .hexagon,957 .hexagon,
952 .hsail,958 .hsail,
953 .hsail64,959 .hsail64,
...@@ -961,6 +967,7 @@ pub const Target = struct {...@@ -961,6 +967,7 @@ pub const Target = struct {
961 .nvptx64,967 .nvptx64,
962 .sparcel,968 .sparcel,
963 .tcele,969 .tcele,
970 .powerpcle,
964 .powerpc64le,971 .powerpc64le,
965 .r600,972 .r600,
966 .riscv32,973 .riscv32,
...@@ -1011,11 +1018,13 @@ pub const Target = struct {...@@ -1011,11 +1018,13 @@ pub const Target = struct {
1011 .arc,1018 .arc,
1012 .arm,1019 .arm,
1013 .armeb,1020 .armeb,
1021 .csky,
1014 .hexagon,1022 .hexagon,
1015 .le32,1023 .le32,
1016 .mips,1024 .mips,
1017 .mipsel,1025 .mipsel,
1018 .powerpc,1026 .powerpc,
1027 .powerpcle,
1019 .r600,1028 .r600,
1020 .riscv32,1029 .riscv32,
1021 .sparc,1030 .sparc,
...@@ -1065,17 +1074,14 @@ pub const Target = struct {...@@ -1065,17 +1074,14 @@ pub const Target = struct {
1065 }1074 }
1066 }1075 }
10671076
1068 /// Returns a name that matches the lib/std/target/* directory name.1077 /// Returns a name that matches the lib/std/target/* source file name.
1069 pub fn genericName(arch: Arch) []const u8 {1078 pub fn genericName(arch: Arch) []const u8 {
1070 return switch (arch) {1079 return switch (arch) {
1071 .arm, .armeb, .thumb, .thumbeb => "arm",1080 .arm, .armeb, .thumb, .thumbeb => "arm",
1072 .aarch64, .aarch64_be, .aarch64_32 => "aarch64",1081 .aarch64, .aarch64_be, .aarch64_32 => "aarch64",
1073 .avr => "avr",
1074 .bpfel, .bpfeb => "bpf",1082 .bpfel, .bpfeb => "bpf",
1075 .hexagon => "hexagon",
1076 .mips, .mipsel, .mips64, .mips64el => "mips",1083 .mips, .mipsel, .mips64, .mips64el => "mips",
1077 .msp430 => "msp430",1084 .powerpc, .powerpcle, .powerpc64, .powerpc64le => "powerpc",
1078 .powerpc, .powerpc64, .powerpc64le => "powerpc",
1079 .amdgcn => "amdgpu",1085 .amdgcn => "amdgpu",
1080 .riscv32, .riscv64 => "riscv",1086 .riscv32, .riscv64 => "riscv",
1081 .sparc, .sparcv9, .sparcel => "sparc",1087 .sparc, .sparcv9, .sparcel => "sparc",
...@@ -1098,13 +1104,14 @@ pub const Target = struct {...@@ -1098,13 +1104,14 @@ pub const Target = struct {
1098 .hexagon => &hexagon.all_features,1104 .hexagon => &hexagon.all_features,
1099 .mips, .mipsel, .mips64, .mips64el => &mips.all_features,1105 .mips, .mipsel, .mips64, .mips64el => &mips.all_features,
1100 .msp430 => &msp430.all_features,1106 .msp430 => &msp430.all_features,
1101 .powerpc, .powerpc64, .powerpc64le => &powerpc.all_features,1107 .powerpc, .powerpcle, .powerpc64, .powerpc64le => &powerpc.all_features,
1102 .amdgcn => &amdgpu.all_features,1108 .amdgcn => &amdgpu.all_features,
1103 .riscv32, .riscv64 => &riscv.all_features,1109 .riscv32, .riscv64 => &riscv.all_features,
1104 .sparc, .sparcv9, .sparcel => &sparc.all_features,1110 .sparc, .sparcv9, .sparcel => &sparc.all_features,
1105 .s390x => &systemz.all_features,1111 .s390x => &systemz.all_features,
1106 .i386, .x86_64 => &x86.all_features,1112 .i386, .x86_64 => &x86.all_features,
1107 .nvptx, .nvptx64 => &nvptx.all_features,1113 .nvptx, .nvptx64 => &nvptx.all_features,
1114 .ve => &ve.all_features,
1108 .wasm32, .wasm64 => &wasm.all_features,1115 .wasm32, .wasm64 => &wasm.all_features,
11091116
1110 else => &[0]Cpu.Feature{},1117 else => &[0]Cpu.Feature{},
...@@ -1121,13 +1128,14 @@ pub const Target = struct {...@@ -1121,13 +1128,14 @@ pub const Target = struct {
1121 .hexagon => comptime allCpusFromDecls(hexagon.cpu),1128 .hexagon => comptime allCpusFromDecls(hexagon.cpu),
1122 .mips, .mipsel, .mips64, .mips64el => comptime allCpusFromDecls(mips.cpu),1129 .mips, .mipsel, .mips64, .mips64el => comptime allCpusFromDecls(mips.cpu),
1123 .msp430 => comptime allCpusFromDecls(msp430.cpu),1130 .msp430 => comptime allCpusFromDecls(msp430.cpu),
1124 .powerpc, .powerpc64, .powerpc64le => comptime allCpusFromDecls(powerpc.cpu),1131 .powerpc, .powerpcle, .powerpc64, .powerpc64le => comptime allCpusFromDecls(powerpc.cpu),
1125 .amdgcn => comptime allCpusFromDecls(amdgpu.cpu),1132 .amdgcn => comptime allCpusFromDecls(amdgpu.cpu),
1126 .riscv32, .riscv64 => comptime allCpusFromDecls(riscv.cpu),1133 .riscv32, .riscv64 => comptime allCpusFromDecls(riscv.cpu),
1127 .sparc, .sparcv9, .sparcel => comptime allCpusFromDecls(sparc.cpu),1134 .sparc, .sparcv9, .sparcel => comptime allCpusFromDecls(sparc.cpu),
1128 .s390x => comptime allCpusFromDecls(systemz.cpu),1135 .s390x => comptime allCpusFromDecls(systemz.cpu),
1129 .i386, .x86_64 => comptime allCpusFromDecls(x86.cpu),1136 .i386, .x86_64 => comptime allCpusFromDecls(x86.cpu),
1130 .nvptx, .nvptx64 => comptime allCpusFromDecls(nvptx.cpu),1137 .nvptx, .nvptx64 => comptime allCpusFromDecls(nvptx.cpu),
1138 .ve => comptime allCpusFromDecls(ve.cpu),
1131 .wasm32, .wasm64 => comptime allCpusFromDecls(wasm.cpu),1139 .wasm32, .wasm64 => comptime allCpusFromDecls(wasm.cpu),
11321140
1133 else => &[0]*const Model{},1141 else => &[0]*const Model{},
...@@ -1177,17 +1185,19 @@ pub const Target = struct {...@@ -1177,17 +1185,19 @@ pub const Target = struct {
1177 .mips64, .mips64el => &mips.cpu.mips64,1185 .mips64, .mips64el => &mips.cpu.mips64,
1178 .msp430 => &msp430.cpu.generic,1186 .msp430 => &msp430.cpu.generic,
1179 .powerpc => &powerpc.cpu.ppc32,1187 .powerpc => &powerpc.cpu.ppc32,
1188 .powerpcle => &powerpc.cpu.ppc32,
1180 .powerpc64 => &powerpc.cpu.ppc64,1189 .powerpc64 => &powerpc.cpu.ppc64,
1181 .powerpc64le => &powerpc.cpu.ppc64le,1190 .powerpc64le => &powerpc.cpu.ppc64le,
1182 .amdgcn => &amdgpu.cpu.generic,1191 .amdgcn => &amdgpu.cpu.generic,
1183 .riscv32 => &riscv.cpu.generic_rv32,1192 .riscv32 => &riscv.cpu.generic_rv32,
1184 .riscv64 => &riscv.cpu.generic_rv64,1193 .riscv64 => &riscv.cpu.generic_rv64,
1185 .sparc, .sparcel => &sparc.cpu.v8,1194 .sparc, .sparcel => &sparc.cpu.generic,
1186 .sparcv9 => &sparc.cpu.v9,1195 .sparcv9 => &sparc.cpu.v9,
1187 .s390x => &systemz.cpu.generic,1196 .s390x => &systemz.cpu.generic,
1188 .i386 => &x86.cpu._i386,1197 .i386 => &x86.cpu._i386,
1189 .x86_64 => &x86.cpu.x86_64,1198 .x86_64 => &x86.cpu.x86_64,
1190 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,1199 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,
1200 .ve => &ve.cpu.generic,
1191 .wasm32, .wasm64 => &wasm.cpu.generic,1201 .wasm32, .wasm64 => &wasm.cpu.generic,
11921202
1193 else => &S.generic_model,1203 else => &S.generic_model,
...@@ -1201,6 +1211,7 @@ pub const Target = struct {...@@ -1201,6 +1211,7 @@ pub const Target = struct {
1201 .riscv64 => &riscv.cpu.baseline_rv64,1211 .riscv64 => &riscv.cpu.baseline_rv64,
1202 .i386 => &x86.cpu.pentium4,1212 .i386 => &x86.cpu.pentium4,
1203 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,1213 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,
1214 .sparc, .sparcel => &sparc.cpu.v8,
12041215
1205 else => generic(arch),1216 else => generic(arch),
1206 };1217 };
...@@ -1490,7 +1501,7 @@ pub const Target = struct {...@@ -1490,7 +1501,7 @@ pub const Target = struct {
1490 return print(&result, "/lib{s}/{s}", .{ lib_suffix, loader });1501 return print(&result, "/lib{s}/{s}", .{ lib_suffix, loader });
1491 },1502 },
14921503
1493 .powerpc => return copy(&result, "/lib/ld.so.1"),1504 .powerpc, .powerpcle => return copy(&result, "/lib/ld.so.1"),
1494 .powerpc64, .powerpc64le => return copy(&result, "/lib64/ld64.so.2"),1505 .powerpc64, .powerpc64le => return copy(&result, "/lib64/ld64.so.2"),
1495 .s390x => return copy(&result, "/lib64/ld64.so.1"),1506 .s390x => return copy(&result, "/lib64/ld64.so.1"),
1496 .sparcv9 => return copy(&result, "/lib64/ld-linux.so.2"),1507 .sparcv9 => return copy(&result, "/lib64/ld-linux.so.2"),
...@@ -1519,6 +1530,7 @@ pub const Target = struct {...@@ -1519,6 +1530,7 @@ pub const Target = struct {
1519 // TODO go over each item in this list and either move it to the above list, or1530 // TODO go over each item in this list and either move it to the above list, or
1520 // implement the standard dynamic linker path code for it.1531 // implement the standard dynamic linker path code for it.
1521 .arc,1532 .arc,
1533 .csky,
1522 .hexagon,1534 .hexagon,
1523 .msp430,1535 .msp430,
1524 .r600,1536 .r600,
...@@ -1573,10 +1585,10 @@ pub const Target = struct {...@@ -1573,10 +1585,10 @@ pub const Target = struct {
1573 .kfreebsd,1585 .kfreebsd,
1574 .lv2,1586 .lv2,
1575 .solaris,1587 .solaris,
1588 .zos,
1576 .minix,1589 .minix,
1577 .rtems,1590 .rtems,
1578 .nacl,1591 .nacl,
1579 .cnk,
1580 .aix,1592 .aix,
1581 .cuda,1593 .cuda,
1582 .nvcl,1594 .nvcl,
lib/std/target/aarch64.zig+311-147
...@@ -1,14 +1,10 @@...@@ -1,14 +1,10 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
96
10pub const Feature = enum {7pub const Feature = enum {
11 a34,
12 a65,8 a65,
13 a76,9 a76,
14 aes,10 aes,
...@@ -17,8 +13,6 @@ pub const Feature = enum {...@@ -17,8 +13,6 @@ pub const Feature = enum {
17 altnzcv,13 altnzcv,
18 am,14 am,
19 amvs,15 amvs,
20 apple_a10,
21 apple_a11,
22 apple_a12,16 apple_a12,
23 apple_a13,17 apple_a13,
24 apple_a7,18 apple_a7,
...@@ -26,6 +20,7 @@ pub const Feature = enum {...@@ -26,6 +20,7 @@ pub const Feature = enum {
26 arith_cbz_fusion,20 arith_cbz_fusion,
27 balance_fp_ops,21 balance_fp_ops,
28 bf16,22 bf16,
23 brbe,
29 bti,24 bti,
30 call_saved_x10,25 call_saved_x10,
31 call_saved_x11,26 call_saved_x11,
...@@ -39,7 +34,11 @@ pub const Feature = enum {...@@ -39,7 +34,11 @@ pub const Feature = enum {
39 ccdp,34 ccdp,
40 ccidx,35 ccidx,
41 ccpp,36 ccpp,
37 cmp_bcc_fusion,
42 complxnum,38 complxnum,
39 contextidr_el2,
40 cortex_a78c,
41 cortex_r82,
43 crc,42 crc,
44 crypto,43 crypto,
45 custom_cheap_as_move,44 custom_cheap_as_move,
...@@ -49,14 +48,14 @@ pub const Feature = enum {...@@ -49,14 +48,14 @@ pub const Feature = enum {
49 ecv,48 ecv,
50 ete,49 ete,
51 exynos_cheap_as_move,50 exynos_cheap_as_move,
52 exynosm4,51 exynos_m4,
53 f32mm,52 f32mm,
54 f64mm,53 f64mm,
55 fgt,54 fgt,
56 fmi,55 flagm,
57 force_32bit_jump_tables,56 force_32bit_jump_tables,
58 fp_armv8,
59 fp16fml,57 fp16fml,
58 fp_armv8,
60 fptoint,59 fptoint,
61 fullfp16,60 fullfp16,
62 fuse_address,61 fuse_address,
...@@ -67,28 +66,32 @@ pub const Feature = enum {...@@ -67,28 +66,32 @@ pub const Feature = enum {
67 fuse_literals,66 fuse_literals,
68 harden_sls_blr,67 harden_sls_blr,
69 harden_sls_retbr,68 harden_sls_retbr,
69 hcx,
70 i8mm,70 i8mm,
71 jsconv,71 jsconv,
72 lor,72 lor,
73 ls64,
73 lse,74 lse,
74 lsl_fast,75 lsl_fast,
75 mpam,76 mpam,
76 mte,77 mte,
77 neon,78 neon,
78 neoversee1,79 neoverse_e1,
79 neoversen1,80 neoverse_n1,
81 neoverse_n2,
82 neoverse_v1,
80 no_neg_immediates,83 no_neg_immediates,
81 nv,84 nv,
82 pa,85 outline_atomics,
83 pan,86 pan,
84 pan_rwv,87 pan_rwv,
88 pauth,
85 perfmon,89 perfmon,
86 pmu,90 pmu,
87 predictable_select_expensive,91 predictable_select_expensive,
88 predres,92 predres,
89 rand,93 rand,
90 ras,94 ras,
91 rasv8_4,
92 rcpc,95 rcpc,
93 rcpc_immo,96 rcpc_immo,
94 rdm,97 rdm,
...@@ -126,6 +129,7 @@ pub const Feature = enum {...@@ -126,6 +129,7 @@ pub const Feature = enum {
126 slow_strqro_store,129 slow_strqro_store,
127 sm4,130 sm4,
128 spe,131 spe,
132 spe_eef,
129 specrestrict,133 specrestrict,
130 ssbs,134 ssbs,
131 strict_align,135 strict_align,
...@@ -148,14 +152,18 @@ pub const Feature = enum {...@@ -148,14 +152,18 @@ pub const Feature = enum {
148 use_experimental_zeroing_pseudos,152 use_experimental_zeroing_pseudos,
149 use_postra_scheduler,153 use_postra_scheduler,
150 use_reciprocal_square_root,154 use_reciprocal_square_root,
151 v8a,
152 v8_1a,155 v8_1a,
153 v8_2a,156 v8_2a,
154 v8_3a,157 v8_3a,
155 v8_4a,158 v8_4a,
156 v8_5a,159 v8_5a,
157 v8_6a,160 v8_6a,
161 v8_7a,
162 v8a,
163 v8r,
158 vh,164 vh,
165 wfxt,
166 xs,
159 zcm,167 zcm,
160 zcz,168 zcz,
161 zcz_fp,169 zcz_fp,
...@@ -170,26 +178,16 @@ pub const all_features = blk: {...@@ -170,26 +178,16 @@ pub const all_features = blk: {
170 const len = @typeInfo(Feature).Enum.fields.len;178 const len = @typeInfo(Feature).Enum.fields.len;
171 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);179 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
172 var result: [len]CpuFeature = undefined;180 var result: [len]CpuFeature = undefined;
173 result[@enumToInt(Feature.a34)] = .{
174 .llvm_name = "a35",
175 .description = "Cortex-A34 ARM processors",
176 .dependencies = featureSet(&[_]Feature{
177 .crc,
178 .crypto,
179 .perfmon,
180 .v8a,
181 }),
182 };
183 result[@enumToInt(Feature.a65)] = .{181 result[@enumToInt(Feature.a65)] = .{
184 .llvm_name = "a65",182 .llvm_name = "a65",
185 .description = "Cortex-A65 ARM processors",183 .description = "Cortex-A65 ARM processors",
186 .dependencies = featureSet(&[_]Feature{184 .dependencies = featureSet(&[_]Feature{
187 .crypto,185 .crypto,
188 .dotprod,186 .dotprod,
189 .fp_armv8,
190 .fullfp16,187 .fullfp16,
191 .neon,188 .fuse_address,
192 .ras,189 .fuse_aes,
190 .fuse_literals,
193 .rcpc,191 .rcpc,
194 .ssbs,192 .ssbs,
195 .v8_2a,193 .v8_2a,
...@@ -202,6 +200,7 @@ pub const all_features = blk: {...@@ -202,6 +200,7 @@ pub const all_features = blk: {
202 .crypto,200 .crypto,
203 .dotprod,201 .dotprod,
204 .fullfp16,202 .fullfp16,
203 .fuse_aes,
205 .rcpc,204 .rcpc,
206 .ssbs,205 .ssbs,
207 .v8_2a,206 .v8_2a,
...@@ -241,49 +240,6 @@ pub const all_features = blk: {...@@ -241,49 +240,6 @@ pub const all_features = blk: {
241 .am,240 .am,
242 }),241 }),
243 };242 };
244 result[@enumToInt(Feature.apple_a10)] = .{
245 .llvm_name = "apple-a10",
246 .description = "Apple A10",
247 .dependencies = featureSet(&[_]Feature{
248 .alternate_sextload_cvt_f32_pattern,
249 .arith_bcc_fusion,
250 .arith_cbz_fusion,
251 .crc,
252 .crypto,
253 .disable_latency_sched_heuristic,
254 .fp_armv8,
255 .fuse_aes,
256 .fuse_crypto_eor,
257 .lor,
258 .neon,
259 .pan,
260 .perfmon,
261 .rdm,
262 .vh,
263 .zcm,
264 .zcz,
265 }),
266 };
267 result[@enumToInt(Feature.apple_a11)] = .{
268 .llvm_name = "apple-a11",
269 .description = "Apple A11",
270 .dependencies = featureSet(&[_]Feature{
271 .alternate_sextload_cvt_f32_pattern,
272 .arith_bcc_fusion,
273 .arith_cbz_fusion,
274 .crypto,
275 .disable_latency_sched_heuristic,
276 .fp_armv8,
277 .fullfp16,
278 .fuse_aes,
279 .fuse_crypto_eor,
280 .neon,
281 .perfmon,
282 .v8_2a,
283 .zcm,
284 .zcz,
285 }),
286 };
287 result[@enumToInt(Feature.apple_a12)] = .{243 result[@enumToInt(Feature.apple_a12)] = .{
288 .llvm_name = "apple-a12",244 .llvm_name = "apple-a12",
289 .description = "Apple A12",245 .description = "Apple A12",
...@@ -293,11 +249,9 @@ pub const all_features = blk: {...@@ -293,11 +249,9 @@ pub const all_features = blk: {
293 .arith_cbz_fusion,249 .arith_cbz_fusion,
294 .crypto,250 .crypto,
295 .disable_latency_sched_heuristic,251 .disable_latency_sched_heuristic,
296 .fp_armv8,
297 .fullfp16,252 .fullfp16,
298 .fuse_aes,253 .fuse_aes,
299 .fuse_crypto_eor,254 .fuse_crypto_eor,
300 .neon,
301 .perfmon,255 .perfmon,
302 .v8_3a,256 .v8_3a,
303 .zcm,257 .zcm,
...@@ -313,12 +267,9 @@ pub const all_features = blk: {...@@ -313,12 +267,9 @@ pub const all_features = blk: {
313 .arith_cbz_fusion,267 .arith_cbz_fusion,
314 .crypto,268 .crypto,
315 .disable_latency_sched_heuristic,269 .disable_latency_sched_heuristic,
316 .fp_armv8,
317 .fp16fml,270 .fp16fml,
318 .fullfp16,
319 .fuse_aes,271 .fuse_aes,
320 .fuse_crypto_eor,272 .fuse_crypto_eor,
321 .neon,
322 .perfmon,273 .perfmon,
323 .sha3,274 .sha3,
324 .v8_4a,275 .v8_4a,
...@@ -335,10 +286,8 @@ pub const all_features = blk: {...@@ -335,10 +286,8 @@ pub const all_features = blk: {
335 .arith_cbz_fusion,286 .arith_cbz_fusion,
336 .crypto,287 .crypto,
337 .disable_latency_sched_heuristic,288 .disable_latency_sched_heuristic,
338 .fp_armv8,
339 .fuse_aes,289 .fuse_aes,
340 .fuse_crypto_eor,290 .fuse_crypto_eor,
341 .neon,
342 .perfmon,291 .perfmon,
343 .zcm,292 .zcm,
344 .zcz,293 .zcz,
...@@ -365,6 +314,11 @@ pub const all_features = blk: {...@@ -365,6 +314,11 @@ pub const all_features = blk: {
365 .description = "Enable BFloat16 Extension",314 .description = "Enable BFloat16 Extension",
366 .dependencies = featureSet(&[_]Feature{}),315 .dependencies = featureSet(&[_]Feature{}),
367 };316 };
317 result[@enumToInt(Feature.brbe)] = .{
318 .llvm_name = "brbe",
319 .description = "Enable Branch Record Buffer Extension",
320 .dependencies = featureSet(&[_]Feature{}),
321 };
368 result[@enumToInt(Feature.bti)] = .{322 result[@enumToInt(Feature.bti)] = .{
369 .llvm_name = "bti",323 .llvm_name = "bti",
370 .description = "Enable Branch Target Identification",324 .description = "Enable Branch Target Identification",
...@@ -430,6 +384,11 @@ pub const all_features = blk: {...@@ -430,6 +384,11 @@ pub const all_features = blk: {
430 .description = "Enable v8.2 data Cache Clean to Point of Persistence",384 .description = "Enable v8.2 data Cache Clean to Point of Persistence",
431 .dependencies = featureSet(&[_]Feature{}),385 .dependencies = featureSet(&[_]Feature{}),
432 };386 };
387 result[@enumToInt(Feature.cmp_bcc_fusion)] = .{
388 .llvm_name = "cmp-bcc-fusion",
389 .description = "CPU fuses cmp+bcc operations",
390 .dependencies = featureSet(&[_]Feature{}),
391 };
433 result[@enumToInt(Feature.complxnum)] = .{392 result[@enumToInt(Feature.complxnum)] = .{
434 .llvm_name = "complxnum",393 .llvm_name = "complxnum",
435 .description = "Enable v8.3-A Floating-point complex number support",394 .description = "Enable v8.3-A Floating-point complex number support",
...@@ -437,6 +396,38 @@ pub const all_features = blk: {...@@ -437,6 +396,38 @@ pub const all_features = blk: {
437 .neon,396 .neon,
438 }),397 }),
439 };398 };
399 result[@enumToInt(Feature.contextidr_el2)] = .{
400 .llvm_name = "CONTEXTIDREL2",
401 .description = "Enable RW operand Context ID Register (EL2)",
402 .dependencies = featureSet(&[_]Feature{}),
403 };
404 result[@enumToInt(Feature.cortex_a78c)] = .{
405 .llvm_name = "cortex-a78c",
406 .description = "Cortex-A78C ARM processors",
407 .dependencies = featureSet(&[_]Feature{
408 .cmp_bcc_fusion,
409 .crypto,
410 .dotprod,
411 .flagm,
412 .fp16fml,
413 .fuse_aes,
414 .pauth,
415 .perfmon,
416 .rcpc,
417 .spe,
418 .ssbs,
419 .use_postra_scheduler,
420 .v8_2a,
421 }),
422 };
423 result[@enumToInt(Feature.cortex_r82)] = .{
424 .llvm_name = "cortex-r82",
425 .description = "Cortex-R82 ARM Processors",
426 .dependencies = featureSet(&[_]Feature{
427 .use_postra_scheduler,
428 .v8r,
429 }),
430 };
440 result[@enumToInt(Feature.crc)] = .{431 result[@enumToInt(Feature.crc)] = .{
441 .llvm_name = "crc",432 .llvm_name = "crc",
442 .description = "Enable ARMv8 CRC-32 checksum instructions",433 .description = "Enable ARMv8 CRC-32 checksum instructions",
...@@ -447,7 +438,6 @@ pub const all_features = blk: {...@@ -447,7 +438,6 @@ pub const all_features = blk: {
447 .description = "Enable cryptographic instructions",438 .description = "Enable cryptographic instructions",
448 .dependencies = featureSet(&[_]Feature{439 .dependencies = featureSet(&[_]Feature{
449 .aes,440 .aes,
450 .neon,
451 .sha2,441 .sha2,
452 }),442 }),
453 };443 };
...@@ -490,7 +480,7 @@ pub const all_features = blk: {...@@ -490,7 +480,7 @@ pub const all_features = blk: {
490 .custom_cheap_as_move,480 .custom_cheap_as_move,
491 }),481 }),
492 };482 };
493 result[@enumToInt(Feature.exynosm4)] = .{483 result[@enumToInt(Feature.exynos_m4)] = .{
494 .llvm_name = "exynosm4",484 .llvm_name = "exynosm4",
495 .description = "Samsung Exynos-M4 processors",485 .description = "Samsung Exynos-M4 processors",
496 .dependencies = featureSet(&[_]Feature{486 .dependencies = featureSet(&[_]Feature{
...@@ -532,8 +522,8 @@ pub const all_features = blk: {...@@ -532,8 +522,8 @@ pub const all_features = blk: {
532 .description = "Enable fine grained virtualization traps extension",522 .description = "Enable fine grained virtualization traps extension",
533 .dependencies = featureSet(&[_]Feature{}),523 .dependencies = featureSet(&[_]Feature{}),
534 };524 };
535 result[@enumToInt(Feature.fmi)] = .{525 result[@enumToInt(Feature.flagm)] = .{
536 .llvm_name = "fmi",526 .llvm_name = "flagm",
537 .description = "Enable v8.4-A Flag Manipulation Instructions",527 .description = "Enable v8.4-A Flag Manipulation Instructions",
538 .dependencies = featureSet(&[_]Feature{}),528 .dependencies = featureSet(&[_]Feature{}),
539 };529 };
...@@ -542,11 +532,6 @@ pub const all_features = blk: {...@@ -542,11 +532,6 @@ pub const all_features = blk: {
542 .description = "Force jump table entries to be 32-bits wide except at MinSize",532 .description = "Force jump table entries to be 32-bits wide except at MinSize",
543 .dependencies = featureSet(&[_]Feature{}),533 .dependencies = featureSet(&[_]Feature{}),
544 };534 };
545 result[@enumToInt(Feature.fp_armv8)] = .{
546 .llvm_name = "fp-armv8",
547 .description = "Enable ARMv8 FP",
548 .dependencies = featureSet(&[_]Feature{}),
549 };
550 result[@enumToInt(Feature.fp16fml)] = .{535 result[@enumToInt(Feature.fp16fml)] = .{
551 .llvm_name = "fp16fml",536 .llvm_name = "fp16fml",
552 .description = "Enable FP16 FML instructions",537 .description = "Enable FP16 FML instructions",
...@@ -554,6 +539,11 @@ pub const all_features = blk: {...@@ -554,6 +539,11 @@ pub const all_features = blk: {
554 .fullfp16,539 .fullfp16,
555 }),540 }),
556 };541 };
542 result[@enumToInt(Feature.fp_armv8)] = .{
543 .llvm_name = "fp-armv8",
544 .description = "Enable ARMv8 FP",
545 .dependencies = featureSet(&[_]Feature{}),
546 };
557 result[@enumToInt(Feature.fptoint)] = .{547 result[@enumToInt(Feature.fptoint)] = .{
558 .llvm_name = "fptoint",548 .llvm_name = "fptoint",
559 .description = "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int",549 .description = "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to an integer (in FP format) forcing it to fit into a 32- or 64-bit int",
...@@ -606,6 +596,11 @@ pub const all_features = blk: {...@@ -606,6 +596,11 @@ pub const all_features = blk: {
606 .description = "Harden against straight line speculation across RET and BR instructions",596 .description = "Harden against straight line speculation across RET and BR instructions",
607 .dependencies = featureSet(&[_]Feature{}),597 .dependencies = featureSet(&[_]Feature{}),
608 };598 };
599 result[@enumToInt(Feature.hcx)] = .{
600 .llvm_name = "hcx",
601 .description = "Enable Armv8.7-A HCRX_EL2 system register",
602 .dependencies = featureSet(&[_]Feature{}),
603 };
609 result[@enumToInt(Feature.i8mm)] = .{604 result[@enumToInt(Feature.i8mm)] = .{
610 .llvm_name = "i8mm",605 .llvm_name = "i8mm",
611 .description = "Enable Matrix Multiply Int8 Extension",606 .description = "Enable Matrix Multiply Int8 Extension",
...@@ -623,6 +618,11 @@ pub const all_features = blk: {...@@ -623,6 +618,11 @@ pub const all_features = blk: {
623 .description = "Enables ARM v8.1 Limited Ordering Regions extension",618 .description = "Enables ARM v8.1 Limited Ordering Regions extension",
624 .dependencies = featureSet(&[_]Feature{}),619 .dependencies = featureSet(&[_]Feature{}),
625 };620 };
621 result[@enumToInt(Feature.ls64)] = .{
622 .llvm_name = "ls64",
623 .description = "Enable Armv8.7-A LD64B/ST64B Accelerator Extension",
624 .dependencies = featureSet(&[_]Feature{}),
625 };
626 result[@enumToInt(Feature.lse)] = .{626 result[@enumToInt(Feature.lse)] = .{
627 .llvm_name = "lse",627 .llvm_name = "lse",
628 .description = "Enable ARMv8.1 Large System Extension (LSE) atomic instructions",628 .description = "Enable ARMv8.1 Large System Extension (LSE) atomic instructions",
...@@ -650,35 +650,62 @@ pub const all_features = blk: {...@@ -650,35 +650,62 @@ pub const all_features = blk: {
650 .fp_armv8,650 .fp_armv8,
651 }),651 }),
652 };652 };
653 result[@enumToInt(Feature.neoversee1)] = .{653 result[@enumToInt(Feature.neoverse_e1)] = .{
654 .llvm_name = "neoversee1",654 .llvm_name = "neoversee1",
655 .description = "Neoverse E1 ARM processors",655 .description = "Neoverse E1 ARM processors",
656 .dependencies = featureSet(&[_]Feature{656 .dependencies = featureSet(&[_]Feature{
657 .crypto,657 .crypto,
658 .dotprod,658 .dotprod,
659 .fp_armv8,
660 .fullfp16,659 .fullfp16,
661 .neon,
662 .rcpc,660 .rcpc,
663 .ssbs,661 .ssbs,
664 .v8_2a,662 .v8_2a,
665 }),663 }),
666 };664 };
667 result[@enumToInt(Feature.neoversen1)] = .{665 result[@enumToInt(Feature.neoverse_n1)] = .{
668 .llvm_name = "neoversen1",666 .llvm_name = "neoversen1",
669 .description = "Neoverse N1 ARM processors",667 .description = "Neoverse N1 ARM processors",
670 .dependencies = featureSet(&[_]Feature{668 .dependencies = featureSet(&[_]Feature{
671 .crypto,669 .crypto,
672 .dotprod,670 .dotprod,
673 .fp_armv8,
674 .fullfp16,671 .fullfp16,
675 .neon,
676 .rcpc,672 .rcpc,
677 .spe,673 .spe,
678 .ssbs,674 .ssbs,
679 .v8_2a,675 .v8_2a,
680 }),676 }),
681 };677 };
678 result[@enumToInt(Feature.neoverse_n2)] = .{
679 .llvm_name = "neoversen2",
680 .description = "Neoverse N2 ARM processors",
681 .dependencies = featureSet(&[_]Feature{
682 .bf16,
683 .ete,
684 .i8mm,
685 .mte,
686 .sve2_bitperm,
687 .v8_5a,
688 }),
689 };
690 result[@enumToInt(Feature.neoverse_v1)] = .{
691 .llvm_name = "neoversev1",
692 .description = "Neoverse V1 ARM processors",
693 .dependencies = featureSet(&[_]Feature{
694 .bf16,
695 .ccdp,
696 .crypto,
697 .fp16fml,
698 .fuse_aes,
699 .i8mm,
700 .perfmon,
701 .rand,
702 .spe,
703 .ssbs,
704 .sve,
705 .use_postra_scheduler,
706 .v8_4a,
707 }),
708 };
682 result[@enumToInt(Feature.no_neg_immediates)] = .{709 result[@enumToInt(Feature.no_neg_immediates)] = .{
683 .llvm_name = "no-neg-immediates",710 .llvm_name = "no-neg-immediates",
684 .description = "Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding.",711 .description = "Convert immediates and instructions to their negated or complemented equivalent when the immediate does not fit in the encoding.",
...@@ -686,12 +713,12 @@ pub const all_features = blk: {...@@ -686,12 +713,12 @@ pub const all_features = blk: {
686 };713 };
687 result[@enumToInt(Feature.nv)] = .{714 result[@enumToInt(Feature.nv)] = .{
688 .llvm_name = "nv",715 .llvm_name = "nv",
689 .description = "Enable v8.4-A Nested Virtualization extension",716 .description = "Enable v8.4-A Nested Virtualization Enchancement",
690 .dependencies = featureSet(&[_]Feature{}),717 .dependencies = featureSet(&[_]Feature{}),
691 };718 };
692 result[@enumToInt(Feature.pa)] = .{719 result[@enumToInt(Feature.outline_atomics)] = .{
693 .llvm_name = "pa",720 .llvm_name = "outline-atomics",
694 .description = "Enable v8.3-A Pointer Authentication extension",721 .description = "Enable out of line atomics to support LSE instructions",
695 .dependencies = featureSet(&[_]Feature{}),722 .dependencies = featureSet(&[_]Feature{}),
696 };723 };
697 result[@enumToInt(Feature.pan)] = .{724 result[@enumToInt(Feature.pan)] = .{
...@@ -706,6 +733,11 @@ pub const all_features = blk: {...@@ -706,6 +733,11 @@ pub const all_features = blk: {
706 .pan,733 .pan,
707 }),734 }),
708 };735 };
736 result[@enumToInt(Feature.pauth)] = .{
737 .llvm_name = "pauth",
738 .description = "Enable v8.3-A Pointer Authentication extension",
739 .dependencies = featureSet(&[_]Feature{}),
740 };
709 result[@enumToInt(Feature.perfmon)] = .{741 result[@enumToInt(Feature.perfmon)] = .{
710 .llvm_name = "perfmon",742 .llvm_name = "perfmon",
711 .description = "Enable ARMv8 PMUv3 Performance Monitors extension",743 .description = "Enable ARMv8 PMUv3 Performance Monitors extension",
...@@ -736,13 +768,6 @@ pub const all_features = blk: {...@@ -736,13 +768,6 @@ pub const all_features = blk: {
736 .description = "Enable ARMv8 Reliability, Availability and Serviceability Extensions",768 .description = "Enable ARMv8 Reliability, Availability and Serviceability Extensions",
737 .dependencies = featureSet(&[_]Feature{}),769 .dependencies = featureSet(&[_]Feature{}),
738 };770 };
739 result[@enumToInt(Feature.rasv8_4)] = .{
740 .llvm_name = "rasv8_4",
741 .description = "Enable v8.4-A Reliability, Availability and Serviceability extension",
742 .dependencies = featureSet(&[_]Feature{
743 .ras,
744 }),
745 };
746 result[@enumToInt(Feature.rcpc)] = .{771 result[@enumToInt(Feature.rcpc)] = .{
747 .llvm_name = "rcpc",772 .llvm_name = "rcpc",
748 .description = "Enable support for RCPC extension",773 .description = "Enable support for RCPC extension",
...@@ -906,7 +931,6 @@ pub const all_features = blk: {...@@ -906,7 +931,6 @@ pub const all_features = blk: {
906 .llvm_name = "sha3",931 .llvm_name = "sha3",
907 .description = "Enable SHA512 and SHA3 support",932 .description = "Enable SHA512 and SHA3 support",
908 .dependencies = featureSet(&[_]Feature{933 .dependencies = featureSet(&[_]Feature{
909 .neon,
910 .sha2,934 .sha2,
911 }),935 }),
912 };936 };
...@@ -937,6 +961,11 @@ pub const all_features = blk: {...@@ -937,6 +961,11 @@ pub const all_features = blk: {
937 .description = "Enable Statistical Profiling extension",961 .description = "Enable Statistical Profiling extension",
938 .dependencies = featureSet(&[_]Feature{}),962 .dependencies = featureSet(&[_]Feature{}),
939 };963 };
964 result[@enumToInt(Feature.spe_eef)] = .{
965 .llvm_name = "spe-eef",
966 .description = "Enable extra register in the Statistical Profiling Extension",
967 .dependencies = featureSet(&[_]Feature{}),
968 };
940 result[@enumToInt(Feature.specrestrict)] = .{969 result[@enumToInt(Feature.specrestrict)] = .{
941 .llvm_name = "specrestrict",970 .llvm_name = "specrestrict",
942 .description = "Enable architectural speculation restriction",971 .description = "Enable architectural speculation restriction",
...@@ -955,7 +984,9 @@ pub const all_features = blk: {...@@ -955,7 +984,9 @@ pub const all_features = blk: {
955 result[@enumToInt(Feature.sve)] = .{984 result[@enumToInt(Feature.sve)] = .{
956 .llvm_name = "sve",985 .llvm_name = "sve",
957 .description = "Enable Scalable Vector Extension (SVE) instructions",986 .description = "Enable Scalable Vector Extension (SVE) instructions",
958 .dependencies = featureSet(&[_]Feature{}),987 .dependencies = featureSet(&[_]Feature{
988 .fullfp16,
989 }),
959 };990 };
960 result[@enumToInt(Feature.sve2)] = .{991 result[@enumToInt(Feature.sve2)] = .{
961 .llvm_name = "sve2",992 .llvm_name = "sve2",
...@@ -1060,14 +1091,6 @@ pub const all_features = blk: {...@@ -1060,14 +1091,6 @@ pub const all_features = blk: {
1060 .description = "Use the reciprocal square root approximation",1091 .description = "Use the reciprocal square root approximation",
1061 .dependencies = featureSet(&[_]Feature{}),1092 .dependencies = featureSet(&[_]Feature{}),
1062 };1093 };
1063 result[@enumToInt(Feature.v8a)] = .{
1064 .llvm_name = null,
1065 .description = "Support ARM v8a instructions",
1066 .dependencies = featureSet(&[_]Feature{
1067 .fp_armv8,
1068 .neon,
1069 }),
1070 };
1071 result[@enumToInt(Feature.v8_1a)] = .{1094 result[@enumToInt(Feature.v8_1a)] = .{
1072 .llvm_name = "v8.1a",1095 .llvm_name = "v8.1a",
1073 .description = "Support ARM v8.1a instructions",1096 .description = "Support ARM v8.1a instructions",
...@@ -1077,8 +1100,8 @@ pub const all_features = blk: {...@@ -1077,8 +1100,8 @@ pub const all_features = blk: {
1077 .lse,1100 .lse,
1078 .pan,1101 .pan,
1079 .rdm,1102 .rdm,
1080 .vh,
1081 .v8a,1103 .v8a,
1104 .vh,
1082 }),1105 }),
1083 };1106 };
1084 result[@enumToInt(Feature.v8_2a)] = .{1107 result[@enumToInt(Feature.v8_2a)] = .{
...@@ -1099,7 +1122,7 @@ pub const all_features = blk: {...@@ -1099,7 +1122,7 @@ pub const all_features = blk: {
1099 .ccidx,1122 .ccidx,
1100 .complxnum,1123 .complxnum,
1101 .jsconv,1124 .jsconv,
1102 .pa,1125 .pauth,
1103 .rcpc,1126 .rcpc,
1104 .v8_2a,1127 .v8_2a,
1105 }),1128 }),
...@@ -1111,11 +1134,10 @@ pub const all_features = blk: {...@@ -1111,11 +1134,10 @@ pub const all_features = blk: {
1111 .am,1134 .am,
1112 .dit,1135 .dit,
1113 .dotprod,1136 .dotprod,
1114 .fmi,1137 .flagm,
1115 .mpam,1138 .mpam,
1116 .nv,1139 .nv,
1117 .pmu,1140 .pmu,
1118 .rasv8_4,
1119 .rcpc_immo,1141 .rcpc_immo,
1120 .sel2,1142 .sel2,
1121 .tlb_rmi,1143 .tlb_rmi,
...@@ -1150,9 +1172,71 @@ pub const all_features = blk: {...@@ -1150,9 +1172,71 @@ pub const all_features = blk: {
1150 .v8_5a,1172 .v8_5a,
1151 }),1173 }),
1152 };1174 };
1175 result[@enumToInt(Feature.v8_7a)] = .{
1176 .llvm_name = "v8.7a",
1177 .description = "Support ARM v8.7a instructions",
1178 .dependencies = featureSet(&[_]Feature{
1179 .hcx,
1180 .v8_6a,
1181 .wfxt,
1182 .xs,
1183 }),
1184 };
1185 result[@enumToInt(Feature.v8a)] = .{
1186 .llvm_name = null,
1187 .description = "Support ARM v8a instructions",
1188 .dependencies = featureSet(&[_]Feature{
1189 .neon,
1190 }),
1191 };
1192 result[@enumToInt(Feature.v8r)] = .{
1193 .llvm_name = "v8r",
1194 .description = "Support ARM v8r instructions",
1195 .dependencies = featureSet(&[_]Feature{
1196 .ccidx,
1197 .ccpp,
1198 .complxnum,
1199 .contextidr_el2,
1200 .crc,
1201 .dit,
1202 .dotprod,
1203 .flagm,
1204 .fp16fml,
1205 .jsconv,
1206 .lse,
1207 .pan_rwv,
1208 .pauth,
1209 .perfmon,
1210 .predres,
1211 .ras,
1212 .rcpc_immo,
1213 .rdm,
1214 .sb,
1215 .sel2,
1216 .sha3,
1217 .sm4,
1218 .specrestrict,
1219 .ssbs,
1220 .tlb_rmi,
1221 .tracev8_4,
1222 .uaops,
1223 }),
1224 };
1153 result[@enumToInt(Feature.vh)] = .{1225 result[@enumToInt(Feature.vh)] = .{
1154 .llvm_name = "vh",1226 .llvm_name = "vh",
1155 .description = "Enables ARM v8.1 Virtual Host extension",1227 .description = "Enables ARM v8.1 Virtual Host extension",
1228 .dependencies = featureSet(&[_]Feature{
1229 .contextidr_el2,
1230 }),
1231 };
1232 result[@enumToInt(Feature.wfxt)] = .{
1233 .llvm_name = "wfxt",
1234 .description = "Enable Armv8.7-A WFET and WFIT instruction",
1235 .dependencies = featureSet(&[_]Feature{}),
1236 };
1237 result[@enumToInt(Feature.xs)] = .{
1238 .llvm_name = "xs",
1239 .description = "Enable Armv8.7-A limited-TLB-maintenance instruction",
1156 .dependencies = featureSet(&[_]Feature{}),1240 .dependencies = featureSet(&[_]Feature{}),
1157 };1241 };
1158 result[@enumToInt(Feature.zcm)] = .{1242 result[@enumToInt(Feature.zcm)] = .{
...@@ -1196,11 +1280,11 @@ pub const cpu = struct {...@@ -1196,11 +1280,11 @@ pub const cpu = struct {
1196 .name = "a64fx",1280 .name = "a64fx",
1197 .llvm_name = "a64fx",1281 .llvm_name = "a64fx",
1198 .features = featureSet(&[_]Feature{1282 .features = featureSet(&[_]Feature{
1283 .aggressive_fma,
1284 .arith_bcc_fusion,
1199 .complxnum,1285 .complxnum,
1200 .fp_armv8,
1201 .fullfp16,
1202 .neon,
1203 .perfmon,1286 .perfmon,
1287 .predictable_select_expensive,
1204 .sha2,1288 .sha2,
1205 .sve,1289 .sve,
1206 .use_postra_scheduler,1290 .use_postra_scheduler,
...@@ -1211,14 +1295,39 @@ pub const cpu = struct {...@@ -1211,14 +1295,39 @@ pub const cpu = struct {
1211 .name = "apple_a10",1295 .name = "apple_a10",
1212 .llvm_name = "apple-a10",1296 .llvm_name = "apple-a10",
1213 .features = featureSet(&[_]Feature{1297 .features = featureSet(&[_]Feature{
1214 .apple_a10,1298 .alternate_sextload_cvt_f32_pattern,
1299 .arith_bcc_fusion,
1300 .arith_cbz_fusion,
1301 .crc,
1302 .crypto,
1303 .disable_latency_sched_heuristic,
1304 .fuse_aes,
1305 .fuse_crypto_eor,
1306 .lor,
1307 .pan,
1308 .perfmon,
1309 .rdm,
1310 .vh,
1311 .zcm,
1312 .zcz,
1215 }),1313 }),
1216 };1314 };
1217 pub const apple_a11 = CpuModel{1315 pub const apple_a11 = CpuModel{
1218 .name = "apple_a11",1316 .name = "apple_a11",
1219 .llvm_name = "apple-a11",1317 .llvm_name = "apple-a11",
1220 .features = featureSet(&[_]Feature{1318 .features = featureSet(&[_]Feature{
1221 .apple_a11,1319 .alternate_sextload_cvt_f32_pattern,
1320 .arith_bcc_fusion,
1321 .arith_cbz_fusion,
1322 .crypto,
1323 .disable_latency_sched_heuristic,
1324 .fullfp16,
1325 .fuse_aes,
1326 .fuse_crypto_eor,
1327 .perfmon,
1328 .v8_2a,
1329 .zcm,
1330 .zcz,
1222 }),1331 }),
1223 };1332 };
1224 pub const apple_a12 = CpuModel{1333 pub const apple_a12 = CpuModel{
...@@ -1235,6 +1344,37 @@ pub const cpu = struct {...@@ -1235,6 +1344,37 @@ pub const cpu = struct {
1235 .apple_a13,1344 .apple_a13,
1236 }),1345 }),
1237 };1346 };
1347 pub const apple_a14 = CpuModel{
1348 .name = "apple_a14",
1349 .llvm_name = "apple-a14",
1350 .features = featureSet(&[_]Feature{
1351 .aggressive_fma,
1352 .alternate_sextload_cvt_f32_pattern,
1353 .altnzcv,
1354 .arith_bcc_fusion,
1355 .arith_cbz_fusion,
1356 .ccdp,
1357 .crypto,
1358 .disable_latency_sched_heuristic,
1359 .fp16fml,
1360 .fptoint,
1361 .fuse_address,
1362 .fuse_aes,
1363 .fuse_arith_logic,
1364 .fuse_crypto_eor,
1365 .fuse_csel,
1366 .fuse_literals,
1367 .perfmon,
1368 .predres,
1369 .sb,
1370 .sha3,
1371 .specrestrict,
1372 .ssbs,
1373 .v8_4a,
1374 .zcm,
1375 .zcz,
1376 }),
1377 };
1238 pub const apple_a7 = CpuModel{1378 pub const apple_a7 = CpuModel{
1239 .name = "apple_a7",1379 .name = "apple_a7",
1240 .llvm_name = "apple-a7",1380 .llvm_name = "apple-a7",
...@@ -1283,7 +1423,6 @@ pub const cpu = struct {...@@ -1283,7 +1423,6 @@ pub const cpu = struct {
1283 .features = featureSet(&[_]Feature{1423 .features = featureSet(&[_]Feature{
1284 .crypto,1424 .crypto,
1285 .fullfp16,1425 .fullfp16,
1286 .neon,
1287 .v8_2a,1426 .v8_2a,
1288 }),1427 }),
1289 };1428 };
...@@ -1291,14 +1430,20 @@ pub const cpu = struct {...@@ -1291,14 +1430,20 @@ pub const cpu = struct {
1291 .name = "cortex_a34",1430 .name = "cortex_a34",
1292 .llvm_name = "cortex-a34",1431 .llvm_name = "cortex-a34",
1293 .features = featureSet(&[_]Feature{1432 .features = featureSet(&[_]Feature{
1294 .a34,1433 .crc,
1434 .crypto,
1435 .perfmon,
1436 .v8a,
1295 }),1437 }),
1296 };1438 };
1297 pub const cortex_a35 = CpuModel{1439 pub const cortex_a35 = CpuModel{
1298 .name = "cortex_a35",1440 .name = "cortex_a35",
1299 .llvm_name = "cortex-a35",1441 .llvm_name = "cortex-a35",
1300 .features = featureSet(&[_]Feature{1442 .features = featureSet(&[_]Feature{
1301 .a34,1443 .crc,
1444 .crypto,
1445 .perfmon,
1446 .v8a,
1302 }),1447 }),
1303 };1448 };
1304 pub const cortex_a53 = CpuModel{1449 pub const cortex_a53 = CpuModel{
...@@ -1366,6 +1511,7 @@ pub const cpu = struct {...@@ -1366,6 +1511,7 @@ pub const cpu = struct {
1366 .crc,1511 .crc,
1367 .crypto,1512 .crypto,
1368 .fuse_aes,1513 .fuse_aes,
1514 .fuse_literals,
1369 .perfmon,1515 .perfmon,
1370 .v8a,1516 .v8a,
1371 }),1517 }),
...@@ -1412,11 +1558,11 @@ pub const cpu = struct {...@@ -1412,11 +1558,11 @@ pub const cpu = struct {
1412 .name = "cortex_a77",1558 .name = "cortex_a77",
1413 .llvm_name = "cortex-a77",1559 .llvm_name = "cortex-a77",
1414 .features = featureSet(&[_]Feature{1560 .features = featureSet(&[_]Feature{
1561 .cmp_bcc_fusion,
1415 .crypto,1562 .crypto,
1416 .dotprod,1563 .dotprod,
1417 .fp_armv8,
1418 .fullfp16,1564 .fullfp16,
1419 .neon,1565 .fuse_aes,
1420 .rcpc,1566 .rcpc,
1421 .v8_2a,1567 .v8_2a,
1422 }),1568 }),
...@@ -1425,12 +1571,11 @@ pub const cpu = struct {...@@ -1425,12 +1571,11 @@ pub const cpu = struct {
1425 .name = "cortex_a78",1571 .name = "cortex_a78",
1426 .llvm_name = "cortex-a78",1572 .llvm_name = "cortex-a78",
1427 .features = featureSet(&[_]Feature{1573 .features = featureSet(&[_]Feature{
1574 .cmp_bcc_fusion,
1428 .crypto,1575 .crypto,
1429 .dotprod,1576 .dotprod,
1430 .fp_armv8,
1431 .fullfp16,1577 .fullfp16,
1432 .fuse_aes,1578 .fuse_aes,
1433 .neon,
1434 .perfmon,1579 .perfmon,
1435 .rcpc,1580 .rcpc,
1436 .spe,1581 .spe,
...@@ -1439,16 +1584,29 @@ pub const cpu = struct {...@@ -1439,16 +1584,29 @@ pub const cpu = struct {
1439 .v8_2a,1584 .v8_2a,
1440 }),1585 }),
1441 };1586 };
1587 pub const cortex_a78c = CpuModel{
1588 .name = "cortex_a78c",
1589 .llvm_name = "cortex-a78c",
1590 .features = featureSet(&[_]Feature{
1591 .cortex_a78c,
1592 }),
1593 };
1594 pub const cortex_r82 = CpuModel{
1595 .name = "cortex_r82",
1596 .llvm_name = "cortex-r82",
1597 .features = featureSet(&[_]Feature{
1598 .cortex_r82,
1599 }),
1600 };
1442 pub const cortex_x1 = CpuModel{1601 pub const cortex_x1 = CpuModel{
1443 .name = "cortex_x1",1602 .name = "cortex_x1",
1444 .llvm_name = "cortex-x1",1603 .llvm_name = "cortex-x1",
1445 .features = featureSet(&[_]Feature{1604 .features = featureSet(&[_]Feature{
1605 .cmp_bcc_fusion,
1446 .crypto,1606 .crypto,
1447 .dotprod,1607 .dotprod,
1448 .fp_armv8,
1449 .fullfp16,1608 .fullfp16,
1450 .fuse_aes,1609 .fuse_aes,
1451 .neon,
1452 .perfmon,1610 .perfmon,
1453 .rcpc,1611 .rcpc,
1454 .spe,1612 .spe,
...@@ -1522,14 +1680,14 @@ pub const cpu = struct {...@@ -1522,14 +1680,14 @@ pub const cpu = struct {
1522 .name = "exynos_m4",1680 .name = "exynos_m4",
1523 .llvm_name = "exynos-m4",1681 .llvm_name = "exynos-m4",
1524 .features = featureSet(&[_]Feature{1682 .features = featureSet(&[_]Feature{
1525 .exynosm4,1683 .exynos_m4,
1526 }),1684 }),
1527 };1685 };
1528 pub const exynos_m5 = CpuModel{1686 pub const exynos_m5 = CpuModel{
1529 .name = "exynos_m5",1687 .name = "exynos_m5",
1530 .llvm_name = "exynos-m5",1688 .llvm_name = "exynos-m5",
1531 .features = featureSet(&[_]Feature{1689 .features = featureSet(&[_]Feature{
1532 .exynosm4,1690 .exynos_m4,
1533 }),1691 }),
1534 };1692 };
1535 pub const falkor = CpuModel{1693 pub const falkor = CpuModel{
...@@ -1555,9 +1713,9 @@ pub const cpu = struct {...@@ -1555,9 +1713,9 @@ pub const cpu = struct {
1555 .features = featureSet(&[_]Feature{1713 .features = featureSet(&[_]Feature{
1556 .ete,1714 .ete,
1557 .fuse_aes,1715 .fuse_aes,
1716 .neon,
1558 .perfmon,1717 .perfmon,
1559 .use_postra_scheduler,1718 .use_postra_scheduler,
1560 .v8a,
1561 }),1719 }),
1562 };1720 };
1563 pub const kryo = CpuModel{1721 pub const kryo = CpuModel{
...@@ -1571,22 +1729,36 @@ pub const cpu = struct {...@@ -1571,22 +1729,36 @@ pub const cpu = struct {
1571 .perfmon,1729 .perfmon,
1572 .predictable_select_expensive,1730 .predictable_select_expensive,
1573 .use_postra_scheduler,1731 .use_postra_scheduler,
1574 .zcz,
1575 .v8a,1732 .v8a,
1733 .zcz,
1576 }),1734 }),
1577 };1735 };
1578 pub const neoverse_e1 = CpuModel{1736 pub const neoverse_e1 = CpuModel{
1579 .name = "neoverse_e1",1737 .name = "neoverse_e1",
1580 .llvm_name = "neoverse-e1",1738 .llvm_name = "neoverse-e1",
1581 .features = featureSet(&[_]Feature{1739 .features = featureSet(&[_]Feature{
1582 .neoversee1,1740 .neoverse_e1,
1583 }),1741 }),
1584 };1742 };
1585 pub const neoverse_n1 = CpuModel{1743 pub const neoverse_n1 = CpuModel{
1586 .name = "neoverse_n1",1744 .name = "neoverse_n1",
1587 .llvm_name = "neoverse-n1",1745 .llvm_name = "neoverse-n1",
1588 .features = featureSet(&[_]Feature{1746 .features = featureSet(&[_]Feature{
1589 .neoversen1,1747 .neoverse_n1,
1748 }),
1749 };
1750 pub const neoverse_n2 = CpuModel{
1751 .name = "neoverse_n2",
1752 .llvm_name = "neoverse-n2",
1753 .features = featureSet(&[_]Feature{
1754 .neoverse_n2,
1755 }),
1756 };
1757 pub const neoverse_v1 = CpuModel{
1758 .name = "neoverse_v1",
1759 .llvm_name = "neoverse-v1",
1760 .features = featureSet(&[_]Feature{
1761 .neoverse_v1,
1590 }),1762 }),
1591 };1763 };
1592 pub const saphira = CpuModel{1764 pub const saphira = CpuModel{
...@@ -1622,9 +1794,7 @@ pub const cpu = struct {...@@ -1622,9 +1794,7 @@ pub const cpu = struct {
1622 .features = featureSet(&[_]Feature{1794 .features = featureSet(&[_]Feature{
1623 .aggressive_fma,1795 .aggressive_fma,
1624 .arith_bcc_fusion,1796 .arith_bcc_fusion,
1625 .crc,
1626 .crypto,1797 .crypto,
1627 .lse,
1628 .predictable_select_expensive,1798 .predictable_select_expensive,
1629 .use_postra_scheduler,1799 .use_postra_scheduler,
1630 .v8_1a,1800 .v8_1a,
...@@ -1637,12 +1807,7 @@ pub const cpu = struct {...@@ -1637,12 +1807,7 @@ pub const cpu = struct {
1637 .aggressive_fma,1807 .aggressive_fma,
1638 .arith_bcc_fusion,1808 .arith_bcc_fusion,
1639 .balance_fp_ops,1809 .balance_fp_ops,
1640 .crc,
1641 .crypto,1810 .crypto,
1642 .fp_armv8,
1643 .lse,
1644 .neon,
1645 .pa,
1646 .perfmon,1811 .perfmon,
1647 .predictable_select_expensive,1812 .predictable_select_expensive,
1648 .strict_align,1813 .strict_align,
...@@ -1695,7 +1860,6 @@ pub const cpu = struct {...@@ -1695,7 +1860,6 @@ pub const cpu = struct {
1695 .custom_cheap_as_move,1860 .custom_cheap_as_move,
1696 .dotprod,1861 .dotprod,
1697 .fp16fml,1862 .fp16fml,
1698 .fullfp16,
1699 .fuse_aes,1863 .fuse_aes,
1700 .perfmon,1864 .perfmon,
1701 .spe,1865 .spe,
lib/std/target/amdgpu.zig+174-138
...@@ -1,22 +1,17 @@...@@ -1,22 +1,17 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
96
10pub const Feature = enum {7pub const Feature = enum {
11 @"16_bit_insts",8 @"16_bit_insts",
12 DumpCode,
13 a16,9 a16,
14 add_no_carry_insts,10 add_no_carry_insts,
15 aperture_regs,11 aperture_regs,
16 atomic_fadd_insts,12 atomic_fadd_insts,
17 auto_waitcnt_before_barrier,13 auto_waitcnt_before_barrier,
18 ci_insts,14 ci_insts,
19 code_object_v3,
20 cumode,15 cumode,
21 dl_insts,16 dl_insts,
22 dot1_insts,17 dot1_insts,
...@@ -28,7 +23,6 @@ pub const Feature = enum {...@@ -28,7 +23,6 @@ pub const Feature = enum {
28 dpp,23 dpp,
29 dpp8,24 dpp8,
30 ds_src2_insts,25 ds_src2_insts,
31 dumpcode,
32 enable_ds128,26 enable_ds128,
33 enable_prt_strict_null,27 enable_prt_strict_null,
34 fast_denormal_f32,28 fast_denormal_f32,
...@@ -47,13 +41,15 @@ pub const Feature = enum {...@@ -47,13 +41,15 @@ pub const Feature = enum {
47 get_wave_id_inst,41 get_wave_id_inst,
48 gfx10,42 gfx10,
49 gfx10_3_insts,43 gfx10_3_insts,
50 gfx10_insts,
51 gfx10_b_encoding,44 gfx10_b_encoding,
45 gfx10_insts,
52 gfx7_gfx8_gfx9_insts,46 gfx7_gfx8_gfx9_insts,
53 gfx8_insts,47 gfx8_insts,
54 gfx9,48 gfx9,
55 gfx9_insts,49 gfx9_insts,
56 half_rate_64_ops,50 half_rate_64_ops,
51 image_gather4_d16_bug,
52 image_store_d16_bug,
57 inst_fwd_prefetch_bug,53 inst_fwd_prefetch_bug,
58 int_clamp_insts,54 int_clamp_insts,
59 inv_2pi_inline_imm,55 inv_2pi_inline_imm,
...@@ -76,8 +72,6 @@ pub const Feature = enum {...@@ -76,8 +72,6 @@ pub const Feature = enum {
76 movrel,72 movrel,
77 no_data_dep_hazard,73 no_data_dep_hazard,
78 no_sdst_cmpx,74 no_sdst_cmpx,
79 no_sram_ecc_support,
80 no_xnack_support,
81 nsa_encoding,75 nsa_encoding,
82 nsa_to_vmem_bug,76 nsa_to_vmem_bug,
83 offset_3f_bug,77 offset_3f_bug,
...@@ -101,10 +95,13 @@ pub const Feature = enum {...@@ -101,10 +95,13 @@ pub const Feature = enum {
101 si_scheduler,95 si_scheduler,
102 smem_to_vector_write_hazard,96 smem_to_vector_write_hazard,
103 southern_islands,97 southern_islands,
104 sram_ecc,98 sramecc,
99 sramecc_support,
105 trap_handler,100 trap_handler,
106 trig_reduced_range,101 trig_reduced_range,
102 unaligned_access_mode,
107 unaligned_buffer_access,103 unaligned_buffer_access,
104 unaligned_ds_access,
108 unaligned_scratch_access,105 unaligned_scratch_access,
109 unpacked_d16_vmem,106 unpacked_d16_vmem,
110 unsafe_ds_offset_folding,107 unsafe_ds_offset_folding,
...@@ -120,6 +117,7 @@ pub const Feature = enum {...@@ -120,6 +117,7 @@ pub const Feature = enum {
120 wavefrontsize32,117 wavefrontsize32,
121 wavefrontsize64,118 wavefrontsize64,
122 xnack,119 xnack,
120 xnack_support,
123};121};
124122
125pub usingnamespace CpuFeature.feature_set_fns(Feature);123pub usingnamespace CpuFeature.feature_set_fns(Feature);
...@@ -133,11 +131,6 @@ pub const all_features = blk: {...@@ -133,11 +131,6 @@ pub const all_features = blk: {
133 .description = "Has i16/f16 instructions",131 .description = "Has i16/f16 instructions",
134 .dependencies = featureSet(&[_]Feature{}),132 .dependencies = featureSet(&[_]Feature{}),
135 };133 };
136 result[@enumToInt(Feature.DumpCode)] = .{
137 .llvm_name = "DumpCode",
138 .description = "Dump MachineInstrs in the CodeEmitter",
139 .dependencies = featureSet(&[_]Feature{}),
140 };
141 result[@enumToInt(Feature.a16)] = .{134 result[@enumToInt(Feature.a16)] = .{
142 .llvm_name = "a16",135 .llvm_name = "a16",
143 .description = "Support gfx10-style A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands",136 .description = "Support gfx10-style A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands",
...@@ -170,11 +163,6 @@ pub const all_features = blk: {...@@ -170,11 +163,6 @@ pub const all_features = blk: {
170 .description = "Additional instructions for CI+",163 .description = "Additional instructions for CI+",
171 .dependencies = featureSet(&[_]Feature{}),164 .dependencies = featureSet(&[_]Feature{}),
172 };165 };
173 result[@enumToInt(Feature.code_object_v3)] = .{
174 .llvm_name = "code-object-v3",
175 .description = "Generate code object version 3",
176 .dependencies = featureSet(&[_]Feature{}),
177 };
178 result[@enumToInt(Feature.cumode)] = .{166 result[@enumToInt(Feature.cumode)] = .{
179 .llvm_name = "cumode",167 .llvm_name = "cumode",
180 .description = "Enable CU wavefront execution mode",168 .description = "Enable CU wavefront execution mode",
...@@ -230,14 +218,9 @@ pub const all_features = blk: {...@@ -230,14 +218,9 @@ pub const all_features = blk: {
230 .description = "Has ds_*_src2 instructions",218 .description = "Has ds_*_src2 instructions",
231 .dependencies = featureSet(&[_]Feature{}),219 .dependencies = featureSet(&[_]Feature{}),
232 };220 };
233 result[@enumToInt(Feature.dumpcode)] = .{
234 .llvm_name = "dumpcode",
235 .description = "Dump MachineInstrs in the CodeEmitter",
236 .dependencies = featureSet(&[_]Feature{}),
237 };
238 result[@enumToInt(Feature.enable_ds128)] = .{221 result[@enumToInt(Feature.enable_ds128)] = .{
239 .llvm_name = "enable-ds128",222 .llvm_name = "enable-ds128",
240 .description = "Use ds_read|write_b128",223 .description = "Use ds_{read|write}_b128",
241 .dependencies = featureSet(&[_]Feature{}),224 .dependencies = featureSet(&[_]Feature{}),
242 };225 };
243 result[@enumToInt(Feature.enable_prt_strict_null)] = .{226 result[@enumToInt(Feature.enable_prt_strict_null)] = .{
...@@ -345,7 +328,6 @@ pub const all_features = blk: {...@@ -345,7 +328,6 @@ pub const all_features = blk: {
345 .movrel,328 .movrel,
346 .no_data_dep_hazard,329 .no_data_dep_hazard,
347 .no_sdst_cmpx,330 .no_sdst_cmpx,
348 .no_sram_ecc_support,
349 .pk_fmac_f16_inst,331 .pk_fmac_f16_inst,
350 .register_banking,332 .register_banking,
351 .s_memrealtime,333 .s_memrealtime,
...@@ -353,6 +335,8 @@ pub const all_features = blk: {...@@ -353,6 +335,8 @@ pub const all_features = blk: {
353 .sdwa_omod,335 .sdwa_omod,
354 .sdwa_scalar,336 .sdwa_scalar,
355 .sdwa_sdst,337 .sdwa_sdst,
338 .unaligned_buffer_access,
339 .unaligned_ds_access,
356 .vop3_literal,340 .vop3_literal,
357 .vop3p,341 .vop3p,
358 .vscnt,342 .vscnt,
...@@ -363,16 +347,16 @@ pub const all_features = blk: {...@@ -363,16 +347,16 @@ pub const all_features = blk: {
363 .description = "Additional instructions for GFX10.3",347 .description = "Additional instructions for GFX10.3",
364 .dependencies = featureSet(&[_]Feature{}),348 .dependencies = featureSet(&[_]Feature{}),
365 };349 };
366 result[@enumToInt(Feature.gfx10_insts)] = .{
367 .llvm_name = "gfx10-insts",
368 .description = "Additional instructions for GFX10+",
369 .dependencies = featureSet(&[_]Feature{}),
370 };
371 result[@enumToInt(Feature.gfx10_b_encoding)] = .{350 result[@enumToInt(Feature.gfx10_b_encoding)] = .{
372 .llvm_name = "gfx10_b-encoding",351 .llvm_name = "gfx10_b-encoding",
373 .description = "Encoding format GFX10_B",352 .description = "Encoding format GFX10_B",
374 .dependencies = featureSet(&[_]Feature{}),353 .dependencies = featureSet(&[_]Feature{}),
375 };354 };
355 result[@enumToInt(Feature.gfx10_insts)] = .{
356 .llvm_name = "gfx10-insts",
357 .description = "Additional instructions for GFX10+",
358 .dependencies = featureSet(&[_]Feature{}),
359 };
376 result[@enumToInt(Feature.gfx7_gfx8_gfx9_insts)] = .{360 result[@enumToInt(Feature.gfx7_gfx8_gfx9_insts)] = .{
377 .llvm_name = "gfx7-gfx8-gfx9-insts",361 .llvm_name = "gfx7-gfx8-gfx9-insts",
378 .description = "Instructions shared in GFX7, GFX8, GFX9",362 .description = "Instructions shared in GFX7, GFX8, GFX9",
...@@ -418,9 +402,12 @@ pub const all_features = blk: {...@@ -418,9 +402,12 @@ pub const all_features = blk: {
418 .sdwa_omod,402 .sdwa_omod,
419 .sdwa_scalar,403 .sdwa_scalar,
420 .sdwa_sdst,404 .sdwa_sdst,
405 .unaligned_buffer_access,
406 .unaligned_ds_access,
421 .vgpr_index_mode,407 .vgpr_index_mode,
422 .vop3p,408 .vop3p,
423 .wavefrontsize64,409 .wavefrontsize64,
410 .xnack_support,
424 }),411 }),
425 };412 };
426 result[@enumToInt(Feature.gfx9_insts)] = .{413 result[@enumToInt(Feature.gfx9_insts)] = .{
...@@ -433,6 +420,16 @@ pub const all_features = blk: {...@@ -433,6 +420,16 @@ pub const all_features = blk: {
433 .description = "Most fp64 instructions are half rate instead of quarter",420 .description = "Most fp64 instructions are half rate instead of quarter",
434 .dependencies = featureSet(&[_]Feature{}),421 .dependencies = featureSet(&[_]Feature{}),
435 };422 };
423 result[@enumToInt(Feature.image_gather4_d16_bug)] = .{
424 .llvm_name = "image-gather4-d16-bug",
425 .description = "Image Gather4 D16 hardware bug",
426 .dependencies = featureSet(&[_]Feature{}),
427 };
428 result[@enumToInt(Feature.image_store_d16_bug)] = .{
429 .llvm_name = "image-store-d16-bug",
430 .description = "Image Store D16 hardware bug",
431 .dependencies = featureSet(&[_]Feature{}),
432 };
436 result[@enumToInt(Feature.inst_fwd_prefetch_bug)] = .{433 result[@enumToInt(Feature.inst_fwd_prefetch_bug)] = .{
437 .llvm_name = "inst-fwd-prefetch-bug",434 .llvm_name = "inst-fwd-prefetch-bug",
438 .description = "S_INST_PREFETCH instruction causes shader to hang",435 .description = "S_INST_PREFETCH instruction causes shader to hang",
...@@ -455,7 +452,7 @@ pub const all_features = blk: {...@@ -455,7 +452,7 @@ pub const all_features = blk: {
455 };452 };
456 result[@enumToInt(Feature.lds_misaligned_bug)] = .{453 result[@enumToInt(Feature.lds_misaligned_bug)] = .{
457 .llvm_name = "lds-misaligned-bug",454 .llvm_name = "lds-misaligned-bug",
458 .description = "Some GFX10 bug with misaligned multi-dword LDS access in WGP mode",455 .description = "Some GFX10 bug with multi-dword LDS and flat access that is not naturally aligned in WGP mode",
459 .dependencies = featureSet(&[_]Feature{}),456 .dependencies = featureSet(&[_]Feature{}),
460 };457 };
461 result[@enumToInt(Feature.ldsbankcount16)] = .{458 result[@enumToInt(Feature.ldsbankcount16)] = .{
...@@ -543,16 +540,6 @@ pub const all_features = blk: {...@@ -543,16 +540,6 @@ pub const all_features = blk: {
543 .description = "V_CMPX does not write VCC/SGPR in addition to EXEC",540 .description = "V_CMPX does not write VCC/SGPR in addition to EXEC",
544 .dependencies = featureSet(&[_]Feature{}),541 .dependencies = featureSet(&[_]Feature{}),
545 };542 };
546 result[@enumToInt(Feature.no_sram_ecc_support)] = .{
547 .llvm_name = "no-sram-ecc-support",
548 .description = "Hardware does not support SRAM ECC",
549 .dependencies = featureSet(&[_]Feature{}),
550 };
551 result[@enumToInt(Feature.no_xnack_support)] = .{
552 .llvm_name = "no-xnack-support",
553 .description = "Hardware does not support XNACK",
554 .dependencies = featureSet(&[_]Feature{}),
555 };
556 result[@enumToInt(Feature.nsa_encoding)] = .{543 result[@enumToInt(Feature.nsa_encoding)] = .{
557 .llvm_name = "nsa-encoding",544 .llvm_name = "nsa-encoding",
558 .description = "Support NSA encoding for image instructions",545 .description = "Support NSA encoding for image instructions",
...@@ -656,9 +643,9 @@ pub const all_features = blk: {...@@ -656,9 +643,9 @@ pub const all_features = blk: {
656 .mad_mac_f32_insts,643 .mad_mac_f32_insts,
657 .mimg_r128,644 .mimg_r128,
658 .movrel,645 .movrel,
659 .no_sram_ecc_support,
660 .s_memtime_inst,646 .s_memtime_inst,
661 .trig_reduced_range,647 .trig_reduced_range,
648 .unaligned_buffer_access,
662 .wavefrontsize64,649 .wavefrontsize64,
663 }),650 }),
664 };651 };
...@@ -688,16 +675,19 @@ pub const all_features = blk: {...@@ -688,16 +675,19 @@ pub const all_features = blk: {
688 .mad_mac_f32_insts,675 .mad_mac_f32_insts,
689 .mimg_r128,676 .mimg_r128,
690 .movrel,677 .movrel,
691 .no_sram_ecc_support,
692 .no_xnack_support,
693 .s_memtime_inst,678 .s_memtime_inst,
694 .trig_reduced_range,679 .trig_reduced_range,
695 .wavefrontsize64,680 .wavefrontsize64,
696 }),681 }),
697 };682 };
698 result[@enumToInt(Feature.sram_ecc)] = .{683 result[@enumToInt(Feature.sramecc)] = .{
699 .llvm_name = "sram-ecc",684 .llvm_name = "sramecc",
700 .description = "Enable SRAM ECC",685 .description = "Enable SRAMECC",
686 .dependencies = featureSet(&[_]Feature{}),
687 };
688 result[@enumToInt(Feature.sramecc_support)] = .{
689 .llvm_name = "sramecc-support",
690 .description = "Hardware supports SRAMECC",
701 .dependencies = featureSet(&[_]Feature{}),691 .dependencies = featureSet(&[_]Feature{}),
702 };692 };
703 result[@enumToInt(Feature.trap_handler)] = .{693 result[@enumToInt(Feature.trap_handler)] = .{
...@@ -710,9 +700,19 @@ pub const all_features = blk: {...@@ -710,9 +700,19 @@ pub const all_features = blk: {
710 .description = "Requires use of fract on arguments to trig instructions",700 .description = "Requires use of fract on arguments to trig instructions",
711 .dependencies = featureSet(&[_]Feature{}),701 .dependencies = featureSet(&[_]Feature{}),
712 };702 };
703 result[@enumToInt(Feature.unaligned_access_mode)] = .{
704 .llvm_name = "unaligned-access-mode",
705 .description = "Enable unaligned global, local and region loads and stores if the hardware supports it",
706 .dependencies = featureSet(&[_]Feature{}),
707 };
713 result[@enumToInt(Feature.unaligned_buffer_access)] = .{708 result[@enumToInt(Feature.unaligned_buffer_access)] = .{
714 .llvm_name = "unaligned-buffer-access",709 .llvm_name = "unaligned-buffer-access",
715 .description = "Support unaligned global loads and stores",710 .description = "Hardware supports unaligned global loads and stores",
711 .dependencies = featureSet(&[_]Feature{}),
712 };
713 result[@enumToInt(Feature.unaligned_ds_access)] = .{
714 .llvm_name = "unaligned-ds-access",
715 .description = "Hardware supports unaligned local and region loads and stores",
716 .dependencies = featureSet(&[_]Feature{}),716 .dependencies = featureSet(&[_]Feature{}),
717 };717 };
718 result[@enumToInt(Feature.unaligned_scratch_access)] = .{718 result[@enumToInt(Feature.unaligned_scratch_access)] = .{
...@@ -770,7 +770,6 @@ pub const all_features = blk: {...@@ -770,7 +770,6 @@ pub const all_features = blk: {
770 .mad_mac_f32_insts,770 .mad_mac_f32_insts,
771 .mimg_r128,771 .mimg_r128,
772 .movrel,772 .movrel,
773 .no_sram_ecc_support,
774 .s_memrealtime,773 .s_memrealtime,
775 .s_memtime_inst,774 .s_memtime_inst,
776 .scalar_stores,775 .scalar_stores,
...@@ -778,6 +777,7 @@ pub const all_features = blk: {...@@ -778,6 +777,7 @@ pub const all_features = blk: {
778 .sdwa_mav,777 .sdwa_mav,
779 .sdwa_out_mods_vopc,778 .sdwa_out_mods_vopc,
780 .trig_reduced_range,779 .trig_reduced_range,
780 .unaligned_buffer_access,
781 .vgpr_index_mode,781 .vgpr_index_mode,
782 .wavefrontsize64,782 .wavefrontsize64,
783 }),783 }),
...@@ -817,6 +817,11 @@ pub const all_features = blk: {...@@ -817,6 +817,11 @@ pub const all_features = blk: {
817 .description = "Enable XNACK support",817 .description = "Enable XNACK support",
818 .dependencies = featureSet(&[_]Feature{}),818 .dependencies = featureSet(&[_]Feature{}),
819 };819 };
820 result[@enumToInt(Feature.xnack_support)] = .{
821 .llvm_name = "xnack-support",
822 .description = "Hardware supports XNACK",
823 .dependencies = featureSet(&[_]Feature{}),
824 };
820 const ti = @typeInfo(Feature);825 const ti = @typeInfo(Feature);
821 for (result) |*elem, i| {826 for (result) |*elem, i| {
822 elem.index = i;827 elem.index = i;
...@@ -830,9 +835,7 @@ pub const cpu = struct {...@@ -830,9 +835,7 @@ pub const cpu = struct {
830 .name = "bonaire",835 .name = "bonaire",
831 .llvm_name = "bonaire",836 .llvm_name = "bonaire",
832 .features = featureSet(&[_]Feature{837 .features = featureSet(&[_]Feature{
833 .code_object_v3,
834 .ldsbankcount32,838 .ldsbankcount32,
835 .no_xnack_support,
836 .sea_islands,839 .sea_islands,
837 }),840 }),
838 };841 };
...@@ -840,22 +843,19 @@ pub const cpu = struct {...@@ -840,22 +843,19 @@ pub const cpu = struct {
840 .name = "carrizo",843 .name = "carrizo",
841 .llvm_name = "carrizo",844 .llvm_name = "carrizo",
842 .features = featureSet(&[_]Feature{845 .features = featureSet(&[_]Feature{
843 .code_object_v3,
844 .fast_fmaf,846 .fast_fmaf,
845 .half_rate_64_ops,847 .half_rate_64_ops,
846 .ldsbankcount32,848 .ldsbankcount32,
847 .unpacked_d16_vmem,849 .unpacked_d16_vmem,
848 .volcanic_islands,850 .volcanic_islands,
849 .xnack,851 .xnack_support,
850 }),852 }),
851 };853 };
852 pub const fiji = CpuModel{854 pub const fiji = CpuModel{
853 .name = "fiji",855 .name = "fiji",
854 .llvm_name = "fiji",856 .llvm_name = "fiji",
855 .features = featureSet(&[_]Feature{857 .features = featureSet(&[_]Feature{
856 .code_object_v3,
857 .ldsbankcount32,858 .ldsbankcount32,
858 .no_xnack_support,
859 .unpacked_d16_vmem,859 .unpacked_d16_vmem,
860 .volcanic_islands,860 .volcanic_islands,
861 }),861 }),
...@@ -879,7 +879,6 @@ pub const cpu = struct {...@@ -879,7 +879,6 @@ pub const cpu = struct {
879 .name = "gfx1010",879 .name = "gfx1010",
880 .llvm_name = "gfx1010",880 .llvm_name = "gfx1010",
881 .features = featureSet(&[_]Feature{881 .features = featureSet(&[_]Feature{
882 .code_object_v3,
883 .dl_insts,882 .dl_insts,
884 .ds_src2_insts,883 .ds_src2_insts,
885 .flat_segment_offset_bug,884 .flat_segment_offset_bug,
...@@ -890,7 +889,6 @@ pub const cpu = struct {...@@ -890,7 +889,6 @@ pub const cpu = struct {
890 .lds_misaligned_bug,889 .lds_misaligned_bug,
891 .ldsbankcount32,890 .ldsbankcount32,
892 .mad_mac_f32_insts,891 .mad_mac_f32_insts,
893 .no_xnack_support,
894 .nsa_encoding,892 .nsa_encoding,
895 .nsa_to_vmem_bug,893 .nsa_to_vmem_bug,
896 .offset_3f_bug,894 .offset_3f_bug,
...@@ -903,13 +901,13 @@ pub const cpu = struct {...@@ -903,13 +901,13 @@ pub const cpu = struct {
903 .vcmpx_permlane_hazard,901 .vcmpx_permlane_hazard,
904 .vmem_to_scalar_write_hazard,902 .vmem_to_scalar_write_hazard,
905 .wavefrontsize32,903 .wavefrontsize32,
904 .xnack_support,
906 }),905 }),
907 };906 };
908 pub const gfx1011 = CpuModel{907 pub const gfx1011 = CpuModel{
909 .name = "gfx1011",908 .name = "gfx1011",
910 .llvm_name = "gfx1011",909 .llvm_name = "gfx1011",
911 .features = featureSet(&[_]Feature{910 .features = featureSet(&[_]Feature{
912 .code_object_v3,
913 .dl_insts,911 .dl_insts,
914 .dot1_insts,912 .dot1_insts,
915 .dot2_insts,913 .dot2_insts,
...@@ -921,9 +919,9 @@ pub const cpu = struct {...@@ -921,9 +919,9 @@ pub const cpu = struct {
921 .gfx10,919 .gfx10,
922 .inst_fwd_prefetch_bug,920 .inst_fwd_prefetch_bug,
923 .lds_branch_vmem_war_hazard,921 .lds_branch_vmem_war_hazard,
922 .lds_misaligned_bug,
924 .ldsbankcount32,923 .ldsbankcount32,
925 .mad_mac_f32_insts,924 .mad_mac_f32_insts,
926 .no_xnack_support,
927 .nsa_encoding,925 .nsa_encoding,
928 .nsa_to_vmem_bug,926 .nsa_to_vmem_bug,
929 .offset_3f_bug,927 .offset_3f_bug,
...@@ -936,13 +934,13 @@ pub const cpu = struct {...@@ -936,13 +934,13 @@ pub const cpu = struct {
936 .vcmpx_permlane_hazard,934 .vcmpx_permlane_hazard,
937 .vmem_to_scalar_write_hazard,935 .vmem_to_scalar_write_hazard,
938 .wavefrontsize32,936 .wavefrontsize32,
937 .xnack_support,
939 }),938 }),
940 };939 };
941 pub const gfx1012 = CpuModel{940 pub const gfx1012 = CpuModel{
942 .name = "gfx1012",941 .name = "gfx1012",
943 .llvm_name = "gfx1012",942 .llvm_name = "gfx1012",
944 .features = featureSet(&[_]Feature{943 .features = featureSet(&[_]Feature{
945 .code_object_v3,
946 .dl_insts,944 .dl_insts,
947 .dot1_insts,945 .dot1_insts,
948 .dot2_insts,946 .dot2_insts,
...@@ -957,7 +955,6 @@ pub const cpu = struct {...@@ -957,7 +955,6 @@ pub const cpu = struct {
957 .lds_misaligned_bug,955 .lds_misaligned_bug,
958 .ldsbankcount32,956 .ldsbankcount32,
959 .mad_mac_f32_insts,957 .mad_mac_f32_insts,
960 .no_xnack_support,
961 .nsa_encoding,958 .nsa_encoding,
962 .nsa_to_vmem_bug,959 .nsa_to_vmem_bug,
963 .offset_3f_bug,960 .offset_3f_bug,
...@@ -970,13 +967,13 @@ pub const cpu = struct {...@@ -970,13 +967,13 @@ pub const cpu = struct {
970 .vcmpx_permlane_hazard,967 .vcmpx_permlane_hazard,
971 .vmem_to_scalar_write_hazard,968 .vmem_to_scalar_write_hazard,
972 .wavefrontsize32,969 .wavefrontsize32,
970 .xnack_support,
973 }),971 }),
974 };972 };
975 pub const gfx1030 = CpuModel{973 pub const gfx1030 = CpuModel{
976 .name = "gfx1030",974 .name = "gfx1030",
977 .llvm_name = "gfx1030",975 .llvm_name = "gfx1030",
978 .features = featureSet(&[_]Feature{976 .features = featureSet(&[_]Feature{
979 .code_object_v3,
980 .dl_insts,977 .dl_insts,
981 .dot1_insts,978 .dot1_insts,
982 .dot2_insts,979 .dot2_insts,
...@@ -986,7 +983,57 @@ pub const cpu = struct {...@@ -986,7 +983,57 @@ pub const cpu = struct {
986 .gfx10_3_insts,983 .gfx10_3_insts,
987 .gfx10_b_encoding,984 .gfx10_b_encoding,
988 .ldsbankcount32,985 .ldsbankcount32,
989 .no_xnack_support,986 .nsa_encoding,
987 .wavefrontsize32,
988 }),
989 };
990 pub const gfx1031 = CpuModel{
991 .name = "gfx1031",
992 .llvm_name = "gfx1031",
993 .features = featureSet(&[_]Feature{
994 .dl_insts,
995 .dot1_insts,
996 .dot2_insts,
997 .dot5_insts,
998 .dot6_insts,
999 .gfx10,
1000 .gfx10_3_insts,
1001 .gfx10_b_encoding,
1002 .ldsbankcount32,
1003 .nsa_encoding,
1004 .wavefrontsize32,
1005 }),
1006 };
1007 pub const gfx1032 = CpuModel{
1008 .name = "gfx1032",
1009 .llvm_name = "gfx1032",
1010 .features = featureSet(&[_]Feature{
1011 .dl_insts,
1012 .dot1_insts,
1013 .dot2_insts,
1014 .dot5_insts,
1015 .dot6_insts,
1016 .gfx10,
1017 .gfx10_3_insts,
1018 .gfx10_b_encoding,
1019 .ldsbankcount32,
1020 .nsa_encoding,
1021 .wavefrontsize32,
1022 }),
1023 };
1024 pub const gfx1033 = CpuModel{
1025 .name = "gfx1033",
1026 .llvm_name = "gfx1033",
1027 .features = featureSet(&[_]Feature{
1028 .dl_insts,
1029 .dot1_insts,
1030 .dot2_insts,
1031 .dot5_insts,
1032 .dot6_insts,
1033 .gfx10,
1034 .gfx10_3_insts,
1035 .gfx10_b_encoding,
1036 .ldsbankcount32,
990 .nsa_encoding,1037 .nsa_encoding,
991 .wavefrontsize32,1038 .wavefrontsize32,
992 }),1039 }),
...@@ -995,11 +1042,8 @@ pub const cpu = struct {...@@ -995,11 +1042,8 @@ pub const cpu = struct {
995 .name = "gfx600",1042 .name = "gfx600",
996 .llvm_name = "gfx600",1043 .llvm_name = "gfx600",
997 .features = featureSet(&[_]Feature{1044 .features = featureSet(&[_]Feature{
998 .code_object_v3,
999 .fast_fmaf,1045 .fast_fmaf,
1000 .half_rate_64_ops,1046 .half_rate_64_ops,
1001 .ldsbankcount32,
1002 .no_xnack_support,
1003 .southern_islands,1047 .southern_islands,
1004 }),1048 }),
1005 };1049 };
...@@ -1007,9 +1051,13 @@ pub const cpu = struct {...@@ -1007,9 +1051,13 @@ pub const cpu = struct {
1007 .name = "gfx601",1051 .name = "gfx601",
1008 .llvm_name = "gfx601",1052 .llvm_name = "gfx601",
1009 .features = featureSet(&[_]Feature{1053 .features = featureSet(&[_]Feature{
1010 .code_object_v3,1054 .southern_islands,
1011 .ldsbankcount32,1055 }),
1012 .no_xnack_support,1056 };
1057 pub const gfx602 = CpuModel{
1058 .name = "gfx602",
1059 .llvm_name = "gfx602",
1060 .features = featureSet(&[_]Feature{
1013 .southern_islands,1061 .southern_islands,
1014 }),1062 }),
1015 };1063 };
...@@ -1017,9 +1065,7 @@ pub const cpu = struct {...@@ -1017,9 +1065,7 @@ pub const cpu = struct {
1017 .name = "gfx700",1065 .name = "gfx700",
1018 .llvm_name = "gfx700",1066 .llvm_name = "gfx700",
1019 .features = featureSet(&[_]Feature{1067 .features = featureSet(&[_]Feature{
1020 .code_object_v3,
1021 .ldsbankcount32,1068 .ldsbankcount32,
1022 .no_xnack_support,
1023 .sea_islands,1069 .sea_islands,
1024 }),1070 }),
1025 };1071 };
...@@ -1027,11 +1073,9 @@ pub const cpu = struct {...@@ -1027,11 +1073,9 @@ pub const cpu = struct {
1027 .name = "gfx701",1073 .name = "gfx701",
1028 .llvm_name = "gfx701",1074 .llvm_name = "gfx701",
1029 .features = featureSet(&[_]Feature{1075 .features = featureSet(&[_]Feature{
1030 .code_object_v3,
1031 .fast_fmaf,1076 .fast_fmaf,
1032 .half_rate_64_ops,1077 .half_rate_64_ops,
1033 .ldsbankcount32,1078 .ldsbankcount32,
1034 .no_xnack_support,
1035 .sea_islands,1079 .sea_islands,
1036 }),1080 }),
1037 };1081 };
...@@ -1039,10 +1083,8 @@ pub const cpu = struct {...@@ -1039,10 +1083,8 @@ pub const cpu = struct {
1039 .name = "gfx702",1083 .name = "gfx702",
1040 .llvm_name = "gfx702",1084 .llvm_name = "gfx702",
1041 .features = featureSet(&[_]Feature{1085 .features = featureSet(&[_]Feature{
1042 .code_object_v3,
1043 .fast_fmaf,1086 .fast_fmaf,
1044 .ldsbankcount16,1087 .ldsbankcount16,
1045 .no_xnack_support,
1046 .sea_islands,1088 .sea_islands,
1047 }),1089 }),
1048 };1090 };
...@@ -1050,9 +1092,7 @@ pub const cpu = struct {...@@ -1050,9 +1092,7 @@ pub const cpu = struct {
1050 .name = "gfx703",1092 .name = "gfx703",
1051 .llvm_name = "gfx703",1093 .llvm_name = "gfx703",
1052 .features = featureSet(&[_]Feature{1094 .features = featureSet(&[_]Feature{
1053 .code_object_v3,
1054 .ldsbankcount16,1095 .ldsbankcount16,
1055 .no_xnack_support,
1056 .sea_islands,1096 .sea_islands,
1057 }),1097 }),
1058 };1098 };
...@@ -1060,9 +1100,15 @@ pub const cpu = struct {...@@ -1060,9 +1100,15 @@ pub const cpu = struct {
1060 .name = "gfx704",1100 .name = "gfx704",
1061 .llvm_name = "gfx704",1101 .llvm_name = "gfx704",
1062 .features = featureSet(&[_]Feature{1102 .features = featureSet(&[_]Feature{
1063 .code_object_v3,
1064 .ldsbankcount32,1103 .ldsbankcount32,
1065 .no_xnack_support,1104 .sea_islands,
1105 }),
1106 };
1107 pub const gfx705 = CpuModel{
1108 .name = "gfx705",
1109 .llvm_name = "gfx705",
1110 .features = featureSet(&[_]Feature{
1111 .ldsbankcount16,
1066 .sea_islands,1112 .sea_islands,
1067 }),1113 }),
1068 };1114 };
...@@ -1070,22 +1116,19 @@ pub const cpu = struct {...@@ -1070,22 +1116,19 @@ pub const cpu = struct {
1070 .name = "gfx801",1116 .name = "gfx801",
1071 .llvm_name = "gfx801",1117 .llvm_name = "gfx801",
1072 .features = featureSet(&[_]Feature{1118 .features = featureSet(&[_]Feature{
1073 .code_object_v3,
1074 .fast_fmaf,1119 .fast_fmaf,
1075 .half_rate_64_ops,1120 .half_rate_64_ops,
1076 .ldsbankcount32,1121 .ldsbankcount32,
1077 .unpacked_d16_vmem,1122 .unpacked_d16_vmem,
1078 .volcanic_islands,1123 .volcanic_islands,
1079 .xnack,1124 .xnack_support,
1080 }),1125 }),
1081 };1126 };
1082 pub const gfx802 = CpuModel{1127 pub const gfx802 = CpuModel{
1083 .name = "gfx802",1128 .name = "gfx802",
1084 .llvm_name = "gfx802",1129 .llvm_name = "gfx802",
1085 .features = featureSet(&[_]Feature{1130 .features = featureSet(&[_]Feature{
1086 .code_object_v3,
1087 .ldsbankcount32,1131 .ldsbankcount32,
1088 .no_xnack_support,
1089 .sgpr_init_bug,1132 .sgpr_init_bug,
1090 .unpacked_d16_vmem,1133 .unpacked_d16_vmem,
1091 .volcanic_islands,1134 .volcanic_islands,
...@@ -1095,9 +1138,17 @@ pub const cpu = struct {...@@ -1095,9 +1138,17 @@ pub const cpu = struct {
1095 .name = "gfx803",1138 .name = "gfx803",
1096 .llvm_name = "gfx803",1139 .llvm_name = "gfx803",
1097 .features = featureSet(&[_]Feature{1140 .features = featureSet(&[_]Feature{
1098 .code_object_v3,
1099 .ldsbankcount32,1141 .ldsbankcount32,
1100 .no_xnack_support,1142 .unpacked_d16_vmem,
1143 .volcanic_islands,
1144 }),
1145 };
1146 pub const gfx805 = CpuModel{
1147 .name = "gfx805",
1148 .llvm_name = "gfx805",
1149 .features = featureSet(&[_]Feature{
1150 .ldsbankcount32,
1151 .sgpr_init_bug,
1101 .unpacked_d16_vmem,1152 .unpacked_d16_vmem,
1102 .volcanic_islands,1153 .volcanic_islands,
1103 }),1154 }),
...@@ -1106,61 +1157,56 @@ pub const cpu = struct {...@@ -1106,61 +1157,56 @@ pub const cpu = struct {
1106 .name = "gfx810",1157 .name = "gfx810",
1107 .llvm_name = "gfx810",1158 .llvm_name = "gfx810",
1108 .features = featureSet(&[_]Feature{1159 .features = featureSet(&[_]Feature{
1109 .code_object_v3,1160 .image_gather4_d16_bug,
1161 .image_store_d16_bug,
1110 .ldsbankcount16,1162 .ldsbankcount16,
1111 .volcanic_islands,1163 .volcanic_islands,
1112 .xnack,1164 .xnack_support,
1113 }),1165 }),
1114 };1166 };
1115 pub const gfx900 = CpuModel{1167 pub const gfx900 = CpuModel{
1116 .name = "gfx900",1168 .name = "gfx900",
1117 .llvm_name = "gfx900",1169 .llvm_name = "gfx900",
1118 .features = featureSet(&[_]Feature{1170 .features = featureSet(&[_]Feature{
1119 .code_object_v3,
1120 .gfx9,1171 .gfx9,
1172 .image_gather4_d16_bug,
1121 .ldsbankcount32,1173 .ldsbankcount32,
1122 .mad_mix_insts,1174 .mad_mix_insts,
1123 .no_sram_ecc_support,
1124 .no_xnack_support,
1125 }),1175 }),
1126 };1176 };
1127 pub const gfx902 = CpuModel{1177 pub const gfx902 = CpuModel{
1128 .name = "gfx902",1178 .name = "gfx902",
1129 .llvm_name = "gfx902",1179 .llvm_name = "gfx902",
1130 .features = featureSet(&[_]Feature{1180 .features = featureSet(&[_]Feature{
1131 .code_object_v3,
1132 .gfx9,1181 .gfx9,
1182 .image_gather4_d16_bug,
1133 .ldsbankcount32,1183 .ldsbankcount32,
1134 .mad_mix_insts,1184 .mad_mix_insts,
1135 .no_sram_ecc_support,
1136 .xnack,
1137 }),1185 }),
1138 };1186 };
1139 pub const gfx904 = CpuModel{1187 pub const gfx904 = CpuModel{
1140 .name = "gfx904",1188 .name = "gfx904",
1141 .llvm_name = "gfx904",1189 .llvm_name = "gfx904",
1142 .features = featureSet(&[_]Feature{1190 .features = featureSet(&[_]Feature{
1143 .code_object_v3,
1144 .fma_mix_insts,1191 .fma_mix_insts,
1145 .gfx9,1192 .gfx9,
1193 .image_gather4_d16_bug,
1146 .ldsbankcount32,1194 .ldsbankcount32,
1147 .no_sram_ecc_support,
1148 .no_xnack_support,
1149 }),1195 }),
1150 };1196 };
1151 pub const gfx906 = CpuModel{1197 pub const gfx906 = CpuModel{
1152 .name = "gfx906",1198 .name = "gfx906",
1153 .llvm_name = "gfx906",1199 .llvm_name = "gfx906",
1154 .features = featureSet(&[_]Feature{1200 .features = featureSet(&[_]Feature{
1155 .code_object_v3,
1156 .dl_insts,1201 .dl_insts,
1157 .dot1_insts,1202 .dot1_insts,
1158 .dot2_insts,1203 .dot2_insts,
1159 .fma_mix_insts,1204 .fma_mix_insts,
1160 .gfx9,1205 .gfx9,
1161 .half_rate_64_ops,1206 .half_rate_64_ops,
1207 .image_gather4_d16_bug,
1162 .ldsbankcount32,1208 .ldsbankcount32,
1163 .no_xnack_support,1209 .sramecc_support,
1164 }),1210 }),
1165 };1211 };
1166 pub const gfx908 = CpuModel{1212 pub const gfx908 = CpuModel{
...@@ -1168,7 +1214,6 @@ pub const cpu = struct {...@@ -1168,7 +1214,6 @@ pub const cpu = struct {
1168 .llvm_name = "gfx908",1214 .llvm_name = "gfx908",
1169 .features = featureSet(&[_]Feature{1215 .features = featureSet(&[_]Feature{
1170 .atomic_fadd_insts,1216 .atomic_fadd_insts,
1171 .code_object_v3,
1172 .dl_insts,1217 .dl_insts,
1173 .dot1_insts,1218 .dot1_insts,
1174 .dot2_insts,1219 .dot2_insts,
...@@ -1179,19 +1224,30 @@ pub const cpu = struct {...@@ -1179,19 +1224,30 @@ pub const cpu = struct {
1179 .fma_mix_insts,1224 .fma_mix_insts,
1180 .gfx9,1225 .gfx9,
1181 .half_rate_64_ops,1226 .half_rate_64_ops,
1227 .image_gather4_d16_bug,
1182 .ldsbankcount32,1228 .ldsbankcount32,
1183 .mai_insts,1229 .mai_insts,
1184 .mfma_inline_literal_bug,1230 .mfma_inline_literal_bug,
1185 .pk_fmac_f16_inst,1231 .pk_fmac_f16_inst,
1186 .sram_ecc,1232 .sramecc_support,
1187 }),1233 }),
1188 };1234 };
1189 pub const gfx909 = CpuModel{1235 pub const gfx909 = CpuModel{
1190 .name = "gfx909",1236 .name = "gfx909",
1191 .llvm_name = "gfx909",1237 .llvm_name = "gfx909",
1192 .features = featureSet(&[_]Feature{1238 .features = featureSet(&[_]Feature{
1193 .code_object_v3,
1194 .gfx9,1239 .gfx9,
1240 .image_gather4_d16_bug,
1241 .ldsbankcount32,
1242 .mad_mix_insts,
1243 }),
1244 };
1245 pub const gfx90c = CpuModel{
1246 .name = "gfx90c",
1247 .llvm_name = "gfx90c",
1248 .features = featureSet(&[_]Feature{
1249 .gfx9,
1250 .image_gather4_d16_bug,
1195 .ldsbankcount32,1251 .ldsbankcount32,
1196 .mad_mix_insts,1252 .mad_mix_insts,
1197 .xnack,1253 .xnack,
...@@ -1201,9 +1257,6 @@ pub const cpu = struct {...@@ -1201,9 +1257,6 @@ pub const cpu = struct {
1201 .name = "hainan",1257 .name = "hainan",
1202 .llvm_name = "hainan",1258 .llvm_name = "hainan",
1203 .features = featureSet(&[_]Feature{1259 .features = featureSet(&[_]Feature{
1204 .code_object_v3,
1205 .ldsbankcount32,
1206 .no_xnack_support,
1207 .southern_islands,1260 .southern_islands,
1208 }),1261 }),
1209 };1262 };
...@@ -1211,11 +1264,9 @@ pub const cpu = struct {...@@ -1211,11 +1264,9 @@ pub const cpu = struct {
1211 .name = "hawaii",1264 .name = "hawaii",
1212 .llvm_name = "hawaii",1265 .llvm_name = "hawaii",
1213 .features = featureSet(&[_]Feature{1266 .features = featureSet(&[_]Feature{
1214 .code_object_v3,
1215 .fast_fmaf,1267 .fast_fmaf,
1216 .half_rate_64_ops,1268 .half_rate_64_ops,
1217 .ldsbankcount32,1269 .ldsbankcount32,
1218 .no_xnack_support,
1219 .sea_islands,1270 .sea_islands,
1220 }),1271 }),
1221 };1272 };
...@@ -1223,9 +1274,7 @@ pub const cpu = struct {...@@ -1223,9 +1274,7 @@ pub const cpu = struct {
1223 .name = "iceland",1274 .name = "iceland",
1224 .llvm_name = "iceland",1275 .llvm_name = "iceland",
1225 .features = featureSet(&[_]Feature{1276 .features = featureSet(&[_]Feature{
1226 .code_object_v3,
1227 .ldsbankcount32,1277 .ldsbankcount32,
1228 .no_xnack_support,
1229 .sgpr_init_bug,1278 .sgpr_init_bug,
1230 .unpacked_d16_vmem,1279 .unpacked_d16_vmem,
1231 .volcanic_islands,1280 .volcanic_islands,
...@@ -1235,9 +1284,7 @@ pub const cpu = struct {...@@ -1235,9 +1284,7 @@ pub const cpu = struct {
1235 .name = "kabini",1284 .name = "kabini",
1236 .llvm_name = "kabini",1285 .llvm_name = "kabini",
1237 .features = featureSet(&[_]Feature{1286 .features = featureSet(&[_]Feature{
1238 .code_object_v3,
1239 .ldsbankcount16,1287 .ldsbankcount16,
1240 .no_xnack_support,
1241 .sea_islands,1288 .sea_islands,
1242 }),1289 }),
1243 };1290 };
...@@ -1245,9 +1292,7 @@ pub const cpu = struct {...@@ -1245,9 +1292,7 @@ pub const cpu = struct {
1245 .name = "kaveri",1292 .name = "kaveri",
1246 .llvm_name = "kaveri",1293 .llvm_name = "kaveri",
1247 .features = featureSet(&[_]Feature{1294 .features = featureSet(&[_]Feature{
1248 .code_object_v3,
1249 .ldsbankcount32,1295 .ldsbankcount32,
1250 .no_xnack_support,
1251 .sea_islands,1296 .sea_islands,
1252 }),1297 }),
1253 };1298 };
...@@ -1255,9 +1300,7 @@ pub const cpu = struct {...@@ -1255,9 +1300,7 @@ pub const cpu = struct {
1255 .name = "mullins",1300 .name = "mullins",
1256 .llvm_name = "mullins",1301 .llvm_name = "mullins",
1257 .features = featureSet(&[_]Feature{1302 .features = featureSet(&[_]Feature{
1258 .code_object_v3,
1259 .ldsbankcount16,1303 .ldsbankcount16,
1260 .no_xnack_support,
1261 .sea_islands,1304 .sea_islands,
1262 }),1305 }),
1263 };1306 };
...@@ -1265,9 +1308,6 @@ pub const cpu = struct {...@@ -1265,9 +1308,6 @@ pub const cpu = struct {
1265 .name = "oland",1308 .name = "oland",
1266 .llvm_name = "oland",1309 .llvm_name = "oland",
1267 .features = featureSet(&[_]Feature{1310 .features = featureSet(&[_]Feature{
1268 .code_object_v3,
1269 .ldsbankcount32,
1270 .no_xnack_support,
1271 .southern_islands,1311 .southern_islands,
1272 }),1312 }),
1273 };1313 };
...@@ -1275,9 +1315,6 @@ pub const cpu = struct {...@@ -1275,9 +1315,6 @@ pub const cpu = struct {
1275 .name = "pitcairn",1315 .name = "pitcairn",
1276 .llvm_name = "pitcairn",1316 .llvm_name = "pitcairn",
1277 .features = featureSet(&[_]Feature{1317 .features = featureSet(&[_]Feature{
1278 .code_object_v3,
1279 .ldsbankcount32,
1280 .no_xnack_support,
1281 .southern_islands,1318 .southern_islands,
1282 }),1319 }),
1283 };1320 };
...@@ -1285,9 +1322,7 @@ pub const cpu = struct {...@@ -1285,9 +1322,7 @@ pub const cpu = struct {
1285 .name = "polaris10",1322 .name = "polaris10",
1286 .llvm_name = "polaris10",1323 .llvm_name = "polaris10",
1287 .features = featureSet(&[_]Feature{1324 .features = featureSet(&[_]Feature{
1288 .code_object_v3,
1289 .ldsbankcount32,1325 .ldsbankcount32,
1290 .no_xnack_support,
1291 .unpacked_d16_vmem,1326 .unpacked_d16_vmem,
1292 .volcanic_islands,1327 .volcanic_islands,
1293 }),1328 }),
...@@ -1296,9 +1331,7 @@ pub const cpu = struct {...@@ -1296,9 +1331,7 @@ pub const cpu = struct {
1296 .name = "polaris11",1331 .name = "polaris11",
1297 .llvm_name = "polaris11",1332 .llvm_name = "polaris11",
1298 .features = featureSet(&[_]Feature{1333 .features = featureSet(&[_]Feature{
1299 .code_object_v3,
1300 .ldsbankcount32,1334 .ldsbankcount32,
1301 .no_xnack_support,
1302 .unpacked_d16_vmem,1335 .unpacked_d16_vmem,
1303 .volcanic_islands,1336 .volcanic_islands,
1304 }),1337 }),
...@@ -1307,21 +1340,19 @@ pub const cpu = struct {...@@ -1307,21 +1340,19 @@ pub const cpu = struct {
1307 .name = "stoney",1340 .name = "stoney",
1308 .llvm_name = "stoney",1341 .llvm_name = "stoney",
1309 .features = featureSet(&[_]Feature{1342 .features = featureSet(&[_]Feature{
1310 .code_object_v3,1343 .image_gather4_d16_bug,
1344 .image_store_d16_bug,
1311 .ldsbankcount16,1345 .ldsbankcount16,
1312 .volcanic_islands,1346 .volcanic_islands,
1313 .xnack,1347 .xnack_support,
1314 }),1348 }),
1315 };1349 };
1316 pub const tahiti = CpuModel{1350 pub const tahiti = CpuModel{
1317 .name = "tahiti",1351 .name = "tahiti",
1318 .llvm_name = "tahiti",1352 .llvm_name = "tahiti",
1319 .features = featureSet(&[_]Feature{1353 .features = featureSet(&[_]Feature{
1320 .code_object_v3,
1321 .fast_fmaf,1354 .fast_fmaf,
1322 .half_rate_64_ops,1355 .half_rate_64_ops,
1323 .ldsbankcount32,
1324 .no_xnack_support,
1325 .southern_islands,1356 .southern_islands,
1326 }),1357 }),
1327 };1358 };
...@@ -1329,9 +1360,17 @@ pub const cpu = struct {...@@ -1329,9 +1360,17 @@ pub const cpu = struct {
1329 .name = "tonga",1360 .name = "tonga",
1330 .llvm_name = "tonga",1361 .llvm_name = "tonga",
1331 .features = featureSet(&[_]Feature{1362 .features = featureSet(&[_]Feature{
1332 .code_object_v3,
1333 .ldsbankcount32,1363 .ldsbankcount32,
1334 .no_xnack_support,1364 .sgpr_init_bug,
1365 .unpacked_d16_vmem,
1366 .volcanic_islands,
1367 }),
1368 };
1369 pub const tongapro = CpuModel{
1370 .name = "tongapro",
1371 .llvm_name = "tongapro",
1372 .features = featureSet(&[_]Feature{
1373 .ldsbankcount32,
1335 .sgpr_init_bug,1374 .sgpr_init_bug,
1336 .unpacked_d16_vmem,1375 .unpacked_d16_vmem,
1337 .volcanic_islands,1376 .volcanic_islands,
...@@ -1341,9 +1380,6 @@ pub const cpu = struct {...@@ -1341,9 +1380,6 @@ pub const cpu = struct {
1341 .name = "verde",1380 .name = "verde",
1342 .llvm_name = "verde",1381 .llvm_name = "verde",
1343 .features = featureSet(&[_]Feature{1382 .features = featureSet(&[_]Feature{
1344 .code_object_v3,
1345 .ldsbankcount32,
1346 .no_xnack_support,
1347 .southern_islands,1383 .southern_islands,
1348 }),1384 }),
1349 };1385 };
lib/std/target/arm.zig+240-262
...@@ -1,8 +1,5 @@...@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
...@@ -53,6 +50,8 @@ pub const Feature = enum {...@@ -53,6 +50,8 @@ pub const Feature = enum {
53 fullfp16,50 fullfp16,
54 fuse_aes,51 fuse_aes,
55 fuse_literals,52 fuse_literals,
53 harden_sls_blr,
54 harden_sls_retbr,
56 has_v4t,55 has_v4t,
57 has_v5t,56 has_v5t,
58 has_v5te,57 has_v5te,
...@@ -62,6 +61,7 @@ pub const Feature = enum {...@@ -62,6 +61,7 @@ pub const Feature = enum {
62 has_v6t2,61 has_v6t2,
63 has_v7,62 has_v7,
64 has_v7clrex,63 has_v7clrex,
64 has_v8,
65 has_v8_1a,65 has_v8_1a,
66 has_v8_1m_main,66 has_v8_1m_main,
67 has_v8_2a,67 has_v8_2a,
...@@ -69,7 +69,7 @@ pub const Feature = enum {...@@ -69,7 +69,7 @@ pub const Feature = enum {
69 has_v8_4a,69 has_v8_4a,
70 has_v8_5a,70 has_v8_5a,
71 has_v8_6a,71 has_v8_6a,
72 has_v8,72 has_v8_7a,
73 has_v8m,73 has_v8m,
74 has_v8m_main,74 has_v8m_main,
75 hwdiv,75 hwdiv,
...@@ -85,10 +85,10 @@ pub const Feature = enum {...@@ -85,10 +85,10 @@ pub const Feature = enum {
85 mp,85 mp,
86 muxed_units,86 muxed_units,
87 mve,87 mve,
88 mve_fp,
89 mve1beat,88 mve1beat,
90 mve2beat,89 mve2beat,
91 mve4beat,90 mve4beat,
91 mve_fp,
92 nacl_trap,92 nacl_trap,
93 neon,93 neon,
94 neon_fpmovs,94 neon_fpmovs,
...@@ -148,10 +148,6 @@ pub const Feature = enum {...@@ -148,10 +148,6 @@ pub const Feature = enum {
148 v7r,148 v7r,
149 v7s,149 v7s,
150 v7ve,150 v7ve,
151 v8a,
152 v8m,
153 v8m_main,
154 v8r,
155 v8_1a,151 v8_1a,
156 v8_1m_main,152 v8_1m_main,
157 v8_2a,153 v8_2a,
...@@ -159,6 +155,11 @@ pub const Feature = enum {...@@ -159,6 +155,11 @@ pub const Feature = enum {
159 v8_4a,155 v8_4a,
160 v8_5a,156 v8_5a,
161 v8_6a,157 v8_6a,
158 v8_7a,
159 v8a,
160 v8m,
161 v8m_main,
162 v8r,
162 vfp2,163 vfp2,
163 vfp2sp,164 vfp2sp,
164 vfp3,165 vfp3,
...@@ -238,7 +239,7 @@ pub const all_features = blk: {...@@ -238,7 +239,7 @@ pub const all_features = blk: {
238 .llvm_name = "cde",239 .llvm_name = "cde",
239 .description = "Support CDE instructions",240 .description = "Support CDE instructions",
240 .dependencies = featureSet(&[_]Feature{241 .dependencies = featureSet(&[_]Feature{
241 .v8m_main,242 .has_v8m_main,
242 }),243 }),
243 };244 };
244 result[@enumToInt(Feature.cdecp0)] = .{245 result[@enumToInt(Feature.cdecp0)] = .{
...@@ -312,7 +313,6 @@ pub const all_features = blk: {...@@ -312,7 +313,6 @@ pub const all_features = blk: {
312 .description = "Enable support for Cryptography extensions",313 .description = "Enable support for Cryptography extensions",
313 .dependencies = featureSet(&[_]Feature{314 .dependencies = featureSet(&[_]Feature{
314 .aes,315 .aes,
315 .neon,
316 .sha2,316 .sha2,
317 }),317 }),
318 };318 };
...@@ -419,7 +419,6 @@ pub const all_features = blk: {...@@ -419,7 +419,6 @@ pub const all_features = blk: {
419 .description = "Enable ARMv8 FP with only 16 d-registers",419 .description = "Enable ARMv8 FP with only 16 d-registers",
420 .dependencies = featureSet(&[_]Feature{420 .dependencies = featureSet(&[_]Feature{
421 .fp_armv8d16sp,421 .fp_armv8d16sp,
422 .fp64,
423 .vfp4d16,422 .vfp4d16,
424 }),423 }),
425 };424 };
...@@ -434,7 +433,6 @@ pub const all_features = blk: {...@@ -434,7 +433,6 @@ pub const all_features = blk: {
434 .llvm_name = "fp-armv8sp",433 .llvm_name = "fp-armv8sp",
435 .description = "Enable ARMv8 FP with no double precision",434 .description = "Enable ARMv8 FP with no double precision",
436 .dependencies = featureSet(&[_]Feature{435 .dependencies = featureSet(&[_]Feature{
437 .d32,
438 .fp_armv8d16sp,436 .fp_armv8d16sp,
439 .vfp4sp,437 .vfp4sp,
440 }),438 }),
...@@ -481,6 +479,16 @@ pub const all_features = blk: {...@@ -481,6 +479,16 @@ pub const all_features = blk: {
481 .description = "CPU fuses literal generation operations",479 .description = "CPU fuses literal generation operations",
482 .dependencies = featureSet(&[_]Feature{}),480 .dependencies = featureSet(&[_]Feature{}),
483 };481 };
482 result[@enumToInt(Feature.harden_sls_blr)] = .{
483 .llvm_name = "harden-sls-blr",
484 .description = "Harden against straight line speculation across indirect calls",
485 .dependencies = featureSet(&[_]Feature{}),
486 };
487 result[@enumToInt(Feature.harden_sls_retbr)] = .{
488 .llvm_name = "harden-sls-retbr",
489 .description = "Harden against straight line speculation across RETurn and BranchRegister instructions",
490 .dependencies = featureSet(&[_]Feature{}),
491 };
484 result[@enumToInt(Feature.has_v4t)] = .{492 result[@enumToInt(Feature.has_v4t)] = .{
485 .llvm_name = "v4t",493 .llvm_name = "v4t",
486 .description = "Support ARM v4T instructions",494 .description = "Support ARM v4T instructions",
...@@ -525,18 +533,18 @@ pub const all_features = blk: {...@@ -525,18 +533,18 @@ pub const all_features = blk: {
525 .llvm_name = "v6t2",533 .llvm_name = "v6t2",
526 .description = "Support ARM v6t2 instructions",534 .description = "Support ARM v6t2 instructions",
527 .dependencies = featureSet(&[_]Feature{535 .dependencies = featureSet(&[_]Feature{
528 .thumb2,
529 .has_v6k,536 .has_v6k,
530 .has_v8m,537 .has_v8m,
538 .thumb2,
531 }),539 }),
532 };540 };
533 result[@enumToInt(Feature.has_v7)] = .{541 result[@enumToInt(Feature.has_v7)] = .{
534 .llvm_name = "v7",542 .llvm_name = "v7",
535 .description = "Support ARM v7 instructions",543 .description = "Support ARM v7 instructions",
536 .dependencies = featureSet(&[_]Feature{544 .dependencies = featureSet(&[_]Feature{
537 .perfmon,
538 .has_v6t2,545 .has_v6t2,
539 .has_v7clrex,546 .has_v7clrex,
547 .perfmon,
540 }),548 }),
541 };549 };
542 result[@enumToInt(Feature.has_v7clrex)] = .{550 result[@enumToInt(Feature.has_v7clrex)] = .{
...@@ -592,8 +600,8 @@ pub const all_features = blk: {...@@ -592,8 +600,8 @@ pub const all_features = blk: {
592 .llvm_name = "v8.5a",600 .llvm_name = "v8.5a",
593 .description = "Support ARM v8.5a instructions",601 .description = "Support ARM v8.5a instructions",
594 .dependencies = featureSet(&[_]Feature{602 .dependencies = featureSet(&[_]Feature{
595 .sb,
596 .has_v8_4a,603 .has_v8_4a,
604 .sb,
597 }),605 }),
598 };606 };
599 result[@enumToInt(Feature.has_v8_6a)] = .{607 result[@enumToInt(Feature.has_v8_6a)] = .{
...@@ -601,8 +609,15 @@ pub const all_features = blk: {...@@ -601,8 +609,15 @@ pub const all_features = blk: {
601 .description = "Support ARM v8.6a instructions",609 .description = "Support ARM v8.6a instructions",
602 .dependencies = featureSet(&[_]Feature{610 .dependencies = featureSet(&[_]Feature{
603 .bf16,611 .bf16,
604 .i8mm,
605 .has_v8_5a,612 .has_v8_5a,
613 .i8mm,
614 }),
615 };
616 result[@enumToInt(Feature.has_v8_7a)] = .{
617 .llvm_name = "v8.7a",
618 .description = "Support ARM v8.7a instructions",
619 .dependencies = featureSet(&[_]Feature{
620 .has_v8_6a,
606 }),621 }),
607 };622 };
608 result[@enumToInt(Feature.has_v8m)] = .{623 result[@enumToInt(Feature.has_v8m)] = .{
...@@ -640,14 +655,14 @@ pub const all_features = blk: {...@@ -640,14 +655,14 @@ pub const all_features = blk: {
640 .llvm_name = "iwmmxt",655 .llvm_name = "iwmmxt",
641 .description = "ARMv5te architecture",656 .description = "ARMv5te architecture",
642 .dependencies = featureSet(&[_]Feature{657 .dependencies = featureSet(&[_]Feature{
643 .has_v5te,658 .v5te,
644 }),659 }),
645 };660 };
646 result[@enumToInt(Feature.iwmmxt2)] = .{661 result[@enumToInt(Feature.iwmmxt2)] = .{
647 .llvm_name = "iwmmxt2",662 .llvm_name = "iwmmxt2",
648 .description = "ARMv5te architecture",663 .description = "ARMv5te architecture",
649 .dependencies = featureSet(&[_]Feature{664 .dependencies = featureSet(&[_]Feature{
650 .has_v5te,665 .v5te,
651 }),666 }),
652 };667 };
653 result[@enumToInt(Feature.lob)] = .{668 result[@enumToInt(Feature.lob)] = .{
...@@ -695,15 +710,6 @@ pub const all_features = blk: {...@@ -695,15 +710,6 @@ pub const all_features = blk: {
695 .has_v8_1m_main,710 .has_v8_1m_main,
696 }),711 }),
697 };712 };
698 result[@enumToInt(Feature.mve_fp)] = .{
699 .llvm_name = "mve.fp",
700 .description = "Support M-Class Vector Extension with integer and floating ops",
701 .dependencies = featureSet(&[_]Feature{
702 .fp_armv8d16sp,
703 .fullfp16,
704 .mve,
705 }),
706 };
707 result[@enumToInt(Feature.mve1beat)] = .{713 result[@enumToInt(Feature.mve1beat)] = .{
708 .llvm_name = "mve1beat",714 .llvm_name = "mve1beat",
709 .description = "Model MVE instructions as a 1 beat per tick architecture",715 .description = "Model MVE instructions as a 1 beat per tick architecture",
...@@ -719,6 +725,14 @@ pub const all_features = blk: {...@@ -719,6 +725,14 @@ pub const all_features = blk: {
719 .description = "Model MVE instructions as a 4 beats per tick architecture",725 .description = "Model MVE instructions as a 4 beats per tick architecture",
720 .dependencies = featureSet(&[_]Feature{}),726 .dependencies = featureSet(&[_]Feature{}),
721 };727 };
728 result[@enumToInt(Feature.mve_fp)] = .{
729 .llvm_name = "mve.fp",
730 .description = "Support M-Class Vector Extension with integer and floating ops",
731 .dependencies = featureSet(&[_]Feature{
732 .fullfp16,
733 .mve,
734 }),
735 };
722 result[@enumToInt(Feature.nacl_trap)] = .{736 result[@enumToInt(Feature.nacl_trap)] = .{
723 .llvm_name = "nacl-trap",737 .llvm_name = "nacl-trap",
724 .description = "NaCl trap",738 .description = "NaCl trap",
...@@ -944,32 +958,32 @@ pub const all_features = blk: {...@@ -944,32 +958,32 @@ pub const all_features = blk: {
944 .llvm_name = "armv4t",958 .llvm_name = "armv4t",
945 .description = "ARMv4t architecture",959 .description = "ARMv4t architecture",
946 .dependencies = featureSet(&[_]Feature{960 .dependencies = featureSet(&[_]Feature{
947 .strict_align,
948 .has_v4t,961 .has_v4t,
962 .strict_align,
949 }),963 }),
950 };964 };
951 result[@enumToInt(Feature.v5t)] = .{965 result[@enumToInt(Feature.v5t)] = .{
952 .llvm_name = "armv5t",966 .llvm_name = "armv5t",
953 .description = "ARMv5t architecture",967 .description = "ARMv5t architecture",
954 .dependencies = featureSet(&[_]Feature{968 .dependencies = featureSet(&[_]Feature{
955 .strict_align,
956 .has_v5t,969 .has_v5t,
970 .strict_align,
957 }),971 }),
958 };972 };
959 result[@enumToInt(Feature.v5te)] = .{973 result[@enumToInt(Feature.v5te)] = .{
960 .llvm_name = "armv5te",974 .llvm_name = "armv5te",
961 .description = "ARMv5te architecture",975 .description = "ARMv5te architecture",
962 .dependencies = featureSet(&[_]Feature{976 .dependencies = featureSet(&[_]Feature{
963 .strict_align,
964 .has_v5te,977 .has_v5te,
978 .strict_align,
965 }),979 }),
966 };980 };
967 result[@enumToInt(Feature.v5tej)] = .{981 result[@enumToInt(Feature.v5tej)] = .{
968 .llvm_name = "armv5tej",982 .llvm_name = "armv5tej",
969 .description = "ARMv5tej architecture",983 .description = "ARMv5tej architecture",
970 .dependencies = featureSet(&[_]Feature{984 .dependencies = featureSet(&[_]Feature{
971 .strict_align,
972 .has_v5te,985 .has_v5te,
986 .strict_align,
973 }),987 }),
974 };988 };
975 result[@enumToInt(Feature.v6)] = .{989 result[@enumToInt(Feature.v6)] = .{
...@@ -980,18 +994,6 @@ pub const all_features = blk: {...@@ -980,18 +994,6 @@ pub const all_features = blk: {
980 .has_v6,994 .has_v6,
981 }),995 }),
982 };996 };
983 result[@enumToInt(Feature.v6m)] = .{
984 .llvm_name = "armv6-m",
985 .description = "ARMv6m architecture",
986 .dependencies = featureSet(&[_]Feature{
987 .db,
988 .mclass,
989 .noarm,
990 .strict_align,
991 .thumb_mode,
992 .has_v6m,
993 }),
994 };
995 result[@enumToInt(Feature.v6j)] = .{997 result[@enumToInt(Feature.v6j)] = .{
996 .llvm_name = "armv6j",998 .llvm_name = "armv6j",
997 .description = "ARMv7a architecture",999 .description = "ARMv7a architecture",
...@@ -1010,8 +1012,20 @@ pub const all_features = blk: {...@@ -1010,8 +1012,20 @@ pub const all_features = blk: {
1010 .llvm_name = "armv6kz",1012 .llvm_name = "armv6kz",
1011 .description = "ARMv6kz architecture",1013 .description = "ARMv6kz architecture",
1012 .dependencies = featureSet(&[_]Feature{1014 .dependencies = featureSet(&[_]Feature{
1013 .trustzone,
1014 .has_v6k,1015 .has_v6k,
1016 .trustzone,
1017 }),
1018 };
1019 result[@enumToInt(Feature.v6m)] = .{
1020 .llvm_name = "armv6-m",
1021 .description = "ARMv6m architecture",
1022 .dependencies = featureSet(&[_]Feature{
1023 .db,
1024 .has_v6m,
1025 .mclass,
1026 .noarm,
1027 .strict_align,
1028 .thumb_mode,
1015 }),1029 }),
1016 };1030 };
1017 result[@enumToInt(Feature.v6sm)] = .{1031 result[@enumToInt(Feature.v6sm)] = .{
...@@ -1019,11 +1033,11 @@ pub const all_features = blk: {...@@ -1019,11 +1033,11 @@ pub const all_features = blk: {
1019 .description = "ARMv6sm architecture",1033 .description = "ARMv6sm architecture",
1020 .dependencies = featureSet(&[_]Feature{1034 .dependencies = featureSet(&[_]Feature{
1021 .db,1035 .db,
1036 .has_v6m,
1022 .mclass,1037 .mclass,
1023 .noarm,1038 .noarm,
1024 .strict_align,1039 .strict_align,
1025 .thumb_mode,1040 .thumb_mode,
1026 .has_v6m,
1027 }),1041 }),
1028 };1042 };
1029 result[@enumToInt(Feature.v6t2)] = .{1043 result[@enumToInt(Feature.v6t2)] = .{
...@@ -1041,53 +1055,51 @@ pub const all_features = blk: {...@@ -1041,53 +1055,51 @@ pub const all_features = blk: {
1041 .aclass,1055 .aclass,
1042 .db,1056 .db,
1043 .dsp,1057 .dsp,
1044 .neon,
1045 .has_v7,1058 .has_v7,
1059 .neon,
1046 }),1060 }),
1047 };1061 };
1048 result[@enumToInt(Feature.v7m)] = .{1062 result[@enumToInt(Feature.v7em)] = .{
1049 .llvm_name = "armv7-m",1063 .llvm_name = "armv7e-m",
1050 .description = "ARMv7m architecture",1064 .description = "ARMv7em architecture",
1051 .dependencies = featureSet(&[_]Feature{1065 .dependencies = featureSet(&[_]Feature{
1052 .db,1066 .db,
1067 .dsp,
1068 .has_v7,
1053 .hwdiv,1069 .hwdiv,
1054 .mclass,1070 .mclass,
1055 .noarm,1071 .noarm,
1056 .thumb_mode,1072 .thumb_mode,
1057 .thumb2,
1058 .has_v7,
1059 }),1073 }),
1060 };1074 };
1061 result[@enumToInt(Feature.v7r)] = .{1075 result[@enumToInt(Feature.v7k)] = .{
1062 .llvm_name = "armv7-r",1076 .llvm_name = "armv7k",
1063 .description = "ARMv7r architecture",1077 .description = "ARMv7a architecture",
1064 .dependencies = featureSet(&[_]Feature{1078 .dependencies = featureSet(&[_]Feature{
1065 .db,1079 .v7a,
1066 .dsp,
1067 .hwdiv,
1068 .rclass,
1069 .has_v7,
1070 }),1080 }),
1071 };1081 };
1072 result[@enumToInt(Feature.v7em)] = .{1082 result[@enumToInt(Feature.v7m)] = .{
1073 .llvm_name = "armv7e-m",1083 .llvm_name = "armv7-m",
1074 .description = "ARMv7em architecture",1084 .description = "ARMv7m architecture",
1075 .dependencies = featureSet(&[_]Feature{1085 .dependencies = featureSet(&[_]Feature{
1076 .db,1086 .db,
1077 .dsp,1087 .has_v7,
1078 .hwdiv,1088 .hwdiv,
1079 .mclass,1089 .mclass,
1080 .noarm,1090 .noarm,
1081 .thumb_mode,1091 .thumb_mode,
1082 .thumb2,
1083 .has_v7,
1084 }),1092 }),
1085 };1093 };
1086 result[@enumToInt(Feature.v7k)] = .{1094 result[@enumToInt(Feature.v7r)] = .{
1087 .llvm_name = "armv7k",1095 .llvm_name = "armv7-r",
1088 .description = "ARMv7a architecture",1096 .description = "ARMv7r architecture",
1089 .dependencies = featureSet(&[_]Feature{1097 .dependencies = featureSet(&[_]Feature{
1090 .v7a,1098 .db,
1099 .dsp,
1100 .has_v7,
1101 .hwdiv,
1102 .rclass,
1091 }),1103 }),
1092 };1104 };
1093 result[@enumToInt(Feature.v7s)] = .{1105 result[@enumToInt(Feature.v7s)] = .{
...@@ -1104,73 +1116,10 @@ pub const all_features = blk: {...@@ -1104,73 +1116,10 @@ pub const all_features = blk: {
1104 .aclass,1116 .aclass,
1105 .db,1117 .db,
1106 .dsp,1118 .dsp,
1107 .mp,
1108 .neon,
1109 .trustzone,
1110 .has_v7,1119 .has_v7,
1111 .virtualization,
1112 }),
1113 };
1114 result[@enumToInt(Feature.v8a)] = .{
1115 .llvm_name = "armv8-a",
1116 .description = "ARMv8a architecture",
1117 .dependencies = featureSet(&[_]Feature{
1118 .aclass,
1119 .crc,
1120 .crypto,
1121 .db,
1122 .dsp,
1123 .fp_armv8,
1124 .mp,1120 .mp,
1125 .neon,1121 .neon,
1126 .trustzone,1122 .trustzone,
1127 .has_v8,
1128 .virtualization,
1129 }),
1130 };
1131 result[@enumToInt(Feature.v8m)] = .{
1132 .llvm_name = "armv8-m.base",
1133 .description = "ARMv8mBaseline architecture",
1134 .dependencies = featureSet(&[_]Feature{
1135 .@"8msecext",
1136 .acquire_release,
1137 .db,
1138 .hwdiv,
1139 .mclass,
1140 .noarm,
1141 .strict_align,
1142 .thumb_mode,
1143 .has_v7clrex,
1144 .has_v8m,
1145 }),
1146 };
1147 result[@enumToInt(Feature.v8m_main)] = .{
1148 .llvm_name = "armv8-m.main",
1149 .description = "ARMv8mMainline architecture",
1150 .dependencies = featureSet(&[_]Feature{
1151 .@"8msecext",
1152 .acquire_release,
1153 .db,
1154 .hwdiv,
1155 .mclass,
1156 .noarm,
1157 .thumb_mode,
1158 .has_v8m_main,
1159 }),
1160 };
1161 result[@enumToInt(Feature.v8r)] = .{
1162 .llvm_name = "armv8-r",
1163 .description = "ARMv8r architecture",
1164 .dependencies = featureSet(&[_]Feature{
1165 .crc,
1166 .db,
1167 .dfb,
1168 .dsp,
1169 .fp_armv8,
1170 .mp,
1171 .neon,
1172 .rclass,
1173 .has_v8,
1174 .virtualization,1123 .virtualization,
1175 }),1124 }),
1176 };1125 };
...@@ -1184,10 +1133,9 @@ pub const all_features = blk: {...@@ -1184,10 +1133,9 @@ pub const all_features = blk: {
1184 .db,1133 .db,
1185 .dsp,1134 .dsp,
1186 .fp_armv8,1135 .fp_armv8,
1136 .has_v8_1a,
1187 .mp,1137 .mp,
1188 .neon,
1189 .trustzone,1138 .trustzone,
1190 .has_v8_1a,
1191 .virtualization,1139 .virtualization,
1192 }),1140 }),
1193 };1141 };
...@@ -1198,13 +1146,13 @@ pub const all_features = blk: {...@@ -1198,13 +1146,13 @@ pub const all_features = blk: {
1198 .@"8msecext",1146 .@"8msecext",
1199 .acquire_release,1147 .acquire_release,
1200 .db,1148 .db,
1149 .has_v8_1m_main,
1201 .hwdiv,1150 .hwdiv,
1202 .lob,1151 .lob,
1203 .mclass,1152 .mclass,
1204 .noarm,1153 .noarm,
1205 .ras,1154 .ras,
1206 .thumb_mode,1155 .thumb_mode,
1207 .has_v8_1m_main,
1208 }),1156 }),
1209 };1157 };
1210 result[@enumToInt(Feature.v8_2a)] = .{1158 result[@enumToInt(Feature.v8_2a)] = .{
...@@ -1217,11 +1165,10 @@ pub const all_features = blk: {...@@ -1217,11 +1165,10 @@ pub const all_features = blk: {
1217 .db,1165 .db,
1218 .dsp,1166 .dsp,
1219 .fp_armv8,1167 .fp_armv8,
1168 .has_v8_2a,
1220 .mp,1169 .mp,
1221 .neon,
1222 .ras,1170 .ras,
1223 .trustzone,1171 .trustzone,
1224 .has_v8_2a,
1225 .virtualization,1172 .virtualization,
1226 }),1173 }),
1227 };1174 };
...@@ -1235,11 +1182,10 @@ pub const all_features = blk: {...@@ -1235,11 +1182,10 @@ pub const all_features = blk: {
1235 .db,1182 .db,
1236 .dsp,1183 .dsp,
1237 .fp_armv8,1184 .fp_armv8,
1185 .has_v8_3a,
1238 .mp,1186 .mp,
1239 .neon,
1240 .ras,1187 .ras,
1241 .trustzone,1188 .trustzone,
1242 .has_v8_3a,
1243 .virtualization,1189 .virtualization,
1244 }),1190 }),
1245 };1191 };
...@@ -1251,14 +1197,12 @@ pub const all_features = blk: {...@@ -1251,14 +1197,12 @@ pub const all_features = blk: {
1251 .crc,1197 .crc,
1252 .crypto,1198 .crypto,
1253 .db,1199 .db,
1254 .dotprod,
1255 .dsp,1200 .dsp,
1256 .fp_armv8,1201 .fp_armv8,
1202 .has_v8_4a,
1257 .mp,1203 .mp,
1258 .neon,
1259 .ras,1204 .ras,
1260 .trustzone,1205 .trustzone,
1261 .has_v8_4a,
1262 .virtualization,1206 .virtualization,
1263 }),1207 }),
1264 };1208 };
...@@ -1270,14 +1214,12 @@ pub const all_features = blk: {...@@ -1270,14 +1214,12 @@ pub const all_features = blk: {
1270 .crc,1214 .crc,
1271 .crypto,1215 .crypto,
1272 .db,1216 .db,
1273 .dotprod,
1274 .dsp,1217 .dsp,
1275 .fp_armv8,1218 .fp_armv8,
1219 .has_v8_5a,
1276 .mp,1220 .mp,
1277 .neon,
1278 .ras,1221 .ras,
1279 .trustzone,1222 .trustzone,
1280 .has_v8_5a,
1281 .virtualization,1223 .virtualization,
1282 }),1224 }),
1283 };1225 };
...@@ -1289,14 +1231,91 @@ pub const all_features = blk: {...@@ -1289,14 +1231,91 @@ pub const all_features = blk: {
1289 .crc,1231 .crc,
1290 .crypto,1232 .crypto,
1291 .db,1233 .db,
1292 .dotprod,
1293 .dsp,1234 .dsp,
1294 .fp_armv8,1235 .fp_armv8,
1236 .has_v8_6a,
1295 .mp,1237 .mp,
1296 .neon,
1297 .ras,1238 .ras,
1298 .trustzone,1239 .trustzone,
1299 .has_v8_6a,1240 .virtualization,
1241 }),
1242 };
1243 result[@enumToInt(Feature.v8_7a)] = .{
1244 .llvm_name = "armv8.7-a",
1245 .description = "ARMv86a architecture",
1246 .dependencies = featureSet(&[_]Feature{
1247 .aclass,
1248 .crc,
1249 .crypto,
1250 .db,
1251 .dsp,
1252 .fp_armv8,
1253 .has_v8_7a,
1254 .mp,
1255 .ras,
1256 .trustzone,
1257 .virtualization,
1258 }),
1259 };
1260 result[@enumToInt(Feature.v8a)] = .{
1261 .llvm_name = "armv8-a",
1262 .description = "ARMv8a architecture",
1263 .dependencies = featureSet(&[_]Feature{
1264 .aclass,
1265 .crc,
1266 .crypto,
1267 .db,
1268 .dsp,
1269 .fp_armv8,
1270 .has_v8,
1271 .mp,
1272 .trustzone,
1273 .virtualization,
1274 }),
1275 };
1276 result[@enumToInt(Feature.v8m)] = .{
1277 .llvm_name = "armv8-m.base",
1278 .description = "ARMv8mBaseline architecture",
1279 .dependencies = featureSet(&[_]Feature{
1280 .@"8msecext",
1281 .acquire_release,
1282 .db,
1283 .has_v7clrex,
1284 .has_v8m,
1285 .hwdiv,
1286 .mclass,
1287 .noarm,
1288 .strict_align,
1289 .thumb_mode,
1290 }),
1291 };
1292 result[@enumToInt(Feature.v8m_main)] = .{
1293 .llvm_name = "armv8-m.main",
1294 .description = "ARMv8mMainline architecture",
1295 .dependencies = featureSet(&[_]Feature{
1296 .@"8msecext",
1297 .acquire_release,
1298 .db,
1299 .has_v8m_main,
1300 .hwdiv,
1301 .mclass,
1302 .noarm,
1303 .thumb_mode,
1304 }),
1305 };
1306 result[@enumToInt(Feature.v8r)] = .{
1307 .llvm_name = "armv8-r",
1308 .description = "ARMv8r architecture",
1309 .dependencies = featureSet(&[_]Feature{
1310 .crc,
1311 .db,
1312 .dfb,
1313 .dsp,
1314 .fp_armv8,
1315 .has_v8,
1316 .mp,
1317 .neon,
1318 .rclass,
1300 .virtualization,1319 .virtualization,
1301 }),1320 }),
1302 };1321 };
...@@ -1327,7 +1346,6 @@ pub const all_features = blk: {...@@ -1327,7 +1346,6 @@ pub const all_features = blk: {
1327 .llvm_name = "vfp3d16",1346 .llvm_name = "vfp3d16",
1328 .description = "Enable VFP3 instructions with only 16 d-registers",1347 .description = "Enable VFP3 instructions with only 16 d-registers",
1329 .dependencies = featureSet(&[_]Feature{1348 .dependencies = featureSet(&[_]Feature{
1330 .fp64,
1331 .vfp2,1349 .vfp2,
1332 .vfp3d16sp,1350 .vfp3d16sp,
1333 }),1351 }),
...@@ -1351,7 +1369,6 @@ pub const all_features = blk: {...@@ -1351,7 +1369,6 @@ pub const all_features = blk: {
1351 .llvm_name = "vfp4",1369 .llvm_name = "vfp4",
1352 .description = "Enable VFP4 instructions",1370 .description = "Enable VFP4 instructions",
1353 .dependencies = featureSet(&[_]Feature{1371 .dependencies = featureSet(&[_]Feature{
1354 .fp16,
1355 .vfp3,1372 .vfp3,
1356 .vfp4d16,1373 .vfp4d16,
1357 .vfp4sp,1374 .vfp4sp,
...@@ -1361,8 +1378,6 @@ pub const all_features = blk: {...@@ -1361,8 +1378,6 @@ pub const all_features = blk: {
1361 .llvm_name = "vfp4d16",1378 .llvm_name = "vfp4d16",
1362 .description = "Enable VFP4 instructions with only 16 d-registers",1379 .description = "Enable VFP4 instructions with only 16 d-registers",
1363 .dependencies = featureSet(&[_]Feature{1380 .dependencies = featureSet(&[_]Feature{
1364 .fp16,
1365 .fp64,
1366 .vfp3d16,1381 .vfp3d16,
1367 .vfp4d16sp,1382 .vfp4d16sp,
1368 }),1383 }),
...@@ -1379,8 +1394,6 @@ pub const all_features = blk: {...@@ -1379,8 +1394,6 @@ pub const all_features = blk: {
1379 .llvm_name = "vfp4sp",1394 .llvm_name = "vfp4sp",
1380 .description = "Enable VFP4 instructions with no double precision",1395 .description = "Enable VFP4 instructions with no double precision",
1381 .dependencies = featureSet(&[_]Feature{1396 .dependencies = featureSet(&[_]Feature{
1382 .d32,
1383 .fp16,
1384 .vfp3sp,1397 .vfp3sp,
1385 .vfp4d16sp,1398 .vfp4d16sp,
1386 }),1399 }),
...@@ -1417,7 +1430,7 @@ pub const all_features = blk: {...@@ -1417,7 +1430,7 @@ pub const all_features = blk: {
1417 .llvm_name = "xscale",1430 .llvm_name = "xscale",
1418 .description = "ARMv5te architecture",1431 .description = "ARMv5te architecture",
1419 .dependencies = featureSet(&[_]Feature{1432 .dependencies = featureSet(&[_]Feature{
1420 .has_v5te,1433 .v5te,
1421 }),1434 }),
1422 };1435 };
1423 result[@enumToInt(Feature.zcz)] = .{1436 result[@enumToInt(Feature.zcz)] = .{
...@@ -1480,8 +1493,8 @@ pub const cpu = struct {...@@ -1480,8 +1493,8 @@ pub const cpu = struct {
1480 .name = "arm1136jf_s",1493 .name = "arm1136jf_s",
1481 .llvm_name = "arm1136jf-s",1494 .llvm_name = "arm1136jf-s",
1482 .features = featureSet(&[_]Feature{1495 .features = featureSet(&[_]Feature{
1483 .v6,
1484 .slowfpvmlx,1496 .slowfpvmlx,
1497 .v6,
1485 .vfp2,1498 .vfp2,
1486 }),1499 }),
1487 };1500 };
...@@ -1496,8 +1509,8 @@ pub const cpu = struct {...@@ -1496,8 +1509,8 @@ pub const cpu = struct {
1496 .name = "arm1156t2f_s",1509 .name = "arm1156t2f_s",
1497 .llvm_name = "arm1156t2f-s",1510 .llvm_name = "arm1156t2f-s",
1498 .features = featureSet(&[_]Feature{1511 .features = featureSet(&[_]Feature{
1499 .v6t2,
1500 .slowfpvmlx,1512 .slowfpvmlx,
1513 .v6t2,
1501 .vfp2,1514 .vfp2,
1502 }),1515 }),
1503 };1516 };
...@@ -1519,8 +1532,8 @@ pub const cpu = struct {...@@ -1519,8 +1532,8 @@ pub const cpu = struct {
1519 .name = "arm1176jzf_s",1532 .name = "arm1176jzf_s",
1520 .llvm_name = "arm1176jzf-s",1533 .llvm_name = "arm1176jzf-s",
1521 .features = featureSet(&[_]Feature{1534 .features = featureSet(&[_]Feature{
1522 .v6kz,
1523 .slowfpvmlx,1535 .slowfpvmlx,
1536 .v6kz,
1524 .vfp2,1537 .vfp2,
1525 }),1538 }),
1526 };1539 };
...@@ -1654,11 +1667,11 @@ pub const cpu = struct {...@@ -1654,11 +1667,11 @@ pub const cpu = struct {
1654 .name = "cortex_a12",1667 .name = "cortex_a12",
1655 .llvm_name = "cortex-a12",1668 .llvm_name = "cortex-a12",
1656 .features = featureSet(&[_]Feature{1669 .features = featureSet(&[_]Feature{
1657 .v7a,
1658 .avoid_partial_cpsr,1670 .avoid_partial_cpsr,
1659 .mp,1671 .mp,
1660 .ret_addr_stack,1672 .ret_addr_stack,
1661 .trustzone,1673 .trustzone,
1674 .v7a,
1662 .vfp4,1675 .vfp4,
1663 .virtualization,1676 .virtualization,
1664 .vmlx_forwarding,1677 .vmlx_forwarding,
...@@ -1668,14 +1681,13 @@ pub const cpu = struct {...@@ -1668,14 +1681,13 @@ pub const cpu = struct {
1668 .name = "cortex_a15",1681 .name = "cortex_a15",
1669 .llvm_name = "cortex-a15",1682 .llvm_name = "cortex-a15",
1670 .features = featureSet(&[_]Feature{1683 .features = featureSet(&[_]Feature{
1671 .v7a,
1672 .avoid_partial_cpsr,1684 .avoid_partial_cpsr,
1673 .dont_widen_vmovs,
1674 .mp,1685 .mp,
1675 .muxed_units,1686 .muxed_units,
1676 .ret_addr_stack,1687 .ret_addr_stack,
1677 .splat_vfp_neon,1688 .splat_vfp_neon,
1678 .trustzone,1689 .trustzone,
1690 .v7a,
1679 .vfp4,1691 .vfp4,
1680 .virtualization,1692 .virtualization,
1681 .vldn_align,1693 .vldn_align,
...@@ -1685,11 +1697,11 @@ pub const cpu = struct {...@@ -1685,11 +1697,11 @@ pub const cpu = struct {
1685 .name = "cortex_a17",1697 .name = "cortex_a17",
1686 .llvm_name = "cortex-a17",1698 .llvm_name = "cortex-a17",
1687 .features = featureSet(&[_]Feature{1699 .features = featureSet(&[_]Feature{
1688 .v7a,
1689 .avoid_partial_cpsr,1700 .avoid_partial_cpsr,
1690 .mp,1701 .mp,
1691 .ret_addr_stack,1702 .ret_addr_stack,
1692 .trustzone,1703 .trustzone,
1704 .v7a,
1693 .vfp4,1705 .vfp4,
1694 .virtualization,1706 .virtualization,
1695 .vmlx_forwarding,1707 .vmlx_forwarding,
...@@ -1699,10 +1711,6 @@ pub const cpu = struct {...@@ -1699,10 +1711,6 @@ pub const cpu = struct {
1699 .name = "cortex_a32",1711 .name = "cortex_a32",
1700 .llvm_name = "cortex-a32",1712 .llvm_name = "cortex-a32",
1701 .features = featureSet(&[_]Feature{1713 .features = featureSet(&[_]Feature{
1702 .crc,
1703 .crypto,
1704 .hwdiv,
1705 .hwdiv_arm,
1706 .v8a,1714 .v8a,
1707 }),1715 }),
1708 };1716 };
...@@ -1710,10 +1718,6 @@ pub const cpu = struct {...@@ -1710,10 +1718,6 @@ pub const cpu = struct {
1710 .name = "cortex_a35",1718 .name = "cortex_a35",
1711 .llvm_name = "cortex-a35",1719 .llvm_name = "cortex-a35",
1712 .features = featureSet(&[_]Feature{1720 .features = featureSet(&[_]Feature{
1713 .crc,
1714 .crypto,
1715 .hwdiv,
1716 .hwdiv_arm,
1717 .v8a,1721 .v8a,
1718 }),1722 }),
1719 };1723 };
...@@ -1721,13 +1725,13 @@ pub const cpu = struct {...@@ -1721,13 +1725,13 @@ pub const cpu = struct {
1721 .name = "cortex_a5",1725 .name = "cortex_a5",
1722 .llvm_name = "cortex-a5",1726 .llvm_name = "cortex-a5",
1723 .features = featureSet(&[_]Feature{1727 .features = featureSet(&[_]Feature{
1724 .v7a,
1725 .mp,1728 .mp,
1726 .ret_addr_stack,1729 .ret_addr_stack,
1727 .slow_fp_brcc,1730 .slow_fp_brcc,
1728 .slowfpvfmx,1731 .slowfpvfmx,
1729 .slowfpvmlx,1732 .slowfpvmlx,
1730 .trustzone,1733 .trustzone,
1734 .v7a,
1731 .vfp4,1735 .vfp4,
1732 .vmlx_forwarding,1736 .vmlx_forwarding,
1733 }),1737 }),
...@@ -1736,49 +1740,39 @@ pub const cpu = struct {...@@ -1736,49 +1740,39 @@ pub const cpu = struct {
1736 .name = "cortex_a53",1740 .name = "cortex_a53",
1737 .llvm_name = "cortex-a53",1741 .llvm_name = "cortex-a53",
1738 .features = featureSet(&[_]Feature{1742 .features = featureSet(&[_]Feature{
1739 .v8a,
1740 .crc,
1741 .crypto,
1742 .fpao,1743 .fpao,
1743 .hwdiv,1744 .v8a,
1744 .hwdiv_arm,
1745 }),1745 }),
1746 };1746 };
1747 pub const cortex_a55 = CpuModel{1747 pub const cortex_a55 = CpuModel{
1748 .name = "cortex_a55",1748 .name = "cortex_a55",
1749 .llvm_name = "cortex-a55",1749 .llvm_name = "cortex-a55",
1750 .features = featureSet(&[_]Feature{1750 .features = featureSet(&[_]Feature{
1751 .v8_2a,
1752 .dotprod,1751 .dotprod,
1753 .hwdiv,1752 .v8_2a,
1754 .hwdiv_arm,
1755 }),1753 }),
1756 };1754 };
1757 pub const cortex_a57 = CpuModel{1755 pub const cortex_a57 = CpuModel{
1758 .name = "cortex_a57",1756 .name = "cortex_a57",
1759 .llvm_name = "cortex-a57",1757 .llvm_name = "cortex-a57",
1760 .features = featureSet(&[_]Feature{1758 .features = featureSet(&[_]Feature{
1761 .v8a,
1762 .avoid_partial_cpsr,1759 .avoid_partial_cpsr,
1763 .cheap_predicable_cpsr,1760 .cheap_predicable_cpsr,
1764 .crc,
1765 .crypto,
1766 .fpao,1761 .fpao,
1767 .hwdiv,1762 .v8a,
1768 .hwdiv_arm,
1769 }),1763 }),
1770 };1764 };
1771 pub const cortex_a7 = CpuModel{1765 pub const cortex_a7 = CpuModel{
1772 .name = "cortex_a7",1766 .name = "cortex_a7",
1773 .llvm_name = "cortex-a7",1767 .llvm_name = "cortex-a7",
1774 .features = featureSet(&[_]Feature{1768 .features = featureSet(&[_]Feature{
1775 .v7a,
1776 .mp,1769 .mp,
1777 .ret_addr_stack,1770 .ret_addr_stack,
1778 .slow_fp_brcc,1771 .slow_fp_brcc,
1779 .slowfpvfmx,1772 .slowfpvfmx,
1780 .slowfpvmlx,1773 .slowfpvmlx,
1781 .trustzone,1774 .trustzone,
1775 .v7a,
1782 .vfp4,1776 .vfp4,
1783 .virtualization,1777 .virtualization,
1784 .vmlx_forwarding,1778 .vmlx_forwarding,
...@@ -1790,10 +1784,6 @@ pub const cpu = struct {...@@ -1790,10 +1784,6 @@ pub const cpu = struct {
1790 .llvm_name = "cortex-a72",1784 .llvm_name = "cortex-a72",
1791 .features = featureSet(&[_]Feature{1785 .features = featureSet(&[_]Feature{
1792 .v8a,1786 .v8a,
1793 .crc,
1794 .crypto,
1795 .hwdiv,
1796 .hwdiv_arm,
1797 }),1787 }),
1798 };1788 };
1799 pub const cortex_a73 = CpuModel{1789 pub const cortex_a73 = CpuModel{
...@@ -1801,20 +1791,14 @@ pub const cpu = struct {...@@ -1801,20 +1791,14 @@ pub const cpu = struct {
1801 .llvm_name = "cortex-a73",1791 .llvm_name = "cortex-a73",
1802 .features = featureSet(&[_]Feature{1792 .features = featureSet(&[_]Feature{
1803 .v8a,1793 .v8a,
1804 .crc,
1805 .crypto,
1806 .hwdiv,
1807 .hwdiv_arm,
1808 }),1794 }),
1809 };1795 };
1810 pub const cortex_a75 = CpuModel{1796 pub const cortex_a75 = CpuModel{
1811 .name = "cortex_a75",1797 .name = "cortex_a75",
1812 .llvm_name = "cortex-a75",1798 .llvm_name = "cortex-a75",
1813 .features = featureSet(&[_]Feature{1799 .features = featureSet(&[_]Feature{
1814 .v8_2a,
1815 .dotprod,1800 .dotprod,
1816 .hwdiv,1801 .v8_2a,
1817 .hwdiv_arm,
1818 }),1802 }),
1819 };1803 };
1820 pub const cortex_a76 = CpuModel{1804 pub const cortex_a76 = CpuModel{
...@@ -1822,13 +1806,9 @@ pub const cpu = struct {...@@ -1822,13 +1806,9 @@ pub const cpu = struct {
1822 .llvm_name = "cortex-a76",1806 .llvm_name = "cortex-a76",
1823 .features = featureSet(&[_]Feature{1807 .features = featureSet(&[_]Feature{
1824 .a76,1808 .a76,
1825 .v8_2a,
1826 .crc,
1827 .crypto,
1828 .dotprod,1809 .dotprod,
1829 .fullfp16,1810 .fullfp16,
1830 .hwdiv,1811 .v8_2a,
1831 .hwdiv_arm,
1832 }),1812 }),
1833 };1813 };
1834 pub const cortex_a76ae = CpuModel{1814 pub const cortex_a76ae = CpuModel{
...@@ -1836,52 +1816,49 @@ pub const cpu = struct {...@@ -1836,52 +1816,49 @@ pub const cpu = struct {
1836 .llvm_name = "cortex-a76ae",1816 .llvm_name = "cortex-a76ae",
1837 .features = featureSet(&[_]Feature{1817 .features = featureSet(&[_]Feature{
1838 .a76,1818 .a76,
1839 .v8_2a,
1840 .crc,
1841 .crypto,
1842 .dotprod,1819 .dotprod,
1843 .fullfp16,1820 .fullfp16,
1844 .hwdiv,1821 .v8_2a,
1845 .hwdiv_arm,
1846 }),1822 }),
1847 };1823 };
1848 pub const cortex_a77 = CpuModel{1824 pub const cortex_a77 = CpuModel{
1849 .name = "cortex_a77",1825 .name = "cortex_a77",
1850 .llvm_name = "cortex-a77",1826 .llvm_name = "cortex-a77",
1851 .features = featureSet(&[_]Feature{1827 .features = featureSet(&[_]Feature{
1852 .v8_2a,
1853 .crc,
1854 .crypto,
1855 .dotprod,1828 .dotprod,
1856 .fullfp16,1829 .fullfp16,
1857 .hwdiv,1830 .v8_2a,
1858 .hwdiv_arm,
1859 }),1831 }),
1860 };1832 };
1861 pub const cortex_a78 = CpuModel{1833 pub const cortex_a78 = CpuModel{
1862 .name = "cortex_a78",1834 .name = "cortex_a78",
1863 .llvm_name = "cortex-a78",1835 .llvm_name = "cortex-a78",
1864 .features = featureSet(&[_]Feature{1836 .features = featureSet(&[_]Feature{
1837 .dotprod,
1838 .fullfp16,
1865 .v8_2a,1839 .v8_2a,
1866 .crc,1840 }),
1867 .crypto,1841 };
1842 pub const cortex_a78c = CpuModel{
1843 .name = "cortex_a78c",
1844 .llvm_name = "cortex-a78c",
1845 .features = featureSet(&[_]Feature{
1868 .dotprod,1846 .dotprod,
1869 .fullfp16,1847 .fullfp16,
1870 .hwdiv,1848 .v8_2a,
1871 .hwdiv_arm,
1872 }),1849 }),
1873 };1850 };
1874 pub const cortex_a8 = CpuModel{1851 pub const cortex_a8 = CpuModel{
1875 .name = "cortex_a8",1852 .name = "cortex_a8",
1876 .llvm_name = "cortex-a8",1853 .llvm_name = "cortex-a8",
1877 .features = featureSet(&[_]Feature{1854 .features = featureSet(&[_]Feature{
1878 .v7a,
1879 .nonpipelined_vfp,1855 .nonpipelined_vfp,
1880 .ret_addr_stack,1856 .ret_addr_stack,
1881 .slow_fp_brcc,1857 .slow_fp_brcc,
1882 .slowfpvfmx,1858 .slowfpvfmx,
1883 .slowfpvmlx,1859 .slowfpvmlx,
1884 .trustzone,1860 .trustzone,
1861 .v7a,
1885 .vmlx_forwarding,1862 .vmlx_forwarding,
1886 .vmlx_hazards,1863 .vmlx_hazards,
1887 }),1864 }),
...@@ -1890,7 +1867,6 @@ pub const cpu = struct {...@@ -1890,7 +1867,6 @@ pub const cpu = struct {
1890 .name = "cortex_a9",1867 .name = "cortex_a9",
1891 .llvm_name = "cortex-a9",1868 .llvm_name = "cortex-a9",
1892 .features = featureSet(&[_]Feature{1869 .features = featureSet(&[_]Feature{
1893 .v7a,
1894 .avoid_partial_cpsr,1870 .avoid_partial_cpsr,
1895 .expand_fp_mlx,1871 .expand_fp_mlx,
1896 .fp16,1872 .fp16,
...@@ -1900,6 +1876,7 @@ pub const cpu = struct {...@@ -1900,6 +1876,7 @@ pub const cpu = struct {
1900 .prefer_vmovsr,1876 .prefer_vmovsr,
1901 .ret_addr_stack,1877 .ret_addr_stack,
1902 .trustzone,1878 .trustzone,
1879 .v7a,
1903 .vldn_align,1880 .vldn_align,
1904 .vmlx_forwarding,1881 .vmlx_forwarding,
1905 .vmlx_hazards,1882 .vmlx_hazards,
...@@ -1930,26 +1907,25 @@ pub const cpu = struct {...@@ -1930,26 +1907,25 @@ pub const cpu = struct {
1930 .name = "cortex_m23",1907 .name = "cortex_m23",
1931 .llvm_name = "cortex-m23",1908 .llvm_name = "cortex-m23",
1932 .features = featureSet(&[_]Feature{1909 .features = featureSet(&[_]Feature{
1933 .v8m,
1934 .no_movt,1910 .no_movt,
1911 .v8m,
1935 }),1912 }),
1936 };1913 };
1937 pub const cortex_m3 = CpuModel{1914 pub const cortex_m3 = CpuModel{
1938 .name = "cortex_m3",1915 .name = "cortex_m3",
1939 .llvm_name = "cortex-m3",1916 .llvm_name = "cortex-m3",
1940 .features = featureSet(&[_]Feature{1917 .features = featureSet(&[_]Feature{
1941 .v7m,
1942 .loop_align,1918 .loop_align,
1943 .m3,1919 .m3,
1944 .no_branch_predictor,1920 .no_branch_predictor,
1945 .use_misched,1921 .use_misched,
1922 .v7m,
1946 }),1923 }),
1947 };1924 };
1948 pub const cortex_m33 = CpuModel{1925 pub const cortex_m33 = CpuModel{
1949 .name = "cortex_m33",1926 .name = "cortex_m33",
1950 .llvm_name = "cortex-m33",1927 .llvm_name = "cortex-m33",
1951 .features = featureSet(&[_]Feature{1928 .features = featureSet(&[_]Feature{
1952 .v8m_main,
1953 .dsp,1929 .dsp,
1954 .fp_armv8d16sp,1930 .fp_armv8d16sp,
1955 .loop_align,1931 .loop_align,
...@@ -1957,13 +1933,13 @@ pub const cpu = struct {...@@ -1957,13 +1933,13 @@ pub const cpu = struct {
1957 .slowfpvfmx,1933 .slowfpvfmx,
1958 .slowfpvmlx,1934 .slowfpvmlx,
1959 .use_misched,1935 .use_misched,
1936 .v8m_main,
1960 }),1937 }),
1961 };1938 };
1962 pub const cortex_m35p = CpuModel{1939 pub const cortex_m35p = CpuModel{
1963 .name = "cortex_m35p",1940 .name = "cortex_m35p",
1964 .llvm_name = "cortex-m35p",1941 .llvm_name = "cortex-m35p",
1965 .features = featureSet(&[_]Feature{1942 .features = featureSet(&[_]Feature{
1966 .v8m_main,
1967 .dsp,1943 .dsp,
1968 .fp_armv8d16sp,1944 .fp_armv8d16sp,
1969 .loop_align,1945 .loop_align,
...@@ -1971,18 +1947,19 @@ pub const cpu = struct {...@@ -1971,18 +1947,19 @@ pub const cpu = struct {
1971 .slowfpvfmx,1947 .slowfpvfmx,
1972 .slowfpvmlx,1948 .slowfpvmlx,
1973 .use_misched,1949 .use_misched,
1950 .v8m_main,
1974 }),1951 }),
1975 };1952 };
1976 pub const cortex_m4 = CpuModel{1953 pub const cortex_m4 = CpuModel{
1977 .name = "cortex_m4",1954 .name = "cortex_m4",
1978 .llvm_name = "cortex-m4",1955 .llvm_name = "cortex-m4",
1979 .features = featureSet(&[_]Feature{1956 .features = featureSet(&[_]Feature{
1980 .v7em,
1981 .loop_align,1957 .loop_align,
1982 .no_branch_predictor,1958 .no_branch_predictor,
1983 .slowfpvfmx,1959 .slowfpvfmx,
1984 .slowfpvmlx,1960 .slowfpvmlx,
1985 .use_misched,1961 .use_misched,
1962 .v7em,
1986 .vfp4d16sp,1963 .vfp4d16sp,
1987 }),1964 }),
1988 };1965 };
...@@ -1990,45 +1967,45 @@ pub const cpu = struct {...@@ -1990,45 +1967,45 @@ pub const cpu = struct {
1990 .name = "cortex_m55",1967 .name = "cortex_m55",
1991 .llvm_name = "cortex-m55",1968 .llvm_name = "cortex-m55",
1992 .features = featureSet(&[_]Feature{1969 .features = featureSet(&[_]Feature{
1993 .v8_1m_main,
1994 .dsp,
1995 .fp_armv8d16,1970 .fp_armv8d16,
1996 .loop_align,1971 .loop_align,
1997 .mve_fp,1972 .mve_fp,
1998 .no_branch_predictor,1973 .no_branch_predictor,
1999 .slowfpvmlx,1974 .slowfpvmlx,
2000 .use_misched,1975 .use_misched,
1976 .v8_1m_main,
2001 }),1977 }),
2002 };1978 };
2003 pub const cortex_m7 = CpuModel{1979 pub const cortex_m7 = CpuModel{
2004 .name = "cortex_m7",1980 .name = "cortex_m7",
2005 .llvm_name = "cortex-m7",1981 .llvm_name = "cortex-m7",
2006 .features = featureSet(&[_]Feature{1982 .features = featureSet(&[_]Feature{
2007 .v7em,
2008 .fp_armv8d16,1983 .fp_armv8d16,
1984 .use_misched,
1985 .v7em,
2009 }),1986 }),
2010 };1987 };
2011 pub const cortex_r4 = CpuModel{1988 pub const cortex_r4 = CpuModel{
2012 .name = "cortex_r4",1989 .name = "cortex_r4",
2013 .llvm_name = "cortex-r4",1990 .llvm_name = "cortex-r4",
2014 .features = featureSet(&[_]Feature{1991 .features = featureSet(&[_]Feature{
2015 .v7r,
2016 .avoid_partial_cpsr,1992 .avoid_partial_cpsr,
2017 .r4,1993 .r4,
2018 .ret_addr_stack,1994 .ret_addr_stack,
1995 .v7r,
2019 }),1996 }),
2020 };1997 };
2021 pub const cortex_r4f = CpuModel{1998 pub const cortex_r4f = CpuModel{
2022 .name = "cortex_r4f",1999 .name = "cortex_r4f",
2023 .llvm_name = "cortex-r4f",2000 .llvm_name = "cortex-r4f",
2024 .features = featureSet(&[_]Feature{2001 .features = featureSet(&[_]Feature{
2025 .v7r,
2026 .avoid_partial_cpsr,2002 .avoid_partial_cpsr,
2027 .r4,2003 .r4,
2028 .ret_addr_stack,2004 .ret_addr_stack,
2029 .slow_fp_brcc,2005 .slow_fp_brcc,
2030 .slowfpvfmx,2006 .slowfpvfmx,
2031 .slowfpvmlx,2007 .slowfpvmlx,
2008 .v7r,
2032 .vfp3d16,2009 .vfp3d16,
2033 }),2010 }),
2034 };2011 };
...@@ -2036,13 +2013,13 @@ pub const cpu = struct {...@@ -2036,13 +2013,13 @@ pub const cpu = struct {
2036 .name = "cortex_r5",2013 .name = "cortex_r5",
2037 .llvm_name = "cortex-r5",2014 .llvm_name = "cortex-r5",
2038 .features = featureSet(&[_]Feature{2015 .features = featureSet(&[_]Feature{
2039 .v7r,
2040 .avoid_partial_cpsr,2016 .avoid_partial_cpsr,
2041 .hwdiv_arm,2017 .hwdiv_arm,
2042 .ret_addr_stack,2018 .ret_addr_stack,
2043 .slow_fp_brcc,2019 .slow_fp_brcc,
2044 .slowfpvfmx,2020 .slowfpvfmx,
2045 .slowfpvmlx,2021 .slowfpvmlx,
2022 .v7r,
2046 .vfp3d16,2023 .vfp3d16,
2047 }),2024 }),
2048 };2025 };
...@@ -2050,16 +2027,15 @@ pub const cpu = struct {...@@ -2050,16 +2027,15 @@ pub const cpu = struct {
2050 .name = "cortex_r52",2027 .name = "cortex_r52",
2051 .llvm_name = "cortex-r52",2028 .llvm_name = "cortex-r52",
2052 .features = featureSet(&[_]Feature{2029 .features = featureSet(&[_]Feature{
2053 .v8r,
2054 .fpao,2030 .fpao,
2055 .use_misched,2031 .use_misched,
2032 .v8r,
2056 }),2033 }),
2057 };2034 };
2058 pub const cortex_r7 = CpuModel{2035 pub const cortex_r7 = CpuModel{
2059 .name = "cortex_r7",2036 .name = "cortex_r7",
2060 .llvm_name = "cortex-r7",2037 .llvm_name = "cortex-r7",
2061 .features = featureSet(&[_]Feature{2038 .features = featureSet(&[_]Feature{
2062 .v7r,
2063 .avoid_partial_cpsr,2039 .avoid_partial_cpsr,
2064 .fp16,2040 .fp16,
2065 .hwdiv_arm,2041 .hwdiv_arm,
...@@ -2068,6 +2044,7 @@ pub const cpu = struct {...@@ -2068,6 +2044,7 @@ pub const cpu = struct {
2068 .slow_fp_brcc,2044 .slow_fp_brcc,
2069 .slowfpvfmx,2045 .slowfpvfmx,
2070 .slowfpvmlx,2046 .slowfpvmlx,
2047 .v7r,
2071 .vfp3d16,2048 .vfp3d16,
2072 }),2049 }),
2073 };2050 };
...@@ -2075,7 +2052,6 @@ pub const cpu = struct {...@@ -2075,7 +2052,6 @@ pub const cpu = struct {
2075 .name = "cortex_r8",2052 .name = "cortex_r8",
2076 .llvm_name = "cortex-r8",2053 .llvm_name = "cortex-r8",
2077 .features = featureSet(&[_]Feature{2054 .features = featureSet(&[_]Feature{
2078 .v7r,
2079 .avoid_partial_cpsr,2055 .avoid_partial_cpsr,
2080 .fp16,2056 .fp16,
2081 .hwdiv_arm,2057 .hwdiv_arm,
...@@ -2084,6 +2060,7 @@ pub const cpu = struct {...@@ -2084,6 +2060,7 @@ pub const cpu = struct {
2084 .slow_fp_brcc,2060 .slow_fp_brcc,
2085 .slowfpvfmx,2061 .slowfpvfmx,
2086 .slowfpvmlx,2062 .slowfpvmlx,
2063 .v7r,
2087 .vfp3d16,2064 .vfp3d16,
2088 }),2065 }),
2089 };2066 };
...@@ -2091,34 +2068,25 @@ pub const cpu = struct {...@@ -2091,34 +2068,25 @@ pub const cpu = struct {
2091 .name = "cortex_x1",2068 .name = "cortex_x1",
2092 .llvm_name = "cortex-x1",2069 .llvm_name = "cortex-x1",
2093 .features = featureSet(&[_]Feature{2070 .features = featureSet(&[_]Feature{
2094 .v8_2a,
2095 .crc,
2096 .crypto,
2097 .dotprod,2071 .dotprod,
2098 .fullfp16,2072 .fullfp16,
2099 .hwdiv,2073 .v8_2a,
2100 .hwdiv_arm,
2101 }),2074 }),
2102 };2075 };
2103 pub const cyclone = CpuModel{2076 pub const cyclone = CpuModel{
2104 .name = "cyclone",2077 .name = "cyclone",
2105 .llvm_name = "cyclone",2078 .llvm_name = "cyclone",
2106 .features = featureSet(&[_]Feature{2079 .features = featureSet(&[_]Feature{
2107 .v8a,
2108 .avoid_movs_shop,2080 .avoid_movs_shop,
2109 .avoid_partial_cpsr,2081 .avoid_partial_cpsr,
2110 .crypto,
2111 .disable_postra_scheduler,2082 .disable_postra_scheduler,
2112 .hwdiv,
2113 .hwdiv_arm,
2114 .mp,
2115 .neonfp,2083 .neonfp,
2116 .ret_addr_stack,2084 .ret_addr_stack,
2117 .slowfpvfmx,2085 .slowfpvfmx,
2118 .slowfpvmlx,2086 .slowfpvmlx,
2119 .swift,2087 .swift,
2120 .use_misched,2088 .use_misched,
2121 .vfp4,2089 .v8a,
2122 .zcz,2090 .zcz,
2123 }),2091 }),
2124 };2092 };
...@@ -2133,34 +2101,34 @@ pub const cpu = struct {...@@ -2133,34 +2101,34 @@ pub const cpu = struct {
2133 .name = "exynos_m1",2101 .name = "exynos_m1",
2134 .llvm_name = null,2102 .llvm_name = null,
2135 .features = featureSet(&[_]Feature{2103 .features = featureSet(&[_]Feature{
2136 .v8a,
2137 .exynos,2104 .exynos,
2105 .v8a,
2138 }),2106 }),
2139 };2107 };
2140 pub const exynos_m2 = CpuModel{2108 pub const exynos_m2 = CpuModel{
2141 .name = "exynos_m2",2109 .name = "exynos_m2",
2142 .llvm_name = null,2110 .llvm_name = null,
2143 .features = featureSet(&[_]Feature{2111 .features = featureSet(&[_]Feature{
2144 .v8a,
2145 .exynos,2112 .exynos,
2113 .v8a,
2146 }),2114 }),
2147 };2115 };
2148 pub const exynos_m3 = CpuModel{2116 pub const exynos_m3 = CpuModel{
2149 .name = "exynos_m3",2117 .name = "exynos_m3",
2150 .llvm_name = "exynos-m3",2118 .llvm_name = "exynos-m3",
2151 .features = featureSet(&[_]Feature{2119 .features = featureSet(&[_]Feature{
2152 .v8_2a,
2153 .exynos,2120 .exynos,
2121 .v8a,
2154 }),2122 }),
2155 };2123 };
2156 pub const exynos_m4 = CpuModel{2124 pub const exynos_m4 = CpuModel{
2157 .name = "exynos_m4",2125 .name = "exynos_m4",
2158 .llvm_name = "exynos-m4",2126 .llvm_name = "exynos-m4",
2159 .features = featureSet(&[_]Feature{2127 .features = featureSet(&[_]Feature{
2160 .v8_2a,
2161 .dotprod,2128 .dotprod,
2162 .exynos,2129 .exynos,
2163 .fullfp16,2130 .fullfp16,
2131 .v8_2a,
2164 }),2132 }),
2165 };2133 };
2166 pub const exynos_m5 = CpuModel{2134 pub const exynos_m5 = CpuModel{
...@@ -2190,7 +2158,6 @@ pub const cpu = struct {...@@ -2190,7 +2158,6 @@ pub const cpu = struct {
2190 .llvm_name = "krait",2158 .llvm_name = "krait",
2191 .features = featureSet(&[_]Feature{2159 .features = featureSet(&[_]Feature{
2192 .avoid_partial_cpsr,2160 .avoid_partial_cpsr,
2193 .fp16,
2194 .hwdiv,2161 .hwdiv,
2195 .hwdiv_arm,2162 .hwdiv_arm,
2196 .muxed_units,2163 .muxed_units,
...@@ -2205,10 +2172,6 @@ pub const cpu = struct {...@@ -2205,10 +2172,6 @@ pub const cpu = struct {
2205 .name = "kryo",2172 .name = "kryo",
2206 .llvm_name = "kryo",2173 .llvm_name = "kryo",
2207 .features = featureSet(&[_]Feature{2174 .features = featureSet(&[_]Feature{
2208 .crc,
2209 .crypto,
2210 .hwdiv,
2211 .hwdiv_arm,
2212 .v8a,2175 .v8a,
2213 }),2176 }),
2214 };2177 };
...@@ -2216,8 +2179,8 @@ pub const cpu = struct {...@@ -2216,8 +2179,8 @@ pub const cpu = struct {
2216 .name = "mpcore",2179 .name = "mpcore",
2217 .llvm_name = "mpcore",2180 .llvm_name = "mpcore",
2218 .features = featureSet(&[_]Feature{2181 .features = featureSet(&[_]Feature{
2219 .v6k,
2220 .slowfpvmlx,2182 .slowfpvmlx,
2183 .v6k,
2221 .vfp2,2184 .vfp2,
2222 }),2185 }),
2223 };2186 };
...@@ -2232,12 +2195,27 @@ pub const cpu = struct {...@@ -2232,12 +2195,27 @@ pub const cpu = struct {
2232 .name = "neoverse_n1",2195 .name = "neoverse_n1",
2233 .llvm_name = "neoverse-n1",2196 .llvm_name = "neoverse-n1",
2234 .features = featureSet(&[_]Feature{2197 .features = featureSet(&[_]Feature{
2235 .v8_2a,
2236 .crc,
2237 .crypto,
2238 .dotprod,2198 .dotprod,
2239 .hwdiv,2199 .v8_2a,
2240 .hwdiv_arm,2200 }),
2201 };
2202 pub const neoverse_n2 = CpuModel{
2203 .name = "neoverse_n2",
2204 .llvm_name = "neoverse-n2",
2205 .features = featureSet(&[_]Feature{
2206 .bf16,
2207 .i8mm,
2208 .v8_5a,
2209 }),
2210 };
2211 pub const neoverse_v1 = CpuModel{
2212 .name = "neoverse_v1",
2213 .llvm_name = "neoverse-v1",
2214 .features = featureSet(&[_]Feature{
2215 .bf16,
2216 .fullfp16,
2217 .i8mm,
2218 .v8_4a,
2241 }),2219 }),
2242 };2220 };
2243 pub const sc000 = CpuModel{2221 pub const sc000 = CpuModel{
...@@ -2251,10 +2229,10 @@ pub const cpu = struct {...@@ -2251,10 +2229,10 @@ pub const cpu = struct {
2251 .name = "sc300",2229 .name = "sc300",
2252 .llvm_name = "sc300",2230 .llvm_name = "sc300",
2253 .features = featureSet(&[_]Feature{2231 .features = featureSet(&[_]Feature{
2254 .v7m,
2255 .m3,2232 .m3,
2256 .no_branch_predictor,2233 .no_branch_predictor,
2257 .use_misched,2234 .use_misched,
2235 .v7m,
2258 }),2236 }),
2259 };2237 };
2260 pub const strongarm = CpuModel{2238 pub const strongarm = CpuModel{
...@@ -2289,7 +2267,6 @@ pub const cpu = struct {...@@ -2289,7 +2267,6 @@ pub const cpu = struct {
2289 .name = "swift",2267 .name = "swift",
2290 .llvm_name = "swift",2268 .llvm_name = "swift",
2291 .features = featureSet(&[_]Feature{2269 .features = featureSet(&[_]Feature{
2292 .v7a,
2293 .avoid_movs_shop,2270 .avoid_movs_shop,
2294 .avoid_partial_cpsr,2271 .avoid_partial_cpsr,
2295 .disable_postra_scheduler,2272 .disable_postra_scheduler,
...@@ -2308,6 +2285,7 @@ pub const cpu = struct {...@@ -2308,6 +2285,7 @@ pub const cpu = struct {
2308 .slowfpvmlx,2285 .slowfpvmlx,
2309 .swift,2286 .swift,
2310 .use_misched,2287 .use_misched,
2288 .v7a,
2311 .vfp4,2289 .vfp4,
2312 .vmlx_hazards,2290 .vmlx_hazards,
2313 .wide_stride_vfp,2291 .wide_stride_vfp,
lib/std/target/avr.zig+64-11
...@@ -1,8 +1,5 @@...@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
...@@ -163,7 +160,6 @@ pub const all_features = blk: {...@@ -163,7 +160,6 @@ pub const all_features = blk: {
163 .dependencies = featureSet(&[_]Feature{160 .dependencies = featureSet(&[_]Feature{
164 .avr0,161 .avr0,
165 .@"break",162 .@"break",
166 .memmappedregs,
167 .sram,163 .sram,
168 .tinyencoding,164 .tinyencoding,
169 }),165 }),
...@@ -802,6 +798,13 @@ pub const cpu = struct {...@@ -802,6 +798,13 @@ pub const cpu = struct {
802 .avr5,798 .avr5,
803 }),799 }),
804 };800 };
801 pub const atmega168pb = CpuModel{
802 .name = "atmega168pb",
803 .llvm_name = "atmega168pb",
804 .features = featureSet(&[_]Feature{
805 .avr5,
806 }),
807 };
805 pub const atmega169 = CpuModel{808 pub const atmega169 = CpuModel{
806 .name = "atmega169",809 .name = "atmega169",
807 .llvm_name = "atmega169",810 .llvm_name = "atmega169",
...@@ -949,6 +952,13 @@ pub const cpu = struct {...@@ -949,6 +952,13 @@ pub const cpu = struct {
949 .avr5,952 .avr5,
950 }),953 }),
951 };954 };
955 pub const atmega324pb = CpuModel{
956 .name = "atmega324pb",
957 .llvm_name = "atmega324pb",
958 .features = featureSet(&[_]Feature{
959 .avr5,
960 }),
961 };
952 pub const atmega325 = CpuModel{962 pub const atmega325 = CpuModel{
953 .name = "atmega325",963 .name = "atmega325",
954 .llvm_name = "atmega325",964 .llvm_name = "atmega325",
...@@ -1019,6 +1029,13 @@ pub const cpu = struct {...@@ -1019,6 +1029,13 @@ pub const cpu = struct {
1019 .avr5,1029 .avr5,
1020 }),1030 }),
1021 };1031 };
1032 pub const atmega328pb = CpuModel{
1033 .name = "atmega328pb",
1034 .llvm_name = "atmega328pb",
1035 .features = featureSet(&[_]Feature{
1036 .avr5,
1037 }),
1038 };
1022 pub const atmega329 = CpuModel{1039 pub const atmega329 = CpuModel{
1023 .name = "atmega329",1040 .name = "atmega329",
1024 .llvm_name = "atmega329",1041 .llvm_name = "atmega329",
...@@ -1166,6 +1183,13 @@ pub const cpu = struct {...@@ -1166,6 +1183,13 @@ pub const cpu = struct {
1166 .avr4,1183 .avr4,
1167 }),1184 }),
1168 };1185 };
1186 pub const atmega48pb = CpuModel{
1187 .name = "atmega48pb",
1188 .llvm_name = "atmega48pb",
1189 .features = featureSet(&[_]Feature{
1190 .avr4,
1191 }),
1192 };
1169 pub const atmega64 = CpuModel{1193 pub const atmega64 = CpuModel{
1170 .name = "atmega64",1194 .name = "atmega64",
1171 .llvm_name = "atmega64",1195 .llvm_name = "atmega64",
...@@ -1338,7 +1362,11 @@ pub const cpu = struct {...@@ -1338,7 +1362,11 @@ pub const cpu = struct {
1338 .name = "atmega8",1362 .name = "atmega8",
1339 .llvm_name = "atmega8",1363 .llvm_name = "atmega8",
1340 .features = featureSet(&[_]Feature{1364 .features = featureSet(&[_]Feature{
1341 .avr4,1365 .avr2,
1366 .lpmx,
1367 .movw,
1368 .mul,
1369 .spm,
1342 }),1370 }),
1343 };1371 };
1344 pub const atmega8515 = CpuModel{1372 pub const atmega8515 = CpuModel{
...@@ -1391,11 +1419,22 @@ pub const cpu = struct {...@@ -1391,11 +1419,22 @@ pub const cpu = struct {
1391 .avr4,1419 .avr4,
1392 }),1420 }),
1393 };1421 };
1422 pub const atmega88pb = CpuModel{
1423 .name = "atmega88pb",
1424 .llvm_name = "atmega88pb",
1425 .features = featureSet(&[_]Feature{
1426 .avr4,
1427 }),
1428 };
1394 pub const atmega8a = CpuModel{1429 pub const atmega8a = CpuModel{
1395 .name = "atmega8a",1430 .name = "atmega8a",
1396 .llvm_name = "atmega8a",1431 .llvm_name = "atmega8a",
1397 .features = featureSet(&[_]Feature{1432 .features = featureSet(&[_]Feature{
1398 .avr4,1433 .avr2,
1434 .lpmx,
1435 .movw,
1436 .mul,
1437 .spm,
1399 }),1438 }),
1400 };1439 };
1401 pub const atmega8hva = CpuModel{1440 pub const atmega8hva = CpuModel{
...@@ -1595,6 +1634,13 @@ pub const cpu = struct {...@@ -1595,6 +1634,13 @@ pub const cpu = struct {
1595 .avr25,1634 .avr25,
1596 }),1635 }),
1597 };1636 };
1637 pub const attiny441 = CpuModel{
1638 .name = "attiny441",
1639 .llvm_name = "attiny441",
1640 .features = featureSet(&[_]Feature{
1641 .avr25,
1642 }),
1643 };
1598 pub const attiny44a = CpuModel{1644 pub const attiny44a = CpuModel{
1599 .name = "attiny44a",1645 .name = "attiny44a",
1600 .llvm_name = "attiny44a",1646 .llvm_name = "attiny44a",
...@@ -1651,6 +1697,13 @@ pub const cpu = struct {...@@ -1651,6 +1697,13 @@ pub const cpu = struct {
1651 .avr25,1697 .avr25,
1652 }),1698 }),
1653 };1699 };
1700 pub const attiny841 = CpuModel{
1701 .name = "attiny841",
1702 .llvm_name = "attiny841",
1703 .features = featureSet(&[_]Feature{
1704 .avr25,
1705 }),
1706 };
1654 pub const attiny84a = CpuModel{1707 pub const attiny84a = CpuModel{
1655 .name = "attiny84a",1708 .name = "attiny84a",
1656 .llvm_name = "attiny84a",1709 .llvm_name = "attiny84a",
...@@ -1802,7 +1855,7 @@ pub const cpu = struct {...@@ -1802,7 +1855,7 @@ pub const cpu = struct {
1802 .name = "atxmega16e5",1855 .name = "atxmega16e5",
1803 .llvm_name = "atxmega16e5",1856 .llvm_name = "atxmega16e5",
1804 .features = featureSet(&[_]Feature{1857 .features = featureSet(&[_]Feature{
1805 .xmega,1858 .xmegau,
1806 }),1859 }),
1807 };1860 };
1808 pub const atxmega192a3 = CpuModel{1861 pub const atxmega192a3 = CpuModel{
...@@ -1907,7 +1960,7 @@ pub const cpu = struct {...@@ -1907,7 +1960,7 @@ pub const cpu = struct {
1907 .name = "atxmega32e5",1960 .name = "atxmega32e5",
1908 .llvm_name = "atxmega32e5",1961 .llvm_name = "atxmega32e5",
1909 .features = featureSet(&[_]Feature{1962 .features = featureSet(&[_]Feature{
1910 .xmega,1963 .xmegau,
1911 }),1964 }),
1912 };1965 };
1913 pub const atxmega32x1 = CpuModel{1966 pub const atxmega32x1 = CpuModel{
...@@ -2005,7 +2058,7 @@ pub const cpu = struct {...@@ -2005,7 +2058,7 @@ pub const cpu = struct {
2005 .name = "atxmega8e5",2058 .name = "atxmega8e5",
2006 .llvm_name = "atxmega8e5",2059 .llvm_name = "atxmega8e5",
2007 .features = featureSet(&[_]Feature{2060 .features = featureSet(&[_]Feature{
2008 .xmega,2061 .xmegau,
2009 }),2062 }),
2010 };2063 };
2011 pub const avr1 = CpuModel{2064 pub const avr1 = CpuModel{
lib/std/target/bpf.zig+2-5
...@@ -1,8 +1,5 @@...@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
lib/std/target/hexagon.zig+2-23
...@@ -1,8 +1,5 @@...@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
...@@ -92,7 +89,6 @@ pub const all_features = blk: {...@@ -92,7 +89,6 @@ pub const all_features = blk: {
92 .llvm_name = "hvxv62",89 .llvm_name = "hvxv62",
93 .description = "Hexagon HVX instructions",90 .description = "Hexagon HVX instructions",
94 .dependencies = featureSet(&[_]Feature{91 .dependencies = featureSet(&[_]Feature{
95 .hvx,
96 .hvxv60,92 .hvxv60,
97 }),93 }),
98 };94 };
...@@ -100,8 +96,6 @@ pub const all_features = blk: {...@@ -100,8 +96,6 @@ pub const all_features = blk: {
100 .llvm_name = "hvxv65",96 .llvm_name = "hvxv65",
101 .description = "Hexagon HVX instructions",97 .description = "Hexagon HVX instructions",
102 .dependencies = featureSet(&[_]Feature{98 .dependencies = featureSet(&[_]Feature{
103 .hvx,
104 .hvxv60,
105 .hvxv62,99 .hvxv62,
106 }),100 }),
107 };101 };
...@@ -109,9 +103,6 @@ pub const all_features = blk: {...@@ -109,9 +103,6 @@ pub const all_features = blk: {
109 .llvm_name = "hvxv66",103 .llvm_name = "hvxv66",
110 .description = "Hexagon HVX instructions",104 .description = "Hexagon HVX instructions",
111 .dependencies = featureSet(&[_]Feature{105 .dependencies = featureSet(&[_]Feature{
112 .hvx,
113 .hvxv60,
114 .hvxv62,
115 .hvxv65,106 .hvxv65,
116 .zreg,107 .zreg,
117 }),108 }),
...@@ -120,9 +111,6 @@ pub const all_features = blk: {...@@ -120,9 +111,6 @@ pub const all_features = blk: {
120 .llvm_name = "hvxv67",111 .llvm_name = "hvxv67",
121 .description = "Hexagon HVX instructions",112 .description = "Hexagon HVX instructions",
122 .dependencies = featureSet(&[_]Feature{113 .dependencies = featureSet(&[_]Feature{
123 .hvxv60,
124 .hvxv62,
125 .hvxv65,
126 .hvxv66,114 .hvxv66,
127 }),115 }),
128 };116 };
...@@ -248,7 +236,6 @@ pub const cpu = struct {...@@ -248,7 +236,6 @@ pub const cpu = struct {
248 .memops,236 .memops,
249 .nvj,237 .nvj,
250 .nvs,238 .nvs,
251 .packets,
252 .prev65,239 .prev65,
253 .small_data,240 .small_data,
254 .v5,241 .v5,
...@@ -265,7 +252,6 @@ pub const cpu = struct {...@@ -265,7 +252,6 @@ pub const cpu = struct {
265 .memops,252 .memops,
266 .nvj,253 .nvj,
267 .nvs,254 .nvs,
268 .packets,
269 .prev65,255 .prev65,
270 .small_data,256 .small_data,
271 .v5,257 .v5,
...@@ -280,7 +266,6 @@ pub const cpu = struct {...@@ -280,7 +266,6 @@ pub const cpu = struct {
280 .memops,266 .memops,
281 .nvj,267 .nvj,
282 .nvs,268 .nvs,
283 .packets,
284 .prev65,269 .prev65,
285 .small_data,270 .small_data,
286 .v5,271 .v5,
...@@ -296,7 +281,6 @@ pub const cpu = struct {...@@ -296,7 +281,6 @@ pub const cpu = struct {
296 .memops,281 .memops,
297 .nvj,282 .nvj,
298 .nvs,283 .nvs,
299 .packets,
300 .prev65,284 .prev65,
301 .small_data,285 .small_data,
302 .v5,286 .v5,
...@@ -313,7 +297,6 @@ pub const cpu = struct {...@@ -313,7 +297,6 @@ pub const cpu = struct {
313 .memops,297 .memops,
314 .nvj,298 .nvj,
315 .nvs,299 .nvs,
316 .packets,
317 .prev65,300 .prev65,
318 .small_data,301 .small_data,
319 .v5,302 .v5,
...@@ -332,7 +315,6 @@ pub const cpu = struct {...@@ -332,7 +315,6 @@ pub const cpu = struct {
332 .memops,315 .memops,
333 .nvj,316 .nvj,
334 .nvs,317 .nvs,
335 .packets,
336 .small_data,318 .small_data,
337 .v5,319 .v5,
338 .v55,320 .v55,
...@@ -351,7 +333,6 @@ pub const cpu = struct {...@@ -351,7 +333,6 @@ pub const cpu = struct {
351 .memops,333 .memops,
352 .nvj,334 .nvj,
353 .nvs,335 .nvs,
354 .packets,
355 .small_data,336 .small_data,
356 .v5,337 .v5,
357 .v55,338 .v55,
...@@ -371,7 +352,6 @@ pub const cpu = struct {...@@ -371,7 +352,6 @@ pub const cpu = struct {
371 .memops,352 .memops,
372 .nvj,353 .nvj,
373 .nvs,354 .nvs,
374 .packets,
375 .small_data,355 .small_data,
376 .v5,356 .v5,
377 .v55,357 .v55,
...@@ -391,7 +371,6 @@ pub const cpu = struct {...@@ -391,7 +371,6 @@ pub const cpu = struct {
391 .mem_noshuf,371 .mem_noshuf,
392 .memops,372 .memops,
393 .nvs,373 .nvs,
394 .packets,
395 .small_data,374 .small_data,
396 .tinycore,375 .tinycore,
397 .v5,376 .v5,
lib/std/target/mips.zig+2-11
...@@ -1,8 +1,5 @@...@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
...@@ -108,7 +105,6 @@ pub const all_features = blk: {...@@ -108,7 +105,6 @@ pub const all_features = blk: {
108 .llvm_name = "dspr3",105 .llvm_name = "dspr3",
109 .description = "Mips DSP-R3 ASE",106 .description = "Mips DSP-R3 ASE",
110 .dependencies = featureSet(&[_]Feature{107 .dependencies = featureSet(&[_]Feature{
111 .dsp,
112 .dspr2,108 .dspr2,
113 }),109 }),
114 };110 };
...@@ -301,10 +297,8 @@ pub const all_features = blk: {...@@ -301,10 +297,8 @@ pub const all_features = blk: {
301 .llvm_name = "mips64r6",297 .llvm_name = "mips64r6",
302 .description = "Mips64r6 ISA Support [experimental]",298 .description = "Mips64r6 ISA Support [experimental]",
303 .dependencies = featureSet(&[_]Feature{299 .dependencies = featureSet(&[_]Feature{
304 .abs2008,
305 .mips32r6,300 .mips32r6,
306 .mips64r5,301 .mips64r5,
307 .nan2008,
308 }),302 }),
309 };303 };
310 result[@enumToInt(Feature.msa)] = .{304 result[@enumToInt(Feature.msa)] = .{
...@@ -515,16 +509,13 @@ pub const cpu = struct {...@@ -515,16 +509,13 @@ pub const cpu = struct {
515 .llvm_name = "octeon",509 .llvm_name = "octeon",
516 .features = featureSet(&[_]Feature{510 .features = featureSet(&[_]Feature{
517 .cnmips,511 .cnmips,
518 .mips64r2,
519 }),512 }),
520 };513 };
521 pub const @"octeon+" = CpuModel{514 pub const @"octeon+" = CpuModel{
522 .name = "octeon+",515 .name = "octeon+",
523 .llvm_name = "octeon+",516 .llvm_name = "octeon+",
524 .features = featureSet(&[_]Feature{517 .features = featureSet(&[_]Feature{
525 .cnmips,
526 .cnmipsp,518 .cnmipsp,
527 .mips64r2,
528 }),519 }),
529 };520 };
530 pub const p5600 = CpuModel{521 pub const p5600 = CpuModel{
lib/std/target/msp430.zig+2-5
...@@ -1,8 +1,5 @@...@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
lib/std/target/nvptx.zig+2-5
...@@ -1,8 +1,5 @@...@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
lib/std/target/powerpc.zig+98-123
...@@ -1,8 +1,5 @@...@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
...@@ -10,6 +7,7 @@ const CpuModel = std.Target.Cpu.Model;...@@ -10,6 +7,7 @@ const CpuModel = std.Target.Cpu.Model;
10pub const Feature = enum {7pub const Feature = enum {
11 @"64bit",8 @"64bit",
12 @"64bitregs",9 @"64bitregs",
10 aix,
13 allow_unaligned_fp_access,11 allow_unaligned_fp_access,
14 altivec,12 altivec,
15 booke,13 booke,
...@@ -19,6 +17,7 @@ pub const Feature = enum {...@@ -19,6 +17,7 @@ pub const Feature = enum {
19 crypto,17 crypto,
20 direct_move,18 direct_move,
21 e500,19 e500,
20 efpu2,
22 extdiv,21 extdiv,
23 fcpsgn,22 fcpsgn,
24 float128,23 float128,
...@@ -32,6 +31,7 @@ pub const Feature = enum {...@@ -32,6 +31,7 @@ pub const Feature = enum {
32 fsqrt,31 fsqrt,
33 fuse_addi_load,32 fuse_addi_load,
34 fuse_addis_load,33 fuse_addis_load,
34 fuse_store,
35 fusion,35 fusion,
36 hard_float,36 hard_float,
37 htm,37 htm,
...@@ -44,7 +44,10 @@ pub const Feature = enum {...@@ -44,7 +44,10 @@ pub const Feature = enum {
44 lfiwax,44 lfiwax,
45 longcall,45 longcall,
46 mfocrf,46 mfocrf,
47 mma,
48 modern_aix_as,
47 msync,49 msync,
50 paired_vector_memops,
48 partword_atomics,51 partword_atomics,
49 pcrelative_memops,52 pcrelative_memops,
50 popcntd,53 popcntd,
...@@ -53,13 +56,12 @@ pub const Feature = enum {...@@ -53,13 +56,12 @@ pub const Feature = enum {
53 power8_vector,56 power8_vector,
54 power9_altivec,57 power9_altivec,
55 power9_vector,58 power9_vector,
56 ppc_postra_sched,
57 ppc_prera_sched,
58 ppc4xx,59 ppc4xx,
59 ppc6xx,60 ppc6xx,
61 ppc_postra_sched,
62 ppc_prera_sched,
60 predictable_select_expensive,63 predictable_select_expensive,
61 prefix_instrs,64 prefix_instrs,
62 qpx,
63 recipprec,65 recipprec,
64 secure_plt,66 secure_plt,
65 slow_popcntd,67 slow_popcntd,
...@@ -86,6 +88,11 @@ pub const all_features = blk: {...@@ -86,6 +88,11 @@ pub const all_features = blk: {
86 .description = "Enable 64-bit registers usage for ppc32 [beta]",88 .description = "Enable 64-bit registers usage for ppc32 [beta]",
87 .dependencies = featureSet(&[_]Feature{}),89 .dependencies = featureSet(&[_]Feature{}),
88 };90 };
91 result[@enumToInt(Feature.aix)] = .{
92 .llvm_name = "aix",
93 .description = "AIX OS",
94 .dependencies = featureSet(&[_]Feature{}),
95 };
89 result[@enumToInt(Feature.allow_unaligned_fp_access)] = .{96 result[@enumToInt(Feature.allow_unaligned_fp_access)] = .{
90 .llvm_name = "allow-unaligned-fp-access",97 .llvm_name = "allow-unaligned-fp-access",
91 .description = "CPU does not trap on unaligned FP access",98 .description = "CPU does not trap on unaligned FP access",
...@@ -139,6 +146,13 @@ pub const all_features = blk: {...@@ -139,6 +146,13 @@ pub const all_features = blk: {
139 .description = "Enable E500/E500mc instructions",146 .description = "Enable E500/E500mc instructions",
140 .dependencies = featureSet(&[_]Feature{}),147 .dependencies = featureSet(&[_]Feature{}),
141 };148 };
149 result[@enumToInt(Feature.efpu2)] = .{
150 .llvm_name = "efpu2",
151 .description = "Enable Embedded Floating-Point APU 2 instructions",
152 .dependencies = featureSet(&[_]Feature{
153 .spe,
154 }),
155 };
142 result[@enumToInt(Feature.extdiv)] = .{156 result[@enumToInt(Feature.extdiv)] = .{
143 .llvm_name = "extdiv",157 .llvm_name = "extdiv",
144 .description = "Enable extended divide instructions",158 .description = "Enable extended divide instructions",
...@@ -228,6 +242,13 @@ pub const all_features = blk: {...@@ -228,6 +242,13 @@ pub const all_features = blk: {
228 .fusion,242 .fusion,
229 }),243 }),
230 };244 };
245 result[@enumToInt(Feature.fuse_store)] = .{
246 .llvm_name = "fuse-store",
247 .description = "Target supports store clustering",
248 .dependencies = featureSet(&[_]Feature{
249 .fusion,
250 }),
251 };
231 result[@enumToInt(Feature.fusion)] = .{252 result[@enumToInt(Feature.fusion)] = .{
232 .llvm_name = "fusion",253 .llvm_name = "fusion",
233 .description = "Target supports instruction fusion",254 .description = "Target supports instruction fusion",
...@@ -292,6 +313,20 @@ pub const all_features = blk: {...@@ -292,6 +313,20 @@ pub const all_features = blk: {
292 .description = "Enable the MFOCRF instruction",313 .description = "Enable the MFOCRF instruction",
293 .dependencies = featureSet(&[_]Feature{}),314 .dependencies = featureSet(&[_]Feature{}),
294 };315 };
316 result[@enumToInt(Feature.mma)] = .{
317 .llvm_name = "mma",
318 .description = "Enable MMA instructions",
319 .dependencies = featureSet(&[_]Feature{
320 .paired_vector_memops,
321 .power8_vector,
322 .power9_altivec,
323 }),
324 };
325 result[@enumToInt(Feature.modern_aix_as)] = .{
326 .llvm_name = "modern-aix-as",
327 .description = "AIX system assembler is modern enough to support new mnes",
328 .dependencies = featureSet(&[_]Feature{}),
329 };
295 result[@enumToInt(Feature.msync)] = .{330 result[@enumToInt(Feature.msync)] = .{
296 .llvm_name = "msync",331 .llvm_name = "msync",
297 .description = "Has only the msync instruction instead of sync",332 .description = "Has only the msync instruction instead of sync",
...@@ -299,6 +334,13 @@ pub const all_features = blk: {...@@ -299,6 +334,13 @@ pub const all_features = blk: {
299 .booke,334 .booke,
300 }),335 }),
301 };336 };
337 result[@enumToInt(Feature.paired_vector_memops)] = .{
338 .llvm_name = "paired-vector-memops",
339 .description = "32Byte load and store instructions",
340 .dependencies = featureSet(&[_]Feature{
341 .isa_v30_instructions,
342 }),
343 };
302 result[@enumToInt(Feature.partword_atomics)] = .{344 result[@enumToInt(Feature.partword_atomics)] = .{
303 .llvm_name = "partword-atomics",345 .llvm_name = "partword-atomics",
304 .description = "Enable l[bh]arx and st[bh]cx.",346 .description = "Enable l[bh]arx and st[bh]cx.",
...@@ -308,7 +350,7 @@ pub const all_features = blk: {...@@ -308,7 +350,7 @@ pub const all_features = blk: {
308 .llvm_name = "pcrelative-memops",350 .llvm_name = "pcrelative-memops",
309 .description = "Enable PC relative Memory Ops",351 .description = "Enable PC relative Memory Ops",
310 .dependencies = featureSet(&[_]Feature{352 .dependencies = featureSet(&[_]Feature{
311 .isa_v30_instructions,353 .prefix_instrs,
312 }),354 }),
313 };355 };
314 result[@enumToInt(Feature.popcntd)] = .{356 result[@enumToInt(Feature.popcntd)] = .{
...@@ -351,21 +393,10 @@ pub const all_features = blk: {...@@ -351,21 +393,10 @@ pub const all_features = blk: {
351 .llvm_name = "power9-vector",393 .llvm_name = "power9-vector",
352 .description = "Enable POWER9 vector instructions",394 .description = "Enable POWER9 vector instructions",
353 .dependencies = featureSet(&[_]Feature{395 .dependencies = featureSet(&[_]Feature{
354 .isa_v30_instructions,
355 .power8_vector,396 .power8_vector,
356 .power9_altivec,397 .power9_altivec,
357 }),398 }),
358 };399 };
359 result[@enumToInt(Feature.ppc_postra_sched)] = .{
360 .llvm_name = "ppc-postra-sched",
361 .description = "Use PowerPC post-RA scheduling strategy",
362 .dependencies = featureSet(&[_]Feature{}),
363 };
364 result[@enumToInt(Feature.ppc_prera_sched)] = .{
365 .llvm_name = "ppc-prera-sched",
366 .description = "Use PowerPC pre-RA scheduling strategy",
367 .dependencies = featureSet(&[_]Feature{}),
368 };
369 result[@enumToInt(Feature.ppc4xx)] = .{400 result[@enumToInt(Feature.ppc4xx)] = .{
370 .llvm_name = "ppc4xx",401 .llvm_name = "ppc4xx",
371 .description = "Enable PPC 4xx instructions",402 .description = "Enable PPC 4xx instructions",
...@@ -376,6 +407,16 @@ pub const all_features = blk: {...@@ -376,6 +407,16 @@ pub const all_features = blk: {
376 .description = "Enable PPC 6xx instructions",407 .description = "Enable PPC 6xx instructions",
377 .dependencies = featureSet(&[_]Feature{}),408 .dependencies = featureSet(&[_]Feature{}),
378 };409 };
410 result[@enumToInt(Feature.ppc_postra_sched)] = .{
411 .llvm_name = "ppc-postra-sched",
412 .description = "Use PowerPC post-RA scheduling strategy",
413 .dependencies = featureSet(&[_]Feature{}),
414 };
415 result[@enumToInt(Feature.ppc_prera_sched)] = .{
416 .llvm_name = "ppc-prera-sched",
417 .description = "Use PowerPC pre-RA scheduling strategy",
418 .dependencies = featureSet(&[_]Feature{}),
419 };
379 result[@enumToInt(Feature.predictable_select_expensive)] = .{420 result[@enumToInt(Feature.predictable_select_expensive)] = .{
380 .llvm_name = "predictable-select-expensive",421 .llvm_name = "predictable-select-expensive",
381 .description = "Prefer likely predicted branches over selects",422 .description = "Prefer likely predicted branches over selects",
...@@ -385,18 +426,10 @@ pub const all_features = blk: {...@@ -385,18 +426,10 @@ pub const all_features = blk: {
385 .llvm_name = "prefix-instrs",426 .llvm_name = "prefix-instrs",
386 .description = "Enable prefixed instructions",427 .description = "Enable prefixed instructions",
387 .dependencies = featureSet(&[_]Feature{428 .dependencies = featureSet(&[_]Feature{
388 .isa_v30_instructions,
389 .power8_vector,429 .power8_vector,
390 .power9_altivec,430 .power9_altivec,
391 }),431 }),
392 };432 };
393 result[@enumToInt(Feature.qpx)] = .{
394 .llvm_name = "qpx",
395 .description = "Enable QPX instructions",
396 .dependencies = featureSet(&[_]Feature{
397 .fpu,
398 }),
399 };
400 result[@enumToInt(Feature.recipprec)] = .{433 result[@enumToInt(Feature.recipprec)] = .{
401 .llvm_name = "recipprec",434 .llvm_name = "recipprec",
402 .description = "Assume higher precision reciprocal estimates",435 .description = "Assume higher precision reciprocal estimates",
...@@ -452,94 +485,90 @@ pub const all_features = blk: {...@@ -452,94 +485,90 @@ pub const all_features = blk: {
452};485};
453486
454pub const cpu = struct {487pub const cpu = struct {
455 pub const @"ppc440" = CpuModel{488 pub const @"440" = CpuModel{
456 .name = "ppc440",489 .name = "440",
457 .llvm_name = "440",490 .llvm_name = "440",
458 .features = featureSet(&[_]Feature{491 .features = featureSet(&[_]Feature{
459 .booke,
460 .fres,492 .fres,
461 .frsqrte,493 .frsqrte,
462 .icbt,
463 .isel,494 .isel,
464 .msync,495 .msync,
465 }),496 }),
466 };497 };
467 pub const @"ppc450" = CpuModel{498 pub const @"450" = CpuModel{
468 .name = "ppc450",499 .name = "450",
469 .llvm_name = "450",500 .llvm_name = "450",
470 .features = featureSet(&[_]Feature{501 .features = featureSet(&[_]Feature{
471 .booke,
472 .fres,502 .fres,
473 .frsqrte,503 .frsqrte,
474 .icbt,
475 .isel,504 .isel,
476 .msync,505 .msync,
477 }),506 }),
478 };507 };
479 pub const @"ppc601" = CpuModel{508 pub const @"601" = CpuModel{
480 .name = "ppc601",509 .name = "601",
481 .llvm_name = "601",510 .llvm_name = "601",
482 .features = featureSet(&[_]Feature{511 .features = featureSet(&[_]Feature{
483 .fpu,512 .fpu,
484 }),513 }),
485 };514 };
486 pub const @"ppc602" = CpuModel{515 pub const @"602" = CpuModel{
487 .name = "ppc602",516 .name = "602",
488 .llvm_name = "602",517 .llvm_name = "602",
489 .features = featureSet(&[_]Feature{518 .features = featureSet(&[_]Feature{
490 .fpu,519 .fpu,
491 }),520 }),
492 };521 };
493 pub const @"ppc603" = CpuModel{522 pub const @"603" = CpuModel{
494 .name = "ppc603",523 .name = "603",
495 .llvm_name = "603",524 .llvm_name = "603",
496 .features = featureSet(&[_]Feature{525 .features = featureSet(&[_]Feature{
497 .fres,526 .fres,
498 .frsqrte,527 .frsqrte,
499 }),528 }),
500 };529 };
501 pub const @"ppc603e" = CpuModel{530 pub const @"603e" = CpuModel{
502 .name = "ppc603e",531 .name = "603e",
503 .llvm_name = "603e",532 .llvm_name = "603e",
504 .features = featureSet(&[_]Feature{533 .features = featureSet(&[_]Feature{
505 .fres,534 .fres,
506 .frsqrte,535 .frsqrte,
507 }),536 }),
508 };537 };
509 pub const @"ppc603ev" = CpuModel{538 pub const @"603ev" = CpuModel{
510 .name = "ppc603ev",539 .name = "603ev",
511 .llvm_name = "603ev",540 .llvm_name = "603ev",
512 .features = featureSet(&[_]Feature{541 .features = featureSet(&[_]Feature{
513 .fres,542 .fres,
514 .frsqrte,543 .frsqrte,
515 }),544 }),
516 };545 };
517 pub const @"ppc604" = CpuModel{546 pub const @"604" = CpuModel{
518 .name = "ppc604",547 .name = "604",
519 .llvm_name = "604",548 .llvm_name = "604",
520 .features = featureSet(&[_]Feature{549 .features = featureSet(&[_]Feature{
521 .fres,550 .fres,
522 .frsqrte,551 .frsqrte,
523 }),552 }),
524 };553 };
525 pub const @"ppc604e" = CpuModel{554 pub const @"604e" = CpuModel{
526 .name = "ppc604e",555 .name = "604e",
527 .llvm_name = "604e",556 .llvm_name = "604e",
528 .features = featureSet(&[_]Feature{557 .features = featureSet(&[_]Feature{
529 .fres,558 .fres,
530 .frsqrte,559 .frsqrte,
531 }),560 }),
532 };561 };
533 pub const @"ppc620" = CpuModel{562 pub const @"620" = CpuModel{
534 .name = "ppc620",563 .name = "620",
535 .llvm_name = "620",564 .llvm_name = "620",
536 .features = featureSet(&[_]Feature{565 .features = featureSet(&[_]Feature{
537 .fres,566 .fres,
538 .frsqrte,567 .frsqrte,
539 }),568 }),
540 };569 };
541 pub const @"ppc7400" = CpuModel{570 pub const @"7400" = CpuModel{
542 .name = "ppc7400",571 .name = "7400",
543 .llvm_name = "7400",572 .llvm_name = "7400",
544 .features = featureSet(&[_]Feature{573 .features = featureSet(&[_]Feature{
545 .altivec,574 .altivec,
...@@ -547,8 +576,8 @@ pub const cpu = struct {...@@ -547,8 +576,8 @@ pub const cpu = struct {
547 .frsqrte,576 .frsqrte,
548 }),577 }),
549 };578 };
550 pub const @"ppc7450" = CpuModel{579 pub const @"7450" = CpuModel{
551 .name = "ppc7450",580 .name = "7450",
552 .llvm_name = "7450",581 .llvm_name = "7450",
553 .features = featureSet(&[_]Feature{582 .features = featureSet(&[_]Feature{
554 .altivec,583 .altivec,
...@@ -556,16 +585,16 @@ pub const cpu = struct {...@@ -556,16 +585,16 @@ pub const cpu = struct {
556 .frsqrte,585 .frsqrte,
557 }),586 }),
558 };587 };
559 pub const @"ppc750" = CpuModel{588 pub const @"750" = CpuModel{
560 .name = "ppc750",589 .name = "750",
561 .llvm_name = "750",590 .llvm_name = "750",
562 .features = featureSet(&[_]Feature{591 .features = featureSet(&[_]Feature{
563 .fres,592 .fres,
564 .frsqrte,593 .frsqrte,
565 }),594 }),
566 };595 };
567 pub const @"ppc970" = CpuModel{596 pub const @"970" = CpuModel{
568 .name = "ppc970",597 .name = "970",
569 .llvm_name = "970",598 .llvm_name = "970",
570 .features = featureSet(&[_]Feature{599 .features = featureSet(&[_]Feature{
571 .@"64bit",600 .@"64bit",
...@@ -592,7 +621,6 @@ pub const cpu = struct {...@@ -592,7 +621,6 @@ pub const cpu = struct {
592 .frsqrte,621 .frsqrte,
593 .frsqrtes,622 .frsqrtes,
594 .fsqrt,623 .fsqrt,
595 .icbt,
596 .isel,624 .isel,
597 .ldbrx,625 .ldbrx,
598 .lfiwax,626 .lfiwax,
...@@ -602,38 +630,10 @@ pub const cpu = struct {...@@ -602,38 +630,10 @@ pub const cpu = struct {
602 .stfiwx,630 .stfiwx,
603 }),631 }),
604 };632 };
605 pub const a2q = CpuModel{
606 .name = "a2q",
607 .llvm_name = "a2q",
608 .features = featureSet(&[_]Feature{
609 .@"64bit",
610 .booke,
611 .cmpb,
612 .fcpsgn,
613 .fpcvt,
614 .fprnd,
615 .fre,
616 .fres,
617 .frsqrte,
618 .frsqrtes,
619 .fsqrt,
620 .icbt,
621 .isel,
622 .ldbrx,
623 .lfiwax,
624 .mfocrf,
625 .qpx,
626 .recipprec,
627 .slow_popcntd,
628 .stfiwx,
629 }),
630 };
631 pub const e500 = CpuModel{633 pub const e500 = CpuModel{
632 .name = "e500",634 .name = "e500",
633 .llvm_name = "e500",635 .llvm_name = "e500",
634 .features = featureSet(&[_]Feature{636 .features = featureSet(&[_]Feature{
635 .booke,
636 .icbt,
637 .isel,637 .isel,
638 .msync,638 .msync,
639 .spe,639 .spe,
...@@ -644,7 +644,6 @@ pub const cpu = struct {...@@ -644,7 +644,6 @@ pub const cpu = struct {
644 .llvm_name = "e500mc",644 .llvm_name = "e500mc",
645 .features = featureSet(&[_]Feature{645 .features = featureSet(&[_]Feature{
646 .booke,646 .booke,
647 .icbt,
648 .isel,647 .isel,
649 .stfiwx,648 .stfiwx,
650 }),649 }),
...@@ -655,7 +654,6 @@ pub const cpu = struct {...@@ -655,7 +654,6 @@ pub const cpu = struct {
655 .features = featureSet(&[_]Feature{654 .features = featureSet(&[_]Feature{
656 .@"64bit",655 .@"64bit",
657 .booke,656 .booke,
658 .icbt,
659 .isel,657 .isel,
660 .mfocrf,658 .mfocrf,
661 .stfiwx,659 .stfiwx,
...@@ -667,7 +665,6 @@ pub const cpu = struct {...@@ -667,7 +665,6 @@ pub const cpu = struct {
667 .features = featureSet(&[_]Feature{665 .features = featureSet(&[_]Feature{
668 .@"64bit",666 .@"64bit",
669 .allow_unaligned_fp_access,667 .allow_unaligned_fp_access,
670 .altivec,
671 .bpermd,668 .bpermd,
672 .cmpb,669 .cmpb,
673 .crypto,670 .crypto,
...@@ -681,28 +678,24 @@ pub const cpu = struct {...@@ -681,28 +678,24 @@ pub const cpu = struct {
681 .frsqrte,678 .frsqrte,
682 .frsqrtes,679 .frsqrtes,
683 .fsqrt,680 .fsqrt,
681 .fuse_store,
684 .htm,682 .htm,
685 .icbt,683 .icbt,
686 .isa_v30_instructions,
687 .isa_v31_instructions,
688 .isel,684 .isel,
689 .ldbrx,685 .ldbrx,
690 .lfiwax,686 .lfiwax,
691 .mfocrf,687 .mfocrf,
688 .mma,
692 .partword_atomics,689 .partword_atomics,
693 .pcrelative_memops,690 .pcrelative_memops,
694 .popcntd,691 .popcntd,
695 .power10_vector,692 .power10_vector,
696 .power8_altivec,693 .ppc_postra_sched,
697 .power8_vector,694 .ppc_prera_sched,
698 .power9_altivec,
699 .power9_vector,
700 .predictable_select_expensive,695 .predictable_select_expensive,
701 .prefix_instrs,
702 .recipprec,696 .recipprec,
703 .stfiwx,697 .stfiwx,
704 .two_const_nr,698 .two_const_nr,
705 .vsx,
706 }),699 }),
707 };700 };
708 pub const g3 = CpuModel{701 pub const g3 = CpuModel{
...@@ -760,7 +753,7 @@ pub const cpu = struct {...@@ -760,7 +753,7 @@ pub const cpu = struct {
760 };753 };
761 pub const ppc32 = CpuModel{754 pub const ppc32 = CpuModel{
762 .name = "ppc32",755 .name = "ppc32",
763 .llvm_name = "ppc",756 .llvm_name = "ppc32",
764 .features = featureSet(&[_]Feature{757 .features = featureSet(&[_]Feature{
765 .hard_float,758 .hard_float,
766 }),759 }),
...@@ -784,7 +777,6 @@ pub const cpu = struct {...@@ -784,7 +777,6 @@ pub const cpu = struct {
784 .features = featureSet(&[_]Feature{777 .features = featureSet(&[_]Feature{
785 .@"64bit",778 .@"64bit",
786 .allow_unaligned_fp_access,779 .allow_unaligned_fp_access,
787 .altivec,
788 .bpermd,780 .bpermd,
789 .cmpb,781 .cmpb,
790 .crypto,782 .crypto,
...@@ -808,13 +800,11 @@ pub const cpu = struct {...@@ -808,13 +800,11 @@ pub const cpu = struct {
808 .mfocrf,800 .mfocrf,
809 .partword_atomics,801 .partword_atomics,
810 .popcntd,802 .popcntd,
811 .power8_altivec,
812 .power8_vector,803 .power8_vector,
813 .predictable_select_expensive,804 .predictable_select_expensive,
814 .recipprec,805 .recipprec,
815 .stfiwx,806 .stfiwx,
816 .two_const_nr,807 .two_const_nr,
817 .vsx,
818 }),808 }),
819 };809 };
820 pub const pwr10 = CpuModel{810 pub const pwr10 = CpuModel{
...@@ -823,7 +813,6 @@ pub const cpu = struct {...@@ -823,7 +813,6 @@ pub const cpu = struct {
823 .features = featureSet(&[_]Feature{813 .features = featureSet(&[_]Feature{
824 .@"64bit",814 .@"64bit",
825 .allow_unaligned_fp_access,815 .allow_unaligned_fp_access,
826 .altivec,
827 .bpermd,816 .bpermd,
828 .cmpb,817 .cmpb,
829 .crypto,818 .crypto,
...@@ -837,28 +826,24 @@ pub const cpu = struct {...@@ -837,28 +826,24 @@ pub const cpu = struct {
837 .frsqrte,826 .frsqrte,
838 .frsqrtes,827 .frsqrtes,
839 .fsqrt,828 .fsqrt,
829 .fuse_store,
840 .htm,830 .htm,
841 .icbt,831 .icbt,
842 .isa_v30_instructions,
843 .isa_v31_instructions,
844 .isel,832 .isel,
845 .ldbrx,833 .ldbrx,
846 .lfiwax,834 .lfiwax,
847 .mfocrf,835 .mfocrf,
836 .mma,
848 .partword_atomics,837 .partword_atomics,
849 .pcrelative_memops,838 .pcrelative_memops,
850 .popcntd,839 .popcntd,
851 .power10_vector,840 .power10_vector,
852 .power8_altivec,841 .ppc_postra_sched,
853 .power8_vector,842 .ppc_prera_sched,
854 .power9_altivec,
855 .power9_vector,
856 .predictable_select_expensive,843 .predictable_select_expensive,
857 .prefix_instrs,
858 .recipprec,844 .recipprec,
859 .stfiwx,845 .stfiwx,
860 .two_const_nr,846 .two_const_nr,
861 .vsx,
862 }),847 }),
863 };848 };
864 pub const pwr3 = CpuModel{849 pub const pwr3 = CpuModel{
...@@ -963,7 +948,6 @@ pub const cpu = struct {...@@ -963,7 +948,6 @@ pub const cpu = struct {
963 .features = featureSet(&[_]Feature{948 .features = featureSet(&[_]Feature{
964 .@"64bit",949 .@"64bit",
965 .allow_unaligned_fp_access,950 .allow_unaligned_fp_access,
966 .altivec,
967 .bpermd,951 .bpermd,
968 .cmpb,952 .cmpb,
969 .extdiv,953 .extdiv,
...@@ -992,7 +976,6 @@ pub const cpu = struct {...@@ -992,7 +976,6 @@ pub const cpu = struct {
992 .features = featureSet(&[_]Feature{976 .features = featureSet(&[_]Feature{
993 .@"64bit",977 .@"64bit",
994 .allow_unaligned_fp_access,978 .allow_unaligned_fp_access,
995 .altivec,
996 .bpermd,979 .bpermd,
997 .cmpb,980 .cmpb,
998 .crypto,981 .crypto,
...@@ -1016,13 +999,11 @@ pub const cpu = struct {...@@ -1016,13 +999,11 @@ pub const cpu = struct {
1016 .mfocrf,999 .mfocrf,
1017 .partword_atomics,1000 .partword_atomics,
1018 .popcntd,1001 .popcntd,
1019 .power8_altivec,
1020 .power8_vector,1002 .power8_vector,
1021 .predictable_select_expensive,1003 .predictable_select_expensive,
1022 .recipprec,1004 .recipprec,
1023 .stfiwx,1005 .stfiwx,
1024 .two_const_nr,1006 .two_const_nr,
1025 .vsx,
1026 }),1007 }),
1027 };1008 };
1028 pub const pwr9 = CpuModel{1009 pub const pwr9 = CpuModel{
...@@ -1031,7 +1012,6 @@ pub const cpu = struct {...@@ -1031,7 +1012,6 @@ pub const cpu = struct {
1031 .features = featureSet(&[_]Feature{1012 .features = featureSet(&[_]Feature{
1032 .@"64bit",1013 .@"64bit",
1033 .allow_unaligned_fp_access,1014 .allow_unaligned_fp_access,
1034 .altivec,
1035 .bpermd,1015 .bpermd,
1036 .cmpb,1016 .cmpb,
1037 .crypto,1017 .crypto,
...@@ -1047,16 +1027,12 @@ pub const cpu = struct {...@@ -1047,16 +1027,12 @@ pub const cpu = struct {
1047 .fsqrt,1027 .fsqrt,
1048 .htm,1028 .htm,
1049 .icbt,1029 .icbt,
1050 .isa_v30_instructions,
1051 .isel,1030 .isel,
1052 .ldbrx,1031 .ldbrx,
1053 .lfiwax,1032 .lfiwax,
1054 .mfocrf,1033 .mfocrf,
1055 .partword_atomics,1034 .partword_atomics,
1056 .popcntd,1035 .popcntd,
1057 .power8_altivec,
1058 .power8_vector,
1059 .power9_altivec,
1060 .power9_vector,1036 .power9_vector,
1061 .ppc_postra_sched,1037 .ppc_postra_sched,
1062 .ppc_prera_sched,1038 .ppc_prera_sched,
...@@ -1065,7 +1041,6 @@ pub const cpu = struct {...@@ -1065,7 +1041,6 @@ pub const cpu = struct {
1065 .stfiwx,1041 .stfiwx,
1066 .two_const_nr,1042 .two_const_nr,
1067 .vectors_use_two_units,1043 .vectors_use_two_units,
1068 .vsx,
1069 }),1044 }),
1070 };1045 };
1071};1046};
lib/std/target/riscv.zig+67-11
...@@ -1,8 +1,5 @@...@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
...@@ -15,6 +12,7 @@ pub const Feature = enum {...@@ -15,6 +12,7 @@ pub const Feature = enum {
15 e,12 e,
16 experimental_b,13 experimental_b,
17 experimental_v,14 experimental_v,
15 experimental_zba,
18 experimental_zbb,16 experimental_zbb,
19 experimental_zbc,17 experimental_zbc,
20 experimental_zbe,18 experimental_zbe,
...@@ -25,6 +23,9 @@ pub const Feature = enum {...@@ -25,6 +23,9 @@ pub const Feature = enum {
25 experimental_zbr,23 experimental_zbr,
26 experimental_zbs,24 experimental_zbs,
27 experimental_zbt,25 experimental_zbt,
26 experimental_zfh,
27 experimental_zvamo,
28 experimental_zvlsseg,
28 f,29 f,
29 m,30 m,
30 no_rvc_hints,31 no_rvc_hints,
...@@ -100,6 +101,7 @@ pub const all_features = blk: {...@@ -100,6 +101,7 @@ pub const all_features = blk: {
100 .llvm_name = "experimental-b",101 .llvm_name = "experimental-b",
101 .description = "'B' (Bit Manipulation Instructions)",102 .description = "'B' (Bit Manipulation Instructions)",
102 .dependencies = featureSet(&[_]Feature{103 .dependencies = featureSet(&[_]Feature{
104 .experimental_zba,
103 .experimental_zbb,105 .experimental_zbb,
104 .experimental_zbc,106 .experimental_zbc,
105 .experimental_zbe,107 .experimental_zbe,
...@@ -114,9 +116,12 @@ pub const all_features = blk: {...@@ -114,9 +116,12 @@ pub const all_features = blk: {
114 result[@enumToInt(Feature.experimental_v)] = .{116 result[@enumToInt(Feature.experimental_v)] = .{
115 .llvm_name = "experimental-v",117 .llvm_name = "experimental-v",
116 .description = "'V' (Vector Instructions)",118 .description = "'V' (Vector Instructions)",
117 .dependencies = featureSet(&[_]Feature{119 .dependencies = featureSet(&[_]Feature{}),
118 .f,120 };
119 }),121 result[@enumToInt(Feature.experimental_zba)] = .{
122 .llvm_name = "experimental-zba",
123 .description = "'Zba' (Address calculation 'B' Instructions)",
124 .dependencies = featureSet(&[_]Feature{}),
120 };125 };
121 result[@enumToInt(Feature.experimental_zbb)] = .{126 result[@enumToInt(Feature.experimental_zbb)] = .{
122 .llvm_name = "experimental-zbb",127 .llvm_name = "experimental-zbb",
...@@ -168,6 +173,27 @@ pub const all_features = blk: {...@@ -168,6 +173,27 @@ pub const all_features = blk: {
168 .description = "'Zbt' (Ternary 'B' Instructions)",173 .description = "'Zbt' (Ternary 'B' Instructions)",
169 .dependencies = featureSet(&[_]Feature{}),174 .dependencies = featureSet(&[_]Feature{}),
170 };175 };
176 result[@enumToInt(Feature.experimental_zfh)] = .{
177 .llvm_name = "experimental-zfh",
178 .description = "'Zfh' (Half-Precision Floating-Point)",
179 .dependencies = featureSet(&[_]Feature{
180 .f,
181 }),
182 };
183 result[@enumToInt(Feature.experimental_zvamo)] = .{
184 .llvm_name = "experimental-zvamo",
185 .description = "'Zvamo'(Vector AMO Operations)",
186 .dependencies = featureSet(&[_]Feature{
187 .experimental_v,
188 }),
189 };
190 result[@enumToInt(Feature.experimental_zvlsseg)] = .{
191 .llvm_name = "experimental-zvlsseg",
192 .description = "'Zvlsseg' (Vector segment load/store instructions)",
193 .dependencies = featureSet(&[_]Feature{
194 .experimental_v,
195 }),
196 };
171 result[@enumToInt(Feature.f)] = .{197 result[@enumToInt(Feature.f)] = .{
172 .llvm_name = "f",198 .llvm_name = "f",
173 .description = "'F' (Single-Precision Floating-Point)",199 .description = "'F' (Single-Precision Floating-Point)",
...@@ -364,7 +390,6 @@ pub const cpu = struct {...@@ -364,7 +390,6 @@ pub const cpu = struct {
364 .a,390 .a,
365 .c,391 .c,
366 .d,392 .d,
367 .f,
368 .m,393 .m,
369 }),394 }),
370 };395 };
...@@ -376,7 +401,6 @@ pub const cpu = struct {...@@ -376,7 +401,6 @@ pub const cpu = struct {
376 .a,401 .a,
377 .c,402 .c,
378 .d,403 .d,
379 .f,
380 .m,404 .m,
381 }),405 }),
382 };406 };
...@@ -404,6 +428,18 @@ pub const cpu = struct {...@@ -404,6 +428,18 @@ pub const cpu = struct {
404 .@"64bit",428 .@"64bit",
405 }),429 }),
406 };430 };
431 pub const sifive_7_rv32 = CpuModel{
432 .name = "sifive_7_rv32",
433 .llvm_name = "sifive-7-rv32",
434 .features = featureSet(&[_]Feature{}),
435 };
436 pub const sifive_7_rv64 = CpuModel{
437 .name = "sifive_7_rv64",
438 .llvm_name = "sifive-7-rv64",
439 .features = featureSet(&[_]Feature{
440 .@"64bit",
441 }),
442 };
407 pub const sifive_e31 = CpuModel{443 pub const sifive_e31 = CpuModel{
408 .name = "sifive_e31",444 .name = "sifive_e31",
409 .llvm_name = "sifive-e31",445 .llvm_name = "sifive-e31",
...@@ -413,6 +449,16 @@ pub const cpu = struct {...@@ -413,6 +449,16 @@ pub const cpu = struct {
413 .m,449 .m,
414 }),450 }),
415 };451 };
452 pub const sifive_e76 = CpuModel{
453 .name = "sifive_e76",
454 .llvm_name = "sifive-e76",
455 .features = featureSet(&[_]Feature{
456 .a,
457 .c,
458 .f,
459 .m,
460 }),
461 };
416 pub const sifive_u54 = CpuModel{462 pub const sifive_u54 = CpuModel{
417 .name = "sifive_u54",463 .name = "sifive_u54",
418 .llvm_name = "sifive-u54",464 .llvm_name = "sifive-u54",
...@@ -421,7 +467,17 @@ pub const cpu = struct {...@@ -421,7 +467,17 @@ pub const cpu = struct {
421 .a,467 .a,
422 .c,468 .c,
423 .d,469 .d,
424 .f,470 .m,
471 }),
472 };
473 pub const sifive_u74 = CpuModel{
474 .name = "sifive_u74",
475 .llvm_name = "sifive-u74",
476 .features = featureSet(&[_]Feature{
477 .@"64bit",
478 .a,
479 .c,
480 .d,
425 .m,481 .m,
426 }),482 }),
427 };483 };
lib/std/target/sparc.zig+7-5
...@@ -1,8 +1,5 @@...@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
...@@ -160,6 +157,11 @@ pub const cpu = struct {...@@ -160,6 +157,11 @@ pub const cpu = struct {
160 .llvm_name = "f934",157 .llvm_name = "f934",
161 .features = featureSet(&[_]Feature{}),158 .features = featureSet(&[_]Feature{}),
162 };159 };
160 pub const generic = CpuModel{
161 .name = "generic",
162 .llvm_name = "generic",
163 .features = featureSet(&[_]Feature{}),
164 };
163 pub const gr712rc = CpuModel{165 pub const gr712rc = CpuModel{
164 .name = "gr712rc",166 .name = "gr712rc",
165 .llvm_name = "gr712rc",167 .llvm_name = "gr712rc",
lib/std/target/systemz.zig+2-5
...@@ -1,8 +1,5 @@...@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
lib/std/target/ve.zig created+36
...@@ -0,0 +1,36 @@
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
3const std = @import("../std.zig");
4const CpuFeature = std.Target.Cpu.Feature;
5const CpuModel = std.Target.Cpu.Model;
6
7pub const Feature = enum {
8 vpu,
9};
10
11pub usingnamespace CpuFeature.feature_set_fns(Feature);
12
13pub const all_features = blk: {
14 const len = @typeInfo(Feature).Enum.fields.len;
15 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
16 var result: [len]CpuFeature = undefined;
17 result[@enumToInt(Feature.vpu)] = .{
18 .llvm_name = "vpu",
19 .description = "Enable the VPU",
20 .dependencies = featureSet(&[_]Feature{}),
21 };
22 const ti = @typeInfo(Feature);
23 for (result) |*elem, i| {
24 elem.index = i;
25 elem.name = ti.Enum.fields[i].name;
26 }
27 break :blk result;
28};
29
30pub const cpu = struct {
31 pub const generic = CpuModel{
32 .name = "generic",
33 .llvm_name = "generic",
34 .features = featureSet(&[_]Feature{}),
35 };
36};
lib/std/target/wasm.zig+2-5
...@@ -1,8 +1,5 @@...@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
lib/std/target/x86.zig+470-320
...@@ -1,13 +1,12 @@...@@ -1,13 +1,12 @@
1// SPDX-License-Identifier: MIT1//! This file is auto-generated by tools/update_cpu_features.zig.
2// Copyright (c) 2015-2021 Zig Contributors2
3// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4// The MIT license requires this copyright notice to be included in all copies
5// and substantial portions of the software.
6const std = @import("../std.zig");3const std = @import("../std.zig");
7const CpuFeature = std.Target.Cpu.Feature;4const CpuFeature = std.Target.Cpu.Feature;
8const CpuModel = std.Target.Cpu.Model;5const CpuModel = std.Target.Cpu.Model;
96
10pub const Feature = enum {7pub const Feature = enum {
8 @"16bit_mode",
9 @"32bit_mode",
11 @"3dnow",10 @"3dnow",
12 @"3dnowa",11 @"3dnowa",
13 @"64bit",12 @"64bit",
...@@ -33,6 +32,7 @@ pub const Feature = enum {...@@ -33,6 +32,7 @@ pub const Feature = enum {
33 avx512vnni,32 avx512vnni,
34 avx512vp2intersect,33 avx512vp2intersect,
35 avx512vpopcntdq,34 avx512vpopcntdq,
35 avxvnni,
36 bmi,36 bmi,
37 bmi2,37 bmi2,
38 branchfusion,38 branchfusion,
...@@ -64,11 +64,14 @@ pub const Feature = enum {...@@ -64,11 +64,14 @@ pub const Feature = enum {
64 fma,64 fma,
65 fma4,65 fma4,
66 fsgsbase,66 fsgsbase,
67 fsrm,
67 fxsr,68 fxsr,
68 gfni,69 gfni,
70 hreset,
69 idivl_to_divb,71 idivl_to_divb,
70 idivq_to_divl,72 idivq_to_divl,
71 invpcid,73 invpcid,
74 kl,
72 lea_sp,75 lea_sp,
73 lea_uses_ag,76 lea_uses_ag,
74 lvi_cfi,77 lvi_cfi,
...@@ -76,12 +79,10 @@ pub const Feature = enum {...@@ -76,12 +79,10 @@ pub const Feature = enum {
76 lwp,79 lwp,
77 lzcnt,80 lzcnt,
78 macrofusion,81 macrofusion,
79 merge_to_threeway_branch,
80 mmx,82 mmx,
81 movbe,83 movbe,
82 movdir64b,84 movdir64b,
83 movdiri,85 movdiri,
84 mpx,
85 mwaitx,86 mwaitx,
86 nopl,87 nopl,
87 pad_short_functions,88 pad_short_functions,
...@@ -120,15 +121,16 @@ pub const Feature = enum {...@@ -120,15 +121,16 @@ pub const Feature = enum {
120 slow_unaligned_mem_32,121 slow_unaligned_mem_32,
121 soft_float,122 soft_float,
122 sse,123 sse,
123 sse_unaligned_mem,
124 sse2,124 sse2,
125 sse3,125 sse3,
126 sse4_1,126 sse4_1,
127 sse4_2,127 sse4_2,
128 sse4a,128 sse4a,
129 sse_unaligned_mem,
129 ssse3,130 ssse3,
130 tbm,131 tbm,
131 tsxldtrk,132 tsxldtrk,
133 uintr,
132 use_aa,134 use_aa,
133 use_glm_div_sqrt_costs,135 use_glm_div_sqrt_costs,
134 vaes,136 vaes,
...@@ -136,6 +138,7 @@ pub const Feature = enum {...@@ -136,6 +138,7 @@ pub const Feature = enum {
136 vzeroupper,138 vzeroupper,
137 waitpkg,139 waitpkg,
138 wbnoinvd,140 wbnoinvd,
141 widekl,
139 x87,142 x87,
140 xop,143 xop,
141 xsave,144 xsave,
...@@ -150,6 +153,16 @@ pub const all_features = blk: {...@@ -150,6 +153,16 @@ pub const all_features = blk: {
150 const len = @typeInfo(Feature).Enum.fields.len;153 const len = @typeInfo(Feature).Enum.fields.len;
151 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);154 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
152 var result: [len]CpuFeature = undefined;155 var result: [len]CpuFeature = undefined;
156 result[@enumToInt(Feature.@"16bit_mode")] = .{
157 .llvm_name = "16bit-mode",
158 .description = "16-bit mode (i8086)",
159 .dependencies = featureSet(&[_]Feature{}),
160 };
161 result[@enumToInt(Feature.@"32bit_mode")] = .{
162 .llvm_name = "32bit-mode",
163 .description = "32-bit mode (80386)",
164 .dependencies = featureSet(&[_]Feature{}),
165 };
153 result[@enumToInt(Feature.@"3dnow")] = .{166 result[@enumToInt(Feature.@"3dnow")] = .{
154 .llvm_name = "3dnow",167 .llvm_name = "3dnow",
155 .description = "Enable 3DNow! instructions",168 .description = "Enable 3DNow! instructions",
...@@ -321,6 +334,13 @@ pub const all_features = blk: {...@@ -321,6 +334,13 @@ pub const all_features = blk: {
321 .avx512f,334 .avx512f,
322 }),335 }),
323 };336 };
337 result[@enumToInt(Feature.avxvnni)] = .{
338 .llvm_name = "avxvnni",
339 .description = "Support AVX_VNNI encoding",
340 .dependencies = featureSet(&[_]Feature{
341 .avx2,
342 }),
343 };
324 result[@enumToInt(Feature.bmi)] = .{344 result[@enumToInt(Feature.bmi)] = .{
325 .llvm_name = "bmi",345 .llvm_name = "bmi",
326 .description = "Support BMI instructions",346 .description = "Support BMI instructions",
...@@ -485,6 +505,11 @@ pub const all_features = blk: {...@@ -485,6 +505,11 @@ pub const all_features = blk: {
485 .description = "Support FS/GS Base instructions",505 .description = "Support FS/GS Base instructions",
486 .dependencies = featureSet(&[_]Feature{}),506 .dependencies = featureSet(&[_]Feature{}),
487 };507 };
508 result[@enumToInt(Feature.fsrm)] = .{
509 .llvm_name = "fsrm",
510 .description = "REP MOVSB of short lengths is faster",
511 .dependencies = featureSet(&[_]Feature{}),
512 };
488 result[@enumToInt(Feature.fxsr)] = .{513 result[@enumToInt(Feature.fxsr)] = .{
489 .llvm_name = "fxsr",514 .llvm_name = "fxsr",
490 .description = "Support fxsave/fxrestore instructions",515 .description = "Support fxsave/fxrestore instructions",
...@@ -497,6 +522,11 @@ pub const all_features = blk: {...@@ -497,6 +522,11 @@ pub const all_features = blk: {
497 .sse2,522 .sse2,
498 }),523 }),
499 };524 };
525 result[@enumToInt(Feature.hreset)] = .{
526 .llvm_name = "hreset",
527 .description = "Has hreset instruction",
528 .dependencies = featureSet(&[_]Feature{}),
529 };
500 result[@enumToInt(Feature.idivl_to_divb)] = .{530 result[@enumToInt(Feature.idivl_to_divb)] = .{
501 .llvm_name = "idivl-to-divb",531 .llvm_name = "idivl-to-divb",
502 .description = "Use 8-bit divide for positive values less than 256",532 .description = "Use 8-bit divide for positive values less than 256",
...@@ -512,6 +542,13 @@ pub const all_features = blk: {...@@ -512,6 +542,13 @@ pub const all_features = blk: {
512 .description = "Invalidate Process-Context Identifier",542 .description = "Invalidate Process-Context Identifier",
513 .dependencies = featureSet(&[_]Feature{}),543 .dependencies = featureSet(&[_]Feature{}),
514 };544 };
545 result[@enumToInt(Feature.kl)] = .{
546 .llvm_name = "kl",
547 .description = "Support Key Locker kl Instructions",
548 .dependencies = featureSet(&[_]Feature{
549 .sse2,
550 }),
551 };
515 result[@enumToInt(Feature.lea_sp)] = .{552 result[@enumToInt(Feature.lea_sp)] = .{
516 .llvm_name = "lea-sp",553 .llvm_name = "lea-sp",
517 .description = "Use LEA for adjusting the stack pointer",554 .description = "Use LEA for adjusting the stack pointer",
...@@ -547,11 +584,6 @@ pub const all_features = blk: {...@@ -547,11 +584,6 @@ pub const all_features = blk: {
547 .description = "Various instructions can be fused with conditional branches",584 .description = "Various instructions can be fused with conditional branches",
548 .dependencies = featureSet(&[_]Feature{}),585 .dependencies = featureSet(&[_]Feature{}),
549 };586 };
550 result[@enumToInt(Feature.merge_to_threeway_branch)] = .{
551 .llvm_name = "merge-to-threeway-branch",
552 .description = "Merge branches to a three-way conditional branch",
553 .dependencies = featureSet(&[_]Feature{}),
554 };
555 result[@enumToInt(Feature.mmx)] = .{587 result[@enumToInt(Feature.mmx)] = .{
556 .llvm_name = "mmx",588 .llvm_name = "mmx",
557 .description = "Enable MMX instructions",589 .description = "Enable MMX instructions",
...@@ -572,11 +604,6 @@ pub const all_features = blk: {...@@ -572,11 +604,6 @@ pub const all_features = blk: {
572 .description = "Support movdiri instruction",604 .description = "Support movdiri instruction",
573 .dependencies = featureSet(&[_]Feature{}),605 .dependencies = featureSet(&[_]Feature{}),
574 };606 };
575 result[@enumToInt(Feature.mpx)] = .{
576 .llvm_name = "mpx",
577 .description = "Deprecated. Support MPX instructions",
578 .dependencies = featureSet(&[_]Feature{}),
579 };
580 result[@enumToInt(Feature.mwaitx)] = .{607 result[@enumToInt(Feature.mwaitx)] = .{
581 .llvm_name = "mwaitx",608 .llvm_name = "mwaitx",
582 .description = "Enable MONITORX/MWAITX timer functionality",609 .description = "Enable MONITORX/MWAITX timer functionality",
...@@ -691,7 +718,7 @@ pub const all_features = blk: {...@@ -691,7 +718,7 @@ pub const all_features = blk: {
691 };718 };
692 result[@enumToInt(Feature.sahf)] = .{719 result[@enumToInt(Feature.sahf)] = .{
693 .llvm_name = "sahf",720 .llvm_name = "sahf",
694 .description = "Support LAHF and SAHF instructions",721 .description = "Support LAHF and SAHF instructions in 64-bit mode",
695 .dependencies = featureSet(&[_]Feature{}),722 .dependencies = featureSet(&[_]Feature{}),
696 };723 };
697 result[@enumToInt(Feature.serialize)] = .{724 result[@enumToInt(Feature.serialize)] = .{
...@@ -778,11 +805,6 @@ pub const all_features = blk: {...@@ -778,11 +805,6 @@ pub const all_features = blk: {
778 .description = "Enable SSE instructions",805 .description = "Enable SSE instructions",
779 .dependencies = featureSet(&[_]Feature{}),806 .dependencies = featureSet(&[_]Feature{}),
780 };807 };
781 result[@enumToInt(Feature.sse_unaligned_mem)] = .{
782 .llvm_name = "sse-unaligned-mem",
783 .description = "Allow unaligned memory operands with SSE instructions",
784 .dependencies = featureSet(&[_]Feature{}),
785 };
786 result[@enumToInt(Feature.sse2)] = .{808 result[@enumToInt(Feature.sse2)] = .{
787 .llvm_name = "sse2",809 .llvm_name = "sse2",
788 .description = "Enable SSE2 instructions",810 .description = "Enable SSE2 instructions",
...@@ -818,6 +840,11 @@ pub const all_features = blk: {...@@ -818,6 +840,11 @@ pub const all_features = blk: {
818 .sse3,840 .sse3,
819 }),841 }),
820 };842 };
843 result[@enumToInt(Feature.sse_unaligned_mem)] = .{
844 .llvm_name = "sse-unaligned-mem",
845 .description = "Allow unaligned memory operands with SSE instructions",
846 .dependencies = featureSet(&[_]Feature{}),
847 };
821 result[@enumToInt(Feature.ssse3)] = .{848 result[@enumToInt(Feature.ssse3)] = .{
822 .llvm_name = "ssse3",849 .llvm_name = "ssse3",
823 .description = "Enable SSSE3 instructions",850 .description = "Enable SSSE3 instructions",
...@@ -835,6 +862,11 @@ pub const all_features = blk: {...@@ -835,6 +862,11 @@ pub const all_features = blk: {
835 .description = "Support TSXLDTRK instructions",862 .description = "Support TSXLDTRK instructions",
836 .dependencies = featureSet(&[_]Feature{}),863 .dependencies = featureSet(&[_]Feature{}),
837 };864 };
865 result[@enumToInt(Feature.uintr)] = .{
866 .llvm_name = "uintr",
867 .description = "Has UINTR Instructions",
868 .dependencies = featureSet(&[_]Feature{}),
869 };
838 result[@enumToInt(Feature.use_aa)] = .{870 result[@enumToInt(Feature.use_aa)] = .{
839 .llvm_name = "use-aa",871 .llvm_name = "use-aa",
840 .description = "Use alias analysis during codegen",872 .description = "Use alias analysis during codegen",
...@@ -876,6 +908,13 @@ pub const all_features = blk: {...@@ -876,6 +908,13 @@ pub const all_features = blk: {
876 .description = "Write Back No Invalidate",908 .description = "Write Back No Invalidate",
877 .dependencies = featureSet(&[_]Feature{}),909 .dependencies = featureSet(&[_]Feature{}),
878 };910 };
911 result[@enumToInt(Feature.widekl)] = .{
912 .llvm_name = "widekl",
913 .description = "Support Key Locker wide Instructions",
914 .dependencies = featureSet(&[_]Feature{
915 .kl,
916 }),
917 };
879 result[@enumToInt(Feature.x87)] = .{918 result[@enumToInt(Feature.x87)] = .{
880 .llvm_name = "x87",919 .llvm_name = "x87",
881 .description = "Enable X87 float instructions",920 .description = "Enable X87 float instructions",
...@@ -923,6 +962,97 @@ pub const all_features = blk: {...@@ -923,6 +962,97 @@ pub const all_features = blk: {
923};962};
924963
925pub const cpu = struct {964pub const cpu = struct {
965 pub const _i386 = CpuModel{
966 .name = "_i386",
967 .llvm_name = "i386",
968 .features = featureSet(&[_]Feature{
969 .slow_unaligned_mem_16,
970 .vzeroupper,
971 .x87,
972 }),
973 };
974 pub const _i486 = CpuModel{
975 .name = "_i486",
976 .llvm_name = "i486",
977 .features = featureSet(&[_]Feature{
978 .slow_unaligned_mem_16,
979 .vzeroupper,
980 .x87,
981 }),
982 };
983 pub const _i586 = CpuModel{
984 .name = "_i586",
985 .llvm_name = "i586",
986 .features = featureSet(&[_]Feature{
987 .cx8,
988 .slow_unaligned_mem_16,
989 .vzeroupper,
990 .x87,
991 }),
992 };
993 pub const _i686 = CpuModel{
994 .name = "_i686",
995 .llvm_name = "i686",
996 .features = featureSet(&[_]Feature{
997 .cmov,
998 .cx8,
999 .slow_unaligned_mem_16,
1000 .vzeroupper,
1001 .x87,
1002 }),
1003 };
1004 pub const alderlake = CpuModel{
1005 .name = "alderlake",
1006 .llvm_name = "alderlake",
1007 .features = featureSet(&[_]Feature{
1008 .@"64bit",
1009 .adx,
1010 .aes,
1011 .avxvnni,
1012 .bmi,
1013 .bmi2,
1014 .cldemote,
1015 .clflushopt,
1016 .cmov,
1017 .cx16,
1018 .ermsb,
1019 .f16c,
1020 .false_deps_popcnt,
1021 .fast_15bytenop,
1022 .fast_gather,
1023 .fast_scalar_fsqrt,
1024 .fast_shld_rotate,
1025 .fast_variable_shuffle,
1026 .fast_vector_fsqrt,
1027 .fma,
1028 .fsgsbase,
1029 .fxsr,
1030 .hreset,
1031 .idivq_to_divl,
1032 .invpcid,
1033 .lzcnt,
1034 .macrofusion,
1035 .mmx,
1036 .movbe,
1037 .nopl,
1038 .pclmul,
1039 .popcnt,
1040 .prfchw,
1041 .ptwrite,
1042 .rdrnd,
1043 .rdseed,
1044 .sahf,
1045 .serialize,
1046 .sgx,
1047 .slow_3ops_lea,
1048 .vzeroupper,
1049 .waitpkg,
1050 .x87,
1051 .xsavec,
1052 .xsaveopt,
1053 .xsaves,
1054 }),
1055 };
926 pub const amdfam10 = CpuModel{1056 pub const amdfam10 = CpuModel{
927 .name = "amdfam10",1057 .name = "amdfam10",
928 .llvm_name = "amdfam10",1058 .llvm_name = "amdfam10",
...@@ -931,7 +1061,6 @@ pub const cpu = struct {...@@ -931,7 +1061,6 @@ pub const cpu = struct {
931 .@"64bit",1061 .@"64bit",
932 .cmov,1062 .cmov,
933 .cx16,1063 .cx16,
934 .cx8,
935 .fast_scalar_shift_masks,1064 .fast_scalar_shift_masks,
936 .fxsr,1065 .fxsr,
937 .lzcnt,1066 .lzcnt,
...@@ -959,43 +1088,45 @@ pub const cpu = struct {...@@ -959,43 +1088,45 @@ pub const cpu = struct {
959 .x87,1088 .x87,
960 }),1089 }),
961 };1090 };
962 pub const athlon_4 = CpuModel{1091 pub const athlon64 = CpuModel{
963 .name = "athlon_4",1092 .name = "athlon64",
964 .llvm_name = "athlon-4",1093 .llvm_name = "athlon64",
965 .features = featureSet(&[_]Feature{1094 .features = featureSet(&[_]Feature{
966 .@"3dnowa",1095 .@"3dnowa",
1096 .@"64bit",
967 .cmov,1097 .cmov,
968 .cx8,1098 .cx8,
1099 .fast_scalar_shift_masks,
969 .fxsr,1100 .fxsr,
970 .nopl,1101 .nopl,
971 .slow_shld,1102 .slow_shld,
972 .slow_unaligned_mem_16,1103 .slow_unaligned_mem_16,
973 .sse,1104 .sse2,
974 .vzeroupper,1105 .vzeroupper,
975 .x87,1106 .x87,
976 }),1107 }),
977 };1108 };
978 pub const athlon_fx = CpuModel{1109 pub const athlon64_sse3 = CpuModel{
979 .name = "athlon_fx",1110 .name = "athlon64_sse3",
980 .llvm_name = "athlon-fx",1111 .llvm_name = "athlon64-sse3",
981 .features = featureSet(&[_]Feature{1112 .features = featureSet(&[_]Feature{
982 .@"3dnowa",1113 .@"3dnowa",
983 .@"64bit",1114 .@"64bit",
984 .cmov,1115 .cmov,
985 .cx8,1116 .cx16,
986 .fast_scalar_shift_masks,1117 .fast_scalar_shift_masks,
987 .fxsr,1118 .fxsr,
988 .nopl,1119 .nopl,
989 .slow_shld,1120 .slow_shld,
990 .slow_unaligned_mem_16,1121 .slow_unaligned_mem_16,
991 .sse2,1122 .sse3,
992 .vzeroupper,1123 .vzeroupper,
993 .x87,1124 .x87,
994 }),1125 }),
995 };1126 };
996 pub const athlon_mp = CpuModel{1127 pub const athlon_4 = CpuModel{
997 .name = "athlon_mp",1128 .name = "athlon_4",
998 .llvm_name = "athlon-mp",1129 .llvm_name = "athlon-4",
999 .features = featureSet(&[_]Feature{1130 .features = featureSet(&[_]Feature{
1000 .@"3dnowa",1131 .@"3dnowa",
1001 .cmov,1132 .cmov,
...@@ -1009,23 +1140,27 @@ pub const cpu = struct {...@@ -1009,23 +1140,27 @@ pub const cpu = struct {
1009 .x87,1140 .x87,
1010 }),1141 }),
1011 };1142 };
1012 pub const athlon_tbird = CpuModel{1143 pub const athlon_fx = CpuModel{
1013 .name = "athlon_tbird",1144 .name = "athlon_fx",
1014 .llvm_name = "athlon-tbird",1145 .llvm_name = "athlon-fx",
1015 .features = featureSet(&[_]Feature{1146 .features = featureSet(&[_]Feature{
1016 .@"3dnowa",1147 .@"3dnowa",
1148 .@"64bit",
1017 .cmov,1149 .cmov,
1018 .cx8,1150 .cx8,
1151 .fast_scalar_shift_masks,
1152 .fxsr,
1019 .nopl,1153 .nopl,
1020 .slow_shld,1154 .slow_shld,
1021 .slow_unaligned_mem_16,1155 .slow_unaligned_mem_16,
1156 .sse2,
1022 .vzeroupper,1157 .vzeroupper,
1023 .x87,1158 .x87,
1024 }),1159 }),
1025 };1160 };
1026 pub const athlon_xp = CpuModel{1161 pub const athlon_mp = CpuModel{
1027 .name = "athlon_xp",1162 .name = "athlon_mp",
1028 .llvm_name = "athlon-xp",1163 .llvm_name = "athlon-mp",
1029 .features = featureSet(&[_]Feature{1164 .features = featureSet(&[_]Feature{
1030 .@"3dnowa",1165 .@"3dnowa",
1031 .cmov,1166 .cmov,
...@@ -1039,39 +1174,32 @@ pub const cpu = struct {...@@ -1039,39 +1174,32 @@ pub const cpu = struct {
1039 .x87,1174 .x87,
1040 }),1175 }),
1041 };1176 };
1042 pub const athlon64 = CpuModel{1177 pub const athlon_tbird = CpuModel{
1043 .name = "athlon64",1178 .name = "athlon_tbird",
1044 .llvm_name = "athlon64",1179 .llvm_name = "athlon-tbird",
1045 .features = featureSet(&[_]Feature{1180 .features = featureSet(&[_]Feature{
1046 .@"3dnowa",1181 .@"3dnowa",
1047 .@"64bit",
1048 .cmov,1182 .cmov,
1049 .cx8,1183 .cx8,
1050 .fast_scalar_shift_masks,
1051 .fxsr,
1052 .nopl,1184 .nopl,
1053 .slow_shld,1185 .slow_shld,
1054 .slow_unaligned_mem_16,1186 .slow_unaligned_mem_16,
1055 .sse2,
1056 .vzeroupper,1187 .vzeroupper,
1057 .x87,1188 .x87,
1058 }),1189 }),
1059 };1190 };
1060 pub const athlon64_sse3 = CpuModel{1191 pub const athlon_xp = CpuModel{
1061 .name = "athlon64_sse3",1192 .name = "athlon_xp",
1062 .llvm_name = "athlon64-sse3",1193 .llvm_name = "athlon-xp",
1063 .features = featureSet(&[_]Feature{1194 .features = featureSet(&[_]Feature{
1064 .@"3dnowa",1195 .@"3dnowa",
1065 .@"64bit",
1066 .cmov,1196 .cmov,
1067 .cx16,
1068 .cx8,1197 .cx8,
1069 .fast_scalar_shift_masks,
1070 .fxsr,1198 .fxsr,
1071 .nopl,1199 .nopl,
1072 .slow_shld,1200 .slow_shld,
1073 .slow_unaligned_mem_16,1201 .slow_unaligned_mem_16,
1074 .sse3,1202 .sse,
1075 .vzeroupper,1203 .vzeroupper,
1076 .x87,1204 .x87,
1077 }),1205 }),
...@@ -1083,7 +1211,6 @@ pub const cpu = struct {...@@ -1083,7 +1211,6 @@ pub const cpu = struct {
1083 .@"64bit",1211 .@"64bit",
1084 .cmov,1212 .cmov,
1085 .cx16,1213 .cx16,
1086 .cx8,
1087 .fxsr,1214 .fxsr,
1088 .idivl_to_divb,1215 .idivl_to_divb,
1089 .idivq_to_divl,1216 .idivq_to_divl,
...@@ -1109,7 +1236,6 @@ pub const cpu = struct {...@@ -1109,7 +1236,6 @@ pub const cpu = struct {
1109 .@"64bit",1236 .@"64bit",
1110 .cmov,1237 .cmov,
1111 .cx16,1238 .cx16,
1112 .cx8,
1113 .fast_scalar_shift_masks,1239 .fast_scalar_shift_masks,
1114 .fxsr,1240 .fxsr,
1115 .lzcnt,1241 .lzcnt,
...@@ -1132,7 +1258,6 @@ pub const cpu = struct {...@@ -1132,7 +1258,6 @@ pub const cpu = struct {
1132 .branchfusion,1258 .branchfusion,
1133 .cmov,1259 .cmov,
1134 .cx16,1260 .cx16,
1135 .cx8,
1136 .fast_11bytenop,1261 .fast_11bytenop,
1137 .fast_scalar_shift_masks,1262 .fast_scalar_shift_masks,
1138 .fxsr,1263 .fxsr,
...@@ -1161,7 +1286,6 @@ pub const cpu = struct {...@@ -1161,7 +1286,6 @@ pub const cpu = struct {
1161 .branchfusion,1286 .branchfusion,
1162 .cmov,1287 .cmov,
1163 .cx16,1288 .cx16,
1164 .cx8,
1165 .f16c,1289 .f16c,
1166 .fast_11bytenop,1290 .fast_11bytenop,
1167 .fast_bextr,1291 .fast_bextr,
...@@ -1194,7 +1318,6 @@ pub const cpu = struct {...@@ -1194,7 +1318,6 @@ pub const cpu = struct {
1194 .branchfusion,1318 .branchfusion,
1195 .cmov,1319 .cmov,
1196 .cx16,1320 .cx16,
1197 .cx8,
1198 .f16c,1321 .f16c,
1199 .fast_11bytenop,1322 .fast_11bytenop,
1200 .fast_bextr,1323 .fast_bextr,
...@@ -1215,7 +1338,6 @@ pub const cpu = struct {...@@ -1215,7 +1338,6 @@ pub const cpu = struct {
1215 .vzeroupper,1338 .vzeroupper,
1216 .x87,1339 .x87,
1217 .xop,1340 .xop,
1218 .xsave,
1219 .xsaveopt,1341 .xsaveopt,
1220 }),1342 }),
1221 };1343 };
...@@ -1231,7 +1353,6 @@ pub const cpu = struct {...@@ -1231,7 +1353,6 @@ pub const cpu = struct {
1231 .branchfusion,1353 .branchfusion,
1232 .cmov,1354 .cmov,
1233 .cx16,1355 .cx16,
1234 .cx8,
1235 .f16c,1356 .f16c,
1236 .fast_11bytenop,1357 .fast_11bytenop,
1237 .fast_bextr,1358 .fast_bextr,
...@@ -1255,7 +1376,6 @@ pub const cpu = struct {...@@ -1255,7 +1376,6 @@ pub const cpu = struct {
1255 .vzeroupper,1376 .vzeroupper,
1256 .x87,1377 .x87,
1257 .xop,1378 .xop,
1258 .xsave,
1259 .xsaveopt,1379 .xsaveopt,
1260 }),1380 }),
1261 };1381 };
...@@ -1266,7 +1386,6 @@ pub const cpu = struct {...@@ -1266,7 +1386,6 @@ pub const cpu = struct {
1266 .@"64bit",1386 .@"64bit",
1267 .cmov,1387 .cmov,
1268 .cx16,1388 .cx16,
1269 .cx8,
1270 .fxsr,1389 .fxsr,
1271 .idivl_to_divb,1390 .idivl_to_divb,
1272 .idivq_to_divl,1391 .idivq_to_divl,
...@@ -1290,13 +1409,11 @@ pub const cpu = struct {...@@ -1290,13 +1409,11 @@ pub const cpu = struct {
1290 .features = featureSet(&[_]Feature{1409 .features = featureSet(&[_]Feature{
1291 .@"64bit",1410 .@"64bit",
1292 .adx,1411 .adx,
1293 .avx,
1294 .avx2,1412 .avx2,
1295 .bmi,1413 .bmi,
1296 .bmi2,1414 .bmi2,
1297 .cmov,1415 .cmov,
1298 .cx16,1416 .cx16,
1299 .cx8,
1300 .ermsb,1417 .ermsb,
1301 .f16c,1418 .f16c,
1302 .false_deps_lzcnt_tzcnt,1419 .false_deps_lzcnt_tzcnt,
...@@ -1312,7 +1429,6 @@ pub const cpu = struct {...@@ -1312,7 +1429,6 @@ pub const cpu = struct {
1312 .invpcid,1429 .invpcid,
1313 .lzcnt,1430 .lzcnt,
1314 .macrofusion,1431 .macrofusion,
1315 .merge_to_threeway_branch,
1316 .mmx,1432 .mmx,
1317 .movbe,1433 .movbe,
1318 .nopl,1434 .nopl,
...@@ -1323,10 +1439,8 @@ pub const cpu = struct {...@@ -1323,10 +1439,8 @@ pub const cpu = struct {
1323 .rdseed,1439 .rdseed,
1324 .sahf,1440 .sahf,
1325 .slow_3ops_lea,1441 .slow_3ops_lea,
1326 .sse4_2,
1327 .vzeroupper,1442 .vzeroupper,
1328 .x87,1443 .x87,
1329 .xsave,
1330 .xsaveopt,1444 .xsaveopt,
1331 }),1445 }),
1332 };1446 };
...@@ -1337,7 +1451,6 @@ pub const cpu = struct {...@@ -1337,7 +1451,6 @@ pub const cpu = struct {
1337 .@"64bit",1451 .@"64bit",
1338 .cmov,1452 .cmov,
1339 .cx16,1453 .cx16,
1340 .cx8,
1341 .fast_15bytenop,1454 .fast_15bytenop,
1342 .fast_scalar_shift_masks,1455 .fast_scalar_shift_masks,
1343 .fast_vector_shift_masks,1456 .fast_vector_shift_masks,
...@@ -1361,11 +1474,9 @@ pub const cpu = struct {...@@ -1361,11 +1474,9 @@ pub const cpu = struct {
1361 .features = featureSet(&[_]Feature{1474 .features = featureSet(&[_]Feature{
1362 .@"64bit",1475 .@"64bit",
1363 .aes,1476 .aes,
1364 .avx,
1365 .bmi,1477 .bmi,
1366 .cmov,1478 .cmov,
1367 .cx16,1479 .cx16,
1368 .cx8,
1369 .f16c,1480 .f16c,
1370 .fast_15bytenop,1481 .fast_15bytenop,
1371 .fast_bextr,1482 .fast_bextr,
...@@ -1384,9 +1495,7 @@ pub const cpu = struct {...@@ -1384,9 +1495,7 @@ pub const cpu = struct {
1384 .sahf,1495 .sahf,
1385 .slow_shld,1496 .slow_shld,
1386 .sse4a,1497 .sse4a,
1387 .ssse3,
1388 .x87,1498 .x87,
1389 .xsave,
1390 .xsaveopt,1499 .xsaveopt,
1391 }),1500 }),
1392 };1501 };
...@@ -1421,12 +1530,8 @@ pub const cpu = struct {...@@ -1421,12 +1530,8 @@ pub const cpu = struct {
1421 .@"64bit",1530 .@"64bit",
1422 .adx,1531 .adx,
1423 .aes,1532 .aes,
1424 .avx,
1425 .avx2,
1426 .avx512bw,
1427 .avx512cd,1533 .avx512cd,
1428 .avx512dq,1534 .avx512dq,
1429 .avx512f,
1430 .avx512ifma,1535 .avx512ifma,
1431 .avx512vbmi,1536 .avx512vbmi,
1432 .avx512vl,1537 .avx512vl,
...@@ -1435,23 +1540,19 @@ pub const cpu = struct {...@@ -1435,23 +1540,19 @@ pub const cpu = struct {
1435 .clflushopt,1540 .clflushopt,
1436 .cmov,1541 .cmov,
1437 .cx16,1542 .cx16,
1438 .cx8,
1439 .ermsb,1543 .ermsb,
1440 .f16c,
1441 .fast_15bytenop,1544 .fast_15bytenop,
1442 .fast_gather,1545 .fast_gather,
1443 .fast_scalar_fsqrt,1546 .fast_scalar_fsqrt,
1444 .fast_shld_rotate,1547 .fast_shld_rotate,
1445 .fast_variable_shuffle,1548 .fast_variable_shuffle,
1446 .fast_vector_fsqrt,1549 .fast_vector_fsqrt,
1447 .fma,
1448 .fsgsbase,1550 .fsgsbase,
1449 .fxsr,1551 .fxsr,
1450 .idivq_to_divl,1552 .idivq_to_divl,
1451 .invpcid,1553 .invpcid,
1452 .lzcnt,1554 .lzcnt,
1453 .macrofusion,1555 .macrofusion,
1454 .merge_to_threeway_branch,
1455 .mmx,1556 .mmx,
1456 .movbe,1557 .movbe,
1457 .nopl,1558 .nopl,
...@@ -1466,10 +1567,8 @@ pub const cpu = struct {...@@ -1466,10 +1567,8 @@ pub const cpu = struct {
1466 .sgx,1567 .sgx,
1467 .sha,1568 .sha,
1468 .slow_3ops_lea,1569 .slow_3ops_lea,
1469 .sse4_2,
1470 .vzeroupper,1570 .vzeroupper,
1471 .x87,1571 .x87,
1472 .xsave,
1473 .xsavec,1572 .xsavec,
1474 .xsaveopt,1573 .xsaveopt,
1475 .xsaves,1574 .xsaves,
...@@ -1482,12 +1581,9 @@ pub const cpu = struct {...@@ -1482,12 +1581,9 @@ pub const cpu = struct {
1482 .@"64bit",1581 .@"64bit",
1483 .adx,1582 .adx,
1484 .aes,1583 .aes,
1485 .avx,
1486 .avx2,
1487 .avx512bw,1584 .avx512bw,
1488 .avx512cd,1585 .avx512cd,
1489 .avx512dq,1586 .avx512dq,
1490 .avx512f,
1491 .avx512vl,1587 .avx512vl,
1492 .avx512vnni,1588 .avx512vnni,
1493 .bmi,1589 .bmi,
...@@ -1496,9 +1592,7 @@ pub const cpu = struct {...@@ -1496,9 +1592,7 @@ pub const cpu = struct {
1496 .clwb,1592 .clwb,
1497 .cmov,1593 .cmov,
1498 .cx16,1594 .cx16,
1499 .cx8,
1500 .ermsb,1595 .ermsb,
1501 .f16c,
1502 .false_deps_popcnt,1596 .false_deps_popcnt,
1503 .fast_15bytenop,1597 .fast_15bytenop,
1504 .fast_gather,1598 .fast_gather,
...@@ -1506,14 +1600,12 @@ pub const cpu = struct {...@@ -1506,14 +1600,12 @@ pub const cpu = struct {
1506 .fast_shld_rotate,1600 .fast_shld_rotate,
1507 .fast_variable_shuffle,1601 .fast_variable_shuffle,
1508 .fast_vector_fsqrt,1602 .fast_vector_fsqrt,
1509 .fma,
1510 .fsgsbase,1603 .fsgsbase,
1511 .fxsr,1604 .fxsr,
1512 .idivq_to_divl,1605 .idivq_to_divl,
1513 .invpcid,1606 .invpcid,
1514 .lzcnt,1607 .lzcnt,
1515 .macrofusion,1608 .macrofusion,
1516 .merge_to_threeway_branch,
1517 .mmx,1609 .mmx,
1518 .movbe,1610 .movbe,
1519 .nopl,1611 .nopl,
...@@ -1526,10 +1618,8 @@ pub const cpu = struct {...@@ -1526,10 +1618,8 @@ pub const cpu = struct {
1526 .rdseed,1618 .rdseed,
1527 .sahf,1619 .sahf,
1528 .slow_3ops_lea,1620 .slow_3ops_lea,
1529 .sse4_2,
1530 .vzeroupper,1621 .vzeroupper,
1531 .x87,1622 .x87,
1532 .xsave,
1533 .xsavec,1623 .xsavec,
1534 .xsaveopt,1624 .xsaveopt,
1535 .xsaves,1625 .xsaves,
...@@ -1542,13 +1632,9 @@ pub const cpu = struct {...@@ -1542,13 +1632,9 @@ pub const cpu = struct {
1542 .@"64bit",1632 .@"64bit",
1543 .adx,1633 .adx,
1544 .aes,1634 .aes,
1545 .avx,
1546 .avx2,
1547 .avx512bf16,1635 .avx512bf16,
1548 .avx512bw,
1549 .avx512cd,1636 .avx512cd,
1550 .avx512dq,1637 .avx512dq,
1551 .avx512f,
1552 .avx512vl,1638 .avx512vl,
1553 .avx512vnni,1639 .avx512vnni,
1554 .bmi,1640 .bmi,
...@@ -1557,9 +1643,7 @@ pub const cpu = struct {...@@ -1557,9 +1643,7 @@ pub const cpu = struct {
1557 .clwb,1643 .clwb,
1558 .cmov,1644 .cmov,
1559 .cx16,1645 .cx16,
1560 .cx8,
1561 .ermsb,1646 .ermsb,
1562 .f16c,
1563 .false_deps_popcnt,1647 .false_deps_popcnt,
1564 .fast_15bytenop,1648 .fast_15bytenop,
1565 .fast_gather,1649 .fast_gather,
...@@ -1567,14 +1651,12 @@ pub const cpu = struct {...@@ -1567,14 +1651,12 @@ pub const cpu = struct {
1567 .fast_shld_rotate,1651 .fast_shld_rotate,
1568 .fast_variable_shuffle,1652 .fast_variable_shuffle,
1569 .fast_vector_fsqrt,1653 .fast_vector_fsqrt,
1570 .fma,
1571 .fsgsbase,1654 .fsgsbase,
1572 .fxsr,1655 .fxsr,
1573 .idivq_to_divl,1656 .idivq_to_divl,
1574 .invpcid,1657 .invpcid,
1575 .lzcnt,1658 .lzcnt,
1576 .macrofusion,1659 .macrofusion,
1577 .merge_to_threeway_branch,
1578 .mmx,1660 .mmx,
1579 .movbe,1661 .movbe,
1580 .nopl,1662 .nopl,
...@@ -1587,47 +1669,29 @@ pub const cpu = struct {...@@ -1587,47 +1669,29 @@ pub const cpu = struct {
1587 .rdseed,1669 .rdseed,
1588 .sahf,1670 .sahf,
1589 .slow_3ops_lea,1671 .slow_3ops_lea,
1590 .sse4_2,
1591 .vzeroupper,1672 .vzeroupper,
1592 .x87,1673 .x87,
1593 .xsave,
1594 .xsavec,1674 .xsavec,
1595 .xsaveopt,1675 .xsaveopt,
1596 .xsaves,1676 .xsaves,
1597 }),1677 }),
1598 };1678 };
1599 pub const core_avx_i = CpuModel{1679 pub const core2 = CpuModel{
1600 .name = "core_avx_i",1680 .name = "core2",
1601 .llvm_name = "core-avx-i",1681 .llvm_name = "core2",
1602 .features = featureSet(&[_]Feature{1682 .features = featureSet(&[_]Feature{
1603 .@"64bit",1683 .@"64bit",
1604 .avx,
1605 .cmov,1684 .cmov,
1606 .cx16,1685 .cx16,
1607 .cx8,
1608 .f16c,
1609 .false_deps_popcnt,
1610 .fast_15bytenop,
1611 .fast_scalar_fsqrt,
1612 .fast_shld_rotate,
1613 .fsgsbase,
1614 .fxsr,1686 .fxsr,
1615 .idivq_to_divl,
1616 .macrofusion,1687 .macrofusion,
1617 .merge_to_threeway_branch,
1618 .mmx,1688 .mmx,
1619 .nopl,1689 .nopl,
1620 .pclmul,
1621 .popcnt,
1622 .rdrnd,
1623 .sahf,1690 .sahf,
1624 .slow_3ops_lea,1691 .slow_unaligned_mem_16,
1625 .slow_unaligned_mem_32,1692 .ssse3,
1626 .sse4_2,
1627 .vzeroupper,1693 .vzeroupper,
1628 .x87,1694 .x87,
1629 .xsave,
1630 .xsaveopt,
1631 }),1695 }),
1632 };1696 };
1633 pub const core_avx2 = CpuModel{1697 pub const core_avx2 = CpuModel{
...@@ -1635,13 +1699,11 @@ pub const cpu = struct {...@@ -1635,13 +1699,11 @@ pub const cpu = struct {
1635 .llvm_name = "core-avx2",1699 .llvm_name = "core-avx2",
1636 .features = featureSet(&[_]Feature{1700 .features = featureSet(&[_]Feature{
1637 .@"64bit",1701 .@"64bit",
1638 .avx,
1639 .avx2,1702 .avx2,
1640 .bmi,1703 .bmi,
1641 .bmi2,1704 .bmi2,
1642 .cmov,1705 .cmov,
1643 .cx16,1706 .cx16,
1644 .cx8,
1645 .ermsb,1707 .ermsb,
1646 .f16c,1708 .f16c,
1647 .false_deps_lzcnt_tzcnt,1709 .false_deps_lzcnt_tzcnt,
...@@ -1657,7 +1719,6 @@ pub const cpu = struct {...@@ -1657,7 +1719,6 @@ pub const cpu = struct {
1657 .invpcid,1719 .invpcid,
1658 .lzcnt,1720 .lzcnt,
1659 .macrofusion,1721 .macrofusion,
1660 .merge_to_threeway_branch,
1661 .mmx,1722 .mmx,
1662 .movbe,1723 .movbe,
1663 .nopl,1724 .nopl,
...@@ -1666,30 +1727,38 @@ pub const cpu = struct {...@@ -1666,30 +1727,38 @@ pub const cpu = struct {
1666 .rdrnd,1727 .rdrnd,
1667 .sahf,1728 .sahf,
1668 .slow_3ops_lea,1729 .slow_3ops_lea,
1669 .sse4_2,
1670 .vzeroupper,1730 .vzeroupper,
1671 .x87,1731 .x87,
1672 .xsave,
1673 .xsaveopt,1732 .xsaveopt,
1674 }),1733 }),
1675 };1734 };
1676 pub const core2 = CpuModel{1735 pub const core_avx_i = CpuModel{
1677 .name = "core2",1736 .name = "core_avx_i",
1678 .llvm_name = "core2",1737 .llvm_name = "core-avx-i",
1679 .features = featureSet(&[_]Feature{1738 .features = featureSet(&[_]Feature{
1680 .@"64bit",1739 .@"64bit",
1681 .cmov,1740 .cmov,
1682 .cx16,1741 .cx16,
1683 .cx8,1742 .f16c,
1743 .false_deps_popcnt,
1744 .fast_15bytenop,
1745 .fast_scalar_fsqrt,
1746 .fast_shld_rotate,
1747 .fsgsbase,
1684 .fxsr,1748 .fxsr,
1749 .idivq_to_divl,
1685 .macrofusion,1750 .macrofusion,
1686 .mmx,1751 .mmx,
1687 .nopl,1752 .nopl,
1753 .pclmul,
1754 .popcnt,
1755 .rdrnd,
1688 .sahf,1756 .sahf,
1689 .slow_unaligned_mem_16,1757 .slow_3ops_lea,
1690 .ssse3,1758 .slow_unaligned_mem_32,
1691 .vzeroupper,1759 .vzeroupper,
1692 .x87,1760 .x87,
1761 .xsaveopt,
1693 }),1762 }),
1694 };1763 };
1695 pub const corei7 = CpuModel{1764 pub const corei7 = CpuModel{
...@@ -1699,7 +1768,6 @@ pub const cpu = struct {...@@ -1699,7 +1768,6 @@ pub const cpu = struct {
1699 .@"64bit",1768 .@"64bit",
1700 .cmov,1769 .cmov,
1701 .cx16,1770 .cx16,
1702 .cx8,
1703 .fxsr,1771 .fxsr,
1704 .macrofusion,1772 .macrofusion,
1705 .mmx,1773 .mmx,
...@@ -1719,7 +1787,6 @@ pub const cpu = struct {...@@ -1719,7 +1787,6 @@ pub const cpu = struct {
1719 .avx,1787 .avx,
1720 .cmov,1788 .cmov,
1721 .cx16,1789 .cx16,
1722 .cx8,
1723 .false_deps_popcnt,1790 .false_deps_popcnt,
1724 .fast_15bytenop,1791 .fast_15bytenop,
1725 .fast_scalar_fsqrt,1792 .fast_scalar_fsqrt,
...@@ -1727,7 +1794,6 @@ pub const cpu = struct {...@@ -1727,7 +1794,6 @@ pub const cpu = struct {
1727 .fxsr,1794 .fxsr,
1728 .idivq_to_divl,1795 .idivq_to_divl,
1729 .macrofusion,1796 .macrofusion,
1730 .merge_to_threeway_branch,
1731 .mmx,1797 .mmx,
1732 .nopl,1798 .nopl,
1733 .pclmul,1799 .pclmul,
...@@ -1735,10 +1801,8 @@ pub const cpu = struct {...@@ -1735,10 +1801,8 @@ pub const cpu = struct {
1735 .sahf,1801 .sahf,
1736 .slow_3ops_lea,1802 .slow_3ops_lea,
1737 .slow_unaligned_mem_32,1803 .slow_unaligned_mem_32,
1738 .sse4_2,
1739 .vzeroupper,1804 .vzeroupper,
1740 .x87,1805 .x87,
1741 .xsave,
1742 .xsaveopt,1806 .xsaveopt,
1743 }),1807 }),
1744 };1808 };
...@@ -1746,8 +1810,12 @@ pub const cpu = struct {...@@ -1746,8 +1810,12 @@ pub const cpu = struct {
1746 .name = "generic",1810 .name = "generic",
1747 .llvm_name = "generic",1811 .llvm_name = "generic",
1748 .features = featureSet(&[_]Feature{1812 .features = featureSet(&[_]Feature{
1813 .@"64bit",
1749 .cx8,1814 .cx8,
1750 .slow_unaligned_mem_16,1815 .idivq_to_divl,
1816 .macrofusion,
1817 .slow_3ops_lea,
1818 .slow_incdec,
1751 .vzeroupper,1819 .vzeroupper,
1752 .x87,1820 .x87,
1753 }),1821 }),
...@@ -1772,7 +1840,6 @@ pub const cpu = struct {...@@ -1772,7 +1840,6 @@ pub const cpu = struct {
1772 .clflushopt,1840 .clflushopt,
1773 .cmov,1841 .cmov,
1774 .cx16,1842 .cx16,
1775 .cx8,
1776 .false_deps_popcnt,1843 .false_deps_popcnt,
1777 .fsgsbase,1844 .fsgsbase,
1778 .fxsr,1845 .fxsr,
...@@ -1790,11 +1857,9 @@ pub const cpu = struct {...@@ -1790,11 +1857,9 @@ pub const cpu = struct {
1790 .slow_lea,1857 .slow_lea,
1791 .slow_two_mem_ops,1858 .slow_two_mem_ops,
1792 .sse4_2,1859 .sse4_2,
1793 .ssse3,
1794 .use_glm_div_sqrt_costs,1860 .use_glm_div_sqrt_costs,
1795 .vzeroupper,1861 .vzeroupper,
1796 .x87,1862 .x87,
1797 .xsave,
1798 .xsavec,1863 .xsavec,
1799 .xsaveopt,1864 .xsaveopt,
1800 .xsaves,1865 .xsaves,
...@@ -1809,7 +1874,6 @@ pub const cpu = struct {...@@ -1809,7 +1874,6 @@ pub const cpu = struct {
1809 .clflushopt,1874 .clflushopt,
1810 .cmov,1875 .cmov,
1811 .cx16,1876 .cx16,
1812 .cx8,
1813 .fsgsbase,1877 .fsgsbase,
1814 .fxsr,1878 .fxsr,
1815 .mmx,1879 .mmx,
...@@ -1829,11 +1893,9 @@ pub const cpu = struct {...@@ -1829,11 +1893,9 @@ pub const cpu = struct {
1829 .slow_lea,1893 .slow_lea,
1830 .slow_two_mem_ops,1894 .slow_two_mem_ops,
1831 .sse4_2,1895 .sse4_2,
1832 .ssse3,
1833 .use_glm_div_sqrt_costs,1896 .use_glm_div_sqrt_costs,
1834 .vzeroupper,1897 .vzeroupper,
1835 .x87,1898 .x87,
1836 .xsave,
1837 .xsavec,1899 .xsavec,
1838 .xsaveopt,1900 .xsaveopt,
1839 .xsaves,1901 .xsaves,
...@@ -1844,13 +1906,11 @@ pub const cpu = struct {...@@ -1844,13 +1906,11 @@ pub const cpu = struct {
1844 .llvm_name = "haswell",1906 .llvm_name = "haswell",
1845 .features = featureSet(&[_]Feature{1907 .features = featureSet(&[_]Feature{
1846 .@"64bit",1908 .@"64bit",
1847 .avx,
1848 .avx2,1909 .avx2,
1849 .bmi,1910 .bmi,
1850 .bmi2,1911 .bmi2,
1851 .cmov,1912 .cmov,
1852 .cx16,1913 .cx16,
1853 .cx8,
1854 .ermsb,1914 .ermsb,
1855 .f16c,1915 .f16c,
1856 .false_deps_lzcnt_tzcnt,1916 .false_deps_lzcnt_tzcnt,
...@@ -1866,7 +1926,6 @@ pub const cpu = struct {...@@ -1866,7 +1926,6 @@ pub const cpu = struct {
1866 .invpcid,1926 .invpcid,
1867 .lzcnt,1927 .lzcnt,
1868 .macrofusion,1928 .macrofusion,
1869 .merge_to_threeway_branch,
1870 .mmx,1929 .mmx,
1871 .movbe,1930 .movbe,
1872 .nopl,1931 .nopl,
...@@ -1875,66 +1934,20 @@ pub const cpu = struct {...@@ -1875,66 +1934,20 @@ pub const cpu = struct {
1875 .rdrnd,1934 .rdrnd,
1876 .sahf,1935 .sahf,
1877 .slow_3ops_lea,1936 .slow_3ops_lea,
1878 .sse4_2,
1879 .vzeroupper,1937 .vzeroupper,
1880 .x87,1938 .x87,
1881 .xsave,
1882 .xsaveopt,1939 .xsaveopt,
1883 }),1940 }),
1884 };1941 };
1885 pub const _i386 = CpuModel{
1886 .name = "_i386",
1887 .llvm_name = "i386",
1888 .features = featureSet(&[_]Feature{
1889 .slow_unaligned_mem_16,
1890 .vzeroupper,
1891 .x87,
1892 }),
1893 };
1894 pub const _i486 = CpuModel{
1895 .name = "_i486",
1896 .llvm_name = "i486",
1897 .features = featureSet(&[_]Feature{
1898 .slow_unaligned_mem_16,
1899 .vzeroupper,
1900 .x87,
1901 }),
1902 };
1903 pub const _i586 = CpuModel{
1904 .name = "_i586",
1905 .llvm_name = "i586",
1906 .features = featureSet(&[_]Feature{
1907 .cx8,
1908 .slow_unaligned_mem_16,
1909 .vzeroupper,
1910 .x87,
1911 }),
1912 };
1913 pub const _i686 = CpuModel{
1914 .name = "_i686",
1915 .llvm_name = "i686",
1916 .features = featureSet(&[_]Feature{
1917 .cmov,
1918 .cx8,
1919 .slow_unaligned_mem_16,
1920 .vzeroupper,
1921 .x87,
1922 }),
1923 };
1924 pub const icelake_client = CpuModel{1942 pub const icelake_client = CpuModel{
1925 .name = "icelake_client",1943 .name = "icelake_client",
1926 .llvm_name = "icelake-client",1944 .llvm_name = "icelake-client",
1927 .features = featureSet(&[_]Feature{1945 .features = featureSet(&[_]Feature{
1928 .@"64bit",1946 .@"64bit",
1929 .adx,1947 .adx,
1930 .aes,
1931 .avx,
1932 .avx2,
1933 .avx512bitalg,1948 .avx512bitalg,
1934 .avx512bw,
1935 .avx512cd,1949 .avx512cd,
1936 .avx512dq,1950 .avx512dq,
1937 .avx512f,
1938 .avx512ifma,1951 .avx512ifma,
1939 .avx512vbmi,1952 .avx512vbmi,
1940 .avx512vbmi2,1953 .avx512vbmi2,
...@@ -1947,28 +1960,24 @@ pub const cpu = struct {...@@ -1947,28 +1960,24 @@ pub const cpu = struct {
1947 .clwb,1960 .clwb,
1948 .cmov,1961 .cmov,
1949 .cx16,1962 .cx16,
1950 .cx8,
1951 .ermsb,1963 .ermsb,
1952 .f16c,
1953 .fast_15bytenop,1964 .fast_15bytenop,
1954 .fast_gather,1965 .fast_gather,
1955 .fast_scalar_fsqrt,1966 .fast_scalar_fsqrt,
1956 .fast_shld_rotate,1967 .fast_shld_rotate,
1957 .fast_variable_shuffle,1968 .fast_variable_shuffle,
1958 .fast_vector_fsqrt,1969 .fast_vector_fsqrt,
1959 .fma,
1960 .fsgsbase,1970 .fsgsbase,
1971 .fsrm,
1961 .fxsr,1972 .fxsr,
1962 .gfni,1973 .gfni,
1963 .idivq_to_divl,1974 .idivq_to_divl,
1964 .invpcid,1975 .invpcid,
1965 .lzcnt,1976 .lzcnt,
1966 .macrofusion,1977 .macrofusion,
1967 .merge_to_threeway_branch,
1968 .mmx,1978 .mmx,
1969 .movbe,1979 .movbe,
1970 .nopl,1980 .nopl,
1971 .pclmul,
1972 .pku,1981 .pku,
1973 .popcnt,1982 .popcnt,
1974 .prefer_256_bit,1983 .prefer_256_bit,
...@@ -1980,12 +1989,10 @@ pub const cpu = struct {...@@ -1980,12 +1989,10 @@ pub const cpu = struct {
1980 .sgx,1989 .sgx,
1981 .sha,1990 .sha,
1982 .slow_3ops_lea,1991 .slow_3ops_lea,
1983 .sse4_2,
1984 .vaes,1992 .vaes,
1985 .vpclmulqdq,1993 .vpclmulqdq,
1986 .vzeroupper,1994 .vzeroupper,
1987 .x87,1995 .x87,
1988 .xsave,
1989 .xsavec,1996 .xsavec,
1990 .xsaveopt,1997 .xsaveopt,
1991 .xsaves,1998 .xsaves,
...@@ -1997,14 +2004,9 @@ pub const cpu = struct {...@@ -1997,14 +2004,9 @@ pub const cpu = struct {
1997 .features = featureSet(&[_]Feature{2004 .features = featureSet(&[_]Feature{
1998 .@"64bit",2005 .@"64bit",
1999 .adx,2006 .adx,
2000 .aes,
2001 .avx,
2002 .avx2,
2003 .avx512bitalg,2007 .avx512bitalg,
2004 .avx512bw,
2005 .avx512cd,2008 .avx512cd,
2006 .avx512dq,2009 .avx512dq,
2007 .avx512f,
2008 .avx512ifma,2010 .avx512ifma,
2009 .avx512vbmi,2011 .avx512vbmi,
2010 .avx512vbmi2,2012 .avx512vbmi2,
...@@ -2017,28 +2019,24 @@ pub const cpu = struct {...@@ -2017,28 +2019,24 @@ pub const cpu = struct {
2017 .clwb,2019 .clwb,
2018 .cmov,2020 .cmov,
2019 .cx16,2021 .cx16,
2020 .cx8,
2021 .ermsb,2022 .ermsb,
2022 .f16c,
2023 .fast_15bytenop,2023 .fast_15bytenop,
2024 .fast_gather,2024 .fast_gather,
2025 .fast_scalar_fsqrt,2025 .fast_scalar_fsqrt,
2026 .fast_shld_rotate,2026 .fast_shld_rotate,
2027 .fast_variable_shuffle,2027 .fast_variable_shuffle,
2028 .fast_vector_fsqrt,2028 .fast_vector_fsqrt,
2029 .fma,
2030 .fsgsbase,2029 .fsgsbase,
2030 .fsrm,
2031 .fxsr,2031 .fxsr,
2032 .gfni,2032 .gfni,
2033 .idivq_to_divl,2033 .idivq_to_divl,
2034 .invpcid,2034 .invpcid,
2035 .lzcnt,2035 .lzcnt,
2036 .macrofusion,2036 .macrofusion,
2037 .merge_to_threeway_branch,
2038 .mmx,2037 .mmx,
2039 .movbe,2038 .movbe,
2040 .nopl,2039 .nopl,
2041 .pclmul,
2042 .pconfig,2040 .pconfig,
2043 .pku,2041 .pku,
2044 .popcnt,2042 .popcnt,
...@@ -2051,13 +2049,11 @@ pub const cpu = struct {...@@ -2051,13 +2049,11 @@ pub const cpu = struct {
2051 .sgx,2049 .sgx,
2052 .sha,2050 .sha,
2053 .slow_3ops_lea,2051 .slow_3ops_lea,
2054 .sse4_2,
2055 .vaes,2052 .vaes,
2056 .vpclmulqdq,2053 .vpclmulqdq,
2057 .vzeroupper,2054 .vzeroupper,
2058 .wbnoinvd,2055 .wbnoinvd,
2059 .x87,2056 .x87,
2060 .xsave,
2061 .xsavec,2057 .xsavec,
2062 .xsaveopt,2058 .xsaveopt,
2063 .xsaves,2059 .xsaves,
...@@ -2068,10 +2064,8 @@ pub const cpu = struct {...@@ -2068,10 +2064,8 @@ pub const cpu = struct {
2068 .llvm_name = "ivybridge",2064 .llvm_name = "ivybridge",
2069 .features = featureSet(&[_]Feature{2065 .features = featureSet(&[_]Feature{
2070 .@"64bit",2066 .@"64bit",
2071 .avx,
2072 .cmov,2067 .cmov,
2073 .cx16,2068 .cx16,
2074 .cx8,
2075 .f16c,2069 .f16c,
2076 .false_deps_popcnt,2070 .false_deps_popcnt,
2077 .fast_15bytenop,2071 .fast_15bytenop,
...@@ -2081,7 +2075,6 @@ pub const cpu = struct {...@@ -2081,7 +2075,6 @@ pub const cpu = struct {
2081 .fxsr,2075 .fxsr,
2082 .idivq_to_divl,2076 .idivq_to_divl,
2083 .macrofusion,2077 .macrofusion,
2084 .merge_to_threeway_branch,
2085 .mmx,2078 .mmx,
2086 .nopl,2079 .nopl,
2087 .pclmul,2080 .pclmul,
...@@ -2090,10 +2083,8 @@ pub const cpu = struct {...@@ -2090,10 +2083,8 @@ pub const cpu = struct {
2090 .sahf,2083 .sahf,
2091 .slow_3ops_lea,2084 .slow_3ops_lea,
2092 .slow_unaligned_mem_32,2085 .slow_unaligned_mem_32,
2093 .sse4_2,
2094 .vzeroupper,2086 .vzeroupper,
2095 .x87,2087 .x87,
2096 .xsave,
2097 .xsaveopt,2088 .xsaveopt,
2098 }),2089 }),
2099 };2090 };
...@@ -2156,7 +2147,6 @@ pub const cpu = struct {...@@ -2156,7 +2147,6 @@ pub const cpu = struct {
2156 .@"64bit",2147 .@"64bit",
2157 .cmov,2148 .cmov,
2158 .cx16,2149 .cx16,
2159 .cx8,
2160 .fast_scalar_shift_masks,2150 .fast_scalar_shift_masks,
2161 .fxsr,2151 .fxsr,
2162 .nopl,2152 .nopl,
...@@ -2176,16 +2166,12 @@ pub const cpu = struct {...@@ -2176,16 +2166,12 @@ pub const cpu = struct {
2176 .aes,2166 .aes,
2177 .avx512cd,2167 .avx512cd,
2178 .avx512er,2168 .avx512er,
2179 .avx512f,
2180 .avx512pf,2169 .avx512pf,
2181 .bmi,2170 .bmi,
2182 .bmi2,2171 .bmi2,
2183 .cmov,2172 .cmov,
2184 .cx16,2173 .cx16,
2185 .cx8,
2186 .f16c,
2187 .fast_gather,2174 .fast_gather,
2188 .fma,
2189 .fsgsbase,2175 .fsgsbase,
2190 .fxsr,2176 .fxsr,
2191 .idivq_to_divl,2177 .idivq_to_divl,
...@@ -2206,7 +2192,6 @@ pub const cpu = struct {...@@ -2206,7 +2192,6 @@ pub const cpu = struct {
2206 .slow_pmaddwd,2192 .slow_pmaddwd,
2207 .slow_two_mem_ops,2193 .slow_two_mem_ops,
2208 .x87,2194 .x87,
2209 .xsave,
2210 .xsaveopt,2195 .xsaveopt,
2211 }),2196 }),
2212 };2197 };
...@@ -2219,17 +2204,13 @@ pub const cpu = struct {...@@ -2219,17 +2204,13 @@ pub const cpu = struct {
2219 .aes,2204 .aes,
2220 .avx512cd,2205 .avx512cd,
2221 .avx512er,2206 .avx512er,
2222 .avx512f,
2223 .avx512pf,2207 .avx512pf,
2224 .avx512vpopcntdq,2208 .avx512vpopcntdq,
2225 .bmi,2209 .bmi,
2226 .bmi2,2210 .bmi2,
2227 .cmov,2211 .cmov,
2228 .cx16,2212 .cx16,
2229 .cx8,
2230 .f16c,
2231 .fast_gather,2213 .fast_gather,
2232 .fma,
2233 .fsgsbase,2214 .fsgsbase,
2234 .fxsr,2215 .fxsr,
2235 .idivq_to_divl,2216 .idivq_to_divl,
...@@ -2250,7 +2231,6 @@ pub const cpu = struct {...@@ -2250,7 +2231,6 @@ pub const cpu = struct {
2250 .slow_pmaddwd,2231 .slow_pmaddwd,
2251 .slow_two_mem_ops,2232 .slow_two_mem_ops,
2252 .x87,2233 .x87,
2253 .xsave,
2254 .xsaveopt,2234 .xsaveopt,
2255 }),2235 }),
2256 };2236 };
...@@ -2258,6 +2238,8 @@ pub const cpu = struct {...@@ -2258,6 +2238,8 @@ pub const cpu = struct {
2258 .name = "lakemont",2238 .name = "lakemont",
2259 .llvm_name = "lakemont",2239 .llvm_name = "lakemont",
2260 .features = featureSet(&[_]Feature{2240 .features = featureSet(&[_]Feature{
2241 .cx8,
2242 .slow_unaligned_mem_16,
2261 .vzeroupper,2243 .vzeroupper,
2262 }),2244 }),
2263 };2245 };
...@@ -2268,7 +2250,6 @@ pub const cpu = struct {...@@ -2268,7 +2250,6 @@ pub const cpu = struct {
2268 .@"64bit",2250 .@"64bit",
2269 .cmov,2251 .cmov,
2270 .cx16,2252 .cx16,
2271 .cx8,
2272 .fxsr,2253 .fxsr,
2273 .macrofusion,2254 .macrofusion,
2274 .mmx,2255 .mmx,
...@@ -2287,7 +2268,6 @@ pub const cpu = struct {...@@ -2287,7 +2268,6 @@ pub const cpu = struct {
2287 .@"64bit",2268 .@"64bit",
2288 .cmov,2269 .cmov,
2289 .cx16,2270 .cx16,
2290 .cx8,
2291 .fxsr,2271 .fxsr,
2292 .mmx,2272 .mmx,
2293 .nopl,2273 .nopl,
...@@ -2323,7 +2303,6 @@ pub const cpu = struct {...@@ -2323,7 +2303,6 @@ pub const cpu = struct {
2323 .@"64bit",2303 .@"64bit",
2324 .cmov,2304 .cmov,
2325 .cx16,2305 .cx16,
2326 .cx8,
2327 .fast_scalar_shift_masks,2306 .fast_scalar_shift_masks,
2328 .fxsr,2307 .fxsr,
2329 .nopl,2308 .nopl,
...@@ -2341,7 +2320,6 @@ pub const cpu = struct {...@@ -2341,7 +2320,6 @@ pub const cpu = struct {
2341 .@"64bit",2320 .@"64bit",
2342 .cmov,2321 .cmov,
2343 .cx16,2322 .cx16,
2344 .cx8,
2345 .fxsr,2323 .fxsr,
2346 .macrofusion,2324 .macrofusion,
2347 .mmx,2325 .mmx,
...@@ -2363,32 +2341,6 @@ pub const cpu = struct {...@@ -2363,32 +2341,6 @@ pub const cpu = struct {
2363 .x87,2341 .x87,
2364 }),2342 }),
2365 };2343 };
2366 pub const pentium_m = CpuModel{
2367 .name = "pentium_m",
2368 .llvm_name = "pentium-m",
2369 .features = featureSet(&[_]Feature{
2370 .cmov,
2371 .cx8,
2372 .fxsr,
2373 .mmx,
2374 .nopl,
2375 .slow_unaligned_mem_16,
2376 .sse2,
2377 .vzeroupper,
2378 .x87,
2379 }),
2380 };
2381 pub const pentium_mmx = CpuModel{
2382 .name = "pentium_mmx",
2383 .llvm_name = "pentium-mmx",
2384 .features = featureSet(&[_]Feature{
2385 .cx8,
2386 .mmx,
2387 .slow_unaligned_mem_16,
2388 .vzeroupper,
2389 .x87,
2390 }),
2391 };
2392 pub const pentium2 = CpuModel{2344 pub const pentium2 = CpuModel{
2393 .name = "pentium2",2345 .name = "pentium2",
2394 .llvm_name = "pentium2",2346 .llvm_name = "pentium2",
...@@ -2463,6 +2415,32 @@ pub const cpu = struct {...@@ -2463,6 +2415,32 @@ pub const cpu = struct {
2463 .x87,2415 .x87,
2464 }),2416 }),
2465 };2417 };
2418 pub const pentium_m = CpuModel{
2419 .name = "pentium_m",
2420 .llvm_name = "pentium-m",
2421 .features = featureSet(&[_]Feature{
2422 .cmov,
2423 .cx8,
2424 .fxsr,
2425 .mmx,
2426 .nopl,
2427 .slow_unaligned_mem_16,
2428 .sse2,
2429 .vzeroupper,
2430 .x87,
2431 }),
2432 };
2433 pub const pentium_mmx = CpuModel{
2434 .name = "pentium_mmx",
2435 .llvm_name = "pentium-mmx",
2436 .features = featureSet(&[_]Feature{
2437 .cx8,
2438 .mmx,
2439 .slow_unaligned_mem_16,
2440 .vzeroupper,
2441 .x87,
2442 }),
2443 };
2466 pub const pentiumpro = CpuModel{2444 pub const pentiumpro = CpuModel{
2467 .name = "pentiumpro",2445 .name = "pentiumpro",
2468 .llvm_name = "pentiumpro",2446 .llvm_name = "pentiumpro",
...@@ -2498,7 +2476,6 @@ pub const cpu = struct {...@@ -2498,7 +2476,6 @@ pub const cpu = struct {
2498 .avx,2476 .avx,
2499 .cmov,2477 .cmov,
2500 .cx16,2478 .cx16,
2501 .cx8,
2502 .false_deps_popcnt,2479 .false_deps_popcnt,
2503 .fast_15bytenop,2480 .fast_15bytenop,
2504 .fast_scalar_fsqrt,2481 .fast_scalar_fsqrt,
...@@ -2506,7 +2483,6 @@ pub const cpu = struct {...@@ -2506,7 +2483,6 @@ pub const cpu = struct {
2506 .fxsr,2483 .fxsr,
2507 .idivq_to_divl,2484 .idivq_to_divl,
2508 .macrofusion,2485 .macrofusion,
2509 .merge_to_threeway_branch,
2510 .mmx,2486 .mmx,
2511 .nopl,2487 .nopl,
2512 .pclmul,2488 .pclmul,
...@@ -2514,13 +2490,87 @@ pub const cpu = struct {...@@ -2514,13 +2490,87 @@ pub const cpu = struct {
2514 .sahf,2490 .sahf,
2515 .slow_3ops_lea,2491 .slow_3ops_lea,
2516 .slow_unaligned_mem_32,2492 .slow_unaligned_mem_32,
2517 .sse4_2,
2518 .vzeroupper,2493 .vzeroupper,
2519 .x87,2494 .x87,
2520 .xsave,
2521 .xsaveopt,2495 .xsaveopt,
2522 }),2496 }),
2523 };2497 };
2498 pub const sapphirerapids = CpuModel{
2499 .name = "sapphirerapids",
2500 .llvm_name = "sapphirerapids",
2501 .features = featureSet(&[_]Feature{
2502 .@"64bit",
2503 .adx,
2504 .amx_bf16,
2505 .amx_int8,
2506 .avx512bf16,
2507 .avx512bitalg,
2508 .avx512cd,
2509 .avx512dq,
2510 .avx512ifma,
2511 .avx512vbmi,
2512 .avx512vbmi2,
2513 .avx512vl,
2514 .avx512vnni,
2515 .avx512vp2intersect,
2516 .avx512vpopcntdq,
2517 .avxvnni,
2518 .bmi,
2519 .bmi2,
2520 .cldemote,
2521 .clflushopt,
2522 .clwb,
2523 .cmov,
2524 .cx16,
2525 .enqcmd,
2526 .ermsb,
2527 .fast_15bytenop,
2528 .fast_gather,
2529 .fast_scalar_fsqrt,
2530 .fast_shld_rotate,
2531 .fast_variable_shuffle,
2532 .fast_vector_fsqrt,
2533 .fsgsbase,
2534 .fsrm,
2535 .fxsr,
2536 .gfni,
2537 .idivq_to_divl,
2538 .invpcid,
2539 .lzcnt,
2540 .macrofusion,
2541 .mmx,
2542 .movbe,
2543 .movdir64b,
2544 .movdiri,
2545 .nopl,
2546 .pconfig,
2547 .pku,
2548 .popcnt,
2549 .prefer_256_bit,
2550 .prfchw,
2551 .ptwrite,
2552 .rdpid,
2553 .rdrnd,
2554 .rdseed,
2555 .sahf,
2556 .serialize,
2557 .sgx,
2558 .sha,
2559 .shstk,
2560 .slow_3ops_lea,
2561 .tsxldtrk,
2562 .uintr,
2563 .vaes,
2564 .vpclmulqdq,
2565 .vzeroupper,
2566 .waitpkg,
2567 .wbnoinvd,
2568 .x87,
2569 .xsavec,
2570 .xsaveopt,
2571 .xsaves,
2572 }),
2573 };
2524 pub const silvermont = CpuModel{2574 pub const silvermont = CpuModel{
2525 .name = "silvermont",2575 .name = "silvermont",
2526 .llvm_name = "silvermont",2576 .llvm_name = "silvermont",
...@@ -2528,7 +2578,6 @@ pub const cpu = struct {...@@ -2528,7 +2578,6 @@ pub const cpu = struct {
2528 .@"64bit",2578 .@"64bit",
2529 .cmov,2579 .cmov,
2530 .cx16,2580 .cx16,
2531 .cx8,
2532 .false_deps_popcnt,2581 .false_deps_popcnt,
2533 .fast_7bytenop,2582 .fast_7bytenop,
2534 .fxsr,2583 .fxsr,
...@@ -2546,7 +2595,6 @@ pub const cpu = struct {...@@ -2546,7 +2595,6 @@ pub const cpu = struct {
2546 .slow_pmulld,2595 .slow_pmulld,
2547 .slow_two_mem_ops,2596 .slow_two_mem_ops,
2548 .sse4_2,2597 .sse4_2,
2549 .ssse3,
2550 .vzeroupper,2598 .vzeroupper,
2551 .x87,2599 .x87,
2552 }),2600 }),
...@@ -2558,12 +2606,9 @@ pub const cpu = struct {...@@ -2558,12 +2606,9 @@ pub const cpu = struct {
2558 .@"64bit",2606 .@"64bit",
2559 .adx,2607 .adx,
2560 .aes,2608 .aes,
2561 .avx,
2562 .avx2,
2563 .avx512bw,2609 .avx512bw,
2564 .avx512cd,2610 .avx512cd,
2565 .avx512dq,2611 .avx512dq,
2566 .avx512f,
2567 .avx512vl,2612 .avx512vl,
2568 .bmi,2613 .bmi,
2569 .bmi2,2614 .bmi2,
...@@ -2571,9 +2616,7 @@ pub const cpu = struct {...@@ -2571,9 +2616,7 @@ pub const cpu = struct {
2571 .clwb,2616 .clwb,
2572 .cmov,2617 .cmov,
2573 .cx16,2618 .cx16,
2574 .cx8,
2575 .ermsb,2619 .ermsb,
2576 .f16c,
2577 .false_deps_popcnt,2620 .false_deps_popcnt,
2578 .fast_15bytenop,2621 .fast_15bytenop,
2579 .fast_gather,2622 .fast_gather,
...@@ -2581,14 +2624,12 @@ pub const cpu = struct {...@@ -2581,14 +2624,12 @@ pub const cpu = struct {
2581 .fast_shld_rotate,2624 .fast_shld_rotate,
2582 .fast_variable_shuffle,2625 .fast_variable_shuffle,
2583 .fast_vector_fsqrt,2626 .fast_vector_fsqrt,
2584 .fma,
2585 .fsgsbase,2627 .fsgsbase,
2586 .fxsr,2628 .fxsr,
2587 .idivq_to_divl,2629 .idivq_to_divl,
2588 .invpcid,2630 .invpcid,
2589 .lzcnt,2631 .lzcnt,
2590 .macrofusion,2632 .macrofusion,
2591 .merge_to_threeway_branch,
2592 .mmx,2633 .mmx,
2593 .movbe,2634 .movbe,
2594 .nopl,2635 .nopl,
...@@ -2601,10 +2642,8 @@ pub const cpu = struct {...@@ -2601,10 +2642,8 @@ pub const cpu = struct {
2601 .rdseed,2642 .rdseed,
2602 .sahf,2643 .sahf,
2603 .slow_3ops_lea,2644 .slow_3ops_lea,
2604 .sse4_2,
2605 .vzeroupper,2645 .vzeroupper,
2606 .x87,2646 .x87,
2607 .xsave,
2608 .xsavec,2647 .xsavec,
2609 .xsaveopt,2648 .xsaveopt,
2610 .xsaves,2649 .xsaves,
...@@ -2617,14 +2656,12 @@ pub const cpu = struct {...@@ -2617,14 +2656,12 @@ pub const cpu = struct {
2617 .@"64bit",2656 .@"64bit",
2618 .adx,2657 .adx,
2619 .aes,2658 .aes,
2620 .avx,
2621 .avx2,2659 .avx2,
2622 .bmi,2660 .bmi,
2623 .bmi2,2661 .bmi2,
2624 .clflushopt,2662 .clflushopt,
2625 .cmov,2663 .cmov,
2626 .cx16,2664 .cx16,
2627 .cx8,
2628 .ermsb,2665 .ermsb,
2629 .f16c,2666 .f16c,
2630 .false_deps_popcnt,2667 .false_deps_popcnt,
...@@ -2641,7 +2678,6 @@ pub const cpu = struct {...@@ -2641,7 +2678,6 @@ pub const cpu = struct {
2641 .invpcid,2678 .invpcid,
2642 .lzcnt,2679 .lzcnt,
2643 .macrofusion,2680 .macrofusion,
2644 .merge_to_threeway_branch,
2645 .mmx,2681 .mmx,
2646 .movbe,2682 .movbe,
2647 .nopl,2683 .nopl,
...@@ -2653,10 +2689,8 @@ pub const cpu = struct {...@@ -2653,10 +2689,8 @@ pub const cpu = struct {
2653 .sahf,2689 .sahf,
2654 .sgx,2690 .sgx,
2655 .slow_3ops_lea,2691 .slow_3ops_lea,
2656 .sse4_2,
2657 .vzeroupper,2692 .vzeroupper,
2658 .x87,2693 .x87,
2659 .xsave,
2660 .xsavec,2694 .xsavec,
2661 .xsaveopt,2695 .xsaveopt,
2662 .xsaves,2696 .xsaves,
...@@ -2669,12 +2703,9 @@ pub const cpu = struct {...@@ -2669,12 +2703,9 @@ pub const cpu = struct {
2669 .@"64bit",2703 .@"64bit",
2670 .adx,2704 .adx,
2671 .aes,2705 .aes,
2672 .avx,
2673 .avx2,
2674 .avx512bw,2706 .avx512bw,
2675 .avx512cd,2707 .avx512cd,
2676 .avx512dq,2708 .avx512dq,
2677 .avx512f,
2678 .avx512vl,2709 .avx512vl,
2679 .bmi,2710 .bmi,
2680 .bmi2,2711 .bmi2,
...@@ -2682,9 +2713,7 @@ pub const cpu = struct {...@@ -2682,9 +2713,7 @@ pub const cpu = struct {
2682 .clwb,2713 .clwb,
2683 .cmov,2714 .cmov,
2684 .cx16,2715 .cx16,
2685 .cx8,
2686 .ermsb,2716 .ermsb,
2687 .f16c,
2688 .false_deps_popcnt,2717 .false_deps_popcnt,
2689 .fast_15bytenop,2718 .fast_15bytenop,
2690 .fast_gather,2719 .fast_gather,
...@@ -2692,14 +2721,12 @@ pub const cpu = struct {...@@ -2692,14 +2721,12 @@ pub const cpu = struct {
2692 .fast_shld_rotate,2721 .fast_shld_rotate,
2693 .fast_variable_shuffle,2722 .fast_variable_shuffle,
2694 .fast_vector_fsqrt,2723 .fast_vector_fsqrt,
2695 .fma,
2696 .fsgsbase,2724 .fsgsbase,
2697 .fxsr,2725 .fxsr,
2698 .idivq_to_divl,2726 .idivq_to_divl,
2699 .invpcid,2727 .invpcid,
2700 .lzcnt,2728 .lzcnt,
2701 .macrofusion,2729 .macrofusion,
2702 .merge_to_threeway_branch,
2703 .mmx,2730 .mmx,
2704 .movbe,2731 .movbe,
2705 .nopl,2732 .nopl,
...@@ -2712,10 +2739,8 @@ pub const cpu = struct {...@@ -2712,10 +2739,8 @@ pub const cpu = struct {
2712 .rdseed,2739 .rdseed,
2713 .sahf,2740 .sahf,
2714 .slow_3ops_lea,2741 .slow_3ops_lea,
2715 .sse4_2,
2716 .vzeroupper,2742 .vzeroupper,
2717 .x87,2743 .x87,
2718 .xsave,
2719 .xsavec,2744 .xsavec,
2720 .xsaveopt,2745 .xsaveopt,
2721 .xsaves,2746 .xsaves,
...@@ -2728,7 +2753,6 @@ pub const cpu = struct {...@@ -2728,7 +2753,6 @@ pub const cpu = struct {
2728 .@"64bit",2753 .@"64bit",
2729 .cmov,2754 .cmov,
2730 .cx16,2755 .cx16,
2731 .cx8,
2732 .false_deps_popcnt,2756 .false_deps_popcnt,
2733 .fast_7bytenop,2757 .fast_7bytenop,
2734 .fxsr,2758 .fxsr,
...@@ -2746,7 +2770,6 @@ pub const cpu = struct {...@@ -2746,7 +2770,6 @@ pub const cpu = struct {
2746 .slow_pmulld,2770 .slow_pmulld,
2747 .slow_two_mem_ops,2771 .slow_two_mem_ops,
2748 .sse4_2,2772 .sse4_2,
2749 .ssse3,
2750 .vzeroupper,2773 .vzeroupper,
2751 .x87,2774 .x87,
2752 }),2775 }),
...@@ -2757,14 +2780,9 @@ pub const cpu = struct {...@@ -2757,14 +2780,9 @@ pub const cpu = struct {
2757 .features = featureSet(&[_]Feature{2780 .features = featureSet(&[_]Feature{
2758 .@"64bit",2781 .@"64bit",
2759 .adx,2782 .adx,
2760 .aes,
2761 .avx,
2762 .avx2,
2763 .avx512bitalg,2783 .avx512bitalg,
2764 .avx512bw,
2765 .avx512cd,2784 .avx512cd,
2766 .avx512dq,2785 .avx512dq,
2767 .avx512f,
2768 .avx512ifma,2786 .avx512ifma,
2769 .avx512vbmi,2787 .avx512vbmi,
2770 .avx512vbmi2,2788 .avx512vbmi2,
...@@ -2778,30 +2796,26 @@ pub const cpu = struct {...@@ -2778,30 +2796,26 @@ pub const cpu = struct {
2778 .clwb,2796 .clwb,
2779 .cmov,2797 .cmov,
2780 .cx16,2798 .cx16,
2781 .cx8,
2782 .ermsb,2799 .ermsb,
2783 .f16c,
2784 .fast_15bytenop,2800 .fast_15bytenop,
2785 .fast_gather,2801 .fast_gather,
2786 .fast_scalar_fsqrt,2802 .fast_scalar_fsqrt,
2787 .fast_shld_rotate,2803 .fast_shld_rotate,
2788 .fast_variable_shuffle,2804 .fast_variable_shuffle,
2789 .fast_vector_fsqrt,2805 .fast_vector_fsqrt,
2790 .fma,
2791 .fsgsbase,2806 .fsgsbase,
2807 .fsrm,
2792 .fxsr,2808 .fxsr,
2793 .gfni,2809 .gfni,
2794 .idivq_to_divl,2810 .idivq_to_divl,
2795 .invpcid,2811 .invpcid,
2796 .lzcnt,2812 .lzcnt,
2797 .macrofusion,2813 .macrofusion,
2798 .merge_to_threeway_branch,
2799 .mmx,2814 .mmx,
2800 .movbe,2815 .movbe,
2801 .movdir64b,2816 .movdir64b,
2802 .movdiri,2817 .movdiri,
2803 .nopl,2818 .nopl,
2804 .pclmul,
2805 .pku,2819 .pku,
2806 .popcnt,2820 .popcnt,
2807 .prefer_256_bit,2821 .prefer_256_bit,
...@@ -2814,12 +2828,10 @@ pub const cpu = struct {...@@ -2814,12 +2828,10 @@ pub const cpu = struct {
2814 .sha,2828 .sha,
2815 .shstk,2829 .shstk,
2816 .slow_3ops_lea,2830 .slow_3ops_lea,
2817 .sse4_2,
2818 .vaes,2831 .vaes,
2819 .vpclmulqdq,2832 .vpclmulqdq,
2820 .vzeroupper,2833 .vzeroupper,
2821 .x87,2834 .x87,
2822 .xsave,
2823 .xsavec,2835 .xsavec,
2824 .xsaveopt,2836 .xsaveopt,
2825 .xsaves,2837 .xsaves,
...@@ -2835,7 +2847,6 @@ pub const cpu = struct {...@@ -2835,7 +2847,6 @@ pub const cpu = struct {
2835 .clwb,2847 .clwb,
2836 .cmov,2848 .cmov,
2837 .cx16,2849 .cx16,
2838 .cx8,
2839 .fsgsbase,2850 .fsgsbase,
2840 .fxsr,2851 .fxsr,
2841 .gfni,2852 .gfni,
...@@ -2856,11 +2867,9 @@ pub const cpu = struct {...@@ -2856,11 +2867,9 @@ pub const cpu = struct {
2856 .slow_lea,2867 .slow_lea,
2857 .slow_two_mem_ops,2868 .slow_two_mem_ops,
2858 .sse4_2,2869 .sse4_2,
2859 .ssse3,
2860 .use_glm_div_sqrt_costs,2870 .use_glm_div_sqrt_costs,
2861 .vzeroupper,2871 .vzeroupper,
2862 .x87,2872 .x87,
2863 .xsave,
2864 .xsavec,2873 .xsavec,
2865 .xsaveopt,2874 .xsaveopt,
2866 .xsaves,2875 .xsaves,
...@@ -2873,7 +2882,6 @@ pub const cpu = struct {...@@ -2873,7 +2882,6 @@ pub const cpu = struct {
2873 .@"64bit",2882 .@"64bit",
2874 .cmov,2883 .cmov,
2875 .cx16,2884 .cx16,
2876 .cx8,
2877 .fxsr,2885 .fxsr,
2878 .macrofusion,2886 .macrofusion,
2879 .mmx,2887 .mmx,
...@@ -2886,21 +2894,21 @@ pub const cpu = struct {...@@ -2886,21 +2894,21 @@ pub const cpu = struct {
2886 .x87,2894 .x87,
2887 }),2895 }),
2888 };2896 };
2889 pub const winchip_c6 = CpuModel{2897 pub const winchip2 = CpuModel{
2890 .name = "winchip_c6",2898 .name = "winchip2",
2891 .llvm_name = "winchip-c6",2899 .llvm_name = "winchip2",
2892 .features = featureSet(&[_]Feature{2900 .features = featureSet(&[_]Feature{
2893 .mmx,2901 .@"3dnow",
2894 .slow_unaligned_mem_16,2902 .slow_unaligned_mem_16,
2895 .vzeroupper,2903 .vzeroupper,
2896 .x87,2904 .x87,
2897 }),2905 }),
2898 };2906 };
2899 pub const winchip2 = CpuModel{2907 pub const winchip_c6 = CpuModel{
2900 .name = "winchip2",2908 .name = "winchip_c6",
2901 .llvm_name = "winchip2",2909 .llvm_name = "winchip-c6",
2902 .features = featureSet(&[_]Feature{2910 .features = featureSet(&[_]Feature{
2903 .@"3dnow",2911 .mmx,
2904 .slow_unaligned_mem_16,2912 .slow_unaligned_mem_16,
2905 .vzeroupper,2913 .vzeroupper,
2906 .x87,2914 .x87,
...@@ -2925,6 +2933,100 @@ pub const cpu = struct {...@@ -2925,6 +2933,100 @@ pub const cpu = struct {
2925 .x87,2933 .x87,
2926 }),2934 }),
2927 };2935 };
2936 pub const x86_64_v2 = CpuModel{
2937 .name = "x86_64_v2",
2938 .llvm_name = "x86-64-v2",
2939 .features = featureSet(&[_]Feature{
2940 .@"64bit",
2941 .cmov,
2942 .cx16,
2943 .false_deps_popcnt,
2944 .fast_15bytenop,
2945 .fast_scalar_fsqrt,
2946 .fast_shld_rotate,
2947 .fxsr,
2948 .idivq_to_divl,
2949 .macrofusion,
2950 .mmx,
2951 .nopl,
2952 .popcnt,
2953 .sahf,
2954 .slow_3ops_lea,
2955 .slow_unaligned_mem_32,
2956 .sse4_2,
2957 .vzeroupper,
2958 .x87,
2959 }),
2960 };
2961 pub const x86_64_v3 = CpuModel{
2962 .name = "x86_64_v3",
2963 .llvm_name = "x86-64-v3",
2964 .features = featureSet(&[_]Feature{
2965 .@"64bit",
2966 .avx2,
2967 .bmi,
2968 .bmi2,
2969 .cmov,
2970 .cx16,
2971 .f16c,
2972 .false_deps_lzcnt_tzcnt,
2973 .false_deps_popcnt,
2974 .fast_15bytenop,
2975 .fast_scalar_fsqrt,
2976 .fast_shld_rotate,
2977 .fast_variable_shuffle,
2978 .fma,
2979 .fxsr,
2980 .idivq_to_divl,
2981 .lzcnt,
2982 .macrofusion,
2983 .mmx,
2984 .movbe,
2985 .nopl,
2986 .popcnt,
2987 .sahf,
2988 .slow_3ops_lea,
2989 .vzeroupper,
2990 .x87,
2991 .xsave,
2992 }),
2993 };
2994 pub const x86_64_v4 = CpuModel{
2995 .name = "x86_64_v4",
2996 .llvm_name = "x86-64-v4",
2997 .features = featureSet(&[_]Feature{
2998 .@"64bit",
2999 .avx512bw,
3000 .avx512cd,
3001 .avx512dq,
3002 .avx512vl,
3003 .bmi,
3004 .bmi2,
3005 .cmov,
3006 .cx16,
3007 .false_deps_popcnt,
3008 .fast_15bytenop,
3009 .fast_gather,
3010 .fast_scalar_fsqrt,
3011 .fast_shld_rotate,
3012 .fast_variable_shuffle,
3013 .fast_vector_fsqrt,
3014 .fxsr,
3015 .idivq_to_divl,
3016 .lzcnt,
3017 .macrofusion,
3018 .mmx,
3019 .movbe,
3020 .nopl,
3021 .popcnt,
3022 .prefer_256_bit,
3023 .sahf,
3024 .slow_3ops_lea,
3025 .vzeroupper,
3026 .x87,
3027 .xsave,
3028 }),
3029 };
2928 pub const yonah = CpuModel{3030 pub const yonah = CpuModel{
2929 .name = "yonah",3031 .name = "yonah",
2930 .llvm_name = "yonah",3032 .llvm_name = "yonah",
...@@ -2979,7 +3081,6 @@ pub const cpu = struct {...@@ -2979,7 +3081,6 @@ pub const cpu = struct {
2979 .sse4a,3081 .sse4a,
2980 .vzeroupper,3082 .vzeroupper,
2981 .x87,3083 .x87,
2982 .xsave,
2983 .xsavec,3084 .xsavec,
2984 .xsaveopt,3085 .xsaveopt,
2985 .xsaves,3086 .xsaves,
...@@ -3027,7 +3128,56 @@ pub const cpu = struct {...@@ -3027,7 +3128,56 @@ pub const cpu = struct {
3027 .vzeroupper,3128 .vzeroupper,
3028 .wbnoinvd,3129 .wbnoinvd,
3029 .x87,3130 .x87,
3030 .xsave,3131 .xsavec,
3132 .xsaveopt,
3133 .xsaves,
3134 }),
3135 };
3136 pub const znver3 = CpuModel{
3137 .name = "znver3",
3138 .llvm_name = "znver3",
3139 .features = featureSet(&[_]Feature{
3140 .@"64bit",
3141 .adx,
3142 .avx2,
3143 .bmi,
3144 .bmi2,
3145 .branchfusion,
3146 .clflushopt,
3147 .clwb,
3148 .clzero,
3149 .cmov,
3150 .cx16,
3151 .f16c,
3152 .fast_15bytenop,
3153 .fast_bextr,
3154 .fast_lzcnt,
3155 .fast_scalar_shift_masks,
3156 .fma,
3157 .fsgsbase,
3158 .fsrm,
3159 .fxsr,
3160 .invpcid,
3161 .lzcnt,
3162 .mmx,
3163 .movbe,
3164 .mwaitx,
3165 .nopl,
3166 .pku,
3167 .popcnt,
3168 .prfchw,
3169 .rdpid,
3170 .rdrnd,
3171 .rdseed,
3172 .sahf,
3173 .sha,
3174 .slow_shld,
3175 .sse4a,
3176 .vaes,
3177 .vpclmulqdq,
3178 .vzeroupper,
3179 .wbnoinvd,
3180 .x87,
3031 .xsavec,3181 .xsavec,
3032 .xsaveopt,3182 .xsaveopt,
3033 .xsaves,3183 .xsaves,
lib/std/zig/cross_target.zig+2-2
...@@ -111,11 +111,11 @@ pub const CrossTarget = struct {...@@ -111,11 +111,11 @@ pub const CrossTarget = struct {
111 .kfreebsd,111 .kfreebsd,
112 .lv2,112 .lv2,
113 .solaris,113 .solaris,
114 .zos,
114 .haiku,115 .haiku,
115 .minix,116 .minix,
116 .rtems,117 .rtems,
117 .nacl,118 .nacl,
118 .cnk,
119 .aix,119 .aix,
120 .cuda,120 .cuda,
121 .nvcl,121 .nvcl,
...@@ -714,11 +714,11 @@ pub const CrossTarget = struct {...@@ -714,11 +714,11 @@ pub const CrossTarget = struct {
714 .kfreebsd,714 .kfreebsd,
715 .lv2,715 .lv2,
716 .solaris,716 .solaris,
717 .zos,
717 .haiku,718 .haiku,
718 .minix,719 .minix,
719 .rtems,720 .rtems,
720 .nacl,721 .nacl,
721 .cnk,
722 .aix,722 .aix,
723 .cuda,723 .cuda,
724 .nvcl,724 .nvcl,
lib/std/zig/system.zig+27-5
...@@ -326,11 +326,33 @@ pub const NativeTargetInfo = struct {...@@ -326,11 +326,33 @@ pub const NativeTargetInfo = struct {
326 cpu_detection_unimplemented = true;326 cpu_detection_unimplemented = true;
327 break :backup_cpu_detection Target.Cpu.baseline(cpu_arch);327 break :backup_cpu_detection Target.Cpu.baseline(cpu_arch);
328 };328 };
329 cross_target.updateCpuFeatures(&cpu.features);329 var result = try detectAbiAndDynamicLinker(allocator, cpu, os, cross_target);
330330 // For x86, we need to populate some CPU feature flags depending on architecture
331 var target = try detectAbiAndDynamicLinker(allocator, cpu, os, cross_target);331 // and mode:
332 target.cpu_detection_unimplemented = cpu_detection_unimplemented;332 // * 16bit_mode => if the abi is code16
333 return target;333 // * 32bit_mode => if the arch is i386
334 // However, the "mode" flags can be used as overrides, so if the user explicitly
335 // sets one of them, that takes precedence.
336 switch (cpu_arch) {
337 .i386 => {
338 if (!std.Target.x86.featureSetHasAny(cross_target.cpu_features_add, .{
339 .@"16bit_mode", .@"32bit_mode",
340 })) {
341 switch (result.target.abi) {
342 .code16 => result.target.cpu.features.addFeature(
343 @enumToInt(std.Target.x86.Feature.@"16bit_mode"),
344 ),
345 else => result.target.cpu.features.addFeature(
346 @enumToInt(std.Target.x86.Feature.@"32bit_mode"),
347 ),
348 }
349 }
350 },
351 else => {},
352 }
353 cross_target.updateCpuFeatures(&result.target.cpu.features);
354 result.cpu_detection_unimplemented = cpu_detection_unimplemented;
355 return result;
334 }356 }
335357
336 /// First we attempt to use the executable's own binary. If it is dynamically358 /// First we attempt to use the executable's own binary. If it is dynamically
lib/std/zig/system/x86.zig+4
...@@ -311,6 +311,10 @@ fn detectAMDProcessor(cpu: *Target.Cpu, family: u32, model: u32) void {...@@ -311,6 +311,10 @@ fn detectAMDProcessor(cpu: *Target.Cpu, family: u32, model: u32) void {
311 }311 }
312 return;312 return;
313 },313 },
314 25 => {
315 cpu.model = &Target.x86.cpu.znver3;
316 return;
317 },
314 else => {318 else => {
315 return;319 return;
316 },320 },
src/Compilation.zig+2-5
...@@ -2345,6 +2345,7 @@ pub fn addCCArgs(...@@ -2345,6 +2345,7 @@ pub fn addCCArgs(
2345 }2345 }
2346 try argv.append("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS");2346 try argv.append("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS");
2347 try argv.append("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS");2347 try argv.append("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS");
2348 try argv.append("-D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS");
2348 }2349 }
23492350
2350 const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target);2351 const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target);
...@@ -2927,11 +2928,7 @@ pub fn generateBuiltinZigSource(comp: *Compilation, allocator: *Allocator) ![]u8...@@ -2927,11 +2928,7 @@ pub fn generateBuiltinZigSource(comp: *Compilation, allocator: *Allocator) ![]u8
2927 const index = @intCast(std.Target.Cpu.Feature.Set.Index, index_usize);2928 const index = @intCast(std.Target.Cpu.Feature.Set.Index, index_usize);
2928 const is_enabled = target.cpu.features.isEnabled(index);2929 const is_enabled = target.cpu.features.isEnabled(index);
2929 if (is_enabled) {2930 if (is_enabled) {
2930 // TODO some kind of "zig identifier escape" function rather than2931 try buffer.writer().print(" .{},\n", .{std.zig.fmtId(feature.name)});
2931 // unconditionally using @"" syntax
2932 try buffer.appendSlice(" .@\"");
2933 try buffer.appendSlice(feature.name);
2934 try buffer.appendSlice("\",\n");
2935 }2932 }
2936 }2933 }
29372934
src/clang.zig+11-4
...@@ -424,7 +424,7 @@ pub const Expr = opaque {...@@ -424,7 +424,7 @@ pub const Expr = opaque {
424 extern fn ZigClangExpr_getBeginLoc(*const Expr) SourceLocation;424 extern fn ZigClangExpr_getBeginLoc(*const Expr) SourceLocation;
425425
426 pub const evaluateAsConstantExpr = ZigClangExpr_EvaluateAsConstantExpr;426 pub const evaluateAsConstantExpr = ZigClangExpr_EvaluateAsConstantExpr;
427 extern fn ZigClangExpr_EvaluateAsConstantExpr(*const Expr, *ExprEvalResult, Expr_ConstExprUsage, *const ASTContext) bool;427 extern fn ZigClangExpr_EvaluateAsConstantExpr(*const Expr, *ExprEvalResult, Expr_ConstantExprKind, *const ASTContext) bool;
428};428};
429429
430pub const FieldDecl = opaque {430pub const FieldDecl = opaque {
...@@ -1341,6 +1341,8 @@ pub const CK = extern enum {...@@ -1341,6 +1341,8 @@ pub const CK = extern enum {
1341 IntegralCast,1341 IntegralCast,
1342 IntegralToBoolean,1342 IntegralToBoolean,
1343 IntegralToFloating,1343 IntegralToFloating,
1344 FloatingToFixedPoint,
1345 FixedPointToFloating,
1344 FixedPointCast,1346 FixedPointCast,
1345 FixedPointToIntegral,1347 FixedPointToIntegral,
1346 IntegralToFixedPoint,1348 IntegralToFixedPoint,
...@@ -1447,6 +1449,7 @@ pub const DeclKind = extern enum {...@@ -1447,6 +1449,7 @@ pub const DeclKind = extern enum {
1447 MSGuid,1449 MSGuid,
1448 OMPDeclareMapper,1450 OMPDeclareMapper,
1449 OMPDeclareReduction,1451 OMPDeclareReduction,
1452 TemplateParamObject,
1450 UnresolvedUsingValue,1453 UnresolvedUsingValue,
1451 OMPAllocate,1454 OMPAllocate,
1452 OMPRequires,1455 OMPRequires,
...@@ -1557,6 +1560,8 @@ pub const BuiltinTypeKind = extern enum {...@@ -1557,6 +1560,8 @@ pub const BuiltinTypeKind = extern enum {
1557 SveFloat64x4,1560 SveFloat64x4,
1558 SveBFloat16x4,1561 SveBFloat16x4,
1559 SveBool,1562 SveBool,
1563 VectorQuad,
1564 VectorPair,
1560 Void,1565 Void,
1561 Bool,1566 Bool,
1562 Char_U,1567 Char_U,
...@@ -1710,9 +1715,11 @@ pub const PreprocessedEntity_EntityKind = extern enum {...@@ -1710,9 +1715,11 @@ pub const PreprocessedEntity_EntityKind = extern enum {
1710 InclusionDirectiveKind,1715 InclusionDirectiveKind,
1711};1716};
17121717
1713pub const Expr_ConstExprUsage = extern enum {1718pub const Expr_ConstantExprKind = extern enum {
1714 EvaluateForCodeGen,1719 Normal,
1715 EvaluateForMangling,1720 NonClassTemplateArgument,
1721 ClassTemplateArgument,
1722 ImmediateInvocation,
1716};1723};
17171724
1718pub const UnaryExprOrTypeTrait_Kind = extern enum {1725pub const UnaryExprOrTypeTrait_Kind = extern enum {
src/clang_options_data.zig+181-78
...@@ -15,7 +15,7 @@ flagpd1("CC"),...@@ -15,7 +15,7 @@ flagpd1("CC"),
15flagpd1("EB"),15flagpd1("EB"),
16flagpd1("EL"),16flagpd1("EL"),
17flagpd1("Eonly"),17flagpd1("Eonly"),
18flagpd1("fAAPCSBitfieldLoad"),18flagpd1("faapcs-bitfield-load"),
19flagpd1("H"),19flagpd1("H"),
20.{20.{
21 .name = "<input>",21 .name = "<input>",
...@@ -1027,14 +1027,6 @@ flagpsl("MT"),...@@ -1027,14 +1027,6 @@ flagpsl("MT"),
1027 .pd2 = false,1027 .pd2 = false,
1028 .psl = true,1028 .psl = true,
1029},1029},
1030.{
1031 .name = "Zd",
1032 .syntax = .flag,
1033 .zig_equivalent = .other,
1034 .pd1 = true,
1035 .pd2 = false,
1036 .psl = true,
1037},
1038.{1030.{
1039 .name = "Ze",1031 .name = "Ze",
1040 .syntax = .flag,1032 .syntax = .flag,
...@@ -2073,49 +2065,7 @@ flagpd1("analyzer-viz-egraph-graphviz"),...@@ -2073,49 +2065,7 @@ flagpd1("analyzer-viz-egraph-graphviz"),
2073flagpd1("analyzer-werror"),2065flagpd1("analyzer-werror"),
2074flagpd1("fslp-vectorize-aggressive"),2066flagpd1("fslp-vectorize-aggressive"),
2075flagpd1("fno-slp-vectorize-aggressive"),2067flagpd1("fno-slp-vectorize-aggressive"),
2076flagpd1("fno-record-gcc-switches"),2068flagpd1("shared-libasan"),
2077flagpd1("fexpensive-optimizations"),
2078flagpd1("fno-expensive-optimizations"),
2079flagpd1("fdefer-pop"),
2080flagpd1("fno-defer-pop"),
2081flagpd1("fextended-identifiers"),
2082flagpd1("fno-extended-identifiers"),
2083flagpd1("fhonor-infinites"),
2084flagpd1("fno-honor-infinites"),
2085flagpd1("findirect-virtual-calls"),
2086sepd1("fnew-alignment"),
2087flagpd1("faligned-new"),
2088flagpd1("fno-aligned-new"),
2089flagpd1("fsched-interblock"),
2090flagpd1("ftree-vectorize"),
2091flagpd1("fno-tree-vectorize"),
2092flagpd1("ftree-slp-vectorize"),
2093flagpd1("fno-tree-slp-vectorize"),
2094flagpd1("fident"),
2095flagpd1("fterminated-vtables"),
2096flagpd1("grecord-gcc-switches"),
2097flagpd1("gno-record-gcc-switches"),
2098flagpd1("nocudainc"),
2099flagpd1("nocudalib"),
2100.{
2101 .name = "system-header-prefix",
2102 .syntax = .separate,
2103 .zig_equivalent = .other,
2104 .pd1 = false,
2105 .pd2 = true,
2106 .psl = false,
2107},
2108.{
2109 .name = "no-system-header-prefix",
2110 .syntax = .separate,
2111 .zig_equivalent = .other,
2112 .pd1 = false,
2113 .pd2 = true,
2114 .psl = false,
2115},
2116flagpd1("integrated-as"),
2117flagpd1("no-integrated-as"),
2118flagpd1("fno-ident"),
2119.{2069.{
2120 .name = "Gs",2070 .name = "Gs",
2121 .syntax = .flag,2071 .syntax = .flag,
...@@ -2196,7 +2146,6 @@ flagpd1("fno-ident"),...@@ -2196,7 +2146,6 @@ flagpd1("fno-ident"),
2196 .pd2 = false,2146 .pd2 = false,
2197 .psl = true,2147 .psl = true,
2198},2148},
2199flagpd1("fcuda-rdc"),
2200.{2149.{
2201 .name = "Os",2150 .name = "Os",
2202 .syntax = .flag,2151 .syntax = .flag,
...@@ -2237,9 +2186,52 @@ flagpd1("fcuda-rdc"),...@@ -2237,9 +2186,52 @@ flagpd1("fcuda-rdc"),
2237 .pd2 = false,2186 .pd2 = false,
2238 .psl = true,2187 .psl = true,
2239},2188},
2240flagpd1("fno-cuda-rdc"),
2241flagpd1("shared-libasan"),
2242flagpd1("frecord-gcc-switches"),2189flagpd1("frecord-gcc-switches"),
2190flagpd1("fno-record-gcc-switches"),
2191flagpd1("fident"),
2192flagpd1("fno-ident"),
2193flagpd1("fexpensive-optimizations"),
2194flagpd1("fno-expensive-optimizations"),
2195flagpd1("fdefer-pop"),
2196flagpd1("fno-defer-pop"),
2197flagpd1("fextended-identifiers"),
2198flagpd1("fno-extended-identifiers"),
2199flagpd1("fhonor-infinites"),
2200flagpd1("fno-honor-infinites"),
2201flagpd1("fcuda-rdc"),
2202flagpd1("fno-cuda-rdc"),
2203flagpd1("findirect-virtual-calls"),
2204sepd1("fnew-alignment"),
2205flagpd1("faligned-new"),
2206flagpd1("fno-aligned-new"),
2207flagpd1("fsched-interblock"),
2208flagpd1("ftree-vectorize"),
2209flagpd1("fno-tree-vectorize"),
2210flagpd1("ftree-slp-vectorize"),
2211flagpd1("fno-tree-slp-vectorize"),
2212flagpd1("fterminated-vtables"),
2213flagpd1("grecord-gcc-switches"),
2214flagpd1("gno-record-gcc-switches"),
2215flagpd1("nocudainc"),
2216flagpd1("nocudalib"),
2217.{
2218 .name = "system-header-prefix",
2219 .syntax = .separate,
2220 .zig_equivalent = .other,
2221 .pd1 = false,
2222 .pd2 = true,
2223 .psl = false,
2224},
2225.{
2226 .name = "no-system-header-prefix",
2227 .syntax = .separate,
2228 .zig_equivalent = .other,
2229 .pd1 = false,
2230 .pd2 = true,
2231 .psl = false,
2232},
2233flagpd1("integrated-as"),
2234flagpd1("no-integrated-as"),
2243.{2235.{
2244 .name = "ansi",2236 .name = "ansi",
2245 .syntax = .flag,2237 .syntax = .flag,
...@@ -2251,11 +2243,8 @@ flagpd1("frecord-gcc-switches"),...@@ -2251,11 +2243,8 @@ flagpd1("frecord-gcc-switches"),
2251sepd1("arch"),2243sepd1("arch"),
2252flagpd1("arch_errors_fatal"),2244flagpd1("arch_errors_fatal"),
2253sepd1("arch_only"),2245sepd1("arch_only"),
2254flagpd1("arcmt-check"),
2255flagpd1("arcmt-migrate"),
2256flagpd1("arcmt-migrate-emit-errors"),2246flagpd1("arcmt-migrate-emit-errors"),
2257sepd1("arcmt-migrate-report-output"),2247sepd1("arcmt-migrate-report-output"),
2258flagpd1("arcmt-modify"),
2259flagpd1("ast-dump"),2248flagpd1("ast-dump"),
2260flagpd1("ast-dump-all"),2249flagpd1("ast-dump-all"),
2261flagpd1("ast-dump-decl-types"),2250flagpd1("ast-dump-decl-types"),
...@@ -2458,6 +2447,7 @@ flagpd1("emit-pch"),...@@ -2458,6 +2447,7 @@ flagpd1("emit-pch"),
2458},2447},
2459flagpd1("enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang"),2448flagpd1("enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang"),
2460sepd1("error-on-deserialized-decl"),2449sepd1("error-on-deserialized-decl"),
2450sepd1("exception-model"),
2461sepd1("exported_symbols_list"),2451sepd1("exported_symbols_list"),
2462.{2452.{
2463 .name = "fPIC",2453 .name = "fPIC",
...@@ -2475,7 +2465,8 @@ sepd1("exported_symbols_list"),...@@ -2475,7 +2465,8 @@ sepd1("exported_symbols_list"),
2475 .pd2 = false,2465 .pd2 = false,
2476 .psl = false,2466 .psl = false,
2477},2467},
2478flagpd1("fno-access-control"),2468flagpd1("faapcs-bitfield-width"),
2469flagpd1("faccess-control"),
2479flagpd1("faddrsig"),2470flagpd1("faddrsig"),
2480flagpd1("faggressive-function-elimination"),2471flagpd1("faggressive-function-elimination"),
2481flagpd1("falign-commons"),2472flagpd1("falign-commons"),
...@@ -2488,6 +2479,7 @@ flagpd1("fall-intrinsics"),...@@ -2488,6 +2479,7 @@ flagpd1("fall-intrinsics"),
2488flagpd1("fallow-editor-placeholders"),2479flagpd1("fallow-editor-placeholders"),
2489flagpd1("fallow-half-arguments-and-returns"),2480flagpd1("fallow-half-arguments-and-returns"),
2490flagpd1("fallow-pch-with-compiler-errors"),2481flagpd1("fallow-pch-with-compiler-errors"),
2482flagpd1("fallow-pcm-with-compiler-errors"),
2491flagpd1("fallow-unsupported"),2483flagpd1("fallow-unsupported"),
2492flagpd1("faltivec"),2484flagpd1("faltivec"),
2493flagpd1("fkeep-inline-functions"),2485flagpd1("fkeep-inline-functions"),
...@@ -2497,6 +2489,7 @@ flagpd1("fapple-link-rtlib"),...@@ -2497,6 +2489,7 @@ flagpd1("fapple-link-rtlib"),
2497flagpd1("fapple-pragma-pack"),2489flagpd1("fapple-pragma-pack"),
2498flagpd1("fapplication-extension"),2490flagpd1("fapplication-extension"),
2499flagpd1("fapply-global-visibility-to-externs"),2491flagpd1("fapply-global-visibility-to-externs"),
2492flagpd1("fapprox-func"),
2500flagpd1("fasm"),2493flagpd1("fasm"),
2501flagpd1("fasm-blocks"),2494flagpd1("fasm-blocks"),
2502flagpd1("fassociative-math"),2495flagpd1("fassociative-math"),
...@@ -2597,6 +2590,7 @@ flagpd1("fdiagnostics-show-note-include-stack"),...@@ -2597,6 +2590,7 @@ flagpd1("fdiagnostics-show-note-include-stack"),
2597flagpd1("fdiagnostics-show-option"),2590flagpd1("fdiagnostics-show-option"),
2598flagpd1("fdiagnostics-show-template-tree"),2591flagpd1("fdiagnostics-show-template-tree"),
2599flagpd1("fdigraphs"),2592flagpd1("fdigraphs"),
2593flagpd1("fdirect-access-external-data"),
2600flagpd1("fdisable-module-hash"),2594flagpd1("fdisable-module-hash"),
2601flagpd1("fdiscard-value-names"),2595flagpd1("fdiscard-value-names"),
2602flagpd1("fdollar-ok"),2596flagpd1("fdollar-ok"),
...@@ -2617,14 +2611,13 @@ flagpd1("feliminate-unused-debug-types"),...@@ -2617,14 +2611,13 @@ flagpd1("feliminate-unused-debug-types"),
2617flagpd1("fembed-bitcode"),2611flagpd1("fembed-bitcode"),
2618flagpd1("fembed-bitcode-marker"),2612flagpd1("fembed-bitcode-marker"),
2619flagpd1("femit-all-decls"),2613flagpd1("femit-all-decls"),
2620flagpd1("femit-coverage-data"),
2621flagpd1("femit-coverage-notes"),
2622flagpd1("femulated-tls"),2614flagpd1("femulated-tls"),
2623flagpd1("fenable-matrix"),2615flagpd1("fenable-matrix"),
2624flagpd1("fencode-extended-block-signature"),2616flagpd1("fencode-extended-block-signature"),
2625sepd1("ferror-limit"),2617sepd1("ferror-limit"),
2626flagpd1("fescaping-block-tail-calls"),2618flagpd1("fescaping-block-tail-calls"),
2627flagpd1("fexceptions"),2619flagpd1("fexceptions"),
2620flagpd1("fexperimental-debug-variable-locations"),
2628flagpd1("fexperimental-isel"),2621flagpd1("fexperimental-isel"),
2629flagpd1("fexperimental-new-constant-interpreter"),2622flagpd1("fexperimental-new-constant-interpreter"),
2630flagpd1("fexperimental-new-pass-manager"),2623flagpd1("fexperimental-new-pass-manager"),
...@@ -2638,6 +2631,7 @@ flagpd1("ffast-math"),...@@ -2638,6 +2631,7 @@ flagpd1("ffast-math"),
2638flagpd1("ffat-lto-objects"),2631flagpd1("ffat-lto-objects"),
2639flagpd1("fcheck-new"),2632flagpd1("fcheck-new"),
2640flagpd1("ffine-grained-bitfield-accesses"),2633flagpd1("ffine-grained-bitfield-accesses"),
2634flagpd1("ffinite-loops"),
2641flagpd1("ffinite-math-only"),2635flagpd1("ffinite-math-only"),
2642flagpd1("finline-limit"),2636flagpd1("finline-limit"),
2643flagpd1("ffixed-form"),2637flagpd1("ffixed-form"),
...@@ -2698,7 +2692,10 @@ flagpd1("fgnu-inline-asm"),...@@ -2698,7 +2692,10 @@ flagpd1("fgnu-inline-asm"),
2698flagpd1("fgnu-keywords"),2692flagpd1("fgnu-keywords"),
2699flagpd1("fgnu-runtime"),2693flagpd1("fgnu-runtime"),
2700flagpd1("fgpu-allow-device-init"),2694flagpd1("fgpu-allow-device-init"),
2695flagpd1("fgpu-defer-diag"),
2696flagpd1("fgpu-exclude-wrong-side-overloads"),
2701flagpd1("fgpu-rdc"),2697flagpd1("fgpu-rdc"),
2698flagpd1("fhalf-no-semantic-interposition"),
2702flagpd1("fheinous-gnu-extensions"),2699flagpd1("fheinous-gnu-extensions"),
2703flagpd1("fhip-dump-offload-linker-script"),2700flagpd1("fhip-dump-offload-linker-script"),
2704flagpd1("fhip-new-launch-api"),2701flagpd1("fhip-new-launch-api"),
...@@ -2738,6 +2735,7 @@ flagpd1("fjump-tables"),...@@ -2738,6 +2735,7 @@ flagpd1("fjump-tables"),
2738flagpd1("fkeep-static-consts"),2735flagpd1("fkeep-static-consts"),
2739flagpd1("flat_namespace"),2736flagpd1("flat_namespace"),
2740flagpd1("flax-vector-conversions"),2737flagpd1("flax-vector-conversions"),
2738flagpd1("flegacy-pass-manager"),
2741flagpd1("flimit-debug-info"),2739flagpd1("flimit-debug-info"),
2742.{2740.{
2743 .name = "flto",2741 .name = "flto",
...@@ -2752,6 +2750,7 @@ flagpd1("flto-visibility-public-std"),...@@ -2752,6 +2750,7 @@ flagpd1("flto-visibility-public-std"),
2752sepd1("fmacro-backtrace-limit"),2750sepd1("fmacro-backtrace-limit"),
2753flagpd1("fmath-errno"),2751flagpd1("fmath-errno"),
2754flagpd1("fmax-identifier-length"),2752flagpd1("fmax-identifier-length"),
2753flagpd1("fmemory-profile"),
2755flagpd1("fmerge-all-constants"),2754flagpd1("fmerge-all-constants"),
2756flagpd1("fmerge-constants"),2755flagpd1("fmerge-constants"),
2757flagpd1("fmerge-functions"),2756flagpd1("fmerge-functions"),
...@@ -2804,7 +2803,8 @@ flagpd1("fnext-runtime"),...@@ -2804,7 +2803,8 @@ flagpd1("fnext-runtime"),
2804 .pd2 = false,2803 .pd2 = false,
2805 .psl = false,2804 .psl = false,
2806},2805},
2807flagpd1("fno-no-access-control"),2806flagpd1("fno-aapcs-bitfield-width"),
2807flagpd1("fno-access-control"),
2808flagpd1("fno-addrsig"),2808flagpd1("fno-addrsig"),
2809flagpd1("fno-aggressive-function-elimination"),2809flagpd1("fno-aggressive-function-elimination"),
2810flagpd1("fno-align-commons"),2810flagpd1("fno-align-commons"),
...@@ -2882,6 +2882,7 @@ flagpd1("fno-diagnostics-show-note-include-stack"),...@@ -2882,6 +2882,7 @@ flagpd1("fno-diagnostics-show-note-include-stack"),
2882flagpd1("fno-diagnostics-show-option"),2882flagpd1("fno-diagnostics-show-option"),
2883flagpd1("fno-diagnostics-use-presumed-location"),2883flagpd1("fno-diagnostics-use-presumed-location"),
2884flagpd1("fno-digraphs"),2884flagpd1("fno-digraphs"),
2885flagpd1("fno-direct-access-external-data"),
2885flagpd1("fno-discard-value-names"),2886flagpd1("fno-discard-value-names"),
2886flagpd1("fno-dllexport-inlines"),2887flagpd1("fno-dllexport-inlines"),
2887flagpd1("fno-dollar-ok"),2888flagpd1("fno-dollar-ok"),
...@@ -2908,6 +2909,7 @@ flagpd1("fno-fast-math"),...@@ -2908,6 +2909,7 @@ flagpd1("fno-fast-math"),
2908flagpd1("fno-fat-lto-objects"),2909flagpd1("fno-fat-lto-objects"),
2909flagpd1("fno-check-new"),2910flagpd1("fno-check-new"),
2910flagpd1("fno-fine-grained-bitfield-accesses"),2911flagpd1("fno-fine-grained-bitfield-accesses"),
2912flagpd1("fno-finite-loops"),
2911flagpd1("fno-finite-math-only"),2913flagpd1("fno-finite-math-only"),
2912flagpd1("fno-inline-limit"),2914flagpd1("fno-inline-limit"),
2913flagpd1("fno-fixed-form"),2915flagpd1("fno-fixed-form"),
...@@ -2932,6 +2934,8 @@ flagpd1("fno-gnu89-inline"),...@@ -2932,6 +2934,8 @@ flagpd1("fno-gnu89-inline"),
2932flagpd1("fno-gnu-inline-asm"),2934flagpd1("fno-gnu-inline-asm"),
2933flagpd1("fno-gnu-keywords"),2935flagpd1("fno-gnu-keywords"),
2934flagpd1("fno-gpu-allow-device-init"),2936flagpd1("fno-gpu-allow-device-init"),
2937flagpd1("fno-gpu-defer-diag"),
2938flagpd1("fno-gpu-exclude-wrong-side-overloads"),
2935flagpd1("fno-gpu-rdc"),2939flagpd1("fno-gpu-rdc"),
2936flagpd1("fno-hip-new-launch-api"),2940flagpd1("fno-hip-new-launch-api"),
2937flagpd1("fno-honor-infinities"),2941flagpd1("fno-honor-infinities"),
...@@ -2955,6 +2959,7 @@ flagpd1("fno-ivopts"),...@@ -2955,6 +2959,7 @@ flagpd1("fno-ivopts"),
2955flagpd1("fno-jump-tables"),2959flagpd1("fno-jump-tables"),
2956flagpd1("fno-keep-static-consts"),2960flagpd1("fno-keep-static-consts"),
2957flagpd1("fno-lax-vector-conversions"),2961flagpd1("fno-lax-vector-conversions"),
2962flagpd1("fno-legacy-pass-manager"),
2958flagpd1("fno-limit-debug-info"),2963flagpd1("fno-limit-debug-info"),
2959.{2964.{
2960 .name = "fno-lto",2965 .name = "fno-lto",
...@@ -2969,6 +2974,7 @@ flagpd1("fno-math-builtin"),...@@ -2969,6 +2974,7 @@ flagpd1("fno-math-builtin"),
2969flagpd1("fno-math-errno"),2974flagpd1("fno-math-errno"),
2970flagpd1("fno-max-identifier-length"),2975flagpd1("fno-max-identifier-length"),
2971flagpd1("fno-max-type-align"),2976flagpd1("fno-max-type-align"),
2977flagpd1("fno-memory-profile"),
2972flagpd1("fno-merge-all-constants"),2978flagpd1("fno-merge-all-constants"),
2973flagpd1("fno-merge-constants"),2979flagpd1("fno-merge-constants"),
2974flagpd1("fno-module-file-deps"),2980flagpd1("fno-module-file-deps"),
...@@ -3018,6 +3024,7 @@ flagpd1("fno-permissive"),...@@ -3018,6 +3024,7 @@ flagpd1("fno-permissive"),
3018flagpd1("fno-pic"),3024flagpd1("fno-pic"),
3019flagpd1("fno-pie"),3025flagpd1("fno-pie"),
3020flagpd1("fno-plt"),3026flagpd1("fno-plt"),
3027flagpd1("fno-prebuilt-implicit-modules"),
3021flagpd1("fno-prefetch-loop-arrays"),3028flagpd1("fno-prefetch-loop-arrays"),
3022flagpd1("fno-preserve-as-comments"),3029flagpd1("fno-preserve-as-comments"),
3023flagpd1("fno-printf"),3030flagpd1("fno-printf"),
...@@ -3034,6 +3041,7 @@ flagpd1("fno-profile-sample-use"),...@@ -3034,6 +3041,7 @@ flagpd1("fno-profile-sample-use"),
3034flagpd1("fno-profile-use"),3041flagpd1("fno-profile-use"),
3035flagpd1("fno-profile-values"),3042flagpd1("fno-profile-values"),
3036flagpd1("fno-protect-parens"),3043flagpd1("fno-protect-parens"),
3044flagpd1("fno-pseudo-probe-for-profiling"),
3037flagpd1("fno-range-check"),3045flagpd1("fno-range-check"),
3038flagpd1("fno-real-4-real-10"),3046flagpd1("fno-real-4-real-10"),
3039flagpd1("fno-real-4-real-16"),3047flagpd1("fno-real-4-real-16"),
...@@ -3104,6 +3112,7 @@ flagpd1("fno-spec-constr-count"),...@@ -3104,6 +3112,7 @@ flagpd1("fno-spec-constr-count"),
3104flagpd1("fno-spell-checking"),3112flagpd1("fno-spell-checking"),
3105flagpd1("fno-split-dwarf-inlining"),3113flagpd1("fno-split-dwarf-inlining"),
3106flagpd1("fno-split-lto-unit"),3114flagpd1("fno-split-lto-unit"),
3115flagpd1("fno-split-machine-functions"),
3107flagpd1("fno-stack-arrays"),3116flagpd1("fno-stack-arrays"),
3108flagpd1("fno-stack-check"),3117flagpd1("fno-stack-check"),
3109flagpd1("fno-stack-clash-protection"),3118flagpd1("fno-stack-clash-protection"),
...@@ -3154,6 +3163,8 @@ flagpd1("fno-vect-cost-model"),...@@ -3154,6 +3163,8 @@ flagpd1("fno-vect-cost-model"),
3154flagpd1("fno-vectorize"),3163flagpd1("fno-vectorize"),
3155flagpd1("fno-verbose-asm"),3164flagpd1("fno-verbose-asm"),
3156flagpd1("fno-virtual-function-elimination"),3165flagpd1("fno-virtual-function-elimination"),
3166flagpd1("fno-visibility-from-dllstorageclass"),
3167flagpd1("fno-visibility-inlines-hidden-static-local-var"),
3157flagpd1("fno-wchar"),3168flagpd1("fno-wchar"),
3158flagpd1("fno-web"),3169flagpd1("fno-web"),
3159flagpd1("fno-whole-file"),3170flagpd1("fno-whole-file"),
...@@ -3161,6 +3172,7 @@ flagpd1("fno-whole-program"),...@@ -3161,6 +3172,7 @@ flagpd1("fno-whole-program"),
3161flagpd1("fno-whole-program-vtables"),3172flagpd1("fno-whole-program-vtables"),
3162flagpd1("fno-working-directory"),3173flagpd1("fno-working-directory"),
3163flagpd1("fno-wrapv"),3174flagpd1("fno-wrapv"),
3175flagpd1("fno-xl-pragma-pack"),
3164flagpd1("fno-xray-always-emit-customevents"),3176flagpd1("fno-xray-always-emit-customevents"),
3165flagpd1("fno-xray-always-emit-typedevents"),3177flagpd1("fno-xray-always-emit-typedevents"),
3166flagpd1("fno-xray-function-index"),3178flagpd1("fno-xray-function-index"),
...@@ -3212,6 +3224,7 @@ flagpd1("fpack-struct"),...@@ -3212,6 +3224,7 @@ flagpd1("fpack-struct"),
3212flagpd1("fpadding-on-unsigned-fixed-point"),3224flagpd1("fpadding-on-unsigned-fixed-point"),
3213flagpd1("fparse-all-comments"),3225flagpd1("fparse-all-comments"),
3214flagpd1("fpascal-strings"),3226flagpd1("fpascal-strings"),
3227flagpd1("fpass-by-value-is-noalias"),
3215flagpd1("fpcc-struct-return"),3228flagpd1("fpcc-struct-return"),
3216flagpd1("fpch-codegen"),3229flagpd1("fpch-codegen"),
3217flagpd1("fpch-debuginfo"),3230flagpd1("fpch-debuginfo"),
...@@ -3223,6 +3236,7 @@ flagpd1("fpermissive"),...@@ -3223,6 +3236,7 @@ flagpd1("fpermissive"),
3223flagpd1("fpic"),3236flagpd1("fpic"),
3224flagpd1("fpie"),3237flagpd1("fpie"),
3225flagpd1("fplt"),3238flagpd1("fplt"),
3239flagpd1("fprebuilt-implicit-modules"),
3226flagpd1("fprefetch-loop-arrays"),3240flagpd1("fprefetch-loop-arrays"),
3227flagpd1("fpreserve-as-comments"),3241flagpd1("fpreserve-as-comments"),
3228flagpd1("fpreserve-vec3-type"),3242flagpd1("fpreserve-vec3-type"),
...@@ -3241,6 +3255,7 @@ flagpd1("fprofile-sample-use"),...@@ -3241,6 +3255,7 @@ flagpd1("fprofile-sample-use"),
3241flagpd1("fprofile-use"),3255flagpd1("fprofile-use"),
3242flagpd1("fprofile-values"),3256flagpd1("fprofile-values"),
3243flagpd1("fprotect-parens"),3257flagpd1("fprotect-parens"),
3258flagpd1("fpseudo-probe-for-profiling"),
3244.{3259.{
3245 .name = "framework",3260 .name = "framework",
3246 .syntax = .separate,3261 .syntax = .separate,
...@@ -3340,6 +3355,7 @@ flagpd1("fspell-checking"),...@@ -3340,6 +3355,7 @@ flagpd1("fspell-checking"),
3340sepd1("fspell-checking-limit"),3355sepd1("fspell-checking-limit"),
3341flagpd1("fsplit-dwarf-inlining"),3356flagpd1("fsplit-dwarf-inlining"),
3342flagpd1("fsplit-lto-unit"),3357flagpd1("fsplit-lto-unit"),
3358flagpd1("fsplit-machine-functions"),
3343flagpd1("fsplit-stack"),3359flagpd1("fsplit-stack"),
3344flagpd1("fstack-arrays"),3360flagpd1("fstack-arrays"),
3345flagpd1("fstack-check"),3361flagpd1("fstack-check"),
...@@ -3395,6 +3411,7 @@ flagpd1("funsigned-bitfields"),...@@ -3395,6 +3411,7 @@ flagpd1("funsigned-bitfields"),
3395flagpd1("funsigned-char"),3411flagpd1("funsigned-char"),
3396flagpd1("funswitch-loops"),3412flagpd1("funswitch-loops"),
3397flagpd1("funwind-tables"),3413flagpd1("funwind-tables"),
3414flagpd1("fuse-ctor-homing"),
3398flagpd1("fuse-cxa-atexit"),3415flagpd1("fuse-cxa-atexit"),
3399flagpd1("fuse-init-array"),3416flagpd1("fuse-init-array"),
3400flagpd1("fuse-line-directives"),3417flagpd1("fuse-line-directives"),
...@@ -3407,8 +3424,10 @@ flagpd1("fvectorize"),...@@ -3407,8 +3424,10 @@ flagpd1("fvectorize"),
3407flagpd1("fverbose-asm"),3424flagpd1("fverbose-asm"),
3408flagpd1("fvirtual-function-elimination"),3425flagpd1("fvirtual-function-elimination"),
3409sepd1("fvisibility"),3426sepd1("fvisibility"),
3427flagpd1("fvisibility-from-dllstorageclass"),
3410flagpd1("fvisibility-global-new-delete-hidden"),3428flagpd1("fvisibility-global-new-delete-hidden"),
3411flagpd1("fvisibility-inlines-hidden"),3429flagpd1("fvisibility-inlines-hidden"),
3430flagpd1("fvisibility-inlines-hidden-static-local-var"),
3412flagpd1("fvisibility-ms-compat"),3431flagpd1("fvisibility-ms-compat"),
3413flagpd1("fwasm-exceptions"),3432flagpd1("fwasm-exceptions"),
3414flagpd1("fweb"),3433flagpd1("fweb"),
...@@ -3417,6 +3436,7 @@ flagpd1("fwhole-program"),...@@ -3417,6 +3436,7 @@ flagpd1("fwhole-program"),
3417flagpd1("fwhole-program-vtables"),3436flagpd1("fwhole-program-vtables"),
3418flagpd1("fwrapv"),3437flagpd1("fwrapv"),
3419flagpd1("fwritable-strings"),3438flagpd1("fwritable-strings"),
3439flagpd1("fxl-pragma-pack"),
3420flagpd1("fxray-always-emit-customevents"),3440flagpd1("fxray-always-emit-customevents"),
3421flagpd1("fxray-always-emit-typedevents"),3441flagpd1("fxray-always-emit-typedevents"),
3422flagpd1("fxray-function-index"),3442flagpd1("fxray-function-index"),
...@@ -3449,6 +3469,8 @@ flagpd1("gcodeview"),...@@ -3449,6 +3469,8 @@ flagpd1("gcodeview"),
3449flagpd1("gcodeview-ghash"),3469flagpd1("gcodeview-ghash"),
3450flagpd1("gcolumn-info"),3470flagpd1("gcolumn-info"),
3451flagpd1("gdwarf"),3471flagpd1("gdwarf"),
3472flagpd1("gdwarf32"),
3473flagpd1("gdwarf64"),
3452flagpd1("gdwarf-2"),3474flagpd1("gdwarf-2"),
3453flagpd1("gdwarf-3"),3475flagpd1("gdwarf-3"),
3454flagpd1("gdwarf-4"),3476flagpd1("gdwarf-4"),
...@@ -3484,6 +3506,7 @@ flagpd1("gno-gnu-pubnames"),...@@ -3484,6 +3506,7 @@ flagpd1("gno-gnu-pubnames"),
3484flagpd1("gno-inline-line-tables"),3506flagpd1("gno-inline-line-tables"),
3485flagpd1("gno-pubnames"),3507flagpd1("gno-pubnames"),
3486flagpd1("gno-record-command-line"),3508flagpd1("gno-record-command-line"),
3509flagpd1("gno-split-dwarf"),
3487flagpd1("gno-strict-dwarf"),3510flagpd1("gno-strict-dwarf"),
3488.{3511.{
3489 .name = "gpu-use-aux-triple-only",3512 .name = "gpu-use-aux-triple-only",
...@@ -3538,6 +3561,8 @@ flagpd1("m64"),...@@ -3538,6 +3561,8 @@ flagpd1("m64"),
3538flagpd1("m80387"),3561flagpd1("m80387"),
3539flagpd1("mseses"),3562flagpd1("mseses"),
3540flagpd1("mabi=ieeelongdouble"),3563flagpd1("mabi=ieeelongdouble"),
3564flagpd1("mabi=vec-default"),
3565flagpd1("mabi=vec-extabi"),
3541flagpd1("mabicalls"),3566flagpd1("mabicalls"),
3542flagpd1("madx"),3567flagpd1("madx"),
3543flagpd1("maes"),3568flagpd1("maes"),
...@@ -3568,6 +3593,7 @@ flagpd1("mavx512vl"),...@@ -3568,6 +3593,7 @@ flagpd1("mavx512vl"),
3568flagpd1("mavx512vnni"),3593flagpd1("mavx512vnni"),
3569flagpd1("mavx512vp2intersect"),3594flagpd1("mavx512vp2intersect"),
3570flagpd1("mavx512vpopcntdq"),3595flagpd1("mavx512vpopcntdq"),
3596flagpd1("mavxvnni"),
3571flagpd1("mbackchain"),3597flagpd1("mbackchain"),
3572flagpd1("mbig-endian"),3598flagpd1("mbig-endian"),
3573flagpd1("mbmi"),3599flagpd1("mbmi"),
...@@ -3600,6 +3626,7 @@ flagpd1("mdouble-float"),...@@ -3600,6 +3626,7 @@ flagpd1("mdouble-float"),
3600flagpd1("mdsp"),3626flagpd1("mdsp"),
3601flagpd1("mdspr2"),3627flagpd1("mdspr2"),
3602sepd1("meabi"),3628sepd1("meabi"),
3629flagpd1("mefpu2"),
3603flagpd1("membedded-data"),3630flagpd1("membedded-data"),
3604flagpd1("menable-experimental-extensions"),3631flagpd1("menable-experimental-extensions"),
3605flagpd1("menable-no-infs"),3632flagpd1("menable-no-infs"),
...@@ -3633,10 +3660,12 @@ flagpd1("mglobal-merge"),...@@ -3633,10 +3660,12 @@ flagpd1("mglobal-merge"),
3633flagpd1("mgpopt"),3660flagpd1("mgpopt"),
3634flagpd1("mhard-float"),3661flagpd1("mhard-float"),
3635flagpd1("mhvx"),3662flagpd1("mhvx"),
3663flagpd1("mhreset"),
3636flagpd1("mhtm"),3664flagpd1("mhtm"),
3637flagpd1("miamcu"),3665flagpd1("miamcu"),
3638flagpd1("mieee-fp"),3666flagpd1("mieee-fp"),
3639flagpd1("mieee-rnd-near"),3667flagpd1("mieee-rnd-near"),
3668flagpd1("mignore-xcoff-visibility"),
3640flagpd1("migrate"),3669flagpd1("migrate"),
3641flagpd1("no-finalize-removal"),3670flagpd1("no-finalize-removal"),
3642flagpd1("no-ns-alloc-error"),3671flagpd1("no-ns-alloc-error"),
...@@ -3663,6 +3692,7 @@ flagpd1("mips64r5"),...@@ -3663,6 +3692,7 @@ flagpd1("mips64r5"),
3663flagpd1("mips64r6"),3692flagpd1("mips64r6"),
3664flagpd1("misel"),3693flagpd1("misel"),
3665flagpd1("mkernel"),3694flagpd1("mkernel"),
3695flagpd1("mkl"),
3666flagpd1("mldc1-sdc1"),3696flagpd1("mldc1-sdc1"),
3667sepd1("mlimit-float-precision"),3697sepd1("mlimit-float-precision"),
3668sepd1("mlink-bitcode-file"),3698sepd1("mlink-bitcode-file"),
...@@ -3681,10 +3711,12 @@ flagpd1("mlvi-hardening"),...@@ -3681,10 +3711,12 @@ flagpd1("mlvi-hardening"),
3681flagpd1("mlwp"),3711flagpd1("mlwp"),
3682flagpd1("mlzcnt"),3712flagpd1("mlzcnt"),
3683flagpd1("mmadd4"),3713flagpd1("mmadd4"),
3714flagpd1("mmark-bti-property"),
3684flagpd1("mmemops"),3715flagpd1("mmemops"),
3685flagpd1("mmfcrf"),3716flagpd1("mmfcrf"),
3686flagpd1("mmfocrf"),3717flagpd1("mmfocrf"),
3687flagpd1("mmicromips"),3718flagpd1("mmicromips"),
3719flagpd1("mmma"),
3688flagpd1("mmmx"),3720flagpd1("mmmx"),
3689flagpd1("mmovbe"),3721flagpd1("mmovbe"),
3690flagpd1("mmovdir64b"),3722flagpd1("mmovdir64b"),
...@@ -3724,6 +3756,7 @@ flagpd1("mno-avx512vl"),...@@ -3724,6 +3756,7 @@ flagpd1("mno-avx512vl"),
3724flagpd1("mno-avx512vnni"),3756flagpd1("mno-avx512vnni"),
3725flagpd1("mno-avx512vp2intersect"),3757flagpd1("mno-avx512vp2intersect"),
3726flagpd1("mno-avx512vpopcntdq"),3758flagpd1("mno-avx512vpopcntdq"),
3759flagpd1("mno-avxvnni"),
3727flagpd1("mno-backchain"),3760flagpd1("mno-backchain"),
3728flagpd1("mno-bmi"),3761flagpd1("mno-bmi"),
3729flagpd1("mno-bmi2"),3762flagpd1("mno-bmi2"),
...@@ -3762,6 +3795,7 @@ flagpd1("mno-ginv"),...@@ -3762,6 +3795,7 @@ flagpd1("mno-ginv"),
3762flagpd1("mno-global-merge"),3795flagpd1("mno-global-merge"),
3763flagpd1("mno-gpopt"),3796flagpd1("mno-gpopt"),
3764flagpd1("mno-hvx"),3797flagpd1("mno-hvx"),
3798flagpd1("mno-hreset"),
3765flagpd1("mno-htm"),3799flagpd1("mno-htm"),
3766flagpd1("mno-iamcu"),3800flagpd1("mno-iamcu"),
3767flagpd1("mno-implicit-float"),3801flagpd1("mno-implicit-float"),
...@@ -3770,6 +3804,7 @@ flagpd1("mno-inline-all-stringops"),...@@ -3770,6 +3804,7 @@ flagpd1("mno-inline-all-stringops"),
3770flagpd1("mno-invariant-function-descriptors"),3804flagpd1("mno-invariant-function-descriptors"),
3771flagpd1("mno-invpcid"),3805flagpd1("mno-invpcid"),
3772flagpd1("mno-isel"),3806flagpd1("mno-isel"),
3807flagpd1("mno-kl"),
3773flagpd1("mno-ldc1-sdc1"),3808flagpd1("mno-ldc1-sdc1"),
3774flagpd1("mno-local-sdata"),3809flagpd1("mno-local-sdata"),
3775flagpd1("mno-long-calls"),3810flagpd1("mno-long-calls"),
...@@ -3784,6 +3819,7 @@ flagpd1("mno-mfcrf"),...@@ -3784,6 +3819,7 @@ flagpd1("mno-mfcrf"),
3784flagpd1("mno-mfocrf"),3819flagpd1("mno-mfocrf"),
3785flagpd1("mno-micromips"),3820flagpd1("mno-micromips"),
3786flagpd1("mno-mips16"),3821flagpd1("mno-mips16"),
3822flagpd1("mno-mma"),
3787flagpd1("mno-mmx"),3823flagpd1("mno-mmx"),
3788flagpd1("mno-movbe"),3824flagpd1("mno-movbe"),
3789flagpd1("mno-movdir64b"),3825flagpd1("mno-movdir64b"),
...@@ -3803,6 +3839,7 @@ flagpd1("mno-nvs"),...@@ -3803,6 +3839,7 @@ flagpd1("mno-nvs"),
3803flagpd1("mno-odd-spreg"),3839flagpd1("mno-odd-spreg"),
3804flagpd1("mno-omit-leaf-frame-pointer"),3840flagpd1("mno-omit-leaf-frame-pointer"),
3805flagpd1("mno-outline"),3841flagpd1("mno-outline"),
3842flagpd1("mno-outline-atomics"),
3806flagpd1("mno-packed-stack"),3843flagpd1("mno-packed-stack"),
3807flagpd1("mno-packets"),3844flagpd1("mno-packets"),
3808flagpd1("mno-pascal-strings"),3845flagpd1("mno-pascal-strings"),
...@@ -3820,7 +3857,6 @@ flagpd1("mno-prefetchwt1"),...@@ -3820,7 +3857,6 @@ flagpd1("mno-prefetchwt1"),
3820flagpd1("mno-prfchw"),3857flagpd1("mno-prfchw"),
3821flagpd1("mno-ptwrite"),3858flagpd1("mno-ptwrite"),
3822flagpd1("mno-pure-code"),3859flagpd1("mno-pure-code"),
3823flagpd1("mno-qpx"),
3824flagpd1("mno-rdpid"),3860flagpd1("mno-rdpid"),
3825flagpd1("mno-rdrnd"),3861flagpd1("mno-rdrnd"),
3826flagpd1("mno-rdseed"),3862flagpd1("mno-rdseed"),
...@@ -3853,7 +3889,6 @@ flagpd1("mno-simd128"),...@@ -3853,7 +3889,6 @@ flagpd1("mno-simd128"),
3853flagpd1("mno-soft-float"),3889flagpd1("mno-soft-float"),
3854flagpd1("mno-spe"),3890flagpd1("mno-spe"),
3855flagpd1("mno-speculative-load-hardening"),3891flagpd1("mno-speculative-load-hardening"),
3856flagpd1("mno-sram-ecc"),
3857flagpd1("mno-sse"),3892flagpd1("mno-sse"),
3858flagpd1("mno-sse2"),3893flagpd1("mno-sse2"),
3859flagpd1("mno-sse3"),3894flagpd1("mno-sse3"),
...@@ -3869,8 +3904,10 @@ flagpd1("mno-tbm"),...@@ -3869,8 +3904,10 @@ flagpd1("mno-tbm"),
3869flagpd1("mno-thumb"),3904flagpd1("mno-thumb"),
3870flagpd1("mno-tls-direct-seg-refs"),3905flagpd1("mno-tls-direct-seg-refs"),
3871flagpd1("mno-tsxldtrk"),3906flagpd1("mno-tsxldtrk"),
3907flagpd1("mno-uintr"),
3872flagpd1("mno-unaligned-access"),3908flagpd1("mno-unaligned-access"),
3873flagpd1("mno-unimplemented-simd128"),3909flagpd1("mno-unimplemented-simd128"),
3910flagpd1("mno-unsafe-fp-atomics"),
3874flagpd1("mno-vaes"),3911flagpd1("mno-vaes"),
3875flagpd1("mno-virt"),3912flagpd1("mno-virt"),
3876flagpd1("mno-vpclmulqdq"),3913flagpd1("mno-vpclmulqdq"),
...@@ -3881,9 +3918,9 @@ flagpd1("mno-waitpkg"),...@@ -3881,9 +3918,9 @@ flagpd1("mno-waitpkg"),
3881flagpd1("mno-warn-nonportable-cfstrings"),3918flagpd1("mno-warn-nonportable-cfstrings"),
3882flagpd1("mno-wavefrontsize64"),3919flagpd1("mno-wavefrontsize64"),
3883flagpd1("mno-wbnoinvd"),3920flagpd1("mno-wbnoinvd"),
3921flagpd1("mno-widekl"),
3884flagpd1("mno-x87"),3922flagpd1("mno-x87"),
3885flagpd1("mno-xgot"),3923flagpd1("mno-xgot"),
3886flagpd1("mno-xnack"),
3887flagpd1("mno-xop"),3924flagpd1("mno-xop"),
3888flagpd1("mno-xsave"),3925flagpd1("mno-xsave"),
3889flagpd1("mno-xsavec"),3926flagpd1("mno-xsavec"),
...@@ -3894,6 +3931,7 @@ flagpd1("mnocrc"),...@@ -3894,6 +3931,7 @@ flagpd1("mnocrc"),
3894flagpd1("mno-direct-move"),3931flagpd1("mno-direct-move"),
3895flagpd1("mnontrapping-fptoint"),3932flagpd1("mnontrapping-fptoint"),
3896flagpd1("mnop-mcount"),3933flagpd1("mnop-mcount"),
3934flagpd1("mno-paired-vector-memops"),
3897flagpd1("mno-crypto"),3935flagpd1("mno-crypto"),
3898flagpd1("mnvj"),3936flagpd1("mnvj"),
3899flagpd1("mnvs"),3937flagpd1("mnvs"),
...@@ -3903,8 +3941,10 @@ flagpd1("module-file-deps"),...@@ -3903,8 +3941,10 @@ flagpd1("module-file-deps"),
3903flagpd1("module-file-info"),3941flagpd1("module-file-info"),
3904flagpd1("momit-leaf-frame-pointer"),3942flagpd1("momit-leaf-frame-pointer"),
3905flagpd1("moutline"),3943flagpd1("moutline"),
3944flagpd1("moutline-atomics"),
3906flagpd1("mpacked-stack"),3945flagpd1("mpacked-stack"),
3907flagpd1("mpackets"),3946flagpd1("mpackets"),
3947flagpd1("mpaired-vector-memops"),
3908flagpd1("mpascal-strings"),3948flagpd1("mpascal-strings"),
3909flagpd1("mpclmul"),3949flagpd1("mpclmul"),
3910flagpd1("mpconfig"),3950flagpd1("mpconfig"),
...@@ -3922,7 +3962,6 @@ flagpd1("mprfchw"),...@@ -3922,7 +3962,6 @@ flagpd1("mprfchw"),
3922flagpd1("mptwrite"),3962flagpd1("mptwrite"),
3923flagpd1("mpure-code"),3963flagpd1("mpure-code"),
3924flagpd1("mqdsp6-compat"),3964flagpd1("mqdsp6-compat"),
3925flagpd1("mqpx"),
3926flagpd1("mrdpid"),3965flagpd1("mrdpid"),
3927flagpd1("mrdrnd"),3966flagpd1("mrdrnd"),
3928flagpd1("mrdseed"),3967flagpd1("mrdseed"),
...@@ -3965,13 +4004,13 @@ flagpd1("msgx"),...@@ -3965,13 +4004,13 @@ flagpd1("msgx"),
3965flagpd1("msha"),4004flagpd1("msha"),
3966flagpd1("mshstk"),4005flagpd1("mshstk"),
3967flagpd1("msign-ext"),4006flagpd1("msign-ext"),
4007flagpd1("msim"),
3968flagpd1("msimd128"),4008flagpd1("msimd128"),
3969flagpd1("msingle-float"),4009flagpd1("msingle-float"),
3970sepd1("msmall-data-limit"),4010sepd1("msmall-data-limit"),
3971flagpd1("msoft-float"),4011flagpd1("msoft-float"),
3972flagpd1("mspe"),4012flagpd1("mspe"),
3973flagpd1("mspeculative-load-hardening"),4013flagpd1("mspeculative-load-hardening"),
3974flagpd1("msram-ecc"),
3975flagpd1("msse"),4014flagpd1("msse"),
3976flagpd1("msse2"),4015flagpd1("msse2"),
3977flagpd1("msse3"),4016flagpd1("msse3"),
...@@ -3995,11 +4034,13 @@ sepd1("mtp"),...@@ -3995,11 +4034,13 @@ sepd1("mtp"),
3995flagpd1("mtsxldtrk"),4034flagpd1("mtsxldtrk"),
3996flagpd1("mtune=?"),4035flagpd1("mtune=?"),
3997flagpd1("muclibc"),4036flagpd1("muclibc"),
4037flagpd1("muintr"),
3998flagpd1("multi_module"),4038flagpd1("multi_module"),
3999sepd1("multiply_defined"),4039sepd1("multiply_defined"),
4000sepd1("multiply_defined_unused"),4040sepd1("multiply_defined_unused"),
4001flagpd1("munaligned-access"),4041flagpd1("munaligned-access"),
4002flagpd1("munimplemented-simd128"),4042flagpd1("munimplemented-simd128"),
4043flagpd1("munsafe-fp-atomics"),
4003flagpd1("munwind-tables"),4044flagpd1("munwind-tables"),
4004flagpd1("mv5"),4045flagpd1("mv5"),
4005flagpd1("mv55"),4046flagpd1("mv55"),
...@@ -4019,10 +4060,10 @@ flagpd1("mwaitpkg"),...@@ -4019,10 +4060,10 @@ flagpd1("mwaitpkg"),
4019flagpd1("mwarn-nonportable-cfstrings"),4060flagpd1("mwarn-nonportable-cfstrings"),
4020flagpd1("mwavefrontsize64"),4061flagpd1("mwavefrontsize64"),
4021flagpd1("mwbnoinvd"),4062flagpd1("mwbnoinvd"),
4063flagpd1("mwidekl"),
4022flagpd1("mx32"),4064flagpd1("mx32"),
4023flagpd1("mx87"),4065flagpd1("mx87"),
4024flagpd1("mxgot"),4066flagpd1("mxgot"),
4025flagpd1("mxnack"),
4026flagpd1("mxop"),4067flagpd1("mxop"),
4027flagpd1("mxsave"),4068flagpd1("mxsave"),
4028flagpd1("mxsavec"),4069flagpd1("mxsavec"),
...@@ -4462,7 +4503,7 @@ sepd1("target-feature"),...@@ -4462,7 +4503,7 @@ sepd1("target-feature"),
4462},4503},
4463sepd1("target-linker-version"),4504sepd1("target-linker-version"),
4464flagpd1("templight-dump"),4505flagpd1("templight-dump"),
4465flagpd1("test-coverage"),4506flagpd1("test-io"),
4466flagpd1("time"),4507flagpd1("time"),
4467.{4508.{
4468 .name = "traditional",4509 .name = "traditional",
...@@ -4490,6 +4531,7 @@ flagpd1("time"),...@@ -4490,6 +4531,7 @@ flagpd1("time"),
4490},4531},
4491flagpd1("trim-egraph"),4532flagpd1("trim-egraph"),
4492sepd1("triple"),4533sepd1("triple"),
4534sepd1("tune-cpu"),
4493flagpd1("twolevel_namespace"),4535flagpd1("twolevel_namespace"),
4494flagpd1("twolevel_namespace_hints"),4536flagpd1("twolevel_namespace_hints"),
4495sepd1("umbrella"),4537sepd1("umbrella"),
...@@ -4541,6 +4583,7 @@ flagpd1("whyload"),...@@ -4541,6 +4583,7 @@ flagpd1("whyload"),
4541},4583},
4542joinpd1("fsanitize-undefined-strip-path-components="),4584joinpd1("fsanitize-undefined-strip-path-components="),
4543joinpd1("fopenmp-cuda-teams-reduction-recs-num="),4585joinpd1("fopenmp-cuda-teams-reduction-recs-num="),
4586joinpd1("fvisibility-externs-nodllstorageclass="),
4544joinpd1("analyzer-config-compatibility-mode="),4587joinpd1("analyzer-config-compatibility-mode="),
4545joinpd1("ftrivial-auto-var-init-stop-after="),4588joinpd1("ftrivial-auto-var-init-stop-after="),
4546joinpd1("fpatchable-function-entry-offset="),4589joinpd1("fpatchable-function-entry-offset="),
...@@ -4549,7 +4592,11 @@ joinpd1("fsanitize-address-field-padding="),...@@ -4549,7 +4592,11 @@ joinpd1("fsanitize-address-field-padding="),
4549joinpd1("fdiagnostics-hotness-threshold="),4592joinpd1("fdiagnostics-hotness-threshold="),
4550joinpd1("fsanitize-memory-track-origins="),4593joinpd1("fsanitize-memory-track-origins="),
4551joinpd1("mwatchos-simulator-version-min="),4594joinpd1("mwatchos-simulator-version-min="),
4595joinpd1("fvisibility-externs-dllimport="),
4596joinpd1("fvisibility-nodllstorageclass="),
4597joinpd1("fxray-selected-function-group="),
4552joinpd1("mappletvsimulator-version-min="),4598joinpd1("mappletvsimulator-version-min="),
4599joinpd1("mstack-protector-guard-offset="),
4553joinpd1("fsanitize-coverage-whitelist="),4600joinpd1("fsanitize-coverage-whitelist="),
4554joinpd1("fsanitize-coverage-blacklist="),4601joinpd1("fsanitize-coverage-blacklist="),
4555joinpd1("fobjc-nonfragile-abi-version="),4602joinpd1("fobjc-nonfragile-abi-version="),
...@@ -4582,7 +4629,16 @@ joinpd1("fopenmp-cuda-blocks-per-sm="),...@@ -4582,7 +4629,16 @@ joinpd1("fopenmp-cuda-blocks-per-sm="),
4582joinpd1("fsanitize-system-blacklist="),4629joinpd1("fsanitize-system-blacklist="),
4583jspd1("fxray-instruction-threshold"),4630jspd1("fxray-instruction-threshold"),
4584joinpd1("headerpad_max_install_names"),4631joinpd1("headerpad_max_install_names"),
4632.{
4633 .name = "libomptarget-nvptx-bc-path=",
4634 .syntax = .joined,
4635 .zig_equivalent = .other,
4636 .pd1 = false,
4637 .pd2 = true,
4638 .psl = false,
4639},
4585joinpd1("mios-simulator-version-min="),4640joinpd1("mios-simulator-version-min="),
4641joinpd1("mstack-protector-guard-reg="),
4586.{4642.{
4587 .name = "include-with-prefix-after=",4643 .name = "include-with-prefix-after=",
4588 .syntax = .joined,4644 .syntax = .joined,
...@@ -4655,14 +4711,6 @@ joinpd1("fsanitize-hwaddress-abi="),...@@ -4655,14 +4711,6 @@ joinpd1("fsanitize-hwaddress-abi="),
4655joinpd1("ftime-trace-granularity="),4711joinpd1("ftime-trace-granularity="),
4656jspd1("fxray-always-instrument="),4712jspd1("fxray-always-instrument="),
4657jspd1("internal-externc-isystem"),4713jspd1("internal-externc-isystem"),
4658.{
4659 .name = "libomptarget-nvptx-path=",
4660 .syntax = .joined,
4661 .zig_equivalent = .other,
4662 .pd1 = false,
4663 .pd2 = true,
4664 .psl = false,
4665},
4666.{4714.{
4667 .name = "no-system-header-prefix=",4715 .name = "no-system-header-prefix=",
4668 .syntax = .joined,4716 .syntax = .joined,
...@@ -4693,6 +4741,7 @@ jspd1("fxray-never-instrument="),...@@ -4693,6 +4741,7 @@ jspd1("fxray-never-instrument="),
4693jspd1("interface-stub-version="),4741jspd1("interface-stub-version="),
4694joinpd1("malign-branch-boundary="),4742joinpd1("malign-branch-boundary="),
4695joinpd1("mappletvos-version-min="),4743joinpd1("mappletvos-version-min="),
4744joinpd1("mstack-protector-guard="),
4696joinpd1("Wnonportable-cfstrings"),4745joinpd1("Wnonportable-cfstrings"),
4697joinpd1("fbasic-block-sections="),4746joinpd1("fbasic-block-sections="),
4698joinpd1("fdefault-calling-conv="),4747joinpd1("fdefault-calling-conv="),
...@@ -4712,6 +4761,8 @@ joinpd1("foperator-arrow-depth="),...@@ -4712,6 +4761,8 @@ joinpd1("foperator-arrow-depth="),
4712joinpd1("fprebuilt-module-path="),4761joinpd1("fprebuilt-module-path="),
4713joinpd1("fprofile-filter-files="),4762joinpd1("fprofile-filter-files="),
4714joinpd1("fspell-checking-limit="),4763joinpd1("fspell-checking-limit="),
4764joinpd1("fvisibility-dllexport="),
4765joinpd1("fxray-function-groups="),
4715joinpd1("miphoneos-version-min="),4766joinpd1("miphoneos-version-min="),
4716joinpd1("msmall-data-threshold="),4767joinpd1("msmall-data-threshold="),
4717joinpd1("Wlarge-by-value-copy="),4768joinpd1("Wlarge-by-value-copy="),
...@@ -4730,7 +4781,7 @@ joinpd1("fmodules-prune-after="),...@@ -4730,7 +4781,7 @@ joinpd1("fmodules-prune-after="),
4730 .psl = false,4781 .psl = false,
4731},4782},
4732jspd1("iframeworkwithsysroot"),4783jspd1("iframeworkwithsysroot"),
4733joinpd1("mamdgpu-debugger-abi="),4784joinpd1("mcode-object-version="),
4734joinpd1("mpad-max-prefix-size="),4785joinpd1("mpad-max-prefix-size="),
4735joinpd1("mprefer-vector-width="),4786joinpd1("mprefer-vector-width="),
4736joinpd1("msign-return-address="),4787joinpd1("msign-return-address="),
...@@ -4774,6 +4825,7 @@ joinpd1("fmax-stack-var-size="),...@@ -4774,6 +4825,7 @@ joinpd1("fmax-stack-var-size="),
4774joinpd1("fmodules-cache-path="),4825joinpd1("fmodules-cache-path="),
4775joinpd1("fmodules-embed-file="),4826joinpd1("fmodules-embed-file="),
4776joinpd1("fprofile-instrument="),4827joinpd1("fprofile-instrument="),
4828joinpd1("fprofile-prefix-map="),
4777joinpd1("fprofile-sample-use="),4829joinpd1("fprofile-sample-use="),
4778joinpd1("fsanitize-blacklist="),4830joinpd1("fsanitize-blacklist="),
4779joinpd1("mmacosx-version-min="),4831joinpd1("mmacosx-version-min="),
...@@ -4802,6 +4854,14 @@ joinpd1("fprofile-instr-use="),...@@ -4802,6 +4854,14 @@ joinpd1("fprofile-instr-use="),
4802 .psl = false,4854 .psl = false,
4803},4855},
4804joinpd1("fthin-link-bitcode="),4856joinpd1("fthin-link-bitcode="),
4857.{
4858 .name = "gpu-instrument-lib=",
4859 .syntax = .joined,
4860 .zig_equivalent = .other,
4861 .pd1 = false,
4862 .pd2 = true,
4863 .psl = false,
4864},
4805joinpd1("mbranch-protection="),4865joinpd1("mbranch-protection="),
4806joinpd1("mmacos-version-min="),4866joinpd1("mmacos-version-min="),
4807joinpd1("pch-through-header="),4867joinpd1("pch-through-header="),
...@@ -4838,6 +4898,7 @@ joinpd1("target-sdk-version="),...@@ -4838,6 +4898,7 @@ joinpd1("target-sdk-version="),
4838 .pd2 = true,4898 .pd2 = true,
4839 .psl = false,4899 .psl = false,
4840},4900},
4901joinpd1("fbinutils-version="),
4841joinpd1("fclang-abi-compat="),4902joinpd1("fclang-abi-compat="),
4842joinpd1("fcompile-resource="),4903joinpd1("fcompile-resource="),
4843joinpd1("fdebug-prefix-map="),4904joinpd1("fdebug-prefix-map="),
...@@ -4855,6 +4916,7 @@ joinpd1("fmacro-prefix-map="),...@@ -4855,6 +4916,7 @@ joinpd1("fmacro-prefix-map="),
4855},4916},
4856joinpd1("fobjc-abi-version="),4917joinpd1("fobjc-abi-version="),
4857joinpd1("foutput-class-dir="),4918joinpd1("foutput-class-dir="),
4919joinpd1("fproc-stat-report="),
4858joinpd1("fprofile-generate="),4920joinpd1("fprofile-generate="),
4859joinpd1("frewrite-map-file="),4921joinpd1("frewrite-map-file="),
4860.{4922.{
...@@ -4888,10 +4950,12 @@ joinpd1("fconstexpr-steps="),...@@ -4888,10 +4950,12 @@ joinpd1("fconstexpr-steps="),
4888joinpd1("ffile-prefix-map="),4950joinpd1("ffile-prefix-map="),
4889joinpd1("fmodule-map-file="),4951joinpd1("fmodule-map-file="),
4890joinpd1("fobjc-arc-cxxlib="),4952joinpd1("fobjc-arc-cxxlib="),
4953joinpd1("fproc-stat-report"),
4891jspd1("iwithprefixbefore"),4954jspd1("iwithprefixbefore"),
4892joinpd1("malign-functions="),4955joinpd1("malign-functions="),
4893joinpd1("mios-version-min="),4956joinpd1("mios-version-min="),
4894joinpd1("mstack-alignment="),4957joinpd1("mstack-alignment="),
4958joinpd1("msve-vector-bits="),
4895.{4959.{
4896 .name = "no-cuda-gpu-arch=",4960 .name = "no-cuda-gpu-arch=",
4897 .syntax = .joined,4961 .syntax = .joined,
...@@ -4912,9 +4976,11 @@ joinpd1("analyzer-output="),...@@ -4912,9 +4976,11 @@ joinpd1("analyzer-output="),
4912},4976},
4913joinpd1("debug-info-kind="),4977joinpd1("debug-info-kind="),
4914joinpd1("debugger-tuning="),4978joinpd1("debugger-tuning="),
4979joinpd1("exception-model="),
4915joinpd1("fcf-runtime-abi="),4980joinpd1("fcf-runtime-abi="),
4916joinpd1("finit-character="),4981joinpd1("finit-character="),
4917joinpd1("fmax-type-align="),4982joinpd1("fmax-type-align="),
4983joinpd1("fmemory-profile="),
4918joinpd1("fmessage-length="),4984joinpd1("fmessage-length="),
4919.{4985.{
4920 .name = "fopenmp-targets=",4986 .name = "fopenmp-targets=",
...@@ -4925,6 +4991,7 @@ joinpd1("fmessage-length="),...@@ -4925,6 +4991,7 @@ joinpd1("fmessage-length="),
4925 .psl = false,4991 .psl = false,
4926},4992},
4927joinpd1("fopenmp-version="),4993joinpd1("fopenmp-version="),
4994joinpd1("fprofile-update="),
4928joinpd1("fshow-overloads="),4995joinpd1("fshow-overloads="),
4929joinpd1("ftemplate-depth-"),4996joinpd1("ftemplate-depth-"),
4930joinpd1("ftemplate-depth="),4997joinpd1("ftemplate-depth="),
...@@ -5074,6 +5141,7 @@ joinpd1("finit-integer="),...@@ -5074,6 +5141,7 @@ joinpd1("finit-integer="),
5074joinpd1("finit-logical="),5141joinpd1("finit-logical="),
5075joinpd1("finline-limit="),5142joinpd1("finline-limit="),
5076joinpd1("fobjc-runtime="),5143joinpd1("fobjc-runtime="),
5144joinpd1("fprofile-list="),
5077.{5145.{
5078 .name = "gcc-toolchain=",5146 .name = "gcc-toolchain=",
5079 .syntax = .joined,5147 .syntax = .joined,
...@@ -5111,6 +5179,7 @@ joinpd1("Wlarger-than="),...@@ -5111,6 +5179,7 @@ joinpd1("Wlarger-than="),
5111 .pd2 = true,5179 .pd2 = true,
5112 .psl = false,5180 .psl = false,
5113},5181},
5182joinpd1("arcmt-action="),
5114joinpd1("ast-dump-all="),5183joinpd1("ast-dump-all="),
5115.{5184.{
5116 .name = "autocomplete=",5185 .name = "autocomplete=",
...@@ -5141,6 +5210,7 @@ joinpd1("fpass-plugin="),...@@ -5141,6 +5210,7 @@ joinpd1("fpass-plugin="),
5141joinpd1("fprofile-dir="),5210joinpd1("fprofile-dir="),
5142joinpd1("fprofile-use="),5211joinpd1("fprofile-use="),
5143joinpd1("frandom-seed="),5212joinpd1("frandom-seed="),
5213joinpd1("ftime-report="),
5144joinpd1("gsplit-dwarf="),5214joinpd1("gsplit-dwarf="),
5145jspd1("isystem-after"),5215jspd1("isystem-after"),
5146joinpd1("malign-jumps="),5216joinpd1("malign-jumps="),
...@@ -5300,6 +5370,14 @@ jspd1("sub_library"),...@@ -5300,6 +5370,14 @@ jspd1("sub_library"),
5300 .pd2 = false,5370 .pd2 = false,
5301 .psl = true,5371 .psl = true,
5302},5372},
5373.{
5374 .name = "vctoolsdir",
5375 .syntax = .joined_or_separate,
5376 .zig_equivalent = .other,
5377 .pd1 = true,
5378 .pd2 = false,
5379 .psl = true,
5380},
5303.{5381.{
5304 .name = "classpath=",5382 .name = "classpath=",
5305 .syntax = .joined,5383 .syntax = .joined,
...@@ -5429,11 +5507,20 @@ jspd1("undefined"),...@@ -5429,11 +5507,20 @@ jspd1("undefined"),
5429 .pd2 = true,5507 .pd2 = true,
5430 .psl = false,5508 .psl = false,
5431},5509},
5510jspd1("dsym-dir"),
5432joinpd1("fopenmp="),5511joinpd1("fopenmp="),
5433joinpd1("fplugin="),5512joinpd1("fplugin="),
5434joinpd1("fuse-ld="),5513joinpd1("fuse-ld="),
5435joinpd1("fveclib="),5514joinpd1("fveclib="),
5436jspd1("isysroot"),5515jspd1("isysroot"),
5516.{
5517 .name = "ld-path=",
5518 .syntax = .joined,
5519 .zig_equivalent = .other,
5520 .pd1 = false,
5521 .pd2 = true,
5522 .psl = false,
5523},
5437joinpd1("mcmodel="),5524joinpd1("mcmodel="),
5438joinpd1("mconsole"),5525joinpd1("mconsole"),
5439joinpd1("mdouble="),5526joinpd1("mdouble="),
...@@ -5658,6 +5745,14 @@ jspd1("Ttext"),...@@ -5658,6 +5745,14 @@ jspd1("Ttext"),
5658 .pd2 = false,5745 .pd2 = false,
5659 .psl = true,5746 .psl = true,
5660},5747},
5748.{
5749 .name = "tune:",
5750 .syntax = .joined,
5751 .zig_equivalent = .other,
5752 .pd1 = true,
5753 .pd2 = false,
5754 .psl = true,
5755},
5661.{5756.{
5662 .name = "warn-",5757 .name = "warn-",
5663 .syntax = .joined,5758 .syntax = .joined,
...@@ -5743,6 +5838,14 @@ joinpd1("mtp="),...@@ -5743,6 +5838,14 @@ joinpd1("mtp="),
5743 .pd2 = false,5838 .pd2 = false,
5744 .psl = false,5839 .psl = false,
5745},5840},
5841.{
5842 .name = "Fe:",
5843 .syntax = .joined,
5844 .zig_equivalent = .other,
5845 .pd1 = true,
5846 .pd2 = false,
5847 .psl = true,
5848},
5746.{5849.{
5747 .name = "RTC",5850 .name = "RTC",
5748 .syntax = .joined,5851 .syntax = .joined,
src/codegen/llvm.zig+4-1
...@@ -28,6 +28,7 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![:0]u8 {...@@ -28,6 +28,7 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![:0]u8 {
28 .avr => "avr",28 .avr => "avr",
29 .bpfel => "bpfel",29 .bpfel => "bpfel",
30 .bpfeb => "bpfeb",30 .bpfeb => "bpfeb",
31 .csky => "csky",
31 .hexagon => "hexagon",32 .hexagon => "hexagon",
32 .mips => "mips",33 .mips => "mips",
33 .mipsel => "mipsel",34 .mipsel => "mipsel",
...@@ -35,6 +36,7 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![:0]u8 {...@@ -35,6 +36,7 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![:0]u8 {
35 .mips64el => "mips64el",36 .mips64el => "mips64el",
36 .msp430 => "msp430",37 .msp430 => "msp430",
37 .powerpc => "powerpc",38 .powerpc => "powerpc",
39 .powerpcle => "powerpcle",
38 .powerpc64 => "powerpc64",40 .powerpc64 => "powerpc64",
39 .powerpc64le => "powerpc64le",41 .powerpc64le => "powerpc64le",
40 .r600 => "r600",42 .r600 => "r600",
...@@ -91,11 +93,11 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![:0]u8 {...@@ -91,11 +93,11 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![:0]u8 {
91 .openbsd => "openbsd",93 .openbsd => "openbsd",
92 .solaris => "solaris",94 .solaris => "solaris",
93 .windows => "windows",95 .windows => "windows",
96 .zos => "zos",
94 .haiku => "haiku",97 .haiku => "haiku",
95 .minix => "minix",98 .minix => "minix",
96 .rtems => "rtems",99 .rtems => "rtems",
97 .nacl => "nacl",100 .nacl => "nacl",
98 .cnk => "cnk",
99 .aix => "aix",101 .aix => "aix",
100 .cuda => "cuda",102 .cuda => "cuda",
101 .nvcl => "nvcl",103 .nvcl => "nvcl",
...@@ -126,6 +128,7 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![:0]u8 {...@@ -126,6 +128,7 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![:0]u8 {
126 .gnueabi => "gnueabi",128 .gnueabi => "gnueabi",
127 .gnueabihf => "gnueabihf",129 .gnueabihf => "gnueabihf",
128 .gnux32 => "gnux32",130 .gnux32 => "gnux32",
131 .gnuilp32 => "gnuilp32",
129 .code16 => "code16",132 .code16 => "code16",
130 .eabi => "eabi",133 .eabi => "eabi",
131 .eabihf => "eabihf",134 .eabihf => "eabihf",
src/codegen/llvm/bindings.zig+91-88
...@@ -508,6 +508,7 @@ pub const ObjectFormatType = extern enum(c_int) {...@@ -508,6 +508,7 @@ pub const ObjectFormatType = extern enum(c_int) {
508 Unknown,508 Unknown,
509 COFF,509 COFF,
510 ELF,510 ELF,
511 GOFF,
511 MachO,512 MachO,
512 Wasm,513 Wasm,
513 XCOFF,514 XCOFF,
...@@ -528,97 +529,99 @@ extern fn ZigLLVMWriteArchive(...@@ -528,97 +529,99 @@ extern fn ZigLLVMWriteArchive(
528) bool;529) bool;
529530
530pub const OSType = extern enum(c_int) {531pub const OSType = extern enum(c_int) {
531 UnknownOS = 0,532 UnknownOS,
532 Ananas = 1,533 Ananas,
533 CloudABI = 2,534 CloudABI,
534 Darwin = 3,535 Darwin,
535 DragonFly = 4,536 DragonFly,
536 FreeBSD = 5,537 FreeBSD,
537 Fuchsia = 6,538 Fuchsia,
538 IOS = 7,539 IOS,
539 KFreeBSD = 8,540 KFreeBSD,
540 Linux = 9,541 Linux,
541 Lv2 = 10,542 Lv2,
542 MacOSX = 11,543 MacOSX,
543 NetBSD = 12,544 NetBSD,
544 OpenBSD = 13,545 OpenBSD,
545 Solaris = 14,546 Solaris,
546 Win32 = 15,547 Win32,
547 Haiku = 16,548 ZOS,
548 Minix = 17,549 Haiku,
549 RTEMS = 18,550 Minix,
550 NaCl = 19,551 RTEMS,
551 CNK = 20,552 NaCl,
552 AIX = 21,553 AIX,
553 CUDA = 22,554 CUDA,
554 NVCL = 23,555 NVCL,
555 AMDHSA = 24,556 AMDHSA,
556 PS4 = 25,557 PS4,
557 ELFIAMCU = 26,558 ELFIAMCU,
558 TvOS = 27,559 TvOS,
559 WatchOS = 28,560 WatchOS,
560 Mesa3D = 29,561 Mesa3D,
561 Contiki = 30,562 Contiki,
562 AMDPAL = 31,563 AMDPAL,
563 HermitCore = 32,564 HermitCore,
564 Hurd = 33,565 Hurd,
565 WASI = 34,566 WASI,
566 Emscripten = 35,567 Emscripten,
567};568};
568569
569pub const ArchType = extern enum(c_int) {570pub const ArchType = extern enum(c_int) {
570 UnknownArch = 0,571 UnknownArch,
571 arm = 1,572 arm,
572 armeb = 2,573 armeb,
573 aarch64 = 3,574 aarch64,
574 aarch64_be = 4,575 aarch64_be,
575 aarch64_32 = 5,576 aarch64_32,
576 arc = 6,577 arc,
577 avr = 7,578 avr,
578 bpfel = 8,579 bpfel,
579 bpfeb = 9,580 bpfeb,
580 hexagon = 10,581 csky,
581 mips = 11,582 hexagon,
582 mipsel = 12,583 mips,
583 mips64 = 13,584 mipsel,
584 mips64el = 14,585 mips64,
585 msp430 = 15,586 mips64el,
586 ppc = 16,587 msp430,
587 ppc64 = 17,588 ppc,
588 ppc64le = 18,589 ppcle,
589 r600 = 19,590 ppc64,
590 amdgcn = 20,591 ppc64le,
591 riscv32 = 21,592 r600,
592 riscv64 = 22,593 amdgcn,
593 sparc = 23,594 riscv32,
594 sparcv9 = 24,595 riscv64,
595 sparcel = 25,596 sparc,
596 systemz = 26,597 sparcv9,
597 tce = 27,598 sparcel,
598 tcele = 28,599 systemz,
599 thumb = 29,600 tce,
600 thumbeb = 30,601 tcele,
601 x86 = 31,602 thumb,
602 x86_64 = 32,603 thumbeb,
603 xcore = 33,604 x86,
604 nvptx = 34,605 x86_64,
605 nvptx64 = 35,606 xcore,
606 le32 = 36,607 nvptx,
607 le64 = 37,608 nvptx64,
608 amdil = 38,609 le32,
609 amdil64 = 39,610 le64,
610 hsail = 40,611 amdil,
611 hsail64 = 41,612 amdil64,
612 spir = 42,613 hsail,
613 spir64 = 43,614 hsail64,
614 kalimba = 44,615 spir,
615 shave = 45,616 spir64,
616 lanai = 46,617 kalimba,
617 wasm32 = 47,618 shave,
618 wasm64 = 48,619 lanai,
619 renderscript32 = 49,620 wasm32,
620 renderscript64 = 50,621 wasm64,
621 ve = 51,622 renderscript32,
623 renderscript64,
624 ve,
622};625};
623626
624pub const ParseCommandLineOptions = ZigLLVMParseCommandLineOptions;627pub const ParseCommandLineOptions = ZigLLVMParseCommandLineOptions;
src/glibc.zig+18-18
...@@ -820,26 +820,26 @@ pub fn buildSharedObjects(comp: *Compilation) !void {...@@ -820,26 +820,26 @@ pub fn buildSharedObjects(comp: *Compilation) !void {
820 // .globl _Exit_2_2_5820 // .globl _Exit_2_2_5
821 // .type _Exit_2_2_5, %function;821 // .type _Exit_2_2_5, %function;
822 // .symver _Exit_2_2_5, _Exit@@GLIBC_2.2.5822 // .symver _Exit_2_2_5, _Exit@@GLIBC_2.2.5
823 // .hidden _Exit_2_2_5
824 // _Exit_2_2_5:823 // _Exit_2_2_5:
825 const ver_index = ver_list.versions[ver_i];824 const ver_index = ver_list.versions[ver_i];
826 const ver = metadata.all_versions[ver_index];825 const ver = metadata.all_versions[ver_index];
827 const sym_name = libc_fn.name;826 const sym_name = libc_fn.name;
828 // Default symbol version definition vs normal symbol version definition827 // Default symbol version definition vs normal symbol version definition
829 const want_two_ats = chosen_def_ver_index != 255 and ver_index == chosen_def_ver_index;828 const want_default = chosen_def_ver_index != 255 and ver_index == chosen_def_ver_index;
830 const at_sign_str = "@@"[0 .. @boolToInt(want_two_ats) + @as(usize, 1)];829 const at_sign_str: []const u8 = if (want_default) "@@" else "@";
831
832 if (ver.patch == 0) {830 if (ver.patch == 0) {
833 const sym_plus_ver = try std.fmt.allocPrint(831 const sym_plus_ver = if (want_default)
834 arena,832 sym_name
835 "{s}_{d}_{d}",833 else
836 .{ sym_name, ver.major, ver.minor },834 try std.fmt.allocPrint(
837 );835 arena,
836 "{s}_GLIBC_{d}_{d}",
837 .{ sym_name, ver.major, ver.minor },
838 );
838 try zig_body.writer().print(839 try zig_body.writer().print(
839 \\.globl {s}840 \\.globl {s}
840 \\.type {s}, %function;841 \\.type {s}, %function;
841 \\.symver {s}, {s}{s}GLIBC_{d}.{d}842 \\.symver {s}, {s}{s}GLIBC_{d}.{d}
842 \\.hidden {s}
843 \\{s}:843 \\{s}:
844 \\844 \\
845 , .{845 , .{
...@@ -851,19 +851,20 @@ pub fn buildSharedObjects(comp: *Compilation) !void {...@@ -851,19 +851,20 @@ pub fn buildSharedObjects(comp: *Compilation) !void {
851 ver.major,851 ver.major,
852 ver.minor,852 ver.minor,
853 sym_plus_ver,853 sym_plus_ver,
854 sym_plus_ver,
855 });854 });
856 } else {855 } else {
857 const sym_plus_ver = try std.fmt.allocPrint(856 const sym_plus_ver = if (want_default)
858 arena,857 sym_name
859 "{s}_{d}_{d}_{d}",858 else
860 .{ sym_name, ver.major, ver.minor, ver.patch },859 try std.fmt.allocPrint(
861 );860 arena,
861 "{s}_GLIBC_{d}_{d}_{d}",
862 .{ sym_name, ver.major, ver.minor, ver.patch },
863 );
862 try zig_body.writer().print(864 try zig_body.writer().print(
863 \\.globl {s}865 \\.globl {s}
864 \\.type {s}, %function;866 \\.type {s}, %function;
865 \\.symver {s}, {s}{s}GLIBC_{d}.{d}.{d}867 \\.symver {s}, {s}{s}GLIBC_{d}.{d}.{d}
866 \\.hidden {s}
867 \\{s}:868 \\{s}:
868 \\869 \\
869 , .{870 , .{
...@@ -876,7 +877,6 @@ pub fn buildSharedObjects(comp: *Compilation) !void {...@@ -876,7 +877,6 @@ pub fn buildSharedObjects(comp: *Compilation) !void {
876 ver.minor,877 ver.minor,
877 ver.patch,878 ver.patch,
878 sym_plus_ver,879 sym_plus_ver,
879 sym_plus_ver,
880 });880 });
881 }881 }
882 }882 }
src/libcxx.zig+2
...@@ -49,6 +49,7 @@ const libcxx_files = [_][]const u8{...@@ -49,6 +49,7 @@ const libcxx_files = [_][]const u8{
49 "src/future.cpp",49 "src/future.cpp",
50 "src/hash.cpp",50 "src/hash.cpp",
51 "src/ios.cpp",51 "src/ios.cpp",
52 "src/ios.instantiations.cpp",
52 "src/iostream.cpp",53 "src/iostream.cpp",
53 "src/locale.cpp",54 "src/locale.cpp",
54 "src/memory.cpp",55 "src/memory.cpp",
...@@ -127,6 +128,7 @@ pub fn buildLibCXX(comp: *Compilation) !void {...@@ -127,6 +128,7 @@ pub fn buildLibCXX(comp: *Compilation) !void {
127 try cflags.append("-DLIBCXX_BUILDING_LIBCXXABI");128 try cflags.append("-DLIBCXX_BUILDING_LIBCXXABI");
128 try cflags.append("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS");129 try cflags.append("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS");
129 try cflags.append("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS");130 try cflags.append("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS");
131 try cflags.append("-D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS");
130132
131 if (target.abi.isMusl()) {133 if (target.abi.isMusl()) {
132 try cflags.append("-D_LIBCPP_HAS_MUSL_LIBC");134 try cflags.append("-D_LIBCPP_HAS_MUSL_LIBC");
src/stage1/codegen.cpp+17-44
...@@ -537,14 +537,12 @@ static LLVMValueRef make_fn_llvm_value(CodeGen *g, ZigFn *fn) {...@@ -537,14 +537,12 @@ static LLVMValueRef make_fn_llvm_value(CodeGen *g, ZigFn *fn) {
537 if (fn->body_node != nullptr) {537 if (fn->body_node != nullptr) {
538 maybe_export_dll(g, llvm_fn, linkage);538 maybe_export_dll(g, llvm_fn, linkage);
539539
540 bool want_fn_safety = g->build_mode != BuildModeFastRelease &&540 bool want_ssp_attrs = g->build_mode != BuildModeFastRelease &&
541 g->build_mode != BuildModeSmallRelease &&541 g->build_mode != BuildModeSmallRelease &&
542 !fn->def_scope->safety_off;542 g->link_libc;
543 if (want_fn_safety) {543 if (want_ssp_attrs) {
544 if (g->link_libc) {544 addLLVMFnAttr(llvm_fn, "sspstrong");
545 addLLVMFnAttr(llvm_fn, "sspstrong");545 addLLVMFnAttrStr(llvm_fn, "stack-protector-buffer-size", "4");
546 addLLVMFnAttrStr(llvm_fn, "stack-protector-buffer-size", "4");
547 }
548 }546 }
549 if (g->have_stack_probing && !fn->def_scope->safety_off) {547 if (g->have_stack_probing && !fn->def_scope->safety_off) {
550 addLLVMFnAttrStr(llvm_fn, "probe-stack", "__zig_probe_stack");548 addLLVMFnAttrStr(llvm_fn, "probe-stack", "__zig_probe_stack");
...@@ -598,7 +596,7 @@ static LLVMValueRef make_fn_llvm_value(CodeGen *g, ZigFn *fn) {...@@ -598,7 +596,7 @@ static LLVMValueRef make_fn_llvm_value(CodeGen *g, ZigFn *fn) {
598 } else if (want_first_arg_sret(g, &fn_type->data.fn.fn_type_id)) {596 } else if (want_first_arg_sret(g, &fn_type->data.fn.fn_type_id)) {
599 // Sret pointers must not be address 0597 // Sret pointers must not be address 0
600 addLLVMArgAttr(llvm_fn, 0, "nonnull");598 addLLVMArgAttr(llvm_fn, 0, "nonnull");
601 addLLVMArgAttr(llvm_fn, 0, "sret");599 ZigLLVMAddSretAttr(llvm_fn, 0, get_llvm_type(g, return_type));
602 if (cc_want_sret_attr(cc)) {600 if (cc_want_sret_attr(cc)) {
603 addLLVMArgAttr(llvm_fn, 0, "noalias");601 addLLVMArgAttr(llvm_fn, 0, "noalias");
604 }602 }
...@@ -1644,35 +1642,16 @@ static const BuildBinOpFunc unsigned_op[3] = { LLVMBuildNUWAdd, LLVMBuildNUWSub,...@@ -1644,35 +1642,16 @@ static const BuildBinOpFunc unsigned_op[3] = { LLVMBuildNUWAdd, LLVMBuildNUWSub,
1644static LLVMValueRef gen_overflow_op(CodeGen *g, ZigType *operand_type, AddSubMul op,1642static LLVMValueRef gen_overflow_op(CodeGen *g, ZigType *operand_type, AddSubMul op,
1645 LLVMValueRef val1, LLVMValueRef val2)1643 LLVMValueRef val1, LLVMValueRef val2)
1646{1644{
1647 LLVMValueRef overflow_bit;1645 LLVMValueRef fn_val = get_int_overflow_fn(g, operand_type, op);
1648 LLVMValueRef result;1646 LLVMValueRef params[] = {
16491647 val1,
1648 val2,
1649 };
1650 LLVMValueRef result_struct = LLVMBuildCall(g->builder, fn_val, params, 2, "");
1651 LLVMValueRef result = LLVMBuildExtractValue(g->builder, result_struct, 0, "");
1652 LLVMValueRef overflow_bit = LLVMBuildExtractValue(g->builder, result_struct, 1, "");
1650 if (operand_type->id == ZigTypeIdVector) {1653 if (operand_type->id == ZigTypeIdVector) {
1651 ZigType *int_type = operand_type->data.vector.elem_type;1654 overflow_bit = ZigLLVMBuildOrReduce(g->builder, overflow_bit);
1652 assert(int_type->id == ZigTypeIdInt);
1653 LLVMTypeRef one_more_bit_int = LLVMIntType(int_type->data.integral.bit_count + 1);
1654 LLVMTypeRef one_more_bit_int_vector = LLVMVectorType(one_more_bit_int, operand_type->data.vector.len);
1655 const auto buildExtFn = int_type->data.integral.is_signed ? LLVMBuildSExt : LLVMBuildZExt;
1656 LLVMValueRef extended1 = buildExtFn(g->builder, val1, one_more_bit_int_vector, "");
1657 LLVMValueRef extended2 = buildExtFn(g->builder, val2, one_more_bit_int_vector, "");
1658 LLVMValueRef extended_result = wrap_op[op](g->builder, extended1, extended2, "");
1659 result = LLVMBuildTrunc(g->builder, extended_result, get_llvm_type(g, operand_type), "");
1660
1661 LLVMValueRef re_extended_result = buildExtFn(g->builder, result, one_more_bit_int_vector, "");
1662 LLVMValueRef overflow_vector = LLVMBuildICmp(g->builder, LLVMIntNE, extended_result, re_extended_result, "");
1663 LLVMTypeRef bitcast_int_type = LLVMIntType(operand_type->data.vector.len);
1664 LLVMValueRef bitcasted_overflow = LLVMBuildBitCast(g->builder, overflow_vector, bitcast_int_type, "");
1665 LLVMValueRef zero = LLVMConstNull(bitcast_int_type);
1666 overflow_bit = LLVMBuildICmp(g->builder, LLVMIntNE, bitcasted_overflow, zero, "");
1667 } else {
1668 LLVMValueRef fn_val = get_int_overflow_fn(g, operand_type, op);
1669 LLVMValueRef params[] = {
1670 val1,
1671 val2,
1672 };
1673 LLVMValueRef result_struct = LLVMBuildCall(g->builder, fn_val, params, 2, "");
1674 result = LLVMBuildExtractValue(g->builder, result_struct, 0, "");
1675 overflow_bit = LLVMBuildExtractValue(g->builder, result_struct, 1, "");
1676 }1655 }
16771656
1678 LLVMBasicBlockRef fail_block = LLVMAppendBasicBlock(g->cur_fn_val, "OverflowFail");1657 LLVMBasicBlockRef fail_block = LLVMAppendBasicBlock(g->cur_fn_val, "OverflowFail");
...@@ -2040,7 +2019,7 @@ static bool iter_function_params_c_abi(CodeGen *g, ZigType *fn_type, FnWalk *fn_...@@ -2040,7 +2019,7 @@ static bool iter_function_params_c_abi(CodeGen *g, ZigType *fn_type, FnWalk *fn_
2040 switch (fn_walk->id) {2019 switch (fn_walk->id) {
2041 case FnWalkIdAttrs:2020 case FnWalkIdAttrs:
2042 if (abi_class != X64CABIClass_MEMORY_nobyval) {2021 if (abi_class != X64CABIClass_MEMORY_nobyval) {
2043 ZigLLVMAddByValAttr(llvm_fn, fn_walk->data.attrs.gen_i + 1, get_llvm_type(g, ty));2022 ZigLLVMAddByValAttr(llvm_fn, fn_walk->data.attrs.gen_i, get_llvm_type(g, ty));
2044 addLLVMArgAttrInt(llvm_fn, fn_walk->data.attrs.gen_i, "align", get_abi_alignment(g, ty));2023 addLLVMArgAttrInt(llvm_fn, fn_walk->data.attrs.gen_i, "align", get_abi_alignment(g, ty));
2045 } else if (g->zig_target->arch == ZigLLVM_aarch64 ||2024 } else if (g->zig_target->arch == ZigLLVM_aarch64 ||
2046 g->zig_target->arch == ZigLLVM_aarch64_be)2025 g->zig_target->arch == ZigLLVM_aarch64_be)
...@@ -4105,12 +4084,6 @@ static void gen_set_stack_pointer(CodeGen *g, LLVMValueRef aligned_end_addr) {...@@ -4105,12 +4084,6 @@ static void gen_set_stack_pointer(CodeGen *g, LLVMValueRef aligned_end_addr) {
4105 LLVMBuildCall(g->builder, write_register_fn_val, params, 2, "");4084 LLVMBuildCall(g->builder, write_register_fn_val, params, 2, "");
4106}4085}
41074086
4108static void set_call_instr_sret(CodeGen *g, LLVMValueRef call_instr) {
4109 unsigned attr_kind_id = LLVMGetEnumAttributeKindForName("sret", 4);
4110 LLVMAttributeRef sret_attr = LLVMCreateEnumAttribute(LLVMGetGlobalContext(), attr_kind_id, 0);
4111 LLVMAddCallSiteAttribute(call_instr, 1, sret_attr);
4112}
4113
4114static void render_async_spills(CodeGen *g) {4087static void render_async_spills(CodeGen *g) {
4115 ZigType *fn_type = g->cur_fn->type_entry;4088 ZigType *fn_type = g->cur_fn->type_entry;
4116 ZigType *import = get_scope_import(&g->cur_fn->fndef_scope->base);4089 ZigType *import = get_scope_import(&g->cur_fn->fndef_scope->base);
...@@ -4634,7 +4607,7 @@ static LLVMValueRef ir_render_call(CodeGen *g, IrExecutableGen *executable, IrIn...@@ -4634,7 +4607,7 @@ static LLVMValueRef ir_render_call(CodeGen *g, IrExecutableGen *executable, IrIn
4634 } else if (!ret_has_bits) {4607 } else if (!ret_has_bits) {
4635 return nullptr;4608 return nullptr;
4636 } else if (first_arg_ret) {4609 } else if (first_arg_ret) {
4637 set_call_instr_sret(g, result);4610 ZigLLVMSetCallSret(result, get_llvm_type(g, src_return_type));
4638 return result_loc;4611 return result_loc;
4639 } else if (handle_is_ptr(g, src_return_type)) {4612 } else if (handle_is_ptr(g, src_return_type)) {
4640 LLVMValueRef store_instr = LLVMBuildStore(g->builder, result, result_loc);4613 LLVMValueRef store_instr = LLVMBuildStore(g->builder, result, result_loc);
src/stage1/stage1.h+1-1
...@@ -73,11 +73,11 @@ enum Os {...@@ -73,11 +73,11 @@ enum Os {
73 OsOpenBSD,73 OsOpenBSD,
74 OsSolaris,74 OsSolaris,
75 OsWindows,75 OsWindows,
76 OsZOS,
76 OsHaiku,77 OsHaiku,
77 OsMinix,78 OsMinix,
78 OsRTEMS,79 OsRTEMS,
79 OsNaCl, // Native Client80 OsNaCl, // Native Client
80 OsCNK, // BG/P Compute-Node Kernel
81 OsAIX,81 OsAIX,
82 OsCUDA, // NVIDIA CUDA82 OsCUDA, // NVIDIA CUDA
83 OsNVCL, // NVIDIA OpenCL83 OsNVCL, // NVIDIA OpenCL
src/stage1/target.cpp+24-9
...@@ -23,6 +23,7 @@ static const ZigLLVM_ArchType arch_list[] = {...@@ -23,6 +23,7 @@ static const ZigLLVM_ArchType arch_list[] = {
23 ZigLLVM_avr, // AVR: Atmel AVR microcontroller23 ZigLLVM_avr, // AVR: Atmel AVR microcontroller
24 ZigLLVM_bpfel, // eBPF or extended BPF or 64-bit BPF (little endian)24 ZigLLVM_bpfel, // eBPF or extended BPF or 64-bit BPF (little endian)
25 ZigLLVM_bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian)25 ZigLLVM_bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian)
26 ZigLLVM_csky, // CSKY: csky
26 ZigLLVM_hexagon, // Hexagon: hexagon27 ZigLLVM_hexagon, // Hexagon: hexagon
27 ZigLLVM_mips, // MIPS: mips, mipsallegrex, mipsr628 ZigLLVM_mips, // MIPS: mips, mipsallegrex, mipsr6
28 ZigLLVM_mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el29 ZigLLVM_mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el
...@@ -30,6 +31,7 @@ static const ZigLLVM_ArchType arch_list[] = {...@@ -30,6 +31,7 @@ static const ZigLLVM_ArchType arch_list[] = {
30 ZigLLVM_mips64el, // MIPS64EL: mips64el, mips64r6el, mipsn32el, mipsn32r6el31 ZigLLVM_mips64el, // MIPS64EL: mips64el, mips64r6el, mipsn32el, mipsn32r6el
31 ZigLLVM_msp430, // MSP430: msp43032 ZigLLVM_msp430, // MSP430: msp430
32 ZigLLVM_ppc, // PPC: powerpc33 ZigLLVM_ppc, // PPC: powerpc
34 ZigLLVM_ppcle, // PPCLE: powerpc (little endian)
33 ZigLLVM_ppc64, // PPC64: powerpc64, ppu35 ZigLLVM_ppc64, // PPC64: powerpc64, ppu
34 ZigLLVM_ppc64le, // PPC64LE: powerpc64le36 ZigLLVM_ppc64le, // PPC64LE: powerpc64le
35 ZigLLVM_r600, // R600: AMD GPUs HD2XXX - HD6XXX37 ZigLLVM_r600, // R600: AMD GPUs HD2XXX - HD6XXX
...@@ -71,8 +73,6 @@ static const ZigLLVM_VendorType vendor_list[] = {...@@ -71,8 +73,6 @@ static const ZigLLVM_VendorType vendor_list[] = {
71 ZigLLVM_Apple,73 ZigLLVM_Apple,
72 ZigLLVM_PC,74 ZigLLVM_PC,
73 ZigLLVM_SCEI,75 ZigLLVM_SCEI,
74 ZigLLVM_BGP,
75 ZigLLVM_BGQ,
76 ZigLLVM_Freescale,76 ZigLLVM_Freescale,
77 ZigLLVM_IBM,77 ZigLLVM_IBM,
78 ZigLLVM_ImaginationTechnologies,78 ZigLLVM_ImaginationTechnologies,
...@@ -101,11 +101,11 @@ static const Os os_list[] = {...@@ -101,11 +101,11 @@ static const Os os_list[] = {
101 OsOpenBSD,101 OsOpenBSD,
102 OsSolaris,102 OsSolaris,
103 OsWindows,103 OsWindows,
104 OsZOS,
104 OsHaiku,105 OsHaiku,
105 OsMinix,106 OsMinix,
106 OsRTEMS,107 OsRTEMS,
107 OsNaCl, // Native Client108 OsNaCl, // Native Client
108 OsCNK, // BG/P Compute-Node Kernel
109 OsAIX,109 OsAIX,
110 OsCUDA, // NVIDIA CUDA110 OsCUDA, // NVIDIA CUDA
111 OsNVCL, // NVIDIA OpenCL111 OsNVCL, // NVIDIA OpenCL
...@@ -135,6 +135,7 @@ static const ZigLLVM_EnvironmentType abi_list[] = {...@@ -135,6 +135,7 @@ static const ZigLLVM_EnvironmentType abi_list[] = {
135 ZigLLVM_GNUEABI,135 ZigLLVM_GNUEABI,
136 ZigLLVM_GNUEABIHF,136 ZigLLVM_GNUEABIHF,
137 ZigLLVM_GNUX32,137 ZigLLVM_GNUX32,
138 ZigLLVM_GNUILP32,
138 ZigLLVM_CODE16,139 ZigLLVM_CODE16,
139 ZigLLVM_EABI,140 ZigLLVM_EABI,
140 ZigLLVM_EABIHF,141 ZigLLVM_EABIHF,
...@@ -155,8 +156,10 @@ static const ZigLLVM_ObjectFormatType oformat_list[] = {...@@ -155,8 +156,10 @@ static const ZigLLVM_ObjectFormatType oformat_list[] = {
155 ZigLLVM_UnknownObjectFormat,156 ZigLLVM_UnknownObjectFormat,
156 ZigLLVM_COFF,157 ZigLLVM_COFF,
157 ZigLLVM_ELF,158 ZigLLVM_ELF,
159 ZigLLVM_GOFF,
158 ZigLLVM_MachO,160 ZigLLVM_MachO,
159 ZigLLVM_Wasm,161 ZigLLVM_Wasm,
162 ZigLLVM_XCOFF,
160};163};
161164
162size_t target_oformat_count(void) {165size_t target_oformat_count(void) {
...@@ -173,6 +176,7 @@ const char *target_oformat_name(ZigLLVM_ObjectFormatType oformat) {...@@ -173,6 +176,7 @@ const char *target_oformat_name(ZigLLVM_ObjectFormatType oformat) {
173 case ZigLLVM_UnknownObjectFormat: return "unknown";176 case ZigLLVM_UnknownObjectFormat: return "unknown";
174 case ZigLLVM_COFF: return "coff";177 case ZigLLVM_COFF: return "coff";
175 case ZigLLVM_ELF: return "elf";178 case ZigLLVM_ELF: return "elf";
179 case ZigLLVM_GOFF: return "goff";
176 case ZigLLVM_MachO: return "macho";180 case ZigLLVM_MachO: return "macho";
177 case ZigLLVM_Wasm: return "wasm";181 case ZigLLVM_Wasm: return "wasm";
178 case ZigLLVM_XCOFF: return "xcoff";182 case ZigLLVM_XCOFF: return "xcoff";
...@@ -240,6 +244,8 @@ ZigLLVM_OSType get_llvm_os_type(Os os_type) {...@@ -240,6 +244,8 @@ ZigLLVM_OSType get_llvm_os_type(Os os_type) {
240 case OsWindows:244 case OsWindows:
241 case OsUefi:245 case OsUefi:
242 return ZigLLVM_Win32;246 return ZigLLVM_Win32;
247 case OsZOS:
248 return ZigLLVM_ZOS;
243 case OsHaiku:249 case OsHaiku:
244 return ZigLLVM_Haiku;250 return ZigLLVM_Haiku;
245 case OsMinix:251 case OsMinix:
...@@ -248,8 +254,6 @@ ZigLLVM_OSType get_llvm_os_type(Os os_type) {...@@ -248,8 +254,6 @@ ZigLLVM_OSType get_llvm_os_type(Os os_type) {
248 return ZigLLVM_RTEMS;254 return ZigLLVM_RTEMS;
249 case OsNaCl:255 case OsNaCl:
250 return ZigLLVM_NaCl;256 return ZigLLVM_NaCl;
251 case OsCNK:
252 return ZigLLVM_CNK;
253 case OsAIX:257 case OsAIX:
254 return ZigLLVM_AIX;258 return ZigLLVM_AIX;
255 case OsCUDA:259 case OsCUDA:
...@@ -306,11 +310,11 @@ const char *target_os_name(Os os_type) {...@@ -306,11 +310,11 @@ const char *target_os_name(Os os_type) {
306 case OsOpenBSD:310 case OsOpenBSD:
307 case OsSolaris:311 case OsSolaris:
308 case OsWindows:312 case OsWindows:
313 case OsZOS:
309 case OsHaiku:314 case OsHaiku:
310 case OsMinix:315 case OsMinix:
311 case OsRTEMS:316 case OsRTEMS:
312 case OsNaCl: // Native Client317 case OsNaCl: // Native Client
313 case OsCNK: // BG/P Compute-Node Kernel
314 case OsAIX:318 case OsAIX:
315 case OsCUDA: // NVIDIA CUDA319 case OsCUDA: // NVIDIA CUDA
316 case OsNVCL: // NVIDIA OpenCL320 case OsNVCL: // NVIDIA OpenCL
...@@ -485,6 +489,7 @@ uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch) {...@@ -485,6 +489,7 @@ uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch) {
485 case ZigLLVM_mipsel:489 case ZigLLVM_mipsel:
486 case ZigLLVM_nvptx:490 case ZigLLVM_nvptx:
487 case ZigLLVM_ppc:491 case ZigLLVM_ppc:
492 case ZigLLVM_ppcle:
488 case ZigLLVM_r600:493 case ZigLLVM_r600:
489 case ZigLLVM_riscv32:494 case ZigLLVM_riscv32:
490 case ZigLLVM_sparc:495 case ZigLLVM_sparc:
...@@ -504,6 +509,7 @@ uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch) {...@@ -504,6 +509,7 @@ uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch) {
504 case ZigLLVM_wasm32:509 case ZigLLVM_wasm32:
505 case ZigLLVM_renderscript32:510 case ZigLLVM_renderscript32:
506 case ZigLLVM_aarch64_32:511 case ZigLLVM_aarch64_32:
512 case ZigLLVM_csky:
507 return 32;513 return 32;
508514
509 case ZigLLVM_aarch64:515 case ZigLLVM_aarch64:
...@@ -550,6 +556,7 @@ uint32_t target_arch_largest_atomic_bits(ZigLLVM_ArchType arch) {...@@ -550,6 +556,7 @@ uint32_t target_arch_largest_atomic_bits(ZigLLVM_ArchType arch) {
550 case ZigLLVM_mipsel:556 case ZigLLVM_mipsel:
551 case ZigLLVM_nvptx:557 case ZigLLVM_nvptx:
552 case ZigLLVM_ppc:558 case ZigLLVM_ppc:
559 case ZigLLVM_ppcle:
553 case ZigLLVM_r600:560 case ZigLLVM_r600:
554 case ZigLLVM_riscv32:561 case ZigLLVM_riscv32:
555 case ZigLLVM_sparc:562 case ZigLLVM_sparc:
...@@ -568,6 +575,7 @@ uint32_t target_arch_largest_atomic_bits(ZigLLVM_ArchType arch) {...@@ -568,6 +575,7 @@ uint32_t target_arch_largest_atomic_bits(ZigLLVM_ArchType arch) {
568 case ZigLLVM_shave:575 case ZigLLVM_shave:
569 case ZigLLVM_wasm32:576 case ZigLLVM_wasm32:
570 case ZigLLVM_renderscript32:577 case ZigLLVM_renderscript32:
578 case ZigLLVM_csky:
571 return 32;579 return 32;
572580
573 case ZigLLVM_aarch64:581 case ZigLLVM_aarch64:
...@@ -707,10 +715,10 @@ uint32_t target_c_type_size_in_bits(const ZigTarget *target, CIntType id) {...@@ -707,10 +715,10 @@ uint32_t target_c_type_size_in_bits(const ZigTarget *target, CIntType id) {
707 case OsKFreeBSD:715 case OsKFreeBSD:
708 case OsLv2:716 case OsLv2:
709 case OsSolaris:717 case OsSolaris:
718 case OsZOS:
710 case OsMinix:719 case OsMinix:
711 case OsRTEMS:720 case OsRTEMS:
712 case OsNaCl:721 case OsNaCl:
713 case OsCNK:
714 case OsAIX:722 case OsAIX:
715 case OsCUDA:723 case OsCUDA:
716 case OsNVCL:724 case OsNVCL:
...@@ -799,6 +807,7 @@ const char *arch_stack_pointer_register_name(ZigLLVM_ArchType arch) {...@@ -799,6 +807,7 @@ const char *arch_stack_pointer_register_name(ZigLLVM_ArchType arch) {
799 case ZigLLVM_riscv64:807 case ZigLLVM_riscv64:
800 case ZigLLVM_mipsel:808 case ZigLLVM_mipsel:
801 case ZigLLVM_ppc:809 case ZigLLVM_ppc:
810 case ZigLLVM_ppcle:
802 case ZigLLVM_ppc64:811 case ZigLLVM_ppc64:
803 case ZigLLVM_ppc64le:812 case ZigLLVM_ppc64le:
804 return "sp";813 return "sp";
...@@ -814,6 +823,7 @@ const char *arch_stack_pointer_register_name(ZigLLVM_ArchType arch) {...@@ -814,6 +823,7 @@ const char *arch_stack_pointer_register_name(ZigLLVM_ArchType arch) {
814 case ZigLLVM_avr:823 case ZigLLVM_avr:
815 case ZigLLVM_bpfeb:824 case ZigLLVM_bpfeb:
816 case ZigLLVM_bpfel:825 case ZigLLVM_bpfel:
826 case ZigLLVM_csky:
817 case ZigLLVM_hexagon:827 case ZigLLVM_hexagon:
818 case ZigLLVM_lanai:828 case ZigLLVM_lanai:
819 case ZigLLVM_hsail:829 case ZigLLVM_hsail:
...@@ -868,6 +878,7 @@ bool target_is_arm(const ZigTarget *target) {...@@ -868,6 +878,7 @@ bool target_is_arm(const ZigTarget *target) {
868 case ZigLLVM_avr:878 case ZigLLVM_avr:
869 case ZigLLVM_bpfeb:879 case ZigLLVM_bpfeb:
870 case ZigLLVM_bpfel:880 case ZigLLVM_bpfel:
881 case ZigLLVM_csky:
871 case ZigLLVM_hexagon:882 case ZigLLVM_hexagon:
872 case ZigLLVM_lanai:883 case ZigLLVM_lanai:
873 case ZigLLVM_hsail:884 case ZigLLVM_hsail:
...@@ -901,6 +912,7 @@ bool target_is_arm(const ZigTarget *target) {...@@ -901,6 +912,7 @@ bool target_is_arm(const ZigTarget *target) {
901 case ZigLLVM_wasm64:912 case ZigLLVM_wasm64:
902 case ZigLLVM_xcore:913 case ZigLLVM_xcore:
903 case ZigLLVM_ppc:914 case ZigLLVM_ppc:
915 case ZigLLVM_ppcle:
904 case ZigLLVM_ppc64:916 case ZigLLVM_ppc64:
905 case ZigLLVM_ve:917 case ZigLLVM_ve:
906 return false;918 return false;
...@@ -951,11 +963,10 @@ ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) {...@@ -951,11 +963,10 @@ ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) {
951 case OsCloudABI:963 case OsCloudABI:
952 case OsLv2:964 case OsLv2:
953 case OsSolaris:965 case OsSolaris:
954 case OsHaiku:966 case OsZOS:
955 case OsMinix:967 case OsMinix:
956 case OsRTEMS:968 case OsRTEMS:
957 case OsNaCl:969 case OsNaCl:
958 case OsCNK:
959 case OsAIX:970 case OsAIX:
960 case OsCUDA:971 case OsCUDA:
961 case OsNVCL:972 case OsNVCL:
...@@ -979,6 +990,7 @@ ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) {...@@ -979,6 +990,7 @@ ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) {
979 case OsNetBSD:990 case OsNetBSD:
980 case OsDragonFly:991 case OsDragonFly:
981 case OsHurd:992 case OsHurd:
993 case OsHaiku:
982 return ZigLLVM_GNU;994 return ZigLLVM_GNU;
983 case OsUefi:995 case OsUefi:
984 case OsWindows:996 case OsWindows:
...@@ -1039,6 +1051,8 @@ static const AvailableLibC libcs_available[] = {...@@ -1039,6 +1051,8 @@ static const AvailableLibC libcs_available[] = {
1039 {ZigLLVM_arm, OsLinux, ZigLLVM_MuslEABI},1051 {ZigLLVM_arm, OsLinux, ZigLLVM_MuslEABI},
1040 {ZigLLVM_arm, OsLinux, ZigLLVM_MuslEABIHF},1052 {ZigLLVM_arm, OsLinux, ZigLLVM_MuslEABIHF},
1041 {ZigLLVM_arm, OsWindows, ZigLLVM_GNU},1053 {ZigLLVM_arm, OsWindows, ZigLLVM_GNU},
1054 {ZigLLVM_csky, OsLinux, ZigLLVM_GNUEABI},
1055 {ZigLLVM_csky, OsLinux, ZigLLVM_GNUEABIHF},
1042 {ZigLLVM_x86, OsLinux, ZigLLVM_GNU},1056 {ZigLLVM_x86, OsLinux, ZigLLVM_GNU},
1043 {ZigLLVM_x86, OsLinux, ZigLLVM_Musl},1057 {ZigLLVM_x86, OsLinux, ZigLLVM_Musl},
1044 {ZigLLVM_x86, OsWindows, ZigLLVM_GNU},1058 {ZigLLVM_x86, OsWindows, ZigLLVM_GNU},
...@@ -1094,6 +1108,7 @@ const char *target_libc_generic_name(const ZigTarget *target) {...@@ -1094,6 +1108,7 @@ const char *target_libc_generic_name(const ZigTarget *target) {
1094 case ZigLLVM_GNUEABI:1108 case ZigLLVM_GNUEABI:
1095 case ZigLLVM_GNUEABIHF:1109 case ZigLLVM_GNUEABIHF:
1096 case ZigLLVM_GNUX32:1110 case ZigLLVM_GNUX32:
1111 case ZigLLVM_GNUILP32:
1097 return "glibc";1112 return "glibc";
1098 case ZigLLVM_Musl:1113 case ZigLLVM_Musl:
1099 case ZigLLVM_MuslEABI:1114 case ZigLLVM_MuslEABI:
src/stage1/zig0.cpp+2-2
...@@ -94,6 +94,8 @@ static Os get_zig_os_type(ZigLLVM_OSType os_type) {...@@ -94,6 +94,8 @@ static Os get_zig_os_type(ZigLLVM_OSType os_type) {
94 return OsSolaris;94 return OsSolaris;
95 case ZigLLVM_Win32:95 case ZigLLVM_Win32:
96 return OsWindows;96 return OsWindows;
97 case ZigLLVM_ZOS:
98 return OsZOS;
97 case ZigLLVM_Haiku:99 case ZigLLVM_Haiku:
98 return OsHaiku;100 return OsHaiku;
99 case ZigLLVM_Minix:101 case ZigLLVM_Minix:
...@@ -102,8 +104,6 @@ static Os get_zig_os_type(ZigLLVM_OSType os_type) {...@@ -102,8 +104,6 @@ static Os get_zig_os_type(ZigLLVM_OSType os_type) {
102 return OsRTEMS;104 return OsRTEMS;
103 case ZigLLVM_NaCl:105 case ZigLLVM_NaCl:
104 return OsNaCl;106 return OsNaCl;
105 case ZigLLVM_CNK:
106 return OsCNK;
107 case ZigLLVM_AIX:107 case ZigLLVM_AIX:
108 return OsAIX;108 return OsAIX;
109 case ZigLLVM_CUDA:109 case ZigLLVM_CUDA:
src/target.zig+6-1
...@@ -25,6 +25,8 @@ pub const available_libcs = [_]ArchOsAbi{...@@ -25,6 +25,8 @@ pub const available_libcs = [_]ArchOsAbi{
25 .{ .arch = .arm, .os = .linux, .abi = .musleabi },25 .{ .arch = .arm, .os = .linux, .abi = .musleabi },
26 .{ .arch = .arm, .os = .linux, .abi = .musleabihf },26 .{ .arch = .arm, .os = .linux, .abi = .musleabihf },
27 .{ .arch = .arm, .os = .windows, .abi = .gnu },27 .{ .arch = .arm, .os = .windows, .abi = .gnu },
28 .{ .arch = .csky, .os = .linux, .abi = .gnueabi },
29 .{ .arch = .csky, .os = .linux, .abi = .gnueabihf },
28 .{ .arch = .i386, .os = .linux, .abi = .gnu },30 .{ .arch = .i386, .os = .linux, .abi = .gnu },
29 .{ .arch = .i386, .os = .linux, .abi = .musl },31 .{ .arch = .i386, .os = .linux, .abi = .musl },
30 .{ .arch = .i386, .os = .windows, .abi = .gnu },32 .{ .arch = .i386, .os = .windows, .abi = .gnu },
...@@ -71,6 +73,7 @@ pub fn libCGenericName(target: std.Target) [:0]const u8 {...@@ -71,6 +73,7 @@ pub fn libCGenericName(target: std.Target) [:0]const u8 {
71 .gnueabi,73 .gnueabi,
72 .gnueabihf,74 .gnueabihf,
73 .gnux32,75 .gnux32,
76 .gnuilp32,
74 => return "glibc",77 => return "glibc",
75 .musl,78 .musl,
76 .musleabi,79 .musleabi,
...@@ -204,11 +207,11 @@ pub fn osToLLVM(os_tag: std.Target.Os.Tag) llvm.OSType {...@@ -204,11 +207,11 @@ pub fn osToLLVM(os_tag: std.Target.Os.Tag) llvm.OSType {
204 .netbsd => .NetBSD,207 .netbsd => .NetBSD,
205 .openbsd => .OpenBSD,208 .openbsd => .OpenBSD,
206 .solaris => .Solaris,209 .solaris => .Solaris,
210 .zos => .ZOS,
207 .haiku => .Haiku,211 .haiku => .Haiku,
208 .minix => .Minix,212 .minix => .Minix,
209 .rtems => .RTEMS,213 .rtems => .RTEMS,
210 .nacl => .NaCl,214 .nacl => .NaCl,
211 .cnk => .CNK,
212 .aix => .AIX,215 .aix => .AIX,
213 .cuda => .CUDA,216 .cuda => .CUDA,
214 .nvcl => .NVCL,217 .nvcl => .NVCL,
...@@ -238,6 +241,7 @@ pub fn archToLLVM(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {...@@ -238,6 +241,7 @@ pub fn archToLLVM(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {
238 .avr => .avr,241 .avr => .avr,
239 .bpfel => .bpfel,242 .bpfel => .bpfel,
240 .bpfeb => .bpfeb,243 .bpfeb => .bpfeb,
244 .csky => .csky,
241 .hexagon => .hexagon,245 .hexagon => .hexagon,
242 .mips => .mips,246 .mips => .mips,
243 .mipsel => .mipsel,247 .mipsel => .mipsel,
...@@ -245,6 +249,7 @@ pub fn archToLLVM(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {...@@ -245,6 +249,7 @@ pub fn archToLLVM(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {
245 .mips64el => .mips64el,249 .mips64el => .mips64el,
246 .msp430 => .msp430,250 .msp430 => .msp430,
247 .powerpc => .ppc,251 .powerpc => .ppc,
252 .powerpcle => .ppcle,
248 .powerpc64 => .ppc64,253 .powerpc64 => .ppc64,
249 .powerpc64le => .ppc64le,254 .powerpc64le => .ppc64le,
250 .r600 => .r600,255 .r600 => .r600,
src/translate_c.zig+1-1
...@@ -2914,7 +2914,7 @@ fn transSwitchProngStmtInline(...@@ -2914,7 +2914,7 @@ fn transSwitchProngStmtInline(
29142914
2915fn transConstantExpr(c: *Context, scope: *Scope, expr: *const clang.Expr, used: ResultUsed) TransError!Node {2915fn transConstantExpr(c: *Context, scope: *Scope, expr: *const clang.Expr, used: ResultUsed) TransError!Node {
2916 var result: clang.ExprEvalResult = undefined;2916 var result: clang.ExprEvalResult = undefined;
2917 if (!expr.evaluateAsConstantExpr(&result, .EvaluateForCodeGen, c.clang_context))2917 if (!expr.evaluateAsConstantExpr(&result, .Normal, c.clang_context))
2918 return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "invalid constant expression", .{});2918 return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "invalid constant expression", .{});
29192919
2920 switch (result.Val.getKind()) {2920 switch (result.Val.getKind()) {
src/type.zig+1-1
...@@ -2695,11 +2695,11 @@ pub const CType = enum {...@@ -2695,11 +2695,11 @@ pub const CType = enum {
2695 .kfreebsd,2695 .kfreebsd,
2696 .lv2,2696 .lv2,
2697 .solaris,2697 .solaris,
2698 .zos,
2698 .haiku,2699 .haiku,
2699 .minix,2700 .minix,
2700 .rtems,2701 .rtems,
2701 .nacl,2702 .nacl,
2702 .cnk,
2703 .aix,2703 .aix,
2704 .cuda,2704 .cuda,
2705 .nvcl,2705 .nvcl,
src/zig_clang.cpp+21-7
...@@ -182,6 +182,8 @@ void ZigClang_detect_enum_CK(clang::CastKind x) {...@@ -182,6 +182,8 @@ void ZigClang_detect_enum_CK(clang::CastKind x) {
182 case clang::CK_IntegralToBoolean:182 case clang::CK_IntegralToBoolean:
183 case clang::CK_IntegralToFloating:183 case clang::CK_IntegralToFloating:
184 case clang::CK_IntegralToPointer:184 case clang::CK_IntegralToPointer:
185 case clang::CK_FloatingToFixedPoint:
186 case clang::CK_FixedPointToFloating:
185 case clang::CK_LValueBitCast:187 case clang::CK_LValueBitCast:
186 case clang::CK_LValueToRValueBitCast:188 case clang::CK_LValueToRValueBitCast:
187 case clang::CK_LValueToRValue:189 case clang::CK_LValueToRValue:
...@@ -237,6 +239,8 @@ static_assert((clang::CastKind)ZigClangCK_VectorSplat == clang::CK_VectorSplat,...@@ -237,6 +239,8 @@ static_assert((clang::CastKind)ZigClangCK_VectorSplat == clang::CK_VectorSplat,
237static_assert((clang::CastKind)ZigClangCK_IntegralCast == clang::CK_IntegralCast, "");239static_assert((clang::CastKind)ZigClangCK_IntegralCast == clang::CK_IntegralCast, "");
238static_assert((clang::CastKind)ZigClangCK_IntegralToBoolean == clang::CK_IntegralToBoolean, "");240static_assert((clang::CastKind)ZigClangCK_IntegralToBoolean == clang::CK_IntegralToBoolean, "");
239static_assert((clang::CastKind)ZigClangCK_IntegralToFloating == clang::CK_IntegralToFloating, "");241static_assert((clang::CastKind)ZigClangCK_IntegralToFloating == clang::CK_IntegralToFloating, "");
242static_assert((clang::CastKind)ZigClangCK_FloatingToFixedPoint == clang::CK_FloatingToFixedPoint, "");
243static_assert((clang::CastKind)ZigClangCK_FixedPointToFloating == clang::CK_FixedPointToFloating, "");
240static_assert((clang::CastKind)ZigClangCK_FixedPointCast == clang::CK_FixedPointCast, "");244static_assert((clang::CastKind)ZigClangCK_FixedPointCast == clang::CK_FixedPointCast, "");
241static_assert((clang::CastKind)ZigClangCK_FixedPointToIntegral == clang::CK_FixedPointToIntegral, "");245static_assert((clang::CastKind)ZigClangCK_FixedPointToIntegral == clang::CK_FixedPointToIntegral, "");
242static_assert((clang::CastKind)ZigClangCK_IntegralToFixedPoint == clang::CK_IntegralToFixedPoint, "");246static_assert((clang::CastKind)ZigClangCK_IntegralToFixedPoint == clang::CK_IntegralToFixedPoint, "");
...@@ -928,6 +932,7 @@ void ZigClang_detect_enum_DeclKind(clang::Decl::Kind x) {...@@ -928,6 +932,7 @@ void ZigClang_detect_enum_DeclKind(clang::Decl::Kind x) {
928 case clang::Decl::MSGuid:932 case clang::Decl::MSGuid:
929 case clang::Decl::OMPDeclareMapper:933 case clang::Decl::OMPDeclareMapper:
930 case clang::Decl::OMPDeclareReduction:934 case clang::Decl::OMPDeclareReduction:
935 case clang::Decl::TemplateParamObject:
931 case clang::Decl::UnresolvedUsingValue:936 case clang::Decl::UnresolvedUsingValue:
932 case clang::Decl::OMPAllocate:937 case clang::Decl::OMPAllocate:
933 case clang::Decl::OMPRequires:938 case clang::Decl::OMPRequires:
...@@ -1013,6 +1018,7 @@ static_assert((clang::Decl::Kind)ZigClangDeclIndirectField == clang::Decl::Indir...@@ -1013,6 +1018,7 @@ static_assert((clang::Decl::Kind)ZigClangDeclIndirectField == clang::Decl::Indir
1013static_assert((clang::Decl::Kind)ZigClangDeclMSGuid == clang::Decl::MSGuid, "");1018static_assert((clang::Decl::Kind)ZigClangDeclMSGuid == clang::Decl::MSGuid, "");
1014static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareMapper == clang::Decl::OMPDeclareMapper, "");1019static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareMapper == clang::Decl::OMPDeclareMapper, "");
1015static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareReduction == clang::Decl::OMPDeclareReduction, "");1020static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareReduction == clang::Decl::OMPDeclareReduction, "");
1021static_assert((clang::Decl::Kind)ZigClangDeclTemplateParamObject == clang::Decl::TemplateParamObject, "");
1016static_assert((clang::Decl::Kind)ZigClangDeclUnresolvedUsingValue == clang::Decl::UnresolvedUsingValue, "");1022static_assert((clang::Decl::Kind)ZigClangDeclUnresolvedUsingValue == clang::Decl::UnresolvedUsingValue, "");
1017static_assert((clang::Decl::Kind)ZigClangDeclOMPRequires == clang::Decl::OMPRequires, "");1023static_assert((clang::Decl::Kind)ZigClangDeclOMPRequires == clang::Decl::OMPRequires, "");
1018static_assert((clang::Decl::Kind)ZigClangDeclOMPThreadPrivate == clang::Decl::OMPThreadPrivate, "");1024static_assert((clang::Decl::Kind)ZigClangDeclOMPThreadPrivate == clang::Decl::OMPThreadPrivate, "");
...@@ -1122,6 +1128,8 @@ void ZigClang_detect_enum_BuiltinTypeKind(clang::BuiltinType::Kind x) {...@@ -1122,6 +1128,8 @@ void ZigClang_detect_enum_BuiltinTypeKind(clang::BuiltinType::Kind x) {
1122 case clang::BuiltinType::SveFloat64x4:1128 case clang::BuiltinType::SveFloat64x4:
1123 case clang::BuiltinType::SveBFloat16x4:1129 case clang::BuiltinType::SveBFloat16x4:
1124 case clang::BuiltinType::SveBool:1130 case clang::BuiltinType::SveBool:
1131 case clang::BuiltinType::VectorQuad:
1132 case clang::BuiltinType::VectorPair:
1125 case clang::BuiltinType::Void:1133 case clang::BuiltinType::Void:
1126 case clang::BuiltinType::Bool:1134 case clang::BuiltinType::Bool:
1127 case clang::BuiltinType::Char_U:1135 case clang::BuiltinType::Char_U:
...@@ -1295,6 +1303,8 @@ static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat32x4 == clang...@@ -1295,6 +1303,8 @@ static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat32x4 == clang
1295static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat64x4 == clang::BuiltinType::SveFloat64x4, "");1303static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat64x4 == clang::BuiltinType::SveFloat64x4, "");
1296static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBFloat16x4 == clang::BuiltinType::SveBFloat16x4, "");1304static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBFloat16x4 == clang::BuiltinType::SveBFloat16x4, "");
1297static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBool == clang::BuiltinType::SveBool, "");1305static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBool == clang::BuiltinType::SveBool, "");
1306static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeVectorQuad == clang::BuiltinType::VectorQuad, "");
1307static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeVectorPair == clang::BuiltinType::VectorPair, "");
1298static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeVoid == clang::BuiltinType::Void, "");1308static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeVoid == clang::BuiltinType::Void, "");
1299static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeBool == clang::BuiltinType::Bool, "");1309static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeBool == clang::BuiltinType::Bool, "");
1300static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeChar_U == clang::BuiltinType::Char_U, "");1310static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeChar_U == clang::BuiltinType::Char_U, "");
...@@ -1517,15 +1527,19 @@ static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_...@@ -1517,15 +1527,19 @@ static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_
1517static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_InclusionDirectiveKind == clang::PreprocessedEntity::InclusionDirectiveKind, "");1527static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_InclusionDirectiveKind == clang::PreprocessedEntity::InclusionDirectiveKind, "");
15181528
15191529
1520void ZigClang_detect_enum_ConstExprUsage(clang::Expr::ConstExprUsage x) {1530void ZigClang_detect_enum_ConstantExprKind(clang::Expr::ConstantExprKind x) {
1521 switch (x) {1531 switch (x) {
1522 case clang::Expr::EvaluateForCodeGen:1532 case clang::Expr::ConstantExprKind::Normal:
1523 case clang::Expr::EvaluateForMangling:1533 case clang::Expr::ConstantExprKind::NonClassTemplateArgument:
1534 case clang::Expr::ConstantExprKind::ClassTemplateArgument:
1535 case clang::Expr::ConstantExprKind::ImmediateInvocation:
1524 break;1536 break;
1525 }1537 }
1526}1538}
1527static_assert((clang::Expr::ConstExprUsage)ZigClangExpr_EvaluateForCodeGen == clang::Expr::EvaluateForCodeGen, "");1539static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ContantExprKind_Normal == clang::Expr::ConstantExprKind::Normal, "");
1528static_assert((clang::Expr::ConstExprUsage)ZigClangExpr_EvaluateForMangling == clang::Expr::EvaluateForMangling, "");1540static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ContantExprKind_NonClassTemplateArgument == clang::Expr::ConstantExprKind::NonClassTemplateArgument, "");
1541static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ContantExprKind_ClassTemplateArgument == clang::Expr::ConstantExprKind::ClassTemplateArgument, "");
1542static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ContantExprKind_ImmediateInvocation == clang::Expr::ConstantExprKind::ImmediateInvocation, "");
15291543
15301544
1531static_assert(sizeof(ZigClangAPValue) == sizeof(clang::APValue), "");1545static_assert(sizeof(ZigClangAPValue) == sizeof(clang::APValue), "");
...@@ -2148,12 +2162,12 @@ bool ZigClangExpr_EvaluateAsFloat(const ZigClangExpr *self, ZigClangAPFloat **re...@@ -2148,12 +2162,12 @@ bool ZigClangExpr_EvaluateAsFloat(const ZigClangExpr *self, ZigClangAPFloat **re
2148}2162}
21492163
2150bool ZigClangExpr_EvaluateAsConstantExpr(const ZigClangExpr *self, ZigClangExprEvalResult *result,2164bool ZigClangExpr_EvaluateAsConstantExpr(const ZigClangExpr *self, ZigClangExprEvalResult *result,
2151 ZigClangExpr_ConstExprUsage usage, const struct ZigClangASTContext *ctx)2165 ZigClangExpr_ConstantExprKind kind, const struct ZigClangASTContext *ctx)
2152{2166{
2153 auto casted_self = reinterpret_cast<const clang::Expr *>(self);2167 auto casted_self = reinterpret_cast<const clang::Expr *>(self);
2154 auto casted_ctx = reinterpret_cast<const clang::ASTContext *>(ctx);2168 auto casted_ctx = reinterpret_cast<const clang::ASTContext *>(ctx);
2155 clang::Expr::EvalResult eval_result;2169 clang::Expr::EvalResult eval_result;
2156 if (!casted_self->EvaluateAsConstantExpr(eval_result, (clang::Expr::ConstExprUsage)usage, *casted_ctx)) {2170 if (!casted_self->EvaluateAsConstantExpr(eval_result, *casted_ctx, (clang::Expr::ConstantExprKind)kind)) {
2157 return false;2171 return false;
2158 }2172 }
2159 *result = bitcast(eval_result);2173 *result = bitcast(eval_result);
src/zig_clang.h+11-4
...@@ -541,6 +541,8 @@ enum ZigClangCK {...@@ -541,6 +541,8 @@ enum ZigClangCK {
541 ZigClangCK_IntegralCast,541 ZigClangCK_IntegralCast,
542 ZigClangCK_IntegralToBoolean,542 ZigClangCK_IntegralToBoolean,
543 ZigClangCK_IntegralToFloating,543 ZigClangCK_IntegralToFloating,
544 ZigClangCK_FloatingToFixedPoint,
545 ZigClangCK_FixedPointToFloating,
544 ZigClangCK_FixedPointCast,546 ZigClangCK_FixedPointCast,
545 ZigClangCK_FixedPointToIntegral,547 ZigClangCK_FixedPointToIntegral,
546 ZigClangCK_IntegralToFixedPoint,548 ZigClangCK_IntegralToFixedPoint,
...@@ -647,6 +649,7 @@ enum ZigClangDeclKind {...@@ -647,6 +649,7 @@ enum ZigClangDeclKind {
647 ZigClangDeclMSGuid,649 ZigClangDeclMSGuid,
648 ZigClangDeclOMPDeclareMapper,650 ZigClangDeclOMPDeclareMapper,
649 ZigClangDeclOMPDeclareReduction,651 ZigClangDeclOMPDeclareReduction,
652 ZigClangDeclTemplateParamObject,
650 ZigClangDeclUnresolvedUsingValue,653 ZigClangDeclUnresolvedUsingValue,
651 ZigClangDeclOMPAllocate,654 ZigClangDeclOMPAllocate,
652 ZigClangDeclOMPRequires,655 ZigClangDeclOMPRequires,
...@@ -757,6 +760,8 @@ enum ZigClangBuiltinTypeKind {...@@ -757,6 +760,8 @@ enum ZigClangBuiltinTypeKind {
757 ZigClangBuiltinTypeSveFloat64x4,760 ZigClangBuiltinTypeSveFloat64x4,
758 ZigClangBuiltinTypeSveBFloat16x4,761 ZigClangBuiltinTypeSveBFloat16x4,
759 ZigClangBuiltinTypeSveBool,762 ZigClangBuiltinTypeSveBool,
763 ZigClangBuiltinTypeVectorQuad,
764 ZigClangBuiltinTypeVectorPair,
760 ZigClangBuiltinTypeVoid,765 ZigClangBuiltinTypeVoid,
761 ZigClangBuiltinTypeBool,766 ZigClangBuiltinTypeBool,
762 ZigClangBuiltinTypeChar_U,767 ZigClangBuiltinTypeChar_U,
...@@ -915,9 +920,11 @@ enum ZigClangPreprocessedEntity_EntityKind {...@@ -915,9 +920,11 @@ enum ZigClangPreprocessedEntity_EntityKind {
915 ZigClangPreprocessedEntity_InclusionDirectiveKind,920 ZigClangPreprocessedEntity_InclusionDirectiveKind,
916};921};
917922
918enum ZigClangExpr_ConstExprUsage {923enum ZigClangExpr_ConstantExprKind {
919 ZigClangExpr_EvaluateForCodeGen,924 ZigClangExpr_ContantExprKind_Normal,
920 ZigClangExpr_EvaluateForMangling,925 ZigClangExpr_ContantExprKind_NonClassTemplateArgument,
926 ZigClangExpr_ContantExprKind_ClassTemplateArgument,
927 ZigClangExpr_ContantExprKind_ImmediateInvocation,
921};928};
922929
923enum ZigClangUnaryExprOrTypeTrait_Kind {930enum ZigClangUnaryExprOrTypeTrait_Kind {
...@@ -1084,7 +1091,7 @@ ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsBooleanCondition(const struct ZigClangE...@@ -1084,7 +1091,7 @@ ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsBooleanCondition(const struct ZigClangE
1084ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsFloat(const struct ZigClangExpr *self,1091ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsFloat(const struct ZigClangExpr *self,
1085 ZigClangAPFloat **result, const struct ZigClangASTContext *ctx);1092 ZigClangAPFloat **result, const struct ZigClangASTContext *ctx);
1086ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsConstantExpr(const struct ZigClangExpr *,1093ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsConstantExpr(const struct ZigClangExpr *,
1087 struct ZigClangExprEvalResult *, ZigClangExpr_ConstExprUsage, const struct ZigClangASTContext *);1094 struct ZigClangExprEvalResult *, ZigClangExpr_ConstantExprKind, const struct ZigClangASTContext *);
10881095
1089ZIG_EXTERN_C const ZigClangExpr *ZigClangInitListExpr_getInit(const ZigClangInitListExpr *, unsigned);1096ZIG_EXTERN_C const ZigClangExpr *ZigClangInitListExpr_getInit(const ZigClangInitListExpr *, unsigned);
1090ZIG_EXTERN_C const ZigClangExpr *ZigClangInitListExpr_getArrayFiller(const ZigClangInitListExpr *);1097ZIG_EXTERN_C const ZigClangExpr *ZigClangInitListExpr_getArrayFiller(const ZigClangInitListExpr *);
src/zig_clang_cc1_main.cpp+1-2
...@@ -251,8 +251,7 @@ int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {...@@ -251,8 +251,7 @@ int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
251 if (auto profilerOutput =251 if (auto profilerOutput =
252 Clang->createOutputFile(Path.str(),252 Clang->createOutputFile(Path.str(),
253 /*Binary=*/false,253 /*Binary=*/false,
254 /*RemoveFileOnSignal=*/false, "",254 /*RemoveFileOnSignal=*/false,
255 /*Extension=*/"json",
256 /*useTemporary=*/false)) {255 /*useTemporary=*/false)) {
257256
258 llvm::timeTraceProfilerWrite(*profilerOutput);257 llvm::timeTraceProfilerWrite(*profilerOutput);
src/zig_clang_cc1as_main.cpp+14-15
...@@ -221,19 +221,13 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,...@@ -221,19 +221,13 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
221 // Any DebugInfoKind implies GenDwarfForAssembly.221 // Any DebugInfoKind implies GenDwarfForAssembly.
222 Opts.GenDwarfForAssembly = Args.hasArg(OPT_debug_info_kind_EQ);222 Opts.GenDwarfForAssembly = Args.hasArg(OPT_debug_info_kind_EQ);
223223
224 if (const Arg *A = Args.getLastArg(OPT_compress_debug_sections,224 if (const Arg *A = Args.getLastArg(OPT_compress_debug_sections_EQ)) {
225 OPT_compress_debug_sections_EQ)) {225 Opts.CompressDebugSections =
226 if (A->getOption().getID() == OPT_compress_debug_sections) {226 llvm::StringSwitch<llvm::DebugCompressionType>(A->getValue())
227 // TODO: be more clever about the compression type auto-detection227 .Case("none", llvm::DebugCompressionType::None)
228 Opts.CompressDebugSections = llvm::DebugCompressionType::GNU;228 .Case("zlib", llvm::DebugCompressionType::Z)
229 } else {229 .Case("zlib-gnu", llvm::DebugCompressionType::GNU)
230 Opts.CompressDebugSections =230 .Default(llvm::DebugCompressionType::None);
231 llvm::StringSwitch<llvm::DebugCompressionType>(A->getValue())
232 .Case("none", llvm::DebugCompressionType::None)
233 .Case("zlib", llvm::DebugCompressionType::Z)
234 .Case("zlib-gnu", llvm::DebugCompressionType::GNU)
235 .Default(llvm::DebugCompressionType::None);
236 }
237 }231 }
238232
239 Opts.RelaxELFRelocations = Args.hasArg(OPT_mrelax_relocations);233 Opts.RelaxELFRelocations = Args.hasArg(OPT_mrelax_relocations);
...@@ -434,8 +428,11 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,...@@ -434,8 +428,11 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
434 std::unique_ptr<MCStreamer> Str;428 std::unique_ptr<MCStreamer> Str;
435429
436 std::unique_ptr<MCInstrInfo> MCII(TheTarget->createMCInstrInfo());430 std::unique_ptr<MCInstrInfo> MCII(TheTarget->createMCInstrInfo());
431 assert(MCII && "Unable to create instruction info!");
432
437 std::unique_ptr<MCSubtargetInfo> STI(433 std::unique_ptr<MCSubtargetInfo> STI(
438 TheTarget->createMCSubtargetInfo(Opts.Triple, Opts.CPU, FS));434 TheTarget->createMCSubtargetInfo(Opts.Triple, Opts.CPU, FS));
435 assert(STI && "Unable to create subtarget info!");
439436
440 raw_pwrite_stream *Out = FDOS.get();437 raw_pwrite_stream *Out = FDOS.get();
441 std::unique_ptr<buffer_ostream> BOS;438 std::unique_ptr<buffer_ostream> BOS;
...@@ -474,6 +471,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,...@@ -474,6 +471,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
474 TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx));471 TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx));
475 std::unique_ptr<MCAsmBackend> MAB(472 std::unique_ptr<MCAsmBackend> MAB(
476 TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions));473 TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions));
474 assert(MAB && "Unable to create asm backend!");
475
477 std::unique_ptr<MCObjectWriter> OW =476 std::unique_ptr<MCObjectWriter> OW =
478 DwoOS ? MAB->createDwoObjectWriter(*Out, *DwoOS)477 DwoOS ? MAB->createDwoObjectWriter(*Out, *DwoOS)
479 : MAB->createObjectWriter(*Out);478 : MAB->createObjectWriter(*Out);
...@@ -526,8 +525,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,...@@ -526,8 +525,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
526 Failed = Parser->Run(Opts.NoInitialTextSection);525 Failed = Parser->Run(Opts.NoInitialTextSection);
527 }526 }
528527
529 // Close Streamer first.528 // Parser has a reference to the output stream (Str), so close Parser first.
530 // It might have a reference to the output stream.529 Parser.reset();
531 Str.reset();530 Str.reset();
532 // Close the output stream early.531 // Close the output stream early.
533 BOS.reset();532 BOS.reset();
src/zig_clang_driver.cpp+7
...@@ -528,6 +528,13 @@ int ZigClang_main(int argc_, const char **argv_) {...@@ -528,6 +528,13 @@ int ZigClang_main(int argc_, const char **argv_) {
528 IsCrash = CommandRes < 0 || CommandRes == 70;528 IsCrash = CommandRes < 0 || CommandRes == 70;
529#ifdef _WIN32529#ifdef _WIN32
530 IsCrash |= CommandRes == 3;530 IsCrash |= CommandRes == 3;
531#endif
532#if LLVM_ON_UNIX
533 // When running in integrated-cc1 mode, the CrashRecoveryContext returns
534 // the same codes as if the program crashed. See section "Exit Status for
535 // Commands":
536 // https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html
537 IsCrash |= CommandRes > 128;
531#endif538#endif
532 if (IsCrash) {539 if (IsCrash) {
533 TheDriver.generateCompilationDiagnostics(*C, *FailingCommand);540 TheDriver.generateCompilationDiagnostics(*C, *FailingCommand);
src/zig_llvm.cpp+165-105
...@@ -20,6 +20,7 @@...@@ -20,6 +20,7 @@
20#pragma GCC diagnostic ignored "-Winit-list-lifetime"20#pragma GCC diagnostic ignored "-Winit-list-lifetime"
21#endif21#endif
2222
23#include <llvm/Analysis/AliasAnalysis.h>
23#include <llvm/Analysis/TargetLibraryInfo.h>24#include <llvm/Analysis/TargetLibraryInfo.h>
24#include <llvm/Analysis/TargetTransformInfo.h>25#include <llvm/Analysis/TargetTransformInfo.h>
25#include <llvm/Bitcode/BitcodeWriter.h>26#include <llvm/Bitcode/BitcodeWriter.h>
...@@ -30,9 +31,12 @@...@@ -30,9 +31,12 @@
30#include <llvm/IR/Instructions.h>31#include <llvm/IR/Instructions.h>
31#include <llvm/IR/LegacyPassManager.h>32#include <llvm/IR/LegacyPassManager.h>
32#include <llvm/IR/Module.h>33#include <llvm/IR/Module.h>
34#include <llvm/IR/PassManager.h>
33#include <llvm/IR/Verifier.h>35#include <llvm/IR/Verifier.h>
34#include <llvm/InitializePasses.h>36#include <llvm/InitializePasses.h>
35#include <llvm/MC/SubtargetFeature.h>37#include <llvm/MC/SubtargetFeature.h>
38#include <llvm/Passes/PassBuilder.h>
39#include <llvm/Passes/StandardInstrumentations.h>
36#include <llvm/Object/Archive.h>40#include <llvm/Object/Archive.h>
37#include <llvm/Object/ArchiveWriter.h>41#include <llvm/Object/ArchiveWriter.h>
38#include <llvm/Object/COFF.h>42#include <llvm/Object/COFF.h>
...@@ -54,6 +58,9 @@...@@ -54,6 +58,9 @@
54#include <llvm/Transforms/Instrumentation/ThreadSanitizer.h>58#include <llvm/Transforms/Instrumentation/ThreadSanitizer.h>
55#include <llvm/Transforms/Scalar.h>59#include <llvm/Transforms/Scalar.h>
56#include <llvm/Transforms/Utils.h>60#include <llvm/Transforms/Utils.h>
61#include <llvm/Transforms/Utils/AddDiscriminators.h>
62#include <llvm/Transforms/Utils/CanonicalizeAliases.h>
63#include <llvm/Transforms/Utils/NameAnonGlobals.h>
5764
58#include <lld/Common/Driver.h>65#include <lld/Common/Driver.h>
5966
...@@ -91,14 +98,6 @@ char *ZigLLVMGetNativeFeatures(void) {...@@ -91,14 +98,6 @@ char *ZigLLVMGetNativeFeatures(void) {
91 return strdup((const char *)StringRef(features.getString()).bytes_begin());98 return strdup((const char *)StringRef(features.getString()).bytes_begin());
92}99}
93100
94static void addDiscriminatorsPass(const PassManagerBuilder &Builder, legacy::PassManagerBase &PM) {
95 PM.add(createAddDiscriminatorsPass());
96}
97
98static void addThreadSanitizerPass(const PassManagerBuilder &Builder, legacy::PassManagerBase &PM) {
99 PM.add(createThreadSanitizerLegacyPassPass());
100}
101
102#ifndef NDEBUG101#ifndef NDEBUG
103static const bool assertions_on = true;102static const bool assertions_on = true;
104#else103#else
...@@ -153,6 +152,11 @@ LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Tri...@@ -153,6 +152,11 @@ LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Tri
153 }152 }
154153
155 TargetOptions opt;154 TargetOptions opt;
155
156 // Work around the missing initialization of this field in the default
157 // constructor. Use -1 so that the default value is used.
158 opt.StackProtectorGuardOffset = (unsigned)-1;
159
156 opt.FunctionSections = function_sections;160 opt.FunctionSections = function_sections;
157 switch (float_abi) {161 switch (float_abi) {
158 case ZigLLVMABITypeDefault:162 case ZigLLVMABITypeDefault:
...@@ -188,14 +192,16 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM...@@ -188,14 +192,16 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM
188 bool is_small, bool time_report, bool tsan, bool lto,192 bool is_small, bool time_report, bool tsan, bool lto,
189 const char *asm_filename, const char *bin_filename, const char *llvm_ir_filename)193 const char *asm_filename, const char *bin_filename, const char *llvm_ir_filename)
190{194{
195 // TODO: Maybe we should collect time trace rather than using timer
196 // to get a more hierarchical timeline view
191 TimePassesIsEnabled = time_report;197 TimePassesIsEnabled = time_report;
192198
193 raw_fd_ostream *dest_asm = nullptr;199 raw_fd_ostream *dest_asm_ptr = nullptr;
194 raw_fd_ostream *dest_bin = nullptr;200 raw_fd_ostream *dest_bin_ptr = nullptr;
195201
196 if (asm_filename) {202 if (asm_filename) {
197 std::error_code EC;203 std::error_code EC;
198 dest_asm = new(std::nothrow) raw_fd_ostream(asm_filename, EC, sys::fs::F_None);204 dest_asm_ptr = new(std::nothrow) raw_fd_ostream(asm_filename, EC, sys::fs::F_None);
199 if (EC) {205 if (EC) {
200 *error_message = strdup((const char *)StringRef(EC.message()).bytes_begin());206 *error_message = strdup((const char *)StringRef(EC.message()).bytes_begin());
201 return true;207 return true;
...@@ -203,116 +209,147 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM...@@ -203,116 +209,147 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM
203 }209 }
204 if (bin_filename) {210 if (bin_filename) {
205 std::error_code EC;211 std::error_code EC;
206 dest_bin = new(std::nothrow) raw_fd_ostream(bin_filename, EC, sys::fs::F_None);212 dest_bin_ptr = new(std::nothrow) raw_fd_ostream(bin_filename, EC, sys::fs::F_None);
207 if (EC) {213 if (EC) {
208 *error_message = strdup((const char *)StringRef(EC.message()).bytes_begin());214 *error_message = strdup((const char *)StringRef(EC.message()).bytes_begin());
209 return true;215 return true;
210 }216 }
211 }217 }
212218
213 TargetMachine* target_machine = reinterpret_cast<TargetMachine*>(targ_machine_ref);219 std::unique_ptr<raw_fd_ostream> dest_asm(dest_asm_ptr),
214 target_machine->setO0WantsFastISel(true);220 dest_bin(dest_bin_ptr);
215221
216 Module* module = unwrap(module_ref);222 TargetMachine &target_machine = *reinterpret_cast<TargetMachine*>(targ_machine_ref);
217223 target_machine.setO0WantsFastISel(true);
218 PassManagerBuilder *PMBuilder = new(std::nothrow) PassManagerBuilder();224
219 if (PMBuilder == nullptr) {225 Module &module = *unwrap(module_ref);
220 *error_message = strdup("memory allocation failure");226
221 return true;227 // Pipeline configurations
228 PipelineTuningOptions pipeline_opts;
229 pipeline_opts.LoopUnrolling = !is_debug;
230 pipeline_opts.SLPVectorization = !is_debug;
231 pipeline_opts.LoopVectorization = !is_debug;
232 pipeline_opts.LoopInterleaving = !is_debug;
233 pipeline_opts.MergeFunctions = !is_debug;
234
235 // Instrumentations
236 PassInstrumentationCallbacks instr_callbacks;
237 StandardInstrumentations std_instrumentations(false);
238 std_instrumentations.registerCallbacks(instr_callbacks);
239
240 PassBuilder pass_builder(false, &target_machine, pipeline_opts,
241 None, &instr_callbacks);
242 using OptimizationLevel = typename PassBuilder::OptimizationLevel;
243
244 LoopAnalysisManager loop_am;
245 FunctionAnalysisManager function_am;
246 CGSCCAnalysisManager cgscc_am;
247 ModuleAnalysisManager module_am;
248
249 // Register the AA manager first so that our version is the one used
250 function_am.registerPass([&] {
251 return pass_builder.buildDefaultAAPipeline();
252 });
253
254 Triple target_triple(module.getTargetTriple());
255 auto tlii = std::make_unique<TargetLibraryInfoImpl>(target_triple);
256 function_am.registerPass([&] { return TargetLibraryAnalysis(*tlii); });
257
258 // Initialize the AnalysisManagers
259 pass_builder.registerModuleAnalyses(module_am);
260 pass_builder.registerCGSCCAnalyses(cgscc_am);
261 pass_builder.registerFunctionAnalyses(function_am);
262 pass_builder.registerLoopAnalyses(loop_am);
263 pass_builder.crossRegisterProxies(loop_am, function_am,
264 cgscc_am, module_am);
265
266 // IR verification
267 if (assertions_on) {
268 // Verify the input
269 pass_builder.registerPipelineStartEPCallback(
270 [](ModulePassManager &module_pm, OptimizationLevel OL) {
271 module_pm.addPass(VerifierPass());
272 });
273 // Verify the output
274 pass_builder.registerOptimizerLastEPCallback(
275 [](ModulePassManager &module_pm, OptimizationLevel OL) {
276 module_pm.addPass(VerifierPass());
277 });
222 }278 }
223 PMBuilder->OptLevel = target_machine->getOptLevel();
224 PMBuilder->SizeLevel = is_small ? 2 : 0;
225
226 PMBuilder->DisableTailCalls = is_debug;
227 PMBuilder->DisableUnrollLoops = is_debug;
228 PMBuilder->SLPVectorize = !is_debug;
229 PMBuilder->LoopVectorize = !is_debug;
230 PMBuilder->LoopsInterleaved = !PMBuilder->DisableUnrollLoops;
231 PMBuilder->RerollLoops = !is_debug;
232 // Leaving NewGVN as default (off) because when on it caused issue #673
233 //PMBuilder->NewGVN = !is_debug;
234 PMBuilder->DisableGVNLoadPRE = is_debug;
235 PMBuilder->VerifyInput = assertions_on;
236 PMBuilder->VerifyOutput = assertions_on;
237 PMBuilder->MergeFunctions = !is_debug;
238 PMBuilder->PrepareForLTO = lto;
239 PMBuilder->PrepareForThinLTO = false;
240 PMBuilder->PerformThinLTO = false;
241
242 TargetLibraryInfoImpl tlii(Triple(module->getTargetTriple()));
243 PMBuilder->LibraryInfo = &tlii;
244
245 if (is_debug) {
246 PMBuilder->Inliner = createAlwaysInlinerLegacyPass(false);
247 } else {
248 target_machine->adjustPassManager(*PMBuilder);
249279
250 PMBuilder->addExtension(PassManagerBuilder::EP_EarlyAsPossible, addDiscriminatorsPass);280 // Passes specific for release build
251 PMBuilder->Inliner = createFunctionInliningPass(PMBuilder->OptLevel, PMBuilder->SizeLevel, false);281 if (!is_debug) {
282 pass_builder.registerPipelineStartEPCallback(
283 [](ModulePassManager &module_pm, OptimizationLevel OL) {
284 module_pm.addPass(
285 createModuleToFunctionPassAdaptor(AddDiscriminatorsPass()));
286 });
252 }287 }
253288
289 // Thread sanitizer
254 if (tsan) {290 if (tsan) {
255 PMBuilder->addExtension(PassManagerBuilder::EP_OptimizerLast, addThreadSanitizerPass);291 pass_builder.registerOptimizerLastEPCallback(
256 PMBuilder->addExtension(PassManagerBuilder::EP_EnabledOnOptLevel0, addThreadSanitizerPass);292 [](ModulePassManager &module_pm, OptimizationLevel level) {
293 module_pm.addPass(ThreadSanitizerPass());
294 });
257 }295 }
258296
259 // Set up the per-function pass manager.297 ModulePassManager module_pm;
260 legacy::FunctionPassManager FPM = legacy::FunctionPassManager(module);298 OptimizationLevel opt_level;
261 auto tliwp = new(std::nothrow) TargetLibraryInfoWrapperPass(tlii);299 // Setting up the optimization level
262 FPM.add(tliwp);300 if (is_debug)
263 FPM.add(createTargetTransformInfoWrapperPass(target_machine->getTargetIRAnalysis()));301 opt_level = OptimizationLevel::O0;
264 if (assertions_on) {302 else if (is_small)
265 FPM.add(createVerifierPass());303 opt_level = OptimizationLevel::Oz;
304 else
305 opt_level = OptimizationLevel::O3;
306
307 // Initialize the PassManager
308 if (opt_level == OptimizationLevel::O0) {
309 module_pm = pass_builder.buildO0DefaultPipeline(opt_level, lto);
310 } else if (lto) {
311 module_pm = pass_builder.buildLTOPreLinkDefaultPipeline(opt_level);
312 } else {
313 module_pm = pass_builder.buildPerModuleDefaultPipeline(opt_level);
266 }314 }
267 PMBuilder->populateFunctionPassManager(FPM);
268
269 {
270 // Set up the per-module pass manager.
271 legacy::PassManager MPM;
272 MPM.add(createTargetTransformInfoWrapperPass(target_machine->getTargetIRAnalysis()));
273 PMBuilder->populateModulePassManager(MPM);
274
275 // Set output passes.
276 if (dest_bin && !lto) {
277 if (target_machine->addPassesToEmitFile(MPM, *dest_bin, nullptr, CGFT_ObjectFile)) {
278 *error_message = strdup("TargetMachine can't emit an object file");
279 return true;
280 }
281 }
282 if (dest_asm) {
283 if (target_machine->addPassesToEmitFile(MPM, *dest_asm, nullptr, CGFT_AssemblyFile)) {
284 *error_message = strdup("TargetMachine can't emit an assembly file");
285 return true;
286 }
287 }
288
289 // run per function optimization passes
290 FPM.doInitialization();
291 for (Function &F : *module)
292 if (!F.isDeclaration())
293 FPM.run(F);
294 FPM.doFinalization();
295315
296 MPM.run(*module);316 // Unfortunately we don't have new PM for code generation
317 legacy::PassManager codegen_pm;
318 codegen_pm.add(
319 createTargetTransformInfoWrapperPass(target_machine.getTargetIRAnalysis()));
297320
298 if (llvm_ir_filename) {321 if (dest_bin && !lto) {
299 if (LLVMPrintModuleToFile(module_ref, llvm_ir_filename, error_message)) {322 if (target_machine.addPassesToEmitFile(codegen_pm, *dest_bin, nullptr, CGFT_ObjectFile)) {
300 return true;323 *error_message = strdup("TargetMachine can't emit an object file");
301 }324 return true;
302 }325 }
303 if (dest_bin && lto) {326 }
304 WriteBitcodeToFile(*module, *dest_bin);327 if (dest_asm) {
328 if (target_machine.addPassesToEmitFile(codegen_pm, *dest_asm, nullptr, CGFT_AssemblyFile)) {
329 *error_message = strdup("TargetMachine can't emit an assembly file");
330 return true;
305 }331 }
332 }
333
334 // Optimization phase
335 module_pm.run(module, module_am);
306336
307 if (time_report) {337 // Code generation phase
308 TimerGroup::printAll(errs());338 codegen_pm.run(module);
339
340 if (llvm_ir_filename) {
341 if (LLVMPrintModuleToFile(module_ref, llvm_ir_filename, error_message)) {
342 return true;
309 }343 }
344 }
310345
311 // MPM goes out of scope and writes to the out streams346 if (dest_bin && lto) {
347 WriteBitcodeToFile(module, *dest_bin);
312 }348 }
313349
314 delete dest_asm;350 if (time_report) {
315 delete dest_bin;351 TimerGroup::printAll(errs());
352 }
316353
317 return false;354 return false;
318}355}
...@@ -614,8 +651,9 @@ void ZigLLVMDisposeDIBuilder(ZigLLVMDIBuilder *dbuilder) {...@@ -614,8 +651,9 @@ void ZigLLVMDisposeDIBuilder(ZigLLVMDIBuilder *dbuilder) {
614}651}
615652
616void ZigLLVMSetCurrentDebugLocation(LLVMBuilderRef builder, int line, int column, ZigLLVMDIScope *scope) {653void ZigLLVMSetCurrentDebugLocation(LLVMBuilderRef builder, int line, int column, ZigLLVMDIScope *scope) {
617 unwrap(builder)->SetCurrentDebugLocation(DebugLoc::get(654 DIScope* di_scope = reinterpret_cast<DIScope*>(scope);
618 line, column, reinterpret_cast<DIScope*>(scope)));655 DebugLoc debug_loc = DILocation::get(di_scope->getContext(), line, column, di_scope, nullptr, false);
656 unwrap(builder)->SetCurrentDebugLocation(debug_loc);
619}657}
620658
621void ZigLLVMClearCurrentDebugLocation(LLVMBuilderRef builder) {659void ZigLLVMClearCurrentDebugLocation(LLVMBuilderRef builder) {
...@@ -776,7 +814,8 @@ LLVMValueRef ZigLLVMInsertDeclare(ZigLLVMDIBuilder *dibuilder, LLVMValueRef stor...@@ -776,7 +814,8 @@ LLVMValueRef ZigLLVMInsertDeclare(ZigLLVMDIBuilder *dibuilder, LLVMValueRef stor
776}814}
777815
778ZigLLVMDILocation *ZigLLVMGetDebugLoc(unsigned line, unsigned col, ZigLLVMDIScope *scope) {816ZigLLVMDILocation *ZigLLVMGetDebugLoc(unsigned line, unsigned col, ZigLLVMDIScope *scope) {
779 DebugLoc debug_loc = DebugLoc::get(line, col, reinterpret_cast<DIScope*>(scope), nullptr);817 DIScope* di_scope = reinterpret_cast<DIScope*>(scope);
818 DebugLoc debug_loc = DILocation::get(di_scope->getContext(), line, col, di_scope, nullptr, false);
780 return reinterpret_cast<ZigLLVMDILocation*>(debug_loc.get());819 return reinterpret_cast<ZigLLVMDILocation*>(debug_loc.get());
781}820}
782821
...@@ -796,7 +835,17 @@ void ZigLLVMAddByValAttr(LLVMValueRef fn_ref, unsigned ArgNo, LLVMTypeRef type_v...@@ -796,7 +835,17 @@ void ZigLLVMAddByValAttr(LLVMValueRef fn_ref, unsigned ArgNo, LLVMTypeRef type_v
796 AttrBuilder attr_builder;835 AttrBuilder attr_builder;
797 Type *llvm_type = unwrap<Type>(type_val);836 Type *llvm_type = unwrap<Type>(type_val);
798 attr_builder.addByValAttr(llvm_type);837 attr_builder.addByValAttr(llvm_type);
799 const AttributeList new_attr_set = attr_set.addAttributes(func->getContext(), ArgNo, attr_builder);838 const AttributeList new_attr_set = attr_set.addAttributes(func->getContext(), ArgNo + 1, attr_builder);
839 func->setAttributes(new_attr_set);
840}
841
842void ZigLLVMAddSretAttr(LLVMValueRef fn_ref, unsigned ArgNo, LLVMTypeRef type_val) {
843 Function *func = unwrap<Function>(fn_ref);
844 const AttributeList attr_set = func->getAttributes();
845 AttrBuilder attr_builder;
846 Type *llvm_type = unwrap<Type>(type_val);
847 attr_builder.addStructRetAttr(llvm_type);
848 const AttributeList new_attr_set = attr_set.addAttributes(func->getContext(), ArgNo + 1, attr_builder);
800 func->setAttributes(new_attr_set);849 func->setAttributes(new_attr_set);
801}850}
802851
...@@ -928,6 +977,15 @@ void ZigLLVMSetTailCall(LLVMValueRef Call) {...@@ -928,6 +977,15 @@ void ZigLLVMSetTailCall(LLVMValueRef Call) {
928 unwrap<CallInst>(Call)->setTailCallKind(CallInst::TCK_MustTail);977 unwrap<CallInst>(Call)->setTailCallKind(CallInst::TCK_MustTail);
929} 978}
930979
980void ZigLLVMSetCallSret(LLVMValueRef Call, LLVMTypeRef return_type) {
981 const AttributeList attr_set = unwrap<CallInst>(Call)->getAttributes();
982 AttrBuilder attr_builder;
983 Type *llvm_type = unwrap<Type>(return_type);
984 attr_builder.addStructRetAttr(llvm_type);
985 const AttributeList new_attr_set = attr_set.addAttributes(unwrap<CallInst>(Call)->getContext(), 1, attr_builder);
986 unwrap<CallInst>(Call)->setAttributes(new_attr_set);
987}
988
931void ZigLLVMFunctionSetPrefixData(LLVMValueRef function, LLVMValueRef data) {989void ZigLLVMFunctionSetPrefixData(LLVMValueRef function, LLVMValueRef data) {
932 unwrap<Function>(function)->setPrefixData(unwrap<Constant>(data));990 unwrap<Function>(function)->setPrefixData(unwrap<Constant>(data));
933}991}
...@@ -1194,6 +1252,7 @@ static_assert((Triple::ArchType)ZigLLVM_arc == Triple::arc, "");...@@ -1194,6 +1252,7 @@ static_assert((Triple::ArchType)ZigLLVM_arc == Triple::arc, "");
1194static_assert((Triple::ArchType)ZigLLVM_avr == Triple::avr, "");1252static_assert((Triple::ArchType)ZigLLVM_avr == Triple::avr, "");
1195static_assert((Triple::ArchType)ZigLLVM_bpfel == Triple::bpfel, "");1253static_assert((Triple::ArchType)ZigLLVM_bpfel == Triple::bpfel, "");
1196static_assert((Triple::ArchType)ZigLLVM_bpfeb == Triple::bpfeb, "");1254static_assert((Triple::ArchType)ZigLLVM_bpfeb == Triple::bpfeb, "");
1255static_assert((Triple::ArchType)ZigLLVM_csky == Triple::csky, "");
1197static_assert((Triple::ArchType)ZigLLVM_hexagon == Triple::hexagon, "");1256static_assert((Triple::ArchType)ZigLLVM_hexagon == Triple::hexagon, "");
1198static_assert((Triple::ArchType)ZigLLVM_mips == Triple::mips, "");1257static_assert((Triple::ArchType)ZigLLVM_mips == Triple::mips, "");
1199static_assert((Triple::ArchType)ZigLLVM_mipsel == Triple::mipsel, "");1258static_assert((Triple::ArchType)ZigLLVM_mipsel == Triple::mipsel, "");
...@@ -1201,6 +1260,7 @@ static_assert((Triple::ArchType)ZigLLVM_mips64 == Triple::mips64, "");...@@ -1201,6 +1260,7 @@ static_assert((Triple::ArchType)ZigLLVM_mips64 == Triple::mips64, "");
1201static_assert((Triple::ArchType)ZigLLVM_mips64el == Triple::mips64el, "");1260static_assert((Triple::ArchType)ZigLLVM_mips64el == Triple::mips64el, "");
1202static_assert((Triple::ArchType)ZigLLVM_msp430 == Triple::msp430, "");1261static_assert((Triple::ArchType)ZigLLVM_msp430 == Triple::msp430, "");
1203static_assert((Triple::ArchType)ZigLLVM_ppc == Triple::ppc, "");1262static_assert((Triple::ArchType)ZigLLVM_ppc == Triple::ppc, "");
1263static_assert((Triple::ArchType)ZigLLVM_ppcle == Triple::ppcle, "");
1204static_assert((Triple::ArchType)ZigLLVM_ppc64 == Triple::ppc64, "");1264static_assert((Triple::ArchType)ZigLLVM_ppc64 == Triple::ppc64, "");
1205static_assert((Triple::ArchType)ZigLLVM_ppc64le == Triple::ppc64le, "");1265static_assert((Triple::ArchType)ZigLLVM_ppc64le == Triple::ppc64le, "");
1206static_assert((Triple::ArchType)ZigLLVM_r600 == Triple::r600, "");1266static_assert((Triple::ArchType)ZigLLVM_r600 == Triple::r600, "");
...@@ -1242,8 +1302,6 @@ static_assert((Triple::VendorType)ZigLLVM_UnknownVendor == Triple::UnknownVendor...@@ -1242,8 +1302,6 @@ static_assert((Triple::VendorType)ZigLLVM_UnknownVendor == Triple::UnknownVendor
1242static_assert((Triple::VendorType)ZigLLVM_Apple == Triple::Apple, "");1302static_assert((Triple::VendorType)ZigLLVM_Apple == Triple::Apple, "");
1243static_assert((Triple::VendorType)ZigLLVM_PC == Triple::PC, "");1303static_assert((Triple::VendorType)ZigLLVM_PC == Triple::PC, "");
1244static_assert((Triple::VendorType)ZigLLVM_SCEI == Triple::SCEI, "");1304static_assert((Triple::VendorType)ZigLLVM_SCEI == Triple::SCEI, "");
1245static_assert((Triple::VendorType)ZigLLVM_BGP == Triple::BGP, "");
1246static_assert((Triple::VendorType)ZigLLVM_BGQ == Triple::BGQ, "");
1247static_assert((Triple::VendorType)ZigLLVM_Freescale == Triple::Freescale, "");1305static_assert((Triple::VendorType)ZigLLVM_Freescale == Triple::Freescale, "");
1248static_assert((Triple::VendorType)ZigLLVM_IBM == Triple::IBM, "");1306static_assert((Triple::VendorType)ZigLLVM_IBM == Triple::IBM, "");
1249static_assert((Triple::VendorType)ZigLLVM_ImaginationTechnologies == Triple::ImaginationTechnologies, "");1307static_assert((Triple::VendorType)ZigLLVM_ImaginationTechnologies == Triple::ImaginationTechnologies, "");
...@@ -1275,11 +1333,11 @@ static_assert((Triple::OSType)ZigLLVM_NetBSD == Triple::NetBSD, "");...@@ -1275,11 +1333,11 @@ static_assert((Triple::OSType)ZigLLVM_NetBSD == Triple::NetBSD, "");
1275static_assert((Triple::OSType)ZigLLVM_OpenBSD == Triple::OpenBSD, "");1333static_assert((Triple::OSType)ZigLLVM_OpenBSD == Triple::OpenBSD, "");
1276static_assert((Triple::OSType)ZigLLVM_Solaris == Triple::Solaris, "");1334static_assert((Triple::OSType)ZigLLVM_Solaris == Triple::Solaris, "");
1277static_assert((Triple::OSType)ZigLLVM_Win32 == Triple::Win32, "");1335static_assert((Triple::OSType)ZigLLVM_Win32 == Triple::Win32, "");
1336static_assert((Triple::OSType)ZigLLVM_ZOS == Triple::ZOS, "");
1278static_assert((Triple::OSType)ZigLLVM_Haiku == Triple::Haiku, "");1337static_assert((Triple::OSType)ZigLLVM_Haiku == Triple::Haiku, "");
1279static_assert((Triple::OSType)ZigLLVM_Minix == Triple::Minix, "");1338static_assert((Triple::OSType)ZigLLVM_Minix == Triple::Minix, "");
1280static_assert((Triple::OSType)ZigLLVM_RTEMS == Triple::RTEMS, "");1339static_assert((Triple::OSType)ZigLLVM_RTEMS == Triple::RTEMS, "");
1281static_assert((Triple::OSType)ZigLLVM_NaCl == Triple::NaCl, "");1340static_assert((Triple::OSType)ZigLLVM_NaCl == Triple::NaCl, "");
1282static_assert((Triple::OSType)ZigLLVM_CNK == Triple::CNK, "");
1283static_assert((Triple::OSType)ZigLLVM_AIX == Triple::AIX, "");1341static_assert((Triple::OSType)ZigLLVM_AIX == Triple::AIX, "");
1284static_assert((Triple::OSType)ZigLLVM_CUDA == Triple::CUDA, "");1342static_assert((Triple::OSType)ZigLLVM_CUDA == Triple::CUDA, "");
1285static_assert((Triple::OSType)ZigLLVM_NVCL == Triple::NVCL, "");1343static_assert((Triple::OSType)ZigLLVM_NVCL == Triple::NVCL, "");
...@@ -1304,6 +1362,7 @@ static_assert((Triple::EnvironmentType)ZigLLVM_GNUABI64 == Triple::GNUABI64, "")...@@ -1304,6 +1362,7 @@ static_assert((Triple::EnvironmentType)ZigLLVM_GNUABI64 == Triple::GNUABI64, "")
1304static_assert((Triple::EnvironmentType)ZigLLVM_GNUEABI == Triple::GNUEABI, "");1362static_assert((Triple::EnvironmentType)ZigLLVM_GNUEABI == Triple::GNUEABI, "");
1305static_assert((Triple::EnvironmentType)ZigLLVM_GNUEABIHF == Triple::GNUEABIHF, "");1363static_assert((Triple::EnvironmentType)ZigLLVM_GNUEABIHF == Triple::GNUEABIHF, "");
1306static_assert((Triple::EnvironmentType)ZigLLVM_GNUX32 == Triple::GNUX32, "");1364static_assert((Triple::EnvironmentType)ZigLLVM_GNUX32 == Triple::GNUX32, "");
1365static_assert((Triple::EnvironmentType)ZigLLVM_GNUILP32 == Triple::GNUILP32, "");
1307static_assert((Triple::EnvironmentType)ZigLLVM_CODE16 == Triple::CODE16, "");1366static_assert((Triple::EnvironmentType)ZigLLVM_CODE16 == Triple::CODE16, "");
1308static_assert((Triple::EnvironmentType)ZigLLVM_EABI == Triple::EABI, "");1367static_assert((Triple::EnvironmentType)ZigLLVM_EABI == Triple::EABI, "");
1309static_assert((Triple::EnvironmentType)ZigLLVM_EABIHF == Triple::EABIHF, "");1368static_assert((Triple::EnvironmentType)ZigLLVM_EABIHF == Triple::EABIHF, "");
...@@ -1322,6 +1381,7 @@ static_assert((Triple::EnvironmentType)ZigLLVM_LastEnvironmentType == Triple::La...@@ -1322,6 +1381,7 @@ static_assert((Triple::EnvironmentType)ZigLLVM_LastEnvironmentType == Triple::La
1322static_assert((Triple::ObjectFormatType)ZigLLVM_UnknownObjectFormat == Triple::UnknownObjectFormat, "");1381static_assert((Triple::ObjectFormatType)ZigLLVM_UnknownObjectFormat == Triple::UnknownObjectFormat, "");
1323static_assert((Triple::ObjectFormatType)ZigLLVM_COFF == Triple::COFF, "");1382static_assert((Triple::ObjectFormatType)ZigLLVM_COFF == Triple::COFF, "");
1324static_assert((Triple::ObjectFormatType)ZigLLVM_ELF == Triple::ELF, "");1383static_assert((Triple::ObjectFormatType)ZigLLVM_ELF == Triple::ELF, "");
1384static_assert((Triple::ObjectFormatType)ZigLLVM_GOFF == Triple::GOFF, "");
1325static_assert((Triple::ObjectFormatType)ZigLLVM_MachO == Triple::MachO, "");1385static_assert((Triple::ObjectFormatType)ZigLLVM_MachO == Triple::MachO, "");
1326static_assert((Triple::ObjectFormatType)ZigLLVM_Wasm == Triple::Wasm, "");1386static_assert((Triple::ObjectFormatType)ZigLLVM_Wasm == Triple::Wasm, "");
1327static_assert((Triple::ObjectFormatType)ZigLLVM_XCOFF == Triple::XCOFF, "");1387static_assert((Triple::ObjectFormatType)ZigLLVM_XCOFF == Triple::XCOFF, "");
src/zig_llvm.h+7-3
...@@ -264,11 +264,13 @@ ZIG_EXTERN_C struct ZigLLVMDILocation *ZigLLVMGetDebugLoc(unsigned line, unsigne...@@ -264,11 +264,13 @@ ZIG_EXTERN_C struct ZigLLVMDILocation *ZigLLVMGetDebugLoc(unsigned line, unsigne
264264
265ZIG_EXTERN_C void ZigLLVMSetFastMath(LLVMBuilderRef builder_wrapped, bool on_state);265ZIG_EXTERN_C void ZigLLVMSetFastMath(LLVMBuilderRef builder_wrapped, bool on_state);
266ZIG_EXTERN_C void ZigLLVMSetTailCall(LLVMValueRef Call);266ZIG_EXTERN_C void ZigLLVMSetTailCall(LLVMValueRef Call);
267ZIG_EXTERN_C void ZigLLVMSetCallSret(LLVMValueRef Call, LLVMTypeRef return_type);
267ZIG_EXTERN_C void ZigLLVMFunctionSetPrefixData(LLVMValueRef fn, LLVMValueRef data);268ZIG_EXTERN_C void ZigLLVMFunctionSetPrefixData(LLVMValueRef fn, LLVMValueRef data);
268ZIG_EXTERN_C void ZigLLVMFunctionSetCallingConv(LLVMValueRef function, enum ZigLLVM_CallingConv cc);269ZIG_EXTERN_C void ZigLLVMFunctionSetCallingConv(LLVMValueRef function, enum ZigLLVM_CallingConv cc);
269270
270ZIG_EXTERN_C void ZigLLVMAddFunctionAttr(LLVMValueRef fn, const char *attr_name, const char *attr_value);271ZIG_EXTERN_C void ZigLLVMAddFunctionAttr(LLVMValueRef fn, const char *attr_name, const char *attr_value);
271ZIG_EXTERN_C void ZigLLVMAddByValAttr(LLVMValueRef fn_ref, unsigned ArgNo, LLVMTypeRef type_val);272ZIG_EXTERN_C void ZigLLVMAddByValAttr(LLVMValueRef fn_ref, unsigned ArgNo, LLVMTypeRef type_val);
273ZIG_EXTERN_C void ZigLLVMAddSretAttr(LLVMValueRef fn_ref, unsigned ArgNo, LLVMTypeRef type_val);
272ZIG_EXTERN_C void ZigLLVMAddFunctionAttrCold(LLVMValueRef fn);274ZIG_EXTERN_C void ZigLLVMAddFunctionAttrCold(LLVMValueRef fn);
273275
274ZIG_EXTERN_C void ZigLLVMParseCommandLineOptions(size_t argc, const char *const *argv);276ZIG_EXTERN_C void ZigLLVMParseCommandLineOptions(size_t argc, const char *const *argv);
...@@ -288,6 +290,7 @@ enum ZigLLVM_ArchType {...@@ -288,6 +290,7 @@ enum ZigLLVM_ArchType {
288 ZigLLVM_avr, // AVR: Atmel AVR microcontroller290 ZigLLVM_avr, // AVR: Atmel AVR microcontroller
289 ZigLLVM_bpfel, // eBPF or extended BPF or 64-bit BPF (little endian)291 ZigLLVM_bpfel, // eBPF or extended BPF or 64-bit BPF (little endian)
290 ZigLLVM_bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian)292 ZigLLVM_bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian)
293 ZigLLVM_csky, // CSKY: csky
291 ZigLLVM_hexagon, // Hexagon: hexagon294 ZigLLVM_hexagon, // Hexagon: hexagon
292 ZigLLVM_mips, // MIPS: mips, mipsallegrex, mipsr6295 ZigLLVM_mips, // MIPS: mips, mipsallegrex, mipsr6
293 ZigLLVM_mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el296 ZigLLVM_mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el
...@@ -295,6 +298,7 @@ enum ZigLLVM_ArchType {...@@ -295,6 +298,7 @@ enum ZigLLVM_ArchType {
295 ZigLLVM_mips64el, // MIPS64EL: mips64el, mips64r6el, mipsn32el, mipsn32r6el298 ZigLLVM_mips64el, // MIPS64EL: mips64el, mips64r6el, mipsn32el, mipsn32r6el
296 ZigLLVM_msp430, // MSP430: msp430299 ZigLLVM_msp430, // MSP430: msp430
297 ZigLLVM_ppc, // PPC: powerpc300 ZigLLVM_ppc, // PPC: powerpc
301 ZigLLVM_ppcle, // PPCLE: powerpc (little endian)
298 ZigLLVM_ppc64, // PPC64: powerpc64, ppu302 ZigLLVM_ppc64, // PPC64: powerpc64, ppu
299 ZigLLVM_ppc64le, // PPC64LE: powerpc64le303 ZigLLVM_ppc64le, // PPC64LE: powerpc64le
300 ZigLLVM_r600, // R600: AMD GPUs HD2XXX - HD6XXX304 ZigLLVM_r600, // R600: AMD GPUs HD2XXX - HD6XXX
...@@ -340,8 +344,6 @@ enum ZigLLVM_VendorType {...@@ -340,8 +344,6 @@ enum ZigLLVM_VendorType {
340 ZigLLVM_Apple,344 ZigLLVM_Apple,
341 ZigLLVM_PC,345 ZigLLVM_PC,
342 ZigLLVM_SCEI,346 ZigLLVM_SCEI,
343 ZigLLVM_BGP,
344 ZigLLVM_BGQ,
345 ZigLLVM_Freescale,347 ZigLLVM_Freescale,
346 ZigLLVM_IBM,348 ZigLLVM_IBM,
347 ZigLLVM_ImaginationTechnologies,349 ZigLLVM_ImaginationTechnologies,
...@@ -375,11 +377,11 @@ enum ZigLLVM_OSType {...@@ -375,11 +377,11 @@ enum ZigLLVM_OSType {
375 ZigLLVM_OpenBSD,377 ZigLLVM_OpenBSD,
376 ZigLLVM_Solaris,378 ZigLLVM_Solaris,
377 ZigLLVM_Win32,379 ZigLLVM_Win32,
380 ZigLLVM_ZOS,
378 ZigLLVM_Haiku,381 ZigLLVM_Haiku,
379 ZigLLVM_Minix,382 ZigLLVM_Minix,
380 ZigLLVM_RTEMS,383 ZigLLVM_RTEMS,
381 ZigLLVM_NaCl, // Native Client384 ZigLLVM_NaCl, // Native Client
382 ZigLLVM_CNK, // BG/P Compute-Node Kernel
383 ZigLLVM_AIX,385 ZigLLVM_AIX,
384 ZigLLVM_CUDA, // NVIDIA CUDA386 ZigLLVM_CUDA, // NVIDIA CUDA
385 ZigLLVM_NVCL, // NVIDIA OpenCL387 ZigLLVM_NVCL, // NVIDIA OpenCL
...@@ -409,6 +411,7 @@ enum ZigLLVM_EnvironmentType {...@@ -409,6 +411,7 @@ enum ZigLLVM_EnvironmentType {
409 ZigLLVM_GNUEABI,411 ZigLLVM_GNUEABI,
410 ZigLLVM_GNUEABIHF,412 ZigLLVM_GNUEABIHF,
411 ZigLLVM_GNUX32,413 ZigLLVM_GNUX32,
414 ZigLLVM_GNUILP32,
412 ZigLLVM_CODE16,415 ZigLLVM_CODE16,
413 ZigLLVM_EABI,416 ZigLLVM_EABI,
414 ZigLLVM_EABIHF,417 ZigLLVM_EABIHF,
...@@ -432,6 +435,7 @@ enum ZigLLVM_ObjectFormatType {...@@ -432,6 +435,7 @@ enum ZigLLVM_ObjectFormatType {
432435
433 ZigLLVM_COFF,436 ZigLLVM_COFF,
434 ZigLLVM_ELF,437 ZigLLVM_ELF,
438 ZigLLVM_GOFF,
435 ZigLLVM_MachO,439 ZigLLVM_MachO,
436 ZigLLVM_Wasm,440 ZigLLVM_Wasm,
437 ZigLLVM_XCOFF,441 ZigLLVM_XCOFF,
test/stage1/behavior/vector.zig+13
...@@ -510,6 +510,19 @@ test "vector reduce operation" {...@@ -510,6 +510,19 @@ test "vector reduce operation" {
510 const N = @typeInfo(@TypeOf(x)).Array.len;510 const N = @typeInfo(@TypeOf(x)).Array.len;
511 const TX = @typeInfo(@TypeOf(x)).Array.child;511 const TX = @typeInfo(@TypeOf(x)).Array.child;
512512
513 // wasmtime: unknown import: `env::fminf` has not been defined
514 // https://github.com/ziglang/zig/issues/8131
515 switch (std.builtin.arch) {
516 .wasm32 => switch (@typeInfo(TX)) {
517 .Float => switch (op) {
518 .Min, .Max, => return,
519 else => {},
520 },
521 else => {},
522 },
523 else => {},
524 }
525
513 var r = @reduce(op, @as(Vector(N, TX), x));526 var r = @reduce(op, @as(Vector(N, TX), x));
514 switch (@typeInfo(TX)) {527 switch (@typeInfo(TX)) {
515 .Int, .Bool => expectEqual(expected, r),528 .Int, .Bool => expectEqual(expected, r),
test/tests.zig+38-30
...@@ -154,21 +154,25 @@ const test_targets = blk: {...@@ -154,21 +154,25 @@ const test_targets = blk: {
154 // .link_libc = true,154 // .link_libc = true,
155 //},155 //},
156156
157 TestTarget{157 // https://github.com/ziglang/zig/issues/8155
158 .target = .{158 //TestTarget{
159 .cpu_arch = .mips,159 // .target = .{
160 .os_tag = .linux,160 // .cpu_arch = .mips,
161 .abi = .none,161 // .os_tag = .linux,
162 },162 // .abi = .none,
163 },163 // },
164 TestTarget{164 //},
165 .target = .{165
166 .cpu_arch = .mips,166 // https://github.com/ziglang/zig/issues/8155
167 .os_tag = .linux,167 //TestTarget{
168 .abi = .musl,168 // .target = .{
169 },169 // .cpu_arch = .mips,
170 .link_libc = true,170 // .os_tag = .linux,
171 },171 // .abi = .musl,
172 // },
173 // .link_libc = true,
174 //},
175
172 // https://github.com/ziglang/zig/issues/4927176 // https://github.com/ziglang/zig/issues/4927
173 //TestTarget{177 //TestTarget{
174 // .target = .{178 // .target = .{
...@@ -179,21 +183,25 @@ const test_targets = blk: {...@@ -179,21 +183,25 @@ const test_targets = blk: {
179 // .link_libc = true,183 // .link_libc = true,
180 //},184 //},
181185
182 TestTarget{186 // https://github.com/ziglang/zig/issues/8155
183 .target = .{187 //TestTarget{
184 .cpu_arch = .mipsel,188 // .target = .{
185 .os_tag = .linux,189 // .cpu_arch = .mipsel,
186 .abi = .none,190 // .os_tag = .linux,
187 },191 // .abi = .none,
188 },192 // },
189 TestTarget{193 //},
190 .target = .{194
191 .cpu_arch = .mipsel,195 // https://github.com/ziglang/zig/issues/8155
192 .os_tag = .linux,196 //TestTarget{
193 .abi = .musl,197 // .target = .{
194 },198 // .cpu_arch = .mipsel,
195 .link_libc = true,199 // .os_tag = .linux,
196 },200 // .abi = .musl,
201 // },
202 // .link_libc = true,
203 //},
204
197 // https://github.com/ziglang/zig/issues/4927205 // https://github.com/ziglang/zig/issues/4927
198 //TestTarget{206 //TestTarget{
199 // .target = .{207 // .target = .{
tools/process_headers.zig+10
...@@ -84,6 +84,16 @@ const glibc_targets = [_]LibCTarget{...@@ -84,6 +84,16 @@ const glibc_targets = [_]LibCTarget{
84 .arch = MultiArch{ .specific = Arch.arm },84 .arch = MultiArch{ .specific = Arch.arm },
85 .abi = MultiAbi{ .specific = Abi.gnueabihf },85 .abi = MultiAbi{ .specific = Abi.gnueabihf },
86 },86 },
87 LibCTarget{
88 .name = "csky-linux-gnuabiv2",
89 .arch = MultiArch{ .specific = Arch.csky },
90 .abi = MultiAbi{ .specific = Abi.gnueabihf },
91 },
92 LibCTarget{
93 .name = "csky-linux-gnuabiv2-soft",
94 .arch = MultiArch{ .specific = Arch.csky },
95 .abi = MultiAbi{ .specific = Abi.gnueabi },
96 },
87 LibCTarget{97 LibCTarget{
88 .name = "i686-linux-gnu",98 .name = "i686-linux-gnu",
89 .arch = MultiArch{ .specific = Arch.i386 },99 .arch = MultiArch{ .specific = Arch.i386 },
tools/update_cpu_features.zig created+1292
...@@ -0,0 +1,1292 @@
1const std = @import("std");
2const fs = std.fs;
3const mem = std.mem;
4const json = std.json;
5const assert = std.debug.assert;
6
7// All references to other features are based on "zig name" as the key.
8
9const FeatureOverride = struct {
10 llvm_name: []const u8,
11 /// If true, completely omit the feature; as if it does not exist.
12 omit: bool = false,
13 /// If true, omit the feature, but all the dependencies of the feature
14 /// are added in its place.
15 flatten: bool = false,
16 zig_name: ?[]const u8 = null,
17 desc: ?[]const u8 = null,
18 extra_deps: []const []const u8 = &.{},
19};
20
21const Cpu = struct {
22 llvm_name: ?[]const u8,
23 zig_name: []const u8,
24 features: []const []const u8,
25};
26
27const Feature = struct {
28 llvm_name: ?[]const u8 = null,
29 zig_name: []const u8,
30 desc: []const u8,
31 deps: []const []const u8,
32 flatten: bool = false,
33};
34
35const LlvmTarget = struct {
36 zig_name: []const u8,
37 llvm_name: []const u8,
38 td_name: []const u8,
39 feature_overrides: []const FeatureOverride = &.{},
40 extra_cpus: []const Cpu = &.{},
41 extra_features: []const Feature = &.{},
42 branch_quota: ?usize = null,
43};
44
45const llvm_targets = [_]LlvmTarget{
46 .{
47 .zig_name = "aarch64",
48 .llvm_name = "AArch64",
49 .td_name = "AArch64.td",
50 .branch_quota = 2000,
51 .feature_overrides = &.{
52 .{
53 .llvm_name = "CONTEXTIDREL2",
54 .zig_name = "contextidr_el2",
55 .desc = "Enable RW operand Context ID Register (EL2)",
56 },
57 .{
58 .llvm_name = "neoversee1",
59 .zig_name = "neoverse_e1",
60 },
61 .{
62 .llvm_name = "neoversen1",
63 .zig_name = "neoverse_n1",
64 },
65 .{
66 .llvm_name = "neoversen2",
67 .zig_name = "neoverse_n2",
68 },
69 .{
70 .llvm_name = "neoversev1",
71 .zig_name = "neoverse_v1",
72 },
73 .{
74 .llvm_name = "exynosm3",
75 .zig_name = "exynos_m3",
76 .flatten = true,
77 .extra_deps = &.{"v8a"},
78 },
79 .{
80 .llvm_name = "exynosm4",
81 .zig_name = "exynos_m4",
82 },
83 .{
84 .llvm_name = "v8.1a",
85 .extra_deps = &.{"v8a"},
86 },
87 .{
88 .llvm_name = "a35",
89 .flatten = true,
90 .extra_deps = &.{"v8a"},
91 },
92 .{
93 .llvm_name = "a53",
94 .flatten = true,
95 .extra_deps = &.{"v8a"},
96 },
97 .{
98 .llvm_name = "a55",
99 .flatten = true,
100 },
101 .{
102 .llvm_name = "a57",
103 .flatten = true,
104 .extra_deps = &.{"v8a"},
105 },
106 .{
107 .llvm_name = "a64fx",
108 .flatten = true,
109 },
110 .{
111 .llvm_name = "a72",
112 .flatten = true,
113 .extra_deps = &.{"v8a"},
114 },
115 .{
116 .llvm_name = "a73",
117 .flatten = true,
118 .extra_deps = &.{"v8a"},
119 },
120 .{
121 .llvm_name = "a75",
122 .flatten = true,
123 },
124 .{
125 .llvm_name = "a77",
126 .flatten = true,
127 },
128 .{
129 .llvm_name = "apple-a10",
130 .flatten = true,
131 },
132 .{
133 .llvm_name = "apple-a11",
134 .flatten = true,
135 },
136 .{
137 .llvm_name = "apple-a14",
138 .flatten = true,
139 },
140 .{
141 .llvm_name = "carmel",
142 .flatten = true,
143 },
144 .{
145 .llvm_name = "cortex-a78",
146 .flatten = true,
147 },
148 .{
149 .llvm_name = "cortex-x1",
150 .flatten = true,
151 },
152 .{
153 .llvm_name = "falkor",
154 .flatten = true,
155 .extra_deps = &.{"v8a"},
156 },
157 .{
158 .llvm_name = "kryo",
159 .flatten = true,
160 .extra_deps = &.{"v8a"},
161 },
162 .{
163 .llvm_name = "saphira",
164 .flatten = true,
165 },
166 .{
167 .llvm_name = "thunderx",
168 .flatten = true,
169 .extra_deps = &.{"v8a"},
170 },
171 .{
172 .llvm_name = "thunderx2t99",
173 .flatten = true,
174 },
175 .{
176 .llvm_name = "thunderx3t110",
177 .flatten = true,
178 },
179 .{
180 .llvm_name = "thunderxt81",
181 .flatten = true,
182 .extra_deps = &.{"v8a"},
183 },
184 .{
185 .llvm_name = "thunderxt83",
186 .flatten = true,
187 .extra_deps = &.{"v8a"},
188 },
189 .{
190 .llvm_name = "thunderxt88",
191 .flatten = true,
192 .extra_deps = &.{"v8a"},
193 },
194 .{
195 .llvm_name = "tsv110",
196 .flatten = true,
197 },
198 },
199 .extra_features = &.{
200 .{
201 .zig_name = "v8a",
202 .desc = "Support ARM v8a instructions",
203 .deps = &.{ "fp_armv8", "neon" },
204 },
205 },
206 .extra_cpus = &.{
207 .{
208 .llvm_name = null,
209 .zig_name = "exynos_m1",
210 .features = &.{
211 "crc",
212 "crypto",
213 "exynos_cheap_as_move",
214 "force_32bit_jump_tables",
215 "fuse_aes",
216 "perfmon",
217 "slow_misaligned_128store",
218 "slow_paired_128",
219 "use_postra_scheduler",
220 "use_reciprocal_square_root",
221 "v8a",
222 "zcz_fp",
223 },
224 },
225 .{
226 .llvm_name = null,
227 .zig_name = "exynos_m2",
228 .features = &.{
229 "crc",
230 "crypto",
231 "exynos_cheap_as_move",
232 "force_32bit_jump_tables",
233 "fuse_aes",
234 "perfmon",
235 "slow_misaligned_128store",
236 "slow_paired_128",
237 "use_postra_scheduler",
238 "v8a",
239 "zcz_fp",
240 },
241 },
242 },
243 },
244 .{
245 .zig_name = "amdgpu",
246 .llvm_name = "AMDGPU",
247 .td_name = "AMDGPU.td",
248 .feature_overrides = &.{
249 .{
250 .llvm_name = "DumpCode",
251 .omit = true,
252 },
253 .{
254 .llvm_name = "dumpcode",
255 .omit = true,
256 },
257 },
258 },
259 .{
260 .zig_name = "arc",
261 .llvm_name = "ARC",
262 .td_name = "ARC.td",
263 },
264 .{
265 .zig_name = "arm",
266 .llvm_name = "ARM",
267 .td_name = "ARM.td",
268 .branch_quota = 10000,
269 .extra_cpus = &.{
270 .{
271 .llvm_name = "generic",
272 .zig_name = "baseline",
273 .features = &.{"v7a"},
274 },
275 .{
276 .llvm_name = null,
277 .zig_name = "exynos_m1",
278 .features = &.{ "v8a", "exynos" },
279 },
280 .{
281 .llvm_name = null,
282 .zig_name = "exynos_m2",
283 .features = &.{ "v8a", "exynos" },
284 },
285 },
286 .feature_overrides = &.{
287 .{
288 .llvm_name = "cortex-a78",
289 .flatten = true,
290 },
291 .{
292 .llvm_name = "r5",
293 .flatten = true,
294 },
295 .{
296 .llvm_name = "r52",
297 .flatten = true,
298 },
299 .{
300 .llvm_name = "r7",
301 .flatten = true,
302 },
303 .{
304 .llvm_name = "m7",
305 .flatten = true,
306 },
307 .{
308 .llvm_name = "krait",
309 .flatten = true,
310 },
311 .{
312 .llvm_name = "kryo",
313 .flatten = true,
314 },
315 .{
316 .llvm_name = "cortex-x1",
317 .flatten = true,
318 },
319 .{
320 .llvm_name = "neoverse-v1",
321 .flatten = true,
322 },
323 .{
324 .llvm_name = "a5",
325 .flatten = true,
326 },
327 .{
328 .llvm_name = "a7",
329 .flatten = true,
330 },
331 .{
332 .llvm_name = "a8",
333 .flatten = true,
334 },
335 .{
336 .llvm_name = "a9",
337 .flatten = true,
338 },
339 .{
340 .llvm_name = "a12",
341 .flatten = true,
342 },
343 .{
344 .llvm_name = "a15",
345 .flatten = true,
346 },
347 .{
348 .llvm_name = "a17",
349 .flatten = true,
350 },
351 .{
352 .llvm_name = "a32",
353 .flatten = true,
354 },
355 .{
356 .llvm_name = "a35",
357 .flatten = true,
358 },
359 .{
360 .llvm_name = "a53",
361 .flatten = true,
362 },
363 .{
364 .llvm_name = "a55",
365 .flatten = true,
366 },
367 .{
368 .llvm_name = "a57",
369 .flatten = true,
370 },
371 .{
372 .llvm_name = "a72",
373 .flatten = true,
374 },
375 .{
376 .llvm_name = "a73",
377 .flatten = true,
378 },
379 .{
380 .llvm_name = "a75",
381 .flatten = true,
382 },
383 .{
384 .llvm_name = "a77",
385 .flatten = true,
386 },
387 .{
388 .llvm_name = "a78c",
389 .flatten = true,
390 },
391 .{
392 .llvm_name = "armv2",
393 .zig_name = "v2",
394 .extra_deps = &.{"strict_align"},
395 },
396 .{
397 .llvm_name = "armv2a",
398 .zig_name = "v2a",
399 .extra_deps = &.{"strict_align"},
400 },
401 .{
402 .llvm_name = "armv3",
403 .zig_name = "v3",
404 .extra_deps = &.{"strict_align"},
405 },
406 .{
407 .llvm_name = "armv3m",
408 .zig_name = "v3m",
409 .extra_deps = &.{"strict_align"},
410 },
411 .{
412 .llvm_name = "armv4",
413 .zig_name = "v4",
414 .extra_deps = &.{"strict_align"},
415 },
416 .{
417 .llvm_name = "armv4t",
418 .zig_name = "v4t",
419 .extra_deps = &.{"strict_align"},
420 },
421 .{
422 .llvm_name = "armv5t",
423 .zig_name = "v5t",
424 .extra_deps = &.{"strict_align"},
425 },
426 .{
427 .llvm_name = "armv5te",
428 .zig_name = "v5te",
429 .extra_deps = &.{"strict_align"},
430 },
431 .{
432 .llvm_name = "armv5tej",
433 .zig_name = "v5tej",
434 .extra_deps = &.{"strict_align"},
435 },
436 .{
437 .llvm_name = "armv6",
438 .zig_name = "v6",
439 },
440 .{
441 .llvm_name = "armv6-m",
442 .zig_name = "v6m",
443 },
444 .{
445 .llvm_name = "armv6j",
446 .zig_name = "v6j",
447 },
448 .{
449 .llvm_name = "armv6k",
450 .zig_name = "v6k",
451 },
452 .{
453 .llvm_name = "armv6kz",
454 .zig_name = "v6kz",
455 },
456 .{
457 .llvm_name = "armv6s-m",
458 .zig_name = "v6sm",
459 },
460 .{
461 .llvm_name = "armv6t2",
462 .zig_name = "v6t2",
463 },
464 .{
465 .llvm_name = "armv7-a",
466 .zig_name = "v7a",
467 },
468 .{
469 .llvm_name = "armv7-m",
470 .zig_name = "v7m",
471 },
472 .{
473 .llvm_name = "armv7-r",
474 .zig_name = "v7r",
475 },
476 .{
477 .llvm_name = "armv7e-m",
478 .zig_name = "v7em",
479 },
480 .{
481 .llvm_name = "armv7k",
482 .zig_name = "v7k",
483 },
484 .{
485 .llvm_name = "armv7s",
486 .zig_name = "v7s",
487 },
488 .{
489 .llvm_name = "armv7ve",
490 .zig_name = "v7ve",
491 },
492 .{
493 .llvm_name = "armv8.1-a",
494 .zig_name = "v8_1a",
495 },
496 .{
497 .llvm_name = "armv8.1-m.main",
498 .zig_name = "v8_1m_main",
499 },
500 .{
501 .llvm_name = "armv8.2-a",
502 .zig_name = "v8_2a",
503 },
504 .{
505 .llvm_name = "armv8.3-a",
506 .zig_name = "v8_3a",
507 },
508 .{
509 .llvm_name = "armv8.4-a",
510 .zig_name = "v8_4a",
511 },
512 .{
513 .llvm_name = "armv8.5-a",
514 .zig_name = "v8_5a",
515 },
516 .{
517 .llvm_name = "armv8.6-a",
518 .zig_name = "v8_6a",
519 },
520 .{
521 .llvm_name = "armv8.7-a",
522 .zig_name = "v8_7a",
523 },
524 .{
525 .llvm_name = "armv8-a",
526 .zig_name = "v8a",
527 },
528 .{
529 .llvm_name = "armv8-m.base",
530 .zig_name = "v8m",
531 },
532 .{
533 .llvm_name = "armv8-m.main",
534 .zig_name = "v8m_main",
535 },
536 .{
537 .llvm_name = "armv8-r",
538 .zig_name = "v8r",
539 },
540 .{
541 .llvm_name = "v4t",
542 .zig_name = "has_v4t",
543 },
544 .{
545 .llvm_name = "v5t",
546 .zig_name = "has_v5t",
547 },
548 .{
549 .llvm_name = "v5te",
550 .zig_name = "has_v5te",
551 },
552 .{
553 .llvm_name = "v6",
554 .zig_name = "has_v6",
555 },
556 .{
557 .llvm_name = "v6k",
558 .zig_name = "has_v6k",
559 },
560 .{
561 .llvm_name = "v6m",
562 .zig_name = "has_v6m",
563 },
564 .{
565 .llvm_name = "v6t2",
566 .zig_name = "has_v6t2",
567 },
568 .{
569 .llvm_name = "v7",
570 .zig_name = "has_v7",
571 },
572 .{
573 .llvm_name = "v7clrex",
574 .zig_name = "has_v7clrex",
575 },
576 .{
577 .llvm_name = "v8",
578 .zig_name = "has_v8",
579 },
580 .{
581 .llvm_name = "v8m",
582 .zig_name = "has_v8m",
583 },
584 .{
585 .llvm_name = "v8m.main",
586 .zig_name = "has_v8m_main",
587 },
588 .{
589 .llvm_name = "v8.1a",
590 .zig_name = "has_v8_1a",
591 },
592 .{
593 .llvm_name = "v8.1m.main",
594 .zig_name = "has_v8_1m_main",
595 },
596 .{
597 .llvm_name = "v8.2a",
598 .zig_name = "has_v8_2a",
599 },
600 .{
601 .llvm_name = "v8.3a",
602 .zig_name = "has_v8_3a",
603 },
604 .{
605 .llvm_name = "v8.4a",
606 .zig_name = "has_v8_4a",
607 },
608 .{
609 .llvm_name = "v8.5a",
610 .zig_name = "has_v8_5a",
611 },
612 .{
613 .llvm_name = "v8.6a",
614 .zig_name = "has_v8_6a",
615 },
616 .{
617 .llvm_name = "v8.7a",
618 .zig_name = "has_v8_7a",
619 },
620 },
621 },
622 .{
623 .zig_name = "avr",
624 .llvm_name = "AVR",
625 .td_name = "AVR.td",
626 },
627 .{
628 .zig_name = "bpf",
629 .llvm_name = "BPF",
630 .td_name = "BPF.td",
631 },
632 .{
633 .zig_name = "csky",
634 .llvm_name = "CSKY",
635 .td_name = "CSKY.td",
636 },
637 .{
638 .zig_name = "hexagon",
639 .llvm_name = "Hexagon",
640 .td_name = "Hexagon.td",
641 },
642 .{
643 .zig_name = "lanai",
644 .llvm_name = "Lanai",
645 .td_name = "Lanai.td",
646 },
647 .{
648 .zig_name = "msp430",
649 .llvm_name = "MSP430",
650 .td_name = "MSP430.td",
651 },
652 .{
653 .zig_name = "mips",
654 .llvm_name = "Mips",
655 .td_name = "Mips.td",
656 },
657 .{
658 .zig_name = "nvptx",
659 .llvm_name = "NVPTX",
660 .td_name = "NVPTX.td",
661 },
662 .{
663 .zig_name = "powerpc",
664 .llvm_name = "PowerPC",
665 .td_name = "PPC.td",
666 },
667 .{
668 .zig_name = "riscv",
669 .llvm_name = "RISCV",
670 .td_name = "RISCV.td",
671 .extra_cpus = &.{
672 .{
673 .llvm_name = null,
674 .zig_name = "baseline_rv32",
675 .features = &.{ "a", "c", "d", "f", "m" },
676 },
677 .{
678 .llvm_name = null,
679 .zig_name = "baseline_rv64",
680 .features = &.{ "64bit", "a", "c", "d", "f", "m" },
681 },
682 },
683 },
684 .{
685 .zig_name = "sparc",
686 .llvm_name = "Sparc",
687 .td_name = "Sparc.td",
688 },
689 .{
690 .zig_name = "systemz",
691 .llvm_name = "SystemZ",
692 .td_name = "SystemZ.td",
693 },
694 .{
695 .zig_name = "ve",
696 .llvm_name = "VE",
697 .td_name = "VE.td",
698 },
699 .{
700 .zig_name = "wasm",
701 .llvm_name = "WebAssembly",
702 .td_name = "WebAssembly.td",
703 },
704 .{
705 .zig_name = "x86",
706 .llvm_name = "X86",
707 .td_name = "X86.td",
708 .feature_overrides = &.{
709 .{
710 .llvm_name = "64bit-mode",
711 .omit = true,
712 },
713 .{
714 .llvm_name = "i386",
715 .zig_name = "_i386",
716 },
717 .{
718 .llvm_name = "i486",
719 .zig_name = "_i486",
720 },
721 .{
722 .llvm_name = "i586",
723 .zig_name = "_i586",
724 },
725 .{
726 .llvm_name = "i686",
727 .zig_name = "_i686",
728 },
729 },
730 },
731 .{
732 .zig_name = "xcore",
733 .llvm_name = "XCore",
734 .td_name = "XCore.td",
735 },
736};
737
738pub fn main() anyerror!void {
739 var arena_state = std.heap.ArenaAllocator.init(std.heap.page_allocator);
740 defer arena_state.deinit();
741 const arena = &arena_state.allocator;
742
743 const args = try std.process.argsAlloc(arena);
744 if (args.len <= 1) {
745 usageAndExit(std.io.getStdErr(), args[0], 1);
746 }
747 if (std.mem.eql(u8, args[1], "--help")) {
748 usageAndExit(std.io.getStdOut(), args[0], 0);
749 }
750 if (args.len < 4) {
751 usageAndExit(std.io.getStdErr(), args[0], 1);
752 }
753
754 const llvm_tblgen_exe = args[1];
755 if (std.mem.startsWith(u8, llvm_tblgen_exe, "-")) {
756 usageAndExit(std.io.getStdErr(), args[0], 1);
757 }
758
759 const llvm_src_root = args[2];
760 if (std.mem.startsWith(u8, llvm_src_root, "-")) {
761 usageAndExit(std.io.getStdErr(), args[0], 1);
762 }
763
764 const zig_src_root = args[3];
765 if (std.mem.startsWith(u8, zig_src_root, "-")) {
766 usageAndExit(std.io.getStdErr(), args[0], 1);
767 }
768
769 var zig_src_dir = try fs.cwd().openDir(zig_src_root, .{});
770 defer zig_src_dir.close();
771
772 var progress = std.Progress{};
773 const root_progress = try progress.start("", llvm_targets.len);
774 defer root_progress.end();
775
776 if (std.builtin.single_threaded) {
777 for (llvm_targets) |llvm_target| {
778 try processOneTarget(Job{
779 .llvm_tblgen_exe = llvm_tblgen_exe,
780 .llvm_src_root = llvm_src_root,
781 .zig_src_dir = zig_src_dir,
782 .root_progress = root_progress,
783 .llvm_target = llvm_target,
784 });
785 }
786 } else {
787 var threads = try arena.alloc(*std.Thread, llvm_targets.len);
788 for (llvm_targets) |llvm_target, i| {
789 threads[i] = try std.Thread.spawn(processOneTarget, .{
790 .llvm_tblgen_exe = llvm_tblgen_exe,
791 .llvm_src_root = llvm_src_root,
792 .zig_src_dir = zig_src_dir,
793 .root_progress = root_progress,
794 .llvm_target = llvm_target,
795 });
796 }
797 for (threads) |thread| {
798 thread.wait();
799 }
800 }
801}
802
803const Job = struct {
804 llvm_tblgen_exe: []const u8,
805 llvm_src_root: []const u8,
806 zig_src_dir: std.fs.Dir,
807 root_progress: *std.Progress.Node,
808 llvm_target: LlvmTarget,
809};
810
811fn processOneTarget(job: Job) anyerror!void {
812 const llvm_target = job.llvm_target;
813
814 var arena_state = std.heap.ArenaAllocator.init(std.heap.page_allocator);
815 defer arena_state.deinit();
816 const arena = &arena_state.allocator;
817
818 var progress_node = job.root_progress.start(llvm_target.zig_name, 3);
819 progress_node.activate();
820 defer progress_node.end();
821
822 var tblgen_progress = progress_node.start("invoke llvm-tblgen", 0);
823 tblgen_progress.activate();
824
825 const child_args = [_][]const u8{
826 job.llvm_tblgen_exe,
827 "--dump-json",
828 try std.fmt.allocPrint(arena, "{s}/llvm/lib/Target/{s}/{s}", .{
829 job.llvm_src_root,
830 llvm_target.llvm_name,
831 llvm_target.td_name,
832 }),
833 try std.fmt.allocPrint(arena, "-I={s}/llvm/include", .{job.llvm_src_root}),
834 try std.fmt.allocPrint(arena, "-I={s}/llvm/lib/Target/{s}", .{
835 job.llvm_src_root, llvm_target.llvm_name,
836 }),
837 };
838
839 const child_result = try std.ChildProcess.exec(.{
840 .allocator = arena,
841 .argv = &child_args,
842 .max_output_bytes = 200 * 1024 * 1024,
843 });
844 tblgen_progress.end();
845 if (child_result.stderr.len != 0) {
846 std.debug.warn("{s}\n", .{child_result.stderr});
847 }
848
849 const json_text = switch (child_result.term) {
850 .Exited => |code| if (code == 0) child_result.stdout else {
851 std.debug.warn("llvm-tblgen exited with code {d}\n", .{code});
852 std.process.exit(1);
853 },
854 else => {
855 std.debug.warn("llvm-tblgen crashed\n", .{});
856 std.process.exit(1);
857 },
858 };
859
860 var json_parse_progress = progress_node.start("parse JSON", 0);
861 json_parse_progress.activate();
862
863 var parser = json.Parser.init(arena, false);
864 const tree = try parser.parse(json_text);
865 json_parse_progress.end();
866
867 var render_progress = progress_node.start("render zig code", 0);
868 render_progress.activate();
869
870 const root_map = &tree.root.Object;
871 var features_table = std.StringHashMap(Feature).init(arena);
872 var all_features = std.ArrayList(Feature).init(arena);
873 var all_cpus = std.ArrayList(Cpu).init(arena);
874 {
875 var it = root_map.iterator();
876 root_it: while (it.next()) |kv| {
877 if (kv.key.len == 0) continue;
878 if (kv.key[0] == '!') continue;
879 if (kv.value != .Object) continue;
880 if (hasSuperclass(&kv.value.Object, "SubtargetFeature")) {
881 const llvm_name = kv.value.Object.get("Name").?.String;
882 if (llvm_name.len == 0) continue;
883
884 var zig_name = try llvmNameToZigName(arena, llvm_name);
885 var desc = kv.value.Object.get("Desc").?.String;
886 var deps = std.ArrayList([]const u8).init(arena);
887 var omit = false;
888 var flatten = false;
889 const implies = kv.value.Object.get("Implies").?.Array;
890 for (implies.items) |imply| {
891 const other_key = imply.Object.get("def").?.String;
892 const other_obj = &root_map.getEntry(other_key).?.value.Object;
893 const other_llvm_name = other_obj.get("Name").?.String;
894 const other_zig_name = (try llvmNameToZigNameOmit(
895 arena,
896 llvm_target,
897 other_llvm_name,
898 )) orelse continue;
899 try deps.append(other_zig_name);
900 }
901 for (llvm_target.feature_overrides) |feature_override| {
902 if (mem.eql(u8, llvm_name, feature_override.llvm_name)) {
903 if (feature_override.omit) {
904 // Still put the feature into the table so that we can
905 // expand dependencies for the feature overrides marked `flatten`.
906 omit = true;
907 }
908 if (feature_override.flatten) {
909 flatten = true;
910 }
911 if (feature_override.zig_name) |override_name| {
912 zig_name = override_name;
913 }
914 if (feature_override.desc) |override_desc| {
915 desc = override_desc;
916 }
917 for (feature_override.extra_deps) |extra_dep| {
918 try deps.append(extra_dep);
919 }
920 break;
921 }
922 }
923 const feature: Feature = .{
924 .llvm_name = llvm_name,
925 .zig_name = zig_name,
926 .desc = desc,
927 .deps = deps.items,
928 .flatten = flatten,
929 };
930 try features_table.put(zig_name, feature);
931 if (!omit and !flatten) {
932 try all_features.append(feature);
933 }
934 }
935 if (hasSuperclass(&kv.value.Object, "Processor")) {
936 const llvm_name = kv.value.Object.get("Name").?.String;
937 if (llvm_name.len == 0) continue;
938
939 var zig_name = try llvmNameToZigName(arena, llvm_name);
940 var deps = std.ArrayList([]const u8).init(arena);
941 const features = kv.value.Object.get("Features").?.Array;
942 for (features.items) |feature| {
943 const feature_key = feature.Object.get("def").?.String;
944 const feature_obj = &root_map.getEntry(feature_key).?.value.Object;
945 const feature_llvm_name = feature_obj.get("Name").?.String;
946 if (feature_llvm_name.len == 0) continue;
947 const feature_zig_name = (try llvmNameToZigNameOmit(
948 arena,
949 llvm_target,
950 feature_llvm_name,
951 )) orelse continue;
952 try deps.append(feature_zig_name);
953 }
954 const tune_features = kv.value.Object.get("TuneFeatures").?.Array;
955 for (tune_features.items) |feature| {
956 const feature_key = feature.Object.get("def").?.String;
957 const feature_obj = &root_map.getEntry(feature_key).?.value.Object;
958 const feature_llvm_name = feature_obj.get("Name").?.String;
959 if (feature_llvm_name.len == 0) continue;
960 const feature_zig_name = (try llvmNameToZigNameOmit(
961 arena,
962 llvm_target,
963 feature_llvm_name,
964 )) orelse continue;
965 try deps.append(feature_zig_name);
966 }
967 for (llvm_target.feature_overrides) |feature_override| {
968 if (mem.eql(u8, llvm_name, feature_override.llvm_name)) {
969 if (feature_override.omit) {
970 continue :root_it;
971 }
972 if (feature_override.zig_name) |override_name| {
973 zig_name = override_name;
974 }
975 for (feature_override.extra_deps) |extra_dep| {
976 try deps.append(extra_dep);
977 }
978 break;
979 }
980 }
981 try all_cpus.append(.{
982 .llvm_name = llvm_name,
983 .zig_name = zig_name,
984 .features = deps.items,
985 });
986 }
987 }
988 }
989 for (llvm_target.extra_features) |extra_feature| {
990 try features_table.put(extra_feature.zig_name, extra_feature);
991 try all_features.append(extra_feature);
992 }
993 for (llvm_target.extra_cpus) |extra_cpu| {
994 try all_cpus.append(extra_cpu);
995 }
996 std.sort.sort(Feature, all_features.items, {}, featureLessThan);
997 std.sort.sort(Cpu, all_cpus.items, {}, cpuLessThan);
998
999 const target_sub_path = try fs.path.join(arena, &.{ "lib", "std", "target" });
1000 var target_dir = try job.zig_src_dir.makeOpenPath(target_sub_path, .{});
1001 defer target_dir.close();
1002
1003 const zig_code_basename = try std.fmt.allocPrint(arena, "{s}.zig", .{llvm_target.zig_name});
1004
1005 if (all_features.items.len == 0) {
1006 // We represent this with an empty file.
1007 try target_dir.deleteTree(zig_code_basename);
1008 return;
1009 }
1010
1011 var zig_code_file = try target_dir.createFile(zig_code_basename, .{});
1012 defer zig_code_file.close();
1013
1014 var bw = std.io.bufferedWriter(zig_code_file.writer());
1015 const w = bw.writer();
1016
1017 try w.writeAll(
1018 \\//! This file is auto-generated by tools/update_cpu_features.zig.
1019 \\
1020 \\const std = @import("../std.zig");
1021 \\const CpuFeature = std.Target.Cpu.Feature;
1022 \\const CpuModel = std.Target.Cpu.Model;
1023 \\
1024 \\pub const Feature = enum {
1025 \\
1026 );
1027
1028 for (all_features.items) |feature| {
1029 try w.print(" {},\n", .{std.zig.fmtId(feature.zig_name)});
1030 }
1031
1032 try w.writeAll(
1033 \\};
1034 \\
1035 \\pub usingnamespace CpuFeature.feature_set_fns(Feature);
1036 \\
1037 \\pub const all_features = blk: {
1038 \\
1039 );
1040 if (llvm_target.branch_quota) |branch_quota| {
1041 try w.print(" @setEvalBranchQuota({d});\n", .{branch_quota});
1042 }
1043 try w.writeAll(
1044 \\ const len = @typeInfo(Feature).Enum.fields.len;
1045 \\ std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
1046 \\ var result: [len]CpuFeature = undefined;
1047 \\
1048 );
1049
1050 for (all_features.items) |feature| {
1051 if (feature.llvm_name) |llvm_name| {
1052 try w.print(
1053 \\ result[@enumToInt(Feature.{})] = .{{
1054 \\ .llvm_name = "{}",
1055 \\ .description = "{}",
1056 \\ .dependencies = featureSet(&[_]Feature{{
1057 ,
1058 .{
1059 std.zig.fmtId(feature.zig_name),
1060 std.zig.fmtEscapes(llvm_name),
1061 std.zig.fmtEscapes(feature.desc),
1062 },
1063 );
1064 } else {
1065 try w.print(
1066 \\ result[@enumToInt(Feature.{})] = .{{
1067 \\ .llvm_name = null,
1068 \\ .description = "{}",
1069 \\ .dependencies = featureSet(&[_]Feature{{
1070 ,
1071 .{
1072 std.zig.fmtId(feature.zig_name),
1073 std.zig.fmtEscapes(feature.desc),
1074 },
1075 );
1076 }
1077 var deps_set = std.StringHashMap(void).init(arena);
1078 for (feature.deps) |dep| {
1079 try putDep(&deps_set, features_table, dep);
1080 }
1081 try pruneFeatures(arena, features_table, &deps_set);
1082 var dependencies = std.ArrayList([]const u8).init(arena);
1083 {
1084 var it = deps_set.iterator();
1085 while (it.next()) |entry| {
1086 try dependencies.append(entry.key);
1087 }
1088 }
1089 std.sort.sort([]const u8, dependencies.items, {}, asciiLessThan);
1090
1091 if (dependencies.items.len == 0) {
1092 try w.writeAll(
1093 \\}),
1094 \\ };
1095 \\
1096 );
1097 } else {
1098 try w.writeAll("\n");
1099 for (dependencies.items) |dep| {
1100 try w.print(" .{},\n", .{std.zig.fmtId(dep)});
1101 }
1102 try w.writeAll(
1103 \\ }),
1104 \\ };
1105 \\
1106 );
1107 }
1108 }
1109 try w.writeAll(
1110 \\ const ti = @typeInfo(Feature);
1111 \\ for (result) |*elem, i| {
1112 \\ elem.index = i;
1113 \\ elem.name = ti.Enum.fields[i].name;
1114 \\ }
1115 \\ break :blk result;
1116 \\};
1117 \\
1118 \\pub const cpu = struct {
1119 \\
1120 );
1121 for (all_cpus.items) |cpu| {
1122 var deps_set = std.StringHashMap(void).init(arena);
1123 for (cpu.features) |feature_zig_name| {
1124 try putDep(&deps_set, features_table, feature_zig_name);
1125 }
1126 try pruneFeatures(arena, features_table, &deps_set);
1127 var cpu_features = std.ArrayList([]const u8).init(arena);
1128 {
1129 var it = deps_set.iterator();
1130 while (it.next()) |entry| {
1131 try cpu_features.append(entry.key);
1132 }
1133 }
1134 std.sort.sort([]const u8, cpu_features.items, {}, asciiLessThan);
1135 if (cpu.llvm_name) |llvm_name| {
1136 try w.print(
1137 \\ pub const {} = CpuModel{{
1138 \\ .name = "{}",
1139 \\ .llvm_name = "{}",
1140 \\ .features = featureSet(&[_]Feature{{
1141 , .{
1142 std.zig.fmtId(cpu.zig_name),
1143 std.zig.fmtEscapes(cpu.zig_name),
1144 std.zig.fmtEscapes(llvm_name),
1145 });
1146 } else {
1147 try w.print(
1148 \\ pub const {} = CpuModel{{
1149 \\ .name = "{}",
1150 \\ .llvm_name = null,
1151 \\ .features = featureSet(&[_]Feature{{
1152 , .{
1153 std.zig.fmtId(cpu.zig_name),
1154 std.zig.fmtEscapes(cpu.zig_name),
1155 });
1156 }
1157 if (cpu_features.items.len == 0) {
1158 try w.writeAll(
1159 \\}),
1160 \\ };
1161 \\
1162 );
1163 } else {
1164 try w.writeAll("\n");
1165 for (cpu_features.items) |feature_zig_name| {
1166 try w.print(" .{},\n", .{std.zig.fmtId(feature_zig_name)});
1167 }
1168 try w.writeAll(
1169 \\ }),
1170 \\ };
1171 \\
1172 );
1173 }
1174 }
1175
1176 try w.writeAll(
1177 \\};
1178 \\
1179 );
1180 try bw.flush();
1181
1182 render_progress.end();
1183}
1184
1185fn usageAndExit(file: fs.File, arg0: []const u8, code: u8) noreturn {
1186 file.writer().print(
1187 \\Usage: {s} /path/to/llvm-tblgen /path/git/llvm-project /path/git/zig
1188 \\
1189 \\Updates lib/std/target/<target>.zig from llvm/lib/Target/<Target>/<Target>.td .
1190 \\
1191 \\On a less beefy system, or when debugging, compile with --single-threaded.
1192 \\
1193 , .{arg0}) catch std.process.exit(1);
1194 std.process.exit(code);
1195}
1196
1197fn featureLessThan(context: void, a: Feature, b: Feature) bool {
1198 return std.ascii.lessThanIgnoreCase(a.zig_name, b.zig_name);
1199}
1200
1201fn cpuLessThan(context: void, a: Cpu, b: Cpu) bool {
1202 return std.ascii.lessThanIgnoreCase(a.zig_name, b.zig_name);
1203}
1204
1205fn asciiLessThan(context: void, a: []const u8, b: []const u8) bool {
1206 return std.ascii.lessThanIgnoreCase(a, b);
1207}
1208
1209fn llvmNameToZigName(arena: *mem.Allocator, llvm_name: []const u8) ![]const u8 {
1210 const duped = try arena.dupe(u8, llvm_name);
1211 for (duped) |*byte| switch (byte.*) {
1212 '-', '.' => byte.* = '_',
1213 else => continue,
1214 };
1215 return duped;
1216}
1217
1218fn llvmNameToZigNameOmit(
1219 arena: *mem.Allocator,
1220 llvm_target: LlvmTarget,
1221 llvm_name: []const u8,
1222) !?[]const u8 {
1223 for (llvm_target.feature_overrides) |feature_override| {
1224 if (mem.eql(u8, feature_override.llvm_name, llvm_name)) {
1225 if (feature_override.omit) return null;
1226 return feature_override.zig_name orelse break;
1227 }
1228 }
1229 return try llvmNameToZigName(arena, llvm_name);
1230}
1231
1232fn hasSuperclass(obj: *json.ObjectMap, class_name: []const u8) bool {
1233 const superclasses_json = obj.get("!superclasses") orelse return false;
1234 for (superclasses_json.Array.items) |superclass_json| {
1235 const superclass = superclass_json.String;
1236 if (std.mem.eql(u8, superclass, class_name)) {
1237 return true;
1238 }
1239 }
1240 return false;
1241}
1242
1243fn pruneFeatures(
1244 arena: *mem.Allocator,
1245 features_table: std.StringHashMap(Feature),
1246 deps_set: *std.StringHashMap(void),
1247) !void {
1248 // For each element, recursively iterate over the dependencies and add
1249 // everything we find to a "deletion set".
1250 // Then, iterate over the deletion set and delete all that stuff from `deps_set`.
1251 var deletion_set = std.StringHashMap(void).init(arena);
1252 {
1253 var it = deps_set.iterator();
1254 while (it.next()) |entry| {
1255 const feature = features_table.get(entry.key).?;
1256 try walkFeatures(features_table, &deletion_set, feature);
1257 }
1258 }
1259 {
1260 var it = deletion_set.iterator();
1261 while (it.next()) |entry| {
1262 _ = deps_set.remove(entry.key);
1263 }
1264 }
1265}
1266
1267fn walkFeatures(
1268 features_table: std.StringHashMap(Feature),
1269 deletion_set: *std.StringHashMap(void),
1270 feature: Feature,
1271) error{OutOfMemory}!void {
1272 for (feature.deps) |dep| {
1273 try deletion_set.put(dep, {});
1274 const other_feature = features_table.get(dep).?;
1275 try walkFeatures(features_table, deletion_set, other_feature);
1276 }
1277}
1278
1279fn putDep(
1280 deps_set: *std.StringHashMap(void),
1281 features_table: std.StringHashMap(Feature),
1282 zig_feature_name: []const u8,
1283) error{OutOfMemory}!void {
1284 const feature = features_table.get(zig_feature_name).?;
1285 if (feature.flatten) {
1286 for (feature.deps) |dep| {
1287 try putDep(deps_set, features_table, dep);
1288 }
1289 } else {
1290 try deps_set.put(zig_feature_name, {});
1291 }
1292}