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 @@
99
1010find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
1111 PATHS
12 /usr/lib/llvm/11/include
13 /usr/lib/llvm-11/include
14 /usr/lib/llvm-11.0/include
15 /usr/local/llvm110/include
16 /usr/local/llvm11/include
12 /usr/lib/llvm/12/include
13 /usr/lib/llvm-12/include
14 /usr/lib/llvm-12.0/include
15 /usr/local/llvm120/include
16 /usr/local/llvm12/include
1717 /mingw64/include
1818)
1919
2020if(ZIG_PREFER_CLANG_CPP_DYLIB)
2121 find_library(CLANG_LIBRARIES
2222 NAMES
23 clang-cpp-11.0
24 clang-cpp110
23 clang-cpp-12.0
24 clang-cpp120
2525 clang-cpp
2626 PATHS
2727 ${CLANG_LIBDIRS}
28 /usr/lib/llvm/11/lib
29 /usr/lib/llvm/11/lib64
30 /usr/lib/llvm-11/lib
31 /usr/local/llvm110/lib
32 /usr/local/llvm11/lib
28 /usr/lib/llvm/12/lib
29 /usr/lib/llvm/12/lib64
30 /usr/lib/llvm-12/lib
31 /usr/local/llvm120/lib
32 /usr/local/llvm12/lib
3333 )
3434endif()
3535
......@@ -39,11 +39,11 @@ if(NOT CLANG_LIBRARIES)
3939 find_library(CLANG_${_prettylibname_}_LIB NAMES ${_libname_}
4040 PATHS
4141 ${CLANG_LIBDIRS}
42 /usr/lib/llvm/11/lib
43 /usr/lib/llvm-11/lib
44 /usr/lib/llvm-11.0/lib
45 /usr/local/llvm110/lib
46 /usr/local/llvm11/lib
42 /usr/lib/llvm/12/lib
43 /usr/lib/llvm-12/lib
44 /usr/lib/llvm-12.0/lib
45 /usr/local/llvm120/lib
46 /usr/local/llvm12/lib
4747 /mingw64/lib
4848 /c/msys64/mingw64/lib
4949 c:\\msys64\\mingw64\\lib
cmake/Findlld.cmake+10-10
......@@ -8,16 +8,16 @@
88
99find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
1010 PATHS
11 /usr/lib/llvm-11/include
12 /usr/local/llvm110/include
13 /usr/local/llvm11/include
11 /usr/lib/llvm-12/include
12 /usr/local/llvm120/include
13 /usr/local/llvm12/include
1414 /mingw64/include)
1515
16find_library(LLD_LIBRARY NAMES lld-11.0 lld110 lld
16find_library(LLD_LIBRARY NAMES lld-12.0 lld120 lld
1717 PATHS
18 /usr/lib/llvm-11/lib
19 /usr/local/llvm110/lib
20 /usr/local/llvm11/lib
18 /usr/lib/llvm-12/lib
19 /usr/local/llvm120/lib
20 /usr/local/llvm12/lib
2121)
2222if(EXISTS ${LLD_LIBRARY})
2323 set(LLD_LIBRARIES ${LLD_LIBRARY})
......@@ -27,9 +27,9 @@ else()
2727 find_library(LLD_${_prettylibname_}_LIB NAMES ${_libname_}
2828 PATHS
2929 ${LLD_LIBDIRS}
30 /usr/lib/llvm-11/lib
31 /usr/local/llvm110/lib
32 /usr/local/llvm11/lib
30 /usr/lib/llvm-12/lib
31 /usr/local/llvm120/lib
32 /usr/local/llvm12/lib
3333 /mingw64/lib
3434 /c/msys64/mingw64/lib
3535 c:/msys64/mingw64/lib)
cmake/Findllvm.cmake+92-88
......@@ -9,37 +9,37 @@
99
1010find_path(LLVM_INCLUDE_DIRS NAMES llvm/IR/IRBuilder.h
1111 PATHS
12 /usr/lib/llvm/11/include
13 /usr/lib/llvm-11/include
14 /usr/lib/llvm-11.0/include
15 /usr/local/llvm11/include
16 /usr/local/llvm110/include
12 /usr/lib/llvm/12/include
13 /usr/lib/llvm-12/include
14 /usr/lib/llvm-12.0/include
15 /usr/local/llvm12/include
16 /usr/local/llvm120/include
1717 /mingw64/include
1818)
1919
2020if(ZIG_PREFER_CLANG_CPP_DYLIB)
2121 find_library(LLVM_LIBRARIES
2222 NAMES
23 LLVM-11.0
24 LLVM-11
25 LLVM-110
23 LLVM-12.0
24 LLVM-12
25 LLVM-120
2626 LLVM
2727 PATHS
2828 ${LLVM_LIBDIRS}
29 /usr/lib/llvm/11/lib
30 /usr/lib/llvm/11/lib64
31 /usr/lib/llvm-11/lib
32 /usr/local/llvm11/lib
33 /usr/local/llvm110/lib
29 /usr/lib/llvm/12/lib
30 /usr/lib/llvm/12/lib64
31 /usr/lib/llvm-12/lib
32 /usr/local/llvm12/lib
33 /usr/local/llvm120/lib
3434 )
3535
3636 find_program(LLVM_CONFIG_EXE
37 NAMES llvm-config-11 llvm-config-11.0 llvm-config110 llvm-config11 llvm-config
37 NAMES llvm-config-12 llvm-config-12.0 llvm-config120 llvm-config12 llvm-config
3838 PATHS
3939 "/mingw64/bin"
4040 "/c/msys64/mingw64/bin"
4141 "c:/msys64/mingw64/bin"
42 "C:/Libraries/llvm-11.0.0/bin")
42 "C:/Libraries/llvm-12.0.0/bin")
4343
4444 if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
4545 message(FATAL_ERROR "unable to find llvm-config")
......@@ -54,23 +54,23 @@ if(ZIG_PREFER_CLANG_CPP_DYLIB)
5454 OUTPUT_VARIABLE LLVM_CONFIG_VERSION
5555 OUTPUT_STRIP_TRAILING_WHITESPACE)
5656
57 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 11)
58 message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
57 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 12)
58 message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
5959 endif()
60 if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 12)
61 message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
60 if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 13)
61 message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
6262 endif()
63 if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 12)
64 message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
63 if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 13)
64 message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
6565 endif()
6666elseif(ZIG_USE_LLVM_CONFIG)
6767 find_program(LLVM_CONFIG_EXE
68 NAMES llvm-config-11 llvm-config-11.0 llvm-config110 llvm-config11 llvm-config
68 NAMES llvm-config-12 llvm-config-12.0 llvm-config120 llvm-config12 llvm-config
6969 PATHS
7070 "/mingw64/bin"
7171 "/c/msys64/mingw64/bin"
7272 "c:/msys64/mingw64/bin"
73 "C:/Libraries/llvm-11.0.0/bin")
73 "C:/Libraries/llvm-12.0.0/bin")
7474
7575 if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
7676 message(FATAL_ERROR "unable to find llvm-config")
......@@ -85,14 +85,14 @@ elseif(ZIG_USE_LLVM_CONFIG)
8585 OUTPUT_VARIABLE LLVM_CONFIG_VERSION
8686 OUTPUT_STRIP_TRAILING_WHITESPACE)
8787
88 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 11)
89 message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
88 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 12)
89 message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
9090 endif()
91 if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 12)
92 message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
91 if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 13)
92 message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
9393 endif()
94 if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 12)
95 message(FATAL_ERROR "expected LLVM 11.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
94 if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 13)
95 message(FATAL_ERROR "expected LLVM 12.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
9696 endif()
9797
9898 execute_process(
......@@ -166,7 +166,7 @@ elseif(ZIG_USE_LLVM_CONFIG)
166166 set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS})
167167
168168 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)
170170 endif()
171171
172172 link_directories("${CMAKE_PREFIX_PATH}/lib")
......@@ -180,11 +180,11 @@ else()
180180 find_library(LLVM_${_prettylibname_}_LIB NAMES ${_libname_}
181181 PATHS
182182 ${LLVM_LIBDIRS}
183 /usr/lib/llvm/11/lib
184 /usr/lib/llvm-11/lib
185 /usr/lib/llvm-11.0/lib
186 /usr/local/llvm110/lib
187 /usr/local/llvm11/lib
183 /usr/lib/llvm/12/lib
184 /usr/lib/llvm-12/lib
185 /usr/lib/llvm-12.0/lib
186 /usr/local/llvm120/lib
187 /usr/local/llvm12/lib
188188 /mingw64/lib
189189 /c/msys64/mingw64/lib
190190 c:\\msys64\\mingw64\\lib)
......@@ -194,78 +194,57 @@ else()
194194 # This list can be re-generated with `llvm-config --libfiles` and then
195195 # reformatting using your favorite text editor. Note we do not execute
196196 # `llvm-config` here because we are cross compiling.
197 FIND_AND_ADD_LLVM_LIB(LLVMXRay)
198197 FIND_AND_ADD_LLVM_LIB(LLVMWindowsManifest)
199 FIND_AND_ADD_LLVM_LIB(LLVMSymbolize)
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)
198 FIND_AND_ADD_LLVM_LIB(LLVMXRay)
212199 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)
219200 FIND_AND_ADD_LLVM_LIB(LLVMDlltoolDriver)
220 FIND_AND_ADD_LLVM_LIB(LLVMOption)
221 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoGSYM)
222201 FIND_AND_ADD_LLVM_LIB(LLVMCoverage)
202 FIND_AND_ADD_LLVM_LIB(LLVMLineEditor)
223203 FIND_AND_ADD_LLVM_LIB(LLVMXCoreDisassembler)
224204 FIND_AND_ADD_LLVM_LIB(LLVMXCoreCodeGen)
225205 FIND_AND_ADD_LLVM_LIB(LLVMXCoreDesc)
226206 FIND_AND_ADD_LLVM_LIB(LLVMXCoreInfo)
227207 FIND_AND_ADD_LLVM_LIB(LLVMX86Disassembler)
228 FIND_AND_ADD_LLVM_LIB(LLVMX86CodeGen)
229208 FIND_AND_ADD_LLVM_LIB(LLVMX86AsmParser)
209 FIND_AND_ADD_LLVM_LIB(LLVMX86CodeGen)
230210 FIND_AND_ADD_LLVM_LIB(LLVMX86Desc)
231211 FIND_AND_ADD_LLVM_LIB(LLVMX86Info)
232212 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyDisassembler)
213 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyAsmParser)
233214 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyCodeGen)
234215 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyDesc)
235 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyAsmParser)
236216 FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyInfo)
237217 FIND_AND_ADD_LLVM_LIB(LLVMSystemZDisassembler)
238 FIND_AND_ADD_LLVM_LIB(LLVMSystemZCodeGen)
239218 FIND_AND_ADD_LLVM_LIB(LLVMSystemZAsmParser)
219 FIND_AND_ADD_LLVM_LIB(LLVMSystemZCodeGen)
240220 FIND_AND_ADD_LLVM_LIB(LLVMSystemZDesc)
241221 FIND_AND_ADD_LLVM_LIB(LLVMSystemZInfo)
242222 FIND_AND_ADD_LLVM_LIB(LLVMSparcDisassembler)
243 FIND_AND_ADD_LLVM_LIB(LLVMSparcCodeGen)
244223 FIND_AND_ADD_LLVM_LIB(LLVMSparcAsmParser)
224 FIND_AND_ADD_LLVM_LIB(LLVMSparcCodeGen)
245225 FIND_AND_ADD_LLVM_LIB(LLVMSparcDesc)
246226 FIND_AND_ADD_LLVM_LIB(LLVMSparcInfo)
247227 FIND_AND_ADD_LLVM_LIB(LLVMRISCVDisassembler)
248 FIND_AND_ADD_LLVM_LIB(LLVMRISCVCodeGen)
249228 FIND_AND_ADD_LLVM_LIB(LLVMRISCVAsmParser)
229 FIND_AND_ADD_LLVM_LIB(LLVMRISCVCodeGen)
250230 FIND_AND_ADD_LLVM_LIB(LLVMRISCVDesc)
251 FIND_AND_ADD_LLVM_LIB(LLVMRISCVUtils)
252231 FIND_AND_ADD_LLVM_LIB(LLVMRISCVInfo)
253232 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCDisassembler)
254 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCCodeGen)
255233 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCAsmParser)
234 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCCodeGen)
256235 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCDesc)
257236 FIND_AND_ADD_LLVM_LIB(LLVMPowerPCInfo)
258237 FIND_AND_ADD_LLVM_LIB(LLVMNVPTXCodeGen)
259238 FIND_AND_ADD_LLVM_LIB(LLVMNVPTXDesc)
260239 FIND_AND_ADD_LLVM_LIB(LLVMNVPTXInfo)
261240 FIND_AND_ADD_LLVM_LIB(LLVMMSP430Disassembler)
262 FIND_AND_ADD_LLVM_LIB(LLVMMSP430CodeGen)
263241 FIND_AND_ADD_LLVM_LIB(LLVMMSP430AsmParser)
242 FIND_AND_ADD_LLVM_LIB(LLVMMSP430CodeGen)
264243 FIND_AND_ADD_LLVM_LIB(LLVMMSP430Desc)
265244 FIND_AND_ADD_LLVM_LIB(LLVMMSP430Info)
266245 FIND_AND_ADD_LLVM_LIB(LLVMMipsDisassembler)
267 FIND_AND_ADD_LLVM_LIB(LLVMMipsCodeGen)
268246 FIND_AND_ADD_LLVM_LIB(LLVMMipsAsmParser)
247 FIND_AND_ADD_LLVM_LIB(LLVMMipsCodeGen)
269248 FIND_AND_ADD_LLVM_LIB(LLVMMipsDesc)
270249 FIND_AND_ADD_LLVM_LIB(LLVMMipsInfo)
271250 FIND_AND_ADD_LLVM_LIB(LLVMLanaiDisassembler)
......@@ -279,44 +258,73 @@ else()
279258 FIND_AND_ADD_LLVM_LIB(LLVMHexagonDesc)
280259 FIND_AND_ADD_LLVM_LIB(LLVMHexagonInfo)
281260 FIND_AND_ADD_LLVM_LIB(LLVMBPFDisassembler)
282 FIND_AND_ADD_LLVM_LIB(LLVMBPFCodeGen)
283261 FIND_AND_ADD_LLVM_LIB(LLVMBPFAsmParser)
262 FIND_AND_ADD_LLVM_LIB(LLVMBPFCodeGen)
284263 FIND_AND_ADD_LLVM_LIB(LLVMBPFDesc)
285264 FIND_AND_ADD_LLVM_LIB(LLVMBPFInfo)
286265 FIND_AND_ADD_LLVM_LIB(LLVMAVRDisassembler)
287 FIND_AND_ADD_LLVM_LIB(LLVMAVRCodeGen)
288266 FIND_AND_ADD_LLVM_LIB(LLVMAVRAsmParser)
267 FIND_AND_ADD_LLVM_LIB(LLVMAVRCodeGen)
289268 FIND_AND_ADD_LLVM_LIB(LLVMAVRDesc)
290269 FIND_AND_ADD_LLVM_LIB(LLVMAVRInfo)
291270 FIND_AND_ADD_LLVM_LIB(LLVMARMDisassembler)
292 FIND_AND_ADD_LLVM_LIB(LLVMARMCodeGen)
293271 FIND_AND_ADD_LLVM_LIB(LLVMARMAsmParser)
272 FIND_AND_ADD_LLVM_LIB(LLVMARMCodeGen)
294273 FIND_AND_ADD_LLVM_LIB(LLVMARMDesc)
295274 FIND_AND_ADD_LLVM_LIB(LLVMARMUtils)
296275 FIND_AND_ADD_LLVM_LIB(LLVMARMInfo)
297276 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)
307277 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUAsmParser)
278 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUCodeGen)
308279 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUDesc)
309280 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUUtils)
310281 FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUInfo)
311282 FIND_AND_ADD_LLVM_LIB(LLVMAArch64Disassembler)
312 FIND_AND_ADD_LLVM_LIB(LLVMMCDisassembler)
283 FIND_AND_ADD_LLVM_LIB(LLVMAArch64AsmParser)
313284 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)
314305 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)
315317 FIND_AND_ADD_LLVM_LIB(LLVMGlobalISel)
316 FIND_AND_ADD_LLVM_LIB(LLVMSelectionDAG)
318 FIND_AND_ADD_LLVM_LIB(LLVMMIRParser)
317319 FIND_AND_ADD_LLVM_LIB(LLVMAsmPrinter)
318320 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoDWARF)
321 FIND_AND_ADD_LLVM_LIB(LLVMSelectionDAG)
319322 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)
320328 FIND_AND_ADD_LLVM_LIB(LLVMTarget)
321329 FIND_AND_ADD_LLVM_LIB(LLVMScalarOpts)
322330 FIND_AND_ADD_LLVM_LIB(LLVMInstCombine)
......@@ -327,19 +335,15 @@ else()
327335 FIND_AND_ADD_LLVM_LIB(LLVMProfileData)
328336 FIND_AND_ADD_LLVM_LIB(LLVMObject)
329337 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)
335338 FIND_AND_ADD_LLVM_LIB(LLVMMCParser)
336 FIND_AND_ADD_LLVM_LIB(LLVMAArch64Desc)
337339 FIND_AND_ADD_LLVM_LIB(LLVMMC)
338340 FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoCodeView)
339341 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)
340346 FIND_AND_ADD_LLVM_LIB(LLVMBinaryFormat)
341 FIND_AND_ADD_LLVM_LIB(LLVMAArch64Utils)
342 FIND_AND_ADD_LLVM_LIB(LLVMAArch64Info)
343347 FIND_AND_ADD_LLVM_LIB(LLVMSupport)
344348 FIND_AND_ADD_LLVM_LIB(LLVMDemangle)
345349endif()
lib/include/__clang_cuda_builtin_vars.h+9
......@@ -55,7 +55,9 @@ struct __cuda_builtin_threadIdx_t {
5555 __CUDA_DEVICE_BUILTIN(z,__nvvm_read_ptx_sreg_tid_z());
5656 // threadIdx should be convertible to uint3 (in fact in nvcc, it *is* a
5757 // uint3). This function is defined after we pull in vector_types.h.
58 __attribute__((device)) operator dim3() const;
5859 __attribute__((device)) operator uint3() const;
60
5961private:
6062 __CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_threadIdx_t);
6163};
......@@ -66,7 +68,9 @@ struct __cuda_builtin_blockIdx_t {
6668 __CUDA_DEVICE_BUILTIN(z,__nvvm_read_ptx_sreg_ctaid_z());
6769 // blockIdx should be convertible to uint3 (in fact in nvcc, it *is* a
6870 // uint3). This function is defined after we pull in vector_types.h.
71 __attribute__((device)) operator dim3() const;
6972 __attribute__((device)) operator uint3() const;
73
7074private:
7175 __CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_blockIdx_t);
7276};
......@@ -78,6 +82,8 @@ struct __cuda_builtin_blockDim_t {
7882 // blockDim should be convertible to dim3 (in fact in nvcc, it *is* a
7983 // dim3). This function is defined after we pull in vector_types.h.
8084 __attribute__((device)) operator dim3() const;
85 __attribute__((device)) operator uint3() const;
86
8187private:
8288 __CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_blockDim_t);
8389};
......@@ -89,6 +95,8 @@ struct __cuda_builtin_gridDim_t {
8995 // gridDim should be convertible to dim3 (in fact in nvcc, it *is* a
9096 // dim3). This function is defined after we pull in vector_types.h.
9197 __attribute__((device)) operator dim3() const;
98 __attribute__((device)) operator uint3() const;
99
92100private:
93101 __CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_gridDim_t);
94102};
......@@ -108,5 +116,6 @@ __attribute__((device)) const int warpSize = 32;
108116#undef __CUDA_DEVICE_BUILTIN
109117#undef __CUDA_BUILTIN_VAR
110118#undef __CUDA_DISALLOW_BUILTINVAR_ACCESS
119#undef __DELETE
111120
112121#endif /* __CUDA_BUILTIN_VARS_H */
lib/include/__clang_cuda_cmath.h+46-4
......@@ -66,10 +66,38 @@ __DEVICE__ float frexp(float __arg, int *__exp) {
6666}
6767
6868// For inscrutable reasons, the CUDA headers define these functions for us on
69// Windows. For OpenMP we omit these as some old system headers have
70// non-conforming `isinf(float)` and `isnan(float)` implementations that return
71// an `int`. The system versions of these functions should be fine anyway.
72#if !defined(_MSC_VER) && !defined(__OPENMP_NVPTX__)
69// Windows.
70#if !defined(_MSC_VER) || defined(__OPENMP_NVPTX__)
71
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
73101__DEVICE__ bool isinf(float __x) { return ::__isinff(__x); }
74102__DEVICE__ bool isinf(double __x) { return ::__isinf(__x); }
75103__DEVICE__ bool isfinite(float __x) { return ::__finitef(__x); }
......@@ -79,6 +107,11 @@ __DEVICE__ bool isfinite(float __x) { return ::__finitef(__x); }
79107__DEVICE__ bool isfinite(double __x) { return ::__isfinited(__x); }
80108__DEVICE__ bool isnan(float __x) { return ::__isnanf(__x); }
81109__DEVICE__ bool isnan(double __x) { return ::__isnan(__x); }
110
111#if defined(__OPENMP_NVPTX__)
112#pragma omp end declare variant
113#endif
114
82115#endif
83116
84117__DEVICE__ bool isgreater(float __x, float __y) {
......@@ -142,6 +175,15 @@ __DEVICE__ float sqrt(float __x) { return ::sqrtf(__x); }
142175__DEVICE__ float tan(float __x) { return ::tanf(__x); }
143176__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
145187// Notably missing above is nexttoward. We omit it because
146188// libdevice doesn't provide an implementation, and we don't want to be in the
147189// business of implementing tricky libm functions in this header.
lib/include/__clang_cuda_complex_builtins.h+28-2
......@@ -41,6 +41,27 @@
4141#define _ABSf std::abs
4242#define _LOGBd std::logb
4343#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
4465#else
4566#define _ISNANd __nv_isnand
4667#define _ISNANf __nv_isnanf
......@@ -56,6 +77,9 @@
5677#define _ABSf __nv_fabsf
5778#define _LOGBd __nv_logb
5879#define _LOGBf __nv_logbf
80#define _fmaxd __nv_fmax
81#define _fmaxf __nv_fmaxf
82#endif
5983#endif
6084
6185#if defined(__cplusplus)
......@@ -167,7 +191,7 @@ __DEVICE__ double _Complex __divdc3(double __a, double __b, double __c,
167191 // Can't use std::max, because that's defined in <algorithm>, and we don't
168192 // want to pull that in for every compile. The CUDA headers define
169193 // ::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)));
171195 if (_ISFINITEd(__logbw)) {
172196 __ilogbw = (int)__logbw;
173197 __c = _SCALBNd(__c, -__ilogbw);
......@@ -200,7 +224,7 @@ __DEVICE__ double _Complex __divdc3(double __a, double __b, double __c,
200224
201225__DEVICE__ float _Complex __divsc3(float __a, float __b, float __c, float __d) {
202226 int __ilogbw = 0;
203 float __logbw = _LOGBf(max(_ABSf(__c), _ABSf(__d)));
227 float __logbw = _LOGBf(_fmaxf(_ABSf(__c), _ABSf(__d)));
204228 if (_ISFINITEf(__logbw)) {
205229 __ilogbw = (int)__logbw;
206230 __c = _SCALBNf(__c, -__ilogbw);
......@@ -249,6 +273,8 @@ __DEVICE__ float _Complex __divsc3(float __a, float __b, float __c, float __d) {
249273#undef _ABSf
250274#undef _LOGBd
251275#undef _LOGBf
276#undef _fmaxd
277#undef _fmaxf
252278
253279#ifdef __OPENMP_NVPTX__
254280#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); }
195195__DEVICE__ int min(int __a, int __b) { return __nv_min(__a, __b); }
196196__DEVICE__ double modf(double __a, double *__b) { return __nv_modf(__a, __b); }
197197__DEVICE__ float modff(float __a, float *__b) { return __nv_modff(__a, __b); }
198__DEVICE__ double nearbyint(double __a) { return __nv_nearbyint(__a); }
199__DEVICE__ float nearbyintf(float __a) { return __nv_nearbyintf(__a); }
198__DEVICE__ double nearbyint(double __a) { return __builtin_nearbyint(__a); }
199__DEVICE__ float nearbyintf(float __a) { return __builtin_nearbyintf(__a); }
200200__DEVICE__ double nextafter(double __a, double __b) {
201201 return __nv_nextafter(__a, __b);
202202}
......@@ -249,8 +249,9 @@ __DEVICE__ double rhypot(double __a, double __b) {
249249__DEVICE__ float rhypotf(float __a, float __b) {
250250 return __nv_rhypotf(__a, __b);
251251}
252__DEVICE__ double rint(double __a) { return __nv_rint(__a); }
253__DEVICE__ float rintf(float __a) { return __nv_rintf(__a); }
252// __nv_rint* in libdevice is buggy and produces incorrect results.
253__DEVICE__ double rint(double __a) { return __builtin_rint(__a); }
254__DEVICE__ float rintf(float __a) { return __builtin_rintf(__a); }
254255__DEVICE__ double rnorm(int __a, const double *__b) {
255256 return __nv_rnorm(__a, __b);
256257}
lib/include/__clang_cuda_math_forward_declares.h+3
......@@ -160,6 +160,9 @@ __DEVICE__ double scalbln(double, long);
160160__DEVICE__ float scalbln(float, long);
161161__DEVICE__ double scalbn(double, int);
162162__DEVICE__ float scalbn(float, int);
163#ifdef _MSC_VER
164__DEVICE__ bool signbit(long double);
165#endif
163166__DEVICE__ bool signbit(double);
164167__DEVICE__ bool signbit(float);
165168__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) {
377377// Out-of-line implementations from __clang_cuda_builtin_vars.h. These need to
378378// 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
380384__device__ inline __cuda_builtin_threadIdx_t::operator uint3() const {
381 uint3 ret;
382 ret.x = x;
383 ret.y = y;
384 ret.z = z;
385 return ret;
385 return {x, y, z};
386}
387
388__device__ inline __cuda_builtin_blockIdx_t::operator dim3() const {
389 return dim3(x, y, z);
386390}
387391
388392__device__ inline __cuda_builtin_blockIdx_t::operator uint3() const {
389 uint3 ret;
390 ret.x = x;
391 ret.y = y;
392 ret.z = z;
393 return ret;
393 return {x, y, z};
394394}
395395
396396__device__ inline __cuda_builtin_blockDim_t::operator dim3() const {
397397 return dim3(x, y, z);
398398}
399399
400__device__ inline __cuda_builtin_blockDim_t::operator uint3() const {
401 return {x, y, z};
402}
403
400404__device__ inline __cuda_builtin_gridDim_t::operator dim3() const {
401405 return dim3(x, y, z);
402406}
403407
408__device__ inline __cuda_builtin_gridDim_t::operator uint3() const {
409 return {x, y, z};
410}
411
404412#include <__clang_cuda_cmath.h>
405413#include <__clang_cuda_intrinsics.h>
406414#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 @@
1010#ifndef __CLANG_HIP_LIBDEVICE_DECLARES_H__
1111#define __CLANG_HIP_LIBDEVICE_DECLARES_H__
1212
13#ifdef __cplusplus
1314extern "C" {
15#endif
1416
1517// BEGIN FLOAT
1618__device__ __attribute__((const)) float __ocml_acos_f32(float);
......@@ -78,6 +80,7 @@ __device__ __attribute__((const)) float __ocml_len4_f32(float, float, float,
7880__device__ __attribute__((pure)) float __ocml_ncdf_f32(float);
7981__device__ __attribute__((pure)) float __ocml_ncdfinv_f32(float);
8082__device__ __attribute__((pure)) float __ocml_pow_f32(float, float);
83__device__ __attribute__((pure)) float __ocml_pown_f32(float, int);
8184__device__ __attribute__((pure)) float __ocml_rcbrt_f32(float);
8285__device__ __attribute__((const)) float __ocml_remainder_f32(float, float);
8386__device__ float __ocml_remquo_f32(float, float,
......@@ -126,10 +129,10 @@ __device__ __attribute__((const)) float __ocml_div_rte_f32(float, float);
126129__device__ __attribute__((const)) float __ocml_div_rtn_f32(float, float);
127130__device__ __attribute__((const)) float __ocml_div_rtp_f32(float, float);
128131__device__ __attribute__((const)) float __ocml_div_rtz_f32(float, float);
129__device__ __attribute__((const)) float __ocml_sqrt_rte_f32(float, float);
130__device__ __attribute__((const)) float __ocml_sqrt_rtn_f32(float, float);
131__device__ __attribute__((const)) float __ocml_sqrt_rtp_f32(float, float);
132__device__ __attribute__((const)) float __ocml_sqrt_rtz_f32(float, float);
132__device__ __attribute__((const)) float __ocml_sqrt_rte_f32(float);
133__device__ __attribute__((const)) float __ocml_sqrt_rtn_f32(float);
134__device__ __attribute__((const)) float __ocml_sqrt_rtp_f32(float);
135__device__ __attribute__((const)) float __ocml_sqrt_rtz_f32(float);
133136__device__ __attribute__((const)) float __ocml_fma_rte_f32(float, float, float);
134137__device__ __attribute__((const)) float __ocml_fma_rtn_f32(float, float, float);
135138__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,
205208__device__ __attribute__((pure)) double __ocml_ncdf_f64(double);
206209__device__ __attribute__((pure)) double __ocml_ncdfinv_f64(double);
207210__device__ __attribute__((pure)) double __ocml_pow_f64(double, double);
211__device__ __attribute__((pure)) double __ocml_pown_f64(double, int);
208212__device__ __attribute__((pure)) double __ocml_rcbrt_f64(double);
209213__device__ __attribute__((const)) double __ocml_remainder_f64(double, double);
210214__device__ double __ocml_remquo_f64(double, double,
......@@ -252,10 +256,10 @@ __device__ __attribute__((const)) double __ocml_div_rte_f64(double, double);
252256__device__ __attribute__((const)) double __ocml_div_rtn_f64(double, double);
253257__device__ __attribute__((const)) double __ocml_div_rtp_f64(double, double);
254258__device__ __attribute__((const)) double __ocml_div_rtz_f64(double, double);
255__device__ __attribute__((const)) double __ocml_sqrt_rte_f64(double, double);
256__device__ __attribute__((const)) double __ocml_sqrt_rtn_f64(double, double);
257__device__ __attribute__((const)) double __ocml_sqrt_rtp_f64(double, double);
258__device__ __attribute__((const)) double __ocml_sqrt_rtz_f64(double, double);
259__device__ __attribute__((const)) double __ocml_sqrt_rte_f64(double);
260__device__ __attribute__((const)) double __ocml_sqrt_rtn_f64(double);
261__device__ __attribute__((const)) double __ocml_sqrt_rtp_f64(double);
262__device__ __attribute__((const)) double __ocml_sqrt_rtz_f64(double);
259263__device__ __attribute__((const)) double __ocml_fma_rte_f64(double, double,
260264 double);
261265__device__ __attribute__((const)) double __ocml_fma_rtn_f64(double, double,
......@@ -290,6 +294,7 @@ __device__ __attribute__((const)) _Float16 __ocml_rsqrt_f16(_Float16);
290294__device__ _Float16 __ocml_sin_f16(_Float16);
291295__device__ __attribute__((const)) _Float16 __ocml_sqrt_f16(_Float16);
292296__device__ __attribute__((const)) _Float16 __ocml_trunc_f16(_Float16);
297__device__ __attribute__((pure)) _Float16 __ocml_pown_f16(_Float16, int);
293298
294299typedef _Float16 __2f16 __attribute__((ext_vector_type(2)));
295300typedef short __2i16 __attribute__((ext_vector_type(2)));
......@@ -313,14 +318,17 @@ __device__ __attribute__((pure)) __2f16 __ocml_log2_2f16(__2f16);
313318__device__ inline __2f16
314319__llvm_amdgcn_rcp_2f16(__2f16 __x) // Not currently exposed by ROCDL.
315320{
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));
317322}
318323__device__ __attribute__((const)) __2f16 __ocml_rint_2f16(__2f16);
319324__device__ __attribute__((const)) __2f16 __ocml_rsqrt_2f16(__2f16);
320325__device__ __2f16 __ocml_sin_2f16(__2f16);
321326__device__ __attribute__((const)) __2f16 __ocml_sqrt_2f16(__2f16);
322327__device__ __attribute__((const)) __2f16 __ocml_trunc_2f16(__2f16);
328__device__ __attribute__((const)) __2f16 __ocml_pown_2f16(__2f16, __2i16);
323329
330#ifdef __cplusplus
324331} // extern "C"
332#endif
325333
326334#endif // __CLANG_HIP_LIBDEVICE_DECLARES_H__
lib/include/__clang_hip_math.h+619-529
......@@ -1,4 +1,4 @@
1/*===---- __clang_hip_math.h - HIP math decls -------------------------------===
1/*===---- __clang_hip_math.h - Device-side HIP math support ----------------===
22 *
33 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44 * See https://llvm.org/LICENSE.txt for license information.
......@@ -6,24 +6,57 @@
66 *
77 *===-----------------------------------------------------------------------===
88 */
9
109#ifndef __CLANG_HIP_MATH_H__
1110#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)
1317#include <algorithm>
18#endif
1419#include <limits.h>
15#include <limits>
1620#include <stdint.h>
1721
1822#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_declares
22#define __DEVICE__ static __device__
25// A few functions return bool type starting only in C++11.
26#pragma push_macro("__RETURN_TYPE")
27#if defined(__cplusplus)
2328#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
2558__DEVICE__
26inline uint64_t __make_mantissa_base8(const char *__tagp) {
59uint64_t __make_mantissa_base8(const char *__tagp) {
2760 uint64_t __r = 0;
2861 while (__tagp) {
2962 char __tmp = *__tagp;
......@@ -40,7 +73,7 @@ inline uint64_t __make_mantissa_base8(const char *__tagp) {
4073}
4174
4275__DEVICE__
43inline uint64_t __make_mantissa_base10(const char *__tagp) {
76uint64_t __make_mantissa_base10(const char *__tagp) {
4477 uint64_t __r = 0;
4578 while (__tagp) {
4679 char __tmp = *__tagp;
......@@ -57,7 +90,7 @@ inline uint64_t __make_mantissa_base10(const char *__tagp) {
5790}
5891
5992__DEVICE__
60inline uint64_t __make_mantissa_base16(const char *__tagp) {
93uint64_t __make_mantissa_base16(const char *__tagp) {
6194 uint64_t __r = 0;
6295 while (__tagp) {
6396 char __tmp = *__tagp;
......@@ -78,7 +111,7 @@ inline uint64_t __make_mantissa_base16(const char *__tagp) {
78111}
79112
80113__DEVICE__
81inline uint64_t __make_mantissa(const char *__tagp) {
114uint64_t __make_mantissa(const char *__tagp) {
82115 if (!__tagp)
83116 return 0u;
84117
......@@ -95,78 +128,124 @@ inline uint64_t __make_mantissa(const char *__tagp) {
95128}
96129
97130// BEGIN FLOAT
131#if defined(__cplusplus)
98132__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}
100137__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}
102142__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
104149__DEVICE__
105inline float asinf(float __x) { return __ocml_asin_f32(__x); }
150float acosf(float __x) { return __ocml_acos_f32(__x); }
151
106152__DEVICE__
107inline float asinhf(float __x) { return __ocml_asinh_f32(__x); }
153float acoshf(float __x) { return __ocml_acosh_f32(__x); }
154
108155__DEVICE__
109inline float atan2f(float __x, float __y) { return __ocml_atan2_f32(__x, __y); }
156float asinf(float __x) { return __ocml_asin_f32(__x); }
157
110158__DEVICE__
111inline float atanf(float __x) { return __ocml_atan_f32(__x); }
159float asinhf(float __x) { return __ocml_asinh_f32(__x); }
160
112161__DEVICE__
113inline float atanhf(float __x) { return __ocml_atanh_f32(__x); }
162float atan2f(float __x, float __y) { return __ocml_atan2_f32(__x, __y); }
163
114164__DEVICE__
115inline float cbrtf(float __x) { return __ocml_cbrt_f32(__x); }
165float atanf(float __x) { return __ocml_atan_f32(__x); }
166
116167__DEVICE__
117inline float ceilf(float __x) { return __ocml_ceil_f32(__x); }
168float atanhf(float __x) { return __ocml_atanh_f32(__x); }
169
118170__DEVICE__
119inline float copysignf(float __x, float __y) {
120 return __ocml_copysign_f32(__x, __y);
121}
171float cbrtf(float __x) { return __ocml_cbrt_f32(__x); }
172
122173__DEVICE__
123inline float cosf(float __x) { return __ocml_cos_f32(__x); }
174float ceilf(float __x) { return __ocml_ceil_f32(__x); }
175
124176__DEVICE__
125inline float coshf(float __x) { return __ocml_cosh_f32(__x); }
177float copysignf(float __x, float __y) { return __ocml_copysign_f32(__x, __y); }
178
126179__DEVICE__
127inline float cospif(float __x) { return __ocml_cospi_f32(__x); }
180float cosf(float __x) { return __ocml_cos_f32(__x); }
181
128182__DEVICE__
129inline float cyl_bessel_i0f(float __x) { return __ocml_i0_f32(__x); }
183float coshf(float __x) { return __ocml_cosh_f32(__x); }
184
130185__DEVICE__
131inline float cyl_bessel_i1f(float __x) { return __ocml_i1_f32(__x); }
186float cospif(float __x) { return __ocml_cospi_f32(__x); }
187
132188__DEVICE__
133inline float erfcf(float __x) { return __ocml_erfc_f32(__x); }
189float cyl_bessel_i0f(float __x) { return __ocml_i0_f32(__x); }
190
134191__DEVICE__
135inline float erfcinvf(float __x) { return __ocml_erfcinv_f32(__x); }
192float cyl_bessel_i1f(float __x) { return __ocml_i1_f32(__x); }
193
136194__DEVICE__
137inline float erfcxf(float __x) { return __ocml_erfcx_f32(__x); }
195float erfcf(float __x) { return __ocml_erfc_f32(__x); }
196
138197__DEVICE__
139inline float erff(float __x) { return __ocml_erf_f32(__x); }
198float erfcinvf(float __x) { return __ocml_erfcinv_f32(__x); }
199
140200__DEVICE__
141inline float erfinvf(float __x) { return __ocml_erfinv_f32(__x); }
201float erfcxf(float __x) { return __ocml_erfcx_f32(__x); }
202
142203__DEVICE__
143inline float exp10f(float __x) { return __ocml_exp10_f32(__x); }
204float erff(float __x) { return __ocml_erf_f32(__x); }
205
144206__DEVICE__
145inline float exp2f(float __x) { return __ocml_exp2_f32(__x); }
207float erfinvf(float __x) { return __ocml_erfinv_f32(__x); }
208
146209__DEVICE__
147inline float expf(float __x) { return __ocml_exp_f32(__x); }
210float exp10f(float __x) { return __ocml_exp10_f32(__x); }
211
148212__DEVICE__
149inline float expm1f(float __x) { return __ocml_expm1_f32(__x); }
213float exp2f(float __x) { return __ocml_exp2_f32(__x); }
214
150215__DEVICE__
151inline float fabsf(float __x) { return __ocml_fabs_f32(__x); }
216float expf(float __x) { return __ocml_exp_f32(__x); }
217
152218__DEVICE__
153inline float fdimf(float __x, float __y) { return __ocml_fdim_f32(__x, __y); }
219float expm1f(float __x) { return __ocml_expm1_f32(__x); }
220
154221__DEVICE__
155inline float fdividef(float __x, float __y) { return __x / __y; }
222float fabsf(float __x) { return __ocml_fabs_f32(__x); }
223
156224__DEVICE__
157inline float floorf(float __x) { return __ocml_floor_f32(__x); }
225float fdimf(float __x, float __y) { return __ocml_fdim_f32(__x, __y); }
226
158227__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) {
160235 return __ocml_fma_f32(__x, __y, __z);
161236}
237
162238__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
164241__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
166244__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
168247__DEVICE__
169inline float frexpf(float __x, int *__nptr) {
248float frexpf(float __x, int *__nptr) {
170249 int __tmp;
171250 float __r =
172251 __ocml_frexp_f32(__x, (__attribute__((address_space(5))) int *)&__tmp);
......@@ -174,24 +253,31 @@ inline float frexpf(float __x, int *__nptr) {
174253
175254 return __r;
176255}
256
177257__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
179260__DEVICE__
180inline int ilogbf(float __x) { return __ocml_ilogb_f32(__x); }
261int ilogbf(float __x) { return __ocml_ilogb_f32(__x); }
262
181263__DEVICE__
182inline __RETURN_TYPE isfinite(float __x) { return __ocml_isfinite_f32(__x); }
264__RETURN_TYPE __finitef(float __x) { return __ocml_isfinite_f32(__x); }
265
183266__DEVICE__
184inline __RETURN_TYPE isinf(float __x) { return __ocml_isinf_f32(__x); }
267__RETURN_TYPE __isinff(float __x) { return __ocml_isinf_f32(__x); }
268
185269__DEVICE__
186inline __RETURN_TYPE isnan(float __x) { return __ocml_isnan_f32(__x); }
270__RETURN_TYPE __isnanf(float __x) { return __ocml_isnan_f32(__x); }
271
187272__DEVICE__
188inline float j0f(float __x) { return __ocml_j0_f32(__x); }
273float j0f(float __x) { return __ocml_j0_f32(__x); }
274
189275__DEVICE__
190inline float j1f(float __x) { return __ocml_j1_f32(__x); }
276float j1f(float __x) { return __ocml_j1_f32(__x); }
277
191278__DEVICE__
192inline float jnf(int __n,
193 float __x) { // TODO: we could use Ahmes multiplication
194 // and the Miller & Brown algorithm
279float jnf(int __n, float __x) { // TODO: we could use Ahmes multiplication
280 // and the Miller & Brown algorithm
195281 // for linear recurrences to get O(log n) steps, but it's unclear if
196282 // it'd be beneficial in this case.
197283 if (__n == 0)
......@@ -209,50 +295,61 @@ inline float jnf(int __n,
209295
210296 return __x1;
211297}
298
212299__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
214302__DEVICE__
215inline float lgammaf(float __x) { return __ocml_lgamma_f32(__x); }
303float lgammaf(float __x) { return __ocml_lgamma_f32(__x); }
304
216305__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
218308__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
220311__DEVICE__
221inline float log10f(float __x) { return __ocml_log10_f32(__x); }
312float log10f(float __x) { return __ocml_log10_f32(__x); }
313
222314__DEVICE__
223inline float log1pf(float __x) { return __ocml_log1p_f32(__x); }
315float log1pf(float __x) { return __ocml_log1p_f32(__x); }
316
224317__DEVICE__
225inline float log2f(float __x) { return __ocml_log2_f32(__x); }
318float log2f(float __x) { return __ocml_log2_f32(__x); }
319
226320__DEVICE__
227inline float logbf(float __x) { return __ocml_logb_f32(__x); }
321float logbf(float __x) { return __ocml_logb_f32(__x); }
322
228323__DEVICE__
229inline float logf(float __x) { return __ocml_log_f32(__x); }
324float logf(float __x) { return __ocml_log_f32(__x); }
325
230326__DEVICE__
231inline long int lrintf(float __x) { return __ocml_rint_f32(__x); }
327long int lrintf(float __x) { return __ocml_rint_f32(__x); }
328
232329__DEVICE__
233inline long int lroundf(float __x) { return __ocml_round_f32(__x); }
330long int lroundf(float __x) { return __ocml_round_f32(__x); }
331
234332__DEVICE__
235inline float modff(float __x, float *__iptr) {
333float modff(float __x, float *__iptr) {
236334 float __tmp;
237335 float __r =
238336 __ocml_modf_f32(__x, (__attribute__((address_space(5))) float *)&__tmp);
239337 *__iptr = __tmp;
240
241338 return __r;
242339}
340
243341__DEVICE__
244inline float nanf(const char *__tagp) {
342float nanf(const char *__tagp) {
245343 union {
246344 float val;
247345 struct ieee_float {
248 uint32_t mantissa : 22;
249 uint32_t quiet : 1;
250 uint32_t exponent : 8;
251 uint32_t sign : 1;
346 unsigned int mantissa : 22;
347 unsigned int quiet : 1;
348 unsigned int exponent : 8;
349 unsigned int sign : 1;
252350 } bits;
253
254 static_assert(sizeof(float) == sizeof(ieee_float), "");
255351 } __tmp;
352 __static_assert_type_size_equal(sizeof(__tmp.val), sizeof(__tmp.bits));
256353
257354 __tmp.bits.sign = 0u;
258355 __tmp.bits.exponent = ~0u;
......@@ -261,28 +358,34 @@ inline float nanf(const char *__tagp) {
261358
262359 return __tmp.val;
263360}
361
264362__DEVICE__
265inline float nearbyintf(float __x) { return __ocml_nearbyint_f32(__x); }
363float nearbyintf(float __x) { return __ocml_nearbyint_f32(__x); }
364
266365__DEVICE__
267inline float nextafterf(float __x, float __y) {
366float nextafterf(float __x, float __y) {
268367 return __ocml_nextafter_f32(__x, __y);
269368}
369
270370__DEVICE__
271inline float norm3df(float __x, float __y, float __z) {
371float norm3df(float __x, float __y, float __z) {
272372 return __ocml_len3_f32(__x, __y, __z);
273373}
374
274375__DEVICE__
275inline float norm4df(float __x, float __y, float __z, float __w) {
376float norm4df(float __x, float __y, float __z, float __w) {
276377 return __ocml_len4_f32(__x, __y, __z, __w);
277378}
379
278380__DEVICE__
279inline float normcdff(float __x) { return __ocml_ncdf_f32(__x); }
381float normcdff(float __x) { return __ocml_ncdf_f32(__x); }
382
280383__DEVICE__
281inline float normcdfinvf(float __x) { return __ocml_ncdfinv_f32(__x); }
384float normcdfinvf(float __x) { return __ocml_ncdfinv_f32(__x); }
385
282386__DEVICE__
283inline float
284normf(int __dim,
285 const float *__a) { // TODO: placeholder until OCML adds support.
387float normf(int __dim,
388 const float *__a) { // TODO: placeholder until OCML adds support.
286389 float __r = 0;
287390 while (__dim--) {
288391 __r += __a[0] * __a[0];
......@@ -291,16 +394,23 @@ normf(int __dim,
291394
292395 return __ocml_sqrt_f32(__r);
293396}
397
294398__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
296404__DEVICE__
297inline float rcbrtf(float __x) { return __ocml_rcbrt_f32(__x); }
405float rcbrtf(float __x) { return __ocml_rcbrt_f32(__x); }
406
298407__DEVICE__
299inline float remainderf(float __x, float __y) {
408float remainderf(float __x, float __y) {
300409 return __ocml_remainder_f32(__x, __y);
301410}
411
302412__DEVICE__
303inline float remquof(float __x, float __y, int *__quo) {
413float remquof(float __x, float __y, int *__quo) {
304414 int __tmp;
305415 float __r = __ocml_remquo_f32(
306416 __x, __y, (__attribute__((address_space(5))) int *)&__tmp);
......@@ -308,25 +418,26 @@ inline float remquof(float __x, float __y, int *__quo) {
308418
309419 return __r;
310420}
421
311422__DEVICE__
312inline float rhypotf(float __x, float __y) {
313 return __ocml_rhypot_f32(__x, __y);
314}
423float rhypotf(float __x, float __y) { return __ocml_rhypot_f32(__x, __y); }
424
315425__DEVICE__
316inline float rintf(float __x) { return __ocml_rint_f32(__x); }
426float rintf(float __x) { return __ocml_rint_f32(__x); }
427
317428__DEVICE__
318inline float rnorm3df(float __x, float __y, float __z) {
429float rnorm3df(float __x, float __y, float __z) {
319430 return __ocml_rlen3_f32(__x, __y, __z);
320431}
321432
322433__DEVICE__
323inline float rnorm4df(float __x, float __y, float __z, float __w) {
434float rnorm4df(float __x, float __y, float __z, float __w) {
324435 return __ocml_rlen4_f32(__x, __y, __z, __w);
325436}
437
326438__DEVICE__
327inline float
328rnormf(int __dim,
329 const float *__a) { // TODO: placeholder until OCML adds support.
439float rnormf(int __dim,
440 const float *__a) { // TODO: placeholder until OCML adds support.
330441 float __r = 0;
331442 while (__dim--) {
332443 __r += __a[0] * __a[0];
......@@ -335,59 +446,74 @@ rnormf(int __dim,
335446
336447 return __ocml_rsqrt_f32(__r);
337448}
449
338450__DEVICE__
339inline float roundf(float __x) { return __ocml_round_f32(__x); }
451float roundf(float __x) { return __ocml_round_f32(__x); }
452
340453__DEVICE__
341inline float rsqrtf(float __x) { return __ocml_rsqrt_f32(__x); }
454float rsqrtf(float __x) { return __ocml_rsqrt_f32(__x); }
455
342456__DEVICE__
343inline float scalblnf(float __x, long int __n) {
457float scalblnf(float __x, long int __n) {
344458 return (__n < INT_MAX) ? __ocml_scalbn_f32(__x, __n)
345459 : __ocml_scalb_f32(__x, __n);
346460}
461
347462__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
349465__DEVICE__
350inline __RETURN_TYPE signbit(float __x) { return __ocml_signbit_f32(__x); }
466__RETURN_TYPE __signbitf(float __x) { return __ocml_signbit_f32(__x); }
467
351468__DEVICE__
352inline void sincosf(float __x, float *__sinptr, float *__cosptr) {
469void sincosf(float __x, float *__sinptr, float *__cosptr) {
353470 float __tmp;
354
355471 *__sinptr =
356472 __ocml_sincos_f32(__x, (__attribute__((address_space(5))) float *)&__tmp);
357473 *__cosptr = __tmp;
358474}
475
359476__DEVICE__
360inline void sincospif(float __x, float *__sinptr, float *__cosptr) {
477void sincospif(float __x, float *__sinptr, float *__cosptr) {
361478 float __tmp;
362
363479 *__sinptr = __ocml_sincospi_f32(
364480 __x, (__attribute__((address_space(5))) float *)&__tmp);
365481 *__cosptr = __tmp;
366482}
483
367484__DEVICE__
368inline float sinf(float __x) { return __ocml_sin_f32(__x); }
485float sinf(float __x) { return __ocml_sin_f32(__x); }
486
369487__DEVICE__
370inline float sinhf(float __x) { return __ocml_sinh_f32(__x); }
488float sinhf(float __x) { return __ocml_sinh_f32(__x); }
489
371490__DEVICE__
372inline float sinpif(float __x) { return __ocml_sinpi_f32(__x); }
491float sinpif(float __x) { return __ocml_sinpi_f32(__x); }
492
373493__DEVICE__
374inline float sqrtf(float __x) { return __ocml_sqrt_f32(__x); }
494float sqrtf(float __x) { return __ocml_sqrt_f32(__x); }
495
375496__DEVICE__
376inline float tanf(float __x) { return __ocml_tan_f32(__x); }
497float tanf(float __x) { return __ocml_tan_f32(__x); }
498
377499__DEVICE__
378inline float tanhf(float __x) { return __ocml_tanh_f32(__x); }
500float tanhf(float __x) { return __ocml_tanh_f32(__x); }
501
379502__DEVICE__
380inline float tgammaf(float __x) { return __ocml_tgamma_f32(__x); }
503float tgammaf(float __x) { return __ocml_tgamma_f32(__x); }
504
381505__DEVICE__
382inline float truncf(float __x) { return __ocml_trunc_f32(__x); }
506float truncf(float __x) { return __ocml_trunc_f32(__x); }
507
383508__DEVICE__
384inline float y0f(float __x) { return __ocml_y0_f32(__x); }
509float y0f(float __x) { return __ocml_y0_f32(__x); }
510
385511__DEVICE__
386inline float y1f(float __x) { return __ocml_y1_f32(__x); }
512float y1f(float __x) { return __ocml_y1_f32(__x); }
513
387514__DEVICE__
388inline float ynf(int __n,
389 float __x) { // TODO: we could use Ahmes multiplication
390 // and the Miller & Brown algorithm
515float ynf(int __n, float __x) { // TODO: we could use Ahmes multiplication
516 // and the Miller & Brown algorithm
391517 // for linear recurrences to get O(log n) steps, but it's unclear if
392518 // it'd be beneficial in this case. Placeholder until OCML adds
393519 // support.
......@@ -408,290 +534,343 @@ inline float ynf(int __n,
408534}
409535
410536// BEGIN INTRINSICS
537
411538__DEVICE__
412inline float __cosf(float __x) { return __ocml_native_cos_f32(__x); }
539float __cosf(float __x) { return __ocml_native_cos_f32(__x); }
540
413541__DEVICE__
414inline float __exp10f(float __x) { return __ocml_native_exp10_f32(__x); }
542float __exp10f(float __x) { return __ocml_native_exp10_f32(__x); }
543
415544__DEVICE__
416inline float __expf(float __x) { return __ocml_native_exp_f32(__x); }
545float __expf(float __x) { return __ocml_native_exp_f32(__x); }
546
417547#if defined OCML_BASIC_ROUNDED_OPERATIONS
418548__DEVICE__
419inline float __fadd_rd(float __x, float __y) {
420 return __ocml_add_rtn_f32(__x, __y);
421}
422#endif
549float __fadd_rd(float __x, float __y) { return __ocml_add_rtn_f32(__x, __y); }
423550__DEVICE__
424inline float __fadd_rn(float __x, float __y) { return __x + __y; }
425#if defined OCML_BASIC_ROUNDED_OPERATIONS
551float __fadd_rn(float __x, float __y) { return __ocml_add_rte_f32(__x, __y); }
426552__DEVICE__
427inline float __fadd_ru(float __x, float __y) {
428 return __ocml_add_rtp_f32(__x, __y);
429}
553float __fadd_ru(float __x, float __y) { return __ocml_add_rtp_f32(__x, __y); }
430554__DEVICE__
431inline float __fadd_rz(float __x, float __y) {
432 return __ocml_add_rtz_f32(__x, __y);
433}
555float __fadd_rz(float __x, float __y) { return __ocml_add_rtz_f32(__x, __y); }
556#else
434557__DEVICE__
435inline float __fdiv_rd(float __x, float __y) {
436 return __ocml_div_rtn_f32(__x, __y);
437}
558float __fadd_rn(float __x, float __y) { return __x + __y; }
438559#endif
439__DEVICE__
440inline float __fdiv_rn(float __x, float __y) { return __x / __y; }
560
441561#if defined OCML_BASIC_ROUNDED_OPERATIONS
442562__DEVICE__
443inline float __fdiv_ru(float __x, float __y) {
444 return __ocml_div_rtp_f32(__x, __y);
445}
563float __fdiv_rd(float __x, float __y) { return __ocml_div_rtn_f32(__x, __y); }
446564__DEVICE__
447inline float __fdiv_rz(float __x, float __y) {
448 return __ocml_div_rtz_f32(__x, __y);
449}
565float __fdiv_rn(float __x, float __y) { return __ocml_div_rte_f32(__x, __y); }
566__DEVICE__
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; }
450573#endif
574
451575__DEVICE__
452inline float __fdividef(float __x, float __y) { return __x / __y; }
576float __fdividef(float __x, float __y) { return __x / __y; }
577
453578#if defined OCML_BASIC_ROUNDED_OPERATIONS
454579__DEVICE__
455inline float __fmaf_rd(float __x, float __y, float __z) {
580float __fmaf_rd(float __x, float __y, float __z) {
456581 return __ocml_fma_rtn_f32(__x, __y, __z);
457582}
458#endif
459583__DEVICE__
460inline float __fmaf_rn(float __x, float __y, float __z) {
461 return __ocml_fma_f32(__x, __y, __z);
584float __fmaf_rn(float __x, float __y, float __z) {
585 return __ocml_fma_rte_f32(__x, __y, __z);
462586}
463#if defined OCML_BASIC_ROUNDED_OPERATIONS
464587__DEVICE__
465inline float __fmaf_ru(float __x, float __y, float __z) {
588float __fmaf_ru(float __x, float __y, float __z) {
466589 return __ocml_fma_rtp_f32(__x, __y, __z);
467590}
468591__DEVICE__
469inline float __fmaf_rz(float __x, float __y, float __z) {
592float __fmaf_rz(float __x, float __y, float __z) {
470593 return __ocml_fma_rtz_f32(__x, __y, __z);
471594}
595#else
472596__DEVICE__
473inline float __fmul_rd(float __x, float __y) {
474 return __ocml_mul_rtn_f32(__x, __y);
597float __fmaf_rn(float __x, float __y, float __z) {
598 return __ocml_fma_f32(__x, __y, __z);
475599}
476600#endif
477__DEVICE__
478inline float __fmul_rn(float __x, float __y) { return __x * __y; }
601
479602#if defined OCML_BASIC_ROUNDED_OPERATIONS
480603__DEVICE__
481inline float __fmul_ru(float __x, float __y) {
482 return __ocml_mul_rtp_f32(__x, __y);
483}
604float __fmul_rd(float __x, float __y) { return __ocml_mul_rtn_f32(__x, __y); }
484605__DEVICE__
485inline float __fmul_rz(float __x, float __y) {
486 return __ocml_mul_rtz_f32(__x, __y);
487}
606float __fmul_rn(float __x, float __y) { return __ocml_mul_rte_f32(__x, __y); }
488607__DEVICE__
489inline float __frcp_rd(float __x) { return __llvm_amdgcn_rcp_f32(__x); }
490#endif
608float __fmul_ru(float __x, float __y) { return __ocml_mul_rtp_f32(__x, __y); }
609__DEVICE__
610float __fmul_rz(float __x, float __y) { return __ocml_mul_rtz_f32(__x, __y); }
611#else
491612__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
493616#if defined OCML_BASIC_ROUNDED_OPERATIONS
494617__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); }
496619__DEVICE__
497inline float __frcp_rz(float __x) { return __llvm_amdgcn_rcp_f32(__x); }
498#endif
620float __frcp_rn(float __x) { return __ocml_div_rte_f32(1.0f, __x); }
499621__DEVICE__
500inline float __frsqrt_rn(float __x) { return __llvm_amdgcn_rsq_f32(__x); }
501#if defined OCML_BASIC_ROUNDED_OPERATIONS
622float __frcp_ru(float __x) { return __ocml_div_rtp_f32(1.0f, __x); }
623__DEVICE__
624float __frcp_rz(float __x) { return __ocml_div_rtz_f32(1.0f, __x); }
625#else
502626__DEVICE__
503inline float __fsqrt_rd(float __x) { return __ocml_sqrt_rtn_f32(__x); }
627float __frcp_rn(float __x) { return 1.0f / __x; }
504628#endif
629
505630__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
507633#if defined OCML_BASIC_ROUNDED_OPERATIONS
508634__DEVICE__
509inline float __fsqrt_ru(float __x) { return __ocml_sqrt_rtp_f32(__x); }
635float __fsqrt_rd(float __x) { return __ocml_sqrt_rtn_f32(__x); }
510636__DEVICE__
511inline float __fsqrt_rz(float __x) { return __ocml_sqrt_rtz_f32(__x); }
637float __fsqrt_rn(float __x) { return __ocml_sqrt_rte_f32(__x); }
512638__DEVICE__
513inline float __fsub_rd(float __x, float __y) {
514 return __ocml_sub_rtn_f32(__x, __y);
515}
516#endif
639float __fsqrt_ru(float __x) { return __ocml_sqrt_rtp_f32(__x); }
640__DEVICE__
641float __fsqrt_rz(float __x) { return __ocml_sqrt_rtz_f32(__x); }
642#else
517643__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
519647#if defined OCML_BASIC_ROUNDED_OPERATIONS
520648__DEVICE__
521inline float __fsub_ru(float __x, float __y) {
522 return __ocml_sub_rtp_f32(__x, __y);
523}
649float __fsub_rd(float __x, float __y) { return __ocml_sub_rtn_f32(__x, __y); }
524650__DEVICE__
525inline float __fsub_rz(float __x, float __y) {
526 return __ocml_sub_rtz_f32(__x, __y);
527}
651float __fsub_rn(float __x, float __y) { return __ocml_sub_rte_f32(__x, __y); }
652__DEVICE__
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; }
528659#endif
660
529661__DEVICE__
530inline float __log10f(float __x) { return __ocml_native_log10_f32(__x); }
662float __log10f(float __x) { return __ocml_native_log10_f32(__x); }
663
531664__DEVICE__
532inline float __log2f(float __x) { return __ocml_native_log2_f32(__x); }
665float __log2f(float __x) { return __ocml_native_log2_f32(__x); }
666
533667__DEVICE__
534inline float __logf(float __x) { return __ocml_native_log_f32(__x); }
668float __logf(float __x) { return __ocml_native_log_f32(__x); }
669
535670__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
537673__DEVICE__
538inline float __saturatef(float __x) {
539 return (__x < 0) ? 0 : ((__x > 1) ? 1 : __x);
540}
674float __saturatef(float __x) { return (__x < 0) ? 0 : ((__x > 1) ? 1 : __x); }
675
541676__DEVICE__
542inline void __sincosf(float __x, float *__sinptr, float *__cosptr) {
677void __sincosf(float __x, float *__sinptr, float *__cosptr) {
543678 *__sinptr = __ocml_native_sin_f32(__x);
544679 *__cosptr = __ocml_native_cos_f32(__x);
545680}
681
546682__DEVICE__
547inline float __sinf(float __x) { return __ocml_native_sin_f32(__x); }
683float __sinf(float __x) { return __ocml_native_sin_f32(__x); }
684
548685__DEVICE__
549inline float __tanf(float __x) { return __ocml_tan_f32(__x); }
686float __tanf(float __x) { return __ocml_tan_f32(__x); }
550687// END INTRINSICS
551688// END FLOAT
552689
553690// BEGIN DOUBLE
554691__DEVICE__
555inline double abs(double __x) { return __ocml_fabs_f64(__x); }
556__DEVICE__
557inline double acos(double __x) { return __ocml_acos_f64(__x); }
692double acos(double __x) { return __ocml_acos_f64(__x); }
693
558694__DEVICE__
559inline double acosh(double __x) { return __ocml_acosh_f64(__x); }
695double acosh(double __x) { return __ocml_acosh_f64(__x); }
696
560697__DEVICE__
561inline double asin(double __x) { return __ocml_asin_f64(__x); }
698double asin(double __x) { return __ocml_asin_f64(__x); }
699
562700__DEVICE__
563inline double asinh(double __x) { return __ocml_asinh_f64(__x); }
701double asinh(double __x) { return __ocml_asinh_f64(__x); }
702
564703__DEVICE__
565inline double atan(double __x) { return __ocml_atan_f64(__x); }
704double atan(double __x) { return __ocml_atan_f64(__x); }
705
566706__DEVICE__
567inline double atan2(double __x, double __y) {
568 return __ocml_atan2_f64(__x, __y);
569}
707double atan2(double __x, double __y) { return __ocml_atan2_f64(__x, __y); }
708
570709__DEVICE__
571inline double atanh(double __x) { return __ocml_atanh_f64(__x); }
710double atanh(double __x) { return __ocml_atanh_f64(__x); }
711
572712__DEVICE__
573inline double cbrt(double __x) { return __ocml_cbrt_f64(__x); }
713double cbrt(double __x) { return __ocml_cbrt_f64(__x); }
714
574715__DEVICE__
575inline double ceil(double __x) { return __ocml_ceil_f64(__x); }
716double ceil(double __x) { return __ocml_ceil_f64(__x); }
717
576718__DEVICE__
577inline double copysign(double __x, double __y) {
719double copysign(double __x, double __y) {
578720 return __ocml_copysign_f64(__x, __y);
579721}
722
580723__DEVICE__
581inline double cos(double __x) { return __ocml_cos_f64(__x); }
724double cos(double __x) { return __ocml_cos_f64(__x); }
725
582726__DEVICE__
583inline double cosh(double __x) { return __ocml_cosh_f64(__x); }
727double cosh(double __x) { return __ocml_cosh_f64(__x); }
728
584729__DEVICE__
585inline double cospi(double __x) { return __ocml_cospi_f64(__x); }
730double cospi(double __x) { return __ocml_cospi_f64(__x); }
731
586732__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
588735__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
590738__DEVICE__
591inline double erf(double __x) { return __ocml_erf_f64(__x); }
739double erf(double __x) { return __ocml_erf_f64(__x); }
740
592741__DEVICE__
593inline double erfc(double __x) { return __ocml_erfc_f64(__x); }
742double erfc(double __x) { return __ocml_erfc_f64(__x); }
743
594744__DEVICE__
595inline double erfcinv(double __x) { return __ocml_erfcinv_f64(__x); }
745double erfcinv(double __x) { return __ocml_erfcinv_f64(__x); }
746
596747__DEVICE__
597inline double erfcx(double __x) { return __ocml_erfcx_f64(__x); }
748double erfcx(double __x) { return __ocml_erfcx_f64(__x); }
749
598750__DEVICE__
599inline double erfinv(double __x) { return __ocml_erfinv_f64(__x); }
751double erfinv(double __x) { return __ocml_erfinv_f64(__x); }
752
600753__DEVICE__
601inline double exp(double __x) { return __ocml_exp_f64(__x); }
754double exp(double __x) { return __ocml_exp_f64(__x); }
755
602756__DEVICE__
603inline double exp10(double __x) { return __ocml_exp10_f64(__x); }
757double exp10(double __x) { return __ocml_exp10_f64(__x); }
758
604759__DEVICE__
605inline double exp2(double __x) { return __ocml_exp2_f64(__x); }
760double exp2(double __x) { return __ocml_exp2_f64(__x); }
761
606762__DEVICE__
607inline double expm1(double __x) { return __ocml_expm1_f64(__x); }
763double expm1(double __x) { return __ocml_expm1_f64(__x); }
764
608765__DEVICE__
609inline double fabs(double __x) { return __ocml_fabs_f64(__x); }
766double fabs(double __x) { return __ocml_fabs_f64(__x); }
767
610768__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
612771__DEVICE__
613inline double floor(double __x) { return __ocml_floor_f64(__x); }
772double floor(double __x) { return __ocml_floor_f64(__x); }
773
614774__DEVICE__
615inline double fma(double __x, double __y, double __z) {
775double fma(double __x, double __y, double __z) {
616776 return __ocml_fma_f64(__x, __y, __z);
617777}
778
618779__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
620782__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
622785__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
624788__DEVICE__
625inline double frexp(double __x, int *__nptr) {
789double frexp(double __x, int *__nptr) {
626790 int __tmp;
627791 double __r =
628792 __ocml_frexp_f64(__x, (__attribute__((address_space(5))) int *)&__tmp);
629793 *__nptr = __tmp;
630
631794 return __r;
632795}
796
633797__DEVICE__
634inline double hypot(double __x, double __y) {
635 return __ocml_hypot_f64(__x, __y);
636}
798double hypot(double __x, double __y) { return __ocml_hypot_f64(__x, __y); }
799
637800__DEVICE__
638inline int ilogb(double __x) { return __ocml_ilogb_f64(__x); }
801int ilogb(double __x) { return __ocml_ilogb_f64(__x); }
802
639803__DEVICE__
640inline __RETURN_TYPE isfinite(double __x) { return __ocml_isfinite_f64(__x); }
804__RETURN_TYPE __finite(double __x) { return __ocml_isfinite_f64(__x); }
805
641806__DEVICE__
642inline __RETURN_TYPE isinf(double __x) { return __ocml_isinf_f64(__x); }
807__RETURN_TYPE __isinf(double __x) { return __ocml_isinf_f64(__x); }
808
643809__DEVICE__
644inline __RETURN_TYPE isnan(double __x) { return __ocml_isnan_f64(__x); }
810__RETURN_TYPE __isnan(double __x) { return __ocml_isnan_f64(__x); }
811
645812__DEVICE__
646inline double j0(double __x) { return __ocml_j0_f64(__x); }
813double j0(double __x) { return __ocml_j0_f64(__x); }
814
647815__DEVICE__
648inline double j1(double __x) { return __ocml_j1_f64(__x); }
816double j1(double __x) { return __ocml_j1_f64(__x); }
817
649818__DEVICE__
650inline double jn(int __n,
651 double __x) { // TODO: we could use Ahmes multiplication
652 // and the Miller & Brown algorithm
819double jn(int __n, double __x) { // TODO: we could use Ahmes multiplication
820 // and the Miller & Brown algorithm
653821 // for linear recurrences to get O(log n) steps, but it's unclear if
654822 // it'd be beneficial in this case. Placeholder until OCML adds
655823 // support.
656824 if (__n == 0)
657 return j0f(__x);
825 return j0(__x);
658826 if (__n == 1)
659 return j1f(__x);
827 return j1(__x);
660828
661 double __x0 = j0f(__x);
662 double __x1 = j1f(__x);
829 double __x0 = j0(__x);
830 double __x1 = j1(__x);
663831 for (int __i = 1; __i < __n; ++__i) {
664832 double __x2 = (2 * __i) / __x * __x1 - __x0;
665833 __x0 = __x1;
666834 __x1 = __x2;
667835 }
668
669836 return __x1;
670837}
838
671839__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
673842__DEVICE__
674inline double lgamma(double __x) { return __ocml_lgamma_f64(__x); }
843double lgamma(double __x) { return __ocml_lgamma_f64(__x); }
844
675845__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
677848__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
679851__DEVICE__
680inline double log(double __x) { return __ocml_log_f64(__x); }
852double log(double __x) { return __ocml_log_f64(__x); }
853
681854__DEVICE__
682inline double log10(double __x) { return __ocml_log10_f64(__x); }
855double log10(double __x) { return __ocml_log10_f64(__x); }
856
683857__DEVICE__
684inline double log1p(double __x) { return __ocml_log1p_f64(__x); }
858double log1p(double __x) { return __ocml_log1p_f64(__x); }
859
685860__DEVICE__
686inline double log2(double __x) { return __ocml_log2_f64(__x); }
861double log2(double __x) { return __ocml_log2_f64(__x); }
862
687863__DEVICE__
688inline double logb(double __x) { return __ocml_logb_f64(__x); }
864double logb(double __x) { return __ocml_logb_f64(__x); }
865
689866__DEVICE__
690inline long int lrint(double __x) { return __ocml_rint_f64(__x); }
867long int lrint(double __x) { return __ocml_rint_f64(__x); }
868
691869__DEVICE__
692inline long int lround(double __x) { return __ocml_round_f64(__x); }
870long int lround(double __x) { return __ocml_round_f64(__x); }
871
693872__DEVICE__
694inline double modf(double __x, double *__iptr) {
873double modf(double __x, double *__iptr) {
695874 double __tmp;
696875 double __r =
697876 __ocml_modf_f64(__x, (__attribute__((address_space(5))) double *)&__tmp);
......@@ -699,8 +878,9 @@ inline double modf(double __x, double *__iptr) {
699878
700879 return __r;
701880}
881
702882__DEVICE__
703inline double nan(const char *__tagp) {
883double nan(const char *__tagp) {
704884#if !_WIN32
705885 union {
706886 double val;
......@@ -710,8 +890,8 @@ inline double nan(const char *__tagp) {
710890 uint32_t exponent : 11;
711891 uint32_t sign : 1;
712892 } bits;
713 static_assert(sizeof(double) == sizeof(ieee_double), "");
714893 } __tmp;
894 __static_assert_type_size_equal(sizeof(__tmp.val), sizeof(__tmp.bits));
715895
716896 __tmp.bits.sign = 0u;
717897 __tmp.bits.exponent = ~0u;
......@@ -720,22 +900,24 @@ inline double nan(const char *__tagp) {
720900
721901 return __tmp.val;
722902#else
723 static_assert(sizeof(uint64_t) == sizeof(double));
724 uint64_t val = __make_mantissa(__tagp);
725 val |= 0xFFF << 51;
726 return *reinterpret_cast<double *>(&val);
903 __static_assert_type_size_equal(sizeof(uint64_t), sizeof(double));
904 uint64_t __val = __make_mantissa(__tagp);
905 __val |= 0xFFF << 51;
906 return *reinterpret_cast<double *>(&__val);
727907#endif
728908}
909
729910__DEVICE__
730inline double nearbyint(double __x) { return __ocml_nearbyint_f64(__x); }
911double nearbyint(double __x) { return __ocml_nearbyint_f64(__x); }
912
731913__DEVICE__
732inline double nextafter(double __x, double __y) {
914double nextafter(double __x, double __y) {
733915 return __ocml_nextafter_f64(__x, __y);
734916}
917
735918__DEVICE__
736inline double
737norm(int __dim,
738 const double *__a) { // TODO: placeholder until OCML adds support.
919double norm(int __dim,
920 const double *__a) { // TODO: placeholder until OCML adds support.
739921 double __r = 0;
740922 while (__dim--) {
741923 __r += __a[0] * __a[0];
......@@ -744,28 +926,39 @@ norm(int __dim,
744926
745927 return __ocml_sqrt_f64(__r);
746928}
929
747930__DEVICE__
748inline double norm3d(double __x, double __y, double __z) {
931double norm3d(double __x, double __y, double __z) {
749932 return __ocml_len3_f64(__x, __y, __z);
750933}
934
751935__DEVICE__
752inline double norm4d(double __x, double __y, double __z, double __w) {
936double norm4d(double __x, double __y, double __z, double __w) {
753937 return __ocml_len4_f64(__x, __y, __z, __w);
754938}
939
940__DEVICE__
941double normcdf(double __x) { return __ocml_ncdf_f64(__x); }
942
755943__DEVICE__
756inline double normcdf(double __x) { return __ocml_ncdf_f64(__x); }
944double normcdfinv(double __x) { return __ocml_ncdfinv_f64(__x); }
945
757946__DEVICE__
758inline double normcdfinv(double __x) { return __ocml_ncdfinv_f64(__x); }
947double pow(double __x, double __y) { return __ocml_pow_f64(__x, __y); }
948
759949__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
761952__DEVICE__
762inline double rcbrt(double __x) { return __ocml_rcbrt_f64(__x); }
953double rcbrt(double __x) { return __ocml_rcbrt_f64(__x); }
954
763955__DEVICE__
764inline double remainder(double __x, double __y) {
956double remainder(double __x, double __y) {
765957 return __ocml_remainder_f64(__x, __y);
766958}
959
767960__DEVICE__
768inline double remquo(double __x, double __y, int *__quo) {
961double remquo(double __x, double __y, int *__quo) {
769962 int __tmp;
770963 double __r = __ocml_remquo_f64(
771964 __x, __y, (__attribute__((address_space(5))) int *)&__tmp);
......@@ -773,16 +966,16 @@ inline double remquo(double __x, double __y, int *__quo) {
773966
774967 return __r;
775968}
969
776970__DEVICE__
777inline double rhypot(double __x, double __y) {
778 return __ocml_rhypot_f64(__x, __y);
779}
971double rhypot(double __x, double __y) { return __ocml_rhypot_f64(__x, __y); }
972
780973__DEVICE__
781inline double rint(double __x) { return __ocml_rint_f64(__x); }
974double rint(double __x) { return __ocml_rint_f64(__x); }
975
782976__DEVICE__
783inline double
784rnorm(int __dim,
785 const double *__a) { // TODO: placeholder until OCML adds support.
977double rnorm(int __dim,
978 const double *__a) { // TODO: placeholder until OCML adds support.
786979 double __r = 0;
787980 while (__dim--) {
788981 __r += __a[0] * __a[0];
......@@ -791,77 +984,93 @@ rnorm(int __dim,
791984
792985 return __ocml_rsqrt_f64(__r);
793986}
987
794988__DEVICE__
795inline double rnorm3d(double __x, double __y, double __z) {
989double rnorm3d(double __x, double __y, double __z) {
796990 return __ocml_rlen3_f64(__x, __y, __z);
797991}
992
798993__DEVICE__
799inline double rnorm4d(double __x, double __y, double __z, double __w) {
994double rnorm4d(double __x, double __y, double __z, double __w) {
800995 return __ocml_rlen4_f64(__x, __y, __z, __w);
801996}
997
802998__DEVICE__
803inline double round(double __x) { return __ocml_round_f64(__x); }
999double round(double __x) { return __ocml_round_f64(__x); }
1000
8041001__DEVICE__
805inline double rsqrt(double __x) { return __ocml_rsqrt_f64(__x); }
1002double rsqrt(double __x) { return __ocml_rsqrt_f64(__x); }
1003
8061004__DEVICE__
807inline double scalbln(double __x, long int __n) {
1005double scalbln(double __x, long int __n) {
8081006 return (__n < INT_MAX) ? __ocml_scalbn_f64(__x, __n)
8091007 : __ocml_scalb_f64(__x, __n);
8101008}
8111009__DEVICE__
812inline double scalbn(double __x, int __n) {
813 return __ocml_scalbn_f64(__x, __n);
814}
1010double scalbn(double __x, int __n) { return __ocml_scalbn_f64(__x, __n); }
1011
8151012__DEVICE__
816inline __RETURN_TYPE signbit(double __x) { return __ocml_signbit_f64(__x); }
1013__RETURN_TYPE __signbit(double __x) { return __ocml_signbit_f64(__x); }
1014
8171015__DEVICE__
818inline double sin(double __x) { return __ocml_sin_f64(__x); }
1016double sin(double __x) { return __ocml_sin_f64(__x); }
1017
8191018__DEVICE__
820inline void sincos(double __x, double *__sinptr, double *__cosptr) {
1019void sincos(double __x, double *__sinptr, double *__cosptr) {
8211020 double __tmp;
8221021 *__sinptr = __ocml_sincos_f64(
8231022 __x, (__attribute__((address_space(5))) double *)&__tmp);
8241023 *__cosptr = __tmp;
8251024}
1025
8261026__DEVICE__
827inline void sincospi(double __x, double *__sinptr, double *__cosptr) {
1027void sincospi(double __x, double *__sinptr, double *__cosptr) {
8281028 double __tmp;
8291029 *__sinptr = __ocml_sincospi_f64(
8301030 __x, (__attribute__((address_space(5))) double *)&__tmp);
8311031 *__cosptr = __tmp;
8321032}
1033
8331034__DEVICE__
834inline double sinh(double __x) { return __ocml_sinh_f64(__x); }
1035double sinh(double __x) { return __ocml_sinh_f64(__x); }
1036
8351037__DEVICE__
836inline double sinpi(double __x) { return __ocml_sinpi_f64(__x); }
1038double sinpi(double __x) { return __ocml_sinpi_f64(__x); }
1039
8371040__DEVICE__
838inline double sqrt(double __x) { return __ocml_sqrt_f64(__x); }
1041double sqrt(double __x) { return __ocml_sqrt_f64(__x); }
1042
8391043__DEVICE__
840inline double tan(double __x) { return __ocml_tan_f64(__x); }
1044double tan(double __x) { return __ocml_tan_f64(__x); }
1045
8411046__DEVICE__
842inline double tanh(double __x) { return __ocml_tanh_f64(__x); }
1047double tanh(double __x) { return __ocml_tanh_f64(__x); }
1048
8431049__DEVICE__
844inline double tgamma(double __x) { return __ocml_tgamma_f64(__x); }
1050double tgamma(double __x) { return __ocml_tgamma_f64(__x); }
1051
8451052__DEVICE__
846inline double trunc(double __x) { return __ocml_trunc_f64(__x); }
1053double trunc(double __x) { return __ocml_trunc_f64(__x); }
1054
8471055__DEVICE__
848inline double y0(double __x) { return __ocml_y0_f64(__x); }
1056double y0(double __x) { return __ocml_y0_f64(__x); }
1057
8491058__DEVICE__
850inline double y1(double __x) { return __ocml_y1_f64(__x); }
1059double y1(double __x) { return __ocml_y1_f64(__x); }
1060
8511061__DEVICE__
852inline double yn(int __n,
853 double __x) { // TODO: we could use Ahmes multiplication
854 // and the Miller & Brown algorithm
1062double yn(int __n, double __x) { // TODO: we could use Ahmes multiplication
1063 // and the Miller & Brown algorithm
8551064 // for linear recurrences to get O(log n) steps, but it's unclear if
8561065 // it'd be beneficial in this case. Placeholder until OCML adds
8571066 // support.
8581067 if (__n == 0)
859 return j0f(__x);
1068 return y0(__x);
8601069 if (__n == 1)
861 return j1f(__x);
1070 return y1(__x);
8621071
863 double __x0 = j0f(__x);
864 double __x1 = j1f(__x);
1072 double __x0 = y0(__x);
1073 double __x1 = y1(__x);
8651074 for (int __i = 1; __i < __n; ++__i) {
8661075 double __x2 = (2 * __i) / __x * __x1 - __x0;
8671076 __x0 = __x1;
......@@ -874,296 +1083,182 @@ inline double yn(int __n,
8741083// BEGIN INTRINSICS
8751084#if defined OCML_BASIC_ROUNDED_OPERATIONS
8761085__DEVICE__
877inline double __dadd_rd(double __x, double __y) {
1086double __dadd_rd(double __x, double __y) {
8781087 return __ocml_add_rtn_f64(__x, __y);
8791088}
880#endif
8811089__DEVICE__
882inline double __dadd_rn(double __x, double __y) { return __x + __y; }
883#if defined OCML_BASIC_ROUNDED_OPERATIONS
1090double __dadd_rn(double __x, double __y) {
1091 return __ocml_add_rte_f64(__x, __y);
1092}
8841093__DEVICE__
885inline double __dadd_ru(double __x, double __y) {
1094double __dadd_ru(double __x, double __y) {
8861095 return __ocml_add_rtp_f64(__x, __y);
8871096}
8881097__DEVICE__
889inline double __dadd_rz(double __x, double __y) {
1098double __dadd_rz(double __x, double __y) {
8901099 return __ocml_add_rtz_f64(__x, __y);
8911100}
1101#else
8921102__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) {
8941109 return __ocml_div_rtn_f64(__x, __y);
8951110}
896#endif
8971111__DEVICE__
898inline double __ddiv_rn(double __x, double __y) { return __x / __y; }
899#if defined OCML_BASIC_ROUNDED_OPERATIONS
1112double __ddiv_rn(double __x, double __y) {
1113 return __ocml_div_rte_f64(__x, __y);
1114}
9001115__DEVICE__
901inline double __ddiv_ru(double __x, double __y) {
1116double __ddiv_ru(double __x, double __y) {
9021117 return __ocml_div_rtp_f64(__x, __y);
9031118}
9041119__DEVICE__
905inline double __ddiv_rz(double __x, double __y) {
1120double __ddiv_rz(double __x, double __y) {
9061121 return __ocml_div_rtz_f64(__x, __y);
9071122}
1123#else
1124__DEVICE__
1125double __ddiv_rn(double __x, double __y) { return __x / __y; }
1126#endif
1127
1128#if defined OCML_BASIC_ROUNDED_OPERATIONS
9081129__DEVICE__
909inline double __dmul_rd(double __x, double __y) {
1130double __dmul_rd(double __x, double __y) {
9101131 return __ocml_mul_rtn_f64(__x, __y);
9111132}
912#endif
9131133__DEVICE__
914inline double __dmul_rn(double __x, double __y) { return __x * __y; }
915#if defined OCML_BASIC_ROUNDED_OPERATIONS
1134double __dmul_rn(double __x, double __y) {
1135 return __ocml_mul_rte_f64(__x, __y);
1136}
9161137__DEVICE__
917inline double __dmul_ru(double __x, double __y) {
1138double __dmul_ru(double __x, double __y) {
9181139 return __ocml_mul_rtp_f64(__x, __y);
9191140}
9201141__DEVICE__
921inline double __dmul_rz(double __x, double __y) {
1142double __dmul_rz(double __x, double __y) {
9221143 return __ocml_mul_rtz_f64(__x, __y);
9231144}
1145#else
9241146__DEVICE__
925inline double __drcp_rd(double __x) { return __llvm_amdgcn_rcp_f64(__x); }
1147double __dmul_rn(double __x, double __y) { return __x * __y; }
9261148#endif
927__DEVICE__
928inline double __drcp_rn(double __x) { return __llvm_amdgcn_rcp_f64(__x); }
1149
9291150#if defined OCML_BASIC_ROUNDED_OPERATIONS
9301151__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); }
9321153__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); }
9341155__DEVICE__
935inline double __dsqrt_rd(double __x) { return __ocml_sqrt_rtn_f64(__x); }
936#endif
1156double __drcp_ru(double __x) { return __ocml_div_rtp_f64(1.0, __x); }
9371157__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
9391164#if defined OCML_BASIC_ROUNDED_OPERATIONS
9401165__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); }
9421171__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
9441179__DEVICE__
945inline double __dsub_rd(double __x, double __y) {
1180double __dsub_rd(double __x, double __y) {
9461181 return __ocml_sub_rtn_f64(__x, __y);
9471182}
948#endif
9491183__DEVICE__
950inline double __dsub_rn(double __x, double __y) { return __x - __y; }
951#if defined OCML_BASIC_ROUNDED_OPERATIONS
1184double __dsub_rn(double __x, double __y) {
1185 return __ocml_sub_rte_f64(__x, __y);
1186}
9521187__DEVICE__
953inline double __dsub_ru(double __x, double __y) {
1188double __dsub_ru(double __x, double __y) {
9541189 return __ocml_sub_rtp_f64(__x, __y);
9551190}
9561191__DEVICE__
957inline double __dsub_rz(double __x, double __y) {
1192double __dsub_rz(double __x, double __y) {
9581193 return __ocml_sub_rtz_f64(__x, __y);
9591194}
1195#else
1196__DEVICE__
1197double __dsub_rn(double __x, double __y) { return __x - __y; }
1198#endif
1199
1200#if defined OCML_BASIC_ROUNDED_OPERATIONS
9601201__DEVICE__
961inline double __fma_rd(double __x, double __y, double __z) {
1202double __fma_rd(double __x, double __y, double __z) {
9621203 return __ocml_fma_rtn_f64(__x, __y, __z);
9631204}
964#endif
9651205__DEVICE__
966inline double __fma_rn(double __x, double __y, double __z) {
967 return __ocml_fma_f64(__x, __y, __z);
1206double __fma_rn(double __x, double __y, double __z) {
1207 return __ocml_fma_rte_f64(__x, __y, __z);
9681208}
969#if defined OCML_BASIC_ROUNDED_OPERATIONS
9701209__DEVICE__
971inline double __fma_ru(double __x, double __y, double __z) {
1210double __fma_ru(double __x, double __y, double __z) {
9721211 return __ocml_fma_rtp_f64(__x, __y, __z);
9731212}
9741213__DEVICE__
975inline double __fma_rz(double __x, double __y, double __z) {
1214double __fma_rz(double __x, double __y, double __z) {
9761215 return __ocml_fma_rtz_f64(__x, __y, __z);
9771216}
1217#else
1218__DEVICE__
1219double __fma_rn(double __x, double __y, double __z) {
1220 return __ocml_fma_f64(__x, __y, __z);
1221}
9781222#endif
9791223// END INTRINSICS
9801224// END DOUBLE
9811225
982// BEGIN INTEGER
983__DEVICE__
984inline int abs(int __x) {
985 int __sgn = __x >> (sizeof(int) * CHAR_BIT - 1);
986 return (__x ^ __sgn) - __sgn;
987}
988__DEVICE__
989inline long labs(long __x) {
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}
1226// C only macros
1227#if !defined(__cplusplus) && __STDC_VERSION__ >= 201112L
1228#define isfinite(__x) _Generic((__x), float : __finitef, double : __finite)(__x)
1229#define isinf(__x) _Generic((__x), float : __isinff, double : __isinf)(__x)
1230#define isnan(__x) _Generic((__x), float : __isnanf, double : __isnan)(__x)
1231#define signbit(__x) \
1232 _Generic((__x), float : __signbitf, double : __signbit)(__x)
1233#endif // !defined(__cplusplus) && __STDC_VERSION__ >= 201112L
9981234
9991235#if defined(__cplusplus)
1000__DEVICE__
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) {
1236template <class T> __DEVICE__ T min(T __arg1, T __arg2) {
11391237 return (__arg1 < __arg2) ? __arg1 : __arg2;
11401238}
11411239
1142template <class T> __DEVICE__ inline T max(T __arg1, T __arg2) {
1240template <class T> __DEVICE__ T max(T __arg1, T __arg2) {
11431241 return (__arg1 > __arg2) ? __arg1 : __arg2;
11441242}
11451243
1146__DEVICE__ inline int min(int __arg1, int __arg2) {
1244__DEVICE__ int min(int __arg1, int __arg2) {
11471245 return (__arg1 < __arg2) ? __arg1 : __arg2;
11481246}
1149__DEVICE__ inline int max(int __arg1, int __arg2) {
1247__DEVICE__ int max(int __arg1, int __arg2) {
11501248 return (__arg1 > __arg2) ? __arg1 : __arg2;
11511249}
11521250
11531251__DEVICE__
1154inline float max(float __x, float __y) { return fmaxf(__x, __y); }
1252float max(float __x, float __y) { return fmaxf(__x, __y); }
11551253
11561254__DEVICE__
1157inline double max(double __x, double __y) { return fmax(__x, __y); }
1255double max(double __x, double __y) { return fmax(__x, __y); }
11581256
11591257__DEVICE__
1160inline float min(float __x, float __y) { return fminf(__x, __y); }
1258float min(float __x, float __y) { return fminf(__x, __y); }
11611259
11621260__DEVICE__
1163inline double min(double __x, double __y) { return fmin(__x, __y); }
1164
1165__HIP_OVERLOAD2(double, max)
1166__HIP_OVERLOAD2(double, min)
1261double min(double __x, double __y) { return fmin(__x, __y); }
11671262
11681263__host__ inline static int min(int __arg1, int __arg2) {
11691264 return std::min(__arg1, __arg2);
......@@ -1172,13 +1267,8 @@ __host__ inline static int min(int __arg1, int __arg2) {
11721267__host__ inline static int max(int __arg1, int __arg2) {
11731268 return std::max(__arg1, __arg2);
11741269}
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")
11821272#pragma pop_macro("__DEVICE__")
11831273#pragma pop_macro("__RETURN_TYPE")
11841274
lib/include/__clang_hip_runtime_wrapper.h+5
......@@ -28,6 +28,10 @@
2828#define __shared__ __attribute__((shared))
2929#define __constant__ __attribute__((constant))
3030
31#if !defined(__cplusplus) || __cplusplus < 201103L
32 #define nullptr NULL;
33#endif
34
3135#if __HIP_ENABLE_DEVICE_MALLOC__
3236extern "C" __device__ void *__hip_malloc(size_t __size);
3337extern "C" __device__ void *__hip_free(void *__ptr);
......@@ -51,6 +55,7 @@ static inline __device__ void *free(void *__ptr) {
5155
5256#if !_OPENMP || __HIP_ENABLE_CUDA_WRAPPER_FOR_OPENMP__
5357#include <__clang_cuda_math_forward_declares.h>
58#include <__clang_hip_cmath.h>
5459#include <__clang_cuda_complex_builtins.h>
5560
5661#include <algorithm>
lib/include/altivec.h+1143-72
......@@ -1709,6 +1709,20 @@ vec_cmpeq(vector double __a, vector double __b) {
17091709}
17101710#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
17121726#ifdef __POWER9_VECTOR__
17131727/* vec_cmpne */
17141728
......@@ -1766,35 +1780,25 @@ vec_cmpne(vector unsigned int __a, vector unsigned int __b) {
17661780 (vector int)__b);
17671781}
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
17871783static __inline__ vector bool int __ATTRS_o_ai
17881784vec_cmpne(vector float __a, vector float __b) {
17891785 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
17901786 (vector int)__b);
17911787}
17921788
1793static __inline__ vector bool long long __ATTRS_o_ai
1794vec_cmpne(vector double __a, vector double __b) {
1795 return (vector bool long long)
1796 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1789#ifdef __POWER10_VECTOR__
1790static __inline__ vector bool __int128 __ATTRS_o_ai
1791vec_cmpne(vector unsigned __int128 __a, vector unsigned __int128 __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));
17971800}
1801#endif
17981802
17991803/* vec_cmpnez */
18001804
......@@ -1900,6 +1904,86 @@ vec_parity_lsbb(vector signed long long __a) {
19001904 return __builtin_altivec_vprtybd(__a);
19011905}
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}
19031987#endif
19041988
19051989/* vec_cmpgt */
......@@ -1962,6 +2046,20 @@ vec_cmpgt(vector double __a, vector double __b) {
19622046}
19632047#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
19652063/* vec_cmpge */
19662064
19672065static __inline__ vector bool char __ATTRS_o_ai
......@@ -2022,6 +2120,18 @@ vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
20222120}
20232121#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
20252135/* vec_vcmpgefp */
20262136
20272137static __inline__ vector bool int __attribute__((__always_inline__))
......@@ -2134,6 +2244,18 @@ vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
21342244}
21352245#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
21372259/* vec_cmplt */
21382260
21392261static __inline__ vector bool char __ATTRS_o_ai
......@@ -2178,6 +2300,18 @@ vec_cmplt(vector double __a, vector double __b) {
21782300}
21792301#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
21812315#ifdef __POWER8_VECTOR__
21822316static __inline__ vector bool long long __ATTRS_o_ai
21832317vec_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) {
27022836}
27032837
27042838#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,
27062840 size_t __b) {
27072841 return (vector signed char)__builtin_vsx_lxvl(__a, (__b << 56));
27082842}
27092843
27102844static __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) {
27122846 return (vector unsigned char)__builtin_vsx_lxvl(__a, (__b << 56));
27132847}
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,
27162850 size_t __b) {
27172851 return (vector signed short)__builtin_vsx_lxvl(__a, (__b << 56));
27182852}
27192853
27202854static __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) {
27222856 return (vector unsigned short)__builtin_vsx_lxvl(__a, (__b << 56));
27232857}
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,
27262860 size_t __b) {
27272861 return (vector signed int)__builtin_vsx_lxvl(__a, (__b << 56));
27282862}
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,
27312865 size_t __b) {
27322866 return (vector unsigned int)__builtin_vsx_lxvl(__a, (__b << 56));
27332867}
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) {
27362870 return (vector float)__builtin_vsx_lxvl(__a, (__b << 56));
27372871}
27382872
27392873static __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) {
27412875 return (vector signed __int128)__builtin_vsx_lxvl(__a, (__b << 56));
27422876}
27432877
27442878static __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) {
27462880 return (vector unsigned __int128)__builtin_vsx_lxvl(__a, (__b << 56));
27472881}
27482882
27492883static __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) {
27512885 return (vector signed long long)__builtin_vsx_lxvl(__a, (__b << 56));
27522886}
27532887
27542888static __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) {
27562890 return (vector unsigned long long)__builtin_vsx_lxvl(__a, (__b << 56));
27572891}
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,
27602894 size_t __b) {
27612895 return (vector double)__builtin_vsx_lxvl(__a, (__b << 56));
27622896}
27632897
27642898static __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) {
27662900 vector unsigned char __res =
27672901 (vector unsigned char)__builtin_vsx_lxvll(__a, (__b << 56));
27682902#ifdef __LITTLE_ENDIAN__
......@@ -2862,12 +2996,12 @@ static __inline__ void __ATTRS_o_ai vec_xst_len_r(vector unsigned char __a,
28622996#ifdef __VSX__
28632997static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,
28642998 vector float __b) {
2865 return __builtin_vsx_xvcpsgnsp(__a, __b);
2999 return __builtin_vsx_xvcpsgnsp(__b, __a);
28663000}
28673001
28683002static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
28693003 vector double __b) {
2870 return __builtin_vsx_xvcpsgndp(__a, __b);
3004 return __builtin_vsx_xvcpsgndp(__b, __a);
28713005}
28723006#endif
28733007
......@@ -2951,6 +3085,42 @@ static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
29513085
29523086#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
29543124/* vec_signed */
29553125
29563126static __inline__ vector signed int __ATTRS_o_ai
......@@ -3288,6 +3458,66 @@ static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,
32883458}
32893459#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
32913521/* vec_dss */
32923522
32933523#define vec_dss __builtin_altivec_dss
......@@ -3300,23 +3530,19 @@ static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {
33003530
33013531/* vec_dst */
33023532#define vec_dst(__PTR, __CW, __STR) \
3303 __extension__( \
3304 { __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR)); })
3533 __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR))
33053534
33063535/* vec_dstst */
33073536#define vec_dstst(__PTR, __CW, __STR) \
3308 __extension__( \
3309 { __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR)); })
3537 __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR))
33103538
33113539/* vec_dststt */
33123540#define vec_dststt(__PTR, __CW, __STR) \
3313 __extension__( \
3314 { __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR)); })
3541 __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR))
33153542
33163543/* vec_dstt */
33173544#define vec_dstt(__PTR, __CW, __STR) \
3318 __extension__( \
3319 { __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR)); })
3545 __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR))
33203546
33213547/* vec_eqv */
33223548
......@@ -5467,6 +5693,16 @@ vec_msum(vector unsigned short __a, vector unsigned short __b,
54675693 return __builtin_altivec_vmsumuhm(__a, __b, __c);
54685694}
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
54705706/* vec_vmsummbm */
54715707
54725708static __inline__ vector int __attribute__((__always_inline__))
......@@ -5693,6 +5929,26 @@ vec_mule(vector unsigned int __a, vector unsigned int __b) {
56935929}
56945930#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
56965952/* vec_vmulesb */
56975953
56985954static __inline__ vector short __attribute__((__always_inline__))
......@@ -5737,6 +5993,30 @@ vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {
57375993#endif
57385994}
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
57406020/* vec_mulo */
57416021
57426022static __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) {
57956075}
57966076#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
57986098/* vec_vmulosb */
57996099
58006100static __inline__ vector short __attribute__((__always_inline__))
......@@ -7627,6 +7927,18 @@ vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
76277927}
76287928#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
76307942/* vec_rlmi */
76317943#ifdef __POWER9_VECTOR__
76327944static __inline__ vector unsigned int __ATTRS_o_ai
......@@ -7640,10 +7952,26 @@ vec_rlmi(vector unsigned long long __a, vector unsigned long long __b,
76407952 vector unsigned long long __c) {
76417953 return __builtin_altivec_vrldmi(__a, __c, __b);
76427954}
7955#endif
76437956
7644/* vec_rlnm */
7645static __inline__ vector unsigned int __ATTRS_o_ai
7646vec_rlnm(vector unsigned int __a, vector unsigned int __b,
7957#ifdef __POWER10_VECTOR__
7958static __inline__ vector unsigned __int128 __ATTRS_o_ai
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,
76477975 vector unsigned int __c) {
76487976 vector unsigned int OneByte = { 0x8, 0x8, 0x8, 0x8 };
76497977 return __builtin_altivec_vrlwnm(__a, ((__c << OneByte) | __b));
......@@ -7657,6 +7985,42 @@ vec_rlnm(vector unsigned long long __a, vector unsigned long long __b,
76577985}
76587986#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
76608024/* vec_vrlb */
76618025
76628026static __inline__ vector signed char __ATTRS_o_ai
......@@ -7771,6 +8135,18 @@ vec_vrsqrtefp(vector float __a) {
77718135 return __builtin_altivec_vrsqrtefp(__a);
77728136}
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
77748150/* vec_sel */
77758151
77768152#define __builtin_altivec_vsel_4si vec_sel
......@@ -7905,6 +8281,46 @@ vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {
79058281 ((vector long long)__b & (vector long long)__c);
79068282 return (vector double)__res;
79078283}
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}
79088324#endif
79098325
79108326/* vec_vsel */
......@@ -13900,6 +14316,18 @@ static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,
1390014316}
1390114317#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
1390314331/* vec_all_ge */
1390414332
1390514333static __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,
1407114499}
1407214500#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
1407414514/* vec_all_gt */
1407514515
1407614516static __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,
1424214682}
1424314683#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
1424514697/* vec_all_in */
1424614698
1424714699static __inline__ int __attribute__((__always_inline__))
......@@ -14421,6 +14873,18 @@ static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,
1442114873}
1442214874#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
1442414888/* vec_all_lt */
1442514889
1442614890static __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,
1459315057}
1459415058#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
1459615072/* vec_all_nan */
1459715073
1459815074static __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,
1479715273}
1479815274#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
1480015288/* vec_all_nge */
1480115289
1480215290static __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,
1504215530}
1504315531#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
1504515545/* vec_any_ge */
1504615546
1504715547static __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,
1522115721}
1522215722#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
1522415736/* vec_any_gt */
1522515737
1522615738static __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,
1540015912}
1540115913#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
1540315927/* vec_any_le */
1540415928
1540515929static __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,
1557916103}
1558016104#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
1558216118/* vec_any_lt */
1558316119
1558416120static __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,
1575816294}
1575916295#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
1576116309/* vec_any_nan */
1576216310
1576316311static __inline__ int __attribute__((__always_inline__))
......@@ -15953,6 +16501,18 @@ static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,
1595316501}
1595416502#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
1595616516/* vec_any_nge */
1595716517
1595816518static __inline__ int __attribute__((__always_inline__))
......@@ -16353,41 +16913,41 @@ typedef vector unsigned int unaligned_vec_uint __attribute__((aligned(1)));
1635316913typedef vector float unaligned_vec_float __attribute__((aligned(1)));
1635416914
1635516915static inline __ATTRS_o_ai vector signed char vec_xl(signed long long __offset,
16356 signed char *__ptr) {
16916 const signed char *__ptr) {
1635716917 return *(unaligned_vec_schar *)(__ptr + __offset);
1635816918}
1635916919
1636016920static 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) {
1636216922 return *(unaligned_vec_uchar*)(__ptr + __offset);
1636316923}
1636416924
1636516925static inline __ATTRS_o_ai vector signed short vec_xl(signed long long __offset,
16366 signed short *__ptr) {
16926 const signed short *__ptr) {
1636716927 signed char *__addr = (signed char *)__ptr + __offset;
1636816928 return *(unaligned_vec_sshort *)__addr;
1636916929}
1637016930
1637116931static 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) {
1637316933 signed char *__addr = (signed char *)__ptr + __offset;
1637416934 return *(unaligned_vec_ushort *)__addr;
1637516935}
1637616936
1637716937static inline __ATTRS_o_ai vector signed int vec_xl(signed long long __offset,
16378 signed int *__ptr) {
16938 const signed int *__ptr) {
1637916939 signed char *__addr = (signed char *)__ptr + __offset;
1638016940 return *(unaligned_vec_sint *)__addr;
1638116941}
1638216942
1638316943static inline __ATTRS_o_ai vector unsigned int vec_xl(signed long long __offset,
16384 unsigned int *__ptr) {
16944 const unsigned int *__ptr) {
1638516945 signed char *__addr = (signed char *)__ptr + __offset;
1638616946 return *(unaligned_vec_uint *)__addr;
1638716947}
1638816948
1638916949static inline __ATTRS_o_ai vector float vec_xl(signed long long __offset,
16390 float *__ptr) {
16950 const float *__ptr) {
1639116951 signed char *__addr = (signed char *)__ptr + __offset;
1639216952 return *(unaligned_vec_float *)__addr;
1639316953}
......@@ -16398,19 +16958,19 @@ typedef vector unsigned long long unaligned_vec_ull __attribute__((aligned(1)));
1639816958typedef vector double unaligned_vec_double __attribute__((aligned(1)));
1639916959
1640016960static 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) {
1640216962 signed char *__addr = (signed char *)__ptr + __offset;
1640316963 return *(unaligned_vec_sll *)__addr;
1640416964}
1640516965
1640616966static 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) {
1640816968 signed char *__addr = (signed char *)__ptr + __offset;
1640916969 return *(unaligned_vec_ull *)__addr;
1641016970}
1641116971
1641216972static inline __ATTRS_o_ai vector double vec_xl(signed long long __offset,
16413 double *__ptr) {
16973 const double *__ptr) {
1641416974 signed char *__addr = (signed char *)__ptr + __offset;
1641516975 return *(unaligned_vec_double *)__addr;
1641616976}
......@@ -16421,13 +16981,13 @@ typedef vector signed __int128 unaligned_vec_si128 __attribute__((aligned(1)));
1642116981typedef vector unsigned __int128 unaligned_vec_ui128
1642216982 __attribute__((aligned(1)));
1642316983static 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) {
1642516985 signed char *__addr = (signed char *)__ptr + __offset;
1642616986 return *(unaligned_vec_si128 *)__addr;
1642716987}
1642816988
1642916989static 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) {
1643116991 signed char *__addr = (signed char *)__ptr + __offset;
1643216992 return *(unaligned_vec_ui128 *)__addr;
1643316993}
......@@ -16437,71 +16997,71 @@ vec_xl(signed long long __offset, unsigned __int128 *__ptr) {
1643716997
1643816998#ifdef __LITTLE_ENDIAN__
1643916999static __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) {
1644117001 vector signed char __vec = (vector signed char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
1644217002 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
1644317003 13, 12, 11, 10, 9, 8);
1644417004}
1644517005
1644617006static __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) {
1644817008 vector unsigned char __vec = (vector unsigned char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
1644917009 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
1645017010 13, 12, 11, 10, 9, 8);
1645117011}
1645217012
1645317013static __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) {
1645517015 vector signed short __vec = (vector signed short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
1645617016 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
1645717017}
1645817018
1645917019static __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) {
1646117021 vector unsigned short __vec = (vector unsigned short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
1646217022 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
1646317023}
1646417024
1646517025static __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) {
1646717027 return (vector signed int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
1646817028}
1646917029
1647017030static __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) {
1647217032 return (vector unsigned int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
1647317033}
1647417034
1647517035static __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) {
1647717037 return (vector float)__builtin_vsx_lxvw4x_be(__offset, __ptr);
1647817038}
1647917039
1648017040#ifdef __VSX__
1648117041static __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) {
1648317043 return (vector signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
1648417044}
1648517045
1648617046static __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) {
1648817048 return (vector unsigned long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
1648917049}
1649017050
1649117051static __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) {
1649317053 return (vector double)__builtin_vsx_lxvd2x_be(__offset, __ptr);
1649417054}
1649517055#endif
1649617056
1649717057#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
1649817058static __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) {
1650017060 return vec_xl(__offset, __ptr);
1650117061}
1650217062
1650317063static __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) {
1650517065 return vec_xl(__offset, __ptr);
1650617066}
1650717067#endif
......@@ -16509,6 +17069,54 @@ vec_xl_be(signed long long __offset, unsigned __int128 *__ptr) {
1650917069 #define vec_xl_be vec_xl
1651017070#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
1651217120/* vec_xst */
1651317121
1651417122static 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,
1659717205}
1659817206#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
1660017260/* vec_xst_be */
1660117261
1660217262#ifdef __LITTLE_ENDIAN__
......@@ -16763,6 +17423,100 @@ static vector signed char __ATTRS_o_ai vec_nabs(vector signed char __a) {
1676317423}
1676417424
1676517425#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
1676617520/* vec_pdep */
1676717521
1676817522static __inline__ vector unsigned long long __ATTRS_o_ai
......@@ -16881,6 +17635,38 @@ vec_cnttzm(vector unsigned long long __a, vector unsigned long long __b) {
1688117635 return __builtin_altivec_vctzdm(__a, __b);
1688217636}
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
1688417670/* vec_sldbi */
1688517671
1688617672#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,
1702717813#endif
1702817814}
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
1703017902#ifdef __VSX__
1703117903
1703217904/* vec_permx */
......@@ -17095,6 +17967,14 @@ vec_blendv(vector double __a, vector double __b,
1709517967 return __builtin_vsx_xxblendvd(__a, __b, __c);
1709617968}
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
1709817978/* vec_splati */
1709917979
1710017980#define vec_splati(__a) \
......@@ -17161,6 +18041,197 @@ vec_test_lsbb_all_zeros(vector unsigned char __a) {
1716118041 return __builtin_vsx_xvtlsbb(__a, 0);
1716218042}
1716318043#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
1716418235#endif /* __POWER10_VECTOR__ */
1716518236
1716618237#undef __ATTRS_o_ai
lib/include/amxintrin.h+75-22
......@@ -15,8 +15,8 @@
1515#define __AMXINTRIN_H
1616#ifdef __x86_64__
1717
18#define __DEFAULT_FN_ATTRS \
19 __attribute__((__always_inline__, __nodebug__, __target__("amx-tile")))
18#define __DEFAULT_FN_ATTRS_TILE \
19 __attribute__((__always_inline__, __nodebug__, __target__("amx-tile")))
2020
2121/// Load tile configuration from a 64-byte memory location specified by
2222/// "mem_addr". The tile configuration includes the tile type palette, the
......@@ -31,9 +31,8 @@
3131///
3232/// \param __config
3333/// A pointer to 512-bits configuration
34static __inline__ void __DEFAULT_FN_ATTRS
35_tile_loadconfig(const void *__config)
36{
34static __inline__ void __DEFAULT_FN_ATTRS_TILE
35_tile_loadconfig(const void *__config) {
3736 __builtin_ia32_tile_loadconfig(__config);
3837}
3938
......@@ -48,9 +47,8 @@ _tile_loadconfig(const void *__config)
4847///
4948/// \param __config
5049/// A pointer to 512-bits configuration
51static __inline__ void __DEFAULT_FN_ATTRS
52_tile_storeconfig(void *__config)
53{
50static __inline__ void __DEFAULT_FN_ATTRS_TILE
51_tile_storeconfig(void *__config) {
5452 __builtin_ia32_tile_storeconfig(__config);
5553}
5654
......@@ -60,9 +58,7 @@ _tile_storeconfig(void *__config)
6058/// \headerfile <x86intrin.h>
6159///
6260/// This intrinsic corresponds to the <c> TILERELEASE </c> instruction.
63static __inline__ void __DEFAULT_FN_ATTRS
64_tile_release(void)
65{
61static __inline__ void __DEFAULT_FN_ATTRS_TILE _tile_release(void) {
6662 __builtin_ia32_tilerelease();
6763}
6864
......@@ -80,8 +76,9 @@ _tile_release(void)
8076/// A pointer to base address.
8177/// \param stride
8278/// The stride between the rows' data to be loaded in memory.
83#define _tile_loadd(dst, base, stride) \
84 __builtin_ia32_tileloadd64((dst), ((const void *)(base)), (__SIZE_TYPE__)(stride))
79#define _tile_loadd(dst, base, stride) \
80 __builtin_ia32_tileloadd64((dst), ((const void *)(base)), \
81 (__SIZE_TYPE__)(stride))
8582
8683/// Load tile rows from memory specifieid by "base" address and "stride" into
8784/// destination tile "dst" using the tile configuration previously configured
......@@ -99,8 +96,9 @@ _tile_release(void)
9996/// A pointer to base address.
10097/// \param stride
10198/// The stride between the rows' data to be loaded in memory.
102#define _tile_stream_loadd(dst, base, stride) \
103 __builtin_ia32_tileloaddt164((dst), ((const void *)(base)), (__SIZE_TYPE__)(stride))
99#define _tile_stream_loadd(dst, base, stride) \
100 __builtin_ia32_tileloaddt164((dst), ((const void *)(base)), \
101 (__SIZE_TYPE__)(stride))
104102
105103/// Store the tile specified by "src" to memory specifieid by "base" address and
106104/// "stride" using the tile configuration previously configured via
......@@ -116,7 +114,7 @@ _tile_release(void)
116114/// A pointer to base address.
117115/// \param stride
118116/// 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) \
120118 __builtin_ia32_tilestored64((dst), ((void *)(base)), (__SIZE_TYPE__)(stride))
121119
122120/// Zero the tile specified by "tdest".
......@@ -145,7 +143,8 @@ _tile_release(void)
145143/// The 1st source tile. Max size is 1024 Bytes.
146144/// \param src1
147145/// 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
150149/// Compute dot-product of bytes in tiles with a source/destination accumulator.
151150/// Multiply groups of 4 adjacent pairs of signed 8-bit integers in src0 with
......@@ -163,7 +162,8 @@ _tile_release(void)
163162/// The 1st source tile. Max size is 1024 Bytes.
164163/// \param src1
165164/// 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
168168/// Compute dot-product of bytes in tiles with a source/destination accumulator.
169169/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in src0 with
......@@ -181,7 +181,8 @@ _tile_release(void)
181181/// The 1st source tile. Max size is 1024 Bytes.
182182/// \param src1
183183/// 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
186187/// Compute dot-product of bytes in tiles with a source/destination accumulator.
187188/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in src0 with
......@@ -199,7 +200,8 @@ _tile_release(void)
199200/// The 1st source tile. Max size is 1024 Bytes.
200201/// \param src1
201202/// 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
204206/// Compute dot-product of BF16 (16-bit) floating-point pairs in tiles src0 and
205207/// src1, accumulating the intermediate single-precision (32-bit) floating-point
......@@ -216,10 +218,61 @@ _tile_release(void)
216218/// The 1st source tile. Max size is 1024 Bytes.
217219/// \param src1
218220/// The 2nd source tile. Max size is 1024 Bytes.
219#define _tile_dpbf16ps(dst, src0, src1) \
221#define _tile_dpbf16ps(dst, src0, src1) \
220222 __builtin_ia32_tdpbf16ps((dst), (src0), (src1))
221223
222#undef __DEFAULT_FN_ATTRS
224#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
224277#endif /* __x86_64__ */
225278#endif /* __AMXINTRIN_H */
lib/include/arm_acle.h+26
......@@ -639,6 +639,32 @@ __jcvt(double __a) {
639639}
640640#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
642668/* 10.1 Special register intrinsics */
643669#define __arm_rsr(sysreg) __builtin_arm_rsr(sysreg)
644670#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) {
4042940429}
4043040430#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}
4043241629#endif
40433#if defined(__ARM_FEATURE_COMPLEX) && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
41630
4043441631#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) {
4043641633 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);
4043841635 return __ret;
4043941636}
4044041637#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) {
4044241639 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
4044341640 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);
4044441642 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);
4044641644 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);
4044741645 return __ret;
4044841646}
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}
4044941652#endif
4045041653
4045141654#ifdef __LITTLE_ENDIAN__
40452__ai float16x4_t vcadd_rot90_f16(float16x4_t __p0, float16x4_t __p1) {
40453 float16x4_t __ret;
40454 __ret = (float16x4_t) __builtin_neon_vcadd_rot90_v((int8x8_t)__p0, (int8x8_t)__p1, 8);
41655#define vcmla_rot90_lane_f16(__p0_225, __p1_225, __p2_225, __p3_225) __extension__ ({ \
41656 float16x4_t __s0_225 = __p0_225; \
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);
4045541772 return __ret;
4045641773}
4045741774#else
40458__ai float16x4_t vcadd_rot90_f16(float16x4_t __p0, float16x4_t __p1) {
40459 float16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
40460 float16x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);
40461 float16x4_t __ret;
40462 __ret = (float16x4_t) __builtin_neon_vcadd_rot90_v((int8x8_t)__rev0, (int8x8_t)__rev1, 8);
40463 __ret = __builtin_shufflevector(__ret, __ret, 3, 2, 1, 0);
41775__ai float64x2_t vcaddq_rot270_f64(float64x2_t __p0, float64x2_t __p1) {
41776 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
41777 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
41778 float64x2_t __ret;
41779 __ret = (float64x2_t) __builtin_neon_vcaddq_rot270_v((int8x16_t)__rev0, (int8x16_t)__rev1, 42);
41780 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
4046441781 return __ret;
4046541782}
4046641783#endif
4046741784
4046841785#ifdef __LITTLE_ENDIAN__
40469__ai float16x8_t vcaddq_rot270_f16(float16x8_t __p0, float16x8_t __p1) {
40470 float16x8_t __ret;
40471 __ret = (float16x8_t) __builtin_neon_vcaddq_rot270_v((int8x16_t)__p0, (int8x16_t)__p1, 40);
41786__ai float64x2_t vcaddq_rot90_f64(float64x2_t __p0, float64x2_t __p1) {
41787 float64x2_t __ret;
41788 __ret = (float64x2_t) __builtin_neon_vcaddq_rot90_v((int8x16_t)__p0, (int8x16_t)__p1, 42);
4047241789 return __ret;
4047341790}
4047441791#else
40475__ai float16x8_t vcaddq_rot270_f16(float16x8_t __p0, float16x8_t __p1) {
40476 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);
40477 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 7, 6, 5, 4, 3, 2, 1, 0);
40478 float16x8_t __ret;
40479 __ret = (float16x8_t) __builtin_neon_vcaddq_rot270_v((int8x16_t)__rev0, (int8x16_t)__rev1, 40);
40480 __ret = __builtin_shufflevector(__ret, __ret, 7, 6, 5, 4, 3, 2, 1, 0);
41792__ai float64x2_t vcaddq_rot90_f64(float64x2_t __p0, float64x2_t __p1) {
41793 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
41794 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
41795 float64x2_t __ret;
41796 __ret = (float64x2_t) __builtin_neon_vcaddq_rot90_v((int8x16_t)__rev0, (int8x16_t)__rev1, 42);
41797 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
4048141798 return __ret;
4048241799}
4048341800#endif
4048441801
4048541802#ifdef __LITTLE_ENDIAN__
40486__ai float16x8_t vcaddq_rot90_f16(float16x8_t __p0, float16x8_t __p1) {
40487 float16x8_t __ret;
40488 __ret = (float16x8_t) __builtin_neon_vcaddq_rot90_v((int8x16_t)__p0, (int8x16_t)__p1, 40);
41803__ai float64x2_t vcmlaq_f64(float64x2_t __p0, float64x2_t __p1, float64x2_t __p2) {
41804 float64x2_t __ret;
41805 __ret = (float64x2_t) __builtin_neon_vcmlaq_v((int8x16_t)__p0, (int8x16_t)__p1, (int8x16_t)__p2, 42);
4048941806 return __ret;
4049041807}
4049141808#else
40492__ai float16x8_t vcaddq_rot90_f16(float16x8_t __p0, float16x8_t __p1) {
40493 float16x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);
40494 float16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 7, 6, 5, 4, 3, 2, 1, 0);
40495 float16x8_t __ret;
40496 __ret = (float16x8_t) __builtin_neon_vcaddq_rot90_v((int8x16_t)__rev0, (int8x16_t)__rev1, 40);
40497 __ret = __builtin_shufflevector(__ret, __ret, 7, 6, 5, 4, 3, 2, 1, 0);
41809__ai float64x2_t vcmlaq_f64(float64x2_t __p0, float64x2_t __p1, float64x2_t __p2) {
41810 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
41811 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
41812 float64x2_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 1, 0);
41813 float64x2_t __ret;
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);
4049841821 return __ret;
4049941822}
4050041823#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})
4050241865#endif
40503#if defined(__ARM_FEATURE_COMPLEX) && defined(__aarch64__)
41866
4050441867#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) {
4050641922 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);
4050841924 return __ret;
4050941925}
4051041926#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) {
4051241928 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
4051341929 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
41930 float64x2_t __rev2; __rev2 = __builtin_shufflevector(__p2, __p2, 1, 0);
4051441931 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);
4051642169 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
4051742170 return __ret;
4051842171}
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})
4051942219#endif
4052042220
4052142221#ifdef __LITTLE_ENDIAN__
40522__ai float64x2_t vcaddq_rot90_f64(float64x2_t __p0, float64x2_t __p1) {
40523 float64x2_t __ret;
40524 __ret = (float64x2_t) __builtin_neon_vcaddq_rot90_v((int8x16_t)__p0, (int8x16_t)__p1, 42);
40525 return __ret;
40526}
42222#define vcmla_rot90_laneq_f64(__p0_257, __p1_257, __p2_257, __p3_257) __extension__ ({ \
42223 float64x1_t __s0_257 = __p0_257; \
42224 float64x1_t __s1_257 = __p1_257; \
42225 float64x2_t __s2_257 = __p2_257; \
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})
4052742232#else
40528__ai float64x2_t vcaddq_rot90_f64(float64x2_t __p0, float64x2_t __p1) {
40529 float64x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
40530 float64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
40531 float64x2_t __ret;
40532 __ret = (float64x2_t) __builtin_neon_vcaddq_rot90_v((int8x16_t)__rev0, (int8x16_t)__rev1, 42);
40533 __ret = __builtin_shufflevector(__ret, __ret, 1, 0);
40534 return __ret;
40535}
42233#define vcmla_rot90_laneq_f64(__p0_258, __p1_258, __p2_258, __p3_258) __extension__ ({ \
42234 float64x1_t __s0_258 = __p0_258; \
42235 float64x1_t __s1_258 = __p1_258; \
42236 float64x2_t __s2_258 = __p2_258; \
42237 float64x2_t __rev2_258; __rev2_258 = __builtin_shufflevector(__s2_258, __s2_258, 1, 0); \
42238 float64x1_t __ret_258; \
42239float64x2_t __reint_258 = __rev2_258; \
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})
4053642272#endif
4053742273
4053842274#endif
......@@ -40630,228 +42366,228 @@ __ai int32x2_t __noswap_vdot_s32(int32x2_t __p0, int8x8_t __p1, int8x8_t __p2) {
4063042366#endif
4063142367
4063242368#ifdef __LITTLE_ENDIAN__
40633#define vdotq_lane_u32(__p0_169, __p1_169, __p2_169, __p3_169) __extension__ ({ \
40634 uint32x4_t __s0_169 = __p0_169; \
40635 uint8x16_t __s1_169 = __p1_169; \
40636 uint8x8_t __s2_169 = __p2_169; \
40637 uint32x4_t __ret_169; \
40638uint8x8_t __reint_169 = __s2_169; \
40639uint32x4_t __reint1_169 = splatq_lane_u32(*(uint32x2_t *) &__reint_169, __p3_169); \
40640 __ret_169 = vdotq_u32(__s0_169, __s1_169, *(uint8x16_t *) &__reint1_169); \
40641 __ret_169; \
42369#define vdotq_lane_u32(__p0_261, __p1_261, __p2_261, __p3_261) __extension__ ({ \
42370 uint32x4_t __s0_261 = __p0_261; \
42371 uint8x16_t __s1_261 = __p1_261; \
42372 uint8x8_t __s2_261 = __p2_261; \
42373 uint32x4_t __ret_261; \
42374uint8x8_t __reint_261 = __s2_261; \
42375uint32x4_t __reint1_261 = splatq_lane_u32(*(uint32x2_t *) &__reint_261, __p3_261); \
42376 __ret_261 = vdotq_u32(__s0_261, __s1_261, *(uint8x16_t *) &__reint1_261); \
42377 __ret_261; \
4064242378})
4064342379#else
40644#define vdotq_lane_u32(__p0_170, __p1_170, __p2_170, __p3_170) __extension__ ({ \
40645 uint32x4_t __s0_170 = __p0_170; \
40646 uint8x16_t __s1_170 = __p1_170; \
40647 uint8x8_t __s2_170 = __p2_170; \
40648 uint32x4_t __rev0_170; __rev0_170 = __builtin_shufflevector(__s0_170, __s0_170, 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); \
40650 uint8x8_t __rev2_170; __rev2_170 = __builtin_shufflevector(__s2_170, __s2_170, 7, 6, 5, 4, 3, 2, 1, 0); \
40651 uint32x4_t __ret_170; \
40652uint8x8_t __reint_170 = __rev2_170; \
40653uint32x4_t __reint1_170 = __noswap_splatq_lane_u32(*(uint32x2_t *) &__reint_170, __p3_170); \
40654 __ret_170 = __noswap_vdotq_u32(__rev0_170, __rev1_170, *(uint8x16_t *) &__reint1_170); \
40655 __ret_170 = __builtin_shufflevector(__ret_170, __ret_170, 3, 2, 1, 0); \
40656 __ret_170; \
42380#define vdotq_lane_u32(__p0_262, __p1_262, __p2_262, __p3_262) __extension__ ({ \
42381 uint32x4_t __s0_262 = __p0_262; \
42382 uint8x16_t __s1_262 = __p1_262; \
42383 uint8x8_t __s2_262 = __p2_262; \
42384 uint32x4_t __rev0_262; __rev0_262 = __builtin_shufflevector(__s0_262, __s0_262, 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); \
42386 uint8x8_t __rev2_262; __rev2_262 = __builtin_shufflevector(__s2_262, __s2_262, 7, 6, 5, 4, 3, 2, 1, 0); \
42387 uint32x4_t __ret_262; \
42388uint8x8_t __reint_262 = __rev2_262; \
42389uint32x4_t __reint1_262 = __noswap_splatq_lane_u32(*(uint32x2_t *) &__reint_262, __p3_262); \
42390 __ret_262 = __noswap_vdotq_u32(__rev0_262, __rev1_262, *(uint8x16_t *) &__reint1_262); \
42391 __ret_262 = __builtin_shufflevector(__ret_262, __ret_262, 3, 2, 1, 0); \
42392 __ret_262; \
4065742393})
4065842394#endif
4065942395
4066042396#ifdef __LITTLE_ENDIAN__
40661#define vdotq_lane_s32(__p0_171, __p1_171, __p2_171, __p3_171) __extension__ ({ \
40662 int32x4_t __s0_171 = __p0_171; \
40663 int8x16_t __s1_171 = __p1_171; \
40664 int8x8_t __s2_171 = __p2_171; \
40665 int32x4_t __ret_171; \
40666int8x8_t __reint_171 = __s2_171; \
40667int32x4_t __reint1_171 = splatq_lane_s32(*(int32x2_t *) &__reint_171, __p3_171); \
40668 __ret_171 = vdotq_s32(__s0_171, __s1_171, *(int8x16_t *) &__reint1_171); \
40669 __ret_171; \
42397#define vdotq_lane_s32(__p0_263, __p1_263, __p2_263, __p3_263) __extension__ ({ \
42398 int32x4_t __s0_263 = __p0_263; \
42399 int8x16_t __s1_263 = __p1_263; \
42400 int8x8_t __s2_263 = __p2_263; \
42401 int32x4_t __ret_263; \
42402int8x8_t __reint_263 = __s2_263; \
42403int32x4_t __reint1_263 = splatq_lane_s32(*(int32x2_t *) &__reint_263, __p3_263); \
42404 __ret_263 = vdotq_s32(__s0_263, __s1_263, *(int8x16_t *) &__reint1_263); \
42405 __ret_263; \
4067042406})
4067142407#else
40672#define vdotq_lane_s32(__p0_172, __p1_172, __p2_172, __p3_172) __extension__ ({ \
40673 int32x4_t __s0_172 = __p0_172; \
40674 int8x16_t __s1_172 = __p1_172; \
40675 int8x8_t __s2_172 = __p2_172; \
40676 int32x4_t __rev0_172; __rev0_172 = __builtin_shufflevector(__s0_172, __s0_172, 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); \
40678 int8x8_t __rev2_172; __rev2_172 = __builtin_shufflevector(__s2_172, __s2_172, 7, 6, 5, 4, 3, 2, 1, 0); \
40679 int32x4_t __ret_172; \
40680int8x8_t __reint_172 = __rev2_172; \
40681int32x4_t __reint1_172 = __noswap_splatq_lane_s32(*(int32x2_t *) &__reint_172, __p3_172); \
40682 __ret_172 = __noswap_vdotq_s32(__rev0_172, __rev1_172, *(int8x16_t *) &__reint1_172); \
40683 __ret_172 = __builtin_shufflevector(__ret_172, __ret_172, 3, 2, 1, 0); \
40684 __ret_172; \
42408#define vdotq_lane_s32(__p0_264, __p1_264, __p2_264, __p3_264) __extension__ ({ \
42409 int32x4_t __s0_264 = __p0_264; \
42410 int8x16_t __s1_264 = __p1_264; \
42411 int8x8_t __s2_264 = __p2_264; \
42412 int32x4_t __rev0_264; __rev0_264 = __builtin_shufflevector(__s0_264, __s0_264, 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); \
42414 int8x8_t __rev2_264; __rev2_264 = __builtin_shufflevector(__s2_264, __s2_264, 7, 6, 5, 4, 3, 2, 1, 0); \
42415 int32x4_t __ret_264; \
42416int8x8_t __reint_264 = __rev2_264; \
42417int32x4_t __reint1_264 = __noswap_splatq_lane_s32(*(int32x2_t *) &__reint_264, __p3_264); \
42418 __ret_264 = __noswap_vdotq_s32(__rev0_264, __rev1_264, *(int8x16_t *) &__reint1_264); \
42419 __ret_264 = __builtin_shufflevector(__ret_264, __ret_264, 3, 2, 1, 0); \
42420 __ret_264; \
4068542421})
4068642422#endif
4068742423
4068842424#ifdef __LITTLE_ENDIAN__
40689#define vdot_lane_u32(__p0_173, __p1_173, __p2_173, __p3_173) __extension__ ({ \
40690 uint32x2_t __s0_173 = __p0_173; \
40691 uint8x8_t __s1_173 = __p1_173; \
40692 uint8x8_t __s2_173 = __p2_173; \
40693 uint32x2_t __ret_173; \
40694uint8x8_t __reint_173 = __s2_173; \
40695uint32x2_t __reint1_173 = splat_lane_u32(*(uint32x2_t *) &__reint_173, __p3_173); \
40696 __ret_173 = vdot_u32(__s0_173, __s1_173, *(uint8x8_t *) &__reint1_173); \
40697 __ret_173; \
42425#define vdot_lane_u32(__p0_265, __p1_265, __p2_265, __p3_265) __extension__ ({ \
42426 uint32x2_t __s0_265 = __p0_265; \
42427 uint8x8_t __s1_265 = __p1_265; \
42428 uint8x8_t __s2_265 = __p2_265; \
42429 uint32x2_t __ret_265; \
42430uint8x8_t __reint_265 = __s2_265; \
42431uint32x2_t __reint1_265 = splat_lane_u32(*(uint32x2_t *) &__reint_265, __p3_265); \
42432 __ret_265 = vdot_u32(__s0_265, __s1_265, *(uint8x8_t *) &__reint1_265); \
42433 __ret_265; \
4069842434})
4069942435#else
40700#define vdot_lane_u32(__p0_174, __p1_174, __p2_174, __p3_174) __extension__ ({ \
40701 uint32x2_t __s0_174 = __p0_174; \
40702 uint8x8_t __s1_174 = __p1_174; \
40703 uint8x8_t __s2_174 = __p2_174; \
40704 uint32x2_t __rev0_174; __rev0_174 = __builtin_shufflevector(__s0_174, __s0_174, 1, 0); \
40705 uint8x8_t __rev1_174; __rev1_174 = __builtin_shufflevector(__s1_174, __s1_174, 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); \
40707 uint32x2_t __ret_174; \
40708uint8x8_t __reint_174 = __rev2_174; \
40709uint32x2_t __reint1_174 = __noswap_splat_lane_u32(*(uint32x2_t *) &__reint_174, __p3_174); \
40710 __ret_174 = __noswap_vdot_u32(__rev0_174, __rev1_174, *(uint8x8_t *) &__reint1_174); \
40711 __ret_174 = __builtin_shufflevector(__ret_174, __ret_174, 1, 0); \
40712 __ret_174; \
42436#define vdot_lane_u32(__p0_266, __p1_266, __p2_266, __p3_266) __extension__ ({ \
42437 uint32x2_t __s0_266 = __p0_266; \
42438 uint8x8_t __s1_266 = __p1_266; \
42439 uint8x8_t __s2_266 = __p2_266; \
42440 uint32x2_t __rev0_266; __rev0_266 = __builtin_shufflevector(__s0_266, __s0_266, 1, 0); \
42441 uint8x8_t __rev1_266; __rev1_266 = __builtin_shufflevector(__s1_266, __s1_266, 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); \
42443 uint32x2_t __ret_266; \
42444uint8x8_t __reint_266 = __rev2_266; \
42445uint32x2_t __reint1_266 = __noswap_splat_lane_u32(*(uint32x2_t *) &__reint_266, __p3_266); \
42446 __ret_266 = __noswap_vdot_u32(__rev0_266, __rev1_266, *(uint8x8_t *) &__reint1_266); \
42447 __ret_266 = __builtin_shufflevector(__ret_266, __ret_266, 1, 0); \
42448 __ret_266; \
4071342449})
4071442450#endif
4071542451
4071642452#ifdef __LITTLE_ENDIAN__
40717#define vdot_lane_s32(__p0_175, __p1_175, __p2_175, __p3_175) __extension__ ({ \
40718 int32x2_t __s0_175 = __p0_175; \
40719 int8x8_t __s1_175 = __p1_175; \
40720 int8x8_t __s2_175 = __p2_175; \
40721 int32x2_t __ret_175; \
40722int8x8_t __reint_175 = __s2_175; \
40723int32x2_t __reint1_175 = splat_lane_s32(*(int32x2_t *) &__reint_175, __p3_175); \
40724 __ret_175 = vdot_s32(__s0_175, __s1_175, *(int8x8_t *) &__reint1_175); \
40725 __ret_175; \
42453#define vdot_lane_s32(__p0_267, __p1_267, __p2_267, __p3_267) __extension__ ({ \
42454 int32x2_t __s0_267 = __p0_267; \
42455 int8x8_t __s1_267 = __p1_267; \
42456 int8x8_t __s2_267 = __p2_267; \
42457 int32x2_t __ret_267; \
42458int8x8_t __reint_267 = __s2_267; \
42459int32x2_t __reint1_267 = splat_lane_s32(*(int32x2_t *) &__reint_267, __p3_267); \
42460 __ret_267 = vdot_s32(__s0_267, __s1_267, *(int8x8_t *) &__reint1_267); \
42461 __ret_267; \
4072642462})
4072742463#else
40728#define vdot_lane_s32(__p0_176, __p1_176, __p2_176, __p3_176) __extension__ ({ \
40729 int32x2_t __s0_176 = __p0_176; \
40730 int8x8_t __s1_176 = __p1_176; \
40731 int8x8_t __s2_176 = __p2_176; \
40732 int32x2_t __rev0_176; __rev0_176 = __builtin_shufflevector(__s0_176, __s0_176, 1, 0); \
40733 int8x8_t __rev1_176; __rev1_176 = __builtin_shufflevector(__s1_176, __s1_176, 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); \
40735 int32x2_t __ret_176; \
40736int8x8_t __reint_176 = __rev2_176; \
40737int32x2_t __reint1_176 = __noswap_splat_lane_s32(*(int32x2_t *) &__reint_176, __p3_176); \
40738 __ret_176 = __noswap_vdot_s32(__rev0_176, __rev1_176, *(int8x8_t *) &__reint1_176); \
40739 __ret_176 = __builtin_shufflevector(__ret_176, __ret_176, 1, 0); \
40740 __ret_176; \
42464#define vdot_lane_s32(__p0_268, __p1_268, __p2_268, __p3_268) __extension__ ({ \
42465 int32x2_t __s0_268 = __p0_268; \
42466 int8x8_t __s1_268 = __p1_268; \
42467 int8x8_t __s2_268 = __p2_268; \
42468 int32x2_t __rev0_268; __rev0_268 = __builtin_shufflevector(__s0_268, __s0_268, 1, 0); \
42469 int8x8_t __rev1_268; __rev1_268 = __builtin_shufflevector(__s1_268, __s1_268, 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); \
42471 int32x2_t __ret_268; \
42472int8x8_t __reint_268 = __rev2_268; \
42473int32x2_t __reint1_268 = __noswap_splat_lane_s32(*(int32x2_t *) &__reint_268, __p3_268); \
42474 __ret_268 = __noswap_vdot_s32(__rev0_268, __rev1_268, *(int8x8_t *) &__reint1_268); \
42475 __ret_268 = __builtin_shufflevector(__ret_268, __ret_268, 1, 0); \
42476 __ret_268; \
4074142477})
4074242478#endif
4074342479
4074442480#endif
4074542481#if defined(__ARM_FEATURE_DOTPROD) && defined(__aarch64__)
4074642482#ifdef __LITTLE_ENDIAN__
40747#define vdotq_laneq_u32(__p0_177, __p1_177, __p2_177, __p3_177) __extension__ ({ \
40748 uint32x4_t __s0_177 = __p0_177; \
40749 uint8x16_t __s1_177 = __p1_177; \
40750 uint8x16_t __s2_177 = __p2_177; \
40751 uint32x4_t __ret_177; \
40752uint8x16_t __reint_177 = __s2_177; \
40753uint32x4_t __reint1_177 = splatq_laneq_u32(*(uint32x4_t *) &__reint_177, __p3_177); \
40754 __ret_177 = vdotq_u32(__s0_177, __s1_177, *(uint8x16_t *) &__reint1_177); \
40755 __ret_177; \
42483#define vdotq_laneq_u32(__p0_269, __p1_269, __p2_269, __p3_269) __extension__ ({ \
42484 uint32x4_t __s0_269 = __p0_269; \
42485 uint8x16_t __s1_269 = __p1_269; \
42486 uint8x16_t __s2_269 = __p2_269; \
42487 uint32x4_t __ret_269; \
42488uint8x16_t __reint_269 = __s2_269; \
42489uint32x4_t __reint1_269 = splatq_laneq_u32(*(uint32x4_t *) &__reint_269, __p3_269); \
42490 __ret_269 = vdotq_u32(__s0_269, __s1_269, *(uint8x16_t *) &__reint1_269); \
42491 __ret_269; \
4075642492})
4075742493#else
40758#define vdotq_laneq_u32(__p0_178, __p1_178, __p2_178, __p3_178) __extension__ ({ \
40759 uint32x4_t __s0_178 = __p0_178; \
40760 uint8x16_t __s1_178 = __p1_178; \
40761 uint8x16_t __s2_178 = __p2_178; \
40762 uint32x4_t __rev0_178; __rev0_178 = __builtin_shufflevector(__s0_178, __s0_178, 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); \
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); \
40765 uint32x4_t __ret_178; \
40766uint8x16_t __reint_178 = __rev2_178; \
40767uint32x4_t __reint1_178 = __noswap_splatq_laneq_u32(*(uint32x4_t *) &__reint_178, __p3_178); \
40768 __ret_178 = __noswap_vdotq_u32(__rev0_178, __rev1_178, *(uint8x16_t *) &__reint1_178); \
40769 __ret_178 = __builtin_shufflevector(__ret_178, __ret_178, 3, 2, 1, 0); \
40770 __ret_178; \
42494#define vdotq_laneq_u32(__p0_270, __p1_270, __p2_270, __p3_270) __extension__ ({ \
42495 uint32x4_t __s0_270 = __p0_270; \
42496 uint8x16_t __s1_270 = __p1_270; \
42497 uint8x16_t __s2_270 = __p2_270; \
42498 uint32x4_t __rev0_270; __rev0_270 = __builtin_shufflevector(__s0_270, __s0_270, 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); \
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); \
42501 uint32x4_t __ret_270; \
42502uint8x16_t __reint_270 = __rev2_270; \
42503uint32x4_t __reint1_270 = __noswap_splatq_laneq_u32(*(uint32x4_t *) &__reint_270, __p3_270); \
42504 __ret_270 = __noswap_vdotq_u32(__rev0_270, __rev1_270, *(uint8x16_t *) &__reint1_270); \
42505 __ret_270 = __builtin_shufflevector(__ret_270, __ret_270, 3, 2, 1, 0); \
42506 __ret_270; \
4077142507})
4077242508#endif
4077342509
4077442510#ifdef __LITTLE_ENDIAN__
40775#define vdotq_laneq_s32(__p0_179, __p1_179, __p2_179, __p3_179) __extension__ ({ \
40776 int32x4_t __s0_179 = __p0_179; \
40777 int8x16_t __s1_179 = __p1_179; \
40778 int8x16_t __s2_179 = __p2_179; \
40779 int32x4_t __ret_179; \
40780int8x16_t __reint_179 = __s2_179; \
40781int32x4_t __reint1_179 = splatq_laneq_s32(*(int32x4_t *) &__reint_179, __p3_179); \
40782 __ret_179 = vdotq_s32(__s0_179, __s1_179, *(int8x16_t *) &__reint1_179); \
40783 __ret_179; \
42511#define vdotq_laneq_s32(__p0_271, __p1_271, __p2_271, __p3_271) __extension__ ({ \
42512 int32x4_t __s0_271 = __p0_271; \
42513 int8x16_t __s1_271 = __p1_271; \
42514 int8x16_t __s2_271 = __p2_271; \
42515 int32x4_t __ret_271; \
42516int8x16_t __reint_271 = __s2_271; \
42517int32x4_t __reint1_271 = splatq_laneq_s32(*(int32x4_t *) &__reint_271, __p3_271); \
42518 __ret_271 = vdotq_s32(__s0_271, __s1_271, *(int8x16_t *) &__reint1_271); \
42519 __ret_271; \
4078442520})
4078542521#else
40786#define vdotq_laneq_s32(__p0_180, __p1_180, __p2_180, __p3_180) __extension__ ({ \
40787 int32x4_t __s0_180 = __p0_180; \
40788 int8x16_t __s1_180 = __p1_180; \
40789 int8x16_t __s2_180 = __p2_180; \
40790 int32x4_t __rev0_180; __rev0_180 = __builtin_shufflevector(__s0_180, __s0_180, 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); \
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); \
40793 int32x4_t __ret_180; \
40794int8x16_t __reint_180 = __rev2_180; \
40795int32x4_t __reint1_180 = __noswap_splatq_laneq_s32(*(int32x4_t *) &__reint_180, __p3_180); \
40796 __ret_180 = __noswap_vdotq_s32(__rev0_180, __rev1_180, *(int8x16_t *) &__reint1_180); \
40797 __ret_180 = __builtin_shufflevector(__ret_180, __ret_180, 3, 2, 1, 0); \
40798 __ret_180; \
42522#define vdotq_laneq_s32(__p0_272, __p1_272, __p2_272, __p3_272) __extension__ ({ \
42523 int32x4_t __s0_272 = __p0_272; \
42524 int8x16_t __s1_272 = __p1_272; \
42525 int8x16_t __s2_272 = __p2_272; \
42526 int32x4_t __rev0_272; __rev0_272 = __builtin_shufflevector(__s0_272, __s0_272, 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); \
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); \
42529 int32x4_t __ret_272; \
42530int8x16_t __reint_272 = __rev2_272; \
42531int32x4_t __reint1_272 = __noswap_splatq_laneq_s32(*(int32x4_t *) &__reint_272, __p3_272); \
42532 __ret_272 = __noswap_vdotq_s32(__rev0_272, __rev1_272, *(int8x16_t *) &__reint1_272); \
42533 __ret_272 = __builtin_shufflevector(__ret_272, __ret_272, 3, 2, 1, 0); \
42534 __ret_272; \
4079942535})
4080042536#endif
4080142537
4080242538#ifdef __LITTLE_ENDIAN__
40803#define vdot_laneq_u32(__p0_181, __p1_181, __p2_181, __p3_181) __extension__ ({ \
40804 uint32x2_t __s0_181 = __p0_181; \
40805 uint8x8_t __s1_181 = __p1_181; \
40806 uint8x16_t __s2_181 = __p2_181; \
40807 uint32x2_t __ret_181; \
40808uint8x16_t __reint_181 = __s2_181; \
40809uint32x2_t __reint1_181 = splat_laneq_u32(*(uint32x4_t *) &__reint_181, __p3_181); \
40810 __ret_181 = vdot_u32(__s0_181, __s1_181, *(uint8x8_t *) &__reint1_181); \
40811 __ret_181; \
42539#define vdot_laneq_u32(__p0_273, __p1_273, __p2_273, __p3_273) __extension__ ({ \
42540 uint32x2_t __s0_273 = __p0_273; \
42541 uint8x8_t __s1_273 = __p1_273; \
42542 uint8x16_t __s2_273 = __p2_273; \
42543 uint32x2_t __ret_273; \
42544uint8x16_t __reint_273 = __s2_273; \
42545uint32x2_t __reint1_273 = splat_laneq_u32(*(uint32x4_t *) &__reint_273, __p3_273); \
42546 __ret_273 = vdot_u32(__s0_273, __s1_273, *(uint8x8_t *) &__reint1_273); \
42547 __ret_273; \
4081242548})
4081342549#else
40814#define vdot_laneq_u32(__p0_182, __p1_182, __p2_182, __p3_182) __extension__ ({ \
40815 uint32x2_t __s0_182 = __p0_182; \
40816 uint8x8_t __s1_182 = __p1_182; \
40817 uint8x16_t __s2_182 = __p2_182; \
40818 uint32x2_t __rev0_182; __rev0_182 = __builtin_shufflevector(__s0_182, __s0_182, 1, 0); \
40819 uint8x8_t __rev1_182; __rev1_182 = __builtin_shufflevector(__s1_182, __s1_182, 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); \
40821 uint32x2_t __ret_182; \
40822uint8x16_t __reint_182 = __rev2_182; \
40823uint32x2_t __reint1_182 = __noswap_splat_laneq_u32(*(uint32x4_t *) &__reint_182, __p3_182); \
40824 __ret_182 = __noswap_vdot_u32(__rev0_182, __rev1_182, *(uint8x8_t *) &__reint1_182); \
40825 __ret_182 = __builtin_shufflevector(__ret_182, __ret_182, 1, 0); \
40826 __ret_182; \
42550#define vdot_laneq_u32(__p0_274, __p1_274, __p2_274, __p3_274) __extension__ ({ \
42551 uint32x2_t __s0_274 = __p0_274; \
42552 uint8x8_t __s1_274 = __p1_274; \
42553 uint8x16_t __s2_274 = __p2_274; \
42554 uint32x2_t __rev0_274; __rev0_274 = __builtin_shufflevector(__s0_274, __s0_274, 1, 0); \
42555 uint8x8_t __rev1_274; __rev1_274 = __builtin_shufflevector(__s1_274, __s1_274, 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); \
42557 uint32x2_t __ret_274; \
42558uint8x16_t __reint_274 = __rev2_274; \
42559uint32x2_t __reint1_274 = __noswap_splat_laneq_u32(*(uint32x4_t *) &__reint_274, __p3_274); \
42560 __ret_274 = __noswap_vdot_u32(__rev0_274, __rev1_274, *(uint8x8_t *) &__reint1_274); \
42561 __ret_274 = __builtin_shufflevector(__ret_274, __ret_274, 1, 0); \
42562 __ret_274; \
4082742563})
4082842564#endif
4082942565
4083042566#ifdef __LITTLE_ENDIAN__
40831#define vdot_laneq_s32(__p0_183, __p1_183, __p2_183, __p3_183) __extension__ ({ \
40832 int32x2_t __s0_183 = __p0_183; \
40833 int8x8_t __s1_183 = __p1_183; \
40834 int8x16_t __s2_183 = __p2_183; \
40835 int32x2_t __ret_183; \
40836int8x16_t __reint_183 = __s2_183; \
40837int32x2_t __reint1_183 = splat_laneq_s32(*(int32x4_t *) &__reint_183, __p3_183); \
40838 __ret_183 = vdot_s32(__s0_183, __s1_183, *(int8x8_t *) &__reint1_183); \
40839 __ret_183; \
42567#define vdot_laneq_s32(__p0_275, __p1_275, __p2_275, __p3_275) __extension__ ({ \
42568 int32x2_t __s0_275 = __p0_275; \
42569 int8x8_t __s1_275 = __p1_275; \
42570 int8x16_t __s2_275 = __p2_275; \
42571 int32x2_t __ret_275; \
42572int8x16_t __reint_275 = __s2_275; \
42573int32x2_t __reint1_275 = splat_laneq_s32(*(int32x4_t *) &__reint_275, __p3_275); \
42574 __ret_275 = vdot_s32(__s0_275, __s1_275, *(int8x8_t *) &__reint1_275); \
42575 __ret_275; \
4084042576})
4084142577#else
40842#define vdot_laneq_s32(__p0_184, __p1_184, __p2_184, __p3_184) __extension__ ({ \
40843 int32x2_t __s0_184 = __p0_184; \
40844 int8x8_t __s1_184 = __p1_184; \
40845 int8x16_t __s2_184 = __p2_184; \
40846 int32x2_t __rev0_184; __rev0_184 = __builtin_shufflevector(__s0_184, __s0_184, 1, 0); \
40847 int8x8_t __rev1_184; __rev1_184 = __builtin_shufflevector(__s1_184, __s1_184, 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); \
40849 int32x2_t __ret_184; \
40850int8x16_t __reint_184 = __rev2_184; \
40851int32x2_t __reint1_184 = __noswap_splat_laneq_s32(*(int32x4_t *) &__reint_184, __p3_184); \
40852 __ret_184 = __noswap_vdot_s32(__rev0_184, __rev1_184, *(int8x8_t *) &__reint1_184); \
40853 __ret_184 = __builtin_shufflevector(__ret_184, __ret_184, 1, 0); \
40854 __ret_184; \
42578#define vdot_laneq_s32(__p0_276, __p1_276, __p2_276, __p3_276) __extension__ ({ \
42579 int32x2_t __s0_276 = __p0_276; \
42580 int8x8_t __s1_276 = __p1_276; \
42581 int8x16_t __s2_276 = __p2_276; \
42582 int32x2_t __rev0_276; __rev0_276 = __builtin_shufflevector(__s0_276, __s0_276, 1, 0); \
42583 int8x8_t __rev1_276; __rev1_276 = __builtin_shufflevector(__s1_276, __s1_276, 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); \
42585 int32x2_t __ret_276; \
42586int8x16_t __reint_276 = __rev2_276; \
42587int32x2_t __reint1_276 = __noswap_splat_laneq_s32(*(int32x4_t *) &__reint_276, __p3_276); \
42588 __ret_276 = __noswap_vdot_s32(__rev0_276, __rev1_276, *(int8x8_t *) &__reint1_276); \
42589 __ret_276 = __builtin_shufflevector(__ret_276, __ret_276, 1, 0); \
42590 __ret_276; \
4085542591})
4085642592#endif
4085742593
......@@ -42518,44 +44254,44 @@ __ai float16x4_t vmul_f16(float16x4_t __p0, float16x4_t __p1) {
4251844254#endif
4251944255
4252044256#ifdef __LITTLE_ENDIAN__
42521#define vmulq_lane_f16(__p0_185, __p1_185, __p2_185) __extension__ ({ \
42522 float16x8_t __s0_185 = __p0_185; \
42523 float16x4_t __s1_185 = __p1_185; \
42524 float16x8_t __ret_185; \
42525 __ret_185 = __s0_185 * splatq_lane_f16(__s1_185, __p2_185); \
42526 __ret_185; \
44257#define vmulq_lane_f16(__p0_277, __p1_277, __p2_277) __extension__ ({ \
44258 float16x8_t __s0_277 = __p0_277; \
44259 float16x4_t __s1_277 = __p1_277; \
44260 float16x8_t __ret_277; \
44261 __ret_277 = __s0_277 * splatq_lane_f16(__s1_277, __p2_277); \
44262 __ret_277; \
4252744263})
4252844264#else
42529#define vmulq_lane_f16(__p0_186, __p1_186, __p2_186) __extension__ ({ \
42530 float16x8_t __s0_186 = __p0_186; \
42531 float16x4_t __s1_186 = __p1_186; \
42532 float16x8_t __rev0_186; __rev0_186 = __builtin_shufflevector(__s0_186, __s0_186, 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); \
42534 float16x8_t __ret_186; \
42535 __ret_186 = __rev0_186 * __noswap_splatq_lane_f16(__rev1_186, __p2_186); \
42536 __ret_186 = __builtin_shufflevector(__ret_186, __ret_186, 7, 6, 5, 4, 3, 2, 1, 0); \
42537 __ret_186; \
44265#define vmulq_lane_f16(__p0_278, __p1_278, __p2_278) __extension__ ({ \
44266 float16x8_t __s0_278 = __p0_278; \
44267 float16x4_t __s1_278 = __p1_278; \
44268 float16x8_t __rev0_278; __rev0_278 = __builtin_shufflevector(__s0_278, __s0_278, 7, 6, 5, 4, 3, 2, 1, 0); \
44269 float16x4_t __rev1_278; __rev1_278 = __builtin_shufflevector(__s1_278, __s1_278, 3, 2, 1, 0); \
44270 float16x8_t __ret_278; \
44271 __ret_278 = __rev0_278 * __noswap_splatq_lane_f16(__rev1_278, __p2_278); \
44272 __ret_278 = __builtin_shufflevector(__ret_278, __ret_278, 7, 6, 5, 4, 3, 2, 1, 0); \
44273 __ret_278; \
4253844274})
4253944275#endif
4254044276
4254144277#ifdef __LITTLE_ENDIAN__
42542#define vmul_lane_f16(__p0_187, __p1_187, __p2_187) __extension__ ({ \
42543 float16x4_t __s0_187 = __p0_187; \
42544 float16x4_t __s1_187 = __p1_187; \
42545 float16x4_t __ret_187; \
42546 __ret_187 = __s0_187 * splat_lane_f16(__s1_187, __p2_187); \
42547 __ret_187; \
44278#define vmul_lane_f16(__p0_279, __p1_279, __p2_279) __extension__ ({ \
44279 float16x4_t __s0_279 = __p0_279; \
44280 float16x4_t __s1_279 = __p1_279; \
44281 float16x4_t __ret_279; \
44282 __ret_279 = __s0_279 * splat_lane_f16(__s1_279, __p2_279); \
44283 __ret_279; \
4254844284})
4254944285#else
42550#define vmul_lane_f16(__p0_188, __p1_188, __p2_188) __extension__ ({ \
42551 float16x4_t __s0_188 = __p0_188; \
42552 float16x4_t __s1_188 = __p1_188; \
42553 float16x4_t __rev0_188; __rev0_188 = __builtin_shufflevector(__s0_188, __s0_188, 3, 2, 1, 0); \
42554 float16x4_t __rev1_188; __rev1_188 = __builtin_shufflevector(__s1_188, __s1_188, 3, 2, 1, 0); \
42555 float16x4_t __ret_188; \
42556 __ret_188 = __rev0_188 * __noswap_splat_lane_f16(__rev1_188, __p2_188); \
42557 __ret_188 = __builtin_shufflevector(__ret_188, __ret_188, 3, 2, 1, 0); \
42558 __ret_188; \
44286#define vmul_lane_f16(__p0_280, __p1_280, __p2_280) __extension__ ({ \
44287 float16x4_t __s0_280 = __p0_280; \
44288 float16x4_t __s1_280 = __p1_280; \
44289 float16x4_t __rev0_280; __rev0_280 = __builtin_shufflevector(__s0_280, __s0_280, 3, 2, 1, 0); \
44290 float16x4_t __rev1_280; __rev1_280 = __builtin_shufflevector(__s1_280, __s1_280, 3, 2, 1, 0); \
44291 float16x4_t __ret_280; \
44292 __ret_280 = __rev0_280 * __noswap_splat_lane_f16(__rev1_280, __p2_280); \
44293 __ret_280 = __builtin_shufflevector(__ret_280, __ret_280, 3, 2, 1, 0); \
44294 __ret_280; \
4255944295})
4256044296#endif
4256144297
......@@ -43297,140 +45033,140 @@ __ai float16x4_t vdiv_f16(float16x4_t __p0, float16x4_t __p1) {
4329745033#endif
4329845034
4329945035#ifdef __LITTLE_ENDIAN__
43300#define vfmsh_lane_f16(__p0_189, __p1_189, __p2_189, __p3_189) __extension__ ({ \
43301 float16_t __s0_189 = __p0_189; \
43302 float16_t __s1_189 = __p1_189; \
43303 float16x4_t __s2_189 = __p2_189; \
43304 float16_t __ret_189; \
43305 __ret_189 = vfmah_lane_f16(__s0_189, -__s1_189, __s2_189, __p3_189); \
43306 __ret_189; \
45036#define vfmsh_lane_f16(__p0_281, __p1_281, __p2_281, __p3_281) __extension__ ({ \
45037 float16_t __s0_281 = __p0_281; \
45038 float16_t __s1_281 = __p1_281; \
45039 float16x4_t __s2_281 = __p2_281; \
45040 float16_t __ret_281; \
45041 __ret_281 = vfmah_lane_f16(__s0_281, -__s1_281, __s2_281, __p3_281); \
45042 __ret_281; \
4330745043})
4330845044#else
43309#define vfmsh_lane_f16(__p0_190, __p1_190, __p2_190, __p3_190) __extension__ ({ \
43310 float16_t __s0_190 = __p0_190; \
43311 float16_t __s1_190 = __p1_190; \
43312 float16x4_t __s2_190 = __p2_190; \
43313 float16x4_t __rev2_190; __rev2_190 = __builtin_shufflevector(__s2_190, __s2_190, 3, 2, 1, 0); \
43314 float16_t __ret_190; \
43315 __ret_190 = __noswap_vfmah_lane_f16(__s0_190, -__s1_190, __rev2_190, __p3_190); \
43316 __ret_190; \
45045#define vfmsh_lane_f16(__p0_282, __p1_282, __p2_282, __p3_282) __extension__ ({ \
45046 float16_t __s0_282 = __p0_282; \
45047 float16_t __s1_282 = __p1_282; \
45048 float16x4_t __s2_282 = __p2_282; \
45049 float16x4_t __rev2_282; __rev2_282 = __builtin_shufflevector(__s2_282, __s2_282, 3, 2, 1, 0); \
45050 float16_t __ret_282; \
45051 __ret_282 = __noswap_vfmah_lane_f16(__s0_282, -__s1_282, __rev2_282, __p3_282); \
45052 __ret_282; \
4331745053})
4331845054#endif
4331945055
4332045056#ifdef __LITTLE_ENDIAN__
43321#define vfmsq_lane_f16(__p0_191, __p1_191, __p2_191, __p3_191) __extension__ ({ \
43322 float16x8_t __s0_191 = __p0_191; \
43323 float16x8_t __s1_191 = __p1_191; \
43324 float16x4_t __s2_191 = __p2_191; \
43325 float16x8_t __ret_191; \
43326 __ret_191 = vfmaq_lane_f16(__s0_191, -__s1_191, __s2_191, __p3_191); \
43327 __ret_191; \
45057#define vfmsq_lane_f16(__p0_283, __p1_283, __p2_283, __p3_283) __extension__ ({ \
45058 float16x8_t __s0_283 = __p0_283; \
45059 float16x8_t __s1_283 = __p1_283; \
45060 float16x4_t __s2_283 = __p2_283; \
45061 float16x8_t __ret_283; \
45062 __ret_283 = vfmaq_lane_f16(__s0_283, -__s1_283, __s2_283, __p3_283); \
45063 __ret_283; \
4332845064})
4332945065#else
43330#define vfmsq_lane_f16(__p0_192, __p1_192, __p2_192, __p3_192) __extension__ ({ \
43331 float16x8_t __s0_192 = __p0_192; \
43332 float16x8_t __s1_192 = __p1_192; \
43333 float16x4_t __s2_192 = __p2_192; \
43334 float16x8_t __rev0_192; __rev0_192 = __builtin_shufflevector(__s0_192, __s0_192, 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); \
43336 float16x4_t __rev2_192; __rev2_192 = __builtin_shufflevector(__s2_192, __s2_192, 3, 2, 1, 0); \
43337 float16x8_t __ret_192; \
43338 __ret_192 = __noswap_vfmaq_lane_f16(__rev0_192, -__rev1_192, __rev2_192, __p3_192); \
43339 __ret_192 = __builtin_shufflevector(__ret_192, __ret_192, 7, 6, 5, 4, 3, 2, 1, 0); \
43340 __ret_192; \
45066#define vfmsq_lane_f16(__p0_284, __p1_284, __p2_284, __p3_284) __extension__ ({ \
45067 float16x8_t __s0_284 = __p0_284; \
45068 float16x8_t __s1_284 = __p1_284; \
45069 float16x4_t __s2_284 = __p2_284; \
45070 float16x8_t __rev0_284; __rev0_284 = __builtin_shufflevector(__s0_284, __s0_284, 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); \
45072 float16x4_t __rev2_284; __rev2_284 = __builtin_shufflevector(__s2_284, __s2_284, 3, 2, 1, 0); \
45073 float16x8_t __ret_284; \
45074 __ret_284 = __noswap_vfmaq_lane_f16(__rev0_284, -__rev1_284, __rev2_284, __p3_284); \
45075 __ret_284 = __builtin_shufflevector(__ret_284, __ret_284, 7, 6, 5, 4, 3, 2, 1, 0); \
45076 __ret_284; \
4334145077})
4334245078#endif
4334345079
4334445080#ifdef __LITTLE_ENDIAN__
43345#define vfms_lane_f16(__p0_193, __p1_193, __p2_193, __p3_193) __extension__ ({ \
43346 float16x4_t __s0_193 = __p0_193; \
43347 float16x4_t __s1_193 = __p1_193; \
43348 float16x4_t __s2_193 = __p2_193; \
43349 float16x4_t __ret_193; \
43350 __ret_193 = vfma_lane_f16(__s0_193, -__s1_193, __s2_193, __p3_193); \
43351 __ret_193; \
45081#define vfms_lane_f16(__p0_285, __p1_285, __p2_285, __p3_285) __extension__ ({ \
45082 float16x4_t __s0_285 = __p0_285; \
45083 float16x4_t __s1_285 = __p1_285; \
45084 float16x4_t __s2_285 = __p2_285; \
45085 float16x4_t __ret_285; \
45086 __ret_285 = vfma_lane_f16(__s0_285, -__s1_285, __s2_285, __p3_285); \
45087 __ret_285; \
4335245088})
4335345089#else
43354#define vfms_lane_f16(__p0_194, __p1_194, __p2_194, __p3_194) __extension__ ({ \
43355 float16x4_t __s0_194 = __p0_194; \
43356 float16x4_t __s1_194 = __p1_194; \
43357 float16x4_t __s2_194 = __p2_194; \
43358 float16x4_t __rev0_194; __rev0_194 = __builtin_shufflevector(__s0_194, __s0_194, 3, 2, 1, 0); \
43359 float16x4_t __rev1_194; __rev1_194 = __builtin_shufflevector(__s1_194, __s1_194, 3, 2, 1, 0); \
43360 float16x4_t __rev2_194; __rev2_194 = __builtin_shufflevector(__s2_194, __s2_194, 3, 2, 1, 0); \
43361 float16x4_t __ret_194; \
43362 __ret_194 = __noswap_vfma_lane_f16(__rev0_194, -__rev1_194, __rev2_194, __p3_194); \
43363 __ret_194 = __builtin_shufflevector(__ret_194, __ret_194, 3, 2, 1, 0); \
43364 __ret_194; \
45090#define vfms_lane_f16(__p0_286, __p1_286, __p2_286, __p3_286) __extension__ ({ \
45091 float16x4_t __s0_286 = __p0_286; \
45092 float16x4_t __s1_286 = __p1_286; \
45093 float16x4_t __s2_286 = __p2_286; \
45094 float16x4_t __rev0_286; __rev0_286 = __builtin_shufflevector(__s0_286, __s0_286, 3, 2, 1, 0); \
45095 float16x4_t __rev1_286; __rev1_286 = __builtin_shufflevector(__s1_286, __s1_286, 3, 2, 1, 0); \
45096 float16x4_t __rev2_286; __rev2_286 = __builtin_shufflevector(__s2_286, __s2_286, 3, 2, 1, 0); \
45097 float16x4_t __ret_286; \
45098 __ret_286 = __noswap_vfma_lane_f16(__rev0_286, -__rev1_286, __rev2_286, __p3_286); \
45099 __ret_286 = __builtin_shufflevector(__ret_286, __ret_286, 3, 2, 1, 0); \
45100 __ret_286; \
4336545101})
4336645102#endif
4336745103
4336845104#ifdef __LITTLE_ENDIAN__
43369#define vfmsh_laneq_f16(__p0_195, __p1_195, __p2_195, __p3_195) __extension__ ({ \
43370 float16_t __s0_195 = __p0_195; \
43371 float16_t __s1_195 = __p1_195; \
43372 float16x8_t __s2_195 = __p2_195; \
43373 float16_t __ret_195; \
43374 __ret_195 = vfmah_laneq_f16(__s0_195, -__s1_195, __s2_195, __p3_195); \
43375 __ret_195; \
45105#define vfmsh_laneq_f16(__p0_287, __p1_287, __p2_287, __p3_287) __extension__ ({ \
45106 float16_t __s0_287 = __p0_287; \
45107 float16_t __s1_287 = __p1_287; \
45108 float16x8_t __s2_287 = __p2_287; \
45109 float16_t __ret_287; \
45110 __ret_287 = vfmah_laneq_f16(__s0_287, -__s1_287, __s2_287, __p3_287); \
45111 __ret_287; \
4337645112})
4337745113#else
43378#define vfmsh_laneq_f16(__p0_196, __p1_196, __p2_196, __p3_196) __extension__ ({ \
43379 float16_t __s0_196 = __p0_196; \
43380 float16_t __s1_196 = __p1_196; \
43381 float16x8_t __s2_196 = __p2_196; \
43382 float16x8_t __rev2_196; __rev2_196 = __builtin_shufflevector(__s2_196, __s2_196, 7, 6, 5, 4, 3, 2, 1, 0); \
43383 float16_t __ret_196; \
43384 __ret_196 = __noswap_vfmah_laneq_f16(__s0_196, -__s1_196, __rev2_196, __p3_196); \
43385 __ret_196; \
45114#define vfmsh_laneq_f16(__p0_288, __p1_288, __p2_288, __p3_288) __extension__ ({ \
45115 float16_t __s0_288 = __p0_288; \
45116 float16_t __s1_288 = __p1_288; \
45117 float16x8_t __s2_288 = __p2_288; \
45118 float16x8_t __rev2_288; __rev2_288 = __builtin_shufflevector(__s2_288, __s2_288, 7, 6, 5, 4, 3, 2, 1, 0); \
45119 float16_t __ret_288; \
45120 __ret_288 = __noswap_vfmah_laneq_f16(__s0_288, -__s1_288, __rev2_288, __p3_288); \
45121 __ret_288; \
4338645122})
4338745123#endif
4338845124
4338945125#ifdef __LITTLE_ENDIAN__
43390#define vfmsq_laneq_f16(__p0_197, __p1_197, __p2_197, __p3_197) __extension__ ({ \
43391 float16x8_t __s0_197 = __p0_197; \
43392 float16x8_t __s1_197 = __p1_197; \
43393 float16x8_t __s2_197 = __p2_197; \
43394 float16x8_t __ret_197; \
43395 __ret_197 = vfmaq_laneq_f16(__s0_197, -__s1_197, __s2_197, __p3_197); \
43396 __ret_197; \
45126#define vfmsq_laneq_f16(__p0_289, __p1_289, __p2_289, __p3_289) __extension__ ({ \
45127 float16x8_t __s0_289 = __p0_289; \
45128 float16x8_t __s1_289 = __p1_289; \
45129 float16x8_t __s2_289 = __p2_289; \
45130 float16x8_t __ret_289; \
45131 __ret_289 = vfmaq_laneq_f16(__s0_289, -__s1_289, __s2_289, __p3_289); \
45132 __ret_289; \
4339745133})
4339845134#else
43399#define vfmsq_laneq_f16(__p0_198, __p1_198, __p2_198, __p3_198) __extension__ ({ \
43400 float16x8_t __s0_198 = __p0_198; \
43401 float16x8_t __s1_198 = __p1_198; \
43402 float16x8_t __s2_198 = __p2_198; \
43403 float16x8_t __rev0_198; __rev0_198 = __builtin_shufflevector(__s0_198, __s0_198, 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); \
43405 float16x8_t __rev2_198; __rev2_198 = __builtin_shufflevector(__s2_198, __s2_198, 7, 6, 5, 4, 3, 2, 1, 0); \
43406 float16x8_t __ret_198; \
43407 __ret_198 = __noswap_vfmaq_laneq_f16(__rev0_198, -__rev1_198, __rev2_198, __p3_198); \
43408 __ret_198 = __builtin_shufflevector(__ret_198, __ret_198, 7, 6, 5, 4, 3, 2, 1, 0); \
43409 __ret_198; \
45135#define vfmsq_laneq_f16(__p0_290, __p1_290, __p2_290, __p3_290) __extension__ ({ \
45136 float16x8_t __s0_290 = __p0_290; \
45137 float16x8_t __s1_290 = __p1_290; \
45138 float16x8_t __s2_290 = __p2_290; \
45139 float16x8_t __rev0_290; __rev0_290 = __builtin_shufflevector(__s0_290, __s0_290, 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); \
45141 float16x8_t __rev2_290; __rev2_290 = __builtin_shufflevector(__s2_290, __s2_290, 7, 6, 5, 4, 3, 2, 1, 0); \
45142 float16x8_t __ret_290; \
45143 __ret_290 = __noswap_vfmaq_laneq_f16(__rev0_290, -__rev1_290, __rev2_290, __p3_290); \
45144 __ret_290 = __builtin_shufflevector(__ret_290, __ret_290, 7, 6, 5, 4, 3, 2, 1, 0); \
45145 __ret_290; \
4341045146})
4341145147#endif
4341245148
4341345149#ifdef __LITTLE_ENDIAN__
43414#define vfms_laneq_f16(__p0_199, __p1_199, __p2_199, __p3_199) __extension__ ({ \
43415 float16x4_t __s0_199 = __p0_199; \
43416 float16x4_t __s1_199 = __p1_199; \
43417 float16x8_t __s2_199 = __p2_199; \
43418 float16x4_t __ret_199; \
43419 __ret_199 = vfma_laneq_f16(__s0_199, -__s1_199, __s2_199, __p3_199); \
43420 __ret_199; \
45150#define vfms_laneq_f16(__p0_291, __p1_291, __p2_291, __p3_291) __extension__ ({ \
45151 float16x4_t __s0_291 = __p0_291; \
45152 float16x4_t __s1_291 = __p1_291; \
45153 float16x8_t __s2_291 = __p2_291; \
45154 float16x4_t __ret_291; \
45155 __ret_291 = vfma_laneq_f16(__s0_291, -__s1_291, __s2_291, __p3_291); \
45156 __ret_291; \
4342145157})
4342245158#else
43423#define vfms_laneq_f16(__p0_200, __p1_200, __p2_200, __p3_200) __extension__ ({ \
43424 float16x4_t __s0_200 = __p0_200; \
43425 float16x4_t __s1_200 = __p1_200; \
43426 float16x8_t __s2_200 = __p2_200; \
43427 float16x4_t __rev0_200; __rev0_200 = __builtin_shufflevector(__s0_200, __s0_200, 3, 2, 1, 0); \
43428 float16x4_t __rev1_200; __rev1_200 = __builtin_shufflevector(__s1_200, __s1_200, 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); \
43430 float16x4_t __ret_200; \
43431 __ret_200 = __noswap_vfma_laneq_f16(__rev0_200, -__rev1_200, __rev2_200, __p3_200); \
43432 __ret_200 = __builtin_shufflevector(__ret_200, __ret_200, 3, 2, 1, 0); \
43433 __ret_200; \
45159#define vfms_laneq_f16(__p0_292, __p1_292, __p2_292, __p3_292) __extension__ ({ \
45160 float16x4_t __s0_292 = __p0_292; \
45161 float16x4_t __s1_292 = __p1_292; \
45162 float16x8_t __s2_292 = __p2_292; \
45163 float16x4_t __rev0_292; __rev0_292 = __builtin_shufflevector(__s0_292, __s0_292, 3, 2, 1, 0); \
45164 float16x4_t __rev1_292; __rev1_292 = __builtin_shufflevector(__s1_292, __s1_292, 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); \
45166 float16x4_t __ret_292; \
45167 __ret_292 = __noswap_vfma_laneq_f16(__rev0_292, -__rev1_292, __rev2_292, __p3_292); \
45168 __ret_292 = __builtin_shufflevector(__ret_292, __ret_292, 3, 2, 1, 0); \
45169 __ret_292; \
4343445170})
4343545171#endif
4343645172
......@@ -43617,44 +45353,44 @@ __ai float16x4_t vdiv_f16(float16x4_t __p0, float16x4_t __p1) {
4361745353#endif
4361845354
4361945355#ifdef __LITTLE_ENDIAN__
43620#define vmulq_laneq_f16(__p0_201, __p1_201, __p2_201) __extension__ ({ \
43621 float16x8_t __s0_201 = __p0_201; \
43622 float16x8_t __s1_201 = __p1_201; \
43623 float16x8_t __ret_201; \
43624 __ret_201 = __s0_201 * splatq_laneq_f16(__s1_201, __p2_201); \
43625 __ret_201; \
45356#define vmulq_laneq_f16(__p0_293, __p1_293, __p2_293) __extension__ ({ \
45357 float16x8_t __s0_293 = __p0_293; \
45358 float16x8_t __s1_293 = __p1_293; \
45359 float16x8_t __ret_293; \
45360 __ret_293 = __s0_293 * splatq_laneq_f16(__s1_293, __p2_293); \
45361 __ret_293; \
4362645362})
4362745363#else
43628#define vmulq_laneq_f16(__p0_202, __p1_202, __p2_202) __extension__ ({ \
43629 float16x8_t __s0_202 = __p0_202; \
43630 float16x8_t __s1_202 = __p1_202; \
43631 float16x8_t __rev0_202; __rev0_202 = __builtin_shufflevector(__s0_202, __s0_202, 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); \
43633 float16x8_t __ret_202; \
43634 __ret_202 = __rev0_202 * __noswap_splatq_laneq_f16(__rev1_202, __p2_202); \
43635 __ret_202 = __builtin_shufflevector(__ret_202, __ret_202, 7, 6, 5, 4, 3, 2, 1, 0); \
43636 __ret_202; \
45364#define vmulq_laneq_f16(__p0_294, __p1_294, __p2_294) __extension__ ({ \
45365 float16x8_t __s0_294 = __p0_294; \
45366 float16x8_t __s1_294 = __p1_294; \
45367 float16x8_t __rev0_294; __rev0_294 = __builtin_shufflevector(__s0_294, __s0_294, 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); \
45369 float16x8_t __ret_294; \
45370 __ret_294 = __rev0_294 * __noswap_splatq_laneq_f16(__rev1_294, __p2_294); \
45371 __ret_294 = __builtin_shufflevector(__ret_294, __ret_294, 7, 6, 5, 4, 3, 2, 1, 0); \
45372 __ret_294; \
4363745373})
4363845374#endif
4363945375
4364045376#ifdef __LITTLE_ENDIAN__
43641#define vmul_laneq_f16(__p0_203, __p1_203, __p2_203) __extension__ ({ \
43642 float16x4_t __s0_203 = __p0_203; \
43643 float16x8_t __s1_203 = __p1_203; \
43644 float16x4_t __ret_203; \
43645 __ret_203 = __s0_203 * splat_laneq_f16(__s1_203, __p2_203); \
43646 __ret_203; \
45377#define vmul_laneq_f16(__p0_295, __p1_295, __p2_295) __extension__ ({ \
45378 float16x4_t __s0_295 = __p0_295; \
45379 float16x8_t __s1_295 = __p1_295; \
45380 float16x4_t __ret_295; \
45381 __ret_295 = __s0_295 * splat_laneq_f16(__s1_295, __p2_295); \
45382 __ret_295; \
4364745383})
4364845384#else
43649#define vmul_laneq_f16(__p0_204, __p1_204, __p2_204) __extension__ ({ \
43650 float16x4_t __s0_204 = __p0_204; \
43651 float16x8_t __s1_204 = __p1_204; \
43652 float16x4_t __rev0_204; __rev0_204 = __builtin_shufflevector(__s0_204, __s0_204, 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); \
43654 float16x4_t __ret_204; \
43655 __ret_204 = __rev0_204 * __noswap_splat_laneq_f16(__rev1_204, __p2_204); \
43656 __ret_204 = __builtin_shufflevector(__ret_204, __ret_204, 3, 2, 1, 0); \
43657 __ret_204; \
45385#define vmul_laneq_f16(__p0_296, __p1_296, __p2_296) __extension__ ({ \
45386 float16x4_t __s0_296 = __p0_296; \
45387 float16x8_t __s1_296 = __p1_296; \
45388 float16x4_t __rev0_296; __rev0_296 = __builtin_shufflevector(__s0_296, __s0_296, 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); \
45390 float16x4_t __ret_296; \
45391 __ret_296 = __rev0_296 * __noswap_splat_laneq_f16(__rev1_296, __p2_296); \
45392 __ret_296 = __builtin_shufflevector(__ret_296, __ret_296, 3, 2, 1, 0); \
45393 __ret_296; \
4365845394})
4365945395#endif
4366045396
......@@ -43722,44 +45458,44 @@ __ai float16x4_t __noswap_vmulx_f16(float16x4_t __p0, float16x4_t __p1) {
4372245458#endif
4372345459
4372445460#ifdef __LITTLE_ENDIAN__
43725#define vmulxq_lane_f16(__p0_205, __p1_205, __p2_205) __extension__ ({ \
43726 float16x8_t __s0_205 = __p0_205; \
43727 float16x4_t __s1_205 = __p1_205; \
43728 float16x8_t __ret_205; \
43729 __ret_205 = vmulxq_f16(__s0_205, splatq_lane_f16(__s1_205, __p2_205)); \
43730 __ret_205; \
45461#define vmulxq_lane_f16(__p0_297, __p1_297, __p2_297) __extension__ ({ \
45462 float16x8_t __s0_297 = __p0_297; \
45463 float16x4_t __s1_297 = __p1_297; \
45464 float16x8_t __ret_297; \
45465 __ret_297 = vmulxq_f16(__s0_297, splatq_lane_f16(__s1_297, __p2_297)); \
45466 __ret_297; \
4373145467})
4373245468#else
43733#define vmulxq_lane_f16(__p0_206, __p1_206, __p2_206) __extension__ ({ \
43734 float16x8_t __s0_206 = __p0_206; \
43735 float16x4_t __s1_206 = __p1_206; \
43736 float16x8_t __rev0_206; __rev0_206 = __builtin_shufflevector(__s0_206, __s0_206, 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); \
43738 float16x8_t __ret_206; \
43739 __ret_206 = __noswap_vmulxq_f16(__rev0_206, __noswap_splatq_lane_f16(__rev1_206, __p2_206)); \
43740 __ret_206 = __builtin_shufflevector(__ret_206, __ret_206, 7, 6, 5, 4, 3, 2, 1, 0); \
43741 __ret_206; \
45469#define vmulxq_lane_f16(__p0_298, __p1_298, __p2_298) __extension__ ({ \
45470 float16x8_t __s0_298 = __p0_298; \
45471 float16x4_t __s1_298 = __p1_298; \
45472 float16x8_t __rev0_298; __rev0_298 = __builtin_shufflevector(__s0_298, __s0_298, 7, 6, 5, 4, 3, 2, 1, 0); \
45473 float16x4_t __rev1_298; __rev1_298 = __builtin_shufflevector(__s1_298, __s1_298, 3, 2, 1, 0); \
45474 float16x8_t __ret_298; \
45475 __ret_298 = __noswap_vmulxq_f16(__rev0_298, __noswap_splatq_lane_f16(__rev1_298, __p2_298)); \
45476 __ret_298 = __builtin_shufflevector(__ret_298, __ret_298, 7, 6, 5, 4, 3, 2, 1, 0); \
45477 __ret_298; \
4374245478})
4374345479#endif
4374445480
4374545481#ifdef __LITTLE_ENDIAN__
43746#define vmulx_lane_f16(__p0_207, __p1_207, __p2_207) __extension__ ({ \
43747 float16x4_t __s0_207 = __p0_207; \
43748 float16x4_t __s1_207 = __p1_207; \
43749 float16x4_t __ret_207; \
43750 __ret_207 = vmulx_f16(__s0_207, splat_lane_f16(__s1_207, __p2_207)); \
43751 __ret_207; \
45482#define vmulx_lane_f16(__p0_299, __p1_299, __p2_299) __extension__ ({ \
45483 float16x4_t __s0_299 = __p0_299; \
45484 float16x4_t __s1_299 = __p1_299; \
45485 float16x4_t __ret_299; \
45486 __ret_299 = vmulx_f16(__s0_299, splat_lane_f16(__s1_299, __p2_299)); \
45487 __ret_299; \
4375245488})
4375345489#else
43754#define vmulx_lane_f16(__p0_208, __p1_208, __p2_208) __extension__ ({ \
43755 float16x4_t __s0_208 = __p0_208; \
43756 float16x4_t __s1_208 = __p1_208; \
43757 float16x4_t __rev0_208; __rev0_208 = __builtin_shufflevector(__s0_208, __s0_208, 3, 2, 1, 0); \
43758 float16x4_t __rev1_208; __rev1_208 = __builtin_shufflevector(__s1_208, __s1_208, 3, 2, 1, 0); \
43759 float16x4_t __ret_208; \
43760 __ret_208 = __noswap_vmulx_f16(__rev0_208, __noswap_splat_lane_f16(__rev1_208, __p2_208)); \
43761 __ret_208 = __builtin_shufflevector(__ret_208, __ret_208, 3, 2, 1, 0); \
43762 __ret_208; \
45490#define vmulx_lane_f16(__p0_300, __p1_300, __p2_300) __extension__ ({ \
45491 float16x4_t __s0_300 = __p0_300; \
45492 float16x4_t __s1_300 = __p1_300; \
45493 float16x4_t __rev0_300; __rev0_300 = __builtin_shufflevector(__s0_300, __s0_300, 3, 2, 1, 0); \
45494 float16x4_t __rev1_300; __rev1_300 = __builtin_shufflevector(__s1_300, __s1_300, 3, 2, 1, 0); \
45495 float16x4_t __ret_300; \
45496 __ret_300 = __noswap_vmulx_f16(__rev0_300, __noswap_splat_lane_f16(__rev1_300, __p2_300)); \
45497 __ret_300 = __builtin_shufflevector(__ret_300, __ret_300, 3, 2, 1, 0); \
45498 __ret_300; \
4376345499})
4376445500#endif
4376545501
......@@ -43783,44 +45519,44 @@ __ai float16x4_t __noswap_vmulx_f16(float16x4_t __p0, float16x4_t __p1) {
4378345519#endif
4378445520
4378545521#ifdef __LITTLE_ENDIAN__
43786#define vmulxq_laneq_f16(__p0_209, __p1_209, __p2_209) __extension__ ({ \
43787 float16x8_t __s0_209 = __p0_209; \
43788 float16x8_t __s1_209 = __p1_209; \
43789 float16x8_t __ret_209; \
43790 __ret_209 = vmulxq_f16(__s0_209, splatq_laneq_f16(__s1_209, __p2_209)); \
43791 __ret_209; \
45522#define vmulxq_laneq_f16(__p0_301, __p1_301, __p2_301) __extension__ ({ \
45523 float16x8_t __s0_301 = __p0_301; \
45524 float16x8_t __s1_301 = __p1_301; \
45525 float16x8_t __ret_301; \
45526 __ret_301 = vmulxq_f16(__s0_301, splatq_laneq_f16(__s1_301, __p2_301)); \
45527 __ret_301; \
4379245528})
4379345529#else
43794#define vmulxq_laneq_f16(__p0_210, __p1_210, __p2_210) __extension__ ({ \
43795 float16x8_t __s0_210 = __p0_210; \
43796 float16x8_t __s1_210 = __p1_210; \
43797 float16x8_t __rev0_210; __rev0_210 = __builtin_shufflevector(__s0_210, __s0_210, 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); \
43799 float16x8_t __ret_210; \
43800 __ret_210 = __noswap_vmulxq_f16(__rev0_210, __noswap_splatq_laneq_f16(__rev1_210, __p2_210)); \
43801 __ret_210 = __builtin_shufflevector(__ret_210, __ret_210, 7, 6, 5, 4, 3, 2, 1, 0); \
43802 __ret_210; \
45530#define vmulxq_laneq_f16(__p0_302, __p1_302, __p2_302) __extension__ ({ \
45531 float16x8_t __s0_302 = __p0_302; \
45532 float16x8_t __s1_302 = __p1_302; \
45533 float16x8_t __rev0_302; __rev0_302 = __builtin_shufflevector(__s0_302, __s0_302, 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); \
45535 float16x8_t __ret_302; \
45536 __ret_302 = __noswap_vmulxq_f16(__rev0_302, __noswap_splatq_laneq_f16(__rev1_302, __p2_302)); \
45537 __ret_302 = __builtin_shufflevector(__ret_302, __ret_302, 7, 6, 5, 4, 3, 2, 1, 0); \
45538 __ret_302; \
4380345539})
4380445540#endif
4380545541
4380645542#ifdef __LITTLE_ENDIAN__
43807#define vmulx_laneq_f16(__p0_211, __p1_211, __p2_211) __extension__ ({ \
43808 float16x4_t __s0_211 = __p0_211; \
43809 float16x8_t __s1_211 = __p1_211; \
43810 float16x4_t __ret_211; \
43811 __ret_211 = vmulx_f16(__s0_211, splat_laneq_f16(__s1_211, __p2_211)); \
43812 __ret_211; \
45543#define vmulx_laneq_f16(__p0_303, __p1_303, __p2_303) __extension__ ({ \
45544 float16x4_t __s0_303 = __p0_303; \
45545 float16x8_t __s1_303 = __p1_303; \
45546 float16x4_t __ret_303; \
45547 __ret_303 = vmulx_f16(__s0_303, splat_laneq_f16(__s1_303, __p2_303)); \
45548 __ret_303; \
4381345549})
4381445550#else
43815#define vmulx_laneq_f16(__p0_212, __p1_212, __p2_212) __extension__ ({ \
43816 float16x4_t __s0_212 = __p0_212; \
43817 float16x8_t __s1_212 = __p1_212; \
43818 float16x4_t __rev0_212; __rev0_212 = __builtin_shufflevector(__s0_212, __s0_212, 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); \
43820 float16x4_t __ret_212; \
43821 __ret_212 = __noswap_vmulx_f16(__rev0_212, __noswap_splat_laneq_f16(__rev1_212, __p2_212)); \
43822 __ret_212 = __builtin_shufflevector(__ret_212, __ret_212, 3, 2, 1, 0); \
43823 __ret_212; \
45551#define vmulx_laneq_f16(__p0_304, __p1_304, __p2_304) __extension__ ({ \
45552 float16x4_t __s0_304 = __p0_304; \
45553 float16x8_t __s1_304 = __p1_304; \
45554 float16x4_t __rev0_304; __rev0_304 = __builtin_shufflevector(__s0_304, __s0_304, 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); \
45556 float16x4_t __ret_304; \
45557 __ret_304 = __noswap_vmulx_f16(__rev0_304, __noswap_splat_laneq_f16(__rev1_304, __p2_304)); \
45558 __ret_304 = __builtin_shufflevector(__ret_304, __ret_304, 3, 2, 1, 0); \
45559 __ret_304; \
4382445560})
4382545561#endif
4382645562
......@@ -44336,54 +46072,54 @@ __ai int32x2_t __noswap_vusdot_s32(int32x2_t __p0, uint8x8_t __p1, int8x8_t __p2
4433646072#endif
4433746073
4433846074#ifdef __LITTLE_ENDIAN__
44339#define vusdotq_lane_s32(__p0_213, __p1_213, __p2_213, __p3_213) __extension__ ({ \
44340 int32x4_t __s0_213 = __p0_213; \
44341 uint8x16_t __s1_213 = __p1_213; \
44342 int8x8_t __s2_213 = __p2_213; \
44343 int32x4_t __ret_213; \
44344int8x8_t __reint_213 = __s2_213; \
44345 __ret_213 = vusdotq_s32(__s0_213, __s1_213, (int8x16_t)(splatq_lane_s32(*(int32x2_t *) &__reint_213, __p3_213))); \
44346 __ret_213; \
46075#define vusdotq_lane_s32(__p0_305, __p1_305, __p2_305, __p3_305) __extension__ ({ \
46076 int32x4_t __s0_305 = __p0_305; \
46077 uint8x16_t __s1_305 = __p1_305; \
46078 int8x8_t __s2_305 = __p2_305; \
46079 int32x4_t __ret_305; \
46080int8x8_t __reint_305 = __s2_305; \
46081 __ret_305 = vusdotq_s32(__s0_305, __s1_305, (int8x16_t)(splatq_lane_s32(*(int32x2_t *) &__reint_305, __p3_305))); \
46082 __ret_305; \
4434746083})
4434846084#else
44349#define vusdotq_lane_s32(__p0_214, __p1_214, __p2_214, __p3_214) __extension__ ({ \
44350 int32x4_t __s0_214 = __p0_214; \
44351 uint8x16_t __s1_214 = __p1_214; \
44352 int8x8_t __s2_214 = __p2_214; \
44353 int32x4_t __rev0_214; __rev0_214 = __builtin_shufflevector(__s0_214, __s0_214, 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); \
44355 int8x8_t __rev2_214; __rev2_214 = __builtin_shufflevector(__s2_214, __s2_214, 7, 6, 5, 4, 3, 2, 1, 0); \
44356 int32x4_t __ret_214; \
44357int8x8_t __reint_214 = __rev2_214; \
44358 __ret_214 = __noswap_vusdotq_s32(__rev0_214, __rev1_214, (int8x16_t)(__noswap_splatq_lane_s32(*(int32x2_t *) &__reint_214, __p3_214))); \
44359 __ret_214 = __builtin_shufflevector(__ret_214, __ret_214, 3, 2, 1, 0); \
44360 __ret_214; \
46085#define vusdotq_lane_s32(__p0_306, __p1_306, __p2_306, __p3_306) __extension__ ({ \
46086 int32x4_t __s0_306 = __p0_306; \
46087 uint8x16_t __s1_306 = __p1_306; \
46088 int8x8_t __s2_306 = __p2_306; \
46089 int32x4_t __rev0_306; __rev0_306 = __builtin_shufflevector(__s0_306, __s0_306, 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); \
46091 int8x8_t __rev2_306; __rev2_306 = __builtin_shufflevector(__s2_306, __s2_306, 7, 6, 5, 4, 3, 2, 1, 0); \
46092 int32x4_t __ret_306; \
46093int8x8_t __reint_306 = __rev2_306; \
46094 __ret_306 = __noswap_vusdotq_s32(__rev0_306, __rev1_306, (int8x16_t)(__noswap_splatq_lane_s32(*(int32x2_t *) &__reint_306, __p3_306))); \
46095 __ret_306 = __builtin_shufflevector(__ret_306, __ret_306, 3, 2, 1, 0); \
46096 __ret_306; \
4436146097})
4436246098#endif
4436346099
4436446100#ifdef __LITTLE_ENDIAN__
44365#define vusdot_lane_s32(__p0_215, __p1_215, __p2_215, __p3_215) __extension__ ({ \
44366 int32x2_t __s0_215 = __p0_215; \
44367 uint8x8_t __s1_215 = __p1_215; \
44368 int8x8_t __s2_215 = __p2_215; \
44369 int32x2_t __ret_215; \
44370int8x8_t __reint_215 = __s2_215; \
44371 __ret_215 = vusdot_s32(__s0_215, __s1_215, (int8x8_t)(splat_lane_s32(*(int32x2_t *) &__reint_215, __p3_215))); \
44372 __ret_215; \
46101#define vusdot_lane_s32(__p0_307, __p1_307, __p2_307, __p3_307) __extension__ ({ \
46102 int32x2_t __s0_307 = __p0_307; \
46103 uint8x8_t __s1_307 = __p1_307; \
46104 int8x8_t __s2_307 = __p2_307; \
46105 int32x2_t __ret_307; \
46106int8x8_t __reint_307 = __s2_307; \
46107 __ret_307 = vusdot_s32(__s0_307, __s1_307, (int8x8_t)(splat_lane_s32(*(int32x2_t *) &__reint_307, __p3_307))); \
46108 __ret_307; \
4437346109})
4437446110#else
44375#define vusdot_lane_s32(__p0_216, __p1_216, __p2_216, __p3_216) __extension__ ({ \
44376 int32x2_t __s0_216 = __p0_216; \
44377 uint8x8_t __s1_216 = __p1_216; \
44378 int8x8_t __s2_216 = __p2_216; \
44379 int32x2_t __rev0_216; __rev0_216 = __builtin_shufflevector(__s0_216, __s0_216, 1, 0); \
44380 uint8x8_t __rev1_216; __rev1_216 = __builtin_shufflevector(__s1_216, __s1_216, 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); \
44382 int32x2_t __ret_216; \
44383int8x8_t __reint_216 = __rev2_216; \
44384 __ret_216 = __noswap_vusdot_s32(__rev0_216, __rev1_216, (int8x8_t)(__noswap_splat_lane_s32(*(int32x2_t *) &__reint_216, __p3_216))); \
44385 __ret_216 = __builtin_shufflevector(__ret_216, __ret_216, 1, 0); \
44386 __ret_216; \
46111#define vusdot_lane_s32(__p0_308, __p1_308, __p2_308, __p3_308) __extension__ ({ \
46112 int32x2_t __s0_308 = __p0_308; \
46113 uint8x8_t __s1_308 = __p1_308; \
46114 int8x8_t __s2_308 = __p2_308; \
46115 int32x2_t __rev0_308; __rev0_308 = __builtin_shufflevector(__s0_308, __s0_308, 1, 0); \
46116 uint8x8_t __rev1_308; __rev1_308 = __builtin_shufflevector(__s1_308, __s1_308, 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); \
46118 int32x2_t __ret_308; \
46119int8x8_t __reint_308 = __rev2_308; \
46120 __ret_308 = __noswap_vusdot_s32(__rev0_308, __rev1_308, (int8x8_t)(__noswap_splat_lane_s32(*(int32x2_t *) &__reint_308, __p3_308))); \
46121 __ret_308 = __builtin_shufflevector(__ret_308, __ret_308, 1, 0); \
46122 __ret_308; \
4438746123})
4438846124#endif
4438946125
......@@ -44480,98 +46216,98 @@ __ai int16x4_t vqrdmlah_s16(int16x4_t __p0, int16x4_t __p1, int16x4_t __p2) {
4448046216#endif
4448146217
4448246218#ifdef __LITTLE_ENDIAN__
44483#define vqrdmlahq_lane_s32(__p0_217, __p1_217, __p2_217, __p3_217) __extension__ ({ \
44484 int32x4_t __s0_217 = __p0_217; \
44485 int32x4_t __s1_217 = __p1_217; \
44486 int32x2_t __s2_217 = __p2_217; \
44487 int32x4_t __ret_217; \
44488 __ret_217 = vqaddq_s32(__s0_217, vqrdmulhq_s32(__s1_217, splatq_lane_s32(__s2_217, __p3_217))); \
44489 __ret_217; \
46219#define vqrdmlahq_lane_s32(__p0_309, __p1_309, __p2_309, __p3_309) __extension__ ({ \
46220 int32x4_t __s0_309 = __p0_309; \
46221 int32x4_t __s1_309 = __p1_309; \
46222 int32x2_t __s2_309 = __p2_309; \
46223 int32x4_t __ret_309; \
46224 __ret_309 = vqaddq_s32(__s0_309, vqrdmulhq_s32(__s1_309, splatq_lane_s32(__s2_309, __p3_309))); \
46225 __ret_309; \
4449046226})
4449146227#else
44492#define vqrdmlahq_lane_s32(__p0_218, __p1_218, __p2_218, __p3_218) __extension__ ({ \
44493 int32x4_t __s0_218 = __p0_218; \
44494 int32x4_t __s1_218 = __p1_218; \
44495 int32x2_t __s2_218 = __p2_218; \
44496 int32x4_t __rev0_218; __rev0_218 = __builtin_shufflevector(__s0_218, __s0_218, 3, 2, 1, 0); \
44497 int32x4_t __rev1_218; __rev1_218 = __builtin_shufflevector(__s1_218, __s1_218, 3, 2, 1, 0); \
44498 int32x2_t __rev2_218; __rev2_218 = __builtin_shufflevector(__s2_218, __s2_218, 1, 0); \
44499 int32x4_t __ret_218; \
44500 __ret_218 = __noswap_vqaddq_s32(__rev0_218, __noswap_vqrdmulhq_s32(__rev1_218, __noswap_splatq_lane_s32(__rev2_218, __p3_218))); \
44501 __ret_218 = __builtin_shufflevector(__ret_218, __ret_218, 3, 2, 1, 0); \
44502 __ret_218; \
46228#define vqrdmlahq_lane_s32(__p0_310, __p1_310, __p2_310, __p3_310) __extension__ ({ \
46229 int32x4_t __s0_310 = __p0_310; \
46230 int32x4_t __s1_310 = __p1_310; \
46231 int32x2_t __s2_310 = __p2_310; \
46232 int32x4_t __rev0_310; __rev0_310 = __builtin_shufflevector(__s0_310, __s0_310, 3, 2, 1, 0); \
46233 int32x4_t __rev1_310; __rev1_310 = __builtin_shufflevector(__s1_310, __s1_310, 3, 2, 1, 0); \
46234 int32x2_t __rev2_310; __rev2_310 = __builtin_shufflevector(__s2_310, __s2_310, 1, 0); \
46235 int32x4_t __ret_310; \
46236 __ret_310 = __noswap_vqaddq_s32(__rev0_310, __noswap_vqrdmulhq_s32(__rev1_310, __noswap_splatq_lane_s32(__rev2_310, __p3_310))); \
46237 __ret_310 = __builtin_shufflevector(__ret_310, __ret_310, 3, 2, 1, 0); \
46238 __ret_310; \
4450346239})
4450446240#endif
4450546241
4450646242#ifdef __LITTLE_ENDIAN__
44507#define vqrdmlahq_lane_s16(__p0_219, __p1_219, __p2_219, __p3_219) __extension__ ({ \
44508 int16x8_t __s0_219 = __p0_219; \
44509 int16x8_t __s1_219 = __p1_219; \
44510 int16x4_t __s2_219 = __p2_219; \
44511 int16x8_t __ret_219; \
44512 __ret_219 = vqaddq_s16(__s0_219, vqrdmulhq_s16(__s1_219, splatq_lane_s16(__s2_219, __p3_219))); \
44513 __ret_219; \
46243#define vqrdmlahq_lane_s16(__p0_311, __p1_311, __p2_311, __p3_311) __extension__ ({ \
46244 int16x8_t __s0_311 = __p0_311; \
46245 int16x8_t __s1_311 = __p1_311; \
46246 int16x4_t __s2_311 = __p2_311; \
46247 int16x8_t __ret_311; \
46248 __ret_311 = vqaddq_s16(__s0_311, vqrdmulhq_s16(__s1_311, splatq_lane_s16(__s2_311, __p3_311))); \
46249 __ret_311; \
4451446250})
4451546251#else
44516#define vqrdmlahq_lane_s16(__p0_220, __p1_220, __p2_220, __p3_220) __extension__ ({ \
44517 int16x8_t __s0_220 = __p0_220; \
44518 int16x8_t __s1_220 = __p1_220; \
44519 int16x4_t __s2_220 = __p2_220; \
44520 int16x8_t __rev0_220; __rev0_220 = __builtin_shufflevector(__s0_220, __s0_220, 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); \
44522 int16x4_t __rev2_220; __rev2_220 = __builtin_shufflevector(__s2_220, __s2_220, 3, 2, 1, 0); \
44523 int16x8_t __ret_220; \
44524 __ret_220 = __noswap_vqaddq_s16(__rev0_220, __noswap_vqrdmulhq_s16(__rev1_220, __noswap_splatq_lane_s16(__rev2_220, __p3_220))); \
44525 __ret_220 = __builtin_shufflevector(__ret_220, __ret_220, 7, 6, 5, 4, 3, 2, 1, 0); \
44526 __ret_220; \
46252#define vqrdmlahq_lane_s16(__p0_312, __p1_312, __p2_312, __p3_312) __extension__ ({ \
46253 int16x8_t __s0_312 = __p0_312; \
46254 int16x8_t __s1_312 = __p1_312; \
46255 int16x4_t __s2_312 = __p2_312; \
46256 int16x8_t __rev0_312; __rev0_312 = __builtin_shufflevector(__s0_312, __s0_312, 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); \
46258 int16x4_t __rev2_312; __rev2_312 = __builtin_shufflevector(__s2_312, __s2_312, 3, 2, 1, 0); \
46259 int16x8_t __ret_312; \
46260 __ret_312 = __noswap_vqaddq_s16(__rev0_312, __noswap_vqrdmulhq_s16(__rev1_312, __noswap_splatq_lane_s16(__rev2_312, __p3_312))); \
46261 __ret_312 = __builtin_shufflevector(__ret_312, __ret_312, 7, 6, 5, 4, 3, 2, 1, 0); \
46262 __ret_312; \
4452746263})
4452846264#endif
4452946265
4453046266#ifdef __LITTLE_ENDIAN__
44531#define vqrdmlah_lane_s32(__p0_221, __p1_221, __p2_221, __p3_221) __extension__ ({ \
44532 int32x2_t __s0_221 = __p0_221; \
44533 int32x2_t __s1_221 = __p1_221; \
44534 int32x2_t __s2_221 = __p2_221; \
44535 int32x2_t __ret_221; \
44536 __ret_221 = vqadd_s32(__s0_221, vqrdmulh_s32(__s1_221, splat_lane_s32(__s2_221, __p3_221))); \
44537 __ret_221; \
46267#define vqrdmlah_lane_s32(__p0_313, __p1_313, __p2_313, __p3_313) __extension__ ({ \
46268 int32x2_t __s0_313 = __p0_313; \
46269 int32x2_t __s1_313 = __p1_313; \
46270 int32x2_t __s2_313 = __p2_313; \
46271 int32x2_t __ret_313; \
46272 __ret_313 = vqadd_s32(__s0_313, vqrdmulh_s32(__s1_313, splat_lane_s32(__s2_313, __p3_313))); \
46273 __ret_313; \
4453846274})
4453946275#else
44540#define vqrdmlah_lane_s32(__p0_222, __p1_222, __p2_222, __p3_222) __extension__ ({ \
44541 int32x2_t __s0_222 = __p0_222; \
44542 int32x2_t __s1_222 = __p1_222; \
44543 int32x2_t __s2_222 = __p2_222; \
44544 int32x2_t __rev0_222; __rev0_222 = __builtin_shufflevector(__s0_222, __s0_222, 1, 0); \
44545 int32x2_t __rev1_222; __rev1_222 = __builtin_shufflevector(__s1_222, __s1_222, 1, 0); \
44546 int32x2_t __rev2_222; __rev2_222 = __builtin_shufflevector(__s2_222, __s2_222, 1, 0); \
44547 int32x2_t __ret_222; \
44548 __ret_222 = __noswap_vqadd_s32(__rev0_222, __noswap_vqrdmulh_s32(__rev1_222, __noswap_splat_lane_s32(__rev2_222, __p3_222))); \
44549 __ret_222 = __builtin_shufflevector(__ret_222, __ret_222, 1, 0); \
44550 __ret_222; \
46276#define vqrdmlah_lane_s32(__p0_314, __p1_314, __p2_314, __p3_314) __extension__ ({ \
46277 int32x2_t __s0_314 = __p0_314; \
46278 int32x2_t __s1_314 = __p1_314; \
46279 int32x2_t __s2_314 = __p2_314; \
46280 int32x2_t __rev0_314; __rev0_314 = __builtin_shufflevector(__s0_314, __s0_314, 1, 0); \
46281 int32x2_t __rev1_314; __rev1_314 = __builtin_shufflevector(__s1_314, __s1_314, 1, 0); \
46282 int32x2_t __rev2_314; __rev2_314 = __builtin_shufflevector(__s2_314, __s2_314, 1, 0); \
46283 int32x2_t __ret_314; \
46284 __ret_314 = __noswap_vqadd_s32(__rev0_314, __noswap_vqrdmulh_s32(__rev1_314, __noswap_splat_lane_s32(__rev2_314, __p3_314))); \
46285 __ret_314 = __builtin_shufflevector(__ret_314, __ret_314, 1, 0); \
46286 __ret_314; \
4455146287})
4455246288#endif
4455346289
4455446290#ifdef __LITTLE_ENDIAN__
44555#define vqrdmlah_lane_s16(__p0_223, __p1_223, __p2_223, __p3_223) __extension__ ({ \
44556 int16x4_t __s0_223 = __p0_223; \
44557 int16x4_t __s1_223 = __p1_223; \
44558 int16x4_t __s2_223 = __p2_223; \
44559 int16x4_t __ret_223; \
44560 __ret_223 = vqadd_s16(__s0_223, vqrdmulh_s16(__s1_223, splat_lane_s16(__s2_223, __p3_223))); \
44561 __ret_223; \
46291#define vqrdmlah_lane_s16(__p0_315, __p1_315, __p2_315, __p3_315) __extension__ ({ \
46292 int16x4_t __s0_315 = __p0_315; \
46293 int16x4_t __s1_315 = __p1_315; \
46294 int16x4_t __s2_315 = __p2_315; \
46295 int16x4_t __ret_315; \
46296 __ret_315 = vqadd_s16(__s0_315, vqrdmulh_s16(__s1_315, splat_lane_s16(__s2_315, __p3_315))); \
46297 __ret_315; \
4456246298})
4456346299#else
44564#define vqrdmlah_lane_s16(__p0_224, __p1_224, __p2_224, __p3_224) __extension__ ({ \
44565 int16x4_t __s0_224 = __p0_224; \
44566 int16x4_t __s1_224 = __p1_224; \
44567 int16x4_t __s2_224 = __p2_224; \
44568 int16x4_t __rev0_224; __rev0_224 = __builtin_shufflevector(__s0_224, __s0_224, 3, 2, 1, 0); \
44569 int16x4_t __rev1_224; __rev1_224 = __builtin_shufflevector(__s1_224, __s1_224, 3, 2, 1, 0); \
44570 int16x4_t __rev2_224; __rev2_224 = __builtin_shufflevector(__s2_224, __s2_224, 3, 2, 1, 0); \
44571 int16x4_t __ret_224; \
44572 __ret_224 = __noswap_vqadd_s16(__rev0_224, __noswap_vqrdmulh_s16(__rev1_224, __noswap_splat_lane_s16(__rev2_224, __p3_224))); \
44573 __ret_224 = __builtin_shufflevector(__ret_224, __ret_224, 3, 2, 1, 0); \
44574 __ret_224; \
46300#define vqrdmlah_lane_s16(__p0_316, __p1_316, __p2_316, __p3_316) __extension__ ({ \
46301 int16x4_t __s0_316 = __p0_316; \
46302 int16x4_t __s1_316 = __p1_316; \
46303 int16x4_t __s2_316 = __p2_316; \
46304 int16x4_t __rev0_316; __rev0_316 = __builtin_shufflevector(__s0_316, __s0_316, 3, 2, 1, 0); \
46305 int16x4_t __rev1_316; __rev1_316 = __builtin_shufflevector(__s1_316, __s1_316, 3, 2, 1, 0); \
46306 int16x4_t __rev2_316; __rev2_316 = __builtin_shufflevector(__s2_316, __s2_316, 3, 2, 1, 0); \
46307 int16x4_t __ret_316; \
46308 __ret_316 = __noswap_vqadd_s16(__rev0_316, __noswap_vqrdmulh_s16(__rev1_316, __noswap_splat_lane_s16(__rev2_316, __p3_316))); \
46309 __ret_316 = __builtin_shufflevector(__ret_316, __ret_316, 3, 2, 1, 0); \
46310 __ret_316; \
4457546311})
4457646312#endif
4457746313
......@@ -44648,292 +46384,292 @@ __ai int16x4_t vqrdmlsh_s16(int16x4_t __p0, int16x4_t __p1, int16x4_t __p2) {
4464846384#endif
4464946385
4465046386#ifdef __LITTLE_ENDIAN__
44651#define vqrdmlshq_lane_s32(__p0_225, __p1_225, __p2_225, __p3_225) __extension__ ({ \
44652 int32x4_t __s0_225 = __p0_225; \
44653 int32x4_t __s1_225 = __p1_225; \
44654 int32x2_t __s2_225 = __p2_225; \
44655 int32x4_t __ret_225; \
44656 __ret_225 = vqsubq_s32(__s0_225, vqrdmulhq_s32(__s1_225, splatq_lane_s32(__s2_225, __p3_225))); \
44657 __ret_225; \
46387#define vqrdmlshq_lane_s32(__p0_317, __p1_317, __p2_317, __p3_317) __extension__ ({ \
46388 int32x4_t __s0_317 = __p0_317; \
46389 int32x4_t __s1_317 = __p1_317; \
46390 int32x2_t __s2_317 = __p2_317; \
46391 int32x4_t __ret_317; \
46392 __ret_317 = vqsubq_s32(__s0_317, vqrdmulhq_s32(__s1_317, splatq_lane_s32(__s2_317, __p3_317))); \
46393 __ret_317; \
4465846394})
4465946395#else
44660#define vqrdmlshq_lane_s32(__p0_226, __p1_226, __p2_226, __p3_226) __extension__ ({ \
44661 int32x4_t __s0_226 = __p0_226; \
44662 int32x4_t __s1_226 = __p1_226; \
44663 int32x2_t __s2_226 = __p2_226; \
44664 int32x4_t __rev0_226; __rev0_226 = __builtin_shufflevector(__s0_226, __s0_226, 3, 2, 1, 0); \
44665 int32x4_t __rev1_226; __rev1_226 = __builtin_shufflevector(__s1_226, __s1_226, 3, 2, 1, 0); \
44666 int32x2_t __rev2_226; __rev2_226 = __builtin_shufflevector(__s2_226, __s2_226, 1, 0); \
44667 int32x4_t __ret_226; \
44668 __ret_226 = __noswap_vqsubq_s32(__rev0_226, __noswap_vqrdmulhq_s32(__rev1_226, __noswap_splatq_lane_s32(__rev2_226, __p3_226))); \
44669 __ret_226 = __builtin_shufflevector(__ret_226, __ret_226, 3, 2, 1, 0); \
44670 __ret_226; \
46396#define vqrdmlshq_lane_s32(__p0_318, __p1_318, __p2_318, __p3_318) __extension__ ({ \
46397 int32x4_t __s0_318 = __p0_318; \
46398 int32x4_t __s1_318 = __p1_318; \
46399 int32x2_t __s2_318 = __p2_318; \
46400 int32x4_t __rev0_318; __rev0_318 = __builtin_shufflevector(__s0_318, __s0_318, 3, 2, 1, 0); \
46401 int32x4_t __rev1_318; __rev1_318 = __builtin_shufflevector(__s1_318, __s1_318, 3, 2, 1, 0); \
46402 int32x2_t __rev2_318; __rev2_318 = __builtin_shufflevector(__s2_318, __s2_318, 1, 0); \
46403 int32x4_t __ret_318; \
46404 __ret_318 = __noswap_vqsubq_s32(__rev0_318, __noswap_vqrdmulhq_s32(__rev1_318, __noswap_splatq_lane_s32(__rev2_318, __p3_318))); \
46405 __ret_318 = __builtin_shufflevector(__ret_318, __ret_318, 3, 2, 1, 0); \
46406 __ret_318; \
4467146407})
4467246408#endif
4467346409
4467446410#ifdef __LITTLE_ENDIAN__
44675#define vqrdmlshq_lane_s16(__p0_227, __p1_227, __p2_227, __p3_227) __extension__ ({ \
44676 int16x8_t __s0_227 = __p0_227; \
44677 int16x8_t __s1_227 = __p1_227; \
44678 int16x4_t __s2_227 = __p2_227; \
44679 int16x8_t __ret_227; \
44680 __ret_227 = vqsubq_s16(__s0_227, vqrdmulhq_s16(__s1_227, splatq_lane_s16(__s2_227, __p3_227))); \
44681 __ret_227; \
46411#define vqrdmlshq_lane_s16(__p0_319, __p1_319, __p2_319, __p3_319) __extension__ ({ \
46412 int16x8_t __s0_319 = __p0_319; \
46413 int16x8_t __s1_319 = __p1_319; \
46414 int16x4_t __s2_319 = __p2_319; \
46415 int16x8_t __ret_319; \
46416 __ret_319 = vqsubq_s16(__s0_319, vqrdmulhq_s16(__s1_319, splatq_lane_s16(__s2_319, __p3_319))); \
46417 __ret_319; \
4468246418})
4468346419#else
44684#define vqrdmlshq_lane_s16(__p0_228, __p1_228, __p2_228, __p3_228) __extension__ ({ \
44685 int16x8_t __s0_228 = __p0_228; \
44686 int16x8_t __s1_228 = __p1_228; \
44687 int16x4_t __s2_228 = __p2_228; \
44688 int16x8_t __rev0_228; __rev0_228 = __builtin_shufflevector(__s0_228, __s0_228, 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); \
44690 int16x4_t __rev2_228; __rev2_228 = __builtin_shufflevector(__s2_228, __s2_228, 3, 2, 1, 0); \
44691 int16x8_t __ret_228; \
44692 __ret_228 = __noswap_vqsubq_s16(__rev0_228, __noswap_vqrdmulhq_s16(__rev1_228, __noswap_splatq_lane_s16(__rev2_228, __p3_228))); \
44693 __ret_228 = __builtin_shufflevector(__ret_228, __ret_228, 7, 6, 5, 4, 3, 2, 1, 0); \
44694 __ret_228; \
46420#define vqrdmlshq_lane_s16(__p0_320, __p1_320, __p2_320, __p3_320) __extension__ ({ \
46421 int16x8_t __s0_320 = __p0_320; \
46422 int16x8_t __s1_320 = __p1_320; \
46423 int16x4_t __s2_320 = __p2_320; \
46424 int16x8_t __rev0_320; __rev0_320 = __builtin_shufflevector(__s0_320, __s0_320, 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); \
46426 int16x4_t __rev2_320; __rev2_320 = __builtin_shufflevector(__s2_320, __s2_320, 3, 2, 1, 0); \
46427 int16x8_t __ret_320; \
46428 __ret_320 = __noswap_vqsubq_s16(__rev0_320, __noswap_vqrdmulhq_s16(__rev1_320, __noswap_splatq_lane_s16(__rev2_320, __p3_320))); \
46429 __ret_320 = __builtin_shufflevector(__ret_320, __ret_320, 7, 6, 5, 4, 3, 2, 1, 0); \
46430 __ret_320; \
4469546431})
4469646432#endif
4469746433
4469846434#ifdef __LITTLE_ENDIAN__
44699#define vqrdmlsh_lane_s32(__p0_229, __p1_229, __p2_229, __p3_229) __extension__ ({ \
44700 int32x2_t __s0_229 = __p0_229; \
44701 int32x2_t __s1_229 = __p1_229; \
44702 int32x2_t __s2_229 = __p2_229; \
44703 int32x2_t __ret_229; \
44704 __ret_229 = vqsub_s32(__s0_229, vqrdmulh_s32(__s1_229, splat_lane_s32(__s2_229, __p3_229))); \
44705 __ret_229; \
46435#define vqrdmlsh_lane_s32(__p0_321, __p1_321, __p2_321, __p3_321) __extension__ ({ \
46436 int32x2_t __s0_321 = __p0_321; \
46437 int32x2_t __s1_321 = __p1_321; \
46438 int32x2_t __s2_321 = __p2_321; \
46439 int32x2_t __ret_321; \
46440 __ret_321 = vqsub_s32(__s0_321, vqrdmulh_s32(__s1_321, splat_lane_s32(__s2_321, __p3_321))); \
46441 __ret_321; \
4470646442})
4470746443#else
44708#define vqrdmlsh_lane_s32(__p0_230, __p1_230, __p2_230, __p3_230) __extension__ ({ \
44709 int32x2_t __s0_230 = __p0_230; \
44710 int32x2_t __s1_230 = __p1_230; \
44711 int32x2_t __s2_230 = __p2_230; \
44712 int32x2_t __rev0_230; __rev0_230 = __builtin_shufflevector(__s0_230, __s0_230, 1, 0); \
44713 int32x2_t __rev1_230; __rev1_230 = __builtin_shufflevector(__s1_230, __s1_230, 1, 0); \
44714 int32x2_t __rev2_230; __rev2_230 = __builtin_shufflevector(__s2_230, __s2_230, 1, 0); \
44715 int32x2_t __ret_230; \
44716 __ret_230 = __noswap_vqsub_s32(__rev0_230, __noswap_vqrdmulh_s32(__rev1_230, __noswap_splat_lane_s32(__rev2_230, __p3_230))); \
44717 __ret_230 = __builtin_shufflevector(__ret_230, __ret_230, 1, 0); \
44718 __ret_230; \
46444#define vqrdmlsh_lane_s32(__p0_322, __p1_322, __p2_322, __p3_322) __extension__ ({ \
46445 int32x2_t __s0_322 = __p0_322; \
46446 int32x2_t __s1_322 = __p1_322; \
46447 int32x2_t __s2_322 = __p2_322; \
46448 int32x2_t __rev0_322; __rev0_322 = __builtin_shufflevector(__s0_322, __s0_322, 1, 0); \
46449 int32x2_t __rev1_322; __rev1_322 = __builtin_shufflevector(__s1_322, __s1_322, 1, 0); \
46450 int32x2_t __rev2_322; __rev2_322 = __builtin_shufflevector(__s2_322, __s2_322, 1, 0); \
46451 int32x2_t __ret_322; \
46452 __ret_322 = __noswap_vqsub_s32(__rev0_322, __noswap_vqrdmulh_s32(__rev1_322, __noswap_splat_lane_s32(__rev2_322, __p3_322))); \
46453 __ret_322 = __builtin_shufflevector(__ret_322, __ret_322, 1, 0); \
46454 __ret_322; \
4471946455})
4472046456#endif
4472146457
4472246458#ifdef __LITTLE_ENDIAN__
44723#define vqrdmlsh_lane_s16(__p0_231, __p1_231, __p2_231, __p3_231) __extension__ ({ \
44724 int16x4_t __s0_231 = __p0_231; \
44725 int16x4_t __s1_231 = __p1_231; \
44726 int16x4_t __s2_231 = __p2_231; \
44727 int16x4_t __ret_231; \
44728 __ret_231 = vqsub_s16(__s0_231, vqrdmulh_s16(__s1_231, splat_lane_s16(__s2_231, __p3_231))); \
44729 __ret_231; \
46459#define vqrdmlsh_lane_s16(__p0_323, __p1_323, __p2_323, __p3_323) __extension__ ({ \
46460 int16x4_t __s0_323 = __p0_323; \
46461 int16x4_t __s1_323 = __p1_323; \
46462 int16x4_t __s2_323 = __p2_323; \
46463 int16x4_t __ret_323; \
46464 __ret_323 = vqsub_s16(__s0_323, vqrdmulh_s16(__s1_323, splat_lane_s16(__s2_323, __p3_323))); \
46465 __ret_323; \
4473046466})
4473146467#else
44732#define vqrdmlsh_lane_s16(__p0_232, __p1_232, __p2_232, __p3_232) __extension__ ({ \
44733 int16x4_t __s0_232 = __p0_232; \
44734 int16x4_t __s1_232 = __p1_232; \
44735 int16x4_t __s2_232 = __p2_232; \
44736 int16x4_t __rev0_232; __rev0_232 = __builtin_shufflevector(__s0_232, __s0_232, 3, 2, 1, 0); \
44737 int16x4_t __rev1_232; __rev1_232 = __builtin_shufflevector(__s1_232, __s1_232, 3, 2, 1, 0); \
44738 int16x4_t __rev2_232; __rev2_232 = __builtin_shufflevector(__s2_232, __s2_232, 3, 2, 1, 0); \
44739 int16x4_t __ret_232; \
44740 __ret_232 = __noswap_vqsub_s16(__rev0_232, __noswap_vqrdmulh_s16(__rev1_232, __noswap_splat_lane_s16(__rev2_232, __p3_232))); \
44741 __ret_232 = __builtin_shufflevector(__ret_232, __ret_232, 3, 2, 1, 0); \
44742 __ret_232; \
46468#define vqrdmlsh_lane_s16(__p0_324, __p1_324, __p2_324, __p3_324) __extension__ ({ \
46469 int16x4_t __s0_324 = __p0_324; \
46470 int16x4_t __s1_324 = __p1_324; \
46471 int16x4_t __s2_324 = __p2_324; \
46472 int16x4_t __rev0_324; __rev0_324 = __builtin_shufflevector(__s0_324, __s0_324, 3, 2, 1, 0); \
46473 int16x4_t __rev1_324; __rev1_324 = __builtin_shufflevector(__s1_324, __s1_324, 3, 2, 1, 0); \
46474 int16x4_t __rev2_324; __rev2_324 = __builtin_shufflevector(__s2_324, __s2_324, 3, 2, 1, 0); \
46475 int16x4_t __ret_324; \
46476 __ret_324 = __noswap_vqsub_s16(__rev0_324, __noswap_vqrdmulh_s16(__rev1_324, __noswap_splat_lane_s16(__rev2_324, __p3_324))); \
46477 __ret_324 = __builtin_shufflevector(__ret_324, __ret_324, 3, 2, 1, 0); \
46478 __ret_324; \
4474346479})
4474446480#endif
4474546481
4474646482#endif
4474746483#if defined(__ARM_FEATURE_QRDMX) && defined(__aarch64__)
4474846484#ifdef __LITTLE_ENDIAN__
44749#define vqrdmlahq_laneq_s32(__p0_233, __p1_233, __p2_233, __p3_233) __extension__ ({ \
44750 int32x4_t __s0_233 = __p0_233; \
44751 int32x4_t __s1_233 = __p1_233; \
44752 int32x4_t __s2_233 = __p2_233; \
44753 int32x4_t __ret_233; \
44754 __ret_233 = vqaddq_s32(__s0_233, vqrdmulhq_s32(__s1_233, splatq_laneq_s32(__s2_233, __p3_233))); \
44755 __ret_233; \
46485#define vqrdmlahq_laneq_s32(__p0_325, __p1_325, __p2_325, __p3_325) __extension__ ({ \
46486 int32x4_t __s0_325 = __p0_325; \
46487 int32x4_t __s1_325 = __p1_325; \
46488 int32x4_t __s2_325 = __p2_325; \
46489 int32x4_t __ret_325; \
46490 __ret_325 = vqaddq_s32(__s0_325, vqrdmulhq_s32(__s1_325, splatq_laneq_s32(__s2_325, __p3_325))); \
46491 __ret_325; \
4475646492})
4475746493#else
44758#define vqrdmlahq_laneq_s32(__p0_234, __p1_234, __p2_234, __p3_234) __extension__ ({ \
44759 int32x4_t __s0_234 = __p0_234; \
44760 int32x4_t __s1_234 = __p1_234; \
44761 int32x4_t __s2_234 = __p2_234; \
44762 int32x4_t __rev0_234; __rev0_234 = __builtin_shufflevector(__s0_234, __s0_234, 3, 2, 1, 0); \
44763 int32x4_t __rev1_234; __rev1_234 = __builtin_shufflevector(__s1_234, __s1_234, 3, 2, 1, 0); \
44764 int32x4_t __rev2_234; __rev2_234 = __builtin_shufflevector(__s2_234, __s2_234, 3, 2, 1, 0); \
44765 int32x4_t __ret_234; \
44766 __ret_234 = __noswap_vqaddq_s32(__rev0_234, __noswap_vqrdmulhq_s32(__rev1_234, __noswap_splatq_laneq_s32(__rev2_234, __p3_234))); \
44767 __ret_234 = __builtin_shufflevector(__ret_234, __ret_234, 3, 2, 1, 0); \
44768 __ret_234; \
46494#define vqrdmlahq_laneq_s32(__p0_326, __p1_326, __p2_326, __p3_326) __extension__ ({ \
46495 int32x4_t __s0_326 = __p0_326; \
46496 int32x4_t __s1_326 = __p1_326; \
46497 int32x4_t __s2_326 = __p2_326; \
46498 int32x4_t __rev0_326; __rev0_326 = __builtin_shufflevector(__s0_326, __s0_326, 3, 2, 1, 0); \
46499 int32x4_t __rev1_326; __rev1_326 = __builtin_shufflevector(__s1_326, __s1_326, 3, 2, 1, 0); \
46500 int32x4_t __rev2_326; __rev2_326 = __builtin_shufflevector(__s2_326, __s2_326, 3, 2, 1, 0); \
46501 int32x4_t __ret_326; \
46502 __ret_326 = __noswap_vqaddq_s32(__rev0_326, __noswap_vqrdmulhq_s32(__rev1_326, __noswap_splatq_laneq_s32(__rev2_326, __p3_326))); \
46503 __ret_326 = __builtin_shufflevector(__ret_326, __ret_326, 3, 2, 1, 0); \
46504 __ret_326; \
4476946505})
4477046506#endif
4477146507
4477246508#ifdef __LITTLE_ENDIAN__
44773#define vqrdmlahq_laneq_s16(__p0_235, __p1_235, __p2_235, __p3_235) __extension__ ({ \
44774 int16x8_t __s0_235 = __p0_235; \
44775 int16x8_t __s1_235 = __p1_235; \
44776 int16x8_t __s2_235 = __p2_235; \
44777 int16x8_t __ret_235; \
44778 __ret_235 = vqaddq_s16(__s0_235, vqrdmulhq_s16(__s1_235, splatq_laneq_s16(__s2_235, __p3_235))); \
44779 __ret_235; \
46509#define vqrdmlahq_laneq_s16(__p0_327, __p1_327, __p2_327, __p3_327) __extension__ ({ \
46510 int16x8_t __s0_327 = __p0_327; \
46511 int16x8_t __s1_327 = __p1_327; \
46512 int16x8_t __s2_327 = __p2_327; \
46513 int16x8_t __ret_327; \
46514 __ret_327 = vqaddq_s16(__s0_327, vqrdmulhq_s16(__s1_327, splatq_laneq_s16(__s2_327, __p3_327))); \
46515 __ret_327; \
4478046516})
4478146517#else
44782#define vqrdmlahq_laneq_s16(__p0_236, __p1_236, __p2_236, __p3_236) __extension__ ({ \
44783 int16x8_t __s0_236 = __p0_236; \
44784 int16x8_t __s1_236 = __p1_236; \
44785 int16x8_t __s2_236 = __p2_236; \
44786 int16x8_t __rev0_236; __rev0_236 = __builtin_shufflevector(__s0_236, __s0_236, 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); \
44788 int16x8_t __rev2_236; __rev2_236 = __builtin_shufflevector(__s2_236, __s2_236, 7, 6, 5, 4, 3, 2, 1, 0); \
44789 int16x8_t __ret_236; \
44790 __ret_236 = __noswap_vqaddq_s16(__rev0_236, __noswap_vqrdmulhq_s16(__rev1_236, __noswap_splatq_laneq_s16(__rev2_236, __p3_236))); \
44791 __ret_236 = __builtin_shufflevector(__ret_236, __ret_236, 7, 6, 5, 4, 3, 2, 1, 0); \
44792 __ret_236; \
46518#define vqrdmlahq_laneq_s16(__p0_328, __p1_328, __p2_328, __p3_328) __extension__ ({ \
46519 int16x8_t __s0_328 = __p0_328; \
46520 int16x8_t __s1_328 = __p1_328; \
46521 int16x8_t __s2_328 = __p2_328; \
46522 int16x8_t __rev0_328; __rev0_328 = __builtin_shufflevector(__s0_328, __s0_328, 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); \
46524 int16x8_t __rev2_328; __rev2_328 = __builtin_shufflevector(__s2_328, __s2_328, 7, 6, 5, 4, 3, 2, 1, 0); \
46525 int16x8_t __ret_328; \
46526 __ret_328 = __noswap_vqaddq_s16(__rev0_328, __noswap_vqrdmulhq_s16(__rev1_328, __noswap_splatq_laneq_s16(__rev2_328, __p3_328))); \
46527 __ret_328 = __builtin_shufflevector(__ret_328, __ret_328, 7, 6, 5, 4, 3, 2, 1, 0); \
46528 __ret_328; \
4479346529})
4479446530#endif
4479546531
4479646532#ifdef __LITTLE_ENDIAN__
44797#define vqrdmlah_laneq_s32(__p0_237, __p1_237, __p2_237, __p3_237) __extension__ ({ \
44798 int32x2_t __s0_237 = __p0_237; \
44799 int32x2_t __s1_237 = __p1_237; \
44800 int32x4_t __s2_237 = __p2_237; \
44801 int32x2_t __ret_237; \
44802 __ret_237 = vqadd_s32(__s0_237, vqrdmulh_s32(__s1_237, splat_laneq_s32(__s2_237, __p3_237))); \
44803 __ret_237; \
46533#define vqrdmlah_laneq_s32(__p0_329, __p1_329, __p2_329, __p3_329) __extension__ ({ \
46534 int32x2_t __s0_329 = __p0_329; \
46535 int32x2_t __s1_329 = __p1_329; \
46536 int32x4_t __s2_329 = __p2_329; \
46537 int32x2_t __ret_329; \
46538 __ret_329 = vqadd_s32(__s0_329, vqrdmulh_s32(__s1_329, splat_laneq_s32(__s2_329, __p3_329))); \
46539 __ret_329; \
4480446540})
4480546541#else
44806#define vqrdmlah_laneq_s32(__p0_238, __p1_238, __p2_238, __p3_238) __extension__ ({ \
44807 int32x2_t __s0_238 = __p0_238; \
44808 int32x2_t __s1_238 = __p1_238; \
44809 int32x4_t __s2_238 = __p2_238; \
44810 int32x2_t __rev0_238; __rev0_238 = __builtin_shufflevector(__s0_238, __s0_238, 1, 0); \
44811 int32x2_t __rev1_238; __rev1_238 = __builtin_shufflevector(__s1_238, __s1_238, 1, 0); \
44812 int32x4_t __rev2_238; __rev2_238 = __builtin_shufflevector(__s2_238, __s2_238, 3, 2, 1, 0); \
44813 int32x2_t __ret_238; \
44814 __ret_238 = __noswap_vqadd_s32(__rev0_238, __noswap_vqrdmulh_s32(__rev1_238, __noswap_splat_laneq_s32(__rev2_238, __p3_238))); \
44815 __ret_238 = __builtin_shufflevector(__ret_238, __ret_238, 1, 0); \
44816 __ret_238; \
46542#define vqrdmlah_laneq_s32(__p0_330, __p1_330, __p2_330, __p3_330) __extension__ ({ \
46543 int32x2_t __s0_330 = __p0_330; \
46544 int32x2_t __s1_330 = __p1_330; \
46545 int32x4_t __s2_330 = __p2_330; \
46546 int32x2_t __rev0_330; __rev0_330 = __builtin_shufflevector(__s0_330, __s0_330, 1, 0); \
46547 int32x2_t __rev1_330; __rev1_330 = __builtin_shufflevector(__s1_330, __s1_330, 1, 0); \
46548 int32x4_t __rev2_330; __rev2_330 = __builtin_shufflevector(__s2_330, __s2_330, 3, 2, 1, 0); \
46549 int32x2_t __ret_330; \
46550 __ret_330 = __noswap_vqadd_s32(__rev0_330, __noswap_vqrdmulh_s32(__rev1_330, __noswap_splat_laneq_s32(__rev2_330, __p3_330))); \
46551 __ret_330 = __builtin_shufflevector(__ret_330, __ret_330, 1, 0); \
46552 __ret_330; \
4481746553})
4481846554#endif
4481946555
4482046556#ifdef __LITTLE_ENDIAN__
44821#define vqrdmlah_laneq_s16(__p0_239, __p1_239, __p2_239, __p3_239) __extension__ ({ \
44822 int16x4_t __s0_239 = __p0_239; \
44823 int16x4_t __s1_239 = __p1_239; \
44824 int16x8_t __s2_239 = __p2_239; \
44825 int16x4_t __ret_239; \
44826 __ret_239 = vqadd_s16(__s0_239, vqrdmulh_s16(__s1_239, splat_laneq_s16(__s2_239, __p3_239))); \
44827 __ret_239; \
46557#define vqrdmlah_laneq_s16(__p0_331, __p1_331, __p2_331, __p3_331) __extension__ ({ \
46558 int16x4_t __s0_331 = __p0_331; \
46559 int16x4_t __s1_331 = __p1_331; \
46560 int16x8_t __s2_331 = __p2_331; \
46561 int16x4_t __ret_331; \
46562 __ret_331 = vqadd_s16(__s0_331, vqrdmulh_s16(__s1_331, splat_laneq_s16(__s2_331, __p3_331))); \
46563 __ret_331; \
4482846564})
4482946565#else
44830#define vqrdmlah_laneq_s16(__p0_240, __p1_240, __p2_240, __p3_240) __extension__ ({ \
44831 int16x4_t __s0_240 = __p0_240; \
44832 int16x4_t __s1_240 = __p1_240; \
44833 int16x8_t __s2_240 = __p2_240; \
44834 int16x4_t __rev0_240; __rev0_240 = __builtin_shufflevector(__s0_240, __s0_240, 3, 2, 1, 0); \
44835 int16x4_t __rev1_240; __rev1_240 = __builtin_shufflevector(__s1_240, __s1_240, 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); \
44837 int16x4_t __ret_240; \
44838 __ret_240 = __noswap_vqadd_s16(__rev0_240, __noswap_vqrdmulh_s16(__rev1_240, __noswap_splat_laneq_s16(__rev2_240, __p3_240))); \
44839 __ret_240 = __builtin_shufflevector(__ret_240, __ret_240, 3, 2, 1, 0); \
44840 __ret_240; \
46566#define vqrdmlah_laneq_s16(__p0_332, __p1_332, __p2_332, __p3_332) __extension__ ({ \
46567 int16x4_t __s0_332 = __p0_332; \
46568 int16x4_t __s1_332 = __p1_332; \
46569 int16x8_t __s2_332 = __p2_332; \
46570 int16x4_t __rev0_332; __rev0_332 = __builtin_shufflevector(__s0_332, __s0_332, 3, 2, 1, 0); \
46571 int16x4_t __rev1_332; __rev1_332 = __builtin_shufflevector(__s1_332, __s1_332, 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); \
46573 int16x4_t __ret_332; \
46574 __ret_332 = __noswap_vqadd_s16(__rev0_332, __noswap_vqrdmulh_s16(__rev1_332, __noswap_splat_laneq_s16(__rev2_332, __p3_332))); \
46575 __ret_332 = __builtin_shufflevector(__ret_332, __ret_332, 3, 2, 1, 0); \
46576 __ret_332; \
4484146577})
4484246578#endif
4484346579
4484446580#ifdef __LITTLE_ENDIAN__
44845#define vqrdmlshq_laneq_s32(__p0_241, __p1_241, __p2_241, __p3_241) __extension__ ({ \
44846 int32x4_t __s0_241 = __p0_241; \
44847 int32x4_t __s1_241 = __p1_241; \
44848 int32x4_t __s2_241 = __p2_241; \
44849 int32x4_t __ret_241; \
44850 __ret_241 = vqsubq_s32(__s0_241, vqrdmulhq_s32(__s1_241, splatq_laneq_s32(__s2_241, __p3_241))); \
44851 __ret_241; \
46581#define vqrdmlshq_laneq_s32(__p0_333, __p1_333, __p2_333, __p3_333) __extension__ ({ \
46582 int32x4_t __s0_333 = __p0_333; \
46583 int32x4_t __s1_333 = __p1_333; \
46584 int32x4_t __s2_333 = __p2_333; \
46585 int32x4_t __ret_333; \
46586 __ret_333 = vqsubq_s32(__s0_333, vqrdmulhq_s32(__s1_333, splatq_laneq_s32(__s2_333, __p3_333))); \
46587 __ret_333; \
4485246588})
4485346589#else
44854#define vqrdmlshq_laneq_s32(__p0_242, __p1_242, __p2_242, __p3_242) __extension__ ({ \
44855 int32x4_t __s0_242 = __p0_242; \
44856 int32x4_t __s1_242 = __p1_242; \
44857 int32x4_t __s2_242 = __p2_242; \
44858 int32x4_t __rev0_242; __rev0_242 = __builtin_shufflevector(__s0_242, __s0_242, 3, 2, 1, 0); \
44859 int32x4_t __rev1_242; __rev1_242 = __builtin_shufflevector(__s1_242, __s1_242, 3, 2, 1, 0); \
44860 int32x4_t __rev2_242; __rev2_242 = __builtin_shufflevector(__s2_242, __s2_242, 3, 2, 1, 0); \
44861 int32x4_t __ret_242; \
44862 __ret_242 = __noswap_vqsubq_s32(__rev0_242, __noswap_vqrdmulhq_s32(__rev1_242, __noswap_splatq_laneq_s32(__rev2_242, __p3_242))); \
44863 __ret_242 = __builtin_shufflevector(__ret_242, __ret_242, 3, 2, 1, 0); \
44864 __ret_242; \
46590#define vqrdmlshq_laneq_s32(__p0_334, __p1_334, __p2_334, __p3_334) __extension__ ({ \
46591 int32x4_t __s0_334 = __p0_334; \
46592 int32x4_t __s1_334 = __p1_334; \
46593 int32x4_t __s2_334 = __p2_334; \
46594 int32x4_t __rev0_334; __rev0_334 = __builtin_shufflevector(__s0_334, __s0_334, 3, 2, 1, 0); \
46595 int32x4_t __rev1_334; __rev1_334 = __builtin_shufflevector(__s1_334, __s1_334, 3, 2, 1, 0); \
46596 int32x4_t __rev2_334; __rev2_334 = __builtin_shufflevector(__s2_334, __s2_334, 3, 2, 1, 0); \
46597 int32x4_t __ret_334; \
46598 __ret_334 = __noswap_vqsubq_s32(__rev0_334, __noswap_vqrdmulhq_s32(__rev1_334, __noswap_splatq_laneq_s32(__rev2_334, __p3_334))); \
46599 __ret_334 = __builtin_shufflevector(__ret_334, __ret_334, 3, 2, 1, 0); \
46600 __ret_334; \
4486546601})
4486646602#endif
4486746603
4486846604#ifdef __LITTLE_ENDIAN__
44869#define vqrdmlshq_laneq_s16(__p0_243, __p1_243, __p2_243, __p3_243) __extension__ ({ \
44870 int16x8_t __s0_243 = __p0_243; \
44871 int16x8_t __s1_243 = __p1_243; \
44872 int16x8_t __s2_243 = __p2_243; \
44873 int16x8_t __ret_243; \
44874 __ret_243 = vqsubq_s16(__s0_243, vqrdmulhq_s16(__s1_243, splatq_laneq_s16(__s2_243, __p3_243))); \
44875 __ret_243; \
46605#define vqrdmlshq_laneq_s16(__p0_335, __p1_335, __p2_335, __p3_335) __extension__ ({ \
46606 int16x8_t __s0_335 = __p0_335; \
46607 int16x8_t __s1_335 = __p1_335; \
46608 int16x8_t __s2_335 = __p2_335; \
46609 int16x8_t __ret_335; \
46610 __ret_335 = vqsubq_s16(__s0_335, vqrdmulhq_s16(__s1_335, splatq_laneq_s16(__s2_335, __p3_335))); \
46611 __ret_335; \
4487646612})
4487746613#else
44878#define vqrdmlshq_laneq_s16(__p0_244, __p1_244, __p2_244, __p3_244) __extension__ ({ \
44879 int16x8_t __s0_244 = __p0_244; \
44880 int16x8_t __s1_244 = __p1_244; \
44881 int16x8_t __s2_244 = __p2_244; \
44882 int16x8_t __rev0_244; __rev0_244 = __builtin_shufflevector(__s0_244, __s0_244, 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); \
44884 int16x8_t __rev2_244; __rev2_244 = __builtin_shufflevector(__s2_244, __s2_244, 7, 6, 5, 4, 3, 2, 1, 0); \
44885 int16x8_t __ret_244; \
44886 __ret_244 = __noswap_vqsubq_s16(__rev0_244, __noswap_vqrdmulhq_s16(__rev1_244, __noswap_splatq_laneq_s16(__rev2_244, __p3_244))); \
44887 __ret_244 = __builtin_shufflevector(__ret_244, __ret_244, 7, 6, 5, 4, 3, 2, 1, 0); \
44888 __ret_244; \
46614#define vqrdmlshq_laneq_s16(__p0_336, __p1_336, __p2_336, __p3_336) __extension__ ({ \
46615 int16x8_t __s0_336 = __p0_336; \
46616 int16x8_t __s1_336 = __p1_336; \
46617 int16x8_t __s2_336 = __p2_336; \
46618 int16x8_t __rev0_336; __rev0_336 = __builtin_shufflevector(__s0_336, __s0_336, 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); \
46620 int16x8_t __rev2_336; __rev2_336 = __builtin_shufflevector(__s2_336, __s2_336, 7, 6, 5, 4, 3, 2, 1, 0); \
46621 int16x8_t __ret_336; \
46622 __ret_336 = __noswap_vqsubq_s16(__rev0_336, __noswap_vqrdmulhq_s16(__rev1_336, __noswap_splatq_laneq_s16(__rev2_336, __p3_336))); \
46623 __ret_336 = __builtin_shufflevector(__ret_336, __ret_336, 7, 6, 5, 4, 3, 2, 1, 0); \
46624 __ret_336; \
4488946625})
4489046626#endif
4489146627
4489246628#ifdef __LITTLE_ENDIAN__
44893#define vqrdmlsh_laneq_s32(__p0_245, __p1_245, __p2_245, __p3_245) __extension__ ({ \
44894 int32x2_t __s0_245 = __p0_245; \
44895 int32x2_t __s1_245 = __p1_245; \
44896 int32x4_t __s2_245 = __p2_245; \
44897 int32x2_t __ret_245; \
44898 __ret_245 = vqsub_s32(__s0_245, vqrdmulh_s32(__s1_245, splat_laneq_s32(__s2_245, __p3_245))); \
44899 __ret_245; \
46629#define vqrdmlsh_laneq_s32(__p0_337, __p1_337, __p2_337, __p3_337) __extension__ ({ \
46630 int32x2_t __s0_337 = __p0_337; \
46631 int32x2_t __s1_337 = __p1_337; \
46632 int32x4_t __s2_337 = __p2_337; \
46633 int32x2_t __ret_337; \
46634 __ret_337 = vqsub_s32(__s0_337, vqrdmulh_s32(__s1_337, splat_laneq_s32(__s2_337, __p3_337))); \
46635 __ret_337; \
4490046636})
4490146637#else
44902#define vqrdmlsh_laneq_s32(__p0_246, __p1_246, __p2_246, __p3_246) __extension__ ({ \
44903 int32x2_t __s0_246 = __p0_246; \
44904 int32x2_t __s1_246 = __p1_246; \
44905 int32x4_t __s2_246 = __p2_246; \
44906 int32x2_t __rev0_246; __rev0_246 = __builtin_shufflevector(__s0_246, __s0_246, 1, 0); \
44907 int32x2_t __rev1_246; __rev1_246 = __builtin_shufflevector(__s1_246, __s1_246, 1, 0); \
44908 int32x4_t __rev2_246; __rev2_246 = __builtin_shufflevector(__s2_246, __s2_246, 3, 2, 1, 0); \
44909 int32x2_t __ret_246; \
44910 __ret_246 = __noswap_vqsub_s32(__rev0_246, __noswap_vqrdmulh_s32(__rev1_246, __noswap_splat_laneq_s32(__rev2_246, __p3_246))); \
44911 __ret_246 = __builtin_shufflevector(__ret_246, __ret_246, 1, 0); \
44912 __ret_246; \
46638#define vqrdmlsh_laneq_s32(__p0_338, __p1_338, __p2_338, __p3_338) __extension__ ({ \
46639 int32x2_t __s0_338 = __p0_338; \
46640 int32x2_t __s1_338 = __p1_338; \
46641 int32x4_t __s2_338 = __p2_338; \
46642 int32x2_t __rev0_338; __rev0_338 = __builtin_shufflevector(__s0_338, __s0_338, 1, 0); \
46643 int32x2_t __rev1_338; __rev1_338 = __builtin_shufflevector(__s1_338, __s1_338, 1, 0); \
46644 int32x4_t __rev2_338; __rev2_338 = __builtin_shufflevector(__s2_338, __s2_338, 3, 2, 1, 0); \
46645 int32x2_t __ret_338; \
46646 __ret_338 = __noswap_vqsub_s32(__rev0_338, __noswap_vqrdmulh_s32(__rev1_338, __noswap_splat_laneq_s32(__rev2_338, __p3_338))); \
46647 __ret_338 = __builtin_shufflevector(__ret_338, __ret_338, 1, 0); \
46648 __ret_338; \
4491346649})
4491446650#endif
4491546651
4491646652#ifdef __LITTLE_ENDIAN__
44917#define vqrdmlsh_laneq_s16(__p0_247, __p1_247, __p2_247, __p3_247) __extension__ ({ \
44918 int16x4_t __s0_247 = __p0_247; \
44919 int16x4_t __s1_247 = __p1_247; \
44920 int16x8_t __s2_247 = __p2_247; \
44921 int16x4_t __ret_247; \
44922 __ret_247 = vqsub_s16(__s0_247, vqrdmulh_s16(__s1_247, splat_laneq_s16(__s2_247, __p3_247))); \
44923 __ret_247; \
46653#define vqrdmlsh_laneq_s16(__p0_339, __p1_339, __p2_339, __p3_339) __extension__ ({ \
46654 int16x4_t __s0_339 = __p0_339; \
46655 int16x4_t __s1_339 = __p1_339; \
46656 int16x8_t __s2_339 = __p2_339; \
46657 int16x4_t __ret_339; \
46658 __ret_339 = vqsub_s16(__s0_339, vqrdmulh_s16(__s1_339, splat_laneq_s16(__s2_339, __p3_339))); \
46659 __ret_339; \
4492446660})
4492546661#else
44926#define vqrdmlsh_laneq_s16(__p0_248, __p1_248, __p2_248, __p3_248) __extension__ ({ \
44927 int16x4_t __s0_248 = __p0_248; \
44928 int16x4_t __s1_248 = __p1_248; \
44929 int16x8_t __s2_248 = __p2_248; \
44930 int16x4_t __rev0_248; __rev0_248 = __builtin_shufflevector(__s0_248, __s0_248, 3, 2, 1, 0); \
44931 int16x4_t __rev1_248; __rev1_248 = __builtin_shufflevector(__s1_248, __s1_248, 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); \
44933 int16x4_t __ret_248; \
44934 __ret_248 = __noswap_vqsub_s16(__rev0_248, __noswap_vqrdmulh_s16(__rev1_248, __noswap_splat_laneq_s16(__rev2_248, __p3_248))); \
44935 __ret_248 = __builtin_shufflevector(__ret_248, __ret_248, 3, 2, 1, 0); \
44936 __ret_248; \
46662#define vqrdmlsh_laneq_s16(__p0_340, __p1_340, __p2_340, __p3_340) __extension__ ({ \
46663 int16x4_t __s0_340 = __p0_340; \
46664 int16x4_t __s1_340 = __p1_340; \
46665 int16x8_t __s2_340 = __p2_340; \
46666 int16x4_t __rev0_340; __rev0_340 = __builtin_shufflevector(__s0_340, __s0_340, 3, 2, 1, 0); \
46667 int16x4_t __rev1_340; __rev1_340 = __builtin_shufflevector(__s1_340, __s1_340, 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); \
46669 int16x4_t __ret_340; \
46670 __ret_340 = __noswap_vqsub_s16(__rev0_340, __noswap_vqrdmulh_s16(__rev1_340, __noswap_splat_laneq_s16(__rev2_340, __p3_340))); \
46671 __ret_340 = __builtin_shufflevector(__ret_340, __ret_340, 3, 2, 1, 0); \
46672 __ret_340; \
4493746673})
4493846674#endif
4493946675
......@@ -45860,9 +47596,9 @@ __ai uint64_t vceqd_u64(uint64_t __p0, uint64_t __p1) {
4586047596 __ret = (uint64_t) __builtin_neon_vceqd_u64(__p0, __p1);
4586147597 return __ret;
4586247598}
45863__ai int64_t vceqd_s64(int64_t __p0, int64_t __p1) {
45864 int64_t __ret;
45865 __ret = (int64_t) __builtin_neon_vceqd_s64(__p0, __p1);
47599__ai uint64_t vceqd_s64(int64_t __p0, int64_t __p1) {
47600 uint64_t __ret;
47601 __ret = (uint64_t) __builtin_neon_vceqd_s64(__p0, __p1);
4586647602 return __ret;
4586747603}
4586847604__ai uint64_t vceqd_f64(float64_t __p0, float64_t __p1) {
......@@ -45881,37 +47617,21 @@ __ai uint8x8_t vceqz_p8(poly8x8_t __p0) {
4588147617 __ret = (uint8x8_t) __builtin_neon_vceqz_v((int8x8_t)__p0, 16);
4588247618 return __ret;
4588347619}
45884#else
45885__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);
45887 uint8x8_t __ret;
45888 __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);
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);
47620#else
47621__ai uint8x8_t vceqz_p8(poly8x8_t __p0) {
47622 poly8x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);
47623 uint8x8_t __ret;
47624 __ret = (uint8x8_t) __builtin_neon_vceqz_v((int8x8_t)__rev0, 16);
47625 __ret = __builtin_shufflevector(__ret, __ret, 7, 6, 5, 4, 3, 2, 1, 0);
4591147626 return __ret;
4591247627}
4591347628#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}
4591547635#ifdef __LITTLE_ENDIAN__
4591647636__ai uint8x16_t vceqzq_p8(poly8x16_t __p0) {
4591747637 uint8x16_t __ret;
......@@ -45944,22 +47664,6 @@ __ai uint64x2_t vceqzq_p64(poly64x2_t __p0) {
4594447664}
4594547665#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
4596347667#ifdef __LITTLE_ENDIAN__
4596447668__ai uint8x16_t vceqzq_u8(uint8x16_t __p0) {
4596547669 uint8x16_t __ret;
......@@ -46252,9 +47956,9 @@ __ai uint64_t vceqzd_u64(uint64_t __p0) {
4625247956 __ret = (uint64_t) __builtin_neon_vceqzd_u64(__p0);
4625347957 return __ret;
4625447958}
46255__ai int64_t vceqzd_s64(int64_t __p0) {
46256 int64_t __ret;
46257 __ret = (int64_t) __builtin_neon_vceqzd_s64(__p0);
47959__ai uint64_t vceqzd_s64(int64_t __p0) {
47960 uint64_t __ret;
47961 __ret = (uint64_t) __builtin_neon_vceqzd_s64(__p0);
4625847962 return __ret;
4625947963}
4626047964__ai uint64_t vceqzd_f64(float64_t __p0) {
......@@ -46333,9 +48037,9 @@ __ai uint64x1_t vcge_s64(int64x1_t __p0, int64x1_t __p1) {
4633348037 __ret = (uint64x1_t)(__p0 >= __p1);
4633448038 return __ret;
4633548039}
46336__ai int64_t vcged_s64(int64_t __p0, int64_t __p1) {
46337 int64_t __ret;
46338 __ret = (int64_t) __builtin_neon_vcged_s64(__p0, __p1);
48040__ai uint64_t vcged_s64(int64_t __p0, int64_t __p1) {
48041 uint64_t __ret;
48042 __ret = (uint64_t) __builtin_neon_vcged_s64(__p0, __p1);
4633948043 return __ret;
4634048044}
4634148045__ai uint64_t vcged_u64(uint64_t __p0, uint64_t __p1) {
......@@ -46523,9 +48227,9 @@ __ai uint16x4_t vcgez_s16(int16x4_t __p0) {
4652348227}
4652448228#endif
4652548229
46526__ai int64_t vcgezd_s64(int64_t __p0) {
46527 int64_t __ret;
46528 __ret = (int64_t) __builtin_neon_vcgezd_s64(__p0);
48230__ai uint64_t vcgezd_s64(int64_t __p0) {
48231 uint64_t __ret;
48232 __ret = (uint64_t) __builtin_neon_vcgezd_s64(__p0);
4652948233 return __ret;
4653048234}
4653148235__ai uint64_t vcgezd_f64(float64_t __p0) {
......@@ -46604,9 +48308,9 @@ __ai uint64x1_t vcgt_s64(int64x1_t __p0, int64x1_t __p1) {
4660448308 __ret = (uint64x1_t)(__p0 > __p1);
4660548309 return __ret;
4660648310}
46607__ai int64_t vcgtd_s64(int64_t __p0, int64_t __p1) {
46608 int64_t __ret;
46609 __ret = (int64_t) __builtin_neon_vcgtd_s64(__p0, __p1);
48311__ai uint64_t vcgtd_s64(int64_t __p0, int64_t __p1) {
48312 uint64_t __ret;
48313 __ret = (uint64_t) __builtin_neon_vcgtd_s64(__p0, __p1);
4661048314 return __ret;
4661148315}
4661248316__ai uint64_t vcgtd_u64(uint64_t __p0, uint64_t __p1) {
......@@ -46794,9 +48498,9 @@ __ai uint16x4_t vcgtz_s16(int16x4_t __p0) {
4679448498}
4679548499#endif
4679648500
46797__ai int64_t vcgtzd_s64(int64_t __p0) {
46798 int64_t __ret;
46799 __ret = (int64_t) __builtin_neon_vcgtzd_s64(__p0);
48501__ai uint64_t vcgtzd_s64(int64_t __p0) {
48502 uint64_t __ret;
48503 __ret = (uint64_t) __builtin_neon_vcgtzd_s64(__p0);
4680048504 return __ret;
4680148505}
4680248506__ai uint64_t vcgtzd_f64(float64_t __p0) {
......@@ -46880,9 +48584,9 @@ __ai uint64_t vcled_u64(uint64_t __p0, uint64_t __p1) {
4688048584 __ret = (uint64_t) __builtin_neon_vcled_u64(__p0, __p1);
4688148585 return __ret;
4688248586}
46883__ai int64_t vcled_s64(int64_t __p0, int64_t __p1) {
46884 int64_t __ret;
46885 __ret = (int64_t) __builtin_neon_vcled_s64(__p0, __p1);
48587__ai uint64_t vcled_s64(int64_t __p0, int64_t __p1) {
48588 uint64_t __ret;
48589 __ret = (uint64_t) __builtin_neon_vcled_s64(__p0, __p1);
4688648590 return __ret;
4688748591}
4688848592__ai uint64_t vcled_f64(float64_t __p0, float64_t __p1) {
......@@ -47065,9 +48769,9 @@ __ai uint16x4_t vclez_s16(int16x4_t __p0) {
4706548769}
4706648770#endif
4706748771
47068__ai int64_t vclezd_s64(int64_t __p0) {
47069 int64_t __ret;
47070 __ret = (int64_t) __builtin_neon_vclezd_s64(__p0);
48772__ai uint64_t vclezd_s64(int64_t __p0) {
48773 uint64_t __ret;
48774 __ret = (uint64_t) __builtin_neon_vclezd_s64(__p0);
4707148775 return __ret;
4707248776}
4707348777__ai uint64_t vclezd_f64(float64_t __p0) {
......@@ -47151,9 +48855,9 @@ __ai uint64_t vcltd_u64(uint64_t __p0, uint64_t __p1) {
4715148855 __ret = (uint64_t) __builtin_neon_vcltd_u64(__p0, __p1);
4715248856 return __ret;
4715348857}
47154__ai int64_t vcltd_s64(int64_t __p0, int64_t __p1) {
47155 int64_t __ret;
47156 __ret = (int64_t) __builtin_neon_vcltd_s64(__p0, __p1);
48858__ai uint64_t vcltd_s64(int64_t __p0, int64_t __p1) {
48859 uint64_t __ret;
48860 __ret = (uint64_t) __builtin_neon_vcltd_s64(__p0, __p1);
4715748861 return __ret;
4715848862}
4715948863__ai uint64_t vcltd_f64(float64_t __p0, float64_t __p1) {
......@@ -47336,9 +49040,9 @@ __ai uint16x4_t vcltz_s16(int16x4_t __p0) {
4733649040}
4733749041#endif
4733849042
47339__ai int64_t vcltzd_s64(int64_t __p0) {
47340 int64_t __ret;
47341 __ret = (int64_t) __builtin_neon_vcltzd_s64(__p0);
49043__ai uint64_t vcltzd_s64(int64_t __p0) {
49044 uint64_t __ret;
49045 __ret = (uint64_t) __builtin_neon_vcltzd_s64(__p0);
4734249046 return __ret;
4734349047}
4734449048__ai uint64_t vcltzd_f64(float64_t __p0) {
......@@ -47382,892 +49086,892 @@ __ai float64x2_t vcombine_f64(float64x1_t __p0, float64x1_t __p1) {
4738249086#endif
4738349087
4738449088#ifdef __LITTLE_ENDIAN__
47385#define vcopyq_lane_p8(__p0_249, __p1_249, __p2_249, __p3_249) __extension__ ({ \
47386 poly8x16_t __s0_249 = __p0_249; \
47387 poly8x8_t __s2_249 = __p2_249; \
47388 poly8x16_t __ret_249; \
47389 __ret_249 = vsetq_lane_p8(vget_lane_p8(__s2_249, __p3_249), __s0_249, __p1_249); \
47390 __ret_249; \
49089#define vcopyq_lane_p8(__p0_341, __p1_341, __p2_341, __p3_341) __extension__ ({ \
49090 poly8x16_t __s0_341 = __p0_341; \
49091 poly8x8_t __s2_341 = __p2_341; \
49092 poly8x16_t __ret_341; \
49093 __ret_341 = vsetq_lane_p8(vget_lane_p8(__s2_341, __p3_341), __s0_341, __p1_341); \
49094 __ret_341; \
4739149095})
4739249096#else
47393#define vcopyq_lane_p8(__p0_250, __p1_250, __p2_250, __p3_250) __extension__ ({ \
47394 poly8x16_t __s0_250 = __p0_250; \
47395 poly8x8_t __s2_250 = __p2_250; \
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); \
47397 poly8x8_t __rev2_250; __rev2_250 = __builtin_shufflevector(__s2_250, __s2_250, 7, 6, 5, 4, 3, 2, 1, 0); \
47398 poly8x16_t __ret_250; \
47399 __ret_250 = __noswap_vsetq_lane_p8(__noswap_vget_lane_p8(__rev2_250, __p3_250), __rev0_250, __p1_250); \
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); \
47401 __ret_250; \
49097#define vcopyq_lane_p8(__p0_342, __p1_342, __p2_342, __p3_342) __extension__ ({ \
49098 poly8x16_t __s0_342 = __p0_342; \
49099 poly8x8_t __s2_342 = __p2_342; \
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); \
49101 poly8x8_t __rev2_342; __rev2_342 = __builtin_shufflevector(__s2_342, __s2_342, 7, 6, 5, 4, 3, 2, 1, 0); \
49102 poly8x16_t __ret_342; \
49103 __ret_342 = __noswap_vsetq_lane_p8(__noswap_vget_lane_p8(__rev2_342, __p3_342), __rev0_342, __p1_342); \
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); \
49105 __ret_342; \
4740249106})
4740349107#endif
4740449108
4740549109#ifdef __LITTLE_ENDIAN__
47406#define vcopyq_lane_p16(__p0_251, __p1_251, __p2_251, __p3_251) __extension__ ({ \
47407 poly16x8_t __s0_251 = __p0_251; \
47408 poly16x4_t __s2_251 = __p2_251; \
47409 poly16x8_t __ret_251; \
47410 __ret_251 = vsetq_lane_p16(vget_lane_p16(__s2_251, __p3_251), __s0_251, __p1_251); \
47411 __ret_251; \
49110#define vcopyq_lane_p16(__p0_343, __p1_343, __p2_343, __p3_343) __extension__ ({ \
49111 poly16x8_t __s0_343 = __p0_343; \
49112 poly16x4_t __s2_343 = __p2_343; \
49113 poly16x8_t __ret_343; \
49114 __ret_343 = vsetq_lane_p16(vget_lane_p16(__s2_343, __p3_343), __s0_343, __p1_343); \
49115 __ret_343; \
4741249116})
4741349117#else
47414#define vcopyq_lane_p16(__p0_252, __p1_252, __p2_252, __p3_252) __extension__ ({ \
47415 poly16x8_t __s0_252 = __p0_252; \
47416 poly16x4_t __s2_252 = __p2_252; \
47417 poly16x8_t __rev0_252; __rev0_252 = __builtin_shufflevector(__s0_252, __s0_252, 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); \
47419 poly16x8_t __ret_252; \
47420 __ret_252 = __noswap_vsetq_lane_p16(__noswap_vget_lane_p16(__rev2_252, __p3_252), __rev0_252, __p1_252); \
47421 __ret_252 = __builtin_shufflevector(__ret_252, __ret_252, 7, 6, 5, 4, 3, 2, 1, 0); \
47422 __ret_252; \
49118#define vcopyq_lane_p16(__p0_344, __p1_344, __p2_344, __p3_344) __extension__ ({ \
49119 poly16x8_t __s0_344 = __p0_344; \
49120 poly16x4_t __s2_344 = __p2_344; \
49121 poly16x8_t __rev0_344; __rev0_344 = __builtin_shufflevector(__s0_344, __s0_344, 7, 6, 5, 4, 3, 2, 1, 0); \
49122 poly16x4_t __rev2_344; __rev2_344 = __builtin_shufflevector(__s2_344, __s2_344, 3, 2, 1, 0); \
49123 poly16x8_t __ret_344; \
49124 __ret_344 = __noswap_vsetq_lane_p16(__noswap_vget_lane_p16(__rev2_344, __p3_344), __rev0_344, __p1_344); \
49125 __ret_344 = __builtin_shufflevector(__ret_344, __ret_344, 7, 6, 5, 4, 3, 2, 1, 0); \
49126 __ret_344; \
4742349127})
4742449128#endif
4742549129
4742649130#ifdef __LITTLE_ENDIAN__
47427#define vcopyq_lane_u8(__p0_253, __p1_253, __p2_253, __p3_253) __extension__ ({ \
47428 uint8x16_t __s0_253 = __p0_253; \
47429 uint8x8_t __s2_253 = __p2_253; \
47430 uint8x16_t __ret_253; \
47431 __ret_253 = vsetq_lane_u8(vget_lane_u8(__s2_253, __p3_253), __s0_253, __p1_253); \
47432 __ret_253; \
49131#define vcopyq_lane_u8(__p0_345, __p1_345, __p2_345, __p3_345) __extension__ ({ \
49132 uint8x16_t __s0_345 = __p0_345; \
49133 uint8x8_t __s2_345 = __p2_345; \
49134 uint8x16_t __ret_345; \
49135 __ret_345 = vsetq_lane_u8(vget_lane_u8(__s2_345, __p3_345), __s0_345, __p1_345); \
49136 __ret_345; \
4743349137})
4743449138#else
47435#define vcopyq_lane_u8(__p0_254, __p1_254, __p2_254, __p3_254) __extension__ ({ \
47436 uint8x16_t __s0_254 = __p0_254; \
47437 uint8x8_t __s2_254 = __p2_254; \
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); \
47439 uint8x8_t __rev2_254; __rev2_254 = __builtin_shufflevector(__s2_254, __s2_254, 7, 6, 5, 4, 3, 2, 1, 0); \
47440 uint8x16_t __ret_254; \
47441 __ret_254 = __noswap_vsetq_lane_u8(__noswap_vget_lane_u8(__rev2_254, __p3_254), __rev0_254, __p1_254); \
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); \
47443 __ret_254; \
49139#define vcopyq_lane_u8(__p0_346, __p1_346, __p2_346, __p3_346) __extension__ ({ \
49140 uint8x16_t __s0_346 = __p0_346; \
49141 uint8x8_t __s2_346 = __p2_346; \
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); \
49143 uint8x8_t __rev2_346; __rev2_346 = __builtin_shufflevector(__s2_346, __s2_346, 7, 6, 5, 4, 3, 2, 1, 0); \
49144 uint8x16_t __ret_346; \
49145 __ret_346 = __noswap_vsetq_lane_u8(__noswap_vget_lane_u8(__rev2_346, __p3_346), __rev0_346, __p1_346); \
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); \
49147 __ret_346; \
4744449148})
4744549149#endif
4744649150
4744749151#ifdef __LITTLE_ENDIAN__
47448#define vcopyq_lane_u32(__p0_255, __p1_255, __p2_255, __p3_255) __extension__ ({ \
47449 uint32x4_t __s0_255 = __p0_255; \
47450 uint32x2_t __s2_255 = __p2_255; \
47451 uint32x4_t __ret_255; \
47452 __ret_255 = vsetq_lane_u32(vget_lane_u32(__s2_255, __p3_255), __s0_255, __p1_255); \
47453 __ret_255; \
49152#define vcopyq_lane_u32(__p0_347, __p1_347, __p2_347, __p3_347) __extension__ ({ \
49153 uint32x4_t __s0_347 = __p0_347; \
49154 uint32x2_t __s2_347 = __p2_347; \
49155 uint32x4_t __ret_347; \
49156 __ret_347 = vsetq_lane_u32(vget_lane_u32(__s2_347, __p3_347), __s0_347, __p1_347); \
49157 __ret_347; \
4745449158})
4745549159#else
47456#define vcopyq_lane_u32(__p0_256, __p1_256, __p2_256, __p3_256) __extension__ ({ \
47457 uint32x4_t __s0_256 = __p0_256; \
47458 uint32x2_t __s2_256 = __p2_256; \
47459 uint32x4_t __rev0_256; __rev0_256 = __builtin_shufflevector(__s0_256, __s0_256, 3, 2, 1, 0); \
47460 uint32x2_t __rev2_256; __rev2_256 = __builtin_shufflevector(__s2_256, __s2_256, 1, 0); \
47461 uint32x4_t __ret_256; \
47462 __ret_256 = __noswap_vsetq_lane_u32(__noswap_vget_lane_u32(__rev2_256, __p3_256), __rev0_256, __p1_256); \
47463 __ret_256 = __builtin_shufflevector(__ret_256, __ret_256, 3, 2, 1, 0); \
47464 __ret_256; \
49160#define vcopyq_lane_u32(__p0_348, __p1_348, __p2_348, __p3_348) __extension__ ({ \
49161 uint32x4_t __s0_348 = __p0_348; \
49162 uint32x2_t __s2_348 = __p2_348; \
49163 uint32x4_t __rev0_348; __rev0_348 = __builtin_shufflevector(__s0_348, __s0_348, 3, 2, 1, 0); \
49164 uint32x2_t __rev2_348; __rev2_348 = __builtin_shufflevector(__s2_348, __s2_348, 1, 0); \
49165 uint32x4_t __ret_348; \
49166 __ret_348 = __noswap_vsetq_lane_u32(__noswap_vget_lane_u32(__rev2_348, __p3_348), __rev0_348, __p1_348); \
49167 __ret_348 = __builtin_shufflevector(__ret_348, __ret_348, 3, 2, 1, 0); \
49168 __ret_348; \
4746549169})
4746649170#endif
4746749171
4746849172#ifdef __LITTLE_ENDIAN__
47469#define vcopyq_lane_u64(__p0_257, __p1_257, __p2_257, __p3_257) __extension__ ({ \
47470 uint64x2_t __s0_257 = __p0_257; \
47471 uint64x1_t __s2_257 = __p2_257; \
47472 uint64x2_t __ret_257; \
47473 __ret_257 = vsetq_lane_u64(vget_lane_u64(__s2_257, __p3_257), __s0_257, __p1_257); \
47474 __ret_257; \
49173#define vcopyq_lane_u64(__p0_349, __p1_349, __p2_349, __p3_349) __extension__ ({ \
49174 uint64x2_t __s0_349 = __p0_349; \
49175 uint64x1_t __s2_349 = __p2_349; \
49176 uint64x2_t __ret_349; \
49177 __ret_349 = vsetq_lane_u64(vget_lane_u64(__s2_349, __p3_349), __s0_349, __p1_349); \
49178 __ret_349; \
4747549179})
4747649180#else
47477#define vcopyq_lane_u64(__p0_258, __p1_258, __p2_258, __p3_258) __extension__ ({ \
47478 uint64x2_t __s0_258 = __p0_258; \
47479 uint64x1_t __s2_258 = __p2_258; \
47480 uint64x2_t __rev0_258; __rev0_258 = __builtin_shufflevector(__s0_258, __s0_258, 1, 0); \
47481 uint64x2_t __ret_258; \
47482 __ret_258 = __noswap_vsetq_lane_u64(vget_lane_u64(__s2_258, __p3_258), __rev0_258, __p1_258); \
47483 __ret_258 = __builtin_shufflevector(__ret_258, __ret_258, 1, 0); \
47484 __ret_258; \
49181#define vcopyq_lane_u64(__p0_350, __p1_350, __p2_350, __p3_350) __extension__ ({ \
49182 uint64x2_t __s0_350 = __p0_350; \
49183 uint64x1_t __s2_350 = __p2_350; \
49184 uint64x2_t __rev0_350; __rev0_350 = __builtin_shufflevector(__s0_350, __s0_350, 1, 0); \
49185 uint64x2_t __ret_350; \
49186 __ret_350 = __noswap_vsetq_lane_u64(vget_lane_u64(__s2_350, __p3_350), __rev0_350, __p1_350); \
49187 __ret_350 = __builtin_shufflevector(__ret_350, __ret_350, 1, 0); \
49188 __ret_350; \
4748549189})
4748649190#endif
4748749191
4748849192#ifdef __LITTLE_ENDIAN__
47489#define vcopyq_lane_u16(__p0_259, __p1_259, __p2_259, __p3_259) __extension__ ({ \
47490 uint16x8_t __s0_259 = __p0_259; \
47491 uint16x4_t __s2_259 = __p2_259; \
47492 uint16x8_t __ret_259; \
47493 __ret_259 = vsetq_lane_u16(vget_lane_u16(__s2_259, __p3_259), __s0_259, __p1_259); \
47494 __ret_259; \
49193#define vcopyq_lane_u16(__p0_351, __p1_351, __p2_351, __p3_351) __extension__ ({ \
49194 uint16x8_t __s0_351 = __p0_351; \
49195 uint16x4_t __s2_351 = __p2_351; \
49196 uint16x8_t __ret_351; \
49197 __ret_351 = vsetq_lane_u16(vget_lane_u16(__s2_351, __p3_351), __s0_351, __p1_351); \
49198 __ret_351; \
4749549199})
4749649200#else
47497#define vcopyq_lane_u16(__p0_260, __p1_260, __p2_260, __p3_260) __extension__ ({ \
47498 uint16x8_t __s0_260 = __p0_260; \
47499 uint16x4_t __s2_260 = __p2_260; \
47500 uint16x8_t __rev0_260; __rev0_260 = __builtin_shufflevector(__s0_260, __s0_260, 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); \
47502 uint16x8_t __ret_260; \
47503 __ret_260 = __noswap_vsetq_lane_u16(__noswap_vget_lane_u16(__rev2_260, __p3_260), __rev0_260, __p1_260); \
47504 __ret_260 = __builtin_shufflevector(__ret_260, __ret_260, 7, 6, 5, 4, 3, 2, 1, 0); \
47505 __ret_260; \
49201#define vcopyq_lane_u16(__p0_352, __p1_352, __p2_352, __p3_352) __extension__ ({ \
49202 uint16x8_t __s0_352 = __p0_352; \
49203 uint16x4_t __s2_352 = __p2_352; \
49204 uint16x8_t __rev0_352; __rev0_352 = __builtin_shufflevector(__s0_352, __s0_352, 7, 6, 5, 4, 3, 2, 1, 0); \
49205 uint16x4_t __rev2_352; __rev2_352 = __builtin_shufflevector(__s2_352, __s2_352, 3, 2, 1, 0); \
49206 uint16x8_t __ret_352; \
49207 __ret_352 = __noswap_vsetq_lane_u16(__noswap_vget_lane_u16(__rev2_352, __p3_352), __rev0_352, __p1_352); \
49208 __ret_352 = __builtin_shufflevector(__ret_352, __ret_352, 7, 6, 5, 4, 3, 2, 1, 0); \
49209 __ret_352; \
4750649210})
4750749211#endif
4750849212
4750949213#ifdef __LITTLE_ENDIAN__
47510#define vcopyq_lane_s8(__p0_261, __p1_261, __p2_261, __p3_261) __extension__ ({ \
47511 int8x16_t __s0_261 = __p0_261; \
47512 int8x8_t __s2_261 = __p2_261; \
47513 int8x16_t __ret_261; \
47514 __ret_261 = vsetq_lane_s8(vget_lane_s8(__s2_261, __p3_261), __s0_261, __p1_261); \
47515 __ret_261; \
49214#define vcopyq_lane_s8(__p0_353, __p1_353, __p2_353, __p3_353) __extension__ ({ \
49215 int8x16_t __s0_353 = __p0_353; \
49216 int8x8_t __s2_353 = __p2_353; \
49217 int8x16_t __ret_353; \
49218 __ret_353 = vsetq_lane_s8(vget_lane_s8(__s2_353, __p3_353), __s0_353, __p1_353); \
49219 __ret_353; \
4751649220})
4751749221#else
47518#define vcopyq_lane_s8(__p0_262, __p1_262, __p2_262, __p3_262) __extension__ ({ \
47519 int8x16_t __s0_262 = __p0_262; \
47520 int8x8_t __s2_262 = __p2_262; \
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); \
47522 int8x8_t __rev2_262; __rev2_262 = __builtin_shufflevector(__s2_262, __s2_262, 7, 6, 5, 4, 3, 2, 1, 0); \
47523 int8x16_t __ret_262; \
47524 __ret_262 = __noswap_vsetq_lane_s8(__noswap_vget_lane_s8(__rev2_262, __p3_262), __rev0_262, __p1_262); \
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); \
47526 __ret_262; \
49222#define vcopyq_lane_s8(__p0_354, __p1_354, __p2_354, __p3_354) __extension__ ({ \
49223 int8x16_t __s0_354 = __p0_354; \
49224 int8x8_t __s2_354 = __p2_354; \
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); \
49226 int8x8_t __rev2_354; __rev2_354 = __builtin_shufflevector(__s2_354, __s2_354, 7, 6, 5, 4, 3, 2, 1, 0); \
49227 int8x16_t __ret_354; \
49228 __ret_354 = __noswap_vsetq_lane_s8(__noswap_vget_lane_s8(__rev2_354, __p3_354), __rev0_354, __p1_354); \
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); \
49230 __ret_354; \
4752749231})
4752849232#endif
4752949233
4753049234#ifdef __LITTLE_ENDIAN__
47531#define vcopyq_lane_f32(__p0_263, __p1_263, __p2_263, __p3_263) __extension__ ({ \
47532 float32x4_t __s0_263 = __p0_263; \
47533 float32x2_t __s2_263 = __p2_263; \
47534 float32x4_t __ret_263; \
47535 __ret_263 = vsetq_lane_f32(vget_lane_f32(__s2_263, __p3_263), __s0_263, __p1_263); \
47536 __ret_263; \
49235#define vcopyq_lane_f32(__p0_355, __p1_355, __p2_355, __p3_355) __extension__ ({ \
49236 float32x4_t __s0_355 = __p0_355; \
49237 float32x2_t __s2_355 = __p2_355; \
49238 float32x4_t __ret_355; \
49239 __ret_355 = vsetq_lane_f32(vget_lane_f32(__s2_355, __p3_355), __s0_355, __p1_355); \
49240 __ret_355; \
4753749241})
4753849242#else
47539#define vcopyq_lane_f32(__p0_264, __p1_264, __p2_264, __p3_264) __extension__ ({ \
47540 float32x4_t __s0_264 = __p0_264; \
47541 float32x2_t __s2_264 = __p2_264; \
47542 float32x4_t __rev0_264; __rev0_264 = __builtin_shufflevector(__s0_264, __s0_264, 3, 2, 1, 0); \
47543 float32x2_t __rev2_264; __rev2_264 = __builtin_shufflevector(__s2_264, __s2_264, 1, 0); \
47544 float32x4_t __ret_264; \
47545 __ret_264 = __noswap_vsetq_lane_f32(__noswap_vget_lane_f32(__rev2_264, __p3_264), __rev0_264, __p1_264); \
47546 __ret_264 = __builtin_shufflevector(__ret_264, __ret_264, 3, 2, 1, 0); \
47547 __ret_264; \
49243#define vcopyq_lane_f32(__p0_356, __p1_356, __p2_356, __p3_356) __extension__ ({ \
49244 float32x4_t __s0_356 = __p0_356; \
49245 float32x2_t __s2_356 = __p2_356; \
49246 float32x4_t __rev0_356; __rev0_356 = __builtin_shufflevector(__s0_356, __s0_356, 3, 2, 1, 0); \
49247 float32x2_t __rev2_356; __rev2_356 = __builtin_shufflevector(__s2_356, __s2_356, 1, 0); \
49248 float32x4_t __ret_356; \
49249 __ret_356 = __noswap_vsetq_lane_f32(__noswap_vget_lane_f32(__rev2_356, __p3_356), __rev0_356, __p1_356); \
49250 __ret_356 = __builtin_shufflevector(__ret_356, __ret_356, 3, 2, 1, 0); \
49251 __ret_356; \
4754849252})
4754949253#endif
4755049254
4755149255#ifdef __LITTLE_ENDIAN__
47552#define vcopyq_lane_s32(__p0_265, __p1_265, __p2_265, __p3_265) __extension__ ({ \
47553 int32x4_t __s0_265 = __p0_265; \
47554 int32x2_t __s2_265 = __p2_265; \
47555 int32x4_t __ret_265; \
47556 __ret_265 = vsetq_lane_s32(vget_lane_s32(__s2_265, __p3_265), __s0_265, __p1_265); \
47557 __ret_265; \
49256#define vcopyq_lane_s32(__p0_357, __p1_357, __p2_357, __p3_357) __extension__ ({ \
49257 int32x4_t __s0_357 = __p0_357; \
49258 int32x2_t __s2_357 = __p2_357; \
49259 int32x4_t __ret_357; \
49260 __ret_357 = vsetq_lane_s32(vget_lane_s32(__s2_357, __p3_357), __s0_357, __p1_357); \
49261 __ret_357; \
4755849262})
4755949263#else
47560#define vcopyq_lane_s32(__p0_266, __p1_266, __p2_266, __p3_266) __extension__ ({ \
47561 int32x4_t __s0_266 = __p0_266; \
47562 int32x2_t __s2_266 = __p2_266; \
47563 int32x4_t __rev0_266; __rev0_266 = __builtin_shufflevector(__s0_266, __s0_266, 3, 2, 1, 0); \
47564 int32x2_t __rev2_266; __rev2_266 = __builtin_shufflevector(__s2_266, __s2_266, 1, 0); \
47565 int32x4_t __ret_266; \
47566 __ret_266 = __noswap_vsetq_lane_s32(__noswap_vget_lane_s32(__rev2_266, __p3_266), __rev0_266, __p1_266); \
47567 __ret_266 = __builtin_shufflevector(__ret_266, __ret_266, 3, 2, 1, 0); \
47568 __ret_266; \
49264#define vcopyq_lane_s32(__p0_358, __p1_358, __p2_358, __p3_358) __extension__ ({ \
49265 int32x4_t __s0_358 = __p0_358; \
49266 int32x2_t __s2_358 = __p2_358; \
49267 int32x4_t __rev0_358; __rev0_358 = __builtin_shufflevector(__s0_358, __s0_358, 3, 2, 1, 0); \
49268 int32x2_t __rev2_358; __rev2_358 = __builtin_shufflevector(__s2_358, __s2_358, 1, 0); \
49269 int32x4_t __ret_358; \
49270 __ret_358 = __noswap_vsetq_lane_s32(__noswap_vget_lane_s32(__rev2_358, __p3_358), __rev0_358, __p1_358); \
49271 __ret_358 = __builtin_shufflevector(__ret_358, __ret_358, 3, 2, 1, 0); \
49272 __ret_358; \
4756949273})
4757049274#endif
4757149275
4757249276#ifdef __LITTLE_ENDIAN__
47573#define vcopyq_lane_s64(__p0_267, __p1_267, __p2_267, __p3_267) __extension__ ({ \
47574 int64x2_t __s0_267 = __p0_267; \
47575 int64x1_t __s2_267 = __p2_267; \
47576 int64x2_t __ret_267; \
47577 __ret_267 = vsetq_lane_s64(vget_lane_s64(__s2_267, __p3_267), __s0_267, __p1_267); \
47578 __ret_267; \
49277#define vcopyq_lane_s64(__p0_359, __p1_359, __p2_359, __p3_359) __extension__ ({ \
49278 int64x2_t __s0_359 = __p0_359; \
49279 int64x1_t __s2_359 = __p2_359; \
49280 int64x2_t __ret_359; \
49281 __ret_359 = vsetq_lane_s64(vget_lane_s64(__s2_359, __p3_359), __s0_359, __p1_359); \
49282 __ret_359; \
4757949283})
4758049284#else
47581#define vcopyq_lane_s64(__p0_268, __p1_268, __p2_268, __p3_268) __extension__ ({ \
47582 int64x2_t __s0_268 = __p0_268; \
47583 int64x1_t __s2_268 = __p2_268; \
47584 int64x2_t __rev0_268; __rev0_268 = __builtin_shufflevector(__s0_268, __s0_268, 1, 0); \
47585 int64x2_t __ret_268; \
47586 __ret_268 = __noswap_vsetq_lane_s64(vget_lane_s64(__s2_268, __p3_268), __rev0_268, __p1_268); \
47587 __ret_268 = __builtin_shufflevector(__ret_268, __ret_268, 1, 0); \
47588 __ret_268; \
49285#define vcopyq_lane_s64(__p0_360, __p1_360, __p2_360, __p3_360) __extension__ ({ \
49286 int64x2_t __s0_360 = __p0_360; \
49287 int64x1_t __s2_360 = __p2_360; \
49288 int64x2_t __rev0_360; __rev0_360 = __builtin_shufflevector(__s0_360, __s0_360, 1, 0); \
49289 int64x2_t __ret_360; \
49290 __ret_360 = __noswap_vsetq_lane_s64(vget_lane_s64(__s2_360, __p3_360), __rev0_360, __p1_360); \
49291 __ret_360 = __builtin_shufflevector(__ret_360, __ret_360, 1, 0); \
49292 __ret_360; \
4758949293})
4759049294#endif
4759149295
4759249296#ifdef __LITTLE_ENDIAN__
47593#define vcopyq_lane_s16(__p0_269, __p1_269, __p2_269, __p3_269) __extension__ ({ \
47594 int16x8_t __s0_269 = __p0_269; \
47595 int16x4_t __s2_269 = __p2_269; \
47596 int16x8_t __ret_269; \
47597 __ret_269 = vsetq_lane_s16(vget_lane_s16(__s2_269, __p3_269), __s0_269, __p1_269); \
47598 __ret_269; \
49297#define vcopyq_lane_s16(__p0_361, __p1_361, __p2_361, __p3_361) __extension__ ({ \
49298 int16x8_t __s0_361 = __p0_361; \
49299 int16x4_t __s2_361 = __p2_361; \
49300 int16x8_t __ret_361; \
49301 __ret_361 = vsetq_lane_s16(vget_lane_s16(__s2_361, __p3_361), __s0_361, __p1_361); \
49302 __ret_361; \
4759949303})
4760049304#else
47601#define vcopyq_lane_s16(__p0_270, __p1_270, __p2_270, __p3_270) __extension__ ({ \
47602 int16x8_t __s0_270 = __p0_270; \
47603 int16x4_t __s2_270 = __p2_270; \
47604 int16x8_t __rev0_270; __rev0_270 = __builtin_shufflevector(__s0_270, __s0_270, 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); \
47606 int16x8_t __ret_270; \
47607 __ret_270 = __noswap_vsetq_lane_s16(__noswap_vget_lane_s16(__rev2_270, __p3_270), __rev0_270, __p1_270); \
47608 __ret_270 = __builtin_shufflevector(__ret_270, __ret_270, 7, 6, 5, 4, 3, 2, 1, 0); \
47609 __ret_270; \
49305#define vcopyq_lane_s16(__p0_362, __p1_362, __p2_362, __p3_362) __extension__ ({ \
49306 int16x8_t __s0_362 = __p0_362; \
49307 int16x4_t __s2_362 = __p2_362; \
49308 int16x8_t __rev0_362; __rev0_362 = __builtin_shufflevector(__s0_362, __s0_362, 7, 6, 5, 4, 3, 2, 1, 0); \
49309 int16x4_t __rev2_362; __rev2_362 = __builtin_shufflevector(__s2_362, __s2_362, 3, 2, 1, 0); \
49310 int16x8_t __ret_362; \
49311 __ret_362 = __noswap_vsetq_lane_s16(__noswap_vget_lane_s16(__rev2_362, __p3_362), __rev0_362, __p1_362); \
49312 __ret_362 = __builtin_shufflevector(__ret_362, __ret_362, 7, 6, 5, 4, 3, 2, 1, 0); \
49313 __ret_362; \
4761049314})
4761149315#endif
4761249316
4761349317#ifdef __LITTLE_ENDIAN__
47614#define vcopy_lane_p8(__p0_271, __p1_271, __p2_271, __p3_271) __extension__ ({ \
47615 poly8x8_t __s0_271 = __p0_271; \
47616 poly8x8_t __s2_271 = __p2_271; \
47617 poly8x8_t __ret_271; \
47618 __ret_271 = vset_lane_p8(vget_lane_p8(__s2_271, __p3_271), __s0_271, __p1_271); \
47619 __ret_271; \
49318#define vcopy_lane_p8(__p0_363, __p1_363, __p2_363, __p3_363) __extension__ ({ \
49319 poly8x8_t __s0_363 = __p0_363; \
49320 poly8x8_t __s2_363 = __p2_363; \
49321 poly8x8_t __ret_363; \
49322 __ret_363 = vset_lane_p8(vget_lane_p8(__s2_363, __p3_363), __s0_363, __p1_363); \
49323 __ret_363; \
4762049324})
4762149325#else
47622#define vcopy_lane_p8(__p0_272, __p1_272, __p2_272, __p3_272) __extension__ ({ \
47623 poly8x8_t __s0_272 = __p0_272; \
47624 poly8x8_t __s2_272 = __p2_272; \
47625 poly8x8_t __rev0_272; __rev0_272 = __builtin_shufflevector(__s0_272, __s0_272, 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); \
47627 poly8x8_t __ret_272; \
47628 __ret_272 = __noswap_vset_lane_p8(__noswap_vget_lane_p8(__rev2_272, __p3_272), __rev0_272, __p1_272); \
47629 __ret_272 = __builtin_shufflevector(__ret_272, __ret_272, 7, 6, 5, 4, 3, 2, 1, 0); \
47630 __ret_272; \
49326#define vcopy_lane_p8(__p0_364, __p1_364, __p2_364, __p3_364) __extension__ ({ \
49327 poly8x8_t __s0_364 = __p0_364; \
49328 poly8x8_t __s2_364 = __p2_364; \
49329 poly8x8_t __rev0_364; __rev0_364 = __builtin_shufflevector(__s0_364, __s0_364, 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); \
49331 poly8x8_t __ret_364; \
49332 __ret_364 = __noswap_vset_lane_p8(__noswap_vget_lane_p8(__rev2_364, __p3_364), __rev0_364, __p1_364); \
49333 __ret_364 = __builtin_shufflevector(__ret_364, __ret_364, 7, 6, 5, 4, 3, 2, 1, 0); \
49334 __ret_364; \
4763149335})
4763249336#endif
4763349337
4763449338#ifdef __LITTLE_ENDIAN__
47635#define vcopy_lane_p16(__p0_273, __p1_273, __p2_273, __p3_273) __extension__ ({ \
47636 poly16x4_t __s0_273 = __p0_273; \
47637 poly16x4_t __s2_273 = __p2_273; \
47638 poly16x4_t __ret_273; \
47639 __ret_273 = vset_lane_p16(vget_lane_p16(__s2_273, __p3_273), __s0_273, __p1_273); \
47640 __ret_273; \
49339#define vcopy_lane_p16(__p0_365, __p1_365, __p2_365, __p3_365) __extension__ ({ \
49340 poly16x4_t __s0_365 = __p0_365; \
49341 poly16x4_t __s2_365 = __p2_365; \
49342 poly16x4_t __ret_365; \
49343 __ret_365 = vset_lane_p16(vget_lane_p16(__s2_365, __p3_365), __s0_365, __p1_365); \
49344 __ret_365; \
4764149345})
4764249346#else
47643#define vcopy_lane_p16(__p0_274, __p1_274, __p2_274, __p3_274) __extension__ ({ \
47644 poly16x4_t __s0_274 = __p0_274; \
47645 poly16x4_t __s2_274 = __p2_274; \
47646 poly16x4_t __rev0_274; __rev0_274 = __builtin_shufflevector(__s0_274, __s0_274, 3, 2, 1, 0); \
47647 poly16x4_t __rev2_274; __rev2_274 = __builtin_shufflevector(__s2_274, __s2_274, 3, 2, 1, 0); \
47648 poly16x4_t __ret_274; \
47649 __ret_274 = __noswap_vset_lane_p16(__noswap_vget_lane_p16(__rev2_274, __p3_274), __rev0_274, __p1_274); \
47650 __ret_274 = __builtin_shufflevector(__ret_274, __ret_274, 3, 2, 1, 0); \
47651 __ret_274; \
49347#define vcopy_lane_p16(__p0_366, __p1_366, __p2_366, __p3_366) __extension__ ({ \
49348 poly16x4_t __s0_366 = __p0_366; \
49349 poly16x4_t __s2_366 = __p2_366; \
49350 poly16x4_t __rev0_366; __rev0_366 = __builtin_shufflevector(__s0_366, __s0_366, 3, 2, 1, 0); \
49351 poly16x4_t __rev2_366; __rev2_366 = __builtin_shufflevector(__s2_366, __s2_366, 3, 2, 1, 0); \
49352 poly16x4_t __ret_366; \
49353 __ret_366 = __noswap_vset_lane_p16(__noswap_vget_lane_p16(__rev2_366, __p3_366), __rev0_366, __p1_366); \
49354 __ret_366 = __builtin_shufflevector(__ret_366, __ret_366, 3, 2, 1, 0); \
49355 __ret_366; \
4765249356})
4765349357#endif
4765449358
4765549359#ifdef __LITTLE_ENDIAN__
47656#define vcopy_lane_u8(__p0_275, __p1_275, __p2_275, __p3_275) __extension__ ({ \
47657 uint8x8_t __s0_275 = __p0_275; \
47658 uint8x8_t __s2_275 = __p2_275; \
47659 uint8x8_t __ret_275; \
47660 __ret_275 = vset_lane_u8(vget_lane_u8(__s2_275, __p3_275), __s0_275, __p1_275); \
47661 __ret_275; \
49360#define vcopy_lane_u8(__p0_367, __p1_367, __p2_367, __p3_367) __extension__ ({ \
49361 uint8x8_t __s0_367 = __p0_367; \
49362 uint8x8_t __s2_367 = __p2_367; \
49363 uint8x8_t __ret_367; \
49364 __ret_367 = vset_lane_u8(vget_lane_u8(__s2_367, __p3_367), __s0_367, __p1_367); \
49365 __ret_367; \
4766249366})
4766349367#else
47664#define vcopy_lane_u8(__p0_276, __p1_276, __p2_276, __p3_276) __extension__ ({ \
47665 uint8x8_t __s0_276 = __p0_276; \
47666 uint8x8_t __s2_276 = __p2_276; \
47667 uint8x8_t __rev0_276; __rev0_276 = __builtin_shufflevector(__s0_276, __s0_276, 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); \
47669 uint8x8_t __ret_276; \
47670 __ret_276 = __noswap_vset_lane_u8(__noswap_vget_lane_u8(__rev2_276, __p3_276), __rev0_276, __p1_276); \
47671 __ret_276 = __builtin_shufflevector(__ret_276, __ret_276, 7, 6, 5, 4, 3, 2, 1, 0); \
47672 __ret_276; \
49368#define vcopy_lane_u8(__p0_368, __p1_368, __p2_368, __p3_368) __extension__ ({ \
49369 uint8x8_t __s0_368 = __p0_368; \
49370 uint8x8_t __s2_368 = __p2_368; \
49371 uint8x8_t __rev0_368; __rev0_368 = __builtin_shufflevector(__s0_368, __s0_368, 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); \
49373 uint8x8_t __ret_368; \
49374 __ret_368 = __noswap_vset_lane_u8(__noswap_vget_lane_u8(__rev2_368, __p3_368), __rev0_368, __p1_368); \
49375 __ret_368 = __builtin_shufflevector(__ret_368, __ret_368, 7, 6, 5, 4, 3, 2, 1, 0); \
49376 __ret_368; \
4767349377})
4767449378#endif
4767549379
4767649380#ifdef __LITTLE_ENDIAN__
47677#define vcopy_lane_u32(__p0_277, __p1_277, __p2_277, __p3_277) __extension__ ({ \
47678 uint32x2_t __s0_277 = __p0_277; \
47679 uint32x2_t __s2_277 = __p2_277; \
47680 uint32x2_t __ret_277; \
47681 __ret_277 = vset_lane_u32(vget_lane_u32(__s2_277, __p3_277), __s0_277, __p1_277); \
47682 __ret_277; \
49381#define vcopy_lane_u32(__p0_369, __p1_369, __p2_369, __p3_369) __extension__ ({ \
49382 uint32x2_t __s0_369 = __p0_369; \
49383 uint32x2_t __s2_369 = __p2_369; \
49384 uint32x2_t __ret_369; \
49385 __ret_369 = vset_lane_u32(vget_lane_u32(__s2_369, __p3_369), __s0_369, __p1_369); \
49386 __ret_369; \
4768349387})
4768449388#else
47685#define vcopy_lane_u32(__p0_278, __p1_278, __p2_278, __p3_278) __extension__ ({ \
47686 uint32x2_t __s0_278 = __p0_278; \
47687 uint32x2_t __s2_278 = __p2_278; \
47688 uint32x2_t __rev0_278; __rev0_278 = __builtin_shufflevector(__s0_278, __s0_278, 1, 0); \
47689 uint32x2_t __rev2_278; __rev2_278 = __builtin_shufflevector(__s2_278, __s2_278, 1, 0); \
47690 uint32x2_t __ret_278; \
47691 __ret_278 = __noswap_vset_lane_u32(__noswap_vget_lane_u32(__rev2_278, __p3_278), __rev0_278, __p1_278); \
47692 __ret_278 = __builtin_shufflevector(__ret_278, __ret_278, 1, 0); \
47693 __ret_278; \
49389#define vcopy_lane_u32(__p0_370, __p1_370, __p2_370, __p3_370) __extension__ ({ \
49390 uint32x2_t __s0_370 = __p0_370; \
49391 uint32x2_t __s2_370 = __p2_370; \
49392 uint32x2_t __rev0_370; __rev0_370 = __builtin_shufflevector(__s0_370, __s0_370, 1, 0); \
49393 uint32x2_t __rev2_370; __rev2_370 = __builtin_shufflevector(__s2_370, __s2_370, 1, 0); \
49394 uint32x2_t __ret_370; \
49395 __ret_370 = __noswap_vset_lane_u32(__noswap_vget_lane_u32(__rev2_370, __p3_370), __rev0_370, __p1_370); \
49396 __ret_370 = __builtin_shufflevector(__ret_370, __ret_370, 1, 0); \
49397 __ret_370; \
4769449398})
4769549399#endif
4769649400
47697#define vcopy_lane_u64(__p0_279, __p1_279, __p2_279, __p3_279) __extension__ ({ \
47698 uint64x1_t __s0_279 = __p0_279; \
47699 uint64x1_t __s2_279 = __p2_279; \
47700 uint64x1_t __ret_279; \
47701 __ret_279 = vset_lane_u64(vget_lane_u64(__s2_279, __p3_279), __s0_279, __p1_279); \
47702 __ret_279; \
49401#define vcopy_lane_u64(__p0_371, __p1_371, __p2_371, __p3_371) __extension__ ({ \
49402 uint64x1_t __s0_371 = __p0_371; \
49403 uint64x1_t __s2_371 = __p2_371; \
49404 uint64x1_t __ret_371; \
49405 __ret_371 = vset_lane_u64(vget_lane_u64(__s2_371, __p3_371), __s0_371, __p1_371); \
49406 __ret_371; \
4770349407})
4770449408#ifdef __LITTLE_ENDIAN__
47705#define vcopy_lane_u16(__p0_280, __p1_280, __p2_280, __p3_280) __extension__ ({ \
47706 uint16x4_t __s0_280 = __p0_280; \
47707 uint16x4_t __s2_280 = __p2_280; \
47708 uint16x4_t __ret_280; \
47709 __ret_280 = vset_lane_u16(vget_lane_u16(__s2_280, __p3_280), __s0_280, __p1_280); \
47710 __ret_280; \
49409#define vcopy_lane_u16(__p0_372, __p1_372, __p2_372, __p3_372) __extension__ ({ \
49410 uint16x4_t __s0_372 = __p0_372; \
49411 uint16x4_t __s2_372 = __p2_372; \
49412 uint16x4_t __ret_372; \
49413 __ret_372 = vset_lane_u16(vget_lane_u16(__s2_372, __p3_372), __s0_372, __p1_372); \
49414 __ret_372; \
4771149415})
4771249416#else
47713#define vcopy_lane_u16(__p0_281, __p1_281, __p2_281, __p3_281) __extension__ ({ \
47714 uint16x4_t __s0_281 = __p0_281; \
47715 uint16x4_t __s2_281 = __p2_281; \
47716 uint16x4_t __rev0_281; __rev0_281 = __builtin_shufflevector(__s0_281, __s0_281, 3, 2, 1, 0); \
47717 uint16x4_t __rev2_281; __rev2_281 = __builtin_shufflevector(__s2_281, __s2_281, 3, 2, 1, 0); \
47718 uint16x4_t __ret_281; \
47719 __ret_281 = __noswap_vset_lane_u16(__noswap_vget_lane_u16(__rev2_281, __p3_281), __rev0_281, __p1_281); \
47720 __ret_281 = __builtin_shufflevector(__ret_281, __ret_281, 3, 2, 1, 0); \
47721 __ret_281; \
49417#define vcopy_lane_u16(__p0_373, __p1_373, __p2_373, __p3_373) __extension__ ({ \
49418 uint16x4_t __s0_373 = __p0_373; \
49419 uint16x4_t __s2_373 = __p2_373; \
49420 uint16x4_t __rev0_373; __rev0_373 = __builtin_shufflevector(__s0_373, __s0_373, 3, 2, 1, 0); \
49421 uint16x4_t __rev2_373; __rev2_373 = __builtin_shufflevector(__s2_373, __s2_373, 3, 2, 1, 0); \
49422 uint16x4_t __ret_373; \
49423 __ret_373 = __noswap_vset_lane_u16(__noswap_vget_lane_u16(__rev2_373, __p3_373), __rev0_373, __p1_373); \
49424 __ret_373 = __builtin_shufflevector(__ret_373, __ret_373, 3, 2, 1, 0); \
49425 __ret_373; \
4772249426})
4772349427#endif
4772449428
4772549429#ifdef __LITTLE_ENDIAN__
47726#define vcopy_lane_s8(__p0_282, __p1_282, __p2_282, __p3_282) __extension__ ({ \
47727 int8x8_t __s0_282 = __p0_282; \
47728 int8x8_t __s2_282 = __p2_282; \
47729 int8x8_t __ret_282; \
47730 __ret_282 = vset_lane_s8(vget_lane_s8(__s2_282, __p3_282), __s0_282, __p1_282); \
47731 __ret_282; \
49430#define vcopy_lane_s8(__p0_374, __p1_374, __p2_374, __p3_374) __extension__ ({ \
49431 int8x8_t __s0_374 = __p0_374; \
49432 int8x8_t __s2_374 = __p2_374; \
49433 int8x8_t __ret_374; \
49434 __ret_374 = vset_lane_s8(vget_lane_s8(__s2_374, __p3_374), __s0_374, __p1_374); \
49435 __ret_374; \
4773249436})
4773349437#else
47734#define vcopy_lane_s8(__p0_283, __p1_283, __p2_283, __p3_283) __extension__ ({ \
47735 int8x8_t __s0_283 = __p0_283; \
47736 int8x8_t __s2_283 = __p2_283; \
47737 int8x8_t __rev0_283; __rev0_283 = __builtin_shufflevector(__s0_283, __s0_283, 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); \
47739 int8x8_t __ret_283; \
47740 __ret_283 = __noswap_vset_lane_s8(__noswap_vget_lane_s8(__rev2_283, __p3_283), __rev0_283, __p1_283); \
47741 __ret_283 = __builtin_shufflevector(__ret_283, __ret_283, 7, 6, 5, 4, 3, 2, 1, 0); \
47742 __ret_283; \
49438#define vcopy_lane_s8(__p0_375, __p1_375, __p2_375, __p3_375) __extension__ ({ \
49439 int8x8_t __s0_375 = __p0_375; \
49440 int8x8_t __s2_375 = __p2_375; \
49441 int8x8_t __rev0_375; __rev0_375 = __builtin_shufflevector(__s0_375, __s0_375, 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); \
49443 int8x8_t __ret_375; \
49444 __ret_375 = __noswap_vset_lane_s8(__noswap_vget_lane_s8(__rev2_375, __p3_375), __rev0_375, __p1_375); \
49445 __ret_375 = __builtin_shufflevector(__ret_375, __ret_375, 7, 6, 5, 4, 3, 2, 1, 0); \
49446 __ret_375; \
4774349447})
4774449448#endif
4774549449
4774649450#ifdef __LITTLE_ENDIAN__
47747#define vcopy_lane_f32(__p0_284, __p1_284, __p2_284, __p3_284) __extension__ ({ \
47748 float32x2_t __s0_284 = __p0_284; \
47749 float32x2_t __s2_284 = __p2_284; \
47750 float32x2_t __ret_284; \
47751 __ret_284 = vset_lane_f32(vget_lane_f32(__s2_284, __p3_284), __s0_284, __p1_284); \
47752 __ret_284; \
49451#define vcopy_lane_f32(__p0_376, __p1_376, __p2_376, __p3_376) __extension__ ({ \
49452 float32x2_t __s0_376 = __p0_376; \
49453 float32x2_t __s2_376 = __p2_376; \
49454 float32x2_t __ret_376; \
49455 __ret_376 = vset_lane_f32(vget_lane_f32(__s2_376, __p3_376), __s0_376, __p1_376); \
49456 __ret_376; \
4775349457})
4775449458#else
47755#define vcopy_lane_f32(__p0_285, __p1_285, __p2_285, __p3_285) __extension__ ({ \
47756 float32x2_t __s0_285 = __p0_285; \
47757 float32x2_t __s2_285 = __p2_285; \
47758 float32x2_t __rev0_285; __rev0_285 = __builtin_shufflevector(__s0_285, __s0_285, 1, 0); \
47759 float32x2_t __rev2_285; __rev2_285 = __builtin_shufflevector(__s2_285, __s2_285, 1, 0); \
47760 float32x2_t __ret_285; \
47761 __ret_285 = __noswap_vset_lane_f32(__noswap_vget_lane_f32(__rev2_285, __p3_285), __rev0_285, __p1_285); \
47762 __ret_285 = __builtin_shufflevector(__ret_285, __ret_285, 1, 0); \
47763 __ret_285; \
49459#define vcopy_lane_f32(__p0_377, __p1_377, __p2_377, __p3_377) __extension__ ({ \
49460 float32x2_t __s0_377 = __p0_377; \
49461 float32x2_t __s2_377 = __p2_377; \
49462 float32x2_t __rev0_377; __rev0_377 = __builtin_shufflevector(__s0_377, __s0_377, 1, 0); \
49463 float32x2_t __rev2_377; __rev2_377 = __builtin_shufflevector(__s2_377, __s2_377, 1, 0); \
49464 float32x2_t __ret_377; \
49465 __ret_377 = __noswap_vset_lane_f32(__noswap_vget_lane_f32(__rev2_377, __p3_377), __rev0_377, __p1_377); \
49466 __ret_377 = __builtin_shufflevector(__ret_377, __ret_377, 1, 0); \
49467 __ret_377; \
4776449468})
4776549469#endif
4776649470
4776749471#ifdef __LITTLE_ENDIAN__
47768#define vcopy_lane_s32(__p0_286, __p1_286, __p2_286, __p3_286) __extension__ ({ \
47769 int32x2_t __s0_286 = __p0_286; \
47770 int32x2_t __s2_286 = __p2_286; \
47771 int32x2_t __ret_286; \
47772 __ret_286 = vset_lane_s32(vget_lane_s32(__s2_286, __p3_286), __s0_286, __p1_286); \
47773 __ret_286; \
49472#define vcopy_lane_s32(__p0_378, __p1_378, __p2_378, __p3_378) __extension__ ({ \
49473 int32x2_t __s0_378 = __p0_378; \
49474 int32x2_t __s2_378 = __p2_378; \
49475 int32x2_t __ret_378; \
49476 __ret_378 = vset_lane_s32(vget_lane_s32(__s2_378, __p3_378), __s0_378, __p1_378); \
49477 __ret_378; \
4777449478})
4777549479#else
47776#define vcopy_lane_s32(__p0_287, __p1_287, __p2_287, __p3_287) __extension__ ({ \
47777 int32x2_t __s0_287 = __p0_287; \
47778 int32x2_t __s2_287 = __p2_287; \
47779 int32x2_t __rev0_287; __rev0_287 = __builtin_shufflevector(__s0_287, __s0_287, 1, 0); \
47780 int32x2_t __rev2_287; __rev2_287 = __builtin_shufflevector(__s2_287, __s2_287, 1, 0); \
47781 int32x2_t __ret_287; \
47782 __ret_287 = __noswap_vset_lane_s32(__noswap_vget_lane_s32(__rev2_287, __p3_287), __rev0_287, __p1_287); \
47783 __ret_287 = __builtin_shufflevector(__ret_287, __ret_287, 1, 0); \
47784 __ret_287; \
49480#define vcopy_lane_s32(__p0_379, __p1_379, __p2_379, __p3_379) __extension__ ({ \
49481 int32x2_t __s0_379 = __p0_379; \
49482 int32x2_t __s2_379 = __p2_379; \
49483 int32x2_t __rev0_379; __rev0_379 = __builtin_shufflevector(__s0_379, __s0_379, 1, 0); \
49484 int32x2_t __rev2_379; __rev2_379 = __builtin_shufflevector(__s2_379, __s2_379, 1, 0); \
49485 int32x2_t __ret_379; \
49486 __ret_379 = __noswap_vset_lane_s32(__noswap_vget_lane_s32(__rev2_379, __p3_379), __rev0_379, __p1_379); \
49487 __ret_379 = __builtin_shufflevector(__ret_379, __ret_379, 1, 0); \
49488 __ret_379; \
4778549489})
4778649490#endif
4778749491
47788#define vcopy_lane_s64(__p0_288, __p1_288, __p2_288, __p3_288) __extension__ ({ \
47789 int64x1_t __s0_288 = __p0_288; \
47790 int64x1_t __s2_288 = __p2_288; \
47791 int64x1_t __ret_288; \
47792 __ret_288 = vset_lane_s64(vget_lane_s64(__s2_288, __p3_288), __s0_288, __p1_288); \
47793 __ret_288; \
49492#define vcopy_lane_s64(__p0_380, __p1_380, __p2_380, __p3_380) __extension__ ({ \
49493 int64x1_t __s0_380 = __p0_380; \
49494 int64x1_t __s2_380 = __p2_380; \
49495 int64x1_t __ret_380; \
49496 __ret_380 = vset_lane_s64(vget_lane_s64(__s2_380, __p3_380), __s0_380, __p1_380); \
49497 __ret_380; \
4779449498})
4779549499#ifdef __LITTLE_ENDIAN__
47796#define vcopy_lane_s16(__p0_289, __p1_289, __p2_289, __p3_289) __extension__ ({ \
47797 int16x4_t __s0_289 = __p0_289; \
47798 int16x4_t __s2_289 = __p2_289; \
47799 int16x4_t __ret_289; \
47800 __ret_289 = vset_lane_s16(vget_lane_s16(__s2_289, __p3_289), __s0_289, __p1_289); \
47801 __ret_289; \
49500#define vcopy_lane_s16(__p0_381, __p1_381, __p2_381, __p3_381) __extension__ ({ \
49501 int16x4_t __s0_381 = __p0_381; \
49502 int16x4_t __s2_381 = __p2_381; \
49503 int16x4_t __ret_381; \
49504 __ret_381 = vset_lane_s16(vget_lane_s16(__s2_381, __p3_381), __s0_381, __p1_381); \
49505 __ret_381; \
4780249506})
4780349507#else
47804#define vcopy_lane_s16(__p0_290, __p1_290, __p2_290, __p3_290) __extension__ ({ \
47805 int16x4_t __s0_290 = __p0_290; \
47806 int16x4_t __s2_290 = __p2_290; \
47807 int16x4_t __rev0_290; __rev0_290 = __builtin_shufflevector(__s0_290, __s0_290, 3, 2, 1, 0); \
47808 int16x4_t __rev2_290; __rev2_290 = __builtin_shufflevector(__s2_290, __s2_290, 3, 2, 1, 0); \
47809 int16x4_t __ret_290; \
47810 __ret_290 = __noswap_vset_lane_s16(__noswap_vget_lane_s16(__rev2_290, __p3_290), __rev0_290, __p1_290); \
47811 __ret_290 = __builtin_shufflevector(__ret_290, __ret_290, 3, 2, 1, 0); \
47812 __ret_290; \
49508#define vcopy_lane_s16(__p0_382, __p1_382, __p2_382, __p3_382) __extension__ ({ \
49509 int16x4_t __s0_382 = __p0_382; \
49510 int16x4_t __s2_382 = __p2_382; \
49511 int16x4_t __rev0_382; __rev0_382 = __builtin_shufflevector(__s0_382, __s0_382, 3, 2, 1, 0); \
49512 int16x4_t __rev2_382; __rev2_382 = __builtin_shufflevector(__s2_382, __s2_382, 3, 2, 1, 0); \
49513 int16x4_t __ret_382; \
49514 __ret_382 = __noswap_vset_lane_s16(__noswap_vget_lane_s16(__rev2_382, __p3_382), __rev0_382, __p1_382); \
49515 __ret_382 = __builtin_shufflevector(__ret_382, __ret_382, 3, 2, 1, 0); \
49516 __ret_382; \
4781349517})
4781449518#endif
4781549519
4781649520#ifdef __LITTLE_ENDIAN__
47817#define vcopyq_laneq_p8(__p0_291, __p1_291, __p2_291, __p3_291) __extension__ ({ \
47818 poly8x16_t __s0_291 = __p0_291; \
47819 poly8x16_t __s2_291 = __p2_291; \
47820 poly8x16_t __ret_291; \
47821 __ret_291 = vsetq_lane_p8(vgetq_lane_p8(__s2_291, __p3_291), __s0_291, __p1_291); \
47822 __ret_291; \
49521#define vcopyq_laneq_p8(__p0_383, __p1_383, __p2_383, __p3_383) __extension__ ({ \
49522 poly8x16_t __s0_383 = __p0_383; \
49523 poly8x16_t __s2_383 = __p2_383; \
49524 poly8x16_t __ret_383; \
49525 __ret_383 = vsetq_lane_p8(vgetq_lane_p8(__s2_383, __p3_383), __s0_383, __p1_383); \
49526 __ret_383; \
4782349527})
4782449528#else
47825#define vcopyq_laneq_p8(__p0_292, __p1_292, __p2_292, __p3_292) __extension__ ({ \
47826 poly8x16_t __s0_292 = __p0_292; \
47827 poly8x16_t __s2_292 = __p2_292; \
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); \
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); \
47830 poly8x16_t __ret_292; \
47831 __ret_292 = __noswap_vsetq_lane_p8(__noswap_vgetq_lane_p8(__rev2_292, __p3_292), __rev0_292, __p1_292); \
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); \
47833 __ret_292; \
49529#define vcopyq_laneq_p8(__p0_384, __p1_384, __p2_384, __p3_384) __extension__ ({ \
49530 poly8x16_t __s0_384 = __p0_384; \
49531 poly8x16_t __s2_384 = __p2_384; \
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); \
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); \
49534 poly8x16_t __ret_384; \
49535 __ret_384 = __noswap_vsetq_lane_p8(__noswap_vgetq_lane_p8(__rev2_384, __p3_384), __rev0_384, __p1_384); \
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); \
49537 __ret_384; \
4783449538})
4783549539#endif
4783649540
4783749541#ifdef __LITTLE_ENDIAN__
47838#define vcopyq_laneq_p16(__p0_293, __p1_293, __p2_293, __p3_293) __extension__ ({ \
47839 poly16x8_t __s0_293 = __p0_293; \
47840 poly16x8_t __s2_293 = __p2_293; \
47841 poly16x8_t __ret_293; \
47842 __ret_293 = vsetq_lane_p16(vgetq_lane_p16(__s2_293, __p3_293), __s0_293, __p1_293); \
47843 __ret_293; \
49542#define vcopyq_laneq_p16(__p0_385, __p1_385, __p2_385, __p3_385) __extension__ ({ \
49543 poly16x8_t __s0_385 = __p0_385; \
49544 poly16x8_t __s2_385 = __p2_385; \
49545 poly16x8_t __ret_385; \
49546 __ret_385 = vsetq_lane_p16(vgetq_lane_p16(__s2_385, __p3_385), __s0_385, __p1_385); \
49547 __ret_385; \
4784449548})
4784549549#else
47846#define vcopyq_laneq_p16(__p0_294, __p1_294, __p2_294, __p3_294) __extension__ ({ \
47847 poly16x8_t __s0_294 = __p0_294; \
47848 poly16x8_t __s2_294 = __p2_294; \
47849 poly16x8_t __rev0_294; __rev0_294 = __builtin_shufflevector(__s0_294, __s0_294, 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); \
47851 poly16x8_t __ret_294; \
47852 __ret_294 = __noswap_vsetq_lane_p16(__noswap_vgetq_lane_p16(__rev2_294, __p3_294), __rev0_294, __p1_294); \
47853 __ret_294 = __builtin_shufflevector(__ret_294, __ret_294, 7, 6, 5, 4, 3, 2, 1, 0); \
47854 __ret_294; \
49550#define vcopyq_laneq_p16(__p0_386, __p1_386, __p2_386, __p3_386) __extension__ ({ \
49551 poly16x8_t __s0_386 = __p0_386; \
49552 poly16x8_t __s2_386 = __p2_386; \
49553 poly16x8_t __rev0_386; __rev0_386 = __builtin_shufflevector(__s0_386, __s0_386, 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); \
49555 poly16x8_t __ret_386; \
49556 __ret_386 = __noswap_vsetq_lane_p16(__noswap_vgetq_lane_p16(__rev2_386, __p3_386), __rev0_386, __p1_386); \
49557 __ret_386 = __builtin_shufflevector(__ret_386, __ret_386, 7, 6, 5, 4, 3, 2, 1, 0); \
49558 __ret_386; \
4785549559})
4785649560#endif
4785749561
4785849562#ifdef __LITTLE_ENDIAN__
47859#define vcopyq_laneq_u8(__p0_295, __p1_295, __p2_295, __p3_295) __extension__ ({ \
47860 uint8x16_t __s0_295 = __p0_295; \
47861 uint8x16_t __s2_295 = __p2_295; \
47862 uint8x16_t __ret_295; \
47863 __ret_295 = vsetq_lane_u8(vgetq_lane_u8(__s2_295, __p3_295), __s0_295, __p1_295); \
47864 __ret_295; \
49563#define vcopyq_laneq_u8(__p0_387, __p1_387, __p2_387, __p3_387) __extension__ ({ \
49564 uint8x16_t __s0_387 = __p0_387; \
49565 uint8x16_t __s2_387 = __p2_387; \
49566 uint8x16_t __ret_387; \
49567 __ret_387 = vsetq_lane_u8(vgetq_lane_u8(__s2_387, __p3_387), __s0_387, __p1_387); \
49568 __ret_387; \
4786549569})
4786649570#else
47867#define vcopyq_laneq_u8(__p0_296, __p1_296, __p2_296, __p3_296) __extension__ ({ \
47868 uint8x16_t __s0_296 = __p0_296; \
47869 uint8x16_t __s2_296 = __p2_296; \
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); \
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); \
47872 uint8x16_t __ret_296; \
47873 __ret_296 = __noswap_vsetq_lane_u8(__noswap_vgetq_lane_u8(__rev2_296, __p3_296), __rev0_296, __p1_296); \
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); \
47875 __ret_296; \
49571#define vcopyq_laneq_u8(__p0_388, __p1_388, __p2_388, __p3_388) __extension__ ({ \
49572 uint8x16_t __s0_388 = __p0_388; \
49573 uint8x16_t __s2_388 = __p2_388; \
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); \
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); \
49576 uint8x16_t __ret_388; \
49577 __ret_388 = __noswap_vsetq_lane_u8(__noswap_vgetq_lane_u8(__rev2_388, __p3_388), __rev0_388, __p1_388); \
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); \
49579 __ret_388; \
4787649580})
4787749581#endif
4787849582
4787949583#ifdef __LITTLE_ENDIAN__
47880#define vcopyq_laneq_u32(__p0_297, __p1_297, __p2_297, __p3_297) __extension__ ({ \
47881 uint32x4_t __s0_297 = __p0_297; \
47882 uint32x4_t __s2_297 = __p2_297; \
47883 uint32x4_t __ret_297; \
47884 __ret_297 = vsetq_lane_u32(vgetq_lane_u32(__s2_297, __p3_297), __s0_297, __p1_297); \
47885 __ret_297; \
49584#define vcopyq_laneq_u32(__p0_389, __p1_389, __p2_389, __p3_389) __extension__ ({ \
49585 uint32x4_t __s0_389 = __p0_389; \
49586 uint32x4_t __s2_389 = __p2_389; \
49587 uint32x4_t __ret_389; \
49588 __ret_389 = vsetq_lane_u32(vgetq_lane_u32(__s2_389, __p3_389), __s0_389, __p1_389); \
49589 __ret_389; \
4788649590})
4788749591#else
47888#define vcopyq_laneq_u32(__p0_298, __p1_298, __p2_298, __p3_298) __extension__ ({ \
47889 uint32x4_t __s0_298 = __p0_298; \
47890 uint32x4_t __s2_298 = __p2_298; \
47891 uint32x4_t __rev0_298; __rev0_298 = __builtin_shufflevector(__s0_298, __s0_298, 3, 2, 1, 0); \
47892 uint32x4_t __rev2_298; __rev2_298 = __builtin_shufflevector(__s2_298, __s2_298, 3, 2, 1, 0); \
47893 uint32x4_t __ret_298; \
47894 __ret_298 = __noswap_vsetq_lane_u32(__noswap_vgetq_lane_u32(__rev2_298, __p3_298), __rev0_298, __p1_298); \
47895 __ret_298 = __builtin_shufflevector(__ret_298, __ret_298, 3, 2, 1, 0); \
47896 __ret_298; \
49592#define vcopyq_laneq_u32(__p0_390, __p1_390, __p2_390, __p3_390) __extension__ ({ \
49593 uint32x4_t __s0_390 = __p0_390; \
49594 uint32x4_t __s2_390 = __p2_390; \
49595 uint32x4_t __rev0_390; __rev0_390 = __builtin_shufflevector(__s0_390, __s0_390, 3, 2, 1, 0); \
49596 uint32x4_t __rev2_390; __rev2_390 = __builtin_shufflevector(__s2_390, __s2_390, 3, 2, 1, 0); \
49597 uint32x4_t __ret_390; \
49598 __ret_390 = __noswap_vsetq_lane_u32(__noswap_vgetq_lane_u32(__rev2_390, __p3_390), __rev0_390, __p1_390); \
49599 __ret_390 = __builtin_shufflevector(__ret_390, __ret_390, 3, 2, 1, 0); \
49600 __ret_390; \
4789749601})
4789849602#endif
4789949603
4790049604#ifdef __LITTLE_ENDIAN__
47901#define vcopyq_laneq_u64(__p0_299, __p1_299, __p2_299, __p3_299) __extension__ ({ \
47902 uint64x2_t __s0_299 = __p0_299; \
47903 uint64x2_t __s2_299 = __p2_299; \
47904 uint64x2_t __ret_299; \
47905 __ret_299 = vsetq_lane_u64(vgetq_lane_u64(__s2_299, __p3_299), __s0_299, __p1_299); \
47906 __ret_299; \
49605#define vcopyq_laneq_u64(__p0_391, __p1_391, __p2_391, __p3_391) __extension__ ({ \
49606 uint64x2_t __s0_391 = __p0_391; \
49607 uint64x2_t __s2_391 = __p2_391; \
49608 uint64x2_t __ret_391; \
49609 __ret_391 = vsetq_lane_u64(vgetq_lane_u64(__s2_391, __p3_391), __s0_391, __p1_391); \
49610 __ret_391; \
4790749611})
4790849612#else
47909#define vcopyq_laneq_u64(__p0_300, __p1_300, __p2_300, __p3_300) __extension__ ({ \
47910 uint64x2_t __s0_300 = __p0_300; \
47911 uint64x2_t __s2_300 = __p2_300; \
47912 uint64x2_t __rev0_300; __rev0_300 = __builtin_shufflevector(__s0_300, __s0_300, 1, 0); \
47913 uint64x2_t __rev2_300; __rev2_300 = __builtin_shufflevector(__s2_300, __s2_300, 1, 0); \
47914 uint64x2_t __ret_300; \
47915 __ret_300 = __noswap_vsetq_lane_u64(__noswap_vgetq_lane_u64(__rev2_300, __p3_300), __rev0_300, __p1_300); \
47916 __ret_300 = __builtin_shufflevector(__ret_300, __ret_300, 1, 0); \
47917 __ret_300; \
49613#define vcopyq_laneq_u64(__p0_392, __p1_392, __p2_392, __p3_392) __extension__ ({ \
49614 uint64x2_t __s0_392 = __p0_392; \
49615 uint64x2_t __s2_392 = __p2_392; \
49616 uint64x2_t __rev0_392; __rev0_392 = __builtin_shufflevector(__s0_392, __s0_392, 1, 0); \
49617 uint64x2_t __rev2_392; __rev2_392 = __builtin_shufflevector(__s2_392, __s2_392, 1, 0); \
49618 uint64x2_t __ret_392; \
49619 __ret_392 = __noswap_vsetq_lane_u64(__noswap_vgetq_lane_u64(__rev2_392, __p3_392), __rev0_392, __p1_392); \
49620 __ret_392 = __builtin_shufflevector(__ret_392, __ret_392, 1, 0); \
49621 __ret_392; \
4791849622})
4791949623#endif
4792049624
4792149625#ifdef __LITTLE_ENDIAN__
47922#define vcopyq_laneq_u16(__p0_301, __p1_301, __p2_301, __p3_301) __extension__ ({ \
47923 uint16x8_t __s0_301 = __p0_301; \
47924 uint16x8_t __s2_301 = __p2_301; \
47925 uint16x8_t __ret_301; \
47926 __ret_301 = vsetq_lane_u16(vgetq_lane_u16(__s2_301, __p3_301), __s0_301, __p1_301); \
47927 __ret_301; \
49626#define vcopyq_laneq_u16(__p0_393, __p1_393, __p2_393, __p3_393) __extension__ ({ \
49627 uint16x8_t __s0_393 = __p0_393; \
49628 uint16x8_t __s2_393 = __p2_393; \
49629 uint16x8_t __ret_393; \
49630 __ret_393 = vsetq_lane_u16(vgetq_lane_u16(__s2_393, __p3_393), __s0_393, __p1_393); \
49631 __ret_393; \
4792849632})
4792949633#else
47930#define vcopyq_laneq_u16(__p0_302, __p1_302, __p2_302, __p3_302) __extension__ ({ \
47931 uint16x8_t __s0_302 = __p0_302; \
47932 uint16x8_t __s2_302 = __p2_302; \
47933 uint16x8_t __rev0_302; __rev0_302 = __builtin_shufflevector(__s0_302, __s0_302, 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); \
47935 uint16x8_t __ret_302; \
47936 __ret_302 = __noswap_vsetq_lane_u16(__noswap_vgetq_lane_u16(__rev2_302, __p3_302), __rev0_302, __p1_302); \
47937 __ret_302 = __builtin_shufflevector(__ret_302, __ret_302, 7, 6, 5, 4, 3, 2, 1, 0); \
47938 __ret_302; \
49634#define vcopyq_laneq_u16(__p0_394, __p1_394, __p2_394, __p3_394) __extension__ ({ \
49635 uint16x8_t __s0_394 = __p0_394; \
49636 uint16x8_t __s2_394 = __p2_394; \
49637 uint16x8_t __rev0_394; __rev0_394 = __builtin_shufflevector(__s0_394, __s0_394, 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); \
49639 uint16x8_t __ret_394; \
49640 __ret_394 = __noswap_vsetq_lane_u16(__noswap_vgetq_lane_u16(__rev2_394, __p3_394), __rev0_394, __p1_394); \
49641 __ret_394 = __builtin_shufflevector(__ret_394, __ret_394, 7, 6, 5, 4, 3, 2, 1, 0); \
49642 __ret_394; \
4793949643})
4794049644#endif
4794149645
4794249646#ifdef __LITTLE_ENDIAN__
47943#define vcopyq_laneq_s8(__p0_303, __p1_303, __p2_303, __p3_303) __extension__ ({ \
47944 int8x16_t __s0_303 = __p0_303; \
47945 int8x16_t __s2_303 = __p2_303; \
47946 int8x16_t __ret_303; \
47947 __ret_303 = vsetq_lane_s8(vgetq_lane_s8(__s2_303, __p3_303), __s0_303, __p1_303); \
47948 __ret_303; \
49647#define vcopyq_laneq_s8(__p0_395, __p1_395, __p2_395, __p3_395) __extension__ ({ \
49648 int8x16_t __s0_395 = __p0_395; \
49649 int8x16_t __s2_395 = __p2_395; \
49650 int8x16_t __ret_395; \
49651 __ret_395 = vsetq_lane_s8(vgetq_lane_s8(__s2_395, __p3_395), __s0_395, __p1_395); \
49652 __ret_395; \
4794949653})
4795049654#else
47951#define vcopyq_laneq_s8(__p0_304, __p1_304, __p2_304, __p3_304) __extension__ ({ \
47952 int8x16_t __s0_304 = __p0_304; \
47953 int8x16_t __s2_304 = __p2_304; \
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); \
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); \
47956 int8x16_t __ret_304; \
47957 __ret_304 = __noswap_vsetq_lane_s8(__noswap_vgetq_lane_s8(__rev2_304, __p3_304), __rev0_304, __p1_304); \
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); \
47959 __ret_304; \
49655#define vcopyq_laneq_s8(__p0_396, __p1_396, __p2_396, __p3_396) __extension__ ({ \
49656 int8x16_t __s0_396 = __p0_396; \
49657 int8x16_t __s2_396 = __p2_396; \
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); \
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); \
49660 int8x16_t __ret_396; \
49661 __ret_396 = __noswap_vsetq_lane_s8(__noswap_vgetq_lane_s8(__rev2_396, __p3_396), __rev0_396, __p1_396); \
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); \
49663 __ret_396; \
4796049664})
4796149665#endif
4796249666
4796349667#ifdef __LITTLE_ENDIAN__
47964#define vcopyq_laneq_f32(__p0_305, __p1_305, __p2_305, __p3_305) __extension__ ({ \
47965 float32x4_t __s0_305 = __p0_305; \
47966 float32x4_t __s2_305 = __p2_305; \
47967 float32x4_t __ret_305; \
47968 __ret_305 = vsetq_lane_f32(vgetq_lane_f32(__s2_305, __p3_305), __s0_305, __p1_305); \
47969 __ret_305; \
49668#define vcopyq_laneq_f32(__p0_397, __p1_397, __p2_397, __p3_397) __extension__ ({ \
49669 float32x4_t __s0_397 = __p0_397; \
49670 float32x4_t __s2_397 = __p2_397; \
49671 float32x4_t __ret_397; \
49672 __ret_397 = vsetq_lane_f32(vgetq_lane_f32(__s2_397, __p3_397), __s0_397, __p1_397); \
49673 __ret_397; \
4797049674})
4797149675#else
47972#define vcopyq_laneq_f32(__p0_306, __p1_306, __p2_306, __p3_306) __extension__ ({ \
47973 float32x4_t __s0_306 = __p0_306; \
47974 float32x4_t __s2_306 = __p2_306; \
47975 float32x4_t __rev0_306; __rev0_306 = __builtin_shufflevector(__s0_306, __s0_306, 3, 2, 1, 0); \
47976 float32x4_t __rev2_306; __rev2_306 = __builtin_shufflevector(__s2_306, __s2_306, 3, 2, 1, 0); \
47977 float32x4_t __ret_306; \
47978 __ret_306 = __noswap_vsetq_lane_f32(__noswap_vgetq_lane_f32(__rev2_306, __p3_306), __rev0_306, __p1_306); \
47979 __ret_306 = __builtin_shufflevector(__ret_306, __ret_306, 3, 2, 1, 0); \
47980 __ret_306; \
49676#define vcopyq_laneq_f32(__p0_398, __p1_398, __p2_398, __p3_398) __extension__ ({ \
49677 float32x4_t __s0_398 = __p0_398; \
49678 float32x4_t __s2_398 = __p2_398; \
49679 float32x4_t __rev0_398; __rev0_398 = __builtin_shufflevector(__s0_398, __s0_398, 3, 2, 1, 0); \
49680 float32x4_t __rev2_398; __rev2_398 = __builtin_shufflevector(__s2_398, __s2_398, 3, 2, 1, 0); \
49681 float32x4_t __ret_398; \
49682 __ret_398 = __noswap_vsetq_lane_f32(__noswap_vgetq_lane_f32(__rev2_398, __p3_398), __rev0_398, __p1_398); \
49683 __ret_398 = __builtin_shufflevector(__ret_398, __ret_398, 3, 2, 1, 0); \
49684 __ret_398; \
4798149685})
4798249686#endif
4798349687
4798449688#ifdef __LITTLE_ENDIAN__
47985#define vcopyq_laneq_s32(__p0_307, __p1_307, __p2_307, __p3_307) __extension__ ({ \
47986 int32x4_t __s0_307 = __p0_307; \
47987 int32x4_t __s2_307 = __p2_307; \
47988 int32x4_t __ret_307; \
47989 __ret_307 = vsetq_lane_s32(vgetq_lane_s32(__s2_307, __p3_307), __s0_307, __p1_307); \
47990 __ret_307; \
49689#define vcopyq_laneq_s32(__p0_399, __p1_399, __p2_399, __p3_399) __extension__ ({ \
49690 int32x4_t __s0_399 = __p0_399; \
49691 int32x4_t __s2_399 = __p2_399; \
49692 int32x4_t __ret_399; \
49693 __ret_399 = vsetq_lane_s32(vgetq_lane_s32(__s2_399, __p3_399), __s0_399, __p1_399); \
49694 __ret_399; \
4799149695})
4799249696#else
47993#define vcopyq_laneq_s32(__p0_308, __p1_308, __p2_308, __p3_308) __extension__ ({ \
47994 int32x4_t __s0_308 = __p0_308; \
47995 int32x4_t __s2_308 = __p2_308; \
47996 int32x4_t __rev0_308; __rev0_308 = __builtin_shufflevector(__s0_308, __s0_308, 3, 2, 1, 0); \
47997 int32x4_t __rev2_308; __rev2_308 = __builtin_shufflevector(__s2_308, __s2_308, 3, 2, 1, 0); \
47998 int32x4_t __ret_308; \
47999 __ret_308 = __noswap_vsetq_lane_s32(__noswap_vgetq_lane_s32(__rev2_308, __p3_308), __rev0_308, __p1_308); \
48000 __ret_308 = __builtin_shufflevector(__ret_308, __ret_308, 3, 2, 1, 0); \
48001 __ret_308; \
49697#define vcopyq_laneq_s32(__p0_400, __p1_400, __p2_400, __p3_400) __extension__ ({ \
49698 int32x4_t __s0_400 = __p0_400; \
49699 int32x4_t __s2_400 = __p2_400; \
49700 int32x4_t __rev0_400; __rev0_400 = __builtin_shufflevector(__s0_400, __s0_400, 3, 2, 1, 0); \
49701 int32x4_t __rev2_400; __rev2_400 = __builtin_shufflevector(__s2_400, __s2_400, 3, 2, 1, 0); \
49702 int32x4_t __ret_400; \
49703 __ret_400 = __noswap_vsetq_lane_s32(__noswap_vgetq_lane_s32(__rev2_400, __p3_400), __rev0_400, __p1_400); \
49704 __ret_400 = __builtin_shufflevector(__ret_400, __ret_400, 3, 2, 1, 0); \
49705 __ret_400; \
4800249706})
4800349707#endif
4800449708
4800549709#ifdef __LITTLE_ENDIAN__
48006#define vcopyq_laneq_s64(__p0_309, __p1_309, __p2_309, __p3_309) __extension__ ({ \
48007 int64x2_t __s0_309 = __p0_309; \
48008 int64x2_t __s2_309 = __p2_309; \
48009 int64x2_t __ret_309; \
48010 __ret_309 = vsetq_lane_s64(vgetq_lane_s64(__s2_309, __p3_309), __s0_309, __p1_309); \
48011 __ret_309; \
49710#define vcopyq_laneq_s64(__p0_401, __p1_401, __p2_401, __p3_401) __extension__ ({ \
49711 int64x2_t __s0_401 = __p0_401; \
49712 int64x2_t __s2_401 = __p2_401; \
49713 int64x2_t __ret_401; \
49714 __ret_401 = vsetq_lane_s64(vgetq_lane_s64(__s2_401, __p3_401), __s0_401, __p1_401); \
49715 __ret_401; \
4801249716})
4801349717#else
48014#define vcopyq_laneq_s64(__p0_310, __p1_310, __p2_310, __p3_310) __extension__ ({ \
48015 int64x2_t __s0_310 = __p0_310; \
48016 int64x2_t __s2_310 = __p2_310; \
48017 int64x2_t __rev0_310; __rev0_310 = __builtin_shufflevector(__s0_310, __s0_310, 1, 0); \
48018 int64x2_t __rev2_310; __rev2_310 = __builtin_shufflevector(__s2_310, __s2_310, 1, 0); \
48019 int64x2_t __ret_310; \
48020 __ret_310 = __noswap_vsetq_lane_s64(__noswap_vgetq_lane_s64(__rev2_310, __p3_310), __rev0_310, __p1_310); \
48021 __ret_310 = __builtin_shufflevector(__ret_310, __ret_310, 1, 0); \
48022 __ret_310; \
49718#define vcopyq_laneq_s64(__p0_402, __p1_402, __p2_402, __p3_402) __extension__ ({ \
49719 int64x2_t __s0_402 = __p0_402; \
49720 int64x2_t __s2_402 = __p2_402; \
49721 int64x2_t __rev0_402; __rev0_402 = __builtin_shufflevector(__s0_402, __s0_402, 1, 0); \
49722 int64x2_t __rev2_402; __rev2_402 = __builtin_shufflevector(__s2_402, __s2_402, 1, 0); \
49723 int64x2_t __ret_402; \
49724 __ret_402 = __noswap_vsetq_lane_s64(__noswap_vgetq_lane_s64(__rev2_402, __p3_402), __rev0_402, __p1_402); \
49725 __ret_402 = __builtin_shufflevector(__ret_402, __ret_402, 1, 0); \
49726 __ret_402; \
4802349727})
4802449728#endif
4802549729
4802649730#ifdef __LITTLE_ENDIAN__
48027#define vcopyq_laneq_s16(__p0_311, __p1_311, __p2_311, __p3_311) __extension__ ({ \
48028 int16x8_t __s0_311 = __p0_311; \
48029 int16x8_t __s2_311 = __p2_311; \
48030 int16x8_t __ret_311; \
48031 __ret_311 = vsetq_lane_s16(vgetq_lane_s16(__s2_311, __p3_311), __s0_311, __p1_311); \
48032 __ret_311; \
49731#define vcopyq_laneq_s16(__p0_403, __p1_403, __p2_403, __p3_403) __extension__ ({ \
49732 int16x8_t __s0_403 = __p0_403; \
49733 int16x8_t __s2_403 = __p2_403; \
49734 int16x8_t __ret_403; \
49735 __ret_403 = vsetq_lane_s16(vgetq_lane_s16(__s2_403, __p3_403), __s0_403, __p1_403); \
49736 __ret_403; \
4803349737})
4803449738#else
48035#define vcopyq_laneq_s16(__p0_312, __p1_312, __p2_312, __p3_312) __extension__ ({ \
48036 int16x8_t __s0_312 = __p0_312; \
48037 int16x8_t __s2_312 = __p2_312; \
48038 int16x8_t __rev0_312; __rev0_312 = __builtin_shufflevector(__s0_312, __s0_312, 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); \
48040 int16x8_t __ret_312; \
48041 __ret_312 = __noswap_vsetq_lane_s16(__noswap_vgetq_lane_s16(__rev2_312, __p3_312), __rev0_312, __p1_312); \
48042 __ret_312 = __builtin_shufflevector(__ret_312, __ret_312, 7, 6, 5, 4, 3, 2, 1, 0); \
48043 __ret_312; \
49739#define vcopyq_laneq_s16(__p0_404, __p1_404, __p2_404, __p3_404) __extension__ ({ \
49740 int16x8_t __s0_404 = __p0_404; \
49741 int16x8_t __s2_404 = __p2_404; \
49742 int16x8_t __rev0_404; __rev0_404 = __builtin_shufflevector(__s0_404, __s0_404, 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); \
49744 int16x8_t __ret_404; \
49745 __ret_404 = __noswap_vsetq_lane_s16(__noswap_vgetq_lane_s16(__rev2_404, __p3_404), __rev0_404, __p1_404); \
49746 __ret_404 = __builtin_shufflevector(__ret_404, __ret_404, 7, 6, 5, 4, 3, 2, 1, 0); \
49747 __ret_404; \
4804449748})
4804549749#endif
4804649750
4804749751#ifdef __LITTLE_ENDIAN__
48048#define vcopy_laneq_p8(__p0_313, __p1_313, __p2_313, __p3_313) __extension__ ({ \
48049 poly8x8_t __s0_313 = __p0_313; \
48050 poly8x16_t __s2_313 = __p2_313; \
48051 poly8x8_t __ret_313; \
48052 __ret_313 = vset_lane_p8(vgetq_lane_p8(__s2_313, __p3_313), __s0_313, __p1_313); \
48053 __ret_313; \
49752#define vcopy_laneq_p8(__p0_405, __p1_405, __p2_405, __p3_405) __extension__ ({ \
49753 poly8x8_t __s0_405 = __p0_405; \
49754 poly8x16_t __s2_405 = __p2_405; \
49755 poly8x8_t __ret_405; \
49756 __ret_405 = vset_lane_p8(vgetq_lane_p8(__s2_405, __p3_405), __s0_405, __p1_405); \
49757 __ret_405; \
4805449758})
4805549759#else
48056#define vcopy_laneq_p8(__p0_314, __p1_314, __p2_314, __p3_314) __extension__ ({ \
48057 poly8x8_t __s0_314 = __p0_314; \
48058 poly8x16_t __s2_314 = __p2_314; \
48059 poly8x8_t __rev0_314; __rev0_314 = __builtin_shufflevector(__s0_314, __s0_314, 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); \
48061 poly8x8_t __ret_314; \
48062 __ret_314 = __noswap_vset_lane_p8(__noswap_vgetq_lane_p8(__rev2_314, __p3_314), __rev0_314, __p1_314); \
48063 __ret_314 = __builtin_shufflevector(__ret_314, __ret_314, 7, 6, 5, 4, 3, 2, 1, 0); \
48064 __ret_314; \
49760#define vcopy_laneq_p8(__p0_406, __p1_406, __p2_406, __p3_406) __extension__ ({ \
49761 poly8x8_t __s0_406 = __p0_406; \
49762 poly8x16_t __s2_406 = __p2_406; \
49763 poly8x8_t __rev0_406; __rev0_406 = __builtin_shufflevector(__s0_406, __s0_406, 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); \
49765 poly8x8_t __ret_406; \
49766 __ret_406 = __noswap_vset_lane_p8(__noswap_vgetq_lane_p8(__rev2_406, __p3_406), __rev0_406, __p1_406); \
49767 __ret_406 = __builtin_shufflevector(__ret_406, __ret_406, 7, 6, 5, 4, 3, 2, 1, 0); \
49768 __ret_406; \
4806549769})
4806649770#endif
4806749771
4806849772#ifdef __LITTLE_ENDIAN__
48069#define vcopy_laneq_p16(__p0_315, __p1_315, __p2_315, __p3_315) __extension__ ({ \
48070 poly16x4_t __s0_315 = __p0_315; \
48071 poly16x8_t __s2_315 = __p2_315; \
48072 poly16x4_t __ret_315; \
48073 __ret_315 = vset_lane_p16(vgetq_lane_p16(__s2_315, __p3_315), __s0_315, __p1_315); \
48074 __ret_315; \
49773#define vcopy_laneq_p16(__p0_407, __p1_407, __p2_407, __p3_407) __extension__ ({ \
49774 poly16x4_t __s0_407 = __p0_407; \
49775 poly16x8_t __s2_407 = __p2_407; \
49776 poly16x4_t __ret_407; \
49777 __ret_407 = vset_lane_p16(vgetq_lane_p16(__s2_407, __p3_407), __s0_407, __p1_407); \
49778 __ret_407; \
4807549779})
4807649780#else
48077#define vcopy_laneq_p16(__p0_316, __p1_316, __p2_316, __p3_316) __extension__ ({ \
48078 poly16x4_t __s0_316 = __p0_316; \
48079 poly16x8_t __s2_316 = __p2_316; \
48080 poly16x4_t __rev0_316; __rev0_316 = __builtin_shufflevector(__s0_316, __s0_316, 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); \
48082 poly16x4_t __ret_316; \
48083 __ret_316 = __noswap_vset_lane_p16(__noswap_vgetq_lane_p16(__rev2_316, __p3_316), __rev0_316, __p1_316); \
48084 __ret_316 = __builtin_shufflevector(__ret_316, __ret_316, 3, 2, 1, 0); \
48085 __ret_316; \
49781#define vcopy_laneq_p16(__p0_408, __p1_408, __p2_408, __p3_408) __extension__ ({ \
49782 poly16x4_t __s0_408 = __p0_408; \
49783 poly16x8_t __s2_408 = __p2_408; \
49784 poly16x4_t __rev0_408; __rev0_408 = __builtin_shufflevector(__s0_408, __s0_408, 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); \
49786 poly16x4_t __ret_408; \
49787 __ret_408 = __noswap_vset_lane_p16(__noswap_vgetq_lane_p16(__rev2_408, __p3_408), __rev0_408, __p1_408); \
49788 __ret_408 = __builtin_shufflevector(__ret_408, __ret_408, 3, 2, 1, 0); \
49789 __ret_408; \
4808649790})
4808749791#endif
4808849792
4808949793#ifdef __LITTLE_ENDIAN__
48090#define vcopy_laneq_u8(__p0_317, __p1_317, __p2_317, __p3_317) __extension__ ({ \
48091 uint8x8_t __s0_317 = __p0_317; \
48092 uint8x16_t __s2_317 = __p2_317; \
48093 uint8x8_t __ret_317; \
48094 __ret_317 = vset_lane_u8(vgetq_lane_u8(__s2_317, __p3_317), __s0_317, __p1_317); \
48095 __ret_317; \
49794#define vcopy_laneq_u8(__p0_409, __p1_409, __p2_409, __p3_409) __extension__ ({ \
49795 uint8x8_t __s0_409 = __p0_409; \
49796 uint8x16_t __s2_409 = __p2_409; \
49797 uint8x8_t __ret_409; \
49798 __ret_409 = vset_lane_u8(vgetq_lane_u8(__s2_409, __p3_409), __s0_409, __p1_409); \
49799 __ret_409; \
4809649800})
4809749801#else
48098#define vcopy_laneq_u8(__p0_318, __p1_318, __p2_318, __p3_318) __extension__ ({ \
48099 uint8x8_t __s0_318 = __p0_318; \
48100 uint8x16_t __s2_318 = __p2_318; \
48101 uint8x8_t __rev0_318; __rev0_318 = __builtin_shufflevector(__s0_318, __s0_318, 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); \
48103 uint8x8_t __ret_318; \
48104 __ret_318 = __noswap_vset_lane_u8(__noswap_vgetq_lane_u8(__rev2_318, __p3_318), __rev0_318, __p1_318); \
48105 __ret_318 = __builtin_shufflevector(__ret_318, __ret_318, 7, 6, 5, 4, 3, 2, 1, 0); \
48106 __ret_318; \
49802#define vcopy_laneq_u8(__p0_410, __p1_410, __p2_410, __p3_410) __extension__ ({ \
49803 uint8x8_t __s0_410 = __p0_410; \
49804 uint8x16_t __s2_410 = __p2_410; \
49805 uint8x8_t __rev0_410; __rev0_410 = __builtin_shufflevector(__s0_410, __s0_410, 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); \
49807 uint8x8_t __ret_410; \
49808 __ret_410 = __noswap_vset_lane_u8(__noswap_vgetq_lane_u8(__rev2_410, __p3_410), __rev0_410, __p1_410); \
49809 __ret_410 = __builtin_shufflevector(__ret_410, __ret_410, 7, 6, 5, 4, 3, 2, 1, 0); \
49810 __ret_410; \
4810749811})
4810849812#endif
4810949813
4811049814#ifdef __LITTLE_ENDIAN__
48111#define vcopy_laneq_u32(__p0_319, __p1_319, __p2_319, __p3_319) __extension__ ({ \
48112 uint32x2_t __s0_319 = __p0_319; \
48113 uint32x4_t __s2_319 = __p2_319; \
48114 uint32x2_t __ret_319; \
48115 __ret_319 = vset_lane_u32(vgetq_lane_u32(__s2_319, __p3_319), __s0_319, __p1_319); \
48116 __ret_319; \
49815#define vcopy_laneq_u32(__p0_411, __p1_411, __p2_411, __p3_411) __extension__ ({ \
49816 uint32x2_t __s0_411 = __p0_411; \
49817 uint32x4_t __s2_411 = __p2_411; \
49818 uint32x2_t __ret_411; \
49819 __ret_411 = vset_lane_u32(vgetq_lane_u32(__s2_411, __p3_411), __s0_411, __p1_411); \
49820 __ret_411; \
4811749821})
4811849822#else
48119#define vcopy_laneq_u32(__p0_320, __p1_320, __p2_320, __p3_320) __extension__ ({ \
48120 uint32x2_t __s0_320 = __p0_320; \
48121 uint32x4_t __s2_320 = __p2_320; \
48122 uint32x2_t __rev0_320; __rev0_320 = __builtin_shufflevector(__s0_320, __s0_320, 1, 0); \
48123 uint32x4_t __rev2_320; __rev2_320 = __builtin_shufflevector(__s2_320, __s2_320, 3, 2, 1, 0); \
48124 uint32x2_t __ret_320; \
48125 __ret_320 = __noswap_vset_lane_u32(__noswap_vgetq_lane_u32(__rev2_320, __p3_320), __rev0_320, __p1_320); \
48126 __ret_320 = __builtin_shufflevector(__ret_320, __ret_320, 1, 0); \
48127 __ret_320; \
49823#define vcopy_laneq_u32(__p0_412, __p1_412, __p2_412, __p3_412) __extension__ ({ \
49824 uint32x2_t __s0_412 = __p0_412; \
49825 uint32x4_t __s2_412 = __p2_412; \
49826 uint32x2_t __rev0_412; __rev0_412 = __builtin_shufflevector(__s0_412, __s0_412, 1, 0); \
49827 uint32x4_t __rev2_412; __rev2_412 = __builtin_shufflevector(__s2_412, __s2_412, 3, 2, 1, 0); \
49828 uint32x2_t __ret_412; \
49829 __ret_412 = __noswap_vset_lane_u32(__noswap_vgetq_lane_u32(__rev2_412, __p3_412), __rev0_412, __p1_412); \
49830 __ret_412 = __builtin_shufflevector(__ret_412, __ret_412, 1, 0); \
49831 __ret_412; \
4812849832})
4812949833#endif
4813049834
4813149835#ifdef __LITTLE_ENDIAN__
48132#define vcopy_laneq_u64(__p0_321, __p1_321, __p2_321, __p3_321) __extension__ ({ \
48133 uint64x1_t __s0_321 = __p0_321; \
48134 uint64x2_t __s2_321 = __p2_321; \
48135 uint64x1_t __ret_321; \
48136 __ret_321 = vset_lane_u64(vgetq_lane_u64(__s2_321, __p3_321), __s0_321, __p1_321); \
48137 __ret_321; \
49836#define vcopy_laneq_u64(__p0_413, __p1_413, __p2_413, __p3_413) __extension__ ({ \
49837 uint64x1_t __s0_413 = __p0_413; \
49838 uint64x2_t __s2_413 = __p2_413; \
49839 uint64x1_t __ret_413; \
49840 __ret_413 = vset_lane_u64(vgetq_lane_u64(__s2_413, __p3_413), __s0_413, __p1_413); \
49841 __ret_413; \
4813849842})
4813949843#else
48140#define vcopy_laneq_u64(__p0_322, __p1_322, __p2_322, __p3_322) __extension__ ({ \
48141 uint64x1_t __s0_322 = __p0_322; \
48142 uint64x2_t __s2_322 = __p2_322; \
48143 uint64x2_t __rev2_322; __rev2_322 = __builtin_shufflevector(__s2_322, __s2_322, 1, 0); \
48144 uint64x1_t __ret_322; \
48145 __ret_322 = vset_lane_u64(__noswap_vgetq_lane_u64(__rev2_322, __p3_322), __s0_322, __p1_322); \
48146 __ret_322; \
49844#define vcopy_laneq_u64(__p0_414, __p1_414, __p2_414, __p3_414) __extension__ ({ \
49845 uint64x1_t __s0_414 = __p0_414; \
49846 uint64x2_t __s2_414 = __p2_414; \
49847 uint64x2_t __rev2_414; __rev2_414 = __builtin_shufflevector(__s2_414, __s2_414, 1, 0); \
49848 uint64x1_t __ret_414; \
49849 __ret_414 = vset_lane_u64(__noswap_vgetq_lane_u64(__rev2_414, __p3_414), __s0_414, __p1_414); \
49850 __ret_414; \
4814749851})
4814849852#endif
4814949853
4815049854#ifdef __LITTLE_ENDIAN__
48151#define vcopy_laneq_u16(__p0_323, __p1_323, __p2_323, __p3_323) __extension__ ({ \
48152 uint16x4_t __s0_323 = __p0_323; \
48153 uint16x8_t __s2_323 = __p2_323; \
48154 uint16x4_t __ret_323; \
48155 __ret_323 = vset_lane_u16(vgetq_lane_u16(__s2_323, __p3_323), __s0_323, __p1_323); \
48156 __ret_323; \
49855#define vcopy_laneq_u16(__p0_415, __p1_415, __p2_415, __p3_415) __extension__ ({ \
49856 uint16x4_t __s0_415 = __p0_415; \
49857 uint16x8_t __s2_415 = __p2_415; \
49858 uint16x4_t __ret_415; \
49859 __ret_415 = vset_lane_u16(vgetq_lane_u16(__s2_415, __p3_415), __s0_415, __p1_415); \
49860 __ret_415; \
4815749861})
4815849862#else
48159#define vcopy_laneq_u16(__p0_324, __p1_324, __p2_324, __p3_324) __extension__ ({ \
48160 uint16x4_t __s0_324 = __p0_324; \
48161 uint16x8_t __s2_324 = __p2_324; \
48162 uint16x4_t __rev0_324; __rev0_324 = __builtin_shufflevector(__s0_324, __s0_324, 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); \
48164 uint16x4_t __ret_324; \
48165 __ret_324 = __noswap_vset_lane_u16(__noswap_vgetq_lane_u16(__rev2_324, __p3_324), __rev0_324, __p1_324); \
48166 __ret_324 = __builtin_shufflevector(__ret_324, __ret_324, 3, 2, 1, 0); \
48167 __ret_324; \
49863#define vcopy_laneq_u16(__p0_416, __p1_416, __p2_416, __p3_416) __extension__ ({ \
49864 uint16x4_t __s0_416 = __p0_416; \
49865 uint16x8_t __s2_416 = __p2_416; \
49866 uint16x4_t __rev0_416; __rev0_416 = __builtin_shufflevector(__s0_416, __s0_416, 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); \
49868 uint16x4_t __ret_416; \
49869 __ret_416 = __noswap_vset_lane_u16(__noswap_vgetq_lane_u16(__rev2_416, __p3_416), __rev0_416, __p1_416); \
49870 __ret_416 = __builtin_shufflevector(__ret_416, __ret_416, 3, 2, 1, 0); \
49871 __ret_416; \
4816849872})
4816949873#endif
4817049874
4817149875#ifdef __LITTLE_ENDIAN__
48172#define vcopy_laneq_s8(__p0_325, __p1_325, __p2_325, __p3_325) __extension__ ({ \
48173 int8x8_t __s0_325 = __p0_325; \
48174 int8x16_t __s2_325 = __p2_325; \
48175 int8x8_t __ret_325; \
48176 __ret_325 = vset_lane_s8(vgetq_lane_s8(__s2_325, __p3_325), __s0_325, __p1_325); \
48177 __ret_325; \
49876#define vcopy_laneq_s8(__p0_417, __p1_417, __p2_417, __p3_417) __extension__ ({ \
49877 int8x8_t __s0_417 = __p0_417; \
49878 int8x16_t __s2_417 = __p2_417; \
49879 int8x8_t __ret_417; \
49880 __ret_417 = vset_lane_s8(vgetq_lane_s8(__s2_417, __p3_417), __s0_417, __p1_417); \
49881 __ret_417; \
4817849882})
4817949883#else
48180#define vcopy_laneq_s8(__p0_326, __p1_326, __p2_326, __p3_326) __extension__ ({ \
48181 int8x8_t __s0_326 = __p0_326; \
48182 int8x16_t __s2_326 = __p2_326; \
48183 int8x8_t __rev0_326; __rev0_326 = __builtin_shufflevector(__s0_326, __s0_326, 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); \
48185 int8x8_t __ret_326; \
48186 __ret_326 = __noswap_vset_lane_s8(__noswap_vgetq_lane_s8(__rev2_326, __p3_326), __rev0_326, __p1_326); \
48187 __ret_326 = __builtin_shufflevector(__ret_326, __ret_326, 7, 6, 5, 4, 3, 2, 1, 0); \
48188 __ret_326; \
49884#define vcopy_laneq_s8(__p0_418, __p1_418, __p2_418, __p3_418) __extension__ ({ \
49885 int8x8_t __s0_418 = __p0_418; \
49886 int8x16_t __s2_418 = __p2_418; \
49887 int8x8_t __rev0_418; __rev0_418 = __builtin_shufflevector(__s0_418, __s0_418, 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); \
49889 int8x8_t __ret_418; \
49890 __ret_418 = __noswap_vset_lane_s8(__noswap_vgetq_lane_s8(__rev2_418, __p3_418), __rev0_418, __p1_418); \
49891 __ret_418 = __builtin_shufflevector(__ret_418, __ret_418, 7, 6, 5, 4, 3, 2, 1, 0); \
49892 __ret_418; \
4818949893})
4819049894#endif
4819149895
4819249896#ifdef __LITTLE_ENDIAN__
48193#define vcopy_laneq_f32(__p0_327, __p1_327, __p2_327, __p3_327) __extension__ ({ \
48194 float32x2_t __s0_327 = __p0_327; \
48195 float32x4_t __s2_327 = __p2_327; \
48196 float32x2_t __ret_327; \
48197 __ret_327 = vset_lane_f32(vgetq_lane_f32(__s2_327, __p3_327), __s0_327, __p1_327); \
48198 __ret_327; \
49897#define vcopy_laneq_f32(__p0_419, __p1_419, __p2_419, __p3_419) __extension__ ({ \
49898 float32x2_t __s0_419 = __p0_419; \
49899 float32x4_t __s2_419 = __p2_419; \
49900 float32x2_t __ret_419; \
49901 __ret_419 = vset_lane_f32(vgetq_lane_f32(__s2_419, __p3_419), __s0_419, __p1_419); \
49902 __ret_419; \
4819949903})
4820049904#else
48201#define vcopy_laneq_f32(__p0_328, __p1_328, __p2_328, __p3_328) __extension__ ({ \
48202 float32x2_t __s0_328 = __p0_328; \
48203 float32x4_t __s2_328 = __p2_328; \
48204 float32x2_t __rev0_328; __rev0_328 = __builtin_shufflevector(__s0_328, __s0_328, 1, 0); \
48205 float32x4_t __rev2_328; __rev2_328 = __builtin_shufflevector(__s2_328, __s2_328, 3, 2, 1, 0); \
48206 float32x2_t __ret_328; \
48207 __ret_328 = __noswap_vset_lane_f32(__noswap_vgetq_lane_f32(__rev2_328, __p3_328), __rev0_328, __p1_328); \
48208 __ret_328 = __builtin_shufflevector(__ret_328, __ret_328, 1, 0); \
48209 __ret_328; \
49905#define vcopy_laneq_f32(__p0_420, __p1_420, __p2_420, __p3_420) __extension__ ({ \
49906 float32x2_t __s0_420 = __p0_420; \
49907 float32x4_t __s2_420 = __p2_420; \
49908 float32x2_t __rev0_420; __rev0_420 = __builtin_shufflevector(__s0_420, __s0_420, 1, 0); \
49909 float32x4_t __rev2_420; __rev2_420 = __builtin_shufflevector(__s2_420, __s2_420, 3, 2, 1, 0); \
49910 float32x2_t __ret_420; \
49911 __ret_420 = __noswap_vset_lane_f32(__noswap_vgetq_lane_f32(__rev2_420, __p3_420), __rev0_420, __p1_420); \
49912 __ret_420 = __builtin_shufflevector(__ret_420, __ret_420, 1, 0); \
49913 __ret_420; \
4821049914})
4821149915#endif
4821249916
4821349917#ifdef __LITTLE_ENDIAN__
48214#define vcopy_laneq_s32(__p0_329, __p1_329, __p2_329, __p3_329) __extension__ ({ \
48215 int32x2_t __s0_329 = __p0_329; \
48216 int32x4_t __s2_329 = __p2_329; \
48217 int32x2_t __ret_329; \
48218 __ret_329 = vset_lane_s32(vgetq_lane_s32(__s2_329, __p3_329), __s0_329, __p1_329); \
48219 __ret_329; \
49918#define vcopy_laneq_s32(__p0_421, __p1_421, __p2_421, __p3_421) __extension__ ({ \
49919 int32x2_t __s0_421 = __p0_421; \
49920 int32x4_t __s2_421 = __p2_421; \
49921 int32x2_t __ret_421; \
49922 __ret_421 = vset_lane_s32(vgetq_lane_s32(__s2_421, __p3_421), __s0_421, __p1_421); \
49923 __ret_421; \
4822049924})
4822149925#else
48222#define vcopy_laneq_s32(__p0_330, __p1_330, __p2_330, __p3_330) __extension__ ({ \
48223 int32x2_t __s0_330 = __p0_330; \
48224 int32x4_t __s2_330 = __p2_330; \
48225 int32x2_t __rev0_330; __rev0_330 = __builtin_shufflevector(__s0_330, __s0_330, 1, 0); \
48226 int32x4_t __rev2_330; __rev2_330 = __builtin_shufflevector(__s2_330, __s2_330, 3, 2, 1, 0); \
48227 int32x2_t __ret_330; \
48228 __ret_330 = __noswap_vset_lane_s32(__noswap_vgetq_lane_s32(__rev2_330, __p3_330), __rev0_330, __p1_330); \
48229 __ret_330 = __builtin_shufflevector(__ret_330, __ret_330, 1, 0); \
48230 __ret_330; \
49926#define vcopy_laneq_s32(__p0_422, __p1_422, __p2_422, __p3_422) __extension__ ({ \
49927 int32x2_t __s0_422 = __p0_422; \
49928 int32x4_t __s2_422 = __p2_422; \
49929 int32x2_t __rev0_422; __rev0_422 = __builtin_shufflevector(__s0_422, __s0_422, 1, 0); \
49930 int32x4_t __rev2_422; __rev2_422 = __builtin_shufflevector(__s2_422, __s2_422, 3, 2, 1, 0); \
49931 int32x2_t __ret_422; \
49932 __ret_422 = __noswap_vset_lane_s32(__noswap_vgetq_lane_s32(__rev2_422, __p3_422), __rev0_422, __p1_422); \
49933 __ret_422 = __builtin_shufflevector(__ret_422, __ret_422, 1, 0); \
49934 __ret_422; \
4823149935})
4823249936#endif
4823349937
4823449938#ifdef __LITTLE_ENDIAN__
48235#define vcopy_laneq_s64(__p0_331, __p1_331, __p2_331, __p3_331) __extension__ ({ \
48236 int64x1_t __s0_331 = __p0_331; \
48237 int64x2_t __s2_331 = __p2_331; \
48238 int64x1_t __ret_331; \
48239 __ret_331 = vset_lane_s64(vgetq_lane_s64(__s2_331, __p3_331), __s0_331, __p1_331); \
48240 __ret_331; \
49939#define vcopy_laneq_s64(__p0_423, __p1_423, __p2_423, __p3_423) __extension__ ({ \
49940 int64x1_t __s0_423 = __p0_423; \
49941 int64x2_t __s2_423 = __p2_423; \
49942 int64x1_t __ret_423; \
49943 __ret_423 = vset_lane_s64(vgetq_lane_s64(__s2_423, __p3_423), __s0_423, __p1_423); \
49944 __ret_423; \
4824149945})
4824249946#else
48243#define vcopy_laneq_s64(__p0_332, __p1_332, __p2_332, __p3_332) __extension__ ({ \
48244 int64x1_t __s0_332 = __p0_332; \
48245 int64x2_t __s2_332 = __p2_332; \
48246 int64x2_t __rev2_332; __rev2_332 = __builtin_shufflevector(__s2_332, __s2_332, 1, 0); \
48247 int64x1_t __ret_332; \
48248 __ret_332 = vset_lane_s64(__noswap_vgetq_lane_s64(__rev2_332, __p3_332), __s0_332, __p1_332); \
48249 __ret_332; \
49947#define vcopy_laneq_s64(__p0_424, __p1_424, __p2_424, __p3_424) __extension__ ({ \
49948 int64x1_t __s0_424 = __p0_424; \
49949 int64x2_t __s2_424 = __p2_424; \
49950 int64x2_t __rev2_424; __rev2_424 = __builtin_shufflevector(__s2_424, __s2_424, 1, 0); \
49951 int64x1_t __ret_424; \
49952 __ret_424 = vset_lane_s64(__noswap_vgetq_lane_s64(__rev2_424, __p3_424), __s0_424, __p1_424); \
49953 __ret_424; \
4825049954})
4825149955#endif
4825249956
4825349957#ifdef __LITTLE_ENDIAN__
48254#define vcopy_laneq_s16(__p0_333, __p1_333, __p2_333, __p3_333) __extension__ ({ \
48255 int16x4_t __s0_333 = __p0_333; \
48256 int16x8_t __s2_333 = __p2_333; \
48257 int16x4_t __ret_333; \
48258 __ret_333 = vset_lane_s16(vgetq_lane_s16(__s2_333, __p3_333), __s0_333, __p1_333); \
48259 __ret_333; \
49958#define vcopy_laneq_s16(__p0_425, __p1_425, __p2_425, __p3_425) __extension__ ({ \
49959 int16x4_t __s0_425 = __p0_425; \
49960 int16x8_t __s2_425 = __p2_425; \
49961 int16x4_t __ret_425; \
49962 __ret_425 = vset_lane_s16(vgetq_lane_s16(__s2_425, __p3_425), __s0_425, __p1_425); \
49963 __ret_425; \
4826049964})
4826149965#else
48262#define vcopy_laneq_s16(__p0_334, __p1_334, __p2_334, __p3_334) __extension__ ({ \
48263 int16x4_t __s0_334 = __p0_334; \
48264 int16x8_t __s2_334 = __p2_334; \
48265 int16x4_t __rev0_334; __rev0_334 = __builtin_shufflevector(__s0_334, __s0_334, 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); \
48267 int16x4_t __ret_334; \
48268 __ret_334 = __noswap_vset_lane_s16(__noswap_vgetq_lane_s16(__rev2_334, __p3_334), __rev0_334, __p1_334); \
48269 __ret_334 = __builtin_shufflevector(__ret_334, __ret_334, 3, 2, 1, 0); \
48270 __ret_334; \
49966#define vcopy_laneq_s16(__p0_426, __p1_426, __p2_426, __p3_426) __extension__ ({ \
49967 int16x4_t __s0_426 = __p0_426; \
49968 int16x8_t __s2_426 = __p2_426; \
49969 int16x4_t __rev0_426; __rev0_426 = __builtin_shufflevector(__s0_426, __s0_426, 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); \
49971 int16x4_t __ret_426; \
49972 __ret_426 = __noswap_vset_lane_s16(__noswap_vgetq_lane_s16(__rev2_426, __p3_426), __rev0_426, __p1_426); \
49973 __ret_426 = __builtin_shufflevector(__ret_426, __ret_426, 3, 2, 1, 0); \
49974 __ret_426; \
4827149975})
4827249976#endif
4827349977
......@@ -49009,85 +50713,85 @@ __ai float32x2_t vdiv_f32(float32x2_t __p0, float32x2_t __p1) {
4900950713})
4901050714#endif
4901150715
49012#define vdup_lane_p64(__p0_335, __p1_335) __extension__ ({ \
49013 poly64x1_t __s0_335 = __p0_335; \
49014 poly64x1_t __ret_335; \
49015 __ret_335 = splat_lane_p64(__s0_335, __p1_335); \
49016 __ret_335; \
50716#define vdup_lane_p64(__p0_427, __p1_427) __extension__ ({ \
50717 poly64x1_t __s0_427 = __p0_427; \
50718 poly64x1_t __ret_427; \
50719 __ret_427 = splat_lane_p64(__s0_427, __p1_427); \
50720 __ret_427; \
4901750721})
4901850722#ifdef __LITTLE_ENDIAN__
49019#define vdupq_lane_p64(__p0_336, __p1_336) __extension__ ({ \
49020 poly64x1_t __s0_336 = __p0_336; \
49021 poly64x2_t __ret_336; \
49022 __ret_336 = splatq_lane_p64(__s0_336, __p1_336); \
49023 __ret_336; \
50723#define vdupq_lane_p64(__p0_428, __p1_428) __extension__ ({ \
50724 poly64x1_t __s0_428 = __p0_428; \
50725 poly64x2_t __ret_428; \
50726 __ret_428 = splatq_lane_p64(__s0_428, __p1_428); \
50727 __ret_428; \
4902450728})
4902550729#else
49026#define vdupq_lane_p64(__p0_337, __p1_337) __extension__ ({ \
49027 poly64x1_t __s0_337 = __p0_337; \
49028 poly64x2_t __ret_337; \
49029 __ret_337 = __noswap_splatq_lane_p64(__s0_337, __p1_337); \
49030 __ret_337 = __builtin_shufflevector(__ret_337, __ret_337, 1, 0); \
49031 __ret_337; \
50730#define vdupq_lane_p64(__p0_429, __p1_429) __extension__ ({ \
50731 poly64x1_t __s0_429 = __p0_429; \
50732 poly64x2_t __ret_429; \
50733 __ret_429 = __noswap_splatq_lane_p64(__s0_429, __p1_429); \
50734 __ret_429 = __builtin_shufflevector(__ret_429, __ret_429, 1, 0); \
50735 __ret_429; \
4903250736})
4903350737#endif
4903450738
4903550739#ifdef __LITTLE_ENDIAN__
49036#define vdupq_lane_f64(__p0_338, __p1_338) __extension__ ({ \
49037 float64x1_t __s0_338 = __p0_338; \
49038 float64x2_t __ret_338; \
49039 __ret_338 = splatq_lane_f64(__s0_338, __p1_338); \
49040 __ret_338; \
50740#define vdupq_lane_f64(__p0_430, __p1_430) __extension__ ({ \
50741 float64x1_t __s0_430 = __p0_430; \
50742 float64x2_t __ret_430; \
50743 __ret_430 = splatq_lane_f64(__s0_430, __p1_430); \
50744 __ret_430; \
4904150745})
4904250746#else
49043#define vdupq_lane_f64(__p0_339, __p1_339) __extension__ ({ \
49044 float64x1_t __s0_339 = __p0_339; \
49045 float64x2_t __ret_339; \
49046 __ret_339 = __noswap_splatq_lane_f64(__s0_339, __p1_339); \
49047 __ret_339 = __builtin_shufflevector(__ret_339, __ret_339, 1, 0); \
49048 __ret_339; \
50747#define vdupq_lane_f64(__p0_431, __p1_431) __extension__ ({ \
50748 float64x1_t __s0_431 = __p0_431; \
50749 float64x2_t __ret_431; \
50750 __ret_431 = __noswap_splatq_lane_f64(__s0_431, __p1_431); \
50751 __ret_431 = __builtin_shufflevector(__ret_431, __ret_431, 1, 0); \
50752 __ret_431; \
4904950753})
4905050754#endif
4905150755
4905250756#ifdef __LITTLE_ENDIAN__
49053#define vdupq_lane_f16(__p0_340, __p1_340) __extension__ ({ \
49054 float16x4_t __s0_340 = __p0_340; \
49055 float16x8_t __ret_340; \
49056 __ret_340 = splatq_lane_f16(__s0_340, __p1_340); \
49057 __ret_340; \
50757#define vdupq_lane_f16(__p0_432, __p1_432) __extension__ ({ \
50758 float16x4_t __s0_432 = __p0_432; \
50759 float16x8_t __ret_432; \
50760 __ret_432 = splatq_lane_f16(__s0_432, __p1_432); \
50761 __ret_432; \
4905850762})
4905950763#else
49060#define vdupq_lane_f16(__p0_341, __p1_341) __extension__ ({ \
49061 float16x4_t __s0_341 = __p0_341; \
49062 float16x4_t __rev0_341; __rev0_341 = __builtin_shufflevector(__s0_341, __s0_341, 3, 2, 1, 0); \
49063 float16x8_t __ret_341; \
49064 __ret_341 = __noswap_splatq_lane_f16(__rev0_341, __p1_341); \
49065 __ret_341 = __builtin_shufflevector(__ret_341, __ret_341, 7, 6, 5, 4, 3, 2, 1, 0); \
49066 __ret_341; \
50764#define vdupq_lane_f16(__p0_433, __p1_433) __extension__ ({ \
50765 float16x4_t __s0_433 = __p0_433; \
50766 float16x4_t __rev0_433; __rev0_433 = __builtin_shufflevector(__s0_433, __s0_433, 3, 2, 1, 0); \
50767 float16x8_t __ret_433; \
50768 __ret_433 = __noswap_splatq_lane_f16(__rev0_433, __p1_433); \
50769 __ret_433 = __builtin_shufflevector(__ret_433, __ret_433, 7, 6, 5, 4, 3, 2, 1, 0); \
50770 __ret_433; \
4906750771})
4906850772#endif
4906950773
49070#define vdup_lane_f64(__p0_342, __p1_342) __extension__ ({ \
49071 float64x1_t __s0_342 = __p0_342; \
49072 float64x1_t __ret_342; \
49073 __ret_342 = splat_lane_f64(__s0_342, __p1_342); \
49074 __ret_342; \
50774#define vdup_lane_f64(__p0_434, __p1_434) __extension__ ({ \
50775 float64x1_t __s0_434 = __p0_434; \
50776 float64x1_t __ret_434; \
50777 __ret_434 = splat_lane_f64(__s0_434, __p1_434); \
50778 __ret_434; \
4907550779})
4907650780#ifdef __LITTLE_ENDIAN__
49077#define vdup_lane_f16(__p0_343, __p1_343) __extension__ ({ \
49078 float16x4_t __s0_343 = __p0_343; \
49079 float16x4_t __ret_343; \
49080 __ret_343 = splat_lane_f16(__s0_343, __p1_343); \
49081 __ret_343; \
50781#define vdup_lane_f16(__p0_435, __p1_435) __extension__ ({ \
50782 float16x4_t __s0_435 = __p0_435; \
50783 float16x4_t __ret_435; \
50784 __ret_435 = splat_lane_f16(__s0_435, __p1_435); \
50785 __ret_435; \
4908250786})
4908350787#else
49084#define vdup_lane_f16(__p0_344, __p1_344) __extension__ ({ \
49085 float16x4_t __s0_344 = __p0_344; \
49086 float16x4_t __rev0_344; __rev0_344 = __builtin_shufflevector(__s0_344, __s0_344, 3, 2, 1, 0); \
49087 float16x4_t __ret_344; \
49088 __ret_344 = __noswap_splat_lane_f16(__rev0_344, __p1_344); \
49089 __ret_344 = __builtin_shufflevector(__ret_344, __ret_344, 3, 2, 1, 0); \
49090 __ret_344; \
50788#define vdup_lane_f16(__p0_436, __p1_436) __extension__ ({ \
50789 float16x4_t __s0_436 = __p0_436; \
50790 float16x4_t __rev0_436; __rev0_436 = __builtin_shufflevector(__s0_436, __s0_436, 3, 2, 1, 0); \
50791 float16x4_t __ret_436; \
50792 __ret_436 = __noswap_splat_lane_f16(__rev0_436, __p1_436); \
50793 __ret_436 = __builtin_shufflevector(__ret_436, __ret_436, 3, 2, 1, 0); \
50794 __ret_436; \
4909150795})
4909250796#endif
4909350797
......@@ -49296,502 +51000,502 @@ __ai float32x2_t vdiv_f32(float32x2_t __p0, float32x2_t __p1) {
4929651000#endif
4929751001
4929851002#ifdef __LITTLE_ENDIAN__
49299#define vdup_laneq_p8(__p0_345, __p1_345) __extension__ ({ \
49300 poly8x16_t __s0_345 = __p0_345; \
49301 poly8x8_t __ret_345; \
49302 __ret_345 = splat_laneq_p8(__s0_345, __p1_345); \
49303 __ret_345; \
51003#define vdup_laneq_p8(__p0_437, __p1_437) __extension__ ({ \
51004 poly8x16_t __s0_437 = __p0_437; \
51005 poly8x8_t __ret_437; \
51006 __ret_437 = splat_laneq_p8(__s0_437, __p1_437); \
51007 __ret_437; \
4930451008})
4930551009#else
49306#define vdup_laneq_p8(__p0_346, __p1_346) __extension__ ({ \
49307 poly8x16_t __s0_346 = __p0_346; \
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); \
49309 poly8x8_t __ret_346; \
49310 __ret_346 = __noswap_splat_laneq_p8(__rev0_346, __p1_346); \
49311 __ret_346 = __builtin_shufflevector(__ret_346, __ret_346, 7, 6, 5, 4, 3, 2, 1, 0); \
49312 __ret_346; \
51010#define vdup_laneq_p8(__p0_438, __p1_438) __extension__ ({ \
51011 poly8x16_t __s0_438 = __p0_438; \
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); \
51013 poly8x8_t __ret_438; \
51014 __ret_438 = __noswap_splat_laneq_p8(__rev0_438, __p1_438); \
51015 __ret_438 = __builtin_shufflevector(__ret_438, __ret_438, 7, 6, 5, 4, 3, 2, 1, 0); \
51016 __ret_438; \
4931351017})
4931451018#endif
4931551019
4931651020#ifdef __LITTLE_ENDIAN__
49317#define vdup_laneq_p64(__p0_347, __p1_347) __extension__ ({ \
49318 poly64x2_t __s0_347 = __p0_347; \
49319 poly64x1_t __ret_347; \
49320 __ret_347 = splat_laneq_p64(__s0_347, __p1_347); \
49321 __ret_347; \
51021#define vdup_laneq_p64(__p0_439, __p1_439) __extension__ ({ \
51022 poly64x2_t __s0_439 = __p0_439; \
51023 poly64x1_t __ret_439; \
51024 __ret_439 = splat_laneq_p64(__s0_439, __p1_439); \
51025 __ret_439; \
4932251026})
4932351027#else
49324#define vdup_laneq_p64(__p0_348, __p1_348) __extension__ ({ \
49325 poly64x2_t __s0_348 = __p0_348; \
49326 poly64x2_t __rev0_348; __rev0_348 = __builtin_shufflevector(__s0_348, __s0_348, 1, 0); \
49327 poly64x1_t __ret_348; \
49328 __ret_348 = __noswap_splat_laneq_p64(__rev0_348, __p1_348); \
49329 __ret_348; \
51028#define vdup_laneq_p64(__p0_440, __p1_440) __extension__ ({ \
51029 poly64x2_t __s0_440 = __p0_440; \
51030 poly64x2_t __rev0_440; __rev0_440 = __builtin_shufflevector(__s0_440, __s0_440, 1, 0); \
51031 poly64x1_t __ret_440; \
51032 __ret_440 = __noswap_splat_laneq_p64(__rev0_440, __p1_440); \
51033 __ret_440; \
4933051034})
4933151035#endif
4933251036
4933351037#ifdef __LITTLE_ENDIAN__
49334#define vdup_laneq_p16(__p0_349, __p1_349) __extension__ ({ \
49335 poly16x8_t __s0_349 = __p0_349; \
49336 poly16x4_t __ret_349; \
49337 __ret_349 = splat_laneq_p16(__s0_349, __p1_349); \
49338 __ret_349; \
51038#define vdup_laneq_p16(__p0_441, __p1_441) __extension__ ({ \
51039 poly16x8_t __s0_441 = __p0_441; \
51040 poly16x4_t __ret_441; \
51041 __ret_441 = splat_laneq_p16(__s0_441, __p1_441); \
51042 __ret_441; \
4933951043})
4934051044#else
49341#define vdup_laneq_p16(__p0_350, __p1_350) __extension__ ({ \
49342 poly16x8_t __s0_350 = __p0_350; \
49343 poly16x8_t __rev0_350; __rev0_350 = __builtin_shufflevector(__s0_350, __s0_350, 7, 6, 5, 4, 3, 2, 1, 0); \
49344 poly16x4_t __ret_350; \
49345 __ret_350 = __noswap_splat_laneq_p16(__rev0_350, __p1_350); \
49346 __ret_350 = __builtin_shufflevector(__ret_350, __ret_350, 3, 2, 1, 0); \
49347 __ret_350; \
51045#define vdup_laneq_p16(__p0_442, __p1_442) __extension__ ({ \
51046 poly16x8_t __s0_442 = __p0_442; \
51047 poly16x8_t __rev0_442; __rev0_442 = __builtin_shufflevector(__s0_442, __s0_442, 7, 6, 5, 4, 3, 2, 1, 0); \
51048 poly16x4_t __ret_442; \
51049 __ret_442 = __noswap_splat_laneq_p16(__rev0_442, __p1_442); \
51050 __ret_442 = __builtin_shufflevector(__ret_442, __ret_442, 3, 2, 1, 0); \
51051 __ret_442; \
4934851052})
4934951053#endif
4935051054
4935151055#ifdef __LITTLE_ENDIAN__
49352#define vdupq_laneq_p8(__p0_351, __p1_351) __extension__ ({ \
49353 poly8x16_t __s0_351 = __p0_351; \
49354 poly8x16_t __ret_351; \
49355 __ret_351 = splatq_laneq_p8(__s0_351, __p1_351); \
49356 __ret_351; \
51056#define vdupq_laneq_p8(__p0_443, __p1_443) __extension__ ({ \
51057 poly8x16_t __s0_443 = __p0_443; \
51058 poly8x16_t __ret_443; \
51059 __ret_443 = splatq_laneq_p8(__s0_443, __p1_443); \
51060 __ret_443; \
4935751061})
4935851062#else
49359#define vdupq_laneq_p8(__p0_352, __p1_352) __extension__ ({ \
49360 poly8x16_t __s0_352 = __p0_352; \
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); \
49362 poly8x16_t __ret_352; \
49363 __ret_352 = __noswap_splatq_laneq_p8(__rev0_352, __p1_352); \
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); \
49365 __ret_352; \
51063#define vdupq_laneq_p8(__p0_444, __p1_444) __extension__ ({ \
51064 poly8x16_t __s0_444 = __p0_444; \
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); \
51066 poly8x16_t __ret_444; \
51067 __ret_444 = __noswap_splatq_laneq_p8(__rev0_444, __p1_444); \
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); \
51069 __ret_444; \
4936651070})
4936751071#endif
4936851072
4936951073#ifdef __LITTLE_ENDIAN__
49370#define vdupq_laneq_p64(__p0_353, __p1_353) __extension__ ({ \
49371 poly64x2_t __s0_353 = __p0_353; \
49372 poly64x2_t __ret_353; \
49373 __ret_353 = splatq_laneq_p64(__s0_353, __p1_353); \
49374 __ret_353; \
51074#define vdupq_laneq_p64(__p0_445, __p1_445) __extension__ ({ \
51075 poly64x2_t __s0_445 = __p0_445; \
51076 poly64x2_t __ret_445; \
51077 __ret_445 = splatq_laneq_p64(__s0_445, __p1_445); \
51078 __ret_445; \
4937551079})
4937651080#else
49377#define vdupq_laneq_p64(__p0_354, __p1_354) __extension__ ({ \
49378 poly64x2_t __s0_354 = __p0_354; \
49379 poly64x2_t __rev0_354; __rev0_354 = __builtin_shufflevector(__s0_354, __s0_354, 1, 0); \
49380 poly64x2_t __ret_354; \
49381 __ret_354 = __noswap_splatq_laneq_p64(__rev0_354, __p1_354); \
49382 __ret_354 = __builtin_shufflevector(__ret_354, __ret_354, 1, 0); \
49383 __ret_354; \
51081#define vdupq_laneq_p64(__p0_446, __p1_446) __extension__ ({ \
51082 poly64x2_t __s0_446 = __p0_446; \
51083 poly64x2_t __rev0_446; __rev0_446 = __builtin_shufflevector(__s0_446, __s0_446, 1, 0); \
51084 poly64x2_t __ret_446; \
51085 __ret_446 = __noswap_splatq_laneq_p64(__rev0_446, __p1_446); \
51086 __ret_446 = __builtin_shufflevector(__ret_446, __ret_446, 1, 0); \
51087 __ret_446; \
4938451088})
4938551089#endif
4938651090
4938751091#ifdef __LITTLE_ENDIAN__
49388#define vdupq_laneq_p16(__p0_355, __p1_355) __extension__ ({ \
49389 poly16x8_t __s0_355 = __p0_355; \
49390 poly16x8_t __ret_355; \
49391 __ret_355 = splatq_laneq_p16(__s0_355, __p1_355); \
49392 __ret_355; \
51092#define vdupq_laneq_p16(__p0_447, __p1_447) __extension__ ({ \
51093 poly16x8_t __s0_447 = __p0_447; \
51094 poly16x8_t __ret_447; \
51095 __ret_447 = splatq_laneq_p16(__s0_447, __p1_447); \
51096 __ret_447; \
4939351097})
4939451098#else
49395#define vdupq_laneq_p16(__p0_356, __p1_356) __extension__ ({ \
49396 poly16x8_t __s0_356 = __p0_356; \
49397 poly16x8_t __rev0_356; __rev0_356 = __builtin_shufflevector(__s0_356, __s0_356, 7, 6, 5, 4, 3, 2, 1, 0); \
49398 poly16x8_t __ret_356; \
49399 __ret_356 = __noswap_splatq_laneq_p16(__rev0_356, __p1_356); \
49400 __ret_356 = __builtin_shufflevector(__ret_356, __ret_356, 7, 6, 5, 4, 3, 2, 1, 0); \
49401 __ret_356; \
51099#define vdupq_laneq_p16(__p0_448, __p1_448) __extension__ ({ \
51100 poly16x8_t __s0_448 = __p0_448; \
51101 poly16x8_t __rev0_448; __rev0_448 = __builtin_shufflevector(__s0_448, __s0_448, 7, 6, 5, 4, 3, 2, 1, 0); \
51102 poly16x8_t __ret_448; \
51103 __ret_448 = __noswap_splatq_laneq_p16(__rev0_448, __p1_448); \
51104 __ret_448 = __builtin_shufflevector(__ret_448, __ret_448, 7, 6, 5, 4, 3, 2, 1, 0); \
51105 __ret_448; \
4940251106})
4940351107#endif
4940451108
4940551109#ifdef __LITTLE_ENDIAN__
49406#define vdupq_laneq_u8(__p0_357, __p1_357) __extension__ ({ \
49407 uint8x16_t __s0_357 = __p0_357; \
49408 uint8x16_t __ret_357; \
49409 __ret_357 = splatq_laneq_u8(__s0_357, __p1_357); \
49410 __ret_357; \
51110#define vdupq_laneq_u8(__p0_449, __p1_449) __extension__ ({ \
51111 uint8x16_t __s0_449 = __p0_449; \
51112 uint8x16_t __ret_449; \
51113 __ret_449 = splatq_laneq_u8(__s0_449, __p1_449); \
51114 __ret_449; \
4941151115})
4941251116#else
49413#define vdupq_laneq_u8(__p0_358, __p1_358) __extension__ ({ \
49414 uint8x16_t __s0_358 = __p0_358; \
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); \
49416 uint8x16_t __ret_358; \
49417 __ret_358 = __noswap_splatq_laneq_u8(__rev0_358, __p1_358); \
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); \
49419 __ret_358; \
51117#define vdupq_laneq_u8(__p0_450, __p1_450) __extension__ ({ \
51118 uint8x16_t __s0_450 = __p0_450; \
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); \
51120 uint8x16_t __ret_450; \
51121 __ret_450 = __noswap_splatq_laneq_u8(__rev0_450, __p1_450); \
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); \
51123 __ret_450; \
4942051124})
4942151125#endif
4942251126
4942351127#ifdef __LITTLE_ENDIAN__
49424#define vdupq_laneq_u32(__p0_359, __p1_359) __extension__ ({ \
49425 uint32x4_t __s0_359 = __p0_359; \
49426 uint32x4_t __ret_359; \
49427 __ret_359 = splatq_laneq_u32(__s0_359, __p1_359); \
49428 __ret_359; \
51128#define vdupq_laneq_u32(__p0_451, __p1_451) __extension__ ({ \
51129 uint32x4_t __s0_451 = __p0_451; \
51130 uint32x4_t __ret_451; \
51131 __ret_451 = splatq_laneq_u32(__s0_451, __p1_451); \
51132 __ret_451; \
4942951133})
4943051134#else
49431#define vdupq_laneq_u32(__p0_360, __p1_360) __extension__ ({ \
49432 uint32x4_t __s0_360 = __p0_360; \
49433 uint32x4_t __rev0_360; __rev0_360 = __builtin_shufflevector(__s0_360, __s0_360, 3, 2, 1, 0); \
49434 uint32x4_t __ret_360; \
49435 __ret_360 = __noswap_splatq_laneq_u32(__rev0_360, __p1_360); \
49436 __ret_360 = __builtin_shufflevector(__ret_360, __ret_360, 3, 2, 1, 0); \
49437 __ret_360; \
51135#define vdupq_laneq_u32(__p0_452, __p1_452) __extension__ ({ \
51136 uint32x4_t __s0_452 = __p0_452; \
51137 uint32x4_t __rev0_452; __rev0_452 = __builtin_shufflevector(__s0_452, __s0_452, 3, 2, 1, 0); \
51138 uint32x4_t __ret_452; \
51139 __ret_452 = __noswap_splatq_laneq_u32(__rev0_452, __p1_452); \
51140 __ret_452 = __builtin_shufflevector(__ret_452, __ret_452, 3, 2, 1, 0); \
51141 __ret_452; \
4943851142})
4943951143#endif
4944051144
4944151145#ifdef __LITTLE_ENDIAN__
49442#define vdupq_laneq_u64(__p0_361, __p1_361) __extension__ ({ \
49443 uint64x2_t __s0_361 = __p0_361; \
49444 uint64x2_t __ret_361; \
49445 __ret_361 = splatq_laneq_u64(__s0_361, __p1_361); \
49446 __ret_361; \
51146#define vdupq_laneq_u64(__p0_453, __p1_453) __extension__ ({ \
51147 uint64x2_t __s0_453 = __p0_453; \
51148 uint64x2_t __ret_453; \
51149 __ret_453 = splatq_laneq_u64(__s0_453, __p1_453); \
51150 __ret_453; \
4944751151})
4944851152#else
49449#define vdupq_laneq_u64(__p0_362, __p1_362) __extension__ ({ \
49450 uint64x2_t __s0_362 = __p0_362; \
49451 uint64x2_t __rev0_362; __rev0_362 = __builtin_shufflevector(__s0_362, __s0_362, 1, 0); \
49452 uint64x2_t __ret_362; \
49453 __ret_362 = __noswap_splatq_laneq_u64(__rev0_362, __p1_362); \
49454 __ret_362 = __builtin_shufflevector(__ret_362, __ret_362, 1, 0); \
49455 __ret_362; \
51153#define vdupq_laneq_u64(__p0_454, __p1_454) __extension__ ({ \
51154 uint64x2_t __s0_454 = __p0_454; \
51155 uint64x2_t __rev0_454; __rev0_454 = __builtin_shufflevector(__s0_454, __s0_454, 1, 0); \
51156 uint64x2_t __ret_454; \
51157 __ret_454 = __noswap_splatq_laneq_u64(__rev0_454, __p1_454); \
51158 __ret_454 = __builtin_shufflevector(__ret_454, __ret_454, 1, 0); \
51159 __ret_454; \
4945651160})
4945751161#endif
4945851162
4945951163#ifdef __LITTLE_ENDIAN__
49460#define vdupq_laneq_u16(__p0_363, __p1_363) __extension__ ({ \
49461 uint16x8_t __s0_363 = __p0_363; \
49462 uint16x8_t __ret_363; \
49463 __ret_363 = splatq_laneq_u16(__s0_363, __p1_363); \
49464 __ret_363; \
51164#define vdupq_laneq_u16(__p0_455, __p1_455) __extension__ ({ \
51165 uint16x8_t __s0_455 = __p0_455; \
51166 uint16x8_t __ret_455; \
51167 __ret_455 = splatq_laneq_u16(__s0_455, __p1_455); \
51168 __ret_455; \
4946551169})
4946651170#else
49467#define vdupq_laneq_u16(__p0_364, __p1_364) __extension__ ({ \
49468 uint16x8_t __s0_364 = __p0_364; \
49469 uint16x8_t __rev0_364; __rev0_364 = __builtin_shufflevector(__s0_364, __s0_364, 7, 6, 5, 4, 3, 2, 1, 0); \
49470 uint16x8_t __ret_364; \
49471 __ret_364 = __noswap_splatq_laneq_u16(__rev0_364, __p1_364); \
49472 __ret_364 = __builtin_shufflevector(__ret_364, __ret_364, 7, 6, 5, 4, 3, 2, 1, 0); \
49473 __ret_364; \
51171#define vdupq_laneq_u16(__p0_456, __p1_456) __extension__ ({ \
51172 uint16x8_t __s0_456 = __p0_456; \
51173 uint16x8_t __rev0_456; __rev0_456 = __builtin_shufflevector(__s0_456, __s0_456, 7, 6, 5, 4, 3, 2, 1, 0); \
51174 uint16x8_t __ret_456; \
51175 __ret_456 = __noswap_splatq_laneq_u16(__rev0_456, __p1_456); \
51176 __ret_456 = __builtin_shufflevector(__ret_456, __ret_456, 7, 6, 5, 4, 3, 2, 1, 0); \
51177 __ret_456; \
4947451178})
4947551179#endif
4947651180
4947751181#ifdef __LITTLE_ENDIAN__
49478#define vdupq_laneq_s8(__p0_365, __p1_365) __extension__ ({ \
49479 int8x16_t __s0_365 = __p0_365; \
49480 int8x16_t __ret_365; \
49481 __ret_365 = splatq_laneq_s8(__s0_365, __p1_365); \
49482 __ret_365; \
51182#define vdupq_laneq_s8(__p0_457, __p1_457) __extension__ ({ \
51183 int8x16_t __s0_457 = __p0_457; \
51184 int8x16_t __ret_457; \
51185 __ret_457 = splatq_laneq_s8(__s0_457, __p1_457); \
51186 __ret_457; \
4948351187})
4948451188#else
49485#define vdupq_laneq_s8(__p0_366, __p1_366) __extension__ ({ \
49486 int8x16_t __s0_366 = __p0_366; \
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); \
49488 int8x16_t __ret_366; \
49489 __ret_366 = __noswap_splatq_laneq_s8(__rev0_366, __p1_366); \
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); \
49491 __ret_366; \
51189#define vdupq_laneq_s8(__p0_458, __p1_458) __extension__ ({ \
51190 int8x16_t __s0_458 = __p0_458; \
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); \
51192 int8x16_t __ret_458; \
51193 __ret_458 = __noswap_splatq_laneq_s8(__rev0_458, __p1_458); \
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); \
51195 __ret_458; \
4949251196})
4949351197#endif
4949451198
4949551199#ifdef __LITTLE_ENDIAN__
49496#define vdupq_laneq_f64(__p0_367, __p1_367) __extension__ ({ \
49497 float64x2_t __s0_367 = __p0_367; \
49498 float64x2_t __ret_367; \
49499 __ret_367 = splatq_laneq_f64(__s0_367, __p1_367); \
49500 __ret_367; \
51200#define vdupq_laneq_f64(__p0_459, __p1_459) __extension__ ({ \
51201 float64x2_t __s0_459 = __p0_459; \
51202 float64x2_t __ret_459; \
51203 __ret_459 = splatq_laneq_f64(__s0_459, __p1_459); \
51204 __ret_459; \
4950151205})
4950251206#else
49503#define vdupq_laneq_f64(__p0_368, __p1_368) __extension__ ({ \
49504 float64x2_t __s0_368 = __p0_368; \
49505 float64x2_t __rev0_368; __rev0_368 = __builtin_shufflevector(__s0_368, __s0_368, 1, 0); \
49506 float64x2_t __ret_368; \
49507 __ret_368 = __noswap_splatq_laneq_f64(__rev0_368, __p1_368); \
49508 __ret_368 = __builtin_shufflevector(__ret_368, __ret_368, 1, 0); \
49509 __ret_368; \
51207#define vdupq_laneq_f64(__p0_460, __p1_460) __extension__ ({ \
51208 float64x2_t __s0_460 = __p0_460; \
51209 float64x2_t __rev0_460; __rev0_460 = __builtin_shufflevector(__s0_460, __s0_460, 1, 0); \
51210 float64x2_t __ret_460; \
51211 __ret_460 = __noswap_splatq_laneq_f64(__rev0_460, __p1_460); \
51212 __ret_460 = __builtin_shufflevector(__ret_460, __ret_460, 1, 0); \
51213 __ret_460; \
4951051214})
4951151215#endif
4951251216
4951351217#ifdef __LITTLE_ENDIAN__
49514#define vdupq_laneq_f32(__p0_369, __p1_369) __extension__ ({ \
49515 float32x4_t __s0_369 = __p0_369; \
49516 float32x4_t __ret_369; \
49517 __ret_369 = splatq_laneq_f32(__s0_369, __p1_369); \
49518 __ret_369; \
51218#define vdupq_laneq_f32(__p0_461, __p1_461) __extension__ ({ \
51219 float32x4_t __s0_461 = __p0_461; \
51220 float32x4_t __ret_461; \
51221 __ret_461 = splatq_laneq_f32(__s0_461, __p1_461); \
51222 __ret_461; \
4951951223})
4952051224#else
49521#define vdupq_laneq_f32(__p0_370, __p1_370) __extension__ ({ \
49522 float32x4_t __s0_370 = __p0_370; \
49523 float32x4_t __rev0_370; __rev0_370 = __builtin_shufflevector(__s0_370, __s0_370, 3, 2, 1, 0); \
49524 float32x4_t __ret_370; \
49525 __ret_370 = __noswap_splatq_laneq_f32(__rev0_370, __p1_370); \
49526 __ret_370 = __builtin_shufflevector(__ret_370, __ret_370, 3, 2, 1, 0); \
49527 __ret_370; \
51225#define vdupq_laneq_f32(__p0_462, __p1_462) __extension__ ({ \
51226 float32x4_t __s0_462 = __p0_462; \
51227 float32x4_t __rev0_462; __rev0_462 = __builtin_shufflevector(__s0_462, __s0_462, 3, 2, 1, 0); \
51228 float32x4_t __ret_462; \
51229 __ret_462 = __noswap_splatq_laneq_f32(__rev0_462, __p1_462); \
51230 __ret_462 = __builtin_shufflevector(__ret_462, __ret_462, 3, 2, 1, 0); \
51231 __ret_462; \
4952851232})
4952951233#endif
4953051234
4953151235#ifdef __LITTLE_ENDIAN__
49532#define vdupq_laneq_f16(__p0_371, __p1_371) __extension__ ({ \
49533 float16x8_t __s0_371 = __p0_371; \
49534 float16x8_t __ret_371; \
49535 __ret_371 = splatq_laneq_f16(__s0_371, __p1_371); \
49536 __ret_371; \
51236#define vdupq_laneq_f16(__p0_463, __p1_463) __extension__ ({ \
51237 float16x8_t __s0_463 = __p0_463; \
51238 float16x8_t __ret_463; \
51239 __ret_463 = splatq_laneq_f16(__s0_463, __p1_463); \
51240 __ret_463; \
4953751241})
4953851242#else
49539#define vdupq_laneq_f16(__p0_372, __p1_372) __extension__ ({ \
49540 float16x8_t __s0_372 = __p0_372; \
49541 float16x8_t __rev0_372; __rev0_372 = __builtin_shufflevector(__s0_372, __s0_372, 7, 6, 5, 4, 3, 2, 1, 0); \
49542 float16x8_t __ret_372; \
49543 __ret_372 = __noswap_splatq_laneq_f16(__rev0_372, __p1_372); \
49544 __ret_372 = __builtin_shufflevector(__ret_372, __ret_372, 7, 6, 5, 4, 3, 2, 1, 0); \
49545 __ret_372; \
51243#define vdupq_laneq_f16(__p0_464, __p1_464) __extension__ ({ \
51244 float16x8_t __s0_464 = __p0_464; \
51245 float16x8_t __rev0_464; __rev0_464 = __builtin_shufflevector(__s0_464, __s0_464, 7, 6, 5, 4, 3, 2, 1, 0); \
51246 float16x8_t __ret_464; \
51247 __ret_464 = __noswap_splatq_laneq_f16(__rev0_464, __p1_464); \
51248 __ret_464 = __builtin_shufflevector(__ret_464, __ret_464, 7, 6, 5, 4, 3, 2, 1, 0); \
51249 __ret_464; \
4954651250})
4954751251#endif
4954851252
4954951253#ifdef __LITTLE_ENDIAN__
49550#define vdupq_laneq_s32(__p0_373, __p1_373) __extension__ ({ \
49551 int32x4_t __s0_373 = __p0_373; \
49552 int32x4_t __ret_373; \
49553 __ret_373 = splatq_laneq_s32(__s0_373, __p1_373); \
49554 __ret_373; \
51254#define vdupq_laneq_s32(__p0_465, __p1_465) __extension__ ({ \
51255 int32x4_t __s0_465 = __p0_465; \
51256 int32x4_t __ret_465; \
51257 __ret_465 = splatq_laneq_s32(__s0_465, __p1_465); \
51258 __ret_465; \
4955551259})
4955651260#else
49557#define vdupq_laneq_s32(__p0_374, __p1_374) __extension__ ({ \
49558 int32x4_t __s0_374 = __p0_374; \
49559 int32x4_t __rev0_374; __rev0_374 = __builtin_shufflevector(__s0_374, __s0_374, 3, 2, 1, 0); \
49560 int32x4_t __ret_374; \
49561 __ret_374 = __noswap_splatq_laneq_s32(__rev0_374, __p1_374); \
49562 __ret_374 = __builtin_shufflevector(__ret_374, __ret_374, 3, 2, 1, 0); \
49563 __ret_374; \
51261#define vdupq_laneq_s32(__p0_466, __p1_466) __extension__ ({ \
51262 int32x4_t __s0_466 = __p0_466; \
51263 int32x4_t __rev0_466; __rev0_466 = __builtin_shufflevector(__s0_466, __s0_466, 3, 2, 1, 0); \
51264 int32x4_t __ret_466; \
51265 __ret_466 = __noswap_splatq_laneq_s32(__rev0_466, __p1_466); \
51266 __ret_466 = __builtin_shufflevector(__ret_466, __ret_466, 3, 2, 1, 0); \
51267 __ret_466; \
4956451268})
4956551269#endif
4956651270
4956751271#ifdef __LITTLE_ENDIAN__
49568#define vdupq_laneq_s64(__p0_375, __p1_375) __extension__ ({ \
49569 int64x2_t __s0_375 = __p0_375; \
49570 int64x2_t __ret_375; \
49571 __ret_375 = splatq_laneq_s64(__s0_375, __p1_375); \
49572 __ret_375; \
51272#define vdupq_laneq_s64(__p0_467, __p1_467) __extension__ ({ \
51273 int64x2_t __s0_467 = __p0_467; \
51274 int64x2_t __ret_467; \
51275 __ret_467 = splatq_laneq_s64(__s0_467, __p1_467); \
51276 __ret_467; \
4957351277})
4957451278#else
49575#define vdupq_laneq_s64(__p0_376, __p1_376) __extension__ ({ \
49576 int64x2_t __s0_376 = __p0_376; \
49577 int64x2_t __rev0_376; __rev0_376 = __builtin_shufflevector(__s0_376, __s0_376, 1, 0); \
49578 int64x2_t __ret_376; \
49579 __ret_376 = __noswap_splatq_laneq_s64(__rev0_376, __p1_376); \
49580 __ret_376 = __builtin_shufflevector(__ret_376, __ret_376, 1, 0); \
49581 __ret_376; \
51279#define vdupq_laneq_s64(__p0_468, __p1_468) __extension__ ({ \
51280 int64x2_t __s0_468 = __p0_468; \
51281 int64x2_t __rev0_468; __rev0_468 = __builtin_shufflevector(__s0_468, __s0_468, 1, 0); \
51282 int64x2_t __ret_468; \
51283 __ret_468 = __noswap_splatq_laneq_s64(__rev0_468, __p1_468); \
51284 __ret_468 = __builtin_shufflevector(__ret_468, __ret_468, 1, 0); \
51285 __ret_468; \
4958251286})
4958351287#endif
4958451288
4958551289#ifdef __LITTLE_ENDIAN__
49586#define vdupq_laneq_s16(__p0_377, __p1_377) __extension__ ({ \
49587 int16x8_t __s0_377 = __p0_377; \
49588 int16x8_t __ret_377; \
49589 __ret_377 = splatq_laneq_s16(__s0_377, __p1_377); \
49590 __ret_377; \
51290#define vdupq_laneq_s16(__p0_469, __p1_469) __extension__ ({ \
51291 int16x8_t __s0_469 = __p0_469; \
51292 int16x8_t __ret_469; \
51293 __ret_469 = splatq_laneq_s16(__s0_469, __p1_469); \
51294 __ret_469; \
4959151295})
4959251296#else
49593#define vdupq_laneq_s16(__p0_378, __p1_378) __extension__ ({ \
49594 int16x8_t __s0_378 = __p0_378; \
49595 int16x8_t __rev0_378; __rev0_378 = __builtin_shufflevector(__s0_378, __s0_378, 7, 6, 5, 4, 3, 2, 1, 0); \
49596 int16x8_t __ret_378; \
49597 __ret_378 = __noswap_splatq_laneq_s16(__rev0_378, __p1_378); \
49598 __ret_378 = __builtin_shufflevector(__ret_378, __ret_378, 7, 6, 5, 4, 3, 2, 1, 0); \
49599 __ret_378; \
51297#define vdupq_laneq_s16(__p0_470, __p1_470) __extension__ ({ \
51298 int16x8_t __s0_470 = __p0_470; \
51299 int16x8_t __rev0_470; __rev0_470 = __builtin_shufflevector(__s0_470, __s0_470, 7, 6, 5, 4, 3, 2, 1, 0); \
51300 int16x8_t __ret_470; \
51301 __ret_470 = __noswap_splatq_laneq_s16(__rev0_470, __p1_470); \
51302 __ret_470 = __builtin_shufflevector(__ret_470, __ret_470, 7, 6, 5, 4, 3, 2, 1, 0); \
51303 __ret_470; \
4960051304})
4960151305#endif
4960251306
4960351307#ifdef __LITTLE_ENDIAN__
49604#define vdup_laneq_u8(__p0_379, __p1_379) __extension__ ({ \
49605 uint8x16_t __s0_379 = __p0_379; \
49606 uint8x8_t __ret_379; \
49607 __ret_379 = splat_laneq_u8(__s0_379, __p1_379); \
49608 __ret_379; \
51308#define vdup_laneq_u8(__p0_471, __p1_471) __extension__ ({ \
51309 uint8x16_t __s0_471 = __p0_471; \
51310 uint8x8_t __ret_471; \
51311 __ret_471 = splat_laneq_u8(__s0_471, __p1_471); \
51312 __ret_471; \
4960951313})
4961051314#else
49611#define vdup_laneq_u8(__p0_380, __p1_380) __extension__ ({ \
49612 uint8x16_t __s0_380 = __p0_380; \
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); \
49614 uint8x8_t __ret_380; \
49615 __ret_380 = __noswap_splat_laneq_u8(__rev0_380, __p1_380); \
49616 __ret_380 = __builtin_shufflevector(__ret_380, __ret_380, 7, 6, 5, 4, 3, 2, 1, 0); \
49617 __ret_380; \
51315#define vdup_laneq_u8(__p0_472, __p1_472) __extension__ ({ \
51316 uint8x16_t __s0_472 = __p0_472; \
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); \
51318 uint8x8_t __ret_472; \
51319 __ret_472 = __noswap_splat_laneq_u8(__rev0_472, __p1_472); \
51320 __ret_472 = __builtin_shufflevector(__ret_472, __ret_472, 7, 6, 5, 4, 3, 2, 1, 0); \
51321 __ret_472; \
4961851322})
4961951323#endif
4962051324
4962151325#ifdef __LITTLE_ENDIAN__
49622#define vdup_laneq_u32(__p0_381, __p1_381) __extension__ ({ \
49623 uint32x4_t __s0_381 = __p0_381; \
49624 uint32x2_t __ret_381; \
49625 __ret_381 = splat_laneq_u32(__s0_381, __p1_381); \
49626 __ret_381; \
51326#define vdup_laneq_u32(__p0_473, __p1_473) __extension__ ({ \
51327 uint32x4_t __s0_473 = __p0_473; \
51328 uint32x2_t __ret_473; \
51329 __ret_473 = splat_laneq_u32(__s0_473, __p1_473); \
51330 __ret_473; \
4962751331})
4962851332#else
49629#define vdup_laneq_u32(__p0_382, __p1_382) __extension__ ({ \
49630 uint32x4_t __s0_382 = __p0_382; \
49631 uint32x4_t __rev0_382; __rev0_382 = __builtin_shufflevector(__s0_382, __s0_382, 3, 2, 1, 0); \
49632 uint32x2_t __ret_382; \
49633 __ret_382 = __noswap_splat_laneq_u32(__rev0_382, __p1_382); \
49634 __ret_382 = __builtin_shufflevector(__ret_382, __ret_382, 1, 0); \
49635 __ret_382; \
51333#define vdup_laneq_u32(__p0_474, __p1_474) __extension__ ({ \
51334 uint32x4_t __s0_474 = __p0_474; \
51335 uint32x4_t __rev0_474; __rev0_474 = __builtin_shufflevector(__s0_474, __s0_474, 3, 2, 1, 0); \
51336 uint32x2_t __ret_474; \
51337 __ret_474 = __noswap_splat_laneq_u32(__rev0_474, __p1_474); \
51338 __ret_474 = __builtin_shufflevector(__ret_474, __ret_474, 1, 0); \
51339 __ret_474; \
4963651340})
4963751341#endif
4963851342
4963951343#ifdef __LITTLE_ENDIAN__
49640#define vdup_laneq_u64(__p0_383, __p1_383) __extension__ ({ \
49641 uint64x2_t __s0_383 = __p0_383; \
49642 uint64x1_t __ret_383; \
49643 __ret_383 = splat_laneq_u64(__s0_383, __p1_383); \
49644 __ret_383; \
51344#define vdup_laneq_u64(__p0_475, __p1_475) __extension__ ({ \
51345 uint64x2_t __s0_475 = __p0_475; \
51346 uint64x1_t __ret_475; \
51347 __ret_475 = splat_laneq_u64(__s0_475, __p1_475); \
51348 __ret_475; \
4964551349})
4964651350#else
49647#define vdup_laneq_u64(__p0_384, __p1_384) __extension__ ({ \
49648 uint64x2_t __s0_384 = __p0_384; \
49649 uint64x2_t __rev0_384; __rev0_384 = __builtin_shufflevector(__s0_384, __s0_384, 1, 0); \
49650 uint64x1_t __ret_384; \
49651 __ret_384 = __noswap_splat_laneq_u64(__rev0_384, __p1_384); \
49652 __ret_384; \
51351#define vdup_laneq_u64(__p0_476, __p1_476) __extension__ ({ \
51352 uint64x2_t __s0_476 = __p0_476; \
51353 uint64x2_t __rev0_476; __rev0_476 = __builtin_shufflevector(__s0_476, __s0_476, 1, 0); \
51354 uint64x1_t __ret_476; \
51355 __ret_476 = __noswap_splat_laneq_u64(__rev0_476, __p1_476); \
51356 __ret_476; \
4965351357})
4965451358#endif
4965551359
4965651360#ifdef __LITTLE_ENDIAN__
49657#define vdup_laneq_u16(__p0_385, __p1_385) __extension__ ({ \
49658 uint16x8_t __s0_385 = __p0_385; \
49659 uint16x4_t __ret_385; \
49660 __ret_385 = splat_laneq_u16(__s0_385, __p1_385); \
49661 __ret_385; \
51361#define vdup_laneq_u16(__p0_477, __p1_477) __extension__ ({ \
51362 uint16x8_t __s0_477 = __p0_477; \
51363 uint16x4_t __ret_477; \
51364 __ret_477 = splat_laneq_u16(__s0_477, __p1_477); \
51365 __ret_477; \
4966251366})
4966351367#else
49664#define vdup_laneq_u16(__p0_386, __p1_386) __extension__ ({ \
49665 uint16x8_t __s0_386 = __p0_386; \
49666 uint16x8_t __rev0_386; __rev0_386 = __builtin_shufflevector(__s0_386, __s0_386, 7, 6, 5, 4, 3, 2, 1, 0); \
49667 uint16x4_t __ret_386; \
49668 __ret_386 = __noswap_splat_laneq_u16(__rev0_386, __p1_386); \
49669 __ret_386 = __builtin_shufflevector(__ret_386, __ret_386, 3, 2, 1, 0); \
49670 __ret_386; \
51368#define vdup_laneq_u16(__p0_478, __p1_478) __extension__ ({ \
51369 uint16x8_t __s0_478 = __p0_478; \
51370 uint16x8_t __rev0_478; __rev0_478 = __builtin_shufflevector(__s0_478, __s0_478, 7, 6, 5, 4, 3, 2, 1, 0); \
51371 uint16x4_t __ret_478; \
51372 __ret_478 = __noswap_splat_laneq_u16(__rev0_478, __p1_478); \
51373 __ret_478 = __builtin_shufflevector(__ret_478, __ret_478, 3, 2, 1, 0); \
51374 __ret_478; \
4967151375})
4967251376#endif
4967351377
4967451378#ifdef __LITTLE_ENDIAN__
49675#define vdup_laneq_s8(__p0_387, __p1_387) __extension__ ({ \
49676 int8x16_t __s0_387 = __p0_387; \
49677 int8x8_t __ret_387; \
49678 __ret_387 = splat_laneq_s8(__s0_387, __p1_387); \
49679 __ret_387; \
51379#define vdup_laneq_s8(__p0_479, __p1_479) __extension__ ({ \
51380 int8x16_t __s0_479 = __p0_479; \
51381 int8x8_t __ret_479; \
51382 __ret_479 = splat_laneq_s8(__s0_479, __p1_479); \
51383 __ret_479; \
4968051384})
4968151385#else
49682#define vdup_laneq_s8(__p0_388, __p1_388) __extension__ ({ \
49683 int8x16_t __s0_388 = __p0_388; \
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); \
49685 int8x8_t __ret_388; \
49686 __ret_388 = __noswap_splat_laneq_s8(__rev0_388, __p1_388); \
49687 __ret_388 = __builtin_shufflevector(__ret_388, __ret_388, 7, 6, 5, 4, 3, 2, 1, 0); \
49688 __ret_388; \
51386#define vdup_laneq_s8(__p0_480, __p1_480) __extension__ ({ \
51387 int8x16_t __s0_480 = __p0_480; \
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); \
51389 int8x8_t __ret_480; \
51390 __ret_480 = __noswap_splat_laneq_s8(__rev0_480, __p1_480); \
51391 __ret_480 = __builtin_shufflevector(__ret_480, __ret_480, 7, 6, 5, 4, 3, 2, 1, 0); \
51392 __ret_480; \
4968951393})
4969051394#endif
4969151395
4969251396#ifdef __LITTLE_ENDIAN__
49693#define vdup_laneq_f64(__p0_389, __p1_389) __extension__ ({ \
49694 float64x2_t __s0_389 = __p0_389; \
49695 float64x1_t __ret_389; \
49696 __ret_389 = splat_laneq_f64(__s0_389, __p1_389); \
49697 __ret_389; \
51397#define vdup_laneq_f64(__p0_481, __p1_481) __extension__ ({ \
51398 float64x2_t __s0_481 = __p0_481; \
51399 float64x1_t __ret_481; \
51400 __ret_481 = splat_laneq_f64(__s0_481, __p1_481); \
51401 __ret_481; \
4969851402})
4969951403#else
49700#define vdup_laneq_f64(__p0_390, __p1_390) __extension__ ({ \
49701 float64x2_t __s0_390 = __p0_390; \
49702 float64x2_t __rev0_390; __rev0_390 = __builtin_shufflevector(__s0_390, __s0_390, 1, 0); \
49703 float64x1_t __ret_390; \
49704 __ret_390 = __noswap_splat_laneq_f64(__rev0_390, __p1_390); \
49705 __ret_390; \
51404#define vdup_laneq_f64(__p0_482, __p1_482) __extension__ ({ \
51405 float64x2_t __s0_482 = __p0_482; \
51406 float64x2_t __rev0_482; __rev0_482 = __builtin_shufflevector(__s0_482, __s0_482, 1, 0); \
51407 float64x1_t __ret_482; \
51408 __ret_482 = __noswap_splat_laneq_f64(__rev0_482, __p1_482); \
51409 __ret_482; \
4970651410})
4970751411#endif
4970851412
4970951413#ifdef __LITTLE_ENDIAN__
49710#define vdup_laneq_f32(__p0_391, __p1_391) __extension__ ({ \
49711 float32x4_t __s0_391 = __p0_391; \
49712 float32x2_t __ret_391; \
49713 __ret_391 = splat_laneq_f32(__s0_391, __p1_391); \
49714 __ret_391; \
51414#define vdup_laneq_f32(__p0_483, __p1_483) __extension__ ({ \
51415 float32x4_t __s0_483 = __p0_483; \
51416 float32x2_t __ret_483; \
51417 __ret_483 = splat_laneq_f32(__s0_483, __p1_483); \
51418 __ret_483; \
4971551419})
4971651420#else
49717#define vdup_laneq_f32(__p0_392, __p1_392) __extension__ ({ \
49718 float32x4_t __s0_392 = __p0_392; \
49719 float32x4_t __rev0_392; __rev0_392 = __builtin_shufflevector(__s0_392, __s0_392, 3, 2, 1, 0); \
49720 float32x2_t __ret_392; \
49721 __ret_392 = __noswap_splat_laneq_f32(__rev0_392, __p1_392); \
49722 __ret_392 = __builtin_shufflevector(__ret_392, __ret_392, 1, 0); \
49723 __ret_392; \
51421#define vdup_laneq_f32(__p0_484, __p1_484) __extension__ ({ \
51422 float32x4_t __s0_484 = __p0_484; \
51423 float32x4_t __rev0_484; __rev0_484 = __builtin_shufflevector(__s0_484, __s0_484, 3, 2, 1, 0); \
51424 float32x2_t __ret_484; \
51425 __ret_484 = __noswap_splat_laneq_f32(__rev0_484, __p1_484); \
51426 __ret_484 = __builtin_shufflevector(__ret_484, __ret_484, 1, 0); \
51427 __ret_484; \
4972451428})
4972551429#endif
4972651430
4972751431#ifdef __LITTLE_ENDIAN__
49728#define vdup_laneq_f16(__p0_393, __p1_393) __extension__ ({ \
49729 float16x8_t __s0_393 = __p0_393; \
49730 float16x4_t __ret_393; \
49731 __ret_393 = splat_laneq_f16(__s0_393, __p1_393); \
49732 __ret_393; \
51432#define vdup_laneq_f16(__p0_485, __p1_485) __extension__ ({ \
51433 float16x8_t __s0_485 = __p0_485; \
51434 float16x4_t __ret_485; \
51435 __ret_485 = splat_laneq_f16(__s0_485, __p1_485); \
51436 __ret_485; \
4973351437})
4973451438#else
49735#define vdup_laneq_f16(__p0_394, __p1_394) __extension__ ({ \
49736 float16x8_t __s0_394 = __p0_394; \
49737 float16x8_t __rev0_394; __rev0_394 = __builtin_shufflevector(__s0_394, __s0_394, 7, 6, 5, 4, 3, 2, 1, 0); \
49738 float16x4_t __ret_394; \
49739 __ret_394 = __noswap_splat_laneq_f16(__rev0_394, __p1_394); \
49740 __ret_394 = __builtin_shufflevector(__ret_394, __ret_394, 3, 2, 1, 0); \
49741 __ret_394; \
51439#define vdup_laneq_f16(__p0_486, __p1_486) __extension__ ({ \
51440 float16x8_t __s0_486 = __p0_486; \
51441 float16x8_t __rev0_486; __rev0_486 = __builtin_shufflevector(__s0_486, __s0_486, 7, 6, 5, 4, 3, 2, 1, 0); \
51442 float16x4_t __ret_486; \
51443 __ret_486 = __noswap_splat_laneq_f16(__rev0_486, __p1_486); \
51444 __ret_486 = __builtin_shufflevector(__ret_486, __ret_486, 3, 2, 1, 0); \
51445 __ret_486; \
4974251446})
4974351447#endif
4974451448
4974551449#ifdef __LITTLE_ENDIAN__
49746#define vdup_laneq_s32(__p0_395, __p1_395) __extension__ ({ \
49747 int32x4_t __s0_395 = __p0_395; \
49748 int32x2_t __ret_395; \
49749 __ret_395 = splat_laneq_s32(__s0_395, __p1_395); \
49750 __ret_395; \
51450#define vdup_laneq_s32(__p0_487, __p1_487) __extension__ ({ \
51451 int32x4_t __s0_487 = __p0_487; \
51452 int32x2_t __ret_487; \
51453 __ret_487 = splat_laneq_s32(__s0_487, __p1_487); \
51454 __ret_487; \
4975151455})
4975251456#else
49753#define vdup_laneq_s32(__p0_396, __p1_396) __extension__ ({ \
49754 int32x4_t __s0_396 = __p0_396; \
49755 int32x4_t __rev0_396; __rev0_396 = __builtin_shufflevector(__s0_396, __s0_396, 3, 2, 1, 0); \
49756 int32x2_t __ret_396; \
49757 __ret_396 = __noswap_splat_laneq_s32(__rev0_396, __p1_396); \
49758 __ret_396 = __builtin_shufflevector(__ret_396, __ret_396, 1, 0); \
49759 __ret_396; \
51457#define vdup_laneq_s32(__p0_488, __p1_488) __extension__ ({ \
51458 int32x4_t __s0_488 = __p0_488; \
51459 int32x4_t __rev0_488; __rev0_488 = __builtin_shufflevector(__s0_488, __s0_488, 3, 2, 1, 0); \
51460 int32x2_t __ret_488; \
51461 __ret_488 = __noswap_splat_laneq_s32(__rev0_488, __p1_488); \
51462 __ret_488 = __builtin_shufflevector(__ret_488, __ret_488, 1, 0); \
51463 __ret_488; \
4976051464})
4976151465#endif
4976251466
4976351467#ifdef __LITTLE_ENDIAN__
49764#define vdup_laneq_s64(__p0_397, __p1_397) __extension__ ({ \
49765 int64x2_t __s0_397 = __p0_397; \
49766 int64x1_t __ret_397; \
49767 __ret_397 = splat_laneq_s64(__s0_397, __p1_397); \
49768 __ret_397; \
51468#define vdup_laneq_s64(__p0_489, __p1_489) __extension__ ({ \
51469 int64x2_t __s0_489 = __p0_489; \
51470 int64x1_t __ret_489; \
51471 __ret_489 = splat_laneq_s64(__s0_489, __p1_489); \
51472 __ret_489; \
4976951473})
4977051474#else
49771#define vdup_laneq_s64(__p0_398, __p1_398) __extension__ ({ \
49772 int64x2_t __s0_398 = __p0_398; \
49773 int64x2_t __rev0_398; __rev0_398 = __builtin_shufflevector(__s0_398, __s0_398, 1, 0); \
49774 int64x1_t __ret_398; \
49775 __ret_398 = __noswap_splat_laneq_s64(__rev0_398, __p1_398); \
49776 __ret_398; \
51475#define vdup_laneq_s64(__p0_490, __p1_490) __extension__ ({ \
51476 int64x2_t __s0_490 = __p0_490; \
51477 int64x2_t __rev0_490; __rev0_490 = __builtin_shufflevector(__s0_490, __s0_490, 1, 0); \
51478 int64x1_t __ret_490; \
51479 __ret_490 = __noswap_splat_laneq_s64(__rev0_490, __p1_490); \
51480 __ret_490; \
4977751481})
4977851482#endif
4977951483
4978051484#ifdef __LITTLE_ENDIAN__
49781#define vdup_laneq_s16(__p0_399, __p1_399) __extension__ ({ \
49782 int16x8_t __s0_399 = __p0_399; \
49783 int16x4_t __ret_399; \
49784 __ret_399 = splat_laneq_s16(__s0_399, __p1_399); \
49785 __ret_399; \
51485#define vdup_laneq_s16(__p0_491, __p1_491) __extension__ ({ \
51486 int16x8_t __s0_491 = __p0_491; \
51487 int16x4_t __ret_491; \
51488 __ret_491 = splat_laneq_s16(__s0_491, __p1_491); \
51489 __ret_491; \
4978651490})
4978751491#else
49788#define vdup_laneq_s16(__p0_400, __p1_400) __extension__ ({ \
49789 int16x8_t __s0_400 = __p0_400; \
49790 int16x8_t __rev0_400; __rev0_400 = __builtin_shufflevector(__s0_400, __s0_400, 7, 6, 5, 4, 3, 2, 1, 0); \
49791 int16x4_t __ret_400; \
49792 __ret_400 = __noswap_splat_laneq_s16(__rev0_400, __p1_400); \
49793 __ret_400 = __builtin_shufflevector(__ret_400, __ret_400, 3, 2, 1, 0); \
49794 __ret_400; \
51492#define vdup_laneq_s16(__p0_492, __p1_492) __extension__ ({ \
51493 int16x8_t __s0_492 = __p0_492; \
51494 int16x8_t __rev0_492; __rev0_492 = __builtin_shufflevector(__s0_492, __s0_492, 7, 6, 5, 4, 3, 2, 1, 0); \
51495 int16x4_t __ret_492; \
51496 __ret_492 = __noswap_splat_laneq_s16(__rev0_492, __p1_492); \
51497 __ret_492 = __builtin_shufflevector(__ret_492, __ret_492, 3, 2, 1, 0); \
51498 __ret_492; \
4979551499})
4979651500#endif
4979751501
......@@ -50287,246 +51991,246 @@ __ai float64x1_t vfms_f64(float64x1_t __p0, float64x1_t __p1, float64x1_t __p2)
5028751991 __ret = vfma_f64(__p0, -__p1, __p2);
5028851992 return __ret;
5028951993}
50290#define vfmsd_lane_f64(__p0_401, __p1_401, __p2_401, __p3_401) __extension__ ({ \
50291 float64_t __s0_401 = __p0_401; \
50292 float64_t __s1_401 = __p1_401; \
50293 float64x1_t __s2_401 = __p2_401; \
50294 float64_t __ret_401; \
50295 __ret_401 = vfmad_lane_f64(__s0_401, -__s1_401, __s2_401, __p3_401); \
50296 __ret_401; \
51994#define vfmsd_lane_f64(__p0_493, __p1_493, __p2_493, __p3_493) __extension__ ({ \
51995 float64_t __s0_493 = __p0_493; \
51996 float64_t __s1_493 = __p1_493; \
51997 float64x1_t __s2_493 = __p2_493; \
51998 float64_t __ret_493; \
51999 __ret_493 = vfmad_lane_f64(__s0_493, -__s1_493, __s2_493, __p3_493); \
52000 __ret_493; \
5029752001})
5029852002#ifdef __LITTLE_ENDIAN__
50299#define vfmss_lane_f32(__p0_402, __p1_402, __p2_402, __p3_402) __extension__ ({ \
50300 float32_t __s0_402 = __p0_402; \
50301 float32_t __s1_402 = __p1_402; \
50302 float32x2_t __s2_402 = __p2_402; \
50303 float32_t __ret_402; \
50304 __ret_402 = vfmas_lane_f32(__s0_402, -__s1_402, __s2_402, __p3_402); \
50305 __ret_402; \
52003#define vfmss_lane_f32(__p0_494, __p1_494, __p2_494, __p3_494) __extension__ ({ \
52004 float32_t __s0_494 = __p0_494; \
52005 float32_t __s1_494 = __p1_494; \
52006 float32x2_t __s2_494 = __p2_494; \
52007 float32_t __ret_494; \
52008 __ret_494 = vfmas_lane_f32(__s0_494, -__s1_494, __s2_494, __p3_494); \
52009 __ret_494; \
5030652010})
5030752011#else
50308#define vfmss_lane_f32(__p0_403, __p1_403, __p2_403, __p3_403) __extension__ ({ \
50309 float32_t __s0_403 = __p0_403; \
50310 float32_t __s1_403 = __p1_403; \
50311 float32x2_t __s2_403 = __p2_403; \
50312 float32x2_t __rev2_403; __rev2_403 = __builtin_shufflevector(__s2_403, __s2_403, 1, 0); \
50313 float32_t __ret_403; \
50314 __ret_403 = __noswap_vfmas_lane_f32(__s0_403, -__s1_403, __rev2_403, __p3_403); \
50315 __ret_403; \
52012#define vfmss_lane_f32(__p0_495, __p1_495, __p2_495, __p3_495) __extension__ ({ \
52013 float32_t __s0_495 = __p0_495; \
52014 float32_t __s1_495 = __p1_495; \
52015 float32x2_t __s2_495 = __p2_495; \
52016 float32x2_t __rev2_495; __rev2_495 = __builtin_shufflevector(__s2_495, __s2_495, 1, 0); \
52017 float32_t __ret_495; \
52018 __ret_495 = __noswap_vfmas_lane_f32(__s0_495, -__s1_495, __rev2_495, __p3_495); \
52019 __ret_495; \
5031652020})
5031752021#endif
5031852022
5031952023#ifdef __LITTLE_ENDIAN__
50320#define vfmsq_lane_f64(__p0_404, __p1_404, __p2_404, __p3_404) __extension__ ({ \
50321 float64x2_t __s0_404 = __p0_404; \
50322 float64x2_t __s1_404 = __p1_404; \
50323 float64x1_t __s2_404 = __p2_404; \
50324 float64x2_t __ret_404; \
50325 __ret_404 = vfmaq_lane_f64(__s0_404, -__s1_404, __s2_404, __p3_404); \
50326 __ret_404; \
52024#define vfmsq_lane_f64(__p0_496, __p1_496, __p2_496, __p3_496) __extension__ ({ \
52025 float64x2_t __s0_496 = __p0_496; \
52026 float64x2_t __s1_496 = __p1_496; \
52027 float64x1_t __s2_496 = __p2_496; \
52028 float64x2_t __ret_496; \
52029 __ret_496 = vfmaq_lane_f64(__s0_496, -__s1_496, __s2_496, __p3_496); \
52030 __ret_496; \
5032752031})
5032852032#else
50329#define vfmsq_lane_f64(__p0_405, __p1_405, __p2_405, __p3_405) __extension__ ({ \
50330 float64x2_t __s0_405 = __p0_405; \
50331 float64x2_t __s1_405 = __p1_405; \
50332 float64x1_t __s2_405 = __p2_405; \
50333 float64x2_t __rev0_405; __rev0_405 = __builtin_shufflevector(__s0_405, __s0_405, 1, 0); \
50334 float64x2_t __rev1_405; __rev1_405 = __builtin_shufflevector(__s1_405, __s1_405, 1, 0); \
50335 float64x2_t __ret_405; \
50336 __ret_405 = __noswap_vfmaq_lane_f64(__rev0_405, -__rev1_405, __s2_405, __p3_405); \
50337 __ret_405 = __builtin_shufflevector(__ret_405, __ret_405, 1, 0); \
50338 __ret_405; \
52033#define vfmsq_lane_f64(__p0_497, __p1_497, __p2_497, __p3_497) __extension__ ({ \
52034 float64x2_t __s0_497 = __p0_497; \
52035 float64x2_t __s1_497 = __p1_497; \
52036 float64x1_t __s2_497 = __p2_497; \
52037 float64x2_t __rev0_497; __rev0_497 = __builtin_shufflevector(__s0_497, __s0_497, 1, 0); \
52038 float64x2_t __rev1_497; __rev1_497 = __builtin_shufflevector(__s1_497, __s1_497, 1, 0); \
52039 float64x2_t __ret_497; \
52040 __ret_497 = __noswap_vfmaq_lane_f64(__rev0_497, -__rev1_497, __s2_497, __p3_497); \
52041 __ret_497 = __builtin_shufflevector(__ret_497, __ret_497, 1, 0); \
52042 __ret_497; \
5033952043})
5034052044#endif
5034152045
5034252046#ifdef __LITTLE_ENDIAN__
50343#define vfmsq_lane_f32(__p0_406, __p1_406, __p2_406, __p3_406) __extension__ ({ \
50344 float32x4_t __s0_406 = __p0_406; \
50345 float32x4_t __s1_406 = __p1_406; \
50346 float32x2_t __s2_406 = __p2_406; \
50347 float32x4_t __ret_406; \
50348 __ret_406 = vfmaq_lane_f32(__s0_406, -__s1_406, __s2_406, __p3_406); \
50349 __ret_406; \
52047#define vfmsq_lane_f32(__p0_498, __p1_498, __p2_498, __p3_498) __extension__ ({ \
52048 float32x4_t __s0_498 = __p0_498; \
52049 float32x4_t __s1_498 = __p1_498; \
52050 float32x2_t __s2_498 = __p2_498; \
52051 float32x4_t __ret_498; \
52052 __ret_498 = vfmaq_lane_f32(__s0_498, -__s1_498, __s2_498, __p3_498); \
52053 __ret_498; \
5035052054})
5035152055#else
50352#define vfmsq_lane_f32(__p0_407, __p1_407, __p2_407, __p3_407) __extension__ ({ \
50353 float32x4_t __s0_407 = __p0_407; \
50354 float32x4_t __s1_407 = __p1_407; \
50355 float32x2_t __s2_407 = __p2_407; \
50356 float32x4_t __rev0_407; __rev0_407 = __builtin_shufflevector(__s0_407, __s0_407, 3, 2, 1, 0); \
50357 float32x4_t __rev1_407; __rev1_407 = __builtin_shufflevector(__s1_407, __s1_407, 3, 2, 1, 0); \
50358 float32x2_t __rev2_407; __rev2_407 = __builtin_shufflevector(__s2_407, __s2_407, 1, 0); \
50359 float32x4_t __ret_407; \
50360 __ret_407 = __noswap_vfmaq_lane_f32(__rev0_407, -__rev1_407, __rev2_407, __p3_407); \
50361 __ret_407 = __builtin_shufflevector(__ret_407, __ret_407, 3, 2, 1, 0); \
50362 __ret_407; \
52056#define vfmsq_lane_f32(__p0_499, __p1_499, __p2_499, __p3_499) __extension__ ({ \
52057 float32x4_t __s0_499 = __p0_499; \
52058 float32x4_t __s1_499 = __p1_499; \
52059 float32x2_t __s2_499 = __p2_499; \
52060 float32x4_t __rev0_499; __rev0_499 = __builtin_shufflevector(__s0_499, __s0_499, 3, 2, 1, 0); \
52061 float32x4_t __rev1_499; __rev1_499 = __builtin_shufflevector(__s1_499, __s1_499, 3, 2, 1, 0); \
52062 float32x2_t __rev2_499; __rev2_499 = __builtin_shufflevector(__s2_499, __s2_499, 1, 0); \
52063 float32x4_t __ret_499; \
52064 __ret_499 = __noswap_vfmaq_lane_f32(__rev0_499, -__rev1_499, __rev2_499, __p3_499); \
52065 __ret_499 = __builtin_shufflevector(__ret_499, __ret_499, 3, 2, 1, 0); \
52066 __ret_499; \
5036352067})
5036452068#endif
5036552069
50366#define vfms_lane_f64(__p0_408, __p1_408, __p2_408, __p3_408) __extension__ ({ \
50367 float64x1_t __s0_408 = __p0_408; \
50368 float64x1_t __s1_408 = __p1_408; \
50369 float64x1_t __s2_408 = __p2_408; \
50370 float64x1_t __ret_408; \
50371 __ret_408 = vfma_lane_f64(__s0_408, -__s1_408, __s2_408, __p3_408); \
50372 __ret_408; \
52070#define vfms_lane_f64(__p0_500, __p1_500, __p2_500, __p3_500) __extension__ ({ \
52071 float64x1_t __s0_500 = __p0_500; \
52072 float64x1_t __s1_500 = __p1_500; \
52073 float64x1_t __s2_500 = __p2_500; \
52074 float64x1_t __ret_500; \
52075 __ret_500 = vfma_lane_f64(__s0_500, -__s1_500, __s2_500, __p3_500); \
52076 __ret_500; \
5037352077})
5037452078#ifdef __LITTLE_ENDIAN__
50375#define vfms_lane_f32(__p0_409, __p1_409, __p2_409, __p3_409) __extension__ ({ \
50376 float32x2_t __s0_409 = __p0_409; \
50377 float32x2_t __s1_409 = __p1_409; \
50378 float32x2_t __s2_409 = __p2_409; \
50379 float32x2_t __ret_409; \
50380 __ret_409 = vfma_lane_f32(__s0_409, -__s1_409, __s2_409, __p3_409); \
50381 __ret_409; \
52079#define vfms_lane_f32(__p0_501, __p1_501, __p2_501, __p3_501) __extension__ ({ \
52080 float32x2_t __s0_501 = __p0_501; \
52081 float32x2_t __s1_501 = __p1_501; \
52082 float32x2_t __s2_501 = __p2_501; \
52083 float32x2_t __ret_501; \
52084 __ret_501 = vfma_lane_f32(__s0_501, -__s1_501, __s2_501, __p3_501); \
52085 __ret_501; \
5038252086})
5038352087#else
50384#define vfms_lane_f32(__p0_410, __p1_410, __p2_410, __p3_410) __extension__ ({ \
50385 float32x2_t __s0_410 = __p0_410; \
50386 float32x2_t __s1_410 = __p1_410; \
50387 float32x2_t __s2_410 = __p2_410; \
50388 float32x2_t __rev0_410; __rev0_410 = __builtin_shufflevector(__s0_410, __s0_410, 1, 0); \
50389 float32x2_t __rev1_410; __rev1_410 = __builtin_shufflevector(__s1_410, __s1_410, 1, 0); \
50390 float32x2_t __rev2_410; __rev2_410 = __builtin_shufflevector(__s2_410, __s2_410, 1, 0); \
50391 float32x2_t __ret_410; \
50392 __ret_410 = __noswap_vfma_lane_f32(__rev0_410, -__rev1_410, __rev2_410, __p3_410); \
50393 __ret_410 = __builtin_shufflevector(__ret_410, __ret_410, 1, 0); \
50394 __ret_410; \
52088#define vfms_lane_f32(__p0_502, __p1_502, __p2_502, __p3_502) __extension__ ({ \
52089 float32x2_t __s0_502 = __p0_502; \
52090 float32x2_t __s1_502 = __p1_502; \
52091 float32x2_t __s2_502 = __p2_502; \
52092 float32x2_t __rev0_502; __rev0_502 = __builtin_shufflevector(__s0_502, __s0_502, 1, 0); \
52093 float32x2_t __rev1_502; __rev1_502 = __builtin_shufflevector(__s1_502, __s1_502, 1, 0); \
52094 float32x2_t __rev2_502; __rev2_502 = __builtin_shufflevector(__s2_502, __s2_502, 1, 0); \
52095 float32x2_t __ret_502; \
52096 __ret_502 = __noswap_vfma_lane_f32(__rev0_502, -__rev1_502, __rev2_502, __p3_502); \
52097 __ret_502 = __builtin_shufflevector(__ret_502, __ret_502, 1, 0); \
52098 __ret_502; \
5039552099})
5039652100#endif
5039752101
5039852102#ifdef __LITTLE_ENDIAN__
50399#define vfmsd_laneq_f64(__p0_411, __p1_411, __p2_411, __p3_411) __extension__ ({ \
50400 float64_t __s0_411 = __p0_411; \
50401 float64_t __s1_411 = __p1_411; \
50402 float64x2_t __s2_411 = __p2_411; \
50403 float64_t __ret_411; \
50404 __ret_411 = vfmad_laneq_f64(__s0_411, -__s1_411, __s2_411, __p3_411); \
50405 __ret_411; \
52103#define vfmsd_laneq_f64(__p0_503, __p1_503, __p2_503, __p3_503) __extension__ ({ \
52104 float64_t __s0_503 = __p0_503; \
52105 float64_t __s1_503 = __p1_503; \
52106 float64x2_t __s2_503 = __p2_503; \
52107 float64_t __ret_503; \
52108 __ret_503 = vfmad_laneq_f64(__s0_503, -__s1_503, __s2_503, __p3_503); \
52109 __ret_503; \
5040652110})
5040752111#else
50408#define vfmsd_laneq_f64(__p0_412, __p1_412, __p2_412, __p3_412) __extension__ ({ \
50409 float64_t __s0_412 = __p0_412; \
50410 float64_t __s1_412 = __p1_412; \
50411 float64x2_t __s2_412 = __p2_412; \
50412 float64x2_t __rev2_412; __rev2_412 = __builtin_shufflevector(__s2_412, __s2_412, 1, 0); \
50413 float64_t __ret_412; \
50414 __ret_412 = __noswap_vfmad_laneq_f64(__s0_412, -__s1_412, __rev2_412, __p3_412); \
50415 __ret_412; \
52112#define vfmsd_laneq_f64(__p0_504, __p1_504, __p2_504, __p3_504) __extension__ ({ \
52113 float64_t __s0_504 = __p0_504; \
52114 float64_t __s1_504 = __p1_504; \
52115 float64x2_t __s2_504 = __p2_504; \
52116 float64x2_t __rev2_504; __rev2_504 = __builtin_shufflevector(__s2_504, __s2_504, 1, 0); \
52117 float64_t __ret_504; \
52118 __ret_504 = __noswap_vfmad_laneq_f64(__s0_504, -__s1_504, __rev2_504, __p3_504); \
52119 __ret_504; \
5041652120})
5041752121#endif
5041852122
5041952123#ifdef __LITTLE_ENDIAN__
50420#define vfmss_laneq_f32(__p0_413, __p1_413, __p2_413, __p3_413) __extension__ ({ \
50421 float32_t __s0_413 = __p0_413; \
50422 float32_t __s1_413 = __p1_413; \
50423 float32x4_t __s2_413 = __p2_413; \
50424 float32_t __ret_413; \
50425 __ret_413 = vfmas_laneq_f32(__s0_413, -__s1_413, __s2_413, __p3_413); \
50426 __ret_413; \
52124#define vfmss_laneq_f32(__p0_505, __p1_505, __p2_505, __p3_505) __extension__ ({ \
52125 float32_t __s0_505 = __p0_505; \
52126 float32_t __s1_505 = __p1_505; \
52127 float32x4_t __s2_505 = __p2_505; \
52128 float32_t __ret_505; \
52129 __ret_505 = vfmas_laneq_f32(__s0_505, -__s1_505, __s2_505, __p3_505); \
52130 __ret_505; \
5042752131})
5042852132#else
50429#define vfmss_laneq_f32(__p0_414, __p1_414, __p2_414, __p3_414) __extension__ ({ \
50430 float32_t __s0_414 = __p0_414; \
50431 float32_t __s1_414 = __p1_414; \
50432 float32x4_t __s2_414 = __p2_414; \
50433 float32x4_t __rev2_414; __rev2_414 = __builtin_shufflevector(__s2_414, __s2_414, 3, 2, 1, 0); \
50434 float32_t __ret_414; \
50435 __ret_414 = __noswap_vfmas_laneq_f32(__s0_414, -__s1_414, __rev2_414, __p3_414); \
50436 __ret_414; \
52133#define vfmss_laneq_f32(__p0_506, __p1_506, __p2_506, __p3_506) __extension__ ({ \
52134 float32_t __s0_506 = __p0_506; \
52135 float32_t __s1_506 = __p1_506; \
52136 float32x4_t __s2_506 = __p2_506; \
52137 float32x4_t __rev2_506; __rev2_506 = __builtin_shufflevector(__s2_506, __s2_506, 3, 2, 1, 0); \
52138 float32_t __ret_506; \
52139 __ret_506 = __noswap_vfmas_laneq_f32(__s0_506, -__s1_506, __rev2_506, __p3_506); \
52140 __ret_506; \
5043752141})
5043852142#endif
5043952143
5044052144#ifdef __LITTLE_ENDIAN__
50441#define vfmsq_laneq_f64(__p0_415, __p1_415, __p2_415, __p3_415) __extension__ ({ \
50442 float64x2_t __s0_415 = __p0_415; \
50443 float64x2_t __s1_415 = __p1_415; \
50444 float64x2_t __s2_415 = __p2_415; \
50445 float64x2_t __ret_415; \
50446 __ret_415 = vfmaq_laneq_f64(__s0_415, -__s1_415, __s2_415, __p3_415); \
50447 __ret_415; \
52145#define vfmsq_laneq_f64(__p0_507, __p1_507, __p2_507, __p3_507) __extension__ ({ \
52146 float64x2_t __s0_507 = __p0_507; \
52147 float64x2_t __s1_507 = __p1_507; \
52148 float64x2_t __s2_507 = __p2_507; \
52149 float64x2_t __ret_507; \
52150 __ret_507 = vfmaq_laneq_f64(__s0_507, -__s1_507, __s2_507, __p3_507); \
52151 __ret_507; \
5044852152})
5044952153#else
50450#define vfmsq_laneq_f64(__p0_416, __p1_416, __p2_416, __p3_416) __extension__ ({ \
50451 float64x2_t __s0_416 = __p0_416; \
50452 float64x2_t __s1_416 = __p1_416; \
50453 float64x2_t __s2_416 = __p2_416; \
50454 float64x2_t __rev0_416; __rev0_416 = __builtin_shufflevector(__s0_416, __s0_416, 1, 0); \
50455 float64x2_t __rev1_416; __rev1_416 = __builtin_shufflevector(__s1_416, __s1_416, 1, 0); \
50456 float64x2_t __rev2_416; __rev2_416 = __builtin_shufflevector(__s2_416, __s2_416, 1, 0); \
50457 float64x2_t __ret_416; \
50458 __ret_416 = __noswap_vfmaq_laneq_f64(__rev0_416, -__rev1_416, __rev2_416, __p3_416); \
50459 __ret_416 = __builtin_shufflevector(__ret_416, __ret_416, 1, 0); \
50460 __ret_416; \
52154#define vfmsq_laneq_f64(__p0_508, __p1_508, __p2_508, __p3_508) __extension__ ({ \
52155 float64x2_t __s0_508 = __p0_508; \
52156 float64x2_t __s1_508 = __p1_508; \
52157 float64x2_t __s2_508 = __p2_508; \
52158 float64x2_t __rev0_508; __rev0_508 = __builtin_shufflevector(__s0_508, __s0_508, 1, 0); \
52159 float64x2_t __rev1_508; __rev1_508 = __builtin_shufflevector(__s1_508, __s1_508, 1, 0); \
52160 float64x2_t __rev2_508; __rev2_508 = __builtin_shufflevector(__s2_508, __s2_508, 1, 0); \
52161 float64x2_t __ret_508; \
52162 __ret_508 = __noswap_vfmaq_laneq_f64(__rev0_508, -__rev1_508, __rev2_508, __p3_508); \
52163 __ret_508 = __builtin_shufflevector(__ret_508, __ret_508, 1, 0); \
52164 __ret_508; \
5046152165})
5046252166#endif
5046352167
5046452168#ifdef __LITTLE_ENDIAN__
50465#define vfmsq_laneq_f32(__p0_417, __p1_417, __p2_417, __p3_417) __extension__ ({ \
50466 float32x4_t __s0_417 = __p0_417; \
50467 float32x4_t __s1_417 = __p1_417; \
50468 float32x4_t __s2_417 = __p2_417; \
50469 float32x4_t __ret_417; \
50470 __ret_417 = vfmaq_laneq_f32(__s0_417, -__s1_417, __s2_417, __p3_417); \
50471 __ret_417; \
52169#define vfmsq_laneq_f32(__p0_509, __p1_509, __p2_509, __p3_509) __extension__ ({ \
52170 float32x4_t __s0_509 = __p0_509; \
52171 float32x4_t __s1_509 = __p1_509; \
52172 float32x4_t __s2_509 = __p2_509; \
52173 float32x4_t __ret_509; \
52174 __ret_509 = vfmaq_laneq_f32(__s0_509, -__s1_509, __s2_509, __p3_509); \
52175 __ret_509; \
5047252176})
5047352177#else
50474#define vfmsq_laneq_f32(__p0_418, __p1_418, __p2_418, __p3_418) __extension__ ({ \
50475 float32x4_t __s0_418 = __p0_418; \
50476 float32x4_t __s1_418 = __p1_418; \
50477 float32x4_t __s2_418 = __p2_418; \
50478 float32x4_t __rev0_418; __rev0_418 = __builtin_shufflevector(__s0_418, __s0_418, 3, 2, 1, 0); \
50479 float32x4_t __rev1_418; __rev1_418 = __builtin_shufflevector(__s1_418, __s1_418, 3, 2, 1, 0); \
50480 float32x4_t __rev2_418; __rev2_418 = __builtin_shufflevector(__s2_418, __s2_418, 3, 2, 1, 0); \
50481 float32x4_t __ret_418; \
50482 __ret_418 = __noswap_vfmaq_laneq_f32(__rev0_418, -__rev1_418, __rev2_418, __p3_418); \
50483 __ret_418 = __builtin_shufflevector(__ret_418, __ret_418, 3, 2, 1, 0); \
50484 __ret_418; \
52178#define vfmsq_laneq_f32(__p0_510, __p1_510, __p2_510, __p3_510) __extension__ ({ \
52179 float32x4_t __s0_510 = __p0_510; \
52180 float32x4_t __s1_510 = __p1_510; \
52181 float32x4_t __s2_510 = __p2_510; \
52182 float32x4_t __rev0_510; __rev0_510 = __builtin_shufflevector(__s0_510, __s0_510, 3, 2, 1, 0); \
52183 float32x4_t __rev1_510; __rev1_510 = __builtin_shufflevector(__s1_510, __s1_510, 3, 2, 1, 0); \
52184 float32x4_t __rev2_510; __rev2_510 = __builtin_shufflevector(__s2_510, __s2_510, 3, 2, 1, 0); \
52185 float32x4_t __ret_510; \
52186 __ret_510 = __noswap_vfmaq_laneq_f32(__rev0_510, -__rev1_510, __rev2_510, __p3_510); \
52187 __ret_510 = __builtin_shufflevector(__ret_510, __ret_510, 3, 2, 1, 0); \
52188 __ret_510; \
5048552189})
5048652190#endif
5048752191
5048852192#ifdef __LITTLE_ENDIAN__
50489#define vfms_laneq_f64(__p0_419, __p1_419, __p2_419, __p3_419) __extension__ ({ \
50490 float64x1_t __s0_419 = __p0_419; \
50491 float64x1_t __s1_419 = __p1_419; \
50492 float64x2_t __s2_419 = __p2_419; \
50493 float64x1_t __ret_419; \
50494 __ret_419 = vfma_laneq_f64(__s0_419, -__s1_419, __s2_419, __p3_419); \
50495 __ret_419; \
52193#define vfms_laneq_f64(__p0_511, __p1_511, __p2_511, __p3_511) __extension__ ({ \
52194 float64x1_t __s0_511 = __p0_511; \
52195 float64x1_t __s1_511 = __p1_511; \
52196 float64x2_t __s2_511 = __p2_511; \
52197 float64x1_t __ret_511; \
52198 __ret_511 = vfma_laneq_f64(__s0_511, -__s1_511, __s2_511, __p3_511); \
52199 __ret_511; \
5049652200})
5049752201#else
50498#define vfms_laneq_f64(__p0_420, __p1_420, __p2_420, __p3_420) __extension__ ({ \
50499 float64x1_t __s0_420 = __p0_420; \
50500 float64x1_t __s1_420 = __p1_420; \
50501 float64x2_t __s2_420 = __p2_420; \
50502 float64x2_t __rev2_420; __rev2_420 = __builtin_shufflevector(__s2_420, __s2_420, 1, 0); \
50503 float64x1_t __ret_420; \
50504 __ret_420 = __noswap_vfma_laneq_f64(__s0_420, -__s1_420, __rev2_420, __p3_420); \
50505 __ret_420; \
52202#define vfms_laneq_f64(__p0_512, __p1_512, __p2_512, __p3_512) __extension__ ({ \
52203 float64x1_t __s0_512 = __p0_512; \
52204 float64x1_t __s1_512 = __p1_512; \
52205 float64x2_t __s2_512 = __p2_512; \
52206 float64x2_t __rev2_512; __rev2_512 = __builtin_shufflevector(__s2_512, __s2_512, 1, 0); \
52207 float64x1_t __ret_512; \
52208 __ret_512 = __noswap_vfma_laneq_f64(__s0_512, -__s1_512, __rev2_512, __p3_512); \
52209 __ret_512; \
5050652210})
5050752211#endif
5050852212
5050952213#ifdef __LITTLE_ENDIAN__
50510#define vfms_laneq_f32(__p0_421, __p1_421, __p2_421, __p3_421) __extension__ ({ \
50511 float32x2_t __s0_421 = __p0_421; \
50512 float32x2_t __s1_421 = __p1_421; \
50513 float32x4_t __s2_421 = __p2_421; \
50514 float32x2_t __ret_421; \
50515 __ret_421 = vfma_laneq_f32(__s0_421, -__s1_421, __s2_421, __p3_421); \
50516 __ret_421; \
52214#define vfms_laneq_f32(__p0_513, __p1_513, __p2_513, __p3_513) __extension__ ({ \
52215 float32x2_t __s0_513 = __p0_513; \
52216 float32x2_t __s1_513 = __p1_513; \
52217 float32x4_t __s2_513 = __p2_513; \
52218 float32x2_t __ret_513; \
52219 __ret_513 = vfma_laneq_f32(__s0_513, -__s1_513, __s2_513, __p3_513); \
52220 __ret_513; \
5051752221})
5051852222#else
50519#define vfms_laneq_f32(__p0_422, __p1_422, __p2_422, __p3_422) __extension__ ({ \
50520 float32x2_t __s0_422 = __p0_422; \
50521 float32x2_t __s1_422 = __p1_422; \
50522 float32x4_t __s2_422 = __p2_422; \
50523 float32x2_t __rev0_422; __rev0_422 = __builtin_shufflevector(__s0_422, __s0_422, 1, 0); \
50524 float32x2_t __rev1_422; __rev1_422 = __builtin_shufflevector(__s1_422, __s1_422, 1, 0); \
50525 float32x4_t __rev2_422; __rev2_422 = __builtin_shufflevector(__s2_422, __s2_422, 3, 2, 1, 0); \
50526 float32x2_t __ret_422; \
50527 __ret_422 = __noswap_vfma_laneq_f32(__rev0_422, -__rev1_422, __rev2_422, __p3_422); \
50528 __ret_422 = __builtin_shufflevector(__ret_422, __ret_422, 1, 0); \
50529 __ret_422; \
52223#define vfms_laneq_f32(__p0_514, __p1_514, __p2_514, __p3_514) __extension__ ({ \
52224 float32x2_t __s0_514 = __p0_514; \
52225 float32x2_t __s1_514 = __p1_514; \
52226 float32x4_t __s2_514 = __p2_514; \
52227 float32x2_t __rev0_514; __rev0_514 = __builtin_shufflevector(__s0_514, __s0_514, 1, 0); \
52228 float32x2_t __rev1_514; __rev1_514 = __builtin_shufflevector(__s1_514, __s1_514, 1, 0); \
52229 float32x4_t __rev2_514; __rev2_514 = __builtin_shufflevector(__s2_514, __s2_514, 3, 2, 1, 0); \
52230 float32x2_t __ret_514; \
52231 __ret_514 = __noswap_vfma_laneq_f32(__rev0_514, -__rev1_514, __rev2_514, __p3_514); \
52232 __ret_514 = __builtin_shufflevector(__ret_514, __ret_514, 1, 0); \
52233 __ret_514; \
5053052234})
5053152235#endif
5053252236
......@@ -52548,547 +54252,530 @@ __ai float64x1_t vmla_f64(float64x1_t __p0, float64x1_t __p1, float64x1_t __p2)
5254854252 return __ret;
5254954253}
5255054254#ifdef __LITTLE_ENDIAN__
52551#define vmlaq_laneq_u32(__p0_423, __p1_423, __p2_423, __p3_423) __extension__ ({ \
52552 uint32x4_t __s0_423 = __p0_423; \
52553 uint32x4_t __s1_423 = __p1_423; \
52554 uint32x4_t __s2_423 = __p2_423; \
52555 uint32x4_t __ret_423; \
52556 __ret_423 = __s0_423 + __s1_423 * splatq_laneq_u32(__s2_423, __p3_423); \
52557 __ret_423; \
54255#define vmlaq_laneq_u32(__p0_515, __p1_515, __p2_515, __p3_515) __extension__ ({ \
54256 uint32x4_t __s0_515 = __p0_515; \
54257 uint32x4_t __s1_515 = __p1_515; \
54258 uint32x4_t __s2_515 = __p2_515; \
54259 uint32x4_t __ret_515; \
54260 __ret_515 = __s0_515 + __s1_515 * splatq_laneq_u32(__s2_515, __p3_515); \
54261 __ret_515; \
5255854262})
5255954263#else
52560#define vmlaq_laneq_u32(__p0_424, __p1_424, __p2_424, __p3_424) __extension__ ({ \
52561 uint32x4_t __s0_424 = __p0_424; \
52562 uint32x4_t __s1_424 = __p1_424; \
52563 uint32x4_t __s2_424 = __p2_424; \
52564 uint32x4_t __rev0_424; __rev0_424 = __builtin_shufflevector(__s0_424, __s0_424, 3, 2, 1, 0); \
52565 uint32x4_t __rev1_424; __rev1_424 = __builtin_shufflevector(__s1_424, __s1_424, 3, 2, 1, 0); \
52566 uint32x4_t __rev2_424; __rev2_424 = __builtin_shufflevector(__s2_424, __s2_424, 3, 2, 1, 0); \
52567 uint32x4_t __ret_424; \
52568 __ret_424 = __rev0_424 + __rev1_424 * __noswap_splatq_laneq_u32(__rev2_424, __p3_424); \
52569 __ret_424 = __builtin_shufflevector(__ret_424, __ret_424, 3, 2, 1, 0); \
52570 __ret_424; \
54264#define vmlaq_laneq_u32(__p0_516, __p1_516, __p2_516, __p3_516) __extension__ ({ \
54265 uint32x4_t __s0_516 = __p0_516; \
54266 uint32x4_t __s1_516 = __p1_516; \
54267 uint32x4_t __s2_516 = __p2_516; \
54268 uint32x4_t __rev0_516; __rev0_516 = __builtin_shufflevector(__s0_516, __s0_516, 3, 2, 1, 0); \
54269 uint32x4_t __rev1_516; __rev1_516 = __builtin_shufflevector(__s1_516, __s1_516, 3, 2, 1, 0); \
54270 uint32x4_t __rev2_516; __rev2_516 = __builtin_shufflevector(__s2_516, __s2_516, 3, 2, 1, 0); \
54271 uint32x4_t __ret_516; \
54272 __ret_516 = __rev0_516 + __rev1_516 * __noswap_splatq_laneq_u32(__rev2_516, __p3_516); \
54273 __ret_516 = __builtin_shufflevector(__ret_516, __ret_516, 3, 2, 1, 0); \
54274 __ret_516; \
5257154275})
5257254276#endif
5257354277
5257454278#ifdef __LITTLE_ENDIAN__
52575#define vmlaq_laneq_u16(__p0_425, __p1_425, __p2_425, __p3_425) __extension__ ({ \
52576 uint16x8_t __s0_425 = __p0_425; \
52577 uint16x8_t __s1_425 = __p1_425; \
52578 uint16x8_t __s2_425 = __p2_425; \
52579 uint16x8_t __ret_425; \
52580 __ret_425 = __s0_425 + __s1_425 * splatq_laneq_u16(__s2_425, __p3_425); \
52581 __ret_425; \
54279#define vmlaq_laneq_u16(__p0_517, __p1_517, __p2_517, __p3_517) __extension__ ({ \
54280 uint16x8_t __s0_517 = __p0_517; \
54281 uint16x8_t __s1_517 = __p1_517; \
54282 uint16x8_t __s2_517 = __p2_517; \
54283 uint16x8_t __ret_517; \
54284 __ret_517 = __s0_517 + __s1_517 * splatq_laneq_u16(__s2_517, __p3_517); \
54285 __ret_517; \
5258254286})
5258354287#else
52584#define vmlaq_laneq_u16(__p0_426, __p1_426, __p2_426, __p3_426) __extension__ ({ \
52585 uint16x8_t __s0_426 = __p0_426; \
52586 uint16x8_t __s1_426 = __p1_426; \
52587 uint16x8_t __s2_426 = __p2_426; \
52588 uint16x8_t __rev0_426; __rev0_426 = __builtin_shufflevector(__s0_426, __s0_426, 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); \
52590 uint16x8_t __rev2_426; __rev2_426 = __builtin_shufflevector(__s2_426, __s2_426, 7, 6, 5, 4, 3, 2, 1, 0); \
52591 uint16x8_t __ret_426; \
52592 __ret_426 = __rev0_426 + __rev1_426 * __noswap_splatq_laneq_u16(__rev2_426, __p3_426); \
52593 __ret_426 = __builtin_shufflevector(__ret_426, __ret_426, 7, 6, 5, 4, 3, 2, 1, 0); \
52594 __ret_426; \
54288#define vmlaq_laneq_u16(__p0_518, __p1_518, __p2_518, __p3_518) __extension__ ({ \
54289 uint16x8_t __s0_518 = __p0_518; \
54290 uint16x8_t __s1_518 = __p1_518; \
54291 uint16x8_t __s2_518 = __p2_518; \
54292 uint16x8_t __rev0_518; __rev0_518 = __builtin_shufflevector(__s0_518, __s0_518, 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); \
54294 uint16x8_t __rev2_518; __rev2_518 = __builtin_shufflevector(__s2_518, __s2_518, 7, 6, 5, 4, 3, 2, 1, 0); \
54295 uint16x8_t __ret_518; \
54296 __ret_518 = __rev0_518 + __rev1_518 * __noswap_splatq_laneq_u16(__rev2_518, __p3_518); \
54297 __ret_518 = __builtin_shufflevector(__ret_518, __ret_518, 7, 6, 5, 4, 3, 2, 1, 0); \
54298 __ret_518; \
5259554299})
5259654300#endif
5259754301
5259854302#ifdef __LITTLE_ENDIAN__
52599#define vmlaq_laneq_f32(__p0_427, __p1_427, __p2_427, __p3_427) __extension__ ({ \
52600 float32x4_t __s0_427 = __p0_427; \
52601 float32x4_t __s1_427 = __p1_427; \
52602 float32x4_t __s2_427 = __p2_427; \
52603 float32x4_t __ret_427; \
52604 __ret_427 = __s0_427 + __s1_427 * splatq_laneq_f32(__s2_427, __p3_427); \
52605 __ret_427; \
54303#define vmlaq_laneq_f32(__p0_519, __p1_519, __p2_519, __p3_519) __extension__ ({ \
54304 float32x4_t __s0_519 = __p0_519; \
54305 float32x4_t __s1_519 = __p1_519; \
54306 float32x4_t __s2_519 = __p2_519; \
54307 float32x4_t __ret_519; \
54308 __ret_519 = __s0_519 + __s1_519 * splatq_laneq_f32(__s2_519, __p3_519); \
54309 __ret_519; \
5260654310})
5260754311#else
52608#define vmlaq_laneq_f32(__p0_428, __p1_428, __p2_428, __p3_428) __extension__ ({ \
52609 float32x4_t __s0_428 = __p0_428; \
52610 float32x4_t __s1_428 = __p1_428; \
52611 float32x4_t __s2_428 = __p2_428; \
52612 float32x4_t __rev0_428; __rev0_428 = __builtin_shufflevector(__s0_428, __s0_428, 3, 2, 1, 0); \
52613 float32x4_t __rev1_428; __rev1_428 = __builtin_shufflevector(__s1_428, __s1_428, 3, 2, 1, 0); \
52614 float32x4_t __rev2_428; __rev2_428 = __builtin_shufflevector(__s2_428, __s2_428, 3, 2, 1, 0); \
52615 float32x4_t __ret_428; \
52616 __ret_428 = __rev0_428 + __rev1_428 * __noswap_splatq_laneq_f32(__rev2_428, __p3_428); \
52617 __ret_428 = __builtin_shufflevector(__ret_428, __ret_428, 3, 2, 1, 0); \
52618 __ret_428; \
54312#define vmlaq_laneq_f32(__p0_520, __p1_520, __p2_520, __p3_520) __extension__ ({ \
54313 float32x4_t __s0_520 = __p0_520; \
54314 float32x4_t __s1_520 = __p1_520; \
54315 float32x4_t __s2_520 = __p2_520; \
54316 float32x4_t __rev0_520; __rev0_520 = __builtin_shufflevector(__s0_520, __s0_520, 3, 2, 1, 0); \
54317 float32x4_t __rev1_520; __rev1_520 = __builtin_shufflevector(__s1_520, __s1_520, 3, 2, 1, 0); \
54318 float32x4_t __rev2_520; __rev2_520 = __builtin_shufflevector(__s2_520, __s2_520, 3, 2, 1, 0); \
54319 float32x4_t __ret_520; \
54320 __ret_520 = __rev0_520 + __rev1_520 * __noswap_splatq_laneq_f32(__rev2_520, __p3_520); \
54321 __ret_520 = __builtin_shufflevector(__ret_520, __ret_520, 3, 2, 1, 0); \
54322 __ret_520; \
5261954323})
5262054324#endif
5262154325
5262254326#ifdef __LITTLE_ENDIAN__
52623#define vmlaq_laneq_s32(__p0_429, __p1_429, __p2_429, __p3_429) __extension__ ({ \
52624 int32x4_t __s0_429 = __p0_429; \
52625 int32x4_t __s1_429 = __p1_429; \
52626 int32x4_t __s2_429 = __p2_429; \
52627 int32x4_t __ret_429; \
52628 __ret_429 = __s0_429 + __s1_429 * splatq_laneq_s32(__s2_429, __p3_429); \
52629 __ret_429; \
54327#define vmlaq_laneq_s32(__p0_521, __p1_521, __p2_521, __p3_521) __extension__ ({ \
54328 int32x4_t __s0_521 = __p0_521; \
54329 int32x4_t __s1_521 = __p1_521; \
54330 int32x4_t __s2_521 = __p2_521; \
54331 int32x4_t __ret_521; \
54332 __ret_521 = __s0_521 + __s1_521 * splatq_laneq_s32(__s2_521, __p3_521); \
54333 __ret_521; \
5263054334})
5263154335#else
52632#define vmlaq_laneq_s32(__p0_430, __p1_430, __p2_430, __p3_430) __extension__ ({ \
52633 int32x4_t __s0_430 = __p0_430; \
52634 int32x4_t __s1_430 = __p1_430; \
52635 int32x4_t __s2_430 = __p2_430; \
52636 int32x4_t __rev0_430; __rev0_430 = __builtin_shufflevector(__s0_430, __s0_430, 3, 2, 1, 0); \
52637 int32x4_t __rev1_430; __rev1_430 = __builtin_shufflevector(__s1_430, __s1_430, 3, 2, 1, 0); \
52638 int32x4_t __rev2_430; __rev2_430 = __builtin_shufflevector(__s2_430, __s2_430, 3, 2, 1, 0); \
52639 int32x4_t __ret_430; \
52640 __ret_430 = __rev0_430 + __rev1_430 * __noswap_splatq_laneq_s32(__rev2_430, __p3_430); \
52641 __ret_430 = __builtin_shufflevector(__ret_430, __ret_430, 3, 2, 1, 0); \
52642 __ret_430; \
54336#define vmlaq_laneq_s32(__p0_522, __p1_522, __p2_522, __p3_522) __extension__ ({ \
54337 int32x4_t __s0_522 = __p0_522; \
54338 int32x4_t __s1_522 = __p1_522; \
54339 int32x4_t __s2_522 = __p2_522; \
54340 int32x4_t __rev0_522; __rev0_522 = __builtin_shufflevector(__s0_522, __s0_522, 3, 2, 1, 0); \
54341 int32x4_t __rev1_522; __rev1_522 = __builtin_shufflevector(__s1_522, __s1_522, 3, 2, 1, 0); \
54342 int32x4_t __rev2_522; __rev2_522 = __builtin_shufflevector(__s2_522, __s2_522, 3, 2, 1, 0); \
54343 int32x4_t __ret_522; \
54344 __ret_522 = __rev0_522 + __rev1_522 * __noswap_splatq_laneq_s32(__rev2_522, __p3_522); \
54345 __ret_522 = __builtin_shufflevector(__ret_522, __ret_522, 3, 2, 1, 0); \
54346 __ret_522; \
5264354347})
5264454348#endif
5264554349
5264654350#ifdef __LITTLE_ENDIAN__
52647#define vmlaq_laneq_s16(__p0_431, __p1_431, __p2_431, __p3_431) __extension__ ({ \
52648 int16x8_t __s0_431 = __p0_431; \
52649 int16x8_t __s1_431 = __p1_431; \
52650 int16x8_t __s2_431 = __p2_431; \
52651 int16x8_t __ret_431; \
52652 __ret_431 = __s0_431 + __s1_431 * splatq_laneq_s16(__s2_431, __p3_431); \
52653 __ret_431; \
54351#define vmlaq_laneq_s16(__p0_523, __p1_523, __p2_523, __p3_523) __extension__ ({ \
54352 int16x8_t __s0_523 = __p0_523; \
54353 int16x8_t __s1_523 = __p1_523; \
54354 int16x8_t __s2_523 = __p2_523; \
54355 int16x8_t __ret_523; \
54356 __ret_523 = __s0_523 + __s1_523 * splatq_laneq_s16(__s2_523, __p3_523); \
54357 __ret_523; \
5265454358})
5265554359#else
52656#define vmlaq_laneq_s16(__p0_432, __p1_432, __p2_432, __p3_432) __extension__ ({ \
52657 int16x8_t __s0_432 = __p0_432; \
52658 int16x8_t __s1_432 = __p1_432; \
52659 int16x8_t __s2_432 = __p2_432; \
52660 int16x8_t __rev0_432; __rev0_432 = __builtin_shufflevector(__s0_432, __s0_432, 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); \
52662 int16x8_t __rev2_432; __rev2_432 = __builtin_shufflevector(__s2_432, __s2_432, 7, 6, 5, 4, 3, 2, 1, 0); \
52663 int16x8_t __ret_432; \
52664 __ret_432 = __rev0_432 + __rev1_432 * __noswap_splatq_laneq_s16(__rev2_432, __p3_432); \
52665 __ret_432 = __builtin_shufflevector(__ret_432, __ret_432, 7, 6, 5, 4, 3, 2, 1, 0); \
52666 __ret_432; \
54360#define vmlaq_laneq_s16(__p0_524, __p1_524, __p2_524, __p3_524) __extension__ ({ \
54361 int16x8_t __s0_524 = __p0_524; \
54362 int16x8_t __s1_524 = __p1_524; \
54363 int16x8_t __s2_524 = __p2_524; \
54364 int16x8_t __rev0_524; __rev0_524 = __builtin_shufflevector(__s0_524, __s0_524, 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); \
54366 int16x8_t __rev2_524; __rev2_524 = __builtin_shufflevector(__s2_524, __s2_524, 7, 6, 5, 4, 3, 2, 1, 0); \
54367 int16x8_t __ret_524; \
54368 __ret_524 = __rev0_524 + __rev1_524 * __noswap_splatq_laneq_s16(__rev2_524, __p3_524); \
54369 __ret_524 = __builtin_shufflevector(__ret_524, __ret_524, 7, 6, 5, 4, 3, 2, 1, 0); \
54370 __ret_524; \
5266754371})
5266854372#endif
5266954373
5267054374#ifdef __LITTLE_ENDIAN__
52671#define vmla_laneq_u32(__p0_433, __p1_433, __p2_433, __p3_433) __extension__ ({ \
52672 uint32x2_t __s0_433 = __p0_433; \
52673 uint32x2_t __s1_433 = __p1_433; \
52674 uint32x4_t __s2_433 = __p2_433; \
52675 uint32x2_t __ret_433; \
52676 __ret_433 = __s0_433 + __s1_433 * splat_laneq_u32(__s2_433, __p3_433); \
52677 __ret_433; \
54375#define vmla_laneq_u32(__p0_525, __p1_525, __p2_525, __p3_525) __extension__ ({ \
54376 uint32x2_t __s0_525 = __p0_525; \
54377 uint32x2_t __s1_525 = __p1_525; \
54378 uint32x4_t __s2_525 = __p2_525; \
54379 uint32x2_t __ret_525; \
54380 __ret_525 = __s0_525 + __s1_525 * splat_laneq_u32(__s2_525, __p3_525); \
54381 __ret_525; \
5267854382})
5267954383#else
52680#define vmla_laneq_u32(__p0_434, __p1_434, __p2_434, __p3_434) __extension__ ({ \
52681 uint32x2_t __s0_434 = __p0_434; \
52682 uint32x2_t __s1_434 = __p1_434; \
52683 uint32x4_t __s2_434 = __p2_434; \
52684 uint32x2_t __rev0_434; __rev0_434 = __builtin_shufflevector(__s0_434, __s0_434, 1, 0); \
52685 uint32x2_t __rev1_434; __rev1_434 = __builtin_shufflevector(__s1_434, __s1_434, 1, 0); \
52686 uint32x4_t __rev2_434; __rev2_434 = __builtin_shufflevector(__s2_434, __s2_434, 3, 2, 1, 0); \
52687 uint32x2_t __ret_434; \
52688 __ret_434 = __rev0_434 + __rev1_434 * __noswap_splat_laneq_u32(__rev2_434, __p3_434); \
52689 __ret_434 = __builtin_shufflevector(__ret_434, __ret_434, 1, 0); \
52690 __ret_434; \
54384#define vmla_laneq_u32(__p0_526, __p1_526, __p2_526, __p3_526) __extension__ ({ \
54385 uint32x2_t __s0_526 = __p0_526; \
54386 uint32x2_t __s1_526 = __p1_526; \
54387 uint32x4_t __s2_526 = __p2_526; \
54388 uint32x2_t __rev0_526; __rev0_526 = __builtin_shufflevector(__s0_526, __s0_526, 1, 0); \
54389 uint32x2_t __rev1_526; __rev1_526 = __builtin_shufflevector(__s1_526, __s1_526, 1, 0); \
54390 uint32x4_t __rev2_526; __rev2_526 = __builtin_shufflevector(__s2_526, __s2_526, 3, 2, 1, 0); \
54391 uint32x2_t __ret_526; \
54392 __ret_526 = __rev0_526 + __rev1_526 * __noswap_splat_laneq_u32(__rev2_526, __p3_526); \
54393 __ret_526 = __builtin_shufflevector(__ret_526, __ret_526, 1, 0); \
54394 __ret_526; \
5269154395})
5269254396#endif
5269354397
5269454398#ifdef __LITTLE_ENDIAN__
52695#define vmla_laneq_u16(__p0_435, __p1_435, __p2_435, __p3_435) __extension__ ({ \
52696 uint16x4_t __s0_435 = __p0_435; \
52697 uint16x4_t __s1_435 = __p1_435; \
52698 uint16x8_t __s2_435 = __p2_435; \
52699 uint16x4_t __ret_435; \
52700 __ret_435 = __s0_435 + __s1_435 * splat_laneq_u16(__s2_435, __p3_435); \
52701 __ret_435; \
54399#define vmla_laneq_u16(__p0_527, __p1_527, __p2_527, __p3_527) __extension__ ({ \
54400 uint16x4_t __s0_527 = __p0_527; \
54401 uint16x4_t __s1_527 = __p1_527; \
54402 uint16x8_t __s2_527 = __p2_527; \
54403 uint16x4_t __ret_527; \
54404 __ret_527 = __s0_527 + __s1_527 * splat_laneq_u16(__s2_527, __p3_527); \
54405 __ret_527; \
5270254406})
5270354407#else
52704#define vmla_laneq_u16(__p0_436, __p1_436, __p2_436, __p3_436) __extension__ ({ \
52705 uint16x4_t __s0_436 = __p0_436; \
52706 uint16x4_t __s1_436 = __p1_436; \
52707 uint16x8_t __s2_436 = __p2_436; \
52708 uint16x4_t __rev0_436; __rev0_436 = __builtin_shufflevector(__s0_436, __s0_436, 3, 2, 1, 0); \
52709 uint16x4_t __rev1_436; __rev1_436 = __builtin_shufflevector(__s1_436, __s1_436, 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); \
52711 uint16x4_t __ret_436; \
52712 __ret_436 = __rev0_436 + __rev1_436 * __noswap_splat_laneq_u16(__rev2_436, __p3_436); \
52713 __ret_436 = __builtin_shufflevector(__ret_436, __ret_436, 3, 2, 1, 0); \
52714 __ret_436; \
54408#define vmla_laneq_u16(__p0_528, __p1_528, __p2_528, __p3_528) __extension__ ({ \
54409 uint16x4_t __s0_528 = __p0_528; \
54410 uint16x4_t __s1_528 = __p1_528; \
54411 uint16x8_t __s2_528 = __p2_528; \
54412 uint16x4_t __rev0_528; __rev0_528 = __builtin_shufflevector(__s0_528, __s0_528, 3, 2, 1, 0); \
54413 uint16x4_t __rev1_528; __rev1_528 = __builtin_shufflevector(__s1_528, __s1_528, 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); \
54415 uint16x4_t __ret_528; \
54416 __ret_528 = __rev0_528 + __rev1_528 * __noswap_splat_laneq_u16(__rev2_528, __p3_528); \
54417 __ret_528 = __builtin_shufflevector(__ret_528, __ret_528, 3, 2, 1, 0); \
54418 __ret_528; \
5271554419})
5271654420#endif
5271754421
5271854422#ifdef __LITTLE_ENDIAN__
52719#define vmla_laneq_f32(__p0_437, __p1_437, __p2_437, __p3_437) __extension__ ({ \
52720 float32x2_t __s0_437 = __p0_437; \
52721 float32x2_t __s1_437 = __p1_437; \
52722 float32x4_t __s2_437 = __p2_437; \
52723 float32x2_t __ret_437; \
52724 __ret_437 = __s0_437 + __s1_437 * splat_laneq_f32(__s2_437, __p3_437); \
52725 __ret_437; \
54423#define vmla_laneq_f32(__p0_529, __p1_529, __p2_529, __p3_529) __extension__ ({ \
54424 float32x2_t __s0_529 = __p0_529; \
54425 float32x2_t __s1_529 = __p1_529; \
54426 float32x4_t __s2_529 = __p2_529; \
54427 float32x2_t __ret_529; \
54428 __ret_529 = __s0_529 + __s1_529 * splat_laneq_f32(__s2_529, __p3_529); \
54429 __ret_529; \
5272654430})
5272754431#else
52728#define vmla_laneq_f32(__p0_438, __p1_438, __p2_438, __p3_438) __extension__ ({ \
52729 float32x2_t __s0_438 = __p0_438; \
52730 float32x2_t __s1_438 = __p1_438; \
52731 float32x4_t __s2_438 = __p2_438; \
52732 float32x2_t __rev0_438; __rev0_438 = __builtin_shufflevector(__s0_438, __s0_438, 1, 0); \
52733 float32x2_t __rev1_438; __rev1_438 = __builtin_shufflevector(__s1_438, __s1_438, 1, 0); \
52734 float32x4_t __rev2_438; __rev2_438 = __builtin_shufflevector(__s2_438, __s2_438, 3, 2, 1, 0); \
52735 float32x2_t __ret_438; \
52736 __ret_438 = __rev0_438 + __rev1_438 * __noswap_splat_laneq_f32(__rev2_438, __p3_438); \
52737 __ret_438 = __builtin_shufflevector(__ret_438, __ret_438, 1, 0); \
52738 __ret_438; \
54432#define vmla_laneq_f32(__p0_530, __p1_530, __p2_530, __p3_530) __extension__ ({ \
54433 float32x2_t __s0_530 = __p0_530; \
54434 float32x2_t __s1_530 = __p1_530; \
54435 float32x4_t __s2_530 = __p2_530; \
54436 float32x2_t __rev0_530; __rev0_530 = __builtin_shufflevector(__s0_530, __s0_530, 1, 0); \
54437 float32x2_t __rev1_530; __rev1_530 = __builtin_shufflevector(__s1_530, __s1_530, 1, 0); \
54438 float32x4_t __rev2_530; __rev2_530 = __builtin_shufflevector(__s2_530, __s2_530, 3, 2, 1, 0); \
54439 float32x2_t __ret_530; \
54440 __ret_530 = __rev0_530 + __rev1_530 * __noswap_splat_laneq_f32(__rev2_530, __p3_530); \
54441 __ret_530 = __builtin_shufflevector(__ret_530, __ret_530, 1, 0); \
54442 __ret_530; \
5273954443})
5274054444#endif
5274154445
5274254446#ifdef __LITTLE_ENDIAN__
52743#define vmla_laneq_s32(__p0_439, __p1_439, __p2_439, __p3_439) __extension__ ({ \
52744 int32x2_t __s0_439 = __p0_439; \
52745 int32x2_t __s1_439 = __p1_439; \
52746 int32x4_t __s2_439 = __p2_439; \
52747 int32x2_t __ret_439; \
52748 __ret_439 = __s0_439 + __s1_439 * splat_laneq_s32(__s2_439, __p3_439); \
52749 __ret_439; \
54447#define vmla_laneq_s32(__p0_531, __p1_531, __p2_531, __p3_531) __extension__ ({ \
54448 int32x2_t __s0_531 = __p0_531; \
54449 int32x2_t __s1_531 = __p1_531; \
54450 int32x4_t __s2_531 = __p2_531; \
54451 int32x2_t __ret_531; \
54452 __ret_531 = __s0_531 + __s1_531 * splat_laneq_s32(__s2_531, __p3_531); \
54453 __ret_531; \
5275054454})
5275154455#else
52752#define vmla_laneq_s32(__p0_440, __p1_440, __p2_440, __p3_440) __extension__ ({ \
52753 int32x2_t __s0_440 = __p0_440; \
52754 int32x2_t __s1_440 = __p1_440; \
52755 int32x4_t __s2_440 = __p2_440; \
52756 int32x2_t __rev0_440; __rev0_440 = __builtin_shufflevector(__s0_440, __s0_440, 1, 0); \
52757 int32x2_t __rev1_440; __rev1_440 = __builtin_shufflevector(__s1_440, __s1_440, 1, 0); \
52758 int32x4_t __rev2_440; __rev2_440 = __builtin_shufflevector(__s2_440, __s2_440, 3, 2, 1, 0); \
52759 int32x2_t __ret_440; \
52760 __ret_440 = __rev0_440 + __rev1_440 * __noswap_splat_laneq_s32(__rev2_440, __p3_440); \
52761 __ret_440 = __builtin_shufflevector(__ret_440, __ret_440, 1, 0); \
52762 __ret_440; \
54456#define vmla_laneq_s32(__p0_532, __p1_532, __p2_532, __p3_532) __extension__ ({ \
54457 int32x2_t __s0_532 = __p0_532; \
54458 int32x2_t __s1_532 = __p1_532; \
54459 int32x4_t __s2_532 = __p2_532; \
54460 int32x2_t __rev0_532; __rev0_532 = __builtin_shufflevector(__s0_532, __s0_532, 1, 0); \
54461 int32x2_t __rev1_532; __rev1_532 = __builtin_shufflevector(__s1_532, __s1_532, 1, 0); \
54462 int32x4_t __rev2_532; __rev2_532 = __builtin_shufflevector(__s2_532, __s2_532, 3, 2, 1, 0); \
54463 int32x2_t __ret_532; \
54464 __ret_532 = __rev0_532 + __rev1_532 * __noswap_splat_laneq_s32(__rev2_532, __p3_532); \
54465 __ret_532 = __builtin_shufflevector(__ret_532, __ret_532, 1, 0); \
54466 __ret_532; \
5276354467})
5276454468#endif
5276554469
5276654470#ifdef __LITTLE_ENDIAN__
52767#define vmla_laneq_s16(__p0_441, __p1_441, __p2_441, __p3_441) __extension__ ({ \
52768 int16x4_t __s0_441 = __p0_441; \
52769 int16x4_t __s1_441 = __p1_441; \
52770 int16x8_t __s2_441 = __p2_441; \
52771 int16x4_t __ret_441; \
52772 __ret_441 = __s0_441 + __s1_441 * splat_laneq_s16(__s2_441, __p3_441); \
52773 __ret_441; \
54471#define vmla_laneq_s16(__p0_533, __p1_533, __p2_533, __p3_533) __extension__ ({ \
54472 int16x4_t __s0_533 = __p0_533; \
54473 int16x4_t __s1_533 = __p1_533; \
54474 int16x8_t __s2_533 = __p2_533; \
54475 int16x4_t __ret_533; \
54476 __ret_533 = __s0_533 + __s1_533 * splat_laneq_s16(__s2_533, __p3_533); \
54477 __ret_533; \
5277454478})
5277554479#else
52776#define vmla_laneq_s16(__p0_442, __p1_442, __p2_442, __p3_442) __extension__ ({ \
52777 int16x4_t __s0_442 = __p0_442; \
52778 int16x4_t __s1_442 = __p1_442; \
52779 int16x8_t __s2_442 = __p2_442; \
52780 int16x4_t __rev0_442; __rev0_442 = __builtin_shufflevector(__s0_442, __s0_442, 3, 2, 1, 0); \
52781 int16x4_t __rev1_442; __rev1_442 = __builtin_shufflevector(__s1_442, __s1_442, 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); \
52783 int16x4_t __ret_442; \
52784 __ret_442 = __rev0_442 + __rev1_442 * __noswap_splat_laneq_s16(__rev2_442, __p3_442); \
52785 __ret_442 = __builtin_shufflevector(__ret_442, __ret_442, 3, 2, 1, 0); \
52786 __ret_442; \
54480#define vmla_laneq_s16(__p0_534, __p1_534, __p2_534, __p3_534) __extension__ ({ \
54481 int16x4_t __s0_534 = __p0_534; \
54482 int16x4_t __s1_534 = __p1_534; \
54483 int16x8_t __s2_534 = __p2_534; \
54484 int16x4_t __rev0_534; __rev0_534 = __builtin_shufflevector(__s0_534, __s0_534, 3, 2, 1, 0); \
54485 int16x4_t __rev1_534; __rev1_534 = __builtin_shufflevector(__s1_534, __s1_534, 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); \
54487 int16x4_t __ret_534; \
54488 __ret_534 = __rev0_534 + __rev1_534 * __noswap_splat_laneq_s16(__rev2_534, __p3_534); \
54489 __ret_534 = __builtin_shufflevector(__ret_534, __ret_534, 3, 2, 1, 0); \
54490 __ret_534; \
5278754491})
5278854492#endif
5278954493
5279054494#ifdef __LITTLE_ENDIAN__
52791__ai float64x2_t vmlaq_n_f64(float64x2_t __p0, float64x2_t __p1, float64_t __p2) {
52792 float64x2_t __ret;
52793 __ret = __p0 + __p1 * (float64x2_t) {__p2, __p2};
52794 return __ret;
52795}
52796#else
52797__ai float64x2_t vmlaq_n_f64(float64x2_t __p0, float64x2_t __p1, float64_t __p2) {
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; \
54495#define vmlal_high_lane_u32(__p0_535, __p1_535, __p2_535, __p3_535) __extension__ ({ \
54496 uint64x2_t __s0_535 = __p0_535; \
54497 uint32x4_t __s1_535 = __p1_535; \
54498 uint32x2_t __s2_535 = __p2_535; \
54499 uint64x2_t __ret_535; \
54500 __ret_535 = __s0_535 + vmull_u32(vget_high_u32(__s1_535), splat_lane_u32(__s2_535, __p3_535)); \
54501 __ret_535; \
5281554502})
5281654503#else
52817#define vmlal_high_lane_u32(__p0_444, __p1_444, __p2_444, __p3_444) __extension__ ({ \
52818 uint64x2_t __s0_444 = __p0_444; \
52819 uint32x4_t __s1_444 = __p1_444; \
52820 uint32x2_t __s2_444 = __p2_444; \
52821 uint64x2_t __rev0_444; __rev0_444 = __builtin_shufflevector(__s0_444, __s0_444, 1, 0); \
52822 uint32x4_t __rev1_444; __rev1_444 = __builtin_shufflevector(__s1_444, __s1_444, 3, 2, 1, 0); \
52823 uint32x2_t __rev2_444; __rev2_444 = __builtin_shufflevector(__s2_444, __s2_444, 1, 0); \
52824 uint64x2_t __ret_444; \
52825 __ret_444 = __rev0_444 + __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_444), __noswap_splat_lane_u32(__rev2_444, __p3_444)); \
52826 __ret_444 = __builtin_shufflevector(__ret_444, __ret_444, 1, 0); \
52827 __ret_444; \
54504#define vmlal_high_lane_u32(__p0_536, __p1_536, __p2_536, __p3_536) __extension__ ({ \
54505 uint64x2_t __s0_536 = __p0_536; \
54506 uint32x4_t __s1_536 = __p1_536; \
54507 uint32x2_t __s2_536 = __p2_536; \
54508 uint64x2_t __rev0_536; __rev0_536 = __builtin_shufflevector(__s0_536, __s0_536, 1, 0); \
54509 uint32x4_t __rev1_536; __rev1_536 = __builtin_shufflevector(__s1_536, __s1_536, 3, 2, 1, 0); \
54510 uint32x2_t __rev2_536; __rev2_536 = __builtin_shufflevector(__s2_536, __s2_536, 1, 0); \
54511 uint64x2_t __ret_536; \
54512 __ret_536 = __rev0_536 + __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_536), __noswap_splat_lane_u32(__rev2_536, __p3_536)); \
54513 __ret_536 = __builtin_shufflevector(__ret_536, __ret_536, 1, 0); \
54514 __ret_536; \
5282854515})
5282954516#endif
5283054517
5283154518#ifdef __LITTLE_ENDIAN__
52832#define vmlal_high_lane_u16(__p0_445, __p1_445, __p2_445, __p3_445) __extension__ ({ \
52833 uint32x4_t __s0_445 = __p0_445; \
52834 uint16x8_t __s1_445 = __p1_445; \
52835 uint16x4_t __s2_445 = __p2_445; \
52836 uint32x4_t __ret_445; \
52837 __ret_445 = __s0_445 + vmull_u16(vget_high_u16(__s1_445), splat_lane_u16(__s2_445, __p3_445)); \
52838 __ret_445; \
54519#define vmlal_high_lane_u16(__p0_537, __p1_537, __p2_537, __p3_537) __extension__ ({ \
54520 uint32x4_t __s0_537 = __p0_537; \
54521 uint16x8_t __s1_537 = __p1_537; \
54522 uint16x4_t __s2_537 = __p2_537; \
54523 uint32x4_t __ret_537; \
54524 __ret_537 = __s0_537 + vmull_u16(vget_high_u16(__s1_537), splat_lane_u16(__s2_537, __p3_537)); \
54525 __ret_537; \
5283954526})
5284054527#else
52841#define vmlal_high_lane_u16(__p0_446, __p1_446, __p2_446, __p3_446) __extension__ ({ \
52842 uint32x4_t __s0_446 = __p0_446; \
52843 uint16x8_t __s1_446 = __p1_446; \
52844 uint16x4_t __s2_446 = __p2_446; \
52845 uint32x4_t __rev0_446; __rev0_446 = __builtin_shufflevector(__s0_446, __s0_446, 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); \
52847 uint16x4_t __rev2_446; __rev2_446 = __builtin_shufflevector(__s2_446, __s2_446, 3, 2, 1, 0); \
52848 uint32x4_t __ret_446; \
52849 __ret_446 = __rev0_446 + __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_446), __noswap_splat_lane_u16(__rev2_446, __p3_446)); \
52850 __ret_446 = __builtin_shufflevector(__ret_446, __ret_446, 3, 2, 1, 0); \
52851 __ret_446; \
54528#define vmlal_high_lane_u16(__p0_538, __p1_538, __p2_538, __p3_538) __extension__ ({ \
54529 uint32x4_t __s0_538 = __p0_538; \
54530 uint16x8_t __s1_538 = __p1_538; \
54531 uint16x4_t __s2_538 = __p2_538; \
54532 uint32x4_t __rev0_538; __rev0_538 = __builtin_shufflevector(__s0_538, __s0_538, 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); \
54534 uint16x4_t __rev2_538; __rev2_538 = __builtin_shufflevector(__s2_538, __s2_538, 3, 2, 1, 0); \
54535 uint32x4_t __ret_538; \
54536 __ret_538 = __rev0_538 + __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_538), __noswap_splat_lane_u16(__rev2_538, __p3_538)); \
54537 __ret_538 = __builtin_shufflevector(__ret_538, __ret_538, 3, 2, 1, 0); \
54538 __ret_538; \
5285254539})
5285354540#endif
5285454541
5285554542#ifdef __LITTLE_ENDIAN__
52856#define vmlal_high_lane_s32(__p0_447, __p1_447, __p2_447, __p3_447) __extension__ ({ \
52857 int64x2_t __s0_447 = __p0_447; \
52858 int32x4_t __s1_447 = __p1_447; \
52859 int32x2_t __s2_447 = __p2_447; \
52860 int64x2_t __ret_447; \
52861 __ret_447 = __s0_447 + vmull_s32(vget_high_s32(__s1_447), splat_lane_s32(__s2_447, __p3_447)); \
52862 __ret_447; \
54543#define vmlal_high_lane_s32(__p0_539, __p1_539, __p2_539, __p3_539) __extension__ ({ \
54544 int64x2_t __s0_539 = __p0_539; \
54545 int32x4_t __s1_539 = __p1_539; \
54546 int32x2_t __s2_539 = __p2_539; \
54547 int64x2_t __ret_539; \
54548 __ret_539 = __s0_539 + vmull_s32(vget_high_s32(__s1_539), splat_lane_s32(__s2_539, __p3_539)); \
54549 __ret_539; \
5286354550})
5286454551#else
52865#define vmlal_high_lane_s32(__p0_448, __p1_448, __p2_448, __p3_448) __extension__ ({ \
52866 int64x2_t __s0_448 = __p0_448; \
52867 int32x4_t __s1_448 = __p1_448; \
52868 int32x2_t __s2_448 = __p2_448; \
52869 int64x2_t __rev0_448; __rev0_448 = __builtin_shufflevector(__s0_448, __s0_448, 1, 0); \
52870 int32x4_t __rev1_448; __rev1_448 = __builtin_shufflevector(__s1_448, __s1_448, 3, 2, 1, 0); \
52871 int32x2_t __rev2_448; __rev2_448 = __builtin_shufflevector(__s2_448, __s2_448, 1, 0); \
52872 int64x2_t __ret_448; \
52873 __ret_448 = __rev0_448 + __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_448), __noswap_splat_lane_s32(__rev2_448, __p3_448)); \
52874 __ret_448 = __builtin_shufflevector(__ret_448, __ret_448, 1, 0); \
52875 __ret_448; \
54552#define vmlal_high_lane_s32(__p0_540, __p1_540, __p2_540, __p3_540) __extension__ ({ \
54553 int64x2_t __s0_540 = __p0_540; \
54554 int32x4_t __s1_540 = __p1_540; \
54555 int32x2_t __s2_540 = __p2_540; \
54556 int64x2_t __rev0_540; __rev0_540 = __builtin_shufflevector(__s0_540, __s0_540, 1, 0); \
54557 int32x4_t __rev1_540; __rev1_540 = __builtin_shufflevector(__s1_540, __s1_540, 3, 2, 1, 0); \
54558 int32x2_t __rev2_540; __rev2_540 = __builtin_shufflevector(__s2_540, __s2_540, 1, 0); \
54559 int64x2_t __ret_540; \
54560 __ret_540 = __rev0_540 + __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_540), __noswap_splat_lane_s32(__rev2_540, __p3_540)); \
54561 __ret_540 = __builtin_shufflevector(__ret_540, __ret_540, 1, 0); \
54562 __ret_540; \
5287654563})
5287754564#endif
5287854565
5287954566#ifdef __LITTLE_ENDIAN__
52880#define vmlal_high_lane_s16(__p0_449, __p1_449, __p2_449, __p3_449) __extension__ ({ \
52881 int32x4_t __s0_449 = __p0_449; \
52882 int16x8_t __s1_449 = __p1_449; \
52883 int16x4_t __s2_449 = __p2_449; \
52884 int32x4_t __ret_449; \
52885 __ret_449 = __s0_449 + vmull_s16(vget_high_s16(__s1_449), splat_lane_s16(__s2_449, __p3_449)); \
52886 __ret_449; \
54567#define vmlal_high_lane_s16(__p0_541, __p1_541, __p2_541, __p3_541) __extension__ ({ \
54568 int32x4_t __s0_541 = __p0_541; \
54569 int16x8_t __s1_541 = __p1_541; \
54570 int16x4_t __s2_541 = __p2_541; \
54571 int32x4_t __ret_541; \
54572 __ret_541 = __s0_541 + vmull_s16(vget_high_s16(__s1_541), splat_lane_s16(__s2_541, __p3_541)); \
54573 __ret_541; \
5288754574})
5288854575#else
52889#define vmlal_high_lane_s16(__p0_450, __p1_450, __p2_450, __p3_450) __extension__ ({ \
52890 int32x4_t __s0_450 = __p0_450; \
52891 int16x8_t __s1_450 = __p1_450; \
52892 int16x4_t __s2_450 = __p2_450; \
52893 int32x4_t __rev0_450; __rev0_450 = __builtin_shufflevector(__s0_450, __s0_450, 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); \
52895 int16x4_t __rev2_450; __rev2_450 = __builtin_shufflevector(__s2_450, __s2_450, 3, 2, 1, 0); \
52896 int32x4_t __ret_450; \
52897 __ret_450 = __rev0_450 + __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_450), __noswap_splat_lane_s16(__rev2_450, __p3_450)); \
52898 __ret_450 = __builtin_shufflevector(__ret_450, __ret_450, 3, 2, 1, 0); \
52899 __ret_450; \
54576#define vmlal_high_lane_s16(__p0_542, __p1_542, __p2_542, __p3_542) __extension__ ({ \
54577 int32x4_t __s0_542 = __p0_542; \
54578 int16x8_t __s1_542 = __p1_542; \
54579 int16x4_t __s2_542 = __p2_542; \
54580 int32x4_t __rev0_542; __rev0_542 = __builtin_shufflevector(__s0_542, __s0_542, 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); \
54582 int16x4_t __rev2_542; __rev2_542 = __builtin_shufflevector(__s2_542, __s2_542, 3, 2, 1, 0); \
54583 int32x4_t __ret_542; \
54584 __ret_542 = __rev0_542 + __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_542), __noswap_splat_lane_s16(__rev2_542, __p3_542)); \
54585 __ret_542 = __builtin_shufflevector(__ret_542, __ret_542, 3, 2, 1, 0); \
54586 __ret_542; \
5290054587})
5290154588#endif
5290254589
5290354590#ifdef __LITTLE_ENDIAN__
52904#define vmlal_high_laneq_u32(__p0_451, __p1_451, __p2_451, __p3_451) __extension__ ({ \
52905 uint64x2_t __s0_451 = __p0_451; \
52906 uint32x4_t __s1_451 = __p1_451; \
52907 uint32x4_t __s2_451 = __p2_451; \
52908 uint64x2_t __ret_451; \
52909 __ret_451 = __s0_451 + vmull_u32(vget_high_u32(__s1_451), splat_laneq_u32(__s2_451, __p3_451)); \
52910 __ret_451; \
54591#define vmlal_high_laneq_u32(__p0_543, __p1_543, __p2_543, __p3_543) __extension__ ({ \
54592 uint64x2_t __s0_543 = __p0_543; \
54593 uint32x4_t __s1_543 = __p1_543; \
54594 uint32x4_t __s2_543 = __p2_543; \
54595 uint64x2_t __ret_543; \
54596 __ret_543 = __s0_543 + vmull_u32(vget_high_u32(__s1_543), splat_laneq_u32(__s2_543, __p3_543)); \
54597 __ret_543; \
5291154598})
5291254599#else
52913#define vmlal_high_laneq_u32(__p0_452, __p1_452, __p2_452, __p3_452) __extension__ ({ \
52914 uint64x2_t __s0_452 = __p0_452; \
52915 uint32x4_t __s1_452 = __p1_452; \
52916 uint32x4_t __s2_452 = __p2_452; \
52917 uint64x2_t __rev0_452; __rev0_452 = __builtin_shufflevector(__s0_452, __s0_452, 1, 0); \
52918 uint32x4_t __rev1_452; __rev1_452 = __builtin_shufflevector(__s1_452, __s1_452, 3, 2, 1, 0); \
52919 uint32x4_t __rev2_452; __rev2_452 = __builtin_shufflevector(__s2_452, __s2_452, 3, 2, 1, 0); \
52920 uint64x2_t __ret_452; \
52921 __ret_452 = __rev0_452 + __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_452), __noswap_splat_laneq_u32(__rev2_452, __p3_452)); \
52922 __ret_452 = __builtin_shufflevector(__ret_452, __ret_452, 1, 0); \
52923 __ret_452; \
54600#define vmlal_high_laneq_u32(__p0_544, __p1_544, __p2_544, __p3_544) __extension__ ({ \
54601 uint64x2_t __s0_544 = __p0_544; \
54602 uint32x4_t __s1_544 = __p1_544; \
54603 uint32x4_t __s2_544 = __p2_544; \
54604 uint64x2_t __rev0_544; __rev0_544 = __builtin_shufflevector(__s0_544, __s0_544, 1, 0); \
54605 uint32x4_t __rev1_544; __rev1_544 = __builtin_shufflevector(__s1_544, __s1_544, 3, 2, 1, 0); \
54606 uint32x4_t __rev2_544; __rev2_544 = __builtin_shufflevector(__s2_544, __s2_544, 3, 2, 1, 0); \
54607 uint64x2_t __ret_544; \
54608 __ret_544 = __rev0_544 + __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_544), __noswap_splat_laneq_u32(__rev2_544, __p3_544)); \
54609 __ret_544 = __builtin_shufflevector(__ret_544, __ret_544, 1, 0); \
54610 __ret_544; \
5292454611})
5292554612#endif
5292654613
5292754614#ifdef __LITTLE_ENDIAN__
52928#define vmlal_high_laneq_u16(__p0_453, __p1_453, __p2_453, __p3_453) __extension__ ({ \
52929 uint32x4_t __s0_453 = __p0_453; \
52930 uint16x8_t __s1_453 = __p1_453; \
52931 uint16x8_t __s2_453 = __p2_453; \
52932 uint32x4_t __ret_453; \
52933 __ret_453 = __s0_453 + vmull_u16(vget_high_u16(__s1_453), splat_laneq_u16(__s2_453, __p3_453)); \
52934 __ret_453; \
54615#define vmlal_high_laneq_u16(__p0_545, __p1_545, __p2_545, __p3_545) __extension__ ({ \
54616 uint32x4_t __s0_545 = __p0_545; \
54617 uint16x8_t __s1_545 = __p1_545; \
54618 uint16x8_t __s2_545 = __p2_545; \
54619 uint32x4_t __ret_545; \
54620 __ret_545 = __s0_545 + vmull_u16(vget_high_u16(__s1_545), splat_laneq_u16(__s2_545, __p3_545)); \
54621 __ret_545; \
5293554622})
5293654623#else
52937#define vmlal_high_laneq_u16(__p0_454, __p1_454, __p2_454, __p3_454) __extension__ ({ \
52938 uint32x4_t __s0_454 = __p0_454; \
52939 uint16x8_t __s1_454 = __p1_454; \
52940 uint16x8_t __s2_454 = __p2_454; \
52941 uint32x4_t __rev0_454; __rev0_454 = __builtin_shufflevector(__s0_454, __s0_454, 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); \
52943 uint16x8_t __rev2_454; __rev2_454 = __builtin_shufflevector(__s2_454, __s2_454, 7, 6, 5, 4, 3, 2, 1, 0); \
52944 uint32x4_t __ret_454; \
52945 __ret_454 = __rev0_454 + __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_454), __noswap_splat_laneq_u16(__rev2_454, __p3_454)); \
52946 __ret_454 = __builtin_shufflevector(__ret_454, __ret_454, 3, 2, 1, 0); \
52947 __ret_454; \
54624#define vmlal_high_laneq_u16(__p0_546, __p1_546, __p2_546, __p3_546) __extension__ ({ \
54625 uint32x4_t __s0_546 = __p0_546; \
54626 uint16x8_t __s1_546 = __p1_546; \
54627 uint16x8_t __s2_546 = __p2_546; \
54628 uint32x4_t __rev0_546; __rev0_546 = __builtin_shufflevector(__s0_546, __s0_546, 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); \
54630 uint16x8_t __rev2_546; __rev2_546 = __builtin_shufflevector(__s2_546, __s2_546, 7, 6, 5, 4, 3, 2, 1, 0); \
54631 uint32x4_t __ret_546; \
54632 __ret_546 = __rev0_546 + __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_546), __noswap_splat_laneq_u16(__rev2_546, __p3_546)); \
54633 __ret_546 = __builtin_shufflevector(__ret_546, __ret_546, 3, 2, 1, 0); \
54634 __ret_546; \
5294854635})
5294954636#endif
5295054637
5295154638#ifdef __LITTLE_ENDIAN__
52952#define vmlal_high_laneq_s32(__p0_455, __p1_455, __p2_455, __p3_455) __extension__ ({ \
52953 int64x2_t __s0_455 = __p0_455; \
52954 int32x4_t __s1_455 = __p1_455; \
52955 int32x4_t __s2_455 = __p2_455; \
52956 int64x2_t __ret_455; \
52957 __ret_455 = __s0_455 + vmull_s32(vget_high_s32(__s1_455), splat_laneq_s32(__s2_455, __p3_455)); \
52958 __ret_455; \
54639#define vmlal_high_laneq_s32(__p0_547, __p1_547, __p2_547, __p3_547) __extension__ ({ \
54640 int64x2_t __s0_547 = __p0_547; \
54641 int32x4_t __s1_547 = __p1_547; \
54642 int32x4_t __s2_547 = __p2_547; \
54643 int64x2_t __ret_547; \
54644 __ret_547 = __s0_547 + vmull_s32(vget_high_s32(__s1_547), splat_laneq_s32(__s2_547, __p3_547)); \
54645 __ret_547; \
5295954646})
5296054647#else
52961#define vmlal_high_laneq_s32(__p0_456, __p1_456, __p2_456, __p3_456) __extension__ ({ \
52962 int64x2_t __s0_456 = __p0_456; \
52963 int32x4_t __s1_456 = __p1_456; \
52964 int32x4_t __s2_456 = __p2_456; \
52965 int64x2_t __rev0_456; __rev0_456 = __builtin_shufflevector(__s0_456, __s0_456, 1, 0); \
52966 int32x4_t __rev1_456; __rev1_456 = __builtin_shufflevector(__s1_456, __s1_456, 3, 2, 1, 0); \
52967 int32x4_t __rev2_456; __rev2_456 = __builtin_shufflevector(__s2_456, __s2_456, 3, 2, 1, 0); \
52968 int64x2_t __ret_456; \
52969 __ret_456 = __rev0_456 + __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_456), __noswap_splat_laneq_s32(__rev2_456, __p3_456)); \
52970 __ret_456 = __builtin_shufflevector(__ret_456, __ret_456, 1, 0); \
52971 __ret_456; \
54648#define vmlal_high_laneq_s32(__p0_548, __p1_548, __p2_548, __p3_548) __extension__ ({ \
54649 int64x2_t __s0_548 = __p0_548; \
54650 int32x4_t __s1_548 = __p1_548; \
54651 int32x4_t __s2_548 = __p2_548; \
54652 int64x2_t __rev0_548; __rev0_548 = __builtin_shufflevector(__s0_548, __s0_548, 1, 0); \
54653 int32x4_t __rev1_548; __rev1_548 = __builtin_shufflevector(__s1_548, __s1_548, 3, 2, 1, 0); \
54654 int32x4_t __rev2_548; __rev2_548 = __builtin_shufflevector(__s2_548, __s2_548, 3, 2, 1, 0); \
54655 int64x2_t __ret_548; \
54656 __ret_548 = __rev0_548 + __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_548), __noswap_splat_laneq_s32(__rev2_548, __p3_548)); \
54657 __ret_548 = __builtin_shufflevector(__ret_548, __ret_548, 1, 0); \
54658 __ret_548; \
5297254659})
5297354660#endif
5297454661
5297554662#ifdef __LITTLE_ENDIAN__
52976#define vmlal_high_laneq_s16(__p0_457, __p1_457, __p2_457, __p3_457) __extension__ ({ \
52977 int32x4_t __s0_457 = __p0_457; \
52978 int16x8_t __s1_457 = __p1_457; \
52979 int16x8_t __s2_457 = __p2_457; \
52980 int32x4_t __ret_457; \
52981 __ret_457 = __s0_457 + vmull_s16(vget_high_s16(__s1_457), splat_laneq_s16(__s2_457, __p3_457)); \
52982 __ret_457; \
54663#define vmlal_high_laneq_s16(__p0_549, __p1_549, __p2_549, __p3_549) __extension__ ({ \
54664 int32x4_t __s0_549 = __p0_549; \
54665 int16x8_t __s1_549 = __p1_549; \
54666 int16x8_t __s2_549 = __p2_549; \
54667 int32x4_t __ret_549; \
54668 __ret_549 = __s0_549 + vmull_s16(vget_high_s16(__s1_549), splat_laneq_s16(__s2_549, __p3_549)); \
54669 __ret_549; \
5298354670})
5298454671#else
52985#define vmlal_high_laneq_s16(__p0_458, __p1_458, __p2_458, __p3_458) __extension__ ({ \
52986 int32x4_t __s0_458 = __p0_458; \
52987 int16x8_t __s1_458 = __p1_458; \
52988 int16x8_t __s2_458 = __p2_458; \
52989 int32x4_t __rev0_458; __rev0_458 = __builtin_shufflevector(__s0_458, __s0_458, 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); \
52991 int16x8_t __rev2_458; __rev2_458 = __builtin_shufflevector(__s2_458, __s2_458, 7, 6, 5, 4, 3, 2, 1, 0); \
52992 int32x4_t __ret_458; \
52993 __ret_458 = __rev0_458 + __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_458), __noswap_splat_laneq_s16(__rev2_458, __p3_458)); \
52994 __ret_458 = __builtin_shufflevector(__ret_458, __ret_458, 3, 2, 1, 0); \
52995 __ret_458; \
54672#define vmlal_high_laneq_s16(__p0_550, __p1_550, __p2_550, __p3_550) __extension__ ({ \
54673 int32x4_t __s0_550 = __p0_550; \
54674 int16x8_t __s1_550 = __p1_550; \
54675 int16x8_t __s2_550 = __p2_550; \
54676 int32x4_t __rev0_550; __rev0_550 = __builtin_shufflevector(__s0_550, __s0_550, 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); \
54678 int16x8_t __rev2_550; __rev2_550 = __builtin_shufflevector(__s2_550, __s2_550, 7, 6, 5, 4, 3, 2, 1, 0); \
54679 int32x4_t __ret_550; \
54680 __ret_550 = __rev0_550 + __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_550), __noswap_splat_laneq_s16(__rev2_550, __p3_550)); \
54681 __ret_550 = __builtin_shufflevector(__ret_550, __ret_550, 3, 2, 1, 0); \
54682 __ret_550; \
5299654683})
5299754684#endif
5299854685
5299954686#ifdef __LITTLE_ENDIAN__
53000#define vmlal_laneq_u32(__p0_459, __p1_459, __p2_459, __p3_459) __extension__ ({ \
53001 uint64x2_t __s0_459 = __p0_459; \
53002 uint32x2_t __s1_459 = __p1_459; \
53003 uint32x4_t __s2_459 = __p2_459; \
53004 uint64x2_t __ret_459; \
53005 __ret_459 = __s0_459 + vmull_u32(__s1_459, splat_laneq_u32(__s2_459, __p3_459)); \
53006 __ret_459; \
54687#define vmlal_laneq_u32(__p0_551, __p1_551, __p2_551, __p3_551) __extension__ ({ \
54688 uint64x2_t __s0_551 = __p0_551; \
54689 uint32x2_t __s1_551 = __p1_551; \
54690 uint32x4_t __s2_551 = __p2_551; \
54691 uint64x2_t __ret_551; \
54692 __ret_551 = __s0_551 + vmull_u32(__s1_551, splat_laneq_u32(__s2_551, __p3_551)); \
54693 __ret_551; \
5300754694})
5300854695#else
53009#define vmlal_laneq_u32(__p0_460, __p1_460, __p2_460, __p3_460) __extension__ ({ \
53010 uint64x2_t __s0_460 = __p0_460; \
53011 uint32x2_t __s1_460 = __p1_460; \
53012 uint32x4_t __s2_460 = __p2_460; \
53013 uint64x2_t __rev0_460; __rev0_460 = __builtin_shufflevector(__s0_460, __s0_460, 1, 0); \
53014 uint32x2_t __rev1_460; __rev1_460 = __builtin_shufflevector(__s1_460, __s1_460, 1, 0); \
53015 uint32x4_t __rev2_460; __rev2_460 = __builtin_shufflevector(__s2_460, __s2_460, 3, 2, 1, 0); \
53016 uint64x2_t __ret_460; \
53017 __ret_460 = __rev0_460 + __noswap_vmull_u32(__rev1_460, __noswap_splat_laneq_u32(__rev2_460, __p3_460)); \
53018 __ret_460 = __builtin_shufflevector(__ret_460, __ret_460, 1, 0); \
53019 __ret_460; \
54696#define vmlal_laneq_u32(__p0_552, __p1_552, __p2_552, __p3_552) __extension__ ({ \
54697 uint64x2_t __s0_552 = __p0_552; \
54698 uint32x2_t __s1_552 = __p1_552; \
54699 uint32x4_t __s2_552 = __p2_552; \
54700 uint64x2_t __rev0_552; __rev0_552 = __builtin_shufflevector(__s0_552, __s0_552, 1, 0); \
54701 uint32x2_t __rev1_552; __rev1_552 = __builtin_shufflevector(__s1_552, __s1_552, 1, 0); \
54702 uint32x4_t __rev2_552; __rev2_552 = __builtin_shufflevector(__s2_552, __s2_552, 3, 2, 1, 0); \
54703 uint64x2_t __ret_552; \
54704 __ret_552 = __rev0_552 + __noswap_vmull_u32(__rev1_552, __noswap_splat_laneq_u32(__rev2_552, __p3_552)); \
54705 __ret_552 = __builtin_shufflevector(__ret_552, __ret_552, 1, 0); \
54706 __ret_552; \
5302054707})
5302154708#endif
5302254709
5302354710#ifdef __LITTLE_ENDIAN__
53024#define vmlal_laneq_u16(__p0_461, __p1_461, __p2_461, __p3_461) __extension__ ({ \
53025 uint32x4_t __s0_461 = __p0_461; \
53026 uint16x4_t __s1_461 = __p1_461; \
53027 uint16x8_t __s2_461 = __p2_461; \
53028 uint32x4_t __ret_461; \
53029 __ret_461 = __s0_461 + vmull_u16(__s1_461, splat_laneq_u16(__s2_461, __p3_461)); \
53030 __ret_461; \
54711#define vmlal_laneq_u16(__p0_553, __p1_553, __p2_553, __p3_553) __extension__ ({ \
54712 uint32x4_t __s0_553 = __p0_553; \
54713 uint16x4_t __s1_553 = __p1_553; \
54714 uint16x8_t __s2_553 = __p2_553; \
54715 uint32x4_t __ret_553; \
54716 __ret_553 = __s0_553 + vmull_u16(__s1_553, splat_laneq_u16(__s2_553, __p3_553)); \
54717 __ret_553; \
5303154718})
5303254719#else
53033#define vmlal_laneq_u16(__p0_462, __p1_462, __p2_462, __p3_462) __extension__ ({ \
53034 uint32x4_t __s0_462 = __p0_462; \
53035 uint16x4_t __s1_462 = __p1_462; \
53036 uint16x8_t __s2_462 = __p2_462; \
53037 uint32x4_t __rev0_462; __rev0_462 = __builtin_shufflevector(__s0_462, __s0_462, 3, 2, 1, 0); \
53038 uint16x4_t __rev1_462; __rev1_462 = __builtin_shufflevector(__s1_462, __s1_462, 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); \
53040 uint32x4_t __ret_462; \
53041 __ret_462 = __rev0_462 + __noswap_vmull_u16(__rev1_462, __noswap_splat_laneq_u16(__rev2_462, __p3_462)); \
53042 __ret_462 = __builtin_shufflevector(__ret_462, __ret_462, 3, 2, 1, 0); \
53043 __ret_462; \
54720#define vmlal_laneq_u16(__p0_554, __p1_554, __p2_554, __p3_554) __extension__ ({ \
54721 uint32x4_t __s0_554 = __p0_554; \
54722 uint16x4_t __s1_554 = __p1_554; \
54723 uint16x8_t __s2_554 = __p2_554; \
54724 uint32x4_t __rev0_554; __rev0_554 = __builtin_shufflevector(__s0_554, __s0_554, 3, 2, 1, 0); \
54725 uint16x4_t __rev1_554; __rev1_554 = __builtin_shufflevector(__s1_554, __s1_554, 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); \
54727 uint32x4_t __ret_554; \
54728 __ret_554 = __rev0_554 + __noswap_vmull_u16(__rev1_554, __noswap_splat_laneq_u16(__rev2_554, __p3_554)); \
54729 __ret_554 = __builtin_shufflevector(__ret_554, __ret_554, 3, 2, 1, 0); \
54730 __ret_554; \
5304454731})
5304554732#endif
5304654733
5304754734#ifdef __LITTLE_ENDIAN__
53048#define vmlal_laneq_s32(__p0_463, __p1_463, __p2_463, __p3_463) __extension__ ({ \
53049 int64x2_t __s0_463 = __p0_463; \
53050 int32x2_t __s1_463 = __p1_463; \
53051 int32x4_t __s2_463 = __p2_463; \
53052 int64x2_t __ret_463; \
53053 __ret_463 = __s0_463 + vmull_s32(__s1_463, splat_laneq_s32(__s2_463, __p3_463)); \
53054 __ret_463; \
54735#define vmlal_laneq_s32(__p0_555, __p1_555, __p2_555, __p3_555) __extension__ ({ \
54736 int64x2_t __s0_555 = __p0_555; \
54737 int32x2_t __s1_555 = __p1_555; \
54738 int32x4_t __s2_555 = __p2_555; \
54739 int64x2_t __ret_555; \
54740 __ret_555 = __s0_555 + vmull_s32(__s1_555, splat_laneq_s32(__s2_555, __p3_555)); \
54741 __ret_555; \
5305554742})
5305654743#else
53057#define vmlal_laneq_s32(__p0_464, __p1_464, __p2_464, __p3_464) __extension__ ({ \
53058 int64x2_t __s0_464 = __p0_464; \
53059 int32x2_t __s1_464 = __p1_464; \
53060 int32x4_t __s2_464 = __p2_464; \
53061 int64x2_t __rev0_464; __rev0_464 = __builtin_shufflevector(__s0_464, __s0_464, 1, 0); \
53062 int32x2_t __rev1_464; __rev1_464 = __builtin_shufflevector(__s1_464, __s1_464, 1, 0); \
53063 int32x4_t __rev2_464; __rev2_464 = __builtin_shufflevector(__s2_464, __s2_464, 3, 2, 1, 0); \
53064 int64x2_t __ret_464; \
53065 __ret_464 = __rev0_464 + __noswap_vmull_s32(__rev1_464, __noswap_splat_laneq_s32(__rev2_464, __p3_464)); \
53066 __ret_464 = __builtin_shufflevector(__ret_464, __ret_464, 1, 0); \
53067 __ret_464; \
54744#define vmlal_laneq_s32(__p0_556, __p1_556, __p2_556, __p3_556) __extension__ ({ \
54745 int64x2_t __s0_556 = __p0_556; \
54746 int32x2_t __s1_556 = __p1_556; \
54747 int32x4_t __s2_556 = __p2_556; \
54748 int64x2_t __rev0_556; __rev0_556 = __builtin_shufflevector(__s0_556, __s0_556, 1, 0); \
54749 int32x2_t __rev1_556; __rev1_556 = __builtin_shufflevector(__s1_556, __s1_556, 1, 0); \
54750 int32x4_t __rev2_556; __rev2_556 = __builtin_shufflevector(__s2_556, __s2_556, 3, 2, 1, 0); \
54751 int64x2_t __ret_556; \
54752 __ret_556 = __rev0_556 + __noswap_vmull_s32(__rev1_556, __noswap_splat_laneq_s32(__rev2_556, __p3_556)); \
54753 __ret_556 = __builtin_shufflevector(__ret_556, __ret_556, 1, 0); \
54754 __ret_556; \
5306854755})
5306954756#endif
5307054757
5307154758#ifdef __LITTLE_ENDIAN__
53072#define vmlal_laneq_s16(__p0_465, __p1_465, __p2_465, __p3_465) __extension__ ({ \
53073 int32x4_t __s0_465 = __p0_465; \
53074 int16x4_t __s1_465 = __p1_465; \
53075 int16x8_t __s2_465 = __p2_465; \
53076 int32x4_t __ret_465; \
53077 __ret_465 = __s0_465 + vmull_s16(__s1_465, splat_laneq_s16(__s2_465, __p3_465)); \
53078 __ret_465; \
54759#define vmlal_laneq_s16(__p0_557, __p1_557, __p2_557, __p3_557) __extension__ ({ \
54760 int32x4_t __s0_557 = __p0_557; \
54761 int16x4_t __s1_557 = __p1_557; \
54762 int16x8_t __s2_557 = __p2_557; \
54763 int32x4_t __ret_557; \
54764 __ret_557 = __s0_557 + vmull_s16(__s1_557, splat_laneq_s16(__s2_557, __p3_557)); \
54765 __ret_557; \
5307954766})
5308054767#else
53081#define vmlal_laneq_s16(__p0_466, __p1_466, __p2_466, __p3_466) __extension__ ({ \
53082 int32x4_t __s0_466 = __p0_466; \
53083 int16x4_t __s1_466 = __p1_466; \
53084 int16x8_t __s2_466 = __p2_466; \
53085 int32x4_t __rev0_466; __rev0_466 = __builtin_shufflevector(__s0_466, __s0_466, 3, 2, 1, 0); \
53086 int16x4_t __rev1_466; __rev1_466 = __builtin_shufflevector(__s1_466, __s1_466, 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); \
53088 int32x4_t __ret_466; \
53089 __ret_466 = __rev0_466 + __noswap_vmull_s16(__rev1_466, __noswap_splat_laneq_s16(__rev2_466, __p3_466)); \
53090 __ret_466 = __builtin_shufflevector(__ret_466, __ret_466, 3, 2, 1, 0); \
53091 __ret_466; \
54768#define vmlal_laneq_s16(__p0_558, __p1_558, __p2_558, __p3_558) __extension__ ({ \
54769 int32x4_t __s0_558 = __p0_558; \
54770 int16x4_t __s1_558 = __p1_558; \
54771 int16x8_t __s2_558 = __p2_558; \
54772 int32x4_t __rev0_558; __rev0_558 = __builtin_shufflevector(__s0_558, __s0_558, 3, 2, 1, 0); \
54773 int16x4_t __rev1_558; __rev1_558 = __builtin_shufflevector(__s1_558, __s1_558, 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); \
54775 int32x4_t __ret_558; \
54776 __ret_558 = __rev0_558 + __noswap_vmull_s16(__rev1_558, __noswap_splat_laneq_s16(__rev2_558, __p3_558)); \
54777 __ret_558 = __builtin_shufflevector(__ret_558, __ret_558, 3, 2, 1, 0); \
54778 __ret_558; \
5309254779})
5309354780#endif
5309454781
......@@ -53116,547 +54803,530 @@ __ai float64x1_t vmls_f64(float64x1_t __p0, float64x1_t __p1, float64x1_t __p2)
5311654803 return __ret;
5311754804}
5311854805#ifdef __LITTLE_ENDIAN__
53119#define vmlsq_laneq_u32(__p0_467, __p1_467, __p2_467, __p3_467) __extension__ ({ \
53120 uint32x4_t __s0_467 = __p0_467; \
53121 uint32x4_t __s1_467 = __p1_467; \
53122 uint32x4_t __s2_467 = __p2_467; \
53123 uint32x4_t __ret_467; \
53124 __ret_467 = __s0_467 - __s1_467 * splatq_laneq_u32(__s2_467, __p3_467); \
53125 __ret_467; \
54806#define vmlsq_laneq_u32(__p0_559, __p1_559, __p2_559, __p3_559) __extension__ ({ \
54807 uint32x4_t __s0_559 = __p0_559; \
54808 uint32x4_t __s1_559 = __p1_559; \
54809 uint32x4_t __s2_559 = __p2_559; \
54810 uint32x4_t __ret_559; \
54811 __ret_559 = __s0_559 - __s1_559 * splatq_laneq_u32(__s2_559, __p3_559); \
54812 __ret_559; \
5312654813})
5312754814#else
53128#define vmlsq_laneq_u32(__p0_468, __p1_468, __p2_468, __p3_468) __extension__ ({ \
53129 uint32x4_t __s0_468 = __p0_468; \
53130 uint32x4_t __s1_468 = __p1_468; \
53131 uint32x4_t __s2_468 = __p2_468; \
53132 uint32x4_t __rev0_468; __rev0_468 = __builtin_shufflevector(__s0_468, __s0_468, 3, 2, 1, 0); \
53133 uint32x4_t __rev1_468; __rev1_468 = __builtin_shufflevector(__s1_468, __s1_468, 3, 2, 1, 0); \
53134 uint32x4_t __rev2_468; __rev2_468 = __builtin_shufflevector(__s2_468, __s2_468, 3, 2, 1, 0); \
53135 uint32x4_t __ret_468; \
53136 __ret_468 = __rev0_468 - __rev1_468 * __noswap_splatq_laneq_u32(__rev2_468, __p3_468); \
53137 __ret_468 = __builtin_shufflevector(__ret_468, __ret_468, 3, 2, 1, 0); \
53138 __ret_468; \
54815#define vmlsq_laneq_u32(__p0_560, __p1_560, __p2_560, __p3_560) __extension__ ({ \
54816 uint32x4_t __s0_560 = __p0_560; \
54817 uint32x4_t __s1_560 = __p1_560; \
54818 uint32x4_t __s2_560 = __p2_560; \
54819 uint32x4_t __rev0_560; __rev0_560 = __builtin_shufflevector(__s0_560, __s0_560, 3, 2, 1, 0); \
54820 uint32x4_t __rev1_560; __rev1_560 = __builtin_shufflevector(__s1_560, __s1_560, 3, 2, 1, 0); \
54821 uint32x4_t __rev2_560; __rev2_560 = __builtin_shufflevector(__s2_560, __s2_560, 3, 2, 1, 0); \
54822 uint32x4_t __ret_560; \
54823 __ret_560 = __rev0_560 - __rev1_560 * __noswap_splatq_laneq_u32(__rev2_560, __p3_560); \
54824 __ret_560 = __builtin_shufflevector(__ret_560, __ret_560, 3, 2, 1, 0); \
54825 __ret_560; \
5313954826})
5314054827#endif
5314154828
5314254829#ifdef __LITTLE_ENDIAN__
53143#define vmlsq_laneq_u16(__p0_469, __p1_469, __p2_469, __p3_469) __extension__ ({ \
53144 uint16x8_t __s0_469 = __p0_469; \
53145 uint16x8_t __s1_469 = __p1_469; \
53146 uint16x8_t __s2_469 = __p2_469; \
53147 uint16x8_t __ret_469; \
53148 __ret_469 = __s0_469 - __s1_469 * splatq_laneq_u16(__s2_469, __p3_469); \
53149 __ret_469; \
54830#define vmlsq_laneq_u16(__p0_561, __p1_561, __p2_561, __p3_561) __extension__ ({ \
54831 uint16x8_t __s0_561 = __p0_561; \
54832 uint16x8_t __s1_561 = __p1_561; \
54833 uint16x8_t __s2_561 = __p2_561; \
54834 uint16x8_t __ret_561; \
54835 __ret_561 = __s0_561 - __s1_561 * splatq_laneq_u16(__s2_561, __p3_561); \
54836 __ret_561; \
5315054837})
5315154838#else
53152#define vmlsq_laneq_u16(__p0_470, __p1_470, __p2_470, __p3_470) __extension__ ({ \
53153 uint16x8_t __s0_470 = __p0_470; \
53154 uint16x8_t __s1_470 = __p1_470; \
53155 uint16x8_t __s2_470 = __p2_470; \
53156 uint16x8_t __rev0_470; __rev0_470 = __builtin_shufflevector(__s0_470, __s0_470, 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); \
53158 uint16x8_t __rev2_470; __rev2_470 = __builtin_shufflevector(__s2_470, __s2_470, 7, 6, 5, 4, 3, 2, 1, 0); \
53159 uint16x8_t __ret_470; \
53160 __ret_470 = __rev0_470 - __rev1_470 * __noswap_splatq_laneq_u16(__rev2_470, __p3_470); \
53161 __ret_470 = __builtin_shufflevector(__ret_470, __ret_470, 7, 6, 5, 4, 3, 2, 1, 0); \
53162 __ret_470; \
54839#define vmlsq_laneq_u16(__p0_562, __p1_562, __p2_562, __p3_562) __extension__ ({ \
54840 uint16x8_t __s0_562 = __p0_562; \
54841 uint16x8_t __s1_562 = __p1_562; \
54842 uint16x8_t __s2_562 = __p2_562; \
54843 uint16x8_t __rev0_562; __rev0_562 = __builtin_shufflevector(__s0_562, __s0_562, 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); \
54845 uint16x8_t __rev2_562; __rev2_562 = __builtin_shufflevector(__s2_562, __s2_562, 7, 6, 5, 4, 3, 2, 1, 0); \
54846 uint16x8_t __ret_562; \
54847 __ret_562 = __rev0_562 - __rev1_562 * __noswap_splatq_laneq_u16(__rev2_562, __p3_562); \
54848 __ret_562 = __builtin_shufflevector(__ret_562, __ret_562, 7, 6, 5, 4, 3, 2, 1, 0); \
54849 __ret_562; \
5316354850})
5316454851#endif
5316554852
5316654853#ifdef __LITTLE_ENDIAN__
53167#define vmlsq_laneq_f32(__p0_471, __p1_471, __p2_471, __p3_471) __extension__ ({ \
53168 float32x4_t __s0_471 = __p0_471; \
53169 float32x4_t __s1_471 = __p1_471; \
53170 float32x4_t __s2_471 = __p2_471; \
53171 float32x4_t __ret_471; \
53172 __ret_471 = __s0_471 - __s1_471 * splatq_laneq_f32(__s2_471, __p3_471); \
53173 __ret_471; \
54854#define vmlsq_laneq_f32(__p0_563, __p1_563, __p2_563, __p3_563) __extension__ ({ \
54855 float32x4_t __s0_563 = __p0_563; \
54856 float32x4_t __s1_563 = __p1_563; \
54857 float32x4_t __s2_563 = __p2_563; \
54858 float32x4_t __ret_563; \
54859 __ret_563 = __s0_563 - __s1_563 * splatq_laneq_f32(__s2_563, __p3_563); \
54860 __ret_563; \
5317454861})
5317554862#else
53176#define vmlsq_laneq_f32(__p0_472, __p1_472, __p2_472, __p3_472) __extension__ ({ \
53177 float32x4_t __s0_472 = __p0_472; \
53178 float32x4_t __s1_472 = __p1_472; \
53179 float32x4_t __s2_472 = __p2_472; \
53180 float32x4_t __rev0_472; __rev0_472 = __builtin_shufflevector(__s0_472, __s0_472, 3, 2, 1, 0); \
53181 float32x4_t __rev1_472; __rev1_472 = __builtin_shufflevector(__s1_472, __s1_472, 3, 2, 1, 0); \
53182 float32x4_t __rev2_472; __rev2_472 = __builtin_shufflevector(__s2_472, __s2_472, 3, 2, 1, 0); \
53183 float32x4_t __ret_472; \
53184 __ret_472 = __rev0_472 - __rev1_472 * __noswap_splatq_laneq_f32(__rev2_472, __p3_472); \
53185 __ret_472 = __builtin_shufflevector(__ret_472, __ret_472, 3, 2, 1, 0); \
53186 __ret_472; \
54863#define vmlsq_laneq_f32(__p0_564, __p1_564, __p2_564, __p3_564) __extension__ ({ \
54864 float32x4_t __s0_564 = __p0_564; \
54865 float32x4_t __s1_564 = __p1_564; \
54866 float32x4_t __s2_564 = __p2_564; \
54867 float32x4_t __rev0_564; __rev0_564 = __builtin_shufflevector(__s0_564, __s0_564, 3, 2, 1, 0); \
54868 float32x4_t __rev1_564; __rev1_564 = __builtin_shufflevector(__s1_564, __s1_564, 3, 2, 1, 0); \
54869 float32x4_t __rev2_564; __rev2_564 = __builtin_shufflevector(__s2_564, __s2_564, 3, 2, 1, 0); \
54870 float32x4_t __ret_564; \
54871 __ret_564 = __rev0_564 - __rev1_564 * __noswap_splatq_laneq_f32(__rev2_564, __p3_564); \
54872 __ret_564 = __builtin_shufflevector(__ret_564, __ret_564, 3, 2, 1, 0); \
54873 __ret_564; \
5318754874})
5318854875#endif
5318954876
5319054877#ifdef __LITTLE_ENDIAN__
53191#define vmlsq_laneq_s32(__p0_473, __p1_473, __p2_473, __p3_473) __extension__ ({ \
53192 int32x4_t __s0_473 = __p0_473; \
53193 int32x4_t __s1_473 = __p1_473; \
53194 int32x4_t __s2_473 = __p2_473; \
53195 int32x4_t __ret_473; \
53196 __ret_473 = __s0_473 - __s1_473 * splatq_laneq_s32(__s2_473, __p3_473); \
53197 __ret_473; \
54878#define vmlsq_laneq_s32(__p0_565, __p1_565, __p2_565, __p3_565) __extension__ ({ \
54879 int32x4_t __s0_565 = __p0_565; \
54880 int32x4_t __s1_565 = __p1_565; \
54881 int32x4_t __s2_565 = __p2_565; \
54882 int32x4_t __ret_565; \
54883 __ret_565 = __s0_565 - __s1_565 * splatq_laneq_s32(__s2_565, __p3_565); \
54884 __ret_565; \
5319854885})
5319954886#else
53200#define vmlsq_laneq_s32(__p0_474, __p1_474, __p2_474, __p3_474) __extension__ ({ \
53201 int32x4_t __s0_474 = __p0_474; \
53202 int32x4_t __s1_474 = __p1_474; \
53203 int32x4_t __s2_474 = __p2_474; \
53204 int32x4_t __rev0_474; __rev0_474 = __builtin_shufflevector(__s0_474, __s0_474, 3, 2, 1, 0); \
53205 int32x4_t __rev1_474; __rev1_474 = __builtin_shufflevector(__s1_474, __s1_474, 3, 2, 1, 0); \
53206 int32x4_t __rev2_474; __rev2_474 = __builtin_shufflevector(__s2_474, __s2_474, 3, 2, 1, 0); \
53207 int32x4_t __ret_474; \
53208 __ret_474 = __rev0_474 - __rev1_474 * __noswap_splatq_laneq_s32(__rev2_474, __p3_474); \
53209 __ret_474 = __builtin_shufflevector(__ret_474, __ret_474, 3, 2, 1, 0); \
53210 __ret_474; \
54887#define vmlsq_laneq_s32(__p0_566, __p1_566, __p2_566, __p3_566) __extension__ ({ \
54888 int32x4_t __s0_566 = __p0_566; \
54889 int32x4_t __s1_566 = __p1_566; \
54890 int32x4_t __s2_566 = __p2_566; \
54891 int32x4_t __rev0_566; __rev0_566 = __builtin_shufflevector(__s0_566, __s0_566, 3, 2, 1, 0); \
54892 int32x4_t __rev1_566; __rev1_566 = __builtin_shufflevector(__s1_566, __s1_566, 3, 2, 1, 0); \
54893 int32x4_t __rev2_566; __rev2_566 = __builtin_shufflevector(__s2_566, __s2_566, 3, 2, 1, 0); \
54894 int32x4_t __ret_566; \
54895 __ret_566 = __rev0_566 - __rev1_566 * __noswap_splatq_laneq_s32(__rev2_566, __p3_566); \
54896 __ret_566 = __builtin_shufflevector(__ret_566, __ret_566, 3, 2, 1, 0); \
54897 __ret_566; \
5321154898})
5321254899#endif
5321354900
5321454901#ifdef __LITTLE_ENDIAN__
53215#define vmlsq_laneq_s16(__p0_475, __p1_475, __p2_475, __p3_475) __extension__ ({ \
53216 int16x8_t __s0_475 = __p0_475; \
53217 int16x8_t __s1_475 = __p1_475; \
53218 int16x8_t __s2_475 = __p2_475; \
53219 int16x8_t __ret_475; \
53220 __ret_475 = __s0_475 - __s1_475 * splatq_laneq_s16(__s2_475, __p3_475); \
53221 __ret_475; \
54902#define vmlsq_laneq_s16(__p0_567, __p1_567, __p2_567, __p3_567) __extension__ ({ \
54903 int16x8_t __s0_567 = __p0_567; \
54904 int16x8_t __s1_567 = __p1_567; \
54905 int16x8_t __s2_567 = __p2_567; \
54906 int16x8_t __ret_567; \
54907 __ret_567 = __s0_567 - __s1_567 * splatq_laneq_s16(__s2_567, __p3_567); \
54908 __ret_567; \
5322254909})
5322354910#else
53224#define vmlsq_laneq_s16(__p0_476, __p1_476, __p2_476, __p3_476) __extension__ ({ \
53225 int16x8_t __s0_476 = __p0_476; \
53226 int16x8_t __s1_476 = __p1_476; \
53227 int16x8_t __s2_476 = __p2_476; \
53228 int16x8_t __rev0_476; __rev0_476 = __builtin_shufflevector(__s0_476, __s0_476, 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); \
53230 int16x8_t __rev2_476; __rev2_476 = __builtin_shufflevector(__s2_476, __s2_476, 7, 6, 5, 4, 3, 2, 1, 0); \
53231 int16x8_t __ret_476; \
53232 __ret_476 = __rev0_476 - __rev1_476 * __noswap_splatq_laneq_s16(__rev2_476, __p3_476); \
53233 __ret_476 = __builtin_shufflevector(__ret_476, __ret_476, 7, 6, 5, 4, 3, 2, 1, 0); \
53234 __ret_476; \
54911#define vmlsq_laneq_s16(__p0_568, __p1_568, __p2_568, __p3_568) __extension__ ({ \
54912 int16x8_t __s0_568 = __p0_568; \
54913 int16x8_t __s1_568 = __p1_568; \
54914 int16x8_t __s2_568 = __p2_568; \
54915 int16x8_t __rev0_568; __rev0_568 = __builtin_shufflevector(__s0_568, __s0_568, 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); \
54917 int16x8_t __rev2_568; __rev2_568 = __builtin_shufflevector(__s2_568, __s2_568, 7, 6, 5, 4, 3, 2, 1, 0); \
54918 int16x8_t __ret_568; \
54919 __ret_568 = __rev0_568 - __rev1_568 * __noswap_splatq_laneq_s16(__rev2_568, __p3_568); \
54920 __ret_568 = __builtin_shufflevector(__ret_568, __ret_568, 7, 6, 5, 4, 3, 2, 1, 0); \
54921 __ret_568; \
5323554922})
5323654923#endif
5323754924
5323854925#ifdef __LITTLE_ENDIAN__
53239#define vmls_laneq_u32(__p0_477, __p1_477, __p2_477, __p3_477) __extension__ ({ \
53240 uint32x2_t __s0_477 = __p0_477; \
53241 uint32x2_t __s1_477 = __p1_477; \
53242 uint32x4_t __s2_477 = __p2_477; \
53243 uint32x2_t __ret_477; \
53244 __ret_477 = __s0_477 - __s1_477 * splat_laneq_u32(__s2_477, __p3_477); \
53245 __ret_477; \
54926#define vmls_laneq_u32(__p0_569, __p1_569, __p2_569, __p3_569) __extension__ ({ \
54927 uint32x2_t __s0_569 = __p0_569; \
54928 uint32x2_t __s1_569 = __p1_569; \
54929 uint32x4_t __s2_569 = __p2_569; \
54930 uint32x2_t __ret_569; \
54931 __ret_569 = __s0_569 - __s1_569 * splat_laneq_u32(__s2_569, __p3_569); \
54932 __ret_569; \
5324654933})
5324754934#else
53248#define vmls_laneq_u32(__p0_478, __p1_478, __p2_478, __p3_478) __extension__ ({ \
53249 uint32x2_t __s0_478 = __p0_478; \
53250 uint32x2_t __s1_478 = __p1_478; \
53251 uint32x4_t __s2_478 = __p2_478; \
53252 uint32x2_t __rev0_478; __rev0_478 = __builtin_shufflevector(__s0_478, __s0_478, 1, 0); \
53253 uint32x2_t __rev1_478; __rev1_478 = __builtin_shufflevector(__s1_478, __s1_478, 1, 0); \
53254 uint32x4_t __rev2_478; __rev2_478 = __builtin_shufflevector(__s2_478, __s2_478, 3, 2, 1, 0); \
53255 uint32x2_t __ret_478; \
53256 __ret_478 = __rev0_478 - __rev1_478 * __noswap_splat_laneq_u32(__rev2_478, __p3_478); \
53257 __ret_478 = __builtin_shufflevector(__ret_478, __ret_478, 1, 0); \
53258 __ret_478; \
54935#define vmls_laneq_u32(__p0_570, __p1_570, __p2_570, __p3_570) __extension__ ({ \
54936 uint32x2_t __s0_570 = __p0_570; \
54937 uint32x2_t __s1_570 = __p1_570; \
54938 uint32x4_t __s2_570 = __p2_570; \
54939 uint32x2_t __rev0_570; __rev0_570 = __builtin_shufflevector(__s0_570, __s0_570, 1, 0); \
54940 uint32x2_t __rev1_570; __rev1_570 = __builtin_shufflevector(__s1_570, __s1_570, 1, 0); \
54941 uint32x4_t __rev2_570; __rev2_570 = __builtin_shufflevector(__s2_570, __s2_570, 3, 2, 1, 0); \
54942 uint32x2_t __ret_570; \
54943 __ret_570 = __rev0_570 - __rev1_570 * __noswap_splat_laneq_u32(__rev2_570, __p3_570); \
54944 __ret_570 = __builtin_shufflevector(__ret_570, __ret_570, 1, 0); \
54945 __ret_570; \
5325954946})
5326054947#endif
5326154948
5326254949#ifdef __LITTLE_ENDIAN__
53263#define vmls_laneq_u16(__p0_479, __p1_479, __p2_479, __p3_479) __extension__ ({ \
53264 uint16x4_t __s0_479 = __p0_479; \
53265 uint16x4_t __s1_479 = __p1_479; \
53266 uint16x8_t __s2_479 = __p2_479; \
53267 uint16x4_t __ret_479; \
53268 __ret_479 = __s0_479 - __s1_479 * splat_laneq_u16(__s2_479, __p3_479); \
53269 __ret_479; \
54950#define vmls_laneq_u16(__p0_571, __p1_571, __p2_571, __p3_571) __extension__ ({ \
54951 uint16x4_t __s0_571 = __p0_571; \
54952 uint16x4_t __s1_571 = __p1_571; \
54953 uint16x8_t __s2_571 = __p2_571; \
54954 uint16x4_t __ret_571; \
54955 __ret_571 = __s0_571 - __s1_571 * splat_laneq_u16(__s2_571, __p3_571); \
54956 __ret_571; \
5327054957})
5327154958#else
53272#define vmls_laneq_u16(__p0_480, __p1_480, __p2_480, __p3_480) __extension__ ({ \
53273 uint16x4_t __s0_480 = __p0_480; \
53274 uint16x4_t __s1_480 = __p1_480; \
53275 uint16x8_t __s2_480 = __p2_480; \
53276 uint16x4_t __rev0_480; __rev0_480 = __builtin_shufflevector(__s0_480, __s0_480, 3, 2, 1, 0); \
53277 uint16x4_t __rev1_480; __rev1_480 = __builtin_shufflevector(__s1_480, __s1_480, 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); \
53279 uint16x4_t __ret_480; \
53280 __ret_480 = __rev0_480 - __rev1_480 * __noswap_splat_laneq_u16(__rev2_480, __p3_480); \
53281 __ret_480 = __builtin_shufflevector(__ret_480, __ret_480, 3, 2, 1, 0); \
53282 __ret_480; \
54959#define vmls_laneq_u16(__p0_572, __p1_572, __p2_572, __p3_572) __extension__ ({ \
54960 uint16x4_t __s0_572 = __p0_572; \
54961 uint16x4_t __s1_572 = __p1_572; \
54962 uint16x8_t __s2_572 = __p2_572; \
54963 uint16x4_t __rev0_572; __rev0_572 = __builtin_shufflevector(__s0_572, __s0_572, 3, 2, 1, 0); \
54964 uint16x4_t __rev1_572; __rev1_572 = __builtin_shufflevector(__s1_572, __s1_572, 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); \
54966 uint16x4_t __ret_572; \
54967 __ret_572 = __rev0_572 - __rev1_572 * __noswap_splat_laneq_u16(__rev2_572, __p3_572); \
54968 __ret_572 = __builtin_shufflevector(__ret_572, __ret_572, 3, 2, 1, 0); \
54969 __ret_572; \
5328354970})
5328454971#endif
5328554972
5328654973#ifdef __LITTLE_ENDIAN__
53287#define vmls_laneq_f32(__p0_481, __p1_481, __p2_481, __p3_481) __extension__ ({ \
53288 float32x2_t __s0_481 = __p0_481; \
53289 float32x2_t __s1_481 = __p1_481; \
53290 float32x4_t __s2_481 = __p2_481; \
53291 float32x2_t __ret_481; \
53292 __ret_481 = __s0_481 - __s1_481 * splat_laneq_f32(__s2_481, __p3_481); \
53293 __ret_481; \
54974#define vmls_laneq_f32(__p0_573, __p1_573, __p2_573, __p3_573) __extension__ ({ \
54975 float32x2_t __s0_573 = __p0_573; \
54976 float32x2_t __s1_573 = __p1_573; \
54977 float32x4_t __s2_573 = __p2_573; \
54978 float32x2_t __ret_573; \
54979 __ret_573 = __s0_573 - __s1_573 * splat_laneq_f32(__s2_573, __p3_573); \
54980 __ret_573; \
5329454981})
5329554982#else
53296#define vmls_laneq_f32(__p0_482, __p1_482, __p2_482, __p3_482) __extension__ ({ \
53297 float32x2_t __s0_482 = __p0_482; \
53298 float32x2_t __s1_482 = __p1_482; \
53299 float32x4_t __s2_482 = __p2_482; \
53300 float32x2_t __rev0_482; __rev0_482 = __builtin_shufflevector(__s0_482, __s0_482, 1, 0); \
53301 float32x2_t __rev1_482; __rev1_482 = __builtin_shufflevector(__s1_482, __s1_482, 1, 0); \
53302 float32x4_t __rev2_482; __rev2_482 = __builtin_shufflevector(__s2_482, __s2_482, 3, 2, 1, 0); \
53303 float32x2_t __ret_482; \
53304 __ret_482 = __rev0_482 - __rev1_482 * __noswap_splat_laneq_f32(__rev2_482, __p3_482); \
53305 __ret_482 = __builtin_shufflevector(__ret_482, __ret_482, 1, 0); \
53306 __ret_482; \
54983#define vmls_laneq_f32(__p0_574, __p1_574, __p2_574, __p3_574) __extension__ ({ \
54984 float32x2_t __s0_574 = __p0_574; \
54985 float32x2_t __s1_574 = __p1_574; \
54986 float32x4_t __s2_574 = __p2_574; \
54987 float32x2_t __rev0_574; __rev0_574 = __builtin_shufflevector(__s0_574, __s0_574, 1, 0); \
54988 float32x2_t __rev1_574; __rev1_574 = __builtin_shufflevector(__s1_574, __s1_574, 1, 0); \
54989 float32x4_t __rev2_574; __rev2_574 = __builtin_shufflevector(__s2_574, __s2_574, 3, 2, 1, 0); \
54990 float32x2_t __ret_574; \
54991 __ret_574 = __rev0_574 - __rev1_574 * __noswap_splat_laneq_f32(__rev2_574, __p3_574); \
54992 __ret_574 = __builtin_shufflevector(__ret_574, __ret_574, 1, 0); \
54993 __ret_574; \
5330754994})
5330854995#endif
5330954996
5331054997#ifdef __LITTLE_ENDIAN__
53311#define vmls_laneq_s32(__p0_483, __p1_483, __p2_483, __p3_483) __extension__ ({ \
53312 int32x2_t __s0_483 = __p0_483; \
53313 int32x2_t __s1_483 = __p1_483; \
53314 int32x4_t __s2_483 = __p2_483; \
53315 int32x2_t __ret_483; \
53316 __ret_483 = __s0_483 - __s1_483 * splat_laneq_s32(__s2_483, __p3_483); \
53317 __ret_483; \
54998#define vmls_laneq_s32(__p0_575, __p1_575, __p2_575, __p3_575) __extension__ ({ \
54999 int32x2_t __s0_575 = __p0_575; \
55000 int32x2_t __s1_575 = __p1_575; \
55001 int32x4_t __s2_575 = __p2_575; \
55002 int32x2_t __ret_575; \
55003 __ret_575 = __s0_575 - __s1_575 * splat_laneq_s32(__s2_575, __p3_575); \
55004 __ret_575; \
5331855005})
5331955006#else
53320#define vmls_laneq_s32(__p0_484, __p1_484, __p2_484, __p3_484) __extension__ ({ \
53321 int32x2_t __s0_484 = __p0_484; \
53322 int32x2_t __s1_484 = __p1_484; \
53323 int32x4_t __s2_484 = __p2_484; \
53324 int32x2_t __rev0_484; __rev0_484 = __builtin_shufflevector(__s0_484, __s0_484, 1, 0); \
53325 int32x2_t __rev1_484; __rev1_484 = __builtin_shufflevector(__s1_484, __s1_484, 1, 0); \
53326 int32x4_t __rev2_484; __rev2_484 = __builtin_shufflevector(__s2_484, __s2_484, 3, 2, 1, 0); \
53327 int32x2_t __ret_484; \
53328 __ret_484 = __rev0_484 - __rev1_484 * __noswap_splat_laneq_s32(__rev2_484, __p3_484); \
53329 __ret_484 = __builtin_shufflevector(__ret_484, __ret_484, 1, 0); \
53330 __ret_484; \
55007#define vmls_laneq_s32(__p0_576, __p1_576, __p2_576, __p3_576) __extension__ ({ \
55008 int32x2_t __s0_576 = __p0_576; \
55009 int32x2_t __s1_576 = __p1_576; \
55010 int32x4_t __s2_576 = __p2_576; \
55011 int32x2_t __rev0_576; __rev0_576 = __builtin_shufflevector(__s0_576, __s0_576, 1, 0); \
55012 int32x2_t __rev1_576; __rev1_576 = __builtin_shufflevector(__s1_576, __s1_576, 1, 0); \
55013 int32x4_t __rev2_576; __rev2_576 = __builtin_shufflevector(__s2_576, __s2_576, 3, 2, 1, 0); \
55014 int32x2_t __ret_576; \
55015 __ret_576 = __rev0_576 - __rev1_576 * __noswap_splat_laneq_s32(__rev2_576, __p3_576); \
55016 __ret_576 = __builtin_shufflevector(__ret_576, __ret_576, 1, 0); \
55017 __ret_576; \
5333155018})
5333255019#endif
5333355020
5333455021#ifdef __LITTLE_ENDIAN__
53335#define vmls_laneq_s16(__p0_485, __p1_485, __p2_485, __p3_485) __extension__ ({ \
53336 int16x4_t __s0_485 = __p0_485; \
53337 int16x4_t __s1_485 = __p1_485; \
53338 int16x8_t __s2_485 = __p2_485; \
53339 int16x4_t __ret_485; \
53340 __ret_485 = __s0_485 - __s1_485 * splat_laneq_s16(__s2_485, __p3_485); \
53341 __ret_485; \
55022#define vmls_laneq_s16(__p0_577, __p1_577, __p2_577, __p3_577) __extension__ ({ \
55023 int16x4_t __s0_577 = __p0_577; \
55024 int16x4_t __s1_577 = __p1_577; \
55025 int16x8_t __s2_577 = __p2_577; \
55026 int16x4_t __ret_577; \
55027 __ret_577 = __s0_577 - __s1_577 * splat_laneq_s16(__s2_577, __p3_577); \
55028 __ret_577; \
5334255029})
5334355030#else
53344#define vmls_laneq_s16(__p0_486, __p1_486, __p2_486, __p3_486) __extension__ ({ \
53345 int16x4_t __s0_486 = __p0_486; \
53346 int16x4_t __s1_486 = __p1_486; \
53347 int16x8_t __s2_486 = __p2_486; \
53348 int16x4_t __rev0_486; __rev0_486 = __builtin_shufflevector(__s0_486, __s0_486, 3, 2, 1, 0); \
53349 int16x4_t __rev1_486; __rev1_486 = __builtin_shufflevector(__s1_486, __s1_486, 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); \
53351 int16x4_t __ret_486; \
53352 __ret_486 = __rev0_486 - __rev1_486 * __noswap_splat_laneq_s16(__rev2_486, __p3_486); \
53353 __ret_486 = __builtin_shufflevector(__ret_486, __ret_486, 3, 2, 1, 0); \
53354 __ret_486; \
55031#define vmls_laneq_s16(__p0_578, __p1_578, __p2_578, __p3_578) __extension__ ({ \
55032 int16x4_t __s0_578 = __p0_578; \
55033 int16x4_t __s1_578 = __p1_578; \
55034 int16x8_t __s2_578 = __p2_578; \
55035 int16x4_t __rev0_578; __rev0_578 = __builtin_shufflevector(__s0_578, __s0_578, 3, 2, 1, 0); \
55036 int16x4_t __rev1_578; __rev1_578 = __builtin_shufflevector(__s1_578, __s1_578, 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); \
55038 int16x4_t __ret_578; \
55039 __ret_578 = __rev0_578 - __rev1_578 * __noswap_splat_laneq_s16(__rev2_578, __p3_578); \
55040 __ret_578 = __builtin_shufflevector(__ret_578, __ret_578, 3, 2, 1, 0); \
55041 __ret_578; \
5335555042})
5335655043#endif
5335755044
5335855045#ifdef __LITTLE_ENDIAN__
53359__ai float64x2_t vmlsq_n_f64(float64x2_t __p0, float64x2_t __p1, float64_t __p2) {
53360 float64x2_t __ret;
53361 __ret = __p0 - __p1 * (float64x2_t) {__p2, __p2};
53362 return __ret;
53363}
53364#else
53365__ai float64x2_t vmlsq_n_f64(float64x2_t __p0, float64x2_t __p1, float64_t __p2) {
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; \
55046#define vmlsl_high_lane_u32(__p0_579, __p1_579, __p2_579, __p3_579) __extension__ ({ \
55047 uint64x2_t __s0_579 = __p0_579; \
55048 uint32x4_t __s1_579 = __p1_579; \
55049 uint32x2_t __s2_579 = __p2_579; \
55050 uint64x2_t __ret_579; \
55051 __ret_579 = __s0_579 - vmull_u32(vget_high_u32(__s1_579), splat_lane_u32(__s2_579, __p3_579)); \
55052 __ret_579; \
5338355053})
5338455054#else
53385#define vmlsl_high_lane_u32(__p0_488, __p1_488, __p2_488, __p3_488) __extension__ ({ \
53386 uint64x2_t __s0_488 = __p0_488; \
53387 uint32x4_t __s1_488 = __p1_488; \
53388 uint32x2_t __s2_488 = __p2_488; \
53389 uint64x2_t __rev0_488; __rev0_488 = __builtin_shufflevector(__s0_488, __s0_488, 1, 0); \
53390 uint32x4_t __rev1_488; __rev1_488 = __builtin_shufflevector(__s1_488, __s1_488, 3, 2, 1, 0); \
53391 uint32x2_t __rev2_488; __rev2_488 = __builtin_shufflevector(__s2_488, __s2_488, 1, 0); \
53392 uint64x2_t __ret_488; \
53393 __ret_488 = __rev0_488 - __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_488), __noswap_splat_lane_u32(__rev2_488, __p3_488)); \
53394 __ret_488 = __builtin_shufflevector(__ret_488, __ret_488, 1, 0); \
53395 __ret_488; \
55055#define vmlsl_high_lane_u32(__p0_580, __p1_580, __p2_580, __p3_580) __extension__ ({ \
55056 uint64x2_t __s0_580 = __p0_580; \
55057 uint32x4_t __s1_580 = __p1_580; \
55058 uint32x2_t __s2_580 = __p2_580; \
55059 uint64x2_t __rev0_580; __rev0_580 = __builtin_shufflevector(__s0_580, __s0_580, 1, 0); \
55060 uint32x4_t __rev1_580; __rev1_580 = __builtin_shufflevector(__s1_580, __s1_580, 3, 2, 1, 0); \
55061 uint32x2_t __rev2_580; __rev2_580 = __builtin_shufflevector(__s2_580, __s2_580, 1, 0); \
55062 uint64x2_t __ret_580; \
55063 __ret_580 = __rev0_580 - __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_580), __noswap_splat_lane_u32(__rev2_580, __p3_580)); \
55064 __ret_580 = __builtin_shufflevector(__ret_580, __ret_580, 1, 0); \
55065 __ret_580; \
5339655066})
5339755067#endif
5339855068
5339955069#ifdef __LITTLE_ENDIAN__
53400#define vmlsl_high_lane_u16(__p0_489, __p1_489, __p2_489, __p3_489) __extension__ ({ \
53401 uint32x4_t __s0_489 = __p0_489; \
53402 uint16x8_t __s1_489 = __p1_489; \
53403 uint16x4_t __s2_489 = __p2_489; \
53404 uint32x4_t __ret_489; \
53405 __ret_489 = __s0_489 - vmull_u16(vget_high_u16(__s1_489), splat_lane_u16(__s2_489, __p3_489)); \
53406 __ret_489; \
55070#define vmlsl_high_lane_u16(__p0_581, __p1_581, __p2_581, __p3_581) __extension__ ({ \
55071 uint32x4_t __s0_581 = __p0_581; \
55072 uint16x8_t __s1_581 = __p1_581; \
55073 uint16x4_t __s2_581 = __p2_581; \
55074 uint32x4_t __ret_581; \
55075 __ret_581 = __s0_581 - vmull_u16(vget_high_u16(__s1_581), splat_lane_u16(__s2_581, __p3_581)); \
55076 __ret_581; \
5340755077})
5340855078#else
53409#define vmlsl_high_lane_u16(__p0_490, __p1_490, __p2_490, __p3_490) __extension__ ({ \
53410 uint32x4_t __s0_490 = __p0_490; \
53411 uint16x8_t __s1_490 = __p1_490; \
53412 uint16x4_t __s2_490 = __p2_490; \
53413 uint32x4_t __rev0_490; __rev0_490 = __builtin_shufflevector(__s0_490, __s0_490, 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); \
53415 uint16x4_t __rev2_490; __rev2_490 = __builtin_shufflevector(__s2_490, __s2_490, 3, 2, 1, 0); \
53416 uint32x4_t __ret_490; \
53417 __ret_490 = __rev0_490 - __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_490), __noswap_splat_lane_u16(__rev2_490, __p3_490)); \
53418 __ret_490 = __builtin_shufflevector(__ret_490, __ret_490, 3, 2, 1, 0); \
53419 __ret_490; \
55079#define vmlsl_high_lane_u16(__p0_582, __p1_582, __p2_582, __p3_582) __extension__ ({ \
55080 uint32x4_t __s0_582 = __p0_582; \
55081 uint16x8_t __s1_582 = __p1_582; \
55082 uint16x4_t __s2_582 = __p2_582; \
55083 uint32x4_t __rev0_582; __rev0_582 = __builtin_shufflevector(__s0_582, __s0_582, 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); \
55085 uint16x4_t __rev2_582; __rev2_582 = __builtin_shufflevector(__s2_582, __s2_582, 3, 2, 1, 0); \
55086 uint32x4_t __ret_582; \
55087 __ret_582 = __rev0_582 - __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_582), __noswap_splat_lane_u16(__rev2_582, __p3_582)); \
55088 __ret_582 = __builtin_shufflevector(__ret_582, __ret_582, 3, 2, 1, 0); \
55089 __ret_582; \
5342055090})
5342155091#endif
5342255092
5342355093#ifdef __LITTLE_ENDIAN__
53424#define vmlsl_high_lane_s32(__p0_491, __p1_491, __p2_491, __p3_491) __extension__ ({ \
53425 int64x2_t __s0_491 = __p0_491; \
53426 int32x4_t __s1_491 = __p1_491; \
53427 int32x2_t __s2_491 = __p2_491; \
53428 int64x2_t __ret_491; \
53429 __ret_491 = __s0_491 - vmull_s32(vget_high_s32(__s1_491), splat_lane_s32(__s2_491, __p3_491)); \
53430 __ret_491; \
55094#define vmlsl_high_lane_s32(__p0_583, __p1_583, __p2_583, __p3_583) __extension__ ({ \
55095 int64x2_t __s0_583 = __p0_583; \
55096 int32x4_t __s1_583 = __p1_583; \
55097 int32x2_t __s2_583 = __p2_583; \
55098 int64x2_t __ret_583; \
55099 __ret_583 = __s0_583 - vmull_s32(vget_high_s32(__s1_583), splat_lane_s32(__s2_583, __p3_583)); \
55100 __ret_583; \
5343155101})
5343255102#else
53433#define vmlsl_high_lane_s32(__p0_492, __p1_492, __p2_492, __p3_492) __extension__ ({ \
53434 int64x2_t __s0_492 = __p0_492; \
53435 int32x4_t __s1_492 = __p1_492; \
53436 int32x2_t __s2_492 = __p2_492; \
53437 int64x2_t __rev0_492; __rev0_492 = __builtin_shufflevector(__s0_492, __s0_492, 1, 0); \
53438 int32x4_t __rev1_492; __rev1_492 = __builtin_shufflevector(__s1_492, __s1_492, 3, 2, 1, 0); \
53439 int32x2_t __rev2_492; __rev2_492 = __builtin_shufflevector(__s2_492, __s2_492, 1, 0); \
53440 int64x2_t __ret_492; \
53441 __ret_492 = __rev0_492 - __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_492), __noswap_splat_lane_s32(__rev2_492, __p3_492)); \
53442 __ret_492 = __builtin_shufflevector(__ret_492, __ret_492, 1, 0); \
53443 __ret_492; \
55103#define vmlsl_high_lane_s32(__p0_584, __p1_584, __p2_584, __p3_584) __extension__ ({ \
55104 int64x2_t __s0_584 = __p0_584; \
55105 int32x4_t __s1_584 = __p1_584; \
55106 int32x2_t __s2_584 = __p2_584; \
55107 int64x2_t __rev0_584; __rev0_584 = __builtin_shufflevector(__s0_584, __s0_584, 1, 0); \
55108 int32x4_t __rev1_584; __rev1_584 = __builtin_shufflevector(__s1_584, __s1_584, 3, 2, 1, 0); \
55109 int32x2_t __rev2_584; __rev2_584 = __builtin_shufflevector(__s2_584, __s2_584, 1, 0); \
55110 int64x2_t __ret_584; \
55111 __ret_584 = __rev0_584 - __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_584), __noswap_splat_lane_s32(__rev2_584, __p3_584)); \
55112 __ret_584 = __builtin_shufflevector(__ret_584, __ret_584, 1, 0); \
55113 __ret_584; \
5344455114})
5344555115#endif
5344655116
5344755117#ifdef __LITTLE_ENDIAN__
53448#define vmlsl_high_lane_s16(__p0_493, __p1_493, __p2_493, __p3_493) __extension__ ({ \
53449 int32x4_t __s0_493 = __p0_493; \
53450 int16x8_t __s1_493 = __p1_493; \
53451 int16x4_t __s2_493 = __p2_493; \
53452 int32x4_t __ret_493; \
53453 __ret_493 = __s0_493 - vmull_s16(vget_high_s16(__s1_493), splat_lane_s16(__s2_493, __p3_493)); \
53454 __ret_493; \
55118#define vmlsl_high_lane_s16(__p0_585, __p1_585, __p2_585, __p3_585) __extension__ ({ \
55119 int32x4_t __s0_585 = __p0_585; \
55120 int16x8_t __s1_585 = __p1_585; \
55121 int16x4_t __s2_585 = __p2_585; \
55122 int32x4_t __ret_585; \
55123 __ret_585 = __s0_585 - vmull_s16(vget_high_s16(__s1_585), splat_lane_s16(__s2_585, __p3_585)); \
55124 __ret_585; \
5345555125})
5345655126#else
53457#define vmlsl_high_lane_s16(__p0_494, __p1_494, __p2_494, __p3_494) __extension__ ({ \
53458 int32x4_t __s0_494 = __p0_494; \
53459 int16x8_t __s1_494 = __p1_494; \
53460 int16x4_t __s2_494 = __p2_494; \
53461 int32x4_t __rev0_494; __rev0_494 = __builtin_shufflevector(__s0_494, __s0_494, 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); \
53463 int16x4_t __rev2_494; __rev2_494 = __builtin_shufflevector(__s2_494, __s2_494, 3, 2, 1, 0); \
53464 int32x4_t __ret_494; \
53465 __ret_494 = __rev0_494 - __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_494), __noswap_splat_lane_s16(__rev2_494, __p3_494)); \
53466 __ret_494 = __builtin_shufflevector(__ret_494, __ret_494, 3, 2, 1, 0); \
53467 __ret_494; \
55127#define vmlsl_high_lane_s16(__p0_586, __p1_586, __p2_586, __p3_586) __extension__ ({ \
55128 int32x4_t __s0_586 = __p0_586; \
55129 int16x8_t __s1_586 = __p1_586; \
55130 int16x4_t __s2_586 = __p2_586; \
55131 int32x4_t __rev0_586; __rev0_586 = __builtin_shufflevector(__s0_586, __s0_586, 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); \
55133 int16x4_t __rev2_586; __rev2_586 = __builtin_shufflevector(__s2_586, __s2_586, 3, 2, 1, 0); \
55134 int32x4_t __ret_586; \
55135 __ret_586 = __rev0_586 - __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_586), __noswap_splat_lane_s16(__rev2_586, __p3_586)); \
55136 __ret_586 = __builtin_shufflevector(__ret_586, __ret_586, 3, 2, 1, 0); \
55137 __ret_586; \
5346855138})
5346955139#endif
5347055140
5347155141#ifdef __LITTLE_ENDIAN__
53472#define vmlsl_high_laneq_u32(__p0_495, __p1_495, __p2_495, __p3_495) __extension__ ({ \
53473 uint64x2_t __s0_495 = __p0_495; \
53474 uint32x4_t __s1_495 = __p1_495; \
53475 uint32x4_t __s2_495 = __p2_495; \
53476 uint64x2_t __ret_495; \
53477 __ret_495 = __s0_495 - vmull_u32(vget_high_u32(__s1_495), splat_laneq_u32(__s2_495, __p3_495)); \
53478 __ret_495; \
55142#define vmlsl_high_laneq_u32(__p0_587, __p1_587, __p2_587, __p3_587) __extension__ ({ \
55143 uint64x2_t __s0_587 = __p0_587; \
55144 uint32x4_t __s1_587 = __p1_587; \
55145 uint32x4_t __s2_587 = __p2_587; \
55146 uint64x2_t __ret_587; \
55147 __ret_587 = __s0_587 - vmull_u32(vget_high_u32(__s1_587), splat_laneq_u32(__s2_587, __p3_587)); \
55148 __ret_587; \
5347955149})
5348055150#else
53481#define vmlsl_high_laneq_u32(__p0_496, __p1_496, __p2_496, __p3_496) __extension__ ({ \
53482 uint64x2_t __s0_496 = __p0_496; \
53483 uint32x4_t __s1_496 = __p1_496; \
53484 uint32x4_t __s2_496 = __p2_496; \
53485 uint64x2_t __rev0_496; __rev0_496 = __builtin_shufflevector(__s0_496, __s0_496, 1, 0); \
53486 uint32x4_t __rev1_496; __rev1_496 = __builtin_shufflevector(__s1_496, __s1_496, 3, 2, 1, 0); \
53487 uint32x4_t __rev2_496; __rev2_496 = __builtin_shufflevector(__s2_496, __s2_496, 3, 2, 1, 0); \
53488 uint64x2_t __ret_496; \
53489 __ret_496 = __rev0_496 - __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_496), __noswap_splat_laneq_u32(__rev2_496, __p3_496)); \
53490 __ret_496 = __builtin_shufflevector(__ret_496, __ret_496, 1, 0); \
53491 __ret_496; \
55151#define vmlsl_high_laneq_u32(__p0_588, __p1_588, __p2_588, __p3_588) __extension__ ({ \
55152 uint64x2_t __s0_588 = __p0_588; \
55153 uint32x4_t __s1_588 = __p1_588; \
55154 uint32x4_t __s2_588 = __p2_588; \
55155 uint64x2_t __rev0_588; __rev0_588 = __builtin_shufflevector(__s0_588, __s0_588, 1, 0); \
55156 uint32x4_t __rev1_588; __rev1_588 = __builtin_shufflevector(__s1_588, __s1_588, 3, 2, 1, 0); \
55157 uint32x4_t __rev2_588; __rev2_588 = __builtin_shufflevector(__s2_588, __s2_588, 3, 2, 1, 0); \
55158 uint64x2_t __ret_588; \
55159 __ret_588 = __rev0_588 - __noswap_vmull_u32(__noswap_vget_high_u32(__rev1_588), __noswap_splat_laneq_u32(__rev2_588, __p3_588)); \
55160 __ret_588 = __builtin_shufflevector(__ret_588, __ret_588, 1, 0); \
55161 __ret_588; \
5349255162})
5349355163#endif
5349455164
5349555165#ifdef __LITTLE_ENDIAN__
53496#define vmlsl_high_laneq_u16(__p0_497, __p1_497, __p2_497, __p3_497) __extension__ ({ \
53497 uint32x4_t __s0_497 = __p0_497; \
53498 uint16x8_t __s1_497 = __p1_497; \
53499 uint16x8_t __s2_497 = __p2_497; \
53500 uint32x4_t __ret_497; \
53501 __ret_497 = __s0_497 - vmull_u16(vget_high_u16(__s1_497), splat_laneq_u16(__s2_497, __p3_497)); \
53502 __ret_497; \
55166#define vmlsl_high_laneq_u16(__p0_589, __p1_589, __p2_589, __p3_589) __extension__ ({ \
55167 uint32x4_t __s0_589 = __p0_589; \
55168 uint16x8_t __s1_589 = __p1_589; \
55169 uint16x8_t __s2_589 = __p2_589; \
55170 uint32x4_t __ret_589; \
55171 __ret_589 = __s0_589 - vmull_u16(vget_high_u16(__s1_589), splat_laneq_u16(__s2_589, __p3_589)); \
55172 __ret_589; \
5350355173})
5350455174#else
53505#define vmlsl_high_laneq_u16(__p0_498, __p1_498, __p2_498, __p3_498) __extension__ ({ \
53506 uint32x4_t __s0_498 = __p0_498; \
53507 uint16x8_t __s1_498 = __p1_498; \
53508 uint16x8_t __s2_498 = __p2_498; \
53509 uint32x4_t __rev0_498; __rev0_498 = __builtin_shufflevector(__s0_498, __s0_498, 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); \
53511 uint16x8_t __rev2_498; __rev2_498 = __builtin_shufflevector(__s2_498, __s2_498, 7, 6, 5, 4, 3, 2, 1, 0); \
53512 uint32x4_t __ret_498; \
53513 __ret_498 = __rev0_498 - __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_498), __noswap_splat_laneq_u16(__rev2_498, __p3_498)); \
53514 __ret_498 = __builtin_shufflevector(__ret_498, __ret_498, 3, 2, 1, 0); \
53515 __ret_498; \
55175#define vmlsl_high_laneq_u16(__p0_590, __p1_590, __p2_590, __p3_590) __extension__ ({ \
55176 uint32x4_t __s0_590 = __p0_590; \
55177 uint16x8_t __s1_590 = __p1_590; \
55178 uint16x8_t __s2_590 = __p2_590; \
55179 uint32x4_t __rev0_590; __rev0_590 = __builtin_shufflevector(__s0_590, __s0_590, 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); \
55181 uint16x8_t __rev2_590; __rev2_590 = __builtin_shufflevector(__s2_590, __s2_590, 7, 6, 5, 4, 3, 2, 1, 0); \
55182 uint32x4_t __ret_590; \
55183 __ret_590 = __rev0_590 - __noswap_vmull_u16(__noswap_vget_high_u16(__rev1_590), __noswap_splat_laneq_u16(__rev2_590, __p3_590)); \
55184 __ret_590 = __builtin_shufflevector(__ret_590, __ret_590, 3, 2, 1, 0); \
55185 __ret_590; \
5351655186})
5351755187#endif
5351855188
5351955189#ifdef __LITTLE_ENDIAN__
53520#define vmlsl_high_laneq_s32(__p0_499, __p1_499, __p2_499, __p3_499) __extension__ ({ \
53521 int64x2_t __s0_499 = __p0_499; \
53522 int32x4_t __s1_499 = __p1_499; \
53523 int32x4_t __s2_499 = __p2_499; \
53524 int64x2_t __ret_499; \
53525 __ret_499 = __s0_499 - vmull_s32(vget_high_s32(__s1_499), splat_laneq_s32(__s2_499, __p3_499)); \
53526 __ret_499; \
55190#define vmlsl_high_laneq_s32(__p0_591, __p1_591, __p2_591, __p3_591) __extension__ ({ \
55191 int64x2_t __s0_591 = __p0_591; \
55192 int32x4_t __s1_591 = __p1_591; \
55193 int32x4_t __s2_591 = __p2_591; \
55194 int64x2_t __ret_591; \
55195 __ret_591 = __s0_591 - vmull_s32(vget_high_s32(__s1_591), splat_laneq_s32(__s2_591, __p3_591)); \
55196 __ret_591; \
5352755197})
5352855198#else
53529#define vmlsl_high_laneq_s32(__p0_500, __p1_500, __p2_500, __p3_500) __extension__ ({ \
53530 int64x2_t __s0_500 = __p0_500; \
53531 int32x4_t __s1_500 = __p1_500; \
53532 int32x4_t __s2_500 = __p2_500; \
53533 int64x2_t __rev0_500; __rev0_500 = __builtin_shufflevector(__s0_500, __s0_500, 1, 0); \
53534 int32x4_t __rev1_500; __rev1_500 = __builtin_shufflevector(__s1_500, __s1_500, 3, 2, 1, 0); \
53535 int32x4_t __rev2_500; __rev2_500 = __builtin_shufflevector(__s2_500, __s2_500, 3, 2, 1, 0); \
53536 int64x2_t __ret_500; \
53537 __ret_500 = __rev0_500 - __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_500), __noswap_splat_laneq_s32(__rev2_500, __p3_500)); \
53538 __ret_500 = __builtin_shufflevector(__ret_500, __ret_500, 1, 0); \
53539 __ret_500; \
55199#define vmlsl_high_laneq_s32(__p0_592, __p1_592, __p2_592, __p3_592) __extension__ ({ \
55200 int64x2_t __s0_592 = __p0_592; \
55201 int32x4_t __s1_592 = __p1_592; \
55202 int32x4_t __s2_592 = __p2_592; \
55203 int64x2_t __rev0_592; __rev0_592 = __builtin_shufflevector(__s0_592, __s0_592, 1, 0); \
55204 int32x4_t __rev1_592; __rev1_592 = __builtin_shufflevector(__s1_592, __s1_592, 3, 2, 1, 0); \
55205 int32x4_t __rev2_592; __rev2_592 = __builtin_shufflevector(__s2_592, __s2_592, 3, 2, 1, 0); \
55206 int64x2_t __ret_592; \
55207 __ret_592 = __rev0_592 - __noswap_vmull_s32(__noswap_vget_high_s32(__rev1_592), __noswap_splat_laneq_s32(__rev2_592, __p3_592)); \
55208 __ret_592 = __builtin_shufflevector(__ret_592, __ret_592, 1, 0); \
55209 __ret_592; \
5354055210})
5354155211#endif
5354255212
5354355213#ifdef __LITTLE_ENDIAN__
53544#define vmlsl_high_laneq_s16(__p0_501, __p1_501, __p2_501, __p3_501) __extension__ ({ \
53545 int32x4_t __s0_501 = __p0_501; \
53546 int16x8_t __s1_501 = __p1_501; \
53547 int16x8_t __s2_501 = __p2_501; \
53548 int32x4_t __ret_501; \
53549 __ret_501 = __s0_501 - vmull_s16(vget_high_s16(__s1_501), splat_laneq_s16(__s2_501, __p3_501)); \
53550 __ret_501; \
55214#define vmlsl_high_laneq_s16(__p0_593, __p1_593, __p2_593, __p3_593) __extension__ ({ \
55215 int32x4_t __s0_593 = __p0_593; \
55216 int16x8_t __s1_593 = __p1_593; \
55217 int16x8_t __s2_593 = __p2_593; \
55218 int32x4_t __ret_593; \
55219 __ret_593 = __s0_593 - vmull_s16(vget_high_s16(__s1_593), splat_laneq_s16(__s2_593, __p3_593)); \
55220 __ret_593; \
5355155221})
5355255222#else
53553#define vmlsl_high_laneq_s16(__p0_502, __p1_502, __p2_502, __p3_502) __extension__ ({ \
53554 int32x4_t __s0_502 = __p0_502; \
53555 int16x8_t __s1_502 = __p1_502; \
53556 int16x8_t __s2_502 = __p2_502; \
53557 int32x4_t __rev0_502; __rev0_502 = __builtin_shufflevector(__s0_502, __s0_502, 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); \
53559 int16x8_t __rev2_502; __rev2_502 = __builtin_shufflevector(__s2_502, __s2_502, 7, 6, 5, 4, 3, 2, 1, 0); \
53560 int32x4_t __ret_502; \
53561 __ret_502 = __rev0_502 - __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_502), __noswap_splat_laneq_s16(__rev2_502, __p3_502)); \
53562 __ret_502 = __builtin_shufflevector(__ret_502, __ret_502, 3, 2, 1, 0); \
53563 __ret_502; \
55223#define vmlsl_high_laneq_s16(__p0_594, __p1_594, __p2_594, __p3_594) __extension__ ({ \
55224 int32x4_t __s0_594 = __p0_594; \
55225 int16x8_t __s1_594 = __p1_594; \
55226 int16x8_t __s2_594 = __p2_594; \
55227 int32x4_t __rev0_594; __rev0_594 = __builtin_shufflevector(__s0_594, __s0_594, 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); \
55229 int16x8_t __rev2_594; __rev2_594 = __builtin_shufflevector(__s2_594, __s2_594, 7, 6, 5, 4, 3, 2, 1, 0); \
55230 int32x4_t __ret_594; \
55231 __ret_594 = __rev0_594 - __noswap_vmull_s16(__noswap_vget_high_s16(__rev1_594), __noswap_splat_laneq_s16(__rev2_594, __p3_594)); \
55232 __ret_594 = __builtin_shufflevector(__ret_594, __ret_594, 3, 2, 1, 0); \
55233 __ret_594; \
5356455234})
5356555235#endif
5356655236
5356755237#ifdef __LITTLE_ENDIAN__
53568#define vmlsl_laneq_u32(__p0_503, __p1_503, __p2_503, __p3_503) __extension__ ({ \
53569 uint64x2_t __s0_503 = __p0_503; \
53570 uint32x2_t __s1_503 = __p1_503; \
53571 uint32x4_t __s2_503 = __p2_503; \
53572 uint64x2_t __ret_503; \
53573 __ret_503 = __s0_503 - vmull_u32(__s1_503, splat_laneq_u32(__s2_503, __p3_503)); \
53574 __ret_503; \
55238#define vmlsl_laneq_u32(__p0_595, __p1_595, __p2_595, __p3_595) __extension__ ({ \
55239 uint64x2_t __s0_595 = __p0_595; \
55240 uint32x2_t __s1_595 = __p1_595; \
55241 uint32x4_t __s2_595 = __p2_595; \
55242 uint64x2_t __ret_595; \
55243 __ret_595 = __s0_595 - vmull_u32(__s1_595, splat_laneq_u32(__s2_595, __p3_595)); \
55244 __ret_595; \
5357555245})
5357655246#else
53577#define vmlsl_laneq_u32(__p0_504, __p1_504, __p2_504, __p3_504) __extension__ ({ \
53578 uint64x2_t __s0_504 = __p0_504; \
53579 uint32x2_t __s1_504 = __p1_504; \
53580 uint32x4_t __s2_504 = __p2_504; \
53581 uint64x2_t __rev0_504; __rev0_504 = __builtin_shufflevector(__s0_504, __s0_504, 1, 0); \
53582 uint32x2_t __rev1_504; __rev1_504 = __builtin_shufflevector(__s1_504, __s1_504, 1, 0); \
53583 uint32x4_t __rev2_504; __rev2_504 = __builtin_shufflevector(__s2_504, __s2_504, 3, 2, 1, 0); \
53584 uint64x2_t __ret_504; \
53585 __ret_504 = __rev0_504 - __noswap_vmull_u32(__rev1_504, __noswap_splat_laneq_u32(__rev2_504, __p3_504)); \
53586 __ret_504 = __builtin_shufflevector(__ret_504, __ret_504, 1, 0); \
53587 __ret_504; \
55247#define vmlsl_laneq_u32(__p0_596, __p1_596, __p2_596, __p3_596) __extension__ ({ \
55248 uint64x2_t __s0_596 = __p0_596; \
55249 uint32x2_t __s1_596 = __p1_596; \
55250 uint32x4_t __s2_596 = __p2_596; \
55251 uint64x2_t __rev0_596; __rev0_596 = __builtin_shufflevector(__s0_596, __s0_596, 1, 0); \
55252 uint32x2_t __rev1_596; __rev1_596 = __builtin_shufflevector(__s1_596, __s1_596, 1, 0); \
55253 uint32x4_t __rev2_596; __rev2_596 = __builtin_shufflevector(__s2_596, __s2_596, 3, 2, 1, 0); \
55254 uint64x2_t __ret_596; \
55255 __ret_596 = __rev0_596 - __noswap_vmull_u32(__rev1_596, __noswap_splat_laneq_u32(__rev2_596, __p3_596)); \
55256 __ret_596 = __builtin_shufflevector(__ret_596, __ret_596, 1, 0); \
55257 __ret_596; \
5358855258})
5358955259#endif
5359055260
5359155261#ifdef __LITTLE_ENDIAN__
53592#define vmlsl_laneq_u16(__p0_505, __p1_505, __p2_505, __p3_505) __extension__ ({ \
53593 uint32x4_t __s0_505 = __p0_505; \
53594 uint16x4_t __s1_505 = __p1_505; \
53595 uint16x8_t __s2_505 = __p2_505; \
53596 uint32x4_t __ret_505; \
53597 __ret_505 = __s0_505 - vmull_u16(__s1_505, splat_laneq_u16(__s2_505, __p3_505)); \
53598 __ret_505; \
55262#define vmlsl_laneq_u16(__p0_597, __p1_597, __p2_597, __p3_597) __extension__ ({ \
55263 uint32x4_t __s0_597 = __p0_597; \
55264 uint16x4_t __s1_597 = __p1_597; \
55265 uint16x8_t __s2_597 = __p2_597; \
55266 uint32x4_t __ret_597; \
55267 __ret_597 = __s0_597 - vmull_u16(__s1_597, splat_laneq_u16(__s2_597, __p3_597)); \
55268 __ret_597; \
5359955269})
5360055270#else
53601#define vmlsl_laneq_u16(__p0_506, __p1_506, __p2_506, __p3_506) __extension__ ({ \
53602 uint32x4_t __s0_506 = __p0_506; \
53603 uint16x4_t __s1_506 = __p1_506; \
53604 uint16x8_t __s2_506 = __p2_506; \
53605 uint32x4_t __rev0_506; __rev0_506 = __builtin_shufflevector(__s0_506, __s0_506, 3, 2, 1, 0); \
53606 uint16x4_t __rev1_506; __rev1_506 = __builtin_shufflevector(__s1_506, __s1_506, 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); \
53608 uint32x4_t __ret_506; \
53609 __ret_506 = __rev0_506 - __noswap_vmull_u16(__rev1_506, __noswap_splat_laneq_u16(__rev2_506, __p3_506)); \
53610 __ret_506 = __builtin_shufflevector(__ret_506, __ret_506, 3, 2, 1, 0); \
53611 __ret_506; \
55271#define vmlsl_laneq_u16(__p0_598, __p1_598, __p2_598, __p3_598) __extension__ ({ \
55272 uint32x4_t __s0_598 = __p0_598; \
55273 uint16x4_t __s1_598 = __p1_598; \
55274 uint16x8_t __s2_598 = __p2_598; \
55275 uint32x4_t __rev0_598; __rev0_598 = __builtin_shufflevector(__s0_598, __s0_598, 3, 2, 1, 0); \
55276 uint16x4_t __rev1_598; __rev1_598 = __builtin_shufflevector(__s1_598, __s1_598, 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); \
55278 uint32x4_t __ret_598; \
55279 __ret_598 = __rev0_598 - __noswap_vmull_u16(__rev1_598, __noswap_splat_laneq_u16(__rev2_598, __p3_598)); \
55280 __ret_598 = __builtin_shufflevector(__ret_598, __ret_598, 3, 2, 1, 0); \
55281 __ret_598; \
5361255282})
5361355283#endif
5361455284
5361555285#ifdef __LITTLE_ENDIAN__
53616#define vmlsl_laneq_s32(__p0_507, __p1_507, __p2_507, __p3_507) __extension__ ({ \
53617 int64x2_t __s0_507 = __p0_507; \
53618 int32x2_t __s1_507 = __p1_507; \
53619 int32x4_t __s2_507 = __p2_507; \
53620 int64x2_t __ret_507; \
53621 __ret_507 = __s0_507 - vmull_s32(__s1_507, splat_laneq_s32(__s2_507, __p3_507)); \
53622 __ret_507; \
55286#define vmlsl_laneq_s32(__p0_599, __p1_599, __p2_599, __p3_599) __extension__ ({ \
55287 int64x2_t __s0_599 = __p0_599; \
55288 int32x2_t __s1_599 = __p1_599; \
55289 int32x4_t __s2_599 = __p2_599; \
55290 int64x2_t __ret_599; \
55291 __ret_599 = __s0_599 - vmull_s32(__s1_599, splat_laneq_s32(__s2_599, __p3_599)); \
55292 __ret_599; \
5362355293})
5362455294#else
53625#define vmlsl_laneq_s32(__p0_508, __p1_508, __p2_508, __p3_508) __extension__ ({ \
53626 int64x2_t __s0_508 = __p0_508; \
53627 int32x2_t __s1_508 = __p1_508; \
53628 int32x4_t __s2_508 = __p2_508; \
53629 int64x2_t __rev0_508; __rev0_508 = __builtin_shufflevector(__s0_508, __s0_508, 1, 0); \
53630 int32x2_t __rev1_508; __rev1_508 = __builtin_shufflevector(__s1_508, __s1_508, 1, 0); \
53631 int32x4_t __rev2_508; __rev2_508 = __builtin_shufflevector(__s2_508, __s2_508, 3, 2, 1, 0); \
53632 int64x2_t __ret_508; \
53633 __ret_508 = __rev0_508 - __noswap_vmull_s32(__rev1_508, __noswap_splat_laneq_s32(__rev2_508, __p3_508)); \
53634 __ret_508 = __builtin_shufflevector(__ret_508, __ret_508, 1, 0); \
53635 __ret_508; \
55295#define vmlsl_laneq_s32(__p0_600, __p1_600, __p2_600, __p3_600) __extension__ ({ \
55296 int64x2_t __s0_600 = __p0_600; \
55297 int32x2_t __s1_600 = __p1_600; \
55298 int32x4_t __s2_600 = __p2_600; \
55299 int64x2_t __rev0_600; __rev0_600 = __builtin_shufflevector(__s0_600, __s0_600, 1, 0); \
55300 int32x2_t __rev1_600; __rev1_600 = __builtin_shufflevector(__s1_600, __s1_600, 1, 0); \
55301 int32x4_t __rev2_600; __rev2_600 = __builtin_shufflevector(__s2_600, __s2_600, 3, 2, 1, 0); \
55302 int64x2_t __ret_600; \
55303 __ret_600 = __rev0_600 - __noswap_vmull_s32(__rev1_600, __noswap_splat_laneq_s32(__rev2_600, __p3_600)); \
55304 __ret_600 = __builtin_shufflevector(__ret_600, __ret_600, 1, 0); \
55305 __ret_600; \
5363655306})
5363755307#endif
5363855308
5363955309#ifdef __LITTLE_ENDIAN__
53640#define vmlsl_laneq_s16(__p0_509, __p1_509, __p2_509, __p3_509) __extension__ ({ \
53641 int32x4_t __s0_509 = __p0_509; \
53642 int16x4_t __s1_509 = __p1_509; \
53643 int16x8_t __s2_509 = __p2_509; \
53644 int32x4_t __ret_509; \
53645 __ret_509 = __s0_509 - vmull_s16(__s1_509, splat_laneq_s16(__s2_509, __p3_509)); \
53646 __ret_509; \
55310#define vmlsl_laneq_s16(__p0_601, __p1_601, __p2_601, __p3_601) __extension__ ({ \
55311 int32x4_t __s0_601 = __p0_601; \
55312 int16x4_t __s1_601 = __p1_601; \
55313 int16x8_t __s2_601 = __p2_601; \
55314 int32x4_t __ret_601; \
55315 __ret_601 = __s0_601 - vmull_s16(__s1_601, splat_laneq_s16(__s2_601, __p3_601)); \
55316 __ret_601; \
5364755317})
5364855318#else
53649#define vmlsl_laneq_s16(__p0_510, __p1_510, __p2_510, __p3_510) __extension__ ({ \
53650 int32x4_t __s0_510 = __p0_510; \
53651 int16x4_t __s1_510 = __p1_510; \
53652 int16x8_t __s2_510 = __p2_510; \
53653 int32x4_t __rev0_510; __rev0_510 = __builtin_shufflevector(__s0_510, __s0_510, 3, 2, 1, 0); \
53654 int16x4_t __rev1_510; __rev1_510 = __builtin_shufflevector(__s1_510, __s1_510, 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); \
53656 int32x4_t __ret_510; \
53657 __ret_510 = __rev0_510 - __noswap_vmull_s16(__rev1_510, __noswap_splat_laneq_s16(__rev2_510, __p3_510)); \
53658 __ret_510 = __builtin_shufflevector(__ret_510, __ret_510, 3, 2, 1, 0); \
53659 __ret_510; \
55319#define vmlsl_laneq_s16(__p0_602, __p1_602, __p2_602, __p3_602) __extension__ ({ \
55320 int32x4_t __s0_602 = __p0_602; \
55321 int16x4_t __s1_602 = __p1_602; \
55322 int16x8_t __s2_602 = __p2_602; \
55323 int32x4_t __rev0_602; __rev0_602 = __builtin_shufflevector(__s0_602, __s0_602, 3, 2, 1, 0); \
55324 int16x4_t __rev1_602; __rev1_602 = __builtin_shufflevector(__s1_602, __s1_602, 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); \
55326 int32x4_t __ret_602; \
55327 __ret_602 = __rev0_602 - __noswap_vmull_s16(__rev1_602, __noswap_splat_laneq_s16(__rev2_602, __p3_602)); \
55328 __ret_602 = __builtin_shufflevector(__ret_602, __ret_602, 3, 2, 1, 0); \
55329 __ret_602; \
5366055330})
5366155331#endif
5366255332
......@@ -53701,146 +55371,146 @@ __ai float64x1_t vmov_n_f64(float64_t __p0) {
5370155371 return __ret;
5370255372}
5370355373#ifdef __LITTLE_ENDIAN__
53704__ai uint16x8_t vmovl_high_u8(uint8x16_t __p0_511) {
53705 uint16x8_t __ret_511;
53706 uint8x8_t __a1_511 = vget_high_u8(__p0_511);
53707 __ret_511 = (uint16x8_t)(vshll_n_u8(__a1_511, 0));
53708 return __ret_511;
55374__ai uint16x8_t vmovl_high_u8(uint8x16_t __p0_603) {
55375 uint16x8_t __ret_603;
55376 uint8x8_t __a1_603 = vget_high_u8(__p0_603);
55377 __ret_603 = (uint16x8_t)(vshll_n_u8(__a1_603, 0));
55378 return __ret_603;
5370955379}
5371055380#else
53711__ai uint16x8_t vmovl_high_u8(uint8x16_t __p0_512) {
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);
53713 uint16x8_t __ret_512;
53714 uint8x8_t __a1_512 = __noswap_vget_high_u8(__rev0_512);
53715 __ret_512 = (uint16x8_t)(__noswap_vshll_n_u8(__a1_512, 0));
53716 __ret_512 = __builtin_shufflevector(__ret_512, __ret_512, 7, 6, 5, 4, 3, 2, 1, 0);
53717 return __ret_512;
55381__ai uint16x8_t vmovl_high_u8(uint8x16_t __p0_604) {
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);
55383 uint16x8_t __ret_604;
55384 uint8x8_t __a1_604 = __noswap_vget_high_u8(__rev0_604);
55385 __ret_604 = (uint16x8_t)(__noswap_vshll_n_u8(__a1_604, 0));
55386 __ret_604 = __builtin_shufflevector(__ret_604, __ret_604, 7, 6, 5, 4, 3, 2, 1, 0);
55387 return __ret_604;
5371855388}
53719__ai uint16x8_t __noswap_vmovl_high_u8(uint8x16_t __p0_513) {
53720 uint16x8_t __ret_513;
53721 uint8x8_t __a1_513 = __noswap_vget_high_u8(__p0_513);
53722 __ret_513 = (uint16x8_t)(__noswap_vshll_n_u8(__a1_513, 0));
53723 return __ret_513;
55389__ai uint16x8_t __noswap_vmovl_high_u8(uint8x16_t __p0_605) {
55390 uint16x8_t __ret_605;
55391 uint8x8_t __a1_605 = __noswap_vget_high_u8(__p0_605);
55392 __ret_605 = (uint16x8_t)(__noswap_vshll_n_u8(__a1_605, 0));
55393 return __ret_605;
5372455394}
5372555395#endif
5372655396
5372755397#ifdef __LITTLE_ENDIAN__
53728__ai uint64x2_t vmovl_high_u32(uint32x4_t __p0_514) {
53729 uint64x2_t __ret_514;
53730 uint32x2_t __a1_514 = vget_high_u32(__p0_514);
53731 __ret_514 = (uint64x2_t)(vshll_n_u32(__a1_514, 0));
53732 return __ret_514;
55398__ai uint64x2_t vmovl_high_u32(uint32x4_t __p0_606) {
55399 uint64x2_t __ret_606;
55400 uint32x2_t __a1_606 = vget_high_u32(__p0_606);
55401 __ret_606 = (uint64x2_t)(vshll_n_u32(__a1_606, 0));
55402 return __ret_606;
5373355403}
5373455404#else
53735__ai uint64x2_t vmovl_high_u32(uint32x4_t __p0_515) {
53736 uint32x4_t __rev0_515; __rev0_515 = __builtin_shufflevector(__p0_515, __p0_515, 3, 2, 1, 0);
53737 uint64x2_t __ret_515;
53738 uint32x2_t __a1_515 = __noswap_vget_high_u32(__rev0_515);
53739 __ret_515 = (uint64x2_t)(__noswap_vshll_n_u32(__a1_515, 0));
53740 __ret_515 = __builtin_shufflevector(__ret_515, __ret_515, 1, 0);
53741 return __ret_515;
55405__ai uint64x2_t vmovl_high_u32(uint32x4_t __p0_607) {
55406 uint32x4_t __rev0_607; __rev0_607 = __builtin_shufflevector(__p0_607, __p0_607, 3, 2, 1, 0);
55407 uint64x2_t __ret_607;
55408 uint32x2_t __a1_607 = __noswap_vget_high_u32(__rev0_607);
55409 __ret_607 = (uint64x2_t)(__noswap_vshll_n_u32(__a1_607, 0));
55410 __ret_607 = __builtin_shufflevector(__ret_607, __ret_607, 1, 0);
55411 return __ret_607;
5374255412}
53743__ai uint64x2_t __noswap_vmovl_high_u32(uint32x4_t __p0_516) {
53744 uint64x2_t __ret_516;
53745 uint32x2_t __a1_516 = __noswap_vget_high_u32(__p0_516);
53746 __ret_516 = (uint64x2_t)(__noswap_vshll_n_u32(__a1_516, 0));
53747 return __ret_516;
55413__ai uint64x2_t __noswap_vmovl_high_u32(uint32x4_t __p0_608) {
55414 uint64x2_t __ret_608;
55415 uint32x2_t __a1_608 = __noswap_vget_high_u32(__p0_608);
55416 __ret_608 = (uint64x2_t)(__noswap_vshll_n_u32(__a1_608, 0));
55417 return __ret_608;
5374855418}
5374955419#endif
5375055420
5375155421#ifdef __LITTLE_ENDIAN__
53752__ai uint32x4_t vmovl_high_u16(uint16x8_t __p0_517) {
53753 uint32x4_t __ret_517;
53754 uint16x4_t __a1_517 = vget_high_u16(__p0_517);
53755 __ret_517 = (uint32x4_t)(vshll_n_u16(__a1_517, 0));
53756 return __ret_517;
55422__ai uint32x4_t vmovl_high_u16(uint16x8_t __p0_609) {
55423 uint32x4_t __ret_609;
55424 uint16x4_t __a1_609 = vget_high_u16(__p0_609);
55425 __ret_609 = (uint32x4_t)(vshll_n_u16(__a1_609, 0));
55426 return __ret_609;
5375755427}
5375855428#else
53759__ai uint32x4_t vmovl_high_u16(uint16x8_t __p0_518) {
53760 uint16x8_t __rev0_518; __rev0_518 = __builtin_shufflevector(__p0_518, __p0_518, 7, 6, 5, 4, 3, 2, 1, 0);
53761 uint32x4_t __ret_518;
53762 uint16x4_t __a1_518 = __noswap_vget_high_u16(__rev0_518);
53763 __ret_518 = (uint32x4_t)(__noswap_vshll_n_u16(__a1_518, 0));
53764 __ret_518 = __builtin_shufflevector(__ret_518, __ret_518, 3, 2, 1, 0);
53765 return __ret_518;
55429__ai uint32x4_t vmovl_high_u16(uint16x8_t __p0_610) {
55430 uint16x8_t __rev0_610; __rev0_610 = __builtin_shufflevector(__p0_610, __p0_610, 7, 6, 5, 4, 3, 2, 1, 0);
55431 uint32x4_t __ret_610;
55432 uint16x4_t __a1_610 = __noswap_vget_high_u16(__rev0_610);
55433 __ret_610 = (uint32x4_t)(__noswap_vshll_n_u16(__a1_610, 0));
55434 __ret_610 = __builtin_shufflevector(__ret_610, __ret_610, 3, 2, 1, 0);
55435 return __ret_610;
5376655436}
53767__ai uint32x4_t __noswap_vmovl_high_u16(uint16x8_t __p0_519) {
53768 uint32x4_t __ret_519;
53769 uint16x4_t __a1_519 = __noswap_vget_high_u16(__p0_519);
53770 __ret_519 = (uint32x4_t)(__noswap_vshll_n_u16(__a1_519, 0));
53771 return __ret_519;
55437__ai uint32x4_t __noswap_vmovl_high_u16(uint16x8_t __p0_611) {
55438 uint32x4_t __ret_611;
55439 uint16x4_t __a1_611 = __noswap_vget_high_u16(__p0_611);
55440 __ret_611 = (uint32x4_t)(__noswap_vshll_n_u16(__a1_611, 0));
55441 return __ret_611;
5377255442}
5377355443#endif
5377455444
5377555445#ifdef __LITTLE_ENDIAN__
53776__ai int16x8_t vmovl_high_s8(int8x16_t __p0_520) {
53777 int16x8_t __ret_520;
53778 int8x8_t __a1_520 = vget_high_s8(__p0_520);
53779 __ret_520 = (int16x8_t)(vshll_n_s8(__a1_520, 0));
53780 return __ret_520;
55446__ai int16x8_t vmovl_high_s8(int8x16_t __p0_612) {
55447 int16x8_t __ret_612;
55448 int8x8_t __a1_612 = vget_high_s8(__p0_612);
55449 __ret_612 = (int16x8_t)(vshll_n_s8(__a1_612, 0));
55450 return __ret_612;
5378155451}
5378255452#else
53783__ai int16x8_t vmovl_high_s8(int8x16_t __p0_521) {
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);
53785 int16x8_t __ret_521;
53786 int8x8_t __a1_521 = __noswap_vget_high_s8(__rev0_521);
53787 __ret_521 = (int16x8_t)(__noswap_vshll_n_s8(__a1_521, 0));
53788 __ret_521 = __builtin_shufflevector(__ret_521, __ret_521, 7, 6, 5, 4, 3, 2, 1, 0);
53789 return __ret_521;
55453__ai int16x8_t vmovl_high_s8(int8x16_t __p0_613) {
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);
55455 int16x8_t __ret_613;
55456 int8x8_t __a1_613 = __noswap_vget_high_s8(__rev0_613);
55457 __ret_613 = (int16x8_t)(__noswap_vshll_n_s8(__a1_613, 0));
55458 __ret_613 = __builtin_shufflevector(__ret_613, __ret_613, 7, 6, 5, 4, 3, 2, 1, 0);
55459 return __ret_613;
5379055460}
53791__ai int16x8_t __noswap_vmovl_high_s8(int8x16_t __p0_522) {
53792 int16x8_t __ret_522;
53793 int8x8_t __a1_522 = __noswap_vget_high_s8(__p0_522);
53794 __ret_522 = (int16x8_t)(__noswap_vshll_n_s8(__a1_522, 0));
53795 return __ret_522;
55461__ai int16x8_t __noswap_vmovl_high_s8(int8x16_t __p0_614) {
55462 int16x8_t __ret_614;
55463 int8x8_t __a1_614 = __noswap_vget_high_s8(__p0_614);
55464 __ret_614 = (int16x8_t)(__noswap_vshll_n_s8(__a1_614, 0));
55465 return __ret_614;
5379655466}
5379755467#endif
5379855468
5379955469#ifdef __LITTLE_ENDIAN__
53800__ai int64x2_t vmovl_high_s32(int32x4_t __p0_523) {
53801 int64x2_t __ret_523;
53802 int32x2_t __a1_523 = vget_high_s32(__p0_523);
53803 __ret_523 = (int64x2_t)(vshll_n_s32(__a1_523, 0));
53804 return __ret_523;
55470__ai int64x2_t vmovl_high_s32(int32x4_t __p0_615) {
55471 int64x2_t __ret_615;
55472 int32x2_t __a1_615 = vget_high_s32(__p0_615);
55473 __ret_615 = (int64x2_t)(vshll_n_s32(__a1_615, 0));
55474 return __ret_615;
5380555475}
5380655476#else
53807__ai int64x2_t vmovl_high_s32(int32x4_t __p0_524) {
53808 int32x4_t __rev0_524; __rev0_524 = __builtin_shufflevector(__p0_524, __p0_524, 3, 2, 1, 0);
53809 int64x2_t __ret_524;
53810 int32x2_t __a1_524 = __noswap_vget_high_s32(__rev0_524);
53811 __ret_524 = (int64x2_t)(__noswap_vshll_n_s32(__a1_524, 0));
53812 __ret_524 = __builtin_shufflevector(__ret_524, __ret_524, 1, 0);
53813 return __ret_524;
55477__ai int64x2_t vmovl_high_s32(int32x4_t __p0_616) {
55478 int32x4_t __rev0_616; __rev0_616 = __builtin_shufflevector(__p0_616, __p0_616, 3, 2, 1, 0);
55479 int64x2_t __ret_616;
55480 int32x2_t __a1_616 = __noswap_vget_high_s32(__rev0_616);
55481 __ret_616 = (int64x2_t)(__noswap_vshll_n_s32(__a1_616, 0));
55482 __ret_616 = __builtin_shufflevector(__ret_616, __ret_616, 1, 0);
55483 return __ret_616;
5381455484}
53815__ai int64x2_t __noswap_vmovl_high_s32(int32x4_t __p0_525) {
53816 int64x2_t __ret_525;
53817 int32x2_t __a1_525 = __noswap_vget_high_s32(__p0_525);
53818 __ret_525 = (int64x2_t)(__noswap_vshll_n_s32(__a1_525, 0));
53819 return __ret_525;
55485__ai int64x2_t __noswap_vmovl_high_s32(int32x4_t __p0_617) {
55486 int64x2_t __ret_617;
55487 int32x2_t __a1_617 = __noswap_vget_high_s32(__p0_617);
55488 __ret_617 = (int64x2_t)(__noswap_vshll_n_s32(__a1_617, 0));
55489 return __ret_617;
5382055490}
5382155491#endif
5382255492
5382355493#ifdef __LITTLE_ENDIAN__
53824__ai int32x4_t vmovl_high_s16(int16x8_t __p0_526) {
53825 int32x4_t __ret_526;
53826 int16x4_t __a1_526 = vget_high_s16(__p0_526);
53827 __ret_526 = (int32x4_t)(vshll_n_s16(__a1_526, 0));
53828 return __ret_526;
55494__ai int32x4_t vmovl_high_s16(int16x8_t __p0_618) {
55495 int32x4_t __ret_618;
55496 int16x4_t __a1_618 = vget_high_s16(__p0_618);
55497 __ret_618 = (int32x4_t)(vshll_n_s16(__a1_618, 0));
55498 return __ret_618;
5382955499}
5383055500#else
53831__ai int32x4_t vmovl_high_s16(int16x8_t __p0_527) {
53832 int16x8_t __rev0_527; __rev0_527 = __builtin_shufflevector(__p0_527, __p0_527, 7, 6, 5, 4, 3, 2, 1, 0);
53833 int32x4_t __ret_527;
53834 int16x4_t __a1_527 = __noswap_vget_high_s16(__rev0_527);
53835 __ret_527 = (int32x4_t)(__noswap_vshll_n_s16(__a1_527, 0));
53836 __ret_527 = __builtin_shufflevector(__ret_527, __ret_527, 3, 2, 1, 0);
53837 return __ret_527;
55501__ai int32x4_t vmovl_high_s16(int16x8_t __p0_619) {
55502 int16x8_t __rev0_619; __rev0_619 = __builtin_shufflevector(__p0_619, __p0_619, 7, 6, 5, 4, 3, 2, 1, 0);
55503 int32x4_t __ret_619;
55504 int16x4_t __a1_619 = __noswap_vget_high_s16(__rev0_619);
55505 __ret_619 = (int32x4_t)(__noswap_vshll_n_s16(__a1_619, 0));
55506 __ret_619 = __builtin_shufflevector(__ret_619, __ret_619, 3, 2, 1, 0);
55507 return __ret_619;
5383855508}
53839__ai int32x4_t __noswap_vmovl_high_s16(int16x8_t __p0_528) {
53840 int32x4_t __ret_528;
53841 int16x4_t __a1_528 = __noswap_vget_high_s16(__p0_528);
53842 __ret_528 = (int32x4_t)(__noswap_vshll_n_s16(__a1_528, 0));
53843 return __ret_528;
55509__ai int32x4_t __noswap_vmovl_high_s16(int16x8_t __p0_620) {
55510 int32x4_t __ret_620;
55511 int16x4_t __a1_620 = __noswap_vget_high_s16(__p0_620);
55512 __ret_620 = (int32x4_t)(__noswap_vshll_n_s16(__a1_620, 0));
55513 return __ret_620;
5384455514}
5384555515#endif
5384655516
......@@ -53968,29 +55638,29 @@ __ai float64x1_t vmul_f64(float64x1_t __p0, float64x1_t __p1) {
5396855638 __ret = __p0 * __p1;
5396955639 return __ret;
5397055640}
53971#define vmuld_lane_f64(__p0_529, __p1_529, __p2_529) __extension__ ({ \
53972 float64_t __s0_529 = __p0_529; \
53973 float64x1_t __s1_529 = __p1_529; \
53974 float64_t __ret_529; \
53975 __ret_529 = __s0_529 * vget_lane_f64(__s1_529, __p2_529); \
53976 __ret_529; \
55641#define vmuld_lane_f64(__p0_621, __p1_621, __p2_621) __extension__ ({ \
55642 float64_t __s0_621 = __p0_621; \
55643 float64x1_t __s1_621 = __p1_621; \
55644 float64_t __ret_621; \
55645 __ret_621 = __s0_621 * vget_lane_f64(__s1_621, __p2_621); \
55646 __ret_621; \
5397755647})
5397855648#ifdef __LITTLE_ENDIAN__
53979#define vmuls_lane_f32(__p0_530, __p1_530, __p2_530) __extension__ ({ \
53980 float32_t __s0_530 = __p0_530; \
53981 float32x2_t __s1_530 = __p1_530; \
53982 float32_t __ret_530; \
53983 __ret_530 = __s0_530 * vget_lane_f32(__s1_530, __p2_530); \
53984 __ret_530; \
55649#define vmuls_lane_f32(__p0_622, __p1_622, __p2_622) __extension__ ({ \
55650 float32_t __s0_622 = __p0_622; \
55651 float32x2_t __s1_622 = __p1_622; \
55652 float32_t __ret_622; \
55653 __ret_622 = __s0_622 * vget_lane_f32(__s1_622, __p2_622); \
55654 __ret_622; \
5398555655})
5398655656#else
53987#define vmuls_lane_f32(__p0_531, __p1_531, __p2_531) __extension__ ({ \
53988 float32_t __s0_531 = __p0_531; \
53989 float32x2_t __s1_531 = __p1_531; \
53990 float32x2_t __rev1_531; __rev1_531 = __builtin_shufflevector(__s1_531, __s1_531, 1, 0); \
53991 float32_t __ret_531; \
53992 __ret_531 = __s0_531 * __noswap_vget_lane_f32(__rev1_531, __p2_531); \
53993 __ret_531; \
55657#define vmuls_lane_f32(__p0_623, __p1_623, __p2_623) __extension__ ({ \
55658 float32_t __s0_623 = __p0_623; \
55659 float32x2_t __s1_623 = __p1_623; \
55660 float32x2_t __rev1_623; __rev1_623 = __builtin_shufflevector(__s1_623, __s1_623, 1, 0); \
55661 float32_t __ret_623; \
55662 __ret_623 = __s0_623 * __noswap_vget_lane_f32(__rev1_623, __p2_623); \
55663 __ret_623; \
5399455664})
5399555665#endif
5399655666
......@@ -54002,60 +55672,60 @@ __ai float64x1_t vmul_f64(float64x1_t __p0, float64x1_t __p1) {
5400255672 __ret; \
5400355673})
5400455674#ifdef __LITTLE_ENDIAN__
54005#define vmulq_lane_f64(__p0_532, __p1_532, __p2_532) __extension__ ({ \
54006 float64x2_t __s0_532 = __p0_532; \
54007 float64x1_t __s1_532 = __p1_532; \
54008 float64x2_t __ret_532; \
54009 __ret_532 = __s0_532 * splatq_lane_f64(__s1_532, __p2_532); \
54010 __ret_532; \
55675#define vmulq_lane_f64(__p0_624, __p1_624, __p2_624) __extension__ ({ \
55676 float64x2_t __s0_624 = __p0_624; \
55677 float64x1_t __s1_624 = __p1_624; \
55678 float64x2_t __ret_624; \
55679 __ret_624 = __s0_624 * splatq_lane_f64(__s1_624, __p2_624); \
55680 __ret_624; \
5401155681})
5401255682#else
54013#define vmulq_lane_f64(__p0_533, __p1_533, __p2_533) __extension__ ({ \
54014 float64x2_t __s0_533 = __p0_533; \
54015 float64x1_t __s1_533 = __p1_533; \
54016 float64x2_t __rev0_533; __rev0_533 = __builtin_shufflevector(__s0_533, __s0_533, 1, 0); \
54017 float64x2_t __ret_533; \
54018 __ret_533 = __rev0_533 * __noswap_splatq_lane_f64(__s1_533, __p2_533); \
54019 __ret_533 = __builtin_shufflevector(__ret_533, __ret_533, 1, 0); \
54020 __ret_533; \
55683#define vmulq_lane_f64(__p0_625, __p1_625, __p2_625) __extension__ ({ \
55684 float64x2_t __s0_625 = __p0_625; \
55685 float64x1_t __s1_625 = __p1_625; \
55686 float64x2_t __rev0_625; __rev0_625 = __builtin_shufflevector(__s0_625, __s0_625, 1, 0); \
55687 float64x2_t __ret_625; \
55688 __ret_625 = __rev0_625 * __noswap_splatq_lane_f64(__s1_625, __p2_625); \
55689 __ret_625 = __builtin_shufflevector(__ret_625, __ret_625, 1, 0); \
55690 __ret_625; \
5402155691})
5402255692#endif
5402355693
5402455694#ifdef __LITTLE_ENDIAN__
54025#define vmuld_laneq_f64(__p0_534, __p1_534, __p2_534) __extension__ ({ \
54026 float64_t __s0_534 = __p0_534; \
54027 float64x2_t __s1_534 = __p1_534; \
54028 float64_t __ret_534; \
54029 __ret_534 = __s0_534 * vgetq_lane_f64(__s1_534, __p2_534); \
54030 __ret_534; \
55695#define vmuld_laneq_f64(__p0_626, __p1_626, __p2_626) __extension__ ({ \
55696 float64_t __s0_626 = __p0_626; \
55697 float64x2_t __s1_626 = __p1_626; \
55698 float64_t __ret_626; \
55699 __ret_626 = __s0_626 * vgetq_lane_f64(__s1_626, __p2_626); \
55700 __ret_626; \
5403155701})
5403255702#else
54033#define vmuld_laneq_f64(__p0_535, __p1_535, __p2_535) __extension__ ({ \
54034 float64_t __s0_535 = __p0_535; \
54035 float64x2_t __s1_535 = __p1_535; \
54036 float64x2_t __rev1_535; __rev1_535 = __builtin_shufflevector(__s1_535, __s1_535, 1, 0); \
54037 float64_t __ret_535; \
54038 __ret_535 = __s0_535 * __noswap_vgetq_lane_f64(__rev1_535, __p2_535); \
54039 __ret_535; \
55703#define vmuld_laneq_f64(__p0_627, __p1_627, __p2_627) __extension__ ({ \
55704 float64_t __s0_627 = __p0_627; \
55705 float64x2_t __s1_627 = __p1_627; \
55706 float64x2_t __rev1_627; __rev1_627 = __builtin_shufflevector(__s1_627, __s1_627, 1, 0); \
55707 float64_t __ret_627; \
55708 __ret_627 = __s0_627 * __noswap_vgetq_lane_f64(__rev1_627, __p2_627); \
55709 __ret_627; \
5404055710})
5404155711#endif
5404255712
5404355713#ifdef __LITTLE_ENDIAN__
54044#define vmuls_laneq_f32(__p0_536, __p1_536, __p2_536) __extension__ ({ \
54045 float32_t __s0_536 = __p0_536; \
54046 float32x4_t __s1_536 = __p1_536; \
54047 float32_t __ret_536; \
54048 __ret_536 = __s0_536 * vgetq_lane_f32(__s1_536, __p2_536); \
54049 __ret_536; \
55714#define vmuls_laneq_f32(__p0_628, __p1_628, __p2_628) __extension__ ({ \
55715 float32_t __s0_628 = __p0_628; \
55716 float32x4_t __s1_628 = __p1_628; \
55717 float32_t __ret_628; \
55718 __ret_628 = __s0_628 * vgetq_lane_f32(__s1_628, __p2_628); \
55719 __ret_628; \
5405055720})
5405155721#else
54052#define vmuls_laneq_f32(__p0_537, __p1_537, __p2_537) __extension__ ({ \
54053 float32_t __s0_537 = __p0_537; \
54054 float32x4_t __s1_537 = __p1_537; \
54055 float32x4_t __rev1_537; __rev1_537 = __builtin_shufflevector(__s1_537, __s1_537, 3, 2, 1, 0); \
54056 float32_t __ret_537; \
54057 __ret_537 = __s0_537 * __noswap_vgetq_lane_f32(__rev1_537, __p2_537); \
54058 __ret_537; \
55722#define vmuls_laneq_f32(__p0_629, __p1_629, __p2_629) __extension__ ({ \
55723 float32_t __s0_629 = __p0_629; \
55724 float32x4_t __s1_629 = __p1_629; \
55725 float32x4_t __rev1_629; __rev1_629 = __builtin_shufflevector(__s1_629, __s1_629, 3, 2, 1, 0); \
55726 float32_t __ret_629; \
55727 __ret_629 = __s0_629 * __noswap_vgetq_lane_f32(__rev1_629, __p2_629); \
55728 __ret_629; \
5405955729})
5406055730#endif
5406155731
......@@ -54079,233 +55749,233 @@ __ai float64x1_t vmul_f64(float64x1_t __p0, float64x1_t __p1) {
5407955749#endif
5408055750
5408155751#ifdef __LITTLE_ENDIAN__
54082#define vmulq_laneq_u32(__p0_538, __p1_538, __p2_538) __extension__ ({ \
54083 uint32x4_t __s0_538 = __p0_538; \
54084 uint32x4_t __s1_538 = __p1_538; \
54085 uint32x4_t __ret_538; \
54086 __ret_538 = __s0_538 * splatq_laneq_u32(__s1_538, __p2_538); \
54087 __ret_538; \
55752#define vmulq_laneq_u32(__p0_630, __p1_630, __p2_630) __extension__ ({ \
55753 uint32x4_t __s0_630 = __p0_630; \
55754 uint32x4_t __s1_630 = __p1_630; \
55755 uint32x4_t __ret_630; \
55756 __ret_630 = __s0_630 * splatq_laneq_u32(__s1_630, __p2_630); \
55757 __ret_630; \
5408855758})
5408955759#else
54090#define vmulq_laneq_u32(__p0_539, __p1_539, __p2_539) __extension__ ({ \
54091 uint32x4_t __s0_539 = __p0_539; \
54092 uint32x4_t __s1_539 = __p1_539; \
54093 uint32x4_t __rev0_539; __rev0_539 = __builtin_shufflevector(__s0_539, __s0_539, 3, 2, 1, 0); \
54094 uint32x4_t __rev1_539; __rev1_539 = __builtin_shufflevector(__s1_539, __s1_539, 3, 2, 1, 0); \
54095 uint32x4_t __ret_539; \
54096 __ret_539 = __rev0_539 * __noswap_splatq_laneq_u32(__rev1_539, __p2_539); \
54097 __ret_539 = __builtin_shufflevector(__ret_539, __ret_539, 3, 2, 1, 0); \
54098 __ret_539; \
55760#define vmulq_laneq_u32(__p0_631, __p1_631, __p2_631) __extension__ ({ \
55761 uint32x4_t __s0_631 = __p0_631; \
55762 uint32x4_t __s1_631 = __p1_631; \
55763 uint32x4_t __rev0_631; __rev0_631 = __builtin_shufflevector(__s0_631, __s0_631, 3, 2, 1, 0); \
55764 uint32x4_t __rev1_631; __rev1_631 = __builtin_shufflevector(__s1_631, __s1_631, 3, 2, 1, 0); \
55765 uint32x4_t __ret_631; \
55766 __ret_631 = __rev0_631 * __noswap_splatq_laneq_u32(__rev1_631, __p2_631); \
55767 __ret_631 = __builtin_shufflevector(__ret_631, __ret_631, 3, 2, 1, 0); \
55768 __ret_631; \
5409955769})
5410055770#endif
5410155771
5410255772#ifdef __LITTLE_ENDIAN__
54103#define vmulq_laneq_u16(__p0_540, __p1_540, __p2_540) __extension__ ({ \
54104 uint16x8_t __s0_540 = __p0_540; \
54105 uint16x8_t __s1_540 = __p1_540; \
54106 uint16x8_t __ret_540; \
54107 __ret_540 = __s0_540 * splatq_laneq_u16(__s1_540, __p2_540); \
54108 __ret_540; \
55773#define vmulq_laneq_u16(__p0_632, __p1_632, __p2_632) __extension__ ({ \
55774 uint16x8_t __s0_632 = __p0_632; \
55775 uint16x8_t __s1_632 = __p1_632; \
55776 uint16x8_t __ret_632; \
55777 __ret_632 = __s0_632 * splatq_laneq_u16(__s1_632, __p2_632); \
55778 __ret_632; \
5410955779})
5411055780#else
54111#define vmulq_laneq_u16(__p0_541, __p1_541, __p2_541) __extension__ ({ \
54112 uint16x8_t __s0_541 = __p0_541; \
54113 uint16x8_t __s1_541 = __p1_541; \
54114 uint16x8_t __rev0_541; __rev0_541 = __builtin_shufflevector(__s0_541, __s0_541, 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); \
54116 uint16x8_t __ret_541; \
54117 __ret_541 = __rev0_541 * __noswap_splatq_laneq_u16(__rev1_541, __p2_541); \
54118 __ret_541 = __builtin_shufflevector(__ret_541, __ret_541, 7, 6, 5, 4, 3, 2, 1, 0); \
54119 __ret_541; \
55781#define vmulq_laneq_u16(__p0_633, __p1_633, __p2_633) __extension__ ({ \
55782 uint16x8_t __s0_633 = __p0_633; \
55783 uint16x8_t __s1_633 = __p1_633; \
55784 uint16x8_t __rev0_633; __rev0_633 = __builtin_shufflevector(__s0_633, __s0_633, 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); \
55786 uint16x8_t __ret_633; \
55787 __ret_633 = __rev0_633 * __noswap_splatq_laneq_u16(__rev1_633, __p2_633); \
55788 __ret_633 = __builtin_shufflevector(__ret_633, __ret_633, 7, 6, 5, 4, 3, 2, 1, 0); \
55789 __ret_633; \
5412055790})
5412155791#endif
5412255792
5412355793#ifdef __LITTLE_ENDIAN__
54124#define vmulq_laneq_f64(__p0_542, __p1_542, __p2_542) __extension__ ({ \
54125 float64x2_t __s0_542 = __p0_542; \
54126 float64x2_t __s1_542 = __p1_542; \
54127 float64x2_t __ret_542; \
54128 __ret_542 = __s0_542 * splatq_laneq_f64(__s1_542, __p2_542); \
54129 __ret_542; \
55794#define vmulq_laneq_f64(__p0_634, __p1_634, __p2_634) __extension__ ({ \
55795 float64x2_t __s0_634 = __p0_634; \
55796 float64x2_t __s1_634 = __p1_634; \
55797 float64x2_t __ret_634; \
55798 __ret_634 = __s0_634 * splatq_laneq_f64(__s1_634, __p2_634); \
55799 __ret_634; \
5413055800})
5413155801#else
54132#define vmulq_laneq_f64(__p0_543, __p1_543, __p2_543) __extension__ ({ \
54133 float64x2_t __s0_543 = __p0_543; \
54134 float64x2_t __s1_543 = __p1_543; \
54135 float64x2_t __rev0_543; __rev0_543 = __builtin_shufflevector(__s0_543, __s0_543, 1, 0); \
54136 float64x2_t __rev1_543; __rev1_543 = __builtin_shufflevector(__s1_543, __s1_543, 1, 0); \
54137 float64x2_t __ret_543; \
54138 __ret_543 = __rev0_543 * __noswap_splatq_laneq_f64(__rev1_543, __p2_543); \
54139 __ret_543 = __builtin_shufflevector(__ret_543, __ret_543, 1, 0); \
54140 __ret_543; \
55802#define vmulq_laneq_f64(__p0_635, __p1_635, __p2_635) __extension__ ({ \
55803 float64x2_t __s0_635 = __p0_635; \
55804 float64x2_t __s1_635 = __p1_635; \
55805 float64x2_t __rev0_635; __rev0_635 = __builtin_shufflevector(__s0_635, __s0_635, 1, 0); \
55806 float64x2_t __rev1_635; __rev1_635 = __builtin_shufflevector(__s1_635, __s1_635, 1, 0); \
55807 float64x2_t __ret_635; \
55808 __ret_635 = __rev0_635 * __noswap_splatq_laneq_f64(__rev1_635, __p2_635); \
55809 __ret_635 = __builtin_shufflevector(__ret_635, __ret_635, 1, 0); \
55810 __ret_635; \
5414155811})
5414255812#endif
5414355813
5414455814#ifdef __LITTLE_ENDIAN__
54145#define vmulq_laneq_f32(__p0_544, __p1_544, __p2_544) __extension__ ({ \
54146 float32x4_t __s0_544 = __p0_544; \
54147 float32x4_t __s1_544 = __p1_544; \
54148 float32x4_t __ret_544; \
54149 __ret_544 = __s0_544 * splatq_laneq_f32(__s1_544, __p2_544); \
54150 __ret_544; \
55815#define vmulq_laneq_f32(__p0_636, __p1_636, __p2_636) __extension__ ({ \
55816 float32x4_t __s0_636 = __p0_636; \
55817 float32x4_t __s1_636 = __p1_636; \
55818 float32x4_t __ret_636; \
55819 __ret_636 = __s0_636 * splatq_laneq_f32(__s1_636, __p2_636); \
55820 __ret_636; \
5415155821})
5415255822#else
54153#define vmulq_laneq_f32(__p0_545, __p1_545, __p2_545) __extension__ ({ \
54154 float32x4_t __s0_545 = __p0_545; \
54155 float32x4_t __s1_545 = __p1_545; \
54156 float32x4_t __rev0_545; __rev0_545 = __builtin_shufflevector(__s0_545, __s0_545, 3, 2, 1, 0); \
54157 float32x4_t __rev1_545; __rev1_545 = __builtin_shufflevector(__s1_545, __s1_545, 3, 2, 1, 0); \
54158 float32x4_t __ret_545; \
54159 __ret_545 = __rev0_545 * __noswap_splatq_laneq_f32(__rev1_545, __p2_545); \
54160 __ret_545 = __builtin_shufflevector(__ret_545, __ret_545, 3, 2, 1, 0); \
54161 __ret_545; \
55823#define vmulq_laneq_f32(__p0_637, __p1_637, __p2_637) __extension__ ({ \
55824 float32x4_t __s0_637 = __p0_637; \
55825 float32x4_t __s1_637 = __p1_637; \
55826 float32x4_t __rev0_637; __rev0_637 = __builtin_shufflevector(__s0_637, __s0_637, 3, 2, 1, 0); \
55827 float32x4_t __rev1_637; __rev1_637 = __builtin_shufflevector(__s1_637, __s1_637, 3, 2, 1, 0); \
55828 float32x4_t __ret_637; \
55829 __ret_637 = __rev0_637 * __noswap_splatq_laneq_f32(__rev1_637, __p2_637); \
55830 __ret_637 = __builtin_shufflevector(__ret_637, __ret_637, 3, 2, 1, 0); \
55831 __ret_637; \
5416255832})
5416355833#endif
5416455834
5416555835#ifdef __LITTLE_ENDIAN__
54166#define vmulq_laneq_s32(__p0_546, __p1_546, __p2_546) __extension__ ({ \
54167 int32x4_t __s0_546 = __p0_546; \
54168 int32x4_t __s1_546 = __p1_546; \
54169 int32x4_t __ret_546; \
54170 __ret_546 = __s0_546 * splatq_laneq_s32(__s1_546, __p2_546); \
54171 __ret_546; \
55836#define vmulq_laneq_s32(__p0_638, __p1_638, __p2_638) __extension__ ({ \
55837 int32x4_t __s0_638 = __p0_638; \
55838 int32x4_t __s1_638 = __p1_638; \
55839 int32x4_t __ret_638; \
55840 __ret_638 = __s0_638 * splatq_laneq_s32(__s1_638, __p2_638); \
55841 __ret_638; \
5417255842})
5417355843#else
54174#define vmulq_laneq_s32(__p0_547, __p1_547, __p2_547) __extension__ ({ \
54175 int32x4_t __s0_547 = __p0_547; \
54176 int32x4_t __s1_547 = __p1_547; \
54177 int32x4_t __rev0_547; __rev0_547 = __builtin_shufflevector(__s0_547, __s0_547, 3, 2, 1, 0); \
54178 int32x4_t __rev1_547; __rev1_547 = __builtin_shufflevector(__s1_547, __s1_547, 3, 2, 1, 0); \
54179 int32x4_t __ret_547; \
54180 __ret_547 = __rev0_547 * __noswap_splatq_laneq_s32(__rev1_547, __p2_547); \
54181 __ret_547 = __builtin_shufflevector(__ret_547, __ret_547, 3, 2, 1, 0); \
54182 __ret_547; \
55844#define vmulq_laneq_s32(__p0_639, __p1_639, __p2_639) __extension__ ({ \
55845 int32x4_t __s0_639 = __p0_639; \
55846 int32x4_t __s1_639 = __p1_639; \
55847 int32x4_t __rev0_639; __rev0_639 = __builtin_shufflevector(__s0_639, __s0_639, 3, 2, 1, 0); \
55848 int32x4_t __rev1_639; __rev1_639 = __builtin_shufflevector(__s1_639, __s1_639, 3, 2, 1, 0); \
55849 int32x4_t __ret_639; \
55850 __ret_639 = __rev0_639 * __noswap_splatq_laneq_s32(__rev1_639, __p2_639); \
55851 __ret_639 = __builtin_shufflevector(__ret_639, __ret_639, 3, 2, 1, 0); \
55852 __ret_639; \
5418355853})
5418455854#endif
5418555855
5418655856#ifdef __LITTLE_ENDIAN__
54187#define vmulq_laneq_s16(__p0_548, __p1_548, __p2_548) __extension__ ({ \
54188 int16x8_t __s0_548 = __p0_548; \
54189 int16x8_t __s1_548 = __p1_548; \
54190 int16x8_t __ret_548; \
54191 __ret_548 = __s0_548 * splatq_laneq_s16(__s1_548, __p2_548); \
54192 __ret_548; \
55857#define vmulq_laneq_s16(__p0_640, __p1_640, __p2_640) __extension__ ({ \
55858 int16x8_t __s0_640 = __p0_640; \
55859 int16x8_t __s1_640 = __p1_640; \
55860 int16x8_t __ret_640; \
55861 __ret_640 = __s0_640 * splatq_laneq_s16(__s1_640, __p2_640); \
55862 __ret_640; \
5419355863})
5419455864#else
54195#define vmulq_laneq_s16(__p0_549, __p1_549, __p2_549) __extension__ ({ \
54196 int16x8_t __s0_549 = __p0_549; \
54197 int16x8_t __s1_549 = __p1_549; \
54198 int16x8_t __rev0_549; __rev0_549 = __builtin_shufflevector(__s0_549, __s0_549, 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); \
54200 int16x8_t __ret_549; \
54201 __ret_549 = __rev0_549 * __noswap_splatq_laneq_s16(__rev1_549, __p2_549); \
54202 __ret_549 = __builtin_shufflevector(__ret_549, __ret_549, 7, 6, 5, 4, 3, 2, 1, 0); \
54203 __ret_549; \
55865#define vmulq_laneq_s16(__p0_641, __p1_641, __p2_641) __extension__ ({ \
55866 int16x8_t __s0_641 = __p0_641; \
55867 int16x8_t __s1_641 = __p1_641; \
55868 int16x8_t __rev0_641; __rev0_641 = __builtin_shufflevector(__s0_641, __s0_641, 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); \
55870 int16x8_t __ret_641; \
55871 __ret_641 = __rev0_641 * __noswap_splatq_laneq_s16(__rev1_641, __p2_641); \
55872 __ret_641 = __builtin_shufflevector(__ret_641, __ret_641, 7, 6, 5, 4, 3, 2, 1, 0); \
55873 __ret_641; \
5420455874})
5420555875#endif
5420655876
5420755877#ifdef __LITTLE_ENDIAN__
54208#define vmul_laneq_u32(__p0_550, __p1_550, __p2_550) __extension__ ({ \
54209 uint32x2_t __s0_550 = __p0_550; \
54210 uint32x4_t __s1_550 = __p1_550; \
54211 uint32x2_t __ret_550; \
54212 __ret_550 = __s0_550 * splat_laneq_u32(__s1_550, __p2_550); \
54213 __ret_550; \
55878#define vmul_laneq_u32(__p0_642, __p1_642, __p2_642) __extension__ ({ \
55879 uint32x2_t __s0_642 = __p0_642; \
55880 uint32x4_t __s1_642 = __p1_642; \
55881 uint32x2_t __ret_642; \
55882 __ret_642 = __s0_642 * splat_laneq_u32(__s1_642, __p2_642); \
55883 __ret_642; \
5421455884})
5421555885#else
54216#define vmul_laneq_u32(__p0_551, __p1_551, __p2_551) __extension__ ({ \
54217 uint32x2_t __s0_551 = __p0_551; \
54218 uint32x4_t __s1_551 = __p1_551; \
54219 uint32x2_t __rev0_551; __rev0_551 = __builtin_shufflevector(__s0_551, __s0_551, 1, 0); \
54220 uint32x4_t __rev1_551; __rev1_551 = __builtin_shufflevector(__s1_551, __s1_551, 3, 2, 1, 0); \
54221 uint32x2_t __ret_551; \
54222 __ret_551 = __rev0_551 * __noswap_splat_laneq_u32(__rev1_551, __p2_551); \
54223 __ret_551 = __builtin_shufflevector(__ret_551, __ret_551, 1, 0); \
54224 __ret_551; \
55886#define vmul_laneq_u32(__p0_643, __p1_643, __p2_643) __extension__ ({ \
55887 uint32x2_t __s0_643 = __p0_643; \
55888 uint32x4_t __s1_643 = __p1_643; \
55889 uint32x2_t __rev0_643; __rev0_643 = __builtin_shufflevector(__s0_643, __s0_643, 1, 0); \
55890 uint32x4_t __rev1_643; __rev1_643 = __builtin_shufflevector(__s1_643, __s1_643, 3, 2, 1, 0); \
55891 uint32x2_t __ret_643; \
55892 __ret_643 = __rev0_643 * __noswap_splat_laneq_u32(__rev1_643, __p2_643); \
55893 __ret_643 = __builtin_shufflevector(__ret_643, __ret_643, 1, 0); \
55894 __ret_643; \
5422555895})
5422655896#endif
5422755897
5422855898#ifdef __LITTLE_ENDIAN__
54229#define vmul_laneq_u16(__p0_552, __p1_552, __p2_552) __extension__ ({ \
54230 uint16x4_t __s0_552 = __p0_552; \
54231 uint16x8_t __s1_552 = __p1_552; \
54232 uint16x4_t __ret_552; \
54233 __ret_552 = __s0_552 * splat_laneq_u16(__s1_552, __p2_552); \
54234 __ret_552; \
55899#define vmul_laneq_u16(__p0_644, __p1_644, __p2_644) __extension__ ({ \
55900 uint16x4_t __s0_644 = __p0_644; \
55901 uint16x8_t __s1_644 = __p1_644; \
55902 uint16x4_t __ret_644; \
55903 __ret_644 = __s0_644 * splat_laneq_u16(__s1_644, __p2_644); \
55904 __ret_644; \
5423555905})
5423655906#else
54237#define vmul_laneq_u16(__p0_553, __p1_553, __p2_553) __extension__ ({ \
54238 uint16x4_t __s0_553 = __p0_553; \
54239 uint16x8_t __s1_553 = __p1_553; \
54240 uint16x4_t __rev0_553; __rev0_553 = __builtin_shufflevector(__s0_553, __s0_553, 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); \
54242 uint16x4_t __ret_553; \
54243 __ret_553 = __rev0_553 * __noswap_splat_laneq_u16(__rev1_553, __p2_553); \
54244 __ret_553 = __builtin_shufflevector(__ret_553, __ret_553, 3, 2, 1, 0); \
54245 __ret_553; \
55907#define vmul_laneq_u16(__p0_645, __p1_645, __p2_645) __extension__ ({ \
55908 uint16x4_t __s0_645 = __p0_645; \
55909 uint16x8_t __s1_645 = __p1_645; \
55910 uint16x4_t __rev0_645; __rev0_645 = __builtin_shufflevector(__s0_645, __s0_645, 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); \
55912 uint16x4_t __ret_645; \
55913 __ret_645 = __rev0_645 * __noswap_splat_laneq_u16(__rev1_645, __p2_645); \
55914 __ret_645 = __builtin_shufflevector(__ret_645, __ret_645, 3, 2, 1, 0); \
55915 __ret_645; \
5424655916})
5424755917#endif
5424855918
5424955919#ifdef __LITTLE_ENDIAN__
54250#define vmul_laneq_f32(__p0_554, __p1_554, __p2_554) __extension__ ({ \
54251 float32x2_t __s0_554 = __p0_554; \
54252 float32x4_t __s1_554 = __p1_554; \
54253 float32x2_t __ret_554; \
54254 __ret_554 = __s0_554 * splat_laneq_f32(__s1_554, __p2_554); \
54255 __ret_554; \
55920#define vmul_laneq_f32(__p0_646, __p1_646, __p2_646) __extension__ ({ \
55921 float32x2_t __s0_646 = __p0_646; \
55922 float32x4_t __s1_646 = __p1_646; \
55923 float32x2_t __ret_646; \
55924 __ret_646 = __s0_646 * splat_laneq_f32(__s1_646, __p2_646); \
55925 __ret_646; \
5425655926})
5425755927#else
54258#define vmul_laneq_f32(__p0_555, __p1_555, __p2_555) __extension__ ({ \
54259 float32x2_t __s0_555 = __p0_555; \
54260 float32x4_t __s1_555 = __p1_555; \
54261 float32x2_t __rev0_555; __rev0_555 = __builtin_shufflevector(__s0_555, __s0_555, 1, 0); \
54262 float32x4_t __rev1_555; __rev1_555 = __builtin_shufflevector(__s1_555, __s1_555, 3, 2, 1, 0); \
54263 float32x2_t __ret_555; \
54264 __ret_555 = __rev0_555 * __noswap_splat_laneq_f32(__rev1_555, __p2_555); \
54265 __ret_555 = __builtin_shufflevector(__ret_555, __ret_555, 1, 0); \
54266 __ret_555; \
55928#define vmul_laneq_f32(__p0_647, __p1_647, __p2_647) __extension__ ({ \
55929 float32x2_t __s0_647 = __p0_647; \
55930 float32x4_t __s1_647 = __p1_647; \
55931 float32x2_t __rev0_647; __rev0_647 = __builtin_shufflevector(__s0_647, __s0_647, 1, 0); \
55932 float32x4_t __rev1_647; __rev1_647 = __builtin_shufflevector(__s1_647, __s1_647, 3, 2, 1, 0); \
55933 float32x2_t __ret_647; \
55934 __ret_647 = __rev0_647 * __noswap_splat_laneq_f32(__rev1_647, __p2_647); \
55935 __ret_647 = __builtin_shufflevector(__ret_647, __ret_647, 1, 0); \
55936 __ret_647; \
5426755937})
5426855938#endif
5426955939
5427055940#ifdef __LITTLE_ENDIAN__
54271#define vmul_laneq_s32(__p0_556, __p1_556, __p2_556) __extension__ ({ \
54272 int32x2_t __s0_556 = __p0_556; \
54273 int32x4_t __s1_556 = __p1_556; \
54274 int32x2_t __ret_556; \
54275 __ret_556 = __s0_556 * splat_laneq_s32(__s1_556, __p2_556); \
54276 __ret_556; \
55941#define vmul_laneq_s32(__p0_648, __p1_648, __p2_648) __extension__ ({ \
55942 int32x2_t __s0_648 = __p0_648; \
55943 int32x4_t __s1_648 = __p1_648; \
55944 int32x2_t __ret_648; \
55945 __ret_648 = __s0_648 * splat_laneq_s32(__s1_648, __p2_648); \
55946 __ret_648; \
5427755947})
5427855948#else
54279#define vmul_laneq_s32(__p0_557, __p1_557, __p2_557) __extension__ ({ \
54280 int32x2_t __s0_557 = __p0_557; \
54281 int32x4_t __s1_557 = __p1_557; \
54282 int32x2_t __rev0_557; __rev0_557 = __builtin_shufflevector(__s0_557, __s0_557, 1, 0); \
54283 int32x4_t __rev1_557; __rev1_557 = __builtin_shufflevector(__s1_557, __s1_557, 3, 2, 1, 0); \
54284 int32x2_t __ret_557; \
54285 __ret_557 = __rev0_557 * __noswap_splat_laneq_s32(__rev1_557, __p2_557); \
54286 __ret_557 = __builtin_shufflevector(__ret_557, __ret_557, 1, 0); \
54287 __ret_557; \
55949#define vmul_laneq_s32(__p0_649, __p1_649, __p2_649) __extension__ ({ \
55950 int32x2_t __s0_649 = __p0_649; \
55951 int32x4_t __s1_649 = __p1_649; \
55952 int32x2_t __rev0_649; __rev0_649 = __builtin_shufflevector(__s0_649, __s0_649, 1, 0); \
55953 int32x4_t __rev1_649; __rev1_649 = __builtin_shufflevector(__s1_649, __s1_649, 3, 2, 1, 0); \
55954 int32x2_t __ret_649; \
55955 __ret_649 = __rev0_649 * __noswap_splat_laneq_s32(__rev1_649, __p2_649); \
55956 __ret_649 = __builtin_shufflevector(__ret_649, __ret_649, 1, 0); \
55957 __ret_649; \
5428855958})
5428955959#endif
5429055960
5429155961#ifdef __LITTLE_ENDIAN__
54292#define vmul_laneq_s16(__p0_558, __p1_558, __p2_558) __extension__ ({ \
54293 int16x4_t __s0_558 = __p0_558; \
54294 int16x8_t __s1_558 = __p1_558; \
54295 int16x4_t __ret_558; \
54296 __ret_558 = __s0_558 * splat_laneq_s16(__s1_558, __p2_558); \
54297 __ret_558; \
55962#define vmul_laneq_s16(__p0_650, __p1_650, __p2_650) __extension__ ({ \
55963 int16x4_t __s0_650 = __p0_650; \
55964 int16x8_t __s1_650 = __p1_650; \
55965 int16x4_t __ret_650; \
55966 __ret_650 = __s0_650 * splat_laneq_s16(__s1_650, __p2_650); \
55967 __ret_650; \
5429855968})
5429955969#else
54300#define vmul_laneq_s16(__p0_559, __p1_559, __p2_559) __extension__ ({ \
54301 int16x4_t __s0_559 = __p0_559; \
54302 int16x8_t __s1_559 = __p1_559; \
54303 int16x4_t __rev0_559; __rev0_559 = __builtin_shufflevector(__s0_559, __s0_559, 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); \
54305 int16x4_t __ret_559; \
54306 __ret_559 = __rev0_559 * __noswap_splat_laneq_s16(__rev1_559, __p2_559); \
54307 __ret_559 = __builtin_shufflevector(__ret_559, __ret_559, 3, 2, 1, 0); \
54308 __ret_559; \
55970#define vmul_laneq_s16(__p0_651, __p1_651, __p2_651) __extension__ ({ \
55971 int16x4_t __s0_651 = __p0_651; \
55972 int16x8_t __s1_651 = __p1_651; \
55973 int16x4_t __rev0_651; __rev0_651 = __builtin_shufflevector(__s0_651, __s0_651, 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); \
55975 int16x4_t __ret_651; \
55976 __ret_651 = __rev0_651 * __noswap_splat_laneq_s16(__rev1_651, __p2_651); \
55977 __ret_651 = __builtin_shufflevector(__ret_651, __ret_651, 3, 2, 1, 0); \
55978 __ret_651; \
5430955979})
5431055980#endif
5431155981
......@@ -54471,170 +56141,170 @@ __ai poly128_t vmull_high_p64(poly64x2_t __p0, poly64x2_t __p1) {
5447156141#endif
5447256142
5447356143#ifdef __LITTLE_ENDIAN__
54474#define vmull_high_lane_u32(__p0_560, __p1_560, __p2_560) __extension__ ({ \
54475 uint32x4_t __s0_560 = __p0_560; \
54476 uint32x2_t __s1_560 = __p1_560; \
54477 uint64x2_t __ret_560; \
54478 __ret_560 = vmull_u32(vget_high_u32(__s0_560), splat_lane_u32(__s1_560, __p2_560)); \
54479 __ret_560; \
56144#define vmull_high_lane_u32(__p0_652, __p1_652, __p2_652) __extension__ ({ \
56145 uint32x4_t __s0_652 = __p0_652; \
56146 uint32x2_t __s1_652 = __p1_652; \
56147 uint64x2_t __ret_652; \
56148 __ret_652 = vmull_u32(vget_high_u32(__s0_652), splat_lane_u32(__s1_652, __p2_652)); \
56149 __ret_652; \
5448056150})
5448156151#else
54482#define vmull_high_lane_u32(__p0_561, __p1_561, __p2_561) __extension__ ({ \
54483 uint32x4_t __s0_561 = __p0_561; \
54484 uint32x2_t __s1_561 = __p1_561; \
54485 uint32x4_t __rev0_561; __rev0_561 = __builtin_shufflevector(__s0_561, __s0_561, 3, 2, 1, 0); \
54486 uint32x2_t __rev1_561; __rev1_561 = __builtin_shufflevector(__s1_561, __s1_561, 1, 0); \
54487 uint64x2_t __ret_561; \
54488 __ret_561 = __noswap_vmull_u32(__noswap_vget_high_u32(__rev0_561), __noswap_splat_lane_u32(__rev1_561, __p2_561)); \
54489 __ret_561 = __builtin_shufflevector(__ret_561, __ret_561, 1, 0); \
54490 __ret_561; \
56152#define vmull_high_lane_u32(__p0_653, __p1_653, __p2_653) __extension__ ({ \
56153 uint32x4_t __s0_653 = __p0_653; \
56154 uint32x2_t __s1_653 = __p1_653; \
56155 uint32x4_t __rev0_653; __rev0_653 = __builtin_shufflevector(__s0_653, __s0_653, 3, 2, 1, 0); \
56156 uint32x2_t __rev1_653; __rev1_653 = __builtin_shufflevector(__s1_653, __s1_653, 1, 0); \
56157 uint64x2_t __ret_653; \
56158 __ret_653 = __noswap_vmull_u32(__noswap_vget_high_u32(__rev0_653), __noswap_splat_lane_u32(__rev1_653, __p2_653)); \
56159 __ret_653 = __builtin_shufflevector(__ret_653, __ret_653, 1, 0); \
56160 __ret_653; \
5449156161})
5449256162#endif
5449356163
5449456164#ifdef __LITTLE_ENDIAN__
54495#define vmull_high_lane_u16(__p0_562, __p1_562, __p2_562) __extension__ ({ \
54496 uint16x8_t __s0_562 = __p0_562; \
54497 uint16x4_t __s1_562 = __p1_562; \
54498 uint32x4_t __ret_562; \
54499 __ret_562 = vmull_u16(vget_high_u16(__s0_562), splat_lane_u16(__s1_562, __p2_562)); \
54500 __ret_562; \
56165#define vmull_high_lane_u16(__p0_654, __p1_654, __p2_654) __extension__ ({ \
56166 uint16x8_t __s0_654 = __p0_654; \
56167 uint16x4_t __s1_654 = __p1_654; \
56168 uint32x4_t __ret_654; \
56169 __ret_654 = vmull_u16(vget_high_u16(__s0_654), splat_lane_u16(__s1_654, __p2_654)); \
56170 __ret_654; \
5450156171})
5450256172#else
54503#define vmull_high_lane_u16(__p0_563, __p1_563, __p2_563) __extension__ ({ \
54504 uint16x8_t __s0_563 = __p0_563; \
54505 uint16x4_t __s1_563 = __p1_563; \
54506 uint16x8_t __rev0_563; __rev0_563 = __builtin_shufflevector(__s0_563, __s0_563, 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); \
54508 uint32x4_t __ret_563; \
54509 __ret_563 = __noswap_vmull_u16(__noswap_vget_high_u16(__rev0_563), __noswap_splat_lane_u16(__rev1_563, __p2_563)); \
54510 __ret_563 = __builtin_shufflevector(__ret_563, __ret_563, 3, 2, 1, 0); \
54511 __ret_563; \
56173#define vmull_high_lane_u16(__p0_655, __p1_655, __p2_655) __extension__ ({ \
56174 uint16x8_t __s0_655 = __p0_655; \
56175 uint16x4_t __s1_655 = __p1_655; \
56176 uint16x8_t __rev0_655; __rev0_655 = __builtin_shufflevector(__s0_655, __s0_655, 7, 6, 5, 4, 3, 2, 1, 0); \
56177 uint16x4_t __rev1_655; __rev1_655 = __builtin_shufflevector(__s1_655, __s1_655, 3, 2, 1, 0); \
56178 uint32x4_t __ret_655; \
56179 __ret_655 = __noswap_vmull_u16(__noswap_vget_high_u16(__rev0_655), __noswap_splat_lane_u16(__rev1_655, __p2_655)); \
56180 __ret_655 = __builtin_shufflevector(__ret_655, __ret_655, 3, 2, 1, 0); \
56181 __ret_655; \
5451256182})
5451356183#endif
5451456184
5451556185#ifdef __LITTLE_ENDIAN__
54516#define vmull_high_lane_s32(__p0_564, __p1_564, __p2_564) __extension__ ({ \
54517 int32x4_t __s0_564 = __p0_564; \
54518 int32x2_t __s1_564 = __p1_564; \
54519 int64x2_t __ret_564; \
54520 __ret_564 = vmull_s32(vget_high_s32(__s0_564), splat_lane_s32(__s1_564, __p2_564)); \
54521 __ret_564; \
56186#define vmull_high_lane_s32(__p0_656, __p1_656, __p2_656) __extension__ ({ \
56187 int32x4_t __s0_656 = __p0_656; \
56188 int32x2_t __s1_656 = __p1_656; \
56189 int64x2_t __ret_656; \
56190 __ret_656 = vmull_s32(vget_high_s32(__s0_656), splat_lane_s32(__s1_656, __p2_656)); \
56191 __ret_656; \
5452256192})
5452356193#else
54524#define vmull_high_lane_s32(__p0_565, __p1_565, __p2_565) __extension__ ({ \
54525 int32x4_t __s0_565 = __p0_565; \
54526 int32x2_t __s1_565 = __p1_565; \
54527 int32x4_t __rev0_565; __rev0_565 = __builtin_shufflevector(__s0_565, __s0_565, 3, 2, 1, 0); \
54528 int32x2_t __rev1_565; __rev1_565 = __builtin_shufflevector(__s1_565, __s1_565, 1, 0); \
54529 int64x2_t __ret_565; \
54530 __ret_565 = __noswap_vmull_s32(__noswap_vget_high_s32(__rev0_565), __noswap_splat_lane_s32(__rev1_565, __p2_565)); \
54531 __ret_565 = __builtin_shufflevector(__ret_565, __ret_565, 1, 0); \
54532 __ret_565; \
56194#define vmull_high_lane_s32(__p0_657, __p1_657, __p2_657) __extension__ ({ \
56195 int32x4_t __s0_657 = __p0_657; \
56196 int32x2_t __s1_657 = __p1_657; \
56197 int32x4_t __rev0_657; __rev0_657 = __builtin_shufflevector(__s0_657, __s0_657, 3, 2, 1, 0); \
56198 int32x2_t __rev1_657; __rev1_657 = __builtin_shufflevector(__s1_657, __s1_657, 1, 0); \
56199 int64x2_t __ret_657; \
56200 __ret_657 = __noswap_vmull_s32(__noswap_vget_high_s32(__rev0_657), __noswap_splat_lane_s32(__rev1_657, __p2_657)); \
56201 __ret_657 = __builtin_shufflevector(__ret_657, __ret_657, 1, 0); \
56202 __ret_657; \
5453356203})
5453456204#endif
5453556205
5453656206#ifdef __LITTLE_ENDIAN__
54537#define vmull_high_lane_s16(__p0_566, __p1_566, __p2_566) __extension__ ({ \
54538 int16x8_t __s0_566 = __p0_566; \
54539 int16x4_t __s1_566 = __p1_566; \
54540 int32x4_t __ret_566; \
54541 __ret_566 = vmull_s16(vget_high_s16(__s0_566), splat_lane_s16(__s1_566, __p2_566)); \
54542 __ret_566; \
56207#define vmull_high_lane_s16(__p0_658, __p1_658, __p2_658) __extension__ ({ \
56208 int16x8_t __s0_658 = __p0_658; \
56209 int16x4_t __s1_658 = __p1_658; \
56210 int32x4_t __ret_658; \
56211 __ret_658 = vmull_s16(vget_high_s16(__s0_658), splat_lane_s16(__s1_658, __p2_658)); \
56212 __ret_658; \
5454356213})
5454456214#else
54545#define vmull_high_lane_s16(__p0_567, __p1_567, __p2_567) __extension__ ({ \
54546 int16x8_t __s0_567 = __p0_567; \
54547 int16x4_t __s1_567 = __p1_567; \
54548 int16x8_t __rev0_567; __rev0_567 = __builtin_shufflevector(__s0_567, __s0_567, 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); \
54550 int32x4_t __ret_567; \
54551 __ret_567 = __noswap_vmull_s16(__noswap_vget_high_s16(__rev0_567), __noswap_splat_lane_s16(__rev1_567, __p2_567)); \
54552 __ret_567 = __builtin_shufflevector(__ret_567, __ret_567, 3, 2, 1, 0); \
54553 __ret_567; \
56215#define vmull_high_lane_s16(__p0_659, __p1_659, __p2_659) __extension__ ({ \
56216 int16x8_t __s0_659 = __p0_659; \
56217 int16x4_t __s1_659 = __p1_659; \
56218 int16x8_t __rev0_659; __rev0_659 = __builtin_shufflevector(__s0_659, __s0_659, 7, 6, 5, 4, 3, 2, 1, 0); \
56219 int16x4_t __rev1_659; __rev1_659 = __builtin_shufflevector(__s1_659, __s1_659, 3, 2, 1, 0); \
56220 int32x4_t __ret_659; \
56221 __ret_659 = __noswap_vmull_s16(__noswap_vget_high_s16(__rev0_659), __noswap_splat_lane_s16(__rev1_659, __p2_659)); \
56222 __ret_659 = __builtin_shufflevector(__ret_659, __ret_659, 3, 2, 1, 0); \
56223 __ret_659; \
5455456224})
5455556225#endif
5455656226
5455756227#ifdef __LITTLE_ENDIAN__
54558#define vmull_high_laneq_u32(__p0_568, __p1_568, __p2_568) __extension__ ({ \
54559 uint32x4_t __s0_568 = __p0_568; \
54560 uint32x4_t __s1_568 = __p1_568; \
54561 uint64x2_t __ret_568; \
54562 __ret_568 = vmull_u32(vget_high_u32(__s0_568), splat_laneq_u32(__s1_568, __p2_568)); \
54563 __ret_568; \
56228#define vmull_high_laneq_u32(__p0_660, __p1_660, __p2_660) __extension__ ({ \
56229 uint32x4_t __s0_660 = __p0_660; \
56230 uint32x4_t __s1_660 = __p1_660; \
56231 uint64x2_t __ret_660; \
56232 __ret_660 = vmull_u32(vget_high_u32(__s0_660), splat_laneq_u32(__s1_660, __p2_660)); \
56233 __ret_660; \
5456456234})
5456556235#else
54566#define vmull_high_laneq_u32(__p0_569, __p1_569, __p2_569) __extension__ ({ \
54567 uint32x4_t __s0_569 = __p0_569; \
54568 uint32x4_t __s1_569 = __p1_569; \
54569 uint32x4_t __rev0_569; __rev0_569 = __builtin_shufflevector(__s0_569, __s0_569, 3, 2, 1, 0); \
54570 uint32x4_t __rev1_569; __rev1_569 = __builtin_shufflevector(__s1_569, __s1_569, 3, 2, 1, 0); \
54571 uint64x2_t __ret_569; \
54572 __ret_569 = __noswap_vmull_u32(__noswap_vget_high_u32(__rev0_569), __noswap_splat_laneq_u32(__rev1_569, __p2_569)); \
54573 __ret_569 = __builtin_shufflevector(__ret_569, __ret_569, 1, 0); \
54574 __ret_569; \
56236#define vmull_high_laneq_u32(__p0_661, __p1_661, __p2_661) __extension__ ({ \
56237 uint32x4_t __s0_661 = __p0_661; \
56238 uint32x4_t __s1_661 = __p1_661; \
56239 uint32x4_t __rev0_661; __rev0_661 = __builtin_shufflevector(__s0_661, __s0_661, 3, 2, 1, 0); \
56240 uint32x4_t __rev1_661; __rev1_661 = __builtin_shufflevector(__s1_661, __s1_661, 3, 2, 1, 0); \
56241 uint64x2_t __ret_661; \
56242 __ret_661 = __noswap_vmull_u32(__noswap_vget_high_u32(__rev0_661), __noswap_splat_laneq_u32(__rev1_661, __p2_661)); \
56243 __ret_661 = __builtin_shufflevector(__ret_661, __ret_661, 1, 0); \
56244 __ret_661; \
5457556245})
5457656246#endif
5457756247
5457856248#ifdef __LITTLE_ENDIAN__
54579#define vmull_high_laneq_u16(__p0_570, __p1_570, __p2_570) __extension__ ({ \
54580 uint16x8_t __s0_570 = __p0_570; \
54581 uint16x8_t __s1_570 = __p1_570; \
54582 uint32x4_t __ret_570; \
54583 __ret_570 = vmull_u16(vget_high_u16(__s0_570), splat_laneq_u16(__s1_570, __p2_570)); \
54584 __ret_570; \
56249#define vmull_high_laneq_u16(__p0_662, __p1_662, __p2_662) __extension__ ({ \
56250 uint16x8_t __s0_662 = __p0_662; \
56251 uint16x8_t __s1_662 = __p1_662; \
56252 uint32x4_t __ret_662; \
56253 __ret_662 = vmull_u16(vget_high_u16(__s0_662), splat_laneq_u16(__s1_662, __p2_662)); \
56254 __ret_662; \
5458556255})
5458656256#else
54587#define vmull_high_laneq_u16(__p0_571, __p1_571, __p2_571) __extension__ ({ \
54588 uint16x8_t __s0_571 = __p0_571; \
54589 uint16x8_t __s1_571 = __p1_571; \
54590 uint16x8_t __rev0_571; __rev0_571 = __builtin_shufflevector(__s0_571, __s0_571, 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); \
54592 uint32x4_t __ret_571; \
54593 __ret_571 = __noswap_vmull_u16(__noswap_vget_high_u16(__rev0_571), __noswap_splat_laneq_u16(__rev1_571, __p2_571)); \
54594 __ret_571 = __builtin_shufflevector(__ret_571, __ret_571, 3, 2, 1, 0); \
54595 __ret_571; \
56257#define vmull_high_laneq_u16(__p0_663, __p1_663, __p2_663) __extension__ ({ \
56258 uint16x8_t __s0_663 = __p0_663; \
56259 uint16x8_t __s1_663 = __p1_663; \
56260 uint16x8_t __rev0_663; __rev0_663 = __builtin_shufflevector(__s0_663, __s0_663, 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); \
56262 uint32x4_t __ret_663; \
56263 __ret_663 = __noswap_vmull_u16(__noswap_vget_high_u16(__rev0_663), __noswap_splat_laneq_u16(__rev1_663, __p2_663)); \
56264 __ret_663 = __builtin_shufflevector(__ret_663, __ret_663, 3, 2, 1, 0); \
56265 __ret_663; \
5459656266})
5459756267#endif
5459856268
5459956269#ifdef __LITTLE_ENDIAN__
54600#define vmull_high_laneq_s32(__p0_572, __p1_572, __p2_572) __extension__ ({ \
54601 int32x4_t __s0_572 = __p0_572; \
54602 int32x4_t __s1_572 = __p1_572; \
54603 int64x2_t __ret_572; \
54604 __ret_572 = vmull_s32(vget_high_s32(__s0_572), splat_laneq_s32(__s1_572, __p2_572)); \
54605 __ret_572; \
56270#define vmull_high_laneq_s32(__p0_664, __p1_664, __p2_664) __extension__ ({ \
56271 int32x4_t __s0_664 = __p0_664; \
56272 int32x4_t __s1_664 = __p1_664; \
56273 int64x2_t __ret_664; \
56274 __ret_664 = vmull_s32(vget_high_s32(__s0_664), splat_laneq_s32(__s1_664, __p2_664)); \
56275 __ret_664; \
5460656276})
5460756277#else
54608#define vmull_high_laneq_s32(__p0_573, __p1_573, __p2_573) __extension__ ({ \
54609 int32x4_t __s0_573 = __p0_573; \
54610 int32x4_t __s1_573 = __p1_573; \
54611 int32x4_t __rev0_573; __rev0_573 = __builtin_shufflevector(__s0_573, __s0_573, 3, 2, 1, 0); \
54612 int32x4_t __rev1_573; __rev1_573 = __builtin_shufflevector(__s1_573, __s1_573, 3, 2, 1, 0); \
54613 int64x2_t __ret_573; \
54614 __ret_573 = __noswap_vmull_s32(__noswap_vget_high_s32(__rev0_573), __noswap_splat_laneq_s32(__rev1_573, __p2_573)); \
54615 __ret_573 = __builtin_shufflevector(__ret_573, __ret_573, 1, 0); \
54616 __ret_573; \
56278#define vmull_high_laneq_s32(__p0_665, __p1_665, __p2_665) __extension__ ({ \
56279 int32x4_t __s0_665 = __p0_665; \
56280 int32x4_t __s1_665 = __p1_665; \
56281 int32x4_t __rev0_665; __rev0_665 = __builtin_shufflevector(__s0_665, __s0_665, 3, 2, 1, 0); \
56282 int32x4_t __rev1_665; __rev1_665 = __builtin_shufflevector(__s1_665, __s1_665, 3, 2, 1, 0); \
56283 int64x2_t __ret_665; \
56284 __ret_665 = __noswap_vmull_s32(__noswap_vget_high_s32(__rev0_665), __noswap_splat_laneq_s32(__rev1_665, __p2_665)); \
56285 __ret_665 = __builtin_shufflevector(__ret_665, __ret_665, 1, 0); \
56286 __ret_665; \
5461756287})
5461856288#endif
5461956289
5462056290#ifdef __LITTLE_ENDIAN__
54621#define vmull_high_laneq_s16(__p0_574, __p1_574, __p2_574) __extension__ ({ \
54622 int16x8_t __s0_574 = __p0_574; \
54623 int16x8_t __s1_574 = __p1_574; \
54624 int32x4_t __ret_574; \
54625 __ret_574 = vmull_s16(vget_high_s16(__s0_574), splat_laneq_s16(__s1_574, __p2_574)); \
54626 __ret_574; \
56291#define vmull_high_laneq_s16(__p0_666, __p1_666, __p2_666) __extension__ ({ \
56292 int16x8_t __s0_666 = __p0_666; \
56293 int16x8_t __s1_666 = __p1_666; \
56294 int32x4_t __ret_666; \
56295 __ret_666 = vmull_s16(vget_high_s16(__s0_666), splat_laneq_s16(__s1_666, __p2_666)); \
56296 __ret_666; \
5462756297})
5462856298#else
54629#define vmull_high_laneq_s16(__p0_575, __p1_575, __p2_575) __extension__ ({ \
54630 int16x8_t __s0_575 = __p0_575; \
54631 int16x8_t __s1_575 = __p1_575; \
54632 int16x8_t __rev0_575; __rev0_575 = __builtin_shufflevector(__s0_575, __s0_575, 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); \
54634 int32x4_t __ret_575; \
54635 __ret_575 = __noswap_vmull_s16(__noswap_vget_high_s16(__rev0_575), __noswap_splat_laneq_s16(__rev1_575, __p2_575)); \
54636 __ret_575 = __builtin_shufflevector(__ret_575, __ret_575, 3, 2, 1, 0); \
54637 __ret_575; \
56299#define vmull_high_laneq_s16(__p0_667, __p1_667, __p2_667) __extension__ ({ \
56300 int16x8_t __s0_667 = __p0_667; \
56301 int16x8_t __s1_667 = __p1_667; \
56302 int16x8_t __rev0_667; __rev0_667 = __builtin_shufflevector(__s0_667, __s0_667, 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); \
56304 int32x4_t __ret_667; \
56305 __ret_667 = __noswap_vmull_s16(__noswap_vget_high_s16(__rev0_667), __noswap_splat_laneq_s16(__rev1_667, __p2_667)); \
56306 __ret_667 = __builtin_shufflevector(__ret_667, __ret_667, 3, 2, 1, 0); \
56307 __ret_667; \
5463856308})
5463956309#endif
5464056310
......@@ -54703,86 +56373,86 @@ __ai int32x4_t vmull_high_n_s16(int16x8_t __p0, int16_t __p1) {
5470356373#endif
5470456374
5470556375#ifdef __LITTLE_ENDIAN__
54706#define vmull_laneq_u32(__p0_576, __p1_576, __p2_576) __extension__ ({ \
54707 uint32x2_t __s0_576 = __p0_576; \
54708 uint32x4_t __s1_576 = __p1_576; \
54709 uint64x2_t __ret_576; \
54710 __ret_576 = vmull_u32(__s0_576, splat_laneq_u32(__s1_576, __p2_576)); \
54711 __ret_576; \
56376#define vmull_laneq_u32(__p0_668, __p1_668, __p2_668) __extension__ ({ \
56377 uint32x2_t __s0_668 = __p0_668; \
56378 uint32x4_t __s1_668 = __p1_668; \
56379 uint64x2_t __ret_668; \
56380 __ret_668 = vmull_u32(__s0_668, splat_laneq_u32(__s1_668, __p2_668)); \
56381 __ret_668; \
5471256382})
5471356383#else
54714#define vmull_laneq_u32(__p0_577, __p1_577, __p2_577) __extension__ ({ \
54715 uint32x2_t __s0_577 = __p0_577; \
54716 uint32x4_t __s1_577 = __p1_577; \
54717 uint32x2_t __rev0_577; __rev0_577 = __builtin_shufflevector(__s0_577, __s0_577, 1, 0); \
54718 uint32x4_t __rev1_577; __rev1_577 = __builtin_shufflevector(__s1_577, __s1_577, 3, 2, 1, 0); \
54719 uint64x2_t __ret_577; \
54720 __ret_577 = __noswap_vmull_u32(__rev0_577, __noswap_splat_laneq_u32(__rev1_577, __p2_577)); \
54721 __ret_577 = __builtin_shufflevector(__ret_577, __ret_577, 1, 0); \
54722 __ret_577; \
56384#define vmull_laneq_u32(__p0_669, __p1_669, __p2_669) __extension__ ({ \
56385 uint32x2_t __s0_669 = __p0_669; \
56386 uint32x4_t __s1_669 = __p1_669; \
56387 uint32x2_t __rev0_669; __rev0_669 = __builtin_shufflevector(__s0_669, __s0_669, 1, 0); \
56388 uint32x4_t __rev1_669; __rev1_669 = __builtin_shufflevector(__s1_669, __s1_669, 3, 2, 1, 0); \
56389 uint64x2_t __ret_669; \
56390 __ret_669 = __noswap_vmull_u32(__rev0_669, __noswap_splat_laneq_u32(__rev1_669, __p2_669)); \
56391 __ret_669 = __builtin_shufflevector(__ret_669, __ret_669, 1, 0); \
56392 __ret_669; \
5472356393})
5472456394#endif
5472556395
5472656396#ifdef __LITTLE_ENDIAN__
54727#define vmull_laneq_u16(__p0_578, __p1_578, __p2_578) __extension__ ({ \
54728 uint16x4_t __s0_578 = __p0_578; \
54729 uint16x8_t __s1_578 = __p1_578; \
54730 uint32x4_t __ret_578; \
54731 __ret_578 = vmull_u16(__s0_578, splat_laneq_u16(__s1_578, __p2_578)); \
54732 __ret_578; \
56397#define vmull_laneq_u16(__p0_670, __p1_670, __p2_670) __extension__ ({ \
56398 uint16x4_t __s0_670 = __p0_670; \
56399 uint16x8_t __s1_670 = __p1_670; \
56400 uint32x4_t __ret_670; \
56401 __ret_670 = vmull_u16(__s0_670, splat_laneq_u16(__s1_670, __p2_670)); \
56402 __ret_670; \
5473356403})
5473456404#else
54735#define vmull_laneq_u16(__p0_579, __p1_579, __p2_579) __extension__ ({ \
54736 uint16x4_t __s0_579 = __p0_579; \
54737 uint16x8_t __s1_579 = __p1_579; \
54738 uint16x4_t __rev0_579; __rev0_579 = __builtin_shufflevector(__s0_579, __s0_579, 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); \
54740 uint32x4_t __ret_579; \
54741 __ret_579 = __noswap_vmull_u16(__rev0_579, __noswap_splat_laneq_u16(__rev1_579, __p2_579)); \
54742 __ret_579 = __builtin_shufflevector(__ret_579, __ret_579, 3, 2, 1, 0); \
54743 __ret_579; \
56405#define vmull_laneq_u16(__p0_671, __p1_671, __p2_671) __extension__ ({ \
56406 uint16x4_t __s0_671 = __p0_671; \
56407 uint16x8_t __s1_671 = __p1_671; \
56408 uint16x4_t __rev0_671; __rev0_671 = __builtin_shufflevector(__s0_671, __s0_671, 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); \
56410 uint32x4_t __ret_671; \
56411 __ret_671 = __noswap_vmull_u16(__rev0_671, __noswap_splat_laneq_u16(__rev1_671, __p2_671)); \
56412 __ret_671 = __builtin_shufflevector(__ret_671, __ret_671, 3, 2, 1, 0); \
56413 __ret_671; \
5474456414})
5474556415#endif
5474656416
5474756417#ifdef __LITTLE_ENDIAN__
54748#define vmull_laneq_s32(__p0_580, __p1_580, __p2_580) __extension__ ({ \
54749 int32x2_t __s0_580 = __p0_580; \
54750 int32x4_t __s1_580 = __p1_580; \
54751 int64x2_t __ret_580; \
54752 __ret_580 = vmull_s32(__s0_580, splat_laneq_s32(__s1_580, __p2_580)); \
54753 __ret_580; \
56418#define vmull_laneq_s32(__p0_672, __p1_672, __p2_672) __extension__ ({ \
56419 int32x2_t __s0_672 = __p0_672; \
56420 int32x4_t __s1_672 = __p1_672; \
56421 int64x2_t __ret_672; \
56422 __ret_672 = vmull_s32(__s0_672, splat_laneq_s32(__s1_672, __p2_672)); \
56423 __ret_672; \
5475456424})
5475556425#else
54756#define vmull_laneq_s32(__p0_581, __p1_581, __p2_581) __extension__ ({ \
54757 int32x2_t __s0_581 = __p0_581; \
54758 int32x4_t __s1_581 = __p1_581; \
54759 int32x2_t __rev0_581; __rev0_581 = __builtin_shufflevector(__s0_581, __s0_581, 1, 0); \
54760 int32x4_t __rev1_581; __rev1_581 = __builtin_shufflevector(__s1_581, __s1_581, 3, 2, 1, 0); \
54761 int64x2_t __ret_581; \
54762 __ret_581 = __noswap_vmull_s32(__rev0_581, __noswap_splat_laneq_s32(__rev1_581, __p2_581)); \
54763 __ret_581 = __builtin_shufflevector(__ret_581, __ret_581, 1, 0); \
54764 __ret_581; \
56426#define vmull_laneq_s32(__p0_673, __p1_673, __p2_673) __extension__ ({ \
56427 int32x2_t __s0_673 = __p0_673; \
56428 int32x4_t __s1_673 = __p1_673; \
56429 int32x2_t __rev0_673; __rev0_673 = __builtin_shufflevector(__s0_673, __s0_673, 1, 0); \
56430 int32x4_t __rev1_673; __rev1_673 = __builtin_shufflevector(__s1_673, __s1_673, 3, 2, 1, 0); \
56431 int64x2_t __ret_673; \
56432 __ret_673 = __noswap_vmull_s32(__rev0_673, __noswap_splat_laneq_s32(__rev1_673, __p2_673)); \
56433 __ret_673 = __builtin_shufflevector(__ret_673, __ret_673, 1, 0); \
56434 __ret_673; \
5476556435})
5476656436#endif
5476756437
5476856438#ifdef __LITTLE_ENDIAN__
54769#define vmull_laneq_s16(__p0_582, __p1_582, __p2_582) __extension__ ({ \
54770 int16x4_t __s0_582 = __p0_582; \
54771 int16x8_t __s1_582 = __p1_582; \
54772 int32x4_t __ret_582; \
54773 __ret_582 = vmull_s16(__s0_582, splat_laneq_s16(__s1_582, __p2_582)); \
54774 __ret_582; \
56439#define vmull_laneq_s16(__p0_674, __p1_674, __p2_674) __extension__ ({ \
56440 int16x4_t __s0_674 = __p0_674; \
56441 int16x8_t __s1_674 = __p1_674; \
56442 int32x4_t __ret_674; \
56443 __ret_674 = vmull_s16(__s0_674, splat_laneq_s16(__s1_674, __p2_674)); \
56444 __ret_674; \
5477556445})
5477656446#else
54777#define vmull_laneq_s16(__p0_583, __p1_583, __p2_583) __extension__ ({ \
54778 int16x4_t __s0_583 = __p0_583; \
54779 int16x8_t __s1_583 = __p1_583; \
54780 int16x4_t __rev0_583; __rev0_583 = __builtin_shufflevector(__s0_583, __s0_583, 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); \
54782 int32x4_t __ret_583; \
54783 __ret_583 = __noswap_vmull_s16(__rev0_583, __noswap_splat_laneq_s16(__rev1_583, __p2_583)); \
54784 __ret_583 = __builtin_shufflevector(__ret_583, __ret_583, 3, 2, 1, 0); \
54785 __ret_583; \
56447#define vmull_laneq_s16(__p0_675, __p1_675, __p2_675) __extension__ ({ \
56448 int16x4_t __s0_675 = __p0_675; \
56449 int16x8_t __s1_675 = __p1_675; \
56450 int16x4_t __rev0_675; __rev0_675 = __builtin_shufflevector(__s0_675, __s0_675, 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); \
56452 int32x4_t __ret_675; \
56453 __ret_675 = __noswap_vmull_s16(__rev0_675, __noswap_splat_laneq_s16(__rev1_675, __p2_675)); \
56454 __ret_675 = __builtin_shufflevector(__ret_675, __ret_675, 3, 2, 1, 0); \
56455 __ret_675; \
5478656456})
5478756457#endif
5478856458
......@@ -54867,192 +56537,192 @@ __ai float32_t vmulxs_f32(float32_t __p0, float32_t __p1) {
5486756537 __ret = (float32_t) __builtin_neon_vmulxs_f32(__p0, __p1);
5486856538 return __ret;
5486956539}
54870#define vmulxd_lane_f64(__p0_584, __p1_584, __p2_584) __extension__ ({ \
54871 float64_t __s0_584 = __p0_584; \
54872 float64x1_t __s1_584 = __p1_584; \
54873 float64_t __ret_584; \
54874 __ret_584 = vmulxd_f64(__s0_584, vget_lane_f64(__s1_584, __p2_584)); \
54875 __ret_584; \
56540#define vmulxd_lane_f64(__p0_676, __p1_676, __p2_676) __extension__ ({ \
56541 float64_t __s0_676 = __p0_676; \
56542 float64x1_t __s1_676 = __p1_676; \
56543 float64_t __ret_676; \
56544 __ret_676 = vmulxd_f64(__s0_676, vget_lane_f64(__s1_676, __p2_676)); \
56545 __ret_676; \
5487656546})
5487756547#ifdef __LITTLE_ENDIAN__
54878#define vmulxs_lane_f32(__p0_585, __p1_585, __p2_585) __extension__ ({ \
54879 float32_t __s0_585 = __p0_585; \
54880 float32x2_t __s1_585 = __p1_585; \
54881 float32_t __ret_585; \
54882 __ret_585 = vmulxs_f32(__s0_585, vget_lane_f32(__s1_585, __p2_585)); \
54883 __ret_585; \
56548#define vmulxs_lane_f32(__p0_677, __p1_677, __p2_677) __extension__ ({ \
56549 float32_t __s0_677 = __p0_677; \
56550 float32x2_t __s1_677 = __p1_677; \
56551 float32_t __ret_677; \
56552 __ret_677 = vmulxs_f32(__s0_677, vget_lane_f32(__s1_677, __p2_677)); \
56553 __ret_677; \
5488456554})
5488556555#else
54886#define vmulxs_lane_f32(__p0_586, __p1_586, __p2_586) __extension__ ({ \
54887 float32_t __s0_586 = __p0_586; \
54888 float32x2_t __s1_586 = __p1_586; \
54889 float32x2_t __rev1_586; __rev1_586 = __builtin_shufflevector(__s1_586, __s1_586, 1, 0); \
54890 float32_t __ret_586; \
54891 __ret_586 = vmulxs_f32(__s0_586, __noswap_vget_lane_f32(__rev1_586, __p2_586)); \
54892 __ret_586; \
56556#define vmulxs_lane_f32(__p0_678, __p1_678, __p2_678) __extension__ ({ \
56557 float32_t __s0_678 = __p0_678; \
56558 float32x2_t __s1_678 = __p1_678; \
56559 float32x2_t __rev1_678; __rev1_678 = __builtin_shufflevector(__s1_678, __s1_678, 1, 0); \
56560 float32_t __ret_678; \
56561 __ret_678 = vmulxs_f32(__s0_678, __noswap_vget_lane_f32(__rev1_678, __p2_678)); \
56562 __ret_678; \
5489356563})
5489456564#endif
5489556565
5489656566#ifdef __LITTLE_ENDIAN__
54897#define vmulxq_lane_f64(__p0_587, __p1_587, __p2_587) __extension__ ({ \
54898 float64x2_t __s0_587 = __p0_587; \
54899 float64x1_t __s1_587 = __p1_587; \
54900 float64x2_t __ret_587; \
54901 __ret_587 = vmulxq_f64(__s0_587, splatq_lane_f64(__s1_587, __p2_587)); \
54902 __ret_587; \
56567#define vmulxq_lane_f64(__p0_679, __p1_679, __p2_679) __extension__ ({ \
56568 float64x2_t __s0_679 = __p0_679; \
56569 float64x1_t __s1_679 = __p1_679; \
56570 float64x2_t __ret_679; \
56571 __ret_679 = vmulxq_f64(__s0_679, splatq_lane_f64(__s1_679, __p2_679)); \
56572 __ret_679; \
5490356573})
5490456574#else
54905#define vmulxq_lane_f64(__p0_588, __p1_588, __p2_588) __extension__ ({ \
54906 float64x2_t __s0_588 = __p0_588; \
54907 float64x1_t __s1_588 = __p1_588; \
54908 float64x2_t __rev0_588; __rev0_588 = __builtin_shufflevector(__s0_588, __s0_588, 1, 0); \
54909 float64x2_t __ret_588; \
54910 __ret_588 = __noswap_vmulxq_f64(__rev0_588, __noswap_splatq_lane_f64(__s1_588, __p2_588)); \
54911 __ret_588 = __builtin_shufflevector(__ret_588, __ret_588, 1, 0); \
54912 __ret_588; \
56575#define vmulxq_lane_f64(__p0_680, __p1_680, __p2_680) __extension__ ({ \
56576 float64x2_t __s0_680 = __p0_680; \
56577 float64x1_t __s1_680 = __p1_680; \
56578 float64x2_t __rev0_680; __rev0_680 = __builtin_shufflevector(__s0_680, __s0_680, 1, 0); \
56579 float64x2_t __ret_680; \
56580 __ret_680 = __noswap_vmulxq_f64(__rev0_680, __noswap_splatq_lane_f64(__s1_680, __p2_680)); \
56581 __ret_680 = __builtin_shufflevector(__ret_680, __ret_680, 1, 0); \
56582 __ret_680; \
5491356583})
5491456584#endif
5491556585
5491656586#ifdef __LITTLE_ENDIAN__
54917#define vmulxq_lane_f32(__p0_589, __p1_589, __p2_589) __extension__ ({ \
54918 float32x4_t __s0_589 = __p0_589; \
54919 float32x2_t __s1_589 = __p1_589; \
54920 float32x4_t __ret_589; \
54921 __ret_589 = vmulxq_f32(__s0_589, splatq_lane_f32(__s1_589, __p2_589)); \
54922 __ret_589; \
56587#define vmulxq_lane_f32(__p0_681, __p1_681, __p2_681) __extension__ ({ \
56588 float32x4_t __s0_681 = __p0_681; \
56589 float32x2_t __s1_681 = __p1_681; \
56590 float32x4_t __ret_681; \
56591 __ret_681 = vmulxq_f32(__s0_681, splatq_lane_f32(__s1_681, __p2_681)); \
56592 __ret_681; \
5492356593})
5492456594#else
54925#define vmulxq_lane_f32(__p0_590, __p1_590, __p2_590) __extension__ ({ \
54926 float32x4_t __s0_590 = __p0_590; \
54927 float32x2_t __s1_590 = __p1_590; \
54928 float32x4_t __rev0_590; __rev0_590 = __builtin_shufflevector(__s0_590, __s0_590, 3, 2, 1, 0); \
54929 float32x2_t __rev1_590; __rev1_590 = __builtin_shufflevector(__s1_590, __s1_590, 1, 0); \
54930 float32x4_t __ret_590; \
54931 __ret_590 = __noswap_vmulxq_f32(__rev0_590, __noswap_splatq_lane_f32(__rev1_590, __p2_590)); \
54932 __ret_590 = __builtin_shufflevector(__ret_590, __ret_590, 3, 2, 1, 0); \
54933 __ret_590; \
56595#define vmulxq_lane_f32(__p0_682, __p1_682, __p2_682) __extension__ ({ \
56596 float32x4_t __s0_682 = __p0_682; \
56597 float32x2_t __s1_682 = __p1_682; \
56598 float32x4_t __rev0_682; __rev0_682 = __builtin_shufflevector(__s0_682, __s0_682, 3, 2, 1, 0); \
56599 float32x2_t __rev1_682; __rev1_682 = __builtin_shufflevector(__s1_682, __s1_682, 1, 0); \
56600 float32x4_t __ret_682; \
56601 __ret_682 = __noswap_vmulxq_f32(__rev0_682, __noswap_splatq_lane_f32(__rev1_682, __p2_682)); \
56602 __ret_682 = __builtin_shufflevector(__ret_682, __ret_682, 3, 2, 1, 0); \
56603 __ret_682; \
5493456604})
5493556605#endif
5493656606
5493756607#ifdef __LITTLE_ENDIAN__
54938#define vmulx_lane_f32(__p0_591, __p1_591, __p2_591) __extension__ ({ \
54939 float32x2_t __s0_591 = __p0_591; \
54940 float32x2_t __s1_591 = __p1_591; \
54941 float32x2_t __ret_591; \
54942 __ret_591 = vmulx_f32(__s0_591, splat_lane_f32(__s1_591, __p2_591)); \
54943 __ret_591; \
56608#define vmulx_lane_f32(__p0_683, __p1_683, __p2_683) __extension__ ({ \
56609 float32x2_t __s0_683 = __p0_683; \
56610 float32x2_t __s1_683 = __p1_683; \
56611 float32x2_t __ret_683; \
56612 __ret_683 = vmulx_f32(__s0_683, splat_lane_f32(__s1_683, __p2_683)); \
56613 __ret_683; \
5494456614})
5494556615#else
54946#define vmulx_lane_f32(__p0_592, __p1_592, __p2_592) __extension__ ({ \
54947 float32x2_t __s0_592 = __p0_592; \
54948 float32x2_t __s1_592 = __p1_592; \
54949 float32x2_t __rev0_592; __rev0_592 = __builtin_shufflevector(__s0_592, __s0_592, 1, 0); \
54950 float32x2_t __rev1_592; __rev1_592 = __builtin_shufflevector(__s1_592, __s1_592, 1, 0); \
54951 float32x2_t __ret_592; \
54952 __ret_592 = __noswap_vmulx_f32(__rev0_592, __noswap_splat_lane_f32(__rev1_592, __p2_592)); \
54953 __ret_592 = __builtin_shufflevector(__ret_592, __ret_592, 1, 0); \
54954 __ret_592; \
56616#define vmulx_lane_f32(__p0_684, __p1_684, __p2_684) __extension__ ({ \
56617 float32x2_t __s0_684 = __p0_684; \
56618 float32x2_t __s1_684 = __p1_684; \
56619 float32x2_t __rev0_684; __rev0_684 = __builtin_shufflevector(__s0_684, __s0_684, 1, 0); \
56620 float32x2_t __rev1_684; __rev1_684 = __builtin_shufflevector(__s1_684, __s1_684, 1, 0); \
56621 float32x2_t __ret_684; \
56622 __ret_684 = __noswap_vmulx_f32(__rev0_684, __noswap_splat_lane_f32(__rev1_684, __p2_684)); \
56623 __ret_684 = __builtin_shufflevector(__ret_684, __ret_684, 1, 0); \
56624 __ret_684; \
5495556625})
5495656626#endif
5495756627
5495856628#ifdef __LITTLE_ENDIAN__
54959#define vmulxd_laneq_f64(__p0_593, __p1_593, __p2_593) __extension__ ({ \
54960 float64_t __s0_593 = __p0_593; \
54961 float64x2_t __s1_593 = __p1_593; \
54962 float64_t __ret_593; \
54963 __ret_593 = vmulxd_f64(__s0_593, vgetq_lane_f64(__s1_593, __p2_593)); \
54964 __ret_593; \
56629#define vmulxd_laneq_f64(__p0_685, __p1_685, __p2_685) __extension__ ({ \
56630 float64_t __s0_685 = __p0_685; \
56631 float64x2_t __s1_685 = __p1_685; \
56632 float64_t __ret_685; \
56633 __ret_685 = vmulxd_f64(__s0_685, vgetq_lane_f64(__s1_685, __p2_685)); \
56634 __ret_685; \
5496556635})
5496656636#else
54967#define vmulxd_laneq_f64(__p0_594, __p1_594, __p2_594) __extension__ ({ \
54968 float64_t __s0_594 = __p0_594; \
54969 float64x2_t __s1_594 = __p1_594; \
54970 float64x2_t __rev1_594; __rev1_594 = __builtin_shufflevector(__s1_594, __s1_594, 1, 0); \
54971 float64_t __ret_594; \
54972 __ret_594 = vmulxd_f64(__s0_594, __noswap_vgetq_lane_f64(__rev1_594, __p2_594)); \
54973 __ret_594; \
56637#define vmulxd_laneq_f64(__p0_686, __p1_686, __p2_686) __extension__ ({ \
56638 float64_t __s0_686 = __p0_686; \
56639 float64x2_t __s1_686 = __p1_686; \
56640 float64x2_t __rev1_686; __rev1_686 = __builtin_shufflevector(__s1_686, __s1_686, 1, 0); \
56641 float64_t __ret_686; \
56642 __ret_686 = vmulxd_f64(__s0_686, __noswap_vgetq_lane_f64(__rev1_686, __p2_686)); \
56643 __ret_686; \
5497456644})
5497556645#endif
5497656646
5497756647#ifdef __LITTLE_ENDIAN__
54978#define vmulxs_laneq_f32(__p0_595, __p1_595, __p2_595) __extension__ ({ \
54979 float32_t __s0_595 = __p0_595; \
54980 float32x4_t __s1_595 = __p1_595; \
54981 float32_t __ret_595; \
54982 __ret_595 = vmulxs_f32(__s0_595, vgetq_lane_f32(__s1_595, __p2_595)); \
54983 __ret_595; \
56648#define vmulxs_laneq_f32(__p0_687, __p1_687, __p2_687) __extension__ ({ \
56649 float32_t __s0_687 = __p0_687; \
56650 float32x4_t __s1_687 = __p1_687; \
56651 float32_t __ret_687; \
56652 __ret_687 = vmulxs_f32(__s0_687, vgetq_lane_f32(__s1_687, __p2_687)); \
56653 __ret_687; \
5498456654})
5498556655#else
54986#define vmulxs_laneq_f32(__p0_596, __p1_596, __p2_596) __extension__ ({ \
54987 float32_t __s0_596 = __p0_596; \
54988 float32x4_t __s1_596 = __p1_596; \
54989 float32x4_t __rev1_596; __rev1_596 = __builtin_shufflevector(__s1_596, __s1_596, 3, 2, 1, 0); \
54990 float32_t __ret_596; \
54991 __ret_596 = vmulxs_f32(__s0_596, __noswap_vgetq_lane_f32(__rev1_596, __p2_596)); \
54992 __ret_596; \
56656#define vmulxs_laneq_f32(__p0_688, __p1_688, __p2_688) __extension__ ({ \
56657 float32_t __s0_688 = __p0_688; \
56658 float32x4_t __s1_688 = __p1_688; \
56659 float32x4_t __rev1_688; __rev1_688 = __builtin_shufflevector(__s1_688, __s1_688, 3, 2, 1, 0); \
56660 float32_t __ret_688; \
56661 __ret_688 = vmulxs_f32(__s0_688, __noswap_vgetq_lane_f32(__rev1_688, __p2_688)); \
56662 __ret_688; \
5499356663})
5499456664#endif
5499556665
5499656666#ifdef __LITTLE_ENDIAN__
54997#define vmulxq_laneq_f64(__p0_597, __p1_597, __p2_597) __extension__ ({ \
54998 float64x2_t __s0_597 = __p0_597; \
54999 float64x2_t __s1_597 = __p1_597; \
55000 float64x2_t __ret_597; \
55001 __ret_597 = vmulxq_f64(__s0_597, splatq_laneq_f64(__s1_597, __p2_597)); \
55002 __ret_597; \
56667#define vmulxq_laneq_f64(__p0_689, __p1_689, __p2_689) __extension__ ({ \
56668 float64x2_t __s0_689 = __p0_689; \
56669 float64x2_t __s1_689 = __p1_689; \
56670 float64x2_t __ret_689; \
56671 __ret_689 = vmulxq_f64(__s0_689, splatq_laneq_f64(__s1_689, __p2_689)); \
56672 __ret_689; \
5500356673})
5500456674#else
55005#define vmulxq_laneq_f64(__p0_598, __p1_598, __p2_598) __extension__ ({ \
55006 float64x2_t __s0_598 = __p0_598; \
55007 float64x2_t __s1_598 = __p1_598; \
55008 float64x2_t __rev0_598; __rev0_598 = __builtin_shufflevector(__s0_598, __s0_598, 1, 0); \
55009 float64x2_t __rev1_598; __rev1_598 = __builtin_shufflevector(__s1_598, __s1_598, 1, 0); \
55010 float64x2_t __ret_598; \
55011 __ret_598 = __noswap_vmulxq_f64(__rev0_598, __noswap_splatq_laneq_f64(__rev1_598, __p2_598)); \
55012 __ret_598 = __builtin_shufflevector(__ret_598, __ret_598, 1, 0); \
55013 __ret_598; \
56675#define vmulxq_laneq_f64(__p0_690, __p1_690, __p2_690) __extension__ ({ \
56676 float64x2_t __s0_690 = __p0_690; \
56677 float64x2_t __s1_690 = __p1_690; \
56678 float64x2_t __rev0_690; __rev0_690 = __builtin_shufflevector(__s0_690, __s0_690, 1, 0); \
56679 float64x2_t __rev1_690; __rev1_690 = __builtin_shufflevector(__s1_690, __s1_690, 1, 0); \
56680 float64x2_t __ret_690; \
56681 __ret_690 = __noswap_vmulxq_f64(__rev0_690, __noswap_splatq_laneq_f64(__rev1_690, __p2_690)); \
56682 __ret_690 = __builtin_shufflevector(__ret_690, __ret_690, 1, 0); \
56683 __ret_690; \
5501456684})
5501556685#endif
5501656686
5501756687#ifdef __LITTLE_ENDIAN__
55018#define vmulxq_laneq_f32(__p0_599, __p1_599, __p2_599) __extension__ ({ \
55019 float32x4_t __s0_599 = __p0_599; \
55020 float32x4_t __s1_599 = __p1_599; \
55021 float32x4_t __ret_599; \
55022 __ret_599 = vmulxq_f32(__s0_599, splatq_laneq_f32(__s1_599, __p2_599)); \
55023 __ret_599; \
56688#define vmulxq_laneq_f32(__p0_691, __p1_691, __p2_691) __extension__ ({ \
56689 float32x4_t __s0_691 = __p0_691; \
56690 float32x4_t __s1_691 = __p1_691; \
56691 float32x4_t __ret_691; \
56692 __ret_691 = vmulxq_f32(__s0_691, splatq_laneq_f32(__s1_691, __p2_691)); \
56693 __ret_691; \
5502456694})
5502556695#else
55026#define vmulxq_laneq_f32(__p0_600, __p1_600, __p2_600) __extension__ ({ \
55027 float32x4_t __s0_600 = __p0_600; \
55028 float32x4_t __s1_600 = __p1_600; \
55029 float32x4_t __rev0_600; __rev0_600 = __builtin_shufflevector(__s0_600, __s0_600, 3, 2, 1, 0); \
55030 float32x4_t __rev1_600; __rev1_600 = __builtin_shufflevector(__s1_600, __s1_600, 3, 2, 1, 0); \
55031 float32x4_t __ret_600; \
55032 __ret_600 = __noswap_vmulxq_f32(__rev0_600, __noswap_splatq_laneq_f32(__rev1_600, __p2_600)); \
55033 __ret_600 = __builtin_shufflevector(__ret_600, __ret_600, 3, 2, 1, 0); \
55034 __ret_600; \
56696#define vmulxq_laneq_f32(__p0_692, __p1_692, __p2_692) __extension__ ({ \
56697 float32x4_t __s0_692 = __p0_692; \
56698 float32x4_t __s1_692 = __p1_692; \
56699 float32x4_t __rev0_692; __rev0_692 = __builtin_shufflevector(__s0_692, __s0_692, 3, 2, 1, 0); \
56700 float32x4_t __rev1_692; __rev1_692 = __builtin_shufflevector(__s1_692, __s1_692, 3, 2, 1, 0); \
56701 float32x4_t __ret_692; \
56702 __ret_692 = __noswap_vmulxq_f32(__rev0_692, __noswap_splatq_laneq_f32(__rev1_692, __p2_692)); \
56703 __ret_692 = __builtin_shufflevector(__ret_692, __ret_692, 3, 2, 1, 0); \
56704 __ret_692; \
5503556705})
5503656706#endif
5503756707
5503856708#ifdef __LITTLE_ENDIAN__
55039#define vmulx_laneq_f32(__p0_601, __p1_601, __p2_601) __extension__ ({ \
55040 float32x2_t __s0_601 = __p0_601; \
55041 float32x4_t __s1_601 = __p1_601; \
55042 float32x2_t __ret_601; \
55043 __ret_601 = vmulx_f32(__s0_601, splat_laneq_f32(__s1_601, __p2_601)); \
55044 __ret_601; \
56709#define vmulx_laneq_f32(__p0_693, __p1_693, __p2_693) __extension__ ({ \
56710 float32x2_t __s0_693 = __p0_693; \
56711 float32x4_t __s1_693 = __p1_693; \
56712 float32x2_t __ret_693; \
56713 __ret_693 = vmulx_f32(__s0_693, splat_laneq_f32(__s1_693, __p2_693)); \
56714 __ret_693; \
5504556715})
5504656716#else
55047#define vmulx_laneq_f32(__p0_602, __p1_602, __p2_602) __extension__ ({ \
55048 float32x2_t __s0_602 = __p0_602; \
55049 float32x4_t __s1_602 = __p1_602; \
55050 float32x2_t __rev0_602; __rev0_602 = __builtin_shufflevector(__s0_602, __s0_602, 1, 0); \
55051 float32x4_t __rev1_602; __rev1_602 = __builtin_shufflevector(__s1_602, __s1_602, 3, 2, 1, 0); \
55052 float32x2_t __ret_602; \
55053 __ret_602 = __noswap_vmulx_f32(__rev0_602, __noswap_splat_laneq_f32(__rev1_602, __p2_602)); \
55054 __ret_602 = __builtin_shufflevector(__ret_602, __ret_602, 1, 0); \
55055 __ret_602; \
56717#define vmulx_laneq_f32(__p0_694, __p1_694, __p2_694) __extension__ ({ \
56718 float32x2_t __s0_694 = __p0_694; \
56719 float32x4_t __s1_694 = __p1_694; \
56720 float32x2_t __rev0_694; __rev0_694 = __builtin_shufflevector(__s0_694, __s0_694, 1, 0); \
56721 float32x4_t __rev1_694; __rev1_694 = __builtin_shufflevector(__s1_694, __s1_694, 3, 2, 1, 0); \
56722 float32x2_t __ret_694; \
56723 __ret_694 = __noswap_vmulx_f32(__rev0_694, __noswap_splat_laneq_f32(__rev1_694, __p2_694)); \
56724 __ret_694 = __builtin_shufflevector(__ret_694, __ret_694, 1, 0); \
56725 __ret_694; \
5505656726})
5505756727#endif
5505856728
......@@ -55955,98 +57625,98 @@ __ai int32x4_t vqdmlal_high_s16(int32x4_t __p0, int16x8_t __p1, int16x8_t __p2)
5595557625#endif
5595657626
5595757627#ifdef __LITTLE_ENDIAN__
55958#define vqdmlal_high_lane_s32(__p0_603, __p1_603, __p2_603, __p3_603) __extension__ ({ \
55959 int64x2_t __s0_603 = __p0_603; \
55960 int32x4_t __s1_603 = __p1_603; \
55961 int32x2_t __s2_603 = __p2_603; \
55962 int64x2_t __ret_603; \
55963 __ret_603 = vqdmlal_s32(__s0_603, vget_high_s32(__s1_603), splat_lane_s32(__s2_603, __p3_603)); \
55964 __ret_603; \
57628#define vqdmlal_high_lane_s32(__p0_695, __p1_695, __p2_695, __p3_695) __extension__ ({ \
57629 int64x2_t __s0_695 = __p0_695; \
57630 int32x4_t __s1_695 = __p1_695; \
57631 int32x2_t __s2_695 = __p2_695; \
57632 int64x2_t __ret_695; \
57633 __ret_695 = vqdmlal_s32(__s0_695, vget_high_s32(__s1_695), splat_lane_s32(__s2_695, __p3_695)); \
57634 __ret_695; \
5596557635})
5596657636#else
55967#define vqdmlal_high_lane_s32(__p0_604, __p1_604, __p2_604, __p3_604) __extension__ ({ \
55968 int64x2_t __s0_604 = __p0_604; \
55969 int32x4_t __s1_604 = __p1_604; \
55970 int32x2_t __s2_604 = __p2_604; \
55971 int64x2_t __rev0_604; __rev0_604 = __builtin_shufflevector(__s0_604, __s0_604, 1, 0); \
55972 int32x4_t __rev1_604; __rev1_604 = __builtin_shufflevector(__s1_604, __s1_604, 3, 2, 1, 0); \
55973 int32x2_t __rev2_604; __rev2_604 = __builtin_shufflevector(__s2_604, __s2_604, 1, 0); \
55974 int64x2_t __ret_604; \
55975 __ret_604 = __noswap_vqdmlal_s32(__rev0_604, __noswap_vget_high_s32(__rev1_604), __noswap_splat_lane_s32(__rev2_604, __p3_604)); \
55976 __ret_604 = __builtin_shufflevector(__ret_604, __ret_604, 1, 0); \
55977 __ret_604; \
57637#define vqdmlal_high_lane_s32(__p0_696, __p1_696, __p2_696, __p3_696) __extension__ ({ \
57638 int64x2_t __s0_696 = __p0_696; \
57639 int32x4_t __s1_696 = __p1_696; \
57640 int32x2_t __s2_696 = __p2_696; \
57641 int64x2_t __rev0_696; __rev0_696 = __builtin_shufflevector(__s0_696, __s0_696, 1, 0); \
57642 int32x4_t __rev1_696; __rev1_696 = __builtin_shufflevector(__s1_696, __s1_696, 3, 2, 1, 0); \
57643 int32x2_t __rev2_696; __rev2_696 = __builtin_shufflevector(__s2_696, __s2_696, 1, 0); \
57644 int64x2_t __ret_696; \
57645 __ret_696 = __noswap_vqdmlal_s32(__rev0_696, __noswap_vget_high_s32(__rev1_696), __noswap_splat_lane_s32(__rev2_696, __p3_696)); \
57646 __ret_696 = __builtin_shufflevector(__ret_696, __ret_696, 1, 0); \
57647 __ret_696; \
5597857648})
5597957649#endif
5598057650
5598157651#ifdef __LITTLE_ENDIAN__
55982#define vqdmlal_high_lane_s16(__p0_605, __p1_605, __p2_605, __p3_605) __extension__ ({ \
55983 int32x4_t __s0_605 = __p0_605; \
55984 int16x8_t __s1_605 = __p1_605; \
55985 int16x4_t __s2_605 = __p2_605; \
55986 int32x4_t __ret_605; \
55987 __ret_605 = vqdmlal_s16(__s0_605, vget_high_s16(__s1_605), splat_lane_s16(__s2_605, __p3_605)); \
55988 __ret_605; \
57652#define vqdmlal_high_lane_s16(__p0_697, __p1_697, __p2_697, __p3_697) __extension__ ({ \
57653 int32x4_t __s0_697 = __p0_697; \
57654 int16x8_t __s1_697 = __p1_697; \
57655 int16x4_t __s2_697 = __p2_697; \
57656 int32x4_t __ret_697; \
57657 __ret_697 = vqdmlal_s16(__s0_697, vget_high_s16(__s1_697), splat_lane_s16(__s2_697, __p3_697)); \
57658 __ret_697; \
5598957659})
5599057660#else
55991#define vqdmlal_high_lane_s16(__p0_606, __p1_606, __p2_606, __p3_606) __extension__ ({ \
55992 int32x4_t __s0_606 = __p0_606; \
55993 int16x8_t __s1_606 = __p1_606; \
55994 int16x4_t __s2_606 = __p2_606; \
55995 int32x4_t __rev0_606; __rev0_606 = __builtin_shufflevector(__s0_606, __s0_606, 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); \
55997 int16x4_t __rev2_606; __rev2_606 = __builtin_shufflevector(__s2_606, __s2_606, 3, 2, 1, 0); \
55998 int32x4_t __ret_606; \
55999 __ret_606 = __noswap_vqdmlal_s16(__rev0_606, __noswap_vget_high_s16(__rev1_606), __noswap_splat_lane_s16(__rev2_606, __p3_606)); \
56000 __ret_606 = __builtin_shufflevector(__ret_606, __ret_606, 3, 2, 1, 0); \
56001 __ret_606; \
57661#define vqdmlal_high_lane_s16(__p0_698, __p1_698, __p2_698, __p3_698) __extension__ ({ \
57662 int32x4_t __s0_698 = __p0_698; \
57663 int16x8_t __s1_698 = __p1_698; \
57664 int16x4_t __s2_698 = __p2_698; \
57665 int32x4_t __rev0_698; __rev0_698 = __builtin_shufflevector(__s0_698, __s0_698, 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); \
57667 int16x4_t __rev2_698; __rev2_698 = __builtin_shufflevector(__s2_698, __s2_698, 3, 2, 1, 0); \
57668 int32x4_t __ret_698; \
57669 __ret_698 = __noswap_vqdmlal_s16(__rev0_698, __noswap_vget_high_s16(__rev1_698), __noswap_splat_lane_s16(__rev2_698, __p3_698)); \
57670 __ret_698 = __builtin_shufflevector(__ret_698, __ret_698, 3, 2, 1, 0); \
57671 __ret_698; \
5600257672})
5600357673#endif
5600457674
5600557675#ifdef __LITTLE_ENDIAN__
56006#define vqdmlal_high_laneq_s32(__p0_607, __p1_607, __p2_607, __p3_607) __extension__ ({ \
56007 int64x2_t __s0_607 = __p0_607; \
56008 int32x4_t __s1_607 = __p1_607; \
56009 int32x4_t __s2_607 = __p2_607; \
56010 int64x2_t __ret_607; \
56011 __ret_607 = vqdmlal_s32(__s0_607, vget_high_s32(__s1_607), splat_laneq_s32(__s2_607, __p3_607)); \
56012 __ret_607; \
57676#define vqdmlal_high_laneq_s32(__p0_699, __p1_699, __p2_699, __p3_699) __extension__ ({ \
57677 int64x2_t __s0_699 = __p0_699; \
57678 int32x4_t __s1_699 = __p1_699; \
57679 int32x4_t __s2_699 = __p2_699; \
57680 int64x2_t __ret_699; \
57681 __ret_699 = vqdmlal_s32(__s0_699, vget_high_s32(__s1_699), splat_laneq_s32(__s2_699, __p3_699)); \
57682 __ret_699; \
5601357683})
5601457684#else
56015#define vqdmlal_high_laneq_s32(__p0_608, __p1_608, __p2_608, __p3_608) __extension__ ({ \
56016 int64x2_t __s0_608 = __p0_608; \
56017 int32x4_t __s1_608 = __p1_608; \
56018 int32x4_t __s2_608 = __p2_608; \
56019 int64x2_t __rev0_608; __rev0_608 = __builtin_shufflevector(__s0_608, __s0_608, 1, 0); \
56020 int32x4_t __rev1_608; __rev1_608 = __builtin_shufflevector(__s1_608, __s1_608, 3, 2, 1, 0); \
56021 int32x4_t __rev2_608; __rev2_608 = __builtin_shufflevector(__s2_608, __s2_608, 3, 2, 1, 0); \
56022 int64x2_t __ret_608; \
56023 __ret_608 = __noswap_vqdmlal_s32(__rev0_608, __noswap_vget_high_s32(__rev1_608), __noswap_splat_laneq_s32(__rev2_608, __p3_608)); \
56024 __ret_608 = __builtin_shufflevector(__ret_608, __ret_608, 1, 0); \
56025 __ret_608; \
57685#define vqdmlal_high_laneq_s32(__p0_700, __p1_700, __p2_700, __p3_700) __extension__ ({ \
57686 int64x2_t __s0_700 = __p0_700; \
57687 int32x4_t __s1_700 = __p1_700; \
57688 int32x4_t __s2_700 = __p2_700; \
57689 int64x2_t __rev0_700; __rev0_700 = __builtin_shufflevector(__s0_700, __s0_700, 1, 0); \
57690 int32x4_t __rev1_700; __rev1_700 = __builtin_shufflevector(__s1_700, __s1_700, 3, 2, 1, 0); \
57691 int32x4_t __rev2_700; __rev2_700 = __builtin_shufflevector(__s2_700, __s2_700, 3, 2, 1, 0); \
57692 int64x2_t __ret_700; \
57693 __ret_700 = __noswap_vqdmlal_s32(__rev0_700, __noswap_vget_high_s32(__rev1_700), __noswap_splat_laneq_s32(__rev2_700, __p3_700)); \
57694 __ret_700 = __builtin_shufflevector(__ret_700, __ret_700, 1, 0); \
57695 __ret_700; \
5602657696})
5602757697#endif
5602857698
5602957699#ifdef __LITTLE_ENDIAN__
56030#define vqdmlal_high_laneq_s16(__p0_609, __p1_609, __p2_609, __p3_609) __extension__ ({ \
56031 int32x4_t __s0_609 = __p0_609; \
56032 int16x8_t __s1_609 = __p1_609; \
56033 int16x8_t __s2_609 = __p2_609; \
56034 int32x4_t __ret_609; \
56035 __ret_609 = vqdmlal_s16(__s0_609, vget_high_s16(__s1_609), splat_laneq_s16(__s2_609, __p3_609)); \
56036 __ret_609; \
57700#define vqdmlal_high_laneq_s16(__p0_701, __p1_701, __p2_701, __p3_701) __extension__ ({ \
57701 int32x4_t __s0_701 = __p0_701; \
57702 int16x8_t __s1_701 = __p1_701; \
57703 int16x8_t __s2_701 = __p2_701; \
57704 int32x4_t __ret_701; \
57705 __ret_701 = vqdmlal_s16(__s0_701, vget_high_s16(__s1_701), splat_laneq_s16(__s2_701, __p3_701)); \
57706 __ret_701; \
5603757707})
5603857708#else
56039#define vqdmlal_high_laneq_s16(__p0_610, __p1_610, __p2_610, __p3_610) __extension__ ({ \
56040 int32x4_t __s0_610 = __p0_610; \
56041 int16x8_t __s1_610 = __p1_610; \
56042 int16x8_t __s2_610 = __p2_610; \
56043 int32x4_t __rev0_610; __rev0_610 = __builtin_shufflevector(__s0_610, __s0_610, 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); \
56045 int16x8_t __rev2_610; __rev2_610 = __builtin_shufflevector(__s2_610, __s2_610, 7, 6, 5, 4, 3, 2, 1, 0); \
56046 int32x4_t __ret_610; \
56047 __ret_610 = __noswap_vqdmlal_s16(__rev0_610, __noswap_vget_high_s16(__rev1_610), __noswap_splat_laneq_s16(__rev2_610, __p3_610)); \
56048 __ret_610 = __builtin_shufflevector(__ret_610, __ret_610, 3, 2, 1, 0); \
56049 __ret_610; \
57709#define vqdmlal_high_laneq_s16(__p0_702, __p1_702, __p2_702, __p3_702) __extension__ ({ \
57710 int32x4_t __s0_702 = __p0_702; \
57711 int16x8_t __s1_702 = __p1_702; \
57712 int16x8_t __s2_702 = __p2_702; \
57713 int32x4_t __rev0_702; __rev0_702 = __builtin_shufflevector(__s0_702, __s0_702, 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); \
57715 int16x8_t __rev2_702; __rev2_702 = __builtin_shufflevector(__s2_702, __s2_702, 7, 6, 5, 4, 3, 2, 1, 0); \
57716 int32x4_t __ret_702; \
57717 __ret_702 = __noswap_vqdmlal_s16(__rev0_702, __noswap_vget_high_s16(__rev1_702), __noswap_splat_laneq_s16(__rev2_702, __p3_702)); \
57718 __ret_702 = __builtin_shufflevector(__ret_702, __ret_702, 3, 2, 1, 0); \
57719 __ret_702; \
5605057720})
5605157721#endif
5605257722
......@@ -56169,50 +57839,50 @@ __ai int32x4_t vqdmlal_high_n_s16(int32x4_t __p0, int16x8_t __p1, int16_t __p2)
5616957839#endif
5617057840
5617157841#ifdef __LITTLE_ENDIAN__
56172#define vqdmlal_laneq_s32(__p0_611, __p1_611, __p2_611, __p3_611) __extension__ ({ \
56173 int64x2_t __s0_611 = __p0_611; \
56174 int32x2_t __s1_611 = __p1_611; \
56175 int32x4_t __s2_611 = __p2_611; \
56176 int64x2_t __ret_611; \
56177 __ret_611 = vqdmlal_s32(__s0_611, __s1_611, splat_laneq_s32(__s2_611, __p3_611)); \
56178 __ret_611; \
57842#define vqdmlal_laneq_s32(__p0_703, __p1_703, __p2_703, __p3_703) __extension__ ({ \
57843 int64x2_t __s0_703 = __p0_703; \
57844 int32x2_t __s1_703 = __p1_703; \
57845 int32x4_t __s2_703 = __p2_703; \
57846 int64x2_t __ret_703; \
57847 __ret_703 = vqdmlal_s32(__s0_703, __s1_703, splat_laneq_s32(__s2_703, __p3_703)); \
57848 __ret_703; \
5617957849})
5618057850#else
56181#define vqdmlal_laneq_s32(__p0_612, __p1_612, __p2_612, __p3_612) __extension__ ({ \
56182 int64x2_t __s0_612 = __p0_612; \
56183 int32x2_t __s1_612 = __p1_612; \
56184 int32x4_t __s2_612 = __p2_612; \
56185 int64x2_t __rev0_612; __rev0_612 = __builtin_shufflevector(__s0_612, __s0_612, 1, 0); \
56186 int32x2_t __rev1_612; __rev1_612 = __builtin_shufflevector(__s1_612, __s1_612, 1, 0); \
56187 int32x4_t __rev2_612; __rev2_612 = __builtin_shufflevector(__s2_612, __s2_612, 3, 2, 1, 0); \
56188 int64x2_t __ret_612; \
56189 __ret_612 = __noswap_vqdmlal_s32(__rev0_612, __rev1_612, __noswap_splat_laneq_s32(__rev2_612, __p3_612)); \
56190 __ret_612 = __builtin_shufflevector(__ret_612, __ret_612, 1, 0); \
56191 __ret_612; \
57851#define vqdmlal_laneq_s32(__p0_704, __p1_704, __p2_704, __p3_704) __extension__ ({ \
57852 int64x2_t __s0_704 = __p0_704; \
57853 int32x2_t __s1_704 = __p1_704; \
57854 int32x4_t __s2_704 = __p2_704; \
57855 int64x2_t __rev0_704; __rev0_704 = __builtin_shufflevector(__s0_704, __s0_704, 1, 0); \
57856 int32x2_t __rev1_704; __rev1_704 = __builtin_shufflevector(__s1_704, __s1_704, 1, 0); \
57857 int32x4_t __rev2_704; __rev2_704 = __builtin_shufflevector(__s2_704, __s2_704, 3, 2, 1, 0); \
57858 int64x2_t __ret_704; \
57859 __ret_704 = __noswap_vqdmlal_s32(__rev0_704, __rev1_704, __noswap_splat_laneq_s32(__rev2_704, __p3_704)); \
57860 __ret_704 = __builtin_shufflevector(__ret_704, __ret_704, 1, 0); \
57861 __ret_704; \
5619257862})
5619357863#endif
5619457864
5619557865#ifdef __LITTLE_ENDIAN__
56196#define vqdmlal_laneq_s16(__p0_613, __p1_613, __p2_613, __p3_613) __extension__ ({ \
56197 int32x4_t __s0_613 = __p0_613; \
56198 int16x4_t __s1_613 = __p1_613; \
56199 int16x8_t __s2_613 = __p2_613; \
56200 int32x4_t __ret_613; \
56201 __ret_613 = vqdmlal_s16(__s0_613, __s1_613, splat_laneq_s16(__s2_613, __p3_613)); \
56202 __ret_613; \
57866#define vqdmlal_laneq_s16(__p0_705, __p1_705, __p2_705, __p3_705) __extension__ ({ \
57867 int32x4_t __s0_705 = __p0_705; \
57868 int16x4_t __s1_705 = __p1_705; \
57869 int16x8_t __s2_705 = __p2_705; \
57870 int32x4_t __ret_705; \
57871 __ret_705 = vqdmlal_s16(__s0_705, __s1_705, splat_laneq_s16(__s2_705, __p3_705)); \
57872 __ret_705; \
5620357873})
5620457874#else
56205#define vqdmlal_laneq_s16(__p0_614, __p1_614, __p2_614, __p3_614) __extension__ ({ \
56206 int32x4_t __s0_614 = __p0_614; \
56207 int16x4_t __s1_614 = __p1_614; \
56208 int16x8_t __s2_614 = __p2_614; \
56209 int32x4_t __rev0_614; __rev0_614 = __builtin_shufflevector(__s0_614, __s0_614, 3, 2, 1, 0); \
56210 int16x4_t __rev1_614; __rev1_614 = __builtin_shufflevector(__s1_614, __s1_614, 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); \
56212 int32x4_t __ret_614; \
56213 __ret_614 = __noswap_vqdmlal_s16(__rev0_614, __rev1_614, __noswap_splat_laneq_s16(__rev2_614, __p3_614)); \
56214 __ret_614 = __builtin_shufflevector(__ret_614, __ret_614, 3, 2, 1, 0); \
56215 __ret_614; \
57875#define vqdmlal_laneq_s16(__p0_706, __p1_706, __p2_706, __p3_706) __extension__ ({ \
57876 int32x4_t __s0_706 = __p0_706; \
57877 int16x4_t __s1_706 = __p1_706; \
57878 int16x8_t __s2_706 = __p2_706; \
57879 int32x4_t __rev0_706; __rev0_706 = __builtin_shufflevector(__s0_706, __s0_706, 3, 2, 1, 0); \
57880 int16x4_t __rev1_706; __rev1_706 = __builtin_shufflevector(__s1_706, __s1_706, 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); \
57882 int32x4_t __ret_706; \
57883 __ret_706 = __noswap_vqdmlal_s16(__rev0_706, __rev1_706, __noswap_splat_laneq_s16(__rev2_706, __p3_706)); \
57884 __ret_706 = __builtin_shufflevector(__ret_706, __ret_706, 3, 2, 1, 0); \
57885 __ret_706; \
5621657886})
5621757887#endif
5621857888
......@@ -56263,98 +57933,98 @@ __ai int32x4_t vqdmlsl_high_s16(int32x4_t __p0, int16x8_t __p1, int16x8_t __p2)
5626357933#endif
5626457934
5626557935#ifdef __LITTLE_ENDIAN__
56266#define vqdmlsl_high_lane_s32(__p0_615, __p1_615, __p2_615, __p3_615) __extension__ ({ \
56267 int64x2_t __s0_615 = __p0_615; \
56268 int32x4_t __s1_615 = __p1_615; \
56269 int32x2_t __s2_615 = __p2_615; \
56270 int64x2_t __ret_615; \
56271 __ret_615 = vqdmlsl_s32(__s0_615, vget_high_s32(__s1_615), splat_lane_s32(__s2_615, __p3_615)); \
56272 __ret_615; \
57936#define vqdmlsl_high_lane_s32(__p0_707, __p1_707, __p2_707, __p3_707) __extension__ ({ \
57937 int64x2_t __s0_707 = __p0_707; \
57938 int32x4_t __s1_707 = __p1_707; \
57939 int32x2_t __s2_707 = __p2_707; \
57940 int64x2_t __ret_707; \
57941 __ret_707 = vqdmlsl_s32(__s0_707, vget_high_s32(__s1_707), splat_lane_s32(__s2_707, __p3_707)); \
57942 __ret_707; \
5627357943})
5627457944#else
56275#define vqdmlsl_high_lane_s32(__p0_616, __p1_616, __p2_616, __p3_616) __extension__ ({ \
56276 int64x2_t __s0_616 = __p0_616; \
56277 int32x4_t __s1_616 = __p1_616; \
56278 int32x2_t __s2_616 = __p2_616; \
56279 int64x2_t __rev0_616; __rev0_616 = __builtin_shufflevector(__s0_616, __s0_616, 1, 0); \
56280 int32x4_t __rev1_616; __rev1_616 = __builtin_shufflevector(__s1_616, __s1_616, 3, 2, 1, 0); \
56281 int32x2_t __rev2_616; __rev2_616 = __builtin_shufflevector(__s2_616, __s2_616, 1, 0); \
56282 int64x2_t __ret_616; \
56283 __ret_616 = __noswap_vqdmlsl_s32(__rev0_616, __noswap_vget_high_s32(__rev1_616), __noswap_splat_lane_s32(__rev2_616, __p3_616)); \
56284 __ret_616 = __builtin_shufflevector(__ret_616, __ret_616, 1, 0); \
56285 __ret_616; \
57945#define vqdmlsl_high_lane_s32(__p0_708, __p1_708, __p2_708, __p3_708) __extension__ ({ \
57946 int64x2_t __s0_708 = __p0_708; \
57947 int32x4_t __s1_708 = __p1_708; \
57948 int32x2_t __s2_708 = __p2_708; \
57949 int64x2_t __rev0_708; __rev0_708 = __builtin_shufflevector(__s0_708, __s0_708, 1, 0); \
57950 int32x4_t __rev1_708; __rev1_708 = __builtin_shufflevector(__s1_708, __s1_708, 3, 2, 1, 0); \
57951 int32x2_t __rev2_708; __rev2_708 = __builtin_shufflevector(__s2_708, __s2_708, 1, 0); \
57952 int64x2_t __ret_708; \
57953 __ret_708 = __noswap_vqdmlsl_s32(__rev0_708, __noswap_vget_high_s32(__rev1_708), __noswap_splat_lane_s32(__rev2_708, __p3_708)); \
57954 __ret_708 = __builtin_shufflevector(__ret_708, __ret_708, 1, 0); \
57955 __ret_708; \
5628657956})
5628757957#endif
5628857958
5628957959#ifdef __LITTLE_ENDIAN__
56290#define vqdmlsl_high_lane_s16(__p0_617, __p1_617, __p2_617, __p3_617) __extension__ ({ \
56291 int32x4_t __s0_617 = __p0_617; \
56292 int16x8_t __s1_617 = __p1_617; \
56293 int16x4_t __s2_617 = __p2_617; \
56294 int32x4_t __ret_617; \
56295 __ret_617 = vqdmlsl_s16(__s0_617, vget_high_s16(__s1_617), splat_lane_s16(__s2_617, __p3_617)); \
56296 __ret_617; \
57960#define vqdmlsl_high_lane_s16(__p0_709, __p1_709, __p2_709, __p3_709) __extension__ ({ \
57961 int32x4_t __s0_709 = __p0_709; \
57962 int16x8_t __s1_709 = __p1_709; \
57963 int16x4_t __s2_709 = __p2_709; \
57964 int32x4_t __ret_709; \
57965 __ret_709 = vqdmlsl_s16(__s0_709, vget_high_s16(__s1_709), splat_lane_s16(__s2_709, __p3_709)); \
57966 __ret_709; \
5629757967})
5629857968#else
56299#define vqdmlsl_high_lane_s16(__p0_618, __p1_618, __p2_618, __p3_618) __extension__ ({ \
56300 int32x4_t __s0_618 = __p0_618; \
56301 int16x8_t __s1_618 = __p1_618; \
56302 int16x4_t __s2_618 = __p2_618; \
56303 int32x4_t __rev0_618; __rev0_618 = __builtin_shufflevector(__s0_618, __s0_618, 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); \
56305 int16x4_t __rev2_618; __rev2_618 = __builtin_shufflevector(__s2_618, __s2_618, 3, 2, 1, 0); \
56306 int32x4_t __ret_618; \
56307 __ret_618 = __noswap_vqdmlsl_s16(__rev0_618, __noswap_vget_high_s16(__rev1_618), __noswap_splat_lane_s16(__rev2_618, __p3_618)); \
56308 __ret_618 = __builtin_shufflevector(__ret_618, __ret_618, 3, 2, 1, 0); \
56309 __ret_618; \
57969#define vqdmlsl_high_lane_s16(__p0_710, __p1_710, __p2_710, __p3_710) __extension__ ({ \
57970 int32x4_t __s0_710 = __p0_710; \
57971 int16x8_t __s1_710 = __p1_710; \
57972 int16x4_t __s2_710 = __p2_710; \
57973 int32x4_t __rev0_710; __rev0_710 = __builtin_shufflevector(__s0_710, __s0_710, 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); \
57975 int16x4_t __rev2_710; __rev2_710 = __builtin_shufflevector(__s2_710, __s2_710, 3, 2, 1, 0); \
57976 int32x4_t __ret_710; \
57977 __ret_710 = __noswap_vqdmlsl_s16(__rev0_710, __noswap_vget_high_s16(__rev1_710), __noswap_splat_lane_s16(__rev2_710, __p3_710)); \
57978 __ret_710 = __builtin_shufflevector(__ret_710, __ret_710, 3, 2, 1, 0); \
57979 __ret_710; \
5631057980})
5631157981#endif
5631257982
5631357983#ifdef __LITTLE_ENDIAN__
56314#define vqdmlsl_high_laneq_s32(__p0_619, __p1_619, __p2_619, __p3_619) __extension__ ({ \
56315 int64x2_t __s0_619 = __p0_619; \
56316 int32x4_t __s1_619 = __p1_619; \
56317 int32x4_t __s2_619 = __p2_619; \
56318 int64x2_t __ret_619; \
56319 __ret_619 = vqdmlsl_s32(__s0_619, vget_high_s32(__s1_619), splat_laneq_s32(__s2_619, __p3_619)); \
56320 __ret_619; \
57984#define vqdmlsl_high_laneq_s32(__p0_711, __p1_711, __p2_711, __p3_711) __extension__ ({ \
57985 int64x2_t __s0_711 = __p0_711; \
57986 int32x4_t __s1_711 = __p1_711; \
57987 int32x4_t __s2_711 = __p2_711; \
57988 int64x2_t __ret_711; \
57989 __ret_711 = vqdmlsl_s32(__s0_711, vget_high_s32(__s1_711), splat_laneq_s32(__s2_711, __p3_711)); \
57990 __ret_711; \
5632157991})
5632257992#else
56323#define vqdmlsl_high_laneq_s32(__p0_620, __p1_620, __p2_620, __p3_620) __extension__ ({ \
56324 int64x2_t __s0_620 = __p0_620; \
56325 int32x4_t __s1_620 = __p1_620; \
56326 int32x4_t __s2_620 = __p2_620; \
56327 int64x2_t __rev0_620; __rev0_620 = __builtin_shufflevector(__s0_620, __s0_620, 1, 0); \
56328 int32x4_t __rev1_620; __rev1_620 = __builtin_shufflevector(__s1_620, __s1_620, 3, 2, 1, 0); \
56329 int32x4_t __rev2_620; __rev2_620 = __builtin_shufflevector(__s2_620, __s2_620, 3, 2, 1, 0); \
56330 int64x2_t __ret_620; \
56331 __ret_620 = __noswap_vqdmlsl_s32(__rev0_620, __noswap_vget_high_s32(__rev1_620), __noswap_splat_laneq_s32(__rev2_620, __p3_620)); \
56332 __ret_620 = __builtin_shufflevector(__ret_620, __ret_620, 1, 0); \
56333 __ret_620; \
57993#define vqdmlsl_high_laneq_s32(__p0_712, __p1_712, __p2_712, __p3_712) __extension__ ({ \
57994 int64x2_t __s0_712 = __p0_712; \
57995 int32x4_t __s1_712 = __p1_712; \
57996 int32x4_t __s2_712 = __p2_712; \
57997 int64x2_t __rev0_712; __rev0_712 = __builtin_shufflevector(__s0_712, __s0_712, 1, 0); \
57998 int32x4_t __rev1_712; __rev1_712 = __builtin_shufflevector(__s1_712, __s1_712, 3, 2, 1, 0); \
57999 int32x4_t __rev2_712; __rev2_712 = __builtin_shufflevector(__s2_712, __s2_712, 3, 2, 1, 0); \
58000 int64x2_t __ret_712; \
58001 __ret_712 = __noswap_vqdmlsl_s32(__rev0_712, __noswap_vget_high_s32(__rev1_712), __noswap_splat_laneq_s32(__rev2_712, __p3_712)); \
58002 __ret_712 = __builtin_shufflevector(__ret_712, __ret_712, 1, 0); \
58003 __ret_712; \
5633458004})
5633558005#endif
5633658006
5633758007#ifdef __LITTLE_ENDIAN__
56338#define vqdmlsl_high_laneq_s16(__p0_621, __p1_621, __p2_621, __p3_621) __extension__ ({ \
56339 int32x4_t __s0_621 = __p0_621; \
56340 int16x8_t __s1_621 = __p1_621; \
56341 int16x8_t __s2_621 = __p2_621; \
56342 int32x4_t __ret_621; \
56343 __ret_621 = vqdmlsl_s16(__s0_621, vget_high_s16(__s1_621), splat_laneq_s16(__s2_621, __p3_621)); \
56344 __ret_621; \
58008#define vqdmlsl_high_laneq_s16(__p0_713, __p1_713, __p2_713, __p3_713) __extension__ ({ \
58009 int32x4_t __s0_713 = __p0_713; \
58010 int16x8_t __s1_713 = __p1_713; \
58011 int16x8_t __s2_713 = __p2_713; \
58012 int32x4_t __ret_713; \
58013 __ret_713 = vqdmlsl_s16(__s0_713, vget_high_s16(__s1_713), splat_laneq_s16(__s2_713, __p3_713)); \
58014 __ret_713; \
5634558015})
5634658016#else
56347#define vqdmlsl_high_laneq_s16(__p0_622, __p1_622, __p2_622, __p3_622) __extension__ ({ \
56348 int32x4_t __s0_622 = __p0_622; \
56349 int16x8_t __s1_622 = __p1_622; \
56350 int16x8_t __s2_622 = __p2_622; \
56351 int32x4_t __rev0_622; __rev0_622 = __builtin_shufflevector(__s0_622, __s0_622, 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); \
56353 int16x8_t __rev2_622; __rev2_622 = __builtin_shufflevector(__s2_622, __s2_622, 7, 6, 5, 4, 3, 2, 1, 0); \
56354 int32x4_t __ret_622; \
56355 __ret_622 = __noswap_vqdmlsl_s16(__rev0_622, __noswap_vget_high_s16(__rev1_622), __noswap_splat_laneq_s16(__rev2_622, __p3_622)); \
56356 __ret_622 = __builtin_shufflevector(__ret_622, __ret_622, 3, 2, 1, 0); \
56357 __ret_622; \
58017#define vqdmlsl_high_laneq_s16(__p0_714, __p1_714, __p2_714, __p3_714) __extension__ ({ \
58018 int32x4_t __s0_714 = __p0_714; \
58019 int16x8_t __s1_714 = __p1_714; \
58020 int16x8_t __s2_714 = __p2_714; \
58021 int32x4_t __rev0_714; __rev0_714 = __builtin_shufflevector(__s0_714, __s0_714, 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); \
58023 int16x8_t __rev2_714; __rev2_714 = __builtin_shufflevector(__s2_714, __s2_714, 7, 6, 5, 4, 3, 2, 1, 0); \
58024 int32x4_t __ret_714; \
58025 __ret_714 = __noswap_vqdmlsl_s16(__rev0_714, __noswap_vget_high_s16(__rev1_714), __noswap_splat_laneq_s16(__rev2_714, __p3_714)); \
58026 __ret_714 = __builtin_shufflevector(__ret_714, __ret_714, 3, 2, 1, 0); \
58027 __ret_714; \
5635858028})
5635958029#endif
5636058030
......@@ -56477,50 +58147,50 @@ __ai int32x4_t vqdmlsl_high_n_s16(int32x4_t __p0, int16x8_t __p1, int16_t __p2)
5647758147#endif
5647858148
5647958149#ifdef __LITTLE_ENDIAN__
56480#define vqdmlsl_laneq_s32(__p0_623, __p1_623, __p2_623, __p3_623) __extension__ ({ \
56481 int64x2_t __s0_623 = __p0_623; \
56482 int32x2_t __s1_623 = __p1_623; \
56483 int32x4_t __s2_623 = __p2_623; \
56484 int64x2_t __ret_623; \
56485 __ret_623 = vqdmlsl_s32(__s0_623, __s1_623, splat_laneq_s32(__s2_623, __p3_623)); \
56486 __ret_623; \
58150#define vqdmlsl_laneq_s32(__p0_715, __p1_715, __p2_715, __p3_715) __extension__ ({ \
58151 int64x2_t __s0_715 = __p0_715; \
58152 int32x2_t __s1_715 = __p1_715; \
58153 int32x4_t __s2_715 = __p2_715; \
58154 int64x2_t __ret_715; \
58155 __ret_715 = vqdmlsl_s32(__s0_715, __s1_715, splat_laneq_s32(__s2_715, __p3_715)); \
58156 __ret_715; \
5648758157})
5648858158#else
56489#define vqdmlsl_laneq_s32(__p0_624, __p1_624, __p2_624, __p3_624) __extension__ ({ \
56490 int64x2_t __s0_624 = __p0_624; \
56491 int32x2_t __s1_624 = __p1_624; \
56492 int32x4_t __s2_624 = __p2_624; \
56493 int64x2_t __rev0_624; __rev0_624 = __builtin_shufflevector(__s0_624, __s0_624, 1, 0); \
56494 int32x2_t __rev1_624; __rev1_624 = __builtin_shufflevector(__s1_624, __s1_624, 1, 0); \
56495 int32x4_t __rev2_624; __rev2_624 = __builtin_shufflevector(__s2_624, __s2_624, 3, 2, 1, 0); \
56496 int64x2_t __ret_624; \
56497 __ret_624 = __noswap_vqdmlsl_s32(__rev0_624, __rev1_624, __noswap_splat_laneq_s32(__rev2_624, __p3_624)); \
56498 __ret_624 = __builtin_shufflevector(__ret_624, __ret_624, 1, 0); \
56499 __ret_624; \
58159#define vqdmlsl_laneq_s32(__p0_716, __p1_716, __p2_716, __p3_716) __extension__ ({ \
58160 int64x2_t __s0_716 = __p0_716; \
58161 int32x2_t __s1_716 = __p1_716; \
58162 int32x4_t __s2_716 = __p2_716; \
58163 int64x2_t __rev0_716; __rev0_716 = __builtin_shufflevector(__s0_716, __s0_716, 1, 0); \
58164 int32x2_t __rev1_716; __rev1_716 = __builtin_shufflevector(__s1_716, __s1_716, 1, 0); \
58165 int32x4_t __rev2_716; __rev2_716 = __builtin_shufflevector(__s2_716, __s2_716, 3, 2, 1, 0); \
58166 int64x2_t __ret_716; \
58167 __ret_716 = __noswap_vqdmlsl_s32(__rev0_716, __rev1_716, __noswap_splat_laneq_s32(__rev2_716, __p3_716)); \
58168 __ret_716 = __builtin_shufflevector(__ret_716, __ret_716, 1, 0); \
58169 __ret_716; \
5650058170})
5650158171#endif
5650258172
5650358173#ifdef __LITTLE_ENDIAN__
56504#define vqdmlsl_laneq_s16(__p0_625, __p1_625, __p2_625, __p3_625) __extension__ ({ \
56505 int32x4_t __s0_625 = __p0_625; \
56506 int16x4_t __s1_625 = __p1_625; \
56507 int16x8_t __s2_625 = __p2_625; \
56508 int32x4_t __ret_625; \
56509 __ret_625 = vqdmlsl_s16(__s0_625, __s1_625, splat_laneq_s16(__s2_625, __p3_625)); \
56510 __ret_625; \
58174#define vqdmlsl_laneq_s16(__p0_717, __p1_717, __p2_717, __p3_717) __extension__ ({ \
58175 int32x4_t __s0_717 = __p0_717; \
58176 int16x4_t __s1_717 = __p1_717; \
58177 int16x8_t __s2_717 = __p2_717; \
58178 int32x4_t __ret_717; \
58179 __ret_717 = vqdmlsl_s16(__s0_717, __s1_717, splat_laneq_s16(__s2_717, __p3_717)); \
58180 __ret_717; \
5651158181})
5651258182#else
56513#define vqdmlsl_laneq_s16(__p0_626, __p1_626, __p2_626, __p3_626) __extension__ ({ \
56514 int32x4_t __s0_626 = __p0_626; \
56515 int16x4_t __s1_626 = __p1_626; \
56516 int16x8_t __s2_626 = __p2_626; \
56517 int32x4_t __rev0_626; __rev0_626 = __builtin_shufflevector(__s0_626, __s0_626, 3, 2, 1, 0); \
56518 int16x4_t __rev1_626; __rev1_626 = __builtin_shufflevector(__s1_626, __s1_626, 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); \
56520 int32x4_t __ret_626; \
56521 __ret_626 = __noswap_vqdmlsl_s16(__rev0_626, __rev1_626, __noswap_splat_laneq_s16(__rev2_626, __p3_626)); \
56522 __ret_626 = __builtin_shufflevector(__ret_626, __ret_626, 3, 2, 1, 0); \
56523 __ret_626; \
58183#define vqdmlsl_laneq_s16(__p0_718, __p1_718, __p2_718, __p3_718) __extension__ ({ \
58184 int32x4_t __s0_718 = __p0_718; \
58185 int16x4_t __s1_718 = __p1_718; \
58186 int16x8_t __s2_718 = __p2_718; \
58187 int32x4_t __rev0_718; __rev0_718 = __builtin_shufflevector(__s0_718, __s0_718, 3, 2, 1, 0); \
58188 int16x4_t __rev1_718; __rev1_718 = __builtin_shufflevector(__s1_718, __s1_718, 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); \
58190 int32x4_t __ret_718; \
58191 __ret_718 = __noswap_vqdmlsl_s16(__rev0_718, __rev1_718, __noswap_splat_laneq_s16(__rev2_718, __p3_718)); \
58192 __ret_718 = __builtin_shufflevector(__ret_718, __ret_718, 3, 2, 1, 0); \
58193 __ret_718; \
5652458194})
5652558195#endif
5652658196
......@@ -56619,78 +58289,78 @@ __ai int16_t vqdmulhh_s16(int16_t __p0, int16_t __p1) {
5661958289#endif
5662058290
5662158291#ifdef __LITTLE_ENDIAN__
56622#define vqdmulhs_lane_s32(__p0_627, __p1_627, __p2_627) __extension__ ({ \
56623 int32_t __s0_627 = __p0_627; \
56624 int32x2_t __s1_627 = __p1_627; \
56625 int32_t __ret_627; \
56626 __ret_627 = vqdmulhs_s32(__s0_627, vget_lane_s32(__s1_627, __p2_627)); \
56627 __ret_627; \
58292#define vqdmulhs_lane_s32(__p0_719, __p1_719, __p2_719) __extension__ ({ \
58293 int32_t __s0_719 = __p0_719; \
58294 int32x2_t __s1_719 = __p1_719; \
58295 int32_t __ret_719; \
58296 __ret_719 = vqdmulhs_s32(__s0_719, vget_lane_s32(__s1_719, __p2_719)); \
58297 __ret_719; \
5662858298})
5662958299#else
56630#define vqdmulhs_lane_s32(__p0_628, __p1_628, __p2_628) __extension__ ({ \
56631 int32_t __s0_628 = __p0_628; \
56632 int32x2_t __s1_628 = __p1_628; \
56633 int32x2_t __rev1_628; __rev1_628 = __builtin_shufflevector(__s1_628, __s1_628, 1, 0); \
56634 int32_t __ret_628; \
56635 __ret_628 = vqdmulhs_s32(__s0_628, __noswap_vget_lane_s32(__rev1_628, __p2_628)); \
56636 __ret_628; \
58300#define vqdmulhs_lane_s32(__p0_720, __p1_720, __p2_720) __extension__ ({ \
58301 int32_t __s0_720 = __p0_720; \
58302 int32x2_t __s1_720 = __p1_720; \
58303 int32x2_t __rev1_720; __rev1_720 = __builtin_shufflevector(__s1_720, __s1_720, 1, 0); \
58304 int32_t __ret_720; \
58305 __ret_720 = vqdmulhs_s32(__s0_720, __noswap_vget_lane_s32(__rev1_720, __p2_720)); \
58306 __ret_720; \
5663758307})
5663858308#endif
5663958309
5664058310#ifdef __LITTLE_ENDIAN__
56641#define vqdmulhh_lane_s16(__p0_629, __p1_629, __p2_629) __extension__ ({ \
56642 int16_t __s0_629 = __p0_629; \
56643 int16x4_t __s1_629 = __p1_629; \
56644 int16_t __ret_629; \
56645 __ret_629 = vqdmulhh_s16(__s0_629, vget_lane_s16(__s1_629, __p2_629)); \
56646 __ret_629; \
58311#define vqdmulhh_lane_s16(__p0_721, __p1_721, __p2_721) __extension__ ({ \
58312 int16_t __s0_721 = __p0_721; \
58313 int16x4_t __s1_721 = __p1_721; \
58314 int16_t __ret_721; \
58315 __ret_721 = vqdmulhh_s16(__s0_721, vget_lane_s16(__s1_721, __p2_721)); \
58316 __ret_721; \
5664758317})
5664858318#else
56649#define vqdmulhh_lane_s16(__p0_630, __p1_630, __p2_630) __extension__ ({ \
56650 int16_t __s0_630 = __p0_630; \
56651 int16x4_t __s1_630 = __p1_630; \
56652 int16x4_t __rev1_630; __rev1_630 = __builtin_shufflevector(__s1_630, __s1_630, 3, 2, 1, 0); \
56653 int16_t __ret_630; \
56654 __ret_630 = vqdmulhh_s16(__s0_630, __noswap_vget_lane_s16(__rev1_630, __p2_630)); \
56655 __ret_630; \
58319#define vqdmulhh_lane_s16(__p0_722, __p1_722, __p2_722) __extension__ ({ \
58320 int16_t __s0_722 = __p0_722; \
58321 int16x4_t __s1_722 = __p1_722; \
58322 int16x4_t __rev1_722; __rev1_722 = __builtin_shufflevector(__s1_722, __s1_722, 3, 2, 1, 0); \
58323 int16_t __ret_722; \
58324 __ret_722 = vqdmulhh_s16(__s0_722, __noswap_vget_lane_s16(__rev1_722, __p2_722)); \
58325 __ret_722; \
5665658326})
5665758327#endif
5665858328
5665958329#ifdef __LITTLE_ENDIAN__
56660#define vqdmulhs_laneq_s32(__p0_631, __p1_631, __p2_631) __extension__ ({ \
56661 int32_t __s0_631 = __p0_631; \
56662 int32x4_t __s1_631 = __p1_631; \
56663 int32_t __ret_631; \
56664 __ret_631 = vqdmulhs_s32(__s0_631, vgetq_lane_s32(__s1_631, __p2_631)); \
56665 __ret_631; \
58330#define vqdmulhs_laneq_s32(__p0_723, __p1_723, __p2_723) __extension__ ({ \
58331 int32_t __s0_723 = __p0_723; \
58332 int32x4_t __s1_723 = __p1_723; \
58333 int32_t __ret_723; \
58334 __ret_723 = vqdmulhs_s32(__s0_723, vgetq_lane_s32(__s1_723, __p2_723)); \
58335 __ret_723; \
5666658336})
5666758337#else
56668#define vqdmulhs_laneq_s32(__p0_632, __p1_632, __p2_632) __extension__ ({ \
56669 int32_t __s0_632 = __p0_632; \
56670 int32x4_t __s1_632 = __p1_632; \
56671 int32x4_t __rev1_632; __rev1_632 = __builtin_shufflevector(__s1_632, __s1_632, 3, 2, 1, 0); \
56672 int32_t __ret_632; \
56673 __ret_632 = vqdmulhs_s32(__s0_632, __noswap_vgetq_lane_s32(__rev1_632, __p2_632)); \
56674 __ret_632; \
58338#define vqdmulhs_laneq_s32(__p0_724, __p1_724, __p2_724) __extension__ ({ \
58339 int32_t __s0_724 = __p0_724; \
58340 int32x4_t __s1_724 = __p1_724; \
58341 int32x4_t __rev1_724; __rev1_724 = __builtin_shufflevector(__s1_724, __s1_724, 3, 2, 1, 0); \
58342 int32_t __ret_724; \
58343 __ret_724 = vqdmulhs_s32(__s0_724, __noswap_vgetq_lane_s32(__rev1_724, __p2_724)); \
58344 __ret_724; \
5667558345})
5667658346#endif
5667758347
5667858348#ifdef __LITTLE_ENDIAN__
56679#define vqdmulhh_laneq_s16(__p0_633, __p1_633, __p2_633) __extension__ ({ \
56680 int16_t __s0_633 = __p0_633; \
56681 int16x8_t __s1_633 = __p1_633; \
56682 int16_t __ret_633; \
56683 __ret_633 = vqdmulhh_s16(__s0_633, vgetq_lane_s16(__s1_633, __p2_633)); \
56684 __ret_633; \
58349#define vqdmulhh_laneq_s16(__p0_725, __p1_725, __p2_725) __extension__ ({ \
58350 int16_t __s0_725 = __p0_725; \
58351 int16x8_t __s1_725 = __p1_725; \
58352 int16_t __ret_725; \
58353 __ret_725 = vqdmulhh_s16(__s0_725, vgetq_lane_s16(__s1_725, __p2_725)); \
58354 __ret_725; \
5668558355})
5668658356#else
56687#define vqdmulhh_laneq_s16(__p0_634, __p1_634, __p2_634) __extension__ ({ \
56688 int16_t __s0_634 = __p0_634; \
56689 int16x8_t __s1_634 = __p1_634; \
56690 int16x8_t __rev1_634; __rev1_634 = __builtin_shufflevector(__s1_634, __s1_634, 7, 6, 5, 4, 3, 2, 1, 0); \
56691 int16_t __ret_634; \
56692 __ret_634 = vqdmulhh_s16(__s0_634, __noswap_vgetq_lane_s16(__rev1_634, __p2_634)); \
56693 __ret_634; \
58357#define vqdmulhh_laneq_s16(__p0_726, __p1_726, __p2_726) __extension__ ({ \
58358 int16_t __s0_726 = __p0_726; \
58359 int16x8_t __s1_726 = __p1_726; \
58360 int16x8_t __rev1_726; __rev1_726 = __builtin_shufflevector(__s1_726, __s1_726, 7, 6, 5, 4, 3, 2, 1, 0); \
58361 int16_t __ret_726; \
58362 __ret_726 = vqdmulhh_s16(__s0_726, __noswap_vgetq_lane_s16(__rev1_726, __p2_726)); \
58363 __ret_726; \
5669458364})
5669558365#endif
5669658366
......@@ -56823,86 +58493,86 @@ __ai int32x4_t vqdmull_high_s16(int16x8_t __p0, int16x8_t __p1) {
5682358493#endif
5682458494
5682558495#ifdef __LITTLE_ENDIAN__
56826#define vqdmull_high_lane_s32(__p0_635, __p1_635, __p2_635) __extension__ ({ \
56827 int32x4_t __s0_635 = __p0_635; \
56828 int32x2_t __s1_635 = __p1_635; \
56829 int64x2_t __ret_635; \
56830 __ret_635 = vqdmull_s32(vget_high_s32(__s0_635), splat_lane_s32(__s1_635, __p2_635)); \
56831 __ret_635; \
58496#define vqdmull_high_lane_s32(__p0_727, __p1_727, __p2_727) __extension__ ({ \
58497 int32x4_t __s0_727 = __p0_727; \
58498 int32x2_t __s1_727 = __p1_727; \
58499 int64x2_t __ret_727; \
58500 __ret_727 = vqdmull_s32(vget_high_s32(__s0_727), splat_lane_s32(__s1_727, __p2_727)); \
58501 __ret_727; \
5683258502})
5683358503#else
56834#define vqdmull_high_lane_s32(__p0_636, __p1_636, __p2_636) __extension__ ({ \
56835 int32x4_t __s0_636 = __p0_636; \
56836 int32x2_t __s1_636 = __p1_636; \
56837 int32x4_t __rev0_636; __rev0_636 = __builtin_shufflevector(__s0_636, __s0_636, 3, 2, 1, 0); \
56838 int32x2_t __rev1_636; __rev1_636 = __builtin_shufflevector(__s1_636, __s1_636, 1, 0); \
56839 int64x2_t __ret_636; \
56840 __ret_636 = __noswap_vqdmull_s32(__noswap_vget_high_s32(__rev0_636), __noswap_splat_lane_s32(__rev1_636, __p2_636)); \
56841 __ret_636 = __builtin_shufflevector(__ret_636, __ret_636, 1, 0); \
56842 __ret_636; \
58504#define vqdmull_high_lane_s32(__p0_728, __p1_728, __p2_728) __extension__ ({ \
58505 int32x4_t __s0_728 = __p0_728; \
58506 int32x2_t __s1_728 = __p1_728; \
58507 int32x4_t __rev0_728; __rev0_728 = __builtin_shufflevector(__s0_728, __s0_728, 3, 2, 1, 0); \
58508 int32x2_t __rev1_728; __rev1_728 = __builtin_shufflevector(__s1_728, __s1_728, 1, 0); \
58509 int64x2_t __ret_728; \
58510 __ret_728 = __noswap_vqdmull_s32(__noswap_vget_high_s32(__rev0_728), __noswap_splat_lane_s32(__rev1_728, __p2_728)); \
58511 __ret_728 = __builtin_shufflevector(__ret_728, __ret_728, 1, 0); \
58512 __ret_728; \
5684358513})
5684458514#endif
5684558515
5684658516#ifdef __LITTLE_ENDIAN__
56847#define vqdmull_high_lane_s16(__p0_637, __p1_637, __p2_637) __extension__ ({ \
56848 int16x8_t __s0_637 = __p0_637; \
56849 int16x4_t __s1_637 = __p1_637; \
56850 int32x4_t __ret_637; \
56851 __ret_637 = vqdmull_s16(vget_high_s16(__s0_637), splat_lane_s16(__s1_637, __p2_637)); \
56852 __ret_637; \
58517#define vqdmull_high_lane_s16(__p0_729, __p1_729, __p2_729) __extension__ ({ \
58518 int16x8_t __s0_729 = __p0_729; \
58519 int16x4_t __s1_729 = __p1_729; \
58520 int32x4_t __ret_729; \
58521 __ret_729 = vqdmull_s16(vget_high_s16(__s0_729), splat_lane_s16(__s1_729, __p2_729)); \
58522 __ret_729; \
5685358523})
5685458524#else
56855#define vqdmull_high_lane_s16(__p0_638, __p1_638, __p2_638) __extension__ ({ \
56856 int16x8_t __s0_638 = __p0_638; \
56857 int16x4_t __s1_638 = __p1_638; \
56858 int16x8_t __rev0_638; __rev0_638 = __builtin_shufflevector(__s0_638, __s0_638, 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); \
56860 int32x4_t __ret_638; \
56861 __ret_638 = __noswap_vqdmull_s16(__noswap_vget_high_s16(__rev0_638), __noswap_splat_lane_s16(__rev1_638, __p2_638)); \
56862 __ret_638 = __builtin_shufflevector(__ret_638, __ret_638, 3, 2, 1, 0); \
56863 __ret_638; \
58525#define vqdmull_high_lane_s16(__p0_730, __p1_730, __p2_730) __extension__ ({ \
58526 int16x8_t __s0_730 = __p0_730; \
58527 int16x4_t __s1_730 = __p1_730; \
58528 int16x8_t __rev0_730; __rev0_730 = __builtin_shufflevector(__s0_730, __s0_730, 7, 6, 5, 4, 3, 2, 1, 0); \
58529 int16x4_t __rev1_730; __rev1_730 = __builtin_shufflevector(__s1_730, __s1_730, 3, 2, 1, 0); \
58530 int32x4_t __ret_730; \
58531 __ret_730 = __noswap_vqdmull_s16(__noswap_vget_high_s16(__rev0_730), __noswap_splat_lane_s16(__rev1_730, __p2_730)); \
58532 __ret_730 = __builtin_shufflevector(__ret_730, __ret_730, 3, 2, 1, 0); \
58533 __ret_730; \
5686458534})
5686558535#endif
5686658536
5686758537#ifdef __LITTLE_ENDIAN__
56868#define vqdmull_high_laneq_s32(__p0_639, __p1_639, __p2_639) __extension__ ({ \
56869 int32x4_t __s0_639 = __p0_639; \
56870 int32x4_t __s1_639 = __p1_639; \
56871 int64x2_t __ret_639; \
56872 __ret_639 = vqdmull_s32(vget_high_s32(__s0_639), splat_laneq_s32(__s1_639, __p2_639)); \
56873 __ret_639; \
58538#define vqdmull_high_laneq_s32(__p0_731, __p1_731, __p2_731) __extension__ ({ \
58539 int32x4_t __s0_731 = __p0_731; \
58540 int32x4_t __s1_731 = __p1_731; \
58541 int64x2_t __ret_731; \
58542 __ret_731 = vqdmull_s32(vget_high_s32(__s0_731), splat_laneq_s32(__s1_731, __p2_731)); \
58543 __ret_731; \
5687458544})
5687558545#else
56876#define vqdmull_high_laneq_s32(__p0_640, __p1_640, __p2_640) __extension__ ({ \
56877 int32x4_t __s0_640 = __p0_640; \
56878 int32x4_t __s1_640 = __p1_640; \
56879 int32x4_t __rev0_640; __rev0_640 = __builtin_shufflevector(__s0_640, __s0_640, 3, 2, 1, 0); \
56880 int32x4_t __rev1_640; __rev1_640 = __builtin_shufflevector(__s1_640, __s1_640, 3, 2, 1, 0); \
56881 int64x2_t __ret_640; \
56882 __ret_640 = __noswap_vqdmull_s32(__noswap_vget_high_s32(__rev0_640), __noswap_splat_laneq_s32(__rev1_640, __p2_640)); \
56883 __ret_640 = __builtin_shufflevector(__ret_640, __ret_640, 1, 0); \
56884 __ret_640; \
58546#define vqdmull_high_laneq_s32(__p0_732, __p1_732, __p2_732) __extension__ ({ \
58547 int32x4_t __s0_732 = __p0_732; \
58548 int32x4_t __s1_732 = __p1_732; \
58549 int32x4_t __rev0_732; __rev0_732 = __builtin_shufflevector(__s0_732, __s0_732, 3, 2, 1, 0); \
58550 int32x4_t __rev1_732; __rev1_732 = __builtin_shufflevector(__s1_732, __s1_732, 3, 2, 1, 0); \
58551 int64x2_t __ret_732; \
58552 __ret_732 = __noswap_vqdmull_s32(__noswap_vget_high_s32(__rev0_732), __noswap_splat_laneq_s32(__rev1_732, __p2_732)); \
58553 __ret_732 = __builtin_shufflevector(__ret_732, __ret_732, 1, 0); \
58554 __ret_732; \
5688558555})
5688658556#endif
5688758557
5688858558#ifdef __LITTLE_ENDIAN__
56889#define vqdmull_high_laneq_s16(__p0_641, __p1_641, __p2_641) __extension__ ({ \
56890 int16x8_t __s0_641 = __p0_641; \
56891 int16x8_t __s1_641 = __p1_641; \
56892 int32x4_t __ret_641; \
56893 __ret_641 = vqdmull_s16(vget_high_s16(__s0_641), splat_laneq_s16(__s1_641, __p2_641)); \
56894 __ret_641; \
58559#define vqdmull_high_laneq_s16(__p0_733, __p1_733, __p2_733) __extension__ ({ \
58560 int16x8_t __s0_733 = __p0_733; \
58561 int16x8_t __s1_733 = __p1_733; \
58562 int32x4_t __ret_733; \
58563 __ret_733 = vqdmull_s16(vget_high_s16(__s0_733), splat_laneq_s16(__s1_733, __p2_733)); \
58564 __ret_733; \
5689558565})
5689658566#else
56897#define vqdmull_high_laneq_s16(__p0_642, __p1_642, __p2_642) __extension__ ({ \
56898 int16x8_t __s0_642 = __p0_642; \
56899 int16x8_t __s1_642 = __p1_642; \
56900 int16x8_t __rev0_642; __rev0_642 = __builtin_shufflevector(__s0_642, __s0_642, 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); \
56902 int32x4_t __ret_642; \
56903 __ret_642 = __noswap_vqdmull_s16(__noswap_vget_high_s16(__rev0_642), __noswap_splat_laneq_s16(__rev1_642, __p2_642)); \
56904 __ret_642 = __builtin_shufflevector(__ret_642, __ret_642, 3, 2, 1, 0); \
56905 __ret_642; \
58567#define vqdmull_high_laneq_s16(__p0_734, __p1_734, __p2_734) __extension__ ({ \
58568 int16x8_t __s0_734 = __p0_734; \
58569 int16x8_t __s1_734 = __p1_734; \
58570 int16x8_t __rev0_734; __rev0_734 = __builtin_shufflevector(__s0_734, __s0_734, 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); \
58572 int32x4_t __ret_734; \
58573 __ret_734 = __noswap_vqdmull_s16(__noswap_vget_high_s16(__rev0_734), __noswap_splat_laneq_s16(__rev1_734, __p2_734)); \
58574 __ret_734 = __builtin_shufflevector(__ret_734, __ret_734, 3, 2, 1, 0); \
58575 __ret_734; \
5690658576})
5690758577#endif
5690858578
......@@ -56939,120 +58609,120 @@ __ai int32x4_t vqdmull_high_n_s16(int16x8_t __p0, int16_t __p1) {
5693958609#endif
5694058610
5694158611#ifdef __LITTLE_ENDIAN__
56942#define vqdmulls_lane_s32(__p0_643, __p1_643, __p2_643) __extension__ ({ \
56943 int32_t __s0_643 = __p0_643; \
56944 int32x2_t __s1_643 = __p1_643; \
56945 int64_t __ret_643; \
56946 __ret_643 = vqdmulls_s32(__s0_643, vget_lane_s32(__s1_643, __p2_643)); \
56947 __ret_643; \
58612#define vqdmulls_lane_s32(__p0_735, __p1_735, __p2_735) __extension__ ({ \
58613 int32_t __s0_735 = __p0_735; \
58614 int32x2_t __s1_735 = __p1_735; \
58615 int64_t __ret_735; \
58616 __ret_735 = vqdmulls_s32(__s0_735, vget_lane_s32(__s1_735, __p2_735)); \
58617 __ret_735; \
5694858618})
5694958619#else
56950#define vqdmulls_lane_s32(__p0_644, __p1_644, __p2_644) __extension__ ({ \
56951 int32_t __s0_644 = __p0_644; \
56952 int32x2_t __s1_644 = __p1_644; \
56953 int32x2_t __rev1_644; __rev1_644 = __builtin_shufflevector(__s1_644, __s1_644, 1, 0); \
56954 int64_t __ret_644; \
56955 __ret_644 = vqdmulls_s32(__s0_644, __noswap_vget_lane_s32(__rev1_644, __p2_644)); \
56956 __ret_644; \
58620#define vqdmulls_lane_s32(__p0_736, __p1_736, __p2_736) __extension__ ({ \
58621 int32_t __s0_736 = __p0_736; \
58622 int32x2_t __s1_736 = __p1_736; \
58623 int32x2_t __rev1_736; __rev1_736 = __builtin_shufflevector(__s1_736, __s1_736, 1, 0); \
58624 int64_t __ret_736; \
58625 __ret_736 = vqdmulls_s32(__s0_736, __noswap_vget_lane_s32(__rev1_736, __p2_736)); \
58626 __ret_736; \
5695758627})
5695858628#endif
5695958629
5696058630#ifdef __LITTLE_ENDIAN__
56961#define vqdmullh_lane_s16(__p0_645, __p1_645, __p2_645) __extension__ ({ \
56962 int16_t __s0_645 = __p0_645; \
56963 int16x4_t __s1_645 = __p1_645; \
56964 int32_t __ret_645; \
56965 __ret_645 = vqdmullh_s16(__s0_645, vget_lane_s16(__s1_645, __p2_645)); \
56966 __ret_645; \
58631#define vqdmullh_lane_s16(__p0_737, __p1_737, __p2_737) __extension__ ({ \
58632 int16_t __s0_737 = __p0_737; \
58633 int16x4_t __s1_737 = __p1_737; \
58634 int32_t __ret_737; \
58635 __ret_737 = vqdmullh_s16(__s0_737, vget_lane_s16(__s1_737, __p2_737)); \
58636 __ret_737; \
5696758637})
5696858638#else
56969#define vqdmullh_lane_s16(__p0_646, __p1_646, __p2_646) __extension__ ({ \
56970 int16_t __s0_646 = __p0_646; \
56971 int16x4_t __s1_646 = __p1_646; \
56972 int16x4_t __rev1_646; __rev1_646 = __builtin_shufflevector(__s1_646, __s1_646, 3, 2, 1, 0); \
56973 int32_t __ret_646; \
56974 __ret_646 = vqdmullh_s16(__s0_646, __noswap_vget_lane_s16(__rev1_646, __p2_646)); \
56975 __ret_646; \
58639#define vqdmullh_lane_s16(__p0_738, __p1_738, __p2_738) __extension__ ({ \
58640 int16_t __s0_738 = __p0_738; \
58641 int16x4_t __s1_738 = __p1_738; \
58642 int16x4_t __rev1_738; __rev1_738 = __builtin_shufflevector(__s1_738, __s1_738, 3, 2, 1, 0); \
58643 int32_t __ret_738; \
58644 __ret_738 = vqdmullh_s16(__s0_738, __noswap_vget_lane_s16(__rev1_738, __p2_738)); \
58645 __ret_738; \
5697658646})
5697758647#endif
5697858648
5697958649#ifdef __LITTLE_ENDIAN__
56980#define vqdmulls_laneq_s32(__p0_647, __p1_647, __p2_647) __extension__ ({ \
56981 int32_t __s0_647 = __p0_647; \
56982 int32x4_t __s1_647 = __p1_647; \
56983 int64_t __ret_647; \
56984 __ret_647 = vqdmulls_s32(__s0_647, vgetq_lane_s32(__s1_647, __p2_647)); \
56985 __ret_647; \
58650#define vqdmulls_laneq_s32(__p0_739, __p1_739, __p2_739) __extension__ ({ \
58651 int32_t __s0_739 = __p0_739; \
58652 int32x4_t __s1_739 = __p1_739; \
58653 int64_t __ret_739; \
58654 __ret_739 = vqdmulls_s32(__s0_739, vgetq_lane_s32(__s1_739, __p2_739)); \
58655 __ret_739; \
5698658656})
5698758657#else
56988#define vqdmulls_laneq_s32(__p0_648, __p1_648, __p2_648) __extension__ ({ \
56989 int32_t __s0_648 = __p0_648; \
56990 int32x4_t __s1_648 = __p1_648; \
56991 int32x4_t __rev1_648; __rev1_648 = __builtin_shufflevector(__s1_648, __s1_648, 3, 2, 1, 0); \
56992 int64_t __ret_648; \
56993 __ret_648 = vqdmulls_s32(__s0_648, __noswap_vgetq_lane_s32(__rev1_648, __p2_648)); \
56994 __ret_648; \
58658#define vqdmulls_laneq_s32(__p0_740, __p1_740, __p2_740) __extension__ ({ \
58659 int32_t __s0_740 = __p0_740; \
58660 int32x4_t __s1_740 = __p1_740; \
58661 int32x4_t __rev1_740; __rev1_740 = __builtin_shufflevector(__s1_740, __s1_740, 3, 2, 1, 0); \
58662 int64_t __ret_740; \
58663 __ret_740 = vqdmulls_s32(__s0_740, __noswap_vgetq_lane_s32(__rev1_740, __p2_740)); \
58664 __ret_740; \
5699558665})
5699658666#endif
5699758667
5699858668#ifdef __LITTLE_ENDIAN__
56999#define vqdmullh_laneq_s16(__p0_649, __p1_649, __p2_649) __extension__ ({ \
57000 int16_t __s0_649 = __p0_649; \
57001 int16x8_t __s1_649 = __p1_649; \
57002 int32_t __ret_649; \
57003 __ret_649 = vqdmullh_s16(__s0_649, vgetq_lane_s16(__s1_649, __p2_649)); \
57004 __ret_649; \
58669#define vqdmullh_laneq_s16(__p0_741, __p1_741, __p2_741) __extension__ ({ \
58670 int16_t __s0_741 = __p0_741; \
58671 int16x8_t __s1_741 = __p1_741; \
58672 int32_t __ret_741; \
58673 __ret_741 = vqdmullh_s16(__s0_741, vgetq_lane_s16(__s1_741, __p2_741)); \
58674 __ret_741; \
5700558675})
5700658676#else
57007#define vqdmullh_laneq_s16(__p0_650, __p1_650, __p2_650) __extension__ ({ \
57008 int16_t __s0_650 = __p0_650; \
57009 int16x8_t __s1_650 = __p1_650; \
57010 int16x8_t __rev1_650; __rev1_650 = __builtin_shufflevector(__s1_650, __s1_650, 7, 6, 5, 4, 3, 2, 1, 0); \
57011 int32_t __ret_650; \
57012 __ret_650 = vqdmullh_s16(__s0_650, __noswap_vgetq_lane_s16(__rev1_650, __p2_650)); \
57013 __ret_650; \
58677#define vqdmullh_laneq_s16(__p0_742, __p1_742, __p2_742) __extension__ ({ \
58678 int16_t __s0_742 = __p0_742; \
58679 int16x8_t __s1_742 = __p1_742; \
58680 int16x8_t __rev1_742; __rev1_742 = __builtin_shufflevector(__s1_742, __s1_742, 7, 6, 5, 4, 3, 2, 1, 0); \
58681 int32_t __ret_742; \
58682 __ret_742 = vqdmullh_s16(__s0_742, __noswap_vgetq_lane_s16(__rev1_742, __p2_742)); \
58683 __ret_742; \
5701458684})
5701558685#endif
5701658686
5701758687#ifdef __LITTLE_ENDIAN__
57018#define vqdmull_laneq_s32(__p0_651, __p1_651, __p2_651) __extension__ ({ \
57019 int32x2_t __s0_651 = __p0_651; \
57020 int32x4_t __s1_651 = __p1_651; \
57021 int64x2_t __ret_651; \
57022 __ret_651 = vqdmull_s32(__s0_651, splat_laneq_s32(__s1_651, __p2_651)); \
57023 __ret_651; \
58688#define vqdmull_laneq_s32(__p0_743, __p1_743, __p2_743) __extension__ ({ \
58689 int32x2_t __s0_743 = __p0_743; \
58690 int32x4_t __s1_743 = __p1_743; \
58691 int64x2_t __ret_743; \
58692 __ret_743 = vqdmull_s32(__s0_743, splat_laneq_s32(__s1_743, __p2_743)); \
58693 __ret_743; \
5702458694})
5702558695#else
57026#define vqdmull_laneq_s32(__p0_652, __p1_652, __p2_652) __extension__ ({ \
57027 int32x2_t __s0_652 = __p0_652; \
57028 int32x4_t __s1_652 = __p1_652; \
57029 int32x2_t __rev0_652; __rev0_652 = __builtin_shufflevector(__s0_652, __s0_652, 1, 0); \
57030 int32x4_t __rev1_652; __rev1_652 = __builtin_shufflevector(__s1_652, __s1_652, 3, 2, 1, 0); \
57031 int64x2_t __ret_652; \
57032 __ret_652 = __noswap_vqdmull_s32(__rev0_652, __noswap_splat_laneq_s32(__rev1_652, __p2_652)); \
57033 __ret_652 = __builtin_shufflevector(__ret_652, __ret_652, 1, 0); \
57034 __ret_652; \
58696#define vqdmull_laneq_s32(__p0_744, __p1_744, __p2_744) __extension__ ({ \
58697 int32x2_t __s0_744 = __p0_744; \
58698 int32x4_t __s1_744 = __p1_744; \
58699 int32x2_t __rev0_744; __rev0_744 = __builtin_shufflevector(__s0_744, __s0_744, 1, 0); \
58700 int32x4_t __rev1_744; __rev1_744 = __builtin_shufflevector(__s1_744, __s1_744, 3, 2, 1, 0); \
58701 int64x2_t __ret_744; \
58702 __ret_744 = __noswap_vqdmull_s32(__rev0_744, __noswap_splat_laneq_s32(__rev1_744, __p2_744)); \
58703 __ret_744 = __builtin_shufflevector(__ret_744, __ret_744, 1, 0); \
58704 __ret_744; \
5703558705})
5703658706#endif
5703758707
5703858708#ifdef __LITTLE_ENDIAN__
57039#define vqdmull_laneq_s16(__p0_653, __p1_653, __p2_653) __extension__ ({ \
57040 int16x4_t __s0_653 = __p0_653; \
57041 int16x8_t __s1_653 = __p1_653; \
57042 int32x4_t __ret_653; \
57043 __ret_653 = vqdmull_s16(__s0_653, splat_laneq_s16(__s1_653, __p2_653)); \
57044 __ret_653; \
58709#define vqdmull_laneq_s16(__p0_745, __p1_745, __p2_745) __extension__ ({ \
58710 int16x4_t __s0_745 = __p0_745; \
58711 int16x8_t __s1_745 = __p1_745; \
58712 int32x4_t __ret_745; \
58713 __ret_745 = vqdmull_s16(__s0_745, splat_laneq_s16(__s1_745, __p2_745)); \
58714 __ret_745; \
5704558715})
5704658716#else
57047#define vqdmull_laneq_s16(__p0_654, __p1_654, __p2_654) __extension__ ({ \
57048 int16x4_t __s0_654 = __p0_654; \
57049 int16x8_t __s1_654 = __p1_654; \
57050 int16x4_t __rev0_654; __rev0_654 = __builtin_shufflevector(__s0_654, __s0_654, 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); \
57052 int32x4_t __ret_654; \
57053 __ret_654 = __noswap_vqdmull_s16(__rev0_654, __noswap_splat_laneq_s16(__rev1_654, __p2_654)); \
57054 __ret_654 = __builtin_shufflevector(__ret_654, __ret_654, 3, 2, 1, 0); \
57055 __ret_654; \
58717#define vqdmull_laneq_s16(__p0_746, __p1_746, __p2_746) __extension__ ({ \
58718 int16x4_t __s0_746 = __p0_746; \
58719 int16x8_t __s1_746 = __p1_746; \
58720 int16x4_t __rev0_746; __rev0_746 = __builtin_shufflevector(__s0_746, __s0_746, 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); \
58722 int32x4_t __ret_746; \
58723 __ret_746 = __noswap_vqdmull_s16(__rev0_746, __noswap_splat_laneq_s16(__rev1_746, __p2_746)); \
58724 __ret_746 = __builtin_shufflevector(__ret_746, __ret_746, 3, 2, 1, 0); \
58725 __ret_746; \
5705658726})
5705758727#endif
5705858728
......@@ -57188,30 +58858,30 @@ __ai int8x16_t vqmovn_high_s16(int8x8_t __p0, int16x8_t __p1) {
5718858858}
5718958859#endif
5719058860
57191__ai int16_t vqmovuns_s32(int32_t __p0) {
57192 int16_t __ret;
57193 __ret = (int16_t) __builtin_neon_vqmovuns_s32(__p0);
58861__ai uint16_t vqmovuns_s32(int32_t __p0) {
58862 uint16_t __ret;
58863 __ret = (uint16_t) __builtin_neon_vqmovuns_s32(__p0);
5719458864 return __ret;
5719558865}
57196__ai int32_t vqmovund_s64(int64_t __p0) {
57197 int32_t __ret;
57198 __ret = (int32_t) __builtin_neon_vqmovund_s64(__p0);
58866__ai uint32_t vqmovund_s64(int64_t __p0) {
58867 uint32_t __ret;
58868 __ret = (uint32_t) __builtin_neon_vqmovund_s64(__p0);
5719958869 return __ret;
5720058870}
57201__ai int8_t vqmovunh_s16(int16_t __p0) {
57202 int8_t __ret;
57203 __ret = (int8_t) __builtin_neon_vqmovunh_s16(__p0);
58871__ai uint8_t vqmovunh_s16(int16_t __p0) {
58872 uint8_t __ret;
58873 __ret = (uint8_t) __builtin_neon_vqmovunh_s16(__p0);
5720458874 return __ret;
5720558875}
5720658876#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) {
5720858878 uint16x8_t __ret;
5720958879 __ret = vcombine_u16((uint16x4_t)(__p0), vqmovun_s32(__p1));
5721058880 return __ret;
5721158881}
5721258882#else
57213__ai uint16x8_t vqmovun_high_s32(int16x4_t __p0, int32x4_t __p1) {
57214 int16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
58883__ai uint16x8_t vqmovun_high_s32(uint16x4_t __p0, int32x4_t __p1) {
58884 uint16x4_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 3, 2, 1, 0);
5721558885 int32x4_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 3, 2, 1, 0);
5721658886 uint16x8_t __ret;
5721758887 __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) {
5722158891#endif
5722258892
5722358893#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) {
5722558895 uint32x4_t __ret;
5722658896 __ret = vcombine_u32((uint32x2_t)(__p0), vqmovun_s64(__p1));
5722758897 return __ret;
5722858898}
5722958899#else
57230__ai uint32x4_t vqmovun_high_s64(int32x2_t __p0, int64x2_t __p1) {
57231 int32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
58900__ai uint32x4_t vqmovun_high_s64(uint32x2_t __p0, int64x2_t __p1) {
58901 uint32x2_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 1, 0);
5723258902 int64x2_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 1, 0);
5723358903 uint32x4_t __ret;
5723458904 __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) {
5723858908#endif
5723958909
5724058910#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) {
5724258912 uint8x16_t __ret;
5724358913 __ret = vcombine_u8((uint8x8_t)(__p0), vqmovun_s16(__p1));
5724458914 return __ret;
5724558915}
5724658916#else
57247__ai uint8x16_t vqmovun_high_s16(int8x8_t __p0, int16x8_t __p1) {
57248 int8x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);
58917__ai uint8x16_t vqmovun_high_s16(uint8x8_t __p0, int16x8_t __p1) {
58918 uint8x8_t __rev0; __rev0 = __builtin_shufflevector(__p0, __p0, 7, 6, 5, 4, 3, 2, 1, 0);
5724958919 int16x8_t __rev1; __rev1 = __builtin_shufflevector(__p1, __p1, 7, 6, 5, 4, 3, 2, 1, 0);
5725058920 uint8x16_t __ret;
5725158921 __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) {
5739059060#endif
5739159061
5739259062#ifdef __LITTLE_ENDIAN__
57393#define vqrdmulhs_lane_s32(__p0_655, __p1_655, __p2_655) __extension__ ({ \
57394 int32_t __s0_655 = __p0_655; \
57395 int32x2_t __s1_655 = __p1_655; \
57396 int32_t __ret_655; \
57397 __ret_655 = vqrdmulhs_s32(__s0_655, vget_lane_s32(__s1_655, __p2_655)); \
57398 __ret_655; \
59063#define vqrdmulhs_lane_s32(__p0_747, __p1_747, __p2_747) __extension__ ({ \
59064 int32_t __s0_747 = __p0_747; \
59065 int32x2_t __s1_747 = __p1_747; \
59066 int32_t __ret_747; \
59067 __ret_747 = vqrdmulhs_s32(__s0_747, vget_lane_s32(__s1_747, __p2_747)); \
59068 __ret_747; \
5739959069})
5740059070#else
57401#define vqrdmulhs_lane_s32(__p0_656, __p1_656, __p2_656) __extension__ ({ \
57402 int32_t __s0_656 = __p0_656; \
57403 int32x2_t __s1_656 = __p1_656; \
57404 int32x2_t __rev1_656; __rev1_656 = __builtin_shufflevector(__s1_656, __s1_656, 1, 0); \
57405 int32_t __ret_656; \
57406 __ret_656 = vqrdmulhs_s32(__s0_656, __noswap_vget_lane_s32(__rev1_656, __p2_656)); \
57407 __ret_656; \
59071#define vqrdmulhs_lane_s32(__p0_748, __p1_748, __p2_748) __extension__ ({ \
59072 int32_t __s0_748 = __p0_748; \
59073 int32x2_t __s1_748 = __p1_748; \
59074 int32x2_t __rev1_748; __rev1_748 = __builtin_shufflevector(__s1_748, __s1_748, 1, 0); \
59075 int32_t __ret_748; \
59076 __ret_748 = vqrdmulhs_s32(__s0_748, __noswap_vget_lane_s32(__rev1_748, __p2_748)); \
59077 __ret_748; \
5740859078})
5740959079#endif
5741059080
5741159081#ifdef __LITTLE_ENDIAN__
57412#define vqrdmulhh_lane_s16(__p0_657, __p1_657, __p2_657) __extension__ ({ \
57413 int16_t __s0_657 = __p0_657; \
57414 int16x4_t __s1_657 = __p1_657; \
57415 int16_t __ret_657; \
57416 __ret_657 = vqrdmulhh_s16(__s0_657, vget_lane_s16(__s1_657, __p2_657)); \
57417 __ret_657; \
59082#define vqrdmulhh_lane_s16(__p0_749, __p1_749, __p2_749) __extension__ ({ \
59083 int16_t __s0_749 = __p0_749; \
59084 int16x4_t __s1_749 = __p1_749; \
59085 int16_t __ret_749; \
59086 __ret_749 = vqrdmulhh_s16(__s0_749, vget_lane_s16(__s1_749, __p2_749)); \
59087 __ret_749; \
5741859088})
5741959089#else
57420#define vqrdmulhh_lane_s16(__p0_658, __p1_658, __p2_658) __extension__ ({ \
57421 int16_t __s0_658 = __p0_658; \
57422 int16x4_t __s1_658 = __p1_658; \
57423 int16x4_t __rev1_658; __rev1_658 = __builtin_shufflevector(__s1_658, __s1_658, 3, 2, 1, 0); \
57424 int16_t __ret_658; \
57425 __ret_658 = vqrdmulhh_s16(__s0_658, __noswap_vget_lane_s16(__rev1_658, __p2_658)); \
57426 __ret_658; \
59090#define vqrdmulhh_lane_s16(__p0_750, __p1_750, __p2_750) __extension__ ({ \
59091 int16_t __s0_750 = __p0_750; \
59092 int16x4_t __s1_750 = __p1_750; \
59093 int16x4_t __rev1_750; __rev1_750 = __builtin_shufflevector(__s1_750, __s1_750, 3, 2, 1, 0); \
59094 int16_t __ret_750; \
59095 __ret_750 = vqrdmulhh_s16(__s0_750, __noswap_vget_lane_s16(__rev1_750, __p2_750)); \
59096 __ret_750; \
5742759097})
5742859098#endif
5742959099
5743059100#ifdef __LITTLE_ENDIAN__
57431#define vqrdmulhs_laneq_s32(__p0_659, __p1_659, __p2_659) __extension__ ({ \
57432 int32_t __s0_659 = __p0_659; \
57433 int32x4_t __s1_659 = __p1_659; \
57434 int32_t __ret_659; \
57435 __ret_659 = vqrdmulhs_s32(__s0_659, vgetq_lane_s32(__s1_659, __p2_659)); \
57436 __ret_659; \
59101#define vqrdmulhs_laneq_s32(__p0_751, __p1_751, __p2_751) __extension__ ({ \
59102 int32_t __s0_751 = __p0_751; \
59103 int32x4_t __s1_751 = __p1_751; \
59104 int32_t __ret_751; \
59105 __ret_751 = vqrdmulhs_s32(__s0_751, vgetq_lane_s32(__s1_751, __p2_751)); \
59106 __ret_751; \
5743759107})
5743859108#else
57439#define vqrdmulhs_laneq_s32(__p0_660, __p1_660, __p2_660) __extension__ ({ \
57440 int32_t __s0_660 = __p0_660; \
57441 int32x4_t __s1_660 = __p1_660; \
57442 int32x4_t __rev1_660; __rev1_660 = __builtin_shufflevector(__s1_660, __s1_660, 3, 2, 1, 0); \
57443 int32_t __ret_660; \
57444 __ret_660 = vqrdmulhs_s32(__s0_660, __noswap_vgetq_lane_s32(__rev1_660, __p2_660)); \
57445 __ret_660; \
59109#define vqrdmulhs_laneq_s32(__p0_752, __p1_752, __p2_752) __extension__ ({ \
59110 int32_t __s0_752 = __p0_752; \
59111 int32x4_t __s1_752 = __p1_752; \
59112 int32x4_t __rev1_752; __rev1_752 = __builtin_shufflevector(__s1_752, __s1_752, 3, 2, 1, 0); \
59113 int32_t __ret_752; \
59114 __ret_752 = vqrdmulhs_s32(__s0_752, __noswap_vgetq_lane_s32(__rev1_752, __p2_752)); \
59115 __ret_752; \
5744659116})
5744759117#endif
5744859118
5744959119#ifdef __LITTLE_ENDIAN__
57450#define vqrdmulhh_laneq_s16(__p0_661, __p1_661, __p2_661) __extension__ ({ \
57451 int16_t __s0_661 = __p0_661; \
57452 int16x8_t __s1_661 = __p1_661; \
57453 int16_t __ret_661; \
57454 __ret_661 = vqrdmulhh_s16(__s0_661, vgetq_lane_s16(__s1_661, __p2_661)); \
57455 __ret_661; \
59120#define vqrdmulhh_laneq_s16(__p0_753, __p1_753, __p2_753) __extension__ ({ \
59121 int16_t __s0_753 = __p0_753; \
59122 int16x8_t __s1_753 = __p1_753; \
59123 int16_t __ret_753; \
59124 __ret_753 = vqrdmulhh_s16(__s0_753, vgetq_lane_s16(__s1_753, __p2_753)); \
59125 __ret_753; \
5745659126})
5745759127#else
57458#define vqrdmulhh_laneq_s16(__p0_662, __p1_662, __p2_662) __extension__ ({ \
57459 int16_t __s0_662 = __p0_662; \
57460 int16x8_t __s1_662 = __p1_662; \
57461 int16x8_t __rev1_662; __rev1_662 = __builtin_shufflevector(__s1_662, __s1_662, 7, 6, 5, 4, 3, 2, 1, 0); \
57462 int16_t __ret_662; \
57463 __ret_662 = vqrdmulhh_s16(__s0_662, __noswap_vgetq_lane_s16(__rev1_662, __p2_662)); \
57464 __ret_662; \
59128#define vqrdmulhh_laneq_s16(__p0_754, __p1_754, __p2_754) __extension__ ({ \
59129 int16_t __s0_754 = __p0_754; \
59130 int16x8_t __s1_754 = __p1_754; \
59131 int16x8_t __rev1_754; __rev1_754 = __builtin_shufflevector(__s1_754, __s1_754, 7, 6, 5, 4, 3, 2, 1, 0); \
59132 int16_t __ret_754; \
59133 __ret_754 = vqrdmulhh_s16(__s0_754, __noswap_vgetq_lane_s16(__rev1_754, __p2_754)); \
59134 __ret_754; \
5746559135})
5746659136#endif
5746759137
......@@ -57549,22 +59219,22 @@ __ai int16_t vqrdmulhh_s16(int16_t __p0, int16_t __p1) {
5754959219})
5755059220#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) {
5755359223 uint8_t __ret;
5755459224 __ret = (uint8_t) __builtin_neon_vqrshlb_u8(__p0, __p1);
5755559225 return __ret;
5755659226}
57557__ai uint32_t vqrshls_u32(uint32_t __p0, uint32_t __p1) {
59227__ai uint32_t vqrshls_u32(uint32_t __p0, int32_t __p1) {
5755859228 uint32_t __ret;
5755959229 __ret = (uint32_t) __builtin_neon_vqrshls_u32(__p0, __p1);
5756059230 return __ret;
5756159231}
57562__ai uint64_t vqrshld_u64(uint64_t __p0, uint64_t __p1) {
59232__ai uint64_t vqrshld_u64(uint64_t __p0, int64_t __p1) {
5756359233 uint64_t __ret;
5756459234 __ret = (uint64_t) __builtin_neon_vqrshld_u64(__p0, __p1);
5756559235 return __ret;
5756659236}
57567__ai uint16_t vqrshlh_u16(uint16_t __p0, uint16_t __p1) {
59237__ai uint16_t vqrshlh_u16(uint16_t __p0, int16_t __p1) {
5756859238 uint16_t __ret;
5756959239 __ret = (uint16_t) __builtin_neon_vqrshlh_u16(__p0, __p1);
5757059240 return __ret;
......@@ -57590,128 +59260,128 @@ __ai int16_t vqrshlh_s16(int16_t __p0, int16_t __p1) {
5759059260 return __ret;
5759159261}
5759259262#ifdef __LITTLE_ENDIAN__
57593#define vqrshrn_high_n_u32(__p0_663, __p1_663, __p2_663) __extension__ ({ \
57594 uint16x4_t __s0_663 = __p0_663; \
57595 uint32x4_t __s1_663 = __p1_663; \
57596 uint16x8_t __ret_663; \
57597 __ret_663 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_663), (uint16x4_t)(vqrshrn_n_u32(__s1_663, __p2_663)))); \
57598 __ret_663; \
59263#define vqrshrn_high_n_u32(__p0_755, __p1_755, __p2_755) __extension__ ({ \
59264 uint16x4_t __s0_755 = __p0_755; \
59265 uint32x4_t __s1_755 = __p1_755; \
59266 uint16x8_t __ret_755; \
59267 __ret_755 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_755), (uint16x4_t)(vqrshrn_n_u32(__s1_755, __p2_755)))); \
59268 __ret_755; \
5759959269})
5760059270#else
57601#define vqrshrn_high_n_u32(__p0_664, __p1_664, __p2_664) __extension__ ({ \
57602 uint16x4_t __s0_664 = __p0_664; \
57603 uint32x4_t __s1_664 = __p1_664; \
57604 uint16x4_t __rev0_664; __rev0_664 = __builtin_shufflevector(__s0_664, __s0_664, 3, 2, 1, 0); \
57605 uint32x4_t __rev1_664; __rev1_664 = __builtin_shufflevector(__s1_664, __s1_664, 3, 2, 1, 0); \
57606 uint16x8_t __ret_664; \
57607 __ret_664 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_664), (uint16x4_t)(__noswap_vqrshrn_n_u32(__rev1_664, __p2_664)))); \
57608 __ret_664 = __builtin_shufflevector(__ret_664, __ret_664, 7, 6, 5, 4, 3, 2, 1, 0); \
57609 __ret_664; \
59271#define vqrshrn_high_n_u32(__p0_756, __p1_756, __p2_756) __extension__ ({ \
59272 uint16x4_t __s0_756 = __p0_756; \
59273 uint32x4_t __s1_756 = __p1_756; \
59274 uint16x4_t __rev0_756; __rev0_756 = __builtin_shufflevector(__s0_756, __s0_756, 3, 2, 1, 0); \
59275 uint32x4_t __rev1_756; __rev1_756 = __builtin_shufflevector(__s1_756, __s1_756, 3, 2, 1, 0); \
59276 uint16x8_t __ret_756; \
59277 __ret_756 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_756), (uint16x4_t)(__noswap_vqrshrn_n_u32(__rev1_756, __p2_756)))); \
59278 __ret_756 = __builtin_shufflevector(__ret_756, __ret_756, 7, 6, 5, 4, 3, 2, 1, 0); \
59279 __ret_756; \
5761059280})
5761159281#endif
5761259282
5761359283#ifdef __LITTLE_ENDIAN__
57614#define vqrshrn_high_n_u64(__p0_665, __p1_665, __p2_665) __extension__ ({ \
57615 uint32x2_t __s0_665 = __p0_665; \
57616 uint64x2_t __s1_665 = __p1_665; \
57617 uint32x4_t __ret_665; \
57618 __ret_665 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_665), (uint32x2_t)(vqrshrn_n_u64(__s1_665, __p2_665)))); \
57619 __ret_665; \
59284#define vqrshrn_high_n_u64(__p0_757, __p1_757, __p2_757) __extension__ ({ \
59285 uint32x2_t __s0_757 = __p0_757; \
59286 uint64x2_t __s1_757 = __p1_757; \
59287 uint32x4_t __ret_757; \
59288 __ret_757 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_757), (uint32x2_t)(vqrshrn_n_u64(__s1_757, __p2_757)))); \
59289 __ret_757; \
5762059290})
5762159291#else
57622#define vqrshrn_high_n_u64(__p0_666, __p1_666, __p2_666) __extension__ ({ \
57623 uint32x2_t __s0_666 = __p0_666; \
57624 uint64x2_t __s1_666 = __p1_666; \
57625 uint32x2_t __rev0_666; __rev0_666 = __builtin_shufflevector(__s0_666, __s0_666, 1, 0); \
57626 uint64x2_t __rev1_666; __rev1_666 = __builtin_shufflevector(__s1_666, __s1_666, 1, 0); \
57627 uint32x4_t __ret_666; \
57628 __ret_666 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_666), (uint32x2_t)(__noswap_vqrshrn_n_u64(__rev1_666, __p2_666)))); \
57629 __ret_666 = __builtin_shufflevector(__ret_666, __ret_666, 3, 2, 1, 0); \
57630 __ret_666; \
59292#define vqrshrn_high_n_u64(__p0_758, __p1_758, __p2_758) __extension__ ({ \
59293 uint32x2_t __s0_758 = __p0_758; \
59294 uint64x2_t __s1_758 = __p1_758; \
59295 uint32x2_t __rev0_758; __rev0_758 = __builtin_shufflevector(__s0_758, __s0_758, 1, 0); \
59296 uint64x2_t __rev1_758; __rev1_758 = __builtin_shufflevector(__s1_758, __s1_758, 1, 0); \
59297 uint32x4_t __ret_758; \
59298 __ret_758 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_758), (uint32x2_t)(__noswap_vqrshrn_n_u64(__rev1_758, __p2_758)))); \
59299 __ret_758 = __builtin_shufflevector(__ret_758, __ret_758, 3, 2, 1, 0); \
59300 __ret_758; \
5763159301})
5763259302#endif
5763359303
5763459304#ifdef __LITTLE_ENDIAN__
57635#define vqrshrn_high_n_u16(__p0_667, __p1_667, __p2_667) __extension__ ({ \
57636 uint8x8_t __s0_667 = __p0_667; \
57637 uint16x8_t __s1_667 = __p1_667; \
57638 uint8x16_t __ret_667; \
57639 __ret_667 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_667), (uint8x8_t)(vqrshrn_n_u16(__s1_667, __p2_667)))); \
57640 __ret_667; \
59305#define vqrshrn_high_n_u16(__p0_759, __p1_759, __p2_759) __extension__ ({ \
59306 uint8x8_t __s0_759 = __p0_759; \
59307 uint16x8_t __s1_759 = __p1_759; \
59308 uint8x16_t __ret_759; \
59309 __ret_759 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_759), (uint8x8_t)(vqrshrn_n_u16(__s1_759, __p2_759)))); \
59310 __ret_759; \
5764159311})
5764259312#else
57643#define vqrshrn_high_n_u16(__p0_668, __p1_668, __p2_668) __extension__ ({ \
57644 uint8x8_t __s0_668 = __p0_668; \
57645 uint16x8_t __s1_668 = __p1_668; \
57646 uint8x8_t __rev0_668; __rev0_668 = __builtin_shufflevector(__s0_668, __s0_668, 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); \
57648 uint8x16_t __ret_668; \
57649 __ret_668 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_668), (uint8x8_t)(__noswap_vqrshrn_n_u16(__rev1_668, __p2_668)))); \
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); \
57651 __ret_668; \
59313#define vqrshrn_high_n_u16(__p0_760, __p1_760, __p2_760) __extension__ ({ \
59314 uint8x8_t __s0_760 = __p0_760; \
59315 uint16x8_t __s1_760 = __p1_760; \
59316 uint8x8_t __rev0_760; __rev0_760 = __builtin_shufflevector(__s0_760, __s0_760, 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); \
59318 uint8x16_t __ret_760; \
59319 __ret_760 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_760), (uint8x8_t)(__noswap_vqrshrn_n_u16(__rev1_760, __p2_760)))); \
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); \
59321 __ret_760; \
5765259322})
5765359323#endif
5765459324
5765559325#ifdef __LITTLE_ENDIAN__
57656#define vqrshrn_high_n_s32(__p0_669, __p1_669, __p2_669) __extension__ ({ \
57657 int16x4_t __s0_669 = __p0_669; \
57658 int32x4_t __s1_669 = __p1_669; \
57659 int16x8_t __ret_669; \
57660 __ret_669 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_669), (int16x4_t)(vqrshrn_n_s32(__s1_669, __p2_669)))); \
57661 __ret_669; \
59326#define vqrshrn_high_n_s32(__p0_761, __p1_761, __p2_761) __extension__ ({ \
59327 int16x4_t __s0_761 = __p0_761; \
59328 int32x4_t __s1_761 = __p1_761; \
59329 int16x8_t __ret_761; \
59330 __ret_761 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_761), (int16x4_t)(vqrshrn_n_s32(__s1_761, __p2_761)))); \
59331 __ret_761; \
5766259332})
5766359333#else
57664#define vqrshrn_high_n_s32(__p0_670, __p1_670, __p2_670) __extension__ ({ \
57665 int16x4_t __s0_670 = __p0_670; \
57666 int32x4_t __s1_670 = __p1_670; \
57667 int16x4_t __rev0_670; __rev0_670 = __builtin_shufflevector(__s0_670, __s0_670, 3, 2, 1, 0); \
57668 int32x4_t __rev1_670; __rev1_670 = __builtin_shufflevector(__s1_670, __s1_670, 3, 2, 1, 0); \
57669 int16x8_t __ret_670; \
57670 __ret_670 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_670), (int16x4_t)(__noswap_vqrshrn_n_s32(__rev1_670, __p2_670)))); \
57671 __ret_670 = __builtin_shufflevector(__ret_670, __ret_670, 7, 6, 5, 4, 3, 2, 1, 0); \
57672 __ret_670; \
59334#define vqrshrn_high_n_s32(__p0_762, __p1_762, __p2_762) __extension__ ({ \
59335 int16x4_t __s0_762 = __p0_762; \
59336 int32x4_t __s1_762 = __p1_762; \
59337 int16x4_t __rev0_762; __rev0_762 = __builtin_shufflevector(__s0_762, __s0_762, 3, 2, 1, 0); \
59338 int32x4_t __rev1_762; __rev1_762 = __builtin_shufflevector(__s1_762, __s1_762, 3, 2, 1, 0); \
59339 int16x8_t __ret_762; \
59340 __ret_762 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_762), (int16x4_t)(__noswap_vqrshrn_n_s32(__rev1_762, __p2_762)))); \
59341 __ret_762 = __builtin_shufflevector(__ret_762, __ret_762, 7, 6, 5, 4, 3, 2, 1, 0); \
59342 __ret_762; \
5767359343})
5767459344#endif
5767559345
5767659346#ifdef __LITTLE_ENDIAN__
57677#define vqrshrn_high_n_s64(__p0_671, __p1_671, __p2_671) __extension__ ({ \
57678 int32x2_t __s0_671 = __p0_671; \
57679 int64x2_t __s1_671 = __p1_671; \
57680 int32x4_t __ret_671; \
57681 __ret_671 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_671), (int32x2_t)(vqrshrn_n_s64(__s1_671, __p2_671)))); \
57682 __ret_671; \
59347#define vqrshrn_high_n_s64(__p0_763, __p1_763, __p2_763) __extension__ ({ \
59348 int32x2_t __s0_763 = __p0_763; \
59349 int64x2_t __s1_763 = __p1_763; \
59350 int32x4_t __ret_763; \
59351 __ret_763 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_763), (int32x2_t)(vqrshrn_n_s64(__s1_763, __p2_763)))); \
59352 __ret_763; \
5768359353})
5768459354#else
57685#define vqrshrn_high_n_s64(__p0_672, __p1_672, __p2_672) __extension__ ({ \
57686 int32x2_t __s0_672 = __p0_672; \
57687 int64x2_t __s1_672 = __p1_672; \
57688 int32x2_t __rev0_672; __rev0_672 = __builtin_shufflevector(__s0_672, __s0_672, 1, 0); \
57689 int64x2_t __rev1_672; __rev1_672 = __builtin_shufflevector(__s1_672, __s1_672, 1, 0); \
57690 int32x4_t __ret_672; \
57691 __ret_672 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_672), (int32x2_t)(__noswap_vqrshrn_n_s64(__rev1_672, __p2_672)))); \
57692 __ret_672 = __builtin_shufflevector(__ret_672, __ret_672, 3, 2, 1, 0); \
57693 __ret_672; \
59355#define vqrshrn_high_n_s64(__p0_764, __p1_764, __p2_764) __extension__ ({ \
59356 int32x2_t __s0_764 = __p0_764; \
59357 int64x2_t __s1_764 = __p1_764; \
59358 int32x2_t __rev0_764; __rev0_764 = __builtin_shufflevector(__s0_764, __s0_764, 1, 0); \
59359 int64x2_t __rev1_764; __rev1_764 = __builtin_shufflevector(__s1_764, __s1_764, 1, 0); \
59360 int32x4_t __ret_764; \
59361 __ret_764 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_764), (int32x2_t)(__noswap_vqrshrn_n_s64(__rev1_764, __p2_764)))); \
59362 __ret_764 = __builtin_shufflevector(__ret_764, __ret_764, 3, 2, 1, 0); \
59363 __ret_764; \
5769459364})
5769559365#endif
5769659366
5769759367#ifdef __LITTLE_ENDIAN__
57698#define vqrshrn_high_n_s16(__p0_673, __p1_673, __p2_673) __extension__ ({ \
57699 int8x8_t __s0_673 = __p0_673; \
57700 int16x8_t __s1_673 = __p1_673; \
57701 int8x16_t __ret_673; \
57702 __ret_673 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_673), (int8x8_t)(vqrshrn_n_s16(__s1_673, __p2_673)))); \
57703 __ret_673; \
59368#define vqrshrn_high_n_s16(__p0_765, __p1_765, __p2_765) __extension__ ({ \
59369 int8x8_t __s0_765 = __p0_765; \
59370 int16x8_t __s1_765 = __p1_765; \
59371 int8x16_t __ret_765; \
59372 __ret_765 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_765), (int8x8_t)(vqrshrn_n_s16(__s1_765, __p2_765)))); \
59373 __ret_765; \
5770459374})
5770559375#else
57706#define vqrshrn_high_n_s16(__p0_674, __p1_674, __p2_674) __extension__ ({ \
57707 int8x8_t __s0_674 = __p0_674; \
57708 int16x8_t __s1_674 = __p1_674; \
57709 int8x8_t __rev0_674; __rev0_674 = __builtin_shufflevector(__s0_674, __s0_674, 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); \
57711 int8x16_t __ret_674; \
57712 __ret_674 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_674), (int8x8_t)(__noswap_vqrshrn_n_s16(__rev1_674, __p2_674)))); \
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); \
57714 __ret_674; \
59376#define vqrshrn_high_n_s16(__p0_766, __p1_766, __p2_766) __extension__ ({ \
59377 int8x8_t __s0_766 = __p0_766; \
59378 int16x8_t __s1_766 = __p1_766; \
59379 int8x8_t __rev0_766; __rev0_766 = __builtin_shufflevector(__s0_766, __s0_766, 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); \
59381 int8x16_t __ret_766; \
59382 __ret_766 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_766), (int8x8_t)(__noswap_vqrshrn_n_s16(__rev1_766, __p2_766)))); \
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); \
59384 __ret_766; \
5771559385})
5771659386#endif
5771759387
......@@ -57752,65 +59422,65 @@ __ai int16_t vqrshlh_s16(int16_t __p0, int16_t __p1) {
5775259422 __ret; \
5775359423})
5775459424#ifdef __LITTLE_ENDIAN__
57755#define vqrshrun_high_n_s32(__p0_675, __p1_675, __p2_675) __extension__ ({ \
57756 int16x4_t __s0_675 = __p0_675; \
57757 int32x4_t __s1_675 = __p1_675; \
57758 int16x8_t __ret_675; \
57759 __ret_675 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_675), (int16x4_t)(vqrshrun_n_s32(__s1_675, __p2_675)))); \
57760 __ret_675; \
59425#define vqrshrun_high_n_s32(__p0_767, __p1_767, __p2_767) __extension__ ({ \
59426 int16x4_t __s0_767 = __p0_767; \
59427 int32x4_t __s1_767 = __p1_767; \
59428 int16x8_t __ret_767; \
59429 __ret_767 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_767), (int16x4_t)(vqrshrun_n_s32(__s1_767, __p2_767)))); \
59430 __ret_767; \
5776159431})
5776259432#else
57763#define vqrshrun_high_n_s32(__p0_676, __p1_676, __p2_676) __extension__ ({ \
57764 int16x4_t __s0_676 = __p0_676; \
57765 int32x4_t __s1_676 = __p1_676; \
57766 int16x4_t __rev0_676; __rev0_676 = __builtin_shufflevector(__s0_676, __s0_676, 3, 2, 1, 0); \
57767 int32x4_t __rev1_676; __rev1_676 = __builtin_shufflevector(__s1_676, __s1_676, 3, 2, 1, 0); \
57768 int16x8_t __ret_676; \
57769 __ret_676 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_676), (int16x4_t)(__noswap_vqrshrun_n_s32(__rev1_676, __p2_676)))); \
57770 __ret_676 = __builtin_shufflevector(__ret_676, __ret_676, 7, 6, 5, 4, 3, 2, 1, 0); \
57771 __ret_676; \
59433#define vqrshrun_high_n_s32(__p0_768, __p1_768, __p2_768) __extension__ ({ \
59434 int16x4_t __s0_768 = __p0_768; \
59435 int32x4_t __s1_768 = __p1_768; \
59436 int16x4_t __rev0_768; __rev0_768 = __builtin_shufflevector(__s0_768, __s0_768, 3, 2, 1, 0); \
59437 int32x4_t __rev1_768; __rev1_768 = __builtin_shufflevector(__s1_768, __s1_768, 3, 2, 1, 0); \
59438 int16x8_t __ret_768; \
59439 __ret_768 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_768), (int16x4_t)(__noswap_vqrshrun_n_s32(__rev1_768, __p2_768)))); \
59440 __ret_768 = __builtin_shufflevector(__ret_768, __ret_768, 7, 6, 5, 4, 3, 2, 1, 0); \
59441 __ret_768; \
5777259442})
5777359443#endif
5777459444
5777559445#ifdef __LITTLE_ENDIAN__
57776#define vqrshrun_high_n_s64(__p0_677, __p1_677, __p2_677) __extension__ ({ \
57777 int32x2_t __s0_677 = __p0_677; \
57778 int64x2_t __s1_677 = __p1_677; \
57779 int32x4_t __ret_677; \
57780 __ret_677 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_677), (int32x2_t)(vqrshrun_n_s64(__s1_677, __p2_677)))); \
57781 __ret_677; \
59446#define vqrshrun_high_n_s64(__p0_769, __p1_769, __p2_769) __extension__ ({ \
59447 int32x2_t __s0_769 = __p0_769; \
59448 int64x2_t __s1_769 = __p1_769; \
59449 int32x4_t __ret_769; \
59450 __ret_769 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_769), (int32x2_t)(vqrshrun_n_s64(__s1_769, __p2_769)))); \
59451 __ret_769; \
5778259452})
5778359453#else
57784#define vqrshrun_high_n_s64(__p0_678, __p1_678, __p2_678) __extension__ ({ \
57785 int32x2_t __s0_678 = __p0_678; \
57786 int64x2_t __s1_678 = __p1_678; \
57787 int32x2_t __rev0_678; __rev0_678 = __builtin_shufflevector(__s0_678, __s0_678, 1, 0); \
57788 int64x2_t __rev1_678; __rev1_678 = __builtin_shufflevector(__s1_678, __s1_678, 1, 0); \
57789 int32x4_t __ret_678; \
57790 __ret_678 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_678), (int32x2_t)(__noswap_vqrshrun_n_s64(__rev1_678, __p2_678)))); \
57791 __ret_678 = __builtin_shufflevector(__ret_678, __ret_678, 3, 2, 1, 0); \
57792 __ret_678; \
59454#define vqrshrun_high_n_s64(__p0_770, __p1_770, __p2_770) __extension__ ({ \
59455 int32x2_t __s0_770 = __p0_770; \
59456 int64x2_t __s1_770 = __p1_770; \
59457 int32x2_t __rev0_770; __rev0_770 = __builtin_shufflevector(__s0_770, __s0_770, 1, 0); \
59458 int64x2_t __rev1_770; __rev1_770 = __builtin_shufflevector(__s1_770, __s1_770, 1, 0); \
59459 int32x4_t __ret_770; \
59460 __ret_770 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_770), (int32x2_t)(__noswap_vqrshrun_n_s64(__rev1_770, __p2_770)))); \
59461 __ret_770 = __builtin_shufflevector(__ret_770, __ret_770, 3, 2, 1, 0); \
59462 __ret_770; \
5779359463})
5779459464#endif
5779559465
5779659466#ifdef __LITTLE_ENDIAN__
57797#define vqrshrun_high_n_s16(__p0_679, __p1_679, __p2_679) __extension__ ({ \
57798 int8x8_t __s0_679 = __p0_679; \
57799 int16x8_t __s1_679 = __p1_679; \
57800 int8x16_t __ret_679; \
57801 __ret_679 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_679), (int8x8_t)(vqrshrun_n_s16(__s1_679, __p2_679)))); \
57802 __ret_679; \
59467#define vqrshrun_high_n_s16(__p0_771, __p1_771, __p2_771) __extension__ ({ \
59468 int8x8_t __s0_771 = __p0_771; \
59469 int16x8_t __s1_771 = __p1_771; \
59470 int8x16_t __ret_771; \
59471 __ret_771 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_771), (int8x8_t)(vqrshrun_n_s16(__s1_771, __p2_771)))); \
59472 __ret_771; \
5780359473})
5780459474#else
57805#define vqrshrun_high_n_s16(__p0_680, __p1_680, __p2_680) __extension__ ({ \
57806 int8x8_t __s0_680 = __p0_680; \
57807 int16x8_t __s1_680 = __p1_680; \
57808 int8x8_t __rev0_680; __rev0_680 = __builtin_shufflevector(__s0_680, __s0_680, 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); \
57810 int8x16_t __ret_680; \
57811 __ret_680 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_680), (int8x8_t)(__noswap_vqrshrun_n_s16(__rev1_680, __p2_680)))); \
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); \
57813 __ret_680; \
59475#define vqrshrun_high_n_s16(__p0_772, __p1_772, __p2_772) __extension__ ({ \
59476 int8x8_t __s0_772 = __p0_772; \
59477 int16x8_t __s1_772 = __p1_772; \
59478 int8x8_t __rev0_772; __rev0_772 = __builtin_shufflevector(__s0_772, __s0_772, 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); \
59480 int8x16_t __ret_772; \
59481 __ret_772 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_772), (int8x8_t)(__noswap_vqrshrun_n_s16(__rev1_772, __p2_772)))); \
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); \
59483 __ret_772; \
5781459484})
5781559485#endif
5781659486
......@@ -57832,22 +59502,22 @@ __ai int16_t vqrshlh_s16(int16_t __p0, int16_t __p1) {
5783259502 __ret = (int8_t) __builtin_neon_vqrshrunh_n_s16(__s0, __p1); \
5783359503 __ret; \
5783459504})
57835__ai uint8_t vqshlb_u8(uint8_t __p0, uint8_t __p1) {
59505__ai uint8_t vqshlb_u8(uint8_t __p0, int8_t __p1) {
5783659506 uint8_t __ret;
5783759507 __ret = (uint8_t) __builtin_neon_vqshlb_u8(__p0, __p1);
5783859508 return __ret;
5783959509}
57840__ai uint32_t vqshls_u32(uint32_t __p0, uint32_t __p1) {
59510__ai uint32_t vqshls_u32(uint32_t __p0, int32_t __p1) {
5784159511 uint32_t __ret;
5784259512 __ret = (uint32_t) __builtin_neon_vqshls_u32(__p0, __p1);
5784359513 return __ret;
5784459514}
57845__ai uint64_t vqshld_u64(uint64_t __p0, uint64_t __p1) {
59515__ai uint64_t vqshld_u64(uint64_t __p0, int64_t __p1) {
5784659516 uint64_t __ret;
5784759517 __ret = (uint64_t) __builtin_neon_vqshld_u64(__p0, __p1);
5784859518 return __ret;
5784959519}
57850__ai uint16_t vqshlh_u16(uint16_t __p0, uint16_t __p1) {
59520__ai uint16_t vqshlh_u16(uint16_t __p0, int16_t __p1) {
5785159521 uint16_t __ret;
5785259522 __ret = (uint16_t) __builtin_neon_vqshlh_u16(__p0, __p1);
5785359523 return __ret;
......@@ -57945,128 +59615,128 @@ __ai int16_t vqshlh_s16(int16_t __p0, int16_t __p1) {
5794559615 __ret; \
5794659616})
5794759617#ifdef __LITTLE_ENDIAN__
57948#define vqshrn_high_n_u32(__p0_681, __p1_681, __p2_681) __extension__ ({ \
57949 uint16x4_t __s0_681 = __p0_681; \
57950 uint32x4_t __s1_681 = __p1_681; \
57951 uint16x8_t __ret_681; \
57952 __ret_681 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_681), (uint16x4_t)(vqshrn_n_u32(__s1_681, __p2_681)))); \
57953 __ret_681; \
59618#define vqshrn_high_n_u32(__p0_773, __p1_773, __p2_773) __extension__ ({ \
59619 uint16x4_t __s0_773 = __p0_773; \
59620 uint32x4_t __s1_773 = __p1_773; \
59621 uint16x8_t __ret_773; \
59622 __ret_773 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_773), (uint16x4_t)(vqshrn_n_u32(__s1_773, __p2_773)))); \
59623 __ret_773; \
5795459624})
5795559625#else
57956#define vqshrn_high_n_u32(__p0_682, __p1_682, __p2_682) __extension__ ({ \
57957 uint16x4_t __s0_682 = __p0_682; \
57958 uint32x4_t __s1_682 = __p1_682; \
57959 uint16x4_t __rev0_682; __rev0_682 = __builtin_shufflevector(__s0_682, __s0_682, 3, 2, 1, 0); \
57960 uint32x4_t __rev1_682; __rev1_682 = __builtin_shufflevector(__s1_682, __s1_682, 3, 2, 1, 0); \
57961 uint16x8_t __ret_682; \
57962 __ret_682 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_682), (uint16x4_t)(__noswap_vqshrn_n_u32(__rev1_682, __p2_682)))); \
57963 __ret_682 = __builtin_shufflevector(__ret_682, __ret_682, 7, 6, 5, 4, 3, 2, 1, 0); \
57964 __ret_682; \
59626#define vqshrn_high_n_u32(__p0_774, __p1_774, __p2_774) __extension__ ({ \
59627 uint16x4_t __s0_774 = __p0_774; \
59628 uint32x4_t __s1_774 = __p1_774; \
59629 uint16x4_t __rev0_774; __rev0_774 = __builtin_shufflevector(__s0_774, __s0_774, 3, 2, 1, 0); \
59630 uint32x4_t __rev1_774; __rev1_774 = __builtin_shufflevector(__s1_774, __s1_774, 3, 2, 1, 0); \
59631 uint16x8_t __ret_774; \
59632 __ret_774 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_774), (uint16x4_t)(__noswap_vqshrn_n_u32(__rev1_774, __p2_774)))); \
59633 __ret_774 = __builtin_shufflevector(__ret_774, __ret_774, 7, 6, 5, 4, 3, 2, 1, 0); \
59634 __ret_774; \
5796559635})
5796659636#endif
5796759637
5796859638#ifdef __LITTLE_ENDIAN__
57969#define vqshrn_high_n_u64(__p0_683, __p1_683, __p2_683) __extension__ ({ \
57970 uint32x2_t __s0_683 = __p0_683; \
57971 uint64x2_t __s1_683 = __p1_683; \
57972 uint32x4_t __ret_683; \
57973 __ret_683 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_683), (uint32x2_t)(vqshrn_n_u64(__s1_683, __p2_683)))); \
57974 __ret_683; \
59639#define vqshrn_high_n_u64(__p0_775, __p1_775, __p2_775) __extension__ ({ \
59640 uint32x2_t __s0_775 = __p0_775; \
59641 uint64x2_t __s1_775 = __p1_775; \
59642 uint32x4_t __ret_775; \
59643 __ret_775 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_775), (uint32x2_t)(vqshrn_n_u64(__s1_775, __p2_775)))); \
59644 __ret_775; \
5797559645})
5797659646#else
57977#define vqshrn_high_n_u64(__p0_684, __p1_684, __p2_684) __extension__ ({ \
57978 uint32x2_t __s0_684 = __p0_684; \
57979 uint64x2_t __s1_684 = __p1_684; \
57980 uint32x2_t __rev0_684; __rev0_684 = __builtin_shufflevector(__s0_684, __s0_684, 1, 0); \
57981 uint64x2_t __rev1_684; __rev1_684 = __builtin_shufflevector(__s1_684, __s1_684, 1, 0); \
57982 uint32x4_t __ret_684; \
57983 __ret_684 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_684), (uint32x2_t)(__noswap_vqshrn_n_u64(__rev1_684, __p2_684)))); \
57984 __ret_684 = __builtin_shufflevector(__ret_684, __ret_684, 3, 2, 1, 0); \
57985 __ret_684; \
59647#define vqshrn_high_n_u64(__p0_776, __p1_776, __p2_776) __extension__ ({ \
59648 uint32x2_t __s0_776 = __p0_776; \
59649 uint64x2_t __s1_776 = __p1_776; \
59650 uint32x2_t __rev0_776; __rev0_776 = __builtin_shufflevector(__s0_776, __s0_776, 1, 0); \
59651 uint64x2_t __rev1_776; __rev1_776 = __builtin_shufflevector(__s1_776, __s1_776, 1, 0); \
59652 uint32x4_t __ret_776; \
59653 __ret_776 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_776), (uint32x2_t)(__noswap_vqshrn_n_u64(__rev1_776, __p2_776)))); \
59654 __ret_776 = __builtin_shufflevector(__ret_776, __ret_776, 3, 2, 1, 0); \
59655 __ret_776; \
5798659656})
5798759657#endif
5798859658
5798959659#ifdef __LITTLE_ENDIAN__
57990#define vqshrn_high_n_u16(__p0_685, __p1_685, __p2_685) __extension__ ({ \
57991 uint8x8_t __s0_685 = __p0_685; \
57992 uint16x8_t __s1_685 = __p1_685; \
57993 uint8x16_t __ret_685; \
57994 __ret_685 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_685), (uint8x8_t)(vqshrn_n_u16(__s1_685, __p2_685)))); \
57995 __ret_685; \
59660#define vqshrn_high_n_u16(__p0_777, __p1_777, __p2_777) __extension__ ({ \
59661 uint8x8_t __s0_777 = __p0_777; \
59662 uint16x8_t __s1_777 = __p1_777; \
59663 uint8x16_t __ret_777; \
59664 __ret_777 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_777), (uint8x8_t)(vqshrn_n_u16(__s1_777, __p2_777)))); \
59665 __ret_777; \
5799659666})
5799759667#else
57998#define vqshrn_high_n_u16(__p0_686, __p1_686, __p2_686) __extension__ ({ \
57999 uint8x8_t __s0_686 = __p0_686; \
58000 uint16x8_t __s1_686 = __p1_686; \
58001 uint8x8_t __rev0_686; __rev0_686 = __builtin_shufflevector(__s0_686, __s0_686, 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); \
58003 uint8x16_t __ret_686; \
58004 __ret_686 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_686), (uint8x8_t)(__noswap_vqshrn_n_u16(__rev1_686, __p2_686)))); \
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); \
58006 __ret_686; \
59668#define vqshrn_high_n_u16(__p0_778, __p1_778, __p2_778) __extension__ ({ \
59669 uint8x8_t __s0_778 = __p0_778; \
59670 uint16x8_t __s1_778 = __p1_778; \
59671 uint8x8_t __rev0_778; __rev0_778 = __builtin_shufflevector(__s0_778, __s0_778, 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); \
59673 uint8x16_t __ret_778; \
59674 __ret_778 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_778), (uint8x8_t)(__noswap_vqshrn_n_u16(__rev1_778, __p2_778)))); \
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); \
59676 __ret_778; \
5800759677})
5800859678#endif
5800959679
5801059680#ifdef __LITTLE_ENDIAN__
58011#define vqshrn_high_n_s32(__p0_687, __p1_687, __p2_687) __extension__ ({ \
58012 int16x4_t __s0_687 = __p0_687; \
58013 int32x4_t __s1_687 = __p1_687; \
58014 int16x8_t __ret_687; \
58015 __ret_687 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_687), (int16x4_t)(vqshrn_n_s32(__s1_687, __p2_687)))); \
58016 __ret_687; \
59681#define vqshrn_high_n_s32(__p0_779, __p1_779, __p2_779) __extension__ ({ \
59682 int16x4_t __s0_779 = __p0_779; \
59683 int32x4_t __s1_779 = __p1_779; \
59684 int16x8_t __ret_779; \
59685 __ret_779 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_779), (int16x4_t)(vqshrn_n_s32(__s1_779, __p2_779)))); \
59686 __ret_779; \
5801759687})
5801859688#else
58019#define vqshrn_high_n_s32(__p0_688, __p1_688, __p2_688) __extension__ ({ \
58020 int16x4_t __s0_688 = __p0_688; \
58021 int32x4_t __s1_688 = __p1_688; \
58022 int16x4_t __rev0_688; __rev0_688 = __builtin_shufflevector(__s0_688, __s0_688, 3, 2, 1, 0); \
58023 int32x4_t __rev1_688; __rev1_688 = __builtin_shufflevector(__s1_688, __s1_688, 3, 2, 1, 0); \
58024 int16x8_t __ret_688; \
58025 __ret_688 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_688), (int16x4_t)(__noswap_vqshrn_n_s32(__rev1_688, __p2_688)))); \
58026 __ret_688 = __builtin_shufflevector(__ret_688, __ret_688, 7, 6, 5, 4, 3, 2, 1, 0); \
58027 __ret_688; \
59689#define vqshrn_high_n_s32(__p0_780, __p1_780, __p2_780) __extension__ ({ \
59690 int16x4_t __s0_780 = __p0_780; \
59691 int32x4_t __s1_780 = __p1_780; \
59692 int16x4_t __rev0_780; __rev0_780 = __builtin_shufflevector(__s0_780, __s0_780, 3, 2, 1, 0); \
59693 int32x4_t __rev1_780; __rev1_780 = __builtin_shufflevector(__s1_780, __s1_780, 3, 2, 1, 0); \
59694 int16x8_t __ret_780; \
59695 __ret_780 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_780), (int16x4_t)(__noswap_vqshrn_n_s32(__rev1_780, __p2_780)))); \
59696 __ret_780 = __builtin_shufflevector(__ret_780, __ret_780, 7, 6, 5, 4, 3, 2, 1, 0); \
59697 __ret_780; \
5802859698})
5802959699#endif
5803059700
5803159701#ifdef __LITTLE_ENDIAN__
58032#define vqshrn_high_n_s64(__p0_689, __p1_689, __p2_689) __extension__ ({ \
58033 int32x2_t __s0_689 = __p0_689; \
58034 int64x2_t __s1_689 = __p1_689; \
58035 int32x4_t __ret_689; \
58036 __ret_689 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_689), (int32x2_t)(vqshrn_n_s64(__s1_689, __p2_689)))); \
58037 __ret_689; \
59702#define vqshrn_high_n_s64(__p0_781, __p1_781, __p2_781) __extension__ ({ \
59703 int32x2_t __s0_781 = __p0_781; \
59704 int64x2_t __s1_781 = __p1_781; \
59705 int32x4_t __ret_781; \
59706 __ret_781 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_781), (int32x2_t)(vqshrn_n_s64(__s1_781, __p2_781)))); \
59707 __ret_781; \
5803859708})
5803959709#else
58040#define vqshrn_high_n_s64(__p0_690, __p1_690, __p2_690) __extension__ ({ \
58041 int32x2_t __s0_690 = __p0_690; \
58042 int64x2_t __s1_690 = __p1_690; \
58043 int32x2_t __rev0_690; __rev0_690 = __builtin_shufflevector(__s0_690, __s0_690, 1, 0); \
58044 int64x2_t __rev1_690; __rev1_690 = __builtin_shufflevector(__s1_690, __s1_690, 1, 0); \
58045 int32x4_t __ret_690; \
58046 __ret_690 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_690), (int32x2_t)(__noswap_vqshrn_n_s64(__rev1_690, __p2_690)))); \
58047 __ret_690 = __builtin_shufflevector(__ret_690, __ret_690, 3, 2, 1, 0); \
58048 __ret_690; \
59710#define vqshrn_high_n_s64(__p0_782, __p1_782, __p2_782) __extension__ ({ \
59711 int32x2_t __s0_782 = __p0_782; \
59712 int64x2_t __s1_782 = __p1_782; \
59713 int32x2_t __rev0_782; __rev0_782 = __builtin_shufflevector(__s0_782, __s0_782, 1, 0); \
59714 int64x2_t __rev1_782; __rev1_782 = __builtin_shufflevector(__s1_782, __s1_782, 1, 0); \
59715 int32x4_t __ret_782; \
59716 __ret_782 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_782), (int32x2_t)(__noswap_vqshrn_n_s64(__rev1_782, __p2_782)))); \
59717 __ret_782 = __builtin_shufflevector(__ret_782, __ret_782, 3, 2, 1, 0); \
59718 __ret_782; \
5804959719})
5805059720#endif
5805159721
5805259722#ifdef __LITTLE_ENDIAN__
58053#define vqshrn_high_n_s16(__p0_691, __p1_691, __p2_691) __extension__ ({ \
58054 int8x8_t __s0_691 = __p0_691; \
58055 int16x8_t __s1_691 = __p1_691; \
58056 int8x16_t __ret_691; \
58057 __ret_691 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_691), (int8x8_t)(vqshrn_n_s16(__s1_691, __p2_691)))); \
58058 __ret_691; \
59723#define vqshrn_high_n_s16(__p0_783, __p1_783, __p2_783) __extension__ ({ \
59724 int8x8_t __s0_783 = __p0_783; \
59725 int16x8_t __s1_783 = __p1_783; \
59726 int8x16_t __ret_783; \
59727 __ret_783 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_783), (int8x8_t)(vqshrn_n_s16(__s1_783, __p2_783)))); \
59728 __ret_783; \
5805959729})
5806059730#else
58061#define vqshrn_high_n_s16(__p0_692, __p1_692, __p2_692) __extension__ ({ \
58062 int8x8_t __s0_692 = __p0_692; \
58063 int16x8_t __s1_692 = __p1_692; \
58064 int8x8_t __rev0_692; __rev0_692 = __builtin_shufflevector(__s0_692, __s0_692, 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); \
58066 int8x16_t __ret_692; \
58067 __ret_692 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_692), (int8x8_t)(__noswap_vqshrn_n_s16(__rev1_692, __p2_692)))); \
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); \
58069 __ret_692; \
59731#define vqshrn_high_n_s16(__p0_784, __p1_784, __p2_784) __extension__ ({ \
59732 int8x8_t __s0_784 = __p0_784; \
59733 int16x8_t __s1_784 = __p1_784; \
59734 int8x8_t __rev0_784; __rev0_784 = __builtin_shufflevector(__s0_784, __s0_784, 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); \
59736 int8x16_t __ret_784; \
59737 __ret_784 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_784), (int8x8_t)(__noswap_vqshrn_n_s16(__rev1_784, __p2_784)))); \
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); \
59739 __ret_784; \
5807059740})
5807159741#endif
5807259742
......@@ -58107,65 +59777,65 @@ __ai int16_t vqshlh_s16(int16_t __p0, int16_t __p1) {
5810759777 __ret; \
5810859778})
5810959779#ifdef __LITTLE_ENDIAN__
58110#define vqshrun_high_n_s32(__p0_693, __p1_693, __p2_693) __extension__ ({ \
58111 int16x4_t __s0_693 = __p0_693; \
58112 int32x4_t __s1_693 = __p1_693; \
58113 int16x8_t __ret_693; \
58114 __ret_693 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_693), (int16x4_t)(vqshrun_n_s32(__s1_693, __p2_693)))); \
58115 __ret_693; \
59780#define vqshrun_high_n_s32(__p0_785, __p1_785, __p2_785) __extension__ ({ \
59781 int16x4_t __s0_785 = __p0_785; \
59782 int32x4_t __s1_785 = __p1_785; \
59783 int16x8_t __ret_785; \
59784 __ret_785 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_785), (int16x4_t)(vqshrun_n_s32(__s1_785, __p2_785)))); \
59785 __ret_785; \
5811659786})
5811759787#else
58118#define vqshrun_high_n_s32(__p0_694, __p1_694, __p2_694) __extension__ ({ \
58119 int16x4_t __s0_694 = __p0_694; \
58120 int32x4_t __s1_694 = __p1_694; \
58121 int16x4_t __rev0_694; __rev0_694 = __builtin_shufflevector(__s0_694, __s0_694, 3, 2, 1, 0); \
58122 int32x4_t __rev1_694; __rev1_694 = __builtin_shufflevector(__s1_694, __s1_694, 3, 2, 1, 0); \
58123 int16x8_t __ret_694; \
58124 __ret_694 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_694), (int16x4_t)(__noswap_vqshrun_n_s32(__rev1_694, __p2_694)))); \
58125 __ret_694 = __builtin_shufflevector(__ret_694, __ret_694, 7, 6, 5, 4, 3, 2, 1, 0); \
58126 __ret_694; \
59788#define vqshrun_high_n_s32(__p0_786, __p1_786, __p2_786) __extension__ ({ \
59789 int16x4_t __s0_786 = __p0_786; \
59790 int32x4_t __s1_786 = __p1_786; \
59791 int16x4_t __rev0_786; __rev0_786 = __builtin_shufflevector(__s0_786, __s0_786, 3, 2, 1, 0); \
59792 int32x4_t __rev1_786; __rev1_786 = __builtin_shufflevector(__s1_786, __s1_786, 3, 2, 1, 0); \
59793 int16x8_t __ret_786; \
59794 __ret_786 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_786), (int16x4_t)(__noswap_vqshrun_n_s32(__rev1_786, __p2_786)))); \
59795 __ret_786 = __builtin_shufflevector(__ret_786, __ret_786, 7, 6, 5, 4, 3, 2, 1, 0); \
59796 __ret_786; \
5812759797})
5812859798#endif
5812959799
5813059800#ifdef __LITTLE_ENDIAN__
58131#define vqshrun_high_n_s64(__p0_695, __p1_695, __p2_695) __extension__ ({ \
58132 int32x2_t __s0_695 = __p0_695; \
58133 int64x2_t __s1_695 = __p1_695; \
58134 int32x4_t __ret_695; \
58135 __ret_695 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_695), (int32x2_t)(vqshrun_n_s64(__s1_695, __p2_695)))); \
58136 __ret_695; \
59801#define vqshrun_high_n_s64(__p0_787, __p1_787, __p2_787) __extension__ ({ \
59802 int32x2_t __s0_787 = __p0_787; \
59803 int64x2_t __s1_787 = __p1_787; \
59804 int32x4_t __ret_787; \
59805 __ret_787 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_787), (int32x2_t)(vqshrun_n_s64(__s1_787, __p2_787)))); \
59806 __ret_787; \
5813759807})
5813859808#else
58139#define vqshrun_high_n_s64(__p0_696, __p1_696, __p2_696) __extension__ ({ \
58140 int32x2_t __s0_696 = __p0_696; \
58141 int64x2_t __s1_696 = __p1_696; \
58142 int32x2_t __rev0_696; __rev0_696 = __builtin_shufflevector(__s0_696, __s0_696, 1, 0); \
58143 int64x2_t __rev1_696; __rev1_696 = __builtin_shufflevector(__s1_696, __s1_696, 1, 0); \
58144 int32x4_t __ret_696; \
58145 __ret_696 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_696), (int32x2_t)(__noswap_vqshrun_n_s64(__rev1_696, __p2_696)))); \
58146 __ret_696 = __builtin_shufflevector(__ret_696, __ret_696, 3, 2, 1, 0); \
58147 __ret_696; \
59809#define vqshrun_high_n_s64(__p0_788, __p1_788, __p2_788) __extension__ ({ \
59810 int32x2_t __s0_788 = __p0_788; \
59811 int64x2_t __s1_788 = __p1_788; \
59812 int32x2_t __rev0_788; __rev0_788 = __builtin_shufflevector(__s0_788, __s0_788, 1, 0); \
59813 int64x2_t __rev1_788; __rev1_788 = __builtin_shufflevector(__s1_788, __s1_788, 1, 0); \
59814 int32x4_t __ret_788; \
59815 __ret_788 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_788), (int32x2_t)(__noswap_vqshrun_n_s64(__rev1_788, __p2_788)))); \
59816 __ret_788 = __builtin_shufflevector(__ret_788, __ret_788, 3, 2, 1, 0); \
59817 __ret_788; \
5814859818})
5814959819#endif
5815059820
5815159821#ifdef __LITTLE_ENDIAN__
58152#define vqshrun_high_n_s16(__p0_697, __p1_697, __p2_697) __extension__ ({ \
58153 int8x8_t __s0_697 = __p0_697; \
58154 int16x8_t __s1_697 = __p1_697; \
58155 int8x16_t __ret_697; \
58156 __ret_697 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_697), (int8x8_t)(vqshrun_n_s16(__s1_697, __p2_697)))); \
58157 __ret_697; \
59822#define vqshrun_high_n_s16(__p0_789, __p1_789, __p2_789) __extension__ ({ \
59823 int8x8_t __s0_789 = __p0_789; \
59824 int16x8_t __s1_789 = __p1_789; \
59825 int8x16_t __ret_789; \
59826 __ret_789 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_789), (int8x8_t)(vqshrun_n_s16(__s1_789, __p2_789)))); \
59827 __ret_789; \
5815859828})
5815959829#else
58160#define vqshrun_high_n_s16(__p0_698, __p1_698, __p2_698) __extension__ ({ \
58161 int8x8_t __s0_698 = __p0_698; \
58162 int16x8_t __s1_698 = __p1_698; \
58163 int8x8_t __rev0_698; __rev0_698 = __builtin_shufflevector(__s0_698, __s0_698, 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); \
58165 int8x16_t __ret_698; \
58166 __ret_698 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_698), (int8x8_t)(__noswap_vqshrun_n_s16(__rev1_698, __p2_698)))); \
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); \
58168 __ret_698; \
59830#define vqshrun_high_n_s16(__p0_790, __p1_790, __p2_790) __extension__ ({ \
59831 int8x8_t __s0_790 = __p0_790; \
59832 int16x8_t __s1_790 = __p1_790; \
59833 int8x8_t __rev0_790; __rev0_790 = __builtin_shufflevector(__s0_790, __s0_790, 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); \
59835 int8x16_t __ret_790; \
59836 __ret_790 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_790), (int8x8_t)(__noswap_vqshrun_n_s16(__rev1_790, __p2_790)))); \
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); \
59838 __ret_790; \
5816959839})
5817059840#endif
5817159841
......@@ -59452,7 +61122,7 @@ __ai float32_t vrecpxs_f32(float32_t __p0) {
5945261122 __ret = (float32_t) __builtin_neon_vrecpxs_f32(__p0);
5945361123 return __ret;
5945461124}
59455__ai uint64_t vrshld_u64(uint64_t __p0, uint64_t __p1) {
61125__ai uint64_t vrshld_u64(uint64_t __p0, int64_t __p1) {
5945661126 uint64_t __ret;
5945761127 __ret = (uint64_t) __builtin_neon_vrshld_u64(__p0, __p1);
5945861128 return __ret;
......@@ -59475,128 +61145,128 @@ __ai int64_t vrshld_s64(int64_t __p0, int64_t __p1) {
5947561145 __ret; \
5947661146})
5947761147#ifdef __LITTLE_ENDIAN__
59478#define vrshrn_high_n_u32(__p0_699, __p1_699, __p2_699) __extension__ ({ \
59479 uint16x4_t __s0_699 = __p0_699; \
59480 uint32x4_t __s1_699 = __p1_699; \
59481 uint16x8_t __ret_699; \
59482 __ret_699 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_699), (uint16x4_t)(vrshrn_n_u32(__s1_699, __p2_699)))); \
59483 __ret_699; \
61148#define vrshrn_high_n_u32(__p0_791, __p1_791, __p2_791) __extension__ ({ \
61149 uint16x4_t __s0_791 = __p0_791; \
61150 uint32x4_t __s1_791 = __p1_791; \
61151 uint16x8_t __ret_791; \
61152 __ret_791 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_791), (uint16x4_t)(vrshrn_n_u32(__s1_791, __p2_791)))); \
61153 __ret_791; \
5948461154})
5948561155#else
59486#define vrshrn_high_n_u32(__p0_700, __p1_700, __p2_700) __extension__ ({ \
59487 uint16x4_t __s0_700 = __p0_700; \
59488 uint32x4_t __s1_700 = __p1_700; \
59489 uint16x4_t __rev0_700; __rev0_700 = __builtin_shufflevector(__s0_700, __s0_700, 3, 2, 1, 0); \
59490 uint32x4_t __rev1_700; __rev1_700 = __builtin_shufflevector(__s1_700, __s1_700, 3, 2, 1, 0); \
59491 uint16x8_t __ret_700; \
59492 __ret_700 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_700), (uint16x4_t)(__noswap_vrshrn_n_u32(__rev1_700, __p2_700)))); \
59493 __ret_700 = __builtin_shufflevector(__ret_700, __ret_700, 7, 6, 5, 4, 3, 2, 1, 0); \
59494 __ret_700; \
61156#define vrshrn_high_n_u32(__p0_792, __p1_792, __p2_792) __extension__ ({ \
61157 uint16x4_t __s0_792 = __p0_792; \
61158 uint32x4_t __s1_792 = __p1_792; \
61159 uint16x4_t __rev0_792; __rev0_792 = __builtin_shufflevector(__s0_792, __s0_792, 3, 2, 1, 0); \
61160 uint32x4_t __rev1_792; __rev1_792 = __builtin_shufflevector(__s1_792, __s1_792, 3, 2, 1, 0); \
61161 uint16x8_t __ret_792; \
61162 __ret_792 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_792), (uint16x4_t)(__noswap_vrshrn_n_u32(__rev1_792, __p2_792)))); \
61163 __ret_792 = __builtin_shufflevector(__ret_792, __ret_792, 7, 6, 5, 4, 3, 2, 1, 0); \
61164 __ret_792; \
5949561165})
5949661166#endif
5949761167
5949861168#ifdef __LITTLE_ENDIAN__
59499#define vrshrn_high_n_u64(__p0_701, __p1_701, __p2_701) __extension__ ({ \
59500 uint32x2_t __s0_701 = __p0_701; \
59501 uint64x2_t __s1_701 = __p1_701; \
59502 uint32x4_t __ret_701; \
59503 __ret_701 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_701), (uint32x2_t)(vrshrn_n_u64(__s1_701, __p2_701)))); \
59504 __ret_701; \
61169#define vrshrn_high_n_u64(__p0_793, __p1_793, __p2_793) __extension__ ({ \
61170 uint32x2_t __s0_793 = __p0_793; \
61171 uint64x2_t __s1_793 = __p1_793; \
61172 uint32x4_t __ret_793; \
61173 __ret_793 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_793), (uint32x2_t)(vrshrn_n_u64(__s1_793, __p2_793)))); \
61174 __ret_793; \
5950561175})
5950661176#else
59507#define vrshrn_high_n_u64(__p0_702, __p1_702, __p2_702) __extension__ ({ \
59508 uint32x2_t __s0_702 = __p0_702; \
59509 uint64x2_t __s1_702 = __p1_702; \
59510 uint32x2_t __rev0_702; __rev0_702 = __builtin_shufflevector(__s0_702, __s0_702, 1, 0); \
59511 uint64x2_t __rev1_702; __rev1_702 = __builtin_shufflevector(__s1_702, __s1_702, 1, 0); \
59512 uint32x4_t __ret_702; \
59513 __ret_702 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_702), (uint32x2_t)(__noswap_vrshrn_n_u64(__rev1_702, __p2_702)))); \
59514 __ret_702 = __builtin_shufflevector(__ret_702, __ret_702, 3, 2, 1, 0); \
59515 __ret_702; \
61177#define vrshrn_high_n_u64(__p0_794, __p1_794, __p2_794) __extension__ ({ \
61178 uint32x2_t __s0_794 = __p0_794; \
61179 uint64x2_t __s1_794 = __p1_794; \
61180 uint32x2_t __rev0_794; __rev0_794 = __builtin_shufflevector(__s0_794, __s0_794, 1, 0); \
61181 uint64x2_t __rev1_794; __rev1_794 = __builtin_shufflevector(__s1_794, __s1_794, 1, 0); \
61182 uint32x4_t __ret_794; \
61183 __ret_794 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_794), (uint32x2_t)(__noswap_vrshrn_n_u64(__rev1_794, __p2_794)))); \
61184 __ret_794 = __builtin_shufflevector(__ret_794, __ret_794, 3, 2, 1, 0); \
61185 __ret_794; \
5951661186})
5951761187#endif
5951861188
5951961189#ifdef __LITTLE_ENDIAN__
59520#define vrshrn_high_n_u16(__p0_703, __p1_703, __p2_703) __extension__ ({ \
59521 uint8x8_t __s0_703 = __p0_703; \
59522 uint16x8_t __s1_703 = __p1_703; \
59523 uint8x16_t __ret_703; \
59524 __ret_703 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_703), (uint8x8_t)(vrshrn_n_u16(__s1_703, __p2_703)))); \
59525 __ret_703; \
61190#define vrshrn_high_n_u16(__p0_795, __p1_795, __p2_795) __extension__ ({ \
61191 uint8x8_t __s0_795 = __p0_795; \
61192 uint16x8_t __s1_795 = __p1_795; \
61193 uint8x16_t __ret_795; \
61194 __ret_795 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_795), (uint8x8_t)(vrshrn_n_u16(__s1_795, __p2_795)))); \
61195 __ret_795; \
5952661196})
5952761197#else
59528#define vrshrn_high_n_u16(__p0_704, __p1_704, __p2_704) __extension__ ({ \
59529 uint8x8_t __s0_704 = __p0_704; \
59530 uint16x8_t __s1_704 = __p1_704; \
59531 uint8x8_t __rev0_704; __rev0_704 = __builtin_shufflevector(__s0_704, __s0_704, 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); \
59533 uint8x16_t __ret_704; \
59534 __ret_704 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_704), (uint8x8_t)(__noswap_vrshrn_n_u16(__rev1_704, __p2_704)))); \
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); \
59536 __ret_704; \
61198#define vrshrn_high_n_u16(__p0_796, __p1_796, __p2_796) __extension__ ({ \
61199 uint8x8_t __s0_796 = __p0_796; \
61200 uint16x8_t __s1_796 = __p1_796; \
61201 uint8x8_t __rev0_796; __rev0_796 = __builtin_shufflevector(__s0_796, __s0_796, 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); \
61203 uint8x16_t __ret_796; \
61204 __ret_796 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_796), (uint8x8_t)(__noswap_vrshrn_n_u16(__rev1_796, __p2_796)))); \
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); \
61206 __ret_796; \
5953761207})
5953861208#endif
5953961209
5954061210#ifdef __LITTLE_ENDIAN__
59541#define vrshrn_high_n_s32(__p0_705, __p1_705, __p2_705) __extension__ ({ \
59542 int16x4_t __s0_705 = __p0_705; \
59543 int32x4_t __s1_705 = __p1_705; \
59544 int16x8_t __ret_705; \
59545 __ret_705 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_705), (int16x4_t)(vrshrn_n_s32(__s1_705, __p2_705)))); \
59546 __ret_705; \
61211#define vrshrn_high_n_s32(__p0_797, __p1_797, __p2_797) __extension__ ({ \
61212 int16x4_t __s0_797 = __p0_797; \
61213 int32x4_t __s1_797 = __p1_797; \
61214 int16x8_t __ret_797; \
61215 __ret_797 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_797), (int16x4_t)(vrshrn_n_s32(__s1_797, __p2_797)))); \
61216 __ret_797; \
5954761217})
5954861218#else
59549#define vrshrn_high_n_s32(__p0_706, __p1_706, __p2_706) __extension__ ({ \
59550 int16x4_t __s0_706 = __p0_706; \
59551 int32x4_t __s1_706 = __p1_706; \
59552 int16x4_t __rev0_706; __rev0_706 = __builtin_shufflevector(__s0_706, __s0_706, 3, 2, 1, 0); \
59553 int32x4_t __rev1_706; __rev1_706 = __builtin_shufflevector(__s1_706, __s1_706, 3, 2, 1, 0); \
59554 int16x8_t __ret_706; \
59555 __ret_706 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_706), (int16x4_t)(__noswap_vrshrn_n_s32(__rev1_706, __p2_706)))); \
59556 __ret_706 = __builtin_shufflevector(__ret_706, __ret_706, 7, 6, 5, 4, 3, 2, 1, 0); \
59557 __ret_706; \
61219#define vrshrn_high_n_s32(__p0_798, __p1_798, __p2_798) __extension__ ({ \
61220 int16x4_t __s0_798 = __p0_798; \
61221 int32x4_t __s1_798 = __p1_798; \
61222 int16x4_t __rev0_798; __rev0_798 = __builtin_shufflevector(__s0_798, __s0_798, 3, 2, 1, 0); \
61223 int32x4_t __rev1_798; __rev1_798 = __builtin_shufflevector(__s1_798, __s1_798, 3, 2, 1, 0); \
61224 int16x8_t __ret_798; \
61225 __ret_798 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_798), (int16x4_t)(__noswap_vrshrn_n_s32(__rev1_798, __p2_798)))); \
61226 __ret_798 = __builtin_shufflevector(__ret_798, __ret_798, 7, 6, 5, 4, 3, 2, 1, 0); \
61227 __ret_798; \
5955861228})
5955961229#endif
5956061230
5956161231#ifdef __LITTLE_ENDIAN__
59562#define vrshrn_high_n_s64(__p0_707, __p1_707, __p2_707) __extension__ ({ \
59563 int32x2_t __s0_707 = __p0_707; \
59564 int64x2_t __s1_707 = __p1_707; \
59565 int32x4_t __ret_707; \
59566 __ret_707 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_707), (int32x2_t)(vrshrn_n_s64(__s1_707, __p2_707)))); \
59567 __ret_707; \
61232#define vrshrn_high_n_s64(__p0_799, __p1_799, __p2_799) __extension__ ({ \
61233 int32x2_t __s0_799 = __p0_799; \
61234 int64x2_t __s1_799 = __p1_799; \
61235 int32x4_t __ret_799; \
61236 __ret_799 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_799), (int32x2_t)(vrshrn_n_s64(__s1_799, __p2_799)))); \
61237 __ret_799; \
5956861238})
5956961239#else
59570#define vrshrn_high_n_s64(__p0_708, __p1_708, __p2_708) __extension__ ({ \
59571 int32x2_t __s0_708 = __p0_708; \
59572 int64x2_t __s1_708 = __p1_708; \
59573 int32x2_t __rev0_708; __rev0_708 = __builtin_shufflevector(__s0_708, __s0_708, 1, 0); \
59574 int64x2_t __rev1_708; __rev1_708 = __builtin_shufflevector(__s1_708, __s1_708, 1, 0); \
59575 int32x4_t __ret_708; \
59576 __ret_708 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_708), (int32x2_t)(__noswap_vrshrn_n_s64(__rev1_708, __p2_708)))); \
59577 __ret_708 = __builtin_shufflevector(__ret_708, __ret_708, 3, 2, 1, 0); \
59578 __ret_708; \
61240#define vrshrn_high_n_s64(__p0_800, __p1_800, __p2_800) __extension__ ({ \
61241 int32x2_t __s0_800 = __p0_800; \
61242 int64x2_t __s1_800 = __p1_800; \
61243 int32x2_t __rev0_800; __rev0_800 = __builtin_shufflevector(__s0_800, __s0_800, 1, 0); \
61244 int64x2_t __rev1_800; __rev1_800 = __builtin_shufflevector(__s1_800, __s1_800, 1, 0); \
61245 int32x4_t __ret_800; \
61246 __ret_800 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_800), (int32x2_t)(__noswap_vrshrn_n_s64(__rev1_800, __p2_800)))); \
61247 __ret_800 = __builtin_shufflevector(__ret_800, __ret_800, 3, 2, 1, 0); \
61248 __ret_800; \
5957961249})
5958061250#endif
5958161251
5958261252#ifdef __LITTLE_ENDIAN__
59583#define vrshrn_high_n_s16(__p0_709, __p1_709, __p2_709) __extension__ ({ \
59584 int8x8_t __s0_709 = __p0_709; \
59585 int16x8_t __s1_709 = __p1_709; \
59586 int8x16_t __ret_709; \
59587 __ret_709 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_709), (int8x8_t)(vrshrn_n_s16(__s1_709, __p2_709)))); \
59588 __ret_709; \
61253#define vrshrn_high_n_s16(__p0_801, __p1_801, __p2_801) __extension__ ({ \
61254 int8x8_t __s0_801 = __p0_801; \
61255 int16x8_t __s1_801 = __p1_801; \
61256 int8x16_t __ret_801; \
61257 __ret_801 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_801), (int8x8_t)(vrshrn_n_s16(__s1_801, __p2_801)))); \
61258 __ret_801; \
5958961259})
5959061260#else
59591#define vrshrn_high_n_s16(__p0_710, __p1_710, __p2_710) __extension__ ({ \
59592 int8x8_t __s0_710 = __p0_710; \
59593 int16x8_t __s1_710 = __p1_710; \
59594 int8x8_t __rev0_710; __rev0_710 = __builtin_shufflevector(__s0_710, __s0_710, 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); \
59596 int8x16_t __ret_710; \
59597 __ret_710 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_710), (int8x8_t)(__noswap_vrshrn_n_s16(__rev1_710, __p2_710)))); \
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); \
59599 __ret_710; \
61261#define vrshrn_high_n_s16(__p0_802, __p1_802, __p2_802) __extension__ ({ \
61262 int8x8_t __s0_802 = __p0_802; \
61263 int16x8_t __s1_802 = __p1_802; \
61264 int8x8_t __rev0_802; __rev0_802 = __builtin_shufflevector(__s0_802, __s0_802, 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); \
61266 int8x16_t __ret_802; \
61267 __ret_802 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_802), (int8x8_t)(__noswap_vrshrn_n_s16(__rev1_802, __p2_802)))); \
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); \
61269 __ret_802; \
5960061270})
5960161271#endif
5960261272
......@@ -59853,7 +61523,7 @@ __ai int8x16_t vrsubhn_high_s16(int8x8_t __p0, int16x8_t __p1, int16x8_t __p2) {
5985361523 __ret = (float64x1_t) __builtin_neon_vset_lane_f64(__s0, (float64x1_t)__s1, __p2); \
5985461524 __ret; \
5985561525})
59856__ai uint64_t vshld_u64(uint64_t __p0, uint64_t __p1) {
61526__ai uint64_t vshld_u64(uint64_t __p0, int64_t __p1) {
5985761527 uint64_t __ret;
5985861528 __ret = (uint64_t) __builtin_neon_vshld_u64(__p0, __p1);
5985961529 return __ret;
......@@ -59876,110 +61546,110 @@ __ai int64_t vshld_s64(int64_t __p0, int64_t __p1) {
5987661546 __ret; \
5987761547})
5987861548#ifdef __LITTLE_ENDIAN__
59879#define vshll_high_n_u8(__p0_711, __p1_711) __extension__ ({ \
59880 uint8x16_t __s0_711 = __p0_711; \
59881 uint16x8_t __ret_711; \
59882 __ret_711 = (uint16x8_t)(vshll_n_u8(vget_high_u8(__s0_711), __p1_711)); \
59883 __ret_711; \
61549#define vshll_high_n_u8(__p0_803, __p1_803) __extension__ ({ \
61550 uint8x16_t __s0_803 = __p0_803; \
61551 uint16x8_t __ret_803; \
61552 __ret_803 = (uint16x8_t)(vshll_n_u8(vget_high_u8(__s0_803), __p1_803)); \
61553 __ret_803; \
5988461554})
5988561555#else
59886#define vshll_high_n_u8(__p0_712, __p1_712) __extension__ ({ \
59887 uint8x16_t __s0_712 = __p0_712; \
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); \
59889 uint16x8_t __ret_712; \
59890 __ret_712 = (uint16x8_t)(__noswap_vshll_n_u8(__noswap_vget_high_u8(__rev0_712), __p1_712)); \
59891 __ret_712 = __builtin_shufflevector(__ret_712, __ret_712, 7, 6, 5, 4, 3, 2, 1, 0); \
59892 __ret_712; \
61556#define vshll_high_n_u8(__p0_804, __p1_804) __extension__ ({ \
61557 uint8x16_t __s0_804 = __p0_804; \
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); \
61559 uint16x8_t __ret_804; \
61560 __ret_804 = (uint16x8_t)(__noswap_vshll_n_u8(__noswap_vget_high_u8(__rev0_804), __p1_804)); \
61561 __ret_804 = __builtin_shufflevector(__ret_804, __ret_804, 7, 6, 5, 4, 3, 2, 1, 0); \
61562 __ret_804; \
5989361563})
5989461564#endif
5989561565
5989661566#ifdef __LITTLE_ENDIAN__
59897#define vshll_high_n_u32(__p0_713, __p1_713) __extension__ ({ \
59898 uint32x4_t __s0_713 = __p0_713; \
59899 uint64x2_t __ret_713; \
59900 __ret_713 = (uint64x2_t)(vshll_n_u32(vget_high_u32(__s0_713), __p1_713)); \
59901 __ret_713; \
61567#define vshll_high_n_u32(__p0_805, __p1_805) __extension__ ({ \
61568 uint32x4_t __s0_805 = __p0_805; \
61569 uint64x2_t __ret_805; \
61570 __ret_805 = (uint64x2_t)(vshll_n_u32(vget_high_u32(__s0_805), __p1_805)); \
61571 __ret_805; \
5990261572})
5990361573#else
59904#define vshll_high_n_u32(__p0_714, __p1_714) __extension__ ({ \
59905 uint32x4_t __s0_714 = __p0_714; \
59906 uint32x4_t __rev0_714; __rev0_714 = __builtin_shufflevector(__s0_714, __s0_714, 3, 2, 1, 0); \
59907 uint64x2_t __ret_714; \
59908 __ret_714 = (uint64x2_t)(__noswap_vshll_n_u32(__noswap_vget_high_u32(__rev0_714), __p1_714)); \
59909 __ret_714 = __builtin_shufflevector(__ret_714, __ret_714, 1, 0); \
59910 __ret_714; \
61574#define vshll_high_n_u32(__p0_806, __p1_806) __extension__ ({ \
61575 uint32x4_t __s0_806 = __p0_806; \
61576 uint32x4_t __rev0_806; __rev0_806 = __builtin_shufflevector(__s0_806, __s0_806, 3, 2, 1, 0); \
61577 uint64x2_t __ret_806; \
61578 __ret_806 = (uint64x2_t)(__noswap_vshll_n_u32(__noswap_vget_high_u32(__rev0_806), __p1_806)); \
61579 __ret_806 = __builtin_shufflevector(__ret_806, __ret_806, 1, 0); \
61580 __ret_806; \
5991161581})
5991261582#endif
5991361583
5991461584#ifdef __LITTLE_ENDIAN__
59915#define vshll_high_n_u16(__p0_715, __p1_715) __extension__ ({ \
59916 uint16x8_t __s0_715 = __p0_715; \
59917 uint32x4_t __ret_715; \
59918 __ret_715 = (uint32x4_t)(vshll_n_u16(vget_high_u16(__s0_715), __p1_715)); \
59919 __ret_715; \
61585#define vshll_high_n_u16(__p0_807, __p1_807) __extension__ ({ \
61586 uint16x8_t __s0_807 = __p0_807; \
61587 uint32x4_t __ret_807; \
61588 __ret_807 = (uint32x4_t)(vshll_n_u16(vget_high_u16(__s0_807), __p1_807)); \
61589 __ret_807; \
5992061590})
5992161591#else
59922#define vshll_high_n_u16(__p0_716, __p1_716) __extension__ ({ \
59923 uint16x8_t __s0_716 = __p0_716; \
59924 uint16x8_t __rev0_716; __rev0_716 = __builtin_shufflevector(__s0_716, __s0_716, 7, 6, 5, 4, 3, 2, 1, 0); \
59925 uint32x4_t __ret_716; \
59926 __ret_716 = (uint32x4_t)(__noswap_vshll_n_u16(__noswap_vget_high_u16(__rev0_716), __p1_716)); \
59927 __ret_716 = __builtin_shufflevector(__ret_716, __ret_716, 3, 2, 1, 0); \
59928 __ret_716; \
61592#define vshll_high_n_u16(__p0_808, __p1_808) __extension__ ({ \
61593 uint16x8_t __s0_808 = __p0_808; \
61594 uint16x8_t __rev0_808; __rev0_808 = __builtin_shufflevector(__s0_808, __s0_808, 7, 6, 5, 4, 3, 2, 1, 0); \
61595 uint32x4_t __ret_808; \
61596 __ret_808 = (uint32x4_t)(__noswap_vshll_n_u16(__noswap_vget_high_u16(__rev0_808), __p1_808)); \
61597 __ret_808 = __builtin_shufflevector(__ret_808, __ret_808, 3, 2, 1, 0); \
61598 __ret_808; \
5992961599})
5993061600#endif
5993161601
5993261602#ifdef __LITTLE_ENDIAN__
59933#define vshll_high_n_s8(__p0_717, __p1_717) __extension__ ({ \
59934 int8x16_t __s0_717 = __p0_717; \
59935 int16x8_t __ret_717; \
59936 __ret_717 = (int16x8_t)(vshll_n_s8(vget_high_s8(__s0_717), __p1_717)); \
59937 __ret_717; \
61603#define vshll_high_n_s8(__p0_809, __p1_809) __extension__ ({ \
61604 int8x16_t __s0_809 = __p0_809; \
61605 int16x8_t __ret_809; \
61606 __ret_809 = (int16x8_t)(vshll_n_s8(vget_high_s8(__s0_809), __p1_809)); \
61607 __ret_809; \
5993861608})
5993961609#else
59940#define vshll_high_n_s8(__p0_718, __p1_718) __extension__ ({ \
59941 int8x16_t __s0_718 = __p0_718; \
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); \
59943 int16x8_t __ret_718; \
59944 __ret_718 = (int16x8_t)(__noswap_vshll_n_s8(__noswap_vget_high_s8(__rev0_718), __p1_718)); \
59945 __ret_718 = __builtin_shufflevector(__ret_718, __ret_718, 7, 6, 5, 4, 3, 2, 1, 0); \
59946 __ret_718; \
61610#define vshll_high_n_s8(__p0_810, __p1_810) __extension__ ({ \
61611 int8x16_t __s0_810 = __p0_810; \
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); \
61613 int16x8_t __ret_810; \
61614 __ret_810 = (int16x8_t)(__noswap_vshll_n_s8(__noswap_vget_high_s8(__rev0_810), __p1_810)); \
61615 __ret_810 = __builtin_shufflevector(__ret_810, __ret_810, 7, 6, 5, 4, 3, 2, 1, 0); \
61616 __ret_810; \
5994761617})
5994861618#endif
5994961619
5995061620#ifdef __LITTLE_ENDIAN__
59951#define vshll_high_n_s32(__p0_719, __p1_719) __extension__ ({ \
59952 int32x4_t __s0_719 = __p0_719; \
59953 int64x2_t __ret_719; \
59954 __ret_719 = (int64x2_t)(vshll_n_s32(vget_high_s32(__s0_719), __p1_719)); \
59955 __ret_719; \
61621#define vshll_high_n_s32(__p0_811, __p1_811) __extension__ ({ \
61622 int32x4_t __s0_811 = __p0_811; \
61623 int64x2_t __ret_811; \
61624 __ret_811 = (int64x2_t)(vshll_n_s32(vget_high_s32(__s0_811), __p1_811)); \
61625 __ret_811; \
5995661626})
5995761627#else
59958#define vshll_high_n_s32(__p0_720, __p1_720) __extension__ ({ \
59959 int32x4_t __s0_720 = __p0_720; \
59960 int32x4_t __rev0_720; __rev0_720 = __builtin_shufflevector(__s0_720, __s0_720, 3, 2, 1, 0); \
59961 int64x2_t __ret_720; \
59962 __ret_720 = (int64x2_t)(__noswap_vshll_n_s32(__noswap_vget_high_s32(__rev0_720), __p1_720)); \
59963 __ret_720 = __builtin_shufflevector(__ret_720, __ret_720, 1, 0); \
59964 __ret_720; \
61628#define vshll_high_n_s32(__p0_812, __p1_812) __extension__ ({ \
61629 int32x4_t __s0_812 = __p0_812; \
61630 int32x4_t __rev0_812; __rev0_812 = __builtin_shufflevector(__s0_812, __s0_812, 3, 2, 1, 0); \
61631 int64x2_t __ret_812; \
61632 __ret_812 = (int64x2_t)(__noswap_vshll_n_s32(__noswap_vget_high_s32(__rev0_812), __p1_812)); \
61633 __ret_812 = __builtin_shufflevector(__ret_812, __ret_812, 1, 0); \
61634 __ret_812; \
5996561635})
5996661636#endif
5996761637
5996861638#ifdef __LITTLE_ENDIAN__
59969#define vshll_high_n_s16(__p0_721, __p1_721) __extension__ ({ \
59970 int16x8_t __s0_721 = __p0_721; \
59971 int32x4_t __ret_721; \
59972 __ret_721 = (int32x4_t)(vshll_n_s16(vget_high_s16(__s0_721), __p1_721)); \
59973 __ret_721; \
61639#define vshll_high_n_s16(__p0_813, __p1_813) __extension__ ({ \
61640 int16x8_t __s0_813 = __p0_813; \
61641 int32x4_t __ret_813; \
61642 __ret_813 = (int32x4_t)(vshll_n_s16(vget_high_s16(__s0_813), __p1_813)); \
61643 __ret_813; \
5997461644})
5997561645#else
59976#define vshll_high_n_s16(__p0_722, __p1_722) __extension__ ({ \
59977 int16x8_t __s0_722 = __p0_722; \
59978 int16x8_t __rev0_722; __rev0_722 = __builtin_shufflevector(__s0_722, __s0_722, 7, 6, 5, 4, 3, 2, 1, 0); \
59979 int32x4_t __ret_722; \
59980 __ret_722 = (int32x4_t)(__noswap_vshll_n_s16(__noswap_vget_high_s16(__rev0_722), __p1_722)); \
59981 __ret_722 = __builtin_shufflevector(__ret_722, __ret_722, 3, 2, 1, 0); \
59982 __ret_722; \
61646#define vshll_high_n_s16(__p0_814, __p1_814) __extension__ ({ \
61647 int16x8_t __s0_814 = __p0_814; \
61648 int16x8_t __rev0_814; __rev0_814 = __builtin_shufflevector(__s0_814, __s0_814, 7, 6, 5, 4, 3, 2, 1, 0); \
61649 int32x4_t __ret_814; \
61650 __ret_814 = (int32x4_t)(__noswap_vshll_n_s16(__noswap_vget_high_s16(__rev0_814), __p1_814)); \
61651 __ret_814 = __builtin_shufflevector(__ret_814, __ret_814, 3, 2, 1, 0); \
61652 __ret_814; \
5998361653})
5998461654#endif
5998561655
......@@ -59996,128 +61666,128 @@ __ai int64_t vshld_s64(int64_t __p0, int64_t __p1) {
5999661666 __ret; \
5999761667})
5999861668#ifdef __LITTLE_ENDIAN__
59999#define vshrn_high_n_u32(__p0_723, __p1_723, __p2_723) __extension__ ({ \
60000 uint16x4_t __s0_723 = __p0_723; \
60001 uint32x4_t __s1_723 = __p1_723; \
60002 uint16x8_t __ret_723; \
60003 __ret_723 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_723), (uint16x4_t)(vshrn_n_u32(__s1_723, __p2_723)))); \
60004 __ret_723; \
61669#define vshrn_high_n_u32(__p0_815, __p1_815, __p2_815) __extension__ ({ \
61670 uint16x4_t __s0_815 = __p0_815; \
61671 uint32x4_t __s1_815 = __p1_815; \
61672 uint16x8_t __ret_815; \
61673 __ret_815 = (uint16x8_t)(vcombine_u16((uint16x4_t)(__s0_815), (uint16x4_t)(vshrn_n_u32(__s1_815, __p2_815)))); \
61674 __ret_815; \
6000561675})
6000661676#else
60007#define vshrn_high_n_u32(__p0_724, __p1_724, __p2_724) __extension__ ({ \
60008 uint16x4_t __s0_724 = __p0_724; \
60009 uint32x4_t __s1_724 = __p1_724; \
60010 uint16x4_t __rev0_724; __rev0_724 = __builtin_shufflevector(__s0_724, __s0_724, 3, 2, 1, 0); \
60011 uint32x4_t __rev1_724; __rev1_724 = __builtin_shufflevector(__s1_724, __s1_724, 3, 2, 1, 0); \
60012 uint16x8_t __ret_724; \
60013 __ret_724 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_724), (uint16x4_t)(__noswap_vshrn_n_u32(__rev1_724, __p2_724)))); \
60014 __ret_724 = __builtin_shufflevector(__ret_724, __ret_724, 7, 6, 5, 4, 3, 2, 1, 0); \
60015 __ret_724; \
61677#define vshrn_high_n_u32(__p0_816, __p1_816, __p2_816) __extension__ ({ \
61678 uint16x4_t __s0_816 = __p0_816; \
61679 uint32x4_t __s1_816 = __p1_816; \
61680 uint16x4_t __rev0_816; __rev0_816 = __builtin_shufflevector(__s0_816, __s0_816, 3, 2, 1, 0); \
61681 uint32x4_t __rev1_816; __rev1_816 = __builtin_shufflevector(__s1_816, __s1_816, 3, 2, 1, 0); \
61682 uint16x8_t __ret_816; \
61683 __ret_816 = (uint16x8_t)(__noswap_vcombine_u16((uint16x4_t)(__rev0_816), (uint16x4_t)(__noswap_vshrn_n_u32(__rev1_816, __p2_816)))); \
61684 __ret_816 = __builtin_shufflevector(__ret_816, __ret_816, 7, 6, 5, 4, 3, 2, 1, 0); \
61685 __ret_816; \
6001661686})
6001761687#endif
6001861688
6001961689#ifdef __LITTLE_ENDIAN__
60020#define vshrn_high_n_u64(__p0_725, __p1_725, __p2_725) __extension__ ({ \
60021 uint32x2_t __s0_725 = __p0_725; \
60022 uint64x2_t __s1_725 = __p1_725; \
60023 uint32x4_t __ret_725; \
60024 __ret_725 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_725), (uint32x2_t)(vshrn_n_u64(__s1_725, __p2_725)))); \
60025 __ret_725; \
61690#define vshrn_high_n_u64(__p0_817, __p1_817, __p2_817) __extension__ ({ \
61691 uint32x2_t __s0_817 = __p0_817; \
61692 uint64x2_t __s1_817 = __p1_817; \
61693 uint32x4_t __ret_817; \
61694 __ret_817 = (uint32x4_t)(vcombine_u32((uint32x2_t)(__s0_817), (uint32x2_t)(vshrn_n_u64(__s1_817, __p2_817)))); \
61695 __ret_817; \
6002661696})
6002761697#else
60028#define vshrn_high_n_u64(__p0_726, __p1_726, __p2_726) __extension__ ({ \
60029 uint32x2_t __s0_726 = __p0_726; \
60030 uint64x2_t __s1_726 = __p1_726; \
60031 uint32x2_t __rev0_726; __rev0_726 = __builtin_shufflevector(__s0_726, __s0_726, 1, 0); \
60032 uint64x2_t __rev1_726; __rev1_726 = __builtin_shufflevector(__s1_726, __s1_726, 1, 0); \
60033 uint32x4_t __ret_726; \
60034 __ret_726 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_726), (uint32x2_t)(__noswap_vshrn_n_u64(__rev1_726, __p2_726)))); \
60035 __ret_726 = __builtin_shufflevector(__ret_726, __ret_726, 3, 2, 1, 0); \
60036 __ret_726; \
61698#define vshrn_high_n_u64(__p0_818, __p1_818, __p2_818) __extension__ ({ \
61699 uint32x2_t __s0_818 = __p0_818; \
61700 uint64x2_t __s1_818 = __p1_818; \
61701 uint32x2_t __rev0_818; __rev0_818 = __builtin_shufflevector(__s0_818, __s0_818, 1, 0); \
61702 uint64x2_t __rev1_818; __rev1_818 = __builtin_shufflevector(__s1_818, __s1_818, 1, 0); \
61703 uint32x4_t __ret_818; \
61704 __ret_818 = (uint32x4_t)(__noswap_vcombine_u32((uint32x2_t)(__rev0_818), (uint32x2_t)(__noswap_vshrn_n_u64(__rev1_818, __p2_818)))); \
61705 __ret_818 = __builtin_shufflevector(__ret_818, __ret_818, 3, 2, 1, 0); \
61706 __ret_818; \
6003761707})
6003861708#endif
6003961709
6004061710#ifdef __LITTLE_ENDIAN__
60041#define vshrn_high_n_u16(__p0_727, __p1_727, __p2_727) __extension__ ({ \
60042 uint8x8_t __s0_727 = __p0_727; \
60043 uint16x8_t __s1_727 = __p1_727; \
60044 uint8x16_t __ret_727; \
60045 __ret_727 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_727), (uint8x8_t)(vshrn_n_u16(__s1_727, __p2_727)))); \
60046 __ret_727; \
61711#define vshrn_high_n_u16(__p0_819, __p1_819, __p2_819) __extension__ ({ \
61712 uint8x8_t __s0_819 = __p0_819; \
61713 uint16x8_t __s1_819 = __p1_819; \
61714 uint8x16_t __ret_819; \
61715 __ret_819 = (uint8x16_t)(vcombine_u8((uint8x8_t)(__s0_819), (uint8x8_t)(vshrn_n_u16(__s1_819, __p2_819)))); \
61716 __ret_819; \
6004761717})
6004861718#else
60049#define vshrn_high_n_u16(__p0_728, __p1_728, __p2_728) __extension__ ({ \
60050 uint8x8_t __s0_728 = __p0_728; \
60051 uint16x8_t __s1_728 = __p1_728; \
60052 uint8x8_t __rev0_728; __rev0_728 = __builtin_shufflevector(__s0_728, __s0_728, 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); \
60054 uint8x16_t __ret_728; \
60055 __ret_728 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_728), (uint8x8_t)(__noswap_vshrn_n_u16(__rev1_728, __p2_728)))); \
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); \
60057 __ret_728; \
61719#define vshrn_high_n_u16(__p0_820, __p1_820, __p2_820) __extension__ ({ \
61720 uint8x8_t __s0_820 = __p0_820; \
61721 uint16x8_t __s1_820 = __p1_820; \
61722 uint8x8_t __rev0_820; __rev0_820 = __builtin_shufflevector(__s0_820, __s0_820, 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); \
61724 uint8x16_t __ret_820; \
61725 __ret_820 = (uint8x16_t)(__noswap_vcombine_u8((uint8x8_t)(__rev0_820), (uint8x8_t)(__noswap_vshrn_n_u16(__rev1_820, __p2_820)))); \
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); \
61727 __ret_820; \
6005861728})
6005961729#endif
6006061730
6006161731#ifdef __LITTLE_ENDIAN__
60062#define vshrn_high_n_s32(__p0_729, __p1_729, __p2_729) __extension__ ({ \
60063 int16x4_t __s0_729 = __p0_729; \
60064 int32x4_t __s1_729 = __p1_729; \
60065 int16x8_t __ret_729; \
60066 __ret_729 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_729), (int16x4_t)(vshrn_n_s32(__s1_729, __p2_729)))); \
60067 __ret_729; \
61732#define vshrn_high_n_s32(__p0_821, __p1_821, __p2_821) __extension__ ({ \
61733 int16x4_t __s0_821 = __p0_821; \
61734 int32x4_t __s1_821 = __p1_821; \
61735 int16x8_t __ret_821; \
61736 __ret_821 = (int16x8_t)(vcombine_s16((int16x4_t)(__s0_821), (int16x4_t)(vshrn_n_s32(__s1_821, __p2_821)))); \
61737 __ret_821; \
6006861738})
6006961739#else
60070#define vshrn_high_n_s32(__p0_730, __p1_730, __p2_730) __extension__ ({ \
60071 int16x4_t __s0_730 = __p0_730; \
60072 int32x4_t __s1_730 = __p1_730; \
60073 int16x4_t __rev0_730; __rev0_730 = __builtin_shufflevector(__s0_730, __s0_730, 3, 2, 1, 0); \
60074 int32x4_t __rev1_730; __rev1_730 = __builtin_shufflevector(__s1_730, __s1_730, 3, 2, 1, 0); \
60075 int16x8_t __ret_730; \
60076 __ret_730 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_730), (int16x4_t)(__noswap_vshrn_n_s32(__rev1_730, __p2_730)))); \
60077 __ret_730 = __builtin_shufflevector(__ret_730, __ret_730, 7, 6, 5, 4, 3, 2, 1, 0); \
60078 __ret_730; \
61740#define vshrn_high_n_s32(__p0_822, __p1_822, __p2_822) __extension__ ({ \
61741 int16x4_t __s0_822 = __p0_822; \
61742 int32x4_t __s1_822 = __p1_822; \
61743 int16x4_t __rev0_822; __rev0_822 = __builtin_shufflevector(__s0_822, __s0_822, 3, 2, 1, 0); \
61744 int32x4_t __rev1_822; __rev1_822 = __builtin_shufflevector(__s1_822, __s1_822, 3, 2, 1, 0); \
61745 int16x8_t __ret_822; \
61746 __ret_822 = (int16x8_t)(__noswap_vcombine_s16((int16x4_t)(__rev0_822), (int16x4_t)(__noswap_vshrn_n_s32(__rev1_822, __p2_822)))); \
61747 __ret_822 = __builtin_shufflevector(__ret_822, __ret_822, 7, 6, 5, 4, 3, 2, 1, 0); \
61748 __ret_822; \
6007961749})
6008061750#endif
6008161751
6008261752#ifdef __LITTLE_ENDIAN__
60083#define vshrn_high_n_s64(__p0_731, __p1_731, __p2_731) __extension__ ({ \
60084 int32x2_t __s0_731 = __p0_731; \
60085 int64x2_t __s1_731 = __p1_731; \
60086 int32x4_t __ret_731; \
60087 __ret_731 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_731), (int32x2_t)(vshrn_n_s64(__s1_731, __p2_731)))); \
60088 __ret_731; \
61753#define vshrn_high_n_s64(__p0_823, __p1_823, __p2_823) __extension__ ({ \
61754 int32x2_t __s0_823 = __p0_823; \
61755 int64x2_t __s1_823 = __p1_823; \
61756 int32x4_t __ret_823; \
61757 __ret_823 = (int32x4_t)(vcombine_s32((int32x2_t)(__s0_823), (int32x2_t)(vshrn_n_s64(__s1_823, __p2_823)))); \
61758 __ret_823; \
6008961759})
6009061760#else
60091#define vshrn_high_n_s64(__p0_732, __p1_732, __p2_732) __extension__ ({ \
60092 int32x2_t __s0_732 = __p0_732; \
60093 int64x2_t __s1_732 = __p1_732; \
60094 int32x2_t __rev0_732; __rev0_732 = __builtin_shufflevector(__s0_732, __s0_732, 1, 0); \
60095 int64x2_t __rev1_732; __rev1_732 = __builtin_shufflevector(__s1_732, __s1_732, 1, 0); \
60096 int32x4_t __ret_732; \
60097 __ret_732 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_732), (int32x2_t)(__noswap_vshrn_n_s64(__rev1_732, __p2_732)))); \
60098 __ret_732 = __builtin_shufflevector(__ret_732, __ret_732, 3, 2, 1, 0); \
60099 __ret_732; \
61761#define vshrn_high_n_s64(__p0_824, __p1_824, __p2_824) __extension__ ({ \
61762 int32x2_t __s0_824 = __p0_824; \
61763 int64x2_t __s1_824 = __p1_824; \
61764 int32x2_t __rev0_824; __rev0_824 = __builtin_shufflevector(__s0_824, __s0_824, 1, 0); \
61765 int64x2_t __rev1_824; __rev1_824 = __builtin_shufflevector(__s1_824, __s1_824, 1, 0); \
61766 int32x4_t __ret_824; \
61767 __ret_824 = (int32x4_t)(__noswap_vcombine_s32((int32x2_t)(__rev0_824), (int32x2_t)(__noswap_vshrn_n_s64(__rev1_824, __p2_824)))); \
61768 __ret_824 = __builtin_shufflevector(__ret_824, __ret_824, 3, 2, 1, 0); \
61769 __ret_824; \
6010061770})
6010161771#endif
6010261772
6010361773#ifdef __LITTLE_ENDIAN__
60104#define vshrn_high_n_s16(__p0_733, __p1_733, __p2_733) __extension__ ({ \
60105 int8x8_t __s0_733 = __p0_733; \
60106 int16x8_t __s1_733 = __p1_733; \
60107 int8x16_t __ret_733; \
60108 __ret_733 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_733), (int8x8_t)(vshrn_n_s16(__s1_733, __p2_733)))); \
60109 __ret_733; \
61774#define vshrn_high_n_s16(__p0_825, __p1_825, __p2_825) __extension__ ({ \
61775 int8x8_t __s0_825 = __p0_825; \
61776 int16x8_t __s1_825 = __p1_825; \
61777 int8x16_t __ret_825; \
61778 __ret_825 = (int8x16_t)(vcombine_s8((int8x8_t)(__s0_825), (int8x8_t)(vshrn_n_s16(__s1_825, __p2_825)))); \
61779 __ret_825; \
6011061780})
6011161781#else
60112#define vshrn_high_n_s16(__p0_734, __p1_734, __p2_734) __extension__ ({ \
60113 int8x8_t __s0_734 = __p0_734; \
60114 int16x8_t __s1_734 = __p1_734; \
60115 int8x8_t __rev0_734; __rev0_734 = __builtin_shufflevector(__s0_734, __s0_734, 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); \
60117 int8x16_t __ret_734; \
60118 __ret_734 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_734), (int8x8_t)(__noswap_vshrn_n_s16(__rev1_734, __p2_734)))); \
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); \
60120 __ret_734; \
61782#define vshrn_high_n_s16(__p0_826, __p1_826, __p2_826) __extension__ ({ \
61783 int8x8_t __s0_826 = __p0_826; \
61784 int16x8_t __s1_826 = __p1_826; \
61785 int8x8_t __rev0_826; __rev0_826 = __builtin_shufflevector(__s0_826, __s0_826, 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); \
61787 int8x16_t __ret_826; \
61788 __ret_826 = (int8x16_t)(__noswap_vcombine_s8((int8x8_t)(__rev0_826), (int8x8_t)(__noswap_vshrn_n_s16(__rev1_826, __p2_826)))); \
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); \
61790 __ret_826; \
6012161791})
6012261792#endif
6012361793
......@@ -61553,54 +63223,54 @@ __ai int32x4_t vsubw_high_s16(int32x4_t __p0, int16x8_t __p1) {
6155363223#endif
6155463224
6155563225#ifdef __LITTLE_ENDIAN__
61556#define vsudotq_laneq_s32(__p0_735, __p1_735, __p2_735, __p3_735) __extension__ ({ \
61557 int32x4_t __s0_735 = __p0_735; \
61558 int8x16_t __s1_735 = __p1_735; \
61559 uint8x16_t __s2_735 = __p2_735; \
61560 int32x4_t __ret_735; \
61561uint8x16_t __reint_735 = __s2_735; \
61562 __ret_735 = vusdotq_s32(__s0_735, (uint8x16_t)(splatq_laneq_s32(*(int32x4_t *) &__reint_735, __p3_735)), __s1_735); \
61563 __ret_735; \
63226#define vsudotq_laneq_s32(__p0_827, __p1_827, __p2_827, __p3_827) __extension__ ({ \
63227 int32x4_t __s0_827 = __p0_827; \
63228 int8x16_t __s1_827 = __p1_827; \
63229 uint8x16_t __s2_827 = __p2_827; \
63230 int32x4_t __ret_827; \
63231uint8x16_t __reint_827 = __s2_827; \
63232 __ret_827 = vusdotq_s32(__s0_827, (uint8x16_t)(splatq_laneq_s32(*(int32x4_t *) &__reint_827, __p3_827)), __s1_827); \
63233 __ret_827; \
6156463234})
6156563235#else
61566#define vsudotq_laneq_s32(__p0_736, __p1_736, __p2_736, __p3_736) __extension__ ({ \
61567 int32x4_t __s0_736 = __p0_736; \
61568 int8x16_t __s1_736 = __p1_736; \
61569 uint8x16_t __s2_736 = __p2_736; \
61570 int32x4_t __rev0_736; __rev0_736 = __builtin_shufflevector(__s0_736, __s0_736, 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); \
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); \
61573 int32x4_t __ret_736; \
61574uint8x16_t __reint_736 = __rev2_736; \
61575 __ret_736 = __noswap_vusdotq_s32(__rev0_736, (uint8x16_t)(__noswap_splatq_laneq_s32(*(int32x4_t *) &__reint_736, __p3_736)), __rev1_736); \
61576 __ret_736 = __builtin_shufflevector(__ret_736, __ret_736, 3, 2, 1, 0); \
61577 __ret_736; \
63236#define vsudotq_laneq_s32(__p0_828, __p1_828, __p2_828, __p3_828) __extension__ ({ \
63237 int32x4_t __s0_828 = __p0_828; \
63238 int8x16_t __s1_828 = __p1_828; \
63239 uint8x16_t __s2_828 = __p2_828; \
63240 int32x4_t __rev0_828; __rev0_828 = __builtin_shufflevector(__s0_828, __s0_828, 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); \
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); \
63243 int32x4_t __ret_828; \
63244uint8x16_t __reint_828 = __rev2_828; \
63245 __ret_828 = __noswap_vusdotq_s32(__rev0_828, (uint8x16_t)(__noswap_splatq_laneq_s32(*(int32x4_t *) &__reint_828, __p3_828)), __rev1_828); \
63246 __ret_828 = __builtin_shufflevector(__ret_828, __ret_828, 3, 2, 1, 0); \
63247 __ret_828; \
6157863248})
6157963249#endif
6158063250
6158163251#ifdef __LITTLE_ENDIAN__
61582#define vsudot_laneq_s32(__p0_737, __p1_737, __p2_737, __p3_737) __extension__ ({ \
61583 int32x2_t __s0_737 = __p0_737; \
61584 int8x8_t __s1_737 = __p1_737; \
61585 uint8x16_t __s2_737 = __p2_737; \
61586 int32x2_t __ret_737; \
61587uint8x16_t __reint_737 = __s2_737; \
61588 __ret_737 = vusdot_s32(__s0_737, (uint8x8_t)(splat_laneq_s32(*(int32x4_t *) &__reint_737, __p3_737)), __s1_737); \
61589 __ret_737; \
63252#define vsudot_laneq_s32(__p0_829, __p1_829, __p2_829, __p3_829) __extension__ ({ \
63253 int32x2_t __s0_829 = __p0_829; \
63254 int8x8_t __s1_829 = __p1_829; \
63255 uint8x16_t __s2_829 = __p2_829; \
63256 int32x2_t __ret_829; \
63257uint8x16_t __reint_829 = __s2_829; \
63258 __ret_829 = vusdot_s32(__s0_829, (uint8x8_t)(splat_laneq_s32(*(int32x4_t *) &__reint_829, __p3_829)), __s1_829); \
63259 __ret_829; \
6159063260})
6159163261#else
61592#define vsudot_laneq_s32(__p0_738, __p1_738, __p2_738, __p3_738) __extension__ ({ \
61593 int32x2_t __s0_738 = __p0_738; \
61594 int8x8_t __s1_738 = __p1_738; \
61595 uint8x16_t __s2_738 = __p2_738; \
61596 int32x2_t __rev0_738; __rev0_738 = __builtin_shufflevector(__s0_738, __s0_738, 1, 0); \
61597 int8x8_t __rev1_738; __rev1_738 = __builtin_shufflevector(__s1_738, __s1_738, 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); \
61599 int32x2_t __ret_738; \
61600uint8x16_t __reint_738 = __rev2_738; \
61601 __ret_738 = __noswap_vusdot_s32(__rev0_738, (uint8x8_t)(__noswap_splat_laneq_s32(*(int32x4_t *) &__reint_738, __p3_738)), __rev1_738); \
61602 __ret_738 = __builtin_shufflevector(__ret_738, __ret_738, 1, 0); \
61603 __ret_738; \
63262#define vsudot_laneq_s32(__p0_830, __p1_830, __p2_830, __p3_830) __extension__ ({ \
63263 int32x2_t __s0_830 = __p0_830; \
63264 int8x8_t __s1_830 = __p1_830; \
63265 uint8x16_t __s2_830 = __p2_830; \
63266 int32x2_t __rev0_830; __rev0_830 = __builtin_shufflevector(__s0_830, __s0_830, 1, 0); \
63267 int8x8_t __rev1_830; __rev1_830 = __builtin_shufflevector(__s1_830, __s1_830, 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); \
63269 int32x2_t __ret_830; \
63270uint8x16_t __reint_830 = __rev2_830; \
63271 __ret_830 = __noswap_vusdot_s32(__rev0_830, (uint8x8_t)(__noswap_splat_laneq_s32(*(int32x4_t *) &__reint_830, __p3_830)), __rev1_830); \
63272 __ret_830 = __builtin_shufflevector(__ret_830, __ret_830, 1, 0); \
63273 __ret_830; \
6160463274})
6160563275#endif
6160663276
......@@ -62423,9 +64093,9 @@ __ai uint64_t vtstd_u64(uint64_t __p0, uint64_t __p1) {
6242364093 __ret = (uint64_t) __builtin_neon_vtstd_u64(__p0, __p1);
6242464094 return __ret;
6242564095}
62426__ai int64_t vtstd_s64(int64_t __p0, int64_t __p1) {
62427 int64_t __ret;
62428 __ret = (int64_t) __builtin_neon_vtstd_s64(__p0, __p1);
64096__ai uint64_t vtstd_s64(int64_t __p0, int64_t __p1) {
64097 uint64_t __ret;
64098 __ret = (uint64_t) __builtin_neon_vtstd_s64(__p0, __p1);
6242964099 return __ret;
6243064100}
6243164101__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) {
6257364243#endif
6257464244
6257564245#ifdef __LITTLE_ENDIAN__
62576#define vusdotq_laneq_s32(__p0_739, __p1_739, __p2_739, __p3_739) __extension__ ({ \
62577 int32x4_t __s0_739 = __p0_739; \
62578 uint8x16_t __s1_739 = __p1_739; \
62579 int8x16_t __s2_739 = __p2_739; \
62580 int32x4_t __ret_739; \
62581int8x16_t __reint_739 = __s2_739; \
62582 __ret_739 = vusdotq_s32(__s0_739, __s1_739, (int8x16_t)(splatq_laneq_s32(*(int32x4_t *) &__reint_739, __p3_739))); \
62583 __ret_739; \
64246#define vusdotq_laneq_s32(__p0_831, __p1_831, __p2_831, __p3_831) __extension__ ({ \
64247 int32x4_t __s0_831 = __p0_831; \
64248 uint8x16_t __s1_831 = __p1_831; \
64249 int8x16_t __s2_831 = __p2_831; \
64250 int32x4_t __ret_831; \
64251int8x16_t __reint_831 = __s2_831; \
64252 __ret_831 = vusdotq_s32(__s0_831, __s1_831, (int8x16_t)(splatq_laneq_s32(*(int32x4_t *) &__reint_831, __p3_831))); \
64253 __ret_831; \
6258464254})
6258564255#else
62586#define vusdotq_laneq_s32(__p0_740, __p1_740, __p2_740, __p3_740) __extension__ ({ \
62587 int32x4_t __s0_740 = __p0_740; \
62588 uint8x16_t __s1_740 = __p1_740; \
62589 int8x16_t __s2_740 = __p2_740; \
62590 int32x4_t __rev0_740; __rev0_740 = __builtin_shufflevector(__s0_740, __s0_740, 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); \
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); \
62593 int32x4_t __ret_740; \
62594int8x16_t __reint_740 = __rev2_740; \
62595 __ret_740 = __noswap_vusdotq_s32(__rev0_740, __rev1_740, (int8x16_t)(__noswap_splatq_laneq_s32(*(int32x4_t *) &__reint_740, __p3_740))); \
62596 __ret_740 = __builtin_shufflevector(__ret_740, __ret_740, 3, 2, 1, 0); \
62597 __ret_740; \
64256#define vusdotq_laneq_s32(__p0_832, __p1_832, __p2_832, __p3_832) __extension__ ({ \
64257 int32x4_t __s0_832 = __p0_832; \
64258 uint8x16_t __s1_832 = __p1_832; \
64259 int8x16_t __s2_832 = __p2_832; \
64260 int32x4_t __rev0_832; __rev0_832 = __builtin_shufflevector(__s0_832, __s0_832, 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); \
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); \
64263 int32x4_t __ret_832; \
64264int8x16_t __reint_832 = __rev2_832; \
64265 __ret_832 = __noswap_vusdotq_s32(__rev0_832, __rev1_832, (int8x16_t)(__noswap_splatq_laneq_s32(*(int32x4_t *) &__reint_832, __p3_832))); \
64266 __ret_832 = __builtin_shufflevector(__ret_832, __ret_832, 3, 2, 1, 0); \
64267 __ret_832; \
6259864268})
6259964269#endif
6260064270
6260164271#ifdef __LITTLE_ENDIAN__
62602#define vusdot_laneq_s32(__p0_741, __p1_741, __p2_741, __p3_741) __extension__ ({ \
62603 int32x2_t __s0_741 = __p0_741; \
62604 uint8x8_t __s1_741 = __p1_741; \
62605 int8x16_t __s2_741 = __p2_741; \
62606 int32x2_t __ret_741; \
62607int8x16_t __reint_741 = __s2_741; \
62608 __ret_741 = vusdot_s32(__s0_741, __s1_741, (int8x8_t)(splat_laneq_s32(*(int32x4_t *) &__reint_741, __p3_741))); \
62609 __ret_741; \
64272#define vusdot_laneq_s32(__p0_833, __p1_833, __p2_833, __p3_833) __extension__ ({ \
64273 int32x2_t __s0_833 = __p0_833; \
64274 uint8x8_t __s1_833 = __p1_833; \
64275 int8x16_t __s2_833 = __p2_833; \
64276 int32x2_t __ret_833; \
64277int8x16_t __reint_833 = __s2_833; \
64278 __ret_833 = vusdot_s32(__s0_833, __s1_833, (int8x8_t)(splat_laneq_s32(*(int32x4_t *) &__reint_833, __p3_833))); \
64279 __ret_833; \
6261064280})
6261164281#else
62612#define vusdot_laneq_s32(__p0_742, __p1_742, __p2_742, __p3_742) __extension__ ({ \
62613 int32x2_t __s0_742 = __p0_742; \
62614 uint8x8_t __s1_742 = __p1_742; \
62615 int8x16_t __s2_742 = __p2_742; \
62616 int32x2_t __rev0_742; __rev0_742 = __builtin_shufflevector(__s0_742, __s0_742, 1, 0); \
62617 uint8x8_t __rev1_742; __rev1_742 = __builtin_shufflevector(__s1_742, __s1_742, 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); \
62619 int32x2_t __ret_742; \
62620int8x16_t __reint_742 = __rev2_742; \
62621 __ret_742 = __noswap_vusdot_s32(__rev0_742, __rev1_742, (int8x8_t)(__noswap_splat_laneq_s32(*(int32x4_t *) &__reint_742, __p3_742))); \
62622 __ret_742 = __builtin_shufflevector(__ret_742, __ret_742, 1, 0); \
62623 __ret_742; \
64282#define vusdot_laneq_s32(__p0_834, __p1_834, __p2_834, __p3_834) __extension__ ({ \
64283 int32x2_t __s0_834 = __p0_834; \
64284 uint8x8_t __s1_834 = __p1_834; \
64285 int8x16_t __s2_834 = __p2_834; \
64286 int32x2_t __rev0_834; __rev0_834 = __builtin_shufflevector(__s0_834, __s0_834, 1, 0); \
64287 uint8x8_t __rev1_834; __rev1_834 = __builtin_shufflevector(__s1_834, __s1_834, 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); \
64289 int32x2_t __ret_834; \
64290int8x16_t __reint_834 = __rev2_834; \
64291 __ret_834 = __noswap_vusdot_s32(__rev0_834, __rev1_834, (int8x8_t)(__noswap_splat_laneq_s32(*(int32x4_t *) &__reint_834, __p3_834))); \
64292 __ret_834 = __builtin_shufflevector(__ret_834, __ret_834, 1, 0); \
64293 __ret_834; \
6262464294})
6262564295#endif
6262664296
......@@ -64674,60 +66344,60 @@ __ai int32x4_t vaddw_s16(int32x4_t __p0, int16x4_t __p1) {
6467466344#endif
6467566345
6467666346#ifdef __LITTLE_ENDIAN__
64677#define vget_lane_f16(__p0_743, __p1_743) __extension__ ({ \
64678 float16x4_t __s0_743 = __p0_743; \
64679 float16_t __ret_743; \
64680float16x4_t __reint_743 = __s0_743; \
64681int16_t __reint1_743 = vget_lane_s16(*(int16x4_t *) &__reint_743, __p1_743); \
64682 __ret_743 = *(float16_t *) &__reint1_743; \
64683 __ret_743; \
66347#define vget_lane_f16(__p0_835, __p1_835) __extension__ ({ \
66348 float16x4_t __s0_835 = __p0_835; \
66349 float16_t __ret_835; \
66350float16x4_t __reint_835 = __s0_835; \
66351int16_t __reint1_835 = vget_lane_s16(*(int16x4_t *) &__reint_835, __p1_835); \
66352 __ret_835 = *(float16_t *) &__reint1_835; \
66353 __ret_835; \
6468466354})
6468566355#else
64686#define vget_lane_f16(__p0_744, __p1_744) __extension__ ({ \
64687 float16x4_t __s0_744 = __p0_744; \
64688 float16x4_t __rev0_744; __rev0_744 = __builtin_shufflevector(__s0_744, __s0_744, 3, 2, 1, 0); \
64689 float16_t __ret_744; \
64690float16x4_t __reint_744 = __rev0_744; \
64691int16_t __reint1_744 = __noswap_vget_lane_s16(*(int16x4_t *) &__reint_744, __p1_744); \
64692 __ret_744 = *(float16_t *) &__reint1_744; \
64693 __ret_744; \
66356#define vget_lane_f16(__p0_836, __p1_836) __extension__ ({ \
66357 float16x4_t __s0_836 = __p0_836; \
66358 float16x4_t __rev0_836; __rev0_836 = __builtin_shufflevector(__s0_836, __s0_836, 3, 2, 1, 0); \
66359 float16_t __ret_836; \
66360float16x4_t __reint_836 = __rev0_836; \
66361int16_t __reint1_836 = __noswap_vget_lane_s16(*(int16x4_t *) &__reint_836, __p1_836); \
66362 __ret_836 = *(float16_t *) &__reint1_836; \
66363 __ret_836; \
6469466364})
64695#define __noswap_vget_lane_f16(__p0_745, __p1_745) __extension__ ({ \
64696 float16x4_t __s0_745 = __p0_745; \
64697 float16_t __ret_745; \
64698float16x4_t __reint_745 = __s0_745; \
64699int16_t __reint1_745 = __noswap_vget_lane_s16(*(int16x4_t *) &__reint_745, __p1_745); \
64700 __ret_745 = *(float16_t *) &__reint1_745; \
64701 __ret_745; \
66365#define __noswap_vget_lane_f16(__p0_837, __p1_837) __extension__ ({ \
66366 float16x4_t __s0_837 = __p0_837; \
66367 float16_t __ret_837; \
66368float16x4_t __reint_837 = __s0_837; \
66369int16_t __reint1_837 = __noswap_vget_lane_s16(*(int16x4_t *) &__reint_837, __p1_837); \
66370 __ret_837 = *(float16_t *) &__reint1_837; \
66371 __ret_837; \
6470266372})
6470366373#endif
6470466374
6470566375#ifdef __LITTLE_ENDIAN__
64706#define vgetq_lane_f16(__p0_746, __p1_746) __extension__ ({ \
64707 float16x8_t __s0_746 = __p0_746; \
64708 float16_t __ret_746; \
64709float16x8_t __reint_746 = __s0_746; \
64710int16_t __reint1_746 = vgetq_lane_s16(*(int16x8_t *) &__reint_746, __p1_746); \
64711 __ret_746 = *(float16_t *) &__reint1_746; \
64712 __ret_746; \
66376#define vgetq_lane_f16(__p0_838, __p1_838) __extension__ ({ \
66377 float16x8_t __s0_838 = __p0_838; \
66378 float16_t __ret_838; \
66379float16x8_t __reint_838 = __s0_838; \
66380int16_t __reint1_838 = vgetq_lane_s16(*(int16x8_t *) &__reint_838, __p1_838); \
66381 __ret_838 = *(float16_t *) &__reint1_838; \
66382 __ret_838; \
6471366383})
6471466384#else
64715#define vgetq_lane_f16(__p0_747, __p1_747) __extension__ ({ \
64716 float16x8_t __s0_747 = __p0_747; \
64717 float16x8_t __rev0_747; __rev0_747 = __builtin_shufflevector(__s0_747, __s0_747, 7, 6, 5, 4, 3, 2, 1, 0); \
64718 float16_t __ret_747; \
64719float16x8_t __reint_747 = __rev0_747; \
64720int16_t __reint1_747 = __noswap_vgetq_lane_s16(*(int16x8_t *) &__reint_747, __p1_747); \
64721 __ret_747 = *(float16_t *) &__reint1_747; \
64722 __ret_747; \
66385#define vgetq_lane_f16(__p0_839, __p1_839) __extension__ ({ \
66386 float16x8_t __s0_839 = __p0_839; \
66387 float16x8_t __rev0_839; __rev0_839 = __builtin_shufflevector(__s0_839, __s0_839, 7, 6, 5, 4, 3, 2, 1, 0); \
66388 float16_t __ret_839; \
66389float16x8_t __reint_839 = __rev0_839; \
66390int16_t __reint1_839 = __noswap_vgetq_lane_s16(*(int16x8_t *) &__reint_839, __p1_839); \
66391 __ret_839 = *(float16_t *) &__reint1_839; \
66392 __ret_839; \
6472366393})
64724#define __noswap_vgetq_lane_f16(__p0_748, __p1_748) __extension__ ({ \
64725 float16x8_t __s0_748 = __p0_748; \
64726 float16_t __ret_748; \
64727float16x8_t __reint_748 = __s0_748; \
64728int16_t __reint1_748 = __noswap_vgetq_lane_s16(*(int16x8_t *) &__reint_748, __p1_748); \
64729 __ret_748 = *(float16_t *) &__reint1_748; \
64730 __ret_748; \
66394#define __noswap_vgetq_lane_f16(__p0_840, __p1_840) __extension__ ({ \
66395 float16x8_t __s0_840 = __p0_840; \
66396 float16_t __ret_840; \
66397float16x8_t __reint_840 = __s0_840; \
66398int16_t __reint1_840 = __noswap_vgetq_lane_s16(*(int16x8_t *) &__reint_840, __p1_840); \
66399 __ret_840 = *(float16_t *) &__reint1_840; \
66400 __ret_840; \
6473166401})
6473266402#endif
6473366403
......@@ -64870,98 +66540,98 @@ __ai int32x4_t __noswap_vmlal_s16(int32x4_t __p0, int16x4_t __p1, int16x4_t __p2
6487066540#endif
6487166541
6487266542#ifdef __LITTLE_ENDIAN__
64873#define vmlal_lane_u32(__p0_749, __p1_749, __p2_749, __p3_749) __extension__ ({ \
64874 uint64x2_t __s0_749 = __p0_749; \
64875 uint32x2_t __s1_749 = __p1_749; \
64876 uint32x2_t __s2_749 = __p2_749; \
64877 uint64x2_t __ret_749; \
64878 __ret_749 = __s0_749 + vmull_u32(__s1_749, splat_lane_u32(__s2_749, __p3_749)); \
64879 __ret_749; \
66543#define vmlal_lane_u32(__p0_841, __p1_841, __p2_841, __p3_841) __extension__ ({ \
66544 uint64x2_t __s0_841 = __p0_841; \
66545 uint32x2_t __s1_841 = __p1_841; \
66546 uint32x2_t __s2_841 = __p2_841; \
66547 uint64x2_t __ret_841; \
66548 __ret_841 = __s0_841 + vmull_u32(__s1_841, splat_lane_u32(__s2_841, __p3_841)); \
66549 __ret_841; \
6488066550})
6488166551#else
64882#define vmlal_lane_u32(__p0_750, __p1_750, __p2_750, __p3_750) __extension__ ({ \
64883 uint64x2_t __s0_750 = __p0_750; \
64884 uint32x2_t __s1_750 = __p1_750; \
64885 uint32x2_t __s2_750 = __p2_750; \
64886 uint64x2_t __rev0_750; __rev0_750 = __builtin_shufflevector(__s0_750, __s0_750, 1, 0); \
64887 uint32x2_t __rev1_750; __rev1_750 = __builtin_shufflevector(__s1_750, __s1_750, 1, 0); \
64888 uint32x2_t __rev2_750; __rev2_750 = __builtin_shufflevector(__s2_750, __s2_750, 1, 0); \
64889 uint64x2_t __ret_750; \
64890 __ret_750 = __rev0_750 + __noswap_vmull_u32(__rev1_750, __noswap_splat_lane_u32(__rev2_750, __p3_750)); \
64891 __ret_750 = __builtin_shufflevector(__ret_750, __ret_750, 1, 0); \
64892 __ret_750; \
66552#define vmlal_lane_u32(__p0_842, __p1_842, __p2_842, __p3_842) __extension__ ({ \
66553 uint64x2_t __s0_842 = __p0_842; \
66554 uint32x2_t __s1_842 = __p1_842; \
66555 uint32x2_t __s2_842 = __p2_842; \
66556 uint64x2_t __rev0_842; __rev0_842 = __builtin_shufflevector(__s0_842, __s0_842, 1, 0); \
66557 uint32x2_t __rev1_842; __rev1_842 = __builtin_shufflevector(__s1_842, __s1_842, 1, 0); \
66558 uint32x2_t __rev2_842; __rev2_842 = __builtin_shufflevector(__s2_842, __s2_842, 1, 0); \
66559 uint64x2_t __ret_842; \
66560 __ret_842 = __rev0_842 + __noswap_vmull_u32(__rev1_842, __noswap_splat_lane_u32(__rev2_842, __p3_842)); \
66561 __ret_842 = __builtin_shufflevector(__ret_842, __ret_842, 1, 0); \
66562 __ret_842; \
6489366563})
6489466564#endif
6489566565
6489666566#ifdef __LITTLE_ENDIAN__
64897#define vmlal_lane_u16(__p0_751, __p1_751, __p2_751, __p3_751) __extension__ ({ \
64898 uint32x4_t __s0_751 = __p0_751; \
64899 uint16x4_t __s1_751 = __p1_751; \
64900 uint16x4_t __s2_751 = __p2_751; \
64901 uint32x4_t __ret_751; \
64902 __ret_751 = __s0_751 + vmull_u16(__s1_751, splat_lane_u16(__s2_751, __p3_751)); \
64903 __ret_751; \
66567#define vmlal_lane_u16(__p0_843, __p1_843, __p2_843, __p3_843) __extension__ ({ \
66568 uint32x4_t __s0_843 = __p0_843; \
66569 uint16x4_t __s1_843 = __p1_843; \
66570 uint16x4_t __s2_843 = __p2_843; \
66571 uint32x4_t __ret_843; \
66572 __ret_843 = __s0_843 + vmull_u16(__s1_843, splat_lane_u16(__s2_843, __p3_843)); \
66573 __ret_843; \
6490466574})
6490566575#else
64906#define vmlal_lane_u16(__p0_752, __p1_752, __p2_752, __p3_752) __extension__ ({ \
64907 uint32x4_t __s0_752 = __p0_752; \
64908 uint16x4_t __s1_752 = __p1_752; \
64909 uint16x4_t __s2_752 = __p2_752; \
64910 uint32x4_t __rev0_752; __rev0_752 = __builtin_shufflevector(__s0_752, __s0_752, 3, 2, 1, 0); \
64911 uint16x4_t __rev1_752; __rev1_752 = __builtin_shufflevector(__s1_752, __s1_752, 3, 2, 1, 0); \
64912 uint16x4_t __rev2_752; __rev2_752 = __builtin_shufflevector(__s2_752, __s2_752, 3, 2, 1, 0); \
64913 uint32x4_t __ret_752; \
64914 __ret_752 = __rev0_752 + __noswap_vmull_u16(__rev1_752, __noswap_splat_lane_u16(__rev2_752, __p3_752)); \
64915 __ret_752 = __builtin_shufflevector(__ret_752, __ret_752, 3, 2, 1, 0); \
64916 __ret_752; \
66576#define vmlal_lane_u16(__p0_844, __p1_844, __p2_844, __p3_844) __extension__ ({ \
66577 uint32x4_t __s0_844 = __p0_844; \
66578 uint16x4_t __s1_844 = __p1_844; \
66579 uint16x4_t __s2_844 = __p2_844; \
66580 uint32x4_t __rev0_844; __rev0_844 = __builtin_shufflevector(__s0_844, __s0_844, 3, 2, 1, 0); \
66581 uint16x4_t __rev1_844; __rev1_844 = __builtin_shufflevector(__s1_844, __s1_844, 3, 2, 1, 0); \
66582 uint16x4_t __rev2_844; __rev2_844 = __builtin_shufflevector(__s2_844, __s2_844, 3, 2, 1, 0); \
66583 uint32x4_t __ret_844; \
66584 __ret_844 = __rev0_844 + __noswap_vmull_u16(__rev1_844, __noswap_splat_lane_u16(__rev2_844, __p3_844)); \
66585 __ret_844 = __builtin_shufflevector(__ret_844, __ret_844, 3, 2, 1, 0); \
66586 __ret_844; \
6491766587})
6491866588#endif
6491966589
6492066590#ifdef __LITTLE_ENDIAN__
64921#define vmlal_lane_s32(__p0_753, __p1_753, __p2_753, __p3_753) __extension__ ({ \
64922 int64x2_t __s0_753 = __p0_753; \
64923 int32x2_t __s1_753 = __p1_753; \
64924 int32x2_t __s2_753 = __p2_753; \
64925 int64x2_t __ret_753; \
64926 __ret_753 = __s0_753 + vmull_s32(__s1_753, splat_lane_s32(__s2_753, __p3_753)); \
64927 __ret_753; \
66591#define vmlal_lane_s32(__p0_845, __p1_845, __p2_845, __p3_845) __extension__ ({ \
66592 int64x2_t __s0_845 = __p0_845; \
66593 int32x2_t __s1_845 = __p1_845; \
66594 int32x2_t __s2_845 = __p2_845; \
66595 int64x2_t __ret_845; \
66596 __ret_845 = __s0_845 + vmull_s32(__s1_845, splat_lane_s32(__s2_845, __p3_845)); \
66597 __ret_845; \
6492866598})
6492966599#else
64930#define vmlal_lane_s32(__p0_754, __p1_754, __p2_754, __p3_754) __extension__ ({ \
64931 int64x2_t __s0_754 = __p0_754; \
64932 int32x2_t __s1_754 = __p1_754; \
64933 int32x2_t __s2_754 = __p2_754; \
64934 int64x2_t __rev0_754; __rev0_754 = __builtin_shufflevector(__s0_754, __s0_754, 1, 0); \
64935 int32x2_t __rev1_754; __rev1_754 = __builtin_shufflevector(__s1_754, __s1_754, 1, 0); \
64936 int32x2_t __rev2_754; __rev2_754 = __builtin_shufflevector(__s2_754, __s2_754, 1, 0); \
64937 int64x2_t __ret_754; \
64938 __ret_754 = __rev0_754 + __noswap_vmull_s32(__rev1_754, __noswap_splat_lane_s32(__rev2_754, __p3_754)); \
64939 __ret_754 = __builtin_shufflevector(__ret_754, __ret_754, 1, 0); \
64940 __ret_754; \
66600#define vmlal_lane_s32(__p0_846, __p1_846, __p2_846, __p3_846) __extension__ ({ \
66601 int64x2_t __s0_846 = __p0_846; \
66602 int32x2_t __s1_846 = __p1_846; \
66603 int32x2_t __s2_846 = __p2_846; \
66604 int64x2_t __rev0_846; __rev0_846 = __builtin_shufflevector(__s0_846, __s0_846, 1, 0); \
66605 int32x2_t __rev1_846; __rev1_846 = __builtin_shufflevector(__s1_846, __s1_846, 1, 0); \
66606 int32x2_t __rev2_846; __rev2_846 = __builtin_shufflevector(__s2_846, __s2_846, 1, 0); \
66607 int64x2_t __ret_846; \
66608 __ret_846 = __rev0_846 + __noswap_vmull_s32(__rev1_846, __noswap_splat_lane_s32(__rev2_846, __p3_846)); \
66609 __ret_846 = __builtin_shufflevector(__ret_846, __ret_846, 1, 0); \
66610 __ret_846; \
6494166611})
6494266612#endif
6494366613
6494466614#ifdef __LITTLE_ENDIAN__
64945#define vmlal_lane_s16(__p0_755, __p1_755, __p2_755, __p3_755) __extension__ ({ \
64946 int32x4_t __s0_755 = __p0_755; \
64947 int16x4_t __s1_755 = __p1_755; \
64948 int16x4_t __s2_755 = __p2_755; \
64949 int32x4_t __ret_755; \
64950 __ret_755 = __s0_755 + vmull_s16(__s1_755, splat_lane_s16(__s2_755, __p3_755)); \
64951 __ret_755; \
66615#define vmlal_lane_s16(__p0_847, __p1_847, __p2_847, __p3_847) __extension__ ({ \
66616 int32x4_t __s0_847 = __p0_847; \
66617 int16x4_t __s1_847 = __p1_847; \
66618 int16x4_t __s2_847 = __p2_847; \
66619 int32x4_t __ret_847; \
66620 __ret_847 = __s0_847 + vmull_s16(__s1_847, splat_lane_s16(__s2_847, __p3_847)); \
66621 __ret_847; \
6495266622})
6495366623#else
64954#define vmlal_lane_s16(__p0_756, __p1_756, __p2_756, __p3_756) __extension__ ({ \
64955 int32x4_t __s0_756 = __p0_756; \
64956 int16x4_t __s1_756 = __p1_756; \
64957 int16x4_t __s2_756 = __p2_756; \
64958 int32x4_t __rev0_756; __rev0_756 = __builtin_shufflevector(__s0_756, __s0_756, 3, 2, 1, 0); \
64959 int16x4_t __rev1_756; __rev1_756 = __builtin_shufflevector(__s1_756, __s1_756, 3, 2, 1, 0); \
64960 int16x4_t __rev2_756; __rev2_756 = __builtin_shufflevector(__s2_756, __s2_756, 3, 2, 1, 0); \
64961 int32x4_t __ret_756; \
64962 __ret_756 = __rev0_756 + __noswap_vmull_s16(__rev1_756, __noswap_splat_lane_s16(__rev2_756, __p3_756)); \
64963 __ret_756 = __builtin_shufflevector(__ret_756, __ret_756, 3, 2, 1, 0); \
64964 __ret_756; \
66624#define vmlal_lane_s16(__p0_848, __p1_848, __p2_848, __p3_848) __extension__ ({ \
66625 int32x4_t __s0_848 = __p0_848; \
66626 int16x4_t __s1_848 = __p1_848; \
66627 int16x4_t __s2_848 = __p2_848; \
66628 int32x4_t __rev0_848; __rev0_848 = __builtin_shufflevector(__s0_848, __s0_848, 3, 2, 1, 0); \
66629 int16x4_t __rev1_848; __rev1_848 = __builtin_shufflevector(__s1_848, __s1_848, 3, 2, 1, 0); \
66630 int16x4_t __rev2_848; __rev2_848 = __builtin_shufflevector(__s2_848, __s2_848, 3, 2, 1, 0); \
66631 int32x4_t __ret_848; \
66632 __ret_848 = __rev0_848 + __noswap_vmull_s16(__rev1_848, __noswap_splat_lane_s16(__rev2_848, __p3_848)); \
66633 __ret_848 = __builtin_shufflevector(__ret_848, __ret_848, 3, 2, 1, 0); \
66634 __ret_848; \
6496566635})
6496666636#endif
6496766637
......@@ -65192,98 +66862,98 @@ __ai int32x4_t __noswap_vmlsl_s16(int32x4_t __p0, int16x4_t __p1, int16x4_t __p2
6519266862#endif
6519366863
6519466864#ifdef __LITTLE_ENDIAN__
65195#define vmlsl_lane_u32(__p0_757, __p1_757, __p2_757, __p3_757) __extension__ ({ \
65196 uint64x2_t __s0_757 = __p0_757; \
65197 uint32x2_t __s1_757 = __p1_757; \
65198 uint32x2_t __s2_757 = __p2_757; \
65199 uint64x2_t __ret_757; \
65200 __ret_757 = __s0_757 - vmull_u32(__s1_757, splat_lane_u32(__s2_757, __p3_757)); \
65201 __ret_757; \
66865#define vmlsl_lane_u32(__p0_849, __p1_849, __p2_849, __p3_849) __extension__ ({ \
66866 uint64x2_t __s0_849 = __p0_849; \
66867 uint32x2_t __s1_849 = __p1_849; \
66868 uint32x2_t __s2_849 = __p2_849; \
66869 uint64x2_t __ret_849; \
66870 __ret_849 = __s0_849 - vmull_u32(__s1_849, splat_lane_u32(__s2_849, __p3_849)); \
66871 __ret_849; \
6520266872})
6520366873#else
65204#define vmlsl_lane_u32(__p0_758, __p1_758, __p2_758, __p3_758) __extension__ ({ \
65205 uint64x2_t __s0_758 = __p0_758; \
65206 uint32x2_t __s1_758 = __p1_758; \
65207 uint32x2_t __s2_758 = __p2_758; \
65208 uint64x2_t __rev0_758; __rev0_758 = __builtin_shufflevector(__s0_758, __s0_758, 1, 0); \
65209 uint32x2_t __rev1_758; __rev1_758 = __builtin_shufflevector(__s1_758, __s1_758, 1, 0); \
65210 uint32x2_t __rev2_758; __rev2_758 = __builtin_shufflevector(__s2_758, __s2_758, 1, 0); \
65211 uint64x2_t __ret_758; \
65212 __ret_758 = __rev0_758 - __noswap_vmull_u32(__rev1_758, __noswap_splat_lane_u32(__rev2_758, __p3_758)); \
65213 __ret_758 = __builtin_shufflevector(__ret_758, __ret_758, 1, 0); \
65214 __ret_758; \
66874#define vmlsl_lane_u32(__p0_850, __p1_850, __p2_850, __p3_850) __extension__ ({ \
66875 uint64x2_t __s0_850 = __p0_850; \
66876 uint32x2_t __s1_850 = __p1_850; \
66877 uint32x2_t __s2_850 = __p2_850; \
66878 uint64x2_t __rev0_850; __rev0_850 = __builtin_shufflevector(__s0_850, __s0_850, 1, 0); \
66879 uint32x2_t __rev1_850; __rev1_850 = __builtin_shufflevector(__s1_850, __s1_850, 1, 0); \
66880 uint32x2_t __rev2_850; __rev2_850 = __builtin_shufflevector(__s2_850, __s2_850, 1, 0); \
66881 uint64x2_t __ret_850; \
66882 __ret_850 = __rev0_850 - __noswap_vmull_u32(__rev1_850, __noswap_splat_lane_u32(__rev2_850, __p3_850)); \
66883 __ret_850 = __builtin_shufflevector(__ret_850, __ret_850, 1, 0); \
66884 __ret_850; \
6521566885})
6521666886#endif
6521766887
6521866888#ifdef __LITTLE_ENDIAN__
65219#define vmlsl_lane_u16(__p0_759, __p1_759, __p2_759, __p3_759) __extension__ ({ \
65220 uint32x4_t __s0_759 = __p0_759; \
65221 uint16x4_t __s1_759 = __p1_759; \
65222 uint16x4_t __s2_759 = __p2_759; \
65223 uint32x4_t __ret_759; \
65224 __ret_759 = __s0_759 - vmull_u16(__s1_759, splat_lane_u16(__s2_759, __p3_759)); \
65225 __ret_759; \
66889#define vmlsl_lane_u16(__p0_851, __p1_851, __p2_851, __p3_851) __extension__ ({ \
66890 uint32x4_t __s0_851 = __p0_851; \
66891 uint16x4_t __s1_851 = __p1_851; \
66892 uint16x4_t __s2_851 = __p2_851; \
66893 uint32x4_t __ret_851; \
66894 __ret_851 = __s0_851 - vmull_u16(__s1_851, splat_lane_u16(__s2_851, __p3_851)); \
66895 __ret_851; \
6522666896})
6522766897#else
65228#define vmlsl_lane_u16(__p0_760, __p1_760, __p2_760, __p3_760) __extension__ ({ \
65229 uint32x4_t __s0_760 = __p0_760; \
65230 uint16x4_t __s1_760 = __p1_760; \
65231 uint16x4_t __s2_760 = __p2_760; \
65232 uint32x4_t __rev0_760; __rev0_760 = __builtin_shufflevector(__s0_760, __s0_760, 3, 2, 1, 0); \
65233 uint16x4_t __rev1_760; __rev1_760 = __builtin_shufflevector(__s1_760, __s1_760, 3, 2, 1, 0); \
65234 uint16x4_t __rev2_760; __rev2_760 = __builtin_shufflevector(__s2_760, __s2_760, 3, 2, 1, 0); \
65235 uint32x4_t __ret_760; \
65236 __ret_760 = __rev0_760 - __noswap_vmull_u16(__rev1_760, __noswap_splat_lane_u16(__rev2_760, __p3_760)); \
65237 __ret_760 = __builtin_shufflevector(__ret_760, __ret_760, 3, 2, 1, 0); \
65238 __ret_760; \
66898#define vmlsl_lane_u16(__p0_852, __p1_852, __p2_852, __p3_852) __extension__ ({ \
66899 uint32x4_t __s0_852 = __p0_852; \
66900 uint16x4_t __s1_852 = __p1_852; \
66901 uint16x4_t __s2_852 = __p2_852; \
66902 uint32x4_t __rev0_852; __rev0_852 = __builtin_shufflevector(__s0_852, __s0_852, 3, 2, 1, 0); \
66903 uint16x4_t __rev1_852; __rev1_852 = __builtin_shufflevector(__s1_852, __s1_852, 3, 2, 1, 0); \
66904 uint16x4_t __rev2_852; __rev2_852 = __builtin_shufflevector(__s2_852, __s2_852, 3, 2, 1, 0); \
66905 uint32x4_t __ret_852; \
66906 __ret_852 = __rev0_852 - __noswap_vmull_u16(__rev1_852, __noswap_splat_lane_u16(__rev2_852, __p3_852)); \
66907 __ret_852 = __builtin_shufflevector(__ret_852, __ret_852, 3, 2, 1, 0); \
66908 __ret_852; \
6523966909})
6524066910#endif
6524166911
6524266912#ifdef __LITTLE_ENDIAN__
65243#define vmlsl_lane_s32(__p0_761, __p1_761, __p2_761, __p3_761) __extension__ ({ \
65244 int64x2_t __s0_761 = __p0_761; \
65245 int32x2_t __s1_761 = __p1_761; \
65246 int32x2_t __s2_761 = __p2_761; \
65247 int64x2_t __ret_761; \
65248 __ret_761 = __s0_761 - vmull_s32(__s1_761, splat_lane_s32(__s2_761, __p3_761)); \
65249 __ret_761; \
66913#define vmlsl_lane_s32(__p0_853, __p1_853, __p2_853, __p3_853) __extension__ ({ \
66914 int64x2_t __s0_853 = __p0_853; \
66915 int32x2_t __s1_853 = __p1_853; \
66916 int32x2_t __s2_853 = __p2_853; \
66917 int64x2_t __ret_853; \
66918 __ret_853 = __s0_853 - vmull_s32(__s1_853, splat_lane_s32(__s2_853, __p3_853)); \
66919 __ret_853; \
6525066920})
6525166921#else
65252#define vmlsl_lane_s32(__p0_762, __p1_762, __p2_762, __p3_762) __extension__ ({ \
65253 int64x2_t __s0_762 = __p0_762; \
65254 int32x2_t __s1_762 = __p1_762; \
65255 int32x2_t __s2_762 = __p2_762; \
65256 int64x2_t __rev0_762; __rev0_762 = __builtin_shufflevector(__s0_762, __s0_762, 1, 0); \
65257 int32x2_t __rev1_762; __rev1_762 = __builtin_shufflevector(__s1_762, __s1_762, 1, 0); \
65258 int32x2_t __rev2_762; __rev2_762 = __builtin_shufflevector(__s2_762, __s2_762, 1, 0); \
65259 int64x2_t __ret_762; \
65260 __ret_762 = __rev0_762 - __noswap_vmull_s32(__rev1_762, __noswap_splat_lane_s32(__rev2_762, __p3_762)); \
65261 __ret_762 = __builtin_shufflevector(__ret_762, __ret_762, 1, 0); \
65262 __ret_762; \
66922#define vmlsl_lane_s32(__p0_854, __p1_854, __p2_854, __p3_854) __extension__ ({ \
66923 int64x2_t __s0_854 = __p0_854; \
66924 int32x2_t __s1_854 = __p1_854; \
66925 int32x2_t __s2_854 = __p2_854; \
66926 int64x2_t __rev0_854; __rev0_854 = __builtin_shufflevector(__s0_854, __s0_854, 1, 0); \
66927 int32x2_t __rev1_854; __rev1_854 = __builtin_shufflevector(__s1_854, __s1_854, 1, 0); \
66928 int32x2_t __rev2_854; __rev2_854 = __builtin_shufflevector(__s2_854, __s2_854, 1, 0); \
66929 int64x2_t __ret_854; \
66930 __ret_854 = __rev0_854 - __noswap_vmull_s32(__rev1_854, __noswap_splat_lane_s32(__rev2_854, __p3_854)); \
66931 __ret_854 = __builtin_shufflevector(__ret_854, __ret_854, 1, 0); \
66932 __ret_854; \
6526366933})
6526466934#endif
6526566935
6526666936#ifdef __LITTLE_ENDIAN__
65267#define vmlsl_lane_s16(__p0_763, __p1_763, __p2_763, __p3_763) __extension__ ({ \
65268 int32x4_t __s0_763 = __p0_763; \
65269 int16x4_t __s1_763 = __p1_763; \
65270 int16x4_t __s2_763 = __p2_763; \
65271 int32x4_t __ret_763; \
65272 __ret_763 = __s0_763 - vmull_s16(__s1_763, splat_lane_s16(__s2_763, __p3_763)); \
65273 __ret_763; \
66937#define vmlsl_lane_s16(__p0_855, __p1_855, __p2_855, __p3_855) __extension__ ({ \
66938 int32x4_t __s0_855 = __p0_855; \
66939 int16x4_t __s1_855 = __p1_855; \
66940 int16x4_t __s2_855 = __p2_855; \
66941 int32x4_t __ret_855; \
66942 __ret_855 = __s0_855 - vmull_s16(__s1_855, splat_lane_s16(__s2_855, __p3_855)); \
66943 __ret_855; \
6527466944})
6527566945#else
65276#define vmlsl_lane_s16(__p0_764, __p1_764, __p2_764, __p3_764) __extension__ ({ \
65277 int32x4_t __s0_764 = __p0_764; \
65278 int16x4_t __s1_764 = __p1_764; \
65279 int16x4_t __s2_764 = __p2_764; \
65280 int32x4_t __rev0_764; __rev0_764 = __builtin_shufflevector(__s0_764, __s0_764, 3, 2, 1, 0); \
65281 int16x4_t __rev1_764; __rev1_764 = __builtin_shufflevector(__s1_764, __s1_764, 3, 2, 1, 0); \
65282 int16x4_t __rev2_764; __rev2_764 = __builtin_shufflevector(__s2_764, __s2_764, 3, 2, 1, 0); \
65283 int32x4_t __ret_764; \
65284 __ret_764 = __rev0_764 - __noswap_vmull_s16(__rev1_764, __noswap_splat_lane_s16(__rev2_764, __p3_764)); \
65285 __ret_764 = __builtin_shufflevector(__ret_764, __ret_764, 3, 2, 1, 0); \
65286 __ret_764; \
66946#define vmlsl_lane_s16(__p0_856, __p1_856, __p2_856, __p3_856) __extension__ ({ \
66947 int32x4_t __s0_856 = __p0_856; \
66948 int16x4_t __s1_856 = __p1_856; \
66949 int16x4_t __s2_856 = __p2_856; \
66950 int32x4_t __rev0_856; __rev0_856 = __builtin_shufflevector(__s0_856, __s0_856, 3, 2, 1, 0); \
66951 int16x4_t __rev1_856; __rev1_856 = __builtin_shufflevector(__s1_856, __s1_856, 3, 2, 1, 0); \
66952 int16x4_t __rev2_856; __rev2_856 = __builtin_shufflevector(__s2_856, __s2_856, 3, 2, 1, 0); \
66953 int32x4_t __ret_856; \
66954 __ret_856 = __rev0_856 - __noswap_vmull_s16(__rev1_856, __noswap_splat_lane_s16(__rev2_856, __p3_856)); \
66955 __ret_856 = __builtin_shufflevector(__ret_856, __ret_856, 3, 2, 1, 0); \
66956 __ret_856; \
6528766957})
6528866958#endif
6528966959
......@@ -65376,151 +67046,151 @@ __ai int32x4_t __noswap_vmlsl_n_s16(int32x4_t __p0, int16x4_t __p1, int16_t __p2
6537667046#endif
6537767047
6537867048#ifdef __LITTLE_ENDIAN__
65379#define vset_lane_f16(__p0_765, __p1_765, __p2_765) __extension__ ({ \
65380 float16_t __s0_765 = __p0_765; \
65381 float16x4_t __s1_765 = __p1_765; \
65382 float16x4_t __ret_765; \
65383float16_t __reint_765 = __s0_765; \
65384float16x4_t __reint1_765 = __s1_765; \
65385int16x4_t __reint2_765 = vset_lane_s16(*(int16_t *) &__reint_765, *(int16x4_t *) &__reint1_765, __p2_765); \
65386 __ret_765 = *(float16x4_t *) &__reint2_765; \
65387 __ret_765; \
67049#define vset_lane_f16(__p0_857, __p1_857, __p2_857) __extension__ ({ \
67050 float16_t __s0_857 = __p0_857; \
67051 float16x4_t __s1_857 = __p1_857; \
67052 float16x4_t __ret_857; \
67053float16_t __reint_857 = __s0_857; \
67054float16x4_t __reint1_857 = __s1_857; \
67055int16x4_t __reint2_857 = vset_lane_s16(*(int16_t *) &__reint_857, *(int16x4_t *) &__reint1_857, __p2_857); \
67056 __ret_857 = *(float16x4_t *) &__reint2_857; \
67057 __ret_857; \
6538867058})
6538967059#else
65390#define vset_lane_f16(__p0_766, __p1_766, __p2_766) __extension__ ({ \
65391 float16_t __s0_766 = __p0_766; \
65392 float16x4_t __s1_766 = __p1_766; \
65393 float16x4_t __rev1_766; __rev1_766 = __builtin_shufflevector(__s1_766, __s1_766, 3, 2, 1, 0); \
65394 float16x4_t __ret_766; \
65395float16_t __reint_766 = __s0_766; \
65396float16x4_t __reint1_766 = __rev1_766; \
65397int16x4_t __reint2_766 = __noswap_vset_lane_s16(*(int16_t *) &__reint_766, *(int16x4_t *) &__reint1_766, __p2_766); \
65398 __ret_766 = *(float16x4_t *) &__reint2_766; \
65399 __ret_766 = __builtin_shufflevector(__ret_766, __ret_766, 3, 2, 1, 0); \
65400 __ret_766; \
67060#define vset_lane_f16(__p0_858, __p1_858, __p2_858) __extension__ ({ \
67061 float16_t __s0_858 = __p0_858; \
67062 float16x4_t __s1_858 = __p1_858; \
67063 float16x4_t __rev1_858; __rev1_858 = __builtin_shufflevector(__s1_858, __s1_858, 3, 2, 1, 0); \
67064 float16x4_t __ret_858; \
67065float16_t __reint_858 = __s0_858; \
67066float16x4_t __reint1_858 = __rev1_858; \
67067int16x4_t __reint2_858 = __noswap_vset_lane_s16(*(int16_t *) &__reint_858, *(int16x4_t *) &__reint1_858, __p2_858); \
67068 __ret_858 = *(float16x4_t *) &__reint2_858; \
67069 __ret_858 = __builtin_shufflevector(__ret_858, __ret_858, 3, 2, 1, 0); \
67070 __ret_858; \
6540167071})
6540267072#endif
6540367073
6540467074#ifdef __LITTLE_ENDIAN__
65405#define vsetq_lane_f16(__p0_767, __p1_767, __p2_767) __extension__ ({ \
65406 float16_t __s0_767 = __p0_767; \
65407 float16x8_t __s1_767 = __p1_767; \
65408 float16x8_t __ret_767; \
65409float16_t __reint_767 = __s0_767; \
65410float16x8_t __reint1_767 = __s1_767; \
65411int16x8_t __reint2_767 = vsetq_lane_s16(*(int16_t *) &__reint_767, *(int16x8_t *) &__reint1_767, __p2_767); \
65412 __ret_767 = *(float16x8_t *) &__reint2_767; \
65413 __ret_767; \
67075#define vsetq_lane_f16(__p0_859, __p1_859, __p2_859) __extension__ ({ \
67076 float16_t __s0_859 = __p0_859; \
67077 float16x8_t __s1_859 = __p1_859; \
67078 float16x8_t __ret_859; \
67079float16_t __reint_859 = __s0_859; \
67080float16x8_t __reint1_859 = __s1_859; \
67081int16x8_t __reint2_859 = vsetq_lane_s16(*(int16_t *) &__reint_859, *(int16x8_t *) &__reint1_859, __p2_859); \
67082 __ret_859 = *(float16x8_t *) &__reint2_859; \
67083 __ret_859; \
6541467084})
6541567085#else
65416#define vsetq_lane_f16(__p0_768, __p1_768, __p2_768) __extension__ ({ \
65417 float16_t __s0_768 = __p0_768; \
65418 float16x8_t __s1_768 = __p1_768; \
65419 float16x8_t __rev1_768; __rev1_768 = __builtin_shufflevector(__s1_768, __s1_768, 7, 6, 5, 4, 3, 2, 1, 0); \
65420 float16x8_t __ret_768; \
65421float16_t __reint_768 = __s0_768; \
65422float16x8_t __reint1_768 = __rev1_768; \
65423int16x8_t __reint2_768 = __noswap_vsetq_lane_s16(*(int16_t *) &__reint_768, *(int16x8_t *) &__reint1_768, __p2_768); \
65424 __ret_768 = *(float16x8_t *) &__reint2_768; \
65425 __ret_768 = __builtin_shufflevector(__ret_768, __ret_768, 7, 6, 5, 4, 3, 2, 1, 0); \
65426 __ret_768; \
67086#define vsetq_lane_f16(__p0_860, __p1_860, __p2_860) __extension__ ({ \
67087 float16_t __s0_860 = __p0_860; \
67088 float16x8_t __s1_860 = __p1_860; \
67089 float16x8_t __rev1_860; __rev1_860 = __builtin_shufflevector(__s1_860, __s1_860, 7, 6, 5, 4, 3, 2, 1, 0); \
67090 float16x8_t __ret_860; \
67091float16_t __reint_860 = __s0_860; \
67092float16x8_t __reint1_860 = __rev1_860; \
67093int16x8_t __reint2_860 = __noswap_vsetq_lane_s16(*(int16_t *) &__reint_860, *(int16x8_t *) &__reint1_860, __p2_860); \
67094 __ret_860 = *(float16x8_t *) &__reint2_860; \
67095 __ret_860 = __builtin_shufflevector(__ret_860, __ret_860, 7, 6, 5, 4, 3, 2, 1, 0); \
67096 __ret_860; \
6542767097})
6542867098#endif
6542967099
6543067100#if defined(__ARM_FEATURE_BF16_VECTOR_ARITHMETIC)
6543167101#ifdef __LITTLE_ENDIAN__
65432#define vbfmlalbq_lane_f32(__p0_769, __p1_769, __p2_769, __p3_769) __extension__ ({ \
65433 float32x4_t __s0_769 = __p0_769; \
65434 bfloat16x8_t __s1_769 = __p1_769; \
65435 bfloat16x4_t __s2_769 = __p2_769; \
65436 float32x4_t __ret_769; \
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)}); \
65438 __ret_769; \
67102#define vbfmlalbq_lane_f32(__p0_861, __p1_861, __p2_861, __p3_861) __extension__ ({ \
67103 float32x4_t __s0_861 = __p0_861; \
67104 bfloat16x8_t __s1_861 = __p1_861; \
67105 bfloat16x4_t __s2_861 = __p2_861; \
67106 float32x4_t __ret_861; \
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)}); \
67108 __ret_861; \
6543967109})
6544067110#else
65441#define vbfmlalbq_lane_f32(__p0_770, __p1_770, __p2_770, __p3_770) __extension__ ({ \
65442 float32x4_t __s0_770 = __p0_770; \
65443 bfloat16x8_t __s1_770 = __p1_770; \
65444 bfloat16x4_t __s2_770 = __p2_770; \
65445 float32x4_t __rev0_770; __rev0_770 = __builtin_shufflevector(__s0_770, __s0_770, 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); \
65447 bfloat16x4_t __rev2_770; __rev2_770 = __builtin_shufflevector(__s2_770, __s2_770, 3, 2, 1, 0); \
65448 float32x4_t __ret_770; \
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)}); \
65450 __ret_770 = __builtin_shufflevector(__ret_770, __ret_770, 3, 2, 1, 0); \
65451 __ret_770; \
67111#define vbfmlalbq_lane_f32(__p0_862, __p1_862, __p2_862, __p3_862) __extension__ ({ \
67112 float32x4_t __s0_862 = __p0_862; \
67113 bfloat16x8_t __s1_862 = __p1_862; \
67114 bfloat16x4_t __s2_862 = __p2_862; \
67115 float32x4_t __rev0_862; __rev0_862 = __builtin_shufflevector(__s0_862, __s0_862, 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); \
67117 bfloat16x4_t __rev2_862; __rev2_862 = __builtin_shufflevector(__s2_862, __s2_862, 3, 2, 1, 0); \
67118 float32x4_t __ret_862; \
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)}); \
67120 __ret_862 = __builtin_shufflevector(__ret_862, __ret_862, 3, 2, 1, 0); \
67121 __ret_862; \
6545267122})
6545367123#endif
6545467124
6545567125#ifdef __LITTLE_ENDIAN__
65456#define vbfmlalbq_laneq_f32(__p0_771, __p1_771, __p2_771, __p3_771) __extension__ ({ \
65457 float32x4_t __s0_771 = __p0_771; \
65458 bfloat16x8_t __s1_771 = __p1_771; \
65459 bfloat16x8_t __s2_771 = __p2_771; \
65460 float32x4_t __ret_771; \
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)}); \
65462 __ret_771; \
67126#define vbfmlalbq_laneq_f32(__p0_863, __p1_863, __p2_863, __p3_863) __extension__ ({ \
67127 float32x4_t __s0_863 = __p0_863; \
67128 bfloat16x8_t __s1_863 = __p1_863; \
67129 bfloat16x8_t __s2_863 = __p2_863; \
67130 float32x4_t __ret_863; \
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)}); \
67132 __ret_863; \
6546367133})
6546467134#else
65465#define vbfmlalbq_laneq_f32(__p0_772, __p1_772, __p2_772, __p3_772) __extension__ ({ \
65466 float32x4_t __s0_772 = __p0_772; \
65467 bfloat16x8_t __s1_772 = __p1_772; \
65468 bfloat16x8_t __s2_772 = __p2_772; \
65469 float32x4_t __rev0_772; __rev0_772 = __builtin_shufflevector(__s0_772, __s0_772, 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); \
65471 bfloat16x8_t __rev2_772; __rev2_772 = __builtin_shufflevector(__s2_772, __s2_772, 7, 6, 5, 4, 3, 2, 1, 0); \
65472 float32x4_t __ret_772; \
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)}); \
65474 __ret_772 = __builtin_shufflevector(__ret_772, __ret_772, 3, 2, 1, 0); \
65475 __ret_772; \
67135#define vbfmlalbq_laneq_f32(__p0_864, __p1_864, __p2_864, __p3_864) __extension__ ({ \
67136 float32x4_t __s0_864 = __p0_864; \
67137 bfloat16x8_t __s1_864 = __p1_864; \
67138 bfloat16x8_t __s2_864 = __p2_864; \
67139 float32x4_t __rev0_864; __rev0_864 = __builtin_shufflevector(__s0_864, __s0_864, 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); \
67141 bfloat16x8_t __rev2_864; __rev2_864 = __builtin_shufflevector(__s2_864, __s2_864, 7, 6, 5, 4, 3, 2, 1, 0); \
67142 float32x4_t __ret_864; \
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)}); \
67144 __ret_864 = __builtin_shufflevector(__ret_864, __ret_864, 3, 2, 1, 0); \
67145 __ret_864; \
6547667146})
6547767147#endif
6547867148
6547967149#ifdef __LITTLE_ENDIAN__
65480#define vbfmlaltq_lane_f32(__p0_773, __p1_773, __p2_773, __p3_773) __extension__ ({ \
65481 float32x4_t __s0_773 = __p0_773; \
65482 bfloat16x8_t __s1_773 = __p1_773; \
65483 bfloat16x4_t __s2_773 = __p2_773; \
65484 float32x4_t __ret_773; \
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)}); \
65486 __ret_773; \
67150#define vbfmlaltq_lane_f32(__p0_865, __p1_865, __p2_865, __p3_865) __extension__ ({ \
67151 float32x4_t __s0_865 = __p0_865; \
67152 bfloat16x8_t __s1_865 = __p1_865; \
67153 bfloat16x4_t __s2_865 = __p2_865; \
67154 float32x4_t __ret_865; \
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)}); \
67156 __ret_865; \
6548767157})
6548867158#else
65489#define vbfmlaltq_lane_f32(__p0_774, __p1_774, __p2_774, __p3_774) __extension__ ({ \
65490 float32x4_t __s0_774 = __p0_774; \
65491 bfloat16x8_t __s1_774 = __p1_774; \
65492 bfloat16x4_t __s2_774 = __p2_774; \
65493 float32x4_t __rev0_774; __rev0_774 = __builtin_shufflevector(__s0_774, __s0_774, 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); \
65495 bfloat16x4_t __rev2_774; __rev2_774 = __builtin_shufflevector(__s2_774, __s2_774, 3, 2, 1, 0); \
65496 float32x4_t __ret_774; \
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)}); \
65498 __ret_774 = __builtin_shufflevector(__ret_774, __ret_774, 3, 2, 1, 0); \
65499 __ret_774; \
67159#define vbfmlaltq_lane_f32(__p0_866, __p1_866, __p2_866, __p3_866) __extension__ ({ \
67160 float32x4_t __s0_866 = __p0_866; \
67161 bfloat16x8_t __s1_866 = __p1_866; \
67162 bfloat16x4_t __s2_866 = __p2_866; \
67163 float32x4_t __rev0_866; __rev0_866 = __builtin_shufflevector(__s0_866, __s0_866, 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); \
67165 bfloat16x4_t __rev2_866; __rev2_866 = __builtin_shufflevector(__s2_866, __s2_866, 3, 2, 1, 0); \
67166 float32x4_t __ret_866; \
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)}); \
67168 __ret_866 = __builtin_shufflevector(__ret_866, __ret_866, 3, 2, 1, 0); \
67169 __ret_866; \
6550067170})
6550167171#endif
6550267172
6550367173#ifdef __LITTLE_ENDIAN__
65504#define vbfmlaltq_laneq_f32(__p0_775, __p1_775, __p2_775, __p3_775) __extension__ ({ \
65505 float32x4_t __s0_775 = __p0_775; \
65506 bfloat16x8_t __s1_775 = __p1_775; \
65507 bfloat16x8_t __s2_775 = __p2_775; \
65508 float32x4_t __ret_775; \
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)}); \
65510 __ret_775; \
67174#define vbfmlaltq_laneq_f32(__p0_867, __p1_867, __p2_867, __p3_867) __extension__ ({ \
67175 float32x4_t __s0_867 = __p0_867; \
67176 bfloat16x8_t __s1_867 = __p1_867; \
67177 bfloat16x8_t __s2_867 = __p2_867; \
67178 float32x4_t __ret_867; \
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)}); \
67180 __ret_867; \
6551167181})
6551267182#else
65513#define vbfmlaltq_laneq_f32(__p0_776, __p1_776, __p2_776, __p3_776) __extension__ ({ \
65514 float32x4_t __s0_776 = __p0_776; \
65515 bfloat16x8_t __s1_776 = __p1_776; \
65516 bfloat16x8_t __s2_776 = __p2_776; \
65517 float32x4_t __rev0_776; __rev0_776 = __builtin_shufflevector(__s0_776, __s0_776, 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); \
65519 bfloat16x8_t __rev2_776; __rev2_776 = __builtin_shufflevector(__s2_776, __s2_776, 7, 6, 5, 4, 3, 2, 1, 0); \
65520 float32x4_t __ret_776; \
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)}); \
65522 __ret_776 = __builtin_shufflevector(__ret_776, __ret_776, 3, 2, 1, 0); \
65523 __ret_776; \
67183#define vbfmlaltq_laneq_f32(__p0_868, __p1_868, __p2_868, __p3_868) __extension__ ({ \
67184 float32x4_t __s0_868 = __p0_868; \
67185 bfloat16x8_t __s1_868 = __p1_868; \
67186 bfloat16x8_t __s2_868 = __p2_868; \
67187 float32x4_t __rev0_868; __rev0_868 = __builtin_shufflevector(__s0_868, __s0_868, 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); \
67189 bfloat16x8_t __rev2_868; __rev2_868 = __builtin_shufflevector(__s2_868, __s2_868, 7, 6, 5, 4, 3, 2, 1, 0); \
67190 float32x4_t __ret_868; \
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)}); \
67192 __ret_868 = __builtin_shufflevector(__ret_868, __ret_868, 3, 2, 1, 0); \
67193 __ret_868; \
6552467194})
6552567195#endif
6552667196
......@@ -65559,480 +67229,480 @@ __ai float32x4_t vcvtq_low_f32_bf16(bfloat16x8_t __p0) {
6555967229#endif
6556067230#if defined(__ARM_FEATURE_FP16FML) && defined(__aarch64__)
6556167231#ifdef __LITTLE_ENDIAN__
65562#define vfmlalq_lane_high_f16(__p0_777, __p1_777, __p2_777, __p3_777) __extension__ ({ \
65563 float32x4_t __s0_777 = __p0_777; \
65564 float16x8_t __s1_777 = __p1_777; \
65565 float16x4_t __s2_777 = __p2_777; \
65566 float32x4_t __ret_777; \
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)}); \
65568 __ret_777; \
67232#define vfmlalq_lane_high_f16(__p0_869, __p1_869, __p2_869, __p3_869) __extension__ ({ \
67233 float32x4_t __s0_869 = __p0_869; \
67234 float16x8_t __s1_869 = __p1_869; \
67235 float16x4_t __s2_869 = __p2_869; \
67236 float32x4_t __ret_869; \
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)}); \
67238 __ret_869; \
6556967239})
6557067240#else
65571#define vfmlalq_lane_high_f16(__p0_778, __p1_778, __p2_778, __p3_778) __extension__ ({ \
65572 float32x4_t __s0_778 = __p0_778; \
65573 float16x8_t __s1_778 = __p1_778; \
65574 float16x4_t __s2_778 = __p2_778; \
65575 float32x4_t __rev0_778; __rev0_778 = __builtin_shufflevector(__s0_778, __s0_778, 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); \
65577 float16x4_t __rev2_778; __rev2_778 = __builtin_shufflevector(__s2_778, __s2_778, 3, 2, 1, 0); \
65578 float32x4_t __ret_778; \
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)}); \
65580 __ret_778 = __builtin_shufflevector(__ret_778, __ret_778, 3, 2, 1, 0); \
65581 __ret_778; \
67241#define vfmlalq_lane_high_f16(__p0_870, __p1_870, __p2_870, __p3_870) __extension__ ({ \
67242 float32x4_t __s0_870 = __p0_870; \
67243 float16x8_t __s1_870 = __p1_870; \
67244 float16x4_t __s2_870 = __p2_870; \
67245 float32x4_t __rev0_870; __rev0_870 = __builtin_shufflevector(__s0_870, __s0_870, 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); \
67247 float16x4_t __rev2_870; __rev2_870 = __builtin_shufflevector(__s2_870, __s2_870, 3, 2, 1, 0); \
67248 float32x4_t __ret_870; \
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)}); \
67250 __ret_870 = __builtin_shufflevector(__ret_870, __ret_870, 3, 2, 1, 0); \
67251 __ret_870; \
6558267252})
6558367253#endif
6558467254
6558567255#ifdef __LITTLE_ENDIAN__
65586#define vfmlal_lane_high_f16(__p0_779, __p1_779, __p2_779, __p3_779) __extension__ ({ \
65587 float32x2_t __s0_779 = __p0_779; \
65588 float16x4_t __s1_779 = __p1_779; \
65589 float16x4_t __s2_779 = __p2_779; \
65590 float32x2_t __ret_779; \
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)}); \
65592 __ret_779; \
67256#define vfmlal_lane_high_f16(__p0_871, __p1_871, __p2_871, __p3_871) __extension__ ({ \
67257 float32x2_t __s0_871 = __p0_871; \
67258 float16x4_t __s1_871 = __p1_871; \
67259 float16x4_t __s2_871 = __p2_871; \
67260 float32x2_t __ret_871; \
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)}); \
67262 __ret_871; \
6559367263})
6559467264#else
65595#define vfmlal_lane_high_f16(__p0_780, __p1_780, __p2_780, __p3_780) __extension__ ({ \
65596 float32x2_t __s0_780 = __p0_780; \
65597 float16x4_t __s1_780 = __p1_780; \
65598 float16x4_t __s2_780 = __p2_780; \
65599 float32x2_t __rev0_780; __rev0_780 = __builtin_shufflevector(__s0_780, __s0_780, 1, 0); \
65600 float16x4_t __rev1_780; __rev1_780 = __builtin_shufflevector(__s1_780, __s1_780, 3, 2, 1, 0); \
65601 float16x4_t __rev2_780; __rev2_780 = __builtin_shufflevector(__s2_780, __s2_780, 3, 2, 1, 0); \
65602 float32x2_t __ret_780; \
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)}); \
65604 __ret_780 = __builtin_shufflevector(__ret_780, __ret_780, 1, 0); \
65605 __ret_780; \
67265#define vfmlal_lane_high_f16(__p0_872, __p1_872, __p2_872, __p3_872) __extension__ ({ \
67266 float32x2_t __s0_872 = __p0_872; \
67267 float16x4_t __s1_872 = __p1_872; \
67268 float16x4_t __s2_872 = __p2_872; \
67269 float32x2_t __rev0_872; __rev0_872 = __builtin_shufflevector(__s0_872, __s0_872, 1, 0); \
67270 float16x4_t __rev1_872; __rev1_872 = __builtin_shufflevector(__s1_872, __s1_872, 3, 2, 1, 0); \
67271 float16x4_t __rev2_872; __rev2_872 = __builtin_shufflevector(__s2_872, __s2_872, 3, 2, 1, 0); \
67272 float32x2_t __ret_872; \
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)}); \
67274 __ret_872 = __builtin_shufflevector(__ret_872, __ret_872, 1, 0); \
67275 __ret_872; \
6560667276})
6560767277#endif
6560867278
6560967279#ifdef __LITTLE_ENDIAN__
65610#define vfmlalq_lane_low_f16(__p0_781, __p1_781, __p2_781, __p3_781) __extension__ ({ \
65611 float32x4_t __s0_781 = __p0_781; \
65612 float16x8_t __s1_781 = __p1_781; \
65613 float16x4_t __s2_781 = __p2_781; \
65614 float32x4_t __ret_781; \
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)}); \
65616 __ret_781; \
67280#define vfmlalq_lane_low_f16(__p0_873, __p1_873, __p2_873, __p3_873) __extension__ ({ \
67281 float32x4_t __s0_873 = __p0_873; \
67282 float16x8_t __s1_873 = __p1_873; \
67283 float16x4_t __s2_873 = __p2_873; \
67284 float32x4_t __ret_873; \
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)}); \
67286 __ret_873; \
6561767287})
6561867288#else
65619#define vfmlalq_lane_low_f16(__p0_782, __p1_782, __p2_782, __p3_782) __extension__ ({ \
65620 float32x4_t __s0_782 = __p0_782; \
65621 float16x8_t __s1_782 = __p1_782; \
65622 float16x4_t __s2_782 = __p2_782; \
65623 float32x4_t __rev0_782; __rev0_782 = __builtin_shufflevector(__s0_782, __s0_782, 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); \
65625 float16x4_t __rev2_782; __rev2_782 = __builtin_shufflevector(__s2_782, __s2_782, 3, 2, 1, 0); \
65626 float32x4_t __ret_782; \
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)}); \
65628 __ret_782 = __builtin_shufflevector(__ret_782, __ret_782, 3, 2, 1, 0); \
65629 __ret_782; \
67289#define vfmlalq_lane_low_f16(__p0_874, __p1_874, __p2_874, __p3_874) __extension__ ({ \
67290 float32x4_t __s0_874 = __p0_874; \
67291 float16x8_t __s1_874 = __p1_874; \
67292 float16x4_t __s2_874 = __p2_874; \
67293 float32x4_t __rev0_874; __rev0_874 = __builtin_shufflevector(__s0_874, __s0_874, 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); \
67295 float16x4_t __rev2_874; __rev2_874 = __builtin_shufflevector(__s2_874, __s2_874, 3, 2, 1, 0); \
67296 float32x4_t __ret_874; \
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)}); \
67298 __ret_874 = __builtin_shufflevector(__ret_874, __ret_874, 3, 2, 1, 0); \
67299 __ret_874; \
6563067300})
6563167301#endif
6563267302
6563367303#ifdef __LITTLE_ENDIAN__
65634#define vfmlal_lane_low_f16(__p0_783, __p1_783, __p2_783, __p3_783) __extension__ ({ \
65635 float32x2_t __s0_783 = __p0_783; \
65636 float16x4_t __s1_783 = __p1_783; \
65637 float16x4_t __s2_783 = __p2_783; \
65638 float32x2_t __ret_783; \
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)}); \
65640 __ret_783; \
67304#define vfmlal_lane_low_f16(__p0_875, __p1_875, __p2_875, __p3_875) __extension__ ({ \
67305 float32x2_t __s0_875 = __p0_875; \
67306 float16x4_t __s1_875 = __p1_875; \
67307 float16x4_t __s2_875 = __p2_875; \
67308 float32x2_t __ret_875; \
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)}); \
67310 __ret_875; \
6564167311})
6564267312#else
65643#define vfmlal_lane_low_f16(__p0_784, __p1_784, __p2_784, __p3_784) __extension__ ({ \
65644 float32x2_t __s0_784 = __p0_784; \
65645 float16x4_t __s1_784 = __p1_784; \
65646 float16x4_t __s2_784 = __p2_784; \
65647 float32x2_t __rev0_784; __rev0_784 = __builtin_shufflevector(__s0_784, __s0_784, 1, 0); \
65648 float16x4_t __rev1_784; __rev1_784 = __builtin_shufflevector(__s1_784, __s1_784, 3, 2, 1, 0); \
65649 float16x4_t __rev2_784; __rev2_784 = __builtin_shufflevector(__s2_784, __s2_784, 3, 2, 1, 0); \
65650 float32x2_t __ret_784; \
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)}); \
65652 __ret_784 = __builtin_shufflevector(__ret_784, __ret_784, 1, 0); \
65653 __ret_784; \
67313#define vfmlal_lane_low_f16(__p0_876, __p1_876, __p2_876, __p3_876) __extension__ ({ \
67314 float32x2_t __s0_876 = __p0_876; \
67315 float16x4_t __s1_876 = __p1_876; \
67316 float16x4_t __s2_876 = __p2_876; \
67317 float32x2_t __rev0_876; __rev0_876 = __builtin_shufflevector(__s0_876, __s0_876, 1, 0); \
67318 float16x4_t __rev1_876; __rev1_876 = __builtin_shufflevector(__s1_876, __s1_876, 3, 2, 1, 0); \
67319 float16x4_t __rev2_876; __rev2_876 = __builtin_shufflevector(__s2_876, __s2_876, 3, 2, 1, 0); \
67320 float32x2_t __ret_876; \
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)}); \
67322 __ret_876 = __builtin_shufflevector(__ret_876, __ret_876, 1, 0); \
67323 __ret_876; \
6565467324})
6565567325#endif
6565667326
6565767327#ifdef __LITTLE_ENDIAN__
65658#define vfmlalq_laneq_high_f16(__p0_785, __p1_785, __p2_785, __p3_785) __extension__ ({ \
65659 float32x4_t __s0_785 = __p0_785; \
65660 float16x8_t __s1_785 = __p1_785; \
65661 float16x8_t __s2_785 = __p2_785; \
65662 float32x4_t __ret_785; \
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)}); \
65664 __ret_785; \
67328#define vfmlalq_laneq_high_f16(__p0_877, __p1_877, __p2_877, __p3_877) __extension__ ({ \
67329 float32x4_t __s0_877 = __p0_877; \
67330 float16x8_t __s1_877 = __p1_877; \
67331 float16x8_t __s2_877 = __p2_877; \
67332 float32x4_t __ret_877; \
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)}); \
67334 __ret_877; \
6566567335})
6566667336#else
65667#define vfmlalq_laneq_high_f16(__p0_786, __p1_786, __p2_786, __p3_786) __extension__ ({ \
65668 float32x4_t __s0_786 = __p0_786; \
65669 float16x8_t __s1_786 = __p1_786; \
65670 float16x8_t __s2_786 = __p2_786; \
65671 float32x4_t __rev0_786; __rev0_786 = __builtin_shufflevector(__s0_786, __s0_786, 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); \
65673 float16x8_t __rev2_786; __rev2_786 = __builtin_shufflevector(__s2_786, __s2_786, 7, 6, 5, 4, 3, 2, 1, 0); \
65674 float32x4_t __ret_786; \
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)}); \
65676 __ret_786 = __builtin_shufflevector(__ret_786, __ret_786, 3, 2, 1, 0); \
65677 __ret_786; \
67337#define vfmlalq_laneq_high_f16(__p0_878, __p1_878, __p2_878, __p3_878) __extension__ ({ \
67338 float32x4_t __s0_878 = __p0_878; \
67339 float16x8_t __s1_878 = __p1_878; \
67340 float16x8_t __s2_878 = __p2_878; \
67341 float32x4_t __rev0_878; __rev0_878 = __builtin_shufflevector(__s0_878, __s0_878, 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); \
67343 float16x8_t __rev2_878; __rev2_878 = __builtin_shufflevector(__s2_878, __s2_878, 7, 6, 5, 4, 3, 2, 1, 0); \
67344 float32x4_t __ret_878; \
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)}); \
67346 __ret_878 = __builtin_shufflevector(__ret_878, __ret_878, 3, 2, 1, 0); \
67347 __ret_878; \
6567867348})
6567967349#endif
6568067350
6568167351#ifdef __LITTLE_ENDIAN__
65682#define vfmlal_laneq_high_f16(__p0_787, __p1_787, __p2_787, __p3_787) __extension__ ({ \
65683 float32x2_t __s0_787 = __p0_787; \
65684 float16x4_t __s1_787 = __p1_787; \
65685 float16x8_t __s2_787 = __p2_787; \
65686 float32x2_t __ret_787; \
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)}); \
65688 __ret_787; \
67352#define vfmlal_laneq_high_f16(__p0_879, __p1_879, __p2_879, __p3_879) __extension__ ({ \
67353 float32x2_t __s0_879 = __p0_879; \
67354 float16x4_t __s1_879 = __p1_879; \
67355 float16x8_t __s2_879 = __p2_879; \
67356 float32x2_t __ret_879; \
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)}); \
67358 __ret_879; \
6568967359})
6569067360#else
65691#define vfmlal_laneq_high_f16(__p0_788, __p1_788, __p2_788, __p3_788) __extension__ ({ \
65692 float32x2_t __s0_788 = __p0_788; \
65693 float16x4_t __s1_788 = __p1_788; \
65694 float16x8_t __s2_788 = __p2_788; \
65695 float32x2_t __rev0_788; __rev0_788 = __builtin_shufflevector(__s0_788, __s0_788, 1, 0); \
65696 float16x4_t __rev1_788; __rev1_788 = __builtin_shufflevector(__s1_788, __s1_788, 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); \
65698 float32x2_t __ret_788; \
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)}); \
65700 __ret_788 = __builtin_shufflevector(__ret_788, __ret_788, 1, 0); \
65701 __ret_788; \
67361#define vfmlal_laneq_high_f16(__p0_880, __p1_880, __p2_880, __p3_880) __extension__ ({ \
67362 float32x2_t __s0_880 = __p0_880; \
67363 float16x4_t __s1_880 = __p1_880; \
67364 float16x8_t __s2_880 = __p2_880; \
67365 float32x2_t __rev0_880; __rev0_880 = __builtin_shufflevector(__s0_880, __s0_880, 1, 0); \
67366 float16x4_t __rev1_880; __rev1_880 = __builtin_shufflevector(__s1_880, __s1_880, 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); \
67368 float32x2_t __ret_880; \
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)}); \
67370 __ret_880 = __builtin_shufflevector(__ret_880, __ret_880, 1, 0); \
67371 __ret_880; \
6570267372})
6570367373#endif
6570467374
6570567375#ifdef __LITTLE_ENDIAN__
65706#define vfmlalq_laneq_low_f16(__p0_789, __p1_789, __p2_789, __p3_789) __extension__ ({ \
65707 float32x4_t __s0_789 = __p0_789; \
65708 float16x8_t __s1_789 = __p1_789; \
65709 float16x8_t __s2_789 = __p2_789; \
65710 float32x4_t __ret_789; \
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)}); \
65712 __ret_789; \
67376#define vfmlalq_laneq_low_f16(__p0_881, __p1_881, __p2_881, __p3_881) __extension__ ({ \
67377 float32x4_t __s0_881 = __p0_881; \
67378 float16x8_t __s1_881 = __p1_881; \
67379 float16x8_t __s2_881 = __p2_881; \
67380 float32x4_t __ret_881; \
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)}); \
67382 __ret_881; \
6571367383})
6571467384#else
65715#define vfmlalq_laneq_low_f16(__p0_790, __p1_790, __p2_790, __p3_790) __extension__ ({ \
65716 float32x4_t __s0_790 = __p0_790; \
65717 float16x8_t __s1_790 = __p1_790; \
65718 float16x8_t __s2_790 = __p2_790; \
65719 float32x4_t __rev0_790; __rev0_790 = __builtin_shufflevector(__s0_790, __s0_790, 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); \
65721 float16x8_t __rev2_790; __rev2_790 = __builtin_shufflevector(__s2_790, __s2_790, 7, 6, 5, 4, 3, 2, 1, 0); \
65722 float32x4_t __ret_790; \
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)}); \
65724 __ret_790 = __builtin_shufflevector(__ret_790, __ret_790, 3, 2, 1, 0); \
65725 __ret_790; \
67385#define vfmlalq_laneq_low_f16(__p0_882, __p1_882, __p2_882, __p3_882) __extension__ ({ \
67386 float32x4_t __s0_882 = __p0_882; \
67387 float16x8_t __s1_882 = __p1_882; \
67388 float16x8_t __s2_882 = __p2_882; \
67389 float32x4_t __rev0_882; __rev0_882 = __builtin_shufflevector(__s0_882, __s0_882, 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); \
67391 float16x8_t __rev2_882; __rev2_882 = __builtin_shufflevector(__s2_882, __s2_882, 7, 6, 5, 4, 3, 2, 1, 0); \
67392 float32x4_t __ret_882; \
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)}); \
67394 __ret_882 = __builtin_shufflevector(__ret_882, __ret_882, 3, 2, 1, 0); \
67395 __ret_882; \
6572667396})
6572767397#endif
6572867398
6572967399#ifdef __LITTLE_ENDIAN__
65730#define vfmlal_laneq_low_f16(__p0_791, __p1_791, __p2_791, __p3_791) __extension__ ({ \
65731 float32x2_t __s0_791 = __p0_791; \
65732 float16x4_t __s1_791 = __p1_791; \
65733 float16x8_t __s2_791 = __p2_791; \
65734 float32x2_t __ret_791; \
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)}); \
65736 __ret_791; \
67400#define vfmlal_laneq_low_f16(__p0_883, __p1_883, __p2_883, __p3_883) __extension__ ({ \
67401 float32x2_t __s0_883 = __p0_883; \
67402 float16x4_t __s1_883 = __p1_883; \
67403 float16x8_t __s2_883 = __p2_883; \
67404 float32x2_t __ret_883; \
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)}); \
67406 __ret_883; \
6573767407})
6573867408#else
65739#define vfmlal_laneq_low_f16(__p0_792, __p1_792, __p2_792, __p3_792) __extension__ ({ \
65740 float32x2_t __s0_792 = __p0_792; \
65741 float16x4_t __s1_792 = __p1_792; \
65742 float16x8_t __s2_792 = __p2_792; \
65743 float32x2_t __rev0_792; __rev0_792 = __builtin_shufflevector(__s0_792, __s0_792, 1, 0); \
65744 float16x4_t __rev1_792; __rev1_792 = __builtin_shufflevector(__s1_792, __s1_792, 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); \
65746 float32x2_t __ret_792; \
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)}); \
65748 __ret_792 = __builtin_shufflevector(__ret_792, __ret_792, 1, 0); \
65749 __ret_792; \
67409#define vfmlal_laneq_low_f16(__p0_884, __p1_884, __p2_884, __p3_884) __extension__ ({ \
67410 float32x2_t __s0_884 = __p0_884; \
67411 float16x4_t __s1_884 = __p1_884; \
67412 float16x8_t __s2_884 = __p2_884; \
67413 float32x2_t __rev0_884; __rev0_884 = __builtin_shufflevector(__s0_884, __s0_884, 1, 0); \
67414 float16x4_t __rev1_884; __rev1_884 = __builtin_shufflevector(__s1_884, __s1_884, 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); \
67416 float32x2_t __ret_884; \
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)}); \
67418 __ret_884 = __builtin_shufflevector(__ret_884, __ret_884, 1, 0); \
67419 __ret_884; \
6575067420})
6575167421#endif
6575267422
6575367423#ifdef __LITTLE_ENDIAN__
65754#define vfmlslq_lane_high_f16(__p0_793, __p1_793, __p2_793, __p3_793) __extension__ ({ \
65755 float32x4_t __s0_793 = __p0_793; \
65756 float16x8_t __s1_793 = __p1_793; \
65757 float16x4_t __s2_793 = __p2_793; \
65758 float32x4_t __ret_793; \
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)}); \
65760 __ret_793; \
67424#define vfmlslq_lane_high_f16(__p0_885, __p1_885, __p2_885, __p3_885) __extension__ ({ \
67425 float32x4_t __s0_885 = __p0_885; \
67426 float16x8_t __s1_885 = __p1_885; \
67427 float16x4_t __s2_885 = __p2_885; \
67428 float32x4_t __ret_885; \
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)}); \
67430 __ret_885; \
6576167431})
6576267432#else
65763#define vfmlslq_lane_high_f16(__p0_794, __p1_794, __p2_794, __p3_794) __extension__ ({ \
65764 float32x4_t __s0_794 = __p0_794; \
65765 float16x8_t __s1_794 = __p1_794; \
65766 float16x4_t __s2_794 = __p2_794; \
65767 float32x4_t __rev0_794; __rev0_794 = __builtin_shufflevector(__s0_794, __s0_794, 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); \
65769 float16x4_t __rev2_794; __rev2_794 = __builtin_shufflevector(__s2_794, __s2_794, 3, 2, 1, 0); \
65770 float32x4_t __ret_794; \
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)}); \
65772 __ret_794 = __builtin_shufflevector(__ret_794, __ret_794, 3, 2, 1, 0); \
65773 __ret_794; \
67433#define vfmlslq_lane_high_f16(__p0_886, __p1_886, __p2_886, __p3_886) __extension__ ({ \
67434 float32x4_t __s0_886 = __p0_886; \
67435 float16x8_t __s1_886 = __p1_886; \
67436 float16x4_t __s2_886 = __p2_886; \
67437 float32x4_t __rev0_886; __rev0_886 = __builtin_shufflevector(__s0_886, __s0_886, 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); \
67439 float16x4_t __rev2_886; __rev2_886 = __builtin_shufflevector(__s2_886, __s2_886, 3, 2, 1, 0); \
67440 float32x4_t __ret_886; \
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)}); \
67442 __ret_886 = __builtin_shufflevector(__ret_886, __ret_886, 3, 2, 1, 0); \
67443 __ret_886; \
6577467444})
6577567445#endif
6577667446
6577767447#ifdef __LITTLE_ENDIAN__
65778#define vfmlsl_lane_high_f16(__p0_795, __p1_795, __p2_795, __p3_795) __extension__ ({ \
65779 float32x2_t __s0_795 = __p0_795; \
65780 float16x4_t __s1_795 = __p1_795; \
65781 float16x4_t __s2_795 = __p2_795; \
65782 float32x2_t __ret_795; \
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)}); \
65784 __ret_795; \
67448#define vfmlsl_lane_high_f16(__p0_887, __p1_887, __p2_887, __p3_887) __extension__ ({ \
67449 float32x2_t __s0_887 = __p0_887; \
67450 float16x4_t __s1_887 = __p1_887; \
67451 float16x4_t __s2_887 = __p2_887; \
67452 float32x2_t __ret_887; \
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)}); \
67454 __ret_887; \
6578567455})
6578667456#else
65787#define vfmlsl_lane_high_f16(__p0_796, __p1_796, __p2_796, __p3_796) __extension__ ({ \
65788 float32x2_t __s0_796 = __p0_796; \
65789 float16x4_t __s1_796 = __p1_796; \
65790 float16x4_t __s2_796 = __p2_796; \
65791 float32x2_t __rev0_796; __rev0_796 = __builtin_shufflevector(__s0_796, __s0_796, 1, 0); \
65792 float16x4_t __rev1_796; __rev1_796 = __builtin_shufflevector(__s1_796, __s1_796, 3, 2, 1, 0); \
65793 float16x4_t __rev2_796; __rev2_796 = __builtin_shufflevector(__s2_796, __s2_796, 3, 2, 1, 0); \
65794 float32x2_t __ret_796; \
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)}); \
65796 __ret_796 = __builtin_shufflevector(__ret_796, __ret_796, 1, 0); \
65797 __ret_796; \
67457#define vfmlsl_lane_high_f16(__p0_888, __p1_888, __p2_888, __p3_888) __extension__ ({ \
67458 float32x2_t __s0_888 = __p0_888; \
67459 float16x4_t __s1_888 = __p1_888; \
67460 float16x4_t __s2_888 = __p2_888; \
67461 float32x2_t __rev0_888; __rev0_888 = __builtin_shufflevector(__s0_888, __s0_888, 1, 0); \
67462 float16x4_t __rev1_888; __rev1_888 = __builtin_shufflevector(__s1_888, __s1_888, 3, 2, 1, 0); \
67463 float16x4_t __rev2_888; __rev2_888 = __builtin_shufflevector(__s2_888, __s2_888, 3, 2, 1, 0); \
67464 float32x2_t __ret_888; \
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)}); \
67466 __ret_888 = __builtin_shufflevector(__ret_888, __ret_888, 1, 0); \
67467 __ret_888; \
6579867468})
6579967469#endif
6580067470
6580167471#ifdef __LITTLE_ENDIAN__
65802#define vfmlslq_lane_low_f16(__p0_797, __p1_797, __p2_797, __p3_797) __extension__ ({ \
65803 float32x4_t __s0_797 = __p0_797; \
65804 float16x8_t __s1_797 = __p1_797; \
65805 float16x4_t __s2_797 = __p2_797; \
65806 float32x4_t __ret_797; \
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)}); \
65808 __ret_797; \
67472#define vfmlslq_lane_low_f16(__p0_889, __p1_889, __p2_889, __p3_889) __extension__ ({ \
67473 float32x4_t __s0_889 = __p0_889; \
67474 float16x8_t __s1_889 = __p1_889; \
67475 float16x4_t __s2_889 = __p2_889; \
67476 float32x4_t __ret_889; \
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)}); \
67478 __ret_889; \
6580967479})
6581067480#else
65811#define vfmlslq_lane_low_f16(__p0_798, __p1_798, __p2_798, __p3_798) __extension__ ({ \
65812 float32x4_t __s0_798 = __p0_798; \
65813 float16x8_t __s1_798 = __p1_798; \
65814 float16x4_t __s2_798 = __p2_798; \
65815 float32x4_t __rev0_798; __rev0_798 = __builtin_shufflevector(__s0_798, __s0_798, 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); \
65817 float16x4_t __rev2_798; __rev2_798 = __builtin_shufflevector(__s2_798, __s2_798, 3, 2, 1, 0); \
65818 float32x4_t __ret_798; \
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)}); \
65820 __ret_798 = __builtin_shufflevector(__ret_798, __ret_798, 3, 2, 1, 0); \
65821 __ret_798; \
67481#define vfmlslq_lane_low_f16(__p0_890, __p1_890, __p2_890, __p3_890) __extension__ ({ \
67482 float32x4_t __s0_890 = __p0_890; \
67483 float16x8_t __s1_890 = __p1_890; \
67484 float16x4_t __s2_890 = __p2_890; \
67485 float32x4_t __rev0_890; __rev0_890 = __builtin_shufflevector(__s0_890, __s0_890, 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); \
67487 float16x4_t __rev2_890; __rev2_890 = __builtin_shufflevector(__s2_890, __s2_890, 3, 2, 1, 0); \
67488 float32x4_t __ret_890; \
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)}); \
67490 __ret_890 = __builtin_shufflevector(__ret_890, __ret_890, 3, 2, 1, 0); \
67491 __ret_890; \
6582267492})
6582367493#endif
6582467494
6582567495#ifdef __LITTLE_ENDIAN__
65826#define vfmlsl_lane_low_f16(__p0_799, __p1_799, __p2_799, __p3_799) __extension__ ({ \
65827 float32x2_t __s0_799 = __p0_799; \
65828 float16x4_t __s1_799 = __p1_799; \
65829 float16x4_t __s2_799 = __p2_799; \
65830 float32x2_t __ret_799; \
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)}); \
65832 __ret_799; \
67496#define vfmlsl_lane_low_f16(__p0_891, __p1_891, __p2_891, __p3_891) __extension__ ({ \
67497 float32x2_t __s0_891 = __p0_891; \
67498 float16x4_t __s1_891 = __p1_891; \
67499 float16x4_t __s2_891 = __p2_891; \
67500 float32x2_t __ret_891; \
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)}); \
67502 __ret_891; \
6583367503})
6583467504#else
65835#define vfmlsl_lane_low_f16(__p0_800, __p1_800, __p2_800, __p3_800) __extension__ ({ \
65836 float32x2_t __s0_800 = __p0_800; \
65837 float16x4_t __s1_800 = __p1_800; \
65838 float16x4_t __s2_800 = __p2_800; \
65839 float32x2_t __rev0_800; __rev0_800 = __builtin_shufflevector(__s0_800, __s0_800, 1, 0); \
65840 float16x4_t __rev1_800; __rev1_800 = __builtin_shufflevector(__s1_800, __s1_800, 3, 2, 1, 0); \
65841 float16x4_t __rev2_800; __rev2_800 = __builtin_shufflevector(__s2_800, __s2_800, 3, 2, 1, 0); \
65842 float32x2_t __ret_800; \
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)}); \
65844 __ret_800 = __builtin_shufflevector(__ret_800, __ret_800, 1, 0); \
65845 __ret_800; \
67505#define vfmlsl_lane_low_f16(__p0_892, __p1_892, __p2_892, __p3_892) __extension__ ({ \
67506 float32x2_t __s0_892 = __p0_892; \
67507 float16x4_t __s1_892 = __p1_892; \
67508 float16x4_t __s2_892 = __p2_892; \
67509 float32x2_t __rev0_892; __rev0_892 = __builtin_shufflevector(__s0_892, __s0_892, 1, 0); \
67510 float16x4_t __rev1_892; __rev1_892 = __builtin_shufflevector(__s1_892, __s1_892, 3, 2, 1, 0); \
67511 float16x4_t __rev2_892; __rev2_892 = __builtin_shufflevector(__s2_892, __s2_892, 3, 2, 1, 0); \
67512 float32x2_t __ret_892; \
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)}); \
67514 __ret_892 = __builtin_shufflevector(__ret_892, __ret_892, 1, 0); \
67515 __ret_892; \
6584667516})
6584767517#endif
6584867518
6584967519#ifdef __LITTLE_ENDIAN__
65850#define vfmlslq_laneq_high_f16(__p0_801, __p1_801, __p2_801, __p3_801) __extension__ ({ \
65851 float32x4_t __s0_801 = __p0_801; \
65852 float16x8_t __s1_801 = __p1_801; \
65853 float16x8_t __s2_801 = __p2_801; \
65854 float32x4_t __ret_801; \
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)}); \
65856 __ret_801; \
67520#define vfmlslq_laneq_high_f16(__p0_893, __p1_893, __p2_893, __p3_893) __extension__ ({ \
67521 float32x4_t __s0_893 = __p0_893; \
67522 float16x8_t __s1_893 = __p1_893; \
67523 float16x8_t __s2_893 = __p2_893; \
67524 float32x4_t __ret_893; \
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)}); \
67526 __ret_893; \
6585767527})
6585867528#else
65859#define vfmlslq_laneq_high_f16(__p0_802, __p1_802, __p2_802, __p3_802) __extension__ ({ \
65860 float32x4_t __s0_802 = __p0_802; \
65861 float16x8_t __s1_802 = __p1_802; \
65862 float16x8_t __s2_802 = __p2_802; \
65863 float32x4_t __rev0_802; __rev0_802 = __builtin_shufflevector(__s0_802, __s0_802, 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); \
65865 float16x8_t __rev2_802; __rev2_802 = __builtin_shufflevector(__s2_802, __s2_802, 7, 6, 5, 4, 3, 2, 1, 0); \
65866 float32x4_t __ret_802; \
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)}); \
65868 __ret_802 = __builtin_shufflevector(__ret_802, __ret_802, 3, 2, 1, 0); \
65869 __ret_802; \
67529#define vfmlslq_laneq_high_f16(__p0_894, __p1_894, __p2_894, __p3_894) __extension__ ({ \
67530 float32x4_t __s0_894 = __p0_894; \
67531 float16x8_t __s1_894 = __p1_894; \
67532 float16x8_t __s2_894 = __p2_894; \
67533 float32x4_t __rev0_894; __rev0_894 = __builtin_shufflevector(__s0_894, __s0_894, 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); \
67535 float16x8_t __rev2_894; __rev2_894 = __builtin_shufflevector(__s2_894, __s2_894, 7, 6, 5, 4, 3, 2, 1, 0); \
67536 float32x4_t __ret_894; \
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)}); \
67538 __ret_894 = __builtin_shufflevector(__ret_894, __ret_894, 3, 2, 1, 0); \
67539 __ret_894; \
6587067540})
6587167541#endif
6587267542
6587367543#ifdef __LITTLE_ENDIAN__
65874#define vfmlsl_laneq_high_f16(__p0_803, __p1_803, __p2_803, __p3_803) __extension__ ({ \
65875 float32x2_t __s0_803 = __p0_803; \
65876 float16x4_t __s1_803 = __p1_803; \
65877 float16x8_t __s2_803 = __p2_803; \
65878 float32x2_t __ret_803; \
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)}); \
65880 __ret_803; \
67544#define vfmlsl_laneq_high_f16(__p0_895, __p1_895, __p2_895, __p3_895) __extension__ ({ \
67545 float32x2_t __s0_895 = __p0_895; \
67546 float16x4_t __s1_895 = __p1_895; \
67547 float16x8_t __s2_895 = __p2_895; \
67548 float32x2_t __ret_895; \
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)}); \
67550 __ret_895; \
6588167551})
6588267552#else
65883#define vfmlsl_laneq_high_f16(__p0_804, __p1_804, __p2_804, __p3_804) __extension__ ({ \
65884 float32x2_t __s0_804 = __p0_804; \
65885 float16x4_t __s1_804 = __p1_804; \
65886 float16x8_t __s2_804 = __p2_804; \
65887 float32x2_t __rev0_804; __rev0_804 = __builtin_shufflevector(__s0_804, __s0_804, 1, 0); \
65888 float16x4_t __rev1_804; __rev1_804 = __builtin_shufflevector(__s1_804, __s1_804, 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); \
65890 float32x2_t __ret_804; \
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)}); \
65892 __ret_804 = __builtin_shufflevector(__ret_804, __ret_804, 1, 0); \
65893 __ret_804; \
67553#define vfmlsl_laneq_high_f16(__p0_896, __p1_896, __p2_896, __p3_896) __extension__ ({ \
67554 float32x2_t __s0_896 = __p0_896; \
67555 float16x4_t __s1_896 = __p1_896; \
67556 float16x8_t __s2_896 = __p2_896; \
67557 float32x2_t __rev0_896; __rev0_896 = __builtin_shufflevector(__s0_896, __s0_896, 1, 0); \
67558 float16x4_t __rev1_896; __rev1_896 = __builtin_shufflevector(__s1_896, __s1_896, 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); \
67560 float32x2_t __ret_896; \
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)}); \
67562 __ret_896 = __builtin_shufflevector(__ret_896, __ret_896, 1, 0); \
67563 __ret_896; \
6589467564})
6589567565#endif
6589667566
6589767567#ifdef __LITTLE_ENDIAN__
65898#define vfmlslq_laneq_low_f16(__p0_805, __p1_805, __p2_805, __p3_805) __extension__ ({ \
65899 float32x4_t __s0_805 = __p0_805; \
65900 float16x8_t __s1_805 = __p1_805; \
65901 float16x8_t __s2_805 = __p2_805; \
65902 float32x4_t __ret_805; \
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)}); \
65904 __ret_805; \
67568#define vfmlslq_laneq_low_f16(__p0_897, __p1_897, __p2_897, __p3_897) __extension__ ({ \
67569 float32x4_t __s0_897 = __p0_897; \
67570 float16x8_t __s1_897 = __p1_897; \
67571 float16x8_t __s2_897 = __p2_897; \
67572 float32x4_t __ret_897; \
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)}); \
67574 __ret_897; \
6590567575})
6590667576#else
65907#define vfmlslq_laneq_low_f16(__p0_806, __p1_806, __p2_806, __p3_806) __extension__ ({ \
65908 float32x4_t __s0_806 = __p0_806; \
65909 float16x8_t __s1_806 = __p1_806; \
65910 float16x8_t __s2_806 = __p2_806; \
65911 float32x4_t __rev0_806; __rev0_806 = __builtin_shufflevector(__s0_806, __s0_806, 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); \
65913 float16x8_t __rev2_806; __rev2_806 = __builtin_shufflevector(__s2_806, __s2_806, 7, 6, 5, 4, 3, 2, 1, 0); \
65914 float32x4_t __ret_806; \
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)}); \
65916 __ret_806 = __builtin_shufflevector(__ret_806, __ret_806, 3, 2, 1, 0); \
65917 __ret_806; \
67577#define vfmlslq_laneq_low_f16(__p0_898, __p1_898, __p2_898, __p3_898) __extension__ ({ \
67578 float32x4_t __s0_898 = __p0_898; \
67579 float16x8_t __s1_898 = __p1_898; \
67580 float16x8_t __s2_898 = __p2_898; \
67581 float32x4_t __rev0_898; __rev0_898 = __builtin_shufflevector(__s0_898, __s0_898, 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); \
67583 float16x8_t __rev2_898; __rev2_898 = __builtin_shufflevector(__s2_898, __s2_898, 7, 6, 5, 4, 3, 2, 1, 0); \
67584 float32x4_t __ret_898; \
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)}); \
67586 __ret_898 = __builtin_shufflevector(__ret_898, __ret_898, 3, 2, 1, 0); \
67587 __ret_898; \
6591867588})
6591967589#endif
6592067590
6592167591#ifdef __LITTLE_ENDIAN__
65922#define vfmlsl_laneq_low_f16(__p0_807, __p1_807, __p2_807, __p3_807) __extension__ ({ \
65923 float32x2_t __s0_807 = __p0_807; \
65924 float16x4_t __s1_807 = __p1_807; \
65925 float16x8_t __s2_807 = __p2_807; \
65926 float32x2_t __ret_807; \
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)}); \
65928 __ret_807; \
67592#define vfmlsl_laneq_low_f16(__p0_899, __p1_899, __p2_899, __p3_899) __extension__ ({ \
67593 float32x2_t __s0_899 = __p0_899; \
67594 float16x4_t __s1_899 = __p1_899; \
67595 float16x8_t __s2_899 = __p2_899; \
67596 float32x2_t __ret_899; \
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)}); \
67598 __ret_899; \
6592967599})
6593067600#else
65931#define vfmlsl_laneq_low_f16(__p0_808, __p1_808, __p2_808, __p3_808) __extension__ ({ \
65932 float32x2_t __s0_808 = __p0_808; \
65933 float16x4_t __s1_808 = __p1_808; \
65934 float16x8_t __s2_808 = __p2_808; \
65935 float32x2_t __rev0_808; __rev0_808 = __builtin_shufflevector(__s0_808, __s0_808, 1, 0); \
65936 float16x4_t __rev1_808; __rev1_808 = __builtin_shufflevector(__s1_808, __s1_808, 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); \
65938 float32x2_t __ret_808; \
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)}); \
65940 __ret_808 = __builtin_shufflevector(__ret_808, __ret_808, 1, 0); \
65941 __ret_808; \
67601#define vfmlsl_laneq_low_f16(__p0_900, __p1_900, __p2_900, __p3_900) __extension__ ({ \
67602 float32x2_t __s0_900 = __p0_900; \
67603 float16x4_t __s1_900 = __p1_900; \
67604 float16x8_t __s2_900 = __p2_900; \
67605 float32x2_t __rev0_900; __rev0_900 = __builtin_shufflevector(__s0_900, __s0_900, 1, 0); \
67606 float16x4_t __rev1_900; __rev1_900 = __builtin_shufflevector(__s1_900, __s1_900, 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); \
67608 float32x2_t __ret_900; \
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)}); \
67610 __ret_900 = __builtin_shufflevector(__ret_900, __ret_900, 1, 0); \
67611 __ret_900; \
6594267612})
6594367613#endif
6594467614
6594567615#endif
6594667616#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarch64__)
6594767617#ifdef __LITTLE_ENDIAN__
65948#define vmulh_lane_f16(__p0_809, __p1_809, __p2_809) __extension__ ({ \
65949 float16_t __s0_809 = __p0_809; \
65950 float16x4_t __s1_809 = __p1_809; \
65951 float16_t __ret_809; \
65952 __ret_809 = __s0_809 * vget_lane_f16(__s1_809, __p2_809); \
65953 __ret_809; \
67618#define vmulh_lane_f16(__p0_901, __p1_901, __p2_901) __extension__ ({ \
67619 float16_t __s0_901 = __p0_901; \
67620 float16x4_t __s1_901 = __p1_901; \
67621 float16_t __ret_901; \
67622 __ret_901 = __s0_901 * vget_lane_f16(__s1_901, __p2_901); \
67623 __ret_901; \
6595467624})
6595567625#else
65956#define vmulh_lane_f16(__p0_810, __p1_810, __p2_810) __extension__ ({ \
65957 float16_t __s0_810 = __p0_810; \
65958 float16x4_t __s1_810 = __p1_810; \
65959 float16x4_t __rev1_810; __rev1_810 = __builtin_shufflevector(__s1_810, __s1_810, 3, 2, 1, 0); \
65960 float16_t __ret_810; \
65961 __ret_810 = __s0_810 * __noswap_vget_lane_f16(__rev1_810, __p2_810); \
65962 __ret_810; \
67626#define vmulh_lane_f16(__p0_902, __p1_902, __p2_902) __extension__ ({ \
67627 float16_t __s0_902 = __p0_902; \
67628 float16x4_t __s1_902 = __p1_902; \
67629 float16x4_t __rev1_902; __rev1_902 = __builtin_shufflevector(__s1_902, __s1_902, 3, 2, 1, 0); \
67630 float16_t __ret_902; \
67631 __ret_902 = __s0_902 * __noswap_vget_lane_f16(__rev1_902, __p2_902); \
67632 __ret_902; \
6596367633})
6596467634#endif
6596567635
6596667636#ifdef __LITTLE_ENDIAN__
65967#define vmulh_laneq_f16(__p0_811, __p1_811, __p2_811) __extension__ ({ \
65968 float16_t __s0_811 = __p0_811; \
65969 float16x8_t __s1_811 = __p1_811; \
65970 float16_t __ret_811; \
65971 __ret_811 = __s0_811 * vgetq_lane_f16(__s1_811, __p2_811); \
65972 __ret_811; \
67637#define vmulh_laneq_f16(__p0_903, __p1_903, __p2_903) __extension__ ({ \
67638 float16_t __s0_903 = __p0_903; \
67639 float16x8_t __s1_903 = __p1_903; \
67640 float16_t __ret_903; \
67641 __ret_903 = __s0_903 * vgetq_lane_f16(__s1_903, __p2_903); \
67642 __ret_903; \
6597367643})
6597467644#else
65975#define vmulh_laneq_f16(__p0_812, __p1_812, __p2_812) __extension__ ({ \
65976 float16_t __s0_812 = __p0_812; \
65977 float16x8_t __s1_812 = __p1_812; \
65978 float16x8_t __rev1_812; __rev1_812 = __builtin_shufflevector(__s1_812, __s1_812, 7, 6, 5, 4, 3, 2, 1, 0); \
65979 float16_t __ret_812; \
65980 __ret_812 = __s0_812 * __noswap_vgetq_lane_f16(__rev1_812, __p2_812); \
65981 __ret_812; \
67645#define vmulh_laneq_f16(__p0_904, __p1_904, __p2_904) __extension__ ({ \
67646 float16_t __s0_904 = __p0_904; \
67647 float16x8_t __s1_904 = __p1_904; \
67648 float16x8_t __rev1_904; __rev1_904 = __builtin_shufflevector(__s1_904, __s1_904, 7, 6, 5, 4, 3, 2, 1, 0); \
67649 float16_t __ret_904; \
67650 __ret_904 = __s0_904 * __noswap_vgetq_lane_f16(__rev1_904, __p2_904); \
67651 __ret_904; \
6598267652})
6598367653#endif
6598467654
6598567655#endif
6598667656#if defined(__ARM_FEATURE_MATMUL_INT8)
6598767657#ifdef __LITTLE_ENDIAN__
65988#define vsudotq_lane_s32(__p0_813, __p1_813, __p2_813, __p3_813) __extension__ ({ \
65989 int32x4_t __s0_813 = __p0_813; \
65990 int8x16_t __s1_813 = __p1_813; \
65991 uint8x8_t __s2_813 = __p2_813; \
65992 int32x4_t __ret_813; \
65993uint8x8_t __reint_813 = __s2_813; \
65994 __ret_813 = vusdotq_s32(__s0_813, (uint8x16_t)(splatq_lane_s32(*(int32x2_t *) &__reint_813, __p3_813)), __s1_813); \
65995 __ret_813; \
67658#define vsudotq_lane_s32(__p0_905, __p1_905, __p2_905, __p3_905) __extension__ ({ \
67659 int32x4_t __s0_905 = __p0_905; \
67660 int8x16_t __s1_905 = __p1_905; \
67661 uint8x8_t __s2_905 = __p2_905; \
67662 int32x4_t __ret_905; \
67663uint8x8_t __reint_905 = __s2_905; \
67664 __ret_905 = vusdotq_s32(__s0_905, (uint8x16_t)(splatq_lane_s32(*(int32x2_t *) &__reint_905, __p3_905)), __s1_905); \
67665 __ret_905; \
6599667666})
6599767667#else
65998#define vsudotq_lane_s32(__p0_814, __p1_814, __p2_814, __p3_814) __extension__ ({ \
65999 int32x4_t __s0_814 = __p0_814; \
66000 int8x16_t __s1_814 = __p1_814; \
66001 uint8x8_t __s2_814 = __p2_814; \
66002 int32x4_t __rev0_814; __rev0_814 = __builtin_shufflevector(__s0_814, __s0_814, 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); \
66004 uint8x8_t __rev2_814; __rev2_814 = __builtin_shufflevector(__s2_814, __s2_814, 7, 6, 5, 4, 3, 2, 1, 0); \
66005 int32x4_t __ret_814; \
66006uint8x8_t __reint_814 = __rev2_814; \
66007 __ret_814 = __noswap_vusdotq_s32(__rev0_814, (uint8x16_t)(__noswap_splatq_lane_s32(*(int32x2_t *) &__reint_814, __p3_814)), __rev1_814); \
66008 __ret_814 = __builtin_shufflevector(__ret_814, __ret_814, 3, 2, 1, 0); \
66009 __ret_814; \
67668#define vsudotq_lane_s32(__p0_906, __p1_906, __p2_906, __p3_906) __extension__ ({ \
67669 int32x4_t __s0_906 = __p0_906; \
67670 int8x16_t __s1_906 = __p1_906; \
67671 uint8x8_t __s2_906 = __p2_906; \
67672 int32x4_t __rev0_906; __rev0_906 = __builtin_shufflevector(__s0_906, __s0_906, 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); \
67674 uint8x8_t __rev2_906; __rev2_906 = __builtin_shufflevector(__s2_906, __s2_906, 7, 6, 5, 4, 3, 2, 1, 0); \
67675 int32x4_t __ret_906; \
67676uint8x8_t __reint_906 = __rev2_906; \
67677 __ret_906 = __noswap_vusdotq_s32(__rev0_906, (uint8x16_t)(__noswap_splatq_lane_s32(*(int32x2_t *) &__reint_906, __p3_906)), __rev1_906); \
67678 __ret_906 = __builtin_shufflevector(__ret_906, __ret_906, 3, 2, 1, 0); \
67679 __ret_906; \
6601067680})
6601167681#endif
6601267682
6601367683#ifdef __LITTLE_ENDIAN__
66014#define vsudot_lane_s32(__p0_815, __p1_815, __p2_815, __p3_815) __extension__ ({ \
66015 int32x2_t __s0_815 = __p0_815; \
66016 int8x8_t __s1_815 = __p1_815; \
66017 uint8x8_t __s2_815 = __p2_815; \
66018 int32x2_t __ret_815; \
66019uint8x8_t __reint_815 = __s2_815; \
66020 __ret_815 = vusdot_s32(__s0_815, (uint8x8_t)(splat_lane_s32(*(int32x2_t *) &__reint_815, __p3_815)), __s1_815); \
66021 __ret_815; \
67684#define vsudot_lane_s32(__p0_907, __p1_907, __p2_907, __p3_907) __extension__ ({ \
67685 int32x2_t __s0_907 = __p0_907; \
67686 int8x8_t __s1_907 = __p1_907; \
67687 uint8x8_t __s2_907 = __p2_907; \
67688 int32x2_t __ret_907; \
67689uint8x8_t __reint_907 = __s2_907; \
67690 __ret_907 = vusdot_s32(__s0_907, (uint8x8_t)(splat_lane_s32(*(int32x2_t *) &__reint_907, __p3_907)), __s1_907); \
67691 __ret_907; \
6602267692})
6602367693#else
66024#define vsudot_lane_s32(__p0_816, __p1_816, __p2_816, __p3_816) __extension__ ({ \
66025 int32x2_t __s0_816 = __p0_816; \
66026 int8x8_t __s1_816 = __p1_816; \
66027 uint8x8_t __s2_816 = __p2_816; \
66028 int32x2_t __rev0_816; __rev0_816 = __builtin_shufflevector(__s0_816, __s0_816, 1, 0); \
66029 int8x8_t __rev1_816; __rev1_816 = __builtin_shufflevector(__s1_816, __s1_816, 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); \
66031 int32x2_t __ret_816; \
66032uint8x8_t __reint_816 = __rev2_816; \
66033 __ret_816 = __noswap_vusdot_s32(__rev0_816, (uint8x8_t)(__noswap_splat_lane_s32(*(int32x2_t *) &__reint_816, __p3_816)), __rev1_816); \
66034 __ret_816 = __builtin_shufflevector(__ret_816, __ret_816, 1, 0); \
66035 __ret_816; \
67694#define vsudot_lane_s32(__p0_908, __p1_908, __p2_908, __p3_908) __extension__ ({ \
67695 int32x2_t __s0_908 = __p0_908; \
67696 int8x8_t __s1_908 = __p1_908; \
67697 uint8x8_t __s2_908 = __p2_908; \
67698 int32x2_t __rev0_908; __rev0_908 = __builtin_shufflevector(__s0_908, __s0_908, 1, 0); \
67699 int8x8_t __rev1_908; __rev1_908 = __builtin_shufflevector(__s1_908, __s1_908, 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); \
67701 int32x2_t __ret_908; \
67702uint8x8_t __reint_908 = __rev2_908; \
67703 __ret_908 = __noswap_vusdot_s32(__rev0_908, (uint8x8_t)(__noswap_splat_lane_s32(*(int32x2_t *) &__reint_908, __p3_908)), __rev1_908); \
67704 __ret_908 = __builtin_shufflevector(__ret_908, __ret_908, 1, 0); \
67705 __ret_908; \
6603667706})
6603767707#endif
6603867708
......@@ -66049,86 +67719,86 @@ __ai int16_t vqrdmlahh_s16(int16_t __p0, int16_t __p1, int16_t __p2) {
6604967719 return __ret;
6605067720}
6605167721#ifdef __LITTLE_ENDIAN__
66052#define vqrdmlahs_lane_s32(__p0_817, __p1_817, __p2_817, __p3_817) __extension__ ({ \
66053 int32_t __s0_817 = __p0_817; \
66054 int32_t __s1_817 = __p1_817; \
66055 int32x2_t __s2_817 = __p2_817; \
66056 int32_t __ret_817; \
66057 __ret_817 = vqadds_s32(__s0_817, vqrdmulhs_s32(__s1_817, vget_lane_s32(__s2_817, __p3_817))); \
66058 __ret_817; \
67722#define vqrdmlahs_lane_s32(__p0_909, __p1_909, __p2_909, __p3_909) __extension__ ({ \
67723 int32_t __s0_909 = __p0_909; \
67724 int32_t __s1_909 = __p1_909; \
67725 int32x2_t __s2_909 = __p2_909; \
67726 int32_t __ret_909; \
67727 __ret_909 = vqadds_s32(__s0_909, vqrdmulhs_s32(__s1_909, vget_lane_s32(__s2_909, __p3_909))); \
67728 __ret_909; \
6605967729})
6606067730#else
66061#define vqrdmlahs_lane_s32(__p0_818, __p1_818, __p2_818, __p3_818) __extension__ ({ \
66062 int32_t __s0_818 = __p0_818; \
66063 int32_t __s1_818 = __p1_818; \
66064 int32x2_t __s2_818 = __p2_818; \
66065 int32x2_t __rev2_818; __rev2_818 = __builtin_shufflevector(__s2_818, __s2_818, 1, 0); \
66066 int32_t __ret_818; \
66067 __ret_818 = vqadds_s32(__s0_818, vqrdmulhs_s32(__s1_818, __noswap_vget_lane_s32(__rev2_818, __p3_818))); \
66068 __ret_818; \
67731#define vqrdmlahs_lane_s32(__p0_910, __p1_910, __p2_910, __p3_910) __extension__ ({ \
67732 int32_t __s0_910 = __p0_910; \
67733 int32_t __s1_910 = __p1_910; \
67734 int32x2_t __s2_910 = __p2_910; \
67735 int32x2_t __rev2_910; __rev2_910 = __builtin_shufflevector(__s2_910, __s2_910, 1, 0); \
67736 int32_t __ret_910; \
67737 __ret_910 = vqadds_s32(__s0_910, vqrdmulhs_s32(__s1_910, __noswap_vget_lane_s32(__rev2_910, __p3_910))); \
67738 __ret_910; \
6606967739})
6607067740#endif
6607167741
6607267742#ifdef __LITTLE_ENDIAN__
66073#define vqrdmlahh_lane_s16(__p0_819, __p1_819, __p2_819, __p3_819) __extension__ ({ \
66074 int16_t __s0_819 = __p0_819; \
66075 int16_t __s1_819 = __p1_819; \
66076 int16x4_t __s2_819 = __p2_819; \
66077 int16_t __ret_819; \
66078 __ret_819 = vqaddh_s16(__s0_819, vqrdmulhh_s16(__s1_819, vget_lane_s16(__s2_819, __p3_819))); \
66079 __ret_819; \
67743#define vqrdmlahh_lane_s16(__p0_911, __p1_911, __p2_911, __p3_911) __extension__ ({ \
67744 int16_t __s0_911 = __p0_911; \
67745 int16_t __s1_911 = __p1_911; \
67746 int16x4_t __s2_911 = __p2_911; \
67747 int16_t __ret_911; \
67748 __ret_911 = vqaddh_s16(__s0_911, vqrdmulhh_s16(__s1_911, vget_lane_s16(__s2_911, __p3_911))); \
67749 __ret_911; \
6608067750})
6608167751#else
66082#define vqrdmlahh_lane_s16(__p0_820, __p1_820, __p2_820, __p3_820) __extension__ ({ \
66083 int16_t __s0_820 = __p0_820; \
66084 int16_t __s1_820 = __p1_820; \
66085 int16x4_t __s2_820 = __p2_820; \
66086 int16x4_t __rev2_820; __rev2_820 = __builtin_shufflevector(__s2_820, __s2_820, 3, 2, 1, 0); \
66087 int16_t __ret_820; \
66088 __ret_820 = vqaddh_s16(__s0_820, vqrdmulhh_s16(__s1_820, __noswap_vget_lane_s16(__rev2_820, __p3_820))); \
66089 __ret_820; \
67752#define vqrdmlahh_lane_s16(__p0_912, __p1_912, __p2_912, __p3_912) __extension__ ({ \
67753 int16_t __s0_912 = __p0_912; \
67754 int16_t __s1_912 = __p1_912; \
67755 int16x4_t __s2_912 = __p2_912; \
67756 int16x4_t __rev2_912; __rev2_912 = __builtin_shufflevector(__s2_912, __s2_912, 3, 2, 1, 0); \
67757 int16_t __ret_912; \
67758 __ret_912 = vqaddh_s16(__s0_912, vqrdmulhh_s16(__s1_912, __noswap_vget_lane_s16(__rev2_912, __p3_912))); \
67759 __ret_912; \
6609067760})
6609167761#endif
6609267762
6609367763#ifdef __LITTLE_ENDIAN__
66094#define vqrdmlahs_laneq_s32(__p0_821, __p1_821, __p2_821, __p3_821) __extension__ ({ \
66095 int32_t __s0_821 = __p0_821; \
66096 int32_t __s1_821 = __p1_821; \
66097 int32x4_t __s2_821 = __p2_821; \
66098 int32_t __ret_821; \
66099 __ret_821 = vqadds_s32(__s0_821, vqrdmulhs_s32(__s1_821, vgetq_lane_s32(__s2_821, __p3_821))); \
66100 __ret_821; \
67764#define vqrdmlahs_laneq_s32(__p0_913, __p1_913, __p2_913, __p3_913) __extension__ ({ \
67765 int32_t __s0_913 = __p0_913; \
67766 int32_t __s1_913 = __p1_913; \
67767 int32x4_t __s2_913 = __p2_913; \
67768 int32_t __ret_913; \
67769 __ret_913 = vqadds_s32(__s0_913, vqrdmulhs_s32(__s1_913, vgetq_lane_s32(__s2_913, __p3_913))); \
67770 __ret_913; \
6610167771})
6610267772#else
66103#define vqrdmlahs_laneq_s32(__p0_822, __p1_822, __p2_822, __p3_822) __extension__ ({ \
66104 int32_t __s0_822 = __p0_822; \
66105 int32_t __s1_822 = __p1_822; \
66106 int32x4_t __s2_822 = __p2_822; \
66107 int32x4_t __rev2_822; __rev2_822 = __builtin_shufflevector(__s2_822, __s2_822, 3, 2, 1, 0); \
66108 int32_t __ret_822; \
66109 __ret_822 = vqadds_s32(__s0_822, vqrdmulhs_s32(__s1_822, __noswap_vgetq_lane_s32(__rev2_822, __p3_822))); \
66110 __ret_822; \
67773#define vqrdmlahs_laneq_s32(__p0_914, __p1_914, __p2_914, __p3_914) __extension__ ({ \
67774 int32_t __s0_914 = __p0_914; \
67775 int32_t __s1_914 = __p1_914; \
67776 int32x4_t __s2_914 = __p2_914; \
67777 int32x4_t __rev2_914; __rev2_914 = __builtin_shufflevector(__s2_914, __s2_914, 3, 2, 1, 0); \
67778 int32_t __ret_914; \
67779 __ret_914 = vqadds_s32(__s0_914, vqrdmulhs_s32(__s1_914, __noswap_vgetq_lane_s32(__rev2_914, __p3_914))); \
67780 __ret_914; \
6611167781})
6611267782#endif
6611367783
6611467784#ifdef __LITTLE_ENDIAN__
66115#define vqrdmlahh_laneq_s16(__p0_823, __p1_823, __p2_823, __p3_823) __extension__ ({ \
66116 int16_t __s0_823 = __p0_823; \
66117 int16_t __s1_823 = __p1_823; \
66118 int16x8_t __s2_823 = __p2_823; \
66119 int16_t __ret_823; \
66120 __ret_823 = vqaddh_s16(__s0_823, vqrdmulhh_s16(__s1_823, vgetq_lane_s16(__s2_823, __p3_823))); \
66121 __ret_823; \
67785#define vqrdmlahh_laneq_s16(__p0_915, __p1_915, __p2_915, __p3_915) __extension__ ({ \
67786 int16_t __s0_915 = __p0_915; \
67787 int16_t __s1_915 = __p1_915; \
67788 int16x8_t __s2_915 = __p2_915; \
67789 int16_t __ret_915; \
67790 __ret_915 = vqaddh_s16(__s0_915, vqrdmulhh_s16(__s1_915, vgetq_lane_s16(__s2_915, __p3_915))); \
67791 __ret_915; \
6612267792})
6612367793#else
66124#define vqrdmlahh_laneq_s16(__p0_824, __p1_824, __p2_824, __p3_824) __extension__ ({ \
66125 int16_t __s0_824 = __p0_824; \
66126 int16_t __s1_824 = __p1_824; \
66127 int16x8_t __s2_824 = __p2_824; \
66128 int16x8_t __rev2_824; __rev2_824 = __builtin_shufflevector(__s2_824, __s2_824, 7, 6, 5, 4, 3, 2, 1, 0); \
66129 int16_t __ret_824; \
66130 __ret_824 = vqaddh_s16(__s0_824, vqrdmulhh_s16(__s1_824, __noswap_vgetq_lane_s16(__rev2_824, __p3_824))); \
66131 __ret_824; \
67794#define vqrdmlahh_laneq_s16(__p0_916, __p1_916, __p2_916, __p3_916) __extension__ ({ \
67795 int16_t __s0_916 = __p0_916; \
67796 int16_t __s1_916 = __p1_916; \
67797 int16x8_t __s2_916 = __p2_916; \
67798 int16x8_t __rev2_916; __rev2_916 = __builtin_shufflevector(__s2_916, __s2_916, 7, 6, 5, 4, 3, 2, 1, 0); \
67799 int16_t __ret_916; \
67800 __ret_916 = vqaddh_s16(__s0_916, vqrdmulhh_s16(__s1_916, __noswap_vgetq_lane_s16(__rev2_916, __p3_916))); \
67801 __ret_916; \
6613267802})
6613367803#endif
6613467804
......@@ -66143,86 +67813,86 @@ __ai int16_t vqrdmlshh_s16(int16_t __p0, int16_t __p1, int16_t __p2) {
6614367813 return __ret;
6614467814}
6614567815#ifdef __LITTLE_ENDIAN__
66146#define vqrdmlshs_lane_s32(__p0_825, __p1_825, __p2_825, __p3_825) __extension__ ({ \
66147 int32_t __s0_825 = __p0_825; \
66148 int32_t __s1_825 = __p1_825; \
66149 int32x2_t __s2_825 = __p2_825; \
66150 int32_t __ret_825; \
66151 __ret_825 = vqsubs_s32(__s0_825, vqrdmulhs_s32(__s1_825, vget_lane_s32(__s2_825, __p3_825))); \
66152 __ret_825; \
67816#define vqrdmlshs_lane_s32(__p0_917, __p1_917, __p2_917, __p3_917) __extension__ ({ \
67817 int32_t __s0_917 = __p0_917; \
67818 int32_t __s1_917 = __p1_917; \
67819 int32x2_t __s2_917 = __p2_917; \
67820 int32_t __ret_917; \
67821 __ret_917 = vqsubs_s32(__s0_917, vqrdmulhs_s32(__s1_917, vget_lane_s32(__s2_917, __p3_917))); \
67822 __ret_917; \
6615367823})
6615467824#else
66155#define vqrdmlshs_lane_s32(__p0_826, __p1_826, __p2_826, __p3_826) __extension__ ({ \
66156 int32_t __s0_826 = __p0_826; \
66157 int32_t __s1_826 = __p1_826; \
66158 int32x2_t __s2_826 = __p2_826; \
66159 int32x2_t __rev2_826; __rev2_826 = __builtin_shufflevector(__s2_826, __s2_826, 1, 0); \
66160 int32_t __ret_826; \
66161 __ret_826 = vqsubs_s32(__s0_826, vqrdmulhs_s32(__s1_826, __noswap_vget_lane_s32(__rev2_826, __p3_826))); \
66162 __ret_826; \
67825#define vqrdmlshs_lane_s32(__p0_918, __p1_918, __p2_918, __p3_918) __extension__ ({ \
67826 int32_t __s0_918 = __p0_918; \
67827 int32_t __s1_918 = __p1_918; \
67828 int32x2_t __s2_918 = __p2_918; \
67829 int32x2_t __rev2_918; __rev2_918 = __builtin_shufflevector(__s2_918, __s2_918, 1, 0); \
67830 int32_t __ret_918; \
67831 __ret_918 = vqsubs_s32(__s0_918, vqrdmulhs_s32(__s1_918, __noswap_vget_lane_s32(__rev2_918, __p3_918))); \
67832 __ret_918; \
6616367833})
6616467834#endif
6616567835
6616667836#ifdef __LITTLE_ENDIAN__
66167#define vqrdmlshh_lane_s16(__p0_827, __p1_827, __p2_827, __p3_827) __extension__ ({ \
66168 int16_t __s0_827 = __p0_827; \
66169 int16_t __s1_827 = __p1_827; \
66170 int16x4_t __s2_827 = __p2_827; \
66171 int16_t __ret_827; \
66172 __ret_827 = vqsubh_s16(__s0_827, vqrdmulhh_s16(__s1_827, vget_lane_s16(__s2_827, __p3_827))); \
66173 __ret_827; \
67837#define vqrdmlshh_lane_s16(__p0_919, __p1_919, __p2_919, __p3_919) __extension__ ({ \
67838 int16_t __s0_919 = __p0_919; \
67839 int16_t __s1_919 = __p1_919; \
67840 int16x4_t __s2_919 = __p2_919; \
67841 int16_t __ret_919; \
67842 __ret_919 = vqsubh_s16(__s0_919, vqrdmulhh_s16(__s1_919, vget_lane_s16(__s2_919, __p3_919))); \
67843 __ret_919; \
6617467844})
6617567845#else
66176#define vqrdmlshh_lane_s16(__p0_828, __p1_828, __p2_828, __p3_828) __extension__ ({ \
66177 int16_t __s0_828 = __p0_828; \
66178 int16_t __s1_828 = __p1_828; \
66179 int16x4_t __s2_828 = __p2_828; \
66180 int16x4_t __rev2_828; __rev2_828 = __builtin_shufflevector(__s2_828, __s2_828, 3, 2, 1, 0); \
66181 int16_t __ret_828; \
66182 __ret_828 = vqsubh_s16(__s0_828, vqrdmulhh_s16(__s1_828, __noswap_vget_lane_s16(__rev2_828, __p3_828))); \
66183 __ret_828; \
67846#define vqrdmlshh_lane_s16(__p0_920, __p1_920, __p2_920, __p3_920) __extension__ ({ \
67847 int16_t __s0_920 = __p0_920; \
67848 int16_t __s1_920 = __p1_920; \
67849 int16x4_t __s2_920 = __p2_920; \
67850 int16x4_t __rev2_920; __rev2_920 = __builtin_shufflevector(__s2_920, __s2_920, 3, 2, 1, 0); \
67851 int16_t __ret_920; \
67852 __ret_920 = vqsubh_s16(__s0_920, vqrdmulhh_s16(__s1_920, __noswap_vget_lane_s16(__rev2_920, __p3_920))); \
67853 __ret_920; \
6618467854})
6618567855#endif
6618667856
6618767857#ifdef __LITTLE_ENDIAN__
66188#define vqrdmlshs_laneq_s32(__p0_829, __p1_829, __p2_829, __p3_829) __extension__ ({ \
66189 int32_t __s0_829 = __p0_829; \
66190 int32_t __s1_829 = __p1_829; \
66191 int32x4_t __s2_829 = __p2_829; \
66192 int32_t __ret_829; \
66193 __ret_829 = vqsubs_s32(__s0_829, vqrdmulhs_s32(__s1_829, vgetq_lane_s32(__s2_829, __p3_829))); \
66194 __ret_829; \
67858#define vqrdmlshs_laneq_s32(__p0_921, __p1_921, __p2_921, __p3_921) __extension__ ({ \
67859 int32_t __s0_921 = __p0_921; \
67860 int32_t __s1_921 = __p1_921; \
67861 int32x4_t __s2_921 = __p2_921; \
67862 int32_t __ret_921; \
67863 __ret_921 = vqsubs_s32(__s0_921, vqrdmulhs_s32(__s1_921, vgetq_lane_s32(__s2_921, __p3_921))); \
67864 __ret_921; \
6619567865})
6619667866#else
66197#define vqrdmlshs_laneq_s32(__p0_830, __p1_830, __p2_830, __p3_830) __extension__ ({ \
66198 int32_t __s0_830 = __p0_830; \
66199 int32_t __s1_830 = __p1_830; \
66200 int32x4_t __s2_830 = __p2_830; \
66201 int32x4_t __rev2_830; __rev2_830 = __builtin_shufflevector(__s2_830, __s2_830, 3, 2, 1, 0); \
66202 int32_t __ret_830; \
66203 __ret_830 = vqsubs_s32(__s0_830, vqrdmulhs_s32(__s1_830, __noswap_vgetq_lane_s32(__rev2_830, __p3_830))); \
66204 __ret_830; \
67867#define vqrdmlshs_laneq_s32(__p0_922, __p1_922, __p2_922, __p3_922) __extension__ ({ \
67868 int32_t __s0_922 = __p0_922; \
67869 int32_t __s1_922 = __p1_922; \
67870 int32x4_t __s2_922 = __p2_922; \
67871 int32x4_t __rev2_922; __rev2_922 = __builtin_shufflevector(__s2_922, __s2_922, 3, 2, 1, 0); \
67872 int32_t __ret_922; \
67873 __ret_922 = vqsubs_s32(__s0_922, vqrdmulhs_s32(__s1_922, __noswap_vgetq_lane_s32(__rev2_922, __p3_922))); \
67874 __ret_922; \
6620567875})
6620667876#endif
6620767877
6620867878#ifdef __LITTLE_ENDIAN__
66209#define vqrdmlshh_laneq_s16(__p0_831, __p1_831, __p2_831, __p3_831) __extension__ ({ \
66210 int16_t __s0_831 = __p0_831; \
66211 int16_t __s1_831 = __p1_831; \
66212 int16x8_t __s2_831 = __p2_831; \
66213 int16_t __ret_831; \
66214 __ret_831 = vqsubh_s16(__s0_831, vqrdmulhh_s16(__s1_831, vgetq_lane_s16(__s2_831, __p3_831))); \
66215 __ret_831; \
67879#define vqrdmlshh_laneq_s16(__p0_923, __p1_923, __p2_923, __p3_923) __extension__ ({ \
67880 int16_t __s0_923 = __p0_923; \
67881 int16_t __s1_923 = __p1_923; \
67882 int16x8_t __s2_923 = __p2_923; \
67883 int16_t __ret_923; \
67884 __ret_923 = vqsubh_s16(__s0_923, vqrdmulhh_s16(__s1_923, vgetq_lane_s16(__s2_923, __p3_923))); \
67885 __ret_923; \
6621667886})
6621767887#else
66218#define vqrdmlshh_laneq_s16(__p0_832, __p1_832, __p2_832, __p3_832) __extension__ ({ \
66219 int16_t __s0_832 = __p0_832; \
66220 int16_t __s1_832 = __p1_832; \
66221 int16x8_t __s2_832 = __p2_832; \
66222 int16x8_t __rev2_832; __rev2_832 = __builtin_shufflevector(__s2_832, __s2_832, 7, 6, 5, 4, 3, 2, 1, 0); \
66223 int16_t __ret_832; \
66224 __ret_832 = vqsubh_s16(__s0_832, vqrdmulhh_s16(__s1_832, __noswap_vgetq_lane_s16(__rev2_832, __p3_832))); \
66225 __ret_832; \
67888#define vqrdmlshh_laneq_s16(__p0_924, __p1_924, __p2_924, __p3_924) __extension__ ({ \
67889 int16_t __s0_924 = __p0_924; \
67890 int16_t __s1_924 = __p1_924; \
67891 int16x8_t __s2_924 = __p2_924; \
67892 int16x8_t __rev2_924; __rev2_924 = __builtin_shufflevector(__s2_924, __s2_924, 7, 6, 5, 4, 3, 2, 1, 0); \
67893 int16_t __ret_924; \
67894 __ret_924 = vqsubh_s16(__s0_924, vqrdmulhh_s16(__s1_924, __noswap_vgetq_lane_s16(__rev2_924, __p3_924))); \
67895 __ret_924; \
6622667896})
6622767897#endif
6622867898
......@@ -66535,136 +68205,136 @@ __ai int32x4_t vaddw_high_s16(int32x4_t __p0, int16x8_t __p1) {
6653568205#endif
6653668206
6653768207#ifdef __LITTLE_ENDIAN__
66538#define vcopyq_lane_p64(__p0_833, __p1_833, __p2_833, __p3_833) __extension__ ({ \
66539 poly64x2_t __s0_833 = __p0_833; \
66540 poly64x1_t __s2_833 = __p2_833; \
66541 poly64x2_t __ret_833; \
66542 __ret_833 = vsetq_lane_p64(vget_lane_p64(__s2_833, __p3_833), __s0_833, __p1_833); \
66543 __ret_833; \
68208#define vcopyq_lane_p64(__p0_925, __p1_925, __p2_925, __p3_925) __extension__ ({ \
68209 poly64x2_t __s0_925 = __p0_925; \
68210 poly64x1_t __s2_925 = __p2_925; \
68211 poly64x2_t __ret_925; \
68212 __ret_925 = vsetq_lane_p64(vget_lane_p64(__s2_925, __p3_925), __s0_925, __p1_925); \
68213 __ret_925; \
6654468214})
6654568215#else
66546#define vcopyq_lane_p64(__p0_834, __p1_834, __p2_834, __p3_834) __extension__ ({ \
66547 poly64x2_t __s0_834 = __p0_834; \
66548 poly64x1_t __s2_834 = __p2_834; \
66549 poly64x2_t __rev0_834; __rev0_834 = __builtin_shufflevector(__s0_834, __s0_834, 1, 0); \
66550 poly64x2_t __ret_834; \
66551 __ret_834 = __noswap_vsetq_lane_p64(vget_lane_p64(__s2_834, __p3_834), __rev0_834, __p1_834); \
66552 __ret_834 = __builtin_shufflevector(__ret_834, __ret_834, 1, 0); \
66553 __ret_834; \
68216#define vcopyq_lane_p64(__p0_926, __p1_926, __p2_926, __p3_926) __extension__ ({ \
68217 poly64x2_t __s0_926 = __p0_926; \
68218 poly64x1_t __s2_926 = __p2_926; \
68219 poly64x2_t __rev0_926; __rev0_926 = __builtin_shufflevector(__s0_926, __s0_926, 1, 0); \
68220 poly64x2_t __ret_926; \
68221 __ret_926 = __noswap_vsetq_lane_p64(vget_lane_p64(__s2_926, __p3_926), __rev0_926, __p1_926); \
68222 __ret_926 = __builtin_shufflevector(__ret_926, __ret_926, 1, 0); \
68223 __ret_926; \
6655468224})
6655568225#endif
6655668226
6655768227#ifdef __LITTLE_ENDIAN__
66558#define vcopyq_lane_f64(__p0_835, __p1_835, __p2_835, __p3_835) __extension__ ({ \
66559 float64x2_t __s0_835 = __p0_835; \
66560 float64x1_t __s2_835 = __p2_835; \
66561 float64x2_t __ret_835; \
66562 __ret_835 = vsetq_lane_f64(vget_lane_f64(__s2_835, __p3_835), __s0_835, __p1_835); \
66563 __ret_835; \
68228#define vcopyq_lane_f64(__p0_927, __p1_927, __p2_927, __p3_927) __extension__ ({ \
68229 float64x2_t __s0_927 = __p0_927; \
68230 float64x1_t __s2_927 = __p2_927; \
68231 float64x2_t __ret_927; \
68232 __ret_927 = vsetq_lane_f64(vget_lane_f64(__s2_927, __p3_927), __s0_927, __p1_927); \
68233 __ret_927; \
6656468234})
6656568235#else
66566#define vcopyq_lane_f64(__p0_836, __p1_836, __p2_836, __p3_836) __extension__ ({ \
66567 float64x2_t __s0_836 = __p0_836; \
66568 float64x1_t __s2_836 = __p2_836; \
66569 float64x2_t __rev0_836; __rev0_836 = __builtin_shufflevector(__s0_836, __s0_836, 1, 0); \
66570 float64x2_t __ret_836; \
66571 __ret_836 = __noswap_vsetq_lane_f64(vget_lane_f64(__s2_836, __p3_836), __rev0_836, __p1_836); \
66572 __ret_836 = __builtin_shufflevector(__ret_836, __ret_836, 1, 0); \
66573 __ret_836; \
68236#define vcopyq_lane_f64(__p0_928, __p1_928, __p2_928, __p3_928) __extension__ ({ \
68237 float64x2_t __s0_928 = __p0_928; \
68238 float64x1_t __s2_928 = __p2_928; \
68239 float64x2_t __rev0_928; __rev0_928 = __builtin_shufflevector(__s0_928, __s0_928, 1, 0); \
68240 float64x2_t __ret_928; \
68241 __ret_928 = __noswap_vsetq_lane_f64(vget_lane_f64(__s2_928, __p3_928), __rev0_928, __p1_928); \
68242 __ret_928 = __builtin_shufflevector(__ret_928, __ret_928, 1, 0); \
68243 __ret_928; \
6657468244})
6657568245#endif
6657668246
66577#define vcopy_lane_p64(__p0_837, __p1_837, __p2_837, __p3_837) __extension__ ({ \
66578 poly64x1_t __s0_837 = __p0_837; \
66579 poly64x1_t __s2_837 = __p2_837; \
66580 poly64x1_t __ret_837; \
66581 __ret_837 = vset_lane_p64(vget_lane_p64(__s2_837, __p3_837), __s0_837, __p1_837); \
66582 __ret_837; \
68247#define vcopy_lane_p64(__p0_929, __p1_929, __p2_929, __p3_929) __extension__ ({ \
68248 poly64x1_t __s0_929 = __p0_929; \
68249 poly64x1_t __s2_929 = __p2_929; \
68250 poly64x1_t __ret_929; \
68251 __ret_929 = vset_lane_p64(vget_lane_p64(__s2_929, __p3_929), __s0_929, __p1_929); \
68252 __ret_929; \
6658368253})
66584#define vcopy_lane_f64(__p0_838, __p1_838, __p2_838, __p3_838) __extension__ ({ \
66585 float64x1_t __s0_838 = __p0_838; \
66586 float64x1_t __s2_838 = __p2_838; \
66587 float64x1_t __ret_838; \
66588 __ret_838 = vset_lane_f64(vget_lane_f64(__s2_838, __p3_838), __s0_838, __p1_838); \
66589 __ret_838; \
68254#define vcopy_lane_f64(__p0_930, __p1_930, __p2_930, __p3_930) __extension__ ({ \
68255 float64x1_t __s0_930 = __p0_930; \
68256 float64x1_t __s2_930 = __p2_930; \
68257 float64x1_t __ret_930; \
68258 __ret_930 = vset_lane_f64(vget_lane_f64(__s2_930, __p3_930), __s0_930, __p1_930); \
68259 __ret_930; \
6659068260})
6659168261#ifdef __LITTLE_ENDIAN__
66592#define vcopyq_laneq_p64(__p0_839, __p1_839, __p2_839, __p3_839) __extension__ ({ \
66593 poly64x2_t __s0_839 = __p0_839; \
66594 poly64x2_t __s2_839 = __p2_839; \
66595 poly64x2_t __ret_839; \
66596 __ret_839 = vsetq_lane_p64(vgetq_lane_p64(__s2_839, __p3_839), __s0_839, __p1_839); \
66597 __ret_839; \
68262#define vcopyq_laneq_p64(__p0_931, __p1_931, __p2_931, __p3_931) __extension__ ({ \
68263 poly64x2_t __s0_931 = __p0_931; \
68264 poly64x2_t __s2_931 = __p2_931; \
68265 poly64x2_t __ret_931; \
68266 __ret_931 = vsetq_lane_p64(vgetq_lane_p64(__s2_931, __p3_931), __s0_931, __p1_931); \
68267 __ret_931; \
6659868268})
6659968269#else
66600#define vcopyq_laneq_p64(__p0_840, __p1_840, __p2_840, __p3_840) __extension__ ({ \
66601 poly64x2_t __s0_840 = __p0_840; \
66602 poly64x2_t __s2_840 = __p2_840; \
66603 poly64x2_t __rev0_840; __rev0_840 = __builtin_shufflevector(__s0_840, __s0_840, 1, 0); \
66604 poly64x2_t __rev2_840; __rev2_840 = __builtin_shufflevector(__s2_840, __s2_840, 1, 0); \
66605 poly64x2_t __ret_840; \
66606 __ret_840 = __noswap_vsetq_lane_p64(__noswap_vgetq_lane_p64(__rev2_840, __p3_840), __rev0_840, __p1_840); \
66607 __ret_840 = __builtin_shufflevector(__ret_840, __ret_840, 1, 0); \
66608 __ret_840; \
68270#define vcopyq_laneq_p64(__p0_932, __p1_932, __p2_932, __p3_932) __extension__ ({ \
68271 poly64x2_t __s0_932 = __p0_932; \
68272 poly64x2_t __s2_932 = __p2_932; \
68273 poly64x2_t __rev0_932; __rev0_932 = __builtin_shufflevector(__s0_932, __s0_932, 1, 0); \
68274 poly64x2_t __rev2_932; __rev2_932 = __builtin_shufflevector(__s2_932, __s2_932, 1, 0); \
68275 poly64x2_t __ret_932; \
68276 __ret_932 = __noswap_vsetq_lane_p64(__noswap_vgetq_lane_p64(__rev2_932, __p3_932), __rev0_932, __p1_932); \
68277 __ret_932 = __builtin_shufflevector(__ret_932, __ret_932, 1, 0); \
68278 __ret_932; \
6660968279})
6661068280#endif
6661168281
6661268282#ifdef __LITTLE_ENDIAN__
66613#define vcopyq_laneq_f64(__p0_841, __p1_841, __p2_841, __p3_841) __extension__ ({ \
66614 float64x2_t __s0_841 = __p0_841; \
66615 float64x2_t __s2_841 = __p2_841; \
66616 float64x2_t __ret_841; \
66617 __ret_841 = vsetq_lane_f64(vgetq_lane_f64(__s2_841, __p3_841), __s0_841, __p1_841); \
66618 __ret_841; \
68283#define vcopyq_laneq_f64(__p0_933, __p1_933, __p2_933, __p3_933) __extension__ ({ \
68284 float64x2_t __s0_933 = __p0_933; \
68285 float64x2_t __s2_933 = __p2_933; \
68286 float64x2_t __ret_933; \
68287 __ret_933 = vsetq_lane_f64(vgetq_lane_f64(__s2_933, __p3_933), __s0_933, __p1_933); \
68288 __ret_933; \
6661968289})
6662068290#else
66621#define vcopyq_laneq_f64(__p0_842, __p1_842, __p2_842, __p3_842) __extension__ ({ \
66622 float64x2_t __s0_842 = __p0_842; \
66623 float64x2_t __s2_842 = __p2_842; \
66624 float64x2_t __rev0_842; __rev0_842 = __builtin_shufflevector(__s0_842, __s0_842, 1, 0); \
66625 float64x2_t __rev2_842; __rev2_842 = __builtin_shufflevector(__s2_842, __s2_842, 1, 0); \
66626 float64x2_t __ret_842; \
66627 __ret_842 = __noswap_vsetq_lane_f64(__noswap_vgetq_lane_f64(__rev2_842, __p3_842), __rev0_842, __p1_842); \
66628 __ret_842 = __builtin_shufflevector(__ret_842, __ret_842, 1, 0); \
66629 __ret_842; \
68291#define vcopyq_laneq_f64(__p0_934, __p1_934, __p2_934, __p3_934) __extension__ ({ \
68292 float64x2_t __s0_934 = __p0_934; \
68293 float64x2_t __s2_934 = __p2_934; \
68294 float64x2_t __rev0_934; __rev0_934 = __builtin_shufflevector(__s0_934, __s0_934, 1, 0); \
68295 float64x2_t __rev2_934; __rev2_934 = __builtin_shufflevector(__s2_934, __s2_934, 1, 0); \
68296 float64x2_t __ret_934; \
68297 __ret_934 = __noswap_vsetq_lane_f64(__noswap_vgetq_lane_f64(__rev2_934, __p3_934), __rev0_934, __p1_934); \
68298 __ret_934 = __builtin_shufflevector(__ret_934, __ret_934, 1, 0); \
68299 __ret_934; \
6663068300})
6663168301#endif
6663268302
6663368303#ifdef __LITTLE_ENDIAN__
66634#define vcopy_laneq_p64(__p0_843, __p1_843, __p2_843, __p3_843) __extension__ ({ \
66635 poly64x1_t __s0_843 = __p0_843; \
66636 poly64x2_t __s2_843 = __p2_843; \
66637 poly64x1_t __ret_843; \
66638 __ret_843 = vset_lane_p64(vgetq_lane_p64(__s2_843, __p3_843), __s0_843, __p1_843); \
66639 __ret_843; \
68304#define vcopy_laneq_p64(__p0_935, __p1_935, __p2_935, __p3_935) __extension__ ({ \
68305 poly64x1_t __s0_935 = __p0_935; \
68306 poly64x2_t __s2_935 = __p2_935; \
68307 poly64x1_t __ret_935; \
68308 __ret_935 = vset_lane_p64(vgetq_lane_p64(__s2_935, __p3_935), __s0_935, __p1_935); \
68309 __ret_935; \
6664068310})
6664168311#else
66642#define vcopy_laneq_p64(__p0_844, __p1_844, __p2_844, __p3_844) __extension__ ({ \
66643 poly64x1_t __s0_844 = __p0_844; \
66644 poly64x2_t __s2_844 = __p2_844; \
66645 poly64x2_t __rev2_844; __rev2_844 = __builtin_shufflevector(__s2_844, __s2_844, 1, 0); \
66646 poly64x1_t __ret_844; \
66647 __ret_844 = vset_lane_p64(__noswap_vgetq_lane_p64(__rev2_844, __p3_844), __s0_844, __p1_844); \
66648 __ret_844; \
68312#define vcopy_laneq_p64(__p0_936, __p1_936, __p2_936, __p3_936) __extension__ ({ \
68313 poly64x1_t __s0_936 = __p0_936; \
68314 poly64x2_t __s2_936 = __p2_936; \
68315 poly64x2_t __rev2_936; __rev2_936 = __builtin_shufflevector(__s2_936, __s2_936, 1, 0); \
68316 poly64x1_t __ret_936; \
68317 __ret_936 = vset_lane_p64(__noswap_vgetq_lane_p64(__rev2_936, __p3_936), __s0_936, __p1_936); \
68318 __ret_936; \
6664968319})
6665068320#endif
6665168321
6665268322#ifdef __LITTLE_ENDIAN__
66653#define vcopy_laneq_f64(__p0_845, __p1_845, __p2_845, __p3_845) __extension__ ({ \
66654 float64x1_t __s0_845 = __p0_845; \
66655 float64x2_t __s2_845 = __p2_845; \
66656 float64x1_t __ret_845; \
66657 __ret_845 = vset_lane_f64(vgetq_lane_f64(__s2_845, __p3_845), __s0_845, __p1_845); \
66658 __ret_845; \
68323#define vcopy_laneq_f64(__p0_937, __p1_937, __p2_937, __p3_937) __extension__ ({ \
68324 float64x1_t __s0_937 = __p0_937; \
68325 float64x2_t __s2_937 = __p2_937; \
68326 float64x1_t __ret_937; \
68327 __ret_937 = vset_lane_f64(vgetq_lane_f64(__s2_937, __p3_937), __s0_937, __p1_937); \
68328 __ret_937; \
6665968329})
6666068330#else
66661#define vcopy_laneq_f64(__p0_846, __p1_846, __p2_846, __p3_846) __extension__ ({ \
66662 float64x1_t __s0_846 = __p0_846; \
66663 float64x2_t __s2_846 = __p2_846; \
66664 float64x2_t __rev2_846; __rev2_846 = __builtin_shufflevector(__s2_846, __s2_846, 1, 0); \
66665 float64x1_t __ret_846; \
66666 __ret_846 = vset_lane_f64(__noswap_vgetq_lane_f64(__rev2_846, __p3_846), __s0_846, __p1_846); \
66667 __ret_846; \
68331#define vcopy_laneq_f64(__p0_938, __p1_938, __p2_938, __p3_938) __extension__ ({ \
68332 float64x1_t __s0_938 = __p0_938; \
68333 float64x2_t __s2_938 = __p2_938; \
68334 float64x2_t __rev2_938; __rev2_938 = __builtin_shufflevector(__s2_938, __s2_938, 1, 0); \
68335 float64x1_t __ret_938; \
68336 __ret_938 = vset_lane_f64(__noswap_vgetq_lane_f64(__rev2_938, __p3_938), __s0_938, __p1_938); \
68337 __ret_938; \
6666868338})
6666968339#endif
6667068340
......@@ -67020,38 +68690,38 @@ __ai int32x4_t vmlsl_high_n_s16(int32x4_t __p0, int16x8_t __p1, int16_t __p2) {
6702068690}
6702168691#endif
6702268692
67023#define vmulx_lane_f64(__p0_847, __p1_847, __p2_847) __extension__ ({ \
67024 float64x1_t __s0_847 = __p0_847; \
67025 float64x1_t __s1_847 = __p1_847; \
67026 float64x1_t __ret_847; \
67027 float64_t __x_847 = vget_lane_f64(__s0_847, 0); \
67028 float64_t __y_847 = vget_lane_f64(__s1_847, __p2_847); \
67029 float64_t __z_847 = vmulxd_f64(__x_847, __y_847); \
67030 __ret_847 = vset_lane_f64(__z_847, __s0_847, __p2_847); \
67031 __ret_847; \
68693#define vmulx_lane_f64(__p0_939, __p1_939, __p2_939) __extension__ ({ \
68694 float64x1_t __s0_939 = __p0_939; \
68695 float64x1_t __s1_939 = __p1_939; \
68696 float64x1_t __ret_939; \
68697 float64_t __x_939 = vget_lane_f64(__s0_939, 0); \
68698 float64_t __y_939 = vget_lane_f64(__s1_939, __p2_939); \
68699 float64_t __z_939 = vmulxd_f64(__x_939, __y_939); \
68700 __ret_939 = vset_lane_f64(__z_939, __s0_939, __p2_939); \
68701 __ret_939; \
6703268702})
6703368703#ifdef __LITTLE_ENDIAN__
67034#define vmulx_laneq_f64(__p0_848, __p1_848, __p2_848) __extension__ ({ \
67035 float64x1_t __s0_848 = __p0_848; \
67036 float64x2_t __s1_848 = __p1_848; \
67037 float64x1_t __ret_848; \
67038 float64_t __x_848 = vget_lane_f64(__s0_848, 0); \
67039 float64_t __y_848 = vgetq_lane_f64(__s1_848, __p2_848); \
67040 float64_t __z_848 = vmulxd_f64(__x_848, __y_848); \
67041 __ret_848 = vset_lane_f64(__z_848, __s0_848, 0); \
67042 __ret_848; \
68704#define vmulx_laneq_f64(__p0_940, __p1_940, __p2_940) __extension__ ({ \
68705 float64x1_t __s0_940 = __p0_940; \
68706 float64x2_t __s1_940 = __p1_940; \
68707 float64x1_t __ret_940; \
68708 float64_t __x_940 = vget_lane_f64(__s0_940, 0); \
68709 float64_t __y_940 = vgetq_lane_f64(__s1_940, __p2_940); \
68710 float64_t __z_940 = vmulxd_f64(__x_940, __y_940); \
68711 __ret_940 = vset_lane_f64(__z_940, __s0_940, 0); \
68712 __ret_940; \
6704368713})
6704468714#else
67045#define vmulx_laneq_f64(__p0_849, __p1_849, __p2_849) __extension__ ({ \
67046 float64x1_t __s0_849 = __p0_849; \
67047 float64x2_t __s1_849 = __p1_849; \
67048 float64x2_t __rev1_849; __rev1_849 = __builtin_shufflevector(__s1_849, __s1_849, 1, 0); \
67049 float64x1_t __ret_849; \
67050 float64_t __x_849 = vget_lane_f64(__s0_849, 0); \
67051 float64_t __y_849 = __noswap_vgetq_lane_f64(__rev1_849, __p2_849); \
67052 float64_t __z_849 = vmulxd_f64(__x_849, __y_849); \
67053 __ret_849 = vset_lane_f64(__z_849, __s0_849, 0); \
67054 __ret_849; \
68715#define vmulx_laneq_f64(__p0_941, __p1_941, __p2_941) __extension__ ({ \
68716 float64x1_t __s0_941 = __p0_941; \
68717 float64x2_t __s1_941 = __p1_941; \
68718 float64x2_t __rev1_941; __rev1_941 = __builtin_shufflevector(__s1_941, __s1_941, 1, 0); \
68719 float64x1_t __ret_941; \
68720 float64_t __x_941 = vget_lane_f64(__s0_941, 0); \
68721 float64_t __y_941 = __noswap_vgetq_lane_f64(__rev1_941, __p2_941); \
68722 float64_t __z_941 = vmulxd_f64(__x_941, __y_941); \
68723 __ret_941 = vset_lane_f64(__z_941, __s0_941, 0); \
68724 __ret_941; \
6705568725})
6705668726#endif
6705768727
lib/include/arm_sve.h+80-80
......@@ -94,7 +94,7 @@ typedef __clang_svbfloat16x2_t svbfloat16x2_t;
9494typedef __clang_svbfloat16x3_t svbfloat16x3_t;
9595typedef __clang_svbfloat16x4_t svbfloat16x4_t;
9696#endif
97typedef enum
97enum svpattern
9898{
9999 SV_POW2 = 0,
100100 SV_VL1 = 1,
......@@ -113,9 +113,9 @@ typedef enum
113113 SV_MUL4 = 29,
114114 SV_MUL3 = 30,
115115 SV_ALL = 31
116} sv_pattern;
116};
117117
118typedef enum
118enum svprfop
119119{
120120 SV_PLDL1KEEP = 0,
121121 SV_PLDL1STRM = 1,
......@@ -129,7 +129,7 @@ typedef enum
129129 SV_PSTL2STRM = 11,
130130 SV_PSTL3KEEP = 12,
131131 SV_PSTL3STRM = 13
132} sv_prfop;
132};
133133
134134/* Function attributes */
135135#define __aio static inline __attribute__((__always_inline__, __nodebug__, __overloadable__))
......@@ -10013,69 +10013,69 @@ int16_t svorv(svbool_t, svint16_t);
1001310013__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svpfirst_b)))
1001410014svbool_t svpfirst(svbool_t, svbool_t);
1001510015__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);
1001710017__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);
1001910019__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);
1002110021__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);
1002310023__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);
1002510025__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);
1002710027__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);
1002910029__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);
1003110031__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);
1003310033__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);
1003510035__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);
1003710037__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);
1003910039__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);
1004110041__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);
1004310043__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);
1004510045__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);
1004710047__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);
1004910049__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);
1005110051__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);
1005310053__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);
1005510055__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);
1005710057__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);
1005910059__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);
1006110061__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);
1006310063__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);
1006510065__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);
1006710067__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);
1006910069__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);
1007110071__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);
1007310073__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);
1007510075__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);
1007710077__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);
1007910079__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqadd_n_s8)))
1008010080svint8_t svqadd(svint8_t, int8_t);
1008110081__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqadd_n_s32)))
......@@ -10117,13 +10117,13 @@ uint32_t svqdecb(uint32_t, uint64_t);
1011710117__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecb_n_u64)))
1011810118uint64_t svqdecb(uint64_t, uint64_t);
1011910119__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);
1012110121__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);
1012310123__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);
1012510125__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);
1012710127__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_n_s32)))
1012810128int32_t svqdecd(int32_t, uint64_t);
1012910129__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_n_s64)))
......@@ -10137,17 +10137,17 @@ svint64_t svqdecd(svint64_t, uint64_t);
1013710137__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecd_u64)))
1013810138svuint64_t svqdecd(svuint64_t, uint64_t);
1013910139__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);
1014110141__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);
1014310143__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);
1014510145__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);
1014710147__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);
1014910149__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);
1015110151__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_n_s32)))
1015210152int32_t svqdech(int32_t, uint64_t);
1015310153__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_n_s64)))
......@@ -10161,17 +10161,17 @@ svint16_t svqdech(svint16_t, uint64_t);
1016110161__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdech_u16)))
1016210162svuint16_t svqdech(svuint16_t, uint64_t);
1016310163__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);
1016510165__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);
1016710167__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);
1016910169__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);
1017110171__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);
1017310173__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);
1017510175__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecp_n_s32_b8)))
1017610176int32_t svqdecp_b8(int32_t, svbool_t);
1017710177__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecp_n_s32_b32)))
......@@ -10229,17 +10229,17 @@ svint32_t svqdecw(svint32_t, uint64_t);
1022910229__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqdecw_u32)))
1023010230svuint32_t svqdecw(svuint32_t, uint64_t);
1023110231__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);
1023310233__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);
1023510235__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);
1023710237__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);
1023910239__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);
1024110241__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);
1024310243__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_n_s32)))
1024410244int32_t svqincb(int32_t, uint64_t);
1024510245__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_n_s64)))
......@@ -10249,13 +10249,13 @@ uint32_t svqincb(uint32_t, uint64_t);
1024910249__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincb_n_u64)))
1025010250uint64_t svqincb(uint64_t, uint64_t);
1025110251__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);
1025310253__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);
1025510255__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);
1025710257__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);
1025910259__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_n_s32)))
1026010260int32_t svqincd(int32_t, uint64_t);
1026110261__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_n_s64)))
......@@ -10269,17 +10269,17 @@ svint64_t svqincd(svint64_t, uint64_t);
1026910269__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincd_u64)))
1027010270svuint64_t svqincd(svuint64_t, uint64_t);
1027110271__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);
1027310273__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);
1027510275__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);
1027710277__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);
1027910279__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);
1028110281__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);
1028310283__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_n_s32)))
1028410284int32_t svqinch(int32_t, uint64_t);
1028510285__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_n_s64)))
......@@ -10293,17 +10293,17 @@ svint16_t svqinch(svint16_t, uint64_t);
1029310293__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqinch_u16)))
1029410294svuint16_t svqinch(svuint16_t, uint64_t);
1029510295__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);
1029710297__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);
1029910299__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);
1030110301__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);
1030310303__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);
1030510305__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);
1030710307__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincp_n_s32_b8)))
1030810308int32_t svqincp_b8(int32_t, svbool_t);
1030910309__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincp_n_s32_b32)))
......@@ -10361,17 +10361,17 @@ svint32_t svqincw(svint32_t, uint64_t);
1036110361__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqincw_u32)))
1036210362svuint32_t svqincw(svuint32_t, uint64_t);
1036310363__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);
1036510365__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);
1036710367__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);
1036910369__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);
1037110371__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);
1037310373__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);
1037510375__aio __attribute__((__clang_arm_builtin_alias(__builtin_sve_svqsub_n_s8)))
1037610376svint8_t svqsub(svint8_t, int8_t);
1037710377__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)
92979297
92989298/* Vector-reduction arithmetic accepts vectors as inputs and produces scalars as
92999299 * outputs. This class of vector operation forms the basis of many scientific
9300 * computations. In vector-reduction arithmetic, the evaluation off is
9300 * computations. In vector-reduction arithmetic, the evaluation order is
93019301 * 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
93039306 * Used bisection method. At each step, we partition the vector with previous
93049307 * step in half, and the operation is performed on its two halves.
93059308 * This takes log2(n) steps where n is the number of elements in the vector.
93069309 */
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
93199311static __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);
93219313}
93229314
93239315static __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);
93259317}
93269318
93279319static __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);
93299321}
93309322
93319323static __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);
93339325}
93349326
93359327static __inline__ long long __DEFAULT_FN_ATTRS512
93369328_mm512_mask_reduce_add_epi64(__mmask8 __M, __m512i __W) {
93379329 __W = _mm512_maskz_mov_epi64(__M, __W);
9338 _mm512_mask_reduce_operator(+);
9330 return __builtin_ia32_reduce_add_q512(__W);
93399331}
93409332
93419333static __inline__ long long __DEFAULT_FN_ATTRS512
93429334_mm512_mask_reduce_mul_epi64(__mmask8 __M, __m512i __W) {
93439335 __W = _mm512_mask_mov_epi64(_mm512_set1_epi64(1), __M, __W);
9344 _mm512_mask_reduce_operator(*);
9336 return __builtin_ia32_reduce_mul_q512(__W);
93459337}
93469338
93479339static __inline__ long long __DEFAULT_FN_ATTRS512
93489340_mm512_mask_reduce_and_epi64(__mmask8 __M, __m512i __W) {
93499341 __W = _mm512_mask_mov_epi64(_mm512_set1_epi64(~0ULL), __M, __W);
9350 _mm512_mask_reduce_operator(&);
9342 return __builtin_ia32_reduce_and_q512(__W);
93519343}
93529344
93539345static __inline__ long long __DEFAULT_FN_ATTRS512
93549346_mm512_mask_reduce_or_epi64(__mmask8 __M, __m512i __W) {
93559347 __W = _mm512_maskz_mov_epi64(__M, __W);
9356 _mm512_mask_reduce_operator(|);
9348 return __builtin_ia32_reduce_or_q512(__W);
93579349}
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
93719354static __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);
93739356}
93749357
93759358static __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);
93779360}
93789361
93799362static __inline__ double __DEFAULT_FN_ATTRS512
93809363_mm512_mask_reduce_add_pd(__mmask8 __M, __m512d __W) {
93819364 __W = _mm512_maskz_mov_pd(__M, __W);
9382 _mm512_mask_reduce_operator(+);
9365 return __builtin_ia32_reduce_fadd_pd512(-0.0, __W);
93839366}
93849367
93859368static __inline__ double __DEFAULT_FN_ATTRS512
93869369_mm512_mask_reduce_mul_pd(__mmask8 __M, __m512d __W) {
93879370 __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);
93899372}
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
94059374static __inline__ int __DEFAULT_FN_ATTRS512
94069375_mm512_reduce_add_epi32(__m512i __W) {
9407 _mm512_mask_reduce_operator(+);
9376 return __builtin_ia32_reduce_add_d512((__v16si)__W);
94089377}
94099378
94109379static __inline__ int __DEFAULT_FN_ATTRS512
94119380_mm512_reduce_mul_epi32(__m512i __W) {
9412 _mm512_mask_reduce_operator(*);
9381 return __builtin_ia32_reduce_mul_d512((__v16si)__W);
94139382}
94149383
94159384static __inline__ int __DEFAULT_FN_ATTRS512
94169385_mm512_reduce_and_epi32(__m512i __W) {
9417 _mm512_mask_reduce_operator(&);
9386 return __builtin_ia32_reduce_and_d512((__v16si)__W);
94189387}
94199388
94209389static __inline__ int __DEFAULT_FN_ATTRS512
94219390_mm512_reduce_or_epi32(__m512i __W) {
9422 _mm512_mask_reduce_operator(|);
9391 return __builtin_ia32_reduce_or_d512((__v16si)__W);
94239392}
94249393
94259394static __inline__ int __DEFAULT_FN_ATTRS512
94269395_mm512_mask_reduce_add_epi32( __mmask16 __M, __m512i __W) {
94279396 __W = _mm512_maskz_mov_epi32(__M, __W);
9428 _mm512_mask_reduce_operator(+);
9397 return __builtin_ia32_reduce_add_d512((__v16si)__W);
94299398}
94309399
94319400static __inline__ int __DEFAULT_FN_ATTRS512
94329401_mm512_mask_reduce_mul_epi32( __mmask16 __M, __m512i __W) {
94339402 __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);
94359404}
94369405
94379406static __inline__ int __DEFAULT_FN_ATTRS512
94389407_mm512_mask_reduce_and_epi32( __mmask16 __M, __m512i __W) {
94399408 __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);
94419410}
94429411
94439412static __inline__ int __DEFAULT_FN_ATTRS512
94449413_mm512_mask_reduce_or_epi32(__mmask16 __M, __m512i __W) {
94459414 __W = _mm512_maskz_mov_epi32(__M, __W);
9446 _mm512_mask_reduce_operator(|);
9415 return __builtin_ia32_reduce_or_d512((__v16si)__W);
94479416}
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
94639418static __inline__ float __DEFAULT_FN_ATTRS512
94649419_mm512_reduce_add_ps(__m512 __W) {
9465 _mm512_mask_reduce_operator(+);
9420 return __builtin_ia32_reduce_fadd_ps512(-0.0f, __W);
94669421}
94679422
94689423static __inline__ float __DEFAULT_FN_ATTRS512
94699424_mm512_reduce_mul_ps(__m512 __W) {
9470 _mm512_mask_reduce_operator(*);
9425 return __builtin_ia32_reduce_fmul_ps512(1.0f, __W);
94719426}
94729427
94739428static __inline__ float __DEFAULT_FN_ATTRS512
94749429_mm512_mask_reduce_add_ps(__mmask16 __M, __m512 __W) {
94759430 __W = _mm512_maskz_mov_ps(__M, __W);
9476 _mm512_mask_reduce_operator(+);
9431 return __builtin_ia32_reduce_fadd_ps512(-0.0f, __W);
94779432}
94789433
94799434static __inline__ float __DEFAULT_FN_ATTRS512
94809435_mm512_mask_reduce_mul_ps(__mmask16 __M, __m512 __W) {
94819436 __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);
94839438}
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
94959440static __inline__ long long __DEFAULT_FN_ATTRS512
94969441_mm512_reduce_max_epi64(__m512i __V) {
9497 _mm512_mask_reduce_operator(max_epi64);
9442 return __builtin_ia32_reduce_smax_q512(__V);
94989443}
94999444
95009445static __inline__ unsigned long long __DEFAULT_FN_ATTRS512
95019446_mm512_reduce_max_epu64(__m512i __V) {
9502 _mm512_mask_reduce_operator(max_epu64);
9447 return __builtin_ia32_reduce_umax_q512(__V);
95039448}
95049449
95059450static __inline__ long long __DEFAULT_FN_ATTRS512
95069451_mm512_reduce_min_epi64(__m512i __V) {
9507 _mm512_mask_reduce_operator(min_epi64);
9452 return __builtin_ia32_reduce_smin_q512(__V);
95089453}
95099454
95109455static __inline__ unsigned long long __DEFAULT_FN_ATTRS512
95119456_mm512_reduce_min_epu64(__m512i __V) {
9512 _mm512_mask_reduce_operator(min_epu64);
9457 return __builtin_ia32_reduce_umin_q512(__V);
95139458}
95149459
95159460static __inline__ long long __DEFAULT_FN_ATTRS512
95169461_mm512_mask_reduce_max_epi64(__mmask8 __M, __m512i __V) {
95179462 __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);
95199464}
95209465
95219466static __inline__ unsigned long long __DEFAULT_FN_ATTRS512
95229467_mm512_mask_reduce_max_epu64(__mmask8 __M, __m512i __V) {
95239468 __V = _mm512_maskz_mov_epi64(__M, __V);
9524 _mm512_mask_reduce_operator(max_epu64);
9469 return __builtin_ia32_reduce_umax_q512(__V);
95259470}
95269471
95279472static __inline__ long long __DEFAULT_FN_ATTRS512
95289473_mm512_mask_reduce_min_epi64(__mmask8 __M, __m512i __V) {
95299474 __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);
95319476}
95329477
95339478static __inline__ unsigned long long __DEFAULT_FN_ATTRS512
95349479_mm512_mask_reduce_min_epu64(__mmask8 __M, __m512i __V) {
95359480 __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);
95379482}
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
95539483static __inline__ int __DEFAULT_FN_ATTRS512
95549484_mm512_reduce_max_epi32(__m512i __V) {
9555 _mm512_mask_reduce_operator(max_epi32);
9485 return __builtin_ia32_reduce_smax_d512((__v16si)__V);
95569486}
95579487
95589488static __inline__ unsigned int __DEFAULT_FN_ATTRS512
95599489_mm512_reduce_max_epu32(__m512i __V) {
9560 _mm512_mask_reduce_operator(max_epu32);
9490 return __builtin_ia32_reduce_umax_d512((__v16si)__V);
95619491}
95629492
95639493static __inline__ int __DEFAULT_FN_ATTRS512
95649494_mm512_reduce_min_epi32(__m512i __V) {
9565 _mm512_mask_reduce_operator(min_epi32);
9495 return __builtin_ia32_reduce_smin_d512((__v16si)__V);
95669496}
95679497
95689498static __inline__ unsigned int __DEFAULT_FN_ATTRS512
95699499_mm512_reduce_min_epu32(__m512i __V) {
9570 _mm512_mask_reduce_operator(min_epu32);
9500 return __builtin_ia32_reduce_umin_d512((__v16si)__V);
95719501}
95729502
95739503static __inline__ int __DEFAULT_FN_ATTRS512
95749504_mm512_mask_reduce_max_epi32(__mmask16 __M, __m512i __V) {
95759505 __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);
95779507}
95789508
95799509static __inline__ unsigned int __DEFAULT_FN_ATTRS512
95809510_mm512_mask_reduce_max_epu32(__mmask16 __M, __m512i __V) {
95819511 __V = _mm512_maskz_mov_epi32(__M, __V);
9582 _mm512_mask_reduce_operator(max_epu32);
9512 return __builtin_ia32_reduce_umax_d512((__v16si)__V);
95839513}
95849514
95859515static __inline__ int __DEFAULT_FN_ATTRS512
95869516_mm512_mask_reduce_min_epi32(__mmask16 __M, __m512i __V) {
95879517 __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);
95899519}
95909520
95919521static __inline__ unsigned int __DEFAULT_FN_ATTRS512
95929522_mm512_mask_reduce_min_epu32(__mmask16 __M, __m512i __V) {
95939523 __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);
95959525}
9596#undef _mm512_mask_reduce_operator
95979526
95989527#define _mm512_mask_reduce_operator(op) \
95999528 __m256d __t1 = _mm512_extractf64x4_pd(__V, 0); \
lib/include/avx512vlvnniintrin.h+150-55
......@@ -18,13 +18,157 @@
1818#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512vnni"), __min_vector_width__(128)))
1919#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_ATTRS256
23_mm256_dpbusd_epi32(__m256i __S, __m256i __A, __m256i __B)
24{
25 return (__m256i)__builtin_ia32_vpdpbusd256((__v8si)__S, (__v8si)__A,
26 (__v8si)__B);
27}
41/// Multiply groups of 4 adjacent pairs of unsigned 8-bit integers in \a A with
42/// corresponding signed 8-bit integers in \a B, producing 4 intermediate signed
43/// 16-bit results. Sum these 4 results with the corresponding 32-bit integer
44/// in \a S using signed saturation, and store the packed 32-bit results in DST.
45///
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
29173static __inline__ __m256i __DEFAULT_FN_ATTRS256
30174_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)
42186 (__v8si)_mm256_setzero_si256());
43187}
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
52189static __inline__ __m256i __DEFAULT_FN_ATTRS256
53190_mm256_mask_dpbusds_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)
54191{
......@@ -65,13 +202,6 @@ _mm256_maskz_dpbusds_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)
65202 (__v8si)_mm256_setzero_si256());
66203}
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
75205static __inline__ __m256i __DEFAULT_FN_ATTRS256
76206_mm256_mask_dpwssd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)
77207{
......@@ -88,13 +218,6 @@ _mm256_maskz_dpwssd_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)
88218 (__v8si)_mm256_setzero_si256());
89219}
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
98221static __inline__ __m256i __DEFAULT_FN_ATTRS256
99222_mm256_mask_dpwssds_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)
100223{
......@@ -111,13 +234,6 @@ _mm256_maskz_dpwssds_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)
111234 (__v8si)_mm256_setzero_si256());
112235}
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
121237static __inline__ __m128i __DEFAULT_FN_ATTRS128
122238_mm_mask_dpbusd_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)
123239{
......@@ -134,13 +250,6 @@ _mm_maskz_dpbusd_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)
134250 (__v4si)_mm_setzero_si128());
135251}
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
144253static __inline__ __m128i __DEFAULT_FN_ATTRS128
145254_mm_mask_dpbusds_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)
146255{
......@@ -157,13 +266,6 @@ _mm_maskz_dpbusds_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)
157266 (__v4si)_mm_setzero_si128());
158267}
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
167269static __inline__ __m128i __DEFAULT_FN_ATTRS128
168270_mm_mask_dpwssd_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)
169271{
......@@ -180,13 +282,6 @@ _mm_maskz_dpwssd_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)
180282 (__v4si)_mm_setzero_si128());
181283}
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
190285static __inline__ __m128i __DEFAULT_FN_ATTRS128
191286_mm_mask_dpwssds_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)
192287{
lib/include/avxintrin.h+3-3
......@@ -2245,7 +2245,7 @@ _mm256_cvttps_epi32(__m256 __a)
22452245
22462246/// Returns the first element of the input vector of [4 x double].
22472247///
2248/// \headerfile <avxintrin.h>
2248/// \headerfile <x86intrin.h>
22492249///
22502250/// This intrinsic is a utility function and does not correspond to a specific
22512251/// instruction.
......@@ -2261,7 +2261,7 @@ _mm256_cvtsd_f64(__m256d __a)
22612261
22622262/// Returns the first element of the input vector of [8 x i32].
22632263///
2264/// \headerfile <avxintrin.h>
2264/// \headerfile <x86intrin.h>
22652265///
22662266/// This intrinsic is a utility function and does not correspond to a specific
22672267/// instruction.
......@@ -2278,7 +2278,7 @@ _mm256_cvtsi256_si32(__m256i __a)
22782278
22792279/// Returns the first element of the input vector of [8 x float].
22802280///
2281/// \headerfile <avxintrin.h>
2281/// \headerfile <x86intrin.h>
22822282///
22832283/// This intrinsic is a utility function and does not correspond to a specific
22842284/// 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 @@
77 *===-----------------------------------------------------------------------===
88 */
99
10#ifndef __CPUID_H
11#define __CPUID_H
12
1013#if !(__x86_64__ || __i386__)
1114#error this header is for x86 only
1215#endif
......@@ -186,6 +189,7 @@
186189/* Features in %edx for leaf 7 sub-leaf 0 */
187190#define bit_AVX5124VNNIW 0x00000004
188191#define bit_AVX5124FMAPS 0x00000008
192#define bit_UINTR 0x00000020
189193#define bit_SERIALIZE 0x00004000
190194#define bit_TSXLDTRK 0x00010000
191195#define bit_PCONFIG 0x00040000
......@@ -195,7 +199,9 @@
195199#define bit_AMXINT8 0x02000000
196200
197201/* Features in %eax for leaf 7 sub-leaf 1 */
202#define bit_AVXVNNI 0x00000008
198203#define bit_AVX512BF16 0x00000020
204#define bit_HRESET 0x00400000
199205
200206/* Features in %eax for leaf 13 sub-leaf 1 */
201207#define bit_XSAVEOPT 0x00000001
......@@ -309,3 +315,5 @@ static __inline int __get_cpuid_count (unsigned int __leaf,
309315 __cpuid_count(__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx);
310316 return 1;
311317}
318
319#endif /* __CPUID_H */
lib/include/cuda_wrappers/algorithm+1-1
......@@ -1,4 +1,4 @@
1/*===---- complex - CUDA wrapper for <algorithm> ----------------------------===
1/*===---- algorithm - CUDA wrapper for <algorithm> -------------------------===
22 *
33 * Permission is hereby granted, free of charge, to any person obtaining a copy
44 * of this software and associated documentation files (the "Software"), to deal
lib/include/cuda_wrappers/new+9-1
......@@ -1,4 +1,4 @@
1/*===---- complex - CUDA wrapper for <new> ------------------------------===
1/*===---- new - CUDA wrapper for <new> -------------------------------------===
22 *
33 * Permission is hereby granted, free of charge, to any person obtaining a copy
44 * of this software and associated documentation files (the "Software"), to deal
......@@ -26,6 +26,13 @@
2626
2727#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
2936#pragma push_macro("CUDA_NOEXCEPT")
3037#if __cplusplus >= 201103L
3138#define CUDA_NOEXCEPT noexcept
......@@ -95,4 +102,5 @@ __device__ inline void operator delete[](void *, void *) CUDA_NOEXCEPT {}
95102
96103#pragma pop_macro("CUDA_NOEXCEPT")
97104
105#endif // __device__
98106#endif // include guard
lib/include/emmintrin.h+1-1
......@@ -4025,7 +4025,7 @@ _mm_storeu_si128(__m128i_u *__p, __m128i __b)
40254025///
40264026/// \param __p
40274027/// 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.
40294029/// \param __b
40304030/// A 128-bit integer vector containing the value to be stored.
40314031static __inline__ void __DEFAULT_FN_ATTRS
lib/include/gfniintrin.h+90-91
......@@ -14,38 +14,56 @@
1414#ifndef __GFNIINTRIN_H
1515#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
1830#define _mm_gf2p8affineinv_epi64_epi8(A, B, I) \
1931 (__m128i)__builtin_ia32_vgf2p8affineinvqb_v16qi((__v16qi)(__m128i)(A), \
2032 (__v16qi)(__m128i)(B), \
2133 (char)(I))
2234
23#define _mm_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) \
24 (__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \
25 (__v16qi)_mm_gf2p8affineinv_epi64_epi8(A, B, I), \
26 (__v16qi)(__m128i)(S))
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)
35#define _mm_gf2p8affine_epi64_epi8(A, B, I) \
36 (__m128i)__builtin_ia32_vgf2p8affineqb_v16qi((__v16qi)(__m128i)(A), \
37 (__v16qi)(__m128i)(B), \
38 (char)(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
3448#define _mm256_gf2p8affineinv_epi64_epi8(A, B, I) \
3549 (__m256i)__builtin_ia32_vgf2p8affineinvqb_v32qi((__v32qi)(__m256i)(A), \
3650 (__v32qi)(__m256i)(B), \
3751 (char)(I))
3852
39#define _mm256_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) \
40 (__m256i)__builtin_ia32_selectb_256((__mmask32)(U), \
41 (__v32qi)_mm256_gf2p8affineinv_epi64_epi8(A, B, I), \
42 (__v32qi)(__m256i)(S))
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)
53#define _mm256_gf2p8affine_epi64_epi8(A, B, I) \
54 (__m256i)__builtin_ia32_vgf2p8affineqb_v32qi((__v32qi)(__m256i)(A), \
55 (__v32qi)(__m256i)(B), \
56 (char)(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
4967#define _mm512_gf2p8affineinv_epi64_epi8(A, B, I) \
5068 (__m512i)__builtin_ia32_vgf2p8affineinvqb_v64qi((__v64qi)(__m512i)(A), \
5169 (__v64qi)(__m512i)(B), \
......@@ -60,27 +78,71 @@
6078 (__m512i)_mm512_mask_gf2p8affineinv_epi64_epi8((__m512i)_mm512_setzero_si512(), \
6179 U, A, B, I)
6280
63#define _mm_gf2p8affine_epi64_epi8(A, B, I) \
64 (__m128i)__builtin_ia32_vgf2p8affineqb_v16qi((__v16qi)(__m128i)(A), \
65 (__v16qi)(__m128i)(B), \
81#define _mm512_gf2p8affine_epi64_epi8(A, B, I) \
82 (__m512i)__builtin_ia32_vgf2p8affineqb_v64qi((__v64qi)(__m512i)(A), \
83 (__v64qi)(__m512i)(B), \
6684 (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
68137#define _mm_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) \
69138 (__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \
70139 (__v16qi)_mm_gf2p8affine_epi64_epi8(A, B, I), \
71140 (__v16qi)(__m128i)(S))
72141
73
74142#define _mm_maskz_gf2p8affine_epi64_epi8(U, A, B, I) \
75143 (__m128i)_mm_mask_gf2p8affine_epi64_epi8((__m128i)_mm_setzero_si128(), \
76144 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
84146#define _mm256_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) \
85147 (__m256i)__builtin_ia32_selectb_256((__mmask32)(U), \
86148 (__v32qi)_mm256_gf2p8affine_epi64_epi8(A, B, I), \
......@@ -90,41 +152,6 @@
90152 (__m256i)_mm256_mask_gf2p8affine_epi64_epi8((__m256i)_mm256_setzero_si256(), \
91153 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
128155static __inline__ __m128i __DEFAULT_FN_ATTRS_VL128
129156_mm_mask_gf2p8mul_epi8(__m128i __S, __mmask16 __U, __m128i __A, __m128i __B)
130157{
......@@ -140,13 +167,6 @@ _mm_maskz_gf2p8mul_epi8(__mmask16 __U, __m128i __A, __m128i __B)
140167 __U, __A, __B);
141168}
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
150170static __inline__ __m256i __DEFAULT_FN_ATTRS_VL256
151171_mm256_mask_gf2p8mul_epi8(__m256i __S, __mmask32 __U, __m256i __A, __m256i __B)
152172{
......@@ -161,28 +181,7 @@ _mm256_maskz_gf2p8mul_epi8(__mmask32 __U, __m256i __A, __m256i __B)
161181 return _mm256_mask_gf2p8mul_epi8((__m256i)_mm256_setzero_si256(),
162182 __U, __A, __B);
163183}
164
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}
184#endif /* __AVX512VLBWINTRIN_H */
186185
187186#undef __DEFAULT_FN_ATTRS
188187#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 @@
1414#ifndef __IA32INTRIN_H
1515#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
1729/** Find the first set bit starting from the lsb. Result is undefined if
1830 * input is 0.
1931 *
......@@ -26,7 +38,7 @@
2638 * A 32-bit integer operand.
2739 * \returns A 32-bit integer containing the bit number.
2840 */
29static __inline__ int __attribute__((__always_inline__, __nodebug__))
41static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
3042__bsfd(int __A) {
3143 return __builtin_ctz(__A);
3244}
......@@ -43,7 +55,7 @@ __bsfd(int __A) {
4355 * A 32-bit integer operand.
4456 * \returns A 32-bit integer containing the bit number.
4557 */
46static __inline__ int __attribute__((__always_inline__, __nodebug__))
58static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
4759__bsrd(int __A) {
4860 return 31 - __builtin_clz(__A);
4961}
......@@ -59,12 +71,12 @@ __bsrd(int __A) {
5971 * A 32-bit integer operand.
6072 * \returns A 32-bit integer containing the swapped bytes.
6173 */
62static __inline__ int __attribute__((__always_inline__, __nodebug__))
74static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
6375__bswapd(int __A) {
6476 return __builtin_bswap32(__A);
6577}
6678
67static __inline__ int __attribute__((__always_inline__, __nodebug__))
79static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
6880_bswap(int __A) {
6981 return __builtin_bswap32(__A);
7082}
......@@ -85,7 +97,7 @@ _bswap(int __A) {
8597 * A 64-bit integer operand.
8698 * \returns A 32-bit integer containing the bit number.
8799 */
88static __inline__ int __attribute__((__always_inline__, __nodebug__))
100static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
89101__bsfq(long long __A) {
90102 return __builtin_ctzll(__A);
91103}
......@@ -102,7 +114,7 @@ __bsfq(long long __A) {
102114 * A 64-bit integer operand.
103115 * \returns A 32-bit integer containing the bit number.
104116 */
105static __inline__ int __attribute__((__always_inline__, __nodebug__))
117static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
106118__bsrq(long long __A) {
107119 return 63 - __builtin_clzll(__A);
108120}
......@@ -118,7 +130,7 @@ __bsrq(long long __A) {
118130 * A 64-bit integer operand.
119131 * \returns A 64-bit integer containing the swapped bytes.
120132 */
121static __inline__ long long __attribute__((__always_inline__, __nodebug__))
133static __inline__ long long __DEFAULT_FN_ATTRS_CONSTEXPR
122134__bswapq(long long __A) {
123135 return __builtin_bswap64(__A);
124136}
......@@ -138,7 +150,7 @@ __bswapq(long long __A) {
138150 * \returns A 32-bit integer containing the number of bits with value 1 in the
139151 * source operand.
140152 */
141static __inline__ int __attribute__((__always_inline__, __nodebug__))
153static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
142154__popcntd(unsigned int __A)
143155{
144156 return __builtin_popcount(__A);
......@@ -159,7 +171,7 @@ __popcntd(unsigned int __A)
159171 * \returns A 64-bit integer containing the number of bits with value 1 in the
160172 * source operand.
161173 */
162static __inline__ long long __attribute__((__always_inline__, __nodebug__))
174static __inline__ long long __DEFAULT_FN_ATTRS_CONSTEXPR
163175__popcntq(unsigned long long __A)
164176{
165177 return __builtin_popcountll(__A);
......@@ -169,26 +181,26 @@ __popcntq(unsigned long long __A)
169181#endif /* __x86_64__ */
170182
171183#ifdef __x86_64__
172static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))
184static __inline__ unsigned long long __DEFAULT_FN_ATTRS
173185__readeflags(void)
174186{
175187 return __builtin_ia32_readeflags_u64();
176188}
177189
178static __inline__ void __attribute__((__always_inline__, __nodebug__))
190static __inline__ void __DEFAULT_FN_ATTRS
179191__writeeflags(unsigned long long __f)
180192{
181193 __builtin_ia32_writeeflags_u64(__f);
182194}
183195
184196#else /* !__x86_64__ */
185static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__))
197static __inline__ unsigned int __DEFAULT_FN_ATTRS
186198__readeflags(void)
187199{
188200 return __builtin_ia32_readeflags_u32();
189201}
190202
191static __inline__ void __attribute__((__always_inline__, __nodebug__))
203static __inline__ void __DEFAULT_FN_ATTRS
192204__writeeflags(unsigned int __f)
193205{
194206 __builtin_ia32_writeeflags_u32(__f);
......@@ -205,11 +217,9 @@ __writeeflags(unsigned int __f)
205217 * A 32-bit float value.
206218 * \returns a 32-bit unsigned integer containing the converted value.
207219 */
208static __inline__ unsigned int __attribute__((__always_inline__))
220static __inline__ unsigned int __DEFAULT_FN_ATTRS_CAST
209221_castf32_u32(float __A) {
210 unsigned int D;
211 __builtin_memcpy(&D, &__A, sizeof(__A));
212 return D;
222 return __builtin_bit_cast(unsigned int, __A);
213223}
214224
215225/** Cast a 64-bit float value to a 64-bit unsigned integer value
......@@ -222,11 +232,9 @@ _castf32_u32(float __A) {
222232 * A 64-bit float value.
223233 * \returns a 64-bit unsigned integer containing the converted value.
224234 */
225static __inline__ unsigned long long __attribute__((__always_inline__))
235static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CAST
226236_castf64_u64(double __A) {
227 unsigned long long D;
228 __builtin_memcpy(&D, &__A, sizeof(__A));
229 return D;
237 return __builtin_bit_cast(unsigned long long, __A);
230238}
231239
232240/** Cast a 32-bit unsigned integer value to a 32-bit float value
......@@ -239,11 +247,9 @@ _castf64_u64(double __A) {
239247 * A 32-bit unsigned integer value.
240248 * \returns a 32-bit float value containing the converted value.
241249 */
242static __inline__ float __attribute__((__always_inline__))
250static __inline__ float __DEFAULT_FN_ATTRS_CAST
243251_castu32_f32(unsigned int __A) {
244 float D;
245 __builtin_memcpy(&D, &__A, sizeof(__A));
246 return D;
252 return __builtin_bit_cast(float, __A);
247253}
248254
249255/** Cast a 64-bit unsigned integer value to a 64-bit float value
......@@ -256,11 +262,9 @@ _castu32_f32(unsigned int __A) {
256262 * A 64-bit unsigned integer value.
257263 * \returns a 64-bit float value containing the converted value.
258264 */
259static __inline__ double __attribute__((__always_inline__))
265static __inline__ double __DEFAULT_FN_ATTRS_CAST
260266_castu64_f64(unsigned long long __A) {
261 double D;
262 __builtin_memcpy(&D, &__A, sizeof(__A));
263 return D;
267 return __builtin_bit_cast(double, __A);
264268}
265269
266270/** Adds the unsigned integer operand to the CRC-32C checksum of the
......@@ -278,7 +282,7 @@ _castu64_f64(unsigned long long __A) {
278282 * \returns The result of adding operand \a __C to the CRC-32C checksum of
279283 * operand \a __D.
280284 */
281static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("sse4.2")))
285static __inline__ unsigned int __DEFAULT_FN_ATTRS_SSE42
282286__crc32b(unsigned int __C, unsigned char __D)
283287{
284288 return __builtin_ia32_crc32qi(__C, __D);
......@@ -299,7 +303,7 @@ __crc32b(unsigned int __C, unsigned char __D)
299303 * \returns The result of adding operand \a __C to the CRC-32C checksum of
300304 * operand \a __D.
301305 */
302static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("sse4.2")))
306static __inline__ unsigned int __DEFAULT_FN_ATTRS_SSE42
303307__crc32w(unsigned int __C, unsigned short __D)
304308{
305309 return __builtin_ia32_crc32hi(__C, __D);
......@@ -320,7 +324,7 @@ __crc32w(unsigned int __C, unsigned short __D)
320324 * \returns The result of adding operand \a __C to the CRC-32C checksum of
321325 * operand \a __D.
322326 */
323static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("sse4.2")))
327static __inline__ unsigned int __DEFAULT_FN_ATTRS_SSE42
324328__crc32d(unsigned int __C, unsigned int __D)
325329{
326330 return __builtin_ia32_crc32si(__C, __D);
......@@ -342,20 +346,20 @@ __crc32d(unsigned int __C, unsigned int __D)
342346 * \returns The result of adding operand \a __C to the CRC-32C checksum of
343347 * operand \a __D.
344348 */
345static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__, __target__("sse4.2")))
349static __inline__ unsigned long long __DEFAULT_FN_ATTRS_SSE42
346350__crc32q(unsigned long long __C, unsigned long long __D)
347351{
348352 return __builtin_ia32_crc32di(__C, __D);
349353}
350354#endif /* __x86_64__ */
351355
352static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))
356static __inline__ unsigned long long __DEFAULT_FN_ATTRS
353357__rdpmc(int __A) {
354358 return __builtin_ia32_rdpmc(__A);
355359}
356360
357361/* __rdtscp */
358static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))
362static __inline__ unsigned long long __DEFAULT_FN_ATTRS
359363__rdtscp(unsigned int *__A) {
360364 return __builtin_ia32_rdtscp(__A);
361365}
......@@ -364,48 +368,48 @@ __rdtscp(unsigned int *__A) {
364368
365369#define _rdpmc(A) __rdpmc(A)
366370
367static __inline__ void __attribute__((__always_inline__, __nodebug__))
371static __inline__ void __DEFAULT_FN_ATTRS
368372_wbinvd(void) {
369373 __builtin_ia32_wbinvd();
370374}
371375
372static __inline__ unsigned char __attribute__((__always_inline__, __nodebug__))
376static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
373377__rolb(unsigned char __X, int __C) {
374378 return __builtin_rotateleft8(__X, __C);
375379}
376380
377static __inline__ unsigned char __attribute__((__always_inline__, __nodebug__))
381static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR
378382__rorb(unsigned char __X, int __C) {
379383 return __builtin_rotateright8(__X, __C);
380384}
381385
382static __inline__ unsigned short __attribute__((__always_inline__, __nodebug__))
386static __inline__ unsigned short __DEFAULT_FN_ATTRS_CONSTEXPR
383387__rolw(unsigned short __X, int __C) {
384388 return __builtin_rotateleft16(__X, __C);
385389}
386390
387static __inline__ unsigned short __attribute__((__always_inline__, __nodebug__))
391static __inline__ unsigned short __DEFAULT_FN_ATTRS_CONSTEXPR
388392__rorw(unsigned short __X, int __C) {
389393 return __builtin_rotateright16(__X, __C);
390394}
391395
392static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__))
396static __inline__ unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR
393397__rold(unsigned int __X, int __C) {
394398 return __builtin_rotateleft32(__X, __C);
395399}
396400
397static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__))
401static __inline__ unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR
398402__rord(unsigned int __X, int __C) {
399403 return __builtin_rotateright32(__X, __C);
400404}
401405
402406#ifdef __x86_64__
403static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))
407static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CONSTEXPR
404408__rolq(unsigned long long __X, int __C) {
405409 return __builtin_rotateleft64(__X, __C);
406410}
407411
408static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))
412static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CONSTEXPR
409413__rorq(unsigned long long __X, int __C) {
410414 return __builtin_rotateright64(__X, __C);
411415}
......@@ -429,4 +433,9 @@ __rorq(unsigned long long __X, int __C) {
429433#define _rotwl(a,b) __rolw((a), (b))
430434#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
432441#endif /* __IA32INTRIN_H */
lib/include/immintrin.h+12
......@@ -10,6 +10,8 @@
1010#ifndef __IMMINTRIN_H
1111#define __IMMINTRIN_H
1212
13#include <x86gprintrin.h>
14
1315#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
1416 defined(__MMX__)
1517#include <mmintrin.h>
......@@ -143,6 +145,11 @@
143145#include <avx512vlvnniintrin.h>
144146#endif
145147
148#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
149 defined(__AVXVNNI__)
150#include <avxvnniintrin.h>
151#endif
152
146153#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
147154 defined(__AVX512DQ__)
148155#include <avx512dqintrin.h>
......@@ -471,6 +478,11 @@ _storebe_i64(void * __P, long long __D) {
471478#include <invpcidintrin.h>
472479#endif
473480
481#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
482 defined(__KL__) || defined(__WIDEKL__)
483#include <keylockerintrin.h>
484#endif
485
474486#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
475487 defined(__AMXTILE__) || defined(__AMXINT8__) || defined(__AMXBF16__)
476488#include <amxintrin.h>
lib/include/intrin.h+78-91
......@@ -57,16 +57,11 @@ void __addfsbyte(unsigned long, unsigned char);
5757void __addfsdword(unsigned long, unsigned long);
5858void __addfsword(unsigned long, unsigned short);
5959void __code_seg(const char *);
60static __inline__
6160void __cpuid(int[4], int);
62static __inline__
6361void __cpuidex(int[4], int, int);
64static __inline__
6562__int64 __emul(int, int);
66static __inline__
6763unsigned __int64 __emulu(unsigned int, unsigned int);
6864unsigned int __getcallerseflags(void);
69static __inline__
7065void __halt(void);
7166unsigned char __inbyte(unsigned short);
7267void __inbytestring(unsigned short, unsigned char *, unsigned long);
......@@ -82,13 +77,9 @@ void __inwordstring(unsigned short, unsigned short *, unsigned long);
8277void __lidt(void *);
8378unsigned __int64 __ll_lshift(unsigned __int64, int);
8479__int64 __ll_rshift(__int64, int);
85static __inline__
8680void __movsb(unsigned char *, unsigned char const *, size_t);
87static __inline__
8881void __movsd(unsigned long *, unsigned long const *, size_t);
89static __inline__
9082void __movsw(unsigned short *, unsigned short const *, size_t);
91static __inline__
9283void __nop(void);
9384void __nvreg_restore_fence(void);
9485void __nvreg_save_fence(void);
......@@ -105,23 +96,16 @@ unsigned long __readcr4(void);
10596unsigned long __readcr8(void);
10697unsigned int __readdr(unsigned int);
10798#ifdef __i386__
108static __inline__
10999unsigned char __readfsbyte(unsigned long);
110static __inline__
111100unsigned __int64 __readfsqword(unsigned long);
112static __inline__
113101unsigned short __readfsword(unsigned long);
114102#endif
115static __inline__
116103unsigned __int64 __readmsr(unsigned long);
117104unsigned __int64 __readpmc(unsigned long);
118105unsigned long __segmentlimit(unsigned long);
119106void __sidt(void *);
120static __inline__
121107void __stosb(unsigned char *, unsigned char, size_t);
122static __inline__
123108void __stosd(unsigned long *, unsigned long, size_t);
124static __inline__
125109void __stosw(unsigned short *, unsigned short, size_t);
126110void __svm_clgi(void);
127111void __svm_invlpga(void *, int);
......@@ -136,7 +120,6 @@ void __vmx_off(void);
136120void __vmx_vmptrst(unsigned __int64 *);
137121void __wbinvd(void);
138122void __writecr0(unsigned int);
139static __inline__
140123void __writecr3(unsigned __INTPTR_TYPE__);
141124void __writecr4(unsigned int);
142125void __writecr8(unsigned int);
......@@ -146,11 +129,8 @@ void __writefsdword(unsigned long, unsigned long);
146129void __writefsqword(unsigned long, unsigned __int64);
147130void __writefsword(unsigned long, unsigned short);
148131void __writemsr(unsigned long, unsigned __int64);
149static __inline__
150132void *_AddressOfReturnAddress(void);
151static __inline__
152133unsigned char _BitScanForward(unsigned long *_Index, unsigned long _Mask);
153static __inline__
154134unsigned char _BitScanReverse(unsigned long *_Index, unsigned long _Mask);
155135unsigned char _bittest(long const *, long);
156136unsigned char _bittestandcomplement(long *, long);
......@@ -169,12 +149,10 @@ long _InterlockedExchangeAdd_HLEAcquire(long volatile *, long);
169149long _InterlockedExchangeAdd_HLERelease(long volatile *, long);
170150__int64 _InterlockedExchangeAdd64_HLEAcquire(__int64 volatile *, __int64);
171151__int64 _InterlockedExchangeAdd64_HLERelease(__int64 volatile *, __int64);
172static __inline__ void
173__attribute__((__deprecated__("use other intrinsics or C++11 atomics instead")))
174_ReadBarrier(void);
175static __inline__ void
176__attribute__((__deprecated__("use other intrinsics or C++11 atomics instead")))
177_ReadWriteBarrier(void);
152void __attribute__((__deprecated__(
153 "use other intrinsics or C++11 atomics instead"))) _ReadBarrier(void);
154void __attribute__((__deprecated__(
155 "use other intrinsics or C++11 atomics instead"))) _ReadWriteBarrier(void);
178156unsigned int _rorx_u32(unsigned int, const unsigned int);
179157int _sarx_i32(int, unsigned int);
180158#if __STDC_HOSTED__
......@@ -185,9 +163,8 @@ unsigned int _shrx_u32(unsigned int, unsigned int);
185163void _Store_HLERelease(long volatile *, long);
186164void _Store64_HLERelease(__int64 volatile *, __int64);
187165void _StorePointer_HLERelease(void *volatile *, void *);
188static __inline__ void
189__attribute__((__deprecated__("use other intrinsics or C++11 atomics instead")))
190_WriteBarrier(void);
166void __attribute__((__deprecated__(
167 "use other intrinsics or C++11 atomics instead"))) _WriteBarrier(void);
191168unsigned __int32 xbegin(void);
192169void _xend(void);
193170
......@@ -197,19 +174,14 @@ void __addgsbyte(unsigned long, unsigned char);
197174void __addgsdword(unsigned long, unsigned long);
198175void __addgsqword(unsigned long, unsigned __int64);
199176void __addgsword(unsigned long, unsigned short);
200static __inline__
201177void __faststorefence(void);
202178void __incgsbyte(unsigned long);
203179void __incgsdword(unsigned long);
204180void __incgsqword(unsigned long);
205181void __incgsword(unsigned long);
206static __inline__
207182void __movsq(unsigned long long *, unsigned long long const *, size_t);
208static __inline__
209183unsigned char __readgsbyte(unsigned long);
210static __inline__
211184unsigned long __readgsdword(unsigned long);
212static __inline__
213185unsigned __int64 __readgsqword(unsigned long);
214186unsigned short __readgsword(unsigned long);
215187unsigned __int64 __shiftleft128(unsigned __int64 _LowPart,
......@@ -218,7 +190,6 @@ unsigned __int64 __shiftleft128(unsigned __int64 _LowPart,
218190unsigned __int64 __shiftright128(unsigned __int64 _LowPart,
219191 unsigned __int64 _HighPart,
220192 unsigned char _Shift);
221static __inline__
222193void __stosq(unsigned __int64 *, unsigned __int64, size_t);
223194unsigned char __vmx_on(unsigned __int64 *);
224195unsigned char __vmx_vmclear(unsigned __int64 *);
......@@ -243,10 +214,6 @@ unsigned char _interlockedbittestandreset64(__int64 volatile *, __int64);
243214unsigned char _interlockedbittestandset64(__int64 volatile *, __int64);
244215long _InterlockedCompareExchange_np(long volatile *_Destination, long _Exchange,
245216 long _Comparand);
246unsigned char _InterlockedCompareExchange128(__int64 volatile *_Destination,
247 __int64 _ExchangeHigh,
248 __int64 _ExchangeLow,
249 __int64 *_CompareandResult);
250217unsigned char _InterlockedCompareExchange128_np(__int64 volatile *_Destination,
251218 __int64 _ExchangeHigh,
252219 __int64 _ExchangeLow,
......@@ -269,13 +236,9 @@ unsigned __int64 _rorx_u64(unsigned __int64, const unsigned int);
269236__int64 _sarx_i64(__int64, unsigned int);
270237unsigned __int64 _shlx_u64(unsigned __int64, unsigned int);
271238unsigned __int64 _shrx_u64(unsigned __int64, unsigned int);
272static __inline__
273239__int64 __mulh(__int64, __int64);
274static __inline__
275240unsigned __int64 __umulh(unsigned __int64, unsigned __int64);
276static __inline__
277241__int64 _mul128(__int64, __int64, __int64*);
278static __inline__
279242unsigned __int64 _umul128(unsigned __int64,
280243 unsigned __int64,
281244 unsigned __int64*);
......@@ -284,29 +247,19 @@ unsigned __int64 _umul128(unsigned __int64,
284247
285248#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
286249
287static __inline__
288250unsigned char _BitScanForward64(unsigned long *_Index, unsigned __int64 _Mask);
289static __inline__
290251unsigned char _BitScanReverse64(unsigned long *_Index, unsigned __int64 _Mask);
291252
292253#endif
293254
294255#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
295static __inline__
296256__int64 _InterlockedDecrement64(__int64 volatile *_Addend);
297static __inline__
298257__int64 _InterlockedExchange64(__int64 volatile *_Target, __int64 _Value);
299static __inline__
300258__int64 _InterlockedExchangeAdd64(__int64 volatile *_Addend, __int64 _Value);
301static __inline__
302259__int64 _InterlockedExchangeSub64(__int64 volatile *_Subend, __int64 _Value);
303static __inline__
304260__int64 _InterlockedIncrement64(__int64 volatile *_Addend);
305static __inline__
306261__int64 _InterlockedOr64(__int64 volatile *_Value, __int64 _Mask);
307static __inline__
308262__int64 _InterlockedXor64(__int64 volatile *_Value, __int64 _Mask);
309static __inline__
310263__int64 _InterlockedAnd64(__int64 volatile *_Value, __int64 _Mask);
311264
312265#endif
......@@ -470,45 +423,81 @@ __int64 _InterlockedCompareExchange64_nf(__int64 volatile *_Destination,
470423__int64 _InterlockedCompareExchange64_rel(__int64 volatile *_Destination,
471424 __int64 _Exchange, __int64 _Comparand);
472425#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
474447/*----------------------------------------------------------------------------*\
475448|* movs, stos
476449\*----------------------------------------------------------------------------*/
477450#if defined(__i386__) || defined(__x86_64__)
478static __inline__ void __DEFAULT_FN_ATTRS
479__movsb(unsigned char *__dst, unsigned char const *__src, size_t __n) {
451static __inline__ void __DEFAULT_FN_ATTRS __movsb(unsigned char *__dst,
452 unsigned char const *__src,
453 size_t __n) {
480454 __asm__ __volatile__("rep movsb" : "+D"(__dst), "+S"(__src), "+c"(__n)
481455 : : "memory");
482456}
483static __inline__ void __DEFAULT_FN_ATTRS
484__movsd(unsigned long *__dst, unsigned long const *__src, size_t __n) {
485 __asm__ __volatile__("rep movsl" : "+D"(__dst), "+S"(__src), "+c"(__n)
486 : : "memory");
457static __inline__ void __DEFAULT_FN_ATTRS __movsd(unsigned long *__dst,
458 unsigned long const *__src,
459 size_t __n) {
460 __asm__ __volatile__("rep movsl"
461 : "+D"(__dst), "+S"(__src), "+c"(__n)
462 :
463 : "memory");
487464}
488static __inline__ void __DEFAULT_FN_ATTRS
489__movsw(unsigned short *__dst, unsigned short const *__src, size_t __n) {
490 __asm__ __volatile__("rep movsw" : "+D"(__dst), "+S"(__src), "+c"(__n)
491 : : "memory");
465static __inline__ void __DEFAULT_FN_ATTRS __movsw(unsigned short *__dst,
466 unsigned short const *__src,
467 size_t __n) {
468 __asm__ __volatile__("rep movsw"
469 : "+D"(__dst), "+S"(__src), "+c"(__n)
470 :
471 : "memory");
492472}
493static __inline__ void __DEFAULT_FN_ATTRS
494__stosd(unsigned long *__dst, unsigned long __x, size_t __n) {
495 __asm__ __volatile__("rep stosl" : "+D"(__dst), "+c"(__n) : "a"(__x)
473static __inline__ void __DEFAULT_FN_ATTRS __stosd(unsigned long *__dst,
474 unsigned long __x,
475 size_t __n) {
476 __asm__ __volatile__("rep stosl"
477 : "+D"(__dst), "+c"(__n)
478 : "a"(__x)
496479 : "memory");
497480}
498static __inline__ void __DEFAULT_FN_ATTRS
499__stosw(unsigned short *__dst, unsigned short __x, size_t __n) {
500 __asm__ __volatile__("rep stosw" : "+D"(__dst), "+c"(__n) : "a"(__x)
481static __inline__ void __DEFAULT_FN_ATTRS __stosw(unsigned short *__dst,
482 unsigned short __x,
483 size_t __n) {
484 __asm__ __volatile__("rep stosw"
485 : "+D"(__dst), "+c"(__n)
486 : "a"(__x)
501487 : "memory");
502488}
503489#endif
504490#ifdef __x86_64__
505static __inline__ void __DEFAULT_FN_ATTRS
506__movsq(unsigned long long *__dst, unsigned long long const *__src, size_t __n) {
507 __asm__ __volatile__("rep movsq" : "+D"(__dst), "+S"(__src), "+c"(__n)
508 : : "memory");
491static __inline__ void __DEFAULT_FN_ATTRS __movsq(
492 unsigned long long *__dst, unsigned long long const *__src, size_t __n) {
493 __asm__ __volatile__("rep movsq"
494 : "+D"(__dst), "+S"(__src), "+c"(__n)
495 :
496 : "memory");
509497}
510static __inline__ void __DEFAULT_FN_ATTRS
511__stosq(unsigned __int64 *__dst, unsigned __int64 __x, size_t __n) {
498static __inline__ void __DEFAULT_FN_ATTRS __stosq(unsigned __int64 *__dst,
499 unsigned __int64 __x,
500 size_t __n) {
512501 __asm__ __volatile__("rep stosq" : "+D"(__dst), "+c"(__n) : "a"(__x)
513502 : "memory");
514503}
......@@ -518,26 +507,25 @@ __stosq(unsigned __int64 *__dst, unsigned __int64 __x, size_t __n) {
518507|* Misc
519508\*----------------------------------------------------------------------------*/
520509#if defined(__i386__) || defined(__x86_64__)
521static __inline__ void __DEFAULT_FN_ATTRS
522__cpuid(int __info[4], int __level) {
523 __asm__ ("cpuid" : "=a"(__info[0]), "=b" (__info[1]), "=c"(__info[2]), "=d"(__info[3])
524 : "a"(__level), "c"(0));
510static __inline__ void __DEFAULT_FN_ATTRS __cpuid(int __info[4], int __level) {
511 __asm__("cpuid"
512 : "=a"(__info[0]), "=b"(__info[1]), "=c"(__info[2]), "=d"(__info[3])
513 : "a"(__level), "c"(0));
525514}
526static __inline__ void __DEFAULT_FN_ATTRS
527__cpuidex(int __info[4], int __level, int __ecx) {
528 __asm__ ("cpuid" : "=a"(__info[0]), "=b" (__info[1]), "=c"(__info[2]), "=d"(__info[3])
529 : "a"(__level), "c"(__ecx));
515static __inline__ void __DEFAULT_FN_ATTRS __cpuidex(int __info[4], int __level,
516 int __ecx) {
517 __asm__("cpuid"
518 : "=a"(__info[0]), "=b"(__info[1]), "=c"(__info[2]), "=d"(__info[3])
519 : "a"(__level), "c"(__ecx));
530520}
531static __inline__ void __DEFAULT_FN_ATTRS
532__halt(void) {
533 __asm__ volatile ("hlt");
521static __inline__ void __DEFAULT_FN_ATTRS __halt(void) {
522 __asm__ volatile("hlt");
534523}
535524#endif
536525
537526#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
538static __inline__ void __DEFAULT_FN_ATTRS
539__nop(void) {
540 __asm__ volatile ("nop");
527static __inline__ void __DEFAULT_FN_ATTRS __nop(void) {
528 __asm__ volatile("nop");
541529}
542530#endif
543531
......@@ -574,8 +562,7 @@ __readmsr(unsigned long __register) {
574562}
575563#endif
576564
577static __inline__ unsigned __LPTRINT_TYPE__ __DEFAULT_FN_ATTRS
578__readcr3(void) {
565static __inline__ unsigned __LPTRINT_TYPE__ __DEFAULT_FN_ATTRS __readcr3(void) {
579566 unsigned __LPTRINT_TYPE__ __cr3_val;
580567 __asm__ __volatile__ ("mov %%cr3, %0" : "=r"(__cr3_val) : : "memory");
581568 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)
5454static __inline__ void __attribute__((__always_inline__, __nodebug__))
5555_mm_free(void *__p)
5656{
57#if defined(__MINGW32__)
58 __mingw_aligned_free(__p);
59#elif defined(_WIN32)
60 _aligned_free(__p);
61#else
5762 free(__p);
63#endif
5864}
5965#endif
6066
lib/include/opencl-c-base.h+18
......@@ -9,6 +9,21 @@
99#ifndef _OPENCL_BASE_H_
1010#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
1227// built-in scalar data types:
1328
1429/**
......@@ -568,4 +583,7 @@ typedef struct {
568583#pragma OPENCL EXTENSION cl_intel_device_side_avc_motion_estimation : end
569584#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
571589#endif //_OPENCL_BASE_H_
lib/include/opencl-c.h+2
......@@ -4633,6 +4633,7 @@ float16 __ovld __cnfn convert_float16(float16);
46334633// Conversions with double data type parameters or return value.
46344634
46354635#ifdef cl_khr_fp64
4636#pragma OPENCL EXTENSION cl_khr_fp64 : enable
46364637char __ovld __cnfn convert_char(double);
46374638char __ovld __cnfn convert_char_rte(double);
46384639char __ovld __cnfn convert_char_rtn(double);
......@@ -5455,6 +5456,7 @@ double16 __ovld __cnfn convert_double16_rtz(ushort16);
54555456#endif //cl_khr_fp64
54565457
54575458#ifdef cl_khr_fp16
5459#pragma OPENCL EXTENSION cl_khr_fp16 : enable
54585460// Convert half types to non-double types.
54595461uchar __ovld __cnfn convert_uchar(half);
54605462uchar __ovld __cnfn convert_uchar_rte(half);
lib/include/openmp_wrappers/cmath+4-1
......@@ -24,8 +24,11 @@
2424// which might live in cstdlib.
2525#include <cstdlib>
2626
27// We need limits because __clang_cuda_cmath.h below uses `std::numeric_limit`.
28#include <limits>
29
2730#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
3033#define __CUDA__
3134#define __OPENMP_NVPTX__
lib/include/openmp_wrappers/complex+25
......@@ -25,3 +25,28 @@
2525
2626// Grab the host header too.
2727#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 @@
1313/* Define the default attributes for the functions in this file. */
1414#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
1622/// Counts the number of bits in the source operand having a value of 1.
1723///
1824/// \headerfile <x86intrin.h>
......@@ -23,7 +29,7 @@
2329/// An unsigned 32-bit integer operand.
2430/// \returns A 32-bit integer containing the number of bits with value 1 in the
2531/// source operand.
26static __inline__ int __DEFAULT_FN_ATTRS
32static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR
2733_mm_popcnt_u32(unsigned int __A)
2834{
2935 return __builtin_popcount(__A);
......@@ -40,7 +46,7 @@ _mm_popcnt_u32(unsigned int __A)
4046/// An unsigned 64-bit integer operand.
4147/// \returns A 64-bit integer containing the number of bits with value 1 in the
4248/// source operand.
43static __inline__ long long __DEFAULT_FN_ATTRS
49static __inline__ long long __DEFAULT_FN_ATTRS_CONSTEXPR
4450_mm_popcnt_u64(unsigned long long __A)
4551{
4652 return __builtin_popcountll(__A);
......@@ -48,5 +54,6 @@ _mm_popcnt_u64(unsigned long long __A)
4854#endif /* __x86_64__ */
4955
5056#undef __DEFAULT_FN_ATTRS
57#undef __DEFAULT_FN_ATTRS_CONSTEXPR
5158
5259#endif /* __POPCNTINTRIN_H */
lib/include/ppc_wrappers/smmintrin.h+24
......@@ -78,6 +78,30 @@ extern __inline __m128i
7878 return (__m128i)vec_sel((__v16qu)__A, (__v16qu)__B, __lmask);
7979}
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
81105#else
82106#include_next <smmintrin.h>
83107#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)));
1818
1919// Internal types determined by clang builtin definitions
2020typedef int32_t __v128_u __attribute__((__vector_size__(16), __aligned__(1)));
21typedef char __i8x16 __attribute__((__vector_size__(16), __aligned__(16)));
22typedef signed char __s8x16
21typedef signed char __i8x16
2322 __attribute__((__vector_size__(16), __aligned__(16)));
2423typedef unsigned char __u8x16
2524 __attribute__((__vector_size__(16), __aligned__(16)));
......@@ -35,6 +34,13 @@ typedef unsigned long long __u64x2
3534typedef float __f32x4 __attribute__((__vector_size__(16), __aligned__(16)));
3635typedef 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
3844#define __DEFAULT_FN_ATTRS \
3945 __attribute__((__always_inline__, __nodebug__, __target__("simd128"), \
4046 __min_vector_width__(128)))
......@@ -273,7 +279,7 @@ static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_splat(int8_t __a) {
273279 (__builtin_wasm_extract_lane_s_i8x16((__i8x16)(__a), __i))
274280
275281#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
278284#define wasm_i8x16_replace_lane(__a, __i, __b) \
279285 ((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) {
286292 (__builtin_wasm_extract_lane_s_i16x8((__i16x8)(__a), __i))
287293
288294#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
291297#define wasm_i16x8_replace_lane(__a, __i, __b) \
292298 ((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) {
333339
334340static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_eq(v128_t __a,
335341 v128_t __b) {
336 return (v128_t)((__s8x16)__a == (__s8x16)__b);
342 return (v128_t)((__i8x16)__a == (__i8x16)__b);
337343}
338344
339345static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_ne(v128_t __a,
340346 v128_t __b) {
341 return (v128_t)((__s8x16)__a != (__s8x16)__b);
347 return (v128_t)((__i8x16)__a != (__i8x16)__b);
342348}
343349
344350static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_lt(v128_t __a,
345351 v128_t __b) {
346 return (v128_t)((__s8x16)__a < (__s8x16)__b);
352 return (v128_t)((__i8x16)__a < (__i8x16)__b);
347353}
348354
349355static __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
354360static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_gt(v128_t __a,
355361 v128_t __b) {
356 return (v128_t)((__s8x16)__a > (__s8x16)__b);
362 return (v128_t)((__i8x16)__a > (__i8x16)__b);
357363}
358364
359365static __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
364370static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_le(v128_t __a,
365371 v128_t __b) {
366 return (v128_t)((__s8x16)__a <= (__s8x16)__b);
372 return (v128_t)((__i8x16)__a <= (__i8x16)__b);
367373}
368374
369375static __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
374380static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_ge(v128_t __a,
375381 v128_t __b) {
376 return (v128_t)((__s8x16)__a >= (__s8x16)__b);
382 return (v128_t)((__i8x16)__a >= (__i8x16)__b);
377383}
378384
379385static __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,
595601
596602static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i8x16_shr(v128_t __a,
597603 int32_t __b) {
598 return (v128_t)((__s8x16)__a >> __b);
604 return (v128_t)((__i8x16)__a >> __b);
599605}
600606
601607static __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) {
616622
617623static __inline__ v128_t __DEFAULT_FN_ATTRS
618624wasm_u8x16_add_saturate(v128_t __a, v128_t __b) {
619 return (v128_t)__builtin_wasm_add_saturate_u_i8x16((__i8x16)__a,
620 (__i8x16)__b);
625 return (v128_t)__builtin_wasm_add_saturate_u_i8x16((__u8x16)__a,
626 (__u8x16)__b);
621627}
622628
623629static __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) {
633639
634640static __inline__ v128_t __DEFAULT_FN_ATTRS
635641wasm_u8x16_sub_saturate(v128_t __a, v128_t __b) {
636 return (v128_t)__builtin_wasm_sub_saturate_u_i8x16((__i8x16)__a,
637 (__i8x16)__b);
642 return (v128_t)__builtin_wasm_sub_saturate_u_i8x16((__u8x16)__a,
643 (__u8x16)__b);
638644}
639645
640646static __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
645651static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_min(v128_t __a,
646652 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);
648654}
649655
650656static __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
655661static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_max(v128_t __a,
656662 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);
658664}
659665
660666static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u8x16_avgr(v128_t __a,
661667 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);
663669}
664670
665671static __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) {
706712
707713static __inline__ v128_t __DEFAULT_FN_ATTRS
708714wasm_u16x8_add_saturate(v128_t __a, v128_t __b) {
709 return (v128_t)__builtin_wasm_add_saturate_u_i16x8((__i16x8)__a,
710 (__i16x8)__b);
715 return (v128_t)__builtin_wasm_add_saturate_u_i16x8((__u16x8)__a,
716 (__u16x8)__b);
711717}
712718
713719static __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) {
723729
724730static __inline__ v128_t __DEFAULT_FN_ATTRS
725731wasm_u16x8_sub_saturate(v128_t __a, v128_t __b) {
726 return (v128_t)__builtin_wasm_sub_saturate_u_i16x8((__i16x8)__a,
727 (__i16x8)__b);
732 return (v128_t)__builtin_wasm_sub_saturate_u_i16x8((__u16x8)__a,
733 (__u16x8)__b);
728734}
729735
730736static __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,
739745
740746static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u16x8_min(v128_t __a,
741747 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);
743749}
744750
745751static __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
750756static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u16x8_max(v128_t __a,
751757 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);
753759}
754760
755761static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u16x8_avgr(v128_t __a,
756762 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);
758764}
759765
760766static __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,
810816
811817static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u32x4_min(v128_t __a,
812818 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);
814820}
815821
816822static __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
821827static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_u32x4_max(v128_t __a,
822828 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);
824830}
825831
826832static __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) {
10711077
10721078static __inline__ v128_t __DEFAULT_FN_ATTRS
10731079wasm_u8x16_narrow_i16x8(v128_t __a, v128_t __b) {
1074 return (v128_t)__builtin_wasm_narrow_u_i8x16_i16x8((__i16x8)__a,
1075 (__i16x8)__b);
1080 return (v128_t)__builtin_wasm_narrow_u_i8x16_i16x8((__u16x8)__a,
1081 (__u16x8)__b);
10761082}
10771083
10781084static __inline__ v128_t __DEFAULT_FN_ATTRS
......@@ -1083,48 +1089,76 @@ wasm_i16x8_narrow_i32x4(v128_t __a, v128_t __b) {
10831089
10841090static __inline__ v128_t __DEFAULT_FN_ATTRS
10851091wasm_u16x8_narrow_i32x4(v128_t __a, v128_t __b) {
1086 return (v128_t)__builtin_wasm_narrow_u_i16x8_i32x4((__i32x4)__a,
1087 (__i32x4)__b);
1092 return (v128_t)__builtin_wasm_narrow_u_i16x8_i32x4((__u32x4)__a,
1093 (__u32x4)__b);
10881094}
10891095
10901096static __inline__ v128_t __DEFAULT_FN_ATTRS
10911097wasm_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);
10931103}
10941104
10951105static __inline__ v128_t __DEFAULT_FN_ATTRS
10961106wasm_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);
10981112}
10991113
11001114static __inline__ v128_t __DEFAULT_FN_ATTRS
11011115wasm_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);
11031121}
11041122
11051123static __inline__ v128_t __DEFAULT_FN_ATTRS
11061124wasm_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);
11081130}
11091131
11101132static __inline__ v128_t __DEFAULT_FN_ATTRS
11111133wasm_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);
11131138}
11141139
11151140static __inline__ v128_t __DEFAULT_FN_ATTRS
11161141wasm_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);
11181146}
11191147
11201148static __inline__ v128_t __DEFAULT_FN_ATTRS
11211149wasm_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);
11231154}
11241155
11251156static __inline__ v128_t __DEFAULT_FN_ATTRS
11261157wasm_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);
11281162}
11291163
11301164// 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 @@
1111#define _LIBCPP___BIT_REFERENCE
1212
1313#include <__config>
14#include <bit>
14#include <__bits>
1515#include <algorithm>
1616
1717#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
......@@ -239,8 +239,8 @@ __bit_iterator<_Cp, _IsConst>
239239find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_)
240240{
241241 if (static_cast<bool>(__value_))
242 return __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));
242 return _VSTD::__find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
243 return _VSTD::__find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
244244}
245245
246246// count
......@@ -313,8 +313,8 @@ typename __bit_iterator<_Cp, _IsConst>::difference_type
313313count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_)
314314{
315315 if (static_cast<bool>(__value_))
316 return __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));
316 return _VSTD::__count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
317 return _VSTD::__count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first));
318318}
319319
320320// fill_n
......@@ -387,9 +387,9 @@ fill_n(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n, bool __v
387387 if (__n > 0)
388388 {
389389 if (__value_)
390 __fill_n_true(__first, __n);
390 _VSTD::__fill_n_true(__first, __n);
391391 else
392 __fill_n_false(__first, __n);
392 _VSTD::__fill_n_false(__first, __n);
393393 }
394394}
395395
......@@ -538,8 +538,8 @@ __bit_iterator<_Cp, false>
538538copy(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
539539{
540540 if (__first.__ctz_ == __result.__ctz_)
541 return __copy_aligned(__first, __last, __result);
542 return __copy_unaligned(__first, __last, __result);
541 return _VSTD::__copy_aligned(__first, __last, __result);
542 return _VSTD::__copy_unaligned(__first, __last, __result);
543543}
544544
545545// copy_backward
......@@ -685,8 +685,8 @@ __bit_iterator<_Cp, false>
685685copy_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result)
686686{
687687 if (__last.__ctz_ == __result.__ctz_)
688 return __copy_backward_aligned(__first, __last, __result);
689 return __copy_backward_unaligned(__first, __last, __result);
688 return _VSTD::__copy_backward_aligned(__first, __last, __result);
689 return _VSTD::__copy_backward_unaligned(__first, __last, __result);
690690}
691691
692692// move
......@@ -868,8 +868,8 @@ swap_ranges(__bit_iterator<__C1, false> __first1, __bit_iterator<__C1, false> __
868868 __bit_iterator<__C2, false> __first2)
869869{
870870 if (__first1.__ctz_ == __first2.__ctz_)
871 return __swap_ranges_aligned(__first1, __last1, __first2);
872 return __swap_ranges_unaligned(__first1, __last1, __first2);
871 return _VSTD::__swap_ranges_aligned(__first1, __last1, __first2);
872 return _VSTD::__swap_ranges_unaligned(__first1, __last1, __first2);
873873}
874874
875875// rotate
......@@ -1083,8 +1083,8 @@ bool
10831083equal(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, __bit_iterator<_Cp, _IC2> __first2)
10841084{
10851085 if (__first1.__ctz_ == __first2.__ctz_)
1086 return __equal_aligned(__first1, __last1, __first2);
1087 return __equal_unaligned(__first1, __last1, __first2);
1086 return _VSTD::__equal_aligned(__first1, __last1, __first2);
1087 return _VSTD::__equal_unaligned(__first1, __last1, __first2);
10881088}
10891089
10901090template <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 @@
3232# define _GNUC_VER_NEW 0
3333#endif
3434
35#define _LIBCPP_VERSION 11000
35#define _LIBCPP_VERSION 12000
3636
3737#ifndef _LIBCPP_ABI_VERSION
3838# define _LIBCPP_ABI_VERSION 1
3939#endif
4040
41#ifndef __STDC_HOSTED__
41#if __STDC_HOSTED__ == 0
4242# define _LIBCPP_FREESTANDING
4343#endif
4444
......@@ -49,8 +49,10 @@
4949# define _LIBCPP_STD_VER 14
5050# elif __cplusplus <= 201703L
5151# define _LIBCPP_STD_VER 17
52# elif __cplusplus <= 202002L
53# define _LIBCPP_STD_VER 20
5254# else
53# define _LIBCPP_STD_VER 18 // current year, or date of c++2a ratification
55# define _LIBCPP_STD_VER 21 // current year, or date of c++2b ratification
5456# endif
5557#endif // _LIBCPP_STD_VER
5658
......@@ -63,7 +65,7 @@
6365#elif defined(__wasm__)
6466# define _LIBCPP_OBJECT_FORMAT_WASM 1
6567#else
66# error Unknown object file format
68 // ... add new file formats here ...
6769#endif
6870
6971#if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
......@@ -105,6 +107,10 @@
105107// Re-worked external template instantiations for std::string with a focus on
106108// performance and fast-path inlining.
107109# 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
108114#elif _LIBCPP_ABI_VERSION == 1
109115# if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
110116// Enable compiling copies of now inline methods into the dylib to support
......@@ -121,9 +127,11 @@
121127# endif
122128#endif
123129
124#ifdef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
125#error "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. \
126 use _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR instead
130#if defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
131// Enable additional explicit instantiations of iostreams components. This
132// 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
127135#endif
128136
129137#define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y
......@@ -256,14 +264,14 @@
256264# endif // __LONG_LONG_SUPPORTED
257265#endif // __FreeBSD__
258266
259#ifdef __NetBSD__
267#if defined(__NetBSD__) || defined(__OpenBSD__)
260268# include <sys/endian.h>
261269# if _BYTE_ORDER == _LITTLE_ENDIAN
262270# define _LIBCPP_LITTLE_ENDIAN
263271# else // _BYTE_ORDER == _LITTLE_ENDIAN
264272# define _LIBCPP_BIG_ENDIAN
265273# endif // _BYTE_ORDER == _LITTLE_ENDIAN
266#endif // __NetBSD__
274#endif // defined(__NetBSD__) || defined(__OpenBSD__)
267275
268276#if defined(_WIN32)
269277# define _LIBCPP_WIN32API
......@@ -304,7 +312,7 @@
304312# endif
305313#endif // __sun__
306314
307#if defined(__CloudABI__)
315#if defined(__OpenBSD__) || defined(__CloudABI__)
308316 // Certain architectures provide arc4random(). Prefer using
309317 // arc4random() over /dev/{u,}random to make it possible to obtain
310318 // random data even when using sandboxing mechanisms such as chroots,
......@@ -344,13 +352,11 @@
344352# if defined(__FreeBSD__)
345353# define _LIBCPP_HAS_ALIGNED_ALLOC
346354# define _LIBCPP_HAS_QUICK_EXIT
347# define _LIBCPP_HAS_C11_FEATURES
348355# if __FreeBSD_version >= 1300064 || \
349356 (__FreeBSD_version >= 1201504 && __FreeBSD_version < 1300000)
350357# define _LIBCPP_HAS_TIMESPEC_GET
351358# endif
352359# elif defined(__BIONIC__)
353# define _LIBCPP_HAS_C11_FEATURES
354360# if __ANDROID_API__ >= 21
355361# define _LIBCPP_HAS_QUICK_EXIT
356362# endif
......@@ -364,7 +370,9 @@
364370# define _LIBCPP_HAS_ALIGNED_ALLOC
365371# define _LIBCPP_HAS_QUICK_EXIT
366372# define _LIBCPP_HAS_TIMESPEC_GET
367# define _LIBCPP_HAS_C11_FEATURES
373# elif defined(__OpenBSD__)
374# define _LIBCPP_HAS_ALIGNED_ALLOC
375# define _LIBCPP_HAS_TIMESPEC_GET
368376# elif defined(__linux__)
369377# if !defined(_LIBCPP_HAS_MUSL_LIBC)
370378# if _LIBCPP_GLIBC_PREREQ(2, 15) || defined(__BIONIC__)
......@@ -372,16 +380,24 @@
372380# endif
373381# if _LIBCPP_GLIBC_PREREQ(2, 17)
374382# define _LIBCPP_HAS_ALIGNED_ALLOC
375# define _LIBCPP_HAS_C11_FEATURES
376383# define _LIBCPP_HAS_TIMESPEC_GET
377384# endif
378385# else // defined(_LIBCPP_HAS_MUSL_LIBC)
379386# define _LIBCPP_HAS_ALIGNED_ALLOC
380387# define _LIBCPP_HAS_QUICK_EXIT
381388# define _LIBCPP_HAS_TIMESPEC_GET
382# define _LIBCPP_HAS_C11_FEATURES
383389# 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__
385401#endif
386402
387403#ifndef _LIBCPP_CXX03_LANG
......@@ -389,9 +405,7 @@
389405#elif defined(_LIBCPP_COMPILER_CLANG)
390406# define _LIBCPP_ALIGNOF(_Tp) _Alignof(_Tp)
391407#else
392// This definition is potentially buggy, but it's only taken with GCC in C++03,
393// which we barely support anyway. See llvm.org/PR39713
394# define _LIBCPP_ALIGNOF(_Tp) __alignof(_Tp)
408# error "We don't know a correct way to implement alignof(T) in C++03 outside of Clang"
395409#endif
396410
397411#define _LIBCPP_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp)
......@@ -433,10 +447,6 @@ typedef __char32_t char32_t;
433447# define _LIBCPP_NORETURN __attribute__ ((noreturn))
434448#endif
435449
436#if !(__has_feature(cxx_lambdas))
437#define _LIBCPP_HAS_NO_LAMBDAS
438#endif
439
440450#if !(__has_feature(cxx_nullptr))
441451# if (__has_extension(cxx_nullptr) || __has_keyword(__nullptr)) && defined(_LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR)
442452# define nullptr __nullptr
......@@ -445,18 +455,6 @@ typedef __char32_t char32_t;
445455# endif
446456#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
460458// Objective-C++ features (opt-in)
461459#if __has_feature(objc_arc)
462460#define _LIBCPP_HAS_OBJC_ARC
......@@ -720,7 +718,7 @@ typedef __char32_t char32_t;
720718#endif
721719
722720#ifndef _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
723# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
721# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
724722# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __attribute__ ((__visibility__("default")))
725723# else
726724# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
......@@ -754,16 +752,6 @@ typedef __char32_t char32_t;
754752# endif
755753#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
767755#ifndef _LIBCPP_HIDE_FROM_ABI
768756# if _LIBCPP_HIDE_FROM_ABI_PER_TU
769757# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_INTERNAL_LINKAGE
......@@ -838,6 +826,12 @@ typedef unsigned int char32_t;
838826# define _LIBCPP_CONSTEXPR constexpr
839827#endif
840828
829#ifndef __cpp_consteval
830# define _LIBCPP_CONSTEVAL _LIBCPP_CONSTEXPR
831#else
832# define _LIBCPP_CONSTEVAL consteval
833#endif
834
841835#ifdef _LIBCPP_CXX03_LANG
842836# define _LIBCPP_DEFAULT {}
843837#else
......@@ -863,10 +857,6 @@ typedef unsigned int char32_t;
863857# define _LIBCPP_EXPLICIT
864858#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
870860#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
871861# define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
872862# define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
......@@ -880,34 +870,43 @@ typedef unsigned int char32_t;
880870# define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
881871#endif // _LIBCPP_HAS_NO_STRONG_ENUMS
882872
883#ifdef _LIBCPP_DEBUG
884# if _LIBCPP_DEBUG == 0
885# define _LIBCPP_DEBUG_LEVEL 1
886# elif _LIBCPP_DEBUG == 1
887# define _LIBCPP_DEBUG_LEVEL 2
888# else
889# error Supported values for _LIBCPP_DEBUG are 0 and 1
890# endif
891# if !defined(_LIBCPP_BUILDING_LIBRARY)
892# define _LIBCPP_EXTERN_TEMPLATE(...)
893# endif
873// _LIBCPP_DEBUG potential values:
874// - undefined: No assertions. This is the default.
875// - 0: Basic assertions
876// - 1: Basic assertions + iterator validity checks.
877#if !defined(_LIBCPP_DEBUG)
878# define _LIBCPP_DEBUG_LEVEL 0
879#elif _LIBCPP_DEBUG == 0
880# define _LIBCPP_DEBUG_LEVEL 1
881#elif _LIBCPP_DEBUG == 1
882# define _LIBCPP_DEBUG_LEVEL 2
883#else
884# error Supported values for _LIBCPP_DEBUG are 0 and 1
894885#endif
895886
896#ifndef _LIBCPP_DEBUG_LEVEL
897# define _LIBCPP_DEBUG_LEVEL 0
887// _LIBCPP_DEBUG_LEVEL is always defined to one of [0, 1, 2] at this point
888#if _LIBCPP_DEBUG_LEVEL >= 1 && !defined(_LIBCPP_DISABLE_EXTERN_TEMPLATE)
889# define _LIBCPP_EXTERN_TEMPLATE(...)
898890#endif
899891
900892#ifdef _LIBCPP_DISABLE_EXTERN_TEMPLATE
901#define _LIBCPP_EXTERN_TEMPLATE(...)
902#define _LIBCPP_EXTERN_TEMPLATE2(...)
893# define _LIBCPP_EXTERN_TEMPLATE(...)
894# define _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(...)
903895#endif
904896
905897#ifndef _LIBCPP_EXTERN_TEMPLATE
906898#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
907899#endif
908900
909#ifndef _LIBCPP_EXTERN_TEMPLATE2
910#define _LIBCPP_EXTERN_TEMPLATE2(...) extern template __VA_ARGS__;
901// When the Debug mode is enabled, we disable extern declarations because we
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__;
911910#endif
912911
913912#ifndef _LIBCPP_EXTERN_TEMPLATE_DEFINE
......@@ -938,6 +937,8 @@ typedef unsigned int char32_t;
938937 // We're deferring to Microsoft's STL to provide aligned new et al. We don't
939938 // have it unless the language feature test macro is defined.
940939# define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
940#elif defined(__MVS__)
941# define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
941942#endif
942943
943944#if defined(__APPLE__)
......@@ -999,6 +1000,18 @@ typedef unsigned int char32_t;
9991000# define _LIBCPP_DEPRECATED_IN_CXX17
10001001#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
10021015// Macros to enter and leave a state where deprecation warnings are suppressed.
10031016#if !defined(_LIBCPP_SUPPRESS_DEPRECATED_PUSH) && \
10041017 (defined(_LIBCPP_COMPILER_CLANG) || defined(_LIBCPP_COMPILER_GCC))
......@@ -1037,14 +1050,6 @@ typedef unsigned int char32_t;
10371050# define _LIBCPP_CONSTEXPR_AFTER_CXX17
10381051#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
10481053// The _LIBCPP_NODISCARD_ATTRIBUTE should only be used to define other
10491054// NODISCARD macros to the correct attribute.
10501055#if __has_cpp_attribute(nodiscard) || defined(_LIBCPP_COMPILER_MSVC)
......@@ -1079,12 +1084,6 @@ typedef unsigned int char32_t;
10791084# define _LIBCPP_INLINE_VAR
10801085#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
10881087#ifndef _LIBCPP_CONSTEXPR_IF_NODEBUG
10891088#if defined(_LIBCPP_DEBUG) || defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
10901089#define _LIBCPP_CONSTEXPR_IF_NODEBUG
......@@ -1100,7 +1099,7 @@ typedef unsigned int char32_t;
11001099#endif
11011100
11021101#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(
11041103 const void *, const void *, const void *, const void *);
11051104#endif
11061105
......@@ -1125,11 +1124,14 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
11251124# if defined(__FreeBSD__) || \
11261125 defined(__wasi__) || \
11271126 defined(__NetBSD__) || \
1127 defined(__OpenBSD__) || \
1128 defined(__NuttX__) || \
11281129 defined(__linux__) || \
11291130 defined(__GNU__) || \
11301131 defined(__APPLE__) || \
11311132 defined(__CloudABI__) || \
11321133 defined(__sun__) || \
1134 defined(__MVS__) || \
11331135 (defined(__MINGW32__) && __has_include(<pthread.h>))
11341136# define _LIBCPP_HAS_THREAD_API_PTHREAD
11351137# elif defined(__Fuchsia__)
......@@ -1167,10 +1169,6 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
11671169 _LIBCPP_HAS_NO_THREADS is defined.
11681170#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
11741172#if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(__STDCPP_THREADS__)
11751173#define __STDCPP_THREADS__ 1
11761174#endif
......@@ -1222,13 +1220,15 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
12221220// Some systems do not provide gets() in their C library, for security reasons.
12231221#ifndef _LIBCPP_C_HAS_NO_GETS
12241222# if defined(_LIBCPP_MSVCRT) || \
1225 (defined(__FreeBSD_version) && __FreeBSD_version >= 1300043)
1223 (defined(__FreeBSD_version) && __FreeBSD_version >= 1300043) || \
1224 defined(__OpenBSD__)
12261225# define _LIBCPP_C_HAS_NO_GETS
12271226# endif
12281227#endif
12291228
1230#if defined(__BIONIC__) || defined(__CloudABI__) || \
1231 defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC)
1229#if defined(__BIONIC__) || defined(__CloudABI__) || defined(__NuttX__) || \
1230 defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC) || \
1231 defined(__MVS__) || defined(__OpenBSD__)
12321232#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
12331233#endif
12341234
......@@ -1337,6 +1337,12 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
13371337#endif
13381338#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
13401346#if defined(_LIBCPP_ABI_MICROSOFT) && \
13411347 (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases))
13421348# define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
......@@ -1367,120 +1373,6 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
13671373#define _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
13681374#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
14841376#if defined(_LIBCPP_COMPILER_IBM)
14851377#define _LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO
14861378#endif
......@@ -1547,6 +1439,12 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
15471439#define _LIBCPP_HAS_NO_FGETPOS_FSETPOS
15481440#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
15501448#endif // __cplusplus
15511449
15521450#endif // _LIBCPP_CONFIG
lib/libcxx/include/__config_site.in+4-2
......@@ -26,12 +26,14 @@
2626#cmakedefine _LIBCPP_HAS_THREAD_API_WIN32
2727#cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL
2828#cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
29#cmakedefine _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
2930#cmakedefine _LIBCPP_NO_VCRUNTIME
30#ifndef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION
3131#cmakedefine _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION @_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION@
32#endif
3332#cmakedefine _LIBCPP_ABI_NAMESPACE @_LIBCPP_ABI_NAMESPACE@
33#cmakedefine _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY
3434#cmakedefine _LIBCPP_HAS_PARALLEL_ALGORITHMS
35#cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE
36#cmakedefine _LIBCPP_HAS_NO_LOCALIZATION
3537
3638@_LIBCPP_ABI_DEFINES@
3739
lib/libcxx/include/__debug+17-22
......@@ -27,26 +27,21 @@
2727# include <cstddef>
2828#endif
2929
30#if _LIBCPP_DEBUG_LEVEL >= 1 && !defined(_LIBCPP_ASSERT)
31# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : \
32 _VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, #x, m)))
33#endif
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
30#if _LIBCPP_DEBUG_LEVEL == 0
31# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0)
32# define _LIBCPP_ASSERT_IMPL(x, m) ((void)0)
33#elif _LIBCPP_DEBUG_LEVEL == 1
4634# 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
4741#endif
48#ifndef _LIBCPP_DEBUG_MODE
49#define _LIBCPP_DEBUG_MODE(...) ((void)0)
42
43#if !defined(_LIBCPP_ASSERT)
44# define _LIBCPP_ASSERT(x, m) _LIBCPP_ASSERT_IMPL(x, m)
5045#endif
5146
5247_LIBCPP_BEGIN_NAMESPACE_STD
......@@ -59,7 +54,7 @@ struct _LIBCPP_TEMPLATE_VIS __libcpp_debug_info {
5954 __libcpp_debug_info(const char* __f, int __l, const char* __p, const char* __m)
6055 : __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
6459 const char* __file_;
6560 int __line_;
......@@ -83,7 +78,7 @@ void __libcpp_abort_debug_function(__libcpp_debug_info const&);
8378_LIBCPP_FUNC_VIS
8479bool __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
8883struct _LIBCPP_TYPE_VIS __c_node;
8984
......@@ -226,7 +221,7 @@ public:
226221
227222 template <class _Cont>
228223 _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);
230225 }
231226
232227 template <class _Cont>
......@@ -271,7 +266,7 @@ _LIBCPP_FUNC_VIS __libcpp_db* __get_db();
271266_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
276271_LIBCPP_END_NAMESPACE_STD
277272
lib/libcxx/include/__functional_03+24-24
......@@ -126,7 +126,7 @@ __func<_Fp, _Alloc, _Rp()>::__clone() const
126126 _Ap __a(__f_.second());
127127 typedef __allocator_destructor<_Ap> _Dp;
128128 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));
130130 return __hold.release();
131131}
132132
......@@ -134,7 +134,7 @@ template<class _Fp, class _Alloc, class _Rp>
134134void
135135__func<_Fp, _Alloc, _Rp()>::__clone(__base<_Rp()>* __p) const
136136{
137 ::new (__p) __func(__f_.first(), __f_.second());
137 ::new ((void*)__p) __func(__f_.first(), __f_.second());
138138}
139139
140140template<class _Fp, class _Alloc, class _Rp>
......@@ -212,7 +212,7 @@ __func<_Fp, _Alloc, _Rp(_A0)>::__clone() const
212212 _Ap __a(__f_.second());
213213 typedef __allocator_destructor<_Ap> _Dp;
214214 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));
216216 return __hold.release();
217217}
218218
......@@ -220,7 +220,7 @@ template<class _Fp, class _Alloc, class _Rp, class _A0>
220220void
221221__func<_Fp, _Alloc, _Rp(_A0)>::__clone(__base<_Rp(_A0)>* __p) const
222222{
223 ::new (__p) __func(__f_.first(), __f_.second());
223 ::new ((void*)__p) __func(__f_.first(), __f_.second());
224224}
225225
226226template<class _Fp, class _Alloc, class _Rp, class _A0>
......@@ -298,7 +298,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone() const
298298 _Ap __a(__f_.second());
299299 typedef __allocator_destructor<_Ap> _Dp;
300300 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));
302302 return __hold.release();
303303}
304304
......@@ -306,7 +306,7 @@ template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
306306void
307307__func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone(__base<_Rp(_A0, _A1)>* __p) const
308308{
309 ::new (__p) __func(__f_.first(), __f_.second());
309 ::new ((void*)__p) __func(__f_.first(), __f_.second());
310310}
311311
312312template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1>
......@@ -384,7 +384,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone() const
384384 _Ap __a(__f_.second());
385385 typedef __allocator_destructor<_Ap> _Dp;
386386 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));
388388 return __hold.release();
389389}
390390
......@@ -392,7 +392,7 @@ template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
392392void
393393__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone(__base<_Rp(_A0, _A1, _A2)>* __p) const
394394{
395 ::new (__p) __func(__f_.first(), __f_.second());
395 ::new ((void*)__p) __func(__f_.first(), __f_.second());
396396}
397397
398398template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2>
......@@ -554,7 +554,7 @@ function<_Rp()>::function(_Fp __f,
554554 if (sizeof(_FF) <= sizeof(__buf_))
555555 {
556556 __f_ = (__base*)&__buf_;
557 ::new (__f_) _FF(__f);
557 ::new ((void*)__f_) _FF(__f);
558558 }
559559 else
560560 {
......@@ -562,7 +562,7 @@ function<_Rp()>::function(_Fp __f,
562562 _Ap __a;
563563 typedef __allocator_destructor<_Ap> _Dp;
564564 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));
566566 __f_ = __hold.release();
567567 }
568568 }
......@@ -581,7 +581,7 @@ function<_Rp()>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
581581 if (sizeof(_FF) <= sizeof(__buf_))
582582 {
583583 __f_ = (__base*)&__buf_;
584 ::new (__f_) _FF(__f, __a0);
584 ::new ((void*)__f_) _FF(__f, __a0);
585585 }
586586 else
587587 {
......@@ -589,7 +589,7 @@ function<_Rp()>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
589589 _Ap __a(__a0);
590590 typedef __allocator_destructor<_Ap> _Dp;
591591 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));
593593 __f_ = __hold.release();
594594 }
595595 }
......@@ -834,7 +834,7 @@ function<_Rp(_A0)>::function(_Fp __f,
834834 if (sizeof(_FF) <= sizeof(__buf_))
835835 {
836836 __f_ = (__base*)&__buf_;
837 ::new (__f_) _FF(__f);
837 ::new ((void*)__f_) _FF(__f);
838838 }
839839 else
840840 {
......@@ -842,7 +842,7 @@ function<_Rp(_A0)>::function(_Fp __f,
842842 _Ap __a;
843843 typedef __allocator_destructor<_Ap> _Dp;
844844 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));
846846 __f_ = __hold.release();
847847 }
848848 }
......@@ -861,7 +861,7 @@ function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
861861 if (sizeof(_FF) <= sizeof(__buf_))
862862 {
863863 __f_ = (__base*)&__buf_;
864 ::new (__f_) _FF(__f, __a0);
864 ::new ((void*)__f_) _FF(__f, __a0);
865865 }
866866 else
867867 {
......@@ -869,7 +869,7 @@ function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
869869 _Ap __a(__a0);
870870 typedef __allocator_destructor<_Ap> _Dp;
871871 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));
873873 __f_ = __hold.release();
874874 }
875875 }
......@@ -1114,7 +1114,7 @@ function<_Rp(_A0, _A1)>::function(_Fp __f,
11141114 if (sizeof(_FF) <= sizeof(__buf_))
11151115 {
11161116 __f_ = (__base*)&__buf_;
1117 ::new (__f_) _FF(__f);
1117 ::new ((void*)__f_) _FF(__f);
11181118 }
11191119 else
11201120 {
......@@ -1122,7 +1122,7 @@ function<_Rp(_A0, _A1)>::function(_Fp __f,
11221122 _Ap __a;
11231123 typedef __allocator_destructor<_Ap> _Dp;
11241124 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));
11261126 __f_ = __hold.release();
11271127 }
11281128 }
......@@ -1141,7 +1141,7 @@ function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
11411141 if (sizeof(_FF) <= sizeof(__buf_))
11421142 {
11431143 __f_ = (__base*)&__buf_;
1144 ::new (__f_) _FF(__f, __a0);
1144 ::new ((void*)__f_) _FF(__f, __a0);
11451145 }
11461146 else
11471147 {
......@@ -1149,7 +1149,7 @@ function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
11491149 _Ap __a(__a0);
11501150 typedef __allocator_destructor<_Ap> _Dp;
11511151 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));
11531153 __f_ = __hold.release();
11541154 }
11551155 }
......@@ -1394,7 +1394,7 @@ function<_Rp(_A0, _A1, _A2)>::function(_Fp __f,
13941394 if (sizeof(_FF) <= sizeof(__buf_))
13951395 {
13961396 __f_ = (__base*)&__buf_;
1397 ::new (__f_) _FF(__f);
1397 ::new ((void*)__f_) _FF(__f);
13981398 }
13991399 else
14001400 {
......@@ -1402,7 +1402,7 @@ function<_Rp(_A0, _A1, _A2)>::function(_Fp __f,
14021402 _Ap __a;
14031403 typedef __allocator_destructor<_Ap> _Dp;
14041404 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));
14061406 __f_ = __hold.release();
14071407 }
14081408 }
......@@ -1421,7 +1421,7 @@ function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc& __a0, _Fp
14211421 if (sizeof(_FF) <= sizeof(__buf_))
14221422 {
14231423 __f_ = (__base*)&__buf_;
1424 ::new (__f_) _FF(__f, __a0);
1424 ::new ((void*)__f_) _FF(__f, __a0);
14251425 }
14261426 else
14271427 {
......@@ -1429,7 +1429,7 @@ function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc& __a0, _Fp
14291429 _Ap __a(__a0);
14301430 typedef __allocator_destructor<_Ap> _Dp;
14311431 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));
14331433 __f_ = __hold.release();
14341434 }
14351435 }
lib/libcxx/include/__functional_base+41-38
......@@ -298,7 +298,7 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile>
298298template <class _Tp, class ..._Args>
299299struct __invoke_return
300300{
301 typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type;
301 typedef decltype(_VSTD::__invoke(declval<_Tp>(), declval<_Args>()...)) type;
302302};
303303
304304#else // defined(_LIBCPP_CXX03_LANG)
......@@ -308,64 +308,64 @@ struct __invoke_return
308308#endif // !defined(_LIBCPP_CXX03_LANG)
309309
310310
311template <class _Ret>
311template <class _Ret, bool = is_void<_Ret>::value>
312312struct __invoke_void_return_wrapper
313313{
314314#ifndef _LIBCPP_CXX03_LANG
315315 template <class ..._Args>
316316 static _Ret __call(_Args&&... __args) {
317 return __invoke(_VSTD::forward<_Args>(__args)...);
317 return _VSTD::__invoke(_VSTD::forward<_Args>(__args)...);
318318 }
319319#else
320320 template <class _Fn>
321321 static _Ret __call(_Fn __f) {
322 return __invoke(__f);
322 return _VSTD::__invoke(__f);
323323 }
324324
325325 template <class _Fn, class _A0>
326326 static _Ret __call(_Fn __f, _A0& __a0) {
327 return __invoke(__f, __a0);
327 return _VSTD::__invoke(__f, __a0);
328328 }
329329
330330 template <class _Fn, class _A0, class _A1>
331331 static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1) {
332 return __invoke(__f, __a0, __a1);
332 return _VSTD::__invoke(__f, __a0, __a1);
333333 }
334334
335335 template <class _Fn, class _A0, class _A1, class _A2>
336336 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);
338338 }
339339#endif
340340};
341341
342template <>
343struct __invoke_void_return_wrapper<void>
342template <class _Ret>
343struct __invoke_void_return_wrapper<_Ret, true>
344344{
345345#ifndef _LIBCPP_CXX03_LANG
346346 template <class ..._Args>
347347 static void __call(_Args&&... __args) {
348 __invoke(_VSTD::forward<_Args>(__args)...);
348 _VSTD::__invoke(_VSTD::forward<_Args>(__args)...);
349349 }
350350#else
351351 template <class _Fn>
352352 static void __call(_Fn __f) {
353 __invoke(__f);
353 _VSTD::__invoke(__f);
354354 }
355355
356356 template <class _Fn, class _A0>
357357 static void __call(_Fn __f, _A0& __a0) {
358 __invoke(__f, __a0);
358 _VSTD::__invoke(__f, __a0);
359359 }
360360
361361 template <class _Fn, class _A0, class _A1>
362362 static void __call(_Fn __f, _A0& __a0, _A1& __a1) {
363 __invoke(__f, __a0, __a1);
363 _VSTD::__invoke(__f, __a0, __a1);
364364 }
365365
366366 template <class _Fn, class _A0, class _A1, class _A2>
367367 static void __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2) {
368 __invoke(__f, __a0, __a1, __a2);
368 _VSTD::__invoke(__f, __a0, __a1, __a2);
369369 }
370370#endif
371371};
......@@ -382,135 +382,138 @@ private:
382382
383383public:
384384 // construct/copy/destroy
385 _LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT
385 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
386 reference_wrapper(type& __f) _NOEXCEPT
386387 : __f_(_VSTD::addressof(__f)) {}
387388#ifndef _LIBCPP_CXX03_LANG
388389 private: reference_wrapper(type&&); public: // = delete; // do not bind to temps
389390#endif
390391
391392 // access
392 _LIBCPP_INLINE_VISIBILITY operator type& () const _NOEXCEPT {return *__f_;}
393 _LIBCPP_INLINE_VISIBILITY type& get() const _NOEXCEPT {return *__f_;}
393 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
394 operator type&() const _NOEXCEPT {return *__f_;}
395 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
396 type& get() const _NOEXCEPT {return *__f_;}
394397
395398#ifndef _LIBCPP_CXX03_LANG
396399 // invoke
397400 template <class... _ArgTypes>
398 _LIBCPP_INLINE_VISIBILITY
401 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
399402 typename __invoke_of<type&, _ArgTypes...>::type
400403 operator() (_ArgTypes&&... __args) const {
401 return __invoke(get(), _VSTD::forward<_ArgTypes>(__args)...);
404 return _VSTD::__invoke(get(), _VSTD::forward<_ArgTypes>(__args)...);
402405 }
403406#else
404407
405408 _LIBCPP_INLINE_VISIBILITY
406409 typename __invoke_return<type>::type
407410 operator() () const {
408 return __invoke(get());
411 return _VSTD::__invoke(get());
409412 }
410413
411414 template <class _A0>
412415 _LIBCPP_INLINE_VISIBILITY
413416 typename __invoke_return0<type, _A0>::type
414417 operator() (_A0& __a0) const {
415 return __invoke(get(), __a0);
418 return _VSTD::__invoke(get(), __a0);
416419 }
417420
418421 template <class _A0>
419422 _LIBCPP_INLINE_VISIBILITY
420423 typename __invoke_return0<type, _A0 const>::type
421424 operator() (_A0 const& __a0) const {
422 return __invoke(get(), __a0);
425 return _VSTD::__invoke(get(), __a0);
423426 }
424427
425428 template <class _A0, class _A1>
426429 _LIBCPP_INLINE_VISIBILITY
427430 typename __invoke_return1<type, _A0, _A1>::type
428431 operator() (_A0& __a0, _A1& __a1) const {
429 return __invoke(get(), __a0, __a1);
432 return _VSTD::__invoke(get(), __a0, __a1);
430433 }
431434
432435 template <class _A0, class _A1>
433436 _LIBCPP_INLINE_VISIBILITY
434437 typename __invoke_return1<type, _A0 const, _A1>::type
435438 operator() (_A0 const& __a0, _A1& __a1) const {
436 return __invoke(get(), __a0, __a1);
439 return _VSTD::__invoke(get(), __a0, __a1);
437440 }
438441
439442 template <class _A0, class _A1>
440443 _LIBCPP_INLINE_VISIBILITY
441444 typename __invoke_return1<type, _A0, _A1 const>::type
442445 operator() (_A0& __a0, _A1 const& __a1) const {
443 return __invoke(get(), __a0, __a1);
446 return _VSTD::__invoke(get(), __a0, __a1);
444447 }
445448
446449 template <class _A0, class _A1>
447450 _LIBCPP_INLINE_VISIBILITY
448451 typename __invoke_return1<type, _A0 const, _A1 const>::type
449452 operator() (_A0 const& __a0, _A1 const& __a1) const {
450 return __invoke(get(), __a0, __a1);
453 return _VSTD::__invoke(get(), __a0, __a1);
451454 }
452455
453456 template <class _A0, class _A1, class _A2>
454457 _LIBCPP_INLINE_VISIBILITY
455458 typename __invoke_return2<type, _A0, _A1, _A2>::type
456459 operator() (_A0& __a0, _A1& __a1, _A2& __a2) const {
457 return __invoke(get(), __a0, __a1, __a2);
460 return _VSTD::__invoke(get(), __a0, __a1, __a2);
458461 }
459462
460463 template <class _A0, class _A1, class _A2>
461464 _LIBCPP_INLINE_VISIBILITY
462465 typename __invoke_return2<type, _A0 const, _A1, _A2>::type
463466 operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const {
464 return __invoke(get(), __a0, __a1, __a2);
467 return _VSTD::__invoke(get(), __a0, __a1, __a2);
465468 }
466469
467470 template <class _A0, class _A1, class _A2>
468471 _LIBCPP_INLINE_VISIBILITY
469472 typename __invoke_return2<type, _A0, _A1 const, _A2>::type
470473 operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const {
471 return __invoke(get(), __a0, __a1, __a2);
474 return _VSTD::__invoke(get(), __a0, __a1, __a2);
472475 }
473476
474477 template <class _A0, class _A1, class _A2>
475478 _LIBCPP_INLINE_VISIBILITY
476479 typename __invoke_return2<type, _A0, _A1, _A2 const>::type
477480 operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const {
478 return __invoke(get(), __a0, __a1, __a2);
481 return _VSTD::__invoke(get(), __a0, __a1, __a2);
479482 }
480483
481484 template <class _A0, class _A1, class _A2>
482485 _LIBCPP_INLINE_VISIBILITY
483486 typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type
484487 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);
486489 }
487490
488491 template <class _A0, class _A1, class _A2>
489492 _LIBCPP_INLINE_VISIBILITY
490493 typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type
491494 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);
493496 }
494497
495498 template <class _A0, class _A1, class _A2>
496499 _LIBCPP_INLINE_VISIBILITY
497500 typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type
498501 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);
500503 }
501504
502505 template <class _A0, class _A1, class _A2>
503506 _LIBCPP_INLINE_VISIBILITY
504507 typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type
505508 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);
507510 }
508511#endif // _LIBCPP_CXX03_LANG
509512};
510513
511514
512515template <class _Tp>
513inline _LIBCPP_INLINE_VISIBILITY
516inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
514517reference_wrapper<_Tp>
515518ref(_Tp& __t) _NOEXCEPT
516519{
......@@ -518,7 +521,7 @@ ref(_Tp& __t) _NOEXCEPT
518521}
519522
520523template <class _Tp>
521inline _LIBCPP_INLINE_VISIBILITY
524inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
522525reference_wrapper<_Tp>
523526ref(reference_wrapper<_Tp> __t) _NOEXCEPT
524527{
......@@ -526,7 +529,7 @@ ref(reference_wrapper<_Tp> __t) _NOEXCEPT
526529}
527530
528531template <class _Tp>
529inline _LIBCPP_INLINE_VISIBILITY
532inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
530533reference_wrapper<const _Tp>
531534cref(const _Tp& __t) _NOEXCEPT
532535{
......@@ -534,7 +537,7 @@ cref(const _Tp& __t) _NOEXCEPT
534537}
535538
536539template <class _Tp>
537inline _LIBCPP_INLINE_VISIBILITY
540inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
538541reference_wrapper<const _Tp>
539542cref(reference_wrapper<_Tp> __t) _NOEXCEPT
540543{
lib/libcxx/include/__functional_base_03+12-12
......@@ -40,7 +40,7 @@ struct __enable_invoke_imp<_Ret, _T1, false, true> {
4040template <class _Ret, class _T1>
4141struct __enable_invoke_imp<_Ret, _T1, false, false> {
4242 typedef typename add_lvalue_reference<
43 typename __apply_cv<decltype(*_VSTD::declval<_T1>()), _Ret>::type
43 typename __apply_cv<decltype(*declval<_T1>()), _Ret>::type
4444 >::type _Bullet4;
4545 typedef _Bullet4 type;
4646};
......@@ -142,7 +142,7 @@ __invoke(_Fn __f, _T1& __t1) {
142142
143143template <class _Fp>
144144inline _LIBCPP_INLINE_VISIBILITY
145decltype(_VSTD::declval<_Fp&>()())
145decltype(declval<_Fp&>()())
146146__invoke(_Fp& __f)
147147{
148148 return __f();
......@@ -150,7 +150,7 @@ __invoke(_Fp& __f)
150150
151151template <class _Fp, class _A0>
152152inline _LIBCPP_INLINE_VISIBILITY
153decltype(_VSTD::declval<_Fp&>()(_VSTD::declval<_A0&>()))
153decltype(declval<_Fp&>()(declval<_A0&>()))
154154__invoke(_Fp& __f, _A0& __a0)
155155{
156156 return __f(__a0);
......@@ -158,7 +158,7 @@ __invoke(_Fp& __f, _A0& __a0)
158158
159159template <class _Fp, class _A0, class _A1>
160160inline _LIBCPP_INLINE_VISIBILITY
161decltype(_VSTD::declval<_Fp&>()(_VSTD::declval<_A0&>(), _VSTD::declval<_A1&>()))
161decltype(declval<_Fp&>()(declval<_A0&>(), declval<_A1&>()))
162162__invoke(_Fp& __f, _A0& __a0, _A1& __a1)
163163{
164164 return __f(__a0, __a1);
......@@ -166,7 +166,7 @@ __invoke(_Fp& __f, _A0& __a0, _A1& __a1)
166166
167167template <class _Fp, class _A0, class _A1, class _A2>
168168inline _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&>()))
170170__invoke(_Fp& __f, _A0& __a0, _A1& __a1, _A2& __a2)
171171{
172172 return __f(__a0, __a1, __a2);
......@@ -181,13 +181,13 @@ struct __invoke_return
181181template <class _Fp>
182182struct __invoke_return<_Fp, false>
183183{
184 typedef decltype(__invoke(_VSTD::declval<_Fp&>())) type;
184 typedef decltype(_VSTD::__invoke(declval<_Fp&>())) type;
185185};
186186
187187template <class _Tp, class _A0>
188188struct __invoke_return0
189189{
190 typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>())) type;
190 typedef decltype(_VSTD::__invoke(declval<_Tp&>(), declval<_A0&>())) type;
191191};
192192
193193template <class _Rp, class _Tp, class _A0>
......@@ -199,8 +199,8 @@ struct __invoke_return0<_Rp _Tp::*, _A0>
199199template <class _Tp, class _A0, class _A1>
200200struct __invoke_return1
201201{
202 typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>(),
203 _VSTD::declval<_A1&>())) type;
202 typedef decltype(_VSTD::__invoke(declval<_Tp&>(), declval<_A0&>(),
203 declval<_A1&>())) type;
204204};
205205
206206template <class _Rp, class _Class, class _A0, class _A1>
......@@ -211,9 +211,9 @@ struct __invoke_return1<_Rp _Class::*, _A0, _A1> {
211211template <class _Tp, class _A0, class _A1, class _A2>
212212struct __invoke_return2
213213{
214 typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>(),
215 _VSTD::declval<_A1&>(),
216 _VSTD::declval<_A2&>())) type;
214 typedef decltype(_VSTD::__invoke(declval<_Tp&>(), declval<_A0&>(),
215 declval<_A1&>(),
216 declval<_A2&>())) type;
217217};
218218
219219template <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
3434template <class _Key, class _Tp>
3535struct __hash_value_type;
3636
37#ifndef _LIBCPP_CXX03_LANG
3837template <class _Tp>
3938struct __is_hash_value_type_imp : false_type {};
4039
4140template <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
4443template <class ..._Args>
4544struct __is_hash_value_type : false_type {};
4645
4746template <class _One>
4847struct __is_hash_value_type<_One> : __is_hash_value_type_imp<typename __uncvref<_One>::type> {};
49#endif
5048
5149_LIBCPP_FUNC_VIS
5250size_t __next_prime(size_t __n);
......@@ -122,7 +120,7 @@ inline _LIBCPP_INLINE_VISIBILITY
122120size_t
123121__next_hash_pow2(size_t __n)
124122{
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)));
126124}
127125
128126
......@@ -155,12 +153,10 @@ struct __hash_key_value_types {
155153 static __container_value_type* __get_ptr(__node_value_type& __n) {
156154 return _VSTD::addressof(__n);
157155 }
158#ifndef _LIBCPP_CXX03_LANG
159156 _LIBCPP_INLINE_VISIBILITY
160157 static __container_value_type&& __move(__node_value_type& __v) {
161158 return _VSTD::move(__v);
162159 }
163#endif
164160};
165161
166162template <class _Key, class _Tp>
......@@ -197,13 +193,10 @@ struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > {
197193 static __container_value_type* __get_ptr(__node_value_type& __n) {
198194 return _VSTD::addressof(__n.__get_value());
199195 }
200#ifndef _LIBCPP_CXX03_LANG
201196 _LIBCPP_INLINE_VISIBILITY
202197 static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) {
203198 return __v.__move();
204199 }
205#endif
206
207200};
208201
209202template <class _Tp, class _AllocPtr, class _KVTypes = __hash_key_value_types<_Tp>,
......@@ -295,10 +288,12 @@ public:
295288 typedef typename _NodeTypes::__node_value_type_pointer pointer;
296289
297290 _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
299294 }
300295
301#if _LIBCPP_DEBUG_LEVEL >= 2
296#if _LIBCPP_DEBUG_LEVEL == 2
302297 _LIBCPP_INLINE_VISIBILITY
303298 __hash_iterator(const __hash_iterator& __i)
304299 : __node_(__i.__node_)
......@@ -322,7 +317,7 @@ public:
322317 }
323318 return *this;
324319 }
325#endif // _LIBCPP_DEBUG_LEVEL >= 2
320#endif // _LIBCPP_DEBUG_LEVEL == 2
326321
327322 _LIBCPP_INLINE_VISIBILITY
328323 reference operator*() const {
......@@ -364,7 +359,7 @@ public:
364359 {return !(__x == __y);}
365360
366361private:
367#if _LIBCPP_DEBUG_LEVEL >= 2
362#if _LIBCPP_DEBUG_LEVEL == 2
368363 _LIBCPP_INLINE_VISIBILITY
369364 __hash_iterator(__next_pointer __node, const void* __c) _NOEXCEPT
370365 : __node_(__node)
......@@ -405,17 +400,21 @@ public:
405400
406401
407402 _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
409406 }
410407
411408 _LIBCPP_INLINE_VISIBILITY
412409 __hash_const_iterator(const __non_const_iterator& __x) _NOEXCEPT
413410 : __node_(__x.__node_)
414411 {
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
416415 }
417416
418#if _LIBCPP_DEBUG_LEVEL >= 2
417#if _LIBCPP_DEBUG_LEVEL == 2
419418 _LIBCPP_INLINE_VISIBILITY
420419 __hash_const_iterator(const __hash_const_iterator& __i)
421420 : __node_(__i.__node_)
......@@ -439,7 +438,7 @@ public:
439438 }
440439 return *this;
441440 }
442#endif // _LIBCPP_DEBUG_LEVEL >= 2
441#endif // _LIBCPP_DEBUG_LEVEL == 2
443442
444443 _LIBCPP_INLINE_VISIBILITY
445444 reference operator*() const {
......@@ -480,7 +479,7 @@ public:
480479 {return !(__x == __y);}
481480
482481private:
483#if _LIBCPP_DEBUG_LEVEL >= 2
482#if _LIBCPP_DEBUG_LEVEL == 2
484483 _LIBCPP_INLINE_VISIBILITY
485484 __hash_const_iterator(__next_pointer __node, const void* __c) _NOEXCEPT
486485 : __node_(__node)
......@@ -518,10 +517,12 @@ public:
518517 typedef typename _NodeTypes::__node_value_type_pointer pointer;
519518
520519 _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
522523 }
523524
524#if _LIBCPP_DEBUG_LEVEL >= 2
525#if _LIBCPP_DEBUG_LEVEL == 2
525526 _LIBCPP_INLINE_VISIBILITY
526527 __hash_local_iterator(const __hash_local_iterator& __i)
527528 : __node_(__i.__node_),
......@@ -549,7 +550,7 @@ public:
549550 }
550551 return *this;
551552 }
552#endif // _LIBCPP_DEBUG_LEVEL >= 2
553#endif // _LIBCPP_DEBUG_LEVEL == 2
553554
554555 _LIBCPP_INLINE_VISIBILITY
555556 reference operator*() const {
......@@ -593,7 +594,7 @@ public:
593594 {return !(__x == __y);}
594595
595596private:
596#if _LIBCPP_DEBUG_LEVEL >= 2
597#if _LIBCPP_DEBUG_LEVEL == 2
597598 _LIBCPP_INLINE_VISIBILITY
598599 __hash_local_iterator(__next_pointer __node, size_t __bucket,
599600 size_t __bucket_count, const void* __c) _NOEXCEPT
......@@ -650,7 +651,9 @@ public:
650651
651652
652653 _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
654657 }
655658
656659 _LIBCPP_INLINE_VISIBILITY
......@@ -659,10 +662,12 @@ public:
659662 __bucket_(__x.__bucket_),
660663 __bucket_count_(__x.__bucket_count_)
661664 {
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
663668 }
664669
665#if _LIBCPP_DEBUG_LEVEL >= 2
670#if _LIBCPP_DEBUG_LEVEL == 2
666671 _LIBCPP_INLINE_VISIBILITY
667672 __hash_const_local_iterator(const __hash_const_local_iterator& __i)
668673 : __node_(__i.__node_),
......@@ -690,7 +695,7 @@ public:
690695 }
691696 return *this;
692697 }
693#endif // _LIBCPP_DEBUG_LEVEL >= 2
698#endif // _LIBCPP_DEBUG_LEVEL == 2
694699
695700 _LIBCPP_INLINE_VISIBILITY
696701 reference operator*() const {
......@@ -734,7 +739,7 @@ public:
734739 {return !(__x == __y);}
735740
736741private:
737#if _LIBCPP_DEBUG_LEVEL >= 2
742#if _LIBCPP_DEBUG_LEVEL == 2
738743 _LIBCPP_INLINE_VISIBILITY
739744 __hash_const_local_iterator(__next_pointer __node, size_t __bucket,
740745 size_t __bucket_count, const void* __c) _NOEXCEPT
......@@ -783,7 +788,6 @@ public:
783788 _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
784789 : __data_(__size, __a) {}
785790
786#ifndef _LIBCPP_CXX03_LANG
787791 _LIBCPP_INLINE_VISIBILITY
788792 __bucket_list_deallocator(__bucket_list_deallocator&& __x)
789793 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
......@@ -791,7 +795,6 @@ public:
791795 {
792796 __x.size() = 0;
793797 }
794#endif
795798
796799 _LIBCPP_INLINE_VISIBILITY
797800 size_type& size() _NOEXCEPT {return __data_.first();}
......@@ -1007,7 +1010,6 @@ public:
10071010 explicit __hash_table(const allocator_type& __a);
10081011 __hash_table(const __hash_table& __u);
10091012 __hash_table(const __hash_table& __u, const allocator_type& __a);
1010#ifndef _LIBCPP_CXX03_LANG
10111013 __hash_table(__hash_table&& __u)
10121014 _NOEXCEPT_(
10131015 is_nothrow_move_constructible<__bucket_list>::value &&
......@@ -1016,11 +1018,9 @@ public:
10161018 is_nothrow_move_constructible<hasher>::value &&
10171019 is_nothrow_move_constructible<key_equal>::value);
10181020 __hash_table(__hash_table&& __u, const allocator_type& __a);
1019#endif // _LIBCPP_CXX03_LANG
10201021 ~__hash_table();
10211022
10221023 __hash_table& operator=(const __hash_table& __u);
1023#ifndef _LIBCPP_CXX03_LANG
10241024 _LIBCPP_INLINE_VISIBILITY
10251025 __hash_table& operator=(__hash_table&& __u)
10261026 _NOEXCEPT_(
......@@ -1028,7 +1028,6 @@ public:
10281028 is_nothrow_move_assignable<__node_allocator>::value &&
10291029 is_nothrow_move_assignable<hasher>::value &&
10301030 is_nothrow_move_assignable<key_equal>::value);
1031#endif
10321031 template <class _InputIterator>
10331032 void __assign_unique(_InputIterator __first, _InputIterator __last);
10341033 template <class _InputIterator>
......@@ -1037,7 +1036,7 @@ public:
10371036 _LIBCPP_INLINE_VISIBILITY
10381037 size_type max_size() const _NOEXCEPT
10391038 {
1040 return std::min<size_type>(
1039 return _VSTD::min<size_type>(
10411040 __node_traits::max_size(__node_alloc()),
10421041 numeric_limits<difference_type >::max()
10431042 );
......@@ -1066,7 +1065,6 @@ public:
10661065 iterator __node_insert_multi(const_iterator __p,
10671066 __node_pointer __nd);
10681067
1069#ifndef _LIBCPP_CXX03_LANG
10701068 template <class _Key, class ..._Args>
10711069 _LIBCPP_INLINE_VISIBILITY
10721070 pair<iterator, bool> __emplace_unique_key_args(_Key const& __k, _Args&&... __args);
......@@ -1151,15 +1149,6 @@ public:
11511149 return __emplace_hint_multi(__p, _VSTD::forward<_Pp>(__x));
11521150 }
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
11631152 _LIBCPP_INLINE_VISIBILITY
11641153 pair<iterator, bool> __insert_unique(const __container_value_type& __x) {
11651154 return __emplace_unique_key_args(_NodeTypes::__get_key(__x), __x);
......@@ -1295,7 +1284,7 @@ public:
12951284 {
12961285 _LIBCPP_ASSERT(__n < bucket_count(),
12971286 "unordered container::begin(n) called with n >= bucket_count()");
1298#if _LIBCPP_DEBUG_LEVEL >= 2
1287#if _LIBCPP_DEBUG_LEVEL == 2
12991288 return local_iterator(__bucket_list_[__n], __n, bucket_count(), this);
13001289#else
13011290 return local_iterator(__bucket_list_[__n], __n, bucket_count());
......@@ -1308,7 +1297,7 @@ public:
13081297 {
13091298 _LIBCPP_ASSERT(__n < bucket_count(),
13101299 "unordered container::end(n) called with n >= bucket_count()");
1311#if _LIBCPP_DEBUG_LEVEL >= 2
1300#if _LIBCPP_DEBUG_LEVEL == 2
13121301 return local_iterator(nullptr, __n, bucket_count(), this);
13131302#else
13141303 return local_iterator(nullptr, __n, bucket_count());
......@@ -1321,7 +1310,7 @@ public:
13211310 {
13221311 _LIBCPP_ASSERT(__n < bucket_count(),
13231312 "unordered container::cbegin(n) called with n >= bucket_count()");
1324#if _LIBCPP_DEBUG_LEVEL >= 2
1313#if _LIBCPP_DEBUG_LEVEL == 2
13251314 return const_local_iterator(__bucket_list_[__n], __n, bucket_count(), this);
13261315#else
13271316 return const_local_iterator(__bucket_list_[__n], __n, bucket_count());
......@@ -1334,35 +1323,30 @@ public:
13341323 {
13351324 _LIBCPP_ASSERT(__n < bucket_count(),
13361325 "unordered container::cend(n) called with n >= bucket_count()");
1337#if _LIBCPP_DEBUG_LEVEL >= 2
1326#if _LIBCPP_DEBUG_LEVEL == 2
13381327 return const_local_iterator(nullptr, __n, bucket_count(), this);
13391328#else
13401329 return const_local_iterator(nullptr, __n, bucket_count());
13411330#endif
13421331 }
13431332
1344#if _LIBCPP_DEBUG_LEVEL >= 2
1333#if _LIBCPP_DEBUG_LEVEL == 2
13451334
13461335 bool __dereferenceable(const const_iterator* __i) const;
13471336 bool __decrementable(const const_iterator* __i) const;
13481337 bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
13491338 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
13501339
1351#endif // _LIBCPP_DEBUG_LEVEL >= 2
1340#endif // _LIBCPP_DEBUG_LEVEL == 2
13521341
13531342private:
13541343 void __rehash(size_type __n);
13551344
1356#ifndef _LIBCPP_CXX03_LANG
13571345 template <class ..._Args>
13581346 __node_holder __construct_node(_Args&& ...__args);
13591347
13601348 template <class _First, class ..._Rest>
13611349 __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
13681352 _LIBCPP_INLINE_VISIBILITY
......@@ -1373,7 +1357,6 @@ private:
13731357 _LIBCPP_INLINE_VISIBILITY
13741358 void __copy_assign_alloc(const __hash_table&, false_type) {}
13751359
1376#ifndef _LIBCPP_CXX03_LANG
13771360 void __move_assign(__hash_table& __u, false_type);
13781361 void __move_assign(__hash_table& __u, true_type)
13791362 _NOEXCEPT_(
......@@ -1400,7 +1383,6 @@ private:
14001383 }
14011384 _LIBCPP_INLINE_VISIBILITY
14021385 void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}
1403#endif // _LIBCPP_CXX03_LANG
14041386
14051387 void __deallocate_node(__next_pointer __np) _NOEXCEPT;
14061388 __next_pointer __detach() _NOEXCEPT;
......@@ -1477,8 +1459,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const __hash_table& __u,
14771459{
14781460}
14791461
1480#ifndef _LIBCPP_CXX03_LANG
1481
14821462template <class _Tp, class _Hash, class _Equal, class _Alloc>
14831463__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)
14841464 _NOEXCEPT_(
......@@ -1526,8 +1506,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u,
15261506 }
15271507}
15281508
1529#endif // _LIBCPP_CXX03_LANG
1530
15311509template <class _Tp, class _Hash, class _Equal, class _Alloc>
15321510__hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table()
15331511{
......@@ -1539,7 +1517,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table()
15391517#endif
15401518
15411519 __deallocate_node(__p1_.first().__next_);
1542#if _LIBCPP_DEBUG_LEVEL >= 2
1520#if _LIBCPP_DEBUG_LEVEL == 2
15431521 __get_db()->__erase_c(this);
15441522#endif
15451523}
......@@ -1583,7 +1561,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate_node(__next_pointer __np)
15831561 while (__np != nullptr)
15841562 {
15851563 __next_pointer __next = __np->__next_;
1586#if _LIBCPP_DEBUG_LEVEL >= 2
1564#if _LIBCPP_DEBUG_LEVEL == 2
15871565 __c_node* __c = __get_db()->__find_c_and_lock(this);
15881566 for (__i_node** __p = __c->end_; __p != __c->beg_; )
15891567 {
......@@ -1593,7 +1571,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate_node(__next_pointer __np)
15931571 {
15941572 (*__p)->__c_ = nullptr;
15951573 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*));
15971575 }
15981576 }
15991577 __get_db()->unlock();
......@@ -1618,8 +1596,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__detach() _NOEXCEPT
16181596 return __cache;
16191597}
16201598
1621#ifndef _LIBCPP_CXX03_LANG
1622
16231599template <class _Tp, class _Hash, class _Equal, class _Alloc>
16241600void
16251601__hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
......@@ -1646,7 +1622,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
16461622 __u.__p1_.first().__next_ = nullptr;
16471623 __u.size() = 0;
16481624 }
1649#if _LIBCPP_DEBUG_LEVEL >= 2
1625#if _LIBCPP_DEBUG_LEVEL == 2
16501626 __get_db()->swap(this, &__u);
16511627#endif
16521628}
......@@ -1714,8 +1690,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(__hash_table&& __u)
17141690 return *this;
17151691}
17161692
1717#endif // _LIBCPP_CXX03_LANG
1718
17191693template <class _Tp, class _Hash, class _Equal, class _Alloc>
17201694template <class _InputIterator>
17211695void
......@@ -1800,7 +1774,7 @@ inline
18001774typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
18011775__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() _NOEXCEPT
18021776{
1803#if _LIBCPP_DEBUG_LEVEL >= 2
1777#if _LIBCPP_DEBUG_LEVEL == 2
18041778 return iterator(__p1_.first().__next_, this);
18051779#else
18061780 return iterator(__p1_.first().__next_);
......@@ -1812,7 +1786,7 @@ inline
18121786typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
18131787__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() _NOEXCEPT
18141788{
1815#if _LIBCPP_DEBUG_LEVEL >= 2
1789#if _LIBCPP_DEBUG_LEVEL == 2
18161790 return iterator(nullptr, this);
18171791#else
18181792 return iterator(nullptr);
......@@ -1824,7 +1798,7 @@ inline
18241798typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
18251799__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() const _NOEXCEPT
18261800{
1827#if _LIBCPP_DEBUG_LEVEL >= 2
1801#if _LIBCPP_DEBUG_LEVEL == 2
18281802 return const_iterator(__p1_.first().__next_, this);
18291803#else
18301804 return const_iterator(__p1_.first().__next_);
......@@ -1836,7 +1810,7 @@ inline
18361810typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
18371811__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() const _NOEXCEPT
18381812{
1839#if _LIBCPP_DEBUG_LEVEL >= 2
1813#if _LIBCPP_DEBUG_LEVEL == 2
18401814 return const_iterator(nullptr, this);
18411815#else
18421816 return const_iterator(nullptr);
......@@ -1945,7 +1919,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
19451919 __existing_node = __nd->__ptr();
19461920 __inserted = true;
19471921 }
1948#if _LIBCPP_DEBUG_LEVEL >= 2
1922#if _LIBCPP_DEBUG_LEVEL == 2
19491923 return pair<iterator, bool>(iterator(__existing_node, this), __inserted);
19501924#else
19511925 return pair<iterator, bool>(iterator(__existing_node), __inserted);
......@@ -1955,7 +1929,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
19551929// Prepare the container for an insertion of the value __cp_val with the hash
19561930// __cp_hash. This does a lookup into the container to see if __cp_value is
19571931// 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.
19591933//
19601934// Note that this function does forward exceptions if key_eq() throws, and never
19611935// mutates __value or actually inserts into the map.
......@@ -2043,7 +2017,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c
20432017 __next_pointer __pn = __node_insert_multi_prepare(__cp->__hash(), __cp->__value_);
20442018 __node_insert_multi_perform(__cp, __pn);
20452019
2046#if _LIBCPP_DEBUG_LEVEL >= 2
2020#if _LIBCPP_DEBUG_LEVEL == 2
20472021 return iterator(__cp->__ptr(), this);
20482022#else
20492023 return iterator(__cp->__ptr());
......@@ -2055,7 +2029,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
20552029__hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
20562030 const_iterator __p, __node_pointer __cp)
20572031{
2058#if _LIBCPP_DEBUG_LEVEL >= 2
2032#if _LIBCPP_DEBUG_LEVEL == 2
20592033 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
20602034 "unordered container::emplace_hint(const_iterator, args...) called with an iterator not"
20612035 " referring to this unordered container");
......@@ -2078,7 +2052,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
20782052 __cp->__next_ = __np;
20792053 __pp->__next_ = static_cast<__next_pointer>(__cp);
20802054 ++size();
2081#if _LIBCPP_DEBUG_LEVEL >= 2
2055#if _LIBCPP_DEBUG_LEVEL == 2
20822056 return iterator(static_cast<__next_pointer>(__cp), this);
20832057#else
20842058 return iterator(static_cast<__next_pointer>(__cp));
......@@ -2089,17 +2063,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
20892063
20902064
20912065
2092#ifndef _LIBCPP_CXX03_LANG
20932066template <class _Tp, class _Hash, class _Equal, class _Alloc>
20942067template <class _Key, class ..._Args>
20952068pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
20962069__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
21032070{
21042071
21052072 size_t __hash = hash_function()(__k);
......@@ -2123,11 +2090,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const&
21232090 }
21242091 }
21252092 {
2126#ifndef _LIBCPP_CXX03_LANG
21272093 __node_holder __h = __construct_node_hash(__hash, _VSTD::forward<_Args>(__args)...);
2128#else
2129 __node_holder __h = __construct_node_hash(__hash, __args);
2130#endif
21312094 if (size()+1 > __bc * max_load_factor() || __bc == 0)
21322095 {
21332096 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&
21592122 __inserted = true;
21602123 }
21612124__done:
2162#if _LIBCPP_DEBUG_LEVEL >= 2
2125#if _LIBCPP_DEBUG_LEVEL == 2
21632126 return pair<iterator, bool>(iterator(__nd, this), __inserted);
21642127#else
21652128 return pair<iterator, bool>(iterator(__nd), __inserted);
21662129#endif
21672130}
21682131
2169#ifndef _LIBCPP_CXX03_LANG
2170
21712132template <class _Tp, class _Hash, class _Equal, class _Alloc>
21722133template <class... _Args>
21732134pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
......@@ -2197,7 +2158,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
21972158__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(
21982159 const_iterator __p, _Args&&... __args)
21992160{
2200#if _LIBCPP_DEBUG_LEVEL >= 2
2161#if _LIBCPP_DEBUG_LEVEL == 2
22012162 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
22022163 "unordered container::emplace_hint(const_iterator, args...) called with an iterator not"
22032164 " referring to this unordered container");
......@@ -2208,36 +2169,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(
22082169 return __r;
22092170}
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
22412172#if _LIBCPP_STD_VER > 14
22422173template <class _Tp, class _Hash, class _Equal, class _Alloc>
22432174template <class _NodeHandle, class _InsertReturnType>
......@@ -2399,9 +2330,9 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
23992330void
24002331__hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __nbc)
24012332{
2402#if _LIBCPP_DEBUG_LEVEL >= 2
2333#if _LIBCPP_DEBUG_LEVEL == 2
24032334 __get_db()->__invalidate_all(this);
2404#endif // _LIBCPP_DEBUG_LEVEL >= 2
2335#endif
24052336 __pointer_allocator& __npa = __bucket_list_.get_deleter().__alloc();
24062337 __bucket_list_.reset(__nbc > 0 ?
24072338 __pointer_alloc_traits::allocate(__npa, __nbc) : nullptr);
......@@ -2470,7 +2401,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k)
24702401 {
24712402 if ((__nd->__hash() == __hash)
24722403 && key_eq()(__nd->__upcast()->__value_, __k))
2473#if _LIBCPP_DEBUG_LEVEL >= 2
2404#if _LIBCPP_DEBUG_LEVEL == 2
24742405 return iterator(__nd, this);
24752406#else
24762407 return iterator(__nd);
......@@ -2501,7 +2432,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) const
25012432 {
25022433 if ((__nd->__hash() == __hash)
25032434 && key_eq()(__nd->__upcast()->__value_, __k))
2504#if _LIBCPP_DEBUG_LEVEL >= 2
2435#if _LIBCPP_DEBUG_LEVEL == 2
25052436 return const_iterator(__nd, this);
25062437#else
25072438 return const_iterator(__nd);
......@@ -2513,8 +2444,6 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) const
25132444 return end();
25142445}
25152446
2516#ifndef _LIBCPP_CXX03_LANG
2517
25182447template <class _Tp, class _Hash, class _Equal, class _Alloc>
25192448template <class ..._Args>
25202449typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
......@@ -2550,43 +2479,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(
25502479 return __h;
25512480}
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
25842482template <class _Tp, class _Hash, class _Equal, class _Alloc>
25852483typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
25862484__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p)
25872485{
25882486 __next_pointer __np = __p.__node_;
2589#if _LIBCPP_DEBUG_LEVEL >= 2
2487#if _LIBCPP_DEBUG_LEVEL == 2
25902488 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
25912489 "unordered container erase(iterator) called with an iterator not"
25922490 " referring to this container");
......@@ -2606,7 +2504,7 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
26062504__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __first,
26072505 const_iterator __last)
26082506{
2609#if _LIBCPP_DEBUG_LEVEL >= 2
2507#if _LIBCPP_DEBUG_LEVEL == 2
26102508 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,
26112509 "unodered container::erase(iterator, iterator) called with an iterator not"
26122510 " referring to this unodered container");
......@@ -2620,7 +2518,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __first,
26202518 erase(__p);
26212519 }
26222520 __next_pointer __np = __last.__node_;
2623#if _LIBCPP_DEBUG_LEVEL >= 2
2521#if _LIBCPP_DEBUG_LEVEL == 2
26242522 return iterator (__np, this);
26252523#else
26262524 return iterator (__np);
......@@ -2691,7 +2589,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
26912589 __pn->__next_ = __cn->__next_;
26922590 __cn->__next_ = nullptr;
26932591 --size();
2694#if _LIBCPP_DEBUG_LEVEL >= 2
2592#if _LIBCPP_DEBUG_LEVEL == 2
26952593 __c_node* __c = __get_db()->__find_c_and_lock(this);
26962594 for (__i_node** __dp = __c->end_; __dp != __c->beg_; )
26972595 {
......@@ -2701,7 +2599,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
27012599 {
27022600 (*__dp)->__c_ = nullptr;
27032601 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*));
27052603 }
27062604 }
27072605 __get_db()->unlock();
......@@ -2830,9 +2728,9 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
28302728 __u.__bucket_list_.reset(__npp);
28312729 }
28322730 _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(),
28342732 __u.__bucket_list_.get_deleter().__alloc());
2835 __swap_allocator(__node_alloc(), __u.__node_alloc());
2733 _VSTD::__swap_allocator(__node_alloc(), __u.__node_alloc());
28362734 _VSTD::swap(__p1_.first().__next_, __u.__p1_.first().__next_);
28372735 __p2_.swap(__u.__p2_);
28382736 __p3_.swap(__u.__p3_);
......@@ -2842,7 +2740,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
28422740 if (__u.size() > 0)
28432741 __u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash(), __u.bucket_count())] =
28442742 __u.__p1_.first().__ptr();
2845#if _LIBCPP_DEBUG_LEVEL >= 2
2743#if _LIBCPP_DEBUG_LEVEL == 2
28462744 __get_db()->swap(this, &__u);
28472745#endif
28482746}
......@@ -2876,7 +2774,7 @@ swap(__hash_table<_Tp, _Hash, _Equal, _Alloc>& __x,
28762774 __x.swap(__y);
28772775}
28782776
2879#if _LIBCPP_DEBUG_LEVEL >= 2
2777#if _LIBCPP_DEBUG_LEVEL == 2
28802778
28812779template <class _Tp, class _Hash, class _Equal, class _Alloc>
28822780bool
......@@ -2906,7 +2804,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__subscriptable(const const_iterator*,
29062804 return false;
29072805}
29082806
2909#endif // _LIBCPP_DEBUG_LEVEL >= 2
2807#endif // _LIBCPP_DEBUG_LEVEL == 2
29102808
29112809_LIBCPP_END_NAMESPACE_STD
29122810
lib/libcxx/include/__libcpp_version+1-1
......@@ -1 +1 @@
111000
112000
lib/libcxx/include/__locale+244-44
......@@ -11,6 +11,7 @@
1111#define _LIBCPP___LOCALE
1212
1313#include <__config>
14#include <__availability>
1415#include <string>
1516#include <memory>
1617#include <utility>
......@@ -20,26 +21,30 @@
2021#include <locale.h>
2122#if defined(_LIBCPP_MSVCRT_LIKE)
2223# include <cstring>
23# include <support/win32/locale_win32.h>
24#elif defined(_AIX)
25# include <support/ibm/xlocale.h>
24# include <__support/win32/locale_win32.h>
25#elif defined(__NuttX__)
26# include <__support/nuttx/xlocale.h>
27#elif defined(_AIX) || defined(__MVS__)
28# include <__support/ibm/xlocale.h>
2629#elif defined(__ANDROID__)
27# include <support/android/locale_bionic.h>
30# include <__support/android/locale_bionic.h>
2831#elif defined(__sun__)
2932# include <xlocale.h>
30# include <support/solaris/xlocale.h>
33# include <__support/solaris/xlocale.h>
3134#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>
3338#elif (defined(__APPLE__) || defined(__FreeBSD__) \
3439 || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
3540# include <xlocale.h>
3641#elif defined(__Fuchsia__)
37# include <support/fuchsia/xlocale.h>
42# include <__support/fuchsia/xlocale.h>
3843#elif defined(__wasi__)
3944// WASI libc uses musl's locales support.
40# include <support/musl/xlocale.h>
45# include <__support/musl/xlocale.h>
4146#elif defined(_LIBCPP_HAS_MUSL_LIBC)
42# include <support/musl/xlocale.h>
47# include <__support/musl/xlocale.h>
4348#endif
4449
4550#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
......@@ -76,7 +81,7 @@ struct __libcpp_locale_guard {
7681 // locale name, otherwise it will be a semicolon-separated string listing
7782 // each category. In the second case, we know at least one category won't
7883 // 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) {
8085 __locale_all = _strdup(__lc);
8186 if (__locale_all == nullptr)
8287 __throw_bad_alloc();
......@@ -105,7 +110,6 @@ struct __libcpp_locale_guard {
105110};
106111#endif
107112
108
109113class _LIBCPP_TYPE_VIS locale;
110114
111115template <class _Facet>
......@@ -335,8 +339,8 @@ collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const
335339 return static_cast<long>(__h);
336340}
337341
338_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<char>)
339_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<wchar_t>)
342_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<char>)
343_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<wchar_t>)
340344
341345// template <class CharT> class collate_byname;
342346
......@@ -396,7 +400,26 @@ locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
396400class _LIBCPP_TYPE_VIS ctype_base
397401{
398402public:
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__)
400423 typedef unsigned short mask;
401424 static const mask space = _ISspace;
402425 static const mask print = _ISprint;
......@@ -485,24 +508,7 @@ public:
485508# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA
486509# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_XDIGIT
487510#else
488 typedef unsigned long mask;
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__)
511# error unknown rune table for this platform -- do you mean to define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE?
506512#endif
507513 static const mask alnum = alpha | digit;
508514 static const mask graph = alnum | punct;
......@@ -623,7 +629,7 @@ class _LIBCPP_TYPE_VIS ctype<char>
623629public:
624630 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
628634 _LIBCPP_INLINE_VISIBILITY
629635 bool is(mask __m, char_type __c) const
......@@ -1069,10 +1075,10 @@ protected:
10691075 virtual int do_max_length() const _NOEXCEPT;
10701076};
10711077
1072// template <> class codecvt<char16_t, char, mbstate_t>
1078// template <> class codecvt<char16_t, char, mbstate_t> // deprecated in C++20
10731079
10741080template <>
1075class _LIBCPP_TYPE_VIS codecvt<char16_t, char, mbstate_t>
1081class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_TYPE_VIS codecvt<char16_t, char, mbstate_t>
10761082 : public locale::facet,
10771083 public codecvt_base
10781084{
......@@ -1155,10 +1161,100 @@ protected:
11551161 virtual int do_max_length() const _NOEXCEPT;
11561162};
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
11601168template <>
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>
11621258 : public locale::facet,
11631259 public codecvt_base
11641260{
......@@ -1241,6 +1337,96 @@ protected:
12411337 virtual int do_max_length() const _NOEXCEPT;
12421338};
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
12441430// template <class _InternT, class _ExternT, class _StateT> class codecvt_byname
12451431
12461432template <class _InternT, class _ExternT, class _StateT>
......@@ -1258,15 +1444,21 @@ protected:
12581444 ~codecvt_byname();
12591445};
12601446
1447_LIBCPP_SUPPRESS_DEPRECATED_PUSH
12611448template <class _InternT, class _ExternT, class _StateT>
12621449codecvt_byname<_InternT, _ExternT, _StateT>::~codecvt_byname()
12631450{
12641451}
1265
1266_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char, char, mbstate_t>)
1267_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>)
1268_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>)
1269_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>)
1452_LIBCPP_SUPPRESS_DEPRECATED_POP
1453
1454_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char, char, mbstate_t>)
1455_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<wchar_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
12711463template <size_t _Np>
12721464struct __narrow_to_utf8
......@@ -1290,12 +1482,14 @@ struct __narrow_to_utf8<8>
12901482 }
12911483};
12921484
1485_LIBCPP_SUPPRESS_DEPRECATED_PUSH
12931486template <>
12941487struct _LIBCPP_TEMPLATE_VIS __narrow_to_utf8<16>
12951488 : public codecvt<char16_t, char, mbstate_t>
12961489{
12971490 _LIBCPP_INLINE_VISIBILITY
12981491 __narrow_to_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}
1492_LIBCPP_SUPPRESS_DEPRECATED_POP
12991493
13001494 _LIBCPP_EXPORTED_FROM_ABI ~__narrow_to_utf8();
13011495
......@@ -1324,12 +1518,14 @@ struct _LIBCPP_TEMPLATE_VIS __narrow_to_utf8<16>
13241518 }
13251519};
13261520
1521_LIBCPP_SUPPRESS_DEPRECATED_PUSH
13271522template <>
13281523struct _LIBCPP_TEMPLATE_VIS __narrow_to_utf8<32>
13291524 : public codecvt<char32_t, char, mbstate_t>
13301525{
13311526 _LIBCPP_INLINE_VISIBILITY
13321527 __narrow_to_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}
1528_LIBCPP_SUPPRESS_DEPRECATED_POP
13331529
13341530 _LIBCPP_EXPORTED_FROM_ABI ~__narrow_to_utf8();
13351531
......@@ -1380,12 +1576,14 @@ struct __widen_from_utf8<8>
13801576 }
13811577};
13821578
1579_LIBCPP_SUPPRESS_DEPRECATED_PUSH
13831580template <>
13841581struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<16>
13851582 : public codecvt<char16_t, char, mbstate_t>
13861583{
13871584 _LIBCPP_INLINE_VISIBILITY
13881585 __widen_from_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}
1586_LIBCPP_SUPPRESS_DEPRECATED_POP
13891587
13901588 _LIBCPP_EXPORTED_FROM_ABI ~__widen_from_utf8();
13911589
......@@ -1407,19 +1605,21 @@ struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<16>
14071605 if (__r == codecvt_base::error || __nn == __nb)
14081606 __throw_runtime_error("locale not supported");
14091607 for (const char16_t* __p = __buf; __p < __bn; ++__p, ++__s)
1410 *__s = (wchar_t)*__p;
1608 *__s = *__p;
14111609 __nb = __nn;
14121610 }
14131611 return __s;
14141612 }
14151613};
14161614
1615_LIBCPP_SUPPRESS_DEPRECATED_PUSH
14171616template <>
14181617struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<32>
14191618 : public codecvt<char32_t, char, mbstate_t>
14201619{
14211620 _LIBCPP_INLINE_VISIBILITY
14221621 __widen_from_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}
1622_LIBCPP_SUPPRESS_DEPRECATED_POP
14231623
14241624 _LIBCPP_EXPORTED_FROM_ABI ~__widen_from_utf8();
14251625
......@@ -1441,7 +1641,7 @@ struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<32>
14411641 if (__r == codecvt_base::error || __nn == __nb)
14421642 __throw_runtime_error("locale not supported");
14431643 for (const char32_t* __p = __buf; __p < __bn; ++__p, ++__s)
1444 *__s = (wchar_t)*__p;
1644 *__s = *__p;
14451645 __nb = __nn;
14461646 }
14471647 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:
146146 unique_lock& operator=(unique_lock const&); // = delete;
147147
148148public:
149#ifndef _LIBCPP_CXX03_LANG
150149 _LIBCPP_INLINE_VISIBILITY
151150 unique_lock(unique_lock&& __u) _NOEXCEPT
152151 : __m_(__u.__m_), __owns_(__u.__owns_)
......@@ -163,8 +162,6 @@ public:
163162 return *this;
164163 }
165164
166#endif // _LIBCPP_CXX03_LANG
167
168165 void lock();
169166 bool try_lock();
170167
......@@ -382,12 +379,12 @@ __safe_nanosecond_cast(chrono::duration<_Rep, _Period> __d)
382379
383380 using __ratio = ratio_divide<_Period, nano>;
384381 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();
386383 if (__d.count() > 0 && __d.count() > __result_max / __ratio::num) {
387384 return nanoseconds::max();
388385 }
389386
390 __ns_rep __result_min = std::numeric_limits<__ns_rep>::min();
387 __ns_rep __result_min = numeric_limits<__ns_rep>::min();
391388 if (__d.count() < 0 && __d.count() < __result_min / __ratio::num) {
392389 return nanoseconds::min();
393390 }
......@@ -421,7 +418,7 @@ condition_variable::wait_until(unique_lock<mutex>& __lk,
421418 if (__t <= __now)
422419 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
426423 __do_timed_wait(__lk, __t_ns);
427424 return _Clock::now() < __t ? cv_status::no_timeout : cv_status::timeout;
......@@ -454,13 +451,13 @@ condition_variable::wait_for(unique_lock<mutex>& __lk,
454451
455452#if defined(_LIBCPP_HAS_COND_CLOCKWAIT)
456453 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();
458455#else
459456 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();
461458#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
465462 if (__now_count_ns > numeric_limits<__ns_rep>::max() - __d_ns_count) {
466463 __do_timed_wait(__lk, __clock_tp_ns::max());
lib/libcxx/include/__split_buffer+4-20
......@@ -68,7 +68,6 @@ public:
6868 __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
6969 ~__split_buffer();
7070
71#ifndef _LIBCPP_CXX03_LANG
7271 __split_buffer(__split_buffer&& __c)
7372 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
7473 __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
......@@ -76,7 +75,6 @@ public:
7675 _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
7776 is_nothrow_move_assignable<allocator_type>::value) ||
7877 !__alloc_traits::propagate_on_container_move_assignment::value);
79#endif // _LIBCPP_CXX03_LANG
8078
8179 _LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT {return __begin_;}
8280 _LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT {return __begin_;}
......@@ -101,12 +99,10 @@ public:
10199 void shrink_to_fit() _NOEXCEPT;
102100 void push_front(const_reference __x);
103101 _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
104#ifndef _LIBCPP_CXX03_LANG
105102 void push_front(value_type&& __x);
106103 void push_back(value_type&& __x);
107104 template <class... _Args>
108105 void emplace_back(_Args&&... __args);
109#endif // !defined(_LIBCPP_CXX03_LANG)
110106
111107 _LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);}
112108 _LIBCPP_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);}
......@@ -270,7 +266,7 @@ typename enable_if
270266>::type
271267__split_buffer<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last)
272268{
273 _ConstructTransaction __tx(&this->__end_, std::distance(__first, __last));
269 _ConstructTransaction __tx(&this->__end_, _VSTD::distance(__first, __last));
274270 for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, ++__first) {
275271 __alloc_traits::construct(this->__alloc(),
276272 _VSTD::__to_address(__tx.__pos_), *__first);
......@@ -283,7 +279,7 @@ void
283279__split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type)
284280{
285281 while (__begin_ != __new_begin)
286 __alloc_traits::destroy(__alloc(), __to_address(__begin_++));
282 __alloc_traits::destroy(__alloc(), _VSTD::__to_address(__begin_++));
287283}
288284
289285template <class _Tp, class _Allocator>
......@@ -300,7 +296,7 @@ void
300296__split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT
301297{
302298 while (__new_last != __end_)
303 __alloc_traits::destroy(__alloc(), __to_address(--__end_));
299 __alloc_traits::destroy(__alloc(), _VSTD::__to_address(--__end_));
304300}
305301
306302template <class _Tp, class _Allocator>
......@@ -350,8 +346,6 @@ __split_buffer<_Tp, _Allocator>::~__split_buffer()
350346 __alloc_traits::deallocate(__alloc(), __first_, capacity());
351347}
352348
353#ifndef _LIBCPP_CXX03_LANG
354
355349template <class _Tp, class _Allocator>
356350__split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)
357351 _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
......@@ -412,8 +406,6 @@ __split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c)
412406 return *this;
413407}
414408
415#endif // _LIBCPP_CXX03_LANG
416
417409template <class _Tp, class _Allocator>
418410void
419411__split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x)
......@@ -424,7 +416,7 @@ __split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x)
424416 _VSTD::swap(__begin_, __x.__begin_);
425417 _VSTD::swap(__end_, __x.__end_);
426418 _VSTD::swap(__end_cap(), __x.__end_cap());
427 __swap_allocator(__alloc(), __x.__alloc());
419 _VSTD::__swap_allocator(__alloc(), __x.__alloc());
428420}
429421
430422template <class _Tp, class _Allocator>
......@@ -499,8 +491,6 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x)
499491 --__begin_;
500492}
501493
502#ifndef _LIBCPP_CXX03_LANG
503
504494template <class _Tp, class _Allocator>
505495void
506496__split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
......@@ -531,8 +521,6 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
531521 --__begin_;
532522}
533523
534#endif // _LIBCPP_CXX03_LANG
535
536524template <class _Tp, class _Allocator>
537525inline _LIBCPP_INLINE_VISIBILITY
538526void
......@@ -563,8 +551,6 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x)
563551 ++__end_;
564552}
565553
566#ifndef _LIBCPP_CXX03_LANG
567
568554template <class _Tp, class _Allocator>
569555void
570556__split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)
......@@ -626,8 +612,6 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)
626612 ++__end_;
627613}
628614
629#endif // _LIBCPP_CXX03_LANG
630
631615template <class _Tp, class _Allocator>
632616inline _LIBCPP_INLINE_VISIBILITY
633617void
lib/libcxx/include/__sso_allocator+5-4
......@@ -11,8 +11,9 @@
1111#define _LIBCPP___SSO_ALLOCATOR
1212
1313#include <__config>
14#include <type_traits>
14#include <memory>
1515#include <new>
16#include <type_traits>
1617
1718#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1819#pragma GCC system_header
......@@ -47,21 +48,21 @@ public:
4748private:
4849 __sso_allocator& operator=(const __sso_allocator&);
4950public:
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)
5152 {
5253 if (!__allocated_ && __n <= _Np)
5354 {
5455 __allocated_ = true;
5556 return (pointer)&buf_;
5657 }
57 return static_cast<pointer>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));
58 return allocator<_Tp>().allocate(__n);
5859 }
5960 _LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type __n)
6061 {
6162 if (__p == (pointer)&buf_)
6263 __allocated_ = false;
6364 else
64 _VSTD::__libcpp_deallocate(__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
65 allocator<_Tp>().deallocate(__p, __n);
6566 }
6667 _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
5555
5656#include <__config>
5757#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
5961#include <memory> // for __murmur2_or_cityhash
6062
6163#include <__debug>
......@@ -92,7 +94,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
9294 _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type, size_type)) \
9395 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&)) \
9496 _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&)) \
9698 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_not_of(value_type const*, size_type, size_type) const) \
9799 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::~basic_string()) \
98100 _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
108110 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \
109111 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \
110112 _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&)) \
112114 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \
113115 _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \
114116 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \
......@@ -158,7 +160,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
158160 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \
159161 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \
160162 _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&)) \
162164 _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \
163165 _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \
164166 _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
268270 return __s;
269271 ++__s;
270272 }
271 return 0;
273 return nullptr;
272274}
273275
274276template <class _CharT>
......@@ -318,7 +320,7 @@ char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a)
318320// constexpr versions of move/copy/assign.
319321
320322template <class _CharT>
321static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
323static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
322324_CharT* __move_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT
323325{
324326 if (__n == 0) return __s1;
......@@ -331,7 +333,7 @@ _CharT* __move_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT
331333}
332334
333335template <class _CharT>
334static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
336static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
335337_CharT* __copy_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT
336338{
337339 _VSTD::copy_n(__s2, __n, __s1);
......@@ -339,7 +341,7 @@ _CharT* __copy_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT
339341}
340342
341343template <class _CharT>
342static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
344static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
343345_CharT* __assign_constexpr(_CharT* __s, size_t __n, _CharT __a) _NOEXCEPT
344346{
345347 _VSTD::fill_n(__s, __n, __a);
......@@ -370,27 +372,27 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char>
370372 length(const char_type* __s) _NOEXCEPT {return __builtin_strlen(__s);}
371373 static _LIBCPP_CONSTEXPR_AFTER_CXX14
372374 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_EVALUATED
375 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
374376 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
375377 {
376378 return __libcpp_is_constant_evaluated()
377 ? __move_constexpr(__s1, __s2, __n)
378 : __n == 0 ? __s1 : (char_type*)memmove(__s1, __s2, __n);
379 ? _VSTD::__move_constexpr(__s1, __s2, __n)
380 : __n == 0 ? __s1 : (char_type*)_VSTD::memmove(__s1, __s2, __n);
379381 }
380 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
382 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
381383 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
382384 {
383385 _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
384386 return __libcpp_is_constant_evaluated()
385 ? __copy_constexpr(__s1, __s2, __n)
386 : __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n);
387 ? _VSTD::__copy_constexpr(__s1, __s2, __n)
388 : __n == 0 ? __s1 : (char_type*)_VSTD::memcpy(__s1, __s2, __n);
387389 }
388 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
390 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
389391 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
390392 {
391393 return __libcpp_is_constant_evaluated()
392 ? __assign_constexpr(__s, __n, __a)
393 : __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n);
394 ? _VSTD::__assign_constexpr(__s, __n, __a)
395 : __n == 0 ? __s : (char_type*)_VSTD::memset(__s, to_int_type(__a), __n);
394396 }
395397
396398 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
414416#if __has_feature(cxx_constexpr_string_builtins)
415417 return __builtin_memcmp(__s1, __s2, __n);
416418#elif _LIBCPP_STD_VER <= 14
417 return memcmp(__s1, __s2, __n);
419 return _VSTD::memcmp(__s1, __s2, __n);
418420#else
419421 for (; __n; --__n, ++__s1, ++__s2)
420422 {
......@@ -436,7 +438,7 @@ char_traits<char>::find(const char_type* __s, size_t __n, const char_type& __a)
436438#if __has_feature(cxx_constexpr_string_builtins)
437439 return __builtin_char_memchr(__s, to_int_type(__a), __n);
438440#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);
440442#else
441443 for (; __n; --__n)
442444 {
......@@ -473,27 +475,27 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t>
473475 size_t length(const char_type* __s) _NOEXCEPT;
474476 static _LIBCPP_CONSTEXPR_AFTER_CXX14
475477 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_EVALUATED
478 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
477479 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
478480 {
479481 return __libcpp_is_constant_evaluated()
480 ? __move_constexpr(__s1, __s2, __n)
481 : __n == 0 ? __s1 : wmemmove(__s1, __s2, __n);
482 ? _VSTD::__move_constexpr(__s1, __s2, __n)
483 : __n == 0 ? __s1 : _VSTD::wmemmove(__s1, __s2, __n);
482484 }
483 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
485 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
484486 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
485487 {
486488 _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
487489 return __libcpp_is_constant_evaluated()
488 ? __copy_constexpr(__s1, __s2, __n)
489 : __n == 0 ? __s1 : wmemcpy(__s1, __s2, __n);
490 ? _VSTD::__copy_constexpr(__s1, __s2, __n)
491 : __n == 0 ? __s1 : _VSTD::wmemcpy(__s1, __s2, __n);
490492 }
491 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
493 static inline _LIBCPP_CONSTEXPR_AFTER_CXX17
492494 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
493495 {
494496 return __libcpp_is_constant_evaluated()
495 ? __assign_constexpr(__s, __n, __a)
496 : __n == 0 ? __s : wmemset(__s, __a, __n);
497 ? _VSTD::__assign_constexpr(__s, __n, __a)
498 : __n == 0 ? __s : _VSTD::wmemset(__s, __a, __n);
497499 }
498500 static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
499501 {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
516518#if __has_feature(cxx_constexpr_string_builtins)
517519 return __builtin_wmemcmp(__s1, __s2, __n);
518520#elif _LIBCPP_STD_VER <= 14
519 return wmemcmp(__s1, __s2, __n);
521 return _VSTD::wmemcmp(__s1, __s2, __n);
520522#else
521523 for (; __n; --__n, ++__s1, ++__s2)
522524 {
......@@ -548,7 +550,7 @@ char_traits<wchar_t>::length(const char_type* __s) _NOEXCEPT
548550#if __has_feature(cxx_constexpr_string_builtins)
549551 return __builtin_wcslen(__s);
550552#elif _LIBCPP_STD_VER <= 14
551 return wcslen(__s);
553 return _VSTD::wcslen(__s);
552554#else
553555 size_t __len = 0;
554556 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& __
566568#if __has_feature(cxx_constexpr_string_builtins)
567569 return __builtin_wmemchr(__s, __a, __n);
568570#elif _LIBCPP_STD_VER <= 14
569 return wmemchr(__s, __a, __n);
571 return _VSTD::wmemchr(__s, __a, __n);
570572#else
571573 for (; __n; --__n)
572574 {
......@@ -606,29 +608,29 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char8_t>
606608 _LIBCPP_INLINE_VISIBILITY static constexpr
607609 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_EVALUATED
611 static _LIBCPP_CONSTEXPR_AFTER_CXX17
610612 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
611613 {
612614 return __libcpp_is_constant_evaluated()
613 ? __move_constexpr(__s1, __s2, __n)
614 : __n == 0 ? __s1 : (char_type*)memmove(__s1, __s2, __n);
615 ? _VSTD::__move_constexpr(__s1, __s2, __n)
616 : __n == 0 ? __s1 : (char_type*)_VSTD::memmove(__s1, __s2, __n);
615617 }
616618
617 static _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
619 static _LIBCPP_CONSTEXPR_AFTER_CXX17
618620 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
619621 {
620622 _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
621623 return __libcpp_is_constant_evaluated()
622 ? __copy_constexpr(__s1, __s2, __n)
623 : __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n);
624 ? _VSTD::__copy_constexpr(__s1, __s2, __n)
625 : __n == 0 ? __s1 : (char_type*)_VSTD::memcpy(__s1, __s2, __n);
624626 }
625627
626 static _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
628 static _LIBCPP_CONSTEXPR_AFTER_CXX17
627629 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
628630 {
629631 return __libcpp_is_constant_evaluated()
630 ? __assign_constexpr(__s, __n, __a)
631 : __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n);
632 ? _VSTD::__assign_constexpr(__s, __n, __a)
633 : __n == 0 ? __s : (char_type*)_VSTD::memset(__s, to_int_type(__a), __n);
632634 }
633635
634636 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& __
683685 return __s;
684686 ++__s;
685687 }
686 return 0;
688 return nullptr;
687689}
688690
689691#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& _
765767 return __s;
766768 ++__s;
767769 }
768 return 0;
770 return nullptr;
769771}
770772
771773inline _LIBCPP_CONSTEXPR_AFTER_CXX17
......@@ -885,7 +887,7 @@ char_traits<char32_t>::find(const char_type* __s, size_t __n, const char_type& _
885887 return __s;
886888 ++__s;
887889 }
888 return 0;
890 return nullptr;
889891}
890892
891893inline _LIBCPP_CONSTEXPR_AFTER_CXX17
......@@ -943,7 +945,7 @@ __str_find(const _CharT *__p, _SizeT __sz,
943945 if (__pos >= __sz)
944946 return __npos;
945947 const _CharT* __r = _Traits::find(__p + __pos, __sz - __pos, __c);
946 if (__r == 0)
948 if (__r == nullptr)
947949 return __npos;
948950 return static_cast<_SizeT>(__r - __p);
949951}
......@@ -972,7 +974,7 @@ __search_substring(const _CharT *__first1, const _CharT *__last1,
972974
973975 // Find __f2 the first byte matching in __first1.
974976 __first1 = _Traits::find(__first1, __len1 - __len2 + 1, __f2);
975 if (__first1 == 0)
977 if (__first1 == nullptr)
976978 return __last1;
977979
978980 // 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,
10951097 {
10961098 const _CharT* __pe = __p + __sz;
10971099 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)
10991101 return static_cast<_SizeT>(__ps - __p);
11001102 }
11011103 return __npos;
......@@ -1129,7 +1131,7 @@ __str_find_last_not_of(const _CharT *__p, _SizeT __sz,
11291131 else
11301132 __pos = __sz;
11311133 for (const _CharT* __ps = __p + __pos; __ps != __p;)
1132 if (_Traits::find(__s, __n, *--__ps) == 0)
1134 if (_Traits::find(__s, __n, *--__ps) == nullptr)
11331135 return static_cast<_SizeT>(__ps - __p);
11341136 return __npos;
11351137}
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 @@
1111#define _LIBCPP_THREADING_SUPPORT
1212
1313#include <__config>
14#include <__availability>
1415#include <chrono>
1516#include <iosfwd>
1617#include <errno.h>
1718
19#ifdef __MVS__
20# include <__support/ibm/nanosleep.h>
21#endif
22
1823#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
1924#pragma GCC system_header
2025#endif
......@@ -26,7 +31,7 @@
2631#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
2732# include <pthread.h>
2833# include <sched.h>
29# ifdef __APPLE__
34# if defined(__APPLE__) || defined(__MVS__)
3035# define _LIBCPP_NO_NATIVE_SEMAPHORES
3136# endif
3237# ifndef _LIBCPP_NO_NATIVE_SEMAPHORES
......@@ -82,11 +87,14 @@ typedef pthread_once_t __libcpp_exec_once_flag;
8287#define _LIBCPP_EXEC_ONCE_INITIALIZER PTHREAD_ONCE_INIT
8388
8489// 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
8796// Thread
88#define _LIBCPP_NULL_THREAD 0U
89
97#define _LIBCPP_NULL_THREAD ((__libcpp_thread_t()))
9098typedef pthread_t __libcpp_thread_t;
9199
92100// Thread Local Storage
......@@ -278,24 +286,21 @@ int __libcpp_tls_set(__libcpp_tls_key __key, void *__p);
278286#endif // !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
279287
280288struct __libcpp_timed_backoff_policy {
281 _LIBCPP_THREAD_ABI_VISIBILITY
282 bool operator()(chrono::nanoseconds __elapsed) const;
289 _LIBCPP_INLINE_VISIBILITY
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 }
283302};
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
299304static _LIBCPP_CONSTEXPR const int __libcpp_polling_count = 64;
300305
301306template<class _Fn, class _BFn>
......@@ -484,7 +489,7 @@ int __libcpp_execute_once(__libcpp_exec_once_flag *flag,
484489// Returns non-zero if the thread ids are equal, otherwise 0
485490bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2)
486491{
487 return pthread_equal(t1, t2) != 0;
492 return t1 == t2;
488493}
489494
490495// 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)
495500
496501// Thread
497502bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) {
498 return *__t == 0;
503 return *__t == __libcpp_thread_t();
499504}
500505
501506int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),
502507 void *__arg)
503508{
504 return pthread_create(__t, 0, __func, __arg);
509 return pthread_create(__t, nullptr, __func, __arg);
505510}
506511
507512__libcpp_thread_id __libcpp_thread_get_current_id()
508513{
509 return pthread_self();
514 const __libcpp_thread_t thread = pthread_self();
515 return __libcpp_thread_get_id(&thread);
510516}
511517
512518__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t)
513519{
520#if defined(__MVS__)
521 return __t->__;
522#else
514523 return *__t;
524#endif
515525}
516526
517527int __libcpp_thread_join(__libcpp_thread_t *__t)
518528{
519 return pthread_join(*__t, 0);
529 return pthread_join(*__t, nullptr);
520530}
521531
522532int __libcpp_thread_detach(__libcpp_thread_t *__t)
......@@ -651,7 +661,7 @@ bool __libcpp_thread_id_less(__libcpp_thread_id t1, __libcpp_thread_id t2)
651661
652662// Thread
653663bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) {
654 return *__t == 0;
664 return __libcpp_thread_get_id(__t) == 0;
655665}
656666
657667int __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)
108108 if (__x->__right_ && !__x->__right_->__is_black_)
109109 return 0;
110110 }
111 unsigned __h = __tree_sub_invariant(__x->__left_);
111 unsigned __h = _VSTD::__tree_sub_invariant(__x->__left_);
112112 if (__h == 0)
113113 return 0; // invalid left subtree
114 if (__h != __tree_sub_invariant(__x->__right_))
114 if (__h != _VSTD::__tree_sub_invariant(__x->__right_))
115115 return 0; // invalid or different height right subtree
116116 return __h + __x->__is_black_; // return black height of this node
117117}
......@@ -128,13 +128,13 @@ __tree_invariant(_NodePtr __root)
128128 // check __x->__parent_ consistency
129129 if (__root->__parent_ == nullptr)
130130 return false;
131 if (!__tree_is_left_child(__root))
131 if (!_VSTD::__tree_is_left_child(__root))
132132 return false;
133133 // root must be black
134134 if (!__root->__is_black_)
135135 return false;
136136 // do normal node checks
137 return __tree_sub_invariant(__root) != 0;
137 return _VSTD::__tree_sub_invariant(__root) != 0;
138138}
139139
140140// Returns: pointer to the left-most node under __x.
......@@ -168,8 +168,8 @@ _NodePtr
168168__tree_next(_NodePtr __x) _NOEXCEPT
169169{
170170 if (__x->__right_ != nullptr)
171 return __tree_min(__x->__right_);
172 while (!__tree_is_left_child(__x))
171 return _VSTD::__tree_min(__x->__right_);
172 while (!_VSTD::__tree_is_left_child(__x))
173173 __x = __x->__parent_unsafe();
174174 return __x->__parent_unsafe();
175175}
......@@ -180,8 +180,8 @@ _EndNodePtr
180180__tree_next_iter(_NodePtr __x) _NOEXCEPT
181181{
182182 if (__x->__right_ != nullptr)
183 return static_cast<_EndNodePtr>(__tree_min(__x->__right_));
184 while (!__tree_is_left_child(__x))
183 return static_cast<_EndNodePtr>(_VSTD::__tree_min(__x->__right_));
184 while (!_VSTD::__tree_is_left_child(__x))
185185 __x = __x->__parent_unsafe();
186186 return static_cast<_EndNodePtr>(__x->__parent_);
187187}
......@@ -195,9 +195,9 @@ _NodePtr
195195__tree_prev_iter(_EndNodePtr __x) _NOEXCEPT
196196{
197197 if (__x->__left_ != nullptr)
198 return __tree_max(__x->__left_);
198 return _VSTD::__tree_max(__x->__left_);
199199 _NodePtr __xx = static_cast<_NodePtr>(__x);
200 while (__tree_is_left_child(__xx))
200 while (_VSTD::__tree_is_left_child(__xx))
201201 __xx = __xx->__parent_unsafe();
202202 return __xx->__parent_unsafe();
203203}
......@@ -237,7 +237,7 @@ __tree_left_rotate(_NodePtr __x) _NOEXCEPT
237237 if (__x->__right_ != nullptr)
238238 __x->__right_->__set_parent(__x);
239239 __y->__parent_ = __x->__parent_;
240 if (__tree_is_left_child(__x))
240 if (_VSTD::__tree_is_left_child(__x))
241241 __x->__parent_->__left_ = __y;
242242 else
243243 __x->__parent_unsafe()->__right_ = __y;
......@@ -257,7 +257,7 @@ __tree_right_rotate(_NodePtr __x) _NOEXCEPT
257257 if (__x->__left_ != nullptr)
258258 __x->__left_->__set_parent(__x);
259259 __y->__parent_ = __x->__parent_;
260 if (__tree_is_left_child(__x))
260 if (_VSTD::__tree_is_left_child(__x))
261261 __x->__parent_->__left_ = __y;
262262 else
263263 __x->__parent_unsafe()->__right_ = __y;
......@@ -281,7 +281,7 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
281281 while (__x != __root && !__x->__parent_unsafe()->__is_black_)
282282 {
283283 // __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()))
285285 {
286286 _NodePtr __y = __x->__parent_unsafe()->__parent_unsafe()->__right_;
287287 if (__y != nullptr && !__y->__is_black_)
......@@ -294,16 +294,16 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
294294 }
295295 else
296296 {
297 if (!__tree_is_left_child(__x))
297 if (!_VSTD::__tree_is_left_child(__x))
298298 {
299299 __x = __x->__parent_unsafe();
300 __tree_left_rotate(__x);
300 _VSTD::__tree_left_rotate(__x);
301301 }
302302 __x = __x->__parent_unsafe();
303303 __x->__is_black_ = true;
304304 __x = __x->__parent_unsafe();
305305 __x->__is_black_ = false;
306 __tree_right_rotate(__x);
306 _VSTD::__tree_right_rotate(__x);
307307 break;
308308 }
309309 }
......@@ -320,16 +320,16 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
320320 }
321321 else
322322 {
323 if (__tree_is_left_child(__x))
323 if (_VSTD::__tree_is_left_child(__x))
324324 {
325325 __x = __x->__parent_unsafe();
326 __tree_right_rotate(__x);
326 _VSTD::__tree_right_rotate(__x);
327327 }
328328 __x = __x->__parent_unsafe();
329329 __x->__is_black_ = true;
330330 __x = __x->__parent_unsafe();
331331 __x->__is_black_ = false;
332 __tree_left_rotate(__x);
332 _VSTD::__tree_left_rotate(__x);
333333 break;
334334 }
335335 }
......@@ -352,7 +352,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
352352 // __y will have at most one child.
353353 // __y will be the initial hole in the tree (make the hole at a leaf)
354354 _NodePtr __y = (__z->__left_ == nullptr || __z->__right_ == nullptr) ?
355 __z : __tree_next(__z);
355 __z : _VSTD::__tree_next(__z);
356356 // __x is __y's possibly null single child
357357 _NodePtr __x = __y->__left_ != nullptr ? __y->__left_ : __y->__right_;
358358 // __w is __x's possibly null uncle (will become __x's sibling)
......@@ -360,7 +360,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
360360 // link __x to __y's parent, and find __w
361361 if (__x != nullptr)
362362 __x->__parent_ = __y->__parent_;
363 if (__tree_is_left_child(__y))
363 if (_VSTD::__tree_is_left_child(__y))
364364 {
365365 __y->__parent_->__left_ = __x;
366366 if (__y != __root)
......@@ -381,7 +381,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
381381 {
382382 // __z->__left_ != nulptr but __z->__right_ might == __x == nullptr
383383 __y->__parent_ = __z->__parent_;
384 if (__tree_is_left_child(__z))
384 if (_VSTD::__tree_is_left_child(__z))
385385 __y->__parent_->__left_ = __y;
386386 else
387387 __y->__parent_unsafe()->__right_ = __y;
......@@ -421,13 +421,13 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
421421 // with a non-null black child).
422422 while (true)
423423 {
424 if (!__tree_is_left_child(__w)) // if x is left child
424 if (!_VSTD::__tree_is_left_child(__w)) // if x is left child
425425 {
426426 if (!__w->__is_black_)
427427 {
428428 __w->__is_black_ = true;
429429 __w->__parent_unsafe()->__is_black_ = false;
430 __tree_left_rotate(__w->__parent_unsafe());
430 _VSTD::__tree_left_rotate(__w->__parent_unsafe());
431431 // __x is still valid
432432 // reset __root only if necessary
433433 if (__root == __w->__left_)
......@@ -448,7 +448,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
448448 break;
449449 }
450450 // reset sibling, and it still can't be null
451 __w = __tree_is_left_child(__x) ?
451 __w = _VSTD::__tree_is_left_child(__x) ?
452452 __x->__parent_unsafe()->__right_ :
453453 __x->__parent_->__left_;
454454 // continue;
......@@ -460,7 +460,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
460460 // __w left child is non-null and red
461461 __w->__left_->__is_black_ = true;
462462 __w->__is_black_ = false;
463 __tree_right_rotate(__w);
463 _VSTD::__tree_right_rotate(__w);
464464 // __w is known not to be root, so root hasn't changed
465465 // reset sibling, and it still can't be null
466466 __w = __w->__parent_unsafe();
......@@ -469,7 +469,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
469469 __w->__is_black_ = __w->__parent_unsafe()->__is_black_;
470470 __w->__parent_unsafe()->__is_black_ = true;
471471 __w->__right_->__is_black_ = true;
472 __tree_left_rotate(__w->__parent_unsafe());
472 _VSTD::__tree_left_rotate(__w->__parent_unsafe());
473473 break;
474474 }
475475 }
......@@ -479,7 +479,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
479479 {
480480 __w->__is_black_ = true;
481481 __w->__parent_unsafe()->__is_black_ = false;
482 __tree_right_rotate(__w->__parent_unsafe());
482 _VSTD::__tree_right_rotate(__w->__parent_unsafe());
483483 // __x is still valid
484484 // reset __root only if necessary
485485 if (__root == __w->__right_)
......@@ -500,7 +500,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
500500 break;
501501 }
502502 // reset sibling, and it still can't be null
503 __w = __tree_is_left_child(__x) ?
503 __w = _VSTD::__tree_is_left_child(__x) ?
504504 __x->__parent_unsafe()->__right_ :
505505 __x->__parent_->__left_;
506506 // continue;
......@@ -512,7 +512,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
512512 // __w right child is non-null and red
513513 __w->__right_->__is_black_ = true;
514514 __w->__is_black_ = false;
515 __tree_left_rotate(__w);
515 _VSTD::__tree_left_rotate(__w);
516516 // __w is known not to be root, so root hasn't changed
517517 // reset sibling, and it still can't be null
518518 __w = __w->__parent_unsafe();
......@@ -521,7 +521,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
521521 __w->__is_black_ = __w->__parent_unsafe()->__is_black_;
522522 __w->__parent_unsafe()->__is_black_ = true;
523523 __w->__left_->__is_black_ = true;
524 __tree_right_rotate(__w->__parent_unsafe());
524 _VSTD::__tree_right_rotate(__w->__parent_unsafe());
525525 break;
526526 }
527527 }
......@@ -533,19 +533,17 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
533533// node traits
534534
535535
536#ifndef _LIBCPP_CXX03_LANG
537536template <class _Tp>
538537struct __is_tree_value_type_imp : false_type {};
539538
540539template <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
543542template <class ..._Args>
544543struct __is_tree_value_type : false_type {};
545544
546545template <class _One>
547546struct __is_tree_value_type<_One> : __is_tree_value_type_imp<typename __uncvref<_One>::type> {};
548#endif
549547
550548template <class _Tp>
551549struct __tree_key_value_types {
......@@ -566,12 +564,10 @@ struct __tree_key_value_types {
566564 static __container_value_type* __get_ptr(__node_value_type& __n) {
567565 return _VSTD::addressof(__n);
568566 }
569#ifndef _LIBCPP_CXX03_LANG
570567 _LIBCPP_INLINE_VISIBILITY
571568 static __container_value_type&& __move(__node_value_type& __v) {
572569 return _VSTD::move(__v);
573570 }
574#endif
575571};
576572
577573template <class _Key, class _Tp>
......@@ -616,12 +612,10 @@ struct __tree_key_value_types<__value_type<_Key, _Tp> > {
616612 return _VSTD::addressof(__n.__get_value());
617613 }
618614
619#ifndef _LIBCPP_CXX03_LANG
620615 _LIBCPP_INLINE_VISIBILITY
621616 static pair<key_type&&, mapped_type&&> __move(__node_value_type& __v) {
622617 return __v.__move();
623618 }
624#endif
625619};
626620
627621template <class _VoidPtr>
......@@ -845,7 +839,7 @@ public:
845839 _LIBCPP_INLINE_VISIBILITY
846840 __tree_iterator& operator++() {
847841 __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_)));
849843 return *this;
850844 }
851845 _LIBCPP_INLINE_VISIBILITY
......@@ -854,7 +848,7 @@ public:
854848
855849 _LIBCPP_INLINE_VISIBILITY
856850 __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>(
858852 static_cast<__end_node_pointer>(__ptr_)));
859853 return *this;
860854 }
......@@ -926,7 +920,7 @@ public:
926920 _LIBCPP_INLINE_VISIBILITY
927921 __tree_const_iterator& operator++() {
928922 __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_)));
930924 return *this;
931925 }
932926
......@@ -936,7 +930,7 @@ public:
936930
937931 _LIBCPP_INLINE_VISIBILITY
938932 __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>(
940934 static_cast<__end_node_pointer>(__ptr_)));
941935 return *this;
942936 }
......@@ -973,7 +967,7 @@ private:
973967
974968template<class _Tp, class _Compare>
975969#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,
977971 "the specified comparator type does not provide a viable const call operator")
978972#endif
979973int __diagnose_non_const_comparator();
......@@ -1103,7 +1097,6 @@ public:
11031097 void __assign_unique(_ForwardIterator __first, _ForwardIterator __last);
11041098 template <class _InputIterator>
11051099 void __assign_multi(_InputIterator __first, _InputIterator __last);
1106#ifndef _LIBCPP_CXX03_LANG
11071100 __tree(__tree&& __t)
11081101 _NOEXCEPT_(
11091102 is_nothrow_move_constructible<__node_allocator>::value &&
......@@ -1114,8 +1107,6 @@ public:
11141107 __node_traits::propagate_on_container_move_assignment::value &&
11151108 is_nothrow_move_assignable<value_compare>::value &&
11161109 is_nothrow_move_assignable<__node_allocator>::value);
1117#endif // _LIBCPP_CXX03_LANG
1118
11191110 ~__tree();
11201111
11211112 _LIBCPP_INLINE_VISIBILITY
......@@ -1129,7 +1120,7 @@ public:
11291120
11301121 _LIBCPP_INLINE_VISIBILITY
11311122 size_type max_size() const _NOEXCEPT
1132 {return std::min<size_type>(
1123 {return _VSTD::min<size_type>(
11331124 __node_traits::max_size(__node_alloc()),
11341125 numeric_limits<difference_type >::max());}
11351126
......@@ -1146,12 +1137,11 @@ public:
11461137 _NOEXCEPT_(__is_nothrow_swappable<value_compare>::value);
11471138#endif
11481139
1149#ifndef _LIBCPP_CXX03_LANG
11501140 template <class _Key, class ..._Args>
11511141 pair<iterator, bool>
11521142 __emplace_unique_key_args(_Key const&, _Args&&... __args);
11531143 template <class _Key, class ..._Args>
1154 iterator
1144 pair<iterator, bool>
11551145 __emplace_hint_unique_key_args(const_iterator, _Key const&, _Args&&...);
11561146
11571147 template <class... _Args>
......@@ -1225,7 +1215,7 @@ public:
12251215 >::type __emplace_hint_unique(const_iterator __p, _First&& __f, _Second&& __s) {
12261216 return __emplace_hint_unique_key_args(__p, __f,
12271217 _VSTD::forward<_First>(__f),
1228 _VSTD::forward<_Second>(__s));
1218 _VSTD::forward<_Second>(__s)).first;
12291219 }
12301220
12311221 template <class... _Args>
......@@ -1245,25 +1235,16 @@ public:
12451235 _LIBCPP_INLINE_VISIBILITY
12461236 iterator
12471237 __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;
12491239 }
12501240
12511241 template <class _Pp>
12521242 _LIBCPP_INLINE_VISIBILITY
12531243 iterator
12541244 __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;
12561246 }
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
12671248 _LIBCPP_INLINE_VISIBILITY
12681249 pair<iterator, bool> __insert_unique(const __container_value_type& __v) {
12691250 return __emplace_unique_key_args(_NodeTypes::__get_key(__v), __v);
......@@ -1271,15 +1252,9 @@ public:
12711252
12721253 _LIBCPP_INLINE_VISIBILITY
12731254 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;
12751256 }
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
12831258 _LIBCPP_INLINE_VISIBILITY
12841259 pair<iterator, bool> __insert_unique(__container_value_type&& __v) {
12851260 return __emplace_unique_key_args(_NodeTypes::__get_key(__v), _VSTD::move(__v));
......@@ -1287,7 +1262,7 @@ public:
12871262
12881263 _LIBCPP_INLINE_VISIBILITY
12891264 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;
12911266 }
12921267
12931268 template <class _Vp, class = typename enable_if<
......@@ -1332,8 +1307,6 @@ public:
13321307 return __emplace_hint_multi(__p, _VSTD::forward<_Vp>(__v));
13331308 }
13341309
1335#endif // !_LIBCPP_CXX03_LANG
1336
13371310 _LIBCPP_INLINE_VISIBILITY
13381311 pair<iterator, bool> __node_assign_unique(const __container_value_type& __v, __node_pointer __dest);
13391312
......@@ -1455,7 +1428,7 @@ private:
14551428 __node_base_pointer&
14561429 __find_leaf(const_iterator __hint,
14571430 __parent_pointer& __parent, const key_type& __v);
1458 // FIXME: Make this function const qualified. Unfortunetly doing so
1431 // FIXME: Make this function const qualified. Unfortunately doing so
14591432 // breaks existing code which uses non-const callable comparators.
14601433 template <class _Key>
14611434 __node_base_pointer&
......@@ -1471,12 +1444,8 @@ private:
14711444 __node_base_pointer& __dummy,
14721445 const _Key& __v);
14731446
1474#ifndef _LIBCPP_CXX03_LANG
14751447 template <class ..._Args>
14761448 __node_holder __construct_node(_Args&& ...__args);
1477#else
1478 __node_holder __construct_node(const __container_value_type& __v);
1479#endif
14801449
14811450 void destroy(__node_pointer __nd) _NOEXCEPT;
14821451
......@@ -1621,20 +1590,20 @@ __tree<_Tp, _Compare, _Allocator>::_DetachedTreeCache::__detach_next(__node_poin
16211590{
16221591 if (__cache->__parent_ == nullptr)
16231592 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)))
16251594 {
16261595 __cache->__parent_->__left_ = nullptr;
16271596 __cache = static_cast<__node_pointer>(__cache->__parent_);
16281597 if (__cache->__right_ == nullptr)
16291598 return __cache;
1630 return static_cast<__node_pointer>(__tree_leaf(__cache->__right_));
1599 return static_cast<__node_pointer>(_VSTD::__tree_leaf(__cache->__right_));
16311600 }
16321601 // __cache is right child
16331602 __cache->__parent_unsafe()->__right_ = nullptr;
16341603 __cache = static_cast<__node_pointer>(__cache->__parent_);
16351604 if (__cache->__left_ == nullptr)
16361605 return __cache;
1637 return static_cast<__node_pointer>(__tree_leaf(__cache->__left_));
1606 return static_cast<__node_pointer>(_VSTD::__tree_leaf(__cache->__left_));
16381607}
16391608
16401609template <class _Tp, class _Compare, class _Allocator>
......@@ -1706,8 +1675,6 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
17061675 __begin_node() = __end_node();
17071676}
17081677
1709#ifndef _LIBCPP_CXX03_LANG
1710
17111678template <class _Tp, class _Compare, class _Allocator>
17121679__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)
17131680 _NOEXCEPT_(
......@@ -1814,8 +1781,6 @@ __tree<_Tp, _Compare, _Allocator>::operator=(__tree&& __t)
18141781 return *this;
18151782}
18161783
1817#endif // _LIBCPP_CXX03_LANG
1818
18191784template <class _Tp, class _Compare, class _Allocator>
18201785__tree<_Tp, _Compare, _Allocator>::~__tree()
18211786{
......@@ -1854,7 +1819,7 @@ __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
18541819 using _VSTD::swap;
18551820 swap(__begin_node_, __t.__begin_node_);
18561821 swap(__pair1_.first(), __t.__pair1_.first());
1857 __swap_allocator(__node_alloc(), __t.__node_alloc());
1822 _VSTD::__swap_allocator(__node_alloc(), __t.__node_alloc());
18581823 __pair3_.swap(__t.__pair3_);
18591824 if (size() == 0)
18601825 __begin_node() = __end_node();
......@@ -2113,21 +2078,14 @@ void __tree<_Tp, _Compare, _Allocator>::__insert_node_at(
21132078 __child = __new_node;
21142079 if (__begin_node()->__left_ != nullptr)
21152080 __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);
21172082 ++size();
21182083}
21192084
2120#ifndef _LIBCPP_CXX03_LANG
21212085template <class _Tp, class _Compare, class _Allocator>
21222086template <class _Key, class... _Args>
21232087pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
21242088__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
21312089{
21322090 __parent_pointer __parent;
21332091 __node_base_pointer& __child = __find_equal(__parent, __k);
......@@ -2135,11 +2093,7 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _A
21352093 bool __inserted = false;
21362094 if (__child == nullptr)
21372095 {
2138#ifndef _LIBCPP_CXX03_LANG
21392096 __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
2140#else
2141 __node_holder __h = __construct_node(__args);
2142#endif
21432097 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
21442098 __r = __h.release();
21452099 __inserted = true;
......@@ -2147,41 +2101,27 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _A
21472101 return pair<iterator, bool>(iterator(__r), __inserted);
21482102}
21492103
2150
2151#ifndef _LIBCPP_CXX03_LANG
21522104template <class _Tp, class _Compare, class _Allocator>
21532105template <class _Key, class... _Args>
2154typename __tree<_Tp, _Compare, _Allocator>::iterator
2106pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
21552107__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_key_args(
21562108 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
21642109{
21652110 __parent_pointer __parent;
21662111 __node_base_pointer __dummy;
21672112 __node_base_pointer& __child = __find_equal(__p, __parent, __dummy, __k);
21682113 __node_pointer __r = static_cast<__node_pointer>(__child);
2114 bool __inserted = false;
21692115 if (__child == nullptr)
21702116 {
2171#ifndef _LIBCPP_CXX03_LANG
21722117 __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
2173#else
2174 __node_holder __h = __construct_node(__args);
2175#endif
21762118 __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
21772119 __r = __h.release();
2120 __inserted = true;
21782121 }
2179 return iterator(__r);
2122 return pair<iterator, bool>(iterator(__r), __inserted);
21802123}
21812124
2182
2183#ifndef _LIBCPP_CXX03_LANG
2184
21852125template <class _Tp, class _Compare, class _Allocator>
21862126template <class ..._Args>
21872127typename __tree<_Tp, _Compare, _Allocator>::__node_holder
......@@ -2259,46 +2199,6 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p,
22592199 return iterator(static_cast<__node_pointer>(__h.release()));
22602200}
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
23022202template <class _Tp, class _Compare, class _Allocator>
23032203pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
23042204__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) _
23482248 if (__begin_node() == __ptr)
23492249 __begin_node() = __r.__ptr_;
23502250 --size();
2351 __tree_remove(__end_node()->__left_,
2352 static_cast<__node_base_pointer>(__ptr));
2251 _VSTD::__tree_remove(__end_node()->__left_,
2252 static_cast<__node_base_pointer>(__ptr));
23532253 return __r;
23542254}
23552255
......@@ -2727,7 +2627,7 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k)
27272627 return _Pp(iterator(__rt),
27282628 iterator(
27292629 __rt->__right_ != nullptr ?
2730 static_cast<__iter_pointer>(__tree_min(__rt->__right_))
2630 static_cast<__iter_pointer>(_VSTD::__tree_min(__rt->__right_))
27312631 : __result));
27322632 }
27332633 return _Pp(iterator(__result), iterator(__result));
......@@ -2755,7 +2655,7 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const
27552655 return _Pp(const_iterator(__rt),
27562656 const_iterator(
27572657 __rt->__right_ != nullptr ?
2758 static_cast<__iter_pointer>(__tree_min(__rt->__right_))
2658 static_cast<__iter_pointer>(_VSTD::__tree_min(__rt->__right_))
27592659 : __result));
27602660 }
27612661 return _Pp(const_iterator(__result), const_iterator(__result));
......@@ -2824,8 +2724,8 @@ __tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p) _NOEXCEPT
28242724 __begin_node() = static_cast<__iter_pointer>(__np->__parent_);
28252725 }
28262726 --size();
2827 __tree_remove(__end_node()->__left_,
2828 static_cast<__node_base_pointer>(__np));
2727 _VSTD::__tree_remove(__end_node()->__left_,
2728 static_cast<__node_base_pointer>(__np));
28292729 return __node_holder(__np, _Dp(__node_alloc(), true));
28302730}
28312731
lib/libcxx/include/algorithm+417-268
......@@ -47,16 +47,16 @@ template <class InputIterator, class Predicate>
4747 find_if(InputIterator first, InputIterator last, Predicate pred);
4848
4949template<class InputIterator, class Predicate>
50 InputIterator // constexpr in C++20
50 constexpr InputIterator // constexpr in C++20
5151 find_if_not(InputIterator first, InputIterator last, Predicate pred);
5252
5353template <class ForwardIterator1, class ForwardIterator2>
54 ForwardIterator1 // constexpr in C++20
54 constexpr ForwardIterator1 // constexpr in C++20
5555 find_end(ForwardIterator1 first1, ForwardIterator1 last1,
5656 ForwardIterator2 first2, ForwardIterator2 last2);
5757
5858template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
59 ForwardIterator1 // constexpr in C++20
59 constexpr ForwardIterator1 // constexpr in C++20
6060 find_end(ForwardIterator1 first1, ForwardIterator1 last1,
6161 ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred);
6262
......@@ -185,11 +185,11 @@ template <class BidirectionalIterator1, class BidirectionalIterator2>
185185 BidirectionalIterator2 result);
186186
187187template <class ForwardIterator1, class ForwardIterator2>
188 ForwardIterator2
188 constexpr ForwardIterator2 // constexpr in C++20
189189 swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2);
190190
191191template <class ForwardIterator1, class ForwardIterator2>
192 void
192 constexpr void // constexpr in C++20
193193 iter_swap(ForwardIterator1 a, ForwardIterator2 b);
194194
195195template <class InputIterator, class OutputIterator, class UnaryOperation>
......@@ -251,23 +251,23 @@ template <class InputIterator, class OutputIterator, class Predicate>
251251 remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred);
252252
253253template <class ForwardIterator>
254 ForwardIterator
254 constexpr ForwardIterator // constexpr in C++20
255255 unique(ForwardIterator first, ForwardIterator last);
256256
257257template <class ForwardIterator, class BinaryPredicate>
258 ForwardIterator
258 constexpr ForwardIterator // constexpr in C++20
259259 unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred);
260260
261261template <class InputIterator, class OutputIterator>
262 OutputIterator
262 constexpr OutputIterator // constexpr in C++20
263263 unique_copy(InputIterator first, InputIterator last, OutputIterator result);
264264
265265template <class InputIterator, class OutputIterator, class BinaryPredicate>
266 OutputIterator
266 constexpr OutputIterator // constexpr in C++20
267267 unique_copy(InputIterator first, InputIterator last, OutputIterator result, BinaryPredicate pred);
268268
269269template <class BidirectionalIterator>
270 void
270 constexpr void // constexpr in C++20
271271 reverse(BidirectionalIterator first, BidirectionalIterator last);
272272
273273template <class BidirectionalIterator, class OutputIterator>
......@@ -275,11 +275,11 @@ template <class BidirectionalIterator, class OutputIterator>
275275 reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result);
276276
277277template <class ForwardIterator>
278 ForwardIterator
278 constexpr ForwardIterator // constexpr in C++20
279279 rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last);
280280
281281template <class ForwardIterator, class OutputIterator>
282 OutputIterator
282 constexpr OutputIterator // constexpr in C++20
283283 rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, OutputIterator result);
284284
285285template <class RandomAccessIterator>
......@@ -301,12 +301,22 @@ template<class RandomAccessIterator, class UniformRandomNumberGenerator>
301301 void shuffle(RandomAccessIterator first, RandomAccessIterator last,
302302 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
304314template <class InputIterator, class Predicate>
305315 constexpr bool // constexpr in C++20
306316 is_partitioned(InputIterator first, InputIterator last, Predicate pred);
307317
308318template <class ForwardIterator, class Predicate>
309 ForwardIterator
319 constexpr ForwardIterator // constexpr in C++20
310320 partition(ForwardIterator first, ForwardIterator last, Predicate pred);
311321
312322template <class InputIterator, class OutputIterator1,
......@@ -329,7 +339,7 @@ template <class ForwardIterator>
329339 is_sorted(ForwardIterator first, ForwardIterator last);
330340
331341template <class ForwardIterator, class Compare>
332 bool
342 constexpr bool // constexpr in C++20
333343 is_sorted(ForwardIterator first, ForwardIterator last, Compare comp);
334344
335345template<class ForwardIterator>
......@@ -415,12 +425,12 @@ template <class ForwardIterator, class T, class Compare>
415425 binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);
416426
417427template <class InputIterator1, class InputIterator2, class OutputIterator>
418 OutputIterator
428 constexpr OutputIterator // constexpr in C++20
419429 merge(InputIterator1 first1, InputIterator1 last1,
420430 InputIterator2 first2, InputIterator2 last2, OutputIterator result);
421431
422432template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
423 OutputIterator
433 constexpr OutputIterator // constexpr in C++20
424434 merge(InputIterator1 first1, InputIterator1 last1,
425435 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
426436
......@@ -441,12 +451,12 @@ template <class InputIterator1, class InputIterator2, class Compare>
441451 includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp);
442452
443453template <class InputIterator1, class InputIterator2, class OutputIterator>
444 OutputIterator
454 constexpr OutputIterator // constexpr in C++20
445455 set_union(InputIterator1 first1, InputIterator1 last1,
446456 InputIterator2 first2, InputIterator2 last2, OutputIterator result);
447457
448458template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
449 OutputIterator
459 constexpr OutputIterator // constexpr in C++20
450460 set_union(InputIterator1 first1, InputIterator1 last1,
451461 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
452462
......@@ -461,22 +471,22 @@ template <class InputIterator1, class InputIterator2, class OutputIterator, clas
461471 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
462472
463473template <class InputIterator1, class InputIterator2, class OutputIterator>
464 OutputIterator
474 constexpr OutputIterator // constexpr in C++20
465475 set_difference(InputIterator1 first1, InputIterator1 last1,
466476 InputIterator2 first2, InputIterator2 last2, OutputIterator result);
467477
468478template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
469 OutputIterator
479 constexpr OutputIterator // constexpr in C++20
470480 set_difference(InputIterator1 first1, InputIterator1 last1,
471481 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
472482
473483template <class InputIterator1, class InputIterator2, class OutputIterator>
474 OutputIterator
484 constexpr OutputIterator // constexpr in C++20
475485 set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,
476486 InputIterator2 first2, InputIterator2 last2, OutputIterator result);
477487
478488template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare>
479 OutputIterator
489 constexpr OutputIterator // constexpr in C++20
480490 set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,
481491 InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);
482492
......@@ -529,82 +539,82 @@ template <class RandomAccessIterator, class Compare>
529539 is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp);
530540
531541template <class ForwardIterator>
532 ForwardIterator
533 min_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14
542 constexpr ForwardIterator // constexpr in C++14
543 min_element(ForwardIterator first, ForwardIterator last);
534544
535545template <class ForwardIterator, class Compare>
536 ForwardIterator
537 min_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14
546 constexpr ForwardIterator // constexpr in C++14
547 min_element(ForwardIterator first, ForwardIterator last, Compare comp);
538548
539549template <class T>
540 const T&
541 min(const T& a, const T& b); // constexpr in C++14
550 constexpr const T& // constexpr in C++14
551 min(const T& a, const T& b);
542552
543553template <class T, class Compare>
544 const T&
545 min(const T& a, const T& b, Compare comp); // constexpr in C++14
554 constexpr const T& // constexpr in C++14
555 min(const T& a, const T& b, Compare comp);
546556
547557template<class T>
548 T
549 min(initializer_list<T> t); // constexpr in C++14
558 constexpr T // constexpr in C++14
559 min(initializer_list<T> t);
550560
551561template<class T, class Compare>
552 T
553 min(initializer_list<T> t, Compare comp); // constexpr in C++14
562 constexpr T // constexpr in C++14
563 min(initializer_list<T> t, Compare comp);
554564
555565template<class T>
556 constexpr const T& clamp( const T& v, const T& lo, const T& hi ); // C++17
566 constexpr const T& clamp(const T& v, const T& lo, const T& hi); // C++17
557567
558568template<class T, class Compare>
559 constexpr const T& clamp( const T& v, const T& lo, const T& hi, Compare comp ); // C++17
569 constexpr const T& clamp(const T& v, const T& lo, const T& hi, Compare comp); // C++17
560570
561571template <class ForwardIterator>
562 ForwardIterator
563 max_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14
572 constexpr ForwardIterator // constexpr in C++14
573 max_element(ForwardIterator first, ForwardIterator last);
564574
565575template <class ForwardIterator, class Compare>
566 ForwardIterator
567 max_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14
576 constexpr ForwardIterator // constexpr in C++14
577 max_element(ForwardIterator first, ForwardIterator last, Compare comp);
568578
569579template <class T>
570 const T&
571 max(const T& a, const T& b); // constexpr in C++14
580 constexpr const T& // constexpr in C++14
581 max(const T& a, const T& b);
572582
573583template <class T, class Compare>
574 const T&
575 max(const T& a, const T& b, Compare comp); // constexpr in C++14
584 constexpr const T& // constexpr in C++14
585 max(const T& a, const T& b, Compare comp);
576586
577587template<class T>
578 T
579 max(initializer_list<T> t); // constexpr in C++14
588 constexpr T // constexpr in C++14
589 max(initializer_list<T> t);
580590
581591template<class T, class Compare>
582 T
583 max(initializer_list<T> t, Compare comp); // constexpr in C++14
592 constexpr T // constexpr in C++14
593 max(initializer_list<T> t, Compare comp);
584594
585595template<class ForwardIterator>
586 pair<ForwardIterator, ForwardIterator>
587 minmax_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14
596 constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14
597 minmax_element(ForwardIterator first, ForwardIterator last);
588598
589599template<class ForwardIterator, class Compare>
590 pair<ForwardIterator, ForwardIterator>
591 minmax_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14
600 constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14
601 minmax_element(ForwardIterator first, ForwardIterator last, Compare comp);
592602
593603template<class T>
594 pair<const T&, const T&>
595 minmax(const T& a, const T& b); // constexpr in C++14
604 constexpr pair<const T&, const T&> // constexpr in C++14
605 minmax(const T& a, const T& b);
596606
597607template<class T, class Compare>
598 pair<const T&, const T&>
599 minmax(const T& a, const T& b, Compare comp); // constexpr in C++14
608 constexpr pair<const T&, const T&> // constexpr in C++14
609 minmax(const T& a, const T& b, Compare comp);
600610
601611template<class T>
602 pair<T, T>
603 minmax(initializer_list<T> t); // constexpr in C++14
612 constexpr pair<T, T> // constexpr in C++14
613 minmax(initializer_list<T> t);
604614
605615template<class T, class Compare>
606 pair<T, T>
607 minmax(initializer_list<T> t, Compare comp); // constexpr in C++14
616 constexpr pair<T, T> // constexpr in C++14
617 minmax(initializer_list<T> t, Compare comp);
608618
609619template <class InputIterator1, class InputIterator2>
610620 constexpr bool // constexpr in C++20
......@@ -616,19 +626,19 @@ template <class InputIterator1, class InputIterator2, class Compare>
616626 InputIterator2 first2, InputIterator2 last2, Compare comp);
617627
618628template <class BidirectionalIterator>
619 bool
629 constexpr bool // constexpr in C++20
620630 next_permutation(BidirectionalIterator first, BidirectionalIterator last);
621631
622632template <class BidirectionalIterator, class Compare>
623 bool
633 constexpr bool // constexpr in C++20
624634 next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp);
625635
626636template <class BidirectionalIterator>
627 bool
637 constexpr bool // constexpr in C++20
628638 prev_permutation(BidirectionalIterator first, BidirectionalIterator last);
629639
630640template <class BidirectionalIterator, class Compare>
631 bool
641 constexpr bool // constexpr in C++20
632642 prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp);
633643
634644} // std
......@@ -895,7 +905,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
895905_InputIterator
896906for_each_n(_InputIterator __first, _Size __orig_n, _Function __f)
897907{
898 typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;
908 typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
899909 _IntegralSize __n = __orig_n;
900910 while (__n > 0)
901911 {
......@@ -1614,7 +1624,7 @@ search_n(_ForwardIterator __first, _ForwardIterator __last,
16141624 _Size __count, const _Tp& __value_, _BinaryPredicate __pred)
16151625{
16161626 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,
16181628 typename iterator_traits<_ForwardIterator>::iterator_category());
16191629}
16201630
......@@ -1625,13 +1635,13 @@ _ForwardIterator
16251635search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_)
16261636{
16271637 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),
16291639 __value_, __equal_to<__v, _Tp>());
16301640}
16311641
16321642// copy
16331643template <class _Iter>
1634inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1644inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
16351645_Iter
16361646__unwrap_iter(_Iter __i)
16371647{
......@@ -1639,7 +1649,7 @@ __unwrap_iter(_Iter __i)
16391649}
16401650
16411651template <class _Tp>
1642inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1652inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
16431653typename enable_if
16441654<
16451655 is_trivially_copy_assignable<_Tp>::value,
......@@ -1653,7 +1663,7 @@ __unwrap_iter(move_iterator<_Tp*> __i)
16531663#if _LIBCPP_DEBUG_LEVEL < 2
16541664
16551665template <class _Tp>
1656inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
1666inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
16571667typename enable_if
16581668<
16591669 is_trivially_copy_assignable<_Tp>::value,
......@@ -1665,7 +1675,7 @@ __unwrap_iter(__wrap_iter<_Tp*> __i)
16651675}
16661676
16671677template <class _Tp>
1668inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
1678inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
16691679typename enable_if
16701680<
16711681 is_trivially_copy_assignable<_Tp>::value,
......@@ -1679,7 +1689,7 @@ __unwrap_iter(__wrap_iter<const _Tp*> __i)
16791689#else
16801690
16811691template <class _Tp>
1682inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
1692inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
16831693typename enable_if
16841694<
16851695 is_trivially_copy_assignable<_Tp>::value,
......@@ -1707,7 +1717,7 @@ inline _LIBCPP_INLINE_VISIBILITY
17071717_OutputIterator
17081718__copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
17091719{
1710 return __copy_constexpr(__first, __last, __result);
1720 return _VSTD::__copy_constexpr(__first, __last, __result);
17111721}
17121722
17131723template <class _Tp, class _Up>
......@@ -1727,16 +1737,16 @@ __copy(_Tp* __first, _Tp* __last, _Up* __result)
17271737}
17281738
17291739template <class _InputIterator, class _OutputIterator>
1730inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
1740inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
17311741_OutputIterator
17321742copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
17331743{
17341744 if (__libcpp_is_constant_evaluated()) {
17351745 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));
17371747 } else {
17381748 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));
17401750 }
17411751}
17421752
......@@ -1757,7 +1767,7 @@ inline _LIBCPP_INLINE_VISIBILITY
17571767_OutputIterator
17581768__copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
17591769{
1760 return __copy_backward_constexpr(__first, __last, __result);
1770 return _VSTD::__copy_backward_constexpr(__first, __last, __result);
17611771}
17621772
17631773template <class _Tp, class _Up>
......@@ -1780,19 +1790,19 @@ __copy_backward(_Tp* __first, _Tp* __last, _Up* __result)
17801790}
17811791
17821792template <class _BidirectionalIterator1, class _BidirectionalIterator2>
1783inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
1793inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
17841794_BidirectionalIterator2
17851795copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
17861796 _BidirectionalIterator2 __result)
17871797{
17881798 if (__libcpp_is_constant_evaluated()) {
1789 return _VSTD::__copy_backward_constexpr(__unwrap_iter(__first),
1790 __unwrap_iter(__last),
1791 __unwrap_iter(__result));
1799 return _VSTD::__copy_backward_constexpr(_VSTD::__unwrap_iter(__first),
1800 _VSTD::__unwrap_iter(__last),
1801 _VSTD::__unwrap_iter(__result));
17921802 } else {
1793 return _VSTD::__copy_backward(__unwrap_iter(__first),
1794 __unwrap_iter(__last),
1795 __unwrap_iter(__result));
1803 return _VSTD::__copy_backward(_VSTD::__unwrap_iter(__first),
1804 _VSTD::__unwrap_iter(__last),
1805 _VSTD::__unwrap_iter(__result));
17961806 }
17971807}
17981808
......@@ -1818,7 +1828,7 @@ copy_if(_InputIterator __first, _InputIterator __last,
18181828// copy_n
18191829
18201830template<class _InputIterator, class _Size, class _OutputIterator>
1821inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
1831inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
18221832typename enable_if
18231833<
18241834 __is_cpp17_input_iterator<_InputIterator>::value &&
......@@ -1827,7 +1837,7 @@ typename enable_if
18271837>::type
18281838copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
18291839{
1830 typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;
1840 typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
18311841 _IntegralSize __n = __orig_n;
18321842 if (__n > 0)
18331843 {
......@@ -1844,7 +1854,7 @@ copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
18441854}
18451855
18461856template<class _InputIterator, class _Size, class _OutputIterator>
1847inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED
1857inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
18481858typename enable_if
18491859<
18501860 __is_cpp17_random_access_iterator<_InputIterator>::value,
......@@ -1852,25 +1862,35 @@ typename enable_if
18521862>::type
18531863copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
18541864{
1855 typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;
1865 typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
18561866 _IntegralSize __n = __orig_n;
18571867 return _VSTD::copy(__first, __first + __n, __result);
18581868}
18591869
18601870// move
18611871
1872// __move_constexpr exists so that __move doesn't call itself when delegating to the constexpr
1873// version of __move.
18621874template <class _InputIterator, class _OutputIterator>
1863inline _LIBCPP_INLINE_VISIBILITY
1875inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
18641876_OutputIterator
1865__move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
1877__move_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
18661878{
18671879 for (; __first != __last; ++__first, (void) ++__result)
18681880 *__result = _VSTD::move(*__first);
18691881 return __result;
18701882}
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
18721892template <class _Tp, class _Up>
1873inline _LIBCPP_INLINE_VISIBILITY
1893inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
18741894typename enable_if
18751895<
18761896 is_same<typename remove_const<_Tp>::type, _Up>::value &&
......@@ -1879,6 +1899,8 @@ typename enable_if
18791899>::type
18801900__move(_Tp* __first, _Tp* __last, _Up* __result)
18811901{
1902 if (__libcpp_is_constant_evaluated())
1903 return _VSTD::__move_constexpr(__first, __last, __result);
18821904 const size_t __n = static_cast<size_t>(__last - __first);
18831905 if (__n > 0)
18841906 _VSTD::memmove(__result, __first, __n * sizeof(_Up));
......@@ -1886,27 +1908,37 @@ __move(_Tp* __first, _Tp* __last, _Up* __result)
18861908}
18871909
18881910template <class _InputIterator, class _OutputIterator>
1889inline _LIBCPP_INLINE_VISIBILITY
1911inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
18901912_OutputIterator
18911913move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
18921914{
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));
18941916}
18951917
18961918// 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.
18981922template <class _InputIterator, class _OutputIterator>
1899inline _LIBCPP_INLINE_VISIBILITY
1923inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
19001924_OutputIterator
1901__move_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
1925__move_backward_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
19021926{
19031927 while (__first != __last)
19041928 *--__result = _VSTD::move(*--__last);
19051929 return __result;
19061930}
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
19081940template <class _Tp, class _Up>
1909inline _LIBCPP_INLINE_VISIBILITY
1941inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
19101942typename enable_if
19111943<
19121944 is_same<typename remove_const<_Tp>::type, _Up>::value &&
......@@ -1915,6 +1947,8 @@ typename enable_if
19151947>::type
19161948__move_backward(_Tp* __first, _Tp* __last, _Up* __result)
19171949{
1950 if (__libcpp_is_constant_evaluated())
1951 return _VSTD::__move_backward_constexpr(__first, __last, __result);
19181952 const size_t __n = static_cast<size_t>(__last - __first);
19191953 if (__n > 0)
19201954 {
......@@ -1925,12 +1959,12 @@ __move_backward(_Tp* __first, _Tp* __last, _Up* __result)
19251959}
19261960
19271961template <class _BidirectionalIterator1, class _BidirectionalIterator2>
1928inline _LIBCPP_INLINE_VISIBILITY
1962inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
19291963_BidirectionalIterator2
19301964move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
19311965 _BidirectionalIterator2 __result)
19321966{
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));
19341968}
19351969
19361970// iter_swap
......@@ -2033,7 +2067,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
20332067_OutputIterator
20342068fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)
20352069{
2036 return _VSTD::__fill_n(__first, __convert_to_integral(__n), __value_);
2070 return _VSTD::__fill_n(__first, _VSTD::__convert_to_integral(__n), __value_);
20372071}
20382072
20392073// fill
......@@ -2081,7 +2115,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
20812115_OutputIterator
20822116generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen)
20832117{
2084 typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;
2118 typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
20852119 _IntegralSize __n = __orig_n;
20862120 for (; __n > 0; ++__first, (void) --__n)
20872121 *__first = __gen();
......@@ -2287,7 +2321,7 @@ unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __res
22872321// reverse
22882322
22892323template <class _BidirectionalIterator>
2290inline _LIBCPP_INLINE_VISIBILITY
2324inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
22912325void
22922326__reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirectional_iterator_tag)
22932327{
......@@ -2301,7 +2335,7 @@ __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirec
23012335}
23022336
23032337template <class _RandomAccessIterator>
2304inline _LIBCPP_INLINE_VISIBILITY
2338inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
23052339void
23062340__reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag)
23072341{
......@@ -2311,7 +2345,7 @@ __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_ac
23112345}
23122346
23132347template <class _BidirectionalIterator>
2314inline _LIBCPP_INLINE_VISIBILITY
2348inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
23152349void
23162350reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
23172351{
......@@ -2333,7 +2367,7 @@ reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _Out
23332367// rotate
23342368
23352369template <class _ForwardIterator>
2336_ForwardIterator
2370_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator
23372371__rotate_left(_ForwardIterator __first, _ForwardIterator __last)
23382372{
23392373 typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
......@@ -2344,7 +2378,7 @@ __rotate_left(_ForwardIterator __first, _ForwardIterator __last)
23442378}
23452379
23462380template <class _BidirectionalIterator>
2347_BidirectionalIterator
2381_LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator
23482382__rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last)
23492383{
23502384 typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
......@@ -2356,7 +2390,7 @@ __rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last)
23562390}
23572391
23582392template <class _ForwardIterator>
2359_ForwardIterator
2393_LIBCPP_CONSTEXPR_AFTER_CXX14 _ForwardIterator
23602394__rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
23612395{
23622396 _ForwardIterator __i = __middle;
......@@ -2392,7 +2426,7 @@ __rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIt
23922426
23932427template<typename _Integral>
23942428inline _LIBCPP_INLINE_VISIBILITY
2395_Integral
2429_LIBCPP_CONSTEXPR_AFTER_CXX14 _Integral
23962430__algo_gcd(_Integral __x, _Integral __y)
23972431{
23982432 do
......@@ -2405,7 +2439,7 @@ __algo_gcd(_Integral __x, _Integral __y)
24052439}
24062440
24072441template<typename _RandomAccessIterator>
2408_RandomAccessIterator
2442_LIBCPP_CONSTEXPR_AFTER_CXX14 _RandomAccessIterator
24092443__rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
24102444{
24112445 typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
......@@ -2441,7 +2475,7 @@ __rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _Ran
24412475
24422476template <class _ForwardIterator>
24432477inline _LIBCPP_INLINE_VISIBILITY
2444_ForwardIterator
2478_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator
24452479__rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
24462480 _VSTD::forward_iterator_tag)
24472481{
......@@ -2456,7 +2490,7 @@ __rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator _
24562490
24572491template <class _BidirectionalIterator>
24582492inline _LIBCPP_INLINE_VISIBILITY
2459_BidirectionalIterator
2493_LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator
24602494__rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
24612495 _VSTD::bidirectional_iterator_tag)
24622496{
......@@ -2473,7 +2507,7 @@ __rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _Bidir
24732507
24742508template <class _RandomAccessIterator>
24752509inline _LIBCPP_INLINE_VISIBILITY
2476_RandomAccessIterator
2510_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator
24772511__rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
24782512 _VSTD::random_access_iterator_tag)
24792513{
......@@ -2491,7 +2525,7 @@ __rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomA
24912525
24922526template <class _ForwardIterator>
24932527inline _LIBCPP_INLINE_VISIBILITY
2494_ForwardIterator
2528_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
24952529rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
24962530{
24972531 if (__first == __middle)
......@@ -2505,7 +2539,7 @@ rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __l
25052539// rotate_copy
25062540
25072541template <class _ForwardIterator, class _OutputIterator>
2508inline _LIBCPP_INLINE_VISIBILITY
2542inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
25092543_OutputIterator
25102544rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIterator __result)
25112545{
......@@ -2684,12 +2718,12 @@ clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi)
26842718
26852719template <class _ForwardIterator, class _Compare>
26862720_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX11
2687std::pair<_ForwardIterator, _ForwardIterator>
2721pair<_ForwardIterator, _ForwardIterator>
26882722minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
26892723{
26902724 static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value,
26912725 "std::minmax_element requires a ForwardIterator");
2692 std::pair<_ForwardIterator, _ForwardIterator> __result(__first, __first);
2726 pair<_ForwardIterator, _ForwardIterator> __result(__first, __first);
26932727 if (__first != __last)
26942728 {
26952729 if (++__first != __last)
......@@ -2735,7 +2769,7 @@ minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __com
27352769template <class _ForwardIterator>
27362770_LIBCPP_NODISCARD_EXT inline
27372771_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
2738std::pair<_ForwardIterator, _ForwardIterator>
2772pair<_ForwardIterator, _ForwardIterator>
27392773minmax_element(_ForwardIterator __first, _ForwardIterator __last)
27402774{
27412775 return _VSTD::minmax_element(__first, __last,
......@@ -2774,7 +2808,7 @@ minmax(initializer_list<_Tp> __t, _Compare __comp)
27742808 typedef typename initializer_list<_Tp>::const_iterator _Iter;
27752809 _Iter __first = __t.begin();
27762810 _Iter __last = __t.end();
2777 std::pair<_Tp, _Tp> __result(*__first, *__first);
2811 pair<_Tp, _Tp> __result(*__first, *__first);
27782812
27792813 ++__first;
27802814 if (__t.size() % 2 == 0)
......@@ -3005,9 +3039,17 @@ private:
30053039
30063040public:
30073041 // constructors and reset functions
3008 explicit uniform_int_distribution(result_type __a = 0,
3009 result_type __b = numeric_limits<result_type>::max())
3042#ifndef _LIBCPP_CXX03_LANG
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())
30103051 : __p_(param_type(__a, __b)) {}
3052#endif
30113053 explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {}
30123054 void reset() {}
30133055
......@@ -3050,7 +3092,7 @@ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
30503092 if (_Rp == 0)
30513093 return static_cast<result_type>(_Eng(__g, _Dt)());
30523094 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)
30543096 ++__w;
30553097 _Eng __e(__g, __w);
30563098 _UIntType __u;
......@@ -3227,6 +3269,111 @@ template<class _RandomAccessIterator, class _UniformRandomNumberGenerator>
32273269 }
32283270}
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
32303377template <class _InputIterator, class _Predicate>
32313378_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
32323379is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred)
......@@ -3246,7 +3393,7 @@ is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred)
32463393// partition
32473394
32483395template <class _Predicate, class _ForwardIterator>
3249_ForwardIterator
3396_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
32503397__partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, forward_iterator_tag)
32513398{
32523399 while (true)
......@@ -3269,7 +3416,7 @@ __partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred
32693416}
32703417
32713418template <class _Predicate, class _BidirectionalIterator>
3272_BidirectionalIterator
3419_LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator
32733420__partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,
32743421 bidirectional_iterator_tag)
32753422{
......@@ -3294,7 +3441,7 @@ __partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Pred
32943441}
32953442
32963443template <class _ForwardIterator, class _Predicate>
3297inline _LIBCPP_INLINE_VISIBILITY
3444inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
32983445_ForwardIterator
32993446partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
33003447{
......@@ -3380,8 +3527,8 @@ __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate
33803527 // Move the falses into the temporary buffer, and the trues to the front of the line
33813528 // Update __first to always point to the end of the trues
33823529 value_type* __t = __p.first;
3383 ::new(__t) value_type(_VSTD::move(*__first));
3384 __d.__incr((value_type*)0);
3530 ::new ((void*)__t) value_type(_VSTD::move(*__first));
3531 __d.template __incr<value_type>();
33853532 ++__t;
33863533 _ForwardIterator __i = __first;
33873534 while (++__i != __last)
......@@ -3393,8 +3540,8 @@ __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate
33933540 }
33943541 else
33953542 {
3396 ::new(__t) value_type(_VSTD::move(*__i));
3397 __d.__incr((value_type*)0);
3543 ::new ((void*)__t) value_type(_VSTD::move(*__i));
3544 __d.template __incr<value_type>();
33983545 ++__t;
33993546 }
34003547 }
......@@ -3415,7 +3562,7 @@ __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate
34153562 // F?????????????????
34163563 // f m l
34173564 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);
34193566 // TTTFFFFF??????????
34203567 // f ff m l
34213568 // 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
34303577 }
34313578 // TTTFFFFFTTTF??????
34323579 // 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);
34343581__second_half_done:
34353582 // TTTFFFFFTTTTTFFFFF
34363583 // f ff m sf l
......@@ -3472,7 +3619,7 @@ __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate
34723619 __p = _VSTD::get_temporary_buffer<value_type>(__len);
34733620 __h.reset(__p.first);
34743621 }
3475 return __stable_partition<typename add_lvalue_reference<_Predicate>::type>
3622 return _VSTD::__stable_partition<typename add_lvalue_reference<_Predicate>::type>
34763623 (__first, __last, __pred, __len, __p, forward_iterator_tag());
34773624}
34783625
......@@ -3510,8 +3657,8 @@ __stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last
35103657 // Move the falses into the temporary buffer, and the trues to the front of the line
35113658 // Update __first to always point to the end of the trues
35123659 value_type* __t = __p.first;
3513 ::new(__t) value_type(_VSTD::move(*__first));
3514 __d.__incr((value_type*)0);
3660 ::new ((void*)__t) value_type(_VSTD::move(*__first));
3661 __d.template __incr<value_type>();
35153662 ++__t;
35163663 _BidirectionalIterator __i = __first;
35173664 while (++__i != __last)
......@@ -3523,8 +3670,8 @@ __stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last
35233670 }
35243671 else
35253672 {
3526 ::new(__t) value_type(_VSTD::move(*__i));
3527 __d.__incr((value_type*)0);
3673 ::new ((void*)__t) value_type(_VSTD::move(*__i));
3674 __d.template __incr<value_type>();
35283675 ++__t;
35293676 }
35303677 }
......@@ -3558,7 +3705,7 @@ __stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last
35583705 // F???TFFF?????????T
35593706 // f m1 m l
35603707 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);
35623709__first_half_done:
35633710 // TTTFFFFF?????????T
35643711 // f ff m l
......@@ -3575,7 +3722,7 @@ __first_half_done:
35753722 }
35763723 // TTTFFFFFTTTF?????T
35773724 // 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);
35793726__second_half_done:
35803727 // TTTFFFFFTTTTTFFFFF
35813728 // f ff m sf l
......@@ -3620,7 +3767,7 @@ __stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last
36203767 __p = _VSTD::get_temporary_buffer<value_type>(__len);
36213768 __h.reset(__p.first);
36223769 }
3623 return __stable_partition<typename add_lvalue_reference<_Predicate>::type>
3770 return _VSTD::__stable_partition<typename add_lvalue_reference<_Predicate>::type>
36243771 (__first, __last, __pred, __len, __p, bidirectional_iterator_tag());
36253772}
36263773
......@@ -3629,7 +3776,7 @@ inline _LIBCPP_INLINE_VISIBILITY
36293776_ForwardIterator
36303777stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
36313778{
3632 return __stable_partition<typename add_lvalue_reference<_Predicate>::type>
3779 return _VSTD::__stable_partition<typename add_lvalue_reference<_Predicate>::type>
36333780 (__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category());
36343781}
36353782
......@@ -3727,7 +3874,7 @@ unsigned
37273874__sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
37283875 _ForwardIterator __x4, _Compare __c)
37293876{
3730 unsigned __r = __sort3<_Compare>(__x1, __x2, __x3, __c);
3877 unsigned __r = _VSTD::__sort3<_Compare>(__x1, __x2, __x3, __c);
37313878 if (__c(*__x4, *__x3))
37323879 {
37333880 swap(*__x3, *__x4);
......@@ -3754,7 +3901,7 @@ unsigned
37543901__sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
37553902 _ForwardIterator __x4, _ForwardIterator __x5, _Compare __c)
37563903{
3757 unsigned __r = __sort4<_Compare>(__x1, __x2, __x3, __x4, __c);
3904 unsigned __r = _VSTD::__sort4<_Compare>(__x1, __x2, __x3, __x4, __c);
37583905 if (__c(*__x5, *__x4))
37593906 {
37603907 swap(*__x4, *__x5);
......@@ -3779,14 +3926,14 @@ __sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
37793926}
37803927
37813928// Assumes size > 0
3782template <class _Compare, class _BirdirectionalIterator>
3929template <class _Compare, class _BidirectionalIterator>
37833930void
3784__selection_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last, _Compare __comp)
3931__selection_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
37853932{
3786 _BirdirectionalIterator __lm1 = __last;
3933 _BidirectionalIterator __lm1 = __last;
37873934 for (--__lm1; __first != __lm1; ++__first)
37883935 {
3789 _BirdirectionalIterator __i = _VSTD::min_element<_BirdirectionalIterator,
3936 _BidirectionalIterator __i = _VSTD::min_element<_BidirectionalIterator,
37903937 typename add_lvalue_reference<_Compare>::type>
37913938 (__first, __last, __comp);
37923939 if (__i != __first)
......@@ -3794,19 +3941,19 @@ __selection_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last
37943941 }
37953942}
37963943
3797template <class _Compare, class _BirdirectionalIterator>
3944template <class _Compare, class _BidirectionalIterator>
37983945void
3799__insertion_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last, _Compare __comp)
3946__insertion_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
38003947{
3801 typedef typename iterator_traits<_BirdirectionalIterator>::value_type value_type;
3948 typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
38023949 if (__first != __last)
38033950 {
3804 _BirdirectionalIterator __i = __first;
3951 _BidirectionalIterator __i = __first;
38053952 for (++__i; __i != __last; ++__i)
38063953 {
3807 _BirdirectionalIterator __j = __i;
3954 _BidirectionalIterator __j = __i;
38083955 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)
38103957 *__j = _VSTD::move(*__k);
38113958 *__j = _VSTD::move(__t);
38123959 }
......@@ -3819,7 +3966,7 @@ __insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __last,
38193966{
38203967 typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
38213968 _RandomAccessIterator __j = __first+2;
3822 __sort3<_Compare>(__first, __first+1, __j, __comp);
3969 _VSTD::__sort3<_Compare>(__first, __first+1, __j, __comp);
38233970 for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)
38243971 {
38253972 if (__comp(*__i, *__j))
......@@ -3863,7 +4010,7 @@ __insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator
38634010 }
38644011 typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
38654012 _RandomAccessIterator __j = __first+2;
3866 __sort3<_Compare>(__first, __first+1, __j, __comp);
4013 _VSTD::__sort3<_Compare>(__first, __first+1, __j, __comp);
38674014 const unsigned __limit = 8;
38684015 unsigned __count = 0;
38694016 for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)
......@@ -3887,35 +4034,35 @@ __insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator
38874034 return true;
38884035}
38894036
3890template <class _Compare, class _BirdirectionalIterator>
4037template <class _Compare, class _BidirectionalIterator>
38914038void
3892__insertion_sort_move(_BirdirectionalIterator __first1, _BirdirectionalIterator __last1,
3893 typename iterator_traits<_BirdirectionalIterator>::value_type* __first2, _Compare __comp)
4039__insertion_sort_move(_BidirectionalIterator __first1, _BidirectionalIterator __last1,
4040 typename iterator_traits<_BidirectionalIterator>::value_type* __first2, _Compare __comp)
38944041{
3895 typedef typename iterator_traits<_BirdirectionalIterator>::value_type value_type;
4042 typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
38964043 if (__first1 != __last1)
38974044 {
38984045 __destruct_n __d(0);
38994046 unique_ptr<value_type, __destruct_n&> __h(__first2, __d);
39004047 value_type* __last2 = __first2;
3901 ::new(__last2) value_type(_VSTD::move(*__first1));
3902 __d.__incr((value_type*)0);
4048 ::new ((void*)__last2) value_type(_VSTD::move(*__first1));
4049 __d.template __incr<value_type>();
39034050 for (++__last2; ++__first1 != __last1; ++__last2)
39044051 {
39054052 value_type* __j2 = __last2;
39064053 value_type* __i2 = __j2;
39074054 if (__comp(*__first1, *--__i2))
39084055 {
3909 ::new(__j2) value_type(_VSTD::move(*__i2));
3910 __d.__incr((value_type*)0);
4056 ::new ((void*)__j2) value_type(_VSTD::move(*__i2));
4057 __d.template __incr<value_type>();
39114058 for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2)
39124059 *__j2 = _VSTD::move(*__i2);
39134060 *__j2 = _VSTD::move(*__first1);
39144061 }
39154062 else
39164063 {
3917 ::new(__j2) value_type(_VSTD::move(*__first1));
3918 __d.__incr((value_type*)0);
4064 ::new ((void*)__j2) value_type(_VSTD::move(*__first1));
4065 __d.template __incr<value_type>();
39194066 }
39204067 }
39214068 __h.release();
......@@ -4032,7 +4179,7 @@ __sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __c
40324179 ++__i;
40334180 }
40344181 // [__first, __i) == *__first and *__first < [__i, __last)
4035 // The first part is sorted, sort the secod part
4182 // The first part is sorted, sort the second part
40364183 // _VSTD::__sort<_Compare>(__i, __last, __comp);
40374184 __first = __i;
40384185 goto __restart;
......@@ -4138,7 +4285,7 @@ inline _LIBCPP_INLINE_VISIBILITY
41384285void
41394286sort(_Tp** __first, _Tp** __last)
41404287{
4141 _VSTD::sort((size_t*)__first, (size_t*)__last, __less<size_t>());
4288 _VSTD::sort((uintptr_t*)__first, (uintptr_t*)__last, __less<uintptr_t>());
41424289}
41434290
41444291template <class _Tp>
......@@ -4223,7 +4370,7 @@ _ForwardIterator
42234370lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
42244371{
42254372 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);
42274374}
42284375
42294376template <class _ForwardIterator, class _Tp>
......@@ -4267,7 +4414,7 @@ _ForwardIterator
42674414upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
42684415{
42694416 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);
42714418}
42724419
42734420template <class _ForwardIterator, class _Tp>
......@@ -4308,8 +4455,8 @@ __equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va
43084455 _ForwardIterator __mp1 = __m;
43094456 return pair<_ForwardIterator, _ForwardIterator>
43104457 (
4311 __lower_bound<_Compare>(__first, __m, __value_, __comp),
4312 __upper_bound<_Compare>(++__mp1, __last, __value_, __comp)
4458 _VSTD::__lower_bound<_Compare>(__first, __m, __value_, __comp),
4459 _VSTD::__upper_bound<_Compare>(++__mp1, __last, __value_, __comp)
43134460 );
43144461 }
43154462 }
......@@ -4323,7 +4470,7 @@ pair<_ForwardIterator, _ForwardIterator>
43234470equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
43244471{
43254472 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);
43274474}
43284475
43294476template <class _ForwardIterator, class _Tp>
......@@ -4343,7 +4490,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
43434490bool
43444491__binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
43454492{
4346 __first = __lower_bound<_Compare>(__first, __last, __value_, __comp);
4493 __first = _VSTD::__lower_bound<_Compare>(__first, __last, __value_, __comp);
43474494 return __first != __last && !__comp(__value_, *__first);
43484495}
43494496
......@@ -4354,7 +4501,7 @@ bool
43544501binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
43554502{
43564503 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);
43584505}
43594506
43604507template <class _ForwardIterator, class _Tp>
......@@ -4370,6 +4517,7 @@ binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va
43704517// merge
43714518
43724519template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
4520_LIBCPP_CONSTEXPR_AFTER_CXX17
43734521_OutputIterator
43744522__merge(_InputIterator1 __first1, _InputIterator1 __last1,
43754523 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
......@@ -4393,7 +4541,7 @@ __merge(_InputIterator1 __first1, _InputIterator1 __last1,
43934541}
43944542
43954543template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
4396inline _LIBCPP_INLINE_VISIBILITY
4544inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
43974545_OutputIterator
43984546merge(_InputIterator1 __first1, _InputIterator1 __last1,
43994547 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
......@@ -4403,7 +4551,7 @@ merge(_InputIterator1 __first1, _InputIterator1 __last1,
44034551}
44044552
44054553template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
4406inline _LIBCPP_INLINE_VISIBILITY
4554inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
44074555_OutputIterator
44084556merge(_InputIterator1 __first1, _InputIterator1 __last1,
44094557 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
......@@ -4456,20 +4604,21 @@ __buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator
44564604 if (__len1 <= __len2)
44574605 {
44584606 value_type* __p = __buff;
4459 for (_BidirectionalIterator __i = __first; __i != __middle; __d.__incr((value_type*)0), (void) ++__i, (void) ++__p)
4460 ::new(__p) value_type(_VSTD::move(*__i));
4461 __half_inplace_merge(__buff, __p, __middle, __last, __first, __comp);
4607 for (_BidirectionalIterator __i = __first; __i != __middle; __d.template __incr<value_type>(), (void) ++__i, (void) ++__p)
4608 ::new ((void*)__p) value_type(_VSTD::move(*__i));
4609 _VSTD::__half_inplace_merge<_Compare>(__buff, __p, __middle, __last, __first, __comp);
44624610 }
44634611 else
44644612 {
44654613 value_type* __p = __buff;
4466 for (_BidirectionalIterator __i = __middle; __i != __last; __d.__incr((value_type*)0), (void) ++__i, (void) ++__p)
4467 ::new(__p) value_type(_VSTD::move(*__i));
4614 for (_BidirectionalIterator __i = __middle; __i != __last; __d.template __incr<value_type>(), (void) ++__i, (void) ++__p)
4615 ::new ((void*)__p) value_type(_VSTD::move(*__i));
44684616 typedef reverse_iterator<_BidirectionalIterator> _RBi;
44694617 typedef reverse_iterator<value_type*> _Rv;
4470 __half_inplace_merge(_Rv(__p), _Rv(__buff),
4471 _RBi(__middle), _RBi(__first),
4472 _RBi(__last), __invert<_Compare>(__comp));
4618 typedef __invert<_Compare> _Inverted;
4619 _VSTD::__half_inplace_merge<_Inverted>(_Rv(__p), _Rv(__buff),
4620 _RBi(__middle), _RBi(__first),
4621 _RBi(__last), _Inverted(__comp));
44734622 }
44744623}
44754624
......@@ -4487,7 +4636,7 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,
44874636 if (__len2 == 0)
44884637 return;
44894638 if (__len1 <= __buff_size || __len2 <= __buff_size)
4490 return __buffered_inplace_merge<_Compare>
4639 return _VSTD::__buffered_inplace_merge<_Compare>
44914640 (__first, __middle, __last, __comp, __len1, __len2, __buff);
44924641 // shrink [__first, __middle) as much as possible (with no moves), returning if it shrinks to 0
44934642 for (; true; ++__first, (void) --__len1)
......@@ -4515,7 +4664,7 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,
45154664 __len21 = __len2 / 2;
45164665 __m2 = __middle;
45174666 _VSTD::advance(__m2, __len21);
4518 __m1 = __upper_bound<_Compare>(__first, __middle, *__m2, __comp);
4667 __m1 = _VSTD::__upper_bound<_Compare>(__first, __middle, *__m2, __comp);
45194668 __len11 = _VSTD::distance(__first, __m1);
45204669 }
45214670 else
......@@ -4530,7 +4679,7 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,
45304679 __len11 = __len1 / 2;
45314680 __m1 = __first;
45324681 _VSTD::advance(__m1, __len11);
4533 __m2 = __lower_bound<_Compare>(__middle, __last, *__m1, __comp);
4682 __m2 = _VSTD::__lower_bound<_Compare>(__middle, __last, *__m1, __comp);
45344683 __len21 = _VSTD::distance(__middle, __m2);
45354684 }
45364685 difference_type __len12 = __len1 - __len11; // distance(__m1, __middle)
......@@ -4539,11 +4688,11 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,
45394688 // swap middle two partitions
45404689 __middle = _VSTD::rotate(__m1, __middle, __m2);
45414690 // __len12 and __len21 now have swapped meanings
4542 // merge smaller range with recurisve call and larger with tail recursion elimination
4691 // merge smaller range with recursive call and larger with tail recursion elimination
45434692 if (__len11 + __len21 < __len12 + __len22)
45444693 {
4545 __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);
4694 _VSTD::__inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size);
4695// _VSTD::__inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);
45474696 __first = __middle;
45484697 __middle = __m2;
45494698 __len1 = __len12;
......@@ -4551,8 +4700,8 @@ __inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle,
45514700 }
45524701 else
45534702 {
4554 __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);
4703 _VSTD::__inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);
4704// _VSTD::__inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size);
45564705 __last = __middle;
45574706 __middle = __m1;
45584707 __len1 = __len11;
......@@ -4603,28 +4752,28 @@ __merge_move_construct(_InputIterator1 __first1, _InputIterator1 __last1,
46034752 {
46044753 if (__first1 == __last1)
46054754 {
4606 for (; __first2 != __last2; ++__first2, ++__result, (void) __d.__incr((value_type*)0))
4607 ::new (__result) value_type(_VSTD::move(*__first2));
4755 for (; __first2 != __last2; ++__first2, ++__result, (void)__d.template __incr<value_type>())
4756 ::new ((void*)__result) value_type(_VSTD::move(*__first2));
46084757 __h.release();
46094758 return;
46104759 }
46114760 if (__first2 == __last2)
46124761 {
4613 for (; __first1 != __last1; ++__first1, ++__result, (void) __d.__incr((value_type*)0))
4614 ::new (__result) value_type(_VSTD::move(*__first1));
4762 for (; __first1 != __last1; ++__first1, ++__result, (void)__d.template __incr<value_type>())
4763 ::new ((void*)__result) value_type(_VSTD::move(*__first1));
46154764 __h.release();
46164765 return;
46174766 }
46184767 if (__comp(*__first2, *__first1))
46194768 {
4620 ::new (__result) value_type(_VSTD::move(*__first2));
4621 __d.__incr((value_type*)0);
4769 ::new ((void*)__result) value_type(_VSTD::move(*__first2));
4770 __d.template __incr<value_type>();
46224771 ++__first2;
46234772 }
46244773 else
46254774 {
4626 ::new (__result) value_type(_VSTD::move(*__first1));
4627 __d.__incr((value_type*)0);
4775 ::new ((void*)__result) value_type(_VSTD::move(*__first1));
4776 __d.template __incr<value_type>();
46284777 ++__first1;
46294778 }
46304779 }
......@@ -4677,38 +4826,38 @@ __stable_sort_move(_RandomAccessIterator __first1, _RandomAccessIterator __last1
46774826 case 0:
46784827 return;
46794828 case 1:
4680 ::new(__first2) value_type(_VSTD::move(*__first1));
4829 ::new ((void*)__first2) value_type(_VSTD::move(*__first1));
46814830 return;
46824831 case 2:
46834832 __destruct_n __d(0);
46844833 unique_ptr<value_type, __destruct_n&> __h2(__first2, __d);
46854834 if (__comp(*--__last1, *__first1))
46864835 {
4687 ::new(__first2) value_type(_VSTD::move(*__last1));
4688 __d.__incr((value_type*)0);
4836 ::new ((void*)__first2) value_type(_VSTD::move(*__last1));
4837 __d.template __incr<value_type>();
46894838 ++__first2;
4690 ::new(__first2) value_type(_VSTD::move(*__first1));
4839 ::new ((void*)__first2) value_type(_VSTD::move(*__first1));
46914840 }
46924841 else
46934842 {
4694 ::new(__first2) value_type(_VSTD::move(*__first1));
4695 __d.__incr((value_type*)0);
4843 ::new ((void*)__first2) value_type(_VSTD::move(*__first1));
4844 __d.template __incr<value_type>();
46964845 ++__first2;
4697 ::new(__first2) value_type(_VSTD::move(*__last1));
4846 ::new ((void*)__first2) value_type(_VSTD::move(*__last1));
46984847 }
46994848 __h2.release();
47004849 return;
47014850 }
47024851 if (__len <= 8)
47034852 {
4704 __insertion_sort_move<_Compare>(__first1, __last1, __first2, __comp);
4853 _VSTD::__insertion_sort_move<_Compare>(__first1, __last1, __first2, __comp);
47054854 return;
47064855 }
47074856 typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2;
47084857 _RandomAccessIterator __m = __first1 + __l2;
4709 __stable_sort<_Compare>(__first1, __m, __comp, __l2, __first2, __l2);
4710 __stable_sort<_Compare>(__m, __last1, __comp, __len - __l2, __first2 + __l2, __len - __l2);
4711 __merge_move_construct<_Compare>(__first1, __m, __m, __last1, __first2, __comp);
4858 _VSTD::__stable_sort<_Compare>(__first1, __m, __comp, __l2, __first2, __l2);
4859 _VSTD::__stable_sort<_Compare>(__m, __last1, __comp, __len - __l2, __first2 + __l2, __len - __l2);
4860 _VSTD::__merge_move_construct<_Compare>(__first1, __m, __m, __last1, __first2, __comp);
47124861}
47134862
47144863template <class _Tp>
......@@ -4737,7 +4886,7 @@ __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp
47374886 }
47384887 if (__len <= static_cast<difference_type>(__stable_sort_switch<value_type>::value))
47394888 {
4740 __insertion_sort<_Compare>(__first, __last, __comp);
4889 _VSTD::__insertion_sort<_Compare>(__first, __last, __comp);
47414890 return;
47424891 }
47434892 typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2;
......@@ -4746,21 +4895,21 @@ __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp
47464895 {
47474896 __destruct_n __d(0);
47484897 unique_ptr<value_type, __destruct_n&> __h2(__buff, __d);
4749 __stable_sort_move<_Compare>(__first, __m, __comp, __l2, __buff);
4750 __d.__set(__l2, (value_type*)0);
4751 __stable_sort_move<_Compare>(__m, __last, __comp, __len - __l2, __buff + __l2);
4752 __d.__set(__len, (value_type*)0);
4753 __merge_move_assign<_Compare>(__buff, __buff + __l2, __buff + __l2, __buff + __len, __first, __comp);
4754// __merge<_Compare>(move_iterator<value_type*>(__buff),
4755// move_iterator<value_type*>(__buff + __l2),
4756// move_iterator<_RandomAccessIterator>(__buff + __l2),
4757// move_iterator<_RandomAccessIterator>(__buff + __len),
4758// __first, __comp);
4898 _VSTD::__stable_sort_move<_Compare>(__first, __m, __comp, __l2, __buff);
4899 __d.__set(__l2, (value_type*)nullptr);
4900 _VSTD::__stable_sort_move<_Compare>(__m, __last, __comp, __len - __l2, __buff + __l2);
4901 __d.__set(__len, (value_type*)nullptr);
4902 _VSTD::__merge_move_assign<_Compare>(__buff, __buff + __l2, __buff + __l2, __buff + __len, __first, __comp);
4903// _VSTD::__merge<_Compare>(move_iterator<value_type*>(__buff),
4904// move_iterator<value_type*>(__buff + __l2),
4905// move_iterator<_RandomAccessIterator>(__buff + __l2),
4906// move_iterator<_RandomAccessIterator>(__buff + __len),
4907// __first, __comp);
47594908 return;
47604909 }
4761 __stable_sort<_Compare>(__first, __m, __comp, __l2, __buff, __buff_size);
4762 __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);
4910 _VSTD::__stable_sort<_Compare>(__first, __m, __comp, __l2, __buff, __buff_size);
4911 _VSTD::__stable_sort<_Compare>(__m, __last, __comp, __len - __l2, __buff, __buff_size);
4912 _VSTD::__inplace_merge<_Compare>(__first, __m, __last, __comp, __l2, __len - __l2, __buff, __buff_size);
47644913}
47654914
47664915template <class _RandomAccessIterator, class _Compare>
......@@ -4779,7 +4928,7 @@ stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compar
47794928 __h.reset(__buf.first);
47804929 }
47814930 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);
47834932}
47844933
47854934template <class _RandomAccessIterator>
......@@ -4883,7 +5032,7 @@ void
48835032push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
48845033{
48855034 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);
48875036}
48885037
48895038template <class _RandomAccessIterator>
......@@ -4960,7 +5109,7 @@ __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare
49605109 if (__len > 1)
49615110 {
49625111 swap(*__first, *--__last);
4963 __sift_down<_Compare>(__first, __last, __comp, __len - 1, __first);
5112 _VSTD::__sift_down<_Compare>(__first, __last, __comp, __len - 1, __first);
49645113 }
49655114}
49665115
......@@ -4970,7 +5119,7 @@ void
49705119pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
49715120{
49725121 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);
49745123}
49755124
49765125template <class _RandomAccessIterator>
......@@ -4994,7 +5143,7 @@ __make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compar
49945143 // start from the first parent, there is no need to consider children
49955144 for (difference_type __start = (__n - 2) / 2; __start >= 0; --__start)
49965145 {
4997 __sift_down<_Compare>(__first, __last, __comp, __n, __first + __start);
5146 _VSTD::__sift_down<_Compare>(__first, __last, __comp, __n, __first + __start);
49985147 }
49995148 }
50005149}
......@@ -5005,7 +5154,7 @@ void
50055154make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
50065155{
50075156 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);
50095158}
50105159
50115160template <class _RandomAccessIterator>
......@@ -5024,7 +5173,7 @@ __sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compar
50245173{
50255174 typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
50265175 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);
50285177}
50295178
50305179template <class _RandomAccessIterator, class _Compare>
......@@ -5033,7 +5182,7 @@ void
50335182sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
50345183{
50355184 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);
50375186}
50385187
50395188template <class _RandomAccessIterator>
......@@ -5051,17 +5200,17 @@ void
50515200__partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
50525201 _Compare __comp)
50535202{
5054 __make_heap<_Compare>(__first, __middle, __comp);
5203 _VSTD::__make_heap<_Compare>(__first, __middle, __comp);
50555204 typename iterator_traits<_RandomAccessIterator>::difference_type __len = __middle - __first;
50565205 for (_RandomAccessIterator __i = __middle; __i != __last; ++__i)
50575206 {
50585207 if (__comp(*__i, *__first))
50595208 {
50605209 swap(*__i, *__first);
5061 __sift_down<_Compare>(__first, __middle, __comp, __len, __first);
5210 _VSTD::__sift_down<_Compare>(__first, __middle, __comp, __len, __first);
50625211 }
50635212 }
5064 __sort_heap<_Compare>(__first, __middle, __comp);
5213 _VSTD::__sort_heap<_Compare>(__first, __middle, __comp);
50655214}
50665215
50675216template <class _RandomAccessIterator, class _Compare>
......@@ -5071,7 +5220,7 @@ partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _Ran
50715220 _Compare __comp)
50725221{
50735222 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);
50755224}
50765225
50775226template <class _RandomAccessIterator>
......@@ -5095,15 +5244,15 @@ __partial_sort_copy(_InputIterator __first, _InputIterator __last,
50955244 {
50965245 for (; __first != __last && __r != __result_last; ++__first, (void) ++__r)
50975246 *__r = *__first;
5098 __make_heap<_Compare>(__result_first, __r, __comp);
5247 _VSTD::__make_heap<_Compare>(__result_first, __r, __comp);
50995248 typename iterator_traits<_RandomAccessIterator>::difference_type __len = __r - __result_first;
51005249 for (; __first != __last; ++__first)
51015250 if (__comp(*__first, *__result_first))
51025251 {
51035252 *__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);
51055254 }
5106 __sort_heap<_Compare>(__result_first, __r, __comp);
5255 _VSTD::__sort_heap<_Compare>(__result_first, __r, __comp);
51075256 }
51085257 return __r;
51095258}
......@@ -5115,7 +5264,7 @@ partial_sort_copy(_InputIterator __first, _InputIterator __last,
51155264 _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp)
51165265{
51175266 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);
51195268}
51205269
51215270template <class _InputIterator, class _RandomAccessIterator>
......@@ -5161,7 +5310,7 @@ __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _Rando
51615310 }
51625311 if (__len <= __limit)
51635312 {
5164 __selection_sort<_Compare>(__first, __last, __comp);
5313 _VSTD::__selection_sort<_Compare>(__first, __last, __comp);
51655314 return;
51665315 }
51675316 // __len > __limit >= 3
......@@ -5185,7 +5334,7 @@ __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _Rando
51855334 if (__i == --__j)
51865335 {
51875336 // *__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)
51895338 ++__i; // __first + 1
51905339 __j = __last;
51915340 if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1)
......@@ -5223,8 +5372,8 @@ __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _Rando
52235372 // The first part is sorted,
52245373 if (__nth < __i)
52255374 return;
5226 // __nth_element the secod part
5227 // __nth_element<_Compare>(__i, __nth, __last, __comp);
5375 // __nth_element the second part
5376 // _VSTD::__nth_element<_Compare>(__i, __nth, __last, __comp);
52285377 __first = __i;
52295378 goto __restart;
52305379 }
......@@ -5306,12 +5455,12 @@ not_sorted:
53065455 // __nth_element on range containing __nth
53075456 if (__nth < __i)
53085457 {
5309 // __nth_element<_Compare>(__first, __nth, __i, __comp);
5458 // _VSTD::__nth_element<_Compare>(__first, __nth, __i, __comp);
53105459 __last = __i;
53115460 }
53125461 else
53135462 {
5314 // __nth_element<_Compare>(__i+1, __nth, __last, __comp);
5463 // _VSTD::__nth_element<_Compare>(__i+1, __nth, __last, __comp);
53155464 __first = ++__i;
53165465 }
53175466 }
......@@ -5323,7 +5472,7 @@ void
53235472nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp)
53245473{
53255474 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);
53275476}
53285477
53295478template <class _RandomAccessIterator>
......@@ -5359,7 +5508,7 @@ includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi
53595508 _Compare __comp)
53605509{
53615510 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);
53635512}
53645513
53655514template <class _InputIterator1, class _InputIterator2>
......@@ -5376,7 +5525,7 @@ includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi
53765525// set_union
53775526
53785527template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
5379_OutputIterator
5528_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
53805529__set_union(_InputIterator1 __first1, _InputIterator1 __last1,
53815530 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
53825531{
......@@ -5401,17 +5550,17 @@ __set_union(_InputIterator1 __first1, _InputIterator1 __last1,
54015550}
54025551
54035552template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
5404inline _LIBCPP_INLINE_VISIBILITY
5553inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
54055554_OutputIterator
54065555set_union(_InputIterator1 __first1, _InputIterator1 __last1,
54075556 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
54085557{
54095558 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);
54115560}
54125561
54135562template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
5414inline _LIBCPP_INLINE_VISIBILITY
5563inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
54155564_OutputIterator
54165565set_union(_InputIterator1 __first1, _InputIterator1 __last1,
54175566 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
......@@ -5453,7 +5602,7 @@ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
54535602 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
54545603{
54555604 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);
54575606}
54585607
54595608template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
......@@ -5470,7 +5619,7 @@ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
54705619// set_difference
54715620
54725621template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
5473_OutputIterator
5622_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
54745623__set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
54755624 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
54765625{
......@@ -5495,17 +5644,17 @@ __set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
54955644}
54965645
54975646template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
5498inline _LIBCPP_INLINE_VISIBILITY
5647inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
54995648_OutputIterator
55005649set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
55015650 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
55025651{
55035652 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);
55055654}
55065655
55075656template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
5508inline _LIBCPP_INLINE_VISIBILITY
5657inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
55095658_OutputIterator
55105659set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
55115660 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
......@@ -5518,7 +5667,7 @@ set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
55185667// set_symmetric_difference
55195668
55205669template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
5521_OutputIterator
5670_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator
55225671__set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
55235672 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
55245673{
......@@ -5548,17 +5697,17 @@ __set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
55485697}
55495698
55505699template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare>
5551inline _LIBCPP_INLINE_VISIBILITY
5700inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
55525701_OutputIterator
55535702set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
55545703 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
55555704{
55565705 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);
55585707}
55595708
55605709template <class _InputIterator1, class _InputIterator2, class _OutputIterator>
5561inline _LIBCPP_INLINE_VISIBILITY
5710inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
55625711_OutputIterator
55635712set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
55645713 _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)
......@@ -5593,7 +5742,7 @@ lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
55935742 _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
55945743{
55955744 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);
55975746}
55985747
55995748template <class _InputIterator1, class _InputIterator2>
......@@ -5611,7 +5760,7 @@ lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
56115760// next_permutation
56125761
56135762template <class _Compare, class _BidirectionalIterator>
5614bool
5763_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
56155764__next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
56165765{
56175766 _BidirectionalIterator __i = __last;
......@@ -5638,16 +5787,16 @@ __next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last
56385787}
56395788
56405789template <class _BidirectionalIterator, class _Compare>
5641inline _LIBCPP_INLINE_VISIBILITY
5790inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
56425791bool
56435792next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
56445793{
56455794 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);
56475796}
56485797
56495798template <class _BidirectionalIterator>
5650inline _LIBCPP_INLINE_VISIBILITY
5799inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
56515800bool
56525801next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
56535802{
......@@ -5658,7 +5807,7 @@ next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
56585807// prev_permutation
56595808
56605809template <class _Compare, class _BidirectionalIterator>
5661bool
5810_LIBCPP_CONSTEXPR_AFTER_CXX17 bool
56625811__prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
56635812{
56645813 _BidirectionalIterator __i = __last;
......@@ -5685,16 +5834,16 @@ __prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last
56855834}
56865835
56875836template <class _BidirectionalIterator, class _Compare>
5688inline _LIBCPP_INLINE_VISIBILITY
5837inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
56895838bool
56905839prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
56915840{
56925841 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);
56945843}
56955844
56965845template <class _BidirectionalIterator>
5697inline _LIBCPP_INLINE_VISIBILITY
5846inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
56985847bool
56995848prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
57005849{
lib/libcxx/include/any+22-8
......@@ -81,8 +81,8 @@ namespace std {
8181*/
8282
8383#include <experimental/__config>
84#include <__availability>
8485#include <memory>
85#include <new>
8686#include <typeinfo>
8787#include <type_traits>
8888#include <cstdlib>
......@@ -157,7 +157,7 @@ namespace __any_imp
157157 template <class _Tp>
158158 inline _LIBCPP_INLINE_VISIBILITY
159159 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;
161161 }
162162
163163 template <class _Tp>
......@@ -368,7 +368,11 @@ namespace __any_imp
368368 template <class ..._Args>
369369 _LIBCPP_INLINE_VISIBILITY
370370 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)...);
372376 __dest.__h = &_SmallHandler::__handle;
373377 return *__ret;
374378 }
......@@ -376,8 +380,11 @@ namespace __any_imp
376380 private:
377381 _LIBCPP_INLINE_VISIBILITY
378382 static void __destroy(any & __this) {
379 _Tp & __value = *static_cast<_Tp *>(static_cast<void*>(&__this.__s.__buf));
380 __value.~_Tp();
383 typedef allocator<_Tp> _Alloc;
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);
381388 __this.__h = nullptr;
382389 }
383390
......@@ -445,10 +452,12 @@ namespace __any_imp
445452 _LIBCPP_INLINE_VISIBILITY
446453 static _Tp& __create(any & __dest, _Args&&... __args) {
447454 typedef allocator<_Tp> _Alloc;
455 typedef allocator_traits<_Alloc> _ATraits;
448456 typedef __allocator_destructor<_Alloc> _Dp;
449457 _Alloc __a;
450 unique_ptr<_Tp, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
451 _Tp* __ret = ::new ((void*)__hold.get()) _Tp(_VSTD::forward<_Args>(__args)...);
458 unique_ptr<_Tp, _Dp> __hold(_ATraits::allocate(__a, 1), _Dp(__a, 1));
459 _Tp * __ret = __hold.get();
460 _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...);
452461 __dest.__s.__ptr = __hold.release();
453462 __dest.__h = &_LargeHandler::__handle;
454463 return *__ret;
......@@ -458,7 +467,12 @@ namespace __any_imp
458467
459468 _LIBCPP_INLINE_VISIBILITY
460469 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);
462476 __this.__h = nullptr;
463477 }
464478
lib/libcxx/include/array+8-12
......@@ -142,8 +142,8 @@ struct _LIBCPP_TEMPLATE_VIS array
142142 typedef const value_type* const_pointer;
143143 typedef size_t size_type;
144144 typedef ptrdiff_t difference_type;
145 typedef std::reverse_iterator<iterator> reverse_iterator;
146 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
145 typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
146 typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
147147
148148 _Tp __elems_[_Size];
149149
......@@ -155,7 +155,7 @@ struct _LIBCPP_TEMPLATE_VIS array
155155
156156 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
157157 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());
159159 }
160160
161161 // iterators:
......@@ -245,8 +245,8 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0>
245245 typedef const value_type* const_pointer;
246246 typedef size_t size_type;
247247 typedef ptrdiff_t difference_type;
248 typedef std::reverse_iterator<iterator> reverse_iterator;
249 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
248 typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
249 typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
250250
251251 typedef typename conditional<is_const<_Tp>::value, const char,
252252 char>::type _CharType;
......@@ -459,8 +459,6 @@ get(const array<_Tp, _Size>& __a) _NOEXCEPT
459459 return __a.__elems_[_Ip];
460460}
461461
462#ifndef _LIBCPP_CXX03_LANG
463
464462template <size_t _Ip, class _Tp, size_t _Size>
465463inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
466464_Tp&&
......@@ -479,8 +477,6 @@ get(const array<_Tp, _Size>&& __a) _NOEXCEPT
479477 return _VSTD::move(__a.__elems_[_Ip]);
480478}
481479
482#endif // !_LIBCPP_CXX03_LANG
483
484480#if _LIBCPP_STD_VER > 17
485481
486482template <typename _Tp, size_t _Size, size_t... _Index>
......@@ -504,7 +500,7 @@ to_array(_Tp (&__arr)[_Size]) noexcept(is_nothrow_constructible_v<_Tp, _Tp&>) {
504500 static_assert(
505501 is_constructible_v<_Tp, _Tp&>,
506502 "[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>());
508504}
509505
510506template <typename _Tp, size_t _Size>
......@@ -516,8 +512,8 @@ to_array(_Tp(&&__arr)[_Size]) noexcept(is_nothrow_move_constructible_v<_Tp>) {
516512 static_assert(
517513 is_move_constructible_v<_Tp>,
518514 "[array.creation]/4: to_array requires move constructible elements.");
519 return __to_array_rvalue_impl(_VSTD::move(__arr),
520 make_index_sequence<_Size>());
515 return _VSTD::__to_array_rvalue_impl(_VSTD::move(__arr),
516 make_index_sequence<_Size>());
521517}
522518
523519#endif // _LIBCPP_STD_VER > 17
lib/libcxx/include/atomic+93-77
......@@ -16,9 +16,12 @@
1616namespace std
1717{
1818
19// feature test macro
19// feature test macro [version.syn]
2020
21#define __cpp_lib_atomic_is_always_lock_free // as specified by SG10
21#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
2326 // order and consistency
2427
......@@ -45,6 +48,7 @@ template <class T> T kill_dependency(T y) noexcept;
4548
4649#define ATOMIC_BOOL_LOCK_FREE unspecified
4750#define ATOMIC_CHAR_LOCK_FREE unspecified
51#define ATOMIC_CHAR8_T_LOCK_FREE unspecified // C++20
4852#define ATOMIC_CHAR16_T_LOCK_FREE unspecified
4953#define ATOMIC_CHAR32_T_LOCK_FREE unspecified
5054#define ATOMIC_WCHAR_T_LOCK_FREE unspecified
......@@ -108,6 +112,7 @@ template <>
108112struct atomic<integral>
109113{
110114 using value_type = integral;
115 using difference_type = value_type;
111116
112117 static constexpr bool is_always_lock_free;
113118 bool is_lock_free() const volatile noexcept;
......@@ -190,6 +195,7 @@ template <class T>
190195struct atomic<T*>
191196{
192197 using value_type = T*;
198 using difference_type = ptrdiff_t;
193199
194200 static constexpr bool is_always_lock_free;
195201 bool is_lock_free() const volatile noexcept;
......@@ -460,6 +466,7 @@ typedef atomic<long> atomic_long;
460466typedef atomic<unsigned long> atomic_ulong;
461467typedef atomic<long long> atomic_llong;
462468typedef atomic<unsigned long long> atomic_ullong;
469typedef atomic<char8_t> atomic_char8_t; // C++20
463470typedef atomic<char16_t> atomic_char16_t;
464471typedef atomic<char32_t> atomic_char32_t;
465472typedef atomic<wchar_t> atomic_wchar_t;
......@@ -477,7 +484,7 @@ typedef atomic<int_fast8_t> atomic_int_fast8_t;
477484typedef atomic<uint_fast8_t> atomic_uint_fast8_t;
478485typedef atomic<int_fast16_t> atomic_int_fast16_t;
479486typedef 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;
481488typedef atomic<uint_fast32_t> atomic_uint_fast32_t;
482489typedef atomic<int_fast64_t> atomic_int_fast64_t;
483490typedef atomic<uint_fast64_t> atomic_uint_fast64_t;
......@@ -568,6 +575,7 @@ template <class T>
568575*/
569576
570577#include <__config>
578#include <__availability>
571579#include <__threading_support>
572580#include <cstddef>
573581#include <cstdint>
......@@ -654,7 +662,7 @@ typedef enum memory_order {
654662
655663template <typename _Tp> _LIBCPP_INLINE_VISIBILITY
656664bool __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;
658666}
659667
660668static_assert((is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value),
......@@ -1119,6 +1127,9 @@ _Tp kill_dependency(_Tp __y) _NOEXCEPT
11191127#if defined(__CLANG_ATOMIC_BOOL_LOCK_FREE)
11201128# define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE
11211129# 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
11221133# define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
11231134# define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE
11241135# define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE
......@@ -1130,6 +1141,9 @@ _Tp kill_dependency(_Tp __y) _NOEXCEPT
11301141#elif defined(__GCC_ATOMIC_BOOL_LOCK_FREE)
11311142# define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
11321143# 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
11331147# define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
11341148# define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
11351149# define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
......@@ -1245,10 +1259,10 @@ template <typename _Tp>
12451259_LIBCPP_INLINE_VISIBILITY
12461260bool __cxx_atomic_compare_exchange_strong(volatile __cxx_atomic_lock_impl<_Tp>* __a,
12471261 _Tp* __expected, _Tp __value, memory_order, memory_order) {
1248 __a->__lock();
12491262 _Tp __temp;
1263 __a->__lock();
12501264 __cxx_atomic_assign_volatile(__temp, __a->__a_value);
1251 bool __ret = __temp == *__expected;
1265 bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
12521266 if(__ret)
12531267 __cxx_atomic_assign_volatile(__a->__a_value, __value);
12541268 else
......@@ -1261,11 +1275,11 @@ _LIBCPP_INLINE_VISIBILITY
12611275bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_lock_impl<_Tp>* __a,
12621276 _Tp* __expected, _Tp __value, memory_order, memory_order) {
12631277 __a->__lock();
1264 bool __ret = __a->__a_value == *__expected;
1278 bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
12651279 if(__ret)
1266 __a->__a_value = __value;
1280 _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
12671281 else
1268 *__expected = __a->__a_value;
1282 _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
12691283 __a->__unlock();
12701284 return __ret;
12711285}
......@@ -1274,10 +1288,10 @@ template <typename _Tp>
12741288_LIBCPP_INLINE_VISIBILITY
12751289bool __cxx_atomic_compare_exchange_weak(volatile __cxx_atomic_lock_impl<_Tp>* __a,
12761290 _Tp* __expected, _Tp __value, memory_order, memory_order) {
1277 __a->__lock();
12781291 _Tp __temp;
1292 __a->__lock();
12791293 __cxx_atomic_assign_volatile(__temp, __a->__a_value);
1280 bool __ret = __temp == *__expected;
1294 bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0);
12811295 if(__ret)
12821296 __cxx_atomic_assign_volatile(__a->__a_value, __value);
12831297 else
......@@ -1290,11 +1304,11 @@ _LIBCPP_INLINE_VISIBILITY
12901304bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_lock_impl<_Tp>* __a,
12911305 _Tp* __expected, _Tp __value, memory_order, memory_order) {
12921306 __a->__lock();
1293 bool __ret = __a->__a_value == *__expected;
1307 bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0);
12941308 if(__ret)
1295 __a->__a_value = __value;
1309 _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp));
12961310 else
1297 *__expected = __a->__a_value;
1311 _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp));
12981312 __a->__unlock();
12991313 return __ret;
13001314}
......@@ -1444,6 +1458,9 @@ template<> struct __cxx_is_always_lock_free<bool> { enum { __value = 2 == ATOMIC
14441458template<> struct __cxx_is_always_lock_free<char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
14451459template<> struct __cxx_is_always_lock_free<signed char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; };
14461460template<> 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
14471464template<> struct __cxx_is_always_lock_free<char16_t> { enum { __value = 2 == ATOMIC_CHAR16_T_LOCK_FREE }; };
14481465template<> struct __cxx_is_always_lock_free<char32_t> { enum { __value = 2 == ATOMIC_CHAR32_T_LOCK_FREE }; };
14491466template<> 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 {
14861503 using __cxx_contention_t = int64_t;
14871504#endif //__linux__
14881505
1489#if _LIBCPP_STD_VER >= 11
1490
14911506using __cxx_atomic_contention_t = __cxx_atomic_impl<__cxx_contention_t>;
14921507
14931508#ifndef _LIBCPP_HAS_NO_PLATFORM_WAIT
......@@ -1519,7 +1534,7 @@ struct __libcpp_atomic_wait_backoff_impl {
15191534 else if(__elapsed > chrono::microseconds(4))
15201535 __libcpp_thread_yield();
15211536 else
1522 ; // poll
1537 {} // poll
15231538 return false;
15241539 }
15251540};
......@@ -1565,8 +1580,6 @@ _LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp* __a, _Tp const __val, mem
15651580 return __cxx_atomic_wait(__a, __test_fn);
15661581}
15671582
1568#endif //_LIBCPP_STD_VER >= 11
1569
15701583// general atomic<T>
15711584
15721585template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value>
......@@ -1775,6 +1788,7 @@ struct atomic
17751788{
17761789 typedef __atomic_base<_Tp> __base;
17771790 typedef _Tp value_type;
1791 typedef value_type difference_type;
17781792 _LIBCPP_INLINE_VISIBILITY
17791793 atomic() _NOEXCEPT _LIBCPP_DEFAULT
17801794 _LIBCPP_INLINE_VISIBILITY
......@@ -1796,6 +1810,7 @@ struct atomic<_Tp*>
17961810{
17971811 typedef __atomic_base<_Tp*> __base;
17981812 typedef _Tp* value_type;
1813 typedef ptrdiff_t difference_type;
17991814 _LIBCPP_INLINE_VISIBILITY
18001815 atomic() _NOEXCEPT _LIBCPP_DEFAULT
18011816 _LIBCPP_INLINE_VISIBILITY
......@@ -1872,7 +1887,7 @@ atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT
18721887template <class _Tp>
18731888_LIBCPP_INLINE_VISIBILITY
18741889void
1875atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
1890atomic_init(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
18761891{
18771892 __cxx_atomic_init(&__o->__a_, __d);
18781893}
......@@ -1880,7 +1895,7 @@ atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
18801895template <class _Tp>
18811896_LIBCPP_INLINE_VISIBILITY
18821897void
1883atomic_init(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
1898atomic_init(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
18841899{
18851900 __cxx_atomic_init(&__o->__a_, __d);
18861901}
......@@ -1890,7 +1905,7 @@ atomic_init(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
18901905template <class _Tp>
18911906_LIBCPP_INLINE_VISIBILITY
18921907void
1893atomic_store(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
1908atomic_store(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
18941909{
18951910 __o->store(__d);
18961911}
......@@ -1898,7 +1913,7 @@ atomic_store(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
18981913template <class _Tp>
18991914_LIBCPP_INLINE_VISIBILITY
19001915void
1901atomic_store(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
1916atomic_store(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
19021917{
19031918 __o->store(__d);
19041919}
......@@ -1908,7 +1923,7 @@ atomic_store(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
19081923template <class _Tp>
19091924_LIBCPP_INLINE_VISIBILITY
19101925void
1911atomic_store_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
1926atomic_store_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
19121927 _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
19131928{
19141929 __o->store(__d, __m);
......@@ -1917,7 +1932,7 @@ atomic_store_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOE
19171932template <class _Tp>
19181933_LIBCPP_INLINE_VISIBILITY
19191934void
1920atomic_store_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
1935atomic_store_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
19211936 _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
19221937{
19231938 __o->store(__d, __m);
......@@ -1966,7 +1981,7 @@ atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
19661981template <class _Tp>
19671982_LIBCPP_INLINE_VISIBILITY
19681983_Tp
1969atomic_exchange(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
1984atomic_exchange(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
19701985{
19711986 return __o->exchange(__d);
19721987}
......@@ -1974,7 +1989,7 @@ atomic_exchange(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
19741989template <class _Tp>
19751990_LIBCPP_INLINE_VISIBILITY
19761991_Tp
1977atomic_exchange(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
1992atomic_exchange(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d) _NOEXCEPT
19781993{
19791994 return __o->exchange(__d);
19801995}
......@@ -1984,7 +1999,7 @@ atomic_exchange(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
19841999template <class _Tp>
19852000_LIBCPP_INLINE_VISIBILITY
19862001_Tp
1987atomic_exchange_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
2002atomic_exchange_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
19882003{
19892004 return __o->exchange(__d, __m);
19902005}
......@@ -1992,7 +2007,7 @@ atomic_exchange_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _
19922007template <class _Tp>
19932008_LIBCPP_INLINE_VISIBILITY
19942009_Tp
1995atomic_exchange_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
2010atomic_exchange_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __d, memory_order __m) _NOEXCEPT
19962011{
19972012 return __o->exchange(__d, __m);
19982013}
......@@ -2002,7 +2017,7 @@ atomic_exchange_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
20022017template <class _Tp>
20032018_LIBCPP_INLINE_VISIBILITY
20042019bool
2005atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
2020atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
20062021{
20072022 return __o->compare_exchange_weak(*__e, __d);
20082023}
......@@ -2010,7 +2025,7 @@ atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEX
20102025template <class _Tp>
20112026_LIBCPP_INLINE_VISIBILITY
20122027bool
2013atomic_compare_exchange_weak(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
2028atomic_compare_exchange_weak(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
20142029{
20152030 return __o->compare_exchange_weak(*__e, __d);
20162031}
......@@ -2020,7 +2035,7 @@ atomic_compare_exchange_weak(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
20202035template <class _Tp>
20212036_LIBCPP_INLINE_VISIBILITY
20222037bool
2023atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
2038atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
20242039{
20252040 return __o->compare_exchange_strong(*__e, __d);
20262041}
......@@ -2028,7 +2043,7 @@ atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NO
20282043template <class _Tp>
20292044_LIBCPP_INLINE_VISIBILITY
20302045bool
2031atomic_compare_exchange_strong(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
2046atomic_compare_exchange_strong(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e, typename atomic<_Tp>::value_type __d) _NOEXCEPT
20322047{
20332048 return __o->compare_exchange_strong(*__e, __d);
20342049}
......@@ -2038,8 +2053,8 @@ atomic_compare_exchange_strong(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
20382053template <class _Tp>
20392054_LIBCPP_INLINE_VISIBILITY
20402055bool
2041atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, _Tp* __e,
2042 _Tp __d,
2056atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
2057 typename atomic<_Tp>::value_type __d,
20432058 memory_order __s, memory_order __f) _NOEXCEPT
20442059 _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
20452060{
......@@ -2049,7 +2064,7 @@ atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, _Tp* __e,
20492064template <class _Tp>
20502065_LIBCPP_INLINE_VISIBILITY
20512066bool
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,
20532068 memory_order __s, memory_order __f) _NOEXCEPT
20542069 _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
20552070{
......@@ -2062,7 +2077,7 @@ template <class _Tp>
20622077_LIBCPP_INLINE_VISIBILITY
20632078bool
20642079atomic_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,
20662081 memory_order __s, memory_order __f) _NOEXCEPT
20672082 _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
20682083{
......@@ -2072,8 +2087,8 @@ atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o,
20722087template <class _Tp>
20732088_LIBCPP_INLINE_VISIBILITY
20742089bool
2075atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, _Tp* __e,
2076 _Tp __d,
2090atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type* __e,
2091 typename atomic<_Tp>::value_type __d,
20772092 memory_order __s, memory_order __f) _NOEXCEPT
20782093 _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
20792094{
......@@ -2156,10 +2171,10 @@ template <class _Tp>
21562171_LIBCPP_INLINE_VISIBILITY
21572172typename enable_if
21582173<
2159 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2174 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
21602175 _Tp
21612176>::type
2162atomic_fetch_add(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
2177atomic_fetch_add(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
21632178{
21642179 return __o->fetch_add(__op);
21652180}
......@@ -2168,10 +2183,10 @@ template <class _Tp>
21682183_LIBCPP_INLINE_VISIBILITY
21692184typename enable_if
21702185<
2171 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2186 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
21722187 _Tp
21732188>::type
2174atomic_fetch_add(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
2189atomic_fetch_add(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
21752190{
21762191 return __o->fetch_add(__op);
21772192}
......@@ -2179,7 +2194,7 @@ atomic_fetch_add(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
21792194template <class _Tp>
21802195_LIBCPP_INLINE_VISIBILITY
21812196_Tp*
2182atomic_fetch_add(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
2197atomic_fetch_add(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) _NOEXCEPT
21832198{
21842199 return __o->fetch_add(__op);
21852200}
......@@ -2187,7 +2202,7 @@ atomic_fetch_add(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
21872202template <class _Tp>
21882203_LIBCPP_INLINE_VISIBILITY
21892204_Tp*
2190atomic_fetch_add(atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
2205atomic_fetch_add(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) _NOEXCEPT
21912206{
21922207 return __o->fetch_add(__op);
21932208}
......@@ -2198,10 +2213,10 @@ template <class _Tp>
21982213_LIBCPP_INLINE_VISIBILITY
21992214typename enable_if
22002215<
2201 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2216 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
22022217 _Tp
22032218>::type
2204atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
2219atomic_fetch_add_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
22052220{
22062221 return __o->fetch_add(__op, __m);
22072222}
......@@ -2210,10 +2225,10 @@ template <class _Tp>
22102225_LIBCPP_INLINE_VISIBILITY
22112226typename enable_if
22122227<
2213 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2228 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
22142229 _Tp
22152230>::type
2216atomic_fetch_add_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
2231atomic_fetch_add_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
22172232{
22182233 return __o->fetch_add(__op, __m);
22192234}
......@@ -2221,8 +2236,7 @@ atomic_fetch_add_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEP
22212236template <class _Tp>
22222237_LIBCPP_INLINE_VISIBILITY
22232238_Tp*
2224atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,
2225 memory_order __m) _NOEXCEPT
2239atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) _NOEXCEPT
22262240{
22272241 return __o->fetch_add(__op, __m);
22282242}
......@@ -2230,7 +2244,7 @@ atomic_fetch_add_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,
22302244template <class _Tp>
22312245_LIBCPP_INLINE_VISIBILITY
22322246_Tp*
2233atomic_fetch_add_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m) _NOEXCEPT
2247atomic_fetch_add_explicit(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) _NOEXCEPT
22342248{
22352249 return __o->fetch_add(__op, __m);
22362250}
......@@ -2241,10 +2255,10 @@ template <class _Tp>
22412255_LIBCPP_INLINE_VISIBILITY
22422256typename enable_if
22432257<
2244 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2258 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
22452259 _Tp
22462260>::type
2247atomic_fetch_sub(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
2261atomic_fetch_sub(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
22482262{
22492263 return __o->fetch_sub(__op);
22502264}
......@@ -2253,10 +2267,10 @@ template <class _Tp>
22532267_LIBCPP_INLINE_VISIBILITY
22542268typename enable_if
22552269<
2256 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2270 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
22572271 _Tp
22582272>::type
2259atomic_fetch_sub(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
2273atomic_fetch_sub(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
22602274{
22612275 return __o->fetch_sub(__op);
22622276}
......@@ -2264,7 +2278,7 @@ atomic_fetch_sub(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
22642278template <class _Tp>
22652279_LIBCPP_INLINE_VISIBILITY
22662280_Tp*
2267atomic_fetch_sub(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
2281atomic_fetch_sub(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) _NOEXCEPT
22682282{
22692283 return __o->fetch_sub(__op);
22702284}
......@@ -2272,7 +2286,7 @@ atomic_fetch_sub(volatile atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
22722286template <class _Tp>
22732287_LIBCPP_INLINE_VISIBILITY
22742288_Tp*
2275atomic_fetch_sub(atomic<_Tp*>* __o, ptrdiff_t __op) _NOEXCEPT
2289atomic_fetch_sub(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op) _NOEXCEPT
22762290{
22772291 return __o->fetch_sub(__op);
22782292}
......@@ -2283,10 +2297,10 @@ template <class _Tp>
22832297_LIBCPP_INLINE_VISIBILITY
22842298typename enable_if
22852299<
2286 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2300 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
22872301 _Tp
22882302>::type
2289atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
2303atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
22902304{
22912305 return __o->fetch_sub(__op, __m);
22922306}
......@@ -2295,10 +2309,10 @@ template <class _Tp>
22952309_LIBCPP_INLINE_VISIBILITY
22962310typename enable_if
22972311<
2298 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
2312 is_integral<_Tp>::value && !is_same<_Tp, bool>::value && !is_const<_Tp>::value,
22992313 _Tp
23002314>::type
2301atomic_fetch_sub_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
2315atomic_fetch_sub_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op, memory_order __m) _NOEXCEPT
23022316{
23032317 return __o->fetch_sub(__op, __m);
23042318}
......@@ -2306,8 +2320,7 @@ atomic_fetch_sub_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEP
23062320template <class _Tp>
23072321_LIBCPP_INLINE_VISIBILITY
23082322_Tp*
2309atomic_fetch_sub_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,
2310 memory_order __m) _NOEXCEPT
2323atomic_fetch_sub_explicit(volatile atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) _NOEXCEPT
23112324{
23122325 return __o->fetch_sub(__op, __m);
23132326}
......@@ -2315,7 +2328,7 @@ atomic_fetch_sub_explicit(volatile atomic<_Tp*>* __o, ptrdiff_t __op,
23152328template <class _Tp>
23162329_LIBCPP_INLINE_VISIBILITY
23172330_Tp*
2318atomic_fetch_sub_explicit(atomic<_Tp*>* __o, ptrdiff_t __op, memory_order __m) _NOEXCEPT
2331atomic_fetch_sub_explicit(atomic<_Tp*>* __o, typename atomic<_Tp*>::difference_type __op, memory_order __m) _NOEXCEPT
23192332{
23202333 return __o->fetch_sub(__op, __m);
23212334}
......@@ -2329,7 +2342,7 @@ typename enable_if
23292342 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
23302343 _Tp
23312344>::type
2332atomic_fetch_and(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
2345atomic_fetch_and(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
23332346{
23342347 return __o->fetch_and(__op);
23352348}
......@@ -2341,7 +2354,7 @@ typename enable_if
23412354 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
23422355 _Tp
23432356>::type
2344atomic_fetch_and(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
2357atomic_fetch_and(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
23452358{
23462359 return __o->fetch_and(__op);
23472360}
......@@ -2355,7 +2368,7 @@ typename enable_if
23552368 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
23562369 _Tp
23572370>::type
2358atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
2371atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
23592372{
23602373 return __o->fetch_and(__op, __m);
23612374}
......@@ -2367,7 +2380,7 @@ typename enable_if
23672380 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
23682381 _Tp
23692382>::type
2370atomic_fetch_and_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
2383atomic_fetch_and_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
23712384{
23722385 return __o->fetch_and(__op, __m);
23732386}
......@@ -2381,7 +2394,7 @@ typename enable_if
23812394 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
23822395 _Tp
23832396>::type
2384atomic_fetch_or(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
2397atomic_fetch_or(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
23852398{
23862399 return __o->fetch_or(__op);
23872400}
......@@ -2393,7 +2406,7 @@ typename enable_if
23932406 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
23942407 _Tp
23952408>::type
2396atomic_fetch_or(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
2409atomic_fetch_or(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
23972410{
23982411 return __o->fetch_or(__op);
23992412}
......@@ -2407,7 +2420,7 @@ typename enable_if
24072420 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
24082421 _Tp
24092422>::type
2410atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
2423atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
24112424{
24122425 return __o->fetch_or(__op, __m);
24132426}
......@@ -2419,7 +2432,7 @@ typename enable_if
24192432 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
24202433 _Tp
24212434>::type
2422atomic_fetch_or_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
2435atomic_fetch_or_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
24232436{
24242437 return __o->fetch_or(__op, __m);
24252438}
......@@ -2433,7 +2446,7 @@ typename enable_if
24332446 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
24342447 _Tp
24352448>::type
2436atomic_fetch_xor(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
2449atomic_fetch_xor(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
24372450{
24382451 return __o->fetch_xor(__op);
24392452}
......@@ -2445,7 +2458,7 @@ typename enable_if
24452458 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
24462459 _Tp
24472460>::type
2448atomic_fetch_xor(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
2461atomic_fetch_xor(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
24492462{
24502463 return __o->fetch_xor(__op);
24512464}
......@@ -2459,7 +2472,7 @@ typename enable_if
24592472 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
24602473 _Tp
24612474>::type
2462atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
2475atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
24632476{
24642477 return __o->fetch_xor(__op, __m);
24652478}
......@@ -2471,7 +2484,7 @@ typename enable_if
24712484 is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
24722485 _Tp
24732486>::type
2474atomic_fetch_xor_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
2487atomic_fetch_xor_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
24752488{
24762489 return __o->fetch_xor(__op, __m);
24772490}
......@@ -2715,6 +2728,9 @@ typedef atomic<long> atomic_long;
27152728typedef atomic<unsigned long> atomic_ulong;
27162729typedef atomic<long long> atomic_llong;
27172730typedef atomic<unsigned long long> atomic_ullong;
2731#ifndef _LIBCPP_NO_HAS_CHAR8_T
2732typedef atomic<char8_t> atomic_char8_t;
2733#endif
27182734typedef atomic<char16_t> atomic_char16_t;
27192735typedef atomic<char32_t> atomic_char32_t;
27202736typedef atomic<wchar_t> atomic_wchar_t;
lib/libcxx/include/barrier+10-2
......@@ -22,6 +22,8 @@ namespace std
2222 public:
2323 using arrival_token = see below;
2424
25 static constexpr ptrdiff_t max() noexcept;
26
2527 constexpr explicit barrier(ptrdiff_t phase_count,
2628 CompletionFunction f = CompletionFunction());
2729 ~barrier();
......@@ -44,6 +46,7 @@ namespace std
4446*/
4547
4648#include <__config>
49#include <__availability>
4750#include <atomic>
4851#ifndef _LIBCPP_HAS_NO_TREE_BARRIER
4952# include <memory>
......@@ -57,6 +60,9 @@ namespace std
5760# error <barrier> is not supported on this single threaded system
5861#endif
5962
63_LIBCPP_PUSH_MACROS
64#include <__undef_macros>
65
6066#if _LIBCPP_STD_VER >= 14
6167
6268_LIBCPP_BEGIN_NAMESPACE_STD
......@@ -287,7 +293,7 @@ public:
287293
288294 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
289295 barrier(ptrdiff_t __count, _CompletionF __completion = _CompletionF())
290 : __b(__count, std::move(__completion)) {
296 : __b(__count, _VSTD::move(__completion)) {
291297 }
292298
293299 barrier(barrier const&) = delete;
......@@ -301,7 +307,7 @@ public:
301307 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
302308 void wait(arrival_token&& __phase) const
303309 {
304 __b.wait(std::move(__phase));
310 __b.wait(_VSTD::move(__phase));
305311 }
306312 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
307313 void arrive_and_wait()
......@@ -319,4 +325,6 @@ _LIBCPP_END_NAMESPACE_STD
319325
320326#endif // _LIBCPP_STD_VER >= 14
321327
328_LIBCPP_POP_MACROS
329
322330#endif //_LIBCPP_BARRIER
lib/libcxx/include/bit+16-132
......@@ -17,13 +17,13 @@ namespace std {
1717
1818 // [bit.pow.two], integral powers of 2
1919 template <class T>
20 constexpr bool ispow2(T x) noexcept; // C++20
20 constexpr bool has_single_bit(T x) noexcept; // C++20
2121 template <class T>
22 constexpr T ceil2(T x); // C++20
22 constexpr T bit_ceil(T x); // C++20
2323 template <class T>
24 constexpr T floor2(T x) noexcept; // C++20
24 constexpr T bit_floor(T x) noexcept; // C++20
2525 template <class T>
26 constexpr T log2p1(T x) noexcept; // C++20
26 constexpr T bit_width(T x) noexcept; // C++20
2727
2828 // [bit.rotate], rotating
2929 template<class T>
......@@ -55,13 +55,14 @@ namespace std {
5555*/
5656
5757#include <__config>
58#include <__bits>
5859#include <limits>
5960#include <type_traits>
6061#include <version>
6162#include <__debug>
6263
6364#if defined(__IBMCPP__)
64#include "support/ibm/support.h"
65#include "__support/ibm/support.h"
6566#endif
6667#if defined(_LIBCPP_COMPILER_MSVC)
6768#include <intrin.h>
......@@ -76,122 +77,6 @@ _LIBCPP_PUSH_MACROS
7677
7778_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
19681template <class _Tp>
19782using __bitop_unsigned_integer _LIBCPP_NODEBUG_TYPE = integral_constant<bool,
......@@ -343,14 +228,14 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
343228unsigned __bit_log2(_Tp __t) _NOEXCEPT
344229{
345230 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);
347232}
348233
349234template <class _Tp>
350235_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
351bool __ispow2(_Tp __t) _NOEXCEPT
236bool __has_single_bit(_Tp __t) _NOEXCEPT
352237{
353 static_assert(__bitop_unsigned_integer<_Tp>::value, "__ispow2 requires unsigned");
238 static_assert(__bitop_unsigned_integer<_Tp>::value, "__has_single_bit requires unsigned");
354239 return __t != 0 && (((__t & (__t - 1)) == 0));
355240}
356241
......@@ -399,7 +284,7 @@ _LIBCPP_INLINE_VISIBILITY constexpr
399284enable_if_t<__bitop_unsigned_integer<_Tp>::value, int>
400285countr_zero(_Tp __t) noexcept
401286{
402 return __countr_zero(__t);
287 return __countr_zero(__t);
403288}
404289
405290
......@@ -424,15 +309,15 @@ popcount(_Tp __t) noexcept
424309template <class _Tp>
425310_LIBCPP_INLINE_VISIBILITY constexpr
426311enable_if_t<__bitop_unsigned_integer<_Tp>::value, bool>
427ispow2(_Tp __t) noexcept
312has_single_bit(_Tp __t) noexcept
428313{
429 return __ispow2(__t);
314 return __has_single_bit(__t);
430315}
431316
432317template <class _Tp>
433318_LIBCPP_INLINE_VISIBILITY constexpr
434319enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>
435floor2(_Tp __t) noexcept
320bit_floor(_Tp __t) noexcept
436321{
437322 return __t == 0 ? 0 : _Tp{1} << __bit_log2(__t);
438323}
......@@ -440,11 +325,11 @@ floor2(_Tp __t) noexcept
440325template <class _Tp>
441326_LIBCPP_INLINE_VISIBILITY constexpr
442327enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>
443ceil2(_Tp __t) noexcept
328bit_ceil(_Tp __t) noexcept
444329{
445330 if (__t < 2) return 1;
446331 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
449334 if constexpr (sizeof(_Tp) >= sizeof(unsigned))
450335 return _Tp{1} << __n;
......@@ -459,12 +344,11 @@ ceil2(_Tp __t) noexcept
459344template <class _Tp>
460345_LIBCPP_INLINE_VISIBILITY constexpr
461346enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>
462log2p1(_Tp __t) noexcept
347bit_width(_Tp __t) noexcept
463348{
464349 return __t == 0 ? 0 : __bit_log2(__t) + 1;
465350}
466351
467
468352enum class endian
469353{
470354 little = 0xDEAD,
lib/libcxx/include/bitset+6-6
......@@ -380,7 +380,7 @@ unsigned long long
380380__bitset<_N_words, _Size>::to_ullong(true_type, true_type) const
381381{
382382 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)
384384 __r |= static_cast<unsigned long long>(__first_[__i]) << (sizeof(__storage_type) * CHAR_BIT);
385385 return __r;
386386}
......@@ -625,13 +625,13 @@ protected:
625625 explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long) _NOEXCEPT;
626626
627627 _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT
628 {return reference(0, 1);}
628 {return reference(nullptr, 1);}
629629 _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);}
631631 _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t) _NOEXCEPT
632 {return iterator(0, 0);}
632 {return iterator(nullptr, 0);}
633633 _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t) const _NOEXCEPT
634 {return const_iterator(0, 0);}
634 {return const_iterator(nullptr, 0);}
635635
636636 _LIBCPP_INLINE_VISIBILITY void operator&=(const __bitset&) _NOEXCEPT {}
637637 _LIBCPP_INLINE_VISIBILITY void operator|=(const __bitset&) _NOEXCEPT {}
......@@ -990,7 +990,7 @@ inline
990990size_t
991991bitset<_Size>::count() const _NOEXCEPT
992992{
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));
994994}
995995
996996template <size_t _Size>
lib/libcxx/include/charconv+14-13
......@@ -74,12 +74,13 @@ namespace std {
7474*/
7575
7676#include <__config>
77#include <__availability>
7778#include <__errc>
78#include <type_traits>
79#include <cmath> // for log2f
80#include <cstdint>
81#include <cstring>
7982#include <limits>
80#include <stdint.h>
81#include <string.h>
82#include <math.h>
83#include <type_traits>
8384
8485#include <__debug>
8586
......@@ -206,7 +207,7 @@ __mul_overflowed(unsigned char __a, _Tp __b, unsigned char& __r)
206207{
207208 auto __c = __a * __b;
208209 __r = __c;
209 return __c > (numeric_limits<unsigned char>::max)();
210 return __c > numeric_limits<unsigned char>::max();
210211}
211212
212213template <typename _Tp>
......@@ -215,7 +216,7 @@ __mul_overflowed(unsigned short __a, _Tp __b, unsigned short& __r)
215216{
216217 auto __c = __a * __b;
217218 __r = __c;
218 return __c > (numeric_limits<unsigned short>::max)();
219 return __c > numeric_limits<unsigned short>::max();
219220}
220221
221222template <typename _Tp>
......@@ -226,7 +227,7 @@ __mul_overflowed(_Tp __a, _Tp __b, _Tp& __r)
226227#if !defined(_LIBCPP_COMPILER_MSVC)
227228 return __builtin_mul_overflow(__a, __b, &__r);
228229#else
229 bool __did = __b && ((numeric_limits<_Tp>::max)() / __b) < __a;
230 bool __did = __b && (numeric_limits<_Tp>::max() / __b) < __a;
230231 __r = __a * __b;
231232 return __did;
232233#endif
......@@ -332,7 +333,7 @@ __to_chars_itoa(char* __first, char* __last, _Tp __value, false_type)
332333 auto __len = __p - __buf;
333334 if (__len <= __diff)
334335 {
335 memcpy(__first, __buf, __len);
336 _VSTD::memcpy(__first, __buf, __len);
336337 return {__first + __len, {}};
337338 }
338339 else
......@@ -381,7 +382,7 @@ __to_chars_integral(char* __first, char* __last, _Tp __value, int __base,
381382 return {__last, errc::value_too_large};
382383 else
383384 {
384 memmove(__first, __p, __len);
385 _VSTD::memmove(__first, __p, __len);
385386 return {__first + __len, {}};
386387 }
387388}
......@@ -428,13 +429,13 @@ __sign_combinator(_It __first, _It __last, _Tp& __value, _Fn __f, _Ts... __args)
428429 if (__x <= __complement(__to_unsigned(__tl::min())))
429430 {
430431 __x = __complement(__x);
431 memcpy(&__value, &__x, sizeof(__x));
432 _VSTD::memcpy(&__value, &__x, sizeof(__x));
432433 return __r;
433434 }
434435 }
435436 else
436437 {
437 if (__x <= (__tl::max)())
438 if (__x <= __tl::max())
438439 {
439440 __value = __x;
440441 return __r;
......@@ -525,7 +526,7 @@ __from_chars_atoi(const char* __first, const char* __last, _Tp& __value)
525526 auto __p = __tx::__read(__first, __last, __a, __b);
526527 if (__p == __last || !__in_pattern(*__p))
527528 {
528 __output_type __m = (numeric_limits<_Tp>::max)();
529 __output_type __m = numeric_limits<_Tp>::max();
529530 if (__m >= __a && __m - __a >= __b)
530531 {
531532 __value = __a + __b;
......@@ -580,7 +581,7 @@ __from_chars_integral(const char* __first, const char* __last, _Tp& __value,
580581
581582 if (__p == __last || !__in_pattern(*__p, __base))
582583 {
583 if ((__tl::max)() - __a >= __b)
584 if (__tl::max() - __a >= __b)
584585 {
585586 __value = __a + __b;
586587 return {__p, {}};
lib/libcxx/include/chrono+4-3
......@@ -824,6 +824,7 @@ constexpr chrono::year operator ""y(unsigned lo
824824*/
825825
826826#include <__config>
827#include <__availability>
827828#include <ctime>
828829#include <type_traits>
829830#include <ratio>
......@@ -1076,7 +1077,7 @@ public:
10761077 is_convertible<_Rep2, rep>::value &&
10771078 (treat_as_floating_point<rep>::value ||
10781079 !treat_as_floating_point<_Rep2>::value)
1079 >::type* = 0)
1080 >::type* = nullptr)
10801081 : __rep_(__r) {}
10811082
10821083 // conversions
......@@ -1089,7 +1090,7 @@ public:
10891090 treat_as_floating_point<rep>::value ||
10901091 (__no_overflow<_Period2, period>::type::den == 1 &&
10911092 !treat_as_floating_point<_Rep2>::value))
1092 >::type* = 0)
1093 >::type* = nullptr)
10931094 : __rep_(_VSTD::chrono::duration_cast<duration>(__d).count()) {}
10941095
10951096 // observer
......@@ -1375,7 +1376,7 @@ public:
13751376 typename enable_if
13761377 <
13771378 is_convertible<_Duration2, duration>::value
1378 >::type* = 0)
1379 >::type* = nullptr)
13791380 : __d_(t.time_since_epoch()) {}
13801381
13811382 // observer
lib/libcxx/include/cmath+2-2
......@@ -660,8 +660,8 @@ _LIBCPP_CONSTEXPR _IntT __max_representable_int_for_float() _NOEXCEPT {
660660template <class _IntT, class _RealT>
661661_LIBCPP_INLINE_VISIBILITY
662662_IntT __clamp_to_integral(_RealT __r) _NOEXCEPT {
663 using _Lim = std::numeric_limits<_IntT>;
664 const _IntT _MaxVal = std::__max_representable_int_for_float<_IntT, _RealT>();
663 using _Lim = numeric_limits<_IntT>;
664 const _IntT _MaxVal = __max_representable_int_for_float<_IntT, _RealT>();
665665 if (__r >= ::nextafter(static_cast<_RealT>(_MaxVal), INFINITY)) {
666666 return _Lim::max();
667667 } else if (__r <= _Lim::lowest()) {
lib/libcxx/include/codecvt+24
......@@ -109,6 +109,7 @@ protected:
109109 virtual int do_max_length() const _NOEXCEPT;
110110};
111111
112_LIBCPP_SUPPRESS_DEPRECATED_PUSH
112113template <>
113114class _LIBCPP_TYPE_VIS __codecvt_utf8<char16_t>
114115 : public codecvt<char16_t, char, mbstate_t>
......@@ -125,6 +126,8 @@ public:
125126 codecvt_mode _Mode)
126127 : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
127128 _Mode_(_Mode) {}
129_LIBCPP_SUPPRESS_DEPRECATED_POP
130
128131protected:
129132 virtual result
130133 do_out(state_type& __st,
......@@ -144,6 +147,7 @@ protected:
144147 virtual int do_max_length() const _NOEXCEPT;
145148};
146149
150_LIBCPP_SUPPRESS_DEPRECATED_PUSH
147151template <>
148152class _LIBCPP_TYPE_VIS __codecvt_utf8<char32_t>
149153 : public codecvt<char32_t, char, mbstate_t>
......@@ -160,6 +164,8 @@ public:
160164 codecvt_mode _Mode)
161165 : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
162166 _Mode_(_Mode) {}
167_LIBCPP_SUPPRESS_DEPRECATED_POP
168
163169protected:
164170 virtual result
165171 do_out(state_type& __st,
......@@ -267,6 +273,7 @@ protected:
267273 virtual int do_max_length() const _NOEXCEPT;
268274};
269275
276_LIBCPP_SUPPRESS_DEPRECATED_PUSH
270277template <>
271278class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, false>
272279 : public codecvt<char16_t, char, mbstate_t>
......@@ -283,6 +290,8 @@ public:
283290 codecvt_mode _Mode)
284291 : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
285292 _Mode_(_Mode) {}
293_LIBCPP_SUPPRESS_DEPRECATED_POP
294
286295protected:
287296 virtual result
288297 do_out(state_type& __st,
......@@ -302,6 +311,7 @@ protected:
302311 virtual int do_max_length() const _NOEXCEPT;
303312};
304313
314_LIBCPP_SUPPRESS_DEPRECATED_PUSH
305315template <>
306316class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, true>
307317 : public codecvt<char16_t, char, mbstate_t>
......@@ -318,6 +328,8 @@ public:
318328 codecvt_mode _Mode)
319329 : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
320330 _Mode_(_Mode) {}
331_LIBCPP_SUPPRESS_DEPRECATED_POP
332
321333protected:
322334 virtual result
323335 do_out(state_type& __st,
......@@ -337,6 +349,7 @@ protected:
337349 virtual int do_max_length() const _NOEXCEPT;
338350};
339351
352_LIBCPP_SUPPRESS_DEPRECATED_PUSH
340353template <>
341354class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, false>
342355 : public codecvt<char32_t, char, mbstate_t>
......@@ -353,6 +366,8 @@ public:
353366 codecvt_mode _Mode)
354367 : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
355368 _Mode_(_Mode) {}
369_LIBCPP_SUPPRESS_DEPRECATED_POP
370
356371protected:
357372 virtual result
358373 do_out(state_type& __st,
......@@ -372,6 +387,7 @@ protected:
372387 virtual int do_max_length() const _NOEXCEPT;
373388};
374389
390_LIBCPP_SUPPRESS_DEPRECATED_PUSH
375391template <>
376392class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, true>
377393 : public codecvt<char32_t, char, mbstate_t>
......@@ -388,6 +404,8 @@ public:
388404 codecvt_mode _Mode)
389405 : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
390406 _Mode_(_Mode) {}
407_LIBCPP_SUPPRESS_DEPRECATED_POP
408
391409protected:
392410 virtual result
393411 do_out(state_type& __st,
......@@ -460,6 +478,7 @@ protected:
460478 virtual int do_max_length() const _NOEXCEPT;
461479};
462480
481_LIBCPP_SUPPRESS_DEPRECATED_PUSH
463482template <>
464483class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char32_t>
465484 : public codecvt<char32_t, char, mbstate_t>
......@@ -476,6 +495,8 @@ public:
476495 codecvt_mode _Mode)
477496 : codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
478497 _Mode_(_Mode) {}
498_LIBCPP_SUPPRESS_DEPRECATED_POP
499
479500protected:
480501 virtual result
481502 do_out(state_type& __st,
......@@ -495,6 +516,7 @@ protected:
495516 virtual int do_max_length() const _NOEXCEPT;
496517};
497518
519_LIBCPP_SUPPRESS_DEPRECATED_PUSH
498520template <>
499521class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char16_t>
500522 : public codecvt<char16_t, char, mbstate_t>
......@@ -511,6 +533,8 @@ public:
511533 codecvt_mode _Mode)
512534 : codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(_Maxcode),
513535 _Mode_(_Mode) {}
536_LIBCPP_SUPPRESS_DEPRECATED_POP
537
514538protected:
515539 virtual result
516540 do_out(state_type& __st,
lib/libcxx/include/compare+9-4
......@@ -154,8 +154,13 @@ enum class _LIBCPP_ENUM_VIS _NCmpResult : signed char {
154154 __unordered = -127
155155};
156156
157struct _CmpUnspecifiedType;
158using _CmpUnspecifiedParam = void (_CmpUnspecifiedType::*)();
157struct _CmpUnspecifiedParam {
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
160165class weak_equality {
161166 _LIBCPP_INLINE_VISIBILITY
......@@ -696,8 +701,8 @@ constexpr _ClassifyCompCategory __type_to_enum() noexcept {
696701
697702template <size_t _Size>
698703constexpr _ClassifyCompCategory
699__compute_comp_type(std::array<_ClassifyCompCategory, _Size> __types) {
700 std::array<int, _CCC_Size> __seen = {};
704__compute_comp_type(array<_ClassifyCompCategory, _Size> __types) {
705 array<int, _CCC_Size> __seen = {};
701706 for (auto __type : __types)
702707 ++__seen[__type];
703708 if (__seen[_None])
lib/libcxx/include/complex+7-10
......@@ -227,14 +227,6 @@ template<class T> complex<T> sqrt (const complex<T>&);
227227template<class T> complex<T> tan (const complex<T>&);
228228template<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
238230} // std
239231
240232*/
......@@ -244,9 +236,12 @@ template<class T, class charT, class traits>
244236#include <stdexcept>
245237#include <cmath>
246238#include <iosfwd>
247#include <sstream>
248239#include <version>
249240
241#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
242# include <sstream> // for std::basic_ostringstream
243#endif
244
250245#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
251246#pragma GCC system_header
252247#endif
......@@ -955,7 +950,7 @@ inline _LIBCPP_INLINE_VISIBILITY
955950complex<_Tp>
956951proj(const complex<_Tp>& __c)
957952{
958 std::complex<_Tp> __r = __c;
953 complex<_Tp> __r = __c;
959954 if (__libcpp_isinf_or_builtin(__c.real()) || __libcpp_isinf_or_builtin(__c.imag()))
960955 __r = complex<_Tp>(INFINITY, copysign(_Tp(0), __c.imag()));
961956 return __r;
......@@ -1438,6 +1433,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
14381433 return __is;
14391434}
14401435
1436#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
14411437template<class _Tp, class _CharT, class _Traits>
14421438basic_ostream<_CharT, _Traits>&
14431439operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
......@@ -1449,6 +1445,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
14491445 __s << '(' << __x.real() << ',' << __x.imag() << ')';
14501446 return __os << __s.str();
14511447}
1448#endif // !_LIBCPP_HAS_NO_LOCALIZATION
14521449
14531450#if _LIBCPP_STD_VER > 11
14541451// 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;
157157template<class _Tp, class _Up>
158158concept 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
160165#endif //_LIBCPP_STD_VER > 17 && defined(__cpp_concepts) && __cpp_concepts >= 201811L
161166
162167_LIBCPP_END_NAMESPACE_STD
lib/libcxx/include/ctime+15-1
......@@ -52,6 +52,20 @@ int timespec_get( struct timespec *ts, int base); // C++17
5252#pragma GCC system_header
5353#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
5569_LIBCPP_BEGIN_NAMESPACE_STD
5670
5771using ::clock_t;
......@@ -72,7 +86,7 @@ using ::gmtime;
7286using ::localtime;
7387#endif
7488using ::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)
7690using ::timespec_get;
7791#endif
7892
lib/libcxx/include/deque+8-8
......@@ -1237,7 +1237,7 @@ __deque_base<_Tp, _Allocator>::swap(__deque_base& __c)
12371237 __map_.swap(__c.__map_);
12381238 _VSTD::swap(__start_, __c.__start_);
12391239 _VSTD::swap(size(), __c.size());
1240 __swap_allocator(__alloc(), __c.__alloc());
1240 _VSTD::__swap_allocator(__alloc(), __c.__alloc());
12411241}
12421242
12431243template <class _Tp, class _Allocator>
......@@ -1393,7 +1393,7 @@ public:
13931393 size_type size() const _NOEXCEPT {return __base::size();}
13941394 _LIBCPP_INLINE_VISIBILITY
13951395 size_type max_size() const _NOEXCEPT
1396 {return std::min<size_type>(
1396 {return _VSTD::min<size_type>(
13971397 __alloc_traits::max_size(__base::__alloc()),
13981398 numeric_limits<difference_type>::max());}
13991399 void resize(size_type __n);
......@@ -1586,7 +1586,7 @@ public:
15861586
15871587#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
15881588template<class _InputIterator,
1589 class _Alloc = typename std::allocator<typename iterator_traits<_InputIterator>::value_type>,
1589 class _Alloc = allocator<typename iterator_traits<_InputIterator>::value_type>,
15901590 class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
15911591 >
15921592deque(_InputIterator, _InputIterator)
......@@ -2376,7 +2376,7 @@ deque<_Tp, _Allocator>::__append(_ForIter __f, _ForIter __l,
23762376 for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
23772377 _ConstructTransaction __tx(this, __br);
23782378 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);
23802380 }
23812381 }
23822382}
......@@ -2393,7 +2393,7 @@ deque<_Tp, _Allocator>::__append(size_type __n)
23932393 for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
23942394 _ConstructTransaction __tx(this, __br);
23952395 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_));
23972397 }
23982398 }
23992399}
......@@ -2410,7 +2410,7 @@ deque<_Tp, _Allocator>::__append(size_type __n, const value_type& __v)
24102410 for (__deque_block_range __br : __deque_range(__base::end(), __base::end() + __n)) {
24112411 _ConstructTransaction __tx(this, __br);
24122412 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);
24142414 }
24152415 }
24162416
......@@ -2708,7 +2708,7 @@ void
27082708deque<_Tp, _Allocator>::pop_front()
27092709{
27102710 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() +
27122712 __base::__start_ / __base::__block_size) +
27132713 __base::__start_ % __base::__block_size));
27142714 --__base::size();
......@@ -2723,7 +2723,7 @@ deque<_Tp, _Allocator>::pop_back()
27232723 _LIBCPP_ASSERT(!empty(), "deque::pop_back called for empty deque");
27242724 allocator_type& __a = __base::__alloc();
27252725 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() +
27272727 __p / __base::__block_size) +
27282728 __p % __base::__block_size));
27292729 --__base::size();
lib/libcxx/include/exception+2
......@@ -77,6 +77,8 @@ template <class E> void rethrow_if_nested(const E& e);
7777*/
7878
7979#include <__config>
80#include <__availability>
81#include <__memory/base.h>
8082#include <cstddef>
8183#include <cstdlib>
8284#include <type_traits>
lib/libcxx/include/experimental/memory_resource+2-3
......@@ -116,7 +116,7 @@ public:
116116 { return do_is_equal(__other); }
117117
118118// 8.5.3, memory.resource.priv
119protected:
119private:
120120 virtual void* do_allocate(size_t, size_t) = 0;
121121 virtual void do_deallocate(void*, size_t, size_t) = 0;
122122 virtual bool do_is_equal(memory_resource const &) const _NOEXCEPT = 0;
......@@ -381,7 +381,7 @@ public:
381381 { return __alloc_; }
382382
383383// 8.7.3, memory.resource.adaptor.mem
384protected:
384private:
385385 virtual void * do_allocate(size_t __bytes, size_t)
386386 {
387387 if (__bytes > __max_size()) {
......@@ -407,7 +407,6 @@ protected:
407407 return __p ? __alloc_ == __p->__alloc_ : false;
408408 }
409409
410private:
411410 _LIBCPP_INLINE_VISIBILITY
412411 size_t __max_size() const _NOEXCEPT {
413412 return numeric_limits<size_t>::max() - _MaxAlign;
lib/libcxx/include/experimental/simd+5
......@@ -659,6 +659,9 @@ public:
659659#pragma GCC system_header
660660#endif
661661
662_LIBCPP_PUSH_MACROS
663#include <__undef_macros>
664
662665_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD
663666
664667#if _LIBCPP_STD_VER >= 17
......@@ -1566,4 +1569,6 @@ public:
15661569
15671570_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD
15681571
1572_LIBCPP_POP_MACROS
1573
15691574#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)
671671 __h.get_deleter().__first_constructed = true;
672672 __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
673673 __h.get_deleter().__second_constructed = true;
674 return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
674 return __h;
675675}
676676
677677template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
lib/libcxx/include/filesystem+346-59
......@@ -230,23 +230,31 @@
230230*/
231231
232232#include <__config>
233#include <__availability>
233234#include <cstddef>
234235#include <cstdlib>
235236#include <chrono>
236237#include <iterator>
237238#include <iosfwd>
238#include <locale>
239239#include <memory>
240240#include <stack>
241241#include <string>
242242#include <system_error>
243243#include <utility>
244#include <iomanip> // for quoted
245244#include <string_view>
246245#include <version>
247246
247#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
248# include <locale>
249# include <iomanip> // for quoted
250#endif
251
248252#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
250258#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
251259#pragma GCC system_header
252260#endif
......@@ -543,6 +551,13 @@ struct __can_convert_char<wchar_t> {
543551 static const bool value = true;
544552 using __char_type = wchar_t;
545553};
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
546561template <>
547562struct __can_convert_char<char16_t> {
548563 static const bool value = true;
......@@ -557,10 +572,20 @@ struct __can_convert_char<char32_t> {
557572template <class _ECharT>
558573typename enable_if<__can_convert_char<_ECharT>::value, bool>::type
559574__is_separator(_ECharT __e) {
575#if defined(_LIBCPP_WIN32API)
576 return __e == _ECharT('/') || __e == _ECharT('\\');
577#else
560578 return __e == _ECharT('/');
579#endif
561580}
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
565590template <class _Tp>
566591using _Void = void;
......@@ -615,9 +640,9 @@ struct __is_pathable_char_array<_Source, _ECharT*, _UPtr, true>
615640 static _ECharT const* __range_begin(const _ECharT* __b) { return __b; }
616641 static _ECharT const* __range_end(const _ECharT* __b) {
617642 using _Iter = const _ECharT*;
618 const _ECharT __sentinal = _ECharT{};
643 const _ECharT __sentinel = _ECharT{};
619644 _Iter __e = __b;
620 for (; *__e != __sentinal; ++__e)
645 for (; *__e != __sentinel; ++__e)
621646 ;
622647 return __e;
623648 }
......@@ -639,7 +664,7 @@ struct __is_pathable_iter<
639664 using _Base = __can_convert_char<_ECharT>;
640665
641666 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
644669 static _ECharT __first_or_null(_Iter __b) { return *__b; }
645670};
......@@ -661,80 +686,219 @@ struct __is_pathable<_Tp, false, true, false> : __is_pathable_char_array<_Tp> {
661686template <class _Tp>
662687struct __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)
664708template <class _ECharT>
665709struct _PathCVT {
666710 static_assert(__can_convert_char<_ECharT>::value,
667711 "Char type not convertible");
668712
669713 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,
672719 _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
673725 _Narrower()(back_inserter(__dest), __b, __e);
726#endif
674727 }
675728
676729 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) {
678731 static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload");
679732 if (__b == __e)
680733 return;
681734 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
682741 _Narrower()(back_inserter(__dest), __tmp.data(),
683742 __tmp.data() + __tmp.length());
743#endif
684744 }
685745
686746 template <class _Iter>
687 static void __append_range(string& __dest, _Iter __b, _NullSentinal) {
747 static void __append_range(__path_string& __dest, _Iter __b, _NullSentinel) {
688748 static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload");
689 const _ECharT __sentinal = _ECharT{};
690 if (*__b == __sentinal)
749 const _ECharT __sentinel = _ECharT{};
750 if (*__b == __sentinel)
691751 return;
692752 basic_string<_ECharT> __tmp;
693 for (; *__b != __sentinal; ++__b)
753 for (; *__b != __sentinel; ++__b)
694754 __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
695761 _Narrower()(back_inserter(__dest), __tmp.data(),
696762 __tmp.data() + __tmp.length());
763#endif
697764 }
698765
699766 template <class _Source>
700 static void __append_source(string& __dest, _Source const& __s) {
767 static void __append_source(__path_string& __dest, _Source const& __s) {
701768 using _Traits = __is_pathable<_Source>;
702769 __append_range(__dest, _Traits::__range_begin(__s),
703770 _Traits::__range_end(__s));
704771 }
705772};
773#endif // !_LIBCPP_HAS_NO_LOCALIZATION
706774
707775template <>
708struct _PathCVT<char> {
776struct _PathCVT<__path_value> {
709777
710778 template <class _Iter>
711779 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) {
713781 for (; __b != __e; ++__b)
714782 __dest.push_back(*__b);
715783 }
716784
717785 template <class _Iter>
718786 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) {
720788 __dest.__append_forward_unsafe(__b, __e);
721789 }
722790
723791 template <class _Iter>
724 static void __append_range(string& __dest, _Iter __b, _NullSentinal) {
725 const char __sentinal = char{};
726 for (; *__b != __sentinal; ++__b)
792 static void __append_range(__path_string& __dest, _Iter __b, _NullSentinel) {
793 const char __sentinel = char{};
794 for (; *__b != __sentinel; ++__b)
727795 __dest.push_back(*__b);
728796 }
729797
730798 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) {
732843 using _Traits = __is_pathable<_Source>;
733844 __append_range(__dest, _Traits::__range_begin(__s),
734845 _Traits::__range_end(__s));
735846 }
736847};
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
738902class _LIBCPP_TYPE_VIS path {
739903 template <class _SourceOrIter, class _Tp = path&>
740904 using _EnableIfPathable =
......@@ -747,10 +911,15 @@ class _LIBCPP_TYPE_VIS path {
747911 using _SourceCVT = _PathCVT<_SourceChar<_Tp> >;
748912
749913public:
914#if defined(_LIBCPP_WIN32API)
915 typedef wchar_t value_type;
916 static constexpr value_type preferred_separator = L'\\';
917#else
750918 typedef char value_type;
751 typedef basic_string<value_type> string_type;
752 typedef _VSTD::string_view __string_view;
753919 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
755924 enum class _LIBCPP_ENUM_VIS format : unsigned char {
756925 auto_format,
......@@ -779,12 +948,14 @@ public:
779948 _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);
780949 }
781950
951#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
782952 // TODO Implement locale conversions.
783953 template <class _Source, class = _EnableIfPathable<_Source, void> >
784954 path(const _Source& __src, const locale& __loc, format = format::auto_format);
785955 template <class _InputIt>
786956 path(_InputIt __first, _InputIt _last, const locale& __loc,
787957 format = format::auto_format);
958#endif
788959
789960 _LIBCPP_INLINE_VISIBILITY
790961 ~path() = default;
......@@ -922,9 +1093,8 @@ public:
9221093 template <class _ECharT>
9231094 typename enable_if<__can_convert_char<_ECharT>::value, path&>::type
9241095 operator+=(_ECharT __x) {
925 basic_string<_ECharT> __tmp;
926 __tmp += __x;
927 _PathCVT<_ECharT>::__append_source(__pn_, __tmp);
1096 _PathCVT<_ECharT>::__append_source(__pn_,
1097 basic_string_view<_ECharT>(&__x, 1));
9281098 return *this;
9291099 }
9301100
......@@ -950,7 +1120,12 @@ public:
9501120 _LIBCPP_INLINE_VISIBILITY
9511121 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
9551130 _LIBCPP_INLINE_VISIBILITY
9561131 path& remove_filename() {
......@@ -983,6 +1158,64 @@ public:
9831158
9841159 _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)
9861219 template <class _ECharT, class _Traits = char_traits<_ECharT>,
9871220 class _Allocator = allocator<_ECharT> >
9881221 basic_string<_ECharT, _Traits, _Allocator>
......@@ -995,19 +1228,26 @@ public:
9951228 return __s;
9961229 }
9971230
998 _LIBCPP_INLINE_VISIBILITY std::string string() const { return __pn_; }
999 _LIBCPP_INLINE_VISIBILITY std::wstring wstring() const {
1231 _LIBCPP_INLINE_VISIBILITY _VSTD::wstring wstring() const {
10001232 return string<wchar_t>();
10011233 }
1002 _LIBCPP_INLINE_VISIBILITY std::string u8string() const { return __pn_; }
1003 _LIBCPP_INLINE_VISIBILITY std::u16string u16string() const {
1234 _LIBCPP_INLINE_VISIBILITY _VSTD::u16string u16string() const {
10041235 return string<char16_t>();
10051236 }
1006 _LIBCPP_INLINE_VISIBILITY std::u32string u32string() const {
1237 _LIBCPP_INLINE_VISIBILITY _VSTD::u32string u32string() const {
10071238 return string<char32_t>();
10081239 }
1240#endif /* !_LIBCPP_HAS_NO_LOCALIZATION */
10091241
10101242 // 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)
10111251 template <class _ECharT, class _Traits = char_traits<_ECharT>,
10121252 class _Allocator = allocator<_ECharT> >
10131253 basic_string<_ECharT, _Traits, _Allocator>
......@@ -1015,11 +1255,11 @@ public:
10151255 return string<_ECharT, _Traits, _Allocator>(__a);
10161256 }
10171257
1018 std::string generic_string() const { return __pn_; }
1019 std::wstring generic_wstring() const { return string<wchar_t>(); }
1020 std::string generic_u8string() const { return __pn_; }
1021 std::u16string generic_u16string() const { return string<char16_t>(); }
1022 std::u32string generic_u32string() const { return string<char32_t>(); }
1258 _VSTD::wstring generic_wstring() const { return string<wchar_t>(); }
1259 _VSTD::u16string generic_u16string() const { return string<char16_t>(); }
1260 _VSTD::u32string generic_u32string() const { return string<char32_t>(); }
1261#endif /* !_LIBCPP_HAS_NO_LOCALIZATION */
1262#endif /* !_LIBCPP_WIN32API */
10231263
10241264private:
10251265 int __compare(__string_view) const;
......@@ -1123,23 +1363,24 @@ public:
11231363 iterator begin() const;
11241364 iterator end() const;
11251365
1366#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
11261367 template <class _CharT, class _Traits>
11271368 _LIBCPP_INLINE_VISIBILITY friend
1128 typename enable_if<is_same<_CharT, char>::value &&
1129 is_same<_Traits, char_traits<char> >::value,
1369 typename enable_if<is_same<_CharT, value_type>::value &&
1370 is_same<_Traits, char_traits<value_type> >::value,
11301371 basic_ostream<_CharT, _Traits>&>::type
11311372 operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
1132 __os << std::__quoted(__p.native());
1373 __os << _VSTD::__quoted(__p.native());
11331374 return __os;
11341375 }
11351376
11361377 template <class _CharT, class _Traits>
11371378 _LIBCPP_INLINE_VISIBILITY friend
1138 typename enable_if<!is_same<_CharT, char>::value ||
1139 !is_same<_Traits, char_traits<char> >::value,
1379 typename enable_if<!is_same<_CharT, value_type>::value ||
1380 !is_same<_Traits, char_traits<value_type> >::value,
11401381 basic_ostream<_CharT, _Traits>&>::type
11411382 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>());
11431384 return __os;
11441385 }
11451386
......@@ -1151,6 +1392,7 @@ public:
11511392 __p = __tmp;
11521393 return __is;
11531394 }
1395#endif // !_LIBCPP_HAS_NO_LOCALIZATION
11541396
11551397 friend _LIBCPP_INLINE_VISIBILITY bool operator==(const path& __lhs, const path& __rhs) noexcept {
11561398 return __lhs.compare(__rhs) == 0;
......@@ -1193,25 +1435,70 @@ inline _LIBCPP_INLINE_VISIBILITY void swap(path& __lhs, path& __rhs) noexcept {
11931435_LIBCPP_FUNC_VIS
11941436size_t hash_value(const path& __p) noexcept;
11951437
1196template <class _Source>
1197_LIBCPP_INLINE_VISIBILITY
1198 typename enable_if<__is_pathable<_Source>::value, path>::type
1199 u8path(const _Source& __s) {
1438template <class _InputIt>
1439_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
1440 typename enable_if<__is_pathable<_InputIt>::value, path>::type
1441 u8path(_InputIt __f, _InputIt __l) {
12001442 static_assert(
1201 is_same<typename __is_pathable<_Source>::__char_type, char>::value,
1202 "u8path(Source const&) requires Source have a character type of type "
1203 "'char'");
1204 return path(__s);
1443#ifndef _LIBCPP_NO_HAS_CHAR8_T
1444 is_same<typename __is_pathable<_InputIt>::__char_type, char8_t>::value ||
1445#endif
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 */
12051459}
12061460
1461#if defined(_LIBCPP_WIN32API)
12071462template <class _InputIt>
1208_LIBCPP_INLINE_VISIBILITY
1463_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
12091464 typename enable_if<__is_pathable<_InputIt>::value, path>::type
1210 u8path(_InputIt __f, _InputIt __l) {
1465 u8path(_InputIt __f, _NullSentinel) {
12111466 static_assert(
1467#ifndef _LIBCPP_NO_HAS_CHAR8_T
1468 is_same<typename __is_pathable<_InputIt>::__char_type, char8_t>::value ||
1469#endif
12121470 is_same<typename __is_pathable<_InputIt>::__char_type, char>::value,
1213 "u8path(Iter, Iter) requires Iter have a value_type of type 'char'");
1214 return path(__f, __l);
1471 "u8path(Iter, Iter) requires Iter have a value_type of type 'char'"
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
12151502}
12161503
12171504class _LIBCPP_TYPE_VIS path::iterator {
......@@ -1230,7 +1517,7 @@ public:
12301517 typedef bidirectional_iterator_tag iterator_category;
12311518
12321519 typedef path value_type;
1233 typedef std::ptrdiff_t difference_type;
1520 typedef ptrdiff_t difference_type;
12341521 typedef const path* pointer;
12351522 typedef const path& reference;
12361523
......@@ -1374,7 +1661,7 @@ template <class... _Args>
13741661_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
13751662#ifndef _LIBCPP_NO_EXCEPTIONS
13761663void __throw_filesystem_error(_Args&&... __args) {
1377 throw filesystem_error(std::forward<_Args>(__args)...);
1664 throw filesystem_error(_VSTD::forward<_Args>(__args)...);
13781665}
13791666#else
13801667void __throw_filesystem_error(_Args&&...) {
......@@ -2204,7 +2491,7 @@ private:
22042491
22052492 _LIBCPP_INLINE_VISIBILITY
22062493 void __assign_iter_entry(_Path&& __p, __cached_data __dt) {
2207 __p_ = std::move(__p);
2494 __p_ = _VSTD::move(__p);
22082495 __data_ = __dt;
22092496 }
22102497
......@@ -2505,10 +2792,10 @@ end(const directory_iterator&) noexcept {
25052792class recursive_directory_iterator {
25062793public:
25072794 using value_type = directory_entry;
2508 using difference_type = std::ptrdiff_t;
2795 using difference_type = ptrdiff_t;
25092796 using pointer = directory_entry const*;
25102797 using reference = directory_entry const&;
2511 using iterator_category = std::input_iterator_tag;
2798 using iterator_category = input_iterator_tag;
25122799
25132800public:
25142801 // constructors and destructor
lib/libcxx/include/forward_list+3-3
......@@ -603,7 +603,7 @@ __forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x)
603603 __is_nothrow_swappable<__node_allocator>::value)
604604#endif
605605{
606 __swap_allocator(__alloc(), __x.__alloc(),
606 _VSTD::__swap_allocator(__alloc(), __x.__alloc(),
607607 integral_constant<bool, __node_traits::propagate_on_container_swap::value>());
608608 using _VSTD::swap;
609609 swap(__before_begin()->__next_, __x.__before_begin()->__next_);
......@@ -758,7 +758,7 @@ public:
758758 {return base::__before_begin()->__next_ == nullptr;}
759759 _LIBCPP_INLINE_VISIBILITY
760760 size_type max_size() const _NOEXCEPT {
761 return std::min<size_type>(
761 return _VSTD::min<size_type>(
762762 __node_traits::max_size(base::__alloc()),
763763 numeric_limits<difference_type>::max());
764764 }
......@@ -871,7 +871,7 @@ private:
871871
872872#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
873873template<class _InputIterator,
874 class _Alloc = typename std::allocator<typename iterator_traits<_InputIterator>::value_type>,
874 class _Alloc = allocator<typename iterator_traits<_InputIterator>::value_type>,
875875 class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
876876 >
877877forward_list(_InputIterator, _InputIterator)
lib/libcxx/include/fstream+83-72
......@@ -180,12 +180,16 @@ typedef basic_fstream<wchar_t> wfstream;
180180*/
181181
182182#include <__config>
183#include <__availability>
183184#include <ostream>
184185#include <istream>
185186#include <__locale>
186187#include <cstdio>
187188#include <cstdlib>
188#include <filesystem>
189
190#if !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
191# include <filesystem>
192#endif
189193
190194#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
191195#pragma GCC system_header
......@@ -234,13 +238,13 @@ public:
234238 _LIBCPP_INLINE_VISIBILITY
235239 basic_filebuf* open(const string& __s, ios_base::openmode __mode);
236240
237#if _LIBCPP_STD_VER >= 17
241#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
238242 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
239243 basic_filebuf* open(const _VSTD_FS::path& __p, ios_base::openmode __mode) {
240244 return open(__p.c_str(), __mode);
241245 }
242246#endif
243 _LIBCPP_INLINE_VISIBILITY
247 inline _LIBCPP_INLINE_VISIBILITY
244248 basic_filebuf* __open(int __fd, ios_base::openmode __mode);
245249#endif
246250 basic_filebuf* close();
......@@ -286,13 +290,13 @@ private:
286290
287291template <class _CharT, class _Traits>
288292basic_filebuf<_CharT, _Traits>::basic_filebuf()
289 : __extbuf_(0),
290 __extbufnext_(0),
291 __extbufend_(0),
293 : __extbuf_(nullptr),
294 __extbufnext_(nullptr),
295 __extbufend_(nullptr),
292296 __ebs_(0),
293 __intbuf_(0),
297 __intbuf_(nullptr),
294298 __ibs_(0),
295 __file_(0),
299 __file_(nullptr),
296300 __cv_(nullptr),
297301 __st_(),
298302 __st_last_(),
......@@ -307,7 +311,7 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf()
307311 __cv_ = &use_facet<codecvt<char_type, char, state_type> >(this->getloc());
308312 __always_noconv_ = __cv_->always_noconv();
309313 }
310 setbuf(0, 4096);
314 setbuf(nullptr, 4096);
311315}
312316
313317#ifndef _LIBCPP_CXX03_LANG
......@@ -359,13 +363,13 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs)
359363 (char_type*)__extbuf_ + (__rhs.gptr() - __rhs.eback()),
360364 (char_type*)__extbuf_ + (__rhs.egptr() - __rhs.eback()));
361365 }
362 __rhs.__extbuf_ = 0;
363 __rhs.__extbufnext_ = 0;
364 __rhs.__extbufend_ = 0;
366 __rhs.__extbuf_ = nullptr;
367 __rhs.__extbufnext_ = nullptr;
368 __rhs.__extbufend_ = nullptr;
365369 __rhs.__ebs_ = 0;
366370 __rhs.__intbuf_ = 0;
367371 __rhs.__ibs_ = 0;
368 __rhs.__file_ = 0;
372 __rhs.__file_ = nullptr;
369373 __rhs.__st_ = state_type();
370374 __rhs.__st_last_ = state_type();
371375 __rhs.__om_ = 0;
......@@ -499,7 +503,7 @@ inline
499503bool
500504basic_filebuf<_CharT, _Traits>::is_open() const
501505{
502 return __file_ != 0;
506 return __file_ != nullptr;
503507}
504508
505509template <class _CharT, class _Traits>
......@@ -547,8 +551,8 @@ template <class _CharT, class _Traits>
547551basic_filebuf<_CharT, _Traits>*
548552basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)
549553{
550 basic_filebuf<_CharT, _Traits>* __rt = 0;
551 if (__file_ == 0)
554 basic_filebuf<_CharT, _Traits>* __rt = nullptr;
555 if (__file_ == nullptr)
552556 {
553557 if (const char* __mdstr = __make_mdstring(__mode)) {
554558 __rt = this;
......@@ -558,22 +562,23 @@ basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)
558562 if (__mode & ios_base::ate) {
559563 if (fseek(__file_, 0, SEEK_END)) {
560564 fclose(__file_);
561 __file_ = 0;
562 __rt = 0;
565 __file_ = nullptr;
566 __rt = nullptr;
563567 }
564568 }
565569 } else
566 __rt = 0;
570 __rt = nullptr;
567571 }
568572 }
569573 return __rt;
570574}
571575
572576template <class _CharT, class _Traits>
573_LIBCPP_INLINE_VISIBILITY basic_filebuf<_CharT, _Traits>*
577inline _LIBCPP_INLINE_VISIBILITY
578basic_filebuf<_CharT, _Traits>*
574579basic_filebuf<_CharT, _Traits>::__open(int __fd, ios_base::openmode __mode) {
575 basic_filebuf<_CharT, _Traits>* __rt = 0;
576 if (__file_ == 0) {
580 basic_filebuf<_CharT, _Traits>* __rt = nullptr;
581 if (__file_ == nullptr) {
577582 if (const char* __mdstr = __make_mdstring(__mode)) {
578583 __rt = this;
579584 __file_ = fdopen(__fd, __mdstr);
......@@ -582,12 +587,12 @@ basic_filebuf<_CharT, _Traits>::__open(int __fd, ios_base::openmode __mode) {
582587 if (__mode & ios_base::ate) {
583588 if (fseek(__file_, 0, SEEK_END)) {
584589 fclose(__file_);
585 __file_ = 0;
586 __rt = 0;
590 __file_ = nullptr;
591 __rt = nullptr;
587592 }
588593 }
589594 } else
590 __rt = 0;
595 __rt = nullptr;
591596 }
592597 }
593598 return __rt;
......@@ -600,8 +605,8 @@ template <class _CharT, class _Traits>
600605basic_filebuf<_CharT, _Traits>*
601606basic_filebuf<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode)
602607{
603 basic_filebuf<_CharT, _Traits>* __rt = 0;
604 if (__file_ == 0)
608 basic_filebuf<_CharT, _Traits>* __rt = nullptr;
609 if (__file_ == nullptr)
605610 {
606611 __rt = this;
607612 const wchar_t* __mdstr;
......@@ -650,7 +655,7 @@ basic_filebuf<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mo
650655 __mdstr = L"a+b";
651656 break;
652657 default:
653 __rt = 0;
658 __rt = nullptr;
654659 break;
655660 }
656661 if (__rt)
......@@ -664,13 +669,13 @@ basic_filebuf<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mo
664669 if (fseek(__file_, 0, SEEK_END))
665670 {
666671 fclose(__file_);
667 __file_ = 0;
668 __rt = 0;
672 __file_ = nullptr;
673 __rt = nullptr;
669674 }
670675 }
671676 }
672677 else
673 __rt = 0;
678 __rt = nullptr;
674679 }
675680 }
676681 return __rt;
......@@ -690,16 +695,16 @@ template <class _CharT, class _Traits>
690695basic_filebuf<_CharT, _Traits>*
691696basic_filebuf<_CharT, _Traits>::close()
692697{
693 basic_filebuf<_CharT, _Traits>* __rt = 0;
698 basic_filebuf<_CharT, _Traits>* __rt = nullptr;
694699 if (__file_)
695700 {
696701 __rt = this;
697702 unique_ptr<FILE, int(*)(FILE*)> __h(__file_, fclose);
698703 if (sync())
699 __rt = 0;
704 __rt = nullptr;
700705 if (fclose(__h.release()))
701 __rt = 0;
702 __file_ = 0;
706 __rt = nullptr;
707 __file_ = nullptr;
703708 setbuf(0, 0);
704709 }
705710 return __rt;
......@@ -709,17 +714,17 @@ template <class _CharT, class _Traits>
709714typename basic_filebuf<_CharT, _Traits>::int_type
710715basic_filebuf<_CharT, _Traits>::underflow()
711716{
712 if (__file_ == 0)
717 if (__file_ == nullptr)
713718 return traits_type::eof();
714719 bool __initial = __read_mode();
715720 char_type __1buf;
716 if (this->gptr() == 0)
721 if (this->gptr() == nullptr)
717722 this->setg(&__1buf, &__1buf+1, &__1buf+1);
718723 const size_t __unget_sz = __initial ? 0 : min<size_t>((this->egptr() - this->eback()) / 2, 4);
719724 int_type __c = traits_type::eof();
720725 if (this->gptr() == this->egptr())
721726 {
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));
723728 if (__always_noconv_)
724729 {
725730 size_t __nmemb = static_cast<size_t>(this->egptr() - this->eback() - __unget_sz);
......@@ -736,7 +741,7 @@ basic_filebuf<_CharT, _Traits>::underflow()
736741 {
737742 _LIBCPP_ASSERT ( !(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" );
738743 if (__extbufend_ != __extbufnext_)
739 memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
744 _VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
740745 __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
741746 __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
742747 size_t __nmemb = _VSTD::min(static_cast<size_t>(__ibs_ - __unget_sz),
......@@ -771,7 +776,7 @@ basic_filebuf<_CharT, _Traits>::underflow()
771776 else
772777 __c = traits_type::to_int_type(*this->gptr());
773778 if (this->eback() == &__1buf)
774 this->setg(0, 0, 0);
779 this->setg(nullptr, nullptr, nullptr);
775780 return __c;
776781}
777782
......@@ -801,7 +806,7 @@ template <class _CharT, class _Traits>
801806typename basic_filebuf<_CharT, _Traits>::int_type
802807basic_filebuf<_CharT, _Traits>::overflow(int_type __c)
803808{
804 if (__file_ == 0)
809 if (__file_ == nullptr)
805810 return traits_type::eof();
806811 __write_mode();
807812 char_type __1buf;
......@@ -809,7 +814,7 @@ basic_filebuf<_CharT, _Traits>::overflow(int_type __c)
809814 char_type* __epb_save = this->epptr();
810815 if (!traits_type::eq_int_type(__c, traits_type::eof()))
811816 {
812 if (this->pptr() == 0)
817 if (this->pptr() == nullptr)
813818 this->setp(&__1buf, &__1buf+1);
814819 *this->pptr() = traits_type::to_char_type(__c);
815820 this->pbump(1);
......@@ -866,8 +871,8 @@ template <class _CharT, class _Traits>
866871basic_streambuf<_CharT, _Traits>*
867872basic_filebuf<_CharT, _Traits>::setbuf(char_type* __s, streamsize __n)
868873{
869 this->setg(0, 0, 0);
870 this->setp(0, 0);
874 this->setg(nullptr, nullptr, nullptr);
875 this->setp(nullptr, nullptr);
871876 if (__owns_eb_)
872877 delete [] __extbuf_;
873878 if (__owns_ib_)
......@@ -909,7 +914,7 @@ basic_filebuf<_CharT, _Traits>::setbuf(char_type* __s, streamsize __n)
909914 else
910915 {
911916 __ibs_ = 0;
912 __intbuf_ = 0;
917 __intbuf_ = nullptr;
913918 __owns_ib_ = false;
914919 }
915920 return this;
......@@ -924,7 +929,7 @@ basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,
924929 __throw_bad_cast();
925930
926931 int __width = __cv_->encoding();
927 if (__file_ == 0 || (__width <= 0 && __off != 0) || sync())
932 if (__file_ == nullptr || (__width <= 0 && __off != 0) || sync())
928933 return pos_type(off_type(-1));
929934 // __width > 0 || __off == 0
930935 int __whence;
......@@ -959,7 +964,7 @@ template <class _CharT, class _Traits>
959964typename basic_filebuf<_CharT, _Traits>::pos_type
960965basic_filebuf<_CharT, _Traits>::seekpos(pos_type __sp, ios_base::openmode)
961966{
962 if (__file_ == 0 || sync())
967 if (__file_ == nullptr || sync())
963968 return pos_type(off_type(-1));
964969#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
965970 if (fseek(__file_, __sp, SEEK_SET))
......@@ -976,7 +981,7 @@ template <class _CharT, class _Traits>
976981int
977982basic_filebuf<_CharT, _Traits>::sync()
978983{
979 if (__file_ == 0)
984 if (__file_ == nullptr)
980985 return 0;
981986 if (!__cv_)
982987 __throw_bad_cast();
......@@ -1035,7 +1040,7 @@ basic_filebuf<_CharT, _Traits>::sync()
10351040 if (__update_st)
10361041 __st_ = __state;
10371042 __extbufnext_ = __extbufend_ = __extbuf_;
1038 this->setg(0, 0, 0);
1043 this->setg(nullptr, nullptr, nullptr);
10391044 __cm_ = 0;
10401045 }
10411046 return 0;
......@@ -1051,8 +1056,8 @@ basic_filebuf<_CharT, _Traits>::imbue(const locale& __loc)
10511056 __always_noconv_ = __cv_->always_noconv();
10521057 if (__old_anc != __always_noconv_)
10531058 {
1054 this->setg(0, 0, 0);
1055 this->setp(0, 0);
1059 this->setg(nullptr, nullptr, nullptr);
1060 this->setp(nullptr, nullptr);
10561061 // invariant, char_type is char, else we couldn't get here
10571062 if (__always_noconv_) // need to dump __intbuf_
10581063 {
......@@ -1062,7 +1067,7 @@ basic_filebuf<_CharT, _Traits>::imbue(const locale& __loc)
10621067 __ebs_ = __ibs_;
10631068 __extbuf_ = (char*)__intbuf_;
10641069 __ibs_ = 0;
1065 __intbuf_ = 0;
1070 __intbuf_ = nullptr;
10661071 __owns_ib_ = false;
10671072 }
10681073 else // need to obtain an __intbuf_.
......@@ -1091,7 +1096,7 @@ basic_filebuf<_CharT, _Traits>::__read_mode()
10911096{
10921097 if (!(__cm_ & ios_base::in))
10931098 {
1094 this->setp(0, 0);
1099 this->setp(nullptr, nullptr);
10951100 if (__always_noconv_)
10961101 this->setg((char_type*)__extbuf_,
10971102 (char_type*)__extbuf_ + __ebs_,
......@@ -1110,7 +1115,7 @@ basic_filebuf<_CharT, _Traits>::__write_mode()
11101115{
11111116 if (!(__cm_ & ios_base::out))
11121117 {
1113 this->setg(0, 0, 0);
1118 this->setg(nullptr, nullptr, nullptr);
11141119 if (__ebs_ > sizeof(__extbuf_min_))
11151120 {
11161121 if (__always_noconv_)
......@@ -1120,7 +1125,7 @@ basic_filebuf<_CharT, _Traits>::__write_mode()
11201125 this->setp(__intbuf_, __intbuf_ + (__ibs_ - 1));
11211126 }
11221127 else
1123 this->setp(0, 0);
1128 this->setp(nullptr, nullptr);
11241129 __cm_ = ios_base::out;
11251130 }
11261131}
......@@ -1149,7 +1154,7 @@ public:
11491154#endif
11501155 _LIBCPP_INLINE_VISIBILITY
11511156 explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
1152#if _LIBCPP_STD_VER >= 17
1157#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
11531158 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
11541159 explicit basic_ifstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in)
11551160 : basic_ifstream(__p.c_str(), __mode) {}
......@@ -1175,7 +1180,7 @@ public:
11751180 void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in);
11761181#endif
11771182 void open(const string& __s, ios_base::openmode __mode = ios_base::in);
1178#if _LIBCPP_STD_VER >= 17
1183#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
11791184 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
11801185 void open(const filesystem::path& __p,
11811186 ios_base::openmode __mode = ios_base::in) {
......@@ -1206,7 +1211,7 @@ inline
12061211basic_ifstream<_CharT, _Traits>::basic_ifstream(const char* __s, ios_base::openmode __mode)
12071212 : basic_istream<char_type, traits_type>(&__sb_)
12081213{
1209 if (__sb_.open(__s, __mode | ios_base::in) == 0)
1214 if (__sb_.open(__s, __mode | ios_base::in) == nullptr)
12101215 this->setstate(ios_base::failbit);
12111216}
12121217
......@@ -1216,7 +1221,7 @@ inline
12161221basic_ifstream<_CharT, _Traits>::basic_ifstream(const wchar_t* __s, ios_base::openmode __mode)
12171222 : basic_istream<char_type, traits_type>(&__sb_)
12181223{
1219 if (__sb_.open(__s, __mode | ios_base::in) == 0)
1224 if (__sb_.open(__s, __mode | ios_base::in) == nullptr)
12201225 this->setstate(ios_base::failbit);
12211226}
12221227#endif
......@@ -1226,7 +1231,7 @@ inline
12261231basic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::openmode __mode)
12271232 : basic_istream<char_type, traits_type>(&__sb_)
12281233{
1229 if (__sb_.open(__s, __mode | ios_base::in) == 0)
1234 if (__sb_.open(__s, __mode | ios_base::in) == nullptr)
12301235 this->setstate(ios_base::failbit);
12311236}
12321237#endif
......@@ -1363,7 +1368,7 @@ public:
13631368 _LIBCPP_INLINE_VISIBILITY
13641369 explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
13651370
1366#if _LIBCPP_STD_VER >= 17
1371#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
13671372 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
13681373 explicit basic_ofstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
13691374 : basic_ofstream(__p.c_str(), __mode) {}
......@@ -1390,7 +1395,7 @@ public:
13901395#endif
13911396 void open(const string& __s, ios_base::openmode __mode = ios_base::out);
13921397
1393#if _LIBCPP_STD_VER >= 17
1398#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
13941399 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
13951400 void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
13961401 { return open(__p.c_str(), __mode); }
......@@ -1419,7 +1424,7 @@ inline
14191424basic_ofstream<_CharT, _Traits>::basic_ofstream(const char* __s, ios_base::openmode __mode)
14201425 : basic_ostream<char_type, traits_type>(&__sb_)
14211426{
1422 if (__sb_.open(__s, __mode | ios_base::out) == 0)
1427 if (__sb_.open(__s, __mode | ios_base::out) == nullptr)
14231428 this->setstate(ios_base::failbit);
14241429}
14251430
......@@ -1429,7 +1434,7 @@ inline
14291434basic_ofstream<_CharT, _Traits>::basic_ofstream(const wchar_t* __s, ios_base::openmode __mode)
14301435 : basic_ostream<char_type, traits_type>(&__sb_)
14311436{
1432 if (__sb_.open(__s, __mode | ios_base::out) == 0)
1437 if (__sb_.open(__s, __mode | ios_base::out) == nullptr)
14331438 this->setstate(ios_base::failbit);
14341439}
14351440#endif
......@@ -1439,7 +1444,7 @@ inline
14391444basic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::openmode __mode)
14401445 : basic_ostream<char_type, traits_type>(&__sb_)
14411446{
1442 if (__sb_.open(__s, __mode | ios_base::out) == 0)
1447 if (__sb_.open(__s, __mode | ios_base::out) == nullptr)
14431448 this->setstate(ios_base::failbit);
14441449}
14451450#endif
......@@ -1548,7 +1553,7 @@ inline
15481553void
15491554basic_ofstream<_CharT, _Traits>::close()
15501555{
1551 if (__sb_.close() == 0)
1556 if (__sb_.close() == nullptr)
15521557 this->setstate(ios_base::failbit);
15531558}
15541559
......@@ -1577,7 +1582,7 @@ public:
15771582 _LIBCPP_INLINE_VISIBILITY
15781583 explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
15791584
1580#if _LIBCPP_STD_VER >= 17
1585#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
15811586 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
15821587 explicit basic_fstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out)
15831588 : basic_fstream(__p.c_str(), __mode) {}
......@@ -1605,7 +1610,7 @@ public:
16051610#endif
16061611 void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
16071612
1608#if _LIBCPP_STD_VER >= 17
1613#if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
16091614 _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
16101615 void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in|ios_base::out)
16111616 { return open(__p.c_str(), __mode); }
......@@ -1632,7 +1637,7 @@ inline
16321637basic_fstream<_CharT, _Traits>::basic_fstream(const char* __s, ios_base::openmode __mode)
16331638 : basic_iostream<char_type, traits_type>(&__sb_)
16341639{
1635 if (__sb_.open(__s, __mode) == 0)
1640 if (__sb_.open(__s, __mode) == nullptr)
16361641 this->setstate(ios_base::failbit);
16371642}
16381643
......@@ -1642,7 +1647,7 @@ inline
16421647basic_fstream<_CharT, _Traits>::basic_fstream(const wchar_t* __s, ios_base::openmode __mode)
16431648 : basic_iostream<char_type, traits_type>(&__sb_)
16441649{
1645 if (__sb_.open(__s, __mode) == 0)
1650 if (__sb_.open(__s, __mode) == nullptr)
16461651 this->setstate(ios_base::failbit);
16471652}
16481653#endif
......@@ -1652,7 +1657,7 @@ inline
16521657basic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openmode __mode)
16531658 : basic_iostream<char_type, traits_type>(&__sb_)
16541659{
1655 if (__sb_.open(__s, __mode) == 0)
1660 if (__sb_.open(__s, __mode) == nullptr)
16561661 this->setstate(ios_base::failbit);
16571662}
16581663#endif
......@@ -1752,10 +1757,16 @@ inline
17521757void
17531758basic_fstream<_CharT, _Traits>::close()
17541759{
1755 if (__sb_.close() == 0)
1760 if (__sb_.close() == nullptr)
17561761 this->setstate(ios_base::failbit);
17571762}
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
17591770_LIBCPP_END_NAMESPACE_STD
17601771
17611772_LIBCPP_POP_MACROS
lib/libcxx/include/functional+82-78
......@@ -213,7 +213,8 @@ public:
213213template <class Predicate> // deprecated in C++17
214214binary_negate<Predicate> not2(const Predicate& pred);
215215
216template <class F> unspecified not_fn(F&& f); // C++17
216template <class F>
217constexpr unspecified not_fn(F&& f); // C++17, constexpr in C++20
217218
218219template<class T> struct is_bind_expression;
219220template<class T> struct is_placeholder;
......@@ -226,11 +227,12 @@ template <class T> inline constexpr int is_placeholder_v
226227
227228
228229template<class Fn, class... BoundArgs>
229 unspecified bind(Fn&&, BoundArgs&&...);
230 constexpr unspecified bind(Fn&&, BoundArgs&&...); // constexpr in C++20
230231template<class R, class Fn, class... BoundArgs>
231 unspecified bind(Fn&&, BoundArgs&&...);
232 constexpr unspecified bind(Fn&&, BoundArgs&&...); // constexpr in C++20
232233
233234template<class F, class... Args>
235 constexpr // constexpr in C++20
234236 invoke_result_t<F, Args...> invoke(F&& f, Args&&... args) // C++17
235237 noexcept(is_nothrow_invocable_v<F, Args...>);
236238
......@@ -376,7 +378,8 @@ public:
376378template <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
377379template <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
381384class bad_function_call
382385 : public exception
......@@ -470,6 +473,7 @@ template <> struct hash<bool>;
470473template <> struct hash<char>;
471474template <> struct hash<signed char>;
472475template <> struct hash<unsigned char>;
476template <> struct hash<char8_t>; // since C++20
473477template <> struct hash<char16_t>;
474478template <> struct hash<char32_t>;
475479template <> struct hash<wchar_t>;
......@@ -508,10 +512,6 @@ POLICY: For non-variadic implementations, the number of arguments is limited
508512
509513#include <__functional_base>
510514
511#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME) && !defined(_LIBCPP_HAS_OBJC_ARC)
512#include <Block.h>
513#endif
514
515515#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
516516#pragma GCC system_header
517517#endif
......@@ -1291,15 +1291,16 @@ private:
12911291 type __f_;
12921292
12931293public:
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
12961297#ifndef _LIBCPP_CXX03_LANG
12971298 // invoke
12981299 template <class... _ArgTypes>
1299 _LIBCPP_INLINE_VISIBILITY
1300 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
13001301 typename __invoke_return<type, _ArgTypes...>::type
13011302 operator() (_ArgTypes&&... __args) const {
1302 return __invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...);
1303 return _VSTD::__invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...);
13031304 }
13041305#else
13051306
......@@ -1307,104 +1308,104 @@ public:
13071308 _LIBCPP_INLINE_VISIBILITY
13081309 typename __invoke_return0<type, _A0>::type
13091310 operator() (_A0& __a0) const {
1310 return __invoke(__f_, __a0);
1311 return _VSTD::__invoke(__f_, __a0);
13111312 }
13121313
13131314 template <class _A0>
13141315 _LIBCPP_INLINE_VISIBILITY
13151316 typename __invoke_return0<type, _A0 const>::type
13161317 operator() (_A0 const& __a0) const {
1317 return __invoke(__f_, __a0);
1318 return _VSTD::__invoke(__f_, __a0);
13181319 }
13191320
13201321 template <class _A0, class _A1>
13211322 _LIBCPP_INLINE_VISIBILITY
13221323 typename __invoke_return1<type, _A0, _A1>::type
13231324 operator() (_A0& __a0, _A1& __a1) const {
1324 return __invoke(__f_, __a0, __a1);
1325 return _VSTD::__invoke(__f_, __a0, __a1);
13251326 }
13261327
13271328 template <class _A0, class _A1>
13281329 _LIBCPP_INLINE_VISIBILITY
13291330 typename __invoke_return1<type, _A0 const, _A1>::type
13301331 operator() (_A0 const& __a0, _A1& __a1) const {
1331 return __invoke(__f_, __a0, __a1);
1332 return _VSTD::__invoke(__f_, __a0, __a1);
13321333 }
13331334
13341335 template <class _A0, class _A1>
13351336 _LIBCPP_INLINE_VISIBILITY
13361337 typename __invoke_return1<type, _A0, _A1 const>::type
13371338 operator() (_A0& __a0, _A1 const& __a1) const {
1338 return __invoke(__f_, __a0, __a1);
1339 return _VSTD::__invoke(__f_, __a0, __a1);
13391340 }
13401341
13411342 template <class _A0, class _A1>
13421343 _LIBCPP_INLINE_VISIBILITY
13431344 typename __invoke_return1<type, _A0 const, _A1 const>::type
13441345 operator() (_A0 const& __a0, _A1 const& __a1) const {
1345 return __invoke(__f_, __a0, __a1);
1346 return _VSTD::__invoke(__f_, __a0, __a1);
13461347 }
13471348
13481349 template <class _A0, class _A1, class _A2>
13491350 _LIBCPP_INLINE_VISIBILITY
13501351 typename __invoke_return2<type, _A0, _A1, _A2>::type
13511352 operator() (_A0& __a0, _A1& __a1, _A2& __a2) const {
1352 return __invoke(__f_, __a0, __a1, __a2);
1353 return _VSTD::__invoke(__f_, __a0, __a1, __a2);
13531354 }
13541355
13551356 template <class _A0, class _A1, class _A2>
13561357 _LIBCPP_INLINE_VISIBILITY
13571358 typename __invoke_return2<type, _A0 const, _A1, _A2>::type
13581359 operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const {
1359 return __invoke(__f_, __a0, __a1, __a2);
1360 return _VSTD::__invoke(__f_, __a0, __a1, __a2);
13601361 }
13611362
13621363 template <class _A0, class _A1, class _A2>
13631364 _LIBCPP_INLINE_VISIBILITY
13641365 typename __invoke_return2<type, _A0, _A1 const, _A2>::type
13651366 operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const {
1366 return __invoke(__f_, __a0, __a1, __a2);
1367 return _VSTD::__invoke(__f_, __a0, __a1, __a2);
13671368 }
13681369
13691370 template <class _A0, class _A1, class _A2>
13701371 _LIBCPP_INLINE_VISIBILITY
13711372 typename __invoke_return2<type, _A0, _A1, _A2 const>::type
13721373 operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const {
1373 return __invoke(__f_, __a0, __a1, __a2);
1374 return _VSTD::__invoke(__f_, __a0, __a1, __a2);
13741375 }
13751376
13761377 template <class _A0, class _A1, class _A2>
13771378 _LIBCPP_INLINE_VISIBILITY
13781379 typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type
13791380 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);
13811382 }
13821383
13831384 template <class _A0, class _A1, class _A2>
13841385 _LIBCPP_INLINE_VISIBILITY
13851386 typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type
13861387 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);
13881389 }
13891390
13901391 template <class _A0, class _A1, class _A2>
13911392 _LIBCPP_INLINE_VISIBILITY
13921393 typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type
13931394 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);
13951396 }
13961397
13971398 template <class _A0, class _A1, class _A2>
13981399 _LIBCPP_INLINE_VISIBILITY
13991400 typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type
14001401 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);
14021403 }
14031404#endif
14041405};
14051406
14061407template<class _Rp, class _Tp>
1407inline _LIBCPP_INLINE_VISIBILITY
1408inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
14081409__mem_fn<_Rp _Tp::*>
14091410mem_fn(_Rp _Tp::* __pm) _NOEXCEPT
14101411{
......@@ -1596,7 +1597,7 @@ public:
15961597 const _Target& __target() const { return __f_; }
15971598
15981599 _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
16011602 _LIBCPP_INLINE_VISIBILITY
16021603 explicit __default_alloc_func(const _Target& __f) : __f_(__f) {}
......@@ -1612,7 +1613,7 @@ public:
16121613 __builtin_new_allocator::__holder_t __hold =
16131614 __builtin_new_allocator::__allocate_type<__default_alloc_func>(1);
16141615 __default_alloc_func* __res =
1615 ::new (__hold.get()) __default_alloc_func(__f_);
1616 ::new ((void*)__hold.get()) __default_alloc_func(__f_);
16161617 (void)__hold.release();
16171618 return __res;
16181619 }
......@@ -1703,7 +1704,7 @@ template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
17031704void
17041705__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone(__base<_Rp(_ArgTypes...)>* __p) const
17051706{
1706 ::new (__p) __func(__f_.__target(), __f_.__get_allocator());
1707 ::new ((void*)__p) __func(__f_.__target(), __f_.__get_allocator());
17071708}
17081709
17091710template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
......@@ -1739,7 +1740,7 @@ __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target(const type_info& __ti) const _NOE
17391740{
17401741 if (__ti == typeid(_Fp))
17411742 return &__f_.__target();
1742 return (const void*)0;
1743 return nullptr;
17431744}
17441745
17451746template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
......@@ -1769,11 +1770,11 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
17691770
17701771 public:
17711772 _LIBCPP_INLINE_VISIBILITY
1772 __value_func() _NOEXCEPT : __f_(0) {}
1773 __value_func() _NOEXCEPT : __f_(nullptr) {}
17731774
17741775 template <class _Fp, class _Alloc>
17751776 _LIBCPP_INLINE_VISIBILITY __value_func(_Fp&& __f, const _Alloc& __a)
1776 : __f_(0)
1777 : __f_(nullptr)
17771778 {
17781779 typedef allocator_traits<_Alloc> __alloc_traits;
17791780 typedef __function::__func<_Fp, _Alloc, _Rp(_ArgTypes...)> _Fun;
......@@ -1803,13 +1804,13 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
18031804 template <class _Fp,
18041805 class = typename enable_if<!is_same<typename decay<_Fp>::type, __value_func>::value>::type>
18051806 _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
18081809 _LIBCPP_INLINE_VISIBILITY
18091810 __value_func(const __value_func& __f)
18101811 {
1811 if (__f.__f_ == 0)
1812 __f_ = 0;
1812 if (__f.__f_ == nullptr)
1813 __f_ = nullptr;
18131814 else if ((void*)__f.__f_ == &__f.__buf_)
18141815 {
18151816 __f_ = __as_base(&__buf_);
......@@ -1822,8 +1823,8 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
18221823 _LIBCPP_INLINE_VISIBILITY
18231824 __value_func(__value_func&& __f) _NOEXCEPT
18241825 {
1825 if (__f.__f_ == 0)
1826 __f_ = 0;
1826 if (__f.__f_ == nullptr)
1827 __f_ = nullptr;
18271828 else if ((void*)__f.__f_ == &__f.__buf_)
18281829 {
18291830 __f_ = __as_base(&__buf_);
......@@ -1832,7 +1833,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
18321833 else
18331834 {
18341835 __f_ = __f.__f_;
1835 __f.__f_ = 0;
1836 __f.__f_ = nullptr;
18361837 }
18371838 }
18381839
......@@ -1849,8 +1850,8 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
18491850 __value_func& operator=(__value_func&& __f)
18501851 {
18511852 *this = nullptr;
1852 if (__f.__f_ == 0)
1853 __f_ = 0;
1853 if (__f.__f_ == nullptr)
1854 __f_ = nullptr;
18541855 else if ((void*)__f.__f_ == &__f.__buf_)
18551856 {
18561857 __f_ = __as_base(&__buf_);
......@@ -1859,7 +1860,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
18591860 else
18601861 {
18611862 __f_ = __f.__f_;
1862 __f.__f_ = 0;
1863 __f.__f_ = nullptr;
18631864 }
18641865 return *this;
18651866 }
......@@ -1868,7 +1869,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
18681869 __value_func& operator=(nullptr_t)
18691870 {
18701871 __func* __f = __f_;
1871 __f_ = 0;
1872 __f_ = nullptr;
18721873 if ((void*)__f == &__buf_)
18731874 __f->destroy();
18741875 else if (__f)
......@@ -1879,7 +1880,7 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
18791880 _LIBCPP_INLINE_VISIBILITY
18801881 _Rp operator()(_ArgTypes&&... __args) const
18811882 {
1882 if (__f_ == 0)
1883 if (__f_ == nullptr)
18831884 __throw_bad_function_call();
18841885 return (*__f_)(_VSTD::forward<_ArgTypes>(__args)...);
18851886 }
......@@ -1895,10 +1896,10 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
18951896 __func* __t = __as_base(&__tempbuf);
18961897 __f_->__clone(__t);
18971898 __f_->destroy();
1898 __f_ = 0;
1899 __f_ = nullptr;
18991900 __f.__f_->__clone(__as_base(&__buf_));
19001901 __f.__f_->destroy();
1901 __f.__f_ = 0;
1902 __f.__f_ = nullptr;
19021903 __f_ = __as_base(&__buf_);
19031904 __t->__clone(__as_base(&__f.__buf_));
19041905 __t->destroy();
......@@ -1923,13 +1924,13 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
19231924 }
19241925
19251926 _LIBCPP_INLINE_VISIBILITY
1926 _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT { return __f_ != 0; }
1927 _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT { return __f_ != nullptr; }
19271928
19281929#ifndef _LIBCPP_NO_RTTI
19291930 _LIBCPP_INLINE_VISIBILITY
19301931 const std::type_info& target_type() const _NOEXCEPT
19311932 {
1932 if (__f_ == 0)
1933 if (__f_ == nullptr)
19331934 return typeid(void);
19341935 return __f_->target_type();
19351936 }
......@@ -1937,8 +1938,8 @@ template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)>
19371938 template <typename _Tp>
19381939 _LIBCPP_INLINE_VISIBILITY const _Tp* target() const _NOEXCEPT
19391940 {
1940 if (__f_ == 0)
1941 return 0;
1941 if (__f_ == nullptr)
1942 return nullptr;
19421943 return (const _Tp*)__f_->target(typeid(_Tp));
19431944 }
19441945#endif // _LIBCPP_NO_RTTI
......@@ -2157,7 +2158,7 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
21572158 } else {
21582159 __builtin_new_allocator::__holder_t __hold =
21592160 __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));
21612162 (void)__hold.release();
21622163 }
21632164 }
......@@ -2257,6 +2258,9 @@ template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)>
22572258
22582259#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
22602264template<class _Rp1, class ..._ArgTypes1, class _Alloc, class _Rp, class ..._ArgTypes>
22612265class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
22622266 : public __base<_Rp(_ArgTypes...)>
......@@ -2267,14 +2271,14 @@ class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)>
22672271public:
22682272 _LIBCPP_INLINE_VISIBILITY
22692273 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))
22712275 { }
22722276
22732277 // [TODO] add && to save on a retain
22742278
22752279 _LIBCPP_INLINE_VISIBILITY
22762280 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))
22782282 { }
22792283
22802284 virtual __base<_Rp(_ArgTypes...)>* __clone() const {
......@@ -2286,12 +2290,12 @@ public:
22862290 }
22872291
22882292 virtual void __clone(__base<_Rp(_ArgTypes...)>* __p) const {
2289 ::new (__p) __func(__f_);
2293 ::new ((void*)__p) __func(__f_);
22902294 }
22912295
22922296 virtual void destroy() _NOEXCEPT {
22932297 if (__f_)
2294 Block_release(__f_);
2298 _Block_release(__f_);
22952299 __f_ = 0;
22962300 }
22972301
......@@ -2303,7 +2307,7 @@ public:
23032307 }
23042308
23052309 virtual _Rp operator()(_ArgTypes&& ... __arg) {
2306 return __invoke(__f_, _VSTD::forward<_ArgTypes>(__arg)...);
2310 return _VSTD::__invoke(__f_, _VSTD::forward<_ArgTypes>(__arg)...);
23072311 }
23082312
23092313#ifndef _LIBCPP_NO_RTTI
......@@ -2344,9 +2348,9 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
23442348 template <class _Fp>
23452349 struct __callable<_Fp, true>
23462350 {
2347 static const bool value = is_same<void, _Rp>::value ||
2348 is_convertible<typename __invoke_of<_Fp, _ArgTypes...>::type,
2349 _Rp>::value;
2351 static const bool value = is_void<_Rp>::value ||
2352 __is_core_convertible<typename __invoke_of<_Fp, _ArgTypes...>::type,
2353 _Rp>::value;
23502354 };
23512355 template <class _Fp>
23522356 struct __callable<_Fp, false>
......@@ -2518,7 +2522,7 @@ template<class _Rp, class ..._ArgTypes>
25182522function<_Rp(_ArgTypes...)>&
25192523function<_Rp(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT
25202524{
2521 __f_ = std::move(__f.__f_);
2525 __f_ = _VSTD::move(__f.__f_);
25222526 return *this;
25232527}
25242528
......@@ -2701,7 +2705,7 @@ typename _EnableIf
27012705__mu(_Ti& __ti, tuple<_Uj...>& __uj)
27022706{
27032707 typedef typename __make_tuple_indices<sizeof...(_Uj)>::type __indices;
2704 return __mu_expand(__ti, __uj, __indices());
2708 return _VSTD::__mu_expand(__ti, __uj, __indices());
27052709}
27062710
27072711template <bool IsPh, class _Ti, class _Uj>
......@@ -2873,13 +2877,13 @@ public:
28732877 !is_same<typename remove_reference<_Gp>::type,
28742878 __bind>::value
28752879 >::type>
2876 _LIBCPP_INLINE_VISIBILITY
2880 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
28772881 explicit __bind(_Gp&& __f, _BA&& ...__bound_args)
28782882 : __f_(_VSTD::forward<_Gp>(__f)),
28792883 __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}
28802884
28812885 template <class ..._Args>
2882 _LIBCPP_INLINE_VISIBILITY
2886 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
28832887 typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
28842888 operator()(_Args&& ...__args)
28852889 {
......@@ -2888,7 +2892,7 @@ public:
28882892 }
28892893
28902894 template <class ..._Args>
2891 _LIBCPP_INLINE_VISIBILITY
2895 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
28922896 typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type
28932897 operator()(_Args&& ...__args) const
28942898 {
......@@ -2918,13 +2922,13 @@ public:
29182922 !is_same<typename remove_reference<_Gp>::type,
29192923 __bind_r>::value
29202924 >::type>
2921 _LIBCPP_INLINE_VISIBILITY
2925 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
29222926 explicit __bind_r(_Gp&& __f, _BA&& ...__bound_args)
29232927 : base(_VSTD::forward<_Gp>(__f),
29242928 _VSTD::forward<_BA>(__bound_args)...) {}
29252929
29262930 template <class ..._Args>
2927 _LIBCPP_INLINE_VISIBILITY
2931 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
29282932 typename enable_if
29292933 <
29302934 is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type,
......@@ -2938,7 +2942,7 @@ public:
29382942 }
29392943
29402944 template <class ..._Args>
2941 _LIBCPP_INLINE_VISIBILITY
2945 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
29422946 typename enable_if
29432947 <
29442948 is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type,
......@@ -2956,7 +2960,7 @@ template<class _Rp, class _Fp, class ..._BoundArgs>
29562960struct __is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {};
29572961
29582962template<class _Fp, class ..._BoundArgs>
2959inline _LIBCPP_INLINE_VISIBILITY
2963inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
29602964__bind<_Fp, _BoundArgs...>
29612965bind(_Fp&& __f, _BoundArgs&&... __bound_args)
29622966{
......@@ -2965,7 +2969,7 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args)
29652969}
29662970
29672971template<class _Rp, class _Fp, class ..._BoundArgs>
2968inline _LIBCPP_INLINE_VISIBILITY
2972inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
29692973__bind_r<_Rp, _Fp, _BoundArgs...>
29702974bind(_Fp&& __f, _BoundArgs&&... __bound_args)
29712975{
......@@ -2978,7 +2982,7 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args)
29782982#if _LIBCPP_STD_VER > 14
29792983
29802984template <class _Fn, class ..._Args>
2981invoke_result_t<_Fn, _Args...>
2985_LIBCPP_CONSTEXPR_AFTER_CXX17 invoke_result_t<_Fn, _Args...>
29822986invoke(_Fn&& __f, _Args&&... __args)
29832987 noexcept(is_nothrow_invocable_v<_Fn, _Args...>)
29842988{
......@@ -2993,21 +2997,21 @@ public:
29932997 __not_fn_imp() = delete;
29942998
29952999 template <class ..._Args>
2996 _LIBCPP_INLINE_VISIBILITY
3000 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
29973001 auto operator()(_Args&& ...__args) &
29983002 noexcept(noexcept(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))
29993003 -> decltype( !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
30003004 { return !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...); }
30013005
30023006 template <class ..._Args>
3003 _LIBCPP_INLINE_VISIBILITY
3007 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
30043008 auto operator()(_Args&& ...__args) &&
30053009 noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))
30063010 -> decltype( !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
30073011 { return !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...); }
30083012
30093013 template <class ..._Args>
3010 _LIBCPP_INLINE_VISIBILITY
3014 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
30113015 auto operator()(_Args&& ...__args) const&
30123016 noexcept(noexcept(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))
30133017 -> decltype( !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
......@@ -3015,7 +3019,7 @@ public:
30153019
30163020
30173021 template <class ..._Args>
3018 _LIBCPP_INLINE_VISIBILITY
3022 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
30193023 auto operator()(_Args&& ...__args) const&&
30203024 noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))
30213025 -> decltype( !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
......@@ -3024,17 +3028,17 @@ public:
30243028private:
30253029 template <class _RawFunc,
30263030 class = enable_if_t<!is_same<decay_t<_RawFunc>, __not_fn_imp>::value>>
3027 _LIBCPP_INLINE_VISIBILITY
3031 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
30283032 explicit __not_fn_imp(_RawFunc&& __rf)
30293033 : __fd(_VSTD::forward<_RawFunc>(__rf)) {}
30303034
30313035 template <class _RawFunc>
3032 friend inline _LIBCPP_INLINE_VISIBILITY
3036 friend inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
30333037 __not_fn_imp<decay_t<_RawFunc>> not_fn(_RawFunc&&);
30343038};
30353039
30363040template <class _RawFunc>
3037inline _LIBCPP_INLINE_VISIBILITY
3041inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
30383042__not_fn_imp<decay_t<_RawFunc>> not_fn(_RawFunc&& __fn) {
30393043 return __not_fn_imp<decay_t<_RawFunc>>(_VSTD::forward<_RawFunc>(__fn));
30403044}
......@@ -3131,13 +3135,13 @@ __search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
31313135template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
31323136class _LIBCPP_TYPE_VIS default_searcher {
31333137public:
3134 _LIBCPP_INLINE_VISIBILITY
3138 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
31353139 default_searcher(_ForwardIterator __f, _ForwardIterator __l,
31363140 _BinaryPredicate __p = _BinaryPredicate())
31373141 : __first_(__f), __last_(__l), __pred_(__p) {}
31383142
31393143 template <typename _ForwardIterator2>
3140 _LIBCPP_INLINE_VISIBILITY
3144 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
31413145 pair<_ForwardIterator2, _ForwardIterator2>
31423146 operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const
31433147 {
lib/libcxx/include/future+49-199
......@@ -362,6 +362,7 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
362362*/
363363
364364#include <__config>
365#include <__availability>
365366#include <system_error>
366367#include <memory>
367368#include <chrono>
......@@ -624,18 +625,10 @@ protected:
624625public:
625626
626627 template <class _Arg>
627#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
628 void set_value(_Arg&& __arg);
629#else
630 void set_value(_Arg& __arg);
631#endif
628 void set_value(_Arg&& __arg);
632629
633630 template <class _Arg>
634#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
635 void set_value_at_thread_exit(_Arg&& __arg);
636#else
637 void set_value_at_thread_exit(_Arg& __arg);
638#endif
631 void set_value_at_thread_exit(_Arg&& __arg);
639632
640633 _Rp move();
641634 typename add_lvalue_reference<_Rp>::type copy();
......@@ -654,16 +647,12 @@ template <class _Rp>
654647template <class _Arg>
655648_LIBCPP_AVAILABILITY_FUTURE
656649void
657#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
658650__assoc_state<_Rp>::set_value(_Arg&& __arg)
659#else
660__assoc_state<_Rp>::set_value(_Arg& __arg)
661#endif
662651{
663652 unique_lock<mutex> __lk(this->__mut_);
664653 if (this->__has_value())
665654 __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));
667656 this->__state_ |= base::__constructed | base::ready;
668657 __cv_.notify_all();
669658}
......@@ -671,16 +660,12 @@ __assoc_state<_Rp>::set_value(_Arg& __arg)
671660template <class _Rp>
672661template <class _Arg>
673662void
674#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
675663__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
679664{
680665 unique_lock<mutex> __lk(this->__mut_);
681666 if (this->__has_value())
682667 __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));
684669 this->__state_ |= base::__constructed;
685670 __thread_local_data()->__make_ready_at_thread_exit(this);
686671}
......@@ -856,16 +841,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state
856841 _Fp __func_;
857842
858843public:
859#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
860844 _LIBCPP_INLINE_VISIBILITY
861845 explicit __deferred_assoc_state(_Fp&& __f);
862#endif
863846
864847 virtual void __execute();
865848};
866849
867#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
868
869850template <class _Rp, class _Fp>
870851inline
871852__deferred_assoc_state<_Rp, _Fp>::__deferred_assoc_state(_Fp&& __f)
......@@ -874,8 +855,6 @@ __deferred_assoc_state<_Rp, _Fp>::__deferred_assoc_state(_Fp&& __f)
874855 this->__set_deferred();
875856}
876857
877#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
878
879858template <class _Rp, class _Fp>
880859void
881860__deferred_assoc_state<_Rp, _Fp>::__execute()
......@@ -903,16 +882,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state<void, _Fp>
903882 _Fp __func_;
904883
905884public:
906#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
907885 _LIBCPP_INLINE_VISIBILITY
908886 explicit __deferred_assoc_state(_Fp&& __f);
909#endif
910887
911888 virtual void __execute();
912889};
913890
914#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
915
916891template <class _Fp>
917892inline
918893__deferred_assoc_state<void, _Fp>::__deferred_assoc_state(_Fp&& __f)
......@@ -921,8 +896,6 @@ __deferred_assoc_state<void, _Fp>::__deferred_assoc_state(_Fp&& __f)
921896 this->__set_deferred();
922897}
923898
924#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
925
926899template <class _Fp>
927900void
928901__deferred_assoc_state<void, _Fp>::__execute()
......@@ -952,16 +925,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state
952925
953926 virtual void __on_zero_shared() _NOEXCEPT;
954927public:
955#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
956928 _LIBCPP_INLINE_VISIBILITY
957929 explicit __async_assoc_state(_Fp&& __f);
958#endif
959930
960931 virtual void __execute();
961932};
962933
963#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
964
965934template <class _Rp, class _Fp>
966935inline
967936__async_assoc_state<_Rp, _Fp>::__async_assoc_state(_Fp&& __f)
......@@ -969,8 +938,6 @@ __async_assoc_state<_Rp, _Fp>::__async_assoc_state(_Fp&& __f)
969938{
970939}
971940
972#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
973
974941template <class _Rp, class _Fp>
975942void
976943__async_assoc_state<_Rp, _Fp>::__execute()
......@@ -1007,16 +974,12 @@ class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state<void, _Fp>
1007974
1008975 virtual void __on_zero_shared() _NOEXCEPT;
1009976public:
1010#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1011977 _LIBCPP_INLINE_VISIBILITY
1012978 explicit __async_assoc_state(_Fp&& __f);
1013#endif
1014979
1015980 virtual void __execute();
1016981};
1017982
1018#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1019
1020983template <class _Fp>
1021984inline
1022985__async_assoc_state<void, _Fp>::__async_assoc_state(_Fp&& __f)
......@@ -1024,8 +987,6 @@ __async_assoc_state<void, _Fp>::__async_assoc_state(_Fp&& __f)
1024987{
1025988}
1026989
1027#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1028
1029990template <class _Fp>
1030991void
1031992__async_assoc_state<void, _Fp>::__execute()
......@@ -1062,19 +1023,11 @@ template <class _Rp> class _LIBCPP_TEMPLATE_VIS future;
10621023
10631024template <class _Rp, class _Fp>
10641025_LIBCPP_INLINE_VISIBILITY future<_Rp>
1065#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
10661026__make_deferred_assoc_state(_Fp&& __f);
1067#else
1068__make_deferred_assoc_state(_Fp __f);
1069#endif
10701027
10711028template <class _Rp, class _Fp>
10721029_LIBCPP_INLINE_VISIBILITY future<_Rp>
1073#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
10741030__make_async_assoc_state(_Fp&& __f);
1075#else
1076__make_async_assoc_state(_Fp __f);
1077#endif
10781031
10791032template <class _Rp>
10801033class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future
......@@ -1086,22 +1039,14 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future
10861039 template <class> friend class promise;
10871040 template <class> friend class shared_future;
10881041
1089#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
10901042 template <class _R1, class _Fp>
10911043 friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);
10921044 template <class _R1, class _Fp>
10931045 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
11011047public:
11021048 _LIBCPP_INLINE_VISIBILITY
11031049 future() _NOEXCEPT : __state_(nullptr) {}
1104#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
11051050 _LIBCPP_INLINE_VISIBILITY
11061051 future(future&& __rhs) _NOEXCEPT
11071052 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
......@@ -1110,15 +1055,10 @@ public:
11101055 _LIBCPP_INLINE_VISIBILITY
11111056 future& operator=(future&& __rhs) _NOEXCEPT
11121057 {
1113 future(std::move(__rhs)).swap(*this);
1058 future(_VSTD::move(__rhs)).swap(*this);
11141059 return *this;
11151060 }
1116#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1117private:
1118 future(const future&);
1119 future& operator=(const future&);
1120public:
1121#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1061
11221062 ~future();
11231063 _LIBCPP_INLINE_VISIBILITY
11241064 shared_future<_Rp> share() _NOEXCEPT;
......@@ -1186,22 +1126,14 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future<_Rp&>
11861126 template <class> friend class promise;
11871127 template <class> friend class shared_future;
11881128
1189#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
11901129 template <class _R1, class _Fp>
11911130 friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);
11921131 template <class _R1, class _Fp>
11931132 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
12011134public:
12021135 _LIBCPP_INLINE_VISIBILITY
12031136 future() _NOEXCEPT : __state_(nullptr) {}
1204#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
12051137 _LIBCPP_INLINE_VISIBILITY
12061138 future(future&& __rhs) _NOEXCEPT
12071139 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
......@@ -1210,15 +1142,10 @@ public:
12101142 _LIBCPP_INLINE_VISIBILITY
12111143 future& operator=(future&& __rhs) _NOEXCEPT
12121144 {
1213 future(std::move(__rhs)).swap(*this);
1145 future(_VSTD::move(__rhs)).swap(*this);
12141146 return *this;
12151147 }
1216#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1217private:
1218 future(const future&);
1219 future& operator=(const future&);
1220public:
1221#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1148
12221149 ~future();
12231150 _LIBCPP_INLINE_VISIBILITY
12241151 shared_future<_Rp&> share() _NOEXCEPT;
......@@ -1281,22 +1208,14 @@ class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE future<void>
12811208 template <class> friend class promise;
12821209 template <class> friend class shared_future;
12831210
1284#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
12851211 template <class _R1, class _Fp>
12861212 friend future<_R1> __make_deferred_assoc_state(_Fp&& __f);
12871213 template <class _R1, class _Fp>
12881214 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
12961216public:
12971217 _LIBCPP_INLINE_VISIBILITY
12981218 future() _NOEXCEPT : __state_(nullptr) {}
1299#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
13001219 _LIBCPP_INLINE_VISIBILITY
13011220 future(future&& __rhs) _NOEXCEPT
13021221 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
......@@ -1305,15 +1224,10 @@ public:
13051224 _LIBCPP_INLINE_VISIBILITY
13061225 future& operator=(future&& __rhs) _NOEXCEPT
13071226 {
1308 future(std::move(__rhs)).swap(*this);
1227 future(_VSTD::move(__rhs)).swap(*this);
13091228 return *this;
13101229 }
1311#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1312private:
1313 future(const future&);
1314 future& operator=(const future&);
1315public:
1316#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1230
13171231 ~future();
13181232 _LIBCPP_INLINE_VISIBILITY
13191233 shared_future<void> share() _NOEXCEPT;
......@@ -1367,32 +1281,21 @@ public:
13671281 promise();
13681282 template <class _Alloc>
13691283 promise(allocator_arg_t, const _Alloc& __a);
1370#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
13711284 _LIBCPP_INLINE_VISIBILITY
13721285 promise(promise&& __rhs) _NOEXCEPT
13731286 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
13741287 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
13801288 ~promise();
13811289
13821290 // assignment
1383#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
13841291 _LIBCPP_INLINE_VISIBILITY
13851292 promise& operator=(promise&& __rhs) _NOEXCEPT
13861293 {
1387 promise(std::move(__rhs)).swap(*this);
1294 promise(_VSTD::move(__rhs)).swap(*this);
13881295 return *this;
13891296 }
13901297 promise& operator=(const promise& __rhs) = delete;
1391#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1392private:
1393 promise& operator=(const promise& __rhs);
1394public:
1395#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1298
13961299 _LIBCPP_INLINE_VISIBILITY
13971300 void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
13981301
......@@ -1401,16 +1304,12 @@ public:
14011304
14021305 // setting the result
14031306 void set_value(const _Rp& __r);
1404#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
14051307 void set_value(_Rp&& __r);
1406#endif
14071308 void set_exception(exception_ptr __p);
14081309
14091310 // setting the result with deferred notification
14101311 void set_value_at_thread_exit(const _Rp& __r);
1411#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
14121312 void set_value_at_thread_exit(_Rp&& __r);
1413#endif
14141313 void set_exception_at_thread_exit(exception_ptr __p);
14151314};
14161315
......@@ -1429,7 +1328,7 @@ promise<_Rp>::promise(allocator_arg_t, const _Alloc& __a0)
14291328 typedef __allocator_destructor<_A2> _D2;
14301329 _A2 __a(__a0);
14311330 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);
14331332 __state_ = _VSTD::addressof(*__hold.release());
14341333}
14351334
......@@ -1464,8 +1363,6 @@ promise<_Rp>::set_value(const _Rp& __r)
14641363 __state_->set_value(__r);
14651364}
14661365
1467#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1468
14691366template <class _Rp>
14701367void
14711368promise<_Rp>::set_value(_Rp&& __r)
......@@ -1475,8 +1372,6 @@ promise<_Rp>::set_value(_Rp&& __r)
14751372 __state_->set_value(_VSTD::move(__r));
14761373}
14771374
1478#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1479
14801375template <class _Rp>
14811376void
14821377promise<_Rp>::set_exception(exception_ptr __p)
......@@ -1496,8 +1391,6 @@ promise<_Rp>::set_value_at_thread_exit(const _Rp& __r)
14961391 __state_->set_value_at_thread_exit(__r);
14971392}
14981393
1499#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1500
15011394template <class _Rp>
15021395void
15031396promise<_Rp>::set_value_at_thread_exit(_Rp&& __r)
......@@ -1507,8 +1400,6 @@ promise<_Rp>::set_value_at_thread_exit(_Rp&& __r)
15071400 __state_->set_value_at_thread_exit(_VSTD::move(__r));
15081401}
15091402
1510#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1511
15121403template <class _Rp>
15131404void
15141405promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)
......@@ -1535,32 +1426,21 @@ public:
15351426 promise();
15361427 template <class _Allocator>
15371428 promise(allocator_arg_t, const _Allocator& __a);
1538#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
15391429 _LIBCPP_INLINE_VISIBILITY
15401430 promise(promise&& __rhs) _NOEXCEPT
15411431 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
15421432 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
15481433 ~promise();
15491434
15501435 // assignment
1551#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
15521436 _LIBCPP_INLINE_VISIBILITY
15531437 promise& operator=(promise&& __rhs) _NOEXCEPT
15541438 {
1555 promise(std::move(__rhs)).swap(*this);
1439 promise(_VSTD::move(__rhs)).swap(*this);
15561440 return *this;
15571441 }
15581442 promise& operator=(const promise& __rhs) = delete;
1559#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1560private:
1561 promise& operator=(const promise& __rhs);
1562public:
1563#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1443
15641444 _LIBCPP_INLINE_VISIBILITY
15651445 void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
15661446
......@@ -1591,7 +1471,7 @@ promise<_Rp&>::promise(allocator_arg_t, const _Alloc& __a0)
15911471 typedef __allocator_destructor<_A2> _D2;
15921472 _A2 __a(__a0);
15931473 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);
15951475 __state_ = _VSTD::addressof(*__hold.release());
15961476}
15971477
......@@ -1672,32 +1552,21 @@ public:
16721552 template <class _Allocator>
16731553 _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
16741554 promise(allocator_arg_t, const _Allocator& __a);
1675#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
16761555 _LIBCPP_INLINE_VISIBILITY
16771556 promise(promise&& __rhs) _NOEXCEPT
16781557 : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
16791558 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
16851559 ~promise();
16861560
16871561 // assignment
1688#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
16891562 _LIBCPP_INLINE_VISIBILITY
16901563 promise& operator=(promise&& __rhs) _NOEXCEPT
16911564 {
1692 promise(std::move(__rhs)).swap(*this);
1565 promise(_VSTD::move(__rhs)).swap(*this);
16931566 return *this;
16941567 }
16951568 promise& operator=(const promise& __rhs) = delete;
1696#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1697private:
1698 promise& operator=(const promise& __rhs);
1699public:
1700#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1569
17011570 _LIBCPP_INLINE_VISIBILITY
17021571 void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
17031572
......@@ -1721,7 +1590,7 @@ promise<void>::promise(allocator_arg_t, const _Alloc& __a0)
17211590 typedef __allocator_destructor<_A2> _D2;
17221591 _A2 __a(__a0);
17231592 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);
17251594 __state_ = _VSTD::addressof(*__hold.release());
17261595}
17271596
......@@ -1737,8 +1606,6 @@ template <class _Rp, class _Alloc>
17371606 struct _LIBCPP_TEMPLATE_VIS uses_allocator<promise<_Rp>, _Alloc>
17381607 : public true_type {};
17391608
1740#ifndef _LIBCPP_HAS_NO_VARIADICS
1741
17421609// packaged_task
17431610
17441611template<class _Fp> class __packaged_task_base;
......@@ -1788,7 +1655,7 @@ void
17881655__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__move_to(
17891656 __packaged_task_base<_Rp(_ArgTypes...)>* __p) _NOEXCEPT
17901657{
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()));
17921659}
17931660
17941661template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
......@@ -1814,7 +1681,7 @@ template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
18141681_Rp
18151682__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
18161683{
1817 return __invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...);
1684 return _VSTD::__invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...);
18181685}
18191686
18201687template <class _Callable> class __packaged_task_function;
......@@ -1823,6 +1690,10 @@ template<class _Rp, class ..._ArgTypes>
18231690class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_function<_Rp(_ArgTypes...)>
18241691{
18251692 typedef __packaged_task_base<_Rp(_ArgTypes...)> __base;
1693
1694 _LIBCPP_INLINE_VISIBILITY _LIBCPP_NO_CFI
1695 __base* __get_buf() { return (__base*)&__buf_; }
1696
18261697 typename aligned_storage<3*sizeof(void*)>::type __buf_;
18271698 __base* __f_;
18281699
......@@ -1856,10 +1727,10 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(__packaged
18561727{
18571728 if (__f.__f_ == nullptr)
18581729 __f_ = nullptr;
1859 else if (__f.__f_ == (__base*)&__f.__buf_)
1730 else if (__f.__f_ == __f.__get_buf())
18601731 {
1732 __f.__f_->__move_to(__get_buf());
18611733 __f_ = (__base*)&__buf_;
1862 __f.__f_->__move_to(__f_);
18631734 }
18641735 else
18651736 {
......@@ -1877,8 +1748,8 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(_Fp&& __f)
18771748 typedef __packaged_task_func<_FR, allocator<_FR>, _Rp(_ArgTypes...)> _FF;
18781749 if (sizeof(_FF) <= sizeof(__buf_))
18791750 {
1751 ::new ((void*)&__buf_) _FF(_VSTD::forward<_Fp>(__f));
18801752 __f_ = (__base*)&__buf_;
1881 ::new (__f_) _FF(_VSTD::forward<_Fp>(__f));
18821753 }
18831754 else
18841755 {
......@@ -1886,7 +1757,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(_Fp&& __f)
18861757 _Ap __a;
18871758 typedef __allocator_destructor<_Ap> _Dp;
18881759 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));
18901761 __f_ = __hold.release();
18911762 }
18921763}
......@@ -1902,7 +1773,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(
19021773 if (sizeof(_FF) <= sizeof(__buf_))
19031774 {
19041775 __f_ = (__base*)&__buf_;
1905 ::new (__f_) _FF(_VSTD::forward<_Fp>(__f));
1776 ::new ((void*)__f_) _FF(_VSTD::forward<_Fp>(__f));
19061777 }
19071778 else
19081779 {
......@@ -1910,7 +1781,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(
19101781 _Ap __a(__a0);
19111782 typedef __allocator_destructor<_Ap> _Dp;
19121783 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()))
19141785 _FF(_VSTD::forward<_Fp>(__f), _Alloc(__a));
19151786 __f_ = _VSTD::addressof(*__hold.release());
19161787 }
......@@ -1920,17 +1791,17 @@ template<class _Rp, class ..._ArgTypes>
19201791__packaged_task_function<_Rp(_ArgTypes...)>&
19211792__packaged_task_function<_Rp(_ArgTypes...)>::operator=(__packaged_task_function&& __f) _NOEXCEPT
19221793{
1923 if (__f_ == (__base*)&__buf_)
1794 if (__f_ == __get_buf())
19241795 __f_->destroy();
19251796 else if (__f_)
19261797 __f_->destroy_deallocate();
19271798 __f_ = nullptr;
19281799 if (__f.__f_ == nullptr)
19291800 __f_ = nullptr;
1930 else if (__f.__f_ == (__base*)&__f.__buf_)
1801 else if (__f.__f_ == __f.__get_buf())
19311802 {
1932 __f_ = (__base*)&__buf_;
1933 __f.__f_->__move_to(__f_);
1803 __f.__f_->__move_to(__get_buf());
1804 __f_ = __get_buf();
19341805 }
19351806 else
19361807 {
......@@ -1943,13 +1814,14 @@ __packaged_task_function<_Rp(_ArgTypes...)>::operator=(__packaged_task_function&
19431814template<class _Rp, class ..._ArgTypes>
19441815__packaged_task_function<_Rp(_ArgTypes...)>::~__packaged_task_function()
19451816{
1946 if (__f_ == (__base*)&__buf_)
1817 if (__f_ == __get_buf())
19471818 __f_->destroy();
19481819 else if (__f_)
19491820 __f_->destroy_deallocate();
19501821}
19511822
19521823template<class _Rp, class ..._ArgTypes>
1824_LIBCPP_NO_CFI
19531825void
19541826__packaged_task_function<_Rp(_ArgTypes...)>::swap(__packaged_task_function& __f) _NOEXCEPT
19551827{
......@@ -2268,11 +2140,7 @@ struct _LIBCPP_TEMPLATE_VIS uses_allocator<packaged_task<_Callable>, _Alloc>
22682140
22692141template <class _Rp, class _Fp>
22702142_LIBCPP_INLINE_VISIBILITY future<_Rp>
2271#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
22722143__make_deferred_assoc_state(_Fp&& __f)
2273#else
2274__make_deferred_assoc_state(_Fp __f)
2275#endif
22762144{
22772145 unique_ptr<__deferred_assoc_state<_Rp, _Fp>, __release_shared_count>
22782146 __h(new __deferred_assoc_state<_Rp, _Fp>(_VSTD::forward<_Fp>(__f)));
......@@ -2281,11 +2149,7 @@ __make_deferred_assoc_state(_Fp __f)
22812149
22822150template <class _Rp, class _Fp>
22832151_LIBCPP_INLINE_VISIBILITY future<_Rp>
2284#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
22852152__make_async_assoc_state(_Fp&& __f)
2286#else
2287__make_async_assoc_state(_Fp __f)
2288#endif
22892153{
22902154 unique_ptr<__async_assoc_state<_Rp, _Fp>, __release_shared_count>
22912155 __h(new __async_assoc_state<_Rp, _Fp>(_VSTD::forward<_Fp>(__f)));
......@@ -2293,6 +2157,8 @@ __make_async_assoc_state(_Fp __f)
22932157 return future<_Rp>(__h.get());
22942158}
22952159
2160#ifndef _LIBCPP_CXX03_LANG
2161
22962162template <class _Fp, class... _Args>
22972163class _LIBCPP_HIDDEN __async_func
22982164{
......@@ -2318,7 +2184,7 @@ private:
23182184 _Rp
23192185 __execute(__tuple_indices<_Indices...>)
23202186 {
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_))...);
23222188 }
23232189};
23242190
......@@ -2338,16 +2204,16 @@ async(launch __policy, _Fp&& __f, _Args&&... __args)
23382204 {
23392205#endif
23402206 if (__does_policy_contain(__policy, launch::async))
2341 return _VSTD::__make_async_assoc_state<_Rp>(_BF(__decay_copy(_VSTD::forward<_Fp>(__f)),
2342 __decay_copy(_VSTD::forward<_Args>(__args))...));
2207 return _VSTD::__make_async_assoc_state<_Rp>(_BF(_VSTD::__decay_copy(_VSTD::forward<_Fp>(__f)),
2208 _VSTD::__decay_copy(_VSTD::forward<_Args>(__args))...));
23432209#ifndef _LIBCPP_NO_EXCEPTIONS
23442210 }
23452211 catch ( ... ) { if (__policy == launch::async) throw ; }
23462212#endif
23472213
23482214 if (__does_policy_contain(__policy, launch::deferred))
2349 return _VSTD::__make_deferred_assoc_state<_Rp>(_BF(__decay_copy(_VSTD::forward<_Fp>(__f)),
2350 __decay_copy(_VSTD::forward<_Args>(__args))...));
2215 return _VSTD::__make_deferred_assoc_state<_Rp>(_BF(_VSTD::__decay_copy(_VSTD::forward<_Fp>(__f)),
2216 _VSTD::__decay_copy(_VSTD::forward<_Args>(__args))...));
23512217 return future<_Rp>{};
23522218}
23532219
......@@ -2360,7 +2226,7 @@ async(_Fp&& __f, _Args&&... __args)
23602226 _VSTD::forward<_Args>(__args)...);
23612227}
23622228
2363#endif // _LIBCPP_HAS_NO_VARIADICS
2229#endif // C++03
23642230
23652231// shared_future
23662232
......@@ -2375,24 +2241,20 @@ public:
23752241 _LIBCPP_INLINE_VISIBILITY
23762242 shared_future(const shared_future& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
23772243 {if (__state_) __state_->__add_shared();}
2378#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
23792244 _LIBCPP_INLINE_VISIBILITY
23802245 shared_future(future<_Rp>&& __f) _NOEXCEPT : __state_(__f.__state_)
23812246 {__f.__state_ = nullptr;}
23822247 _LIBCPP_INLINE_VISIBILITY
23832248 shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
23842249 {__rhs.__state_ = nullptr;}
2385#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
23862250 ~shared_future();
23872251 shared_future& operator=(const shared_future& __rhs) _NOEXCEPT;
2388#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
23892252 _LIBCPP_INLINE_VISIBILITY
23902253 shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
23912254 {
2392 shared_future(std::move(__rhs)).swap(*this);
2255 shared_future(_VSTD::move(__rhs)).swap(*this);
23932256 return *this;
23942257 }
2395#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
23962258
23972259 // retrieving the value
23982260 _LIBCPP_INLINE_VISIBILITY
......@@ -2449,24 +2311,20 @@ public:
24492311 _LIBCPP_INLINE_VISIBILITY
24502312 shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
24512313 {if (__state_) __state_->__add_shared();}
2452#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
24532314 _LIBCPP_INLINE_VISIBILITY
24542315 shared_future(future<_Rp&>&& __f) _NOEXCEPT : __state_(__f.__state_)
24552316 {__f.__state_ = nullptr;}
24562317 _LIBCPP_INLINE_VISIBILITY
24572318 shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
24582319 {__rhs.__state_ = nullptr;}
2459#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
24602320 ~shared_future();
24612321 shared_future& operator=(const shared_future& __rhs);
2462#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
24632322 _LIBCPP_INLINE_VISIBILITY
24642323 shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
24652324 {
2466 shared_future(std::move(__rhs)).swap(*this);
2325 shared_future(_VSTD::move(__rhs)).swap(*this);
24672326 return *this;
24682327 }
2469#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
24702328
24712329 // retrieving the value
24722330 _LIBCPP_INLINE_VISIBILITY
......@@ -2523,24 +2381,20 @@ public:
25232381 _LIBCPP_INLINE_VISIBILITY
25242382 shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
25252383 {if (__state_) __state_->__add_shared();}
2526#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
25272384 _LIBCPP_INLINE_VISIBILITY
25282385 shared_future(future<void>&& __f) _NOEXCEPT : __state_(__f.__state_)
25292386 {__f.__state_ = nullptr;}
25302387 _LIBCPP_INLINE_VISIBILITY
25312388 shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
25322389 {__rhs.__state_ = nullptr;}
2533#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
25342390 ~shared_future();
25352391 shared_future& operator=(const shared_future& __rhs);
2536#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
25372392 _LIBCPP_INLINE_VISIBILITY
25382393 shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
25392394 {
2540 shared_future(std::move(__rhs)).swap(*this);
2395 shared_future(_VSTD::move(__rhs)).swap(*this);
25412396 return *this;
25422397 }
2543#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
25442398
25452399 // retrieving the value
25462400 _LIBCPP_INLINE_VISIBILITY
......@@ -2591,8 +2445,6 @@ future<_Rp&>::share() _NOEXCEPT
25912445 return shared_future<_Rp&>(_VSTD::move(*this));
25922446}
25932447
2594#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2595
25962448inline
25972449shared_future<void>
25982450future<void>::share() _NOEXCEPT
......@@ -2600,8 +2452,6 @@ future<void>::share() _NOEXCEPT
26002452 return shared_future<void>(_VSTD::move(*this));
26012453}
26022454
2603#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2604
26052455_LIBCPP_END_NAMESPACE_STD
26062456
26072457#endif // !_LIBCPP_HAS_NO_THREADS
lib/libcxx/include/iomanip+2-2
......@@ -514,7 +514,7 @@ put_time(const tm* __tm, const _CharT* __fmt)
514514}
515515
516516template <class _CharT, class _Traits, class _ForwardIterator>
517std::basic_ostream<_CharT, _Traits> &
517basic_ostream<_CharT, _Traits> &
518518__quoted_output ( basic_ostream<_CharT, _Traits> &__os,
519519 _ForwardIterator __first, _ForwardIterator __last, _CharT __delim, _CharT __escape )
520520{
......@@ -527,7 +527,7 @@ __quoted_output ( basic_ostream<_CharT, _Traits> &__os,
527527 __str.push_back(*__first);
528528 }
529529 __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());
531531}
532532
533533template <class _CharT, class _Traits, class _String>
lib/libcxx/include/ios+2-29
......@@ -710,7 +710,7 @@ void
710710basic_ios<_CharT, _Traits>::init(basic_streambuf<char_type, traits_type>* __sb)
711711{
712712 ios_base::init(__sb);
713 __tie_ = 0;
713 __tie_ = nullptr;
714714 __fill_ = traits_type::eof();
715715}
716716
......@@ -821,7 +821,7 @@ basic_ios<_CharT, _Traits>::move(basic_ios& __rhs)
821821{
822822 ios_base::move(__rhs);
823823 __tie_ = __rhs.__tie_;
824 __rhs.__tie_ = 0;
824 __rhs.__tie_ = nullptr;
825825 __fill_ = __rhs.__fill_;
826826}
827827
......@@ -1035,33 +1035,6 @@ defaultfloat(ios_base& __str)
10351035 return __str;
10361036}
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
10651038_LIBCPP_END_NAMESPACE_STD
10661039
10671040#endif // _LIBCPP_IOS
lib/libcxx/include/iosfwd+59
......@@ -185,6 +185,36 @@ typedef basic_ifstream<wchar_t> wifstream;
185185typedef basic_ofstream<wchar_t> wofstream;
186186typedef 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
188218template <class _State> class _LIBCPP_TEMPLATE_VIS fpos;
189219typedef fpos<mbstate_t> streampos;
190220typedef fpos<mbstate_t> wstreampos;
......@@ -210,11 +240,40 @@ template <class _CharT, // for <stdexcept>
210240typedef basic_string<char, char_traits<char>, allocator<char> > string;
211241typedef 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
214246// Include other forward declarations here
215247template <class _Tp, class _Alloc = allocator<_Tp> >
216248class _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
218277_LIBCPP_END_NAMESPACE_STD
219278
220279#endif // _LIBCPP_IOSFWD
lib/libcxx/include/istream+21-13
......@@ -150,9 +150,9 @@ template <class charT, class traits>
150150 basic_istream<charT,traits>&
151151 ws(basic_istream<charT,traits>& is);
152152
153template <class charT, class traits, class T>
154 basic_istream<charT, traits>&
155 operator>>(basic_istream<charT, traits>&& is, T& x);
153// rvalue stream extraction
154template <class Stream, class T>
155 Stream&& operator>>(Stream&& is, T&& x);
156156
157157} // std
158158
......@@ -1142,7 +1142,7 @@ basic_istream<_CharT, _Traits>::putback(char_type __c)
11421142 try
11431143 {
11441144#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())
11461146 __state |= ios_base::badbit;
11471147#ifndef _LIBCPP_NO_EXCEPTIONS
11481148 }
......@@ -1179,7 +1179,7 @@ basic_istream<_CharT, _Traits>::unget()
11791179 try
11801180 {
11811181#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())
11831183 __state |= ios_base::badbit;
11841184#ifndef _LIBCPP_NO_EXCEPTIONS
11851185 }
......@@ -1215,7 +1215,7 @@ basic_istream<_CharT, _Traits>::sync()
12151215 try
12161216 {
12171217#endif // _LIBCPP_NO_EXCEPTIONS
1218 if (this->rdbuf() == 0)
1218 if (this->rdbuf() == nullptr)
12191219 return -1;
12201220 if (this->rdbuf()->pubsync() == -1)
12211221 {
......@@ -1378,13 +1378,23 @@ ws(basic_istream<_CharT, _Traits>& __is)
13781378
13791379#ifndef _LIBCPP_CXX03_LANG
13801380
1381template <class _CharT, class _Traits, class _Tp>
1382inline _LIBCPP_INLINE_VISIBILITY
1383basic_istream<_CharT, _Traits>&
1384operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp&& __x)
1381template <class _Stream, class _Tp, class = void>
1382struct __is_istreamable : false_type { };
1383
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)
13851395{
13861396 __is >> _VSTD::forward<_Tp>(__x);
1387 return __is;
1397 return _VSTD::move(__is);
13881398}
13891399
13901400#endif // _LIBCPP_CXX03_LANG
......@@ -1638,11 +1648,9 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
16381648 return __is;
16391649}
16401650
1641#ifndef _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
16421651_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>)
16431652_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>)
16441653_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>)
1645#endif
16461654
16471655_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;
420420#include <type_traits>
421421#include <cstddef>
422422#include <initializer_list>
423#include <__memory/base.h>
423424#include <version>
424#ifdef __APPLE__
425#include <Availability.h>
426#endif
427425
428426#include <__debug>
429427
......@@ -498,12 +496,11 @@ struct __has_iterator_typedefs
498496private:
499497 struct __two {char __lx; char __lxx;};
500498 template <class _Up> static __two __test(...);
501 template <class _Up> static char __test(typename std::__void_t<typename _Up::iterator_category>::type* = 0,
502 typename std::__void_t<typename _Up::difference_type>::type* = 0,
503 typename std::__void_t<typename _Up::value_type>::type* = 0,
504 typename std::__void_t<typename _Up::reference>::type* = 0,
505 typename std::__void_t<typename _Up::pointer>::type* = 0
506 );
499 template <class _Up> static char __test(typename __void_t<typename _Up::iterator_category>::type* = 0,
500 typename __void_t<typename _Up::difference_type>::type* = 0,
501 typename __void_t<typename _Up::value_type>::type* = 0,
502 typename __void_t<typename _Up::reference>::type* = 0,
503 typename __void_t<typename _Up::pointer>::type* = 0);
507504public:
508505 static const bool value = sizeof(__test<_Tp>(0,0,0,0,0)) == 1;
509506};
......@@ -515,9 +512,9 @@ struct __has_iterator_category
515512private:
516513 struct __two {char __lx; char __lxx;};
517514 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);
519516public:
520 static const bool value = sizeof(__test<_Tp>(0)) == 1;
517 static const bool value = sizeof(__test<_Tp>(nullptr)) == 1;
521518};
522519
523520template <class _Iter, bool> struct __iterator_traits_impl {};
......@@ -667,9 +664,9 @@ void advance(_InputIter& __i, _Distance __orig_n)
667664{
668665 _LIBCPP_ASSERT(__orig_n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,
669666 "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;
671668 _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());
673670}
674671
675672template <class _InputIter>
......@@ -696,7 +693,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
696693typename iterator_traits<_InputIter>::difference_type
697694distance(_InputIter __first, _InputIter __last)
698695{
699 return __distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());
696 return _VSTD::__distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());
700697}
701698
702699template <class _InputIter>
......@@ -998,11 +995,11 @@ private:
998995 istream_type* __in_stream_;
999996 _Tp __value_;
1000997public:
1001 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(0), __value_() {}
998 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(nullptr), __value_() {}
1002999 _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(_VSTD::addressof(__s))
10031000 {
10041001 if (!(*__in_stream_ >> __value_))
1005 __in_stream_ = 0;
1002 __in_stream_ = nullptr;
10061003 }
10071004
10081005 _LIBCPP_INLINE_VISIBILITY const _Tp& operator*() const {return __value_;}
......@@ -1010,7 +1007,7 @@ public:
10101007 _LIBCPP_INLINE_VISIBILITY istream_iterator& operator++()
10111008 {
10121009 if (!(*__in_stream_ >> __value_))
1013 __in_stream_ = 0;
1010 __in_stream_ = nullptr;
10141011 return *this;
10151012 }
10161013 _LIBCPP_INLINE_VISIBILITY istream_iterator operator++(int)
......@@ -1052,15 +1049,25 @@ class _LIBCPP_TEMPLATE_VIS ostream_iterator
10521049 : public iterator<output_iterator_tag, void, void, void, void>
10531050{
10541051public:
1055 typedef _CharT char_type;
1056 typedef _Traits traits_type;
1057 typedef basic_ostream<_CharT,_Traits> ostream_type;
1052 typedef output_iterator_tag iterator_category;
1053 typedef void value_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
10581065private:
10591066 ostream_type* __out_stream_;
10601067 const char_type* __delim_;
10611068public:
10621069 _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) {}
10641071 _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter) _NOEXCEPT
10651072 : __out_stream_(_VSTD::addressof(__s)), __delim_(__delimiter) {}
10661073 _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator=(const _Tp& __value_)
......@@ -1106,11 +1113,11 @@ private:
11061113 bool __test_for_eof() const
11071114 {
11081115 if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof()))
1109 __sbuf_ = 0;
1110 return __sbuf_ == 0;
1116 __sbuf_ = nullptr;
1117 return __sbuf_ == nullptr;
11111118 }
11121119public:
1113 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {}
1120 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(nullptr) {}
11141121 _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT
11151122 : __sbuf_(__s.rdbuf()) {}
11161123 _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT
......@@ -1151,10 +1158,20 @@ class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator
11511158 : public iterator<output_iterator_tag, void, void, void, void>
11521159{
11531160public:
1154 typedef _CharT char_type;
1155 typedef _Traits traits_type;
1156 typedef basic_streambuf<_CharT,_Traits> streambuf_type;
1157 typedef basic_ostream<_CharT,_Traits> ostream_type;
1161 typedef output_iterator_tag iterator_category;
1162 typedef void value_type;
1163#if _LIBCPP_STD_VER > 17
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
11581175private:
11591176 streambuf_type* __sbuf_;
11601177public:
......@@ -1165,13 +1182,13 @@ public:
11651182 _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator=(_CharT __c)
11661183 {
11671184 if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sputc(__c), traits_type::eof()))
1168 __sbuf_ = 0;
1185 __sbuf_ = nullptr;
11691186 return *this;
11701187 }
11711188 _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator*() {return *this;}
11721189 _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++() {return *this;}
11731190 _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
11761193 template <class _Ch, class _Tr>
11771194 friend
......@@ -1373,13 +1390,13 @@ operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOE
13731390
13741391template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 copy(_Ip, _Ip, _Op);
13751392template <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);
1377template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY move_backward(_B1, _B1, _B2);
1393template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 move(_Ip, _Ip, _Op);
1394template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 move_backward(_B1, _B1, _B2);
13781395
13791396#if _LIBCPP_DEBUG_LEVEL < 2
13801397
13811398template <class _Tp>
1382_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
1399_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
13831400typename enable_if
13841401<
13851402 is_trivially_copy_assignable<_Tp>::value,
......@@ -1390,7 +1407,7 @@ __unwrap_iter(__wrap_iter<_Tp*>);
13901407#else
13911408
13921409template <class _Tp>
1393inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
1410inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
13941411typename enable_if
13951412<
13961413 is_trivially_copy_assignable<_Tp>::value,
......@@ -1418,20 +1435,20 @@ public:
14181435 : __i{}
14191436#endif
14201437 {
1421#if _LIBCPP_DEBUG_LEVEL >= 2
1438#if _LIBCPP_DEBUG_LEVEL == 2
14221439 __get_db()->__insert_i(this);
14231440#endif
14241441 }
14251442 template <class _Up> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
14261443 __wrap_iter(const __wrap_iter<_Up>& __u,
1427 typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT
1444 typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = nullptr) _NOEXCEPT
14281445 : __i(__u.base())
14291446 {
1430#if _LIBCPP_DEBUG_LEVEL >= 2
1447#if _LIBCPP_DEBUG_LEVEL == 2
14311448 __get_db()->__iterator_copy(this, &__u);
14321449#endif
14331450 }
1434#if _LIBCPP_DEBUG_LEVEL >= 2
1451#if _LIBCPP_DEBUG_LEVEL == 2
14351452 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
14361453 __wrap_iter(const __wrap_iter& __x)
14371454 : __i(__x.base())
......@@ -1456,7 +1473,7 @@ public:
14561473#endif
14571474 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator*() const _NOEXCEPT
14581475 {
1459#if _LIBCPP_DEBUG_LEVEL >= 2
1476#if _LIBCPP_DEBUG_LEVEL == 2
14601477 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
14611478 "Attempted to dereference a non-dereferenceable iterator");
14621479#endif
......@@ -1464,7 +1481,7 @@ public:
14641481 }
14651482 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG pointer operator->() const _NOEXCEPT
14661483 {
1467#if _LIBCPP_DEBUG_LEVEL >= 2
1484#if _LIBCPP_DEBUG_LEVEL == 2
14681485 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
14691486 "Attempted to dereference a non-dereferenceable iterator");
14701487#endif
......@@ -1472,7 +1489,7 @@ public:
14721489 }
14731490 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator++() _NOEXCEPT
14741491 {
1475#if _LIBCPP_DEBUG_LEVEL >= 2
1492#if _LIBCPP_DEBUG_LEVEL == 2
14761493 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
14771494 "Attempted to increment non-incrementable iterator");
14781495#endif
......@@ -1484,7 +1501,7 @@ public:
14841501
14851502 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator--() _NOEXCEPT
14861503 {
1487#if _LIBCPP_DEBUG_LEVEL >= 2
1504#if _LIBCPP_DEBUG_LEVEL == 2
14881505 _LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
14891506 "Attempted to decrement non-decrementable iterator");
14901507#endif
......@@ -1497,7 +1514,7 @@ public:
14971514 {__wrap_iter __w(*this); __w += __n; return __w;}
14981515 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator+=(difference_type __n) _NOEXCEPT
14991516 {
1500#if _LIBCPP_DEBUG_LEVEL >= 2
1517#if _LIBCPP_DEBUG_LEVEL == 2
15011518 _LIBCPP_ASSERT(__get_const_db()->__addable(this, __n),
15021519 "Attempted to add/subtract iterator outside of valid range");
15031520#endif
......@@ -1510,7 +1527,7 @@ public:
15101527 {*this += -__n; return *this;}
15111528 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator[](difference_type __n) const _NOEXCEPT
15121529 {
1513#if _LIBCPP_DEBUG_LEVEL >= 2
1530#if _LIBCPP_DEBUG_LEVEL == 2
15141531 _LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n),
15151532 "Attempted to subscript iterator outside of valid range");
15161533#endif
......@@ -1520,7 +1537,7 @@ public:
15201537 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG iterator_type base() const _NOEXCEPT {return __i;}
15211538
15221539private:
1523#if _LIBCPP_DEBUG_LEVEL >= 2
1540#if _LIBCPP_DEBUG_LEVEL == 2
15241541 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter(const void* __p, iterator_type __x) : __i(__x)
15251542 {
15261543 __get_db()->__insert_ic(this, __p);
......@@ -1584,12 +1601,12 @@ private:
15841601
15851602 template <class _Ip, class _Op> friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _Op copy(_Ip, _Ip, _Op);
15861603 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);
1588 template <class _B1, class _B2> friend _B2 move_backward(_B1, _B1, _B2);
1604 template <class _Ip, class _Op> friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _Op move(_Ip, _Ip, _Op);
1605 template <class _B1, class _B2> friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _B2 move_backward(_B1, _B1, _B2);
15891606
15901607#if _LIBCPP_DEBUG_LEVEL < 2
15911608 template <class _Tp>
1592 _LIBCPP_CONSTEXPR_IF_NODEBUG friend
1609 _LIBCPP_CONSTEXPR friend
15931610 typename enable_if
15941611 <
15951612 is_trivially_copy_assignable<_Tp>::value,
......@@ -1598,7 +1615,7 @@ private:
15981615 __unwrap_iter(__wrap_iter<_Tp*>);
15991616#else
16001617 template <class _Tp>
1601 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
1618 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR friend
16021619 typename enable_if
16031620 <
16041621 is_trivially_copy_assignable<_Tp>::value,
......@@ -1621,7 +1638,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
16211638bool
16221639operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
16231640{
1624#if _LIBCPP_DEBUG_LEVEL >= 2
1641#if _LIBCPP_DEBUG_LEVEL == 2
16251642 _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
16261643 "Attempted to compare incomparable iterators");
16271644#endif
......@@ -1699,7 +1716,7 @@ auto
16991716operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
17001717-> decltype(__x.base() - __y.base())
17011718{
1702#if _LIBCPP_DEBUG_LEVEL >= 2
1719#if _LIBCPP_DEBUG_LEVEL == 2
17031720 _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
17041721 "Attempted to subtract incompatible iterators");
17051722#endif
......@@ -1711,7 +1728,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG
17111728typename __wrap_iter<_Iter1>::difference_type
17121729operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
17131730{
1714#if _LIBCPP_DEBUG_LEVEL >= 2
1731#if _LIBCPP_DEBUG_LEVEL == 2
17151732 _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
17161733 "Attempted to subtract incompatible iterators");
17171734#endif
lib/libcxx/include/latch+8
......@@ -19,6 +19,8 @@ namespace std
1919 class latch
2020 {
2121 public:
22 static constexpr ptrdiff_t max() noexcept;
23
2224 constexpr explicit latch(ptrdiff_t __expected);
2325 ~latch();
2426
......@@ -39,6 +41,7 @@ namespace std
3941*/
4042
4143#include <__config>
44#include <__availability>
4245#include <atomic>
4346
4447#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
......@@ -49,6 +52,9 @@ namespace std
4952# error <latch> is not supported on this single threaded system
5053#endif
5154
55_LIBCPP_PUSH_MACROS
56#include <__undef_macros>
57
5258#if _LIBCPP_STD_VER >= 14
5359
5460_LIBCPP_BEGIN_NAMESPACE_STD
......@@ -101,4 +107,6 @@ _LIBCPP_END_NAMESPACE_STD
101107
102108#endif // _LIBCPP_STD_VER >= 14
103109
110_LIBCPP_POP_MACROS
111
104112#endif //_LIBCPP_LATCH
lib/libcxx/include/limits+2-2
......@@ -105,11 +105,11 @@ template<> class numeric_limits<cv long double>;
105105#include <type_traits>
106106
107107#if defined(_LIBCPP_COMPILER_MSVC)
108#include "support/win32/limits_msvc_win32.h"
108#include "__support/win32/limits_msvc_win32.h"
109109#endif // _LIBCPP_MSVCRT
110110
111111#if defined(__IBMCPP__)
112#include "support/ibm/limits.h"
112#include "__support/ibm/limits.h"
113113#endif // __IBMCPP__
114114
115115#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
lib/libcxx/include/list+93-93
......@@ -293,7 +293,7 @@ class _LIBCPP_TEMPLATE_VIS __list_iterator
293293
294294 __link_pointer __ptr_;
295295
296#if _LIBCPP_DEBUG_LEVEL >= 2
296#if _LIBCPP_DEBUG_LEVEL == 2
297297 _LIBCPP_INLINE_VISIBILITY
298298 explicit __list_iterator(__link_pointer __p, const void* __c) _NOEXCEPT
299299 : __ptr_(__p)
......@@ -320,12 +320,12 @@ public:
320320 _LIBCPP_INLINE_VISIBILITY
321321 __list_iterator() _NOEXCEPT : __ptr_(nullptr)
322322 {
323#if _LIBCPP_DEBUG_LEVEL >= 2
323#if _LIBCPP_DEBUG_LEVEL == 2
324324 __get_db()->__insert_i(this);
325325#endif
326326 }
327327
328#if _LIBCPP_DEBUG_LEVEL >= 2
328#if _LIBCPP_DEBUG_LEVEL == 2
329329
330330 _LIBCPP_INLINE_VISIBILITY
331331 __list_iterator(const __list_iterator& __p)
......@@ -351,12 +351,12 @@ public:
351351 return *this;
352352 }
353353
354#endif // _LIBCPP_DEBUG_LEVEL >= 2
354#endif // _LIBCPP_DEBUG_LEVEL == 2
355355
356356 _LIBCPP_INLINE_VISIBILITY
357357 reference operator*() const
358358 {
359#if _LIBCPP_DEBUG_LEVEL >= 2
359#if _LIBCPP_DEBUG_LEVEL == 2
360360 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
361361 "Attempted to dereference a non-dereferenceable list::iterator");
362362#endif
......@@ -365,7 +365,7 @@ public:
365365 _LIBCPP_INLINE_VISIBILITY
366366 pointer operator->() const
367367 {
368#if _LIBCPP_DEBUG_LEVEL >= 2
368#if _LIBCPP_DEBUG_LEVEL == 2
369369 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
370370 "Attempted to dereference a non-dereferenceable list::iterator");
371371#endif
......@@ -375,7 +375,7 @@ public:
375375 _LIBCPP_INLINE_VISIBILITY
376376 __list_iterator& operator++()
377377 {
378#if _LIBCPP_DEBUG_LEVEL >= 2
378#if _LIBCPP_DEBUG_LEVEL == 2
379379 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
380380 "Attempted to increment non-incrementable list::iterator");
381381#endif
......@@ -388,7 +388,7 @@ public:
388388 _LIBCPP_INLINE_VISIBILITY
389389 __list_iterator& operator--()
390390 {
391#if _LIBCPP_DEBUG_LEVEL >= 2
391#if _LIBCPP_DEBUG_LEVEL == 2
392392 _LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
393393 "Attempted to decrement non-decrementable list::iterator");
394394#endif
......@@ -416,7 +416,7 @@ class _LIBCPP_TEMPLATE_VIS __list_const_iterator
416416
417417 __link_pointer __ptr_;
418418
419#if _LIBCPP_DEBUG_LEVEL >= 2
419#if _LIBCPP_DEBUG_LEVEL == 2
420420 _LIBCPP_INLINE_VISIBILITY
421421 explicit __list_const_iterator(__link_pointer __p, const void* __c) _NOEXCEPT
422422 : __ptr_(__p)
......@@ -440,7 +440,7 @@ public:
440440 _LIBCPP_INLINE_VISIBILITY
441441 __list_const_iterator() _NOEXCEPT : __ptr_(nullptr)
442442 {
443#if _LIBCPP_DEBUG_LEVEL >= 2
443#if _LIBCPP_DEBUG_LEVEL == 2
444444 __get_db()->__insert_i(this);
445445#endif
446446 }
......@@ -448,12 +448,12 @@ public:
448448 __list_const_iterator(const __list_iterator<_Tp, _VoidPtr>& __p) _NOEXCEPT
449449 : __ptr_(__p.__ptr_)
450450 {
451#if _LIBCPP_DEBUG_LEVEL >= 2
451#if _LIBCPP_DEBUG_LEVEL == 2
452452 __get_db()->__iterator_copy(this, &__p);
453453#endif
454454 }
455455
456#if _LIBCPP_DEBUG_LEVEL >= 2
456#if _LIBCPP_DEBUG_LEVEL == 2
457457
458458 _LIBCPP_INLINE_VISIBILITY
459459 __list_const_iterator(const __list_const_iterator& __p)
......@@ -479,11 +479,11 @@ public:
479479 return *this;
480480 }
481481
482#endif // _LIBCPP_DEBUG_LEVEL >= 2
482#endif // _LIBCPP_DEBUG_LEVEL == 2
483483 _LIBCPP_INLINE_VISIBILITY
484484 reference operator*() const
485485 {
486#if _LIBCPP_DEBUG_LEVEL >= 2
486#if _LIBCPP_DEBUG_LEVEL == 2
487487 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
488488 "Attempted to dereference a non-dereferenceable list::const_iterator");
489489#endif
......@@ -492,7 +492,7 @@ public:
492492 _LIBCPP_INLINE_VISIBILITY
493493 pointer operator->() const
494494 {
495#if _LIBCPP_DEBUG_LEVEL >= 2
495#if _LIBCPP_DEBUG_LEVEL == 2
496496 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
497497 "Attempted to dereference a non-dereferenceable list::const_iterator");
498498#endif
......@@ -502,7 +502,7 @@ public:
502502 _LIBCPP_INLINE_VISIBILITY
503503 __list_const_iterator& operator++()
504504 {
505#if _LIBCPP_DEBUG_LEVEL >= 2
505#if _LIBCPP_DEBUG_LEVEL == 2
506506 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
507507 "Attempted to increment non-incrementable list::const_iterator");
508508#endif
......@@ -515,7 +515,7 @@ public:
515515 _LIBCPP_INLINE_VISIBILITY
516516 __list_const_iterator& operator--()
517517 {
518#if _LIBCPP_DEBUG_LEVEL >= 2
518#if _LIBCPP_DEBUG_LEVEL == 2
519519 _LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
520520 "Attempted to decrement non-decrementable list::const_iterator");
521521#endif
......@@ -614,7 +614,7 @@ protected:
614614 _LIBCPP_INLINE_VISIBILITY
615615 iterator begin() _NOEXCEPT
616616 {
617#if _LIBCPP_DEBUG_LEVEL >= 2
617#if _LIBCPP_DEBUG_LEVEL == 2
618618 return iterator(__end_.__next_, this);
619619#else
620620 return iterator(__end_.__next_);
......@@ -623,7 +623,7 @@ protected:
623623 _LIBCPP_INLINE_VISIBILITY
624624 const_iterator begin() const _NOEXCEPT
625625 {
626#if _LIBCPP_DEBUG_LEVEL >= 2
626#if _LIBCPP_DEBUG_LEVEL == 2
627627 return const_iterator(__end_.__next_, this);
628628#else
629629 return const_iterator(__end_.__next_);
......@@ -632,7 +632,7 @@ protected:
632632 _LIBCPP_INLINE_VISIBILITY
633633 iterator end() _NOEXCEPT
634634 {
635#if _LIBCPP_DEBUG_LEVEL >= 2
635#if _LIBCPP_DEBUG_LEVEL == 2
636636 return iterator(__end_as_link(), this);
637637#else
638638 return iterator(__end_as_link());
......@@ -641,7 +641,7 @@ protected:
641641 _LIBCPP_INLINE_VISIBILITY
642642 const_iterator end() const _NOEXCEPT
643643 {
644#if _LIBCPP_DEBUG_LEVEL >= 2
644#if _LIBCPP_DEBUG_LEVEL == 2
645645 return const_iterator(__end_as_link(), this);
646646#else
647647 return const_iterator(__end_as_link());
......@@ -696,7 +696,7 @@ private:
696696
697697 _LIBCPP_INLINE_VISIBILITY
698698 void __invalidate_all_iterators() {
699#if _LIBCPP_DEBUG_LEVEL >= 2
699#if _LIBCPP_DEBUG_LEVEL == 2
700700 __get_db()->__invalidate_all(this);
701701#endif
702702 }
......@@ -735,13 +735,13 @@ inline __list_imp<_Tp, _Alloc>::__list_imp(const __node_allocator& __a)
735735#ifndef _LIBCPP_CXX03_LANG
736736template <class _Tp, class _Alloc>
737737inline __list_imp<_Tp, _Alloc>::__list_imp(__node_allocator&& __a) _NOEXCEPT
738 : __size_alloc_(0, std::move(__a)) {}
738 : __size_alloc_(0, _VSTD::move(__a)) {}
739739#endif
740740
741741template <class _Tp, class _Alloc>
742742__list_imp<_Tp, _Alloc>::~__list_imp() {
743743 clear();
744#if _LIBCPP_DEBUG_LEVEL >= 2
744#if _LIBCPP_DEBUG_LEVEL == 2
745745 __get_db()->__erase_c(this);
746746#endif
747747}
......@@ -783,7 +783,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
783783 "list::swap: Either propagate_on_container_swap must be true"
784784 " or the allocators must compare equal");
785785 using _VSTD::swap;
786 __swap_allocator(__node_alloc(), __c.__node_alloc());
786 _VSTD::__swap_allocator(__node_alloc(), __c.__node_alloc());
787787 swap(__sz(), __c.__sz());
788788 swap(__end_, __c.__end_);
789789 if (__sz() == 0)
......@@ -795,13 +795,13 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
795795 else
796796 __c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_ = __c.__end_as_link();
797797
798#if _LIBCPP_DEBUG_LEVEL >= 2
798#if _LIBCPP_DEBUG_LEVEL == 2
799799 __libcpp_db* __db = __get_db();
800800 __c_node* __cn1 = __db->__find_c_and_lock(this);
801801 __c_node* __cn2 = __db->__find_c(&__c);
802 std::swap(__cn1->beg_, __cn2->beg_);
803 std::swap(__cn1->end_, __cn2->end_);
804 std::swap(__cn1->cap_, __cn2->cap_);
802 _VSTD::swap(__cn1->beg_, __cn2->beg_);
803 _VSTD::swap(__cn1->end_, __cn2->end_);
804 _VSTD::swap(__cn1->cap_, __cn2->cap_);
805805 for (__i_node** __p = __cn1->end_; __p != __cn1->beg_;)
806806 {
807807 --__p;
......@@ -810,7 +810,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
810810 {
811811 __cn2->__add(*__p);
812812 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*));
814814 }
815815 else
816816 (*__p)->__c_ = __cn1;
......@@ -823,7 +823,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
823823 {
824824 __cn1->__add(*__p);
825825 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*));
827827 }
828828 else
829829 (*__p)->__c_ = __cn2;
......@@ -870,14 +870,14 @@ public:
870870 list()
871871 _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
872872 {
873#if _LIBCPP_DEBUG_LEVEL >= 2
873#if _LIBCPP_DEBUG_LEVEL == 2
874874 __get_db()->__insert_c(this);
875875#endif
876876 }
877877 _LIBCPP_INLINE_VISIBILITY
878878 explicit list(const allocator_type& __a) : base(__a)
879879 {
880#if _LIBCPP_DEBUG_LEVEL >= 2
880#if _LIBCPP_DEBUG_LEVEL == 2
881881 __get_db()->__insert_c(this);
882882#endif
883883 }
......@@ -937,7 +937,7 @@ public:
937937 _LIBCPP_INLINE_VISIBILITY
938938 size_type max_size() const _NOEXCEPT
939939 {
940 return std::min<size_type>(
940 return _VSTD::min<size_type>(
941941 base::__node_alloc_max_size(),
942942 numeric_limits<difference_type >::max());
943943 }
......@@ -1117,14 +1117,14 @@ public:
11171117 return __hold_pointer(__p, __node_destructor(__na, 1));
11181118 }
11191119
1120#if _LIBCPP_DEBUG_LEVEL >= 2
1120#if _LIBCPP_DEBUG_LEVEL == 2
11211121
11221122 bool __dereferenceable(const const_iterator* __i) const;
11231123 bool __decrementable(const const_iterator* __i) const;
11241124 bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
11251125 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
11261126
1127#endif // _LIBCPP_DEBUG_LEVEL >= 2
1127#endif // _LIBCPP_DEBUG_LEVEL == 2
11281128
11291129private:
11301130 _LIBCPP_INLINE_VISIBILITY
......@@ -1144,7 +1144,7 @@ private:
11441144
11451145#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
11461146template<class _InputIterator,
1147 class _Alloc = typename std::allocator<typename iterator_traits<_InputIterator>::value_type>,
1147 class _Alloc = allocator<typename iterator_traits<_InputIterator>::value_type>,
11481148 class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
11491149 >
11501150list(_InputIterator, _InputIterator)
......@@ -1207,7 +1207,7 @@ list<_Tp, _Alloc>::__iterator(size_type __n)
12071207template <class _Tp, class _Alloc>
12081208list<_Tp, _Alloc>::list(size_type __n)
12091209{
1210#if _LIBCPP_DEBUG_LEVEL >= 2
1210#if _LIBCPP_DEBUG_LEVEL == 2
12111211 __get_db()->__insert_c(this);
12121212#endif
12131213 for (; __n > 0; --__n)
......@@ -1222,7 +1222,7 @@ list<_Tp, _Alloc>::list(size_type __n)
12221222template <class _Tp, class _Alloc>
12231223list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)
12241224{
1225#if _LIBCPP_DEBUG_LEVEL >= 2
1225#if _LIBCPP_DEBUG_LEVEL == 2
12261226 __get_db()->__insert_c(this);
12271227#endif
12281228 for (; __n > 0; --__n)
......@@ -1233,7 +1233,7 @@ list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)
12331233template <class _Tp, class _Alloc>
12341234list<_Tp, _Alloc>::list(size_type __n, const value_type& __x)
12351235{
1236#if _LIBCPP_DEBUG_LEVEL >= 2
1236#if _LIBCPP_DEBUG_LEVEL == 2
12371237 __get_db()->__insert_c(this);
12381238#endif
12391239 for (; __n > 0; --__n)
......@@ -1244,7 +1244,7 @@ template <class _Tp, class _Alloc>
12441244list<_Tp, _Alloc>::list(size_type __n, const value_type& __x, const allocator_type& __a)
12451245 : base(__a)
12461246{
1247#if _LIBCPP_DEBUG_LEVEL >= 2
1247#if _LIBCPP_DEBUG_LEVEL == 2
12481248 __get_db()->__insert_c(this);
12491249#endif
12501250 for (; __n > 0; --__n)
......@@ -1256,7 +1256,7 @@ template <class _InpIter>
12561256list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l,
12571257 typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*)
12581258{
1259#if _LIBCPP_DEBUG_LEVEL >= 2
1259#if _LIBCPP_DEBUG_LEVEL == 2
12601260 __get_db()->__insert_c(this);
12611261#endif
12621262 for (; __f != __l; ++__f)
......@@ -1269,7 +1269,7 @@ list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, const allocator_type& __a,
12691269 typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*)
12701270 : base(__a)
12711271{
1272#if _LIBCPP_DEBUG_LEVEL >= 2
1272#if _LIBCPP_DEBUG_LEVEL == 2
12731273 __get_db()->__insert_c(this);
12741274#endif
12751275 for (; __f != __l; ++__f)
......@@ -1280,7 +1280,7 @@ template <class _Tp, class _Alloc>
12801280list<_Tp, _Alloc>::list(const list& __c)
12811281 : base(__node_alloc_traits::select_on_container_copy_construction(
12821282 __c.__node_alloc())) {
1283#if _LIBCPP_DEBUG_LEVEL >= 2
1283#if _LIBCPP_DEBUG_LEVEL == 2
12841284 __get_db()->__insert_c(this);
12851285#endif
12861286 for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i)
......@@ -1291,7 +1291,7 @@ template <class _Tp, class _Alloc>
12911291list<_Tp, _Alloc>::list(const list& __c, const allocator_type& __a)
12921292 : base(__a)
12931293{
1294#if _LIBCPP_DEBUG_LEVEL >= 2
1294#if _LIBCPP_DEBUG_LEVEL == 2
12951295 __get_db()->__insert_c(this);
12961296#endif
12971297 for (const_iterator __i = __c.begin(), __e = __c.end(); __i != __e; ++__i)
......@@ -1304,7 +1304,7 @@ template <class _Tp, class _Alloc>
13041304list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type& __a)
13051305 : base(__a)
13061306{
1307#if _LIBCPP_DEBUG_LEVEL >= 2
1307#if _LIBCPP_DEBUG_LEVEL == 2
13081308 __get_db()->__insert_c(this);
13091309#endif
13101310 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&
13151315template <class _Tp, class _Alloc>
13161316list<_Tp, _Alloc>::list(initializer_list<value_type> __il)
13171317{
1318#if _LIBCPP_DEBUG_LEVEL >= 2
1318#if _LIBCPP_DEBUG_LEVEL == 2
13191319 __get_db()->__insert_c(this);
13201320#endif
13211321 for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),
......@@ -1327,7 +1327,7 @@ template <class _Tp, class _Alloc>
13271327inline list<_Tp, _Alloc>::list(list&& __c)
13281328 _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
13291329 : base(_VSTD::move(__c.__node_alloc())) {
1330#if _LIBCPP_DEBUG_LEVEL >= 2
1330#if _LIBCPP_DEBUG_LEVEL == 2
13311331 __get_db()->__insert_c(this);
13321332#endif
13331333 splice(end(), __c);
......@@ -1338,7 +1338,7 @@ inline
13381338list<_Tp, _Alloc>::list(list&& __c, const allocator_type& __a)
13391339 : base(__a)
13401340{
1341#if _LIBCPP_DEBUG_LEVEL >= 2
1341#if _LIBCPP_DEBUG_LEVEL == 2
13421342 __get_db()->__insert_c(this);
13431343#endif
13441344 if (__a == __c.get_allocator())
......@@ -1415,7 +1415,7 @@ list<_Tp, _Alloc>::assign(_InpIter __f, _InpIter __l,
14151415 insert(__e, __f, __l);
14161416 else
14171417 erase(__i, __e);
1418#if _LIBCPP_DEBUG_LEVEL >= 2
1418#if _LIBCPP_DEBUG_LEVEL == 2
14191419 __get_db()->__invalidate_all(this);
14201420#endif
14211421}
......@@ -1432,7 +1432,7 @@ list<_Tp, _Alloc>::assign(size_type __n, const value_type& __x)
14321432 insert(__e, __n, __x);
14331433 else
14341434 erase(__i, __e);
1435#if _LIBCPP_DEBUG_LEVEL >= 2
1435#if _LIBCPP_DEBUG_LEVEL == 2
14361436 __get_db()->__invalidate_all(this);
14371437#endif
14381438}
......@@ -1449,7 +1449,7 @@ template <class _Tp, class _Alloc>
14491449typename list<_Tp, _Alloc>::iterator
14501450list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x)
14511451{
1452#if _LIBCPP_DEBUG_LEVEL >= 2
1452#if _LIBCPP_DEBUG_LEVEL == 2
14531453 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
14541454 "list::insert(iterator, x) called with an iterator not"
14551455 " referring to this list");
......@@ -1459,7 +1459,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x)
14591459 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
14601460 __link_nodes(__p.__ptr_, __hold->__as_link(), __hold->__as_link());
14611461 ++base::__sz();
1462#if _LIBCPP_DEBUG_LEVEL >= 2
1462#if _LIBCPP_DEBUG_LEVEL == 2
14631463 return iterator(__hold.release()->__as_link(), this);
14641464#else
14651465 return iterator(__hold.release()->__as_link());
......@@ -1470,7 +1470,7 @@ template <class _Tp, class _Alloc>
14701470typename list<_Tp, _Alloc>::iterator
14711471list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& __x)
14721472{
1473#if _LIBCPP_DEBUG_LEVEL >= 2
1473#if _LIBCPP_DEBUG_LEVEL == 2
14741474 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
14751475 "list::insert(iterator, n, x) called with an iterator not"
14761476 " referring to this list");
......@@ -1485,7 +1485,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
14851485 __hold_pointer __hold = __allocate_node(__na);
14861486 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
14871487 ++__ds;
1488#if _LIBCPP_DEBUG_LEVEL >= 2
1488#if _LIBCPP_DEBUG_LEVEL == 2
14891489 __r = iterator(__hold->__as_link(), this);
14901490#else
14911491 __r = iterator(__hold->__as_link());
......@@ -1515,7 +1515,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
15151515 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
15161516 if (__prev == 0)
15171517 break;
1518#if _LIBCPP_DEBUG_LEVEL >= 2
1518#if _LIBCPP_DEBUG_LEVEL == 2
15191519 __e = iterator(__prev, this);
15201520#else
15211521 __e = iterator(__prev);
......@@ -1536,7 +1536,7 @@ typename list<_Tp, _Alloc>::iterator
15361536list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
15371537 typename enable_if<__is_cpp17_input_iterator<_InpIter>::value>::type*)
15381538{
1539#if _LIBCPP_DEBUG_LEVEL >= 2
1539#if _LIBCPP_DEBUG_LEVEL == 2
15401540 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
15411541 "list::insert(iterator, range) called with an iterator not"
15421542 " referring to this list");
......@@ -1551,7 +1551,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
15511551 __hold_pointer __hold = __allocate_node(__na);
15521552 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);
15531553 ++__ds;
1554#if _LIBCPP_DEBUG_LEVEL >= 2
1554#if _LIBCPP_DEBUG_LEVEL == 2
15551555 __r = iterator(__hold.get()->__as_link(), this);
15561556#else
15571557 __r = iterator(__hold.get()->__as_link());
......@@ -1581,7 +1581,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
15811581 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
15821582 if (__prev == 0)
15831583 break;
1584#if _LIBCPP_DEBUG_LEVEL >= 2
1584#if _LIBCPP_DEBUG_LEVEL == 2
15851585 __e = iterator(__prev, this);
15861586#else
15871587 __e = iterator(__prev);
......@@ -1695,7 +1695,7 @@ template <class... _Args>
16951695typename list<_Tp, _Alloc>::iterator
16961696list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
16971697{
1698#if _LIBCPP_DEBUG_LEVEL >= 2
1698#if _LIBCPP_DEBUG_LEVEL == 2
16991699 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
17001700 "list::emplace(iterator, args...) called with an iterator not"
17011701 " referring to this list");
......@@ -1707,7 +1707,7 @@ list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
17071707 __link_nodes(__p.__ptr_, __nl, __nl);
17081708 ++base::__sz();
17091709 __hold.release();
1710#if _LIBCPP_DEBUG_LEVEL >= 2
1710#if _LIBCPP_DEBUG_LEVEL == 2
17111711 return iterator(__nl, this);
17121712#else
17131713 return iterator(__nl);
......@@ -1718,7 +1718,7 @@ template <class _Tp, class _Alloc>
17181718typename list<_Tp, _Alloc>::iterator
17191719list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
17201720{
1721#if _LIBCPP_DEBUG_LEVEL >= 2
1721#if _LIBCPP_DEBUG_LEVEL == 2
17221722 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
17231723 "list::insert(iterator, x) called with an iterator not"
17241724 " referring to this list");
......@@ -1730,7 +1730,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
17301730 __link_nodes(__p.__ptr_, __nl, __nl);
17311731 ++base::__sz();
17321732 __hold.release();
1733#if _LIBCPP_DEBUG_LEVEL >= 2
1733#if _LIBCPP_DEBUG_LEVEL == 2
17341734 return iterator(__nl, this);
17351735#else
17361736 return iterator(__nl);
......@@ -1748,7 +1748,7 @@ list<_Tp, _Alloc>::pop_front()
17481748 __link_pointer __n = base::__end_.__next_;
17491749 base::__unlink_nodes(__n, __n);
17501750 --base::__sz();
1751#if _LIBCPP_DEBUG_LEVEL >= 2
1751#if _LIBCPP_DEBUG_LEVEL == 2
17521752 __c_node* __c = __get_db()->__find_c_and_lock(this);
17531753 for (__i_node** __p = __c->end_; __p != __c->beg_; )
17541754 {
......@@ -1758,7 +1758,7 @@ list<_Tp, _Alloc>::pop_front()
17581758 {
17591759 (*__p)->__c_ = nullptr;
17601760 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*));
17621762 }
17631763 }
17641764 __get_db()->unlock();
......@@ -1777,7 +1777,7 @@ list<_Tp, _Alloc>::pop_back()
17771777 __link_pointer __n = base::__end_.__prev_;
17781778 base::__unlink_nodes(__n, __n);
17791779 --base::__sz();
1780#if _LIBCPP_DEBUG_LEVEL >= 2
1780#if _LIBCPP_DEBUG_LEVEL == 2
17811781 __c_node* __c = __get_db()->__find_c_and_lock(this);
17821782 for (__i_node** __p = __c->end_; __p != __c->beg_; )
17831783 {
......@@ -1787,7 +1787,7 @@ list<_Tp, _Alloc>::pop_back()
17871787 {
17881788 (*__p)->__c_ = nullptr;
17891789 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*));
17911791 }
17921792 }
17931793 __get_db()->unlock();
......@@ -1801,7 +1801,7 @@ template <class _Tp, class _Alloc>
18011801typename list<_Tp, _Alloc>::iterator
18021802list<_Tp, _Alloc>::erase(const_iterator __p)
18031803{
1804#if _LIBCPP_DEBUG_LEVEL >= 2
1804#if _LIBCPP_DEBUG_LEVEL == 2
18051805 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
18061806 "list::erase(iterator) called with an iterator not"
18071807 " referring to this list");
......@@ -1813,7 +1813,7 @@ list<_Tp, _Alloc>::erase(const_iterator __p)
18131813 __link_pointer __r = __n->__next_;
18141814 base::__unlink_nodes(__n, __n);
18151815 --base::__sz();
1816#if _LIBCPP_DEBUG_LEVEL >= 2
1816#if _LIBCPP_DEBUG_LEVEL == 2
18171817 __c_node* __c = __get_db()->__find_c_and_lock(this);
18181818 for (__i_node** __ip = __c->end_; __ip != __c->beg_; )
18191819 {
......@@ -1823,7 +1823,7 @@ list<_Tp, _Alloc>::erase(const_iterator __p)
18231823 {
18241824 (*__ip)->__c_ = nullptr;
18251825 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*));
18271827 }
18281828 }
18291829 __get_db()->unlock();
......@@ -1831,7 +1831,7 @@ list<_Tp, _Alloc>::erase(const_iterator __p)
18311831 __node_pointer __np = __n->__as_node();
18321832 __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
18331833 __node_alloc_traits::deallocate(__na, __np, 1);
1834#if _LIBCPP_DEBUG_LEVEL >= 2
1834#if _LIBCPP_DEBUG_LEVEL == 2
18351835 return iterator(__r, this);
18361836#else
18371837 return iterator(__r);
......@@ -1842,7 +1842,7 @@ template <class _Tp, class _Alloc>
18421842typename list<_Tp, _Alloc>::iterator
18431843list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
18441844{
1845#if _LIBCPP_DEBUG_LEVEL >= 2
1845#if _LIBCPP_DEBUG_LEVEL == 2
18461846 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == this,
18471847 "list::erase(iterator, iterator) called with an iterator not"
18481848 " referring to this list");
......@@ -1859,7 +1859,7 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
18591859 __link_pointer __n = __f.__ptr_;
18601860 ++__f;
18611861 --base::__sz();
1862#if _LIBCPP_DEBUG_LEVEL >= 2
1862#if _LIBCPP_DEBUG_LEVEL == 2
18631863 __c_node* __c = __get_db()->__find_c_and_lock(this);
18641864 for (__i_node** __p = __c->end_; __p != __c->beg_; )
18651865 {
......@@ -1869,7 +1869,7 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
18691869 {
18701870 (*__p)->__c_ = nullptr;
18711871 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*));
18731873 }
18741874 }
18751875 __get_db()->unlock();
......@@ -1879,7 +1879,7 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
18791879 __node_alloc_traits::deallocate(__na, __np, 1);
18801880 }
18811881 }
1882#if _LIBCPP_DEBUG_LEVEL >= 2
1882#if _LIBCPP_DEBUG_LEVEL == 2
18831883 return iterator(__l.__ptr_, this);
18841884#else
18851885 return iterator(__l.__ptr_);
......@@ -1900,7 +1900,7 @@ list<_Tp, _Alloc>::resize(size_type __n)
19001900 __hold_pointer __hold = __allocate_node(__na);
19011901 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));
19021902 ++__ds;
1903#if _LIBCPP_DEBUG_LEVEL >= 2
1903#if _LIBCPP_DEBUG_LEVEL == 2
19041904 iterator __r = iterator(__hold.release()->__as_link(), this);
19051905#else
19061906 iterator __r = iterator(__hold.release()->__as_link());
......@@ -1929,7 +1929,7 @@ list<_Tp, _Alloc>::resize(size_type __n)
19291929 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
19301930 if (__prev == 0)
19311931 break;
1932#if _LIBCPP_DEBUG_LEVEL >= 2
1932#if _LIBCPP_DEBUG_LEVEL == 2
19331933 __e = iterator(__prev, this);
19341934#else
19351935 __e = iterator(__prev);
......@@ -1958,7 +1958,7 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
19581958 __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
19591959 ++__ds;
19601960 __link_pointer __nl = __hold.release()->__as_link();
1961#if _LIBCPP_DEBUG_LEVEL >= 2
1961#if _LIBCPP_DEBUG_LEVEL == 2
19621962 iterator __r = iterator(__nl, this);
19631963#else
19641964 iterator __r = iterator(__nl);
......@@ -1987,7 +1987,7 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
19871987 __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
19881988 if (__prev == 0)
19891989 break;
1990#if _LIBCPP_DEBUG_LEVEL >= 2
1990#if _LIBCPP_DEBUG_LEVEL == 2
19911991 __e = iterator(__prev, this);
19921992#else
19931993 __e = iterator(__prev);
......@@ -2007,7 +2007,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
20072007{
20082008 _LIBCPP_ASSERT(this != &__c,
20092009 "list::splice(iterator, list) called with this == &list");
2010#if _LIBCPP_DEBUG_LEVEL >= 2
2010#if _LIBCPP_DEBUG_LEVEL == 2
20112011 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
20122012 "list::splice(iterator, list) called with an iterator not"
20132013 " referring to this list");
......@@ -2020,7 +2020,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
20202020 __link_nodes(__p.__ptr_, __f, __l);
20212021 base::__sz() += __c.__sz();
20222022 __c.__sz() = 0;
2023#if _LIBCPP_DEBUG_LEVEL >= 2
2023#if _LIBCPP_DEBUG_LEVEL == 2
20242024 if (&__c != this) {
20252025 __libcpp_db* __db = __get_db();
20262026 __c_node* __cn1 = __db->__find_c_and_lock(this);
......@@ -2034,7 +2034,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
20342034 __cn1->__add(*__ip);
20352035 (*__ip)->__c_ = __cn1;
20362036 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*));
20382038 }
20392039 }
20402040 __db->unlock();
......@@ -2047,7 +2047,7 @@ template <class _Tp, class _Alloc>
20472047void
20482048list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
20492049{
2050#if _LIBCPP_DEBUG_LEVEL >= 2
2050#if _LIBCPP_DEBUG_LEVEL == 2
20512051 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
20522052 "list::splice(iterator, list, iterator) called with first iterator not"
20532053 " referring to this list");
......@@ -2056,7 +2056,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
20562056 " referring to list argument");
20572057 _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(&__i),
20582058 "list::splice(iterator, list, iterator) called with second iterator not"
2059 " derefereceable");
2059 " dereferenceable");
20602060#endif
20612061 if (__p.__ptr_ != __i.__ptr_ && __p.__ptr_ != __i.__ptr_->__next_)
20622062 {
......@@ -2065,7 +2065,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
20652065 __link_nodes(__p.__ptr_, __f, __f);
20662066 --__c.__sz();
20672067 ++base::__sz();
2068#if _LIBCPP_DEBUG_LEVEL >= 2
2068#if _LIBCPP_DEBUG_LEVEL == 2
20692069 if (&__c != this) {
20702070 __libcpp_db* __db = __get_db();
20712071 __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)
20792079 __cn1->__add(*__ip);
20802080 (*__ip)->__c_ = __cn1;
20812081 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*));
20832083 }
20842084 }
20852085 __db->unlock();
......@@ -2092,7 +2092,7 @@ template <class _Tp, class _Alloc>
20922092void
20932093list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l)
20942094{
2095#if _LIBCPP_DEBUG_LEVEL >= 2
2095#if _LIBCPP_DEBUG_LEVEL == 2
20962096 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
20972097 "list::splice(iterator, list, iterator, iterator) called with first iterator not"
20982098 " referring to this list");
......@@ -2121,7 +2121,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, con
21212121 }
21222122 base::__unlink_nodes(__first, __last);
21232123 __link_nodes(__p.__ptr_, __first, __last);
2124#if _LIBCPP_DEBUG_LEVEL >= 2
2124#if _LIBCPP_DEBUG_LEVEL == 2
21252125 if (&__c != this) {
21262126 __libcpp_db* __db = __get_db();
21272127 __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
21382138 __cn1->__add(*__ip);
21392139 (*__ip)->__c_ = __cn1;
21402140 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*));
21422142 }
21432143 }
21442144 }
......@@ -2258,7 +2258,7 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
22582258 ++__f1;
22592259 }
22602260 splice(__e1, __c);
2261#if _LIBCPP_DEBUG_LEVEL >= 2
2261#if _LIBCPP_DEBUG_LEVEL == 2
22622262 __libcpp_db* __db = __get_db();
22632263 __c_node* __cn1 = __db->__find_c_and_lock(this);
22642264 __c_node* __cn2 = __db->__find_c(&__c);
......@@ -2271,7 +2271,7 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
22712271 __cn1->__add(*__p);
22722272 (*__p)->__c_ = __cn1;
22732273 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*));
22752275 }
22762276 }
22772277 __db->unlock();
......@@ -2382,7 +2382,7 @@ list<_Tp, _Alloc>::__invariants() const
23822382 return size() == _VSTD::distance(begin(), end());
23832383}
23842384
2385#if _LIBCPP_DEBUG_LEVEL >= 2
2385#if _LIBCPP_DEBUG_LEVEL == 2
23862386
23872387template <class _Tp, class _Alloc>
23882388bool
......@@ -2412,7 +2412,7 @@ list<_Tp, _Alloc>::__subscriptable(const const_iterator*, ptrdiff_t) const
24122412 return false;
24132413}
24142414
2415#endif // _LIBCPP_DEBUG_LEVEL >= 2
2415#endif // _LIBCPP_DEBUG_LEVEL == 2
24162416
24172417template <class _Tp, class _Alloc>
24182418inline _LIBCPP_INLINE_VISIBILITY
lib/libcxx/include/locale+105-79
......@@ -92,7 +92,11 @@ public:
9292 typedef typename Codecvt::state_type state_type;
9393 typedef typename wide_string::traits_type::int_type int_type;
9494
95 explicit wstring_convert(Codecvt* pcvt = new Codecvt); // explicit in C++14
95 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
96100 wstring_convert(Codecvt* pcvt, state_type state);
97101 explicit wstring_convert(const byte_string& byte_err, // explicit in C++14
98102 const wide_string& wide_err = wide_string());
......@@ -121,8 +125,14 @@ class wbuffer_convert
121125public:
122126 typedef typename Tr::state_type state_type;
123127
124 explicit wbuffer_convert(streambuf* bytebuf = 0, Codecvt* pcvt = new Codecvt,
125 state_type state = state_type()); // explicit in C++14
128 wbuffer_convert(streambuf* bytebuf = 0, Codecvt* pcvt = new Codecvt,
129 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
126136 wbuffer_convert(const wbuffer_convert&) = delete; // C++14
127137 wbuffer_convert & operator=(const wbuffer_convert &) = delete; // C++14
128138 ~wbuffer_convert(); // C++14
......@@ -197,10 +207,6 @@ template <class charT> class messages_byname;
197207#include <nl_types.h>
198208#endif
199209
200#ifdef __APPLE__
201#include <Availability.h>
202#endif
203
204210#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
205211#include <__bsd_locale_defaults.h>
206212#else
......@@ -261,11 +267,11 @@ __scan_keyword(_InputIterator& __b, _InputIterator __e,
261267 const unsigned char __does_match = '\2';
262268 unsigned char __statbuf[100];
263269 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);
265271 if (__nkw > sizeof(__statbuf))
266272 {
267273 __status = (unsigned char*)malloc(__nkw);
268 if (__status == 0)
274 if (__status == nullptr)
269275 __throw_bad_alloc();
270276 __stat_hold.reset(__status);
271277 }
......@@ -561,8 +567,8 @@ __num_get<_CharT>::__stage2_float_loop(_CharT __ct, bool& __in_units, char& __ex
561567 return 0;
562568}
563569
564_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<char>)
565_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<wchar_t>)
570_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<char>)
571_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<wchar_t>)
566572
567573template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
568574class _LIBCPP_TEMPLATE_VIS num_get
......@@ -877,8 +883,8 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
877883 const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__iob.getloc());
878884 typedef typename numpunct<_CharT>::string_type string_type;
879885 const string_type __names[2] = {__np.truename(), __np.falsename()};
880 const string_type* __i = __scan_keyword(__b, __e, __names, __names+2,
881 __ct, __err);
886 const string_type* __i = _VSTD::__scan_keyword(__b, __e, __names, __names+2,
887 __ct, __err);
882888 __v = __i == __names;
883889 return __b;
884890}
......@@ -1099,8 +1105,8 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
10991105 return __b;
11001106}
11011107
1102_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<char>)
1103_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<wchar_t>)
1108_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<char>)
1109_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<wchar_t>)
11041110
11051111struct _LIBCPP_TYPE_VIS __num_put_base
11061112{
......@@ -1249,8 +1255,8 @@ __num_put<_CharT>::__widen_and_group_float(char* __nb, char* __np, char* __ne,
12491255 __op = __ob + (__np - __nb);
12501256}
12511257
1252_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<char>)
1253_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<wchar_t>)
1258_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<char>)
1259_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<wchar_t>)
12541260
12551261template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
12561262class _LIBCPP_TEMPLATE_VIS num_put
......@@ -1427,7 +1433,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
14271433 return do_put(__s, __iob, __fl, (unsigned long)__v);
14281434 const numpunct<char_type>& __np = use_facet<numpunct<char_type> >(__iob.getloc());
14291435 typedef typename numpunct<char_type>::string_type string_type;
1430#if _LIBCPP_DEBUG_LEVEL >= 2
1436#if _LIBCPP_DEBUG_LEVEL == 2
14311437 string_type __tmp(__v ? __np.truename() : __np.falsename());
14321438 string_type __nm = _VSTD::move(__tmp);
14331439#else
......@@ -1564,14 +1570,14 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
15641570 (int)__iob.precision(), __v);
15651571 else
15661572 __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);
15681574 if (__nc > static_cast<int>(__nbuf-1))
15691575 {
15701576 if (__specify_precision)
15711577 __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
15721578 else
15731579 __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v);
1574 if (__nb == 0)
1580 if (__nc == -1)
15751581 __throw_bad_alloc();
15761582 __nbh.reset(__nb);
15771583 }
......@@ -1615,14 +1621,14 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
16151621 (int)__iob.precision(), __v);
16161622 else
16171623 __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);
16191625 if (__nc > static_cast<int>(__nbuf-1))
16201626 {
16211627 if (__specify_precision)
16221628 __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
16231629 else
16241630 __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v);
1625 if (__nb == 0)
1631 if (__nc == -1)
16261632 __throw_bad_alloc();
16271633 __nbh.reset(__nb);
16281634 }
......@@ -1676,8 +1682,8 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
16761682 return __pad_and_output(__s, __o, __op, __oe, __iob, __fl);
16771683}
16781684
1679_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<char>)
1680_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<wchar_t>)
1685_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<char>)
1686_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<wchar_t>)
16811687
16821688template <class _CharT, class _InputIterator>
16831689_LIBCPP_HIDDEN
......@@ -1916,7 +1922,7 @@ time_get<_CharT, _InputIterator>::__get_weekdayname(int& __w,
19161922{
19171923 // Note: ignoring case comes from the POSIX strptime spec
19181924 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;
19201926 if (__i < 14)
19211927 __w = __i % 7;
19221928}
......@@ -1930,7 +1936,7 @@ time_get<_CharT, _InputIterator>::__get_monthname(int& __m,
19301936{
19311937 // Note: ignoring case comes from the POSIX strptime spec
19321938 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;
19341940 if (__i < 24)
19351941 __m = __i % 12;
19361942}
......@@ -1942,7 +1948,7 @@ time_get<_CharT, _InputIterator>::__get_day(int& __d,
19421948 ios_base::iostate& __err,
19431949 const ctype<char_type>& __ct) const
19441950{
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);
19461952 if (!(__err & ios_base::failbit) && 1 <= __t && __t <= 31)
19471953 __d = __t;
19481954 else
......@@ -2102,7 +2108,7 @@ time_get<_CharT, _InputIterator>::__get_am_pm(int& __h,
21022108 __err |= ios_base::failbit;
21032109 return;
21042110 }
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;
21062112 if (__i == 0 && __h == 12)
21072113 __h = 0;
21082114 else if (__i == 1 && __h < 12)
......@@ -2362,8 +2368,8 @@ time_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
23622368 return __b;
23632369}
23642370
2365_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<char>)
2366_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<wchar_t>)
2371_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<char>)
2372_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<wchar_t>)
23672373
23682374class _LIBCPP_TYPE_VIS __time_get
23692375{
......@@ -2462,8 +2468,8 @@ private:
24622468 virtual const string_type& __X() const {return this->__X_;}
24632469};
24642470
2465_LIBCPP_EXTERN_TEMPLATE2(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>)
2471_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<char>)
2472_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<wchar_t>)
24672473
24682474class _LIBCPP_TYPE_VIS __time_put
24692475{
......@@ -2575,8 +2581,8 @@ time_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base&,
25752581 return _VSTD::copy(__nb, __ne, __s);
25762582}
25772583
2578_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<char>)
2579_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<wchar_t>)
2584_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<char>)
2585_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<wchar_t>)
25802586
25812587template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
25822588class _LIBCPP_TEMPLATE_VIS time_put_byname
......@@ -2596,8 +2602,8 @@ protected:
25962602 ~time_put_byname() {}
25972603};
25982604
2599_LIBCPP_EXTERN_TEMPLATE2(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>)
2605_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>)
2606_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<wchar_t>)
26012607
26022608// money_base
26032609
......@@ -2663,10 +2669,10 @@ template <class _CharT, bool _International>
26632669const bool
26642670moneypunct<_CharT, _International>::intl;
26652671
2666_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, false>)
2667_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, true>)
2668_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, false>)
2669_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, true>)
2672_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, false>)
2673_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, true>)
2674_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, false>)
2675_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, true>)
26702676
26712677// moneypunct_byname
26722678
......@@ -2720,10 +2726,10 @@ template<> _LIBCPP_FUNC_VIS void moneypunct_byname<char, true>::init(const char*
27202726template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, false>::init(const char*);
27212727template<> _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>)
2724_LIBCPP_EXTERN_TEMPLATE2(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>)
2726_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, true>)
2729_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, false>)
2730_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, true>)
2731_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, false>)
2732_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, true>)
27272733
27282734// money_get
27292735
......@@ -2779,8 +2785,8 @@ __money_get<_CharT>::__gather_info(bool __intl, const locale& __loc,
27792785 }
27802786}
27812787
2782_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<char>)
2783_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<wchar_t>)
2788_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<char>)
2789_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<wchar_t>)
27842790
27852791template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
27862792class _LIBCPP_TEMPLATE_VIS money_get
......@@ -3108,11 +3114,11 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
31083114 __ct.widen(__src, __src + (sizeof(__src)-1), __atoms);
31093115 char __nbuf[__bz];
31103116 char* __nc = __nbuf;
3111 unique_ptr<char, void(*)(void*)> __h(0, free);
3117 unique_ptr<char, void(*)(void*)> __h(nullptr, free);
31123118 if (__wn - __wb.get() > __bz-2)
31133119 {
31143120 __h.reset((char*)malloc(static_cast<size_t>(__wn - __wb.get() + 2)));
3115 if (__h.get() == 0)
3121 if (__h.get() == nullptr)
31163122 __throw_bad_alloc();
31173123 __nc = __h.get();
31183124 }
......@@ -3162,8 +3168,8 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
31623168 return __b;
31633169}
31643170
3165_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<char>)
3166_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<wchar_t>)
3171_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<char>)
3172_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<wchar_t>)
31673173
31683174// money_put
31693175
......@@ -3337,8 +3343,8 @@ __money_put<_CharT>::__format(char_type* __mb, char_type*& __mi, char_type*& __m
33373343 __mi = __mb;
33383344}
33393345
3340_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<char>)
3341_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<wchar_t>)
3346_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<char>)
3347_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<wchar_t>)
33423348
33433349template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
33443350class _LIBCPP_TEMPLATE_VIS money_put
......@@ -3396,17 +3402,17 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,
33963402 char* __bb = __buf;
33973403 char_type __digits[__bs];
33983404 char_type* __db = __digits;
3399 size_t __n = static_cast<size_t>(snprintf(__bb, __bs, "%.0Lf", __units));
3400 unique_ptr<char, void(*)(void*)> __hn(0, free);
3405 int __n = snprintf(__bb, __bs, "%.0Lf", __units);
3406 unique_ptr<char, void(*)(void*)> __hn(nullptr, free);
34013407 unique_ptr<char_type, void(*)(void*)> __hd(0, free);
34023408 // secure memory for digit storage
3403 if (__n > __bs-1)
3409 if (static_cast<size_t>(__n) > __bs-1)
34043410 {
3405 __n = static_cast<size_t>(__libcpp_asprintf_l(&__bb, _LIBCPP_GET_C_LOCALE, "%.0Lf", __units));
3406 if (__bb == 0)
3411 __n = __libcpp_asprintf_l(&__bb, _LIBCPP_GET_C_LOCALE, "%.0Lf", __units);
3412 if (__n == -1)
34073413 __throw_bad_alloc();
34083414 __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)));
34103416 if (__hd == nullptr)
34113417 __throw_bad_alloc();
34123418 __db = __hd.get();
......@@ -3428,9 +3434,9 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,
34283434 char_type __mbuf[__bs];
34293435 char_type* __mb = __mbuf;
34303436 unique_ptr<char_type, void(*)(void*)> __hw(0, free);
3431 size_t __exn = static_cast<int>(__n) > __fd ?
3432 (__n - static_cast<size_t>(__fd)) * 2 + __sn.size() +
3433 __sym.size() + static_cast<size_t>(__fd) + 1
3437 size_t __exn = __n > __fd ?
3438 (static_cast<size_t>(__n) - static_cast<size_t>(__fd)) * 2 +
3439 __sn.size() + __sym.size() + static_cast<size_t>(__fd) + 1
34343440 : __sn.size() + __sym.size() + static_cast<size_t>(__fd) + 2;
34353441 if (__exn > __bs)
34363442 {
......@@ -3490,8 +3496,8 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,
34903496 return __pad_and_output(__s, __mb, __mi, __me, __iob, __fl);
34913497}
34923498
3493_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<char>)
3494_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<wchar_t>)
3499_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<char>)
3500_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<wchar_t>)
34953501
34963502// messages
34973503
......@@ -3582,7 +3588,7 @@ messages<_CharT>::do_get(catalog __c, int __set, int __msgid,
35823588 char* __n = catgets(__cat, __set, __msgid, __ndflt.c_str());
35833589 string_type __w;
35843590 __widen_from_utf8<sizeof(char_type)*__CHAR_BIT__>()(back_inserter(__w),
3585 __n, __n + strlen(__n));
3591 __n, __n + _VSTD::strlen(__n));
35863592 return __w;
35873593#else // !_LIBCPP_HAS_CATOPEN
35883594 _LIBCPP_UNUSED_VAR(__c);
......@@ -3606,8 +3612,8 @@ messages<_CharT>::do_close(catalog __c) const
36063612#endif // _LIBCPP_HAS_CATOPEN
36073613}
36083614
3609_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<char>)
3610_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<wchar_t>)
3615_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<char>)
3616_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<wchar_t>)
36113617
36123618template <class _CharT>
36133619class _LIBCPP_TEMPLATE_VIS messages_byname
......@@ -3630,8 +3636,8 @@ protected:
36303636 ~messages_byname() {}
36313637};
36323638
3633_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>)
3634_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>)
3639_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>)
3640_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>)
36353641
36363642template<class _Codecvt, class _Elem = wchar_t,
36373643 class _Wide_alloc = allocator<_Elem>,
......@@ -3654,8 +3660,17 @@ private:
36543660 wstring_convert(const wstring_convert& __wc);
36553661 wstring_convert& operator=(const wstring_convert& __wc);
36563662public:
3663#ifndef _LIBCPP_CXX03_LANG
36573664 _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
36593674 _LIBCPP_INLINE_VISIBILITY
36603675 wstring_convert(_Codecvt* __pcvt, state_type __state);
36613676 _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err,
......@@ -3922,9 +3937,20 @@ private:
39223937
39233938 wbuffer_convert(const wbuffer_convert&);
39243939 wbuffer_convert& operator=(const wbuffer_convert&);
3940
39253941public:
3926 _LIBCPP_EXPLICIT_AFTER_CXX11 wbuffer_convert(streambuf* __bytebuf = 0,
3927 _Codecvt* __pcvt = new _Codecvt, state_type __state = state_type());
3942#ifndef _LIBCPP_CXX03_LANG
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
39283954 ~wbuffer_convert();
39293955
39303956 _LIBCPP_INLINE_VISIBILITY
......@@ -3961,9 +3987,9 @@ private:
39613987template <class _Codecvt, class _Elem, class _Tr>
39623988wbuffer_convert<_Codecvt, _Elem, _Tr>::
39633989 wbuffer_convert(streambuf* __bytebuf, _Codecvt* __pcvt, state_type __state)
3964 : __extbuf_(0),
3965 __extbufnext_(0),
3966 __extbufend_(0),
3990 : __extbuf_(nullptr),
3991 __extbufnext_(nullptr),
3992 __extbufend_(nullptr),
39673993 __ebs_(0),
39683994 __intbuf_(0),
39693995 __ibs_(0),
......@@ -4003,7 +4029,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow()
40034029 int_type __c = traits_type::eof();
40044030 if (this->gptr() == this->egptr())
40054031 {
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));
40074033 if (__always_noconv_)
40084034 {
40094035 streamsize __nmemb = static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz);
......@@ -4020,7 +4046,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow()
40204046 {
40214047 _LIBCPP_ASSERT(!(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" );
40224048 if (__extbufend_ != __extbufnext_)
4023 memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
4049 _VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
40244050 __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
40254051 __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
40264052 streamsize __nmemb = _VSTD::min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),
......@@ -4336,12 +4362,12 @@ template <class _Codecvt, class _Elem, class _Tr>
43364362wbuffer_convert<_Codecvt, _Elem, _Tr>*
43374363wbuffer_convert<_Codecvt, _Elem, _Tr>::__close()
43384364{
4339 wbuffer_convert* __rt = 0;
4340 if (__cv_ != 0 && __bufptr_ != 0)
4365 wbuffer_convert* __rt = nullptr;
4366 if (__cv_ != nullptr && __bufptr_ != nullptr)
43414367 {
43424368 __rt = this;
43434369 if ((__cm_ & ios_base::out) && sync())
4344 __rt = 0;
4370 __rt = nullptr;
43454371 }
43464372 return __rt;
43474373}
lib/libcxx/include/locale.h+5-1
......@@ -35,8 +35,12 @@ Functions:
3535
3636#include <__config>
3737
38#if defined(_LIBCPP_HAS_NO_LOCALIZATION)
39# error "Localization is not supported by this configuration of libc++"
40#endif
41
3842#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
39#pragma GCC system_header
43# pragma GCC system_header
4044#endif
4145
4246#include_next <locale.h>
lib/libcxx/include/map+25-25
......@@ -1230,7 +1230,7 @@ public:
12301230 return __tree_.__emplace_hint_unique_key_args(__h.__i_, __k,
12311231 _VSTD::piecewise_construct,
12321232 _VSTD::forward_as_tuple(__k),
1233 _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
1233 _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)).first;
12341234 }
12351235
12361236 template <class... _Args>
......@@ -1240,7 +1240,7 @@ public:
12401240 return __tree_.__emplace_hint_unique_key_args(__h.__i_, __k,
12411241 _VSTD::piecewise_construct,
12421242 _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;
12441244 }
12451245
12461246 template <class _Vp>
......@@ -1270,30 +1270,30 @@ public:
12701270 }
12711271
12721272 template <class _Vp>
1273 _LIBCPP_INLINE_VISIBILITY
1274 iterator insert_or_assign(const_iterator __h, const key_type& __k, _Vp&& __v)
1275 {
1276 iterator __p = lower_bound(__k);
1277 if ( __p != end() && !key_comp()(__k, __p->first))
1278 {
1279 __p->second = _VSTD::forward<_Vp>(__v);
1280 return __p;
1281 }
1282 return emplace_hint(__h, __k, _VSTD::forward<_Vp>(__v));
1283 }
1273 _LIBCPP_INLINE_VISIBILITY iterator insert_or_assign(const_iterator __h,
1274 const key_type& __k,
1275 _Vp&& __v) {
1276 auto [__r, __inserted] = __tree_.__emplace_hint_unique_key_args(
1277 __h.__i_, __k, __k, _VSTD::forward<_Vp>(__v));
1278
1279 if (!__inserted)
1280 __r->__get_value().second = _VSTD::forward<_Vp>(__v);
1281
1282 return __r;
1283 }
12841284
12851285 template <class _Vp>
1286 _LIBCPP_INLINE_VISIBILITY
1287 iterator insert_or_assign(const_iterator __h, key_type&& __k, _Vp&& __v)
1288 {
1289 iterator __p = lower_bound(__k);
1290 if ( __p != end() && !key_comp()(__k, __p->first))
1291 {
1292 __p->second = _VSTD::forward<_Vp>(__v);
1293 return __p;
1294 }
1295 return emplace_hint(__h, _VSTD::move(__k), _VSTD::forward<_Vp>(__v));
1296 }
1286 _LIBCPP_INLINE_VISIBILITY iterator insert_or_assign(const_iterator __h,
1287 key_type&& __k,
1288 _Vp&& __v) {
1289 auto [__r, __inserted] = __tree_.__emplace_hint_unique_key_args(
1290 __h.__i_, __k, _VSTD::move(__k), _VSTD::forward<_Vp>(__v));
1291
1292 if (!__inserted)
1293 __r->__get_value().second = _VSTD::forward<_Vp>(__v);
1294
1295 return __r;
1296 }
12971297
12981298#endif // _LIBCPP_STD_VER > 14
12991299
......@@ -1546,7 +1546,7 @@ map<_Key, _Tp, _Compare, _Allocator>::__construct_node_with_key(const key_type&
15461546 __h.get_deleter().__first_constructed = true;
15471547 __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__get_value().second));
15481548 __h.get_deleter().__second_constructed = true;
1549 return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
1549 return __h;
15501550}
15511551
15521552template <class _Key, class _Tp, class _Compare, class _Allocator>
lib/libcxx/include/memory+418-1383
......@@ -46,7 +46,7 @@ struct pointer_traits<T*>
4646};
4747
4848template <class T> constexpr T* to_address(T* p) noexcept; // C++20
49template <class Ptr> auto to_address(const Ptr& p) noexcept; // C++20
49template <class Ptr> constexpr auto to_address(const Ptr& p) noexcept; // C++20
5050
5151template <class Alloc>
5252struct allocator_traits
......@@ -83,21 +83,19 @@ struct allocator_traits
8383 template <class T> using rebind_alloc = Alloc::rebind<T>::other | Alloc<T, Args...>;
8484 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++20
87 static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint); // [[nodiscard]] in C++20
86 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); // 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
9191 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
9494 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++14
98
99 static allocator_type
100 select_on_container_copy_construction(const allocator_type& a);
97 static size_type max_size(const allocator_type& a); // noexcept in C++14, constexpr in C++20
98 static allocator_type select_on_container_copy_construction(const allocator_type& a); // constexpr in C++20
10199};
102100
103101template <>
......@@ -115,8 +113,8 @@ template <class T>
115113class allocator
116114{
117115public:
118 typedef size_t size_type; // deprecated in C++17, removed in C++20
119 typedef ptrdiff_t difference_type; // deprecated in C++17, removed in C++20
116 typedef size_t size_type;
117 typedef ptrdiff_t difference_type;
120118 typedef T* pointer; // deprecated in C++17, removed in C++20
121119 typedef const T* const_pointer; // deprecated in C++17, removed in C++20
122120 typedef typename add_lvalue_reference<T>::type
......@@ -135,12 +133,12 @@ public:
135133 constexpr allocator(const allocator&) noexcept; // constexpr in C++20
136134 template <class U>
137135 constexpr allocator(const allocator<U>&) noexcept; // constexpr in C++20
138 ~allocator();
136 ~allocator(); // constexpr in C++20
139137 pointer address(reference x) const noexcept; // deprecated in C++17, removed in C++20
140138 const_pointer address(const_reference x) const noexcept; // deprecated in C++17, removed in C++20
141139 T* allocate(size_t n, const void* hint); // deprecated in C++17, removed in C++20
142 T* allocate(size_t n);
143 void deallocate(T* p, size_t n) noexcept;
140 T* allocate(size_t n); // constexpr in C++20
141 void deallocate(T* p, size_t n) noexcept; // constexpr in C++20
144142 size_type max_size() const noexcept; // deprecated in C++17, removed in C++20
145143 template<class U, class... Args>
146144 void construct(U* p, Args&&... args); // deprecated in C++17, removed in C++20
......@@ -149,10 +147,10 @@ public:
149147};
150148
151149template <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
154152template <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
157155template <class OutputIterator, class T>
158156class raw_storage_iterator
......@@ -191,14 +189,17 @@ template <class ForwardIterator, class Size, class T>
191189ForwardIterator
192190uninitialized_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
194195template <class T>
195void destroy_at(T* location);
196void destroy_at(T* location); // constexpr in C++20
196197
197198template <class ForwardIterator>
198 void destroy(ForwardIterator first, ForwardIterator last);
199void destroy(ForwardIterator first, ForwardIterator last); // constexpr in C++20
199200
200201template <class ForwardIterator, class Size>
201 ForwardIterator destroy_n(ForwardIterator first, Size n);
202ForwardIterator destroy_n(ForwardIterator first, Size n); // constexpr in C++20
202203
203204template <class InputIterator, class ForwardIterator>
204205 ForwardIterator uninitialized_move(InputIterator first, InputIterator last, ForwardIterator result);
......@@ -338,7 +339,7 @@ public:
338339 pointer release() noexcept;
339340 void reset(pointer p = pointer()) noexcept;
340341 void reset(nullptr_t) noexcept;
341 template <class U> void reset(U) = delete;
342 template <class U> void reset(U) = delete;
342343 void swap(unique_ptr& u) noexcept;
343344};
344345
......@@ -664,6 +665,7 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
664665*/
665666
666667#include <__config>
668#include <__availability>
667669#include <type_traits>
668670#include <typeinfo>
669671#include <cstddef>
......@@ -677,6 +679,10 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
677679#include <tuple>
678680#include <stdexcept>
679681#include <cstring>
682#include <__memory/allocator_traits.h>
683#include <__memory/base.h>
684#include <__memory/pointer_traits.h>
685#include <__memory/utilities.h>
680686#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
681687# include <atomic>
682688#endif
......@@ -716,413 +722,11 @@ _ValueType __libcpp_acquire_load(_ValueType const* __value) {
716722#endif
717723}
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
1121725template <bool _UsePointerTraits> struct __to_address_helper;
1122726
1123727template <> struct __to_address_helper<true> {
1124728 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
1127731 template <class _Pointer>
1128732 _LIBCPP_CONSTEXPR
......@@ -1157,7 +761,7 @@ template <> struct __to_address_helper<false> {
1157761 template <class _Pointer>
1158762 _LIBCPP_CONSTEXPR
1159763 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->()); }
1161765};
1162766
1163767
......@@ -1172,7 +776,7 @@ to_address(_Tp* __p) _NOEXCEPT
1172776}
1173777
1174778template <class _Pointer>
1175inline _LIBCPP_INLINE_VISIBILITY
779inline _LIBCPP_INLINE_VISIBILITY constexpr
1176780auto
1177781to_address(const _Pointer& __p) _NOEXCEPT
1178782{
......@@ -1180,765 +784,287 @@ to_address(const _Pointer& __p) _NOEXCEPT
1180784}
1181785#endif
1182786
1183template <class _Tp, class = void>
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 {};
787template <class _Tp> class allocator;
1189788
1190template <class _Alloc, class _DiffType, bool = __has_size_type<_Alloc>::value>
1191struct __size_type
789#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
790template <>
791class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 allocator<void>
1192792{
1193 typedef _LIBCPP_NODEBUG_TYPE typename make_unsigned<_DiffType>::type type;
1194};
793public:
794 typedef void* pointer;
795 typedef const void* const_pointer;
796 typedef void value_type;
1195797
1196template <class _Alloc, class _DiffType>
1197struct __size_type<_Alloc, _DiffType, true>
1198{
1199 typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::size_type type;
798 template <class _Up> struct rebind {typedef allocator<_Up> other;};
1200799};
1201800
1202template <class _Tp, class = void>
1203struct __has_propagate_on_container_copy_assignment : false_type {};
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
801template <>
802class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 allocator<const void>
1212803{
1213 typedef _LIBCPP_NODEBUG_TYPE false_type type;
1214};
804public:
805 typedef const void* pointer;
806 typedef const void* const_pointer;
807 typedef const void value_type;
1215808
1216template <class _Alloc>
1217struct __propagate_on_container_copy_assignment<_Alloc, true>
1218{
1219 typedef _LIBCPP_NODEBUG_TYPE typename _Alloc::propagate_on_container_copy_assignment type;
809 template <class _Up> struct rebind {typedef allocator<_Up> other;};
1220810};
811#endif
1221812
1222template <class _Tp, class = void>
1223struct __has_propagate_on_container_move_assignment : false_type {};
813// allocator
1224814
1225815template <class _Tp>
1226struct __has_propagate_on_container_move_assignment<_Tp,
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
816class _LIBCPP_TEMPLATE_VIS allocator
1232817{
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
1291818public:
1292 static const bool value = sizeof(__test<_Tp>(0)) == 1;
1293};
1294
1295template <class _Tp, class _Up>
1296struct __has_rebind_other<_Tp, _Up, false>
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 }
819 typedef size_t size_type;
820 typedef ptrdiff_t difference_type;
821 typedef _Tp value_type;
822 typedef true_type propagate_on_container_move_assignment;
823 typedef true_type is_always_equal;
1604824
1605 template <class _SourceTp, class _DestTp,
1606 class _RawSourceTp = typename remove_const<_SourceTp>::type,
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 }
825 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
826 allocator() _NOEXCEPT { }
1627827
1628 template <class _Ptr>
1629 _LIBCPP_INLINE_VISIBILITY
1630 static
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 }
828 template <class _Up>
829 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
830 allocator(const allocator<_Up>&) _NOEXCEPT { }
1648831
1649 template <class _Tp>
1650 _LIBCPP_INLINE_VISIBILITY
1651 static
1652 typename enable_if
1653 <
1654 (__is_default_allocator<allocator_type>::value
1655 || !__has_construct<allocator_type, _Tp*, _Tp>::value) &&
1656 is_trivially_move_constructible<_Tp>::value,
1657 void
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));
832 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
833 _Tp* allocate(size_t __n) {
834 if (__n > allocator_traits<allocator>::max_size(*this))
835 __throw_length_error("allocator<T>::allocate(size_t n)"
836 " 'n' exceeds maximum supported size");
837 if (__libcpp_is_constant_evaluated()) {
838 return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
839 } else {
840 return static_cast<_Tp*>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)));
1665841 }
842 }
1666843
1667private:
1668
1669 _LIBCPP_INLINE_VISIBILITY
1670 static pointer __allocate(allocator_type& __a, size_type __n,
1671 const_void_pointer __hint, true_type)
1672 {
1673 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
1674 return __a.allocate(__n, __hint);
1675 _LIBCPP_SUPPRESS_DEPRECATED_POP
844 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
845 void deallocate(_Tp* __p, size_t __n) _NOEXCEPT {
846 if (__libcpp_is_constant_evaluated()) {
847 ::operator delete(__p);
848 } else {
849 _VSTD::__libcpp_deallocate((void*)__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
1676850 }
1677 _LIBCPP_INLINE_VISIBILITY
1678 static pointer __allocate(allocator_type& __a, size_type __n,
1679 const_void_pointer, false_type)
1680 {return __a.allocate(__n);}
851 }
1681852
1682 template <class _Tp, class... _Args>
1683 _LIBCPP_INLINE_VISIBILITY
1684 static void __construct(true_type, allocator_type& __a, _Tp* __p, _Args&&... __args)
1685 {
1686 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
1687 __a.construct(__p, _VSTD::forward<_Args>(__args)...);
1688 _LIBCPP_SUPPRESS_DEPRECATED_POP
1689 }
853 // C++20 Removed members
854#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
855 _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp* pointer;
856 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
857 _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp& reference;
858 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference;
1690859
1691 template <class _Tp, class... _Args>
1692 _LIBCPP_INLINE_VISIBILITY
1693 static void __construct(false_type, allocator_type&, _Tp* __p, _Args&&... __args)
1694 {
1695 ::new ((void*)__p) _Tp(_VSTD::forward<_Args>(__args)...);
1696 }
860 template <class _Up>
861 struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {
862 typedef allocator<_Up> other;
863 };
1697864
1698 template <class _Tp>
1699 _LIBCPP_INLINE_VISIBILITY
1700 static void __destroy(true_type, allocator_type& __a, _Tp* __p)
1701 {
1702 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
1703 __a.destroy(__p);
1704 _LIBCPP_SUPPRESS_DEPRECATED_POP
1705 }
1706 template <class _Tp>
1707 _LIBCPP_INLINE_VISIBILITY
1708 static void __destroy(false_type, allocator_type&, _Tp* __p)
1709 {
1710 __p->~_Tp();
1711 }
865 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
866 pointer address(reference __x) const _NOEXCEPT {
867 return _VSTD::addressof(__x);
868 }
869 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
870 const_pointer address(const_reference __x) const _NOEXCEPT {
871 return _VSTD::addressof(__x);
872 }
1712873
1713 _LIBCPP_INLINE_VISIBILITY
1714 static size_type __max_size(true_type, const allocator_type& __a) _NOEXCEPT
1715 {
1716 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
1717 return __a.max_size();
1718 _LIBCPP_SUPPRESS_DEPRECATED_POP
1719 }
874 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17
875 _Tp* allocate(size_t __n, const void*) {
876 return allocate(__n);
877 }
1720878
1721 _LIBCPP_INLINE_VISIBILITY
1722 static size_type __max_size(false_type, const allocator_type&) _NOEXCEPT
1723 {return numeric_limits<size_type>::max() / sizeof(value_type);}
879 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {
880 return size_type(~0) / sizeof(_Tp);
881 }
1724882
1725 _LIBCPP_INLINE_VISIBILITY
1726 static allocator_type
1727 __select_on_container_copy_construction(true_type, const allocator_type& __a)
1728 {return __a.select_on_container_copy_construction();}
1729 _LIBCPP_INLINE_VISIBILITY
1730 static allocator_type
1731 __select_on_container_copy_construction(false_type, const allocator_type& __a)
1732 {return __a;}
1733};
883 template <class _Up, class... _Args>
884 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
885 void construct(_Up* __p, _Args&&... __args) {
886 ::new ((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
887 }
1734888
1735template <class _Traits, class _Tp>
1736struct __rebind_alloc_helper
1737{
1738#ifndef _LIBCPP_CXX03_LANG
1739 typedef _LIBCPP_NODEBUG_TYPE typename _Traits::template rebind_alloc<_Tp> type;
1740#else
1741 typedef typename _Traits::template rebind_alloc<_Tp>::other type;
889 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
890 void destroy(pointer __p) {
891 __p->~_Tp();
892 }
1742893#endif
1743894};
1744895
1745// allocator
1746
1747896template <class _Tp>
1748class _LIBCPP_TEMPLATE_VIS allocator
897class _LIBCPP_TEMPLATE_VIS allocator<const _Tp>
1749898{
1750899public:
1751#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
1752 _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t size_type;
1753 _LIBCPP_DEPRECATED_IN_CXX17 typedef ptrdiff_t difference_type;
1754 _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp* pointer;
1755 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
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;
900 typedef size_t size_type;
901 typedef ptrdiff_t difference_type;
902 typedef const _Tp value_type;
903 typedef true_type propagate_on_container_move_assignment;
904 typedef true_type is_always_equal;
1766905
1767906 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1768 allocator() _NOEXCEPT {}
907 allocator() _NOEXCEPT { }
1769908
1770909 template <class _Up>
1771910 _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)
1775 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
1776 pointer address(reference __x) const _NOEXCEPT
1777 {return _VSTD::addressof(__x);}
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)"
913 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
914 const _Tp* allocate(size_t __n) {
915 if (__n > allocator_traits<allocator>::max_size(*this))
916 __throw_length_error("allocator<const T>::allocate(size_t n)"
1788917 " '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)));
1790922 }
923 }
1791924
1792#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
1793 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17
1794 _Tp* allocate(size_t __n, const void*) { return allocate(__n); }
1795#endif
1796
1797 _LIBCPP_INLINE_VISIBILITY void deallocate(_Tp* __p, size_t __n) _NOEXCEPT
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)...);
925 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
926 void deallocate(const _Tp* __p, size_t __n) {
927 if (__libcpp_is_constant_evaluated()) {
928 ::operator delete(const_cast<_Tp*>(__p));
929 } else {
930 _VSTD::__libcpp_deallocate((void*) const_cast<_Tp *>(__p), __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp));
1810931 }
1811 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}
1812#endif
1813};
932 }
1814933
1815template <class _Tp>
1816class _LIBCPP_TEMPLATE_VIS allocator<const _Tp>
1817{
1818public:
934 // C++20 Removed members
1819935#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;
1822936 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* pointer;
1823937 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer;
1824938 _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& reference;
1825939 _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
1838941 template <class _Up>
1839 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1840 allocator(const allocator<_Up>&) _NOEXCEPT {}
942 struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {
943 typedef allocator<_Up> other;
944 };
1841945
1842#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
1843946 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
1844 const_pointer address(const_reference __x) const _NOEXCEPT
1845 {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)));
947 const_pointer address(const_reference __x) const _NOEXCEPT {
948 return _VSTD::addressof(__x);
1855949 }
1856950
1857#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
1858951 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17
1859 const _Tp* allocate(size_t __n, const void*) { return allocate(__n); }
1860#endif
1861
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));}
952 const _Tp* allocate(size_t __n, const void*) {
953 return allocate(__n);
954 }
1864955
1865#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
1866 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT
1867 {return size_type(~0) / sizeof(_Tp);}
956 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {
957 return size_type(~0) / sizeof(_Tp);
958 }
1868959
1869#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
1870960 template <class _Up, class... _Args>
1871 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
1872 void
1873 construct(_Up* __p, _Args&&... __args)
1874 {
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)
961 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
962 void construct(_Up* __p, _Args&&... __args) {
963 ::new ((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
964 }
1885965
1886 template <class _A0>
1887 _LIBCPP_INLINE_VISIBILITY
1888 void
1889 construct(pointer __p, _A0& __a0)
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();}
966 _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY
967 void destroy(pointer __p) {
968 __p->~_Tp();
969 }
1931970#endif
1932971};
1933972
1934973template <class _Tp, class _Up>
1935inline _LIBCPP_INLINE_VISIBILITY
974inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1936975bool operator==(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return true;}
1937976
1938977template <class _Tp, class _Up>
1939inline _LIBCPP_INLINE_VISIBILITY
978inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
1940979bool 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
19421068template <class _OutputIterator, class _Tp>
19431069class _LIBCPP_TEMPLATE_VIS raw_storage_iterator
19441070 : public iterator<output_iterator_tag,
......@@ -1953,10 +1079,10 @@ public:
19531079 _LIBCPP_INLINE_VISIBILITY explicit raw_storage_iterator(_OutputIterator __x) : __x_(__x) {}
19541080 _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator*() {return *this;}
19551081 _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;}
19571083#if _LIBCPP_STD_VER >= 14
19581084 _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;}
19601086#endif
19611087 _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator++() {++__x_; return *this;}
19621088 _LIBCPP_INLINE_VISIBILITY raw_storage_iterator operator++(int)
......@@ -1982,8 +1108,8 @@ get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT
19821108#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
19831109 if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp)))
19841110 {
1985 std::align_val_t __al =
1986 std::align_val_t(std::alignment_of<_Tp>::value);
1111 align_val_t __al =
1112 align_val_t(alignment_of<_Tp>::value);
19871113 __r.first = static_cast<_Tp*>(::operator new(
19881114 __n * sizeof(_Tp), __al, nothrow));
19891115 } else {
......@@ -2052,7 +1178,7 @@ public:
20521178 _LIBCPP_INLINE_VISIBILITY _Tp* release() _NOEXCEPT
20531179 {
20541180 _Tp* __t = __ptr_;
2055 __ptr_ = 0;
1181 __ptr_ = nullptr;
20561182 return __t;
20571183 }
20581184 _LIBCPP_INLINE_VISIBILITY void reset(_Tp* __p = 0) _NOEXCEPT
......@@ -2160,19 +1286,19 @@ struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {
21601286template <class _T1, class _T2>
21611287class __compressed_pair : private __compressed_pair_elem<_T1, 0>,
21621288 private __compressed_pair_elem<_T2, 1> {
2163 typedef _LIBCPP_NODEBUG_TYPE __compressed_pair_elem<_T1, 0> _Base1;
2164 typedef _LIBCPP_NODEBUG_TYPE __compressed_pair_elem<_T2, 1> _Base2;
2165
1289public:
21661290 // NOTE: This static assert should never fire because __compressed_pair
21671291 // is *almost never* used in a scenario where it's possible for T1 == T2.
21681292 // (The exception is std::function where it is possible that the function
21691293 // object and the allocator have the same type).
21701294 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; "
21721296 "The current implementation is NOT ABI-compatible with the previous "
21731297 "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
21761302 template <bool _Dummy = true,
21771303 class = typename enable_if<
21781304 __dependent_type<is_default_constructible<_T1>, _Dummy>::value &&
......@@ -2185,7 +1311,7 @@ public:
21851311 template <class _U1, class _U2>
21861312 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
21871313 __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
21901316#ifndef _LIBCPP_CXX03_LANG
21911317 template <class... _Args1, class... _Args2>
......@@ -2218,12 +1344,21 @@ public:
22181344 return static_cast<_Base2 const&>(*this).__get();
22191345 }
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
22211356 _LIBCPP_INLINE_VISIBILITY
22221357 void swap(__compressed_pair& __x)
22231358 _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
22241359 __is_nothrow_swappable<_T2>::value)
22251360 {
2226 using std::swap;
1361 using _VSTD::swap;
22271362 swap(first(), __x.first());
22281363 swap(second(), __x.second());
22291364 }
......@@ -2316,12 +1451,18 @@ struct __unique_ptr_deleter_sfinae<_Deleter&> {
23161451 typedef false_type __enable_rval_overload;
23171452};
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
23191460template <class _Tp, class _Dp = default_delete<_Tp> >
2320class _LIBCPP_TEMPLATE_VIS unique_ptr {
1461class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
23211462public:
23221463 typedef _Tp element_type;
23231464 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
23261467 static_assert(!is_rvalue_reference<deleter_type>::value,
23271468 "the specified deleter type cannot be an rvalue reference");
......@@ -2525,11 +1666,11 @@ public:
25251666
25261667
25271668template <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> {
25291670public:
25301671 typedef _Tp element_type;
25311672 typedef _Dp deleter_type;
2532 typedef typename __pointer_type<_Tp, deleter_type>::type pointer;
1673 typedef typename __pointer<_Tp, deleter_type>::type pointer;
25331674
25341675private:
25351676 __compressed_pair<pointer, deleter_type> __ptr_;
......@@ -2987,7 +2128,7 @@ public:
29872128 : __size_(__s) {}
29882129
29892130 template <class _Tp>
2990 _LIBCPP_INLINE_VISIBILITY void __incr(_Tp*) _NOEXCEPT
2131 _LIBCPP_INLINE_VISIBILITY void __incr() _NOEXCEPT
29912132 {__incr(integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
29922133
29932134 template <class _Tp>
......@@ -3029,7 +2170,7 @@ uninitialized_copy(_InputIterator __f, _InputIterator __l, _ForwardIterator __r)
30292170 {
30302171#endif
30312172 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);
30332174#ifndef _LIBCPP_NO_EXCEPTIONS
30342175 }
30352176 catch (...)
......@@ -3053,7 +2194,7 @@ uninitialized_copy_n(_InputIterator __f, _Size __n, _ForwardIterator __r)
30532194 {
30542195#endif
30552196 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);
30572198#ifndef _LIBCPP_NO_EXCEPTIONS
30582199 }
30592200 catch (...)
......@@ -3077,7 +2218,7 @@ uninitialized_fill(_ForwardIterator __f, _ForwardIterator __l, const _Tp& __x)
30772218 {
30782219#endif
30792220 for (; __f != __l; ++__f)
3080 ::new (static_cast<void*>(_VSTD::addressof(*__f))) value_type(__x);
2221 ::new ((void*)_VSTD::addressof(*__f)) value_type(__x);
30812222#ifndef _LIBCPP_NO_EXCEPTIONS
30822223 }
30832224 catch (...)
......@@ -3100,7 +2241,7 @@ uninitialized_fill_n(_ForwardIterator __f, _Size __n, const _Tp& __x)
31002241 {
31012242#endif
31022243 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);
31042245#ifndef _LIBCPP_NO_EXCEPTIONS
31052246 }
31062247 catch (...)
......@@ -3115,22 +2256,15 @@ uninitialized_fill_n(_ForwardIterator __f, _Size __n, const _Tp& __x)
31152256
31162257#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
31252259template <class _ForwardIterator>
3126inline _LIBCPP_INLINE_VISIBILITY
2260inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
31272261void destroy(_ForwardIterator __first, _ForwardIterator __last) {
31282262 for (; __first != __last; ++__first)
31292263 _VSTD::destroy_at(_VSTD::addressof(*__first));
31302264}
31312265
31322266template <class _ForwardIterator, class _Size>
3133inline _LIBCPP_INLINE_VISIBILITY
2267inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
31342268_ForwardIterator destroy_n(_ForwardIterator __first, _Size __n) {
31352269 for (; __n > 0; (void)++__first, --__n)
31362270 _VSTD::destroy_at(_VSTD::addressof(*__first));
......@@ -3146,7 +2280,7 @@ void uninitialized_default_construct(_ForwardIterator __first, _ForwardIterator
31462280 try {
31472281#endif
31482282 for (; __idx != __last; ++__idx)
3149 ::new((void*)_VSTD::addressof(*__idx)) _Vt;
2283 ::new ((void*)_VSTD::addressof(*__idx)) _Vt;
31502284#ifndef _LIBCPP_NO_EXCEPTIONS
31512285 } catch (...) {
31522286 _VSTD::destroy(__first, __idx);
......@@ -3164,7 +2298,7 @@ _ForwardIterator uninitialized_default_construct_n(_ForwardIterator __first, _Si
31642298 try {
31652299#endif
31662300 for (; __n > 0; (void)++__idx, --__n)
3167 ::new((void*)_VSTD::addressof(*__idx)) _Vt;
2301 ::new ((void*)_VSTD::addressof(*__idx)) _Vt;
31682302 return __idx;
31692303#ifndef _LIBCPP_NO_EXCEPTIONS
31702304 } catch (...) {
......@@ -3184,7 +2318,7 @@ void uninitialized_value_construct(_ForwardIterator __first, _ForwardIterator __
31842318 try {
31852319#endif
31862320 for (; __idx != __last; ++__idx)
3187 ::new((void*)_VSTD::addressof(*__idx)) _Vt();
2321 ::new ((void*)_VSTD::addressof(*__idx)) _Vt();
31882322#ifndef _LIBCPP_NO_EXCEPTIONS
31892323 } catch (...) {
31902324 _VSTD::destroy(__first, __idx);
......@@ -3202,7 +2336,7 @@ _ForwardIterator uninitialized_value_construct_n(_ForwardIterator __first, _Size
32022336 try {
32032337#endif
32042338 for (; __n > 0; (void)++__idx, --__n)
3205 ::new((void*)_VSTD::addressof(*__idx)) _Vt();
2339 ::new ((void*)_VSTD::addressof(*__idx)) _Vt();
32062340 return __idx;
32072341#ifndef _LIBCPP_NO_EXCEPTIONS
32082342 } catch (...) {
......@@ -3222,7 +2356,7 @@ _ForwardIt uninitialized_move(_InputIt __first, _InputIt __last, _ForwardIt __fi
32222356 try {
32232357#endif
32242358 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));
32262360 return __idx;
32272361#ifndef _LIBCPP_NO_EXCEPTIONS
32282362 } catch (...) {
......@@ -3242,7 +2376,7 @@ uninitialized_move_n(_InputIt __first, _Size __n, _ForwardIt __first_res) {
32422376 try {
32432377#endif
32442378 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));
32462380 return {__first, __idx};
32472381#ifndef _LIBCPP_NO_EXCEPTIONS
32482382 } catch (...) {
......@@ -3389,13 +2523,7 @@ public:
33892523 long use_count() const _NOEXCEPT {return __shared_count::use_count();}
33902524 __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)
33972526 virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
3398#endif
33992527private:
34002528 virtual void __on_zero_shared_weak() _NOEXCEPT = 0;
34012529};
......@@ -3452,69 +2580,86 @@ __shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT
34522580}
34532581
34542582template <class _Tp, class _Alloc>
3455class __shared_ptr_emplace
3456 : public __shared_weak_count
2583struct __shared_ptr_emplace
2584 : __shared_weak_count
34572585{
3458 __compressed_pair<_Alloc, _Tp> __data_;
3459public:
3460
3461 _LIBCPP_INLINE_VISIBILITY
3462 __shared_ptr_emplace(_Alloc __a)
3463 : __data_(_VSTD::move(__a), __value_init_tag()) {}
3464
2586 template<class ..._Args>
2587 _LIBCPP_HIDE_FROM_ABI
2588 explicit __shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
2589 : __storage_(_VSTD::move(__a))
2590 {
2591#if _LIBCPP_STD_VER > 17
2592 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_VARIADICS
3467 template <class ..._Args>
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
2600 _LIBCPP_HIDE_FROM_ABI
2601 _Alloc* __get_alloc() _NOEXCEPT { return __storage_.__get_alloc(); }
34732602
3474 template <class _A0>
3475 _LIBCPP_INLINE_VISIBILITY
3476 __shared_ptr_emplace(_Alloc __a, _A0& __a0)
3477 : __data_(__a, _Tp(__a0)) {}
2603 _LIBCPP_HIDE_FROM_ABI
2604 _Tp* __get_elem() _NOEXCEPT { return __storage_.__get_elem(); }
34782605
3479 template <class _A0, class _A1>
3480 _LIBCPP_INLINE_VISIBILITY
3481 __shared_ptr_emplace(_Alloc __a, _A0& __a0, _A1& __a1)
3482 : __data_(__a, _Tp(__a0, __a1)) {}
2606private:
2607 virtual void __on_zero_shared() _NOEXCEPT {
2608#if _LIBCPP_STD_VER > 17
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>
3485 _LIBCPP_INLINE_VISIBILITY
3486 __shared_ptr_emplace(_Alloc __a, _A0& __a0, _A1& __a1, _A2& __a2)
3487 : __data_(__a, _Tp(__a0, __a1, __a2)) {}
2617 virtual void __on_zero_shared_weak() _NOEXCEPT {
2618 using _ControlBlockAlloc = typename __allocator_traits_rebind<_Alloc, __shared_ptr_emplace>::type;
2619 using _ControlBlockPointer = typename allocator_traits<_ControlBlockAlloc>::pointer;
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_VARIADICS
2626 // 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:
3492 virtual void __on_zero_shared() _NOEXCEPT;
3493 virtual void __on_zero_shared_weak() _NOEXCEPT;
3494public:
3495 _LIBCPP_INLINE_VISIBILITY
3496 _Tp* get() _NOEXCEPT {return _VSTD::addressof(__data_.second());}
2658 static_assert(_LIBCPP_ALIGNOF(_Storage) == _LIBCPP_ALIGNOF(_CompressedPair), "");
2659 static_assert(sizeof(_Storage) == sizeof(_CompressedPair), "");
2660 _Storage __storage_;
34972661};
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
35182663struct __shared_ptr_dummy_rebind_allocator_type;
35192664template <>
35202665class _LIBCPP_TEMPLATE_VIS allocator<__shared_ptr_dummy_rebind_allocator_type>
......@@ -3537,8 +2682,14 @@ struct __compatible_with
35372682 : is_convertible<_Tp*, _Up*> {};
35382683#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
35402691template<class _Tp>
3541class _LIBCPP_TEMPLATE_VIS shared_ptr
2692class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
35422693{
35432694public:
35442695#if _LIBCPP_STD_VER > 14
......@@ -3577,25 +2728,17 @@ public:
35772728 shared_ptr(const shared_ptr<_Yp>& __r,
35782729 typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat())
35792730 _NOEXCEPT;
3580#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
35812731 _LIBCPP_INLINE_VISIBILITY
35822732 shared_ptr(shared_ptr&& __r) _NOEXCEPT;
35832733 template<class _Yp> _LIBCPP_INLINE_VISIBILITY shared_ptr(shared_ptr<_Yp>&& __r,
35842734 typename enable_if<__compatible_with<_Yp, element_type>::value, __nat>::type = __nat())
35852735 _NOEXCEPT;
3586#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
35872736 template<class _Yp> explicit shared_ptr(const weak_ptr<_Yp>& __r,
35882737 typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type= __nat());
35892738#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
3590#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
35912739 template<class _Yp>
35922740 shared_ptr(auto_ptr<_Yp>&& __r,
35932741 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
35992742#endif
36002743 template <class _Yp, class _Dp>
36012744 shared_ptr(unique_ptr<_Yp, _Dp>&&,
......@@ -3628,7 +2771,6 @@ public:
36282771 >::type
36292772 _LIBCPP_INLINE_VISIBILITY
36302773 operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT;
3631#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
36322774 _LIBCPP_INLINE_VISIBILITY
36332775 shared_ptr& operator=(shared_ptr&& __r) _NOEXCEPT;
36342776 template<class _Yp>
......@@ -3649,19 +2791,6 @@ public:
36492791 shared_ptr
36502792 >::type&
36512793 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
36652794#endif
36662795 template <class _Yp, class _Dp>
36672796 typename enable_if
......@@ -3670,13 +2799,8 @@ public:
36702799 is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
36712800 shared_ptr&
36722801 >::type
3673#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
36742802 _LIBCPP_INLINE_VISIBILITY
36752803 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
36812805 _LIBCPP_INLINE_VISIBILITY
36822806 void swap(shared_ptr& __r) _NOEXCEPT;
......@@ -3724,7 +2848,7 @@ public:
37242848 _LIBCPP_INLINE_VISIBILITY
37252849 bool unique() const _NOEXCEPT {return use_count() == 1;}
37262850 _LIBCPP_INLINE_VISIBILITY
3727 _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {return get() != 0;}
2851 _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {return get() != nullptr;}
37282852 template <class _Up>
37292853 _LIBCPP_INLINE_VISIBILITY
37302854 bool owner_before(shared_ptr<_Up> const& __p) const _NOEXCEPT
......@@ -3828,8 +2952,8 @@ template<class _Tp>
38282952inline
38292953_LIBCPP_CONSTEXPR
38302954shared_ptr<_Tp>::shared_ptr() _NOEXCEPT
3831 : __ptr_(0),
3832 __cntrl_(0)
2955 : __ptr_(nullptr),
2956 __cntrl_(nullptr)
38332957{
38342958}
38352959
......@@ -3837,8 +2961,8 @@ template<class _Tp>
38372961inline
38382962_LIBCPP_CONSTEXPR
38392963shared_ptr<_Tp>::shared_ptr(nullptr_t) _NOEXCEPT
3840 : __ptr_(0),
3841 __cntrl_(0)
2964 : __ptr_(nullptr),
2965 __cntrl_(nullptr)
38422966{
38432967}
38442968
......@@ -3883,7 +3007,7 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d,
38833007template<class _Tp>
38843008template<class _Dp>
38853009shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d)
3886 : __ptr_(0)
3010 : __ptr_(nullptr)
38873011{
38883012#ifndef _LIBCPP_NO_EXCEPTIONS
38893013 try
......@@ -3917,8 +3041,7 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d, _Alloc __a,
39173041 typedef __allocator_destructor<_A2> _D2;
39183042 _A2 __a2(__a);
39193043 unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
3920 ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))
3921 _CntrlBlk(__p, __d, __a);
3044 ::new ((void*)_VSTD::addressof(*__hold2.get())) _CntrlBlk(__p, __d, __a);
39223045 __cntrl_ = _VSTD::addressof(*__hold2.release());
39233046 __enable_weak_this(__p, __p);
39243047#ifndef _LIBCPP_NO_EXCEPTIONS
......@@ -3934,7 +3057,7 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d, _Alloc __a,
39343057template<class _Tp>
39353058template<class _Dp, class _Alloc>
39363059shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a)
3937 : __ptr_(0)
3060 : __ptr_(nullptr)
39383061{
39393062#ifndef _LIBCPP_NO_EXCEPTIONS
39403063 try
......@@ -3945,8 +3068,7 @@ shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a)
39453068 typedef __allocator_destructor<_A2> _D2;
39463069 _A2 __a2(__a);
39473070 unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
3948 ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))
3949 _CntrlBlk(__p, __d, __a);
3071 ::new ((void*)_VSTD::addressof(*__hold2.get())) _CntrlBlk(__p, __d, __a);
39503072 __cntrl_ = _VSTD::addressof(*__hold2.release());
39513073#ifndef _LIBCPP_NO_EXCEPTIONS
39523074 }
......@@ -3992,16 +3114,14 @@ shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r,
39923114 __cntrl_->__add_shared();
39933115}
39943116
3995#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
3996
39973117template<class _Tp>
39983118inline
39993119shared_ptr<_Tp>::shared_ptr(shared_ptr&& __r) _NOEXCEPT
40003120 : __ptr_(__r.__ptr_),
40013121 __cntrl_(__r.__cntrl_)
40023122{
4003 __r.__ptr_ = 0;
4004 __r.__cntrl_ = 0;
3123 __r.__ptr_ = nullptr;
3124 __r.__cntrl_ = nullptr;
40053125}
40063126
40073127template<class _Tp>
......@@ -4013,20 +3133,14 @@ shared_ptr<_Tp>::shared_ptr(shared_ptr<_Yp>&& __r,
40133133 : __ptr_(__r.__ptr_),
40143134 __cntrl_(__r.__cntrl_)
40153135{
4016 __r.__ptr_ = 0;
4017 __r.__cntrl_ = 0;
3136 __r.__ptr_ = nullptr;
3137 __r.__cntrl_ = nullptr;
40183138}
40193139
4020#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4021
40223140#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
40233141template<class _Tp>
40243142template<class _Yp>
4025#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
40263143shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp>&& __r,
4027#else
4028shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp> __r,
4029#endif
40303144 typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type)
40313145 : __ptr_(__r.get())
40323146{
......@@ -4121,8 +3235,6 @@ shared_ptr<_Tp>::operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT
41213235 return *this;
41223236}
41233237
4124#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4125
41263238template<class _Tp>
41273239inline
41283240shared_ptr<_Tp>&
......@@ -4179,43 +3291,6 @@ shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp>&& __r)
41793291 return *this;
41803292}
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
42193294template<class _Tp>
42203295inline
42213296void
......@@ -4272,50 +3347,26 @@ shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d, _Alloc __a)
42723347 shared_ptr(__p, __d, __a).swap(*this);
42733348}
42743349
4275template<class _Tp, class ..._Args>
4276inline _LIBCPP_INLINE_VISIBILITY
4277typename enable_if
4278<
4279 !is_array<_Tp>::value,
4280 shared_ptr<_Tp>
4281>::type
4282make_shared(_Args&& ...__args)
3350//
3351// std::allocate_shared and std::make_shared
3352//
3353template<class _Tp, class _Alloc, class ..._Args, class = _EnableIf<!is_array<_Tp>::value> >
3354_LIBCPP_HIDE_FROM_ABI
3355shared_ptr<_Tp> allocate_shared(const _Alloc& __a, _Args&& ...__args)
42833356{
4284 static_assert(is_constructible<_Tp, _Args...>::value, "Can't construct object in make_shared");
4285 typedef __shared_ptr_emplace<_Tp, allocator<_Tp> > _CntrlBlk;
4286 typedef allocator<_CntrlBlk> _A2;
4287 typedef __allocator_destructor<_A2> _D2;
4288
4289 _A2 __a2;
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());
3357 using _ControlBlock = __shared_ptr_emplace<_Tp, _Alloc>;
3358 using _ControlBlockAllocator = typename __allocator_traits_rebind<_Alloc, _ControlBlock>::type;
3359 __allocation_guard<_ControlBlockAllocator> __guard(__a, 1);
3360 ::new ((void*)_VSTD::addressof(*__guard.__get())) _ControlBlock(__a, _VSTD::forward<_Args>(__args)...);
3361 auto __control_block = __guard.__release_ptr();
3362 return shared_ptr<_Tp>::__create_with_control_block((*__control_block).__get_elem(), _VSTD::addressof(*__control_block));
42953363}
42963364
4297template<class _Tp, class _Alloc, class ..._Args>
4298inline _LIBCPP_INLINE_VISIBILITY
4299typename enable_if
4300<
4301 !is_array<_Tp>::value,
4302 shared_ptr<_Tp>
4303>::type
4304allocate_shared(const _Alloc& __a, _Args&& ...__args)
3365template<class _Tp, class ..._Args, class = _EnableIf<!is_array<_Tp>::value> >
3366_LIBCPP_HIDE_FROM_ABI
3367shared_ptr<_Tp> make_shared(_Args&& ...__args)
43053368{
4306 static_assert( is_constructible<_Tp, _Args...>::value, "Can't construct object in allocate_shared");
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()));
3369 return _VSTD::allocate_shared<_Tp>(allocator<_Tp>(), _VSTD::forward<_Args>(__args)...);
43193370}
43203371
43213372template<class _Tp, class _Up>
......@@ -4526,7 +3577,7 @@ get_deleter(const shared_ptr<_Tp>& __p) _NOEXCEPT
45263577#endif // _LIBCPP_NO_RTTI
45273578
45283579template<class _Tp>
4529class _LIBCPP_TEMPLATE_VIS weak_ptr
3580class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr
45303581{
45313582public:
45323583 typedef _Tp element_type;
......@@ -4546,13 +3597,11 @@ public:
45463597 typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
45473598 _NOEXCEPT;
45483599
4549#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
45503600 _LIBCPP_INLINE_VISIBILITY
45513601 weak_ptr(weak_ptr&& __r) _NOEXCEPT;
45523602 template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r,
45533603 typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
45543604 _NOEXCEPT;
4555#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
45563605 ~weak_ptr();
45573606
45583607 _LIBCPP_INLINE_VISIBILITY
......@@ -4566,8 +3615,6 @@ public:
45663615 _LIBCPP_INLINE_VISIBILITY
45673616 operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT;
45683617
4569#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4570
45713618 _LIBCPP_INLINE_VISIBILITY
45723619 weak_ptr& operator=(weak_ptr&& __r) _NOEXCEPT;
45733620 template<class _Yp>
......@@ -4579,8 +3626,6 @@ public:
45793626 _LIBCPP_INLINE_VISIBILITY
45803627 operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT;
45813628
4582#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4583
45843629 template<class _Yp>
45853630 typename enable_if
45863631 <
......@@ -4600,7 +3645,7 @@ public:
46003645 {return __cntrl_ ? __cntrl_->use_count() : 0;}
46013646 _LIBCPP_INLINE_VISIBILITY
46023647 bool expired() const _NOEXCEPT
4603 {return __cntrl_ == 0 || __cntrl_->use_count() == 0;}
3648 {return __cntrl_ == nullptr || __cntrl_->use_count() == 0;}
46043649 shared_ptr<_Tp> lock() const _NOEXCEPT;
46053650 template<class _Up>
46063651 _LIBCPP_INLINE_VISIBILITY
......@@ -4624,8 +3669,8 @@ template<class _Tp>
46243669inline
46253670_LIBCPP_CONSTEXPR
46263671weak_ptr<_Tp>::weak_ptr() _NOEXCEPT
4627 : __ptr_(0),
4628 __cntrl_(0)
3672 : __ptr_(nullptr),
3673 __cntrl_(nullptr)
46293674{
46303675}
46313676
......@@ -4665,16 +3710,14 @@ weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp> const& __r,
46653710 __cntrl_->__add_weak();
46663711}
46673712
4668#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4669
46703713template<class _Tp>
46713714inline
46723715weak_ptr<_Tp>::weak_ptr(weak_ptr&& __r) _NOEXCEPT
46733716 : __ptr_(__r.__ptr_),
46743717 __cntrl_(__r.__cntrl_)
46753718{
4676 __r.__ptr_ = 0;
4677 __r.__cntrl_ = 0;
3719 __r.__ptr_ = nullptr;
3720 __r.__cntrl_ = nullptr;
46783721}
46793722
46803723template<class _Tp>
......@@ -4686,12 +3729,10 @@ weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp>&& __r,
46863729 : __ptr_(__r.__ptr_),
46873730 __cntrl_(__r.__cntrl_)
46883731{
4689 __r.__ptr_ = 0;
4690 __r.__cntrl_ = 0;
3732 __r.__ptr_ = nullptr;
3733 __r.__cntrl_ = nullptr;
46913734}
46923735
4693#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4694
46953736template<class _Tp>
46963737weak_ptr<_Tp>::~weak_ptr()
46973738{
......@@ -4722,8 +3763,6 @@ weak_ptr<_Tp>::operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT
47223763 return *this;
47233764}
47243765
4725#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4726
47273766template<class _Tp>
47283767inline
47293768weak_ptr<_Tp>&
......@@ -4747,8 +3786,6 @@ weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT
47473786 return *this;
47483787}
47493788
4750#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4751
47523789template<class _Tp>
47533790template<class _Yp>
47543791inline
......@@ -4795,7 +3832,7 @@ shared_ptr<_Tp>::shared_ptr(const weak_ptr<_Yp>& __r,
47953832 : __ptr_(__r.__ptr_),
47963833 __cntrl_(__r.__cntrl_ ? __r.__cntrl_->lock() : __r.__cntrl_)
47973834{
4798 if (__cntrl_ == 0)
3835 if (__cntrl_ == nullptr)
47993836 __throw_bad_weak_ptr();
48003837}
48013838
......@@ -5130,35 +4167,35 @@ _LIBCPP_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t&
51304167
51314168// --- Helper for container swap --
51324169template <typename _Alloc>
5133inline _LIBCPP_INLINE_VISIBILITY
5134void __swap_allocator(_Alloc & __a1, _Alloc & __a2)
4170_LIBCPP_INLINE_VISIBILITY
4171void __swap_allocator(_Alloc & __a1, _Alloc & __a2, true_type)
51354172#if _LIBCPP_STD_VER >= 14
51364173 _NOEXCEPT
51374174#else
51384175 _NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
51394176#endif
51404177{
5141 __swap_allocator(__a1, __a2,
5142 integral_constant<bool, _VSTD::allocator_traits<_Alloc>::propagate_on_container_swap::value>());
4178 using _VSTD::swap;
4179 swap(__a1, __a2);
51434180}
51444181
51454182template <typename _Alloc>
5146_LIBCPP_INLINE_VISIBILITY
5147void __swap_allocator(_Alloc & __a1, _Alloc & __a2, true_type)
4183inline _LIBCPP_INLINE_VISIBILITY
4184void __swap_allocator(_Alloc &, _Alloc &, false_type) _NOEXCEPT {}
4185
4186template <typename _Alloc>
4187inline _LIBCPP_INLINE_VISIBILITY
4188void __swap_allocator(_Alloc & __a1, _Alloc & __a2)
51484189#if _LIBCPP_STD_VER >= 14
51494190 _NOEXCEPT
51504191#else
51514192 _NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
51524193#endif
51534194{
5154 using _VSTD::swap;
5155 swap(__a1, __a2);
4195 _VSTD::__swap_allocator(__a1, __a2,
4196 integral_constant<bool, _VSTD::allocator_traits<_Alloc>::propagate_on_container_swap::value>());
51564197}
51574198
5158template <typename _Alloc>
5159inline _LIBCPP_INLINE_VISIBILITY
5160void __swap_allocator(_Alloc &, _Alloc &, false_type) _NOEXCEPT {}
5161
51624199template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >
51634200struct __noexcept_move_assign_container : public integral_constant<bool,
51644201 _Traits::propagate_on_container_move_assignment::value
......@@ -5170,7 +4207,6 @@ struct __noexcept_move_assign_container : public integral_constant<bool,
51704207 > {};
51714208
51724209
5173#ifndef _LIBCPP_HAS_NO_VARIADICS
51744210template <class _Tp, class _Alloc>
51754211struct __temp_value {
51764212 typedef allocator_traits<_Alloc> _Traits;
......@@ -5190,7 +4226,6 @@ struct __temp_value {
51904226
51914227 ~__temp_value() { _Traits::destroy(__a, __addr()); }
51924228 };
5193#endif
51944229
51954230template<typename _Alloc, typename = void, typename = void>
51964231struct __is_allocator : false_type {};
......@@ -5214,7 +4249,7 @@ struct __builtin_new_allocator {
52144249 : __size_(__size), __align_(__align) {}
52154250
52164251 void operator()(void* p) const _NOEXCEPT {
5217 std::__libcpp_deallocate(p, __size_, __align_);
4252 _VSTD::__libcpp_deallocate(p, __size_, __align_);
52184253 }
52194254
52204255 private:
......@@ -5225,13 +4260,13 @@ struct __builtin_new_allocator {
52254260 typedef unique_ptr<void, __builtin_new_deleter> __holder_t;
52264261
52274262 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),
52294264 __builtin_new_deleter(__s, __align));
52304265 }
52314266
52324267 static void __deallocate_bytes(void* __p, size_t __s,
52334268 size_t __align) _NOEXCEPT {
5234 std::__libcpp_deallocate(__p, __s, __align);
4269 _VSTD::__libcpp_deallocate(__p, __s, __align);
52354270 }
52364271
52374272 template <class _Tp>
lib/libcxx/include/module.modulemap+1
......@@ -522,6 +522,7 @@ module std [system] {
522522 }
523523
524524 // FIXME: These should be private.
525 module __bits { header "__bits" export * }
525526 module __bit_reference { header "__bit_reference" export * }
526527 module __debug { header "__debug" export * }
527528 module __errc { header "__errc" export * }
lib/libcxx/include/mutex+1-1
......@@ -626,7 +626,7 @@ private:
626626 _LIBCPP_INLINE_VISIBILITY
627627 void __execute(__tuple_indices<_Indices...>)
628628 {
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_))...);
630630 }
631631};
632632
lib/libcxx/include/new+80-93
......@@ -49,11 +49,11 @@ new_handler get_new_handler() noexcept;
4949template <class T> constexpr T* launder(T* p) noexcept; // C++17
5050} // std
5151
52void* operator new(std::size_t size); // replaceable, nodiscard in C++2a
53void* operator new(std::size_t size, std::align_val_t alignment); // replaceable, C++17, nodiscard in C++2a
54void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++2a
52void* 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++20
54void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++20
5555void* operator new(std::size_t size, std::align_val_t alignment,
56 const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++2a
56 const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++20
5757void operator delete(void* ptr) noexcept; // replaceable
5858void operator delete(void* ptr, std::size_t size) noexcept; // replaceable, C++14
5959void 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
6363void operator delete(void* ptr, std:align_val_t alignment,
6464 const std::nothrow_t&) noexcept; // replaceable, C++17
6565
66void* operator new[](std::size_t size); // replaceable, nodiscard in C++2a
66void* operator new[](std::size_t size); // replaceable, nodiscard in C++20
6767void* operator new[](std::size_t size,
68 std::align_val_t alignment) noexcept; // replaceable, C++17, nodiscard in C++2a
69void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++2a
68 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++20
7070void* operator new[](std::size_t size, std::align_val_t alignment,
71 const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++2a
71 const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++20
7272void operator delete[](void* ptr) noexcept; // replaceable
7373void operator delete[](void* ptr, std::size_t size) noexcept; // replaceable, C++14
7474void operator delete[](void* ptr,
......@@ -79,21 +79,20 @@ void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // repla
7979void operator delete[](void* ptr, std::align_val_t alignment,
8080 const std::nothrow_t&) noexcept; // replaceable, C++17
8181
82void* operator new (std::size_t size, void* ptr) noexcept; // nodiscard in C++2a
83void* operator new[](std::size_t size, void* ptr) noexcept; // nodiscard in C++2a
82void* 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++20
8484void operator delete (void* ptr, void*) noexcept;
8585void operator delete[](void* ptr, void*) noexcept;
8686
8787*/
8888
8989#include <__config>
90#include <__availability>
91#include <cstddef>
92#include <cstdlib>
9093#include <exception>
9194#include <type_traits>
92#include <cstddef>
9395#include <version>
94#ifdef _LIBCPP_NO_EXCEPTIONS
95#include <cstdlib>
96#endif
9796
9897#if defined(_LIBCPP_ABI_VCRUNTIME)
9998#include <new.h>
......@@ -117,11 +116,6 @@ void operator delete[](void* ptr, void*) noexcept;
117116# define _LIBCPP_HAS_NO_SIZED_DEALLOCATION
118117#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
125119namespace std // purposefully not using versioning namespace
126120{
127121
......@@ -234,31 +228,54 @@ _LIBCPP_CONSTEXPR inline _LIBCPP_INLINE_VISIBILITY bool __is_overaligned_for_new
234228#endif
235229}
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) {
238253#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
239254 if (__is_overaligned_for_new(__align)) {
240255 const align_val_t __align_val = static_cast<align_val_t>(__align);
241# ifdef _LIBCPP_HAS_NO_BUILTIN_OVERLOADED_OPERATOR_NEW_DELETE
242 return ::operator new(__size, __align_val);
243# else
244 return __builtin_operator_new(__size, __align_val);
245# endif
256 return __libcpp_operator_new(__size, __align_val);
246257 }
247#else
248 ((void)__align);
249258#endif
250#ifdef _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE
251 return ::operator new(__size);
259
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...);
252270#else
253 return __builtin_operator_new(__size);
271 return __libcpp_operator_delete(__ptr, __size, __args...);
254272#endif
255273}
256274
257struct _DeallocateCaller {
258 static inline _LIBCPP_INLINE_VISIBILITY
259 void __do_deallocate_handle_size_align(void *__ptr, size_t __size, size_t __align) {
275inline _LIBCPP_INLINE_VISIBILITY
276void __libcpp_deallocate(void* __ptr, size_t __size, size_t __align) {
260277#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
261 ((void)__align);
278 (void)__align;
262279 return __do_deallocate_handle_size(__ptr, __size);
263280#else
264281 if (__is_overaligned_for_new(__align)) {
......@@ -268,81 +285,51 @@ struct _DeallocateCaller {
268285 return __do_deallocate_handle_size(__ptr, __size);
269286 }
270287#endif
271 }
288}
272289
273 static inline _LIBCPP_INLINE_VISIBILITY
274 void __do_deallocate_handle_align(void *__ptr, size_t __align) {
290inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate_unsized(void* __ptr, size_t __align) {
275291#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
276 ((void)__align);
277 return __do_call(__ptr);
292 (void)__align;
293 return __libcpp_operator_delete(__ptr);
278294#else
279295 if (__is_overaligned_for_new(__align)) {
280296 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);
282298 } else {
283 return __do_call(__ptr);
299 return __libcpp_operator_delete(__ptr);
284300 }
285301#endif
286 }
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 }
302}
319303
320 template <class _A1>
321 static inline void __do_call(void *__ptr, _A1 __a1) {
322#if defined(_LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE) || \
323 defined(_LIBCPP_HAS_NO_BUILTIN_OVERLOADED_OPERATOR_NEW_DELETE)
324 return ::operator delete(__ptr, __a1);
304#if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
305// Low-level helpers to call the aligned allocation and deallocation functions
306// on the target platform. This is used to implement libc++'s own memory
307// allocation routines -- if you need to allocate memory inside the library,
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);
325315#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;
327320#endif
328 }
321}
329322
330 static inline void __do_call(void *__ptr) {
331#ifdef _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE
332 return ::operator delete(__ptr);
323inline _LIBCPP_INLINE_VISIBILITY
324void __libcpp_aligned_free(void* __ptr) {
325#if defined(_LIBCPP_MSVCRT_LIKE)
326 ::_aligned_free(__ptr);
333327#else
334 return __builtin_operator_delete(__ptr);
328 ::free(__ptr);
335329#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);
341330}
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
347334template <class _Tp>
348335_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>{};
100100template <class T> inline constexpr T phi_v = __illformed<T>{};
101101
102102template <class T>
103concept __floating_point = std::is_floating_point_v<T>;
103concept __floating_point = is_floating_point_v<T>;
104104
105105template <__floating_point T> inline constexpr T e_v<T> = 2.718281828459045235360287471352662;
106106template <__floating_point T> inline constexpr T log2e_v<T> = 1.442695040888963407359924681001892;
lib/libcxx/include/numeric+118-73
......@@ -17,115 +17,116 @@ namespace std
1717{
1818
1919template <class InputIterator, class T>
20 T
20 constexpr T // constexpr since C++20
2121 accumulate(InputIterator first, InputIterator last, T init);
2222
2323template <class InputIterator, class T, class BinaryOperation>
24 T
24 constexpr T // constexpr since C++20
2525 accumulate(InputIterator first, InputIterator last, T init, BinaryOperation binary_op);
2626
2727template<class InputIterator>
28 typename iterator_traits<InputIterator>::value_type
28 constexpr typename iterator_traits<InputIterator>::value_type // constexpr since C++20
2929 reduce(InputIterator first, InputIterator last); // C++17
3030
3131template<class InputIterator, class T>
32 T
32 constexpr T // constexpr since C++20
3333 reduce(InputIterator first, InputIterator last, T init); // C++17
3434
3535template<class InputIterator, class T, class BinaryOperation>
36 T
36 constexpr T // constexpr since C++20
3737 reduce(InputIterator first, InputIterator last, T init, BinaryOperation binary_op); // C++17
3838
3939template <class InputIterator1, class InputIterator2, class T>
40 T
40 constexpr T // constexpr since C++20
4141 inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T init);
4242
4343template <class InputIterator1, class InputIterator2, class T, class BinaryOperation1, class BinaryOperation2>
44 T
44 constexpr T // constexpr since C++20
4545 inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2,
4646 T init, BinaryOperation1 binary_op1, BinaryOperation2 binary_op2);
4747
4848
4949template<class InputIterator1, class InputIterator2, class T>
50 T
50 constexpr T // constexpr since C++20
5151 transform_reduce(InputIterator1 first1, InputIterator1 last1,
5252 InputIterator2 first2, T init); // C++17
5353
5454template<class InputIterator1, class InputIterator2, class T, class BinaryOperation1, class BinaryOperation2>
55 T
55 constexpr T // constexpr since C++20
5656 transform_reduce(InputIterator1 first1, InputIterator1 last1,
5757 InputIterator2 first2, T init,
5858 BinaryOperation1 binary_op1, BinaryOperation2 binary_op2); // C++17
5959
6060template<class InputIterator, class T, class BinaryOperation, class UnaryOperation>
61 T
61 constexpr T // constexpr since C++20
6262 transform_reduce(InputIterator first, InputIterator last, T init,
6363 BinaryOperation binary_op, UnaryOperation unary_op); // C++17
6464
6565template <class InputIterator, class OutputIterator>
66 OutputIterator
66 constexpr OutputIterator // constexpr since C++20
6767 partial_sum(InputIterator first, InputIterator last, OutputIterator result);
6868
6969template <class InputIterator, class OutputIterator, class BinaryOperation>
70 OutputIterator
70 constexpr OutputIterator // constexpr since C++20
7171 partial_sum(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op);
7272
7373template<class InputIterator, class OutputIterator, class T>
74 OutputIterator
74 constexpr OutputIterator // constexpr since C++20
7575 exclusive_scan(InputIterator first, InputIterator last,
7676 OutputIterator result, T init); // C++17
7777
7878template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
79 OutputIterator
79 constexpr OutputIterator // constexpr since C++20
8080 exclusive_scan(InputIterator first, InputIterator last,
8181 OutputIterator result, T init, BinaryOperation binary_op); // C++17
8282
8383template<class InputIterator, class OutputIterator>
84 OutputIterator
84 constexpr OutputIterator // constexpr since C++20
8585 inclusive_scan(InputIterator first, InputIterator last, OutputIterator result); // C++17
8686
8787template<class InputIterator, class OutputIterator, class BinaryOperation>
88 OutputIterator
88 constexpr OutputIterator // constexpr since C++20
8989 inclusive_scan(InputIterator first, InputIterator last,
9090 OutputIterator result, BinaryOperation binary_op); // C++17
9191
9292template<class InputIterator, class OutputIterator, class BinaryOperation, class T>
93 OutputIterator
93 constexpr OutputIterator // constexpr since C++20
9494 inclusive_scan(InputIterator first, InputIterator last,
9595 OutputIterator result, BinaryOperation binary_op, T init); // C++17
9696
9797template<class InputIterator, class OutputIterator, class T,
9898 class BinaryOperation, class UnaryOperation>
99 OutputIterator
99 constexpr OutputIterator // constexpr since C++20
100100 transform_exclusive_scan(InputIterator first, InputIterator last,
101101 OutputIterator result, T init,
102102 BinaryOperation binary_op, UnaryOperation unary_op); // C++17
103103
104104template<class InputIterator, class OutputIterator,
105105 class BinaryOperation, class UnaryOperation>
106 OutputIterator
106 constexpr OutputIterator // constexpr since C++20
107107 transform_inclusive_scan(InputIterator first, InputIterator last,
108108 OutputIterator result,
109109 BinaryOperation binary_op, UnaryOperation unary_op); // C++17
110110
111111template<class InputIterator, class OutputIterator,
112112 class BinaryOperation, class UnaryOperation, class T>
113 OutputIterator
113 constexpr OutputIterator // constexpr since C++20
114114 transform_inclusive_scan(InputIterator first, InputIterator last,
115115 OutputIterator result,
116116 BinaryOperation binary_op, UnaryOperation unary_op,
117117 T init); // C++17
118118
119119template <class InputIterator, class OutputIterator>
120 OutputIterator
120 constexpr OutputIterator // constexpr since C++20
121121 adjacent_difference(InputIterator first, InputIterator last, OutputIterator result);
122122
123123template <class InputIterator, class OutputIterator, class BinaryOperation>
124 OutputIterator
124 constexpr OutputIterator // constexpr since C++20
125125 adjacent_difference(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op);
126126
127127template <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
130131template <class M, class N>
131132 constexpr common_type_t<M,N> gcd(M m, N n); // C++17
......@@ -133,9 +134,11 @@ template <class M, class N>
133134template <class M, class N>
134135 constexpr common_type_t<M,N> lcm(M m, N n); // C++17
135136
136integer midpoint(integer a, integer b); // C++20
137pointer midpoint(pointer a, pointer b); // C++20
138floating_point midpoint(floating_point a, floating_point b); // C++20
137template<class T>
138 constexpr T midpoint(T a, T b) noexcept; // C++20
139
140template<class T>
141 constexpr T* midpoint(T* a, T* b); // C++20
139142
140143} // std
141144
......@@ -158,28 +161,36 @@ _LIBCPP_PUSH_MACROS
158161_LIBCPP_BEGIN_NAMESPACE_STD
159162
160163template <class _InputIterator, class _Tp>
161inline _LIBCPP_INLINE_VISIBILITY
164_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
162165_Tp
163166accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
164167{
165168 for (; __first != __last; ++__first)
169#if _LIBCPP_STD_VER > 17
170 __init = _VSTD::move(__init) + *__first;
171#else
166172 __init = __init + *__first;
173#endif
167174 return __init;
168175}
169176
170177template <class _InputIterator, class _Tp, class _BinaryOperation>
171inline _LIBCPP_INLINE_VISIBILITY
178_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
172179_Tp
173180accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOperation __binary_op)
174181{
175182 for (; __first != __last; ++__first)
183#if _LIBCPP_STD_VER > 17
184 __init = __binary_op(_VSTD::move(__init), *__first);
185#else
176186 __init = __binary_op(__init, *__first);
187#endif
177188 return __init;
178189}
179190
180191#if _LIBCPP_STD_VER > 14
181192template <class _InputIterator, class _Tp, class _BinaryOp>
182inline _LIBCPP_INLINE_VISIBILITY
193_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
183194_Tp
184195reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b)
185196{
......@@ -189,7 +200,7 @@ reduce(_InputIterator __first, _InputIterator __last, _Tp __init, _BinaryOp __b)
189200}
190201
191202template <class _InputIterator, class _Tp>
192inline _LIBCPP_INLINE_VISIBILITY
203_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
193204_Tp
194205reduce(_InputIterator __first, _InputIterator __last, _Tp __init)
195206{
......@@ -197,7 +208,7 @@ reduce(_InputIterator __first, _InputIterator __last, _Tp __init)
197208}
198209
199210template <class _InputIterator>
200inline _LIBCPP_INLINE_VISIBILITY
211_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
201212typename iterator_traits<_InputIterator>::value_type
202213reduce(_InputIterator __first, _InputIterator __last)
203214{
......@@ -207,29 +218,37 @@ reduce(_InputIterator __first, _InputIterator __last)
207218#endif
208219
209220template <class _InputIterator1, class _InputIterator2, class _Tp>
210inline _LIBCPP_INLINE_VISIBILITY
221_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
211222_Tp
212223inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init)
213224{
214225 for (; __first1 != __last1; ++__first1, (void) ++__first2)
226#if _LIBCPP_STD_VER > 17
227 __init = _VSTD::move(__init) + *__first1 * *__first2;
228#else
215229 __init = __init + *__first1 * *__first2;
230#endif
216231 return __init;
217232}
218233
219234template <class _InputIterator1, class _InputIterator2, class _Tp, class _BinaryOperation1, class _BinaryOperation2>
220inline _LIBCPP_INLINE_VISIBILITY
235_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
221236_Tp
222237inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,
223238 _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2)
224239{
225240 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
226244 __init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
245#endif
227246 return __init;
228247}
229248
230249#if _LIBCPP_STD_VER > 14
231250template <class _InputIterator, class _Tp, class _BinaryOp, class _UnaryOp>
232inline _LIBCPP_INLINE_VISIBILITY
251_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
233252_Tp
234253transform_reduce(_InputIterator __first, _InputIterator __last,
235254 _Tp __init, _BinaryOp __b, _UnaryOp __u)
......@@ -241,7 +260,7 @@ transform_reduce(_InputIterator __first, _InputIterator __last,
241260
242261template <class _InputIterator1, class _InputIterator2,
243262 class _Tp, class _BinaryOp1, class _BinaryOp2>
244inline _LIBCPP_INLINE_VISIBILITY
263_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
245264_Tp
246265transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1,
247266 _InputIterator2 __first2, _Tp __init, _BinaryOp1 __b1, _BinaryOp2 __b2)
......@@ -252,7 +271,7 @@ transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1,
252271}
253272
254273template <class _InputIterator1, class _InputIterator2, class _Tp>
255inline _LIBCPP_INLINE_VISIBILITY
274_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
256275_Tp
257276transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1,
258277 _InputIterator2 __first2, _Tp __init)
......@@ -263,7 +282,7 @@ transform_reduce(_InputIterator1 __first1, _InputIterator1 __last1,
263282#endif
264283
265284template <class _InputIterator, class _OutputIterator>
266inline _LIBCPP_INLINE_VISIBILITY
285_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
267286_OutputIterator
268287partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
269288{
......@@ -273,7 +292,11 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
273292 *__result = __t;
274293 for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
275294 {
295#if _LIBCPP_STD_VER > 17
296 __t = _VSTD::move(__t) + *__first;
297#else
276298 __t = __t + *__first;
299#endif
277300 *__result = __t;
278301 }
279302 }
......@@ -281,7 +304,7 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
281304}
282305
283306template <class _InputIterator, class _OutputIterator, class _BinaryOperation>
284inline _LIBCPP_INLINE_VISIBILITY
307_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
285308_OutputIterator
286309partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
287310 _BinaryOperation __binary_op)
......@@ -292,7 +315,11 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
292315 *__result = __t;
293316 for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
294317 {
318#if _LIBCPP_STD_VER > 17
319 __t = __binary_op(_VSTD::move(__t), *__first);
320#else
295321 __t = __binary_op(__t, *__first);
322#endif
296323 *__result = __t;
297324 }
298325 }
......@@ -301,27 +328,30 @@ partial_sum(_InputIterator __first, _InputIterator __last, _OutputIterator __res
301328
302329#if _LIBCPP_STD_VER > 14
303330template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp>
304inline _LIBCPP_INLINE_VISIBILITY
331_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
305332_OutputIterator
306333exclusive_scan(_InputIterator __first, _InputIterator __last,
307334 _OutputIterator __result, _Tp __init, _BinaryOp __b)
308335{
309336 if (__first != __last)
310337 {
311 _Tp __saved = __init;
312 do
338 _Tp __tmp(__b(__init, *__first));
339 while (true)
313340 {
314 __init = __b(__init, *__first);
315 *__result = __saved;
316 __saved = __init;
341 *__result = _VSTD::move(__init);
317342 ++__result;
318 } while (++__first != __last);
343 ++__first;
344 if (__first == __last)
345 break;
346 __init = _VSTD::move(__tmp);
347 __tmp = __b(__init, *__first);
348 }
319349 }
320350 return __result;
321351}
322352
323353template <class _InputIterator, class _OutputIterator, class _Tp>
324inline _LIBCPP_INLINE_VISIBILITY
354_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
325355_OutputIterator
326356exclusive_scan(_InputIterator __first, _InputIterator __last,
327357 _OutputIterator __result, _Tp __init)
......@@ -330,40 +360,43 @@ exclusive_scan(_InputIterator __first, _InputIterator __last,
330360}
331361
332362template <class _InputIterator, class _OutputIterator, class _Tp, class _BinaryOp>
363_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
333364_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,
334365 _OutputIterator __result, _BinaryOp __b, _Tp __init)
335366{
336367 for (; __first != __last; ++__first, (void) ++__result) {
337368 __init = __b(__init, *__first);
338369 *__result = __init;
339 }
370 }
340371 return __result;
341372}
342373
343374template <class _InputIterator, class _OutputIterator, class _BinaryOp>
375_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
344376_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,
345377 _OutputIterator __result, _BinaryOp __b)
346378{
347379 if (__first != __last) {
348 typename std::iterator_traits<_InputIterator>::value_type __init = *__first;
380 typename iterator_traits<_InputIterator>::value_type __init = *__first;
349381 *__result++ = __init;
350382 if (++__first != __last)
351383 return _VSTD::inclusive_scan(__first, __last, __result, __b, __init);
352 }
384 }
353385
354386 return __result;
355387}
356388
357389template <class _InputIterator, class _OutputIterator>
390_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
358391_OutputIterator inclusive_scan(_InputIterator __first, _InputIterator __last,
359392 _OutputIterator __result)
360393{
361 return _VSTD::inclusive_scan(__first, __last, __result, std::plus<>());
394 return _VSTD::inclusive_scan(__first, __last, __result, _VSTD::plus<>());
362395}
363396
364397template <class _InputIterator, class _OutputIterator, class _Tp,
365398 class _BinaryOp, class _UnaryOp>
366inline _LIBCPP_INLINE_VISIBILITY
399_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
367400_OutputIterator
368401transform_exclusive_scan(_InputIterator __first, _InputIterator __last,
369402 _OutputIterator __result, _Tp __init,
......@@ -384,7 +417,9 @@ transform_exclusive_scan(_InputIterator __first, _InputIterator __last,
384417}
385418
386419template <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,
388423 _OutputIterator __result, _BinaryOp __b, _UnaryOp __u, _Tp __init)
389424{
390425 for (; __first != __last; ++__first, (void) ++__result) {
......@@ -396,61 +431,71 @@ _OutputIterator transform_inclusive_scan(_InputIterator __first, _InputIterator
396431}
397432
398433template <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,
400437 _OutputIterator __result, _BinaryOp __b, _UnaryOp __u)
401438{
402439 if (__first != __last) {
403 typename std::iterator_traits<_InputIterator>::value_type __init = __u(*__first);
440 typename iterator_traits<_InputIterator>::value_type __init = __u(*__first);
404441 *__result++ = __init;
405442 if (++__first != __last)
406443 return _VSTD::transform_inclusive_scan(__first, __last, __result, __b, __u, __init);
407 }
444 }
408445
409446 return __result;
410447}
411448#endif
412449
413450template <class _InputIterator, class _OutputIterator>
414inline _LIBCPP_INLINE_VISIBILITY
451_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
415452_OutputIterator
416453adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
417454{
418455 if (__first != __last)
419456 {
420 typename iterator_traits<_InputIterator>::value_type __t1(*__first);
421 *__result = __t1;
457 typename iterator_traits<_InputIterator>::value_type __acc(*__first);
458 *__result = __acc;
422459 for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
423460 {
424 typename iterator_traits<_InputIterator>::value_type __t2(*__first);
425 *__result = __t2 - __t1;
426 __t1 = _VSTD::move(__t2);
461 typename iterator_traits<_InputIterator>::value_type __val(*__first);
462#if _LIBCPP_STD_VER > 17
463 *__result = __val - _VSTD::move(__acc);
464#else
465 *__result = __val - __acc;
466#endif
467 __acc = _VSTD::move(__val);
427468 }
428469 }
429470 return __result;
430471}
431472
432473template <class _InputIterator, class _OutputIterator, class _BinaryOperation>
433inline _LIBCPP_INLINE_VISIBILITY
474_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
434475_OutputIterator
435476adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
436477 _BinaryOperation __binary_op)
437478{
438479 if (__first != __last)
439480 {
440 typename iterator_traits<_InputIterator>::value_type __t1(*__first);
441 *__result = __t1;
481 typename iterator_traits<_InputIterator>::value_type __acc(*__first);
482 *__result = __acc;
442483 for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
443484 {
444 typename iterator_traits<_InputIterator>::value_type __t2(*__first);
445 *__result = __binary_op(__t2, __t1);
446 __t1 = _VSTD::move(__t2);
485 typename iterator_traits<_InputIterator>::value_type __val(*__first);
486#if _LIBCPP_STD_VER > 17
487 *__result = __binary_op(__val, _VSTD::move(__acc));
488#else
489 *__result = __binary_op(__val, __acc);
490#endif
491 __acc = _VSTD::move(__val);
447492 }
448493 }
449494 return __result;
450495}
451496
452497template <class _ForwardIterator, class _Tp>
453inline _LIBCPP_INLINE_VISIBILITY
498_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
454499void
455500iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value_)
456501{
......@@ -467,9 +512,9 @@ struct __ct_abs<_Result, _Source, true> {
467512 _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
468513 _Result operator()(_Source __t) const noexcept
469514 {
470 if (__t >= 0) return __t;
471 if (__t == numeric_limits<_Source>::min()) return -static_cast<_Result>(__t);
472 return -__t;
515 if (__t >= 0) return __t;
516 if (__t == numeric_limits<_Source>::min()) return -static_cast<_Result>(__t);
517 return -__t;
473518 }
474519};
475520
......@@ -531,8 +576,8 @@ enable_if_t<is_integral_v<_Tp> && !is_same_v<bool, _Tp> && !is_null_pointer_v<_T
531576midpoint(_Tp __a, _Tp __b) noexcept
532577_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
533578{
534 using _Up = std::make_unsigned_t<_Tp>;
535 constexpr _Up __bitshift = std::numeric_limits<_Up>::digits - 1;
579 using _Up = make_unsigned_t<_Tp>;
580 constexpr _Up __bitshift = numeric_limits<_Up>::digits - 1;
536581
537582 _Up __diff = _Up(__b) - _Up(__a);
538583 _Up __sign_bit = __b < __a;
lib/libcxx/include/optional+3-2
......@@ -147,6 +147,7 @@ template<class T>
147147*/
148148
149149#include <__config>
150#include <__availability>
150151#include <__debug>
151152#include <__functional_base>
152153#include <functional>
......@@ -320,7 +321,7 @@ struct __optional_storage_base : __optional_destruct_base<_Tp>
320321 void __construct(_Args&&... __args)
321322 {
322323 _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)...);
324325 this->__engaged_ = true;
325326 }
326327
......@@ -656,7 +657,7 @@ private:
656657 }
657658 template <class _Up, class _QUp = _QualUp>
658659 static constexpr bool __enable_assign() {
659 // Construction and assignability of _Qup to _Tp has already been
660 // Construction and assignability of _QUp to _Tp has already been
660661 // checked.
661662 return !__check_constructible_from_opt<_Up>::value &&
662663 !__check_assignable_from_opt<_Up>::value;
lib/libcxx/include/ostream+15-13
......@@ -126,9 +126,8 @@ template <class charT, class traits>
126126 basic_ostream<charT,traits>& flush(basic_ostream<charT,traits>& os);
127127
128128// rvalue stream insertion
129template <class charT, class traits, class T>
130 basic_ostream<charT, traits>&
131 operator<<(basic_ostream<charT, traits>&& os, const T& x);
129template <class Stream, class T>
130 Stream&& operator<<(Stream&& os, const T& x);
132131
133132} // std
134133
......@@ -1028,15 +1027,20 @@ flush(basic_ostream<_CharT, _Traits>& __os)
10281027
10291028#ifndef _LIBCPP_CXX03_LANG
10301029
1030template <class _Stream, class _Tp, class = void>
1031struct __is_ostreamable : false_type { };
1032
10311033template <class _Stream, class _Tp>
1032inline _LIBCPP_INLINE_VISIBILITY
1033typename enable_if
1034<
1035 !is_lvalue_reference<_Stream>::value &&
1036 is_base_of<ios_base, _Stream>::value,
1037 _Stream&&
1038>::type
1039operator<<(_Stream&& __os, const _Tp& __x)
1034struct __is_ostreamable<_Stream, _Tp, decltype(
1035 _VSTD::declval<_Stream>() << _VSTD::declval<_Tp>(), void()
1036)> : true_type { };
1037
1038template <class _Stream, class _Tp, class = typename enable_if<
1039 _And<is_base_of<ios_base, _Stream>,
1040 __is_ostreamable<_Stream&, const _Tp&>>::value
1041>::type>
1042_LIBCPP_INLINE_VISIBILITY
1043_Stream&& operator<<(_Stream&& __os, const _Tp& __x)
10401044{
10411045 __os << __x;
10421046 return _VSTD::move(__os);
......@@ -1097,10 +1101,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
10971101 use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
10981102}
10991103
1100#ifndef _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
11011104_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>)
11021105_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>)
1103#endif
11041106
11051107_LIBCPP_END_NAMESPACE_STD
11061108
lib/libcxx/include/queue+6-13
......@@ -112,18 +112,11 @@ protected:
112112 Compare comp;
113113
114114public:
115 priority_queue() = default;
116 ~priority_queue() = default;
117
118 priority_queue(const priority_queue& q) = default;
119 priority_queue(priority_queue&& q) = default;
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);
115 priority_queue() : priority_queue(Compare()) {} // C++20
116 explicit priority_queue(const Compare& x) : priority_queue(x, Container()) {}
117 priority_queue(const Compare& x, const Container&);
118 explicit priority_queue(const Compare& x = Compare(), Container&&= Container()); // before C++20
119 priority_queue(const Compare& x, Container&&); // C++20
127120 template <class InputIterator>
128121 priority_queue(InputIterator first, InputIterator last,
129122 const Compare& comp = Compare());
......@@ -474,7 +467,7 @@ public:
474467 priority_queue(const value_compare& __comp, const container_type& __c);
475468#ifndef _LIBCPP_CXX03_LANG
476469 _LIBCPP_INLINE_VISIBILITY
477 explicit priority_queue(const value_compare& __comp, container_type&& __c);
470 priority_queue(const value_compare& __comp, container_type&& __c);
478471#endif
479472 template <class _InputIter>
480473 _LIBCPP_INLINE_VISIBILITY
lib/libcxx/include/random+385-113
......@@ -36,7 +36,9 @@ public:
3636 static constexpr result_type default_seed = 1u;
3737
3838 // 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
4042 template<class Sseq> explicit linear_congruential_engine(Sseq& q);
4143 void seed(result_type s = default_seed);
4244 template<class Sseq> void seed(Sseq& q);
......@@ -96,7 +98,9 @@ public:
9698 static constexpr result_type default_seed = 5489u;
9799
98100 // 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
100104 template<class Sseq> explicit mersenne_twister_engine(Sseq& q);
101105 void seed(result_type value = default_seed);
102106 template<class Sseq> void seed(Sseq& q);
......@@ -154,7 +158,9 @@ public:
154158 static constexpr result_type default_seed = 19780503u;
155159
156160 // 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
158164 template<class Sseq> explicit subtract_with_carry_engine(Sseq& q);
159165 void seed(result_type value = default_seed);
160166 template<class Sseq> void seed(Sseq& q);
......@@ -385,7 +391,9 @@ public:
385391 static constexpr result_type max() { return numeric_limits<result_type>::max(); }
386392
387393 // 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
390398 // generating functions
391399 result_type operator()();
......@@ -456,7 +464,10 @@ public:
456464
457465 // constructors and reset functions
458466 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
460471 explicit uniform_int_distribution(const param_type& parm);
461472 void reset();
462473
......@@ -515,7 +526,9 @@ public:
515526 };
516527
517528 // 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
519532 explicit uniform_real_distribution(const param_type& parm);
520533 void reset();
521534
......@@ -571,7 +584,9 @@ public:
571584 };
572585
573586 // 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
575590 explicit bernoulli_distribution(const param_type& parm);
576591 void reset();
577592
......@@ -628,7 +643,9 @@ public:
628643 };
629644
630645 // 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
632649 explicit binomial_distribution(const param_type& parm);
633650 void reset();
634651
......@@ -685,7 +702,9 @@ public:
685702 };
686703
687704 // 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
689708 explicit geometric_distribution(const param_type& parm);
690709 void reset();
691710
......@@ -742,7 +761,9 @@ public:
742761 };
743762
744763 // 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
746767 explicit negative_binomial_distribution(const param_type& parm);
747768 void reset();
748769
......@@ -799,7 +820,9 @@ public:
799820 };
800821
801822 // 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
803826 explicit poisson_distribution(const param_type& parm);
804827 void reset();
805828
......@@ -855,7 +878,9 @@ public:
855878 };
856879
857880 // 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
859884 explicit exponential_distribution(const param_type& parm);
860885 void reset();
861886
......@@ -912,7 +937,9 @@ public:
912937 };
913938
914939 // 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
916943 explicit gamma_distribution(const param_type& parm);
917944 void reset();
918945
......@@ -970,7 +997,9 @@ public:
970997 };
971998
972999 // 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
9741003 explicit weibull_distribution(const param_type& parm);
9751004 void reset();
9761005
......@@ -1028,7 +1057,9 @@ public:
10281057 };
10291058
10301059 // 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
10321063 explicit extreme_value_distribution(const param_type& parm);
10331064 void reset();
10341065
......@@ -1086,7 +1117,9 @@ public:
10861117 };
10871118
10881119 // 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
10901123 explicit normal_distribution(const param_type& parm);
10911124 void reset();
10921125
......@@ -1144,7 +1177,9 @@ public:
11441177 };
11451178
11461179 // 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
11481183 explicit lognormal_distribution(const param_type& parm);
11491184 void reset();
11501185
......@@ -1201,7 +1236,9 @@ public:
12011236 };
12021237
12031238 // 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
12051242 explicit chi_squared_distribution(const param_type& parm);
12061243 void reset();
12071244
......@@ -1258,7 +1295,9 @@ public:
12581295 };
12591296
12601297 // 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
12621301 explicit cauchy_distribution(const param_type& parm);
12631302 void reset();
12641303
......@@ -1316,7 +1355,9 @@ public:
13161355 };
13171356
13181357 // 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
13201361 explicit fisher_f_distribution(const param_type& parm);
13211362 void reset();
13221363
......@@ -1373,7 +1414,9 @@ public:
13731414 };
13741415
13751416 // 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
13771420 explicit student_t_distribution(const param_type& parm);
13781421 void reset();
13791422
......@@ -1642,8 +1685,7 @@ class piecewise_linear_distribution
16421685#include <numeric>
16431686#include <vector>
16441687#include <string>
1645#include <istream>
1646#include <ostream>
1688#include <iosfwd>
16471689
16481690#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16491691#pragma GCC system_header
......@@ -1669,7 +1711,23 @@ struct __is_seed_sequence
16691711
16701712template <unsigned long long __a, unsigned long long __c,
16711713 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>
16731731struct __lce_ta;
16741732
16751733// 64
......@@ -1843,6 +1901,7 @@ private:
18431901
18441902 static_assert(__m == 0 || __a < __m, "linear_congruential_engine invalid parameters");
18451903 static_assert(__m == 0 || __c < __m, "linear_congruential_engine invalid parameters");
1904 static_assert(_VSTD::is_unsigned<_UIntType>::value, "_UIntType must be unsigned type");
18461905public:
18471906 static _LIBCPP_CONSTEXPR const result_type _Min = __c == 0u ? 1u: 0u;
18481907 static _LIBCPP_CONSTEXPR const result_type _Max = __m - 1u;
......@@ -1859,9 +1918,17 @@ public:
18591918 static _LIBCPP_CONSTEXPR const result_type default_seed = 1u;
18601919
18611920 // 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
18621927 _LIBCPP_INLINE_VISIBILITY
1863 explicit linear_congruential_engine(result_type __s = default_seed)
1864 {seed(__s);}
1928 explicit linear_congruential_engine(result_type __s = default_seed) {
1929 seed(__s);
1930 }
1931#endif
18651932 template<class _Sseq>
18661933 _LIBCPP_INLINE_VISIBILITY
18671934 explicit linear_congruential_engine(_Sseq& __q,
......@@ -1982,7 +2049,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
19822049 const linear_congruential_engine<_UIntType, __a, __c, __m>& __x)
19832050{
19842051 __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);
19862054 __os.fill(__os.widen(' '));
19872055 return __os << __x.__x_;
19882056}
......@@ -1994,7 +2062,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
19942062 linear_congruential_engine<_UIntType, __a, __c, __m>& __x)
19952063{
19962064 __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);
19982067 _UIntType __t;
19992068 __is >> __t;
20002069 if (!__is.fail())
......@@ -2106,9 +2175,17 @@ public:
21062175 static _LIBCPP_CONSTEXPR const result_type default_seed = 5489u;
21072176
21082177 // constructors and seeding functions
2178#ifndef _LIBCPP_CXX03_LANG
21092179 _LIBCPP_INLINE_VISIBILITY
2110 explicit mersenne_twister_engine(result_type __sd = default_seed)
2111 {seed(__sd);}
2180 mersenne_twister_engine() : mersenne_twister_engine(default_seed) {}
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
21122189 template<class _Sseq>
21132190 _LIBCPP_INLINE_VISIBILITY
21142191 explicit mersenne_twister_engine(_Sseq& __q,
......@@ -2453,7 +2530,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
24532530 _Bp, _Tp, _Cp, _Lp, _Fp>& __x)
24542531{
24552532 __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);
24572535 _CharT __sp = __os.widen(' ');
24582536 __os.fill(__sp);
24592537 __os << __x.__x_[__x.__i_];
......@@ -2474,7 +2552,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
24742552 _Bp, _Tp, _Cp, _Lp, _Fp>& __x)
24752553{
24762554 __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);
24782557 _UInt __t[_Np];
24792558 for (size_t __i = 0; __i < _Np; ++__i)
24802559 __is >> __t[__i];
......@@ -2562,9 +2641,17 @@ public:
25622641 static _LIBCPP_CONSTEXPR const result_type default_seed = 19780503u;
25632642
25642643 // 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
25652650 _LIBCPP_INLINE_VISIBILITY
2566 explicit subtract_with_carry_engine(result_type __sd = default_seed)
2567 {seed(__sd);}
2651 explicit subtract_with_carry_engine(result_type __sd = default_seed) {
2652 seed(__sd);
2653 }
2654#endif
25682655 template<class _Sseq>
25692656 _LIBCPP_INLINE_VISIBILITY
25702657 explicit subtract_with_carry_engine(_Sseq& __q,
......@@ -2773,7 +2860,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
27732860 const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x)
27742861{
27752862 __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);
27772865 _CharT __sp = __os.widen(' ');
27782866 __os.fill(__sp);
27792867 __os << __x.__x_[__x.__i_];
......@@ -2792,7 +2880,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
27922880 subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x)
27932881{
27942882 __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);
27962885 _UInt __t[_Rp+1];
27972886 for (size_t __i = 0; __i < _Rp+1; ++__i)
27982887 __is >> __t[__i];
......@@ -2955,7 +3044,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
29553044 const discard_block_engine<_Eng, _Pp, _Rp>& __x)
29563045{
29573046 __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);
29593049 _CharT __sp = __os.widen(' ');
29603050 __os.fill(__sp);
29613051 return __os << __x.__e_ << __sp << __x.__n_;
......@@ -2968,7 +3058,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
29683058 discard_block_engine<_Eng, _Pp, _Rp>& __x)
29693059{
29703060 __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);
29723063 _Eng __e;
29733064 int __n;
29743065 __is >> __e >> __n;
......@@ -3440,7 +3531,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
34403531 const shuffle_order_engine<_Eng, _Kp>& __x)
34413532{
34423533 __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);
34443536 _CharT __sp = __os.widen(' ');
34453537 __os.fill(__sp);
34463538 __os << __x.__e_ << __sp << __x._V_[0];
......@@ -3457,7 +3549,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
34573549{
34583550 typedef typename shuffle_order_engine<_Eng, _Kp>::result_type result_type;
34593551 __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);
34613554 _Eng __e;
34623555 result_type _Vp[_Kp+1];
34633556 __is >> __e;
......@@ -3477,6 +3570,8 @@ typedef shuffle_order_engine<minstd_rand0, 256> knuth_b;
34773570
34783571// random_device
34793572
3573#if !defined(_LIBCPP_HAS_NO_RANDOM_DEVICE)
3574
34803575class _LIBCPP_TYPE_VIS random_device
34813576{
34823577#ifdef _LIBCPP_USING_DEV_RANDOM
......@@ -3496,7 +3591,12 @@ public:
34963591 static _LIBCPP_CONSTEXPR result_type max() { return _Max;}
34973592
34983593 // constructors
3594#ifndef _LIBCPP_CXX03_LANG
3595 random_device() : random_device("/dev/urandom") {}
3596 explicit random_device(const string& __token);
3597#else
34993598 explicit random_device(const string& __token = "/dev/urandom");
3599#endif
35003600 ~random_device();
35013601
35023602 // generating functions
......@@ -3511,6 +3611,8 @@ private:
35113611 random_device& operator=(const random_device&); // = delete;
35123612};
35133613
3614#endif // !_LIBCPP_HAS_NO_RANDOM_DEVICE
3615
35143616// seed_seq
35153617
35163618class _LIBCPP_TEMPLATE_VIS seed_seq
......@@ -3663,7 +3765,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
36633765 const uniform_int_distribution<_IT>& __x)
36643766{
36653767 __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);
36673770 _CharT __sp = __os.widen(' ');
36683771 __os.fill(__sp);
36693772 return __os << __x.a() << __sp << __x.b();
......@@ -3678,7 +3781,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
36783781 typedef typename _Eng::result_type result_type;
36793782 typedef typename _Eng::param_type param_type;
36803783 __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);
36823786 result_type __a;
36833787 result_type __b;
36843788 __is >> __a >> __b;
......@@ -3726,9 +3830,16 @@ private:
37263830
37273831public:
37283832 // 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
37293839 _LIBCPP_INLINE_VISIBILITY
37303840 explicit uniform_real_distribution(result_type __a = 0, result_type __b = 1)
37313841 : __p_(param_type(__a, __b)) {}
3842#endif
37323843 _LIBCPP_INLINE_VISIBILITY
37333844 explicit uniform_real_distribution(const param_type& __p) : __p_(__p) {}
37343845 _LIBCPP_INLINE_VISIBILITY
......@@ -3784,8 +3895,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
37843895 const uniform_real_distribution<_RT>& __x)
37853896{
37863897 __save_flags<_CharT, _Traits> __lx(__os);
3787 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
3788 ios_base::scientific);
3898 typedef basic_ostream<_CharT, _Traits> _OStream;
3899 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
3900 _OStream::scientific);
37893901 _CharT __sp = __os.widen(' ');
37903902 __os.fill(__sp);
37913903 return __os << __x.a() << __sp << __x.b();
......@@ -3800,7 +3912,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
38003912 typedef typename _Eng::result_type result_type;
38013913 typedef typename _Eng::param_type param_type;
38023914 __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);
38043917 result_type __a;
38053918 result_type __b;
38063919 __is >> __a >> __b;
......@@ -3842,9 +3955,15 @@ private:
38423955
38433956public:
38443957 // constructors and reset functions
3958#ifndef _LIBCPP_CXX03_LANG
3959 _LIBCPP_INLINE_VISIBILITY
3960 bernoulli_distribution() : bernoulli_distribution(0.5) {}
38453961 _LIBCPP_INLINE_VISIBILITY
3846 explicit bernoulli_distribution(double __p = 0.5)
3847 : __p_(param_type(__p)) {}
3962 explicit bernoulli_distribution(double __p) : __p_(param_type(__p)) {}
3963#else
3964 _LIBCPP_INLINE_VISIBILITY
3965 explicit bernoulli_distribution(double __p = 0.5) : __p_(param_type(__p)) {}
3966#endif
38483967 _LIBCPP_INLINE_VISIBILITY
38493968 explicit bernoulli_distribution(const param_type& __p) : __p_(__p) {}
38503969 _LIBCPP_INLINE_VISIBILITY
......@@ -3895,8 +4014,9 @@ basic_ostream<_CharT, _Traits>&
38954014operator<<(basic_ostream<_CharT, _Traits>& __os, const bernoulli_distribution& __x)
38964015{
38974016 __save_flags<_CharT, _Traits> __lx(__os);
3898 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
3899 ios_base::scientific);
4017 typedef basic_ostream<_CharT, _Traits> _OStream;
4018 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
4019 _OStream::scientific);
39004020 _CharT __sp = __os.widen(' ');
39014021 __os.fill(__sp);
39024022 return __os << __x.p();
......@@ -3909,7 +4029,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bernoulli_distribution& __x)
39094029 typedef bernoulli_distribution _Eng;
39104030 typedef typename _Eng::param_type param_type;
39114031 __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);
39134034 double __p;
39144035 __is >> __p;
39154036 if (!__is.fail())
......@@ -3958,9 +4079,17 @@ private:
39584079
39594080public:
39604081 // 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
39614089 _LIBCPP_INLINE_VISIBILITY
39624090 explicit binomial_distribution(result_type __t = 1, double __p = 0.5)
39634091 : __p_(param_type(__t, __p)) {}
4092#endif
39644093 _LIBCPP_INLINE_VISIBILITY
39654094 explicit binomial_distribution(const param_type& __p) : __p_(__p) {}
39664095 _LIBCPP_INLINE_VISIBILITY
......@@ -3999,12 +4128,12 @@ public:
39994128 {return !(__x == __y);}
40004129};
40014130
4002#ifndef _LIBCPP_MSVCRT
4131#ifndef _LIBCPP_MSVCRT_LIKE
40034132extern "C" double lgamma_r(double, int *);
40044133#endif
40054134
40064135inline _LIBCPP_INLINE_VISIBILITY double __libcpp_lgamma(double __d) {
4007#if defined(_LIBCPP_MSVCRT)
4136#if defined(_LIBCPP_MSVCRT_LIKE)
40084137 return lgamma(__d);
40094138#else
40104139 int __sign;
......@@ -4079,8 +4208,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
40794208 const binomial_distribution<_IntType>& __x)
40804209{
40814210 __save_flags<_CharT, _Traits> __lx(__os);
4082 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
4083 ios_base::scientific);
4211 typedef basic_ostream<_CharT, _Traits> _OStream;
4212 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
4213 _OStream::scientific);
40844214 _CharT __sp = __os.widen(' ');
40854215 __os.fill(__sp);
40864216 return __os << __x.t() << __sp << __x.p();
......@@ -4095,7 +4225,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
40954225 typedef typename _Eng::result_type result_type;
40964226 typedef typename _Eng::param_type param_type;
40974227 __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);
40994230 result_type __t;
41004231 double __p;
41014232 __is >> __t >> __p;
......@@ -4138,9 +4269,17 @@ private:
41384269
41394270public:
41404271 // 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
41414279 _LIBCPP_INLINE_VISIBILITY
41424280 explicit exponential_distribution(result_type __lambda = 1)
41434281 : __p_(param_type(__lambda)) {}
4282#endif
41444283 _LIBCPP_INLINE_VISIBILITY
41454284 explicit exponential_distribution(const param_type& __p) : __p_(__p) {}
41464285 _LIBCPP_INLINE_VISIBILITY
......@@ -4197,8 +4336,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
41974336 const exponential_distribution<_RealType>& __x)
41984337{
41994338 __save_flags<_CharT, _Traits> __lx(__os);
4200 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
4201 ios_base::scientific);
4339 typedef basic_ostream<_CharT, _Traits> _OStream;
4340 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
4341 _OStream::scientific);
42024342 return __os << __x.lambda();
42034343}
42044344
......@@ -4211,7 +4351,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
42114351 typedef typename _Eng::result_type result_type;
42124352 typedef typename _Eng::param_type param_type;
42134353 __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);
42154356 result_type __lambda;
42164357 __is >> __lambda;
42174358 if (!__is.fail())
......@@ -4259,9 +4400,18 @@ private:
42594400
42604401public:
42614402 // constructors and reset functions
4403#ifndef _LIBCPP_CXX03_LANG
4404 _LIBCPP_INLINE_VISIBILITY
4405 normal_distribution() : normal_distribution(0) {}
42624406 _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)
42644408 : __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
42654415 _LIBCPP_INLINE_VISIBILITY
42664416 explicit normal_distribution(const param_type& __p)
42674417 : __p_(__p), _V_hot_(false) {}
......@@ -4351,8 +4501,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
43514501 const normal_distribution<_RT>& __x)
43524502{
43534503 __save_flags<_CharT, _Traits> __lx(__os);
4354 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
4355 ios_base::scientific);
4504 typedef basic_ostream<_CharT, _Traits> _OStream;
4505 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
4506 _OStream::scientific);
43564507 _CharT __sp = __os.widen(' ');
43574508 __os.fill(__sp);
43584509 __os << __x.mean() << __sp << __x.stddev() << __sp << __x._V_hot_;
......@@ -4370,7 +4521,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
43704521 typedef typename _Eng::result_type result_type;
43714522 typedef typename _Eng::param_type param_type;
43724523 __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);
43744526 result_type __mean;
43754527 result_type __stddev;
43764528 result_type _Vp = 0;
......@@ -4437,9 +4589,18 @@ private:
44374589
44384590public:
44394591 // 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
44404599 _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)
44424602 : __p_(param_type(__m, __s)) {}
4603#endif
44434604 _LIBCPP_INLINE_VISIBILITY
44444605 explicit lognormal_distribution(const param_type& __p)
44454606 : __p_(__p) {}
......@@ -4557,8 +4718,17 @@ private:
45574718
45584719public:
45594720 // 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
45604728 _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
45624732 _LIBCPP_INLINE_VISIBILITY
45634733 explicit poisson_distribution(const param_type& __p) : __p_(__p) {}
45644734 _LIBCPP_INLINE_VISIBILITY
......@@ -4618,7 +4788,7 @@ poisson_distribution<_IntType>::param_type::param_type(double __mean)
46184788 {
46194789 __s_ = _VSTD::sqrt(__mean_);
46204790 __d_ = 6 * __mean_ * __mean_;
4621 __l_ = std::trunc(__mean_ - 1.1484);
4791 __l_ = _VSTD::trunc(__mean_ - 1.1484);
46224792 __omega_ = .3989423 / __s_;
46234793 double __b1_ = .4166667E-1 / __mean_;
46244794 double __b2_ = .3 * __b1_ * __b1_;
......@@ -4650,13 +4820,13 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr
46504820 double __u;
46514821 if (__g > 0)
46524822 {
4653 __tx = std::trunc(__g);
4823 __tx = _VSTD::trunc(__g);
46544824 if (__tx >= __pr.__l_)
4655 return std::__clamp_to_integral<result_type>(__tx);
4825 return _VSTD::__clamp_to_integral<result_type>(__tx);
46564826 __difmuk = __pr.__mean_ - __tx;
46574827 __u = __urd(__urng);
46584828 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);
46604830 }
46614831 exponential_distribution<double> __edist;
46624832 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
46724842 __u += __u - 1;
46734843 __t = 1.8 + (__u < 0 ? -__e : __e);
46744844 } while (__t <= -.6744);
4675 __tx = std::trunc(__pr.__mean_ + __pr.__s_ * __t);
4845 __tx = _VSTD::trunc(__pr.__mean_ + __pr.__s_ * __t);
46764846 __difmuk = __pr.__mean_ - __tx;
46774847 __using_exp_dist = true;
46784848 }
......@@ -4716,7 +4886,7 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr
47164886 }
47174887 }
47184888 }
4719 return std::__clamp_to_integral<result_type>(__tx);
4889 return _VSTD::__clamp_to_integral<result_type>(__tx);
47204890}
47214891
47224892template <class _CharT, class _Traits, class _IntType>
......@@ -4725,8 +4895,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
47254895 const poisson_distribution<_IntType>& __x)
47264896{
47274897 __save_flags<_CharT, _Traits> __lx(__os);
4728 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
4729 ios_base::scientific);
4898 typedef basic_ostream<_CharT, _Traits> _OStream;
4899 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
4900 _OStream::scientific);
47304901 return __os << __x.mean();
47314902}
47324903
......@@ -4738,7 +4909,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
47384909 typedef poisson_distribution<_IntType> _Eng;
47394910 typedef typename _Eng::param_type param_type;
47404911 __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);
47424914 double __mean;
47434915 __is >> __mean;
47444916 if (!__is.fail())
......@@ -4784,9 +4956,17 @@ private:
47844956
47854957public:
47864958 // 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
47874966 _LIBCPP_INLINE_VISIBILITY
47884967 explicit weibull_distribution(result_type __a = 1, result_type __b = 1)
47894968 : __p_(param_type(__a, __b)) {}
4969#endif
47904970 _LIBCPP_INLINE_VISIBILITY
47914971 explicit weibull_distribution(const param_type& __p)
47924972 : __p_(__p) {}
......@@ -4836,8 +5016,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
48365016 const weibull_distribution<_RT>& __x)
48375017{
48385018 __save_flags<_CharT, _Traits> __lx(__os);
4839 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
4840 ios_base::scientific);
5019 typedef basic_ostream<_CharT, _Traits> _OStream;
5020 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5021 _OStream::scientific);
48415022 _CharT __sp = __os.widen(' ');
48425023 __os.fill(__sp);
48435024 __os << __x.a() << __sp << __x.b();
......@@ -4853,7 +5034,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
48535034 typedef typename _Eng::result_type result_type;
48545035 typedef typename _Eng::param_type param_type;
48555036 __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);
48575039 result_type __a;
48585040 result_type __b;
48595041 __is >> __a >> __b;
......@@ -4898,9 +5080,18 @@ private:
48985080
48995081public:
49005082 // constructor and reset functions
5083#ifndef _LIBCPP_CXX03_LANG
5084 _LIBCPP_INLINE_VISIBILITY
5085 extreme_value_distribution() : extreme_value_distribution(0) {}
49015086 _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)
49035088 : __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
49045095 _LIBCPP_INLINE_VISIBILITY
49055096 explicit extreme_value_distribution(const param_type& __p)
49065097 : __p_(__p) {}
......@@ -4955,8 +5146,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
49555146 const extreme_value_distribution<_RT>& __x)
49565147{
49575148 __save_flags<_CharT, _Traits> __lx(__os);
4958 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
4959 ios_base::scientific);
5149 typedef basic_ostream<_CharT, _Traits> _OStream;
5150 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5151 _OStream::scientific);
49605152 _CharT __sp = __os.widen(' ');
49615153 __os.fill(__sp);
49625154 __os << __x.a() << __sp << __x.b();
......@@ -4972,7 +5164,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
49725164 typedef typename _Eng::result_type result_type;
49735165 typedef typename _Eng::param_type param_type;
49745166 __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);
49765169 result_type __a;
49775170 result_type __b;
49785171 __is >> __a >> __b;
......@@ -5019,9 +5212,18 @@ private:
50195212
50205213public:
50215214 // constructors and reset functions
5215#ifndef _LIBCPP_CXX03_LANG
5216 _LIBCPP_INLINE_VISIBILITY
5217 gamma_distribution() : gamma_distribution(1) {}
50225218 _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)
50245220 : __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
50255227 _LIBCPP_INLINE_VISIBILITY
50265228 explicit gamma_distribution(const param_type& __p)
50275229 : __p_(__p) {}
......@@ -5127,8 +5329,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
51275329 const gamma_distribution<_RT>& __x)
51285330{
51295331 __save_flags<_CharT, _Traits> __lx(__os);
5130 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
5131 ios_base::scientific);
5332 typedef basic_ostream<_CharT, _Traits> _OStream;
5333 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5334 _OStream::scientific);
51325335 _CharT __sp = __os.widen(' ');
51335336 __os.fill(__sp);
51345337 __os << __x.alpha() << __sp << __x.beta();
......@@ -5144,7 +5347,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
51445347 typedef typename _Eng::result_type result_type;
51455348 typedef typename _Eng::param_type param_type;
51465349 __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);
51485352 result_type __alpha;
51495353 result_type __beta;
51505354 __is >> __alpha >> __beta;
......@@ -5191,9 +5395,18 @@ private:
51915395
51925396public:
51935397 // constructor and reset functions
5398#ifndef _LIBCPP_CXX03_LANG
5399 _LIBCPP_INLINE_VISIBILITY
5400 negative_binomial_distribution() : negative_binomial_distribution(1) {}
51945401 _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)
51965403 : __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
51975410 _LIBCPP_INLINE_VISIBILITY
51985411 explicit negative_binomial_distribution(const param_type& __p) : __p_(__p) {}
51995412 _LIBCPP_INLINE_VISIBILITY
......@@ -5263,8 +5476,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
52635476 const negative_binomial_distribution<_IntType>& __x)
52645477{
52655478 __save_flags<_CharT, _Traits> __lx(__os);
5266 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
5267 ios_base::scientific);
5479 typedef basic_ostream<_CharT, _Traits> _OStream;
5480 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5481 _OStream::scientific);
52685482 _CharT __sp = __os.widen(' ');
52695483 __os.fill(__sp);
52705484 return __os << __x.k() << __sp << __x.p();
......@@ -5279,7 +5493,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
52795493 typedef typename _Eng::result_type result_type;
52805494 typedef typename _Eng::param_type param_type;
52815495 __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);
52835498 result_type __k;
52845499 double __p;
52855500 __is >> __k >> __p;
......@@ -5322,8 +5537,17 @@ private:
53225537
53235538public:
53245539 // constructors and reset functions
5540#ifndef _LIBCPP_CXX03_LANG
53255541 _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
53275551 _LIBCPP_INLINE_VISIBILITY
53285552 explicit geometric_distribution(const param_type& __p) : __p_(__p) {}
53295553 _LIBCPP_INLINE_VISIBILITY
......@@ -5369,8 +5593,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
53695593 const geometric_distribution<_IntType>& __x)
53705594{
53715595 __save_flags<_CharT, _Traits> __lx(__os);
5372 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
5373 ios_base::scientific);
5596 typedef basic_ostream<_CharT, _Traits> _OStream;
5597 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5598 _OStream::scientific);
53745599 return __os << __x.p();
53755600}
53765601
......@@ -5382,7 +5607,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
53825607 typedef geometric_distribution<_IntType> _Eng;
53835608 typedef typename _Eng::param_type param_type;
53845609 __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);
53865612 double __p;
53875613 __is >> __p;
53885614 if (!__is.fail())
......@@ -5424,9 +5650,17 @@ private:
54245650
54255651public:
54265652 // 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
54275660 _LIBCPP_INLINE_VISIBILITY
54285661 explicit chi_squared_distribution(result_type __n = 1)
54295662 : __p_(param_type(__n)) {}
5663#endif
54305664 _LIBCPP_INLINE_VISIBILITY
54315665 explicit chi_squared_distribution(const param_type& __p)
54325666 : __p_(__p) {}
......@@ -5473,8 +5707,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
54735707 const chi_squared_distribution<_RT>& __x)
54745708{
54755709 __save_flags<_CharT, _Traits> __lx(__os);
5476 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
5477 ios_base::scientific);
5710 typedef basic_ostream<_CharT, _Traits> _OStream;
5711 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5712 _OStream::scientific);
54785713 __os << __x.n();
54795714 return __os;
54805715}
......@@ -5488,7 +5723,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
54885723 typedef typename _Eng::result_type result_type;
54895724 typedef typename _Eng::param_type param_type;
54905725 __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);
54925728 result_type __n;
54935729 __is >> __n;
54945730 if (!__is.fail())
......@@ -5534,9 +5770,17 @@ private:
55345770
55355771public:
55365772 // 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
55375780 _LIBCPP_INLINE_VISIBILITY
55385781 explicit cauchy_distribution(result_type __a = 0, result_type __b = 1)
55395782 : __p_(param_type(__a, __b)) {}
5783#endif
55405784 _LIBCPP_INLINE_VISIBILITY
55415785 explicit cauchy_distribution(const param_type& __p)
55425786 : __p_(__p) {}
......@@ -5593,8 +5837,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
55935837 const cauchy_distribution<_RT>& __x)
55945838{
55955839 __save_flags<_CharT, _Traits> __lx(__os);
5596 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
5597 ios_base::scientific);
5840 typedef basic_ostream<_CharT, _Traits> _OStream;
5841 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5842 _OStream::scientific);
55985843 _CharT __sp = __os.widen(' ');
55995844 __os.fill(__sp);
56005845 __os << __x.a() << __sp << __x.b();
......@@ -5610,7 +5855,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
56105855 typedef typename _Eng::result_type result_type;
56115856 typedef typename _Eng::param_type param_type;
56125857 __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);
56145860 result_type __a;
56155861 result_type __b;
56165862 __is >> __a >> __b;
......@@ -5657,9 +5903,17 @@ private:
56575903
56585904public:
56595905 // 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
56605913 _LIBCPP_INLINE_VISIBILITY
56615914 explicit fisher_f_distribution(result_type __m = 1, result_type __n = 1)
56625915 : __p_(param_type(__m, __n)) {}
5916#endif
56635917 _LIBCPP_INLINE_VISIBILITY
56645918 explicit fisher_f_distribution(const param_type& __p)
56655919 : __p_(__p) {}
......@@ -5715,8 +5969,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
57155969 const fisher_f_distribution<_RT>& __x)
57165970{
57175971 __save_flags<_CharT, _Traits> __lx(__os);
5718 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
5719 ios_base::scientific);
5972 typedef basic_ostream<_CharT, _Traits> _OStream;
5973 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
5974 _OStream::scientific);
57205975 _CharT __sp = __os.widen(' ');
57215976 __os.fill(__sp);
57225977 __os << __x.m() << __sp << __x.n();
......@@ -5732,7 +5987,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
57325987 typedef typename _Eng::result_type result_type;
57335988 typedef typename _Eng::param_type param_type;
57345989 __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);
57365992 result_type __m;
57375993 result_type __n;
57385994 __is >> __m >> __n;
......@@ -5776,9 +6032,17 @@ private:
57766032
57776033public:
57786034 // 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
57796042 _LIBCPP_INLINE_VISIBILITY
57806043 explicit student_t_distribution(result_type __n = 1)
57816044 : __p_(param_type(__n)) {}
6045#endif
57826046 _LIBCPP_INLINE_VISIBILITY
57836047 explicit student_t_distribution(const param_type& __p)
57846048 : __p_(__p) {}
......@@ -5831,8 +6095,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
58316095 const student_t_distribution<_RT>& __x)
58326096{
58336097 __save_flags<_CharT, _Traits> __lx(__os);
5834 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
5835 ios_base::scientific);
6098 typedef basic_ostream<_CharT, _Traits> _OStream;
6099 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
6100 _OStream::scientific);
58366101 __os << __x.n();
58376102 return __os;
58386103}
......@@ -5846,7 +6111,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
58466111 typedef typename _Eng::result_type result_type;
58476112 typedef typename _Eng::param_type param_type;
58486113 __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);
58506116 result_type __n;
58516117 __is >> __n;
58526118 if (!__is.fail())
......@@ -6054,8 +6320,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
60546320 const discrete_distribution<_IT>& __x)
60556321{
60566322 __save_flags<_CharT, _Traits> __lx(__os);
6057 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
6058 ios_base::scientific);
6323 typedef basic_ostream<_CharT, _Traits> _OStream;
6324 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
6325 _OStream::scientific);
60596326 _CharT __sp = __os.widen(' ');
60606327 __os.fill(__sp);
60616328 size_t __n = __x.__p_.__p_.size();
......@@ -6071,7 +6338,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
60716338 discrete_distribution<_IT>& __x)
60726339{
60736340 __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);
60756343 size_t __n;
60766344 __is >> __n;
60776345 vector<double> __p(__n);
......@@ -6356,8 +6624,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
63566624 const piecewise_constant_distribution<_RT>& __x)
63576625{
63586626 __save_flags<_CharT, _Traits> __lx(__os);
6359 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
6360 ios_base::scientific);
6627 typedef basic_ostream<_CharT, _Traits> _OStream;
6628 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
6629 _OStream::scientific);
63616630 _CharT __sp = __os.widen(' ');
63626631 __os.fill(__sp);
63636632 size_t __n = __x.__p_.__b_.size();
......@@ -6383,7 +6652,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
63836652 typedef piecewise_constant_distribution<_RT> _Eng;
63846653 typedef typename _Eng::result_type result_type;
63856654 __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);
63876657 size_t __n;
63886658 __is >> __n;
63896659 vector<result_type> __b(__n);
......@@ -6696,8 +6966,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
66966966 const piecewise_linear_distribution<_RT>& __x)
66976967{
66986968 __save_flags<_CharT, _Traits> __lx(__os);
6699 __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
6700 ios_base::scientific);
6969 typedef basic_ostream<_CharT, _Traits> _OStream;
6970 __os.flags(_OStream::dec | _OStream::left | _OStream::fixed |
6971 _OStream::scientific);
67016972 _CharT __sp = __os.widen(' ');
67026973 __os.fill(__sp);
67036974 size_t __n = __x.__p_.__b_.size();
......@@ -6723,7 +6994,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
67236994 typedef piecewise_linear_distribution<_RT> _Eng;
67246995 typedef typename _Eng::result_type result_type;
67256996 __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);
67276999 size_t __n;
67287000 __is >> __n;
67297001 vector<result_type> __b(__n);
lib/libcxx/include/regex+131-52
......@@ -32,7 +32,8 @@ enum syntax_option_type
3232 extended = unspecified,
3333 awk = unspecified,
3434 grep = unspecified,
35 egrep = unspecified
35 egrep = unspecified,
36 multiline = unspecified
3637};
3738
3839constexpr syntax_option_type operator~(syntax_option_type f);
......@@ -142,6 +143,7 @@ public:
142143 static constexpr regex_constants::syntax_option_type awk = regex_constants::awk;
143144 static constexpr regex_constants::syntax_option_type grep = regex_constants::grep;
144145 static constexpr regex_constants::syntax_option_type egrep = regex_constants::egrep;
146 static constexpr regex_constants::syntax_option_type multiline = regex_constants::multiline;
145147
146148 // construct/copy/destroy:
147149 basic_regex();
......@@ -453,7 +455,9 @@ public:
453455 typedef basic_string<char_type> string_type;
454456
455457 // 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
457461 match_results(const match_results& m);
458462 match_results(match_results&& m) noexcept;
459463 match_results& operator=(const match_results& m);
......@@ -802,7 +806,9 @@ enum syntax_option_type
802806 extended = 1 << 5,
803807 awk = 1 << 6,
804808 grep = 1 << 7,
805 egrep = 1 << 8
809 egrep = 1 << 8,
810 // 1 << 9 may be used by ECMAScript
811 multiline = 1 << 10
806812};
807813
808814inline _LIBCPP_CONSTEXPR
......@@ -1982,24 +1988,33 @@ __word_boundary<_CharT, _Traits>::__exec(__state& __s) const
19821988// __l_anchor
19831989
19841990template <class _CharT>
1985class __l_anchor
1991_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
19861999 : public __owns_one_state<_CharT>
19872000{
19882001 typedef __owns_one_state<_CharT> base;
19892002
2003 bool __multiline;
2004
19902005public:
19912006 typedef _VSTD::__state<_CharT> __state;
19922007
19932008 _LIBCPP_INLINE_VISIBILITY
1994 __l_anchor(__node<_CharT>* __s)
1995 : base(__s) {}
2009 __l_anchor_multiline(bool __multiline, __node<_CharT>* __s)
2010 : base(__s), __multiline(__multiline) {}
19962011
19972012 virtual void __exec(__state&) const;
19982013};
19992014
20002015template <class _CharT>
20012016void
2002__l_anchor<_CharT>::__exec(__state& __s) const
2017__l_anchor_multiline<_CharT>::__exec(__state& __s) const
20032018{
20042019 if (__s.__at_first_ && __s.__current_ == __s.__first_ &&
20052020 !(__s.__flags_ & regex_constants::match_not_bol))
......@@ -2007,6 +2022,13 @@ __l_anchor<_CharT>::__exec(__state& __s) const
20072022 __s.__do_ = __state::__accept_but_not_consume;
20082023 __s.__node_ = this->first();
20092024 }
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 }
20102032 else
20112033 {
20122034 __s.__do_ = __state::__reject;
......@@ -2017,24 +2039,26 @@ __l_anchor<_CharT>::__exec(__state& __s) const
20172039// __r_anchor
20182040
20192041template <class _CharT>
2020class __r_anchor
2042class __r_anchor_multiline
20212043 : public __owns_one_state<_CharT>
20222044{
20232045 typedef __owns_one_state<_CharT> base;
20242046
2047 bool __multiline;
2048
20252049public:
20262050 typedef _VSTD::__state<_CharT> __state;
20272051
20282052 _LIBCPP_INLINE_VISIBILITY
2029 __r_anchor(__node<_CharT>* __s)
2030 : base(__s) {}
2053 __r_anchor_multiline(bool __multiline, __node<_CharT>* __s)
2054 : base(__s), __multiline(__multiline) {}
20312055
20322056 virtual void __exec(__state&) const;
20332057};
20342058
20352059template <class _CharT>
20362060void
2037__r_anchor<_CharT>::__exec(__state& __s) const
2061__r_anchor_multiline<_CharT>::__exec(__state& __s) const
20382062{
20392063 if (__s.__current_ == __s.__last_ &&
20402064 !(__s.__flags_ & regex_constants::match_not_eol))
......@@ -2042,6 +2066,11 @@ __r_anchor<_CharT>::__exec(__state& __s) const
20422066 __s.__do_ = __state::__accept_but_not_consume;
20432067 __s.__node_ = this->first();
20442068 }
2069 else if (__multiline && __is_eol(*__s.__current_))
2070 {
2071 __s.__do_ = __state::__accept_but_not_consume;
2072 __s.__node_ = this->first();
2073 }
20452074 else
20462075 {
20472076 __s.__do_ = __state::__reject;
......@@ -2448,7 +2477,7 @@ __bracket_expression<_CharT, _Traits>::__exec(__state& __s) const
24482477 {
24492478 const bool __in_neg_mask = __traits_.isctype(__ch, __neg_mask_);
24502479 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) !=
24522481 __neg_chars_.end();
24532482 if (!(__in_neg_mask || __in_neg_chars))
24542483 {
......@@ -2507,7 +2536,17 @@ __exit:
25072536template <class _CharT, class _Traits> class __lookahead;
25082537
25092538template <class _CharT, class _Traits = regex_traits<_CharT> >
2510class _LIBCPP_TEMPLATE_VIS basic_regex
2539 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
25112550{
25122551public:
25132552 // types:
......@@ -2541,17 +2580,18 @@ public:
25412580 static const regex_constants::syntax_option_type awk = regex_constants::awk;
25422581 static const regex_constants::syntax_option_type grep = regex_constants::grep;
25432582 static const regex_constants::syntax_option_type egrep = regex_constants::egrep;
2583 static const regex_constants::syntax_option_type multiline = regex_constants::multiline;
25442584
25452585 // construct/copy/destroy:
25462586 _LIBCPP_INLINE_VISIBILITY
25472587 basic_regex()
25482588 : __flags_(regex_constants::ECMAScript), __marked_count_(0), __loop_count_(0), __open_count_(0),
2549 __end_(0)
2589 __end_(nullptr)
25502590 {}
25512591 _LIBCPP_INLINE_VISIBILITY
25522592 explicit basic_regex(const value_type* __p, flag_type __f = regex_constants::ECMAScript)
25532593 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
2554 __end_(0)
2594 __end_(nullptr)
25552595 {
25562596 __init(__p, __p + __traits_.length(__p));
25572597 }
......@@ -2559,7 +2599,7 @@ public:
25592599 _LIBCPP_INLINE_VISIBILITY
25602600 basic_regex(const value_type* __p, size_t __len, flag_type __f = regex_constants::ECMAScript)
25612601 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
2562 __end_(0)
2602 __end_(nullptr)
25632603 {
25642604 __init(__p, __p + __len);
25652605 }
......@@ -2571,7 +2611,7 @@ public:
25712611 explicit basic_regex(const basic_string<value_type, _ST, _SA>& __p,
25722612 flag_type __f = regex_constants::ECMAScript)
25732613 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
2574 __end_(0)
2614 __end_(nullptr)
25752615 {
25762616 __init(__p.begin(), __p.end());
25772617 }
......@@ -2581,7 +2621,7 @@ public:
25812621 basic_regex(_ForwardIterator __first, _ForwardIterator __last,
25822622 flag_type __f = regex_constants::ECMAScript)
25832623 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
2584 __end_(0)
2624 __end_(nullptr)
25852625 {
25862626 __init(__first, __last);
25872627 }
......@@ -2590,7 +2630,7 @@ public:
25902630 basic_regex(initializer_list<value_type> __il,
25912631 flag_type __f = regex_constants::ECMAScript)
25922632 : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
2593 __end_(0)
2633 __end_(nullptr)
25942634 {
25952635 __init(__il.begin(), __il.end());
25962636 }
......@@ -2707,6 +2747,12 @@ private:
27072747 _LIBCPP_INLINE_VISIBILITY
27082748 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
27102756 template <class _ForwardIterator>
27112757 void
27122758 __init(_ForwardIterator __first, _ForwardIterator __last);
......@@ -4119,7 +4165,7 @@ basic_regex<_CharT, _Traits>::__parse_DUP_COUNT(_ForwardIterator __first,
41194165 __first != __last && ( __val = __traits_.value(*__first, 10)) != -1;
41204166 ++__first)
41214167 {
4122 if (__c >= std::numeric_limits<int>::max() / 10)
4168 if (__c >= numeric_limits<int>::max() / 10)
41234169 __throw_regex_error<regex_constants::error_badbrace>();
41244170 __c *= 10;
41254171 __c += __val;
......@@ -4383,7 +4429,7 @@ basic_regex<_CharT, _Traits>::__parse_decimal_escape(_ForwardIterator __first,
43834429 for (++__first;
43844430 __first != __last && '0' <= *__first && *__first <= '9'; ++__first)
43854431 {
4386 if (__v >= std::numeric_limits<unsigned>::max() / 10)
4432 if (__v >= numeric_limits<unsigned>::max() / 10)
43874433 __throw_regex_error<regex_constants::error_backref>();
43884434 __v = 10 * __v + *__first - '0';
43894435 }
......@@ -4746,7 +4792,7 @@ template <class _CharT, class _Traits>
47464792void
47474793basic_regex<_CharT, _Traits>::__push_l_anchor()
47484794{
4749 __end_->first() = new __l_anchor<_CharT>(__end_->first());
4795 __end_->first() = new __l_anchor_multiline<_CharT>(__use_multiline(), __end_->first());
47504796 __end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());
47514797}
47524798
......@@ -4754,7 +4800,7 @@ template <class _CharT, class _Traits>
47544800void
47554801basic_regex<_CharT, _Traits>::__push_r_anchor()
47564802{
4757 __end_->first() = new __r_anchor<_CharT>(__end_->first());
4803 __end_->first() = new __r_anchor_multiline<_CharT>(__use_multiline(), __end_->first());
47584804 __end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());
47594805}
47604806
......@@ -4845,13 +4891,21 @@ basic_regex<_CharT, _Traits>::__push_lookahead(const basic_regex& __exp,
48454891 __end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());
48464892}
48474893
4848typedef basic_regex<char> regex;
4849typedef basic_regex<wchar_t> wregex;
4850
48514894// 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
48534901template <class _BidirectionalIterator>
4854class _LIBCPP_TEMPLATE_VIS sub_match
4902class
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
48554909 : public pair<_BidirectionalIterator, _BidirectionalIterator>
48564910{
48574911public:
......@@ -4886,11 +4940,6 @@ public:
48864940 {return str().compare(__s);}
48874941};
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
48944943template <class _BiIter>
48954944inline _LIBCPP_INLINE_VISIBILITY
48964945bool
......@@ -5273,8 +5322,19 @@ operator<<(basic_ostream<_CharT, _ST>& __os, const sub_match<_BiIter>& __m)
52735322 return __os << __m.str();
52745323}
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
52765330template <class _BidirectionalIterator, class _Allocator>
5277class _LIBCPP_TEMPLATE_VIS match_results
5331class
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
52785338{
52795339public:
52805340 typedef _Allocator allocator_type;
......@@ -5299,7 +5359,13 @@ public:
52995359 typedef basic_string<char_type> string_type;
53005360
53015361 // 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
53025366 explicit match_results(const allocator_type& __a = allocator_type());
5367#endif
5368
53035369// match_results(const match_results&) = default;
53045370// match_results& operator=(const match_results&) = default;
53055371// match_results(match_results&& __m) = default;
......@@ -5556,7 +5622,7 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output_i
55565622 '0' <= __fmt_first[1] && __fmt_first[1] <= '9')
55575623 {
55585624 ++__fmt_first;
5559 if (__idx >= std::numeric_limits<size_t>::max() / 10)
5625 if (__idx >= numeric_limits<size_t>::max() / 10)
55605626 __throw_regex_error<regex_constants::error_escape>();
55615627 __idx = 10 * __idx + *__fmt_first - '0';
55625628 }
......@@ -5594,11 +5660,6 @@ match_results<_BidirectionalIterator, _Allocator>::swap(match_results& __m)
55945660 swap(__ready_, __m.__ready_);
55955661}
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
56025663template <class _BidirectionalIterator, class _Allocator>
56035664bool
56045665operator==(const match_results<_BidirectionalIterator, _Allocator>& __x,
......@@ -6182,7 +6243,21 @@ regex_match(const basic_string<_CharT, _ST, _SA>& __s,
61826243template <class _BidirectionalIterator,
61836244 class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
61846245 class _Traits = regex_traits<_CharT> >
6185class _LIBCPP_TEMPLATE_VIS regex_iterator
6246 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
61866261{
61876262public:
61886263 typedef basic_regex<_CharT, _Traits> regex_type;
......@@ -6291,17 +6366,26 @@ regex_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()
62916366 return *this;
62926367}
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
62996369// regex_token_iterator
63006370
63016371template <class _BidirectionalIterator,
63026372 class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
63036373 class _Traits = regex_traits<_CharT> >
6304class _LIBCPP_TEMPLATE_VIS regex_token_iterator
6374 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
63056389{
63066390public:
63076391 typedef basic_regex<_CharT, _Traits> regex_type;
......@@ -6367,7 +6451,7 @@ public:
63676451 regex_constants::match_flag_type __m =
63686452 regex_constants::match_default);
63696453#if _LIBCPP_STD_VER > 11
6370 template <std::size_t _Np>
6454 template <size_t _Np>
63716455 regex_token_iterator(_BidirectionalIterator __a,
63726456 _BidirectionalIterator __b,
63736457 const regex_type&& __re,
......@@ -6579,11 +6663,6 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()
65796663 return *this;
65806664}
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
65876666// regex_replace
65886667
65896668template <class _OutputIterator, class _BidirectionalIterator,
lib/libcxx/include/semaphore+7-2
......@@ -46,9 +46,9 @@ using binary_semaphore = counting_semaphore<1>;
4646*/
4747
4848#include <__config>
49#include <__availability>
4950#include <__threading_support>
5051#include <atomic>
51#include <cassert>
5252
5353#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
5454#pragma GCC system_header
......@@ -58,6 +58,9 @@ using binary_semaphore = counting_semaphore<1>;
5858# error <semaphore> is not supported on this single threaded system
5959#endif
6060
61_LIBCPP_PUSH_MACROS
62#include <__undef_macros>
63
6164#if _LIBCPP_STD_VER >= 14
6265
6366_LIBCPP_BEGIN_NAMESPACE_STD
......@@ -68,7 +71,7 @@ __atomic_semaphore_base is the general-case implementation, to be used for
6871user-requested least-max values that exceed the OS implementation support
6972(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 notify
74It is a typical Dijkstra semaphore algorithm over atomics, wait and notify
7275functions. It avoids contention against users' own use of those facilities.
7376
7477*/
......@@ -232,4 +235,6 @@ _LIBCPP_END_NAMESPACE_STD
232235
233236#endif // _LIBCPP_STD_VER >= 14
234237
238_LIBCPP_POP_MACROS
239
235240#endif //_LIBCPP_SEMAPHORE
lib/libcxx/include/shared_mutex+1
......@@ -123,6 +123,7 @@ template <class Mutex>
123123*/
124124
125125#include <__config>
126#include <__availability>
126127#include <version>
127128
128129_LIBCPP_PUSH_MACROS
lib/libcxx/include/span+6-1
......@@ -132,11 +132,14 @@ template<class Container>
132132#pragma GCC system_header
133133#endif
134134
135_LIBCPP_PUSH_MACROS
136#include <__undef_macros>
137
135138_LIBCPP_BEGIN_NAMESPACE_STD
136139
137140#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();
140143template <typename _Tp, size_t _Extent = dynamic_extent> class span;
141144
142145
......@@ -546,4 +549,6 @@ template<class _Container>
546549
547550_LIBCPP_END_NAMESPACE_STD
548551
552_LIBCPP_POP_MACROS
553
549554#endif // _LIBCPP_SPAN
lib/libcxx/include/sstream+202-292
......@@ -25,8 +25,10 @@ public:
2525 typedef typename traits_type::off_type off_type;
2626 typedef Allocator allocator_type;
2727
28 // 27.8.1.1 Constructors:
29 explicit basic_stringbuf(ios_base::openmode which = ios_base::in | ios_base::out);
28 // 27.8.1.1 [stringbuf.cons], constructors:
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
3032 explicit basic_stringbuf(const basic_string<char_type, traits_type, allocator_type>& str,
3133 ios_base::openmode which = ios_base::in | ios_base::out);
3234 basic_stringbuf(basic_stringbuf&& rhs);
......@@ -71,7 +73,10 @@ public:
7173 typedef Allocator allocator_type;
7274
7375 // 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
7580 explicit basic_istringstream(const basic_string<char_type, traits_type,allocator_type>& str,
7681 ios_base::openmode which = ios_base::in);
7782 basic_istringstream(basic_istringstream&& rhs);
......@@ -107,7 +112,10 @@ public:
107112 typedef Allocator allocator_type;
108113
109114 // 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
111119 explicit basic_ostringstream(const basic_string<char_type, traits_type, allocator_type>& str,
112120 ios_base::openmode which = ios_base::out);
113121 basic_ostringstream(basic_ostringstream&& rhs);
......@@ -143,7 +151,10 @@ public:
143151 typedef Allocator allocator_type;
144152
145153 // 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
147158 explicit basic_stringstream(const basic_string<char_type, traits_type, allocator_type>& str,
148159 ios_base::openmode which = ios_base::out|ios_base::in);
149160 basic_stringstream(basic_stringstream&& rhs);
......@@ -207,18 +218,33 @@ private:
207218 ios_base::openmode __mode_;
208219
209220public:
210 // 27.8.1.1 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);
221 // 30.8.2.1 [stringbuf.cons], constructors
216222#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
217244 basic_stringbuf(basic_stringbuf&& __rhs);
218245
219246 // 27.8.1.2 Assign and swap:
220247 basic_stringbuf& operator=(basic_stringbuf&& __rhs);
221#endif
222248 void swap(basic_stringbuf& __rhs);
223249
224250 // 27.8.1.3 Get and set:
......@@ -232,30 +258,13 @@ protected:
232258 virtual int_type overflow (int_type __c = traits_type::eof());
233259 virtual pos_type seekoff(off_type __off, ios_base::seekdir __way,
234260 ios_base::openmode __wch = ios_base::in | ios_base::out);
235 inline _LIBCPP_INLINE_VISIBILITY
261 _LIBCPP_INLINE_VISIBILITY
236262 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 }
238266};
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
259268template <class _CharT, class _Traits, class _Allocator>
260269basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&& __rhs)
261270 : __mode_(__rhs.__mode_)
......@@ -345,8 +354,6 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
345354 return *this;
346355}
347356
348#endif // _LIBCPP_CXX03_LANG
349
350357template <class _CharT, class _Traits, class _Allocator>
351358void
352359basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
......@@ -453,7 +460,7 @@ void
453460basic_stringbuf<_CharT, _Traits, _Allocator>::str(const string_type& __s)
454461{
455462 __str_ = __s;
456 __hm_ = 0;
463 __hm_ = nullptr;
457464 if (__mode_ & ios_base::in)
458465 {
459466 __hm_ = const_cast<char_type*>(__str_.data()) + __str_.size();
......@@ -600,9 +607,9 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff(off_type __off,
600607 return pos_type(-1);
601608 if (__noff != 0)
602609 {
603 if ((__wch & ios_base::in) && this->gptr() == 0)
610 if ((__wch & ios_base::in) && this->gptr() == nullptr)
604611 return pos_type(-1);
605 if ((__wch & ios_base::out) && this->pptr() == 0)
612 if ((__wch & ios_base::out) && this->pptr() == nullptr)
606613 return pos_type(-1);
607614 }
608615 if (__wch & ios_base::in)
......@@ -615,14 +622,6 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff(off_type __off,
615622 return pos_type(__noff);
616623}
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
626625// basic_istringstream
627626
628627template <class _CharT, class _Traits, class _Allocator>
......@@ -643,74 +642,62 @@ private:
643642 basic_stringbuf<char_type, traits_type, allocator_type> __sb_;
644643
645644public:
646 // 27.8.2.1 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);
645 // 30.8.3.1 [istringstream.cons], constructors
652646#ifndef _LIBCPP_CXX03_LANG
653 inline _LIBCPP_INLINE_VISIBILITY
654 basic_istringstream(basic_istringstream&& __rhs);
647 _LIBCPP_INLINE_VISIBILITY
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
656674 // 27.8.2.2 Assign and swap:
657 basic_istringstream& operator=(basic_istringstream&& __rhs);
658#endif // _LIBCPP_CXX03_LANG
659 inline _LIBCPP_INLINE_VISIBILITY
660 void swap(basic_istringstream& __rhs);
675 basic_istringstream& operator=(basic_istringstream&& __rhs) {
676 basic_istream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
677 __sb_ = _VSTD::move(__rhs.__sb_);
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
662686 // 27.8.2.3 Members:
663 inline _LIBCPP_INLINE_VISIBILITY
664 basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
665 inline _LIBCPP_INLINE_VISIBILITY
666 string_type str() const;
667 inline _LIBCPP_INLINE_VISIBILITY
668 void str(const string_type& __s);
687 _LIBCPP_INLINE_VISIBILITY
688 basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
689 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
690 }
691 _LIBCPP_INLINE_VISIBILITY
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 }
669699};
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
714701template <class _CharT, class _Traits, class _Allocator>
715702inline _LIBCPP_INLINE_VISIBILITY
716703void
......@@ -720,26 +707,6 @@ swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x,
720707 __x.swap(__y);
721708}
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
743710// basic_ostringstream
744711
745712template <class _CharT, class _Traits, class _Allocator>
......@@ -760,75 +727,65 @@ private:
760727 basic_stringbuf<char_type, traits_type, allocator_type> __sb_;
761728
762729public:
763 // 27.8.2.1 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);
730 // 30.8.4.1 [ostringstream.cons], constructors
769731#ifndef _LIBCPP_CXX03_LANG
770 inline _LIBCPP_INLINE_VISIBILITY
771 basic_ostringstream(basic_ostringstream&& __rhs);
732 _LIBCPP_INLINE_VISIBILITY
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
773761 // 27.8.2.2 Assign and swap:
774 basic_ostringstream& operator=(basic_ostringstream&& __rhs);
775#endif // _LIBCPP_CXX03_LANG
776 inline _LIBCPP_INLINE_VISIBILITY
777 void swap(basic_ostringstream& __rhs);
762 basic_ostringstream& operator=(basic_ostringstream&& __rhs) {
763 basic_ostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
764 __sb_ = _VSTD::move(__rhs.__sb_);
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
779774 // 27.8.2.3 Members:
780 inline _LIBCPP_INLINE_VISIBILITY
781 basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
782 inline _LIBCPP_INLINE_VISIBILITY
783 string_type str() const;
784 inline _LIBCPP_INLINE_VISIBILITY
785 void str(const string_type& __s);
775 _LIBCPP_INLINE_VISIBILITY
776 basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
777 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
778 }
779 _LIBCPP_INLINE_VISIBILITY
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 }
786787};
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
832789template <class _CharT, class _Traits, class _Allocator>
833790inline _LIBCPP_INLINE_VISIBILITY
834791void
......@@ -838,27 +795,6 @@ swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x,
838795 __x.swap(__y);
839796}
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
862798// basic_stringstream
863799
864800template <class _CharT, class _Traits, class _Allocator>
......@@ -879,75 +815,63 @@ private:
879815 basic_stringbuf<char_type, traits_type, allocator_type> __sb_;
880816
881817public:
882 // 27.8.2.1 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);
818 // 30.8.5.1 [stringstream.cons], constructors
888819#ifndef _LIBCPP_CXX03_LANG
889 inline _LIBCPP_INLINE_VISIBILITY
890 basic_stringstream(basic_stringstream&& __rhs);
820 _LIBCPP_INLINE_VISIBILITY
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
892848 // 27.8.2.2 Assign and swap:
893 basic_stringstream& operator=(basic_stringstream&& __rhs);
894#endif // _LIBCPP_CXX03_LANG
895 inline _LIBCPP_INLINE_VISIBILITY
896 void swap(basic_stringstream& __rhs);
849 basic_stringstream& operator=(basic_stringstream&& __rhs) {
850 basic_iostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
851 __sb_ = _VSTD::move(__rhs.__sb_);
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
898860 // 27.8.2.3 Members:
899 inline _LIBCPP_INLINE_VISIBILITY
900 basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
901 inline _LIBCPP_INLINE_VISIBILITY
902 string_type str() const;
903 inline _LIBCPP_INLINE_VISIBILITY
904 void str(const string_type& __s);
861 _LIBCPP_INLINE_VISIBILITY
862 basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const {
863 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
864 }
865 _LIBCPP_INLINE_VISIBILITY
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 }
905873};
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
951875template <class _CharT, class _Traits, class _Allocator>
952876inline _LIBCPP_INLINE_VISIBILITY
953877void
......@@ -957,26 +881,12 @@ swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x,
957881 __x.swap(__y);
958882}
959883
960template <class _CharT, class _Traits, class _Allocator>
961basic_stringbuf<_CharT, _Traits, _Allocator>*
962basic_stringstream<_CharT, _Traits, _Allocator>::rdbuf() const
963{
964 return const_cast<basic_stringbuf<char_type, traits_type, allocator_type>*>(&__sb_);
965}
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}
884#if defined(_LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1)
885_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_stringbuf<char>)
886_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_stringstream<char>)
887_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostringstream<char>)
888_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istringstream<char>)
889#endif
980890
981891_LIBCPP_END_NAMESPACE_STD
982892
lib/libcxx/include/stdexcept+1-3
......@@ -42,11 +42,9 @@ public:
4242*/
4343
4444#include <__config>
45#include <cstdlib>
4546#include <exception>
4647#include <iosfwd> // for string forward decl
47#ifdef _LIBCPP_NO_EXCEPTIONS
48#include <cstdlib>
49#endif
5048
5149#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
5250#pragma GCC system_header
lib/libcxx/include/streambuf+6-8
......@@ -308,12 +308,12 @@ basic_streambuf<_CharT, _Traits>::~basic_streambuf()
308308
309309template <class _CharT, class _Traits>
310310basic_streambuf<_CharT, _Traits>::basic_streambuf()
311 : __binp_(0),
312 __ninp_(0),
313 __einp_(0),
314 __bout_(0),
315 __nout_(0),
316 __eout_(0)
311 : __binp_(nullptr),
312 __ninp_(nullptr),
313 __einp_(nullptr),
314 __bout_(nullptr),
315 __nout_(nullptr),
316 __eout_(nullptr)
317317{
318318}
319319
......@@ -485,13 +485,11 @@ basic_streambuf<_CharT, _Traits>::overflow(int_type)
485485 return traits_type::eof();
486486}
487487
488#ifndef _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
489488_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>)
490489_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>)
491490
492491_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>)
493492_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>)
494#endif
495493
496494_LIBCPP_END_NAMESPACE_STD
497495
lib/libcxx/include/string+198-144
......@@ -153,7 +153,8 @@ public:
153153 void resize(size_type n, value_type c);
154154 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
157158 void shrink_to_fit();
158159 void clear() noexcept;
159160 bool empty() const noexcept;
......@@ -316,12 +317,16 @@ public:
316317 int compare(size_type pos1, size_type n1, const value_type* s) const;
317318 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++2a
320 bool starts_with(charT c) const noexcept; // C++2a
321 bool starts_with(const charT* s) const; // C++2a
322 bool ends_with(basic_string_view<charT, traits> sv) const noexcept; // C++2a
323 bool ends_with(charT c) const noexcept; // C++2a
324 bool ends_with(const charT* s) const; // C++2a
320 bool starts_with(basic_string_view<charT, traits> sv) const noexcept; // C++20
321 bool starts_with(charT c) const noexcept; // C++20
322 bool starts_with(const charT* s) const; // C++20
323 bool ends_with(basic_string_view<charT, traits> sv) const noexcept; // C++20
324 bool ends_with(charT c) const noexcept; // C++20
325 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
326331 bool __invariants() const;
327332};
......@@ -448,15 +453,15 @@ typedef basic_string<wchar_t> wstring;
448453typedef basic_string<char16_t> u16string;
449454typedef basic_string<char32_t> u32string;
450455
451int stoi (const string& str, size_t* idx = 0, int base = 10);
452long stol (const string& str, size_t* idx = 0, int base = 10);
453unsigned long stoul (const string& str, size_t* idx = 0, int base = 10);
454long long stoll (const string& str, size_t* idx = 0, int base = 10);
455unsigned long long stoull(const string& str, size_t* idx = 0, int base = 10);
456int stoi (const string& str, size_t* idx = nullptr, int base = 10);
457long stol (const string& str, size_t* idx = nullptr, int base = 10);
458unsigned long stoul (const string& str, size_t* idx = nullptr, int base = 10);
459long long stoll (const string& str, size_t* idx = nullptr, 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);
458double stod (const string& str, size_t* idx = 0);
459long double stold(const string& str, size_t* idx = 0);
462float stof (const string& str, size_t* idx = nullptr);
463double stod (const string& str, size_t* idx = nullptr);
464long double stold(const string& str, size_t* idx = nullptr);
460465
461466string to_string(int val);
462467string to_string(unsigned val);
......@@ -468,15 +473,15 @@ string to_string(float val);
468473string to_string(double val);
469474string to_string(long double val);
470475
471int stoi (const wstring& str, size_t* idx = 0, int base = 10);
472long stol (const wstring& str, size_t* idx = 0, int base = 10);
473unsigned long stoul (const wstring& str, size_t* idx = 0, int base = 10);
474long long stoll (const wstring& str, size_t* idx = 0, int base = 10);
475unsigned long long stoull(const wstring& str, size_t* idx = 0, int base = 10);
476int stoi (const wstring& str, size_t* idx = nullptr, int base = 10);
477long stol (const wstring& str, size_t* idx = nullptr, int base = 10);
478unsigned long stoul (const wstring& str, size_t* idx = nullptr, int base = 10);
479long long stoll (const wstring& str, size_t* idx = nullptr, 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);
478double stod (const wstring& str, size_t* idx = 0);
479long double stold(const wstring& str, size_t* idx = 0);
482float stof (const wstring& str, size_t* idx = nullptr);
483double stod (const wstring& str, size_t* idx = nullptr);
484long double stold(const wstring& str, size_t* idx = nullptr);
480485
481486wstring to_wstring(int val);
482487wstring to_wstring(unsigned val);
......@@ -665,8 +670,26 @@ struct __padding<_CharT, 1>
665670
666671#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
668682template<class _CharT, class _Traits, class _Allocator>
669class _LIBCPP_TEMPLATE_VIS basic_string
683class
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
670693 : private __basic_string_common<true>
671694{
672695public:
......@@ -816,7 +839,7 @@ public:
816839 basic_string(const _CharT* __s) : __r_(__default_init_tag(), __default_init_tag()) {
817840 _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr");
818841 __init(__s, traits_type::length(__s));
819# if _LIBCPP_DEBUG_LEVEL >= 2
842# if _LIBCPP_DEBUG_LEVEL == 2
820843 __get_db()->__insert_c(this);
821844# endif
822845 }
......@@ -890,7 +913,7 @@ public:
890913 _LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);}
891914 basic_string& operator=(value_type __c);
892915
893#if _LIBCPP_DEBUG_LEVEL >= 2
916#if _LIBCPP_DEBUG_LEVEL == 2
894917 _LIBCPP_INLINE_VISIBILITY
895918 iterator begin() _NOEXCEPT
896919 {return iterator(this, __get_pointer());}
......@@ -916,7 +939,7 @@ public:
916939 _LIBCPP_INLINE_VISIBILITY
917940 const_iterator end() const _NOEXCEPT
918941 {return const_iterator(__get_pointer() + size());}
919#endif // _LIBCPP_DEBUG_LEVEL >= 2
942#endif // _LIBCPP_DEBUG_LEVEL == 2
920943 _LIBCPP_INLINE_VISIBILITY
921944 reverse_iterator rbegin() _NOEXCEPT
922945 {return reverse_iterator(end());}
......@@ -954,13 +977,13 @@ public:
954977 void resize(size_type __n, value_type __c);
955978 _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);
958981 _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();}
960985 _LIBCPP_INLINE_VISIBILITY
961 void reserve() _NOEXCEPT {reserve(0);}
962 _LIBCPP_INLINE_VISIBILITY
963 void shrink_to_fit() _NOEXCEPT {reserve();}
986 void shrink_to_fit() _NOEXCEPT;
964987 _LIBCPP_INLINE_VISIBILITY
965988 void clear() _NOEXCEPT;
966989 _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
......@@ -1414,22 +1437,38 @@ public:
14141437 { return ends_with(__self_view(__s)); }
14151438#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
14171454 _LIBCPP_INLINE_VISIBILITY bool __invariants() const;
14181455
14191456 _LIBCPP_INLINE_VISIBILITY void __clear_and_shrink() _NOEXCEPT;
14201457
1458 _LIBCPP_INLINE_VISIBILITY void __shrink_or_extend(size_type __target_capacity);
1459
14211460 _LIBCPP_INLINE_VISIBILITY
14221461 bool __is_long() const _NOEXCEPT
14231462 {return bool(__r_.first().__s.__size_ & __short_mask);}
14241463
1425#if _LIBCPP_DEBUG_LEVEL >= 2
1464#if _LIBCPP_DEBUG_LEVEL == 2
14261465
14271466 bool __dereferenceable(const const_iterator* __i) const;
14281467 bool __decrementable(const const_iterator* __i) const;
14291468 bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
14301469 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
14311470
1432#endif // _LIBCPP_DEBUG_LEVEL >= 2
1471#endif // _LIBCPP_DEBUG_LEVEL == 2
14331472
14341473private:
14351474 _LIBCPP_INLINE_VISIBILITY
......@@ -1726,21 +1765,21 @@ inline
17261765void
17271766basic_string<_CharT, _Traits, _Allocator>::__invalidate_all_iterators()
17281767{
1729#if _LIBCPP_DEBUG_LEVEL >= 2
1768#if _LIBCPP_DEBUG_LEVEL == 2
17301769 __get_db()->__invalidate_all(this);
1731#endif // _LIBCPP_DEBUG_LEVEL >= 2
1770#endif
17321771}
17331772
17341773template <class _CharT, class _Traits, class _Allocator>
17351774inline
17361775void
17371776basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type
1738#if _LIBCPP_DEBUG_LEVEL >= 2
1777#if _LIBCPP_DEBUG_LEVEL == 2
17391778 __pos
17401779#endif
17411780 )
17421781{
1743#if _LIBCPP_DEBUG_LEVEL >= 2
1782#if _LIBCPP_DEBUG_LEVEL == 2
17441783 __c_node* __c = __get_db()->__find_c_and_lock(this);
17451784 if (__c)
17461785 {
......@@ -1753,12 +1792,12 @@ basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type
17531792 {
17541793 (*__p)->__c_ = nullptr;
17551794 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*));
17571796 }
17581797 }
17591798 __get_db()->unlock();
17601799 }
1761#endif // _LIBCPP_DEBUG_LEVEL >= 2
1800#endif // _LIBCPP_DEBUG_LEVEL == 2
17621801}
17631802
17641803template <class _CharT, class _Traits, class _Allocator>
......@@ -1767,7 +1806,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string()
17671806 _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
17681807 : __r_(__default_init_tag(), __default_init_tag())
17691808{
1770#if _LIBCPP_DEBUG_LEVEL >= 2
1809#if _LIBCPP_DEBUG_LEVEL == 2
17711810 __get_db()->__insert_c(this);
17721811#endif
17731812 __zero();
......@@ -1783,7 +1822,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __
17831822#endif
17841823: __r_(__default_init_tag(), __a)
17851824{
1786#if _LIBCPP_DEBUG_LEVEL >= 2
1825#if _LIBCPP_DEBUG_LEVEL == 2
17871826 __get_db()->__insert_c(this);
17881827#endif
17891828 __zero();
......@@ -1845,7 +1884,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, const
18451884{
18461885 _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
18471886 __init(__s, traits_type::length(__s));
1848#if _LIBCPP_DEBUG_LEVEL >= 2
1887#if _LIBCPP_DEBUG_LEVEL == 2
18491888 __get_db()->__insert_c(this);
18501889#endif
18511890}
......@@ -1857,7 +1896,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, size_
18571896{
18581897 _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
18591898 __init(__s, __n);
1860#if _LIBCPP_DEBUG_LEVEL >= 2
1899#if _LIBCPP_DEBUG_LEVEL == 2
18611900 __get_db()->__insert_c(this);
18621901#endif
18631902}
......@@ -1869,7 +1908,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, size_
18691908{
18701909 _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");
18711910 __init(__s, __n);
1872#if _LIBCPP_DEBUG_LEVEL >= 2
1911#if _LIBCPP_DEBUG_LEVEL == 2
18731912 __get_db()->__insert_c(this);
18741913#endif
18751914}
......@@ -1884,7 +1923,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
18841923 __init_copy_ctor_external(_VSTD::__to_address(__str.__get_long_pointer()),
18851924 __str.__get_long_size());
18861925
1887#if _LIBCPP_DEBUG_LEVEL >= 2
1926#if _LIBCPP_DEBUG_LEVEL == 2
18881927 __get_db()->__insert_c(this);
18891928#endif
18901929}
......@@ -1899,7 +1938,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(
18991938 else
19001939 __init_copy_ctor_external(_VSTD::__to_address(__str.__get_long_pointer()),
19011940 __str.__get_long_size());
1902#if _LIBCPP_DEBUG_LEVEL >= 2
1941#if _LIBCPP_DEBUG_LEVEL == 2
19031942 __get_db()->__insert_c(this);
19041943#endif
19051944}
......@@ -1936,7 +1975,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str)
19361975 : __r_(_VSTD::move(__str.__r_))
19371976{
19381977 __str.__zero();
1939#if _LIBCPP_DEBUG_LEVEL >= 2
1978#if _LIBCPP_DEBUG_LEVEL == 2
19401979 __get_db()->__insert_c(this);
19411980 if (__is_long())
19421981 __get_db()->swap(this, &__str);
......@@ -1955,7 +1994,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, co
19551994 __r_.first().__r = __str.__r_.first().__r;
19561995 __str.__zero();
19571996 }
1958#if _LIBCPP_DEBUG_LEVEL >= 2
1997#if _LIBCPP_DEBUG_LEVEL == 2
19591998 __get_db()->__insert_c(this);
19601999 if (__is_long())
19612000 __get_db()->swap(this, &__str);
......@@ -1994,7 +2033,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __
19942033 : __r_(__default_init_tag(), __default_init_tag())
19952034{
19962035 __init(__n, __c);
1997#if _LIBCPP_DEBUG_LEVEL >= 2
2036#if _LIBCPP_DEBUG_LEVEL == 2
19982037 __get_db()->__insert_c(this);
19992038#endif
20002039}
......@@ -2005,7 +2044,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __
20052044 : __r_(__default_init_tag(), __a)
20062045{
20072046 __init(__n, __c);
2008#if _LIBCPP_DEBUG_LEVEL >= 2
2047#if _LIBCPP_DEBUG_LEVEL == 2
20092048 __get_db()->__insert_c(this);
20102049#endif
20112050}
......@@ -2020,7 +2059,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
20202059 if (__pos > __str_sz)
20212060 this->__throw_out_of_range();
20222061 __init(__str.data() + __pos, _VSTD::min(__n, __str_sz - __pos));
2023#if _LIBCPP_DEBUG_LEVEL >= 2
2062#if _LIBCPP_DEBUG_LEVEL == 2
20242063 __get_db()->__insert_c(this);
20252064#endif
20262065}
......@@ -2035,7 +2074,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
20352074 if (__pos > __str_sz)
20362075 this->__throw_out_of_range();
20372076 __init(__str.data() + __pos, __str_sz - __pos);
2038#if _LIBCPP_DEBUG_LEVEL >= 2
2077#if _LIBCPP_DEBUG_LEVEL == 2
20392078 __get_db()->__insert_c(this);
20402079#endif
20412080}
......@@ -2049,7 +2088,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(
20492088 __self_view __sv0 = __t;
20502089 __self_view __sv = __sv0.substr(__pos, __n);
20512090 __init(__sv.data(), __sv.size());
2052#if _LIBCPP_DEBUG_LEVEL >= 2
2091#if _LIBCPP_DEBUG_LEVEL == 2
20532092 __get_db()->__insert_c(this);
20542093#endif
20552094}
......@@ -2061,7 +2100,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t)
20612100{
20622101 __self_view __sv = __t;
20632102 __init(__sv.data(), __sv.size());
2064#if _LIBCPP_DEBUG_LEVEL >= 2
2103#if _LIBCPP_DEBUG_LEVEL == 2
20652104 __get_db()->__insert_c(this);
20662105#endif
20672106}
......@@ -2073,7 +2112,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const _Tp & __t, const _
20732112{
20742113 __self_view __sv = __t;
20752114 __init(__sv.data(), __sv.size());
2076#if _LIBCPP_DEBUG_LEVEL >= 2
2115#if _LIBCPP_DEBUG_LEVEL == 2
20772116 __get_db()->__insert_c(this);
20782117#endif
20792118}
......@@ -2141,7 +2180,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first,
21412180 : __r_(__default_init_tag(), __default_init_tag())
21422181{
21432182 __init(__first, __last);
2144#if _LIBCPP_DEBUG_LEVEL >= 2
2183#if _LIBCPP_DEBUG_LEVEL == 2
21452184 __get_db()->__insert_c(this);
21462185#endif
21472186}
......@@ -2154,7 +2193,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first,
21542193 : __r_(__default_init_tag(), __a)
21552194{
21562195 __init(__first, __last);
2157#if _LIBCPP_DEBUG_LEVEL >= 2
2196#if _LIBCPP_DEBUG_LEVEL == 2
21582197 __get_db()->__insert_c(this);
21592198#endif
21602199}
......@@ -2168,7 +2207,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(
21682207 : __r_(__default_init_tag(), __default_init_tag())
21692208{
21702209 __init(__il.begin(), __il.end());
2171#if _LIBCPP_DEBUG_LEVEL >= 2
2210#if _LIBCPP_DEBUG_LEVEL == 2
21722211 __get_db()->__insert_c(this);
21732212#endif
21742213}
......@@ -2181,7 +2220,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(
21812220 : __r_(__default_init_tag(), __a)
21822221{
21832222 __init(__il.begin(), __il.end());
2184#if _LIBCPP_DEBUG_LEVEL >= 2
2223#if _LIBCPP_DEBUG_LEVEL == 2
21852224 __get_db()->__insert_c(this);
21862225#endif
21872226}
......@@ -2191,7 +2230,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(
21912230template <class _CharT, class _Traits, class _Allocator>
21922231basic_string<_CharT, _Traits, _Allocator>::~basic_string()
21932232{
2194#if _LIBCPP_DEBUG_LEVEL >= 2
2233#if _LIBCPP_DEBUG_LEVEL == 2
21952234 __get_db()->__erase_c(this);
21962235#endif
21972236 if (__is_long())
......@@ -2768,7 +2807,7 @@ _EnableIf
27682807>
27692808basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _InputIterator __first, _InputIterator __last)
27702809{
2771#if _LIBCPP_DEBUG_LEVEL >= 2
2810#if _LIBCPP_DEBUG_LEVEL == 2
27722811 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
27732812 "string::insert(iterator, range) called with an iterator not"
27742813 " referring to this string");
......@@ -2787,7 +2826,7 @@ _EnableIf
27872826>
27882827basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last)
27892828{
2790#if _LIBCPP_DEBUG_LEVEL >= 2
2829#if _LIBCPP_DEBUG_LEVEL == 2
27912830 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
27922831 "string::insert(iterator, range) called with an iterator not"
27932832 " referring to this string");
......@@ -2903,7 +2942,7 @@ inline
29032942typename basic_string<_CharT, _Traits, _Allocator>::iterator
29042943basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, size_type __n, value_type __c)
29052944{
2906#if _LIBCPP_DEBUG_LEVEL >= 2
2945#if _LIBCPP_DEBUG_LEVEL == 2
29072946 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
29082947 "string::insert(iterator, n, value) called with an iterator not"
29092948 " referring to this string");
......@@ -3137,7 +3176,7 @@ inline
31373176typename basic_string<_CharT, _Traits, _Allocator>::iterator
31383177basic_string<_CharT, _Traits, _Allocator>::erase(const_iterator __pos)
31393178{
3140#if _LIBCPP_DEBUG_LEVEL >= 2
3179#if _LIBCPP_DEBUG_LEVEL == 2
31413180 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
31423181 "string::erase(iterator) called with an iterator not"
31433182 " referring to this string");
......@@ -3155,7 +3194,7 @@ inline
31553194typename basic_string<_CharT, _Traits, _Allocator>::iterator
31563195basic_string<_CharT, _Traits, _Allocator>::erase(const_iterator __first, const_iterator __last)
31573196{
3158#if _LIBCPP_DEBUG_LEVEL >= 2
3197#if _LIBCPP_DEBUG_LEVEL == 2
31593198 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,
31603199 "string::erase(iterator, iterator) called with an iterator not"
31613200 " referring to this string");
......@@ -3262,65 +3301,88 @@ basic_string<_CharT, _Traits, _Allocator>::max_size() const _NOEXCEPT
32623301
32633302template <class _CharT, class _Traits, class _Allocator>
32643303void
3265basic_string<_CharT, _Traits, _Allocator>::reserve(size_type __res_arg)
3304basic_string<_CharT, _Traits, _Allocator>::reserve(size_type __requested_capacity)
32663305{
3267 if (__res_arg > max_size())
3306 if (__requested_capacity > max_size())
32683307 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{
32693335 size_type __cap = capacity();
32703336 size_type __sz = size();
3271 __res_arg = _VSTD::max(__res_arg, __sz);
3272 __res_arg = __recommend(__res_arg);
3273 if (__res_arg != __cap)
3337
3338 pointer __new_data, __p;
3339 bool __was_long, __now_long;
3340 if (__target_capacity == __min_cap - 1)
32743341 {
3275 pointer __new_data, __p;
3276 bool __was_long, __now_long;
3277 if (__res_arg == __min_cap - 1)
3278 {
3279 __was_long = true;
3280 __now_long = false;
3281 __new_data = __get_short_pointer();
3282 __p = __get_long_pointer();
3283 }
3342 __was_long = true;
3343 __now_long = false;
3344 __new_data = __get_short_pointer();
3345 __p = __get_long_pointer();
3346 }
3347 else
3348 {
3349 if (__target_capacity > __cap)
3350 __new_data = __alloc_traits::allocate(__alloc(), __target_capacity+1);
32843351 else
32853352 {
3286 if (__res_arg > __cap)
3287 __new_data = __alloc_traits::allocate(__alloc(), __res_arg+1);
3288 else
3353 #ifndef _LIBCPP_NO_EXCEPTIONS
3354 try
32893355 {
3290 #ifndef _LIBCPP_NO_EXCEPTIONS
3291 try
3292 {
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
3356 #endif // _LIBCPP_NO_EXCEPTIONS
3357 __new_data = __alloc_traits::allocate(__alloc(), __target_capacity+1);
3358 #ifndef _LIBCPP_NO_EXCEPTIONS
33053359 }
3306 __now_long = true;
3307 __was_long = __is_long();
3308 __p = __get_pointer();
3309 }
3310 traits_type::copy(_VSTD::__to_address(__new_data),
3311 _VSTD::__to_address(__p), size()+1);
3312 if (__was_long)
3313 __alloc_traits::deallocate(__alloc(), __p, __cap+1);
3314 if (__now_long)
3315 {
3316 __set_long_cap(__res_arg+1);
3317 __set_long_size(__sz);
3318 __set_long_pointer(__new_data);
3360 catch (...)
3361 {
3362 return;
3363 }
3364 #else // _LIBCPP_NO_EXCEPTIONS
3365 if (__new_data == nullptr)
3366 return;
3367 #endif // _LIBCPP_NO_EXCEPTIONS
33193368 }
3320 else
3321 __set_short_size(__sz);
3322 __invalidate_all_iterators();
3369 __now_long = true;
3370 __was_long = __is_long();
3371 __p = __get_pointer();
33233372 }
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();
33243386}
33253387
33263388template <class _CharT, class _Traits, class _Allocator>
......@@ -3426,7 +3488,7 @@ basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)
34263488 __is_nothrow_swappable<allocator_type>::value)
34273489#endif
34283490{
3429#if _LIBCPP_DEBUG_LEVEL >= 2
3491#if _LIBCPP_DEBUG_LEVEL == 2
34303492 if (!__is_long())
34313493 __get_db()->__invalidate_all(this);
34323494 if (!__str.__is_long())
......@@ -3438,7 +3500,7 @@ basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)
34383500 __alloc_traits::is_always_equal::value ||
34393501 __alloc() == __str.__alloc(), "swapping non-equal allocators");
34403502 _VSTD::swap(__r_.first(), __str.__r_.first());
3441 __swap_allocator(__alloc(), __str.__alloc());
3503 _VSTD::__swap_allocator(__alloc(), __str.__alloc());
34423504}
34433505
34443506// find
......@@ -3939,9 +4001,9 @@ basic_string<_CharT, _Traits, _Allocator>::__invariants() const
39394001 return false;
39404002 if (capacity() < __min_cap - 1)
39414003 return false;
3942 if (data() == 0)
4004 if (data() == nullptr)
39434005 return false;
3944 if (data()[size()] != value_type(0))
4006 if (data()[size()] != value_type())
39454007 return false;
39464008 return true;
39474009}
......@@ -3959,6 +4021,7 @@ basic_string<_CharT, _Traits, _Allocator>::__clear_and_shrink() _NOEXCEPT
39594021 __alloc_traits::deallocate(__alloc(), __get_long_pointer(), capacity() + 1);
39604022 __set_long_cap(0);
39614023 __set_short_size(0);
4024 traits_type::assign(*__get_short_pointer(), value_type());
39624025 }
39634026}
39644027
......@@ -4300,24 +4363,15 @@ swap(basic_string<_CharT, _Traits, _Allocator>& __lhs,
43004363 __lhs.swap(__rhs);
43014364}
43024365
4303#ifndef _LIBCPP_NO_HAS_CHAR8_T
4304typedef basic_string<char8_t> u8string;
4305#endif
4306
4307#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
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);
4366_LIBCPP_FUNC_VIS int stoi (const string& __str, size_t* __idx = nullptr, int __base = 10);
4367_LIBCPP_FUNC_VIS long stol (const string& __str, size_t* __idx = nullptr, int __base = 10);
4368_LIBCPP_FUNC_VIS unsigned long stoul (const string& __str, size_t* __idx = nullptr, int __base = 10);
4369_LIBCPP_FUNC_VIS long long stoll (const string& __str, size_t* __idx = nullptr, int __base = 10);
4370_LIBCPP_FUNC_VIS unsigned long long stoull(const string& __str, size_t* __idx = nullptr, int __base = 10);
43174371
4318_LIBCPP_FUNC_VIS float stof (const string& __str, size_t* __idx = 0);
4319_LIBCPP_FUNC_VIS double stod (const string& __str, size_t* __idx = 0);
4320_LIBCPP_FUNC_VIS long double stold(const string& __str, size_t* __idx = 0);
4372_LIBCPP_FUNC_VIS float stof (const string& __str, size_t* __idx = nullptr);
4373_LIBCPP_FUNC_VIS double stod (const string& __str, size_t* __idx = nullptr);
4374_LIBCPP_FUNC_VIS long double stold(const string& __str, size_t* __idx = nullptr);
43214375
43224376_LIBCPP_FUNC_VIS string to_string(int __val);
43234377_LIBCPP_FUNC_VIS string to_string(unsigned __val);
......@@ -4329,15 +4383,15 @@ _LIBCPP_FUNC_VIS string to_string(float __val);
43294383_LIBCPP_FUNC_VIS string to_string(double __val);
43304384_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);
4333_LIBCPP_FUNC_VIS long stol (const wstring& __str, size_t* __idx = 0, int __base = 10);
4334_LIBCPP_FUNC_VIS unsigned long stoul (const wstring& __str, size_t* __idx = 0, int __base = 10);
4335_LIBCPP_FUNC_VIS long long stoll (const wstring& __str, size_t* __idx = 0, int __base = 10);
4336_LIBCPP_FUNC_VIS unsigned long long stoull(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);
4387_LIBCPP_FUNC_VIS long stol (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
4388_LIBCPP_FUNC_VIS unsigned long stoul (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
4389_LIBCPP_FUNC_VIS long long stoll (const wstring& __str, size_t* __idx = nullptr, 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);
4339_LIBCPP_FUNC_VIS double stod (const wstring& __str, size_t* __idx = 0);
4340_LIBCPP_FUNC_VIS long double stold(const wstring& __str, size_t* __idx = 0);
4392_LIBCPP_FUNC_VIS float stof (const wstring& __str, size_t* __idx = nullptr);
4393_LIBCPP_FUNC_VIS double stod (const wstring& __str, size_t* __idx = nullptr);
4394_LIBCPP_FUNC_VIS long double stold(const wstring& __str, size_t* __idx = nullptr);
43414395
43424396_LIBCPP_FUNC_VIS wstring to_wstring(int __val);
43434397_LIBCPP_FUNC_VIS wstring to_wstring(unsigned __val);
......@@ -4425,7 +4479,7 @@ inline _LIBCPP_INLINE_VISIBILITY
44254479}
44264480#endif
44274481
4428#if _LIBCPP_DEBUG_LEVEL >= 2
4482#if _LIBCPP_DEBUG_LEVEL == 2
44294483
44304484template<class _CharT, class _Traits, class _Allocator>
44314485bool
......@@ -4459,7 +4513,7 @@ basic_string<_CharT, _Traits, _Allocator>::__subscriptable(const const_iterator*
44594513 return this->data() <= __p && __p < this->data() + this->size();
44604514}
44614515
4462#endif // _LIBCPP_DEBUG_LEVEL >= 2
4516#endif // _LIBCPP_DEBUG_LEVEL == 2
44634517
44644518#if _LIBCPP_STD_VER > 11
44654519// Literal suffixes for basic_string [basic.string.literals]
lib/libcxx/include/string_view+48-17
......@@ -142,12 +142,16 @@ namespace std {
142142 constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const;
143143 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++2a
146 constexpr bool starts_with(charT c) const noexcept; // C++2a
147 constexpr bool starts_with(const charT* s) const; // C++2a
148 constexpr bool ends_with(basic_string_view s) const noexcept; // C++2a
149 constexpr bool ends_with(charT c) const noexcept; // C++2a
150 constexpr bool ends_with(const charT* s) const; // C++2a
145 constexpr bool starts_with(basic_string_view s) const noexcept; // C++20
146 constexpr bool starts_with(charT c) const noexcept; // C++20
147 constexpr bool starts_with(const charT* s) const; // C++20
148 constexpr bool ends_with(basic_string_view s) const noexcept; // C++20
149 constexpr bool ends_with(charT c) const noexcept; // C++20
150 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
152156 private:
153157 const_pointer data_; // exposition only
......@@ -192,7 +196,26 @@ _LIBCPP_PUSH_MACROS
192196_LIBCPP_BEGIN_NAMESPACE_STD
193197
194198template<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 {
196219public:
197220 // types
198221 typedef _Traits traits_type;
......@@ -236,7 +259,7 @@ public:
236259
237260 _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
238261 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
241264 // [string.view.iterators], iterators
242265 _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
......@@ -278,7 +301,9 @@ public:
278301
279302 // [string.view.access], element access
280303 _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
283308 _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
284309 const_reference at(size_type __pos) const
......@@ -601,6 +626,20 @@ public:
601626 { return ends_with(basic_string_view(__s)); }
602627#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
604643private:
605644 const value_type* __data;
606645 size_type __size;
......@@ -774,14 +813,6 @@ basic_ostream<_CharT, _Traits>&
774813operator<<(basic_ostream<_CharT, _Traits>& __os,
775814 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
785816// [string.view.hash]
786817template<class _CharT>
787818struct _LIBCPP_TEMPLATE_VIS hash<basic_string_view<_CharT, char_traits<_CharT> > >
lib/libcxx/include/strstream+17-9
......@@ -17,14 +17,17 @@ class strstreambuf
1717 : public basic_streambuf<char>
1818{
1919public:
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
2124 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);
2326 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);
2629 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);
2831 strstreambuf(const unsigned char* gnext_arg, streamsize n);
2932
3033 strstreambuf(strstreambuf&& rhs);
......@@ -140,14 +143,19 @@ class _LIBCPP_TYPE_VIS strstreambuf
140143 : public streambuf
141144{
142145public:
146#ifndef _LIBCPP_CXX03_LANG
147 strstreambuf() : strstreambuf(0) {}
148 explicit strstreambuf(streamsize __alsize);
149#else
143150 explicit strstreambuf(streamsize __alsize = 0);
151#endif
144152 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);
146154 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);
149157 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);
151159 strstreambuf(const unsigned char* __gnext, streamsize __n);
152160
153161#ifndef _LIBCPP_CXX03_LANG
......@@ -290,7 +298,7 @@ public:
290298 _LIBCPP_INLINE_VISIBILITY
291299 ostrstream(char* __s, int __n, ios_base::openmode __mode = ios_base::out)
292300 : 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))
294302 {}
295303
296304#ifndef _LIBCPP_CXX03_LANG
......@@ -350,7 +358,7 @@ public:
350358 _LIBCPP_INLINE_VISIBILITY
351359 strstream(char* __s, int __n, ios_base::openmode __mode = ios_base::in | ios_base::out)
352360 : 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))
354362 {}
355363
356364#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:
253253 template <class _Ep>
254254 _LIBCPP_INLINE_VISIBILITY
255255 error_condition(_Ep __e,
256 typename enable_if<is_error_condition_enum<_Ep>::value>::type* = 0
256 typename enable_if<is_error_condition_enum<_Ep>::value>::type* = nullptr
257257 ) _NOEXCEPT
258258 {*this = make_error_condition(__e);}
259259
......@@ -325,7 +325,7 @@ public:
325325 template <class _Ep>
326326 _LIBCPP_INLINE_VISIBILITY
327327 error_code(_Ep __e,
328 typename enable_if<is_error_code_enum<_Ep>::value>::type* = 0
328 typename enable_if<is_error_code_enum<_Ep>::value>::type* = nullptr
329329 ) _NOEXCEPT
330330 {*this = make_error_code(__e);}
331331
lib/libcxx/include/thread+21-24
......@@ -277,18 +277,18 @@ inline _LIBCPP_INLINE_VISIBILITY
277277void
278278__thread_execute(tuple<_TSp, _Fp, _Args...>& __t, __tuple_indices<_Indices...>)
279279{
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))...);
281281}
282282
283283template <class _Fp>
284284_LIBCPP_INLINE_VISIBILITY
285285void* __thread_proxy(void* __vp)
286286{
287 // _Fp = std::tuple< unique_ptr<__thread_struct>, Functor, Args...>
288 std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
289 __thread_local_data().set_pointer(_VSTD::get<0>(*__p).release());
287 // _Fp = tuple< unique_ptr<__thread_struct>, Functor, Args...>
288 unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
289 __thread_local_data().set_pointer(_VSTD::get<0>(*__p.get()).release());
290290 typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 2>::type _Index;
291 __thread_execute(*__p, _Index());
291 _VSTD::__thread_execute(*__p.get(), _Index());
292292 return nullptr;
293293}
294294
......@@ -300,11 +300,11 @@ thread::thread(_Fp&& __f, _Args&&... __args)
300300 typedef unique_ptr<__thread_struct> _TSPtr;
301301 _TSPtr __tsp(new __thread_struct);
302302 typedef tuple<_TSPtr, typename decay<_Fp>::type, typename decay<_Args>::type...> _Gp;
303 _VSTD::unique_ptr<_Gp> __p(
304 new _Gp(std::move(__tsp),
305 __decay_copy(_VSTD::forward<_Fp>(__f)),
306 __decay_copy(_VSTD::forward<_Args>(__args))...));
307 int __ec = __libcpp_thread_create(&__t_, &__thread_proxy<_Gp>, __p.get());
303 unique_ptr<_Gp> __p(
304 new _Gp(_VSTD::move(__tsp),
305 _VSTD::__decay_copy(_VSTD::forward<_Fp>(__f)),
306 _VSTD::__decay_copy(_VSTD::forward<_Args>(__args))...));
307 int __ec = _VSTD::__libcpp_thread_create(&__t_, &__thread_proxy<_Gp>, __p.get());
308308 if (__ec == 0)
309309 __p.release();
310310 else
......@@ -326,7 +326,7 @@ struct __thread_invoke_pair {
326326template <class _Fp>
327327void* __thread_proxy_cxx03(void* __vp)
328328{
329 std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
329 unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
330330 __thread_local_data().set_pointer(__p->__tsp_.release());
331331 (__p->__fn_)();
332332 return nullptr;
......@@ -337,9 +337,9 @@ thread::thread(_Fp __f)
337337{
338338
339339 typedef __thread_invoke_pair<_Fp> _InvokePair;
340 typedef std::unique_ptr<_InvokePair> _PairPtr;
340 typedef unique_ptr<_InvokePair> _PairPtr;
341341 _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());
343343 if (__ec == 0)
344344 __pp.release();
345345 else
......@@ -360,25 +360,24 @@ template <class _Rep, class _Period>
360360void
361361sleep_for(const chrono::duration<_Rep, _Period>& __d)
362362{
363 using namespace chrono;
364 if (__d > duration<_Rep, _Period>::zero())
363 if (__d > chrono::duration<_Rep, _Period>::zero())
365364 {
366365#if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)
367366 // 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) ;
369368#else
370 _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
369 _LIBCPP_CONSTEXPR chrono::duration<long double> _Max = chrono::nanoseconds::max();
371370#endif
372 nanoseconds __ns;
371 chrono::nanoseconds __ns;
373372 if (__d < _Max)
374373 {
375 __ns = duration_cast<nanoseconds>(__d);
374 __ns = chrono::duration_cast<chrono::nanoseconds>(__d);
376375 if (__ns < __d)
377376 ++__ns;
378377 }
379378 else
380 __ns = nanoseconds::max();
381 sleep_for(__ns);
379 __ns = chrono::nanoseconds::max();
380 this_thread::sleep_for(__ns);
382381 }
383382}
384383
......@@ -386,7 +385,6 @@ template <class _Clock, class _Duration>
386385void
387386sleep_until(const chrono::time_point<_Clock, _Duration>& __t)
388387{
389 using namespace chrono;
390388 mutex __mut;
391389 condition_variable __cv;
392390 unique_lock<mutex> __lk(__mut);
......@@ -399,8 +397,7 @@ inline _LIBCPP_INLINE_VISIBILITY
399397void
400398sleep_until(const chrono::time_point<chrono::steady_clock, _Duration>& __t)
401399{
402 using namespace chrono;
403 sleep_for(__t - steady_clock::now());
400 this_thread::sleep_for(__t - chrono::steady_clock::now());
404401}
405402
406403inline _LIBCPP_INLINE_VISIBILITY
lib/libcxx/include/tuple+1-1
......@@ -1393,7 +1393,7 @@ struct _LIBCPP_TEMPLATE_VIS uses_allocator<tuple<_Tp...>, _Alloc>
13931393
13941394template <class _T1, class _T2>
13951395template <class... _Args1, class... _Args2, size_t ..._I1, size_t ..._I2>
1396inline _LIBCPP_INLINE_VISIBILITY
1396inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
13971397pair<_T1, _T2>::pair(piecewise_construct_t,
13981398 tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
13991399 __tuple_indices<_I1...>, __tuple_indices<_I2...>)
lib/libcxx/include/type_traits+137-245
......@@ -51,6 +51,7 @@ namespace std
5151 template <class T> struct is_arithmetic;
5252 template <class T> struct is_fundamental;
5353 template <class T> struct is_member_pointer;
54 template <class T> struct is_scoped_enum; // C++2b
5455 template <class T> struct is_scalar;
5556 template <class T> struct is_object;
5657 template <class T> struct is_compound;
......@@ -284,6 +285,8 @@ namespace std
284285 = is_compound<T>::value; // C++17
285286 template <class T> inline constexpr bool is_member_pointer_v
286287 = 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
288291 // See C++14 20.10.4.3, type properties
289292 template <class T> inline constexpr bool is_const_v
......@@ -514,7 +517,7 @@ template <template <class...> class, class ...>
514517false_type __sfinae_test_impl(...);
515518
516519template <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
519522template <class>
520523struct __void_t { typedef void type; };
......@@ -595,75 +598,6 @@ using __is_primary_template = _IsValidExpansion<
595598 __test_for_primary_template, _Tp
596599 >;
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
667601struct __two {char __lx[2];};
668602
669603// helper class:
......@@ -1731,6 +1665,21 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_base_of_v
17311665 = is_base_of<_Bp, _Dp>::value;
17321666#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
17341683// is_convertible
17351684
17361685#if __has_feature(is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
......@@ -1821,7 +1770,7 @@ template <typename _Tp>
18211770static void __test_noexcept(_Tp) noexcept;
18221771
18231772template<typename _Fm, typename _To>
1824static bool_constant<noexcept(__test_noexcept<_To>(declval<_Fm>()))>
1773static bool_constant<noexcept(_VSTD::__test_noexcept<_To>(declval<_Fm>()))>
18251774__is_nothrow_convertible_test();
18261775
18271776template <typename _Fm, typename _To>
......@@ -2550,7 +2499,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_destructible_v = __is_destructible(
25502499// if it's a function, return false
25512500// if it's void, return false
25522501// if it's an array of unknown bound, return false
2553// Otherwise, return "std::declval<_Up&>().~_Up()" is well-formed
2502// Otherwise, return "declval<_Up&>().~_Up()" is well-formed
25542503// where _Up is remove_all_extents<_Tp>::type
25552504
25562505template <class>
......@@ -2876,167 +2825,13 @@ struct __member_pointer_class_type<_Ret _ClassType::*> {
28762825 typedef _ClassType type;
28772826};
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
30312828// template <class T, class... Args> struct is_constructible;
30322829
3033namespace __is_construct
3034{
3035struct __nat {};
3036}
2830#if defined(_LIBCPP_COMPILER_GCC) && _GNUC_VER_NEW >= 10000
2831# define _LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE
2832#endif
30372833
3038#if !defined(_LIBCPP_CXX03_LANG) && (!__has_feature(is_constructible) || \
3039 defined(_LIBCPP_TESTING_FALLBACK_IS_CONSTRUCTIBLE))
2834#if !defined(_LIBCPP_CXX03_LANG) && !__has_feature(is_constructible) && !defined(_LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE)
30402835
30412836template <class _Tp, class... _Args>
30422837struct __libcpp_is_constructible;
......@@ -3151,7 +2946,7 @@ struct __libcpp_is_constructible<_Tp&&, _A0>
31512946
31522947#endif
31532948
3154#if __has_feature(is_constructible)
2949#if __has_feature(is_constructible) || defined(_LIBCPP_GCC_SUPPORTS_IS_CONSTRUCTIBLE)
31552950template <class _Tp, class ..._Args>
31562951struct _LIBCPP_TEMPLATE_VIS is_constructible
31572952 : public integral_constant<bool, __is_constructible(_Tp, _Args...)>
......@@ -3442,7 +3237,7 @@ void __implicit_conversion_to(_Tp) noexcept { }
34423237
34433238template <class _Tp, class _Arg>
34443239struct __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>()))>
34463241{
34473242};
34483243
......@@ -3807,7 +3602,7 @@ auto __invoke_constexpr(__any, _Args&& ...__args) -> __nat;
38073602template <class _Fp, class _A0, class ..._Args,
38083603 class = __enable_if_bullet1<_Fp, _A0>>
38093604inline _LIBCPP_INLINE_VISIBILITY
3810auto
3605_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
38113606__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
38123607_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
38213616template <class _Fp, class _A0, class ..._Args,
38223617 class = __enable_if_bullet2<_Fp, _A0>>
38233618inline _LIBCPP_INLINE_VISIBILITY
3824auto
3619_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
38253620__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
38263621_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)...))
38353630template <class _Fp, class _A0, class ..._Args,
38363631 class = __enable_if_bullet3<_Fp, _A0>>
38373632inline _LIBCPP_INLINE_VISIBILITY
3838auto
3633_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
38393634__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
38403635_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>(
38513646template <class _Fp, class _A0,
38523647 class = __enable_if_bullet4<_Fp, _A0>>
38533648inline _LIBCPP_INLINE_VISIBILITY
3854auto
3649_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
38553650__invoke(_Fp&& __f, _A0&& __a0)
38563651_LIBCPP_INVOKE_RETURN(_VSTD::forward<_A0>(__a0).*__f)
38573652
......@@ -3865,7 +3660,7 @@ _LIBCPP_INVOKE_RETURN(_VSTD::forward<_A0>(__a0).*__f)
38653660template <class _Fp, class _A0,
38663661 class = __enable_if_bullet5<_Fp, _A0>>
38673662inline _LIBCPP_INLINE_VISIBILITY
3868auto
3663_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
38693664__invoke(_Fp&& __f, _A0&& __a0)
38703665_LIBCPP_INVOKE_RETURN(__a0.get().*__f)
38713666
......@@ -3879,7 +3674,7 @@ _LIBCPP_INVOKE_RETURN(__a0.get().*__f)
38793674template <class _Fp, class _A0,
38803675 class = __enable_if_bullet6<_Fp, _A0>>
38813676inline _LIBCPP_INLINE_VISIBILITY
3882auto
3677_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
38833678__invoke(_Fp&& __f, _A0&& __a0)
38843679_LIBCPP_INVOKE_RETURN((*_VSTD::forward<_A0>(__a0)).*__f)
38853680
......@@ -3894,7 +3689,7 @@ _LIBCPP_INVOKE_RETURN((*_VSTD::forward<_A0>(__a0)).*__f)
38943689
38953690template <class _Fp, class ..._Args>
38963691inline _LIBCPP_INLINE_VISIBILITY
3897auto
3692_LIBCPP_CONSTEXPR_AFTER_CXX17 auto
38983693__invoke(_Fp&& __f, _Args&& ...__args)
38993694_LIBCPP_INVOKE_RETURN(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))
39003695
......@@ -3982,14 +3777,97 @@ struct __invoke_of
39823777{
39833778};
39843779
3780#endif // _LIBCPP_CXX03_LANG
3781
39853782// result_of
39863783
3784template <class _Callable> class result_of;
3785
3786#ifndef _LIBCPP_CXX03_LANG
3787
39873788template <class _Fp, class ..._Args>
39883789class _LIBCPP_TEMPLATE_VIS result_of<_Fp(_Args...)>
39893790 : public __invoke_of<_Fp, _Args...>
39903791{
39913792};
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
39933871#if _LIBCPP_STD_VER > 11
39943872template <class _Tp> using result_of_t = typename result_of<_Tp>::type;
39953873#endif
......@@ -4045,8 +3923,6 @@ _LIBCPP_INLINE_VAR constexpr bool is_nothrow_invocable_r_v
40453923
40463924#endif // _LIBCPP_STD_VER > 14
40473925
4048#endif // !defined(_LIBCPP_CXX03_LANG)
4049
40503926template <class _Tp> struct __is_swappable;
40513927template <class _Tp> struct __is_nothrow_swappable;
40523928
......@@ -4319,6 +4195,25 @@ struct __has_operator_addressof
43194195
43204196#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
43224217#if _LIBCPP_STD_VER > 14
43234218
43244219template <class... _Args>
......@@ -4341,7 +4236,6 @@ _LIBCPP_INLINE_VAR constexpr bool negation_v
43414236#endif // _LIBCPP_STD_VER > 14
43424237
43434238// These traits are used in __tree and __hash_table
4344#ifndef _LIBCPP_CXX03_LANG
43454239struct __extract_key_fail_tag {};
43464240struct __extract_key_self_tag {};
43474241struct __extract_key_first_tag {};
......@@ -4353,7 +4247,7 @@ struct __can_extract_key
43534247 __extract_key_fail_tag>::type {};
43544248
43554249template <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> >
43574251 : conditional<_IsSame<typename remove_const<_First>::type, _Key>::value,
43584252 __extract_key_first_tag, __extract_key_fail_tag>::type {};
43594253
......@@ -4371,8 +4265,6 @@ template <class _ValTy, class _Key, class _RawValTy>
43714265struct __can_extract_map_key<_ValTy, _Key, _Key, _RawValTy>
43724266 : false_type {};
43734267
4374#endif
4375
43764268#ifndef _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED
43774269#if _LIBCPP_STD_VER > 17
43784270_LIBCPP_INLINE_VISIBILITY
lib/libcxx/include/typeinfo+24-5
......@@ -57,6 +57,7 @@ public:
5757*/
5858
5959#include <__config>
60#include <__availability>
6061#include <exception>
6162#include <cstddef>
6263#include <cstdint>
......@@ -141,7 +142,7 @@ public:
141142// comparison is equal.
142143// -------------------------------------------------------------------------- //
143144// NonUniqueARMRTTIBit
144// (selected on ARM64 regardless of _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION)
145// (_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION = 3)
145146// -------------------------------------------------------------------------- //
146147// This implementation of type_info does not assume always a unique copy of
147148// the RTTI for a given type inside a program. It packs the pointer to the
......@@ -160,6 +161,24 @@ public:
160161// the pointer when it constructs the type_info, depending on whether it can
161162// 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
163182struct __type_info_implementations {
164183 struct __string_impl_base {
165184 typedef const char* __type_name_t;
......@@ -243,7 +262,7 @@ struct __type_info_implementations {
243262 private:
244263 // The unique bit is the top bit. It is expected that __type_name_t is 64 bits when
245264 // this implementation is actually used.
246 typedef std::integral_constant<__type_name_t,
265 typedef integral_constant<__type_name_t,
247266 (1ULL << ((__CHAR_BIT__ * sizeof(__type_name_t)) - 1))> __non_unique_rtti_bit;
248267
249268 _LIBCPP_INLINE_VISIBILITY
......@@ -257,12 +276,12 @@ struct __type_info_implementations {
257276 };
258277
259278 typedef
260#if defined(__APPLE__) && defined(__LP64__) && !defined(__x86_64__)
261 __non_unique_arm_rtti_bit_impl
262#elif _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 1
279#if _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 1
263280 __unique_impl
264281#elif _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 2
265282 __non_unique_impl
283#elif _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION == 3
284 __non_unique_arm_rtti_bit_impl
266285#else
267286# error invalid configuration for _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION
268287#endif
lib/libcxx/include/unordered_map+203-67
......@@ -173,10 +173,22 @@ public:
173173
174174 iterator find(const key_type& k);
175175 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
176180 size_type count(const key_type& k) const;
181 template<typename K>
182 size_type count(const K& k) const; // C++20
177183 bool contains(const key_type& k) const; // C++20
184 template<typename K>
185 bool contains(const K& k) const; // C++20
178186 pair<iterator, iterator> equal_range(const key_type& k);
179187 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
181193 mapped_type& operator[](const key_type& k);
182194 mapped_type& operator[](key_type&& k);
......@@ -355,10 +367,22 @@ public:
355367
356368 iterator find(const key_type& k);
357369 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
358374 size_type count(const key_type& k) const;
375 template<typename K>
376 size_type count(const K& k) const; // C++20
359377 bool contains(const key_type& k) const; // C++20
378 template<typename K>
379 bool contains(const K& k) const; // C++20
360380 pair<iterator, iterator> equal_range(const key_type& k);
361381 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
363387 size_type bucket_count() const noexcept;
364388 size_type max_bucket_count() const noexcept;
......@@ -423,7 +447,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
423447
424448_LIBCPP_BEGIN_NAMESPACE_STD
425449
426template <class _Key, class _Cp, class _Hash,
450template <class _Key, class _Cp, class _Hash, class _Pred,
427451 bool = is_empty<_Hash>::value && !__libcpp_is_final<_Hash>::value>
428452class __unordered_map_hasher
429453 : private _Hash
......@@ -445,6 +469,12 @@ public:
445469 _LIBCPP_INLINE_VISIBILITY
446470 size_t operator()(const _Key& __x) const
447471 {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
448478 void swap(__unordered_map_hasher&__y)
449479 _NOEXCEPT_(__is_nothrow_swappable<_Hash>::value)
450480 {
......@@ -453,8 +483,8 @@ public:
453483 }
454484};
455485
456template <class _Key, class _Cp, class _Hash>
457class __unordered_map_hasher<_Key, _Cp, _Hash, false>
486template <class _Key, class _Cp, class _Hash, class _Pred>
487class __unordered_map_hasher<_Key, _Cp, _Hash, _Pred, false>
458488{
459489 _Hash __hash_;
460490public:
......@@ -474,6 +504,12 @@ public:
474504 _LIBCPP_INLINE_VISIBILITY
475505 size_t operator()(const _Key& __x) const
476506 {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
477513 void swap(__unordered_map_hasher&__y)
478514 _NOEXCEPT_(__is_nothrow_swappable<_Hash>::value)
479515 {
......@@ -482,17 +518,17 @@ public:
482518 }
483519};
484520
485template <class _Key, class _Cp, class _Hash, bool __b>
521template <class _Key, class _Cp, class _Hash, class _Pred, bool __b>
486522inline _LIBCPP_INLINE_VISIBILITY
487523void
488swap(__unordered_map_hasher<_Key, _Cp, _Hash, __b>& __x,
489 __unordered_map_hasher<_Key, _Cp, _Hash, __b>& __y)
524swap(__unordered_map_hasher<_Key, _Cp, _Hash, _Pred, __b>& __x,
525 __unordered_map_hasher<_Key, _Cp, _Hash, _Pred, __b>& __y)
490526 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
491527{
492528 __x.swap(__y);
493529}
494530
495template <class _Key, class _Cp, class _Pred,
531template <class _Key, class _Cp, class _Pred, class _Hash,
496532 bool = is_empty<_Pred>::value && !__libcpp_is_final<_Pred>::value>
497533class __unordered_map_equal
498534 : private _Pred
......@@ -517,6 +553,24 @@ public:
517553 _LIBCPP_INLINE_VISIBILITY
518554 bool operator()(const _Key& __x, const _Cp& __y) const
519555 {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
520574 void swap(__unordered_map_equal&__y)
521575 _NOEXCEPT_(__is_nothrow_swappable<_Pred>::value)
522576 {
......@@ -525,8 +579,8 @@ public:
525579 }
526580};
527581
528template <class _Key, class _Cp, class _Pred>
529class __unordered_map_equal<_Key, _Cp, _Pred, false>
582template <class _Key, class _Cp, class _Pred, class _Hash>
583class __unordered_map_equal<_Key, _Cp, _Pred, _Hash, false>
530584{
531585 _Pred __pred_;
532586public:
......@@ -549,6 +603,24 @@ public:
549603 _LIBCPP_INLINE_VISIBILITY
550604 bool operator()(const _Key& __x, const _Cp& __y) const
551605 {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
552624 void swap(__unordered_map_equal&__y)
553625 _NOEXCEPT_(__is_nothrow_swappable<_Pred>::value)
554626 {
......@@ -557,11 +629,11 @@ public:
557629 }
558630};
559631
560template <class _Key, class _Cp, class _Pred, bool __b>
632template <class _Key, class _Cp, class _Pred, class _Hash, bool __b>
561633inline _LIBCPP_INLINE_VISIBILITY
562634void
563swap(__unordered_map_equal<_Key, _Cp, _Pred, __b>& __x,
564 __unordered_map_equal<_Key, _Cp, _Pred, __b>& __y)
635swap(__unordered_map_equal<_Key, _Cp, _Pred, _Hash, __b>& __x,
636 __unordered_map_equal<_Key, _Cp, _Pred, _Hash, __b>& __y)
565637 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
566638{
567639 __x.swap(__y);
......@@ -858,11 +930,11 @@ public:
858930 "Invalid allocator::value_type");
859931
860932private:
861 typedef __hash_value_type<key_type, mapped_type> __value_type;
862 typedef __unordered_map_hasher<key_type, __value_type, hasher> __hasher;
863 typedef __unordered_map_equal<key_type, __value_type, key_equal> __key_equal;
933 typedef __hash_value_type<key_type, mapped_type> __value_type;
934 typedef __unordered_map_hasher<key_type, __value_type, hasher, key_equal> __hasher;
935 typedef __unordered_map_equal<key_type, __value_type, key_equal, hasher> __key_equal;
864936 typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>,
865 __value_type>::type __allocator_type;
937 __value_type>::type __allocator_type;
866938
867939 typedef __hash_table<__value_type, __hasher,
868940 __key_equal, __allocator_type> __table;
......@@ -906,7 +978,7 @@ public:
906978 unordered_map()
907979 _NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
908980 {
909#if _LIBCPP_DEBUG_LEVEL >= 2
981#if _LIBCPP_DEBUG_LEVEL == 2
910982 __get_db()->__insert_c(this);
911983#endif
912984 }
......@@ -1025,7 +1097,7 @@ public:
10251097 {return __table_.__insert_unique(__x);}
10261098
10271099 iterator insert(const_iterator __p, const value_type& __x) {
1028#if _LIBCPP_DEBUG_LEVEL >= 2
1100#if _LIBCPP_DEBUG_LEVEL == 2
10291101 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
10301102 "unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
10311103 " referring to this unordered_map");
......@@ -1049,7 +1121,7 @@ public:
10491121 {return __table_.__insert_unique(_VSTD::move(__x));}
10501122
10511123 iterator insert(const_iterator __p, value_type&& __x) {
1052#if _LIBCPP_DEBUG_LEVEL >= 2
1124#if _LIBCPP_DEBUG_LEVEL == 2
10531125 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
10541126 "unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
10551127 " referring to this unordered_map");
......@@ -1070,7 +1142,7 @@ public:
10701142 _LIBCPP_INLINE_VISIBILITY
10711143 iterator insert(const_iterator __p, _Pp&& __x)
10721144 {
1073#if _LIBCPP_DEBUG_LEVEL >= 2
1145#if _LIBCPP_DEBUG_LEVEL == 2
10741146 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
10751147 "unordered_map::insert(const_iterator, value_type&&) called with an iterator not"
10761148 " referring to this unordered_map");
......@@ -1089,7 +1161,7 @@ public:
10891161 template <class... _Args>
10901162 _LIBCPP_INLINE_VISIBILITY
10911163 iterator emplace_hint(const_iterator __p, _Args&&... __args) {
1092#if _LIBCPP_DEBUG_LEVEL >= 2
1164#if _LIBCPP_DEBUG_LEVEL == 2
10931165 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
10941166 "unordered_map::emplace_hint(const_iterator, args...) called with an iterator not"
10951167 " referring to this unordered_map");
......@@ -1106,7 +1178,7 @@ public:
11061178 _LIBCPP_INLINE_VISIBILITY
11071179 pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args)
11081180 {
1109 return __table_.__emplace_unique_key_args(__k, _VSTD::piecewise_construct,
1181 return __table_.__emplace_unique_key_args(__k, piecewise_construct,
11101182 _VSTD::forward_as_tuple(__k),
11111183 _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
11121184 }
......@@ -1115,7 +1187,7 @@ public:
11151187 _LIBCPP_INLINE_VISIBILITY
11161188 pair<iterator, bool> try_emplace(key_type&& __k, _Args&&... __args)
11171189 {
1118 return __table_.__emplace_unique_key_args(__k, _VSTD::piecewise_construct,
1190 return __table_.__emplace_unique_key_args(__k, piecewise_construct,
11191191 _VSTD::forward_as_tuple(_VSTD::move(__k)),
11201192 _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
11211193 }
......@@ -1124,7 +1196,7 @@ public:
11241196 _LIBCPP_INLINE_VISIBILITY
11251197 iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args)
11261198 {
1127#if _LIBCPP_DEBUG_LEVEL >= 2
1199#if _LIBCPP_DEBUG_LEVEL == 2
11281200 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this,
11291201 "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"
11301202 " referring to this unordered_map");
......@@ -1138,7 +1210,7 @@ public:
11381210 _LIBCPP_INLINE_VISIBILITY
11391211 iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args)
11401212 {
1141#if _LIBCPP_DEBUG_LEVEL >= 2
1213#if _LIBCPP_DEBUG_LEVEL == 2
11421214 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this,
11431215 "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"
11441216 " referring to this unordered_map");
......@@ -1280,11 +1352,34 @@ public:
12801352 iterator find(const key_type& __k) {return __table_.find(__k);}
12811353 _LIBCPP_INLINE_VISIBILITY
12821354 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
12831367 _LIBCPP_INLINE_VISIBILITY
12841368 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
12851375 #if _LIBCPP_STD_VER > 17
12861376 _LIBCPP_INLINE_VISIBILITY
12871377 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();}
12881383 #endif // _LIBCPP_STD_VER > 17
12891384 _LIBCPP_INLINE_VISIBILITY
12901385 pair<iterator, iterator> equal_range(const key_type& __k)
......@@ -1292,6 +1387,16 @@ public:
12921387 _LIBCPP_INLINE_VISIBILITY
12931388 pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
12941389 {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
12961401 mapped_type& operator[](const key_type& __k);
12971402#ifndef _LIBCPP_CXX03_LANG
......@@ -1336,7 +1441,7 @@ public:
13361441 _LIBCPP_INLINE_VISIBILITY
13371442 void reserve(size_type __n) {__table_.reserve(__n);}
13381443
1339#if _LIBCPP_DEBUG_LEVEL >= 2
1444#if _LIBCPP_DEBUG_LEVEL == 2
13401445
13411446 bool __dereferenceable(const const_iterator* __i) const
13421447 {return __table_.__dereferenceable(&__i->__i_);}
......@@ -1347,7 +1452,7 @@ public:
13471452 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
13481453 {return __table_.__addable(&__i->__i_, __n);}
13491454
1350#endif // _LIBCPP_DEBUG_LEVEL >= 2
1455#endif // _LIBCPP_DEBUG_LEVEL == 2
13511456
13521457private:
13531458
......@@ -1428,7 +1533,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
14281533 size_type __n, const hasher& __hf, const key_equal& __eql)
14291534 : __table_(__hf, __eql)
14301535{
1431#if _LIBCPP_DEBUG_LEVEL >= 2
1536#if _LIBCPP_DEBUG_LEVEL == 2
14321537 __get_db()->__insert_c(this);
14331538#endif
14341539 __table_.rehash(__n);
......@@ -1440,7 +1545,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
14401545 const allocator_type& __a)
14411546 : __table_(__hf, __eql, typename __table::allocator_type(__a))
14421547{
1443#if _LIBCPP_DEBUG_LEVEL >= 2
1548#if _LIBCPP_DEBUG_LEVEL == 2
14441549 __get_db()->__insert_c(this);
14451550#endif
14461551 __table_.rehash(__n);
......@@ -1452,7 +1557,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
14521557 const allocator_type& __a)
14531558 : __table_(typename __table::allocator_type(__a))
14541559{
1455#if _LIBCPP_DEBUG_LEVEL >= 2
1560#if _LIBCPP_DEBUG_LEVEL == 2
14561561 __get_db()->__insert_c(this);
14571562#endif
14581563}
......@@ -1462,7 +1567,7 @@ template <class _InputIterator>
14621567unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
14631568 _InputIterator __first, _InputIterator __last)
14641569{
1465#if _LIBCPP_DEBUG_LEVEL >= 2
1570#if _LIBCPP_DEBUG_LEVEL == 2
14661571 __get_db()->__insert_c(this);
14671572#endif
14681573 insert(__first, __last);
......@@ -1475,7 +1580,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
14751580 const hasher& __hf, const key_equal& __eql)
14761581 : __table_(__hf, __eql)
14771582{
1478#if _LIBCPP_DEBUG_LEVEL >= 2
1583#if _LIBCPP_DEBUG_LEVEL == 2
14791584 __get_db()->__insert_c(this);
14801585#endif
14811586 __table_.rehash(__n);
......@@ -1489,7 +1594,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
14891594 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
14901595 : __table_(__hf, __eql, typename __table::allocator_type(__a))
14911596{
1492#if _LIBCPP_DEBUG_LEVEL >= 2
1597#if _LIBCPP_DEBUG_LEVEL == 2
14931598 __get_db()->__insert_c(this);
14941599#endif
14951600 __table_.rehash(__n);
......@@ -1501,7 +1606,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
15011606 const unordered_map& __u)
15021607 : __table_(__u.__table_)
15031608{
1504#if _LIBCPP_DEBUG_LEVEL >= 2
1609#if _LIBCPP_DEBUG_LEVEL == 2
15051610 __get_db()->__insert_c(this);
15061611#endif
15071612 __table_.rehash(__u.bucket_count());
......@@ -1513,7 +1618,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
15131618 const unordered_map& __u, const allocator_type& __a)
15141619 : __table_(__u.__table_, typename __table::allocator_type(__a))
15151620{
1516#if _LIBCPP_DEBUG_LEVEL >= 2
1621#if _LIBCPP_DEBUG_LEVEL == 2
15171622 __get_db()->__insert_c(this);
15181623#endif
15191624 __table_.rehash(__u.bucket_count());
......@@ -1529,7 +1634,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
15291634 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
15301635 : __table_(_VSTD::move(__u.__table_))
15311636{
1532#if _LIBCPP_DEBUG_LEVEL >= 2
1637#if _LIBCPP_DEBUG_LEVEL == 2
15331638 __get_db()->__insert_c(this);
15341639 __get_db()->swap(this, &__u);
15351640#endif
......@@ -1540,7 +1645,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
15401645 unordered_map&& __u, const allocator_type& __a)
15411646 : __table_(_VSTD::move(__u.__table_), typename __table::allocator_type(__a))
15421647{
1543#if _LIBCPP_DEBUG_LEVEL >= 2
1648#if _LIBCPP_DEBUG_LEVEL == 2
15441649 __get_db()->__insert_c(this);
15451650#endif
15461651 if (__a != __u.get_allocator())
......@@ -1551,7 +1656,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
15511656 __u.__table_.remove((__i++).__i_)->__value_.__move());
15521657 }
15531658 }
1554#if _LIBCPP_DEBUG_LEVEL >= 2
1659#if _LIBCPP_DEBUG_LEVEL == 2
15551660 else
15561661 __get_db()->swap(this, &__u);
15571662#endif
......@@ -1561,7 +1666,7 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
15611666unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
15621667 initializer_list<value_type> __il)
15631668{
1564#if _LIBCPP_DEBUG_LEVEL >= 2
1669#if _LIBCPP_DEBUG_LEVEL == 2
15651670 __get_db()->__insert_c(this);
15661671#endif
15671672 insert(__il.begin(), __il.end());
......@@ -1573,7 +1678,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
15731678 const key_equal& __eql)
15741679 : __table_(__hf, __eql)
15751680{
1576#if _LIBCPP_DEBUG_LEVEL >= 2
1681#if _LIBCPP_DEBUG_LEVEL == 2
15771682 __get_db()->__insert_c(this);
15781683#endif
15791684 __table_.rehash(__n);
......@@ -1586,7 +1691,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
15861691 const key_equal& __eql, const allocator_type& __a)
15871692 : __table_(__hf, __eql, typename __table::allocator_type(__a))
15881693{
1589#if _LIBCPP_DEBUG_LEVEL >= 2
1694#if _LIBCPP_DEBUG_LEVEL == 2
15901695 __get_db()->__insert_c(this);
15911696#endif
15921697 __table_.rehash(__n);
......@@ -1633,8 +1738,8 @@ _Tp&
16331738unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k)
16341739{
16351740 return __table_.__emplace_unique_key_args(__k,
1636 std::piecewise_construct, std::forward_as_tuple(__k),
1637 std::forward_as_tuple()).first->__get_value().second;
1741 piecewise_construct, _VSTD::forward_as_tuple(__k),
1742 _VSTD::forward_as_tuple()).first->__get_value().second;
16381743}
16391744
16401745template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
......@@ -1642,8 +1747,8 @@ _Tp&
16421747unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&& __k)
16431748{
16441749 return __table_.__emplace_unique_key_args(__k,
1645 std::piecewise_construct, std::forward_as_tuple(std::move(__k)),
1646 std::forward_as_tuple()).first->__get_value().second;
1750 piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__k)),
1751 _VSTD::forward_as_tuple()).first->__get_value().second;
16471752}
16481753#else // _LIBCPP_CXX03_LANG
16491754
......@@ -1657,7 +1762,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(const
16571762 __h.get_deleter().__first_constructed = true;
16581763 __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__get_value().second));
16591764 __h.get_deleter().__second_constructed = true;
1660 return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
1765 return __h;
16611766}
16621767
16631768template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
......@@ -1762,11 +1867,11 @@ public:
17621867 "Invalid allocator::value_type");
17631868
17641869private:
1765 typedef __hash_value_type<key_type, mapped_type> __value_type;
1766 typedef __unordered_map_hasher<key_type, __value_type, hasher> __hasher;
1767 typedef __unordered_map_equal<key_type, __value_type, key_equal> __key_equal;
1870 typedef __hash_value_type<key_type, mapped_type> __value_type;
1871 typedef __unordered_map_hasher<key_type, __value_type, hasher, key_equal> __hasher;
1872 typedef __unordered_map_equal<key_type, __value_type, key_equal, hasher> __key_equal;
17681873 typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>,
1769 __value_type>::type __allocator_type;
1874 __value_type>::type __allocator_type;
17701875
17711876 typedef __hash_table<__value_type, __hasher,
17721877 __key_equal, __allocator_type> __table;
......@@ -1807,7 +1912,7 @@ public:
18071912 unordered_multimap()
18081913 _NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
18091914 {
1810#if _LIBCPP_DEBUG_LEVEL >= 2
1915#if _LIBCPP_DEBUG_LEVEL == 2
18111916 __get_db()->__insert_c(this);
18121917#endif
18131918 }
......@@ -2059,11 +2164,32 @@ public:
20592164 iterator find(const key_type& __k) {return __table_.find(__k);}
20602165 _LIBCPP_INLINE_VISIBILITY
20612166 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
20622177 _LIBCPP_INLINE_VISIBILITY
20632178 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
20642185 #if _LIBCPP_STD_VER > 17
20652186 _LIBCPP_INLINE_VISIBILITY
20662187 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();}
20672193 #endif // _LIBCPP_STD_VER > 17
20682194 _LIBCPP_INLINE_VISIBILITY
20692195 pair<iterator, iterator> equal_range(const key_type& __k)
......@@ -2071,6 +2197,16 @@ public:
20712197 _LIBCPP_INLINE_VISIBILITY
20722198 pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
20732199 {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
20752211 _LIBCPP_INLINE_VISIBILITY
20762212 size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
......@@ -2108,7 +2244,7 @@ public:
21082244 _LIBCPP_INLINE_VISIBILITY
21092245 void reserve(size_type __n) {__table_.reserve(__n);}
21102246
2111#if _LIBCPP_DEBUG_LEVEL >= 2
2247#if _LIBCPP_DEBUG_LEVEL == 2
21122248
21132249 bool __dereferenceable(const const_iterator* __i) const
21142250 {return __table_.__dereferenceable(&__i->__i_);}
......@@ -2119,7 +2255,7 @@ public:
21192255 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
21202256 {return __table_.__addable(&__i->__i_, __n);}
21212257
2122#endif // _LIBCPP_DEBUG_LEVEL >= 2
2258#endif // _LIBCPP_DEBUG_LEVEL == 2
21232259
21242260
21252261};
......@@ -2196,7 +2332,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
21962332 size_type __n, const hasher& __hf, const key_equal& __eql)
21972333 : __table_(__hf, __eql)
21982334{
2199#if _LIBCPP_DEBUG_LEVEL >= 2
2335#if _LIBCPP_DEBUG_LEVEL == 2
22002336 __get_db()->__insert_c(this);
22012337#endif
22022338 __table_.rehash(__n);
......@@ -2208,7 +2344,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
22082344 const allocator_type& __a)
22092345 : __table_(__hf, __eql, typename __table::allocator_type(__a))
22102346{
2211#if _LIBCPP_DEBUG_LEVEL >= 2
2347#if _LIBCPP_DEBUG_LEVEL == 2
22122348 __get_db()->__insert_c(this);
22132349#endif
22142350 __table_.rehash(__n);
......@@ -2219,7 +2355,7 @@ template <class _InputIterator>
22192355unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
22202356 _InputIterator __first, _InputIterator __last)
22212357{
2222#if _LIBCPP_DEBUG_LEVEL >= 2
2358#if _LIBCPP_DEBUG_LEVEL == 2
22232359 __get_db()->__insert_c(this);
22242360#endif
22252361 insert(__first, __last);
......@@ -2232,7 +2368,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
22322368 const hasher& __hf, const key_equal& __eql)
22332369 : __table_(__hf, __eql)
22342370{
2235#if _LIBCPP_DEBUG_LEVEL >= 2
2371#if _LIBCPP_DEBUG_LEVEL == 2
22362372 __get_db()->__insert_c(this);
22372373#endif
22382374 __table_.rehash(__n);
......@@ -2246,7 +2382,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
22462382 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
22472383 : __table_(__hf, __eql, typename __table::allocator_type(__a))
22482384{
2249#if _LIBCPP_DEBUG_LEVEL >= 2
2385#if _LIBCPP_DEBUG_LEVEL == 2
22502386 __get_db()->__insert_c(this);
22512387#endif
22522388 __table_.rehash(__n);
......@@ -2259,7 +2395,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
22592395 const allocator_type& __a)
22602396 : __table_(typename __table::allocator_type(__a))
22612397{
2262#if _LIBCPP_DEBUG_LEVEL >= 2
2398#if _LIBCPP_DEBUG_LEVEL == 2
22632399 __get_db()->__insert_c(this);
22642400#endif
22652401}
......@@ -2269,7 +2405,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
22692405 const unordered_multimap& __u)
22702406 : __table_(__u.__table_)
22712407{
2272#if _LIBCPP_DEBUG_LEVEL >= 2
2408#if _LIBCPP_DEBUG_LEVEL == 2
22732409 __get_db()->__insert_c(this);
22742410#endif
22752411 __table_.rehash(__u.bucket_count());
......@@ -2281,7 +2417,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
22812417 const unordered_multimap& __u, const allocator_type& __a)
22822418 : __table_(__u.__table_, typename __table::allocator_type(__a))
22832419{
2284#if _LIBCPP_DEBUG_LEVEL >= 2
2420#if _LIBCPP_DEBUG_LEVEL == 2
22852421 __get_db()->__insert_c(this);
22862422#endif
22872423 __table_.rehash(__u.bucket_count());
......@@ -2297,7 +2433,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
22972433 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
22982434 : __table_(_VSTD::move(__u.__table_))
22992435{
2300#if _LIBCPP_DEBUG_LEVEL >= 2
2436#if _LIBCPP_DEBUG_LEVEL == 2
23012437 __get_db()->__insert_c(this);
23022438 __get_db()->swap(this, &__u);
23032439#endif
......@@ -2308,7 +2444,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
23082444 unordered_multimap&& __u, const allocator_type& __a)
23092445 : __table_(_VSTD::move(__u.__table_), typename __table::allocator_type(__a))
23102446{
2311#if _LIBCPP_DEBUG_LEVEL >= 2
2447#if _LIBCPP_DEBUG_LEVEL == 2
23122448 __get_db()->__insert_c(this);
23132449#endif
23142450 if (__a != __u.get_allocator())
......@@ -2320,7 +2456,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
23202456 __u.__table_.remove((__i++).__i_)->__value_.__move());
23212457 }
23222458 }
2323#if _LIBCPP_DEBUG_LEVEL >= 2
2459#if _LIBCPP_DEBUG_LEVEL == 2
23242460 else
23252461 __get_db()->swap(this, &__u);
23262462#endif
......@@ -2330,7 +2466,7 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
23302466unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
23312467 initializer_list<value_type> __il)
23322468{
2333#if _LIBCPP_DEBUG_LEVEL >= 2
2469#if _LIBCPP_DEBUG_LEVEL == 2
23342470 __get_db()->__insert_c(this);
23352471#endif
23362472 insert(__il.begin(), __il.end());
......@@ -2342,7 +2478,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
23422478 const key_equal& __eql)
23432479 : __table_(__hf, __eql)
23442480{
2345#if _LIBCPP_DEBUG_LEVEL >= 2
2481#if _LIBCPP_DEBUG_LEVEL == 2
23462482 __get_db()->__insert_c(this);
23472483#endif
23482484 __table_.rehash(__n);
......@@ -2355,7 +2491,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
23552491 const key_equal& __eql, const allocator_type& __a)
23562492 : __table_(__hf, __eql, typename __table::allocator_type(__a))
23572493{
2358#if _LIBCPP_DEBUG_LEVEL >= 2
2494#if _LIBCPP_DEBUG_LEVEL == 2
23592495 __get_db()->__insert_c(this);
23602496#endif
23612497 __table_.rehash(__n);
lib/libcxx/include/unordered_set+123-37
......@@ -145,10 +145,22 @@ public:
145145
146146 iterator find(const key_type& k);
147147 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
148152 size_type count(const key_type& k) const;
153 template<typename K>
154 size_type count(const K& k) const; // C++20
149155 bool contains(const key_type& k) const; // C++20
156 template<typename K>
157 bool contains(const K& k) const; // C++20
150158 pair<iterator, iterator> equal_range(const key_type& k);
151159 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
153165 size_type bucket_count() const noexcept;
154166 size_type max_bucket_count() const noexcept;
......@@ -310,10 +322,22 @@ public:
310322
311323 iterator find(const key_type& k);
312324 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
313329 size_type count(const key_type& k) const;
330 template<typename K>
331 size_type count(const K& k) const; // C++20
314332 bool contains(const key_type& k) const; // C++20
333 template<typename K>
334 bool contains(const K& k) const; // C++20
315335 pair<iterator, iterator> equal_range(const key_type& k);
316336 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
318342 size_type bucket_count() const noexcept;
319343 size_type max_bucket_count() const noexcept;
......@@ -425,7 +449,7 @@ public:
425449 unordered_set()
426450 _NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
427451 {
428#if _LIBCPP_DEBUG_LEVEL >= 2
452#if _LIBCPP_DEBUG_LEVEL == 2
429453 __get_db()->__insert_c(this);
430454#endif
431455 }
......@@ -539,7 +563,7 @@ public:
539563 {return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...);}
540564 template <class... _Args>
541565 _LIBCPP_INLINE_VISIBILITY
542#if _LIBCPP_DEBUG_LEVEL >= 2
566#if _LIBCPP_DEBUG_LEVEL == 2
543567 iterator emplace_hint(const_iterator __p, _Args&&... __args)
544568 {
545569 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
......@@ -556,7 +580,7 @@ public:
556580 pair<iterator, bool> insert(value_type&& __x)
557581 {return __table_.__insert_unique(_VSTD::move(__x));}
558582 _LIBCPP_INLINE_VISIBILITY
559#if _LIBCPP_DEBUG_LEVEL >= 2
583#if _LIBCPP_DEBUG_LEVEL == 2
560584 iterator insert(const_iterator __p, value_type&& __x)
561585 {
562586 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
......@@ -577,7 +601,7 @@ public:
577601 {return __table_.__insert_unique(__x);}
578602
579603 _LIBCPP_INLINE_VISIBILITY
580#if _LIBCPP_DEBUG_LEVEL >= 2
604#if _LIBCPP_DEBUG_LEVEL == 2
581605 iterator insert(const_iterator __p, const value_type& __x)
582606 {
583607 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
......@@ -679,11 +703,32 @@ public:
679703 iterator find(const key_type& __k) {return __table_.find(__k);}
680704 _LIBCPP_INLINE_VISIBILITY
681705 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
682716 _LIBCPP_INLINE_VISIBILITY
683717 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
684724 #if _LIBCPP_STD_VER > 17
685725 _LIBCPP_INLINE_VISIBILITY
686726 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();}
687732 #endif // _LIBCPP_STD_VER > 17
688733 _LIBCPP_INLINE_VISIBILITY
689734 pair<iterator, iterator> equal_range(const key_type& __k)
......@@ -691,6 +736,16 @@ public:
691736 _LIBCPP_INLINE_VISIBILITY
692737 pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
693738 {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
695750 _LIBCPP_INLINE_VISIBILITY
696751 size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
......@@ -726,7 +781,7 @@ public:
726781 _LIBCPP_INLINE_VISIBILITY
727782 void reserve(size_type __n) {__table_.reserve(__n);}
728783
729#if _LIBCPP_DEBUG_LEVEL >= 2
784#if _LIBCPP_DEBUG_LEVEL == 2
730785
731786 bool __dereferenceable(const const_iterator* __i) const
732787 {return __table_.__dereferenceable(__i);}
......@@ -737,7 +792,7 @@ public:
737792 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
738793 {return __table_.__addable(__i, __n);}
739794
740#endif // _LIBCPP_DEBUG_LEVEL >= 2
795#endif // _LIBCPP_DEBUG_LEVEL == 2
741796
742797};
743798
......@@ -802,7 +857,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(size_type __n,
802857 const hasher& __hf, const key_equal& __eql)
803858 : __table_(__hf, __eql)
804859{
805#if _LIBCPP_DEBUG_LEVEL >= 2
860#if _LIBCPP_DEBUG_LEVEL == 2
806861 __get_db()->__insert_c(this);
807862#endif
808863 __table_.rehash(__n);
......@@ -813,7 +868,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(size_type __n,
813868 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
814869 : __table_(__hf, __eql, __a)
815870{
816#if _LIBCPP_DEBUG_LEVEL >= 2
871#if _LIBCPP_DEBUG_LEVEL == 2
817872 __get_db()->__insert_c(this);
818873#endif
819874 __table_.rehash(__n);
......@@ -824,7 +879,7 @@ template <class _InputIterator>
824879unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
825880 _InputIterator __first, _InputIterator __last)
826881{
827#if _LIBCPP_DEBUG_LEVEL >= 2
882#if _LIBCPP_DEBUG_LEVEL == 2
828883 __get_db()->__insert_c(this);
829884#endif
830885 insert(__first, __last);
......@@ -837,7 +892,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
837892 const hasher& __hf, const key_equal& __eql)
838893 : __table_(__hf, __eql)
839894{
840#if _LIBCPP_DEBUG_LEVEL >= 2
895#if _LIBCPP_DEBUG_LEVEL == 2
841896 __get_db()->__insert_c(this);
842897#endif
843898 __table_.rehash(__n);
......@@ -851,7 +906,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
851906 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
852907 : __table_(__hf, __eql, __a)
853908{
854#if _LIBCPP_DEBUG_LEVEL >= 2
909#if _LIBCPP_DEBUG_LEVEL == 2
855910 __get_db()->__insert_c(this);
856911#endif
857912 __table_.rehash(__n);
......@@ -864,7 +919,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
864919 const allocator_type& __a)
865920 : __table_(__a)
866921{
867#if _LIBCPP_DEBUG_LEVEL >= 2
922#if _LIBCPP_DEBUG_LEVEL == 2
868923 __get_db()->__insert_c(this);
869924#endif
870925}
......@@ -874,7 +929,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
874929 const unordered_set& __u)
875930 : __table_(__u.__table_)
876931{
877#if _LIBCPP_DEBUG_LEVEL >= 2
932#if _LIBCPP_DEBUG_LEVEL == 2
878933 __get_db()->__insert_c(this);
879934#endif
880935 __table_.rehash(__u.bucket_count());
......@@ -886,7 +941,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
886941 const unordered_set& __u, const allocator_type& __a)
887942 : __table_(__u.__table_, __a)
888943{
889#if _LIBCPP_DEBUG_LEVEL >= 2
944#if _LIBCPP_DEBUG_LEVEL == 2
890945 __get_db()->__insert_c(this);
891946#endif
892947 __table_.rehash(__u.bucket_count());
......@@ -902,7 +957,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
902957 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
903958 : __table_(_VSTD::move(__u.__table_))
904959{
905#if _LIBCPP_DEBUG_LEVEL >= 2
960#if _LIBCPP_DEBUG_LEVEL == 2
906961 __get_db()->__insert_c(this);
907962 __get_db()->swap(this, &__u);
908963#endif
......@@ -913,7 +968,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
913968 unordered_set&& __u, const allocator_type& __a)
914969 : __table_(_VSTD::move(__u.__table_), __a)
915970{
916#if _LIBCPP_DEBUG_LEVEL >= 2
971#if _LIBCPP_DEBUG_LEVEL == 2
917972 __get_db()->__insert_c(this);
918973#endif
919974 if (__a != __u.get_allocator())
......@@ -922,7 +977,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
922977 while (__u.size() != 0)
923978 __table_.__insert_unique(_VSTD::move(__u.__table_.remove(__i++)->__value_));
924979 }
925#if _LIBCPP_DEBUG_LEVEL >= 2
980#if _LIBCPP_DEBUG_LEVEL == 2
926981 else
927982 __get_db()->swap(this, &__u);
928983#endif
......@@ -932,7 +987,7 @@ template <class _Value, class _Hash, class _Pred, class _Alloc>
932987unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
933988 initializer_list<value_type> __il)
934989{
935#if _LIBCPP_DEBUG_LEVEL >= 2
990#if _LIBCPP_DEBUG_LEVEL == 2
936991 __get_db()->__insert_c(this);
937992#endif
938993 insert(__il.begin(), __il.end());
......@@ -944,7 +999,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
944999 const key_equal& __eql)
9451000 : __table_(__hf, __eql)
9461001{
947#if _LIBCPP_DEBUG_LEVEL >= 2
1002#if _LIBCPP_DEBUG_LEVEL == 2
9481003 __get_db()->__insert_c(this);
9491004#endif
9501005 __table_.rehash(__n);
......@@ -957,7 +1012,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
9571012 const key_equal& __eql, const allocator_type& __a)
9581013 : __table_(__hf, __eql, __a)
9591014{
960#if _LIBCPP_DEBUG_LEVEL >= 2
1015#if _LIBCPP_DEBUG_LEVEL == 2
9611016 __get_db()->__insert_c(this);
9621017#endif
9631018 __table_.rehash(__n);
......@@ -1091,7 +1146,7 @@ public:
10911146 unordered_multiset()
10921147 _NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
10931148 {
1094#if _LIBCPP_DEBUG_LEVEL >= 2
1149#if _LIBCPP_DEBUG_LEVEL == 2
10951150 __get_db()->__insert_c(this);
10961151#endif
10971152 }
......@@ -1314,11 +1369,32 @@ public:
13141369 iterator find(const key_type& __k) {return __table_.find(__k);}
13151370 _LIBCPP_INLINE_VISIBILITY
13161371 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
13171382 _LIBCPP_INLINE_VISIBILITY
13181383 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
13191390 #if _LIBCPP_STD_VER > 17
13201391 _LIBCPP_INLINE_VISIBILITY
13211392 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();}
13221398 #endif // _LIBCPP_STD_VER > 17
13231399 _LIBCPP_INLINE_VISIBILITY
13241400 pair<iterator, iterator> equal_range(const key_type& __k)
......@@ -1326,6 +1402,16 @@ public:
13261402 _LIBCPP_INLINE_VISIBILITY
13271403 pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
13281404 {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
13301416 _LIBCPP_INLINE_VISIBILITY
13311417 size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();}
......@@ -1361,7 +1447,7 @@ public:
13611447 _LIBCPP_INLINE_VISIBILITY
13621448 void reserve(size_type __n) {__table_.reserve(__n);}
13631449
1364#if _LIBCPP_DEBUG_LEVEL >= 2
1450#if _LIBCPP_DEBUG_LEVEL == 2
13651451
13661452 bool __dereferenceable(const const_iterator* __i) const
13671453 {return __table_.__dereferenceable(__i);}
......@@ -1372,7 +1458,7 @@ public:
13721458 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
13731459 {return __table_.__addable(__i, __n);}
13741460
1375#endif // _LIBCPP_DEBUG_LEVEL >= 2
1461#endif // _LIBCPP_DEBUG_LEVEL == 2
13761462
13771463};
13781464
......@@ -1435,7 +1521,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
14351521 size_type __n, const hasher& __hf, const key_equal& __eql)
14361522 : __table_(__hf, __eql)
14371523{
1438#if _LIBCPP_DEBUG_LEVEL >= 2
1524#if _LIBCPP_DEBUG_LEVEL == 2
14391525 __get_db()->__insert_c(this);
14401526#endif
14411527 __table_.rehash(__n);
......@@ -1447,7 +1533,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
14471533 const allocator_type& __a)
14481534 : __table_(__hf, __eql, __a)
14491535{
1450#if _LIBCPP_DEBUG_LEVEL >= 2
1536#if _LIBCPP_DEBUG_LEVEL == 2
14511537 __get_db()->__insert_c(this);
14521538#endif
14531539 __table_.rehash(__n);
......@@ -1458,7 +1544,7 @@ template <class _InputIterator>
14581544unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
14591545 _InputIterator __first, _InputIterator __last)
14601546{
1461#if _LIBCPP_DEBUG_LEVEL >= 2
1547#if _LIBCPP_DEBUG_LEVEL == 2
14621548 __get_db()->__insert_c(this);
14631549#endif
14641550 insert(__first, __last);
......@@ -1471,7 +1557,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
14711557 const hasher& __hf, const key_equal& __eql)
14721558 : __table_(__hf, __eql)
14731559{
1474#if _LIBCPP_DEBUG_LEVEL >= 2
1560#if _LIBCPP_DEBUG_LEVEL == 2
14751561 __get_db()->__insert_c(this);
14761562#endif
14771563 __table_.rehash(__n);
......@@ -1485,7 +1571,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
14851571 const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
14861572 : __table_(__hf, __eql, __a)
14871573{
1488#if _LIBCPP_DEBUG_LEVEL >= 2
1574#if _LIBCPP_DEBUG_LEVEL == 2
14891575 __get_db()->__insert_c(this);
14901576#endif
14911577 __table_.rehash(__n);
......@@ -1498,7 +1584,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
14981584 const allocator_type& __a)
14991585 : __table_(__a)
15001586{
1501#if _LIBCPP_DEBUG_LEVEL >= 2
1587#if _LIBCPP_DEBUG_LEVEL == 2
15021588 __get_db()->__insert_c(this);
15031589#endif
15041590}
......@@ -1508,7 +1594,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
15081594 const unordered_multiset& __u)
15091595 : __table_(__u.__table_)
15101596{
1511#if _LIBCPP_DEBUG_LEVEL >= 2
1597#if _LIBCPP_DEBUG_LEVEL == 2
15121598 __get_db()->__insert_c(this);
15131599#endif
15141600 __table_.rehash(__u.bucket_count());
......@@ -1520,7 +1606,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
15201606 const unordered_multiset& __u, const allocator_type& __a)
15211607 : __table_(__u.__table_, __a)
15221608{
1523#if _LIBCPP_DEBUG_LEVEL >= 2
1609#if _LIBCPP_DEBUG_LEVEL == 2
15241610 __get_db()->__insert_c(this);
15251611#endif
15261612 __table_.rehash(__u.bucket_count());
......@@ -1536,7 +1622,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
15361622 _NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
15371623 : __table_(_VSTD::move(__u.__table_))
15381624{
1539#if _LIBCPP_DEBUG_LEVEL >= 2
1625#if _LIBCPP_DEBUG_LEVEL == 2
15401626 __get_db()->__insert_c(this);
15411627 __get_db()->swap(this, &__u);
15421628#endif
......@@ -1547,7 +1633,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
15471633 unordered_multiset&& __u, const allocator_type& __a)
15481634 : __table_(_VSTD::move(__u.__table_), __a)
15491635{
1550#if _LIBCPP_DEBUG_LEVEL >= 2
1636#if _LIBCPP_DEBUG_LEVEL == 2
15511637 __get_db()->__insert_c(this);
15521638#endif
15531639 if (__a != __u.get_allocator())
......@@ -1556,7 +1642,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
15561642 while (__u.size() != 0)
15571643 __table_.__insert_multi(_VSTD::move(__u.__table_.remove(__i++)->__value_));
15581644 }
1559#if _LIBCPP_DEBUG_LEVEL >= 2
1645#if _LIBCPP_DEBUG_LEVEL == 2
15601646 else
15611647 __get_db()->swap(this, &__u);
15621648#endif
......@@ -1566,7 +1652,7 @@ template <class _Value, class _Hash, class _Pred, class _Alloc>
15661652unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
15671653 initializer_list<value_type> __il)
15681654{
1569#if _LIBCPP_DEBUG_LEVEL >= 2
1655#if _LIBCPP_DEBUG_LEVEL == 2
15701656 __get_db()->__insert_c(this);
15711657#endif
15721658 insert(__il.begin(), __il.end());
......@@ -1578,7 +1664,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
15781664 const key_equal& __eql)
15791665 : __table_(__hf, __eql)
15801666{
1581#if _LIBCPP_DEBUG_LEVEL >= 2
1667#if _LIBCPP_DEBUG_LEVEL == 2
15821668 __get_db()->__insert_c(this);
15831669#endif
15841670 __table_.rehash(__n);
......@@ -1591,7 +1677,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
15911677 const key_equal& __eql, const allocator_type& __a)
15921678 : __table_(__hf, __eql, __a)
15931679{
1594#if _LIBCPP_DEBUG_LEVEL >= 2
1680#if _LIBCPP_DEBUG_LEVEL == 2
15951681 __get_db()->__insert_c(this);
15961682#endif
15971683 __table_.rehash(__n);
lib/libcxx/include/utility+24-14
......@@ -499,7 +499,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
499499 second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
500500
501501 template <class... _Args1, class... _Args2>
502 _LIBCPP_INLINE_VISIBILITY
502 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
503503 pair(piecewise_construct_t __pc,
504504 tuple<_Args1...> __first_args, tuple<_Args2...> __second_args)
505505 _NOEXCEPT_((is_nothrow_constructible<first_type, _Args1...>::value &&
......@@ -508,7 +508,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
508508 typename __make_tuple_indices<sizeof...(_Args1)>::type(),
509509 typename __make_tuple_indices<sizeof...(_Args2) >::type()) {}
510510
511 _LIBCPP_INLINE_VISIBILITY
511 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
512512 pair& operator=(typename conditional<
513513 is_copy_assignable<first_type>::value &&
514514 is_copy_assignable<second_type>::value,
......@@ -521,7 +521,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
521521 return *this;
522522 }
523523
524 _LIBCPP_INLINE_VISIBILITY
524 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
525525 pair& operator=(typename conditional<
526526 is_move_assignable<first_type>::value &&
527527 is_move_assignable<second_type>::value,
......@@ -537,7 +537,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
537537 template <class _Tuple, _EnableB<
538538 _CheckTLC<_Tuple>::template __enable_assign<_Tuple>()
539539 > = false>
540 _LIBCPP_INLINE_VISIBILITY
540 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
541541 pair& operator=(_Tuple&& __p) {
542542 first = _VSTD::get<0>(_VSTD::forward<_Tuple>(__p));
543543 second = _VSTD::get<1>(_VSTD::forward<_Tuple>(__p));
......@@ -545,7 +545,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
545545 }
546546#endif
547547
548 _LIBCPP_INLINE_VISIBILITY
548 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
549549 void
550550 swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
551551 __is_nothrow_swappable<second_type>::value)
......@@ -558,10 +558,10 @@ private:
558558
559559#ifndef _LIBCPP_CXX03_LANG
560560 template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
561 _LIBCPP_INLINE_VISIBILITY
562 pair(piecewise_construct_t,
563 tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
564 __tuple_indices<_I1...>, __tuple_indices<_I2...>);
561 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
562 pair(piecewise_construct_t,
563 tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
564 __tuple_indices<_I1...>, __tuple_indices<_I2...>);
565565#endif
566566};
567567
......@@ -619,7 +619,7 @@ operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
619619}
620620
621621template <class _T1, class _T2>
622inline _LIBCPP_INLINE_VISIBILITY
622inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
623623typename enable_if
624624<
625625 __is_swappable<_T1>::value &&
......@@ -970,7 +970,7 @@ _Size
970970__loadword(const void* __p)
971971{
972972 _Size __r;
973 std::memcpy(&__r, __p, sizeof(__r));
973 _VSTD::memcpy(&__r, __p, sizeof(__r));
974974 return __r;
975975}
976976
......@@ -1189,7 +1189,7 @@ __murmur2_or_cityhash<_Size, 64>::operator()(const void* __key, _Size __len)
11891189 __v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first);
11901190 __w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second,
11911191 __y + __loadword<_Size>(__s + 16));
1192 std::swap(__z, __x);
1192 _VSTD::swap(__z, __x);
11931193 __s += 64;
11941194 __len -= 64;
11951195 } while (__len != 0);
......@@ -1364,6 +1364,16 @@ struct _LIBCPP_TEMPLATE_VIS hash<unsigned char>
13641364 size_t operator()(unsigned char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
13651365};
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
13671377#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
13681378
13691379template <>
......@@ -1506,7 +1516,7 @@ struct _LIBCPP_TEMPLATE_VIS hash<long double>
15061516 // -0.0 and 0.0 should return same hash
15071517 if (__v == 0.0L)
15081518 return 0;
1509#if defined(__i386__)
1519#if defined(__i386__) || (defined(__x86_64__) && defined(__ILP32__))
15101520 // Zero out padding bits
15111521 union
15121522 {
......@@ -1593,7 +1603,7 @@ using __check_hash_requirements _LIBCPP_NODEBUG_TYPE = integral_constant<bool,
15931603 __invokable_r<size_t, _Hash, _Key const&>::value
15941604>;
15951605
1596template <class _Key, class _Hash = std::hash<_Key> >
1606template <class _Key, class _Hash = hash<_Key> >
15971607using __has_enabled_hash _LIBCPP_NODEBUG_TYPE = integral_constant<bool,
15981608 __check_hash_requirements<_Key, _Hash>::value &&
15991609 is_default_constructible<_Hash>::value
lib/libcxx/include/valarray+73-95
......@@ -136,6 +136,7 @@ public:
136136 void operator>>=(const valarray<value_type>& v) const;
137137
138138 void operator=(const value_type& x) const;
139 void operator=(const valarray<T>& val_arr) const;
139140
140141 slice_array() = delete;
141142};
......@@ -802,7 +803,7 @@ private:
802803public:
803804 // construct/destroy:
804805 _LIBCPP_INLINE_VISIBILITY
805 valarray() : __begin_(0), __end_(0) {}
806 valarray() : __begin_(nullptr), __end_(nullptr) {}
806807 inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
807808 explicit valarray(size_t __n);
808809 _LIBCPP_INLINE_VISIBILITY
......@@ -1264,6 +1265,9 @@ public:
12641265 _LIBCPP_INLINE_VISIBILITY
12651266 void operator=(const value_type& __x) const;
12661267
1268 _LIBCPP_INLINE_VISIBILITY
1269 void operator=(const valarray<value_type>& __va) const;
1270
12671271private:
12681272 _LIBCPP_INLINE_VISIBILITY
12691273 slice_array(const slice& __sl, const valarray<value_type>& __v)
......@@ -1303,6 +1307,15 @@ slice_array<_Tp>::operator=(const _Expr& __v) const
13031307 *__t = __v[__i];
13041308}
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
13061319template <class _Tp>
13071320template <class _Expr>
13081321inline
......@@ -2738,11 +2751,9 @@ __val_expr<_ValExpr>::operator valarray<__val_expr::result_type>() const
27382751 if (__n)
27392752 {
27402753 __r.__begin_ =
2741 __r.__end_ =
2742 static_cast<result_type*>(
2743 _VSTD::__libcpp_allocate(__n * sizeof(result_type), _LIBCPP_ALIGNOF(result_type)));
2754 __r.__end_ = allocator<result_type>().allocate(__n);
27442755 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]);
27462757 }
27472758 return __r;
27482759}
......@@ -2752,19 +2763,18 @@ __val_expr<_ValExpr>::operator valarray<__val_expr::result_type>() const
27522763template <class _Tp>
27532764inline
27542765valarray<_Tp>::valarray(size_t __n)
2755 : __begin_(0),
2756 __end_(0)
2766 : __begin_(nullptr),
2767 __end_(nullptr)
27572768{
27582769 if (__n)
27592770 {
2760 __begin_ = __end_ = static_cast<value_type*>(
2761 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2771 __begin_ = __end_ = allocator<value_type>().allocate(__n);
27622772#ifndef _LIBCPP_NO_EXCEPTIONS
27632773 try
27642774 {
27652775#endif // _LIBCPP_NO_EXCEPTIONS
27662776 for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)
2767 ::new (__end_) value_type();
2777 ::new ((void*)__end_) value_type();
27682778#ifndef _LIBCPP_NO_EXCEPTIONS
27692779 }
27702780 catch (...)
......@@ -2779,27 +2789,26 @@ valarray<_Tp>::valarray(size_t __n)
27792789template <class _Tp>
27802790inline
27812791valarray<_Tp>::valarray(const value_type& __x, size_t __n)
2782 : __begin_(0),
2783 __end_(0)
2792 : __begin_(nullptr),
2793 __end_(nullptr)
27842794{
27852795 resize(__n, __x);
27862796}
27872797
27882798template <class _Tp>
27892799valarray<_Tp>::valarray(const value_type* __p, size_t __n)
2790 : __begin_(0),
2791 __end_(0)
2800 : __begin_(nullptr),
2801 __end_(nullptr)
27922802{
27932803 if (__n)
27942804 {
2795 __begin_ = __end_ = static_cast<value_type*>(
2796 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2805 __begin_ = __end_ = allocator<value_type>().allocate(__n);
27972806#ifndef _LIBCPP_NO_EXCEPTIONS
27982807 try
27992808 {
28002809#endif // _LIBCPP_NO_EXCEPTIONS
28012810 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);
28032812#ifndef _LIBCPP_NO_EXCEPTIONS
28042813 }
28052814 catch (...)
......@@ -2813,19 +2822,18 @@ valarray<_Tp>::valarray(const value_type* __p, size_t __n)
28132822
28142823template <class _Tp>
28152824valarray<_Tp>::valarray(const valarray& __v)
2816 : __begin_(0),
2817 __end_(0)
2825 : __begin_(nullptr),
2826 __end_(nullptr)
28182827{
28192828 if (__v.size())
28202829 {
2821 __begin_ = __end_ = static_cast<value_type*>(
2822 _VSTD::__libcpp_allocate(__v.size() * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2830 __begin_ = __end_ = allocator<value_type>().allocate(__v.size());
28232831#ifndef _LIBCPP_NO_EXCEPTIONS
28242832 try
28252833 {
28262834#endif // _LIBCPP_NO_EXCEPTIONS
28272835 for (value_type* __p = __v.__begin_; __p != __v.__end_; ++__end_, ++__p)
2828 ::new (__end_) value_type(*__p);
2836 ::new ((void*)__end_) value_type(*__p);
28292837#ifndef _LIBCPP_NO_EXCEPTIONS
28302838 }
28312839 catch (...)
......@@ -2850,21 +2858,20 @@ valarray<_Tp>::valarray(valarray&& __v) _NOEXCEPT
28502858
28512859template <class _Tp>
28522860valarray<_Tp>::valarray(initializer_list<value_type> __il)
2853 : __begin_(0),
2854 __end_(0)
2861 : __begin_(nullptr),
2862 __end_(nullptr)
28552863{
28562864 const size_t __n = __il.size();
28572865 if (__n)
28582866 {
2859 __begin_ = __end_ = static_cast<value_type*>(
2860_VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2867 __begin_ = __end_ = allocator<value_type>().allocate(__n);
28612868#ifndef _LIBCPP_NO_EXCEPTIONS
28622869 try
28632870 {
28642871#endif // _LIBCPP_NO_EXCEPTIONS
28652872 size_t __n_left = __n;
28662873 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);
28682875#ifndef _LIBCPP_NO_EXCEPTIONS
28692876 }
28702877 catch (...)
......@@ -2880,21 +2887,20 @@ _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)))
28802887
28812888template <class _Tp>
28822889valarray<_Tp>::valarray(const slice_array<value_type>& __sa)
2883 : __begin_(0),
2884 __end_(0)
2890 : __begin_(nullptr),
2891 __end_(nullptr)
28852892{
28862893 const size_t __n = __sa.__size_;
28872894 if (__n)
28882895 {
2889 __begin_ = __end_ = static_cast<value_type*>(
2890 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2896 __begin_ = __end_ = allocator<value_type>().allocate(__n);
28912897#ifndef _LIBCPP_NO_EXCEPTIONS
28922898 try
28932899 {
28942900#endif // _LIBCPP_NO_EXCEPTIONS
28952901 size_t __n_left = __n;
28962902 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);
28982904#ifndef _LIBCPP_NO_EXCEPTIONS
28992905 }
29002906 catch (...)
......@@ -2908,14 +2914,13 @@ valarray<_Tp>::valarray(const slice_array<value_type>& __sa)
29082914
29092915template <class _Tp>
29102916valarray<_Tp>::valarray(const gslice_array<value_type>& __ga)
2911 : __begin_(0),
2912 __end_(0)
2917 : __begin_(nullptr),
2918 __end_(nullptr)
29132919{
29142920 const size_t __n = __ga.__1d_.size();
29152921 if (__n)
29162922 {
2917 __begin_ = __end_ = static_cast<value_type*>(
2918 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2923 __begin_ = __end_ = allocator<value_type>().allocate(__n);
29192924#ifndef _LIBCPP_NO_EXCEPTIONS
29202925 try
29212926 {
......@@ -2924,7 +2929,7 @@ valarray<_Tp>::valarray(const gslice_array<value_type>& __ga)
29242929 const value_type* __s = __ga.__vp_;
29252930 for (_Ip __i = __ga.__1d_.__begin_, __e = __ga.__1d_.__end_;
29262931 __i != __e; ++__i, ++__end_)
2927 ::new (__end_) value_type(__s[*__i]);
2932 ::new ((void*)__end_) value_type(__s[*__i]);
29282933#ifndef _LIBCPP_NO_EXCEPTIONS
29292934 }
29302935 catch (...)
......@@ -2938,14 +2943,13 @@ valarray<_Tp>::valarray(const gslice_array<value_type>& __ga)
29382943
29392944template <class _Tp>
29402945valarray<_Tp>::valarray(const mask_array<value_type>& __ma)
2941 : __begin_(0),
2942 __end_(0)
2946 : __begin_(nullptr),
2947 __end_(nullptr)
29432948{
29442949 const size_t __n = __ma.__1d_.size();
29452950 if (__n)
29462951 {
2947 __begin_ = __end_ = static_cast<value_type*>(
2948 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2952 __begin_ = __end_ = allocator<value_type>().allocate(__n);
29492953#ifndef _LIBCPP_NO_EXCEPTIONS
29502954 try
29512955 {
......@@ -2954,7 +2958,7 @@ valarray<_Tp>::valarray(const mask_array<value_type>& __ma)
29542958 const value_type* __s = __ma.__vp_;
29552959 for (_Ip __i = __ma.__1d_.__begin_, __e = __ma.__1d_.__end_;
29562960 __i != __e; ++__i, ++__end_)
2957 ::new (__end_) value_type(__s[*__i]);
2961 ::new ((void*)__end_) value_type(__s[*__i]);
29582962#ifndef _LIBCPP_NO_EXCEPTIONS
29592963 }
29602964 catch (...)
......@@ -2968,14 +2972,13 @@ valarray<_Tp>::valarray(const mask_array<value_type>& __ma)
29682972
29692973template <class _Tp>
29702974valarray<_Tp>::valarray(const indirect_array<value_type>& __ia)
2971 : __begin_(0),
2972 __end_(0)
2975 : __begin_(nullptr),
2976 __end_(nullptr)
29732977{
29742978 const size_t __n = __ia.__1d_.size();
29752979 if (__n)
29762980 {
2977 __begin_ = __end_ = static_cast<value_type*>(
2978 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
2981 __begin_ = __end_ = allocator<value_type>().allocate(__n);
29792982#ifndef _LIBCPP_NO_EXCEPTIONS
29802983 try
29812984 {
......@@ -2984,7 +2987,7 @@ valarray<_Tp>::valarray(const indirect_array<value_type>& __ia)
29842987 const value_type* __s = __ia.__vp_;
29852988 for (_Ip __i = __ia.__1d_.__begin_, __e = __ia.__1d_.__end_;
29862989 __i != __e; ++__i, ++__end_)
2987 ::new (__end_) value_type(__s[*__i]);
2990 ::new ((void*)__end_) value_type(__s[*__i]);
29882991#ifndef _LIBCPP_NO_EXCEPTIONS
29892992 }
29902993 catch (...)
......@@ -3011,8 +3014,7 @@ valarray<_Tp>::__assign_range(const value_type* __f, const value_type* __l)
30113014 if (size() != __n)
30123015 {
30133016 __clear(size());
3014 __begin_ = static_cast<value_type*>(
3015 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3017 __begin_ = allocator<value_type>().allocate(__n);
30163018 __end_ = __begin_ + __n;
30173019 _VSTD::uninitialized_copy(__f, __l, __begin_);
30183020 } else {
......@@ -3265,12 +3267,9 @@ valarray<_Tp>::operator+() const
32653267 size_t __n = size();
32663268 if (__n)
32673269 {
3268 __r.__begin_ =
3269 __r.__end_ =
3270 static_cast<value_type*>(
3271 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3270 __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
32723271 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);
32743273 }
32753274 return __r;
32763275}
......@@ -3283,12 +3282,9 @@ valarray<_Tp>::operator-() const
32833282 size_t __n = size();
32843283 if (__n)
32853284 {
3286 __r.__begin_ =
3287 __r.__end_ =
3288 static_cast<value_type*>(
3289 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3285 __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
32903286 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);
32923288 }
32933289 return __r;
32943290}
......@@ -3301,12 +3297,9 @@ valarray<_Tp>::operator~() const
33013297 size_t __n = size();
33023298 if (__n)
33033299 {
3304 __r.__begin_ =
3305 __r.__end_ =
3306 static_cast<value_type*>(
3307 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3300 __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
33083301 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);
33103303 }
33113304 return __r;
33123305}
......@@ -3319,11 +3312,9 @@ valarray<_Tp>::operator!() const
33193312 size_t __n = size();
33203313 if (__n)
33213314 {
3322 __r.__begin_ =
3323 __r.__end_ =
3324 static_cast<bool*>(_VSTD::__libcpp_allocate(__n * sizeof(bool), _LIBCPP_ALIGNOF(bool)));
3315 __r.__begin_ = __r.__end_ = allocator<bool>().allocate(__n);
33253316 for (const value_type* __p = __begin_; __n; ++__r.__end_, ++__p, --__n)
3326 ::new (__r.__end_) bool(!*__p);
3317 ::new ((void*)__r.__end_) bool(!*__p);
33273318 }
33283319 return __r;
33293320}
......@@ -3639,10 +3630,7 @@ valarray<_Tp>::shift(int __i) const
36393630 size_t __n = size();
36403631 if (__n)
36413632 {
3642 __r.__begin_ =
3643 __r.__end_ =
3644 static_cast<value_type*>(
3645 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3633 __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
36463634 const value_type* __sb;
36473635 value_type* __tb;
36483636 value_type* __te;
......@@ -3661,11 +3649,11 @@ valarray<_Tp>::shift(int __i) const
36613649 __te = __r.__begin_ + __n;
36623650 }
36633651 for (; __r.__end_ != __tb; ++__r.__end_)
3664 ::new (__r.__end_) value_type();
3652 ::new ((void*)__r.__end_) value_type();
36653653 for (; __r.__end_ != __te; ++__r.__end_, ++__sb)
3666 ::new (__r.__end_) value_type(*__sb);
3654 ::new ((void*)__r.__end_) value_type(*__sb);
36673655 for (__te = __r.__begin_ + __n; __r.__end_ != __te; ++__r.__end_)
3668 ::new (__r.__end_) value_type();
3656 ::new ((void*)__r.__end_) value_type();
36693657 }
36703658 return __r;
36713659}
......@@ -3678,16 +3666,13 @@ valarray<_Tp>::cshift(int __i) const
36783666 size_t __n = size();
36793667 if (__n)
36803668 {
3681 __r.__begin_ =
3682 __r.__end_ =
3683 static_cast<value_type*>(
3684 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3669 __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
36853670 __i %= static_cast<int>(__n);
36863671 const value_type* __m = __i >= 0 ? __begin_ + __i : __end_ + __i;
36873672 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);
36893674 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);
36913676 }
36923677 return __r;
36933678}
......@@ -3700,12 +3685,9 @@ valarray<_Tp>::apply(value_type __f(value_type)) const
37003685 size_t __n = size();
37013686 if (__n)
37023687 {
3703 __r.__begin_ =
3704 __r.__end_ =
3705 static_cast<value_type*>(
3706 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3688 __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
37073689 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));
37093691 }
37103692 return __r;
37113693}
......@@ -3718,12 +3700,9 @@ valarray<_Tp>::apply(value_type __f(const value_type&)) const
37183700 size_t __n = size();
37193701 if (__n)
37203702 {
3721 __r.__begin_ =
3722 __r.__end_ =
3723 static_cast<value_type*>(
3724 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3703 __r.__begin_ = __r.__end_ = allocator<value_type>().allocate(__n);
37253704 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));
37273706 }
37283707 return __r;
37293708}
......@@ -3736,7 +3715,7 @@ void valarray<_Tp>::__clear(size_t __capacity)
37363715 {
37373716 while (__end_ != __begin_)
37383717 (--__end_)->~value_type();
3739 _VSTD::__libcpp_deallocate(__begin_, __capacity * sizeof(value_type), _LIBCPP_ALIGNOF(value_type));
3718 allocator<value_type>().deallocate(__begin_, __capacity);
37403719 __begin_ = __end_ = nullptr;
37413720 }
37423721}
......@@ -3748,14 +3727,13 @@ valarray<_Tp>::resize(size_t __n, value_type __x)
37483727 __clear(size());
37493728 if (__n)
37503729 {
3751 __begin_ = __end_ = static_cast<value_type*>(
3752 _VSTD::__libcpp_allocate(__n * sizeof(value_type), _LIBCPP_ALIGNOF(value_type)));
3730 __begin_ = __end_ = allocator<value_type>().allocate(__n);
37533731#ifndef _LIBCPP_NO_EXCEPTIONS
37543732 try
37553733 {
37563734#endif // _LIBCPP_NO_EXCEPTIONS
37573735 for (size_t __n_left = __n; __n_left; --__n_left, ++__end_)
3758 ::new (__end_) value_type(__x);
3736 ::new ((void*)__end_) value_type(__x);
37593737#ifndef _LIBCPP_NO_EXCEPTIONS
37603738 }
37613739 catch (...)
lib/libcxx/include/variant+96-31
......@@ -169,6 +169,9 @@ namespace std {
169169 template <class Visitor, class... Variants>
170170 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
172175 // 20.7.7, class monostate
173176 struct monostate;
174177
......@@ -197,6 +200,7 @@ namespace std {
197200*/
198201
199202#include <__config>
203#include <__availability>
200204#include <__tuple>
201205#include <array>
202206#include <exception>
......@@ -227,7 +231,10 @@ public:
227231
228232_LIBCPP_BEGIN_NAMESPACE_STD
229233
230#if _LIBCPP_STD_VER > 14
234// 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
232239_LIBCPP_NORETURN
233240inline _LIBCPP_INLINE_VISIBILITY
......@@ -290,9 +297,9 @@ struct _LIBCPP_TEMPLATE_VIS variant_alternative<_Ip, variant<_Types...>> {
290297_LIBCPP_INLINE_VAR constexpr size_t variant_npos = static_cast<size_t>(-1);
291298
292299constexpr 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())
294301 return 0;
295 if (__num_elem < std::numeric_limits<unsigned short>::max())
302 if (__num_elem < numeric_limits<unsigned short>::max())
296303 return 1;
297304 return 2;
298305}
......@@ -482,12 +489,12 @@ private:
482489 return __result{{_VSTD::forward<_Fs>(__fs)...}};
483490 }
484491
485 template <std::size_t... _Is>
492 template <size_t... _Is>
486493 struct __dispatcher {
487494 template <class _Fp, class... _Vs>
488495 inline _LIBCPP_INLINE_VISIBILITY
489496 static constexpr decltype(auto) __dispatch(_Fp __f, _Vs... __vs) {
490 return __invoke_constexpr(
497 return _VSTD::__invoke_constexpr(
491498 static_cast<_Fp>(__f),
492499 __access::__base::__get_alt<_Is>(static_cast<_Vs>(__vs))...);
493500 }
......@@ -579,6 +586,16 @@ struct __variant {
579586 __make_value_visitor(_VSTD::forward<_Visitor>(__visitor)),
580587 _VSTD::forward<_Vs>(__vs)...);
581588 }
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
583600private:
584601 template <class _Visitor, class... _Values>
......@@ -595,17 +612,48 @@ private:
595612 __std_visit_exhaustive_visitor_check<
596613 _Visitor,
597614 decltype((_VSTD::forward<_Alts>(__alts).__value))...>();
598 return __invoke_constexpr(_VSTD::forward<_Visitor>(__visitor),
615 return _VSTD::__invoke_constexpr(_VSTD::forward<_Visitor>(__visitor),
599616 _VSTD::forward<_Alts>(__alts).__value...);
600617 }
601618 _Visitor&& __visitor;
602619 };
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
604644 template <class _Visitor>
605645 inline _LIBCPP_INLINE_VISIBILITY
606646 static constexpr auto __make_value_visitor(_Visitor&& __visitor) {
607647 return __value_visitor<_Visitor>{_VSTD::forward<_Visitor>(__visitor)};
608648 }
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
609657};
610658
611659} // namespace __visitation
......@@ -720,12 +768,12 @@ protected:
720768};
721769
722770template <class _Traits, _Trait = _Traits::__destructible_trait>
723class _LIBCPP_TEMPLATE_VIS __destructor;
771class _LIBCPP_TEMPLATE_VIS __dtor;
724772
725773#define _LIBCPP_VARIANT_DESTRUCTOR(destructible_trait, destructor, destroy) \
726774 template <class... _Types> \
727 class _LIBCPP_TEMPLATE_VIS __destructor<__traits<_Types...>, \
728 destructible_trait> \
775 class _LIBCPP_TEMPLATE_VIS __dtor<__traits<_Types...>, \
776 destructible_trait> \
729777 : public __base<destructible_trait, _Types...> { \
730778 using __base_type = __base<destructible_trait, _Types...>; \
731779 using __index_t = typename __base_type::__index_t; \
......@@ -734,11 +782,11 @@ class _LIBCPP_TEMPLATE_VIS __destructor;
734782 using __base_type::__base_type; \
735783 using __base_type::operator=; \
736784 \
737 __destructor(const __destructor&) = default; \
738 __destructor(__destructor&&) = default; \
785 __dtor(const __dtor&) = default; \
786 __dtor(__dtor&&) = default; \
739787 destructor \
740 __destructor& operator=(const __destructor&) = default; \
741 __destructor& operator=(__destructor&&) = default; \
788 __dtor& operator=(const __dtor&) = default; \
789 __dtor& operator=(__dtor&&) = default; \
742790 \
743791 protected: \
744792 inline _LIBCPP_INLINE_VISIBILITY \
......@@ -747,12 +795,12 @@ class _LIBCPP_TEMPLATE_VIS __destructor;
747795
748796_LIBCPP_VARIANT_DESTRUCTOR(
749797 _Trait::_TriviallyAvailable,
750 ~__destructor() = default;,
798 ~__dtor() = default;,
751799 void __destroy() noexcept { this->__index = __variant_npos<__index_t>; });
752800
753801_LIBCPP_VARIANT_DESTRUCTOR(
754802 _Trait::_Available,
755 ~__destructor() { __destroy(); },
803 ~__dtor() { __destroy(); },
756804 void __destroy() noexcept {
757805 if (!this->valueless_by_exception()) {
758806 __visitation::__base::__visit_alt(
......@@ -767,14 +815,14 @@ _LIBCPP_VARIANT_DESTRUCTOR(
767815
768816_LIBCPP_VARIANT_DESTRUCTOR(
769817 _Trait::_Unavailable,
770 ~__destructor() = delete;,
818 ~__dtor() = delete;,
771819 void __destroy() noexcept = delete;);
772820
773821#undef _LIBCPP_VARIANT_DESTRUCTOR
774822
775823template <class _Traits>
776class _LIBCPP_TEMPLATE_VIS __constructor : public __destructor<_Traits> {
777 using __base_type = __destructor<_Traits>;
824class _LIBCPP_TEMPLATE_VIS __ctor : public __dtor<_Traits> {
825 using __base_type = __dtor<_Traits>;
778826
779827public:
780828 using __base_type::__base_type;
......@@ -791,7 +839,7 @@ protected:
791839
792840 template <class _Rhs>
793841 inline _LIBCPP_INLINE_VISIBILITY
794 static void __generic_construct(__constructor& __lhs, _Rhs&& __rhs) {
842 static void __generic_construct(__ctor& __lhs, _Rhs&& __rhs) {
795843 __lhs.__destroy();
796844 if (!__rhs.valueless_by_exception()) {
797845 __visitation::__base::__visit_alt_at(
......@@ -813,10 +861,10 @@ class _LIBCPP_TEMPLATE_VIS __move_constructor;
813861#define _LIBCPP_VARIANT_MOVE_CONSTRUCTOR(move_constructible_trait, \
814862 move_constructor) \
815863 template <class... _Types> \
816 class _LIBCPP_TEMPLATE_VIS __move_constructor<__traits<_Types...>, \
817 move_constructible_trait> \
818 : public __constructor<__traits<_Types...>> { \
819 using __base_type = __constructor<__traits<_Types...>>; \
864 class _LIBCPP_TEMPLATE_VIS __move_constructor<__traits<_Types...>, \
865 move_constructible_trait> \
866 : public __ctor<__traits<_Types...>> { \
867 using __base_type = __ctor<__traits<_Types...>>; \
820868 \
821869 public: \
822870 using __base_type::__base_type; \
......@@ -1104,7 +1152,7 @@ struct __narrowing_check {
11041152 template <class _Dest>
11051153 static auto __test_impl(_Dest (&&)[1]) -> __identity<_Dest>;
11061154 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>()}));
11081156};
11091157
11101158template <class _Dest, class _Source>
......@@ -1510,7 +1558,7 @@ template <class _Operator>
15101558struct __convert_to_bool {
15111559 template <class _T1, class _T2>
15121560 _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,
15141562 "the relational operator does not return a type which is implicitly convertible to bool");
15151563 return _Operator{}(_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2));
15161564 }
......@@ -1587,21 +1635,38 @@ constexpr bool operator>=(const variant<_Types...>& __lhs,
15871635 __lhs.index(), __convert_to_bool<greater_equal<>>{}, __lhs, __rhs);
15881636}
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
15901648template <class _Visitor, class... _Vs>
15911649inline _LIBCPP_INLINE_VISIBILITY
15921650_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
15931651constexpr decltype(auto) visit(_Visitor&& __visitor, _Vs&&... __vs) {
15941652 using __variant_detail::__visitation::__variant;
1595 bool __results[] = {__vs.valueless_by_exception()...};
1596 for (bool __result : __results) {
1597 if (__result) {
1598 __throw_bad_variant_access();
1599 }
1600 }
1653 _VSTD::__throw_if_valueless(_VSTD::forward<_Vs>(__vs)...);
16011654 return __variant::__visit_value(_VSTD::forward<_Visitor>(__visitor),
16021655 _VSTD::forward<_Vs>(__vs)...);
16031656}
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
16051670struct _LIBCPP_TEMPLATE_VIS monostate {};
16061671
16071672inline _LIBCPP_INLINE_VISIBILITY
lib/libcxx/include/vector+48-51
......@@ -454,7 +454,7 @@ inline _LIBCPP_INLINE_VISIBILITY
454454__vector_base<_Tp, _Allocator>::__vector_base(allocator_type&& __a) _NOEXCEPT
455455 : __begin_(nullptr),
456456 __end_(nullptr),
457 __end_cap_(nullptr, std::move(__a)) {}
457 __end_cap_(nullptr, _VSTD::move(__a)) {}
458458#endif
459459
460460template <class _Tp, class _Allocator>
......@@ -496,7 +496,7 @@ public:
496496 _LIBCPP_INLINE_VISIBILITY
497497 vector() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
498498 {
499#if _LIBCPP_DEBUG_LEVEL >= 2
499#if _LIBCPP_DEBUG_LEVEL == 2
500500 __get_db()->__insert_c(this);
501501#endif
502502 }
......@@ -508,7 +508,7 @@ public:
508508#endif
509509 : __base(__a)
510510 {
511#if _LIBCPP_DEBUG_LEVEL >= 2
511#if _LIBCPP_DEBUG_LEVEL == 2
512512 __get_db()->__insert_c(this);
513513#endif
514514 }
......@@ -551,7 +551,7 @@ public:
551551 ~vector()
552552 {
553553 __annotate_delete();
554#if _LIBCPP_DEBUG_LEVEL >= 2
554#if _LIBCPP_DEBUG_LEVEL == 2
555555 __get_db()->__erase_c(this);
556556#endif
557557 }
......@@ -789,14 +789,14 @@ public:
789789
790790 bool __invariants() const;
791791
792#if _LIBCPP_DEBUG_LEVEL >= 2
792#if _LIBCPP_DEBUG_LEVEL == 2
793793
794794 bool __dereferenceable(const const_iterator* __i) const;
795795 bool __decrementable(const const_iterator* __i) const;
796796 bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
797797 bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;
798798
799#endif // _LIBCPP_DEBUG_LEVEL >= 2
799#endif // _LIBCPP_DEBUG_LEVEL == 2
800800
801801private:
802802 _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
......@@ -931,7 +931,7 @@ private:
931931
932932#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
933933template<class _InputIterator,
934 class _Alloc = typename std::allocator<typename iterator_traits<_InputIterator>::value_type>,
934 class _Alloc = allocator<typename iterator_traits<_InputIterator>::value_type>,
935935 class = typename enable_if<__is_allocator<_Alloc>::value, void>::type
936936 >
937937vector(_InputIterator, _InputIterator)
......@@ -951,8 +951,7 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a
951951{
952952
953953 __annotate_delete();
954 __alloc_traits::__construct_backward_with_exception_guarantees(
955 this->__alloc(), this->__begin_, this->__end_, __v.__begin_);
954 _VSTD::__construct_backward_with_exception_guarantees(this->__alloc(), this->__begin_, this->__end_, __v.__begin_);
956955 _VSTD::swap(this->__begin_, __v.__begin_);
957956 _VSTD::swap(this->__end_, __v.__end_);
958957 _VSTD::swap(this->__end_cap(), __v.__end_cap());
......@@ -967,10 +966,8 @@ vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, a
967966{
968967 __annotate_delete();
969968 pointer __r = __v.__begin_;
970 __alloc_traits::__construct_backward_with_exception_guarantees(
971 this->__alloc(), this->__begin_, __p, __v.__begin_);
972 __alloc_traits::__construct_forward_with_exception_guarantees(
973 this->__alloc(), __p, this->__end_, __v.__end_);
969 _VSTD::__construct_backward_with_exception_guarantees(this->__alloc(), this->__begin_, __p, __v.__begin_);
970 _VSTD::__construct_forward_with_exception_guarantees(this->__alloc(), __p, this->__end_, __v.__end_);
974971 _VSTD::swap(this->__begin_, __v.__begin_);
975972 _VSTD::swap(this->__end_, __v.__end_);
976973 _VSTD::swap(this->__end_cap(), __v.__end_cap());
......@@ -1077,7 +1074,7 @@ typename enable_if
10771074vector<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n)
10781075{
10791076 _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_);
10811078}
10821079
10831080// Default constructs __n objects starting at __end_
......@@ -1121,7 +1118,7 @@ vector<_Tp, _Allocator>::__append(size_type __n, const_reference __x)
11211118template <class _Tp, class _Allocator>
11221119vector<_Tp, _Allocator>::vector(size_type __n)
11231120{
1124#if _LIBCPP_DEBUG_LEVEL >= 2
1121#if _LIBCPP_DEBUG_LEVEL == 2
11251122 __get_db()->__insert_c(this);
11261123#endif
11271124 if (__n > 0)
......@@ -1136,7 +1133,7 @@ template <class _Tp, class _Allocator>
11361133vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)
11371134 : __base(__a)
11381135{
1139#if _LIBCPP_DEBUG_LEVEL >= 2
1136#if _LIBCPP_DEBUG_LEVEL == 2
11401137 __get_db()->__insert_c(this);
11411138#endif
11421139 if (__n > 0)
......@@ -1150,7 +1147,7 @@ vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)
11501147template <class _Tp, class _Allocator>
11511148vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x)
11521149{
1153#if _LIBCPP_DEBUG_LEVEL >= 2
1150#if _LIBCPP_DEBUG_LEVEL == 2
11541151 __get_db()->__insert_c(this);
11551152#endif
11561153 if (__n > 0)
......@@ -1164,7 +1161,7 @@ template <class _Tp, class _Allocator>
11641161vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x, const allocator_type& __a)
11651162 : __base(__a)
11661163{
1167#if _LIBCPP_DEBUG_LEVEL >= 2
1164#if _LIBCPP_DEBUG_LEVEL == 2
11681165 __get_db()->__insert_c(this);
11691166#endif
11701167 if (__n > 0)
......@@ -1184,7 +1181,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first,
11841181 typename iterator_traits<_InputIterator>::reference>::value,
11851182 _InputIterator>::type __last)
11861183{
1187#if _LIBCPP_DEBUG_LEVEL >= 2
1184#if _LIBCPP_DEBUG_LEVEL == 2
11881185 __get_db()->__insert_c(this);
11891186#endif
11901187 for (; __first != __last; ++__first)
......@@ -1201,7 +1198,7 @@ vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, c
12011198 typename iterator_traits<_InputIterator>::reference>::value>::type*)
12021199 : __base(__a)
12031200{
1204#if _LIBCPP_DEBUG_LEVEL >= 2
1201#if _LIBCPP_DEBUG_LEVEL == 2
12051202 __get_db()->__insert_c(this);
12061203#endif
12071204 for (; __first != __last; ++__first)
......@@ -1217,7 +1214,7 @@ vector<_Tp, _Allocator>::vector(_ForwardIterator __first,
12171214 typename iterator_traits<_ForwardIterator>::reference>::value,
12181215 _ForwardIterator>::type __last)
12191216{
1220#if _LIBCPP_DEBUG_LEVEL >= 2
1217#if _LIBCPP_DEBUG_LEVEL == 2
12211218 __get_db()->__insert_c(this);
12221219#endif
12231220 size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
......@@ -1237,7 +1234,7 @@ vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __las
12371234 typename iterator_traits<_ForwardIterator>::reference>::value>::type*)
12381235 : __base(__a)
12391236{
1240#if _LIBCPP_DEBUG_LEVEL >= 2
1237#if _LIBCPP_DEBUG_LEVEL == 2
12411238 __get_db()->__insert_c(this);
12421239#endif
12431240 size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
......@@ -1252,7 +1249,7 @@ template <class _Tp, class _Allocator>
12521249vector<_Tp, _Allocator>::vector(const vector& __x)
12531250 : __base(__alloc_traits::select_on_container_copy_construction(__x.__alloc()))
12541251{
1255#if _LIBCPP_DEBUG_LEVEL >= 2
1252#if _LIBCPP_DEBUG_LEVEL == 2
12561253 __get_db()->__insert_c(this);
12571254#endif
12581255 size_type __n = __x.size();
......@@ -1267,7 +1264,7 @@ template <class _Tp, class _Allocator>
12671264vector<_Tp, _Allocator>::vector(const vector& __x, const allocator_type& __a)
12681265 : __base(__a)
12691266{
1270#if _LIBCPP_DEBUG_LEVEL >= 2
1267#if _LIBCPP_DEBUG_LEVEL == 2
12711268 __get_db()->__insert_c(this);
12721269#endif
12731270 size_type __n = __x.size();
......@@ -1290,7 +1287,7 @@ vector<_Tp, _Allocator>::vector(vector&& __x)
12901287#endif
12911288 : __base(_VSTD::move(__x.__alloc()))
12921289{
1293#if _LIBCPP_DEBUG_LEVEL >= 2
1290#if _LIBCPP_DEBUG_LEVEL == 2
12941291 __get_db()->__insert_c(this);
12951292 __get_db()->swap(this, &__x);
12961293#endif
......@@ -1305,7 +1302,7 @@ inline _LIBCPP_INLINE_VISIBILITY
13051302vector<_Tp, _Allocator>::vector(vector&& __x, const allocator_type& __a)
13061303 : __base(__a)
13071304{
1308#if _LIBCPP_DEBUG_LEVEL >= 2
1305#if _LIBCPP_DEBUG_LEVEL == 2
13091306 __get_db()->__insert_c(this);
13101307#endif
13111308 if (__a == __x.__alloc())
......@@ -1314,7 +1311,7 @@ vector<_Tp, _Allocator>::vector(vector&& __x, const allocator_type& __a)
13141311 this->__end_ = __x.__end_;
13151312 this->__end_cap() = __x.__end_cap();
13161313 __x.__begin_ = __x.__end_ = __x.__end_cap() = nullptr;
1317#if _LIBCPP_DEBUG_LEVEL >= 2
1314#if _LIBCPP_DEBUG_LEVEL == 2
13181315 __get_db()->swap(this, &__x);
13191316#endif
13201317 }
......@@ -1329,7 +1326,7 @@ template <class _Tp, class _Allocator>
13291326inline _LIBCPP_INLINE_VISIBILITY
13301327vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il)
13311328{
1332#if _LIBCPP_DEBUG_LEVEL >= 2
1329#if _LIBCPP_DEBUG_LEVEL == 2
13331330 __get_db()->__insert_c(this);
13341331#endif
13351332 if (__il.size() > 0)
......@@ -1344,7 +1341,7 @@ inline _LIBCPP_INLINE_VISIBILITY
13441341vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il, const allocator_type& __a)
13451342 : __base(__a)
13461343{
1347#if _LIBCPP_DEBUG_LEVEL >= 2
1344#if _LIBCPP_DEBUG_LEVEL == 2
13481345 __get_db()->__insert_c(this);
13491346#endif
13501347 if (__il.size() > 0)
......@@ -1390,7 +1387,7 @@ vector<_Tp, _Allocator>::__move_assign(vector& __c, true_type)
13901387 this->__end_ = __c.__end_;
13911388 this->__end_cap() = __c.__end_cap();
13921389 __c.__begin_ = __c.__end_ = __c.__end_cap() = nullptr;
1393#if _LIBCPP_DEBUG_LEVEL >= 2
1390#if _LIBCPP_DEBUG_LEVEL == 2
13941391 __get_db()->swap(this, &__c);
13951392#endif
13961393}
......@@ -1493,7 +1490,7 @@ inline _LIBCPP_INLINE_VISIBILITY
14931490typename vector<_Tp, _Allocator>::iterator
14941491vector<_Tp, _Allocator>::__make_iter(pointer __p) _NOEXCEPT
14951492{
1496#if _LIBCPP_DEBUG_LEVEL >= 2
1493#if _LIBCPP_DEBUG_LEVEL == 2
14971494 return iterator(this, __p);
14981495#else
14991496 return iterator(__p);
......@@ -1505,7 +1502,7 @@ inline _LIBCPP_INLINE_VISIBILITY
15051502typename vector<_Tp, _Allocator>::const_iterator
15061503vector<_Tp, _Allocator>::__make_iter(const_pointer __p) const _NOEXCEPT
15071504{
1508#if _LIBCPP_DEBUG_LEVEL >= 2
1505#if _LIBCPP_DEBUG_LEVEL == 2
15091506 return const_iterator(this, __p);
15101507#else
15111508 return const_iterator(__p);
......@@ -1709,7 +1706,7 @@ inline _LIBCPP_INLINE_VISIBILITY
17091706typename vector<_Tp, _Allocator>::iterator
17101707vector<_Tp, _Allocator>::erase(const_iterator __position)
17111708{
1712#if _LIBCPP_DEBUG_LEVEL >= 2
1709#if _LIBCPP_DEBUG_LEVEL == 2
17131710 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
17141711 "vector::erase(iterator) called with an iterator not"
17151712 " referring to this vector");
......@@ -1728,7 +1725,7 @@ template <class _Tp, class _Allocator>
17281725typename vector<_Tp, _Allocator>::iterator
17291726vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last)
17301727{
1731#if _LIBCPP_DEBUG_LEVEL >= 2
1728#if _LIBCPP_DEBUG_LEVEL == 2
17321729 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,
17331730 "vector::erase(iterator, iterator) called with an iterator not"
17341731 " referring to this vector");
......@@ -1769,7 +1766,7 @@ template <class _Tp, class _Allocator>
17691766typename vector<_Tp, _Allocator>::iterator
17701767vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)
17711768{
1772#if _LIBCPP_DEBUG_LEVEL >= 2
1769#if _LIBCPP_DEBUG_LEVEL == 2
17731770 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
17741771 "vector::insert(iterator, x) called with an iterator not"
17751772 " referring to this vector");
......@@ -1806,7 +1803,7 @@ template <class _Tp, class _Allocator>
18061803typename vector<_Tp, _Allocator>::iterator
18071804vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x)
18081805{
1809#if _LIBCPP_DEBUG_LEVEL >= 2
1806#if _LIBCPP_DEBUG_LEVEL == 2
18101807 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
18111808 "vector::insert(iterator, x) called with an iterator not"
18121809 " referring to this vector");
......@@ -1839,7 +1836,7 @@ template <class... _Args>
18391836typename vector<_Tp, _Allocator>::iterator
18401837vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args)
18411838{
1842#if _LIBCPP_DEBUG_LEVEL >= 2
1839#if _LIBCPP_DEBUG_LEVEL == 2
18431840 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
18441841 "vector::emplace(iterator, x) called with an iterator not"
18451842 " referring to this vector");
......@@ -1874,7 +1871,7 @@ template <class _Tp, class _Allocator>
18741871typename vector<_Tp, _Allocator>::iterator
18751872vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_reference __x)
18761873{
1877#if _LIBCPP_DEBUG_LEVEL >= 2
1874#if _LIBCPP_DEBUG_LEVEL == 2
18781875 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
18791876 "vector::insert(iterator, n, x) called with an iterator not"
18801877 " referring to this vector");
......@@ -1925,7 +1922,7 @@ typename enable_if
19251922>::type
19261923vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __first, _InputIterator __last)
19271924{
1928#if _LIBCPP_DEBUG_LEVEL >= 2
1925#if _LIBCPP_DEBUG_LEVEL == 2
19291926 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
19301927 "vector::insert(iterator, range) called with an iterator not"
19311928 " referring to this vector");
......@@ -1978,7 +1975,7 @@ typename enable_if
19781975>::type
19791976vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
19801977{
1981#if _LIBCPP_DEBUG_LEVEL >= 2
1978#if _LIBCPP_DEBUG_LEVEL == 2
19821979 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
19831980 "vector::insert(iterator, range) called with an iterator not"
19841981 " referring to this vector");
......@@ -2057,11 +2054,11 @@ vector<_Tp, _Allocator>::swap(vector& __x)
20572054 _VSTD::swap(this->__begin_, __x.__begin_);
20582055 _VSTD::swap(this->__end_, __x.__end_);
20592056 _VSTD::swap(this->__end_cap(), __x.__end_cap());
2060 __swap_allocator(this->__alloc(), __x.__alloc(),
2057 _VSTD::__swap_allocator(this->__alloc(), __x.__alloc(),
20612058 integral_constant<bool,__alloc_traits::propagate_on_container_swap::value>());
2062#if _LIBCPP_DEBUG_LEVEL >= 2
2059#if _LIBCPP_DEBUG_LEVEL == 2
20632060 __get_db()->swap(this, &__x);
2064#endif // _LIBCPP_DEBUG_LEVEL >= 2
2061#endif
20652062}
20662063
20672064template <class _Tp, class _Allocator>
......@@ -2085,7 +2082,7 @@ vector<_Tp, _Allocator>::__invariants() const
20852082 return true;
20862083}
20872084
2088#if _LIBCPP_DEBUG_LEVEL >= 2
2085#if _LIBCPP_DEBUG_LEVEL == 2
20892086
20902087template <class _Tp, class _Allocator>
20912088bool
......@@ -2117,16 +2114,16 @@ vector<_Tp, _Allocator>::__subscriptable(const const_iterator* __i, ptrdiff_t __
21172114 return this->__begin_ <= __p && __p < this->__end_;
21182115}
21192116
2120#endif // _LIBCPP_DEBUG_LEVEL >= 2
2117#endif // _LIBCPP_DEBUG_LEVEL == 2
21212118
21222119template <class _Tp, class _Allocator>
21232120inline _LIBCPP_INLINE_VISIBILITY
21242121void
21252122vector<_Tp, _Allocator>::__invalidate_all_iterators()
21262123{
2127#if _LIBCPP_DEBUG_LEVEL >= 2
2124#if _LIBCPP_DEBUG_LEVEL == 2
21282125 __get_db()->__invalidate_all(this);
2129#endif // _LIBCPP_DEBUG_LEVEL >= 2
2126#endif
21302127}
21312128
21322129
......@@ -2134,7 +2131,7 @@ template <class _Tp, class _Allocator>
21342131inline _LIBCPP_INLINE_VISIBILITY
21352132void
21362133vector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) {
2137#if _LIBCPP_DEBUG_LEVEL >= 2
2134#if _LIBCPP_DEBUG_LEVEL == 2
21382135 __c_node* __c = __get_db()->__find_c_and_lock(this);
21392136 for (__i_node** __p = __c->end_; __p != __c->beg_; ) {
21402137 --__p;
......@@ -2142,7 +2139,7 @@ vector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) {
21422139 if (__i->base() > __new_last) {
21432140 (*__p)->__c_ = nullptr;
21442141 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*));
21462143 }
21472144 }
21482145 __get_db()->unlock();
......@@ -2883,7 +2880,7 @@ inline _LIBCPP_INLINE_VISIBILITY vector<bool, _Allocator>::vector(vector&& __v)
28832880#endif
28842881 : __begin_(__v.__begin_),
28852882 __size_(__v.__size_),
2886 __cap_alloc_(std::move(__v.__cap_alloc_)) {
2883 __cap_alloc_(_VSTD::move(__v.__cap_alloc_)) {
28872884 __v.__begin_ = nullptr;
28882885 __v.__size_ = 0;
28892886 __v.__cap() = 0;
......@@ -3235,7 +3232,7 @@ vector<bool, _Allocator>::swap(vector& __x)
32353232 _VSTD::swap(this->__begin_, __x.__begin_);
32363233 _VSTD::swap(this->__size_, __x.__size_);
32373234 _VSTD::swap(this->__cap(), __x.__cap());
3238 __swap_allocator(this->__alloc(), __x.__alloc(),
3235 _VSTD::__swap_allocator(this->__alloc(), __x.__alloc(),
32393236 integral_constant<bool, __alloc_traits::propagate_on_container_swap::value>());
32403237}
32413238
lib/libcxx/include/version+142-28
......@@ -15,20 +15,30 @@
1515
1616Macro name Value Headers
1717__cpp_lib_addressof_constexpr 201603L <memory>
18__cpp_lib_allocator_traits_is_always_equal 201411L <memory> <scoped_allocator> <string>
19 <deque> <forward_list> <list>
20 <vector> <map> <set>
21 <unordered_map> <unordered_set>
18__cpp_lib_allocator_traits_is_always_equal 201411L <deque> <forward_list> <list>
19 <map> <memory> <scoped_allocator>
20 <set> <string> <unordered_map>
21 <unordered_set> <vector>
2222__cpp_lib_any 201606L <any>
2323__cpp_lib_apply 201603L <tuple>
24__cpp_lib_array_constexpr 201811L <iterator> <array>
24__cpp_lib_array_constexpr 201811L <array> <iterator>
2525 201603L // C++17
2626__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>
2730__cpp_lib_atomic_is_always_lock_free 201603L <atomic>
31__cpp_lib_atomic_lock_free_type_aliases 201907L <atomic>
2832__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>
3038__cpp_lib_bit_cast 201806L <bit>
39__cpp_lib_bitops 201907L <bit>
3140__cpp_lib_bool_constant 201505L <type_traits>
41__cpp_lib_bounded_array_traits 201902L <type_traits>
3242__cpp_lib_boyer_moore_searcher 201603L <functional>
3343__cpp_lib_byte 201603L <cstddef>
3444__cpp_lib_char8_t 201811L <atomic> <filesystem> <istream>
......@@ -38,18 +48,29 @@ __cpp_lib_chrono 201611L <chrono>
3848__cpp_lib_chrono_udls 201304L <chrono>
3949__cpp_lib_clamp 201603L <algorithm>
4050__cpp_lib_complex_udls 201309L <complex>
41__cpp_lib_concepts 201806L <concepts>
42__cpp_lib_constexpr_misc 201811L <array> <functional> <iterator>
43 <string_view> <tuple> <utility>
44__cpp_lib_constexpr_swap_algorithms 201806L <algorithm>
51__cpp_lib_concepts 202002L <concepts>
52__cpp_lib_constexpr_algorithms 201806L <algorithm>
53__cpp_lib_constexpr_complex 201711L <complex>
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>
4565__cpp_lib_destroying_delete 201806L <new>
4666__cpp_lib_enable_shared_from_this 201603L <memory>
4767__cpp_lib_endian 201907L <bit>
48__cpp_lib_erase_if 202002L <string> <deque> <forward_list>
49 <list> <vector> <map>
50 <set> <unordered_map> <unordered_set>
68__cpp_lib_erase_if 202002L <deque> <forward_list> <list>
69 <map> <set> <string>
70 <unordered_map> <unordered_set> <vector>
5171__cpp_lib_exchange_function 201304L <utility>
52__cpp_lib_execution 201603L <execution>
72__cpp_lib_execution 201902L <execution>
73 201603L // C++17
5374__cpp_lib_filesystem 201703L <filesystem>
5475__cpp_lib_gcd_lcm 201606L <numeric>
5576__cpp_lib_generic_associative_lookup 201304L <map> <set>
......@@ -58,16 +79,24 @@ __cpp_lib_hardware_interference_size 201703L <new>
5879__cpp_lib_has_unique_object_representations 201606L <type_traits>
5980__cpp_lib_hypot 201603L <cmath>
6081__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>
6184__cpp_lib_integer_sequence 201304L <utility>
6285__cpp_lib_integral_constant_callable 201304L <type_traits>
63__cpp_lib_interpolate 201902L <numeric>
86__cpp_lib_interpolate 201902L <cmath> <numeric>
6487__cpp_lib_invoke 201411L <functional>
6588__cpp_lib_is_aggregate 201703L <type_traits>
6689__cpp_lib_is_constant_evaluated 201811L <type_traits>
6790__cpp_lib_is_final 201402L <type_traits>
6891__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>
6994__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>
7097__cpp_lib_is_swappable 201603L <type_traits>
98__cpp_lib_jthread 201911L <stop_token> <thread>
99__cpp_lib_latch 201907L <latch>
71100__cpp_lib_launder 201606L <new>
72101__cpp_lib_list_remove_return_type 201806L <forward_list> <list>
73102__cpp_lib_logical_traits 201510L <type_traits>
......@@ -80,40 +109,55 @@ __cpp_lib_math_special_functions 201603L <cmath>
80109__cpp_lib_memory_resource 201603L <memory_resource>
81110__cpp_lib_node_extract 201606L <map> <set> <unordered_map>
82111 <unordered_set>
83__cpp_lib_nonmember_container_access 201411L <iterator> <array> <deque>
84 <forward_list> <list> <map>
112__cpp_lib_nonmember_container_access 201411L <array> <deque> <forward_list>
113 <iterator> <list> <map>
85114 <regex> <set> <string>
86115 <unordered_map> <unordered_set> <vector>
87116__cpp_lib_not_fn 201603L <functional>
88117__cpp_lib_null_iterators 201304L <iterator>
89118__cpp_lib_optional 201606L <optional>
90119__cpp_lib_parallel_algorithm 201603L <algorithm> <numeric>
120__cpp_lib_polymorphic_allocator 201902L <memory>
91121__cpp_lib_quoted_string_io 201304L <iomanip>
92122__cpp_lib_ranges 201811L <algorithm> <functional> <iterator>
93123 <memory> <ranges>
94124__cpp_lib_raw_memory_algorithms 201606L <memory>
125__cpp_lib_remove_cvref 201711L <type_traits>
95126__cpp_lib_result_of_sfinae 201210L <functional> <type_traits>
96127__cpp_lib_robust_nonmodifying_seq_ops 201304L <algorithm>
97128__cpp_lib_sample 201603L <algorithm>
98129__cpp_lib_scoped_lock 201703L <mutex>
130__cpp_lib_semaphore 201907L <semaphore>
99131__cpp_lib_shared_mutex 201505L <shared_mutex>
100132__cpp_lib_shared_ptr_arrays 201611L <memory>
101133__cpp_lib_shared_ptr_weak_type 201606L <memory>
102134__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>
103138__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>
104144__cpp_lib_string_udls 201304L <string>
105__cpp_lib_string_view 201606L <string> <string_view>
106__cpp_lib_three_way_comparison 201711L <compare>
145__cpp_lib_string_view 201803L <string> <string_view>
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>
107150__cpp_lib_to_array 201907L <array>
108151__cpp_lib_to_chars 201611L <utility>
109152__cpp_lib_transformation_trait_aliases 201304L <type_traits>
110__cpp_lib_transparent_operators 201510L <functional>
153__cpp_lib_transparent_operators 201510L <functional> <memory>
111154 201210L // C++14
112155__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>
114157__cpp_lib_type_trait_variable_templates 201510L <type_traits>
115158__cpp_lib_uncaught_exceptions 201411L <exception>
116159__cpp_lib_unordered_map_try_emplace 201411L <unordered_map>
160__cpp_lib_unwrap_ref 201811L <functional>
117161__cpp_lib_variant 201606L <variant>
118162__cpp_lib_void_t 201411L <type_traits>
119163
......@@ -200,7 +244,7 @@ __cpp_lib_void_t 201411L <type_traits>
200244# if !defined(_LIBCPP_HAS_NO_THREADS)
201245# define __cpp_lib_shared_mutex 201505L
202246# endif
203// # define __cpp_lib_shared_ptr_arrays 201611L
247# define __cpp_lib_shared_ptr_arrays 201611L
204248# define __cpp_lib_shared_ptr_weak_type 201606L
205249# define __cpp_lib_string_view 201606L
206250// # define __cpp_lib_to_chars 201611L
......@@ -216,35 +260,105 @@ __cpp_lib_void_t 201411L <type_traits>
216260#if _LIBCPP_STD_VER > 17
217261# undef __cpp_lib_array_constexpr
218262# 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
219273# if !defined(_LIBCPP_HAS_NO_THREADS)
220274// # define __cpp_lib_atomic_ref 201806L
221275# endif
222// # define __cpp_lib_bind_front 201811L
276# 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
223289// # define __cpp_lib_bit_cast 201806L
290// # define __cpp_lib_bitops 201907L
291# define __cpp_lib_bounded_array_traits 201902L
224292# if !defined(_LIBCPP_NO_HAS_CHAR8_T)
225293# define __cpp_lib_char8_t 201811L
226294# endif
227// # define __cpp_lib_concepts 201806L
228// # define __cpp_lib_constexpr_misc 201811L
229// # define __cpp_lib_constexpr_swap_algorithms 201806L
295// # define __cpp_lib_concepts 202002L
296// # define __cpp_lib_constexpr_algorithms 201806L
297// # 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
230309# if _LIBCPP_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
231310# define __cpp_lib_destroying_delete 201806L
232311# endif
233312# define __cpp_lib_endian 201907L
234313# define __cpp_lib_erase_if 202002L
235// # define __cpp_lib_generic_unordered_lookup 201811L
314# 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
236319# define __cpp_lib_interpolate 201902L
237320# if !defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED)
238321# define __cpp_lib_is_constant_evaluated 201811L
239322# 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
240332# define __cpp_lib_list_remove_return_type 201806L
241333# if defined(__cpp_concepts) && __cpp_concepts >= 201811L
242334# define __cpp_lib_math_constants 201907L
243335# endif
336// # define __cpp_lib_polymorphic_allocator 201902L
244337// # 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
245345# define __cpp_lib_span 202002L
246// # define __cpp_lib_three_way_comparison 201711L
346# 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
247353# 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
248362#endif
249363
250364#endif // _LIBCPP_VERSIONH
lib/libcxx/include/wctype.h+3-1
......@@ -50,7 +50,9 @@ wctrans_t wctrans(const char* property);
5050#pragma GCC system_header
5151#endif
5252
53#include_next <wctype.h>
53#if __has_include_next(<wctype.h>)
54# include_next <wctype.h>
55#endif
5456
5557#ifdef __cplusplus
5658
lib/libcxx/src/atomic.cpp+6-2
......@@ -13,14 +13,18 @@
1313#include <atomic>
1414#include <functional>
1515
16#include <iostream>
17
1816#ifdef __linux__
1917
2018#include <unistd.h>
2119#include <linux/futex.h>
2220#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
2428#else // <- Add other operating systems here
2529
2630// Baseline needs no new headers
lib/libcxx/src/barrier.cpp+3-9
......@@ -26,21 +26,15 @@ public:
2626 } __tickets[64];
2727 };
2828
29 ptrdiff_t& __expected;
30 unique_ptr<char[]> __state_allocation;
31 __state_t* __state;
29 ptrdiff_t& __expected;
30 unique_ptr<__state_t[]> __state;
3231
3332 _LIBCPP_HIDDEN
3433 __barrier_algorithm_base(ptrdiff_t& __expected)
3534 : __expected(__expected)
3635 {
3736 size_t const __count = (__expected + 1) >> 1;
38 size_t const __size = sizeof(__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];
37 __state = unique_ptr<__state_t[]>(new __state_t[__count]);
4438 }
4539 _LIBCPP_HIDDEN
4640 bool __arrive(__barrier_phase_t __old_phase)
lib/libcxx/src/chrono.cpp+113-42
......@@ -13,11 +13,15 @@
1313#include "include/apple_availability.h"
1414
1515#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
1721#endif
1822
1923#if !defined(__APPLE__) && _POSIX_TIMERS > 0
20#define _LIBCPP_USE_CLOCK_GETTIME
24# define _LIBCPP_USE_CLOCK_GETTIME
2125#endif
2226
2327#if defined(_LIBCPP_WIN32API)
......@@ -27,12 +31,12 @@
2731# if _WIN32_WINNT >= _WIN32_WINNT_WIN8
2832# include <winapifamily.h>
2933# endif
30#else
31# if !defined(CLOCK_REALTIME)
32# include <sys/time.h> // for gettimeofday and timeval
33# endif // !defined(CLOCK_REALTIME)
3434#endif // defined(_LIBCPP_WIN32API)
3535
36#if __has_include(<mach/mach_time.h>)
37# include <mach/mach_time.h>
38#endif
39
3640#if defined(__ELF__) && defined(_LIBCPP_LINK_RT_LIB)
3741# pragma comment(lib, "rt")
3842#endif
......@@ -42,14 +46,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
4246namespace chrono
4347{
4448
49//
4550// system_clock
51//
4652
47const bool system_clock::is_steady;
48
49system_clock::time_point
50system_clock::now() _NOEXCEPT
51{
5253#if defined(_LIBCPP_WIN32API)
54
55static system_clock::time_point __libcpp_system_clock_now() {
5356 // FILETIME is in 100ns units
5457 using filetime_duration =
5558 _VSTD::chrono::duration<__int64,
......@@ -60,31 +63,42 @@ system_clock::now() _NOEXCEPT
6063 static _LIBCPP_CONSTEXPR const seconds nt_to_unix_epoch{11644473600};
6164
6265 FILETIME ft;
63#if _WIN32_WINNT >= _WIN32_WINNT_WIN8
64#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
66#if _WIN32_WINNT >= _WIN32_WINNT_WIN8 && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
6567 GetSystemTimePreciseAsFileTime(&ft);
66#else
67 GetSystemTimeAsFileTime(&ft);
68#endif
6968#else
7069 GetSystemTimeAsFileTime(&ft);
7170#endif
7271
7372 filetime_duration d{(static_cast<__int64>(ft.dwHighDateTime) << 32) |
7473 static_cast<__int64>(ft.dwLowDateTime)};
75 return time_point(duration_cast<duration>(d - nt_to_unix_epoch));
76#else
77#if defined(CLOCK_REALTIME)
74 return system_clock::time_point(duration_cast<system_clock::duration>(d - nt_to_unix_epoch));
75}
76
77#elif defined(CLOCK_REALTIME) && defined(_LIBCPP_USE_CLOCK_GETTIME)
78
79static system_clock::time_point __libcpp_system_clock_now() {
7880 struct timespec tp;
7981 if (0 != clock_gettime(CLOCK_REALTIME, &tp))
8082 __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
8286#else
87
88static system_clock::time_point __libcpp_system_clock_now() {
8389 timeval tv;
8490 gettimeofday(&tv, 0);
85 return time_point(seconds(tv.tv_sec) + microseconds(tv.tv_usec));
86#endif // CLOCK_REALTIME
91 return system_clock::time_point(seconds(tv.tv_sec) + microseconds(tv.tv_usec));
92}
93
8794#endif
95
96const bool system_clock::is_steady;
97
98system_clock::time_point
99system_clock::now() _NOEXCEPT
100{
101 return __libcpp_system_clock_now();
88102}
89103
90104time_t
......@@ -99,35 +113,85 @@ system_clock::from_time_t(time_t t) _NOEXCEPT
99113 return system_clock::time_point(seconds(t));
100114}
101115
102#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
116//
103117// steady_clock
104118//
105119// Warning: If this is not truly steady, then it is non-conforming. It is
106120// better for it to not exist and have the rest of libc++ use system_clock
107121// instead.
122//
108123
109const bool steady_clock::is_steady;
124#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
110125
111126#if defined(__APPLE__)
112127
113#if !defined(CLOCK_MONOTONIC_RAW)
114# error "Building libc++ on Apple platforms requires CLOCK_MONOTONIC_RAW"
128// TODO(ldionne):
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
115138#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
117181// On Apple platforms, only CLOCK_UPTIME_RAW, CLOCK_MONOTONIC_RAW or
118182// mach_absolute_time are able to time functions in the nanosecond range.
119183// Furthermore, only CLOCK_MONOTONIC_RAW is truly monotonic, because it
120184// also counts cycles when the system is asleep. Thus, it is the only
121185// acceptable implementation of steady_clock.
122steady_clock::time_point
123steady_clock::now() _NOEXCEPT
124{
186static steady_clock::time_point __libcpp_steady_clock_now() {
125187 struct timespec tp;
126188 if (0 != clock_gettime(CLOCK_MONOTONIC_RAW, &tp))
127189 __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));
129191}
130192
193#endif
194
131195#elif defined(_LIBCPP_WIN32API)
132196
133197// https://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx says:
......@@ -138,36 +202,43 @@ steady_clock::now() _NOEXCEPT
138202static LARGE_INTEGER
139203__QueryPerformanceFrequency()
140204{
141 LARGE_INTEGER val;
142 (void) QueryPerformanceFrequency(&val);
143 return val;
205 LARGE_INTEGER val;
206 (void) QueryPerformanceFrequency(&val);
207 return val;
144208}
145209
146steady_clock::time_point
147steady_clock::now() _NOEXCEPT
148{
210static steady_clock::time_point __libcpp_steady_clock_now() {
149211 static const LARGE_INTEGER freq = __QueryPerformanceFrequency();
150212
151213 LARGE_INTEGER counter;
152214 (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));
154219}
155220
156221#elif defined(CLOCK_MONOTONIC)
157222
158steady_clock::time_point
159steady_clock::now() _NOEXCEPT
160{
223static steady_clock::time_point __libcpp_steady_clock_now() {
161224 struct timespec tp;
162225 if (0 != clock_gettime(CLOCK_MONOTONIC, &tp))
163226 __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));
165228}
166229
167230#else
168# error "Monotonic clock not implemented"
231# error "Monotonic clock not implemented on this platform"
169232#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
171242#endif // !_LIBCPP_HAS_NO_MONOTONIC_CLOCK
172243
173244}
lib/libcxx/src/experimental/memory_resource.cpp-10
......@@ -76,16 +76,6 @@ union ResourceInitHelper {
7676 ~ResourceInitHelper() {}
7777};
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
8979// When compiled in C++14 this initialization should be a constant expression.
9080// Only in C++11 is "init_priority" needed to ensure initialization order.
9181#if _LIBCPP_STD_VER > 11
lib/libcxx/src/filesystem/directory_iterator.cpp+39-24
......@@ -10,6 +10,7 @@
1010#include "__config"
1111#if defined(_LIBCPP_WIN32API)
1212#define WIN32_LEAN_AND_MEAN
13#define NOMINMAX
1314#include <windows.h>
1415#else
1516#include <dirent.h>
......@@ -72,16 +73,20 @@ static pair<string_view, file_type> posix_readdir(DIR* dir_stream,
7273 }
7374}
7475#else
76// defined(_LIBCPP_WIN32API)
7577
76static file_type get_file_type(const WIN32_FIND_DATA& data) {
77 //auto attrs = data.dwFileAttributes;
78 // FIXME(EricWF)
79 return file_type::unknown;
78static file_type get_file_type(const WIN32_FIND_DATAW& data) {
79 if (data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT &&
80 data.dwReserved0 == IO_REPARSE_TAG_SYMLINK)
81 return file_type::symlink;
82 if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
83 return file_type::directory;
84 return file_type::regular;
8085}
81static uintmax_t get_file_size(const WIN32_FIND_DATA& data) {
82 return (data.nFileSizeHigh * (MAXDWORD + 1)) + data.nFileSizeLow;
86static uintmax_t get_file_size(const WIN32_FIND_DATAW& data) {
87 return (static_cast<uint64_t>(data.nFileSizeHigh) << 32) + data.nFileSizeLow;
8388}
84static file_time_type get_write_time(const WIN32_FIND_DATA& data) {
89static file_time_type get_write_time(const WIN32_FIND_DATAW& data) {
8590 ULARGE_INTEGER tmp;
8691 const FILETIME& time = data.ftLastWriteTime;
8792 tmp.u.LowPart = time.dwLowDateTime;
......@@ -110,15 +115,21 @@ public:
110115
111116 __dir_stream(const path& root, directory_options opts, error_code& ec)
112117 : __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_);
114123 if (__stream_ == INVALID_HANDLE_VALUE) {
115 ec = error_code(::GetLastError(), generic_category());
124 ec = detail::make_windows_error(GetLastError());
116125 const bool ignore_permission_denied =
117126 bool(opts & directory_options::skip_permission_denied);
118127 if (ignore_permission_denied && ec.value() == ERROR_ACCESS_DENIED)
119128 ec.clear();
120129 return;
121130 }
131 if (!assign())
132 advance(ec);
122133 }
123134
124135 ~__dir_stream() noexcept {
......@@ -130,35 +141,39 @@ public:
130141 bool good() const noexcept { return __stream_ != INVALID_HANDLE_VALUE; }
131142
132143 bool advance(error_code& ec) {
133 while (::FindNextFile(__stream_, &__data_)) {
134 if (!strcmp(__data_.cFileName, ".") || strcmp(__data_.cFileName, ".."))
135 continue;
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;
144 while (::FindNextFileW(__stream_, &__data_)) {
145 if (assign())
146 return true;
145147 }
146 ec = error_code(::GetLastError(), generic_category());
147148 close();
148149 return false;
149150 }
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
151166private:
152167 error_code close() noexcept {
153168 error_code ec;
154169 if (!::FindClose(__stream_))
155 ec = error_code(::GetLastError(), generic_category());
170 ec = detail::make_windows_error(GetLastError());
156171 __stream_ = INVALID_HANDLE_VALUE;
157172 return ec;
158173 }
159174
160175 HANDLE __stream_{INVALID_HANDLE_VALUE};
161 WIN32_FIND_DATA __data_;
176 WIN32_FIND_DATAW __data_;
162177
163178public:
164179 path __root_;
lib/libcxx/src/filesystem/filesystem_common.h+87-47
......@@ -13,14 +13,17 @@
1313#include "filesystem"
1414#include "array"
1515#include "chrono"
16#include "cstdlib"
1716#include "climits"
18
19#include <unistd.h>
20#include <sys/stat.h>
21#include <sys/statvfs.h>
22#include <sys/time.h> // for ::utimes as used in __last_write_time
23#include <fcntl.h> /* values for fchmodat */
17#include "cstdlib"
18#include "ctime"
19
20#if !defined(_LIBCPP_WIN32API)
21# include <unistd.h>
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
2528#include "../include/apple_availability.h"
2629
......@@ -37,9 +40,21 @@
3740#pragma GCC diagnostic ignored "-Wunused-function"
3841#endif
3942
43#if defined(_LIBCPP_WIN32API)
44#define PS(x) (L##x)
45#else
46#define PS(x) (x)
47#endif
48
4049_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
4150
4251namespace 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
4358namespace {
4459
4560static string format_string_imp(const char* msg, ...) {
......@@ -47,7 +62,7 @@ static string format_string_imp(const char* msg, ...) {
4762 struct GuardVAList {
4863 va_list& target;
4964 bool active = true;
50 GuardVAList(va_list& target) : target(target), active(true) {}
65 GuardVAList(va_list& tgt) : target(tgt), active(true) {}
5166 void clear() {
5267 if (active)
5368 va_end(target);
......@@ -93,8 +108,8 @@ static string format_string_imp(const char* msg, ...) {
93108 return result;
94109}
95110
96const char* unwrap(string const& s) { return s.c_str(); }
97const char* unwrap(path const& p) { return p.native().c_str(); }
111const path::value_type* unwrap(path::string_type const& s) { return s.c_str(); }
112const path::value_type* unwrap(path const& p) { return p.native().c_str(); }
98113template <class Arg>
99114Arg const& unwrap(Arg const& a) {
100115 static_assert(!is_class<Arg>::value, "cannot pass class here");
......@@ -111,6 +126,12 @@ error_code capture_errno() {
111126 return error_code(errno, generic_category());
112127}
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
114135template <class T>
115136T error_value();
116137template <>
......@@ -119,6 +140,12 @@ template <>
119140bool error_value<bool>() {
120141 return false;
121142}
143#if __SIZEOF_SIZE_T__ != __SIZEOF_LONG_LONG__
144template <>
145size_t error_value<size_t>() {
146 return size_t(-1);
147}
148#endif
122149template <>
123150uintmax_t error_value<uintmax_t>() {
124151 return uintmax_t(-1);
......@@ -134,50 +161,50 @@ path error_value<path>() {
134161
135162template <class T>
136163struct ErrorHandler {
137 const char* func_name;
138 error_code* ec = nullptr;
139 const path* p1 = nullptr;
140 const path* p2 = nullptr;
164 const char* func_name_;
165 error_code* ec_ = nullptr;
166 const path* p1_ = nullptr;
167 const path* p2_ = nullptr;
141168
142169 ErrorHandler(const char* fname, error_code* ec, const path* p1 = nullptr,
143170 const path* p2 = nullptr)
144 : func_name(fname), ec(ec), p1(p1), p2(p2) {
145 if (ec)
146 ec->clear();
171 : func_name_(fname), ec_(ec), p1_(p1), p2_(p2) {
172 if (ec_)
173 ec_->clear();
147174 }
148175
149 T report(const error_code& m_ec) const {
150 if (ec) {
151 *ec = m_ec;
176 T report(const error_code& ec) const {
177 if (ec_) {
178 *ec_ = ec;
152179 return error_value<T>();
153180 }
154 string what = string("in ") + func_name;
155 switch (bool(p1) + bool(p2)) {
181 string what = string("in ") + func_name_;
182 switch (bool(p1_) + bool(p2_)) {
156183 case 0:
157 __throw_filesystem_error(what, m_ec);
184 __throw_filesystem_error(what, ec);
158185 case 1:
159 __throw_filesystem_error(what, *p1, m_ec);
186 __throw_filesystem_error(what, *p1_, ec);
160187 case 2:
161 __throw_filesystem_error(what, *p1, *p2, m_ec);
188 __throw_filesystem_error(what, *p1_, *p2_, ec);
162189 }
163190 _LIBCPP_UNREACHABLE();
164191 }
165192
166193 template <class... Args>
167 T report(const error_code& m_ec, const char* msg, Args const&... args) const {
168 if (ec) {
169 *ec = m_ec;
194 T report(const error_code& ec, const char* msg, Args const&... args) const {
195 if (ec_) {
196 *ec_ = ec;
170197 return error_value<T>();
171198 }
172199 string what =
173 string("in ") + func_name + ": " + format_string(msg, args...);
174 switch (bool(p1) + bool(p2)) {
200 string("in ") + func_name_ + ": " + format_string(msg, args...);
201 switch (bool(p1_) + bool(p2_)) {
175202 case 0:
176 __throw_filesystem_error(what, m_ec);
203 __throw_filesystem_error(what, ec);
177204 case 1:
178 __throw_filesystem_error(what, *p1, m_ec);
205 __throw_filesystem_error(what, *p1_, ec);
179206 case 2:
180 __throw_filesystem_error(what, *p1, *p2, m_ec);
207 __throw_filesystem_error(what, *p1_, *p2_, ec);
181208 }
182209 _LIBCPP_UNREACHABLE();
183210 }
......@@ -197,8 +224,9 @@ private:
197224using chrono::duration;
198225using chrono::duration_cast;
199226
200using TimeSpec = struct ::timespec;
201using StatT = struct ::stat;
227using TimeSpec = struct timespec;
228using TimeVal = struct timeval;
229using StatT = struct stat;
202230
203231template <class FileTimeT, class TimeT,
204232 bool IsFloat = is_floating_point<typename FileTimeT::rep>::value>
......@@ -380,26 +408,38 @@ public:
380408using fs_time = time_util<file_time_type, time_t, TimeSpec>;
381409
382410#if defined(__APPLE__)
383TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }
384TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; }
411inline TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }
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}
385422#else
386TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; }
387TimeSpec extract_atime(StatT const& st) { return st.st_atim; }
423inline TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; }
424inline TimeSpec extract_atime(StatT const& st) { return st.st_atim; }
388425#endif
389426
390// allow the utimes implementation to compile even it we're not going
391// to use it.
392
393bool posix_utimes(const path& p, std::array<TimeSpec, 2> const& TS,
394 error_code& ec) {
427inline TimeVal make_timeval(TimeSpec const& ts) {
395428 using namespace chrono;
396429 auto Convert = [](long nsec) {
397 using int_type = decltype(std::declval< ::timeval>().tv_usec);
430 using int_type = decltype(std::declval<TimeVal>().tv_usec);
398431 auto dur = duration_cast<microseconds>(nanoseconds(nsec)).count();
399432 return static_cast<int_type>(dur);
400433 };
401 struct ::timeval ConvertedTS[2] = {{TS[0].tv_sec, Convert(TS[0].tv_nsec)},
402 {TS[1].tv_sec, Convert(TS[1].tv_nsec)}};
434 TimeVal TV = {};
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])};
403443 if (::utimes(p.c_str(), ConvertedTS) == -1) {
404444 ec = capture_errno();
405445 return true;
lib/libcxx/src/filesystem/operations.cpp+263-135
......@@ -9,8 +9,6 @@
99#include "filesystem"
1010#include "array"
1111#include "iterator"
12#include "fstream"
13#include "random" /* for unique_path */
1412#include "string_view"
1513#include "type_traits"
1614#include "vector"
......@@ -19,40 +17,51 @@
1917
2018#include "filesystem_common.h"
2119
22#include <unistd.h>
23#include <sys/stat.h>
24#include <sys/statvfs.h>
20#if defined(_LIBCPP_WIN32API)
21# define WIN32_LEAN_AND_MEAN
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
2529#include <time.h>
2630#include <fcntl.h> /* values for fchmodat */
2731
28#if defined(__linux__)
29#include <linux/version.h>
30#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
31#include <sys/sendfile.h>
32#define _LIBCPP_USE_SENDFILE
33#endif
32#if __has_include(<sys/sendfile.h>)
33# include <sys/sendfile.h>
34# define _LIBCPP_FILESYSTEM_USE_SENDFILE
3435#elif defined(__APPLE__) || __has_include(<copyfile.h>)
35#include <copyfile.h>
36#define _LIBCPP_USE_COPYFILE
36# include <copyfile.h>
37# define _LIBCPP_FILESYSTEM_USE_COPYFILE
38#else
39# include "fstream"
40# define _LIBCPP_FILESYSTEM_USE_FSTREAM
3741#endif
3842
3943#if !defined(CLOCK_REALTIME)
40#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")
44# include <sys/time.h> // for gettimeofday and timeval
4545#endif
4646
47#if defined(_LIBCPP_COMPILER_GCC)
48#if _GNUC_VER < 500
49#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
50#endif
47#if defined(__ELF__) && defined(_LIBCPP_LINK_RT_LIB)
48# pragma comment(lib, "rt")
5149#endif
5250
5351_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
5452
5553namespace {
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
5665namespace parser {
5766
5867using string_view_t = path::__string_view;
......@@ -179,11 +188,14 @@ public:
179188 switch (State) {
180189 case PS_BeforeBegin:
181190 case PS_AtEnd:
182 return "";
191 return PS("");
183192 case PS_InRootDir:
184 return "/";
193 if (RawEntry[0] == '\\')
194 return PS("\\");
195 else
196 return PS("/");
185197 case PS_InTrailingSep:
186 return "";
198 return PS("");
187199 case PS_InRootName:
188200 case PS_InFilenames:
189201 return RawEntry;
......@@ -270,29 +282,29 @@ private:
270282 }
271283
272284 PosPtr consumeSeparator(PosPtr P, PosPtr End) const noexcept {
273 if (P == End || *P != '/')
285 if (P == End || !isSeparator(*P))
274286 return nullptr;
275287 const int Inc = P < End ? 1 : -1;
276288 P += Inc;
277 while (P != End && *P == '/')
289 while (P != End && isSeparator(*P))
278290 P += Inc;
279291 return P;
280292 }
281293
282294 PosPtr consumeName(PosPtr P, PosPtr End) const noexcept {
283 if (P == End || *P == '/')
295 if (P == End || isSeparator(*P))
284296 return nullptr;
285297 const int Inc = P < End ? 1 : -1;
286298 P += Inc;
287 while (P != End && *P != '/')
299 while (P != End && !isSeparator(*P))
288300 P += Inc;
289301 return P;
290302 }
291303};
292304
293305string_view_pair separate_filename(string_view_t const& s) {
294 if (s == "." || s == ".." || s.empty())
295 return string_view_pair{s, ""};
306 if (s == PS(".") || s == PS("..") || s.empty())
307 return string_view_pair{s, PS("")};
296308 auto pos = s.find_last_of('.');
297309 if (pos == string_view_t::npos || pos == 0)
298310 return string_view_pair{s, string_view_t{}};
......@@ -308,6 +320,73 @@ string_view_t createView(PosPtr S, PosPtr E) noexcept {
308320
309321// 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
311390namespace detail {
312391namespace {
313392
......@@ -503,19 +582,25 @@ _FilesystemClock::time_point _FilesystemClock::now() noexcept {
503582
504583filesystem_error::~filesystem_error() {}
505584
585#if defined(_LIBCPP_WIN32API)
586#define PS_FMT "%ls"
587#else
588#define PS_FMT "%s"
589#endif
590
506591void filesystem_error::__create_what(int __num_paths) {
507592 const char* derived_what = system_error::what();
508593 __storage_->__what_ = [&]() -> string {
509 const char* p1 = path1().native().empty() ? "\"\"" : path1().c_str();
510 const char* p2 = path2().native().empty() ? "\"\"" : path2().c_str();
594 const path::value_type* p1 = path1().native().empty() ? PS("\"\"") : path1().c_str();
595 const path::value_type* p2 = path2().native().empty() ? PS("\"\"") : path2().c_str();
511596 switch (__num_paths) {
512597 default:
513598 return detail::format_string("filesystem error: %s", derived_what);
514599 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,
516601 p1);
517602 case 2:
518 return detail::format_string("filesystem error: %s [%s] [%s]",
603 return detail::format_string("filesystem error: %s [" PS_FMT "] [" PS_FMT "]",
519604 derived_what, p1, p2);
520605 }
521606 }();
......@@ -542,14 +627,18 @@ path __canonical(path const& orig_p, error_code* ec) {
542627 ErrorHandler<path> err("canonical", ec, &orig_p, &cwd);
543628
544629 path p = __do_absolute(orig_p, &cwd, ec);
545#if _POSIX_VERSION >= 200112
630#if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112
546631 std::unique_ptr<char, decltype(&::free)>
547632 hold(::realpath(p.c_str(), nullptr), &::free);
548633 if (hold.get() == nullptr)
549634 return err.report(capture_errno());
550635 return {hold.get()};
551636#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
553642 char* ret;
554643 if ((ret = ::realpath(p.c_str(), buff)) == nullptr)
555644 return err.report(capture_errno());
......@@ -646,96 +735,83 @@ void __copy(const path& from, const path& to, copy_options options,
646735namespace detail {
647736namespace {
648737
649#ifdef _LIBCPP_USE_SENDFILE
650bool copy_file_impl_sendfile(FileDescriptor& read_fd, FileDescriptor& write_fd,
651 error_code& ec) {
652
653 size_t count = read_fd.get_stat().st_size;
654 do {
655 ssize_t res;
656 if ((res = ::sendfile(write_fd.fd, read_fd.fd, nullptr, count)) == -1) {
657 ec = capture_errno();
658 return false;
659 }
660 count -= res;
661 } while (count > 0);
662
663 ec.clear();
738#if defined(_LIBCPP_FILESYSTEM_USE_SENDFILE)
739 bool copy_file_impl(FileDescriptor& read_fd, FileDescriptor& write_fd, error_code& ec) {
740 size_t count = read_fd.get_stat().st_size;
741 do {
742 ssize_t res;
743 if ((res = ::sendfile(write_fd.fd, read_fd.fd, nullptr, count)) == -1) {
744 ec = capture_errno();
745 return false;
746 }
747 count -= res;
748 } while (count > 0);
664749
665 return true;
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 };
750 ec.clear();
679751
680 CopyFileState cfs;
681 if (fcopyfile(read_fd.fd, write_fd.fd, cfs.state, COPYFILE_DATA) < 0) {
682 ec = capture_errno();
683 return false;
752 return true;
684753 }
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();
687 return true;
688}
689#endif
761 private:
762 CopyFileState(CopyFileState const&) = delete;
763 CopyFileState& operator=(CopyFileState const&) = delete;
764 };
690765
691// Note: This function isn't guarded by ifdef's even though it may be unused
692// in order to assure it still compiles.
693__attribute__((unused)) bool copy_file_impl_default(FileDescriptor& read_fd,
694 FileDescriptor& write_fd,
695 error_code& ec) {
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 }
766 CopyFileState cfs;
767 if (fcopyfile(read_fd.fd, write_fd.fd, cfs.state, COPYFILE_DATA) < 0) {
768 ec = capture_errno();
769 return false;
770 }
709771
710 if (in.good() && out.good()) {
711 using InIt = istreambuf_iterator<char>;
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;
772 ec.clear();
773 return true;
721774 }
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();
724 return true;
725}
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);
806 ec.clear();
807 return true;
808 }
732809#else
733 return copy_file_impl_default(from, to, ec);
734#endif
735}
810# error "Unknown implementation for copy_file_impl"
811#endif // copy_file_impl implementation
736812
737} // namespace
738} // namespace detail
813} // end anonymous namespace
814} // end namespace detail
739815
740816bool __copy_file(const path& from, const path& to, copy_options options,
741817 error_code* ec) {
......@@ -870,8 +946,17 @@ bool __create_directory(const path& p, error_code* ec) {
870946
871947 if (::mkdir(p.c_str(), static_cast<int>(perms::all)) == 0)
872948 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 {
874958 err.report(capture_errno());
959 }
875960 return false;
876961}
877962
......@@ -889,8 +974,17 @@ bool __create_directory(path const& p, path const& attributes, error_code* ec) {
889974
890975 if (::mkdir(p.c_str(), attr_stat.st_mode) == 0)
891976 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 {
893986 err.report(capture_errno());
987 }
894988 return false;
895989}
896990
......@@ -1225,10 +1319,10 @@ path __temp_directory_path(error_code* ec) {
12251319 error_code m_ec;
12261320 file_status st = detail::posix_stat(p, &m_ec);
12271321 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
12301324 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",
12321326 p);
12331327
12341328 return p;
......@@ -1284,7 +1378,7 @@ path& path::replace_extension(path const& replacement) {
12841378 }
12851379 if (!replacement.empty()) {
12861380 if (replacement.native()[0] != '.') {
1287 __pn_ += ".";
1381 __pn_ += PS(".");
12881382 }
12891383 __pn_.append(replacement.__pn_);
12901384 }
......@@ -1314,7 +1408,7 @@ string_view_t path::__root_path_raw() const {
13141408 auto PP = PathParser::CreateBegin(__pn_);
13151409 if (PP.State == PathParser::PS_InRootName) {
13161410 auto NextCh = PP.peek();
1317 if (NextCh && *NextCh == '/') {
1411 if (NextCh && isSeparator(*NextCh)) {
13181412 ++PP;
13191413 return createView(__pn_.data(), &PP.RawEntry.back());
13201414 }
......@@ -1406,12 +1500,16 @@ enum PathPartKind : unsigned char {
14061500static PathPartKind ClassifyPathPart(string_view_t Part) {
14071501 if (Part.empty())
14081502 return PK_TrailingSep;
1409 if (Part == ".")
1503 if (Part == PS("."))
14101504 return PK_Dot;
1411 if (Part == "..")
1505 if (Part == PS(".."))
14121506 return PK_DotDot;
1413 if (Part == "/")
1507 if (Part == PS("/"))
1508 return PK_RootSep;
1509#if defined(_LIBCPP_WIN32API)
1510 if (Part == PS("\\"))
14141511 return PK_RootSep;
1512#endif
14151513 return PK_Filename;
14161514}
14171515
......@@ -1459,7 +1557,7 @@ path path::lexically_normal() const {
14591557 NewPathSize -= Parts.back().first.size();
14601558 Parts.pop_back();
14611559 } else if (LastKind != PK_RootSep)
1462 AddPart(PK_DotDot, "..");
1560 AddPart(PK_DotDot, PS(".."));
14631561 MaybeNeedTrailingSep = LastKind == PK_Filename;
14641562 break;
14651563 }
......@@ -1474,7 +1572,7 @@ path path::lexically_normal() const {
14741572 }
14751573 // [fs.path.generic]p6.8: If the path is empty, add a dot.
14761574 if (Parts.empty())
1477 return ".";
1575 return PS(".");
14781576
14791577 // [fs.path.generic]p6.7: If the last filename is dot-dot, remove any
14801578 // trailing directory-separator.
......@@ -1486,7 +1584,7 @@ path path::lexically_normal() const {
14861584 Result /= PK.first;
14871585
14881586 if (NeedTrailingSep)
1489 Result /= "";
1587 Result /= PS("");
14901588
14911589 return Result;
14921590}
......@@ -1495,9 +1593,9 @@ static int DetermineLexicalElementCount(PathParser PP) {
14951593 int Count = 0;
14961594 for (; PP; ++PP) {
14971595 auto Elem = *PP;
1498 if (Elem == "..")
1596 if (Elem == PS(".."))
14991597 --Count;
1500 else if (Elem != "." && Elem != "")
1598 else if (Elem != PS(".") && Elem != PS(""))
15011599 ++Count;
15021600 }
15031601 return Count;
......@@ -1544,15 +1642,15 @@ path path::lexically_relative(const path& base) const {
15441642 return {};
15451643
15461644 // if n == 0 and (a == end() || a->empty()), returns path("."); otherwise
1547 if (ElemCount == 0 && (PP.atEnd() || *PP == ""))
1548 return ".";
1645 if (ElemCount == 0 && (PP.atEnd() || *PP == PS("")))
1646 return PS(".");
15491647
15501648 // return a path constructed with 'n' dot-dot elements, followed by the the
15511649 // elements of '*this' after the mismatch.
15521650 path Result;
15531651 // FIXME: Reserve enough room in Result that it won't have to re-allocate.
15541652 while (ElemCount--)
1555 Result /= "..";
1653 Result /= PS("..");
15561654 for (; PP; ++PP)
15571655 Result /= *PP;
15581656 return Result;
......@@ -1565,7 +1663,7 @@ static int CompareRootName(PathParser *LHS, PathParser *RHS) {
15651663 return 0;
15661664
15671665 auto GetRootName = [](PathParser *Parser) -> string_view_t {
1568 return Parser->inRootName() ? **Parser : "";
1666 return Parser->inRootName() ? **Parser : PS("");
15691667 };
15701668 int res = GetRootName(LHS).compare(GetRootName(RHS));
15711669 ConsumeRootName(LHS);
......@@ -1674,6 +1772,36 @@ path::iterator& path::iterator::__decrement() {
16741772 return *this;
16751773}
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
16771805///////////////////////////////////////////////////////////////////////////////
16781806// directory entry definitions
16791807///////////////////////////////////////////////////////////////////////////////
lib/libcxx/src/include/config_elast.h+4
......@@ -17,10 +17,14 @@
1717#include <errno.h>
1818#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.
2022#if defined(ELAST)
2123#define _LIBCPP_ELAST ELAST
2224#elif defined(_NEWLIB_VERSION)
2325#define _LIBCPP_ELAST __ELASTERROR
26#elif defined(__NuttX__)
27// No _LIBCPP_ELAST needed on NuttX
2428#elif defined(__Fuchsia__)
2529// No _LIBCPP_ELAST needed on Fuchsia
2630#elif defined(__wasi__)
lib/libcxx/src/include/refstring.h+19-6
......@@ -13,12 +13,25 @@
1313#include <stdexcept>
1414#include <cstddef>
1515#include <cstring>
16#ifdef __APPLE__
17#include <dlfcn.h>
18#include <mach-o/dyld.h>
19#endif
2016#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
2235_LIBCPP_BEGIN_NAMESPACE_STD
2336
2437namespace __refstring_imp { namespace {
......@@ -40,7 +53,7 @@ inline char * data_from_rep(_Rep_base *rep) noexcept {
4053 return data + sizeof(*rep);
4154}
4255
43#if defined(__APPLE__)
56#if defined(_LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE)
4457inline
4558const char* compute_gcc_empty_string_storage() _NOEXCEPT
4659{
......@@ -115,7 +128,7 @@ __libcpp_refstring::~__libcpp_refstring() {
115128
116129inline
117130bool __libcpp_refstring::__uses_refcount() const {
118#ifdef __APPLE__
131#if defined(_LIBCPP_CHECK_FOR_GCC_EMPTY_STRING_STORAGE)
119132 return __imp_ != get_gcc_empty_string_storage();
120133#else
121134 return true;
lib/libcxx/src/ios.cpp-16
......@@ -15,30 +15,14 @@
1515#include "__locale"
1616#include "algorithm"
1717#include "include/config_elast.h"
18#include "istream"
1918#include "limits"
2019#include "memory"
2120#include "new"
22#include "streambuf"
2321#include "string"
2422#include "__undef_macros"
2523
2624_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
4226class _LIBCPP_HIDDEN __iostream_category
4327 : public __do_message
4428{
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
7777#endif
7878;
7979
80_LIBCPP_HIDDEN ios_base::Init __start_std_streams;
80_LIBCPP_HIDDEN ios_base::Init __start_std_streams _LIBCPP_INIT_PRIORITY_MAX;
8181
8282// On Windows the TLS storage for locales needs to be initialized before we create
8383// the standard streams, otherwise it may not be alive during program termination
lib/libcxx/src/locale.cpp+200-10
......@@ -29,8 +29,8 @@
2929#include "cwctype"
3030#include "__sso_allocator"
3131#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
32#include "support/win32/locale_win32.h"
33#elif !defined(__BIONIC__)
32#include "__support/win32/locale_win32.h"
33#elif !defined(__BIONIC__) && !defined(__NuttX__)
3434#include <langinfo.h>
3535#endif
3636#include <stdlib.h>
......@@ -158,7 +158,7 @@ const locale::category locale::all;
158158class _LIBCPP_HIDDEN locale::__imp
159159 : public facet
160160{
161 enum {N = 28};
161 enum {N = 30};
162162#if defined(_LIBCPP_COMPILER_MSVC)
163163// FIXME: MSVC doesn't support aligned parameters by value.
164164// I can't get the __sso_allocator to work here
......@@ -202,8 +202,14 @@ locale::__imp::__imp(size_t refs)
202202 install(&make<_VSTD::ctype<wchar_t> >(1u));
203203 install(&make<codecvt<char, char, mbstate_t> >(1u));
204204 install(&make<codecvt<wchar_t, char, mbstate_t> >(1u));
205_LIBCPP_SUPPRESS_DEPRECATED_PUSH
205206 install(&make<codecvt<char16_t, char, mbstate_t> >(1u));
206207 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
207213 install(&make<numpunct<char> >(1u));
208214 install(&make<numpunct<wchar_t> >(1u));
209215 install(&make<num_get<char> >(1u));
......@@ -245,8 +251,14 @@ locale::__imp::__imp(const string& name, size_t refs)
245251 install(new ctype_byname<wchar_t>(name_));
246252 install(new codecvt_byname<char, char, mbstate_t>(name_));
247253 install(new codecvt_byname<wchar_t, char, mbstate_t>(name_));
254_LIBCPP_SUPPRESS_DEPRECATED_PUSH
248255 install(new codecvt_byname<char16_t, char, mbstate_t>(name_));
249256 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
250262 install(new numpunct_byname<char>(name_));
251263 install(new numpunct_byname<wchar_t>(name_));
252264 install(new moneypunct_byname<char, false>(name_));
......@@ -315,8 +327,14 @@ locale::__imp::__imp(const __imp& other, const string& name, locale::category c)
315327 install(new ctype_byname<wchar_t>(name));
316328 install(new codecvt_byname<char, char, mbstate_t>(name));
317329 install(new codecvt_byname<wchar_t, char, mbstate_t>(name));
330_LIBCPP_SUPPRESS_DEPRECATED_PUSH
318331 install(new codecvt_byname<char16_t, char, mbstate_t>(name));
319332 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
320338 }
321339 if (c & locale::monetary)
322340 {
......@@ -385,8 +403,14 @@ locale::__imp::__imp(const __imp& other, const __imp& one, locale::category c)
385403 install_from<_VSTD::ctype<char> >(one);
386404 install_from<_VSTD::ctype<wchar_t> >(one);
387405 install_from<_VSTD::codecvt<char, char, mbstate_t> >(one);
406_LIBCPP_SUPPRESS_DEPRECATED_PUSH
388407 install_from<_VSTD::codecvt<char16_t, char, mbstate_t> >(one);
389408 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
390414 install_from<_VSTD::codecvt<wchar_t, char, mbstate_t> >(one);
391415 }
392416 if (c & locale::monetary)
......@@ -1149,7 +1173,7 @@ ctype<char>::__classic_upper_table() _NOEXCEPT
11491173{
11501174 return _LIBCPP_GET_C_LOCALE->__ctype_toupper;
11511175}
1152#elif __NetBSD__
1176#elif defined(__NetBSD__)
11531177const short*
11541178ctype<char>::__classic_lower_table() _NOEXCEPT
11551179{
......@@ -3171,6 +3195,87 @@ codecvt<char16_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
31713195 return 4;
31723196}
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
31743279// template <> class codecvt<char32_t, char, mbstate_t>
31753280
31763281locale::id codecvt<char32_t, char, mbstate_t>::id;
......@@ -3248,6 +3353,87 @@ codecvt<char32_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
32483353 return 4;
32493354}
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
32513437// __codecvt_utf8<wchar_t>
32523438
32533439__codecvt_utf8<wchar_t>::result
......@@ -5128,7 +5314,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
51285314 mb = mbstate_t();
51295315 const char* bb = buf;
51305316 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)
51325318 __throw_runtime_error("locale not supported");
51335319 wbe = wbuf + j;
51345320 __weeks_[i].assign(wbuf, wbe);
......@@ -5136,7 +5322,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
51365322 mb = mbstate_t();
51375323 bb = buf;
51385324 j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
5139 if (j == size_t(-1))
5325 if (j == size_t(-1) || j == 0)
51405326 __throw_runtime_error("locale not supported");
51415327 wbe = wbuf + j;
51425328 __weeks_[i+7].assign(wbuf, wbe);
......@@ -5149,7 +5335,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
51495335 mb = mbstate_t();
51505336 const char* bb = buf;
51515337 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)
51535339 __throw_runtime_error("locale not supported");
51545340 wbe = wbuf + j;
51555341 __months_[i].assign(wbuf, wbe);
......@@ -5157,7 +5343,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
51575343 mb = mbstate_t();
51585344 bb = buf;
51595345 j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
5160 if (j == size_t(-1))
5346 if (j == size_t(-1) || j == 0)
51615347 __throw_runtime_error("locale not supported");
51625348 wbe = wbuf + j;
51635349 __months_[i+12].assign(wbuf, wbe);
......@@ -6148,7 +6334,11 @@ template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<wchar_t>
61486334
61496335template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char, char, mbstate_t>;
61506336template 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>;
6152template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char, mbstate_t>;
6337template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_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
61546344_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/memory.cpp-4
......@@ -124,16 +124,12 @@ __shared_weak_count::lock() _NOEXCEPT
124124 return nullptr;
125125}
126126
127#if !defined(_LIBCPP_NO_RTTI) || !defined(_LIBCPP_BUILD_STATIC)
128
129127const void*
130128__shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT
131129{
132130 return nullptr;
133131}
134132
135#endif // _LIBCPP_NO_RTTI
136
137133#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
138134
139135_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
6464 if (size == 0)
6565 size = 1;
6666 void* p;
67 while ((p = ::malloc(size)) == 0)
67 while ((p = ::malloc(size)) == nullptr)
6868 {
6969 // If malloc fails and there is a new_handler,
7070 // call it to try free up memory.
......@@ -85,7 +85,7 @@ _LIBCPP_WEAK
8585void*
8686operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
8787{
88 void* p = 0;
88 void* p = nullptr;
8989#ifndef _LIBCPP_NO_EXCEPTIONS
9090 try
9191 {
......@@ -111,7 +111,7 @@ _LIBCPP_WEAK
111111void*
112112operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
113113{
114 void* p = 0;
114 void* p = nullptr;
115115#ifndef _LIBCPP_NO_EXCEPTIONS
116116 try
117117 {
......@@ -178,15 +178,16 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
178178 size = 1;
179179 if (static_cast<size_t>(alignment) < sizeof(void*))
180180 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).
181188 void* p;
182#if defined(_LIBCPP_MSVCRT_LIKE)
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
189 while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr)
187190 {
188 // If posix_memalign fails and there is a new_handler,
189 // call it to try free up memory.
190191 std::new_handler nh = std::get_new_handler();
191192 if (nh)
192193 nh();
......@@ -194,7 +195,6 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
194195#ifndef _LIBCPP_NO_EXCEPTIONS
195196 throw std::bad_alloc();
196197#else
197 p = nullptr; // posix_memalign doesn't initialize 'p' on failure
198198 break;
199199#endif
200200 }
......@@ -206,7 +206,7 @@ _LIBCPP_WEAK
206206void*
207207operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
208208{
209 void* p = 0;
209 void* p = nullptr;
210210#ifndef _LIBCPP_NO_EXCEPTIONS
211211 try
212212 {
......@@ -232,7 +232,7 @@ _LIBCPP_WEAK
232232void*
233233operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
234234{
235 void* p = 0;
235 void* p = nullptr;
236236#ifndef _LIBCPP_NO_EXCEPTIONS
237237 try
238238 {
......@@ -251,11 +251,7 @@ _LIBCPP_WEAK
251251void
252252operator delete(void* ptr, std::align_val_t) _NOEXCEPT
253253{
254#if defined(_LIBCPP_MSVCRT_LIKE)
255 ::_aligned_free(ptr);
256#else
257 ::free(ptr);
258#endif
254 std::__libcpp_aligned_free(ptr);
259255}
260256
261257_LIBCPP_WEAK
lib/libcxx/src/optional.cpp+1
......@@ -7,6 +7,7 @@
77//===----------------------------------------------------------------------===//
88
99#include "optional"
10#include "__availability"
1011
1112namespace std
1213{
lib/libcxx/src/random.cpp+21
......@@ -13,6 +13,7 @@
1313#define _CRT_RAND_S
1414#endif // defined(_LIBCPP_USING_WIN32_RANDOM)
1515
16#include "limits"
1617#include "random"
1718#include "system_error"
1819
......@@ -29,6 +30,10 @@
2930#elif defined(_LIBCPP_USING_DEV_RANDOM)
3031#include <fcntl.h>
3132#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
3237#elif defined(_LIBCPP_USING_NACL_RANDOM)
3338#include <nacl/nacl_random.h>
3439#endif
......@@ -172,7 +177,23 @@ random_device::operator()()
172177double
173178random_device::entropy() const _NOEXCEPT
174179{
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)
175186 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
176197}
177198
178199_LIBCPP_END_NAMESPACE_STD
lib/libcxx/src/support/runtime/exception_fallback.ipp-4
......@@ -49,7 +49,6 @@ get_terminate() _NOEXCEPT
4949 return __libcpp_atomic_load(&__terminate_handler);
5050}
5151
52#ifndef __EMSCRIPTEN__ // We provide this in JS
5352_LIBCPP_NORETURN
5453void
5554terminate() _NOEXCEPT
......@@ -72,9 +71,7 @@ terminate() _NOEXCEPT
7271 }
7372#endif // _LIBCPP_NO_EXCEPTIONS
7473}
75#endif // !__EMSCRIPTEN__
7674
77#if !defined(__EMSCRIPTEN__)
7875bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; }
7976
8077int uncaught_exceptions() _NOEXCEPT
......@@ -83,7 +80,6 @@ int uncaught_exceptions() _NOEXCEPT
8380 fprintf(stderr, "uncaught_exceptions not yet implemented\n");
8481 ::abort();
8582}
86#endif // !__EMSCRIPTEN__
8783
8884
8985exception::~exception() _NOEXCEPT
lib/libcxx/src/support/solaris/xlocale.cpp+1-1
......@@ -8,7 +8,7 @@
88
99#ifdef __sun__
1010
11#include "support/solaris/xlocale.h"
11#include "__support/solaris/xlocale.h"
1212#include <stdarg.h>
1313#include <stdio.h>
1414#include <sys/localedef.h>
lib/libcxx/src/support/win32/locale_win32.cpp+1-1
......@@ -1,5 +1,5 @@
11// -*- C++ -*-
2//===-------------------- support/win32/locale_win32.cpp ------------------===//
2//===----------------------------------------------------------------------===//
33//
44// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
55// See https://llvm.org/LICENSE.txt for license information.
lib/libcxx/src/support/win32/support.cpp+1-1
......@@ -1,5 +1,5 @@
11// -*- C++ -*-
2//===----------------------- support/win32/support.h ----------------------===//
2//===----------------------------------------------------------------------===//
33//
44// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
55// See https://llvm.org/LICENSE.txt for license information.
lib/libcxx/src/support/win32/thread_win32.cpp+1-1
......@@ -1,5 +1,5 @@
11// -*- C++ -*-
2//===-------------------- support/win32/thread_win32.cpp ------------------===//
2//===----------------------------------------------------------------------===//
33//
44// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
55// See https://llvm.org/LICENSE.txt for license information.
lib/libcxx/src/thread.cpp+2-16
......@@ -14,17 +14,9 @@
1414#include "vector"
1515#include "future"
1616#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
2618#if __has_include(<unistd.h>)
27#include <unistd.h>
19# include <unistd.h> // for sysconf
2820#endif
2921
3022#if defined(__NetBSD__)
......@@ -80,13 +72,7 @@ thread::detach()
8072unsigned
8173thread::hardware_concurrency() _NOEXCEPT
8274{
83#if defined(CTL_HW) && defined(HW_NCPU)
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)
75#if defined(_SC_NPROCESSORS_ONLN)
9076 long result = sysconf(_SC_NPROCESSORS_ONLN);
9177 // sysconf returns -1 if the name is invalid, the option does not exist or
9278 // does not have a definite limit.
lib/libcxxabi/include/__cxxabi_config.h+15-2
......@@ -18,6 +18,19 @@
1818#define __has_attribute(_attribute_) 0
1919#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
2134#if defined(_WIN32)
2235 #if defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)
2336 #define _LIBCXXABI_HIDDEN
......@@ -53,7 +66,7 @@
5366 #endif
5467#endif
5568
56#if defined(_WIN32)
69#if defined(_LIBCXXABI_COMPILER_MSVC)
5770#define _LIBCXXABI_WEAK
5871#else
5972#define _LIBCXXABI_WEAK __attribute__((__weak__))
......@@ -72,7 +85,7 @@
7285#endif
7386
7487// 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__)
7689# define _LIBCXXABI_GUARD_ABI_ARM
7790#endif
7891
lib/libcxxabi/include/cxxabi.h+10-9
......@@ -21,6 +21,7 @@
2121
2222#define _LIBCPPABI_VERSION 1002
2323#define _LIBCXXABI_NORETURN __attribute__((noreturn))
24#define _LIBCXXABI_ALWAYS_COLD __attribute__((cold))
2425
2526#ifdef __cplusplus
2627
......@@ -78,13 +79,13 @@ extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_deleted_virtual(void);
7879
7980// 3.3.2 One-time Construction API
8081#if defined(_LIBCXXABI_GUARD_ABI_ARM)
81extern _LIBCXXABI_FUNC_VIS int __cxa_guard_acquire(uint32_t *);
82extern _LIBCXXABI_FUNC_VIS void __cxa_guard_release(uint32_t *);
83extern _LIBCXXABI_FUNC_VIS void __cxa_guard_abort(uint32_t *);
82extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_ALWAYS_COLD int __cxa_guard_acquire(uint32_t *);
83extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_ALWAYS_COLD void __cxa_guard_release(uint32_t *);
84extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_ALWAYS_COLD void __cxa_guard_abort(uint32_t *);
8485#else
85extern _LIBCXXABI_FUNC_VIS int __cxa_guard_acquire(uint64_t *);
86extern _LIBCXXABI_FUNC_VIS void __cxa_guard_release(uint64_t *);
87extern _LIBCXXABI_FUNC_VIS void __cxa_guard_abort(uint64_t *);
86extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_ALWAYS_COLD int __cxa_guard_acquire(uint64_t *);
87extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_ALWAYS_COLD void __cxa_guard_release(uint64_t *);
88extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_ALWAYS_COLD void __cxa_guard_abort(uint64_t *);
8889#endif
8990
9091// 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,
136137 void (*destructor)(void *));
137138
138139// 3.3.5.3 Runtime API
139extern _LIBCXXABI_FUNC_VIS int __cxa_atexit(void (*f)(void *), void *p,
140 void *d);
141extern _LIBCXXABI_FUNC_VIS int __cxa_finalize(void *);
140// These functions are part of the C++ ABI, but they are not defined in libc++abi:
141// int __cxa_atexit(void (*)(void *), void *, void *);
142// void __cxa_finalize(void *);
142143
143144// 3.4 Demangler API
144145extern _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()
4545 exception_header + 1;
4646 const __shim_type_info* thrown_type =
4747 static_cast<const __shim_type_info*>(exception_header->exceptionType);
48#if !defined(LIBCXXABI_NON_DEMANGLING_TERMINATE)
4849 // Try to get demangled name of thrown_type
4950 int status;
5051 char buf[1024];
......@@ -52,6 +53,9 @@ static void demangling_terminate_handler()
5253 const char* name = __cxa_demangle(thrown_type->name(), buf, &len, &status);
5354 if (status != 0)
5455 name = thrown_type->name();
56#else
57 const char* name = thrown_type->name();
58#endif
5559 // If the uncaught exception can be caught with std::exception&
5660 const __shim_type_info* catch_type =
5761 static_cast<const __shim_type_info*>(&typeid(std::exception));
lib/libcxxabi/src/cxa_guard_impl.h+24-24
......@@ -54,6 +54,14 @@
5454#endif
5555#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
5765// To make testing possible, this header is included from both cxa_guard.cpp
5866// and a number of tests.
5967//
......@@ -112,25 +120,25 @@ class AtomicInt {
112120public:
113121 using MemoryOrder = std::__libcpp_atomic_order;
114122
115 explicit AtomicInt(IntType *b) : b(b) {}
123 explicit AtomicInt(IntType *b) : b_(b) {}
116124 AtomicInt(AtomicInt const&) = delete;
117125 AtomicInt& operator=(AtomicInt const&) = delete;
118126
119127 IntType load(MemoryOrder ord) {
120 return std::__libcpp_atomic_load(b, ord);
128 return std::__libcpp_atomic_load(b_, ord);
121129 }
122130 void store(IntType val, MemoryOrder ord) {
123 std::__libcpp_atomic_store(b, val, ord);
131 std::__libcpp_atomic_store(b_, val, ord);
124132 }
125133 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);
127135 }
128136 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);
130138 }
131139
132140private:
133 IntType *b;
141 IntType *b_;
134142};
135143
136144//===----------------------------------------------------------------------===//
......@@ -154,14 +162,7 @@ constexpr uint32_t (*PlatformThreadID)() = nullptr;
154162
155163
156164constexpr bool PlatformSupportsThreadID() {
157#ifdef __clang__
158#pragma clang diagnostic push
159#pragma clang diagnostic ignored "-Wtautological-pointer-compare"
160#endif
161165 return +PlatformThreadID != nullptr;
162#ifdef __clang__
163#pragma clang diagnostic pop
164#endif
165166}
166167
167168//===----------------------------------------------------------------------===//
......@@ -375,18 +376,18 @@ private:
375376 LockGuard& operator=(LockGuard const&) = delete;
376377
377378 explicit LockGuard(const char* calling_func)
378 : calling_func(calling_func) {
379 : calling_func_(calling_func) {
379380 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_);
381382 }
382383
383384 ~LockGuard() {
384385 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_);
386387 }
387388
388389 private:
389 const char* const calling_func;
390 const char* const calling_func_;
390391 };
391392};
392393
......@@ -411,14 +412,7 @@ constexpr void (*PlatformFutexWake)(int*) = nullptr;
411412#endif
412413
413414constexpr bool PlatformSupportsFutex() {
414#ifdef __clang__
415#pragma clang diagnostic push
416#pragma clang diagnostic ignored "-Wtautological-pointer-compare"
417#endif
418415 return +PlatformFutexWait != nullptr;
419#ifdef __clang__
420#pragma clang diagnostic pop
421#endif
422416}
423417
424418/// InitByteFutex - Manages initialization using atomics and the futex syscall
......@@ -589,4 +583,10 @@ using SelectedImplementation =
589583} // end namespace
590584} // 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
592592#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,
684684 return;
685685 }
686686 landingPad = (uintptr_t)lpStart + landingPad;
687 results.landingPad = landingPad;
687688#else // __USING_SJLJ_EXCEPTIONS__
688689 ++landingPad;
689690#endif // __USING_SJLJ_EXCEPTIONS__
690691 if (actionEntry == 0)
691692 {
692693 // Found a cleanup
693 // If this is a type 1 or type 2 search, there are no handlers
694 // If this is a type 3 search, you want to install the cleanup.
695 if ((actions & _UA_CLEANUP_PHASE) && !(actions & _UA_HANDLER_FRAME))
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;
694 results.reason = actions & _UA_SEARCH_PHASE
695 ? _URC_CONTINUE_UNWIND
696 : _URC_HANDLER_FOUND;
704697 return;
705698 }
706699 // Convert 1-based byte offset into
707700 const uint8_t* action = actionTableStart + (actionEntry - 1);
701 bool hasCleanup = false;
708702 // Scan action entries until you find a matching handler, cleanup, or the end of action list
709703 while (true)
710704 {
......@@ -720,27 +714,17 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
720714 native_exception, unwind_exception);
721715 if (catchType == 0)
722716 {
723 // Found catch (...) catches everything, including foreign exceptions
724 // If this is a type 1 search save state and return _URC_HANDLER_FOUND
725 // If this is a type 2 search save state and return _URC_HANDLER_FOUND
726 // If this is a type 3 search !_UA_FORCE_UNWIND, we should have found this in phase 1!
727 // If this is a type 3 search _UA_FORCE_UNWIND, ignore handler and continue scan
728 if ((actions & _UA_SEARCH_PHASE) || (actions & _UA_HANDLER_FRAME))
729 {
730 // Save state and return _URC_HANDLER_FOUND
731 results.ttypeIndex = ttypeIndex;
732 results.actionRecord = actionRecord;
733 results.landingPad = landingPad;
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 }
717 // Found catch (...) catches everything, including
718 // foreign exceptions. This is search phase, cleanup
719 // phase with foreign exception, or forced unwinding.
720 assert(actions & (_UA_SEARCH_PHASE | _UA_HANDLER_FRAME |
721 _UA_FORCE_UNWIND));
722 results.ttypeIndex = ttypeIndex;
723 results.actionRecord = actionRecord;
724 results.adjustedPtr =
725 get_thrown_object_ptr(unwind_exception);
726 results.reason = _URC_HANDLER_FOUND;
727 return;
744728 }
745729 // Else this is a catch (T) clause and will never
746730 // catch a foreign exception
......@@ -757,36 +741,25 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
757741 }
758742 if (catchType->can_catch(excpType, adjustedPtr))
759743 {
760 // Found a matching handler
761 // If this is a type 1 search save state and return _URC_HANDLER_FOUND
762 // If this is a type 3 search and !_UA_FORCE_UNWIND, we should have found this in phase 1!
763 // If this is a type 3 search and _UA_FORCE_UNWIND, ignore handler and continue scan
764 if (actions & _UA_SEARCH_PHASE)
765 {
766 // Save state and return _URC_HANDLER_FOUND
767 results.ttypeIndex = ttypeIndex;
768 results.actionRecord = actionRecord;
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 }
744 // Found a matching handler. This is either search
745 // phase or forced unwinding.
746 assert(actions &
747 (_UA_SEARCH_PHASE | _UA_FORCE_UNWIND));
748 results.ttypeIndex = ttypeIndex;
749 results.actionRecord = actionRecord;
750 results.adjustedPtr = adjustedPtr;
751 results.reason = _URC_HANDLER_FOUND;
752 return;
780753 }
781754 }
782755 // Scan next action ...
783756 }
784757 else if (ttypeIndex < 0)
785758 {
786 // Found an exception spec. If this is a foreign exception,
787 // it is always caught.
788 if (native_exception)
789 {
759 // Found an exception specification.
760 if (actions & _UA_FORCE_UNWIND) {
761 // Skip if forced unwinding.
762 } else if (native_exception) {
790763 // Does the exception spec catch this native exception?
791764 __cxa_exception* exception_header = (__cxa_exception*)(unwind_exception+1) - 1;
792765 void* adjustedPtr = get_thrown_object_ptr(unwind_exception);
......@@ -801,77 +774,38 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
801774 ttypeEncoding, excpType,
802775 adjustedPtr, unwind_exception))
803776 {
804 // native exception caught by exception spec
805 // If this is a type 1 search, save state and return _URC_HANDLER_FOUND
806 // If this is a type 3 search !_UA_FORCE_UNWIND, we should have found this in phase 1!
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
777 // Native exception caught by exception
778 // specification.
779 assert(actions & _UA_SEARCH_PHASE);
836780 results.ttypeIndex = ttypeIndex;
837781 results.actionRecord = actionRecord;
838 results.landingPad = landingPad;
839 results.adjustedPtr = get_thrown_object_ptr(unwind_exception);
782 results.adjustedPtr = adjustedPtr;
840783 results.reason = _URC_HANDLER_FOUND;
841784 return;
842785 }
843 else if (!(actions & _UA_FORCE_UNWIND))
844 {
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
786 } else {
787 // foreign exception caught by exception spec
861788 results.ttypeIndex = ttypeIndex;
862789 results.actionRecord = actionRecord;
863 results.landingPad = landingPad;
864 results.adjustedPtr = get_thrown_object_ptr(unwind_exception);
790 results.adjustedPtr =
791 get_thrown_object_ptr(unwind_exception);
865792 results.reason = _URC_HANDLER_FOUND;
866793 return;
867794 }
795 // Scan next action ...
796 } else {
797 hasCleanup = true;
868798 }
869799 const uint8_t* temp = action;
870800 int64_t actionOffset = readSLEB128(&temp);
871801 if (actionOffset == 0)
872802 {
873 // End of action list, no matching handler or cleanup found
874 results.reason = _URC_CONTINUE_UNWIND;
803 // End of action list. If this is phase 2 and we have found
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;
875809 return;
876810 }
877811 // Go to next action
......@@ -962,78 +896,51 @@ __gxx_personality_v0
962896 bool native_exception = (exceptionClass & get_vendor_and_language) ==
963897 (kOurExceptionClass & get_vendor_and_language);
964898 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
965923 if (actions & _UA_SEARCH_PHASE)
966924 {
967925 // Phase 1 search: All we're looking for in phase 1 is a handler that
968926 // halts unwinding
969 scan_eh_tab(results, actions, native_exception, unwind_exception, context);
970 if (results.reason == _URC_HANDLER_FOUND)
971 {
972 // Found one. Can we cache the results somewhere to optimize phase 2?
973 if (native_exception)
974 {
975 __cxa_exception* exception_header = (__cxa_exception*)(unwind_exception+1) - 1;
976 exception_header->handlerSwitchValue = static_cast<int>(results.ttypeIndex);
977 exception_header->actionRecord = results.actionRecord;
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;
927 assert(results.reason == _URC_HANDLER_FOUND);
928 if (native_exception) {
929 // For a native exception, cache the LSDA result.
930 __cxa_exception* exc = (__cxa_exception*)(unwind_exception + 1) - 1;
931 exc->handlerSwitchValue = static_cast<int>(results.ttypeIndex);
932 exc->actionRecord = results.actionRecord;
933 exc->languageSpecificData = results.languageSpecificData;
934 exc->catchTemp = reinterpret_cast<void*>(results.landingPad);
935 exc->adjustedPtr = results.adjustedPtr;
1029936 }
1030 // Did not find a cleanup. Return the results of the scan
1031 // (normally _URC_CONTINUE_UNWIND, but could have been _URC_FATAL_PHASE2_ERROR
1032 // if we were called improperly).
1033 return results.reason;
937 return _URC_HANDLER_FOUND;
1034938 }
1035 // We were called improperly: neither a phase 1 or phase 2 search
1036 return _URC_FATAL_PHASE1_ERROR;
939
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;
1037944}
1038945
1039946#if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
lib/libcxxabi/src/demangle/ItaniumDemangle.h+167-36
......@@ -82,6 +82,7 @@
8282 X(PostfixExpr) \
8383 X(ConditionalExpr) \
8484 X(MemberExpr) \
85 X(SubobjectExpr) \
8586 X(EnclosingExpr) \
8687 X(CastExpr) \
8788 X(SizeofParamPackExpr) \
......@@ -91,10 +92,10 @@
9192 X(PrefixExpr) \
9293 X(FunctionParam) \
9394 X(ConversionExpr) \
95 X(PointerToMemberConversionExpr) \
9496 X(InitListExpr) \
9597 X(FoldExpr) \
9698 X(ThrowExpr) \
97 X(UUIDOfExpr) \
9899 X(BoolExpr) \
99100 X(StringLiteral) \
100101 X(LambdaExpr) \
......@@ -1656,6 +1657,40 @@ public:
16561657 }
16571658};
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
16591694class EnclosingExpr : public Node {
16601695 const StringView Prefix;
16611696 const Node *Infix;
......@@ -1843,6 +1878,28 @@ public:
18431878 }
18441879};
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
18461903class InitListExpr : public Node {
18471904 const Node *Ty;
18481905 NodeArray Inits;
......@@ -1977,21 +2034,6 @@ public:
19772034 }
19782035};
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
19952037class BoolExpr : public Node {
19962038 bool Value;
19972039
......@@ -2313,9 +2355,9 @@ template <typename Derived, typename Alloc> struct AbstractManglingParser {
23132355 TemplateParamList Params;
23142356
23152357 public:
2316 ScopedTemplateParamList(AbstractManglingParser *Parser)
2317 : Parser(Parser),
2318 OldNumTemplateParamLists(Parser->TemplateParams.size()) {
2358 ScopedTemplateParamList(AbstractManglingParser *TheParser)
2359 : Parser(TheParser),
2360 OldNumTemplateParamLists(TheParser->TemplateParams.size()) {
23192361 Parser->TemplateParams.push_back(&Params);
23202362 }
23212363 ~ScopedTemplateParamList() {
......@@ -2437,6 +2479,8 @@ template <typename Derived, typename Alloc> struct AbstractManglingParser {
24372479 Node *parseConversionExpr();
24382480 Node *parseBracedExpr();
24392481 Node *parseFoldExpr();
2482 Node *parsePointerToMemberConversionExpr();
2483 Node *parseSubobjectExpr();
24402484
24412485 /// Parse the <type> production.
24422486 Node *parseType();
......@@ -4404,6 +4448,50 @@ Node *AbstractManglingParser<Derived, Alloc>::parseFoldExpr() {
44044448 return make<FoldExpr>(IsLeftFold, OperatorName, Pack, Init);
44054449}
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
44074495// <expression> ::= <unary operator-name> <expression>
44084496// ::= <binary operator-name> <expression> <expression>
44094497// ::= <ternary operator-name> <expression> <expression> <expression>
......@@ -4661,6 +4749,9 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {
46614749 return nullptr;
46624750 case 'm':
46634751 switch (First[1]) {
4752 case 'c':
4753 First += 2;
4754 return parsePointerToMemberConversionExpr();
46644755 case 'i':
46654756 First += 2;
46664757 return getDerived().parseBinaryExpr("-");
......@@ -4808,6 +4899,9 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {
48084899 return Ex;
48094900 return make<CastExpr>("static_cast", T, Ex);
48104901 }
4902 case 'o':
4903 First += 2;
4904 return parseSubobjectExpr();
48114905 case 'p': {
48124906 First += 2;
48134907 Node *Child = getDerived().parseExpr();
......@@ -4903,6 +4997,43 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {
49034997 }
49044998 }
49054999 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 }
49065037 case '1':
49075038 case '2':
49085039 case '3':
......@@ -4914,21 +5045,6 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {
49145045 case '9':
49155046 return getDerived().parseUnresolvedName();
49165047 }
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
49325048 return nullptr;
49335049}
49345050
......@@ -4975,6 +5091,16 @@ Node *AbstractManglingParser<Derived, Alloc>::parseSpecialName() {
49755091 switch (look()) {
49765092 case 'T':
49775093 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 }
49785104 // TV <type> # virtual table
49795105 case 'V': {
49805106 First += 2;
......@@ -5103,7 +5229,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseEncoding() {
51035229 decltype(TemplateParams) OldParams;
51045230
51055231 public:
5106 SaveTemplateParams(AbstractManglingParser *Parser) : Parser(Parser) {
5232 SaveTemplateParams(AbstractManglingParser *TheParser) : Parser(TheParser) {
51075233 OldParams = std::move(Parser->TemplateParams);
51085234 Parser->TemplateParams.clear();
51095235 }
......@@ -5203,7 +5329,12 @@ struct FloatData<long double>
52035329#else
52045330 static const size_t mangled_size = 20; // May need to be adjusted to 16 or 24 on other platforms
52055331#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;
52075338 static constexpr const char *spec = "%LaL";
52085339};
52095340
lib/libcxxabi/src/demangle/Utility.h+1-1
......@@ -52,7 +52,7 @@ class OutputStream {
5252 char *TempPtr = std::end(Temp);
5353
5454 while (N) {
55 *--TempPtr = '0' + char(N % 10);
55 *--TempPtr = char('0' + N % 10);
5656 N /= 10;
5757 }
5858
lib/libcxxabi/src/fallback_malloc.cpp+16-23
......@@ -6,9 +6,6 @@
66//
77//===----------------------------------------------------------------------===//
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
129#include "fallback_malloc.h"
1310
1411#include <__threading_support>
......@@ -20,6 +17,7 @@
2017
2118#include <stdlib.h> // for malloc, calloc, free
2219#include <string.h> // for memset
20#include <new> // for std::__libcpp_aligned_{alloc,free}
2321
2422// A small, simple heap manager based (loosely) on
2523// the startup heap manager from FreeBSD, optimized for space.
......@@ -144,29 +142,26 @@ void fallback_free(void* ptr) {
144142 mutexor mtx(&heap_mutex);
145143
146144#ifdef DEBUG_FALLBACK_MALLOC
147 std::cout << "Freeing item at " << offset_from_node(cp) << " of size "
148 << cp->len << std::endl;
145 std::printf("Freeing item at %d of size %d\n", offset_from_node(cp), cp->len);
149146#endif
150147
151148 for (p = freelist, prev = 0; p && p != list_end;
152149 prev = p, p = node_from_offset(p->next_node)) {
153150#ifdef DEBUG_FALLBACK_MALLOC
154 std::cout << " p, cp, after (p), after(cp) " << offset_from_node(p) << ' '
155 << offset_from_node(cp) << ' ' << offset_from_node(after(p))
156 << ' ' << offset_from_node(after(cp)) << std::endl;
151 std::printf(" p=%d, cp=%d, after(p)=%d, after(cp)=%d\n",
152 offset_from_node(p), offset_from_node(cp),
153 offset_from_node(after(p)), offset_from_node(after(cp)));
157154#endif
158155 if (after(p) == cp) {
159156#ifdef DEBUG_FALLBACK_MALLOC
160 std::cout << " Appending onto chunk at " << offset_from_node(p)
161 << std::endl;
157 std::printf(" Appending onto chunk at %d\n", offset_from_node(p));
162158#endif
163159 p->len = static_cast<heap_size>(
164160 p->len + cp->len); // make the free heap_node larger
165161 return;
166162 } else if (after(cp) == p) { // there's a free heap_node right after
167163#ifdef DEBUG_FALLBACK_MALLOC
168 std::cout << " Appending free chunk at " << offset_from_node(p)
169 << std::endl;
164 std::printf(" Appending free chunk at %d\n", offset_from_node(p));
170165#endif
171166 cp->len = static_cast<heap_size>(cp->len + p->len);
172167 if (prev == 0) {
......@@ -179,8 +174,7 @@ void fallback_free(void* ptr) {
179174 }
180175// Nothing to merge with, add it to the start of the free list
181176#ifdef DEBUG_FALLBACK_MALLOC
182 std::cout << " Making new free list entry " << offset_from_node(cp)
183 << std::endl;
177 std::printf(" Making new free list entry %d\n", offset_from_node(cp));
184178#endif
185179 cp->next_node = offset_from_node(freelist);
186180 freelist = cp;
......@@ -195,11 +189,11 @@ size_t print_free_list() {
195189
196190 for (p = freelist, prev = 0; p && p != list_end;
197191 prev = p, p = node_from_offset(p->next_node)) {
198 std::cout << (prev == 0 ? "" : " ") << "Offset: " << offset_from_node(p)
199 << "\tsize: " << p->len << " Next: " << p->next_node << std::endl;
192 std::printf("%sOffset: %d\tsize: %d Next: %d\n",
193 (prev == 0 ? "" : " "), offset_from_node(p), p->len, p->next_node);
200194 total_free += p->len;
201195 }
202 std::cout << "Total Free space: " << total_free << std::endl;
196 std::printf("Total Free space: %d\n", total_free);
203197 return total_free;
204198}
205199#endif
......@@ -211,7 +205,7 @@ struct __attribute__((aligned)) __aligned_type {};
211205
212206void* __aligned_malloc_with_fallback(size_t size) {
213207#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))
215209 return dest;
216210#elif defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
217211 if (void* dest = ::malloc(size))
......@@ -219,8 +213,7 @@ void* __aligned_malloc_with_fallback(size_t size) {
219213#else
220214 if (size == 0)
221215 size = 1;
222 void* dest;
223 if (::posix_memalign(&dest, __alignof(__aligned_type), size) == 0)
216 if (void* dest = std::__libcpp_aligned_alloc(__alignof(__aligned_type), size))
224217 return dest;
225218#endif
226219 return fallback_malloc(size);
......@@ -241,10 +234,10 @@ void __aligned_free_with_fallback(void* ptr) {
241234 if (is_fallback_ptr(ptr))
242235 fallback_free(ptr);
243236 else {
244#if defined(_WIN32)
245 ::_aligned_free(ptr);
246#else
237#if defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
247238 ::free(ptr);
239#else
240 std::__libcpp_aligned_free(ptr);
248241#endif
249242 }
250243}
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)
6161 return x == y || strcmp(x->name(), y->name()) == 0;
6262}
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
6474namespace __cxxabiv1
6575{
6676
......@@ -297,7 +307,7 @@ __base_class_type_info::has_unambiguous_public_base(__dynamic_cast_info* info,
297307 if (__offset_flags & __virtual_mask)
298308 {
299309 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);
301311 }
302312 }
303313 __base_type->has_unambiguous_public_base(
......@@ -615,10 +625,26 @@ __dynamic_cast(const void *static_ptr, const __class_type_info *static_type,
615625 // Possible future optimization: Take advantage of src2dst_offset
616626
617627 // 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
618643 void **vtable = *static_cast<void ** const *>(static_ptr);
619644 ptrdiff_t offset_to_derived = reinterpret_cast<ptrdiff_t>(vtable[-2]);
620645 const void* dynamic_ptr = static_cast<const char*>(static_ptr) + offset_to_derived;
621646 const __class_type_info* dynamic_type = static_cast<const __class_type_info*>(vtable[-1]);
647#endif
622648
623649 // Initialize answer to nullptr. This will be changed from the search
624650 // 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,
641667 {
642668 // We get here only if there is some kind of visibility problem
643669 // in client code.
670 static_assert(std::atomic<size_t>::is_always_lock_free, "");
644671 static std::atomic<size_t> error_count(0);
645672 size_t error_count_snapshot = error_count.fetch_add(1, std::memory_order_relaxed);
646673 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,
667694 if (info.path_dst_ptr_to_static_ptr == unknown &&
668695 info.path_dynamic_ptr_to_static_ptr == unknown)
669696 {
697 static_assert(std::atomic<size_t>::is_always_lock_free, "");
670698 static std::atomic<size_t> error_count(0);
671699 size_t error_count_snapshot = error_count.fetch_add(1, std::memory_order_relaxed);
672700 if ((error_count_snapshot & (error_count_snapshot-1)) == 0)
......@@ -1265,7 +1293,7 @@ __base_class_type_info::search_above_dst(__dynamic_cast_info* info,
12651293 if (__offset_flags & __virtual_mask)
12661294 {
12671295 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);
12691297 }
12701298 __base_type->search_above_dst(info, dst_ptr,
12711299 static_cast<const char*>(current_ptr) + offset_to_base,
......@@ -1285,7 +1313,7 @@ __base_class_type_info::search_below_dst(__dynamic_cast_info* info,
12851313 if (__offset_flags & __virtual_mask)
12861314 {
12871315 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);
12891317 }
12901318 __base_type->search_below_dst(info,
12911319 static_cast<const char*>(current_ptr) + offset_to_base,
lib/libcxxabi/src/stdlib_exception.cpp-1
......@@ -6,7 +6,6 @@
66//
77//===----------------------------------------------------------------------===//
88
9#define _LIBCPP_BUILDING_LIBRARY
109#include <new>
1110#include <exception>
1211
lib/libcxxabi/src/stdlib_new_delete.cpp+15-22
......@@ -8,7 +8,6 @@
88// This file implements the new and delete operators.
99//===----------------------------------------------------------------------===//
1010
11#define _LIBCPP_BUILDING_LIBRARY
1211#include "__cxxabi_config.h"
1312#include <new>
1413#include <cstdlib>
......@@ -28,7 +27,7 @@ operator new(std::size_t size) _THROW_BAD_ALLOC
2827 if (size == 0)
2928 size = 1;
3029 void* p;
31 while ((p = ::malloc(size)) == 0)
30 while ((p = ::malloc(size)) == nullptr)
3231 {
3332 // If malloc fails and there is a new_handler,
3433 // call it to try free up memory.
......@@ -49,7 +48,7 @@ _LIBCXXABI_WEAK
4948void*
5049operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
5150{
52 void* p = 0;
51 void* p = nullptr;
5352#ifndef _LIBCXXABI_NO_EXCEPTIONS
5453 try
5554 {
......@@ -75,7 +74,7 @@ _LIBCXXABI_WEAK
7574void*
7675operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
7776{
78 void* p = 0;
77 void* p = nullptr;
7978#ifndef _LIBCXXABI_NO_EXCEPTIONS
8079 try
8180 {
......@@ -94,8 +93,7 @@ _LIBCXXABI_WEAK
9493void
9594operator delete(void* ptr) _NOEXCEPT
9695{
97 if (ptr)
98 ::free(ptr);
96 ::free(ptr);
9997}
10098
10199_LIBCXXABI_WEAK
......@@ -143,15 +141,16 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
143141 size = 1;
144142 if (static_cast<size_t>(alignment) < sizeof(void*))
145143 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).
146151 void* p;
147#if defined(_LIBCPP_WIN32API)
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 while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr)
152153 {
153 // If posix_memalign fails and there is a new_handler,
154 // call it to try free up memory.
155154 std::new_handler nh = std::get_new_handler();
156155 if (nh)
157156 nh();
......@@ -159,7 +158,6 @@ operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
159158#ifndef _LIBCXXABI_NO_EXCEPTIONS
160159 throw std::bad_alloc();
161160#else
162 p = nullptr; // posix_memalign doesn't initialize 'p' on failure
163161 break;
164162#endif
165163 }
......@@ -171,7 +169,7 @@ _LIBCXXABI_WEAK
171169void*
172170operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
173171{
174 void* p = 0;
172 void* p = nullptr;
175173#ifndef _LIBCXXABI_NO_EXCEPTIONS
176174 try
177175 {
......@@ -197,7 +195,7 @@ _LIBCXXABI_WEAK
197195void*
198196operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
199197{
200 void* p = 0;
198 void* p = nullptr;
201199#ifndef _LIBCXXABI_NO_EXCEPTIONS
202200 try
203201 {
......@@ -216,12 +214,7 @@ _LIBCXXABI_WEAK
216214void
217215operator delete(void* ptr, std::align_val_t) _NOEXCEPT
218216{
219 if (ptr)
220#if defined(_LIBCPP_WIN32API)
221 ::_aligned_free(ptr);
222#else
223 ::free(ptr);
224#endif
217 std::__libcpp_aligned_free(ptr);
225218}
226219
227220_LIBCXXABI_WEAK
lib/libcxxabi/src/stdlib_stdexcept.cpp+1-1
......@@ -6,7 +6,7 @@
66//
77//===----------------------------------------------------------------------===//
88
9#include "include/refstring.h"
9#include "../../libcxx/src/include/refstring.h"
1010#include "stdexcept"
1111#include "new"
1212#include <cstdlib>
lib/libunwind/include/__libunwind_config.h+10
......@@ -25,8 +25,12 @@
2525#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC 31
2626#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_HEXAGON 34
2727#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV 64
28#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE 143
2829
2930#if defined(_LIBUNWIND_IS_NATIVE_ONLY)
31# if defined(__linux__)
32# define _LIBUNWIND_TARGET_LINUX 1
33# endif
3034# if defined(__i386__)
3135# define _LIBUNWIND_TARGET_I386
3236# define _LIBUNWIND_CONTEXT_SIZE 8
......@@ -135,6 +139,11 @@
135139# error "Unsupported RISC-V ABI"
136140# endif
137141# 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
138147# else
139148# error "Unsupported architecture."
140149# endif
......@@ -151,6 +160,7 @@
151160# define _LIBUNWIND_TARGET_SPARC 1
152161# define _LIBUNWIND_TARGET_HEXAGON 1
153162# define _LIBUNWIND_TARGET_RISCV 1
163# define _LIBUNWIND_TARGET_VE 1
154164# define _LIBUNWIND_CONTEXT_SIZE 167
155165# define _LIBUNWIND_CURSOR_SIZE 179
156166# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
lib/libunwind/include/libunwind.h+159-1
......@@ -43,6 +43,12 @@
4343 #define LIBUNWIND_AVAIL
4444#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
4652/* error codes */
4753enum {
4854 UNW_ESUCCESS = 0, /* no error */
......@@ -68,7 +74,7 @@ typedef struct unw_context_t unw_context_t;
6874
6975struct unw_cursor_t {
7076 uint64_t data[_LIBUNWIND_CURSOR_SIZE];
71};
77} LIBUNWIND_CURSOR_ALIGNMENT_ATTR;
7278typedef struct unw_cursor_t unw_cursor_t;
7379
7480typedef struct unw_addr_space *unw_addr_space_t;
......@@ -941,4 +947,156 @@ enum {
941947 UNW_RISCV_F31 = 63,
942948};
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
9441102#endif
lib/libunwind/src/AddressSpace.hpp+98-162
......@@ -17,6 +17,12 @@
1717#include <stdlib.h>
1818#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
2026#ifndef _LIBUNWIND_USE_DLADDR
2127 #if !defined(_LIBUNWIND_IS_BAREMETAL) && !defined(_WIN32)
2228 #define _LIBUNWIND_USE_DLADDR 1
......@@ -39,19 +45,6 @@ struct EHABIIndexEntry {
3945};
4046#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
5548#ifdef __APPLE__
5649
5750 struct dyld_unwind_sections
......@@ -62,43 +55,9 @@ namespace libunwind {
6255 const void* compact_unwind_section;
6356 uintptr_t compact_unwind_section_length;
6457 };
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 struct
87 info->mh = (const struct mach_header *)mh;
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
59 // In 10.7.0 or later, libSystem.dylib implements this function.
60 extern "C" bool _dyld_find_unwind_sections(void *, dyld_unwind_sections *);
10261
10362#elif defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) && defined(_LIBUNWIND_IS_BAREMETAL)
10463
......@@ -139,22 +98,15 @@ extern char __eh_frame_hdr_end;
13998extern char __exidx_start;
14099extern 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
152103#include <windows.h>
153104#include <psapi.h>
154#endif
155#if !defined(ElfW)
156#define ElfW(type) Elf_##type
157#endif
105
106#elif defined(_LIBUNWIND_USE_DL_ITERATE_PHDR) || \
107 defined(_LIBUNWIND_USE_DL_UNWIND_FIND_EXIDX)
108
109#include <link.h>
158110
159111#endif
160112
......@@ -162,11 +114,15 @@ namespace libunwind {
162114
163115/// Used by findUnwindSections() to return info about needed sections.
164116struct UnwindInfoSections {
165#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) || defined(_LIBUNWIND_SUPPORT_DWARF_INDEX) || \
166 defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)
167 // No dso_base for SEH or ARM EHABI.
117#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) || \
118 defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND) || \
119 defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)
120 // No dso_base for SEH.
168121 uintptr_t dso_base;
169122#endif
123#if defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)
124 uintptr_t text_segment_length;
125#endif
170126#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
171127 uintptr_t dwarf_section;
172128 uintptr_t dwarf_section_length;
......@@ -290,11 +246,11 @@ inline int64_t LocalAddressSpace::getSLEB128(pint_t &addr, pint_t end) {
290246 if (p == pend)
291247 _LIBUNWIND_ABORT("truncated sleb128 expression");
292248 byte = *p++;
293 result |= ((byte & 0x7f) << bit);
249 result |= (uint64_t)(byte & 0x7f) << bit;
294250 bit += 7;
295251 } while (byte & 0x80);
296252 // sign extend negative numbers
297 if ((byte & 0x40) != 0)
253 if ((byte & 0x40) != 0 && bit < 64)
298254 result |= (-1ULL) << bit;
299255 addr = (pint_t) p;
300256 return result;
......@@ -392,23 +348,14 @@ LocalAddressSpace::getEncodedP(pint_t &addr, pint_t end, uint8_t encoding,
392348 return result;
393349}
394350
395#ifdef __APPLE__
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)
351#if defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)
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
412359#if !defined(Elf_Half)
413360 typedef ElfW(Half) Elf_Half;
414361#endif
......@@ -447,16 +394,12 @@ struct _LIBUNWIND_HIDDEN dl_iterate_cb_data {
447394 uintptr_t targetAddr;
448395};
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
455397#if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE)
456398#include "FrameHeaderCache.hpp"
457399
458// There should be just one of these per process.
459static FrameHeaderCache ProcessFrameHeaderCache;
400// Typically there is one cache per process, but when libunwind is built as a
401// hermetic static library, then each shared object may have its own cache.
402static FrameHeaderCache TheFrameHeaderCache;
460403#endif
461404
462405static 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,
466409 uintptr_t end = begin + phdr->p_memsz;
467410 if (cbdata->targetAddr >= begin && cbdata->targetAddr < end) {
468411 cbdata->sects->dso_base = begin;
469 cbdata->sects->dwarf_section_length = phdr->p_memsz;
412 cbdata->sects->text_segment_length = phdr->p_memsz;
470413 return true;
471414 }
472415 }
473416 return false;
474417}
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
476451static int findUnwindSectionsByPhdr(struct dl_phdr_info *pinfo,
477452 size_t pinfo_size, void *data) {
478453 auto cbdata = static_cast<dl_iterate_cb_data *>(data);
479454 if (pinfo->dlpi_phnum == 0 || cbdata->targetAddr < pinfo->dlpi_addr)
480455 return 0;
481456#if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE)
482 if (ProcessFrameHeaderCache.find(pinfo, pinfo_size, data))
457 if (TheFrameHeaderCache.find(pinfo, pinfo_size, data))
483458 return 1;
459#else
460 // Avoid warning about unused variable.
461 (void)pinfo_size;
484462#endif
485463
486464 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.
491 if (pinfo->dlpi_phnum > 2)
492 found_obj = checkAddrInSegment(&pinfo->dlpi_phdr[2], image_base, cbdata);
466 // Most shared objects seen in this callback function likely don't contain the
467 // target address, so optimize for that. Scan for a matching PT_LOAD segment
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 know
495 // that there is one or more phdrs.
479 // PT_GNU_EH_FRAME and PT_ARM_EXIDX are usually near the end. Iterate
480 // backward.
481 bool found_unwind = false;
496482 for (Elf_Half i = pinfo->dlpi_phnum; i > 0; i--) {
497483 const Elf_Phdr *phdr = &pinfo->dlpi_phdr[i - 1];
498 if (!found_hdr && phdr->p_type == PT_GNU_EH_FRAME) {
499 EHHeaderParser<LocalAddressSpace>::EHHeaderInfo hdrInfo;
500 uintptr_t eh_frame_hdr_start = image_base + phdr->p_vaddr;
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;
484 if (checkForUnwindInfoSegment(phdr, image_base, cbdata)) {
485 found_unwind = true;
486 break;
516487 }
517488 }
518 cbdata->sects->dwarf_section_length = 0;
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)
489 if (!found_unwind)
536490 return 0;
537491
538 Elf_Addr image_base = calculateImageBase(pinfo);
539
540 for (Elf_Half i = 0; i < pinfo->dlpi_phnum; i++) {
541 const Elf_Phdr *phdr = &pinfo->dlpi_phdr[i];
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;
492#if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE)
493 TheFrameHeaderCache.add(cbdata->sects);
494#endif
495 return 1;
555496}
556#endif // defined(LIBUNWIND_SUPPORT_DWARF_UNWIND)
557#endif // defined(_LIBUNWIND_ARM_EHABI) || defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
497
498#endif // defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)
558499
559500
560501inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
......@@ -572,6 +513,7 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
572513 return true;
573514 }
574515#elif defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) && defined(_LIBUNWIND_IS_BAREMETAL)
516 info.dso_base = 0;
575517 // Bare metal is statically linked, so no need to ask the dynamic loader
576518 info.dwarf_section_length = (uintptr_t)(&__eh_frame_end - &__eh_frame_start);
577519 info.dwarf_section = (uintptr_t)(&__eh_frame_start);
......@@ -638,16 +580,14 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
638580 (void)targetAddr;
639581 (void)info;
640582 return true;
641#elif defined(_LIBUNWIND_ARM_EHABI) && defined(__BIONIC__)
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.
583#elif defined(_LIBUNWIND_USE_DL_UNWIND_FIND_EXIDX)
644584 int length = 0;
645585 info.arm_section =
646586 (uintptr_t)dl_unwind_find_exidx((_Unwind_Ptr)targetAddr, &length);
647587 info.arm_section_length = (uintptr_t)length * sizeof(EHABIIndexEntry);
648588 if (info.arm_section && info.arm_section_length)
649589 return true;
650#elif defined(_LIBUNWIND_ARM_EHABI) || defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
590#elif defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)
651591 dl_iterate_cb_data cb_data = {this, &info, targetAddr};
652592 int found = dl_iterate_phdr(findUnwindSectionsByPhdr, &cb_data);
653593 return static_cast<bool>(found);
......@@ -658,14 +598,10 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
658598
659599
660600inline bool LocalAddressSpace::findOtherFDE(pint_t targetAddr, pint_t &fde) {
661#ifdef __APPLE__
662 return checkKeyMgrRegisteredFDEs(targetAddr, *((void**)&fde));
663#else
664601 // TO DO: if OS has way to dynamically register FDEs, check that.
665602 (void)targetAddr;
666603 (void)fde;
667604 return false;
668#endif
669605}
670606
671607inline 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(
9393
9494 case CFI_Parser<A>::kRegisterInRegister:
9595 return registers.getRegister((int)savedReg.value);
96
96 case CFI_Parser<A>::kRegisterUndefined:
97 return 0;
9798 case CFI_Parser<A>::kRegisterUnused:
9899 case CFI_Parser<A>::kRegisterOffsetFromCFA:
99100 // FIX ME
......@@ -117,6 +118,7 @@ double DwarfInstructions<A, R>::getSavedFloatRegister(
117118
118119 case CFI_Parser<A>::kRegisterIsExpression:
119120 case CFI_Parser<A>::kRegisterUnused:
121 case CFI_Parser<A>::kRegisterUndefined:
120122 case CFI_Parser<A>::kRegisterOffsetFromCFA:
121123 case CFI_Parser<A>::kRegisterInRegister:
122124 // FIX ME
......@@ -140,6 +142,7 @@ v128 DwarfInstructions<A, R>::getSavedVectorRegister(
140142
141143 case CFI_Parser<A>::kRegisterIsExpression:
142144 case CFI_Parser<A>::kRegisterUnused:
145 case CFI_Parser<A>::kRegisterUndefined:
143146 case CFI_Parser<A>::kRegisterOffsetFromCFA:
144147 case CFI_Parser<A>::kRegisterInRegister:
145148 // FIX ME
......@@ -190,6 +193,10 @@ int DwarfInstructions<A, R>::stepWithDwarf(A &addressSpace, pint_t pc,
190193 prolog.savedRegisters[i]));
191194 else
192195 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);
193200 }
194201 }
195202
lib/libunwind/src/DwarfParser.hpp+407-404
......@@ -69,6 +69,7 @@ public:
6969 };
7070 enum RegisterSavedWhere {
7171 kRegisterUnused,
72 kRegisterUndefined,
7273 kRegisterInCFA,
7374 kRegisterOffsetFromCFA,
7475 kRegisterInRegister,
......@@ -87,9 +88,6 @@ public:
8788 int32_t cfaRegisterOffset; // CFA = (cfaRegister)+cfaRegisterOffset
8889 int64_t cfaExpression; // CFA = expression
8990 uint32_t spExtraArgSize;
90 uint32_t codeOffsetAtStackDecrement;
91 bool registersInOtherRegisters;
92 bool sameValueUsed;
9391 RegisterLocation savedRegisters[kMaxRegisterNumber + 1];
9492 enum class InitializeTime { kLazy, kNormal };
9593
......@@ -134,8 +132,26 @@ public:
134132 PrologInfo info;
135133 };
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
137153 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,
139155 CIE_Info *cieInfo);
140156 static const char *decodeFDE(A &addressSpace, pint_t fdeStart,
141157 FDE_Info *fdeInfo, CIE_Info *cieInfo);
......@@ -144,13 +160,6 @@ public:
144160 int arch, PrologInfo *results);
145161
146162 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);
154163};
155164
156165/// 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,
166175 p += 8;
167176 }
168177 if (cfiLength == 0)
169 return "FDE has zero length"; // end marker
178 return "FDE has zero length"; // zero terminator
170179 uint32_t ciePointer = addressSpace.get32(p);
171180 if (ciePointer == 0)
172181 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,
211220/// Scan an eh_frame section to find an FDE for a pc
212221template <typename A>
213222bool 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,
215224 FDE_Info *fdeInfo, CIE_Info *cieInfo) {
216225 //fprintf(stderr, "findFDE(0x%llX)\n", (long long)pc);
217226 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);
219230 while (p < ehSectionEnd) {
220231 pint_t currentCFI = p;
221232 //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,
227238 p += 8;
228239 }
229240 if (cfiLength == 0)
230 return false; // end marker
241 return false; // zero terminator
231242 uint32_t id = addressSpace.get32(p);
232243 if (id == 0) {
233244 // Skip over CIEs.
......@@ -336,7 +347,8 @@ const char *CFI_Parser<A>::parseCIE(A &addressSpace, pint_t cie,
336347 // parse data alignment factor
337348 cieInfo->dataAlignFactor = (int)addressSpace.getSLEB128(p, cieContentEnd);
338349 // 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);
340352 assert(raReg < 255 && "return address register too large");
341353 cieInfo->returnAddressRegister = (uint8_t)raReg;
342354 // parse augmentation data based on augmentation string
......@@ -390,418 +402,409 @@ bool CFI_Parser<A>::parseFDEInstructions(A &addressSpace,
390402 const FDE_Info &fdeInfo,
391403 const CIE_Info &cieInfo, pint_t upToPC,
392404 int arch, PrologInfo *results) {
393 PrologInfoStackEntry *rememberStack = NULL;
394
395 // parse CIE then FDE instructions
396 bool returnValue =
397 parseInstructions(addressSpace, cieInfo.cieInstructions,
398 cieInfo.cieStart + cieInfo.cieLength, cieInfo,
399 (pint_t)(-1), rememberStack, arch, results) &&
400 parseInstructions(addressSpace, fdeInfo.fdeInstructions,
401 fdeInfo.fdeStart + fdeInfo.fdeLength, cieInfo,
402 upToPC - fdeInfo.pcStart, rememberStack, arch, results);
403
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}
405 // Alloca is used for the allocation of the rememberStack entries. It removes
406 // the dependency on new/malloc but the below for loop can not be refactored
407 // into functions. Entry could be saved during the processing of a CIE and
408 // restored by an FDE.
409 RememberStack rememberStack;
410
411 struct ParseInfo {
412 pint_t instructions;
413 pint_t instructionsEnd;
414 pint_t pcoffset;
415 };
418416
419/// "run" the DWARF instructions
420template <typename A>
421bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
422 pint_t instructionsEnd,
423 const CIE_Info &cieInfo, pint_t pcoffset,
424 PrologInfoStackEntry *&rememberStack,
425 int arch, PrologInfo *results) {
426 pint_t p = instructions;
427 pint_t codeOffset = 0;
428 // initialState initialized as registers in results are modified. Use
429 // PrologInfo accessor functions to avoid reading uninitialized data.
430 PrologInfo initialState(PrologInfo::InitializeTime::kLazy);
431
432 _LIBUNWIND_TRACE_DWARF("parseInstructions(instructions=0x%0" PRIx64 ")\n",
433 static_cast<uint64_t>(instructionsEnd));
434
435 // see DWARF Spec, section 6.4.2 for details on unwind opcodes
436 while ((p < instructionsEnd) && (codeOffset < pcoffset)) {
437 uint64_t reg;
438 uint64_t reg2;
439 int64_t offset;
440 uint64_t length;
441 uint8_t opcode = addressSpace.get8(p);
442 uint8_t operand;
443#if !defined(_LIBUNWIND_NO_HEAP)
444 PrologInfoStackEntry *entry;
445#endif
446 ++p;
447 switch (opcode) {
448 case DW_CFA_nop:
449 _LIBUNWIND_TRACE_DWARF("DW_CFA_nop\n");
450 break;
451 case DW_CFA_set_loc:
452 codeOffset =
453 addressSpace.getEncodedP(p, instructionsEnd, cieInfo.pointerEncoding);
454 _LIBUNWIND_TRACE_DWARF("DW_CFA_set_loc\n");
455 break;
456 case DW_CFA_advance_loc1:
457 codeOffset += (addressSpace.get8(p) * cieInfo.codeAlignFactor);
458 p += 1;
459 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc1: new offset=%" PRIu64 "\n",
460 static_cast<uint64_t>(codeOffset));
461 break;
462 case DW_CFA_advance_loc2:
463 codeOffset += (addressSpace.get16(p) * cieInfo.codeAlignFactor);
464 p += 2;
465 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc2: new offset=%" PRIu64 "\n",
466 static_cast<uint64_t>(codeOffset));
467 break;
468 case DW_CFA_advance_loc4:
469 codeOffset += (addressSpace.get32(p) * cieInfo.codeAlignFactor);
470 p += 4;
471 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc4: new offset=%" PRIu64 "\n",
472 static_cast<uint64_t>(codeOffset));
473 break;
474 case DW_CFA_offset_extended:
475 reg = addressSpace.getULEB128(p, instructionsEnd);
476 offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd)
477 * cieInfo.dataAlignFactor;
478 if (reg > kMaxRegisterNumber) {
479 _LIBUNWIND_LOG0(
480 "malformed DW_CFA_offset_extended DWARF unwind, reg too big");
481 return false;
482 }
483 results->setRegister(reg, kRegisterInCFA, offset, initialState);
484 _LIBUNWIND_TRACE_DWARF("DW_CFA_offset_extended(reg=%" PRIu64 ", "
485 "offset=%" PRId64 ")\n",
486 reg, offset);
487 break;
488 case DW_CFA_restore_extended:
489 reg = addressSpace.getULEB128(p, instructionsEnd);
490 if (reg > kMaxRegisterNumber) {
491 _LIBUNWIND_LOG0(
492 "malformed DW_CFA_restore_extended DWARF unwind, reg too big");
493 return false;
494 }
495 results->restoreRegisterToInitialState(reg, initialState);
496 _LIBUNWIND_TRACE_DWARF("DW_CFA_restore_extended(reg=%" PRIu64 ")\n", reg);
497 break;
498 case DW_CFA_undefined:
499 reg = addressSpace.getULEB128(p, instructionsEnd);
500 if (reg > kMaxRegisterNumber) {
501 _LIBUNWIND_LOG0(
502 "malformed DW_CFA_undefined DWARF unwind, reg too big");
503 return false;
504 }
505 results->setRegisterLocation(reg, kRegisterUnused, initialState);
506 _LIBUNWIND_TRACE_DWARF("DW_CFA_undefined(reg=%" PRIu64 ")\n", reg);
507 break;
508 case DW_CFA_same_value:
509 reg = addressSpace.getULEB128(p, instructionsEnd);
510 if (reg > kMaxRegisterNumber) {
511 _LIBUNWIND_LOG0(
512 "malformed DW_CFA_same_value DWARF unwind, reg too big");
513 return false;
514 }
515 // <rdar://problem/8456377> DW_CFA_same_value unsupported
516 // "same value" means register was stored in frame, but its current
517 // value has not changed, so no need to restore from frame.
518 // We model this as if the register was never saved.
519 results->setRegisterLocation(reg, kRegisterUnused, initialState);
520 // set flag to disable conversion to compact unwind
521 results->sameValueUsed = true;
522 _LIBUNWIND_TRACE_DWARF("DW_CFA_same_value(reg=%" PRIu64 ")\n", reg);
523 break;
524 case DW_CFA_register:
525 reg = addressSpace.getULEB128(p, instructionsEnd);
526 reg2 = addressSpace.getULEB128(p, instructionsEnd);
527 if (reg > kMaxRegisterNumber) {
528 _LIBUNWIND_LOG0(
529 "malformed DW_CFA_register DWARF unwind, reg too big");
530 return false;
531 }
532 if (reg2 > kMaxRegisterNumber) {
533 _LIBUNWIND_LOG0(
534 "malformed DW_CFA_register DWARF unwind, reg2 too big");
535 return false;
536 }
537 results->setRegister(reg, kRegisterInRegister, (int64_t)reg2,
538 initialState);
539 // set flag to disable conversion to compact unwind
540 results->registersInOtherRegisters = true;
541 _LIBUNWIND_TRACE_DWARF(
542 "DW_CFA_register(reg=%" PRIu64 ", reg2=%" PRIu64 ")\n", reg, reg2);
543 break;
544#if !defined(_LIBUNWIND_NO_HEAP)
545 case DW_CFA_remember_state:
546 // avoid operator new, because that would be an upward dependency
547 entry = (PrologInfoStackEntry *)malloc(sizeof(PrologInfoStackEntry));
548 if (entry != NULL) {
549 entry->next = rememberStack;
550 entry->info = *results;
551 rememberStack = entry;
552 } else {
553 return false;
554 }
555 _LIBUNWIND_TRACE_DWARF("DW_CFA_remember_state\n");
556 break;
557 case DW_CFA_restore_state:
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;
417 ParseInfo parseInfoArray[] = {
418 {cieInfo.cieInstructions, cieInfo.cieStart + cieInfo.cieLength,
419 (pint_t)(-1)},
420 {fdeInfo.fdeInstructions, fdeInfo.fdeStart + fdeInfo.fdeLength,
421 upToPC - fdeInfo.pcStart}};
422
423 for (const auto &info : parseInfoArray) {
424 pint_t p = info.instructions;
425 pint_t instructionsEnd = info.instructionsEnd;
426 pint_t pcoffset = info.pcoffset;
427 pint_t codeOffset = 0;
428
429 // initialState initialized as registers in results are modified. Use
430 // PrologInfo accessor functions to avoid reading uninitialized data.
431 PrologInfo initialState(PrologInfo::InitializeTime::kLazy);
432
433 _LIBUNWIND_TRACE_DWARF("parseFDEInstructions(instructions=0x%0" PRIx64
434 ")\n",
435 static_cast<uint64_t>(instructionsEnd));
436
437 // see DWARF Spec, section 6.4.2 for details on unwind opcodes
438 while ((p < instructionsEnd) && (codeOffset < pcoffset)) {
439 uint64_t reg;
440 uint64_t reg2;
441 int64_t offset;
442 uint64_t length;
443 uint8_t opcode = addressSpace.get8(p);
444 uint8_t operand;
445
446 ++p;
447 switch (opcode) {
448 case DW_CFA_nop:
449 _LIBUNWIND_TRACE_DWARF("DW_CFA_nop\n");
450 break;
451 case DW_CFA_set_loc:
452 codeOffset = addressSpace.getEncodedP(p, instructionsEnd,
453 cieInfo.pointerEncoding);
454 _LIBUNWIND_TRACE_DWARF("DW_CFA_set_loc\n");
455 break;
456 case DW_CFA_advance_loc1:
457 codeOffset += (addressSpace.get8(p) * cieInfo.codeAlignFactor);
458 p += 1;
459 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc1: new offset=%" PRIu64 "\n",
460 static_cast<uint64_t>(codeOffset));
461 break;
462 case DW_CFA_advance_loc2:
463 codeOffset += (addressSpace.get16(p) * cieInfo.codeAlignFactor);
464 p += 2;
465 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc2: new offset=%" PRIu64 "\n",
466 static_cast<uint64_t>(codeOffset));
467 break;
468 case DW_CFA_advance_loc4:
469 codeOffset += (addressSpace.get32(p) * cieInfo.codeAlignFactor);
470 p += 4;
471 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc4: new offset=%" PRIu64 "\n",
472 static_cast<uint64_t>(codeOffset));
473 break;
474 case DW_CFA_offset_extended:
475 reg = addressSpace.getULEB128(p, instructionsEnd);
476 offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd) *
477 cieInfo.dataAlignFactor;
478 if (reg > kMaxRegisterNumber) {
479 _LIBUNWIND_LOG0(
480 "malformed DW_CFA_offset_extended DWARF unwind, reg too big");
481 return false;
482 }
483 results->setRegister(reg, kRegisterInCFA, offset, initialState);
484 _LIBUNWIND_TRACE_DWARF("DW_CFA_offset_extended(reg=%" PRIu64 ", "
485 "offset=%" PRId64 ")\n",
486 reg, offset);
487 break;
488 case DW_CFA_restore_extended:
489 reg = addressSpace.getULEB128(p, instructionsEnd);
490 if (reg > kMaxRegisterNumber) {
491 _LIBUNWIND_LOG0(
492 "malformed DW_CFA_restore_extended DWARF unwind, reg too big");
493 return false;
494 }
495 results->restoreRegisterToInitialState(reg, initialState);
496 _LIBUNWIND_TRACE_DWARF("DW_CFA_restore_extended(reg=%" PRIu64 ")\n",
497 reg);
498 break;
499 case DW_CFA_undefined:
500 reg = addressSpace.getULEB128(p, instructionsEnd);
501 if (reg > kMaxRegisterNumber) {
502 _LIBUNWIND_LOG0(
503 "malformed DW_CFA_undefined DWARF unwind, reg too big");
504 return false;
505 }
506 results->setRegisterLocation(reg, kRegisterUndefined, initialState);
507 _LIBUNWIND_TRACE_DWARF("DW_CFA_undefined(reg=%" PRIu64 ")\n", reg);
508 break;
509 case DW_CFA_same_value:
510 reg = addressSpace.getULEB128(p, instructionsEnd);
511 if (reg > kMaxRegisterNumber) {
512 _LIBUNWIND_LOG0(
513 "malformed DW_CFA_same_value DWARF unwind, reg too big");
514 return false;
515 }
516 // <rdar://problem/8456377> DW_CFA_same_value unsupported
517 // "same value" means register was stored in frame, but its current
518 // value has not changed, so no need to restore from frame.
519 // We model this as if the register was never saved.
520 results->setRegisterLocation(reg, kRegisterUnused, initialState);
521 _LIBUNWIND_TRACE_DWARF("DW_CFA_same_value(reg=%" PRIu64 ")\n", reg);
522 break;
523 case DW_CFA_register:
524 reg = addressSpace.getULEB128(p, instructionsEnd);
525 reg2 = addressSpace.getULEB128(p, instructionsEnd);
526 if (reg > kMaxRegisterNumber) {
527 _LIBUNWIND_LOG0(
528 "malformed DW_CFA_register DWARF unwind, reg too big");
529 return false;
530 }
531 if (reg2 > kMaxRegisterNumber) {
532 _LIBUNWIND_LOG0(
533 "malformed DW_CFA_register DWARF unwind, reg2 too big");
534 return false;
535 }
536 results->setRegister(reg, kRegisterInRegister, (int64_t)reg2,
537 initialState);
538 _LIBUNWIND_TRACE_DWARF(
539 "DW_CFA_register(reg=%" PRIu64 ", reg2=%" PRIu64 ")\n", reg, reg2);
540 break;
541 case DW_CFA_remember_state: {
542 // Avoid operator new because that would be an upward dependency.
543 // Avoid malloc because it needs heap allocation.
544 PrologInfoStackEntry *entry =
545 (PrologInfoStackEntry *)_LIBUNWIND_REMEMBER_ALLOC(
546 sizeof(PrologInfoStackEntry));
547 if (entry != NULL) {
548 entry->next = rememberStack.entry;
549 entry->info = *results;
550 rememberStack.entry = entry;
551 } else {
552 return false;
553 }
554 _LIBUNWIND_TRACE_DWARF("DW_CFA_remember_state\n");
555 break;
718556 }
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;
557 case DW_CFA_restore_state:
558 if (rememberStack.entry != NULL) {
559 PrologInfoStackEntry *top = rememberStack.entry;
560 *results = top->info;
561 rememberStack.entry = top->next;
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
726726#if defined(_LIBUNWIND_TARGET_AARCH64) || defined(_LIBUNWIND_TARGET_SPARC)
727 // The same constant is used to represent different instructions on
728 // AArch64 (negate_ra_state) and SPARC (window_save).
729 static_assert(DW_CFA_AARCH64_negate_ra_state == DW_CFA_GNU_window_save,
730 "uses the same constant");
731 case DW_CFA_AARCH64_negate_ra_state:
732 switch (arch) {
727 // The same constant is used to represent different instructions on
728 // AArch64 (negate_ra_state) and SPARC (window_save).
729 static_assert(DW_CFA_AARCH64_negate_ra_state == DW_CFA_GNU_window_save,
730 "uses the same constant");
731 case DW_CFA_AARCH64_negate_ra_state:
732 switch (arch) {
733733#if defined(_LIBUNWIND_TARGET_AARCH64)
734734 case REGISTERS_ARM64: {
735735 int64_t value =
736736 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);
738739 _LIBUNWIND_TRACE_DWARF("DW_CFA_AARCH64_negate_ra_state\n");
739740 } break;
740741#endif
741742
742743#if defined(_LIBUNWIND_TARGET_SPARC)
743 // case DW_CFA_GNU_window_save:
744 case REGISTERS_SPARC:
745 _LIBUNWIND_TRACE_DWARF("DW_CFA_GNU_window_save()\n");
746 for (reg = UNW_SPARC_O0; reg <= UNW_SPARC_O7; reg++) {
747 results->setRegister(reg, kRegisterInRegister,
748 ((int64_t)reg - UNW_SPARC_O0) + UNW_SPARC_I0,
749 initialState);
750 }
744 // case DW_CFA_GNU_window_save:
745 case REGISTERS_SPARC:
746 _LIBUNWIND_TRACE_DWARF("DW_CFA_GNU_window_save()\n");
747 for (reg = UNW_SPARC_O0; reg <= UNW_SPARC_O7; reg++) {
748 results->setRegister(reg, kRegisterInRegister,
749 ((int64_t)reg - UNW_SPARC_O0) + UNW_SPARC_I0,
750 initialState);
751 }
751752
752 for (reg = UNW_SPARC_L0; reg <= UNW_SPARC_I7; reg++) {
753 results->setRegister(reg, kRegisterInCFA,
754 ((int64_t)reg - UNW_SPARC_L0) * 4, initialState);
753 for (reg = UNW_SPARC_L0; reg <= UNW_SPARC_I7; reg++) {
754 results->setRegister(reg, kRegisterInCFA,
755 ((int64_t)reg - UNW_SPARC_L0) * 4,
756 initialState);
757 }
758 break;
759#endif
755760 }
756761 break;
757#endif
758 }
759 break;
760762#else
761 (void)arch;
763 (void)arch;
762764#endif
763765
764 default:
765 operand = opcode & 0x3F;
766 switch (opcode & 0xC0) {
767 case DW_CFA_offset:
768 reg = operand;
769 if (reg > kMaxRegisterNumber) {
770 _LIBUNWIND_LOG("malformed DW_CFA_offset DWARF unwind, reg (%" PRIu64
771 ") out of range",
772 reg);
773 return false;
774 }
775 offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd)
776 * cieInfo.dataAlignFactor;
777 results->setRegister(reg, kRegisterInCFA, offset, initialState);
778 _LIBUNWIND_TRACE_DWARF("DW_CFA_offset(reg=%d, offset=%" PRId64 ")\n",
779 operand, offset);
780 break;
781 case DW_CFA_advance_loc:
782 codeOffset += operand * cieInfo.codeAlignFactor;
783 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc: new offset=%" PRIu64 "\n",
784 static_cast<uint64_t>(codeOffset));
785 break;
786 case DW_CFA_restore:
787 reg = operand;
788 if (reg > kMaxRegisterNumber) {
789 _LIBUNWIND_LOG("malformed DW_CFA_restore DWARF unwind, reg (%" PRIu64
790 ") out of range",
791 reg);
766 default:
767 operand = opcode & 0x3F;
768 switch (opcode & 0xC0) {
769 case DW_CFA_offset:
770 reg = operand;
771 if (reg > kMaxRegisterNumber) {
772 _LIBUNWIND_LOG("malformed DW_CFA_offset DWARF unwind, reg (%" PRIu64
773 ") out of range",
774 reg);
775 return false;
776 }
777 offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd) *
778 cieInfo.dataAlignFactor;
779 results->setRegister(reg, kRegisterInCFA, offset, initialState);
780 _LIBUNWIND_TRACE_DWARF("DW_CFA_offset(reg=%d, offset=%" PRId64 ")\n",
781 operand, offset);
782 break;
783 case DW_CFA_advance_loc:
784 codeOffset += operand * cieInfo.codeAlignFactor;
785 _LIBUNWIND_TRACE_DWARF("DW_CFA_advance_loc: new offset=%" PRIu64 "\n",
786 static_cast<uint64_t>(codeOffset));
787 break;
788 case DW_CFA_restore:
789 reg = operand;
790 if (reg > kMaxRegisterNumber) {
791 _LIBUNWIND_LOG(
792 "malformed DW_CFA_restore DWARF unwind, reg (%" PRIu64
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);
792803 return false;
793804 }
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;
801805 }
802806 }
803807 }
804
805808 return true;
806809}
807810
lib/libunwind/src/FrameHeaderCache.hpp+1-1
......@@ -32,7 +32,7 @@
3232class _LIBUNWIND_HIDDEN FrameHeaderCache {
3333 struct CacheEntry {
3434 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; };
3636 UnwindInfoSections Info;
3737 CacheEntry *Next;
3838 };
lib/libunwind/src/Registers.hpp+453-5
......@@ -36,9 +36,12 @@ enum {
3636 REGISTERS_SPARC,
3737 REGISTERS_HEXAGON,
3838 REGISTERS_RISCV,
39 REGISTERS_VE,
3940};
4041
4142#if defined(_LIBUNWIND_TARGET_I386)
43class _LIBUNWIND_HIDDEN Registers_x86;
44extern "C" void __libunwind_Registers_x86_jumpto(Registers_x86 *);
4245/// Registers_x86 holds the register state of a thread in a 32-bit intel
4346/// process.
4447class _LIBUNWIND_HIDDEN Registers_x86 {
......@@ -56,7 +59,7 @@ public:
5659 v128 getVectorRegister(int num) const;
5760 void setVectorRegister(int num, v128 value);
5861 static const char *getRegisterName(int num);
59 void jumpto();
62 void jumpto() { __libunwind_Registers_x86_jumpto(this); }
6063 static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86; }
6164 static int getArch() { return REGISTERS_X86; }
6265
......@@ -248,6 +251,8 @@ inline void Registers_x86::setVectorRegister(int, v128) {
248251#if defined(_LIBUNWIND_TARGET_X86_64)
249252/// Registers_x86_64 holds the register state of a thread in a 64-bit intel
250253/// process.
254class _LIBUNWIND_HIDDEN Registers_x86_64;
255extern "C" void __libunwind_Registers_x86_64_jumpto(Registers_x86_64 *);
251256class _LIBUNWIND_HIDDEN Registers_x86_64 {
252257public:
253258 Registers_x86_64();
......@@ -263,7 +268,7 @@ public:
263268 v128 getVectorRegister(int num) const;
264269 void setVectorRegister(int num, v128 value);
265270 static const char *getRegisterName(int num);
266 void jumpto();
271 void jumpto() { __libunwind_Registers_x86_64_jumpto(this); }
267272 static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_64; }
268273 static int getArch() { return REGISTERS_X86_64; }
269274
......@@ -1510,12 +1515,12 @@ inline void Registers_ppc64::setFloatRegister(int regNum, double value) {
15101515}
15111516
15121517inline bool Registers_ppc64::validVectorRegister(int regNum) const {
1513#ifdef PPC64_HAS_VMX
1518#if defined(__VSX__)
15141519 if (regNum >= UNW_PPC64_VS0 && regNum <= UNW_PPC64_VS31)
15151520 return true;
15161521 if (regNum >= UNW_PPC64_VS32 && regNum <= UNW_PPC64_VS63)
15171522 return true;
1518#else
1523#elif defined(__ALTIVEC__)
15191524 if (regNum >= UNW_PPC64_V0 && regNum <= UNW_PPC64_V31)
15201525 return true;
15211526#endif
......@@ -1771,6 +1776,8 @@ inline const char *Registers_ppc64::getRegisterName(int regNum) {
17711776#if defined(_LIBUNWIND_TARGET_AARCH64)
17721777/// Registers_arm64 holds the register state of a thread in a 64-bit arm
17731778/// process.
1779class _LIBUNWIND_HIDDEN Registers_arm64;
1780extern "C" void __libunwind_Registers_arm64_jumpto(Registers_arm64 *);
17741781class _LIBUNWIND_HIDDEN Registers_arm64 {
17751782public:
17761783 Registers_arm64();
......@@ -1786,7 +1793,7 @@ public:
17861793 v128 getVectorRegister(int num) const;
17871794 void setVectorRegister(int num, v128 value);
17881795 static const char *getRegisterName(int num);
1789 void jumpto();
1796 void jumpto() { __libunwind_Registers_arm64_jumpto(this); }
17901797 static int lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64; }
17911798 static int getArch() { return REGISTERS_ARM64; }
17921799
......@@ -3977,6 +3984,447 @@ inline void Registers_riscv::setVectorRegister(int, v128) {
39773984 _LIBUNWIND_ABORT("no riscv vector register support yet");
39783985}
39793986#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
39804428} // namespace libunwind
39814429
39824430#endif // __REGISTERS_HPP__
lib/libunwind/src/Unwind-seh.cpp+4-16
......@@ -46,18 +46,6 @@ using namespace libunwind;
4646/// handling.
4747#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
6149static int __unw_init_seh(unw_cursor_t *cursor, CONTEXT *ctx);
6250static DISPATCHER_CONTEXT *__unw_seh_get_disp_ctx(unw_cursor_t *cursor);
6351static 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,
10896 }
10997 } else {
11098 // Foreign exception.
111 exc = (_Unwind_Exception *)malloc(sizeof(_Unwind_Exception));
112 exc->exception_class = kSEHExceptionClass;
113 exc->exception_cleanup = seh_exc_cleanup;
114 memset(exc->private_, 0, sizeof(exc->private_));
99 // We can't interact with them (we don't know the original target frame
100 // that we should pass on to RtlUnwindEx in _Unwind_Resume), so just
101 // pass without calling our destructors here.
102 return ExceptionContinueSearch;
115103 }
116104 if (!ctx) {
117105 __unw_init_seh(&cursor, disp->ContextRecord);
lib/libunwind/src/Unwind-sjlj.c+12
......@@ -32,11 +32,23 @@ struct _Unwind_FunctionContext {
3232 // next function in stack of handlers
3333 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
3546 // set by calling function before registering to be the landing pad
3647 uint32_t resumeLocation;
3748
3849 // set by personality handler to be parameters passed to landing pad function
3950 uint32_t resumeParameters[4];
51#endif
4052
4153 // set by calling function before registering
4254 _Unwind_Personality_Fn personality; // arm offset=24
lib/libunwind/src/UnwindCursor.hpp+156-69
......@@ -81,6 +81,7 @@ template <typename A>
8181class _LIBUNWIND_HIDDEN DwarfFDECache {
8282 typedef typename A::pint_t pint_t;
8383public:
84 static constexpr pint_t kSearchAll = static_cast<pint_t>(-1);
8485 static pint_t findFDE(pint_t mh, pint_t pc);
8586 static void add(pint_t mh, pint_t ip_start, pint_t ip_end, pint_t fde);
8687 static void removeAllIn(pint_t mh);
......@@ -138,7 +139,7 @@ typename A::pint_t DwarfFDECache<A>::findFDE(pint_t mh, pint_t pc) {
138139 pint_t result = 0;
139140 _LIBUNWIND_LOG_IF_FALSE(_lock.lock_shared());
140141 for (entry *p = _buffer; p < _bufferUsed; ++p) {
141 if ((mh == p->mh) || (mh == 0)) {
142 if ((mh == p->mh) || (mh == kSearchAll)) {
142143 if ((p->ip_start <= pc) && (pc < p->ip_end)) {
143144 result = p->fde;
144145 break;
......@@ -530,6 +531,8 @@ UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as)
530531 : _addressSpace(as), _unwindInfoMissing(false) {
531532 static_assert((check_fit<UnwindCursor<A, R>, unw_cursor_t>::does_fit),
532533 "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");
533536 memset(&_info, 0, sizeof(_info));
534537 memset(&_histTable, 0, sizeof(_histTable));
535538 _dispContext.ContextRecord = &_msContext;
......@@ -922,7 +925,29 @@ private:
922925 }
923926#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
925947#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);
926951 bool getInfoFromDwarfSection(pint_t pc, const UnwindInfoSections &sects,
927952 uint32_t fdeSectionOffsetHint=0);
928953 int stepWithDwarfFDE() {
......@@ -1173,6 +1198,9 @@ private:
11731198 unw_proc_info_t _info;
11741199 bool _unwindInfoMissing;
11751200 bool _isSignalFrame;
1201#if defined(_LIBUNWIND_TARGET_LINUX) && defined(_LIBUNWIND_TARGET_AARCH64)
1202 bool _isSigReturn = false;
1203#endif
11761204};
11771205
11781206
......@@ -1182,6 +1210,8 @@ UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as)
11821210 _isSignalFrame(false) {
11831211 static_assert((check_fit<UnwindCursor<A, R>, unw_cursor_t>::does_fit),
11841212 "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");
11851215 memset(&_info, 0, sizeof(_info));
11861216}
11871217
......@@ -1472,6 +1502,32 @@ bool UnwindCursor<A, R>::getInfoFromEHABISection(
14721502#endif
14731503
14741504#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
14751531template <typename A, typename R>
14761532bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,
14771533 const UnwindInfoSections &sects,
......@@ -1483,7 +1539,7 @@ bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,
14831539 // If compact encoding table gave offset into dwarf section, go directly there
14841540 if (fdeSectionOffsetHint != 0) {
14851541 foundFDE = CFI_Parser<A>::findFDE(_addressSpace, pc, sects.dwarf_section,
1486 (uint32_t)sects.dwarf_section_length,
1542 sects.dwarf_section_length,
14871543 sects.dwarf_section + fdeSectionOffsetHint,
14881544 &fdeInfo, &cieInfo);
14891545 }
......@@ -1500,7 +1556,7 @@ bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,
15001556 if (cachedFDE != 0) {
15011557 foundFDE =
15021558 CFI_Parser<A>::findFDE(_addressSpace, pc, sects.dwarf_section,
1503 (uint32_t)sects.dwarf_section_length,
1559 sects.dwarf_section_length,
15041560 cachedFDE, &fdeInfo, &cieInfo);
15051561 foundInCache = foundFDE;
15061562 }
......@@ -1508,25 +1564,11 @@ bool UnwindCursor<A, R>::getInfoFromDwarfSection(pint_t pc,
15081564 if (!foundFDE) {
15091565 // Still not found, do full scan of __eh_frame section.
15101566 foundFDE = CFI_Parser<A>::findFDE(_addressSpace, pc, sects.dwarf_section,
1511 (uint32_t)sects.dwarf_section_length, 0,
1567 sects.dwarf_section_length, 0,
15121568 &fdeInfo, &cieInfo);
15131569 }
15141570 if (foundFDE) {
1515 typename CFI_Parser<A>::PrologInfo prolog;
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
1571 if (getInfoFromFdeCie(fdeInfo, cieInfo, pc, sects.dso_base)) {
15301572 // Add to cache (to make next lookup faster) if we had no hint
15311573 // and there was no index.
15321574 if (!foundInCache && (fdeSectionOffsetHint == 0)) {
......@@ -1759,12 +1801,12 @@ bool UnwindCursor<A, R>::getInfoFromCompactEncodingSection(pint_t pc,
17591801 }
17601802 }
17611803
1762 // extact personality routine, if encoding says function has one
1804 // extract personality routine, if encoding says function has one
17631805 uint32_t personalityIndex = (encoding & UNWIND_PERSONALITY_MASK) >>
17641806 (__builtin_ctz(UNWIND_PERSONALITY_MASK));
17651807 if (personalityIndex != 0) {
17661808 --personalityIndex; // change 1-based to zero-based index
1767 if (personalityIndex > sectionHeader.personalityArrayCount()) {
1809 if (personalityIndex >= sectionHeader.personalityArrayCount()) {
17681810 _LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with personality index %d, "
17691811 "but personality table has only %d entries",
17701812 encoding, personalityIndex,
......@@ -1853,7 +1895,11 @@ bool UnwindCursor<A, R>::getInfoFromSEH(pint_t pc) {
18531895
18541896template <typename A, typename R>
18551897void 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));
18571903#if defined(_LIBUNWIND_ARM_EHABI)
18581904 // Remove the thumb bit so the IP represents the actual instruction address.
18591905 // This matches the behaviour of _Unwind_GetIP on arm.
......@@ -1926,68 +1972,102 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {
19261972#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
19271973 // There is no static unwind info for this pc. Look to see if an FDE was
19281974 // 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);
19301977 if (cachedFDE != 0) {
1931 CFI_Parser<LocalAddressSpace>::FDE_Info fdeInfo;
1932 CFI_Parser<LocalAddressSpace>::CIE_Info cieInfo;
1933 const char *msg = CFI_Parser<A>::decodeFDE(_addressSpace,
1934 cachedFDE, &fdeInfo, &cieInfo);
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;
1978 typename CFI_Parser<A>::FDE_Info fdeInfo;
1979 typename CFI_Parser<A>::CIE_Info cieInfo;
1980 if (!CFI_Parser<A>::decodeFDE(_addressSpace, cachedFDE, &fdeInfo, &cieInfo))
1981 if (getInfoFromFdeCie(fdeInfo, cieInfo, pc, 0))
19521982 return;
1953 }
1954 }
19551983 }
19561984
19571985 // Lastly, ask AddressSpace object about platform specific ways to locate
19581986 // other FDEs.
19591987 pint_t fde;
19601988 if (_addressSpace.findOtherFDE(pc, fde)) {
1961 CFI_Parser<LocalAddressSpace>::FDE_Info fdeInfo;
1962 CFI_Parser<LocalAddressSpace>::CIE_Info cieInfo;
1989 typename CFI_Parser<A>::FDE_Info fdeInfo;
1990 typename CFI_Parser<A>::CIE_Info cieInfo;
19631991 if (!CFI_Parser<A>::decodeFDE(_addressSpace, fde, &fdeInfo, &cieInfo)) {
19641992 // Double check this FDE is for a function that includes the pc.
1965 if ((fdeInfo.pcStart <= pc) && (pc < fdeInfo.pcEnd)) {
1966 typename CFI_Parser<A>::PrologInfo prolog;
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;
1993 if ((fdeInfo.pcStart <= pc) && (pc < fdeInfo.pcEnd))
1994 if (getInfoFromFdeCie(fdeInfo, cieInfo, pc, 0))
19801995 return;
1981 }
1982 }
19831996 }
19841997 }
19851998#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
19872005 // no unwind info, flag that we can't reliably unwind
19882006 _unwindInfoMissing = true;
19892007}
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
19912071template <typename A, typename R>
19922072int UnwindCursor<A, R>::step() {
19932073 // Bottom of stack is defined is when unwind info cannot be found.
......@@ -1996,20 +2076,27 @@ int UnwindCursor<A, R>::step() {
19962076
19972077 // Use unwinding info to modify register set as if function returned.
19982078 int result;
2079#if defined(_LIBUNWIND_TARGET_LINUX) && defined(_LIBUNWIND_TARGET_AARCH64)
2080 if (_isSigReturn) {
2081 result = this->stepThroughSigReturn();
2082 } else
2083#endif
2084 {
19992085#if defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)
2000 result = this->stepWithCompactEncoding();
2086 result = this->stepWithCompactEncoding();
20012087#elif defined(_LIBUNWIND_SUPPORT_SEH_UNWIND)
2002 result = this->stepWithSEHData();
2088 result = this->stepWithSEHData();
20032089#elif defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
2004 result = this->stepWithDwarfFDE();
2090 result = this->stepWithDwarfFDE();
20052091#elif defined(_LIBUNWIND_ARM_EHABI)
2006 result = this->stepWithEHABI();
2092 result = this->stepWithEHABI();
20072093#else
20082094 #error Need _LIBUNWIND_SUPPORT_COMPACT_UNWIND or \
20092095 _LIBUNWIND_SUPPORT_SEH_UNWIND or \
20102096 _LIBUNWIND_SUPPORT_DWARF_UNWIND or \
20112097 _LIBUNWIND_ARM_EHABI
20122098#endif
2099 }
20132100
20142101 // update info based on new PC
20152102 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
3939 __unw_init_local(cursor, uc);
4040
4141 // Walk each frame looking for a place to stop.
42 bool handlerNotFound = true;
43 while (handlerNotFound) {
42 while (true) {
4443 // Ask libunwind to get next frame (skip over first which is
4544 // _Unwind_RaiseException).
4645 int stepResult = __unw_step(cursor);
......@@ -102,7 +101,6 @@ unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except
102101 case _URC_HANDLER_FOUND:
103102 // found a catch clause or locals that need destructing in this frame
104103 // stop search and remember stack pointer at the frame
105 handlerNotFound = false;
106104 __unw_get_reg(cursor, UNW_REG_SP, &sp);
107105 exception_object->private_2 = (uintptr_t)sp;
108106 _LIBUNWIND_TRACE_UNWINDING(
lib/libunwind/src/UnwindRegistersRestore.S+13-12
......@@ -13,14 +13,10 @@
1313#if !defined(__USING_SJLJ_EXCEPTIONS__)
1414
1515#if defined(__i386__)
16DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_x866jumptoEv)
16DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_jumpto)
1717#
18# void libunwind::Registers_x86::jumpto()
18# extern "C" void __libunwind_Registers_x86_jumpto(Registers_x86 *);
1919#
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
2420# On entry:
2521# + +
2622# +-----------------------+
......@@ -30,7 +26,6 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_x866jumptoEv)
3026# +-----------------------+ <-- SP
3127# + +
3228 movl 4(%esp), %eax
33#endif
3429 # set up eax and ret on new stack location
3530 movl 28(%eax), %edx # edx holds new stack pointer
3631 subl $8,%edx
......@@ -60,9 +55,9 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_x866jumptoEv)
6055
6156#elif defined(__x86_64__)
6257
63DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind16Registers_x86_646jumptoEv)
58DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_64_jumpto)
6459#
65# void libunwind::Registers_x86_64::jumpto()
60# extern "C" void __libunwind_Registers_x86_64_jumpto(Registers_x86_64 *);
6661#
6762#if defined(_WIN64)
6863# On entry, thread_state pointer is in rcx; move it into rdi
......@@ -175,7 +170,7 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_ppc646jumptoEv)
175170 PPC64_LR(30)
176171 PPC64_LR(31)
177172
178#ifdef PPC64_HAS_VMX
173#if defined(__VSX__)
179174
180175 // restore VS registers
181176 // (note that this also restores floating point registers and V registers,
......@@ -317,6 +312,7 @@ PPC64_CLVS_BOTTOM(n)
317312 PPC64_LF(30)
318313 PPC64_LF(31)
319314
315#if defined(__ALTIVEC__)
320316 // restore vector registers if any are in use
321317 ld %r5, PPC64_OFFS_VRSAVE(%r3) // test VRsave
322318 cmpwi %r5, 0
......@@ -378,6 +374,7 @@ PPC64_CLV_UNALIGNED_BOTTOM(n)
378374 PPC64_CLV_UNALIGNEDh(31)
379375
380376#endif
377#endif
381378
382379Lnovec:
383380 ld %r0, PPC64_OFFS_CR(%r3)
......@@ -436,6 +433,7 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
436433 lwz %r30,128(%r3)
437434 lwz %r31,132(%r3)
438435
436#ifndef __NO_FPRS__
439437 // restore float registers
440438 lfd %f0, 160(%r3)
441439 lfd %f1, 168(%r3)
......@@ -469,7 +467,9 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
469467 lfd %f29,392(%r3)
470468 lfd %f30,400(%r3)
471469 lfd %f31,408(%r3)
470#endif
472471
472#if defined(__ALTIVEC__)
473473 // restore vector registers if any are in use
474474 lwz %r5, 156(%r3) // test VRsave
475475 cmpwi %r5, 0
......@@ -542,6 +542,7 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
542542 LOAD_VECTOR_UNALIGNEDh(29)
543543 LOAD_VECTOR_UNALIGNEDh(30)
544544 LOAD_VECTOR_UNALIGNEDh(31)
545#endif
545546
546547Lnovec:
547548 lwz %r0, 136(%r3) // __cr
......@@ -560,13 +561,13 @@ Lnovec:
560561#elif defined(__aarch64__)
561562
562563//
563// void libunwind::Registers_arm64::jumpto()
564// extern "C" void __libunwind_Registers_arm64_jumpto(Registers_arm64 *);
564565//
565566// On entry:
566567// thread_state pointer is in x0
567568//
568569 .p2align 2
569DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_arm646jumptoEv)
570DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)
570571 // skip restore of x0,x1 for now
571572 ldp x2, x3, [x0, #0x010]
572573 ldp x4, x5, [x0, #0x020]
lib/libunwind/src/UnwindRegistersSave.S+7-2
......@@ -384,7 +384,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
384384 mfvrsave %r0
385385 std %r0, PPC64_OFFS_VRSAVE(%r3)
386386
387#ifdef PPC64_HAS_VMX
387#if defined(__VSX__)
388388 // save VS registers
389389 // (note that this also saves floating point registers and V registers,
390390 // because part of VS is mapped to these registers)
......@@ -501,6 +501,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
501501 PPC64_STF(30)
502502 PPC64_STF(31)
503503
504#if defined(__ALTIVEC__)
504505 // save vector registers
505506
506507 // Use 16-bytes below the stack pointer as an
......@@ -548,6 +549,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
548549 PPC64_STV_UNALIGNED(30)
549550 PPC64_STV_UNALIGNED(31)
550551
552#endif
551553#endif
552554
553555 li %r3, 0 // return UNW_ESUCCESS
......@@ -608,6 +610,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
608610 mfctr %r0
609611 stw %r0, 148(%r3)
610612
613#if !defined(__NO_FPRS__)
611614 // save float registers
612615 stfd %f0, 160(%r3)
613616 stfd %f1, 168(%r3)
......@@ -641,8 +644,9 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
641644 stfd %f29,392(%r3)
642645 stfd %f30,400(%r3)
643646 stfd %f31,408(%r3)
647#endif
644648
645
649#if defined(__ALTIVEC__)
646650 // save vector registers
647651
648652 subi %r4, %r1, 16
......@@ -692,6 +696,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
692696 SAVE_VECTOR_UNALIGNED(%v29, 424+0x1D0)
693697 SAVE_VECTOR_UNALIGNED(%v30, 424+0x1E0)
694698 SAVE_VECTOR_UNALIGNED(%v31, 424+0x1F0)
699#endif
695700
696701 li %r3, 0 // return UNW_ESUCCESS
697702 blr
lib/libunwind/src/Unwind_AppleExtras.cpp-70
......@@ -8,35 +8,6 @@
88//===----------------------------------------------------------------------===//
99
1010#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
4213// 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)
140111NOT_HERE_BEFORE_5_0(_Unwind_SjLj_Unregister)
141112
142113#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 @@
2525#define PPC64_OFFS_VRSAVE 304
2626#define PPC64_OFFS_FP 312
2727#define PPC64_OFFS_V 824
28#ifdef _ARCH_PWR8
29#define PPC64_HAS_VMX
30#endif
3128#elif defined(__APPLE__) && defined(__aarch64__)
3229#define SEPARATOR %%
3330#else
......@@ -48,6 +45,24 @@
4845#define PPC64_OPD2
4946#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
5166#define GLUE2(a, b) a ## b
5267#define GLUE(a, b) GLUE2(a, b)
5368#define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name)
......@@ -144,7 +159,8 @@
144159 SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \
145160 PPC64_OPD1 \
146161 SYMBOL_NAME(name): \
147 PPC64_OPD2
162 PPC64_OPD2 \
163 AARCH64_BTI
148164
149165#if defined(__arm__)
150166#if !defined(__ARM_ARCH)
lib/libunwind/src/config.h+39-15
......@@ -18,23 +18,15 @@
1818#include <stdint.h>
1919#include <stdlib.h>
2020
21// Define static_assert() unless already defined by compiler.
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
21#include <__libunwind_config.h>
3022
3123// Platform specific configuration defines.
3224#ifdef __APPLE__
3325 #if defined(FOR_DYLD)
34 #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND
26 #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND 1
3527 #else
36 #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND
37 #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1
28 #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND 1
29 #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1
3830 #endif
3931#elif defined(_WIN32)
4032 #ifdef __SEH__
......@@ -42,8 +34,19 @@
4234 #else
4335 #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1
4436 #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
4546#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)
4750 #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1
4851 #define _LIBUNWIND_SUPPORT_DWARF_INDEX 1
4952 #endif
......@@ -91,6 +94,8 @@
9194#error Unsupported target
9295#endif
9396
97// Apple/armv7k defaults to DWARF/Compact unwinding, but its libunwind also
98// needs to include the SJLJ APIs.
9499#if (defined(__APPLE__) && defined(__arm__)) || defined(__USING_SJLJ_EXCEPTIONS__)
95100#define _LIBUNWIND_BUILD_SJLJ_APIS
96101#endif
......@@ -111,8 +116,27 @@
111116#endif
112117#endif
113118
114#if defined(__powerpc64__) && defined(_ARCH_PWR8)
115#define PPC64_HAS_VMX
119#ifndef _LIBUNWIND_REMEMBER_HEAP_ALLOC
120#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
116140#endif
117141
118142#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,
6262# define REGISTER_KIND Registers_sparc
6363#elif defined(__riscv) && __riscv_xlen == 64
6464# define REGISTER_KIND Registers_riscv
65#elif defined(__ve__)
66# define REGISTER_KIND Registers_ve
6567#else
6668# error Architecture not supported
6769#endif
lib/std/dwarf.zig+5-1
......@@ -157,6 +157,7 @@ const LineNumberProgram = struct {
157157 include_dirs: []const []const u8,
158158 file_entries: *ArrayList(FileEntry),
159159
160 prev_valid: bool,
160161 prev_address: usize,
161162 prev_file: usize,
162163 prev_line: i64,
......@@ -175,6 +176,7 @@ const LineNumberProgram = struct {
175176 self.basic_block = false;
176177 self.end_sequence = false;
177178 // Invalidate all the remaining fields
179 self.prev_valid = false;
178180 self.prev_address = 0;
179181 self.prev_file = undefined;
180182 self.prev_line = undefined;
......@@ -197,6 +199,7 @@ const LineNumberProgram = struct {
197199 .file_entries = file_entries,
198200 .default_is_stmt = is_stmt,
199201 .target_address = target_address,
202 .prev_valid = false,
200203 .prev_address = 0,
201204 .prev_file = undefined,
202205 .prev_line = undefined,
......@@ -208,7 +211,7 @@ const LineNumberProgram = struct {
208211 }
209212
210213 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) {
212215 const file_entry = if (self.prev_file == 0) {
213216 return error.MissingDebugInfo;
214217 } else if (self.prev_file - 1 >= self.file_entries.items.len) {
......@@ -228,6 +231,7 @@ const LineNumberProgram = struct {
228231 };
229232 }
230233
234 self.prev_valid = true;
231235 self.prev_address = self.address;
232236 self.prev_file = self.file;
233237 self.prev_line = self.line;
lib/std/target.zig+30-18
......@@ -36,11 +36,11 @@ pub const Target = struct {
3636 openbsd,
3737 solaris,
3838 windows,
39 zos,
3940 haiku,
4041 minix,
4142 rtems,
4243 nacl,
43 cnk,
4444 aix,
4545 cuda,
4646 nvcl,
......@@ -232,11 +232,11 @@ pub const Target = struct {
232232 .kfreebsd,
233233 .lv2,
234234 .solaris,
235 .zos,
235236 .haiku,
236237 .minix,
237238 .rtems,
238239 .nacl,
239 .cnk,
240240 .aix,
241241 .cuda,
242242 .nvcl,
......@@ -391,10 +391,10 @@ pub const Target = struct {
391391 .kfreebsd,
392392 .lv2,
393393 .solaris,
394 .zos,
394395 .minix,
395396 .rtems,
396397 .nacl,
397 .cnk,
398398 .aix,
399399 .cuda,
400400 .nvcl,
......@@ -430,8 +430,8 @@ pub const Target = struct {
430430 pub const powerpc = @import("target/powerpc.zig");
431431 pub const riscv = @import("target/riscv.zig");
432432 pub const sparc = @import("target/sparc.zig");
433 pub const spirv = @import("target/spirv.zig");
434433 pub const systemz = @import("target/systemz.zig");
434 pub const ve = @import("target/ve.zig");
435435 pub const wasm = @import("target/wasm.zig");
436436 pub const x86 = @import("target/x86.zig");
437437
......@@ -443,6 +443,7 @@ pub const Target = struct {
443443 gnueabi,
444444 gnueabihf,
445445 gnux32,
446 gnuilp32,
446447 code16,
447448 eabi,
448449 eabihf,
......@@ -468,10 +469,10 @@ pub const Target = struct {
468469 .dragonfly,
469470 .lv2,
470471 .solaris,
472 .zos,
471473 .minix,
472474 .rtems,
473475 .nacl,
474 .cnk,
475476 .aix,
476477 .cuda,
477478 .nvcl,
......@@ -592,7 +593,7 @@ pub const Target = struct {
592593 pub const Set = struct {
593594 ints: [usize_count]usize,
594595
595 pub const needed_bit_count = 168;
596 pub const needed_bit_count = 172;
596597 pub const byte_count = (needed_bit_count + 7) / 8;
597598 pub const usize_count = (byte_count + (@sizeOf(usize) - 1)) / @sizeOf(usize);
598599 pub const Index = std.math.Log2Int(std.meta.Int(.unsigned, usize_count * @bitSizeOf(usize)));
......@@ -714,6 +715,7 @@ pub const Target = struct {
714715 avr,
715716 bpfel,
716717 bpfeb,
718 csky,
717719 hexagon,
718720 mips,
719721 mipsel,
......@@ -721,6 +723,7 @@ pub const Target = struct {
721723 mips64el,
722724 msp430,
723725 powerpc,
726 powerpcle,
724727 powerpc64,
725728 powerpc64le,
726729 r600,
......@@ -831,7 +834,7 @@ pub const Target = struct {
831834 .le32 => ._NONE,
832835 .mips => ._MIPS,
833836 .mipsel => ._MIPS_RS3_LE,
834 .powerpc => ._PPC,
837 .powerpc, .powerpcle => ._PPC,
835838 .r600 => ._NONE,
836839 .riscv32 => ._RISCV,
837840 .sparc => ._SPARC,
......@@ -870,6 +873,7 @@ pub const Target = struct {
870873 .amdgcn => ._NONE,
871874 .bpfel => ._BPF,
872875 .bpfeb => ._BPF,
876 .csky => ._NONE,
873877 .sparcv9 => ._SPARCV9,
874878 .s390x => ._S390,
875879 .ve => ._NONE,
......@@ -890,7 +894,7 @@ pub const Target = struct {
890894 .le32 => .Unknown,
891895 .mips => .Unknown,
892896 .mipsel => .Unknown,
893 .powerpc => .POWERPC,
897 .powerpc, .powerpcle => .POWERPC,
894898 .r600 => .Unknown,
895899 .riscv32 => .RISCV32,
896900 .sparc => .Unknown,
......@@ -929,6 +933,7 @@ pub const Target = struct {
929933 .amdgcn => .Unknown,
930934 .bpfel => .Unknown,
931935 .bpfeb => .Unknown,
936 .csky => .Unknown,
932937 .sparcv9 => .Unknown,
933938 .s390x => .Unknown,
934939 .ve => .Unknown,
......@@ -948,6 +953,7 @@ pub const Target = struct {
948953 .amdil,
949954 .amdil64,
950955 .bpfel,
956 .csky,
951957 .hexagon,
952958 .hsail,
953959 .hsail64,
......@@ -961,6 +967,7 @@ pub const Target = struct {
961967 .nvptx64,
962968 .sparcel,
963969 .tcele,
970 .powerpcle,
964971 .powerpc64le,
965972 .r600,
966973 .riscv32,
......@@ -1011,11 +1018,13 @@ pub const Target = struct {
10111018 .arc,
10121019 .arm,
10131020 .armeb,
1021 .csky,
10141022 .hexagon,
10151023 .le32,
10161024 .mips,
10171025 .mipsel,
10181026 .powerpc,
1027 .powerpcle,
10191028 .r600,
10201029 .riscv32,
10211030 .sparc,
......@@ -1065,17 +1074,14 @@ pub const Target = struct {
10651074 }
10661075 }
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.
10691078 pub fn genericName(arch: Arch) []const u8 {
10701079 return switch (arch) {
10711080 .arm, .armeb, .thumb, .thumbeb => "arm",
10721081 .aarch64, .aarch64_be, .aarch64_32 => "aarch64",
1073 .avr => "avr",
10741082 .bpfel, .bpfeb => "bpf",
1075 .hexagon => "hexagon",
10761083 .mips, .mipsel, .mips64, .mips64el => "mips",
1077 .msp430 => "msp430",
1078 .powerpc, .powerpc64, .powerpc64le => "powerpc",
1084 .powerpc, .powerpcle, .powerpc64, .powerpc64le => "powerpc",
10791085 .amdgcn => "amdgpu",
10801086 .riscv32, .riscv64 => "riscv",
10811087 .sparc, .sparcv9, .sparcel => "sparc",
......@@ -1098,13 +1104,14 @@ pub const Target = struct {
10981104 .hexagon => &hexagon.all_features,
10991105 .mips, .mipsel, .mips64, .mips64el => &mips.all_features,
11001106 .msp430 => &msp430.all_features,
1101 .powerpc, .powerpc64, .powerpc64le => &powerpc.all_features,
1107 .powerpc, .powerpcle, .powerpc64, .powerpc64le => &powerpc.all_features,
11021108 .amdgcn => &amdgpu.all_features,
11031109 .riscv32, .riscv64 => &riscv.all_features,
11041110 .sparc, .sparcv9, .sparcel => &sparc.all_features,
11051111 .s390x => &systemz.all_features,
11061112 .i386, .x86_64 => &x86.all_features,
11071113 .nvptx, .nvptx64 => &nvptx.all_features,
1114 .ve => &ve.all_features,
11081115 .wasm32, .wasm64 => &wasm.all_features,
11091116
11101117 else => &[0]Cpu.Feature{},
......@@ -1121,13 +1128,14 @@ pub const Target = struct {
11211128 .hexagon => comptime allCpusFromDecls(hexagon.cpu),
11221129 .mips, .mipsel, .mips64, .mips64el => comptime allCpusFromDecls(mips.cpu),
11231130 .msp430 => comptime allCpusFromDecls(msp430.cpu),
1124 .powerpc, .powerpc64, .powerpc64le => comptime allCpusFromDecls(powerpc.cpu),
1131 .powerpc, .powerpcle, .powerpc64, .powerpc64le => comptime allCpusFromDecls(powerpc.cpu),
11251132 .amdgcn => comptime allCpusFromDecls(amdgpu.cpu),
11261133 .riscv32, .riscv64 => comptime allCpusFromDecls(riscv.cpu),
11271134 .sparc, .sparcv9, .sparcel => comptime allCpusFromDecls(sparc.cpu),
11281135 .s390x => comptime allCpusFromDecls(systemz.cpu),
11291136 .i386, .x86_64 => comptime allCpusFromDecls(x86.cpu),
11301137 .nvptx, .nvptx64 => comptime allCpusFromDecls(nvptx.cpu),
1138 .ve => comptime allCpusFromDecls(ve.cpu),
11311139 .wasm32, .wasm64 => comptime allCpusFromDecls(wasm.cpu),
11321140
11331141 else => &[0]*const Model{},
......@@ -1177,17 +1185,19 @@ pub const Target = struct {
11771185 .mips64, .mips64el => &mips.cpu.mips64,
11781186 .msp430 => &msp430.cpu.generic,
11791187 .powerpc => &powerpc.cpu.ppc32,
1188 .powerpcle => &powerpc.cpu.ppc32,
11801189 .powerpc64 => &powerpc.cpu.ppc64,
11811190 .powerpc64le => &powerpc.cpu.ppc64le,
11821191 .amdgcn => &amdgpu.cpu.generic,
11831192 .riscv32 => &riscv.cpu.generic_rv32,
11841193 .riscv64 => &riscv.cpu.generic_rv64,
1185 .sparc, .sparcel => &sparc.cpu.v8,
1194 .sparc, .sparcel => &sparc.cpu.generic,
11861195 .sparcv9 => &sparc.cpu.v9,
11871196 .s390x => &systemz.cpu.generic,
11881197 .i386 => &x86.cpu._i386,
11891198 .x86_64 => &x86.cpu.x86_64,
11901199 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,
1200 .ve => &ve.cpu.generic,
11911201 .wasm32, .wasm64 => &wasm.cpu.generic,
11921202
11931203 else => &S.generic_model,
......@@ -1201,6 +1211,7 @@ pub const Target = struct {
12011211 .riscv64 => &riscv.cpu.baseline_rv64,
12021212 .i386 => &x86.cpu.pentium4,
12031213 .nvptx, .nvptx64 => &nvptx.cpu.sm_20,
1214 .sparc, .sparcel => &sparc.cpu.v8,
12041215
12051216 else => generic(arch),
12061217 };
......@@ -1490,7 +1501,7 @@ pub const Target = struct {
14901501 return print(&result, "/lib{s}/{s}", .{ lib_suffix, loader });
14911502 },
14921503
1493 .powerpc => return copy(&result, "/lib/ld.so.1"),
1504 .powerpc, .powerpcle => return copy(&result, "/lib/ld.so.1"),
14941505 .powerpc64, .powerpc64le => return copy(&result, "/lib64/ld64.so.2"),
14951506 .s390x => return copy(&result, "/lib64/ld64.so.1"),
14961507 .sparcv9 => return copy(&result, "/lib64/ld-linux.so.2"),
......@@ -1519,6 +1530,7 @@ pub const Target = struct {
15191530 // TODO go over each item in this list and either move it to the above list, or
15201531 // implement the standard dynamic linker path code for it.
15211532 .arc,
1533 .csky,
15221534 .hexagon,
15231535 .msp430,
15241536 .r600,
......@@ -1573,10 +1585,10 @@ pub const Target = struct {
15731585 .kfreebsd,
15741586 .lv2,
15751587 .solaris,
1588 .zos,
15761589 .minix,
15771590 .rtems,
15781591 .nacl,
1579 .cnk,
15801592 .aix,
15811593 .cuda,
15821594 .nvcl,
lib/std/target/aarch64.zig+311-147
......@@ -1,14 +1,10 @@
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const CpuModel = std.Target.Cpu.Model;
96
107pub const Feature = enum {
11 a34,
128 a65,
139 a76,
1410 aes,
......@@ -17,8 +13,6 @@ pub const Feature = enum {
1713 altnzcv,
1814 am,
1915 amvs,
20 apple_a10,
21 apple_a11,
2216 apple_a12,
2317 apple_a13,
2418 apple_a7,
......@@ -26,6 +20,7 @@ pub const Feature = enum {
2620 arith_cbz_fusion,
2721 balance_fp_ops,
2822 bf16,
23 brbe,
2924 bti,
3025 call_saved_x10,
3126 call_saved_x11,
......@@ -39,7 +34,11 @@ pub const Feature = enum {
3934 ccdp,
4035 ccidx,
4136 ccpp,
37 cmp_bcc_fusion,
4238 complxnum,
39 contextidr_el2,
40 cortex_a78c,
41 cortex_r82,
4342 crc,
4443 crypto,
4544 custom_cheap_as_move,
......@@ -49,14 +48,14 @@ pub const Feature = enum {
4948 ecv,
5049 ete,
5150 exynos_cheap_as_move,
52 exynosm4,
51 exynos_m4,
5352 f32mm,
5453 f64mm,
5554 fgt,
56 fmi,
55 flagm,
5756 force_32bit_jump_tables,
58 fp_armv8,
5957 fp16fml,
58 fp_armv8,
6059 fptoint,
6160 fullfp16,
6261 fuse_address,
......@@ -67,28 +66,32 @@ pub const Feature = enum {
6766 fuse_literals,
6867 harden_sls_blr,
6968 harden_sls_retbr,
69 hcx,
7070 i8mm,
7171 jsconv,
7272 lor,
73 ls64,
7374 lse,
7475 lsl_fast,
7576 mpam,
7677 mte,
7778 neon,
78 neoversee1,
79 neoversen1,
79 neoverse_e1,
80 neoverse_n1,
81 neoverse_n2,
82 neoverse_v1,
8083 no_neg_immediates,
8184 nv,
82 pa,
85 outline_atomics,
8386 pan,
8487 pan_rwv,
88 pauth,
8589 perfmon,
8690 pmu,
8791 predictable_select_expensive,
8892 predres,
8993 rand,
9094 ras,
91 rasv8_4,
9295 rcpc,
9396 rcpc_immo,
9497 rdm,
......@@ -126,6 +129,7 @@ pub const Feature = enum {
126129 slow_strqro_store,
127130 sm4,
128131 spe,
132 spe_eef,
129133 specrestrict,
130134 ssbs,
131135 strict_align,
......@@ -148,14 +152,18 @@ pub const Feature = enum {
148152 use_experimental_zeroing_pseudos,
149153 use_postra_scheduler,
150154 use_reciprocal_square_root,
151 v8a,
152155 v8_1a,
153156 v8_2a,
154157 v8_3a,
155158 v8_4a,
156159 v8_5a,
157160 v8_6a,
161 v8_7a,
162 v8a,
163 v8r,
158164 vh,
165 wfxt,
166 xs,
159167 zcm,
160168 zcz,
161169 zcz_fp,
......@@ -170,26 +178,16 @@ pub const all_features = blk: {
170178 const len = @typeInfo(Feature).Enum.fields.len;
171179 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
172180 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 };
183181 result[@enumToInt(Feature.a65)] = .{
184182 .llvm_name = "a65",
185183 .description = "Cortex-A65 ARM processors",
186184 .dependencies = featureSet(&[_]Feature{
187185 .crypto,
188186 .dotprod,
189 .fp_armv8,
190187 .fullfp16,
191 .neon,
192 .ras,
188 .fuse_address,
189 .fuse_aes,
190 .fuse_literals,
193191 .rcpc,
194192 .ssbs,
195193 .v8_2a,
......@@ -202,6 +200,7 @@ pub const all_features = blk: {
202200 .crypto,
203201 .dotprod,
204202 .fullfp16,
203 .fuse_aes,
205204 .rcpc,
206205 .ssbs,
207206 .v8_2a,
......@@ -241,49 +240,6 @@ pub const all_features = blk: {
241240 .am,
242241 }),
243242 };
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 };
287243 result[@enumToInt(Feature.apple_a12)] = .{
288244 .llvm_name = "apple-a12",
289245 .description = "Apple A12",
......@@ -293,11 +249,9 @@ pub const all_features = blk: {
293249 .arith_cbz_fusion,
294250 .crypto,
295251 .disable_latency_sched_heuristic,
296 .fp_armv8,
297252 .fullfp16,
298253 .fuse_aes,
299254 .fuse_crypto_eor,
300 .neon,
301255 .perfmon,
302256 .v8_3a,
303257 .zcm,
......@@ -313,12 +267,9 @@ pub const all_features = blk: {
313267 .arith_cbz_fusion,
314268 .crypto,
315269 .disable_latency_sched_heuristic,
316 .fp_armv8,
317270 .fp16fml,
318 .fullfp16,
319271 .fuse_aes,
320272 .fuse_crypto_eor,
321 .neon,
322273 .perfmon,
323274 .sha3,
324275 .v8_4a,
......@@ -335,10 +286,8 @@ pub const all_features = blk: {
335286 .arith_cbz_fusion,
336287 .crypto,
337288 .disable_latency_sched_heuristic,
338 .fp_armv8,
339289 .fuse_aes,
340290 .fuse_crypto_eor,
341 .neon,
342291 .perfmon,
343292 .zcm,
344293 .zcz,
......@@ -365,6 +314,11 @@ pub const all_features = blk: {
365314 .description = "Enable BFloat16 Extension",
366315 .dependencies = featureSet(&[_]Feature{}),
367316 };
317 result[@enumToInt(Feature.brbe)] = .{
318 .llvm_name = "brbe",
319 .description = "Enable Branch Record Buffer Extension",
320 .dependencies = featureSet(&[_]Feature{}),
321 };
368322 result[@enumToInt(Feature.bti)] = .{
369323 .llvm_name = "bti",
370324 .description = "Enable Branch Target Identification",
......@@ -430,6 +384,11 @@ pub const all_features = blk: {
430384 .description = "Enable v8.2 data Cache Clean to Point of Persistence",
431385 .dependencies = featureSet(&[_]Feature{}),
432386 };
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 };
433392 result[@enumToInt(Feature.complxnum)] = .{
434393 .llvm_name = "complxnum",
435394 .description = "Enable v8.3-A Floating-point complex number support",
......@@ -437,6 +396,38 @@ pub const all_features = blk: {
437396 .neon,
438397 }),
439398 };
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 };
440431 result[@enumToInt(Feature.crc)] = .{
441432 .llvm_name = "crc",
442433 .description = "Enable ARMv8 CRC-32 checksum instructions",
......@@ -447,7 +438,6 @@ pub const all_features = blk: {
447438 .description = "Enable cryptographic instructions",
448439 .dependencies = featureSet(&[_]Feature{
449440 .aes,
450 .neon,
451441 .sha2,
452442 }),
453443 };
......@@ -490,7 +480,7 @@ pub const all_features = blk: {
490480 .custom_cheap_as_move,
491481 }),
492482 };
493 result[@enumToInt(Feature.exynosm4)] = .{
483 result[@enumToInt(Feature.exynos_m4)] = .{
494484 .llvm_name = "exynosm4",
495485 .description = "Samsung Exynos-M4 processors",
496486 .dependencies = featureSet(&[_]Feature{
......@@ -532,8 +522,8 @@ pub const all_features = blk: {
532522 .description = "Enable fine grained virtualization traps extension",
533523 .dependencies = featureSet(&[_]Feature{}),
534524 };
535 result[@enumToInt(Feature.fmi)] = .{
536 .llvm_name = "fmi",
525 result[@enumToInt(Feature.flagm)] = .{
526 .llvm_name = "flagm",
537527 .description = "Enable v8.4-A Flag Manipulation Instructions",
538528 .dependencies = featureSet(&[_]Feature{}),
539529 };
......@@ -542,11 +532,6 @@ pub const all_features = blk: {
542532 .description = "Force jump table entries to be 32-bits wide except at MinSize",
543533 .dependencies = featureSet(&[_]Feature{}),
544534 };
545 result[@enumToInt(Feature.fp_armv8)] = .{
546 .llvm_name = "fp-armv8",
547 .description = "Enable ARMv8 FP",
548 .dependencies = featureSet(&[_]Feature{}),
549 };
550535 result[@enumToInt(Feature.fp16fml)] = .{
551536 .llvm_name = "fp16fml",
552537 .description = "Enable FP16 FML instructions",
......@@ -554,6 +539,11 @@ pub const all_features = blk: {
554539 .fullfp16,
555540 }),
556541 };
542 result[@enumToInt(Feature.fp_armv8)] = .{
543 .llvm_name = "fp-armv8",
544 .description = "Enable ARMv8 FP",
545 .dependencies = featureSet(&[_]Feature{}),
546 };
557547 result[@enumToInt(Feature.fptoint)] = .{
558548 .llvm_name = "fptoint",
559549 .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: {
606596 .description = "Harden against straight line speculation across RET and BR instructions",
607597 .dependencies = featureSet(&[_]Feature{}),
608598 };
599 result[@enumToInt(Feature.hcx)] = .{
600 .llvm_name = "hcx",
601 .description = "Enable Armv8.7-A HCRX_EL2 system register",
602 .dependencies = featureSet(&[_]Feature{}),
603 };
609604 result[@enumToInt(Feature.i8mm)] = .{
610605 .llvm_name = "i8mm",
611606 .description = "Enable Matrix Multiply Int8 Extension",
......@@ -623,6 +618,11 @@ pub const all_features = blk: {
623618 .description = "Enables ARM v8.1 Limited Ordering Regions extension",
624619 .dependencies = featureSet(&[_]Feature{}),
625620 };
621 result[@enumToInt(Feature.ls64)] = .{
622 .llvm_name = "ls64",
623 .description = "Enable Armv8.7-A LD64B/ST64B Accelerator Extension",
624 .dependencies = featureSet(&[_]Feature{}),
625 };
626626 result[@enumToInt(Feature.lse)] = .{
627627 .llvm_name = "lse",
628628 .description = "Enable ARMv8.1 Large System Extension (LSE) atomic instructions",
......@@ -650,35 +650,62 @@ pub const all_features = blk: {
650650 .fp_armv8,
651651 }),
652652 };
653 result[@enumToInt(Feature.neoversee1)] = .{
653 result[@enumToInt(Feature.neoverse_e1)] = .{
654654 .llvm_name = "neoversee1",
655655 .description = "Neoverse E1 ARM processors",
656656 .dependencies = featureSet(&[_]Feature{
657657 .crypto,
658658 .dotprod,
659 .fp_armv8,
660659 .fullfp16,
661 .neon,
662660 .rcpc,
663661 .ssbs,
664662 .v8_2a,
665663 }),
666664 };
667 result[@enumToInt(Feature.neoversen1)] = .{
665 result[@enumToInt(Feature.neoverse_n1)] = .{
668666 .llvm_name = "neoversen1",
669667 .description = "Neoverse N1 ARM processors",
670668 .dependencies = featureSet(&[_]Feature{
671669 .crypto,
672670 .dotprod,
673 .fp_armv8,
674671 .fullfp16,
675 .neon,
676672 .rcpc,
677673 .spe,
678674 .ssbs,
679675 .v8_2a,
680676 }),
681677 };
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 };
682709 result[@enumToInt(Feature.no_neg_immediates)] = .{
683710 .llvm_name = "no-neg-immediates",
684711 .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: {
686713 };
687714 result[@enumToInt(Feature.nv)] = .{
688715 .llvm_name = "nv",
689 .description = "Enable v8.4-A Nested Virtualization extension",
716 .description = "Enable v8.4-A Nested Virtualization Enchancement",
690717 .dependencies = featureSet(&[_]Feature{}),
691718 };
692 result[@enumToInt(Feature.pa)] = .{
693 .llvm_name = "pa",
694 .description = "Enable v8.3-A Pointer Authentication extension",
719 result[@enumToInt(Feature.outline_atomics)] = .{
720 .llvm_name = "outline-atomics",
721 .description = "Enable out of line atomics to support LSE instructions",
695722 .dependencies = featureSet(&[_]Feature{}),
696723 };
697724 result[@enumToInt(Feature.pan)] = .{
......@@ -706,6 +733,11 @@ pub const all_features = blk: {
706733 .pan,
707734 }),
708735 };
736 result[@enumToInt(Feature.pauth)] = .{
737 .llvm_name = "pauth",
738 .description = "Enable v8.3-A Pointer Authentication extension",
739 .dependencies = featureSet(&[_]Feature{}),
740 };
709741 result[@enumToInt(Feature.perfmon)] = .{
710742 .llvm_name = "perfmon",
711743 .description = "Enable ARMv8 PMUv3 Performance Monitors extension",
......@@ -736,13 +768,6 @@ pub const all_features = blk: {
736768 .description = "Enable ARMv8 Reliability, Availability and Serviceability Extensions",
737769 .dependencies = featureSet(&[_]Feature{}),
738770 };
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 };
746771 result[@enumToInt(Feature.rcpc)] = .{
747772 .llvm_name = "rcpc",
748773 .description = "Enable support for RCPC extension",
......@@ -906,7 +931,6 @@ pub const all_features = blk: {
906931 .llvm_name = "sha3",
907932 .description = "Enable SHA512 and SHA3 support",
908933 .dependencies = featureSet(&[_]Feature{
909 .neon,
910934 .sha2,
911935 }),
912936 };
......@@ -937,6 +961,11 @@ pub const all_features = blk: {
937961 .description = "Enable Statistical Profiling extension",
938962 .dependencies = featureSet(&[_]Feature{}),
939963 };
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 };
940969 result[@enumToInt(Feature.specrestrict)] = .{
941970 .llvm_name = "specrestrict",
942971 .description = "Enable architectural speculation restriction",
......@@ -955,7 +984,9 @@ pub const all_features = blk: {
955984 result[@enumToInt(Feature.sve)] = .{
956985 .llvm_name = "sve",
957986 .description = "Enable Scalable Vector Extension (SVE) instructions",
958 .dependencies = featureSet(&[_]Feature{}),
987 .dependencies = featureSet(&[_]Feature{
988 .fullfp16,
989 }),
959990 };
960991 result[@enumToInt(Feature.sve2)] = .{
961992 .llvm_name = "sve2",
......@@ -1060,14 +1091,6 @@ pub const all_features = blk: {
10601091 .description = "Use the reciprocal square root approximation",
10611092 .dependencies = featureSet(&[_]Feature{}),
10621093 };
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 };
10711094 result[@enumToInt(Feature.v8_1a)] = .{
10721095 .llvm_name = "v8.1a",
10731096 .description = "Support ARM v8.1a instructions",
......@@ -1077,8 +1100,8 @@ pub const all_features = blk: {
10771100 .lse,
10781101 .pan,
10791102 .rdm,
1080 .vh,
10811103 .v8a,
1104 .vh,
10821105 }),
10831106 };
10841107 result[@enumToInt(Feature.v8_2a)] = .{
......@@ -1099,7 +1122,7 @@ pub const all_features = blk: {
10991122 .ccidx,
11001123 .complxnum,
11011124 .jsconv,
1102 .pa,
1125 .pauth,
11031126 .rcpc,
11041127 .v8_2a,
11051128 }),
......@@ -1111,11 +1134,10 @@ pub const all_features = blk: {
11111134 .am,
11121135 .dit,
11131136 .dotprod,
1114 .fmi,
1137 .flagm,
11151138 .mpam,
11161139 .nv,
11171140 .pmu,
1118 .rasv8_4,
11191141 .rcpc_immo,
11201142 .sel2,
11211143 .tlb_rmi,
......@@ -1150,9 +1172,71 @@ pub const all_features = blk: {
11501172 .v8_5a,
11511173 }),
11521174 };
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 };
11531225 result[@enumToInt(Feature.vh)] = .{
11541226 .llvm_name = "vh",
11551227 .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",
11561240 .dependencies = featureSet(&[_]Feature{}),
11571241 };
11581242 result[@enumToInt(Feature.zcm)] = .{
......@@ -1196,11 +1280,11 @@ pub const cpu = struct {
11961280 .name = "a64fx",
11971281 .llvm_name = "a64fx",
11981282 .features = featureSet(&[_]Feature{
1283 .aggressive_fma,
1284 .arith_bcc_fusion,
11991285 .complxnum,
1200 .fp_armv8,
1201 .fullfp16,
1202 .neon,
12031286 .perfmon,
1287 .predictable_select_expensive,
12041288 .sha2,
12051289 .sve,
12061290 .use_postra_scheduler,
......@@ -1211,14 +1295,39 @@ pub const cpu = struct {
12111295 .name = "apple_a10",
12121296 .llvm_name = "apple-a10",
12131297 .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,
12151313 }),
12161314 };
12171315 pub const apple_a11 = CpuModel{
12181316 .name = "apple_a11",
12191317 .llvm_name = "apple-a11",
12201318 .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,
12221331 }),
12231332 };
12241333 pub const apple_a12 = CpuModel{
......@@ -1235,6 +1344,37 @@ pub const cpu = struct {
12351344 .apple_a13,
12361345 }),
12371346 };
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 };
12381378 pub const apple_a7 = CpuModel{
12391379 .name = "apple_a7",
12401380 .llvm_name = "apple-a7",
......@@ -1283,7 +1423,6 @@ pub const cpu = struct {
12831423 .features = featureSet(&[_]Feature{
12841424 .crypto,
12851425 .fullfp16,
1286 .neon,
12871426 .v8_2a,
12881427 }),
12891428 };
......@@ -1291,14 +1430,20 @@ pub const cpu = struct {
12911430 .name = "cortex_a34",
12921431 .llvm_name = "cortex-a34",
12931432 .features = featureSet(&[_]Feature{
1294 .a34,
1433 .crc,
1434 .crypto,
1435 .perfmon,
1436 .v8a,
12951437 }),
12961438 };
12971439 pub const cortex_a35 = CpuModel{
12981440 .name = "cortex_a35",
12991441 .llvm_name = "cortex-a35",
13001442 .features = featureSet(&[_]Feature{
1301 .a34,
1443 .crc,
1444 .crypto,
1445 .perfmon,
1446 .v8a,
13021447 }),
13031448 };
13041449 pub const cortex_a53 = CpuModel{
......@@ -1366,6 +1511,7 @@ pub const cpu = struct {
13661511 .crc,
13671512 .crypto,
13681513 .fuse_aes,
1514 .fuse_literals,
13691515 .perfmon,
13701516 .v8a,
13711517 }),
......@@ -1412,11 +1558,11 @@ pub const cpu = struct {
14121558 .name = "cortex_a77",
14131559 .llvm_name = "cortex-a77",
14141560 .features = featureSet(&[_]Feature{
1561 .cmp_bcc_fusion,
14151562 .crypto,
14161563 .dotprod,
1417 .fp_armv8,
14181564 .fullfp16,
1419 .neon,
1565 .fuse_aes,
14201566 .rcpc,
14211567 .v8_2a,
14221568 }),
......@@ -1425,12 +1571,11 @@ pub const cpu = struct {
14251571 .name = "cortex_a78",
14261572 .llvm_name = "cortex-a78",
14271573 .features = featureSet(&[_]Feature{
1574 .cmp_bcc_fusion,
14281575 .crypto,
14291576 .dotprod,
1430 .fp_armv8,
14311577 .fullfp16,
14321578 .fuse_aes,
1433 .neon,
14341579 .perfmon,
14351580 .rcpc,
14361581 .spe,
......@@ -1439,16 +1584,29 @@ pub const cpu = struct {
14391584 .v8_2a,
14401585 }),
14411586 };
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 };
14421601 pub const cortex_x1 = CpuModel{
14431602 .name = "cortex_x1",
14441603 .llvm_name = "cortex-x1",
14451604 .features = featureSet(&[_]Feature{
1605 .cmp_bcc_fusion,
14461606 .crypto,
14471607 .dotprod,
1448 .fp_armv8,
14491608 .fullfp16,
14501609 .fuse_aes,
1451 .neon,
14521610 .perfmon,
14531611 .rcpc,
14541612 .spe,
......@@ -1522,14 +1680,14 @@ pub const cpu = struct {
15221680 .name = "exynos_m4",
15231681 .llvm_name = "exynos-m4",
15241682 .features = featureSet(&[_]Feature{
1525 .exynosm4,
1683 .exynos_m4,
15261684 }),
15271685 };
15281686 pub const exynos_m5 = CpuModel{
15291687 .name = "exynos_m5",
15301688 .llvm_name = "exynos-m5",
15311689 .features = featureSet(&[_]Feature{
1532 .exynosm4,
1690 .exynos_m4,
15331691 }),
15341692 };
15351693 pub const falkor = CpuModel{
......@@ -1555,9 +1713,9 @@ pub const cpu = struct {
15551713 .features = featureSet(&[_]Feature{
15561714 .ete,
15571715 .fuse_aes,
1716 .neon,
15581717 .perfmon,
15591718 .use_postra_scheduler,
1560 .v8a,
15611719 }),
15621720 };
15631721 pub const kryo = CpuModel{
......@@ -1571,22 +1729,36 @@ pub const cpu = struct {
15711729 .perfmon,
15721730 .predictable_select_expensive,
15731731 .use_postra_scheduler,
1574 .zcz,
15751732 .v8a,
1733 .zcz,
15761734 }),
15771735 };
15781736 pub const neoverse_e1 = CpuModel{
15791737 .name = "neoverse_e1",
15801738 .llvm_name = "neoverse-e1",
15811739 .features = featureSet(&[_]Feature{
1582 .neoversee1,
1740 .neoverse_e1,
15831741 }),
15841742 };
15851743 pub const neoverse_n1 = CpuModel{
15861744 .name = "neoverse_n1",
15871745 .llvm_name = "neoverse-n1",
15881746 .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,
15901762 }),
15911763 };
15921764 pub const saphira = CpuModel{
......@@ -1622,9 +1794,7 @@ pub const cpu = struct {
16221794 .features = featureSet(&[_]Feature{
16231795 .aggressive_fma,
16241796 .arith_bcc_fusion,
1625 .crc,
16261797 .crypto,
1627 .lse,
16281798 .predictable_select_expensive,
16291799 .use_postra_scheduler,
16301800 .v8_1a,
......@@ -1637,12 +1807,7 @@ pub const cpu = struct {
16371807 .aggressive_fma,
16381808 .arith_bcc_fusion,
16391809 .balance_fp_ops,
1640 .crc,
16411810 .crypto,
1642 .fp_armv8,
1643 .lse,
1644 .neon,
1645 .pa,
16461811 .perfmon,
16471812 .predictable_select_expensive,
16481813 .strict_align,
......@@ -1695,7 +1860,6 @@ pub const cpu = struct {
16951860 .custom_cheap_as_move,
16961861 .dotprod,
16971862 .fp16fml,
1698 .fullfp16,
16991863 .fuse_aes,
17001864 .perfmon,
17011865 .spe,
lib/std/target/amdgpu.zig+174-138
......@@ -1,22 +1,17 @@
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const CpuModel = std.Target.Cpu.Model;
96
107pub const Feature = enum {
118 @"16_bit_insts",
12 DumpCode,
139 a16,
1410 add_no_carry_insts,
1511 aperture_regs,
1612 atomic_fadd_insts,
1713 auto_waitcnt_before_barrier,
1814 ci_insts,
19 code_object_v3,
2015 cumode,
2116 dl_insts,
2217 dot1_insts,
......@@ -28,7 +23,6 @@ pub const Feature = enum {
2823 dpp,
2924 dpp8,
3025 ds_src2_insts,
31 dumpcode,
3226 enable_ds128,
3327 enable_prt_strict_null,
3428 fast_denormal_f32,
......@@ -47,13 +41,15 @@ pub const Feature = enum {
4741 get_wave_id_inst,
4842 gfx10,
4943 gfx10_3_insts,
50 gfx10_insts,
5144 gfx10_b_encoding,
45 gfx10_insts,
5246 gfx7_gfx8_gfx9_insts,
5347 gfx8_insts,
5448 gfx9,
5549 gfx9_insts,
5650 half_rate_64_ops,
51 image_gather4_d16_bug,
52 image_store_d16_bug,
5753 inst_fwd_prefetch_bug,
5854 int_clamp_insts,
5955 inv_2pi_inline_imm,
......@@ -76,8 +72,6 @@ pub const Feature = enum {
7672 movrel,
7773 no_data_dep_hazard,
7874 no_sdst_cmpx,
79 no_sram_ecc_support,
80 no_xnack_support,
8175 nsa_encoding,
8276 nsa_to_vmem_bug,
8377 offset_3f_bug,
......@@ -101,10 +95,13 @@ pub const Feature = enum {
10195 si_scheduler,
10296 smem_to_vector_write_hazard,
10397 southern_islands,
104 sram_ecc,
98 sramecc,
99 sramecc_support,
105100 trap_handler,
106101 trig_reduced_range,
102 unaligned_access_mode,
107103 unaligned_buffer_access,
104 unaligned_ds_access,
108105 unaligned_scratch_access,
109106 unpacked_d16_vmem,
110107 unsafe_ds_offset_folding,
......@@ -120,6 +117,7 @@ pub const Feature = enum {
120117 wavefrontsize32,
121118 wavefrontsize64,
122119 xnack,
120 xnack_support,
123121};
124122
125123pub usingnamespace CpuFeature.feature_set_fns(Feature);
......@@ -133,11 +131,6 @@ pub const all_features = blk: {
133131 .description = "Has i16/f16 instructions",
134132 .dependencies = featureSet(&[_]Feature{}),
135133 };
136 result[@enumToInt(Feature.DumpCode)] = .{
137 .llvm_name = "DumpCode",
138 .description = "Dump MachineInstrs in the CodeEmitter",
139 .dependencies = featureSet(&[_]Feature{}),
140 };
141134 result[@enumToInt(Feature.a16)] = .{
142135 .llvm_name = "a16",
143136 .description = "Support gfx10-style A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands",
......@@ -170,11 +163,6 @@ pub const all_features = blk: {
170163 .description = "Additional instructions for CI+",
171164 .dependencies = featureSet(&[_]Feature{}),
172165 };
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 };
178166 result[@enumToInt(Feature.cumode)] = .{
179167 .llvm_name = "cumode",
180168 .description = "Enable CU wavefront execution mode",
......@@ -230,14 +218,9 @@ pub const all_features = blk: {
230218 .description = "Has ds_*_src2 instructions",
231219 .dependencies = featureSet(&[_]Feature{}),
232220 };
233 result[@enumToInt(Feature.dumpcode)] = .{
234 .llvm_name = "dumpcode",
235 .description = "Dump MachineInstrs in the CodeEmitter",
236 .dependencies = featureSet(&[_]Feature{}),
237 };
238221 result[@enumToInt(Feature.enable_ds128)] = .{
239222 .llvm_name = "enable-ds128",
240 .description = "Use ds_read|write_b128",
223 .description = "Use ds_{read|write}_b128",
241224 .dependencies = featureSet(&[_]Feature{}),
242225 };
243226 result[@enumToInt(Feature.enable_prt_strict_null)] = .{
......@@ -345,7 +328,6 @@ pub const all_features = blk: {
345328 .movrel,
346329 .no_data_dep_hazard,
347330 .no_sdst_cmpx,
348 .no_sram_ecc_support,
349331 .pk_fmac_f16_inst,
350332 .register_banking,
351333 .s_memrealtime,
......@@ -353,6 +335,8 @@ pub const all_features = blk: {
353335 .sdwa_omod,
354336 .sdwa_scalar,
355337 .sdwa_sdst,
338 .unaligned_buffer_access,
339 .unaligned_ds_access,
356340 .vop3_literal,
357341 .vop3p,
358342 .vscnt,
......@@ -363,16 +347,16 @@ pub const all_features = blk: {
363347 .description = "Additional instructions for GFX10.3",
364348 .dependencies = featureSet(&[_]Feature{}),
365349 };
366 result[@enumToInt(Feature.gfx10_insts)] = .{
367 .llvm_name = "gfx10-insts",
368 .description = "Additional instructions for GFX10+",
369 .dependencies = featureSet(&[_]Feature{}),
370 };
371350 result[@enumToInt(Feature.gfx10_b_encoding)] = .{
372351 .llvm_name = "gfx10_b-encoding",
373352 .description = "Encoding format GFX10_B",
374353 .dependencies = featureSet(&[_]Feature{}),
375354 };
355 result[@enumToInt(Feature.gfx10_insts)] = .{
356 .llvm_name = "gfx10-insts",
357 .description = "Additional instructions for GFX10+",
358 .dependencies = featureSet(&[_]Feature{}),
359 };
376360 result[@enumToInt(Feature.gfx7_gfx8_gfx9_insts)] = .{
377361 .llvm_name = "gfx7-gfx8-gfx9-insts",
378362 .description = "Instructions shared in GFX7, GFX8, GFX9",
......@@ -418,9 +402,12 @@ pub const all_features = blk: {
418402 .sdwa_omod,
419403 .sdwa_scalar,
420404 .sdwa_sdst,
405 .unaligned_buffer_access,
406 .unaligned_ds_access,
421407 .vgpr_index_mode,
422408 .vop3p,
423409 .wavefrontsize64,
410 .xnack_support,
424411 }),
425412 };
426413 result[@enumToInt(Feature.gfx9_insts)] = .{
......@@ -433,6 +420,16 @@ pub const all_features = blk: {
433420 .description = "Most fp64 instructions are half rate instead of quarter",
434421 .dependencies = featureSet(&[_]Feature{}),
435422 };
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 };
436433 result[@enumToInt(Feature.inst_fwd_prefetch_bug)] = .{
437434 .llvm_name = "inst-fwd-prefetch-bug",
438435 .description = "S_INST_PREFETCH instruction causes shader to hang",
......@@ -455,7 +452,7 @@ pub const all_features = blk: {
455452 };
456453 result[@enumToInt(Feature.lds_misaligned_bug)] = .{
457454 .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",
459456 .dependencies = featureSet(&[_]Feature{}),
460457 };
461458 result[@enumToInt(Feature.ldsbankcount16)] = .{
......@@ -543,16 +540,6 @@ pub const all_features = blk: {
543540 .description = "V_CMPX does not write VCC/SGPR in addition to EXEC",
544541 .dependencies = featureSet(&[_]Feature{}),
545542 };
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 };
556543 result[@enumToInt(Feature.nsa_encoding)] = .{
557544 .llvm_name = "nsa-encoding",
558545 .description = "Support NSA encoding for image instructions",
......@@ -656,9 +643,9 @@ pub const all_features = blk: {
656643 .mad_mac_f32_insts,
657644 .mimg_r128,
658645 .movrel,
659 .no_sram_ecc_support,
660646 .s_memtime_inst,
661647 .trig_reduced_range,
648 .unaligned_buffer_access,
662649 .wavefrontsize64,
663650 }),
664651 };
......@@ -688,16 +675,19 @@ pub const all_features = blk: {
688675 .mad_mac_f32_insts,
689676 .mimg_r128,
690677 .movrel,
691 .no_sram_ecc_support,
692 .no_xnack_support,
693678 .s_memtime_inst,
694679 .trig_reduced_range,
695680 .wavefrontsize64,
696681 }),
697682 };
698 result[@enumToInt(Feature.sram_ecc)] = .{
699 .llvm_name = "sram-ecc",
700 .description = "Enable SRAM ECC",
683 result[@enumToInt(Feature.sramecc)] = .{
684 .llvm_name = "sramecc",
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",
701691 .dependencies = featureSet(&[_]Feature{}),
702692 };
703693 result[@enumToInt(Feature.trap_handler)] = .{
......@@ -710,9 +700,19 @@ pub const all_features = blk: {
710700 .description = "Requires use of fract on arguments to trig instructions",
711701 .dependencies = featureSet(&[_]Feature{}),
712702 };
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 };
713708 result[@enumToInt(Feature.unaligned_buffer_access)] = .{
714709 .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",
716716 .dependencies = featureSet(&[_]Feature{}),
717717 };
718718 result[@enumToInt(Feature.unaligned_scratch_access)] = .{
......@@ -770,7 +770,6 @@ pub const all_features = blk: {
770770 .mad_mac_f32_insts,
771771 .mimg_r128,
772772 .movrel,
773 .no_sram_ecc_support,
774773 .s_memrealtime,
775774 .s_memtime_inst,
776775 .scalar_stores,
......@@ -778,6 +777,7 @@ pub const all_features = blk: {
778777 .sdwa_mav,
779778 .sdwa_out_mods_vopc,
780779 .trig_reduced_range,
780 .unaligned_buffer_access,
781781 .vgpr_index_mode,
782782 .wavefrontsize64,
783783 }),
......@@ -817,6 +817,11 @@ pub const all_features = blk: {
817817 .description = "Enable XNACK support",
818818 .dependencies = featureSet(&[_]Feature{}),
819819 };
820 result[@enumToInt(Feature.xnack_support)] = .{
821 .llvm_name = "xnack-support",
822 .description = "Hardware supports XNACK",
823 .dependencies = featureSet(&[_]Feature{}),
824 };
820825 const ti = @typeInfo(Feature);
821826 for (result) |*elem, i| {
822827 elem.index = i;
......@@ -830,9 +835,7 @@ pub const cpu = struct {
830835 .name = "bonaire",
831836 .llvm_name = "bonaire",
832837 .features = featureSet(&[_]Feature{
833 .code_object_v3,
834838 .ldsbankcount32,
835 .no_xnack_support,
836839 .sea_islands,
837840 }),
838841 };
......@@ -840,22 +843,19 @@ pub const cpu = struct {
840843 .name = "carrizo",
841844 .llvm_name = "carrizo",
842845 .features = featureSet(&[_]Feature{
843 .code_object_v3,
844846 .fast_fmaf,
845847 .half_rate_64_ops,
846848 .ldsbankcount32,
847849 .unpacked_d16_vmem,
848850 .volcanic_islands,
849 .xnack,
851 .xnack_support,
850852 }),
851853 };
852854 pub const fiji = CpuModel{
853855 .name = "fiji",
854856 .llvm_name = "fiji",
855857 .features = featureSet(&[_]Feature{
856 .code_object_v3,
857858 .ldsbankcount32,
858 .no_xnack_support,
859859 .unpacked_d16_vmem,
860860 .volcanic_islands,
861861 }),
......@@ -879,7 +879,6 @@ pub const cpu = struct {
879879 .name = "gfx1010",
880880 .llvm_name = "gfx1010",
881881 .features = featureSet(&[_]Feature{
882 .code_object_v3,
883882 .dl_insts,
884883 .ds_src2_insts,
885884 .flat_segment_offset_bug,
......@@ -890,7 +889,6 @@ pub const cpu = struct {
890889 .lds_misaligned_bug,
891890 .ldsbankcount32,
892891 .mad_mac_f32_insts,
893 .no_xnack_support,
894892 .nsa_encoding,
895893 .nsa_to_vmem_bug,
896894 .offset_3f_bug,
......@@ -903,13 +901,13 @@ pub const cpu = struct {
903901 .vcmpx_permlane_hazard,
904902 .vmem_to_scalar_write_hazard,
905903 .wavefrontsize32,
904 .xnack_support,
906905 }),
907906 };
908907 pub const gfx1011 = CpuModel{
909908 .name = "gfx1011",
910909 .llvm_name = "gfx1011",
911910 .features = featureSet(&[_]Feature{
912 .code_object_v3,
913911 .dl_insts,
914912 .dot1_insts,
915913 .dot2_insts,
......@@ -921,9 +919,9 @@ pub const cpu = struct {
921919 .gfx10,
922920 .inst_fwd_prefetch_bug,
923921 .lds_branch_vmem_war_hazard,
922 .lds_misaligned_bug,
924923 .ldsbankcount32,
925924 .mad_mac_f32_insts,
926 .no_xnack_support,
927925 .nsa_encoding,
928926 .nsa_to_vmem_bug,
929927 .offset_3f_bug,
......@@ -936,13 +934,13 @@ pub const cpu = struct {
936934 .vcmpx_permlane_hazard,
937935 .vmem_to_scalar_write_hazard,
938936 .wavefrontsize32,
937 .xnack_support,
939938 }),
940939 };
941940 pub const gfx1012 = CpuModel{
942941 .name = "gfx1012",
943942 .llvm_name = "gfx1012",
944943 .features = featureSet(&[_]Feature{
945 .code_object_v3,
946944 .dl_insts,
947945 .dot1_insts,
948946 .dot2_insts,
......@@ -957,7 +955,6 @@ pub const cpu = struct {
957955 .lds_misaligned_bug,
958956 .ldsbankcount32,
959957 .mad_mac_f32_insts,
960 .no_xnack_support,
961958 .nsa_encoding,
962959 .nsa_to_vmem_bug,
963960 .offset_3f_bug,
......@@ -970,13 +967,13 @@ pub const cpu = struct {
970967 .vcmpx_permlane_hazard,
971968 .vmem_to_scalar_write_hazard,
972969 .wavefrontsize32,
970 .xnack_support,
973971 }),
974972 };
975973 pub const gfx1030 = CpuModel{
976974 .name = "gfx1030",
977975 .llvm_name = "gfx1030",
978976 .features = featureSet(&[_]Feature{
979 .code_object_v3,
980977 .dl_insts,
981978 .dot1_insts,
982979 .dot2_insts,
......@@ -986,7 +983,57 @@ pub const cpu = struct {
986983 .gfx10_3_insts,
987984 .gfx10_b_encoding,
988985 .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,
9901037 .nsa_encoding,
9911038 .wavefrontsize32,
9921039 }),
......@@ -995,11 +1042,8 @@ pub const cpu = struct {
9951042 .name = "gfx600",
9961043 .llvm_name = "gfx600",
9971044 .features = featureSet(&[_]Feature{
998 .code_object_v3,
9991045 .fast_fmaf,
10001046 .half_rate_64_ops,
1001 .ldsbankcount32,
1002 .no_xnack_support,
10031047 .southern_islands,
10041048 }),
10051049 };
......@@ -1007,9 +1051,13 @@ pub const cpu = struct {
10071051 .name = "gfx601",
10081052 .llvm_name = "gfx601",
10091053 .features = featureSet(&[_]Feature{
1010 .code_object_v3,
1011 .ldsbankcount32,
1012 .no_xnack_support,
1054 .southern_islands,
1055 }),
1056 };
1057 pub const gfx602 = CpuModel{
1058 .name = "gfx602",
1059 .llvm_name = "gfx602",
1060 .features = featureSet(&[_]Feature{
10131061 .southern_islands,
10141062 }),
10151063 };
......@@ -1017,9 +1065,7 @@ pub const cpu = struct {
10171065 .name = "gfx700",
10181066 .llvm_name = "gfx700",
10191067 .features = featureSet(&[_]Feature{
1020 .code_object_v3,
10211068 .ldsbankcount32,
1022 .no_xnack_support,
10231069 .sea_islands,
10241070 }),
10251071 };
......@@ -1027,11 +1073,9 @@ pub const cpu = struct {
10271073 .name = "gfx701",
10281074 .llvm_name = "gfx701",
10291075 .features = featureSet(&[_]Feature{
1030 .code_object_v3,
10311076 .fast_fmaf,
10321077 .half_rate_64_ops,
10331078 .ldsbankcount32,
1034 .no_xnack_support,
10351079 .sea_islands,
10361080 }),
10371081 };
......@@ -1039,10 +1083,8 @@ pub const cpu = struct {
10391083 .name = "gfx702",
10401084 .llvm_name = "gfx702",
10411085 .features = featureSet(&[_]Feature{
1042 .code_object_v3,
10431086 .fast_fmaf,
10441087 .ldsbankcount16,
1045 .no_xnack_support,
10461088 .sea_islands,
10471089 }),
10481090 };
......@@ -1050,9 +1092,7 @@ pub const cpu = struct {
10501092 .name = "gfx703",
10511093 .llvm_name = "gfx703",
10521094 .features = featureSet(&[_]Feature{
1053 .code_object_v3,
10541095 .ldsbankcount16,
1055 .no_xnack_support,
10561096 .sea_islands,
10571097 }),
10581098 };
......@@ -1060,9 +1100,15 @@ pub const cpu = struct {
10601100 .name = "gfx704",
10611101 .llvm_name = "gfx704",
10621102 .features = featureSet(&[_]Feature{
1063 .code_object_v3,
10641103 .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,
10661112 .sea_islands,
10671113 }),
10681114 };
......@@ -1070,22 +1116,19 @@ pub const cpu = struct {
10701116 .name = "gfx801",
10711117 .llvm_name = "gfx801",
10721118 .features = featureSet(&[_]Feature{
1073 .code_object_v3,
10741119 .fast_fmaf,
10751120 .half_rate_64_ops,
10761121 .ldsbankcount32,
10771122 .unpacked_d16_vmem,
10781123 .volcanic_islands,
1079 .xnack,
1124 .xnack_support,
10801125 }),
10811126 };
10821127 pub const gfx802 = CpuModel{
10831128 .name = "gfx802",
10841129 .llvm_name = "gfx802",
10851130 .features = featureSet(&[_]Feature{
1086 .code_object_v3,
10871131 .ldsbankcount32,
1088 .no_xnack_support,
10891132 .sgpr_init_bug,
10901133 .unpacked_d16_vmem,
10911134 .volcanic_islands,
......@@ -1095,9 +1138,17 @@ pub const cpu = struct {
10951138 .name = "gfx803",
10961139 .llvm_name = "gfx803",
10971140 .features = featureSet(&[_]Feature{
1098 .code_object_v3,
10991141 .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,
11011152 .unpacked_d16_vmem,
11021153 .volcanic_islands,
11031154 }),
......@@ -1106,61 +1157,56 @@ pub const cpu = struct {
11061157 .name = "gfx810",
11071158 .llvm_name = "gfx810",
11081159 .features = featureSet(&[_]Feature{
1109 .code_object_v3,
1160 .image_gather4_d16_bug,
1161 .image_store_d16_bug,
11101162 .ldsbankcount16,
11111163 .volcanic_islands,
1112 .xnack,
1164 .xnack_support,
11131165 }),
11141166 };
11151167 pub const gfx900 = CpuModel{
11161168 .name = "gfx900",
11171169 .llvm_name = "gfx900",
11181170 .features = featureSet(&[_]Feature{
1119 .code_object_v3,
11201171 .gfx9,
1172 .image_gather4_d16_bug,
11211173 .ldsbankcount32,
11221174 .mad_mix_insts,
1123 .no_sram_ecc_support,
1124 .no_xnack_support,
11251175 }),
11261176 };
11271177 pub const gfx902 = CpuModel{
11281178 .name = "gfx902",
11291179 .llvm_name = "gfx902",
11301180 .features = featureSet(&[_]Feature{
1131 .code_object_v3,
11321181 .gfx9,
1182 .image_gather4_d16_bug,
11331183 .ldsbankcount32,
11341184 .mad_mix_insts,
1135 .no_sram_ecc_support,
1136 .xnack,
11371185 }),
11381186 };
11391187 pub const gfx904 = CpuModel{
11401188 .name = "gfx904",
11411189 .llvm_name = "gfx904",
11421190 .features = featureSet(&[_]Feature{
1143 .code_object_v3,
11441191 .fma_mix_insts,
11451192 .gfx9,
1193 .image_gather4_d16_bug,
11461194 .ldsbankcount32,
1147 .no_sram_ecc_support,
1148 .no_xnack_support,
11491195 }),
11501196 };
11511197 pub const gfx906 = CpuModel{
11521198 .name = "gfx906",
11531199 .llvm_name = "gfx906",
11541200 .features = featureSet(&[_]Feature{
1155 .code_object_v3,
11561201 .dl_insts,
11571202 .dot1_insts,
11581203 .dot2_insts,
11591204 .fma_mix_insts,
11601205 .gfx9,
11611206 .half_rate_64_ops,
1207 .image_gather4_d16_bug,
11621208 .ldsbankcount32,
1163 .no_xnack_support,
1209 .sramecc_support,
11641210 }),
11651211 };
11661212 pub const gfx908 = CpuModel{
......@@ -1168,7 +1214,6 @@ pub const cpu = struct {
11681214 .llvm_name = "gfx908",
11691215 .features = featureSet(&[_]Feature{
11701216 .atomic_fadd_insts,
1171 .code_object_v3,
11721217 .dl_insts,
11731218 .dot1_insts,
11741219 .dot2_insts,
......@@ -1179,19 +1224,30 @@ pub const cpu = struct {
11791224 .fma_mix_insts,
11801225 .gfx9,
11811226 .half_rate_64_ops,
1227 .image_gather4_d16_bug,
11821228 .ldsbankcount32,
11831229 .mai_insts,
11841230 .mfma_inline_literal_bug,
11851231 .pk_fmac_f16_inst,
1186 .sram_ecc,
1232 .sramecc_support,
11871233 }),
11881234 };
11891235 pub const gfx909 = CpuModel{
11901236 .name = "gfx909",
11911237 .llvm_name = "gfx909",
11921238 .features = featureSet(&[_]Feature{
1193 .code_object_v3,
11941239 .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,
11951251 .ldsbankcount32,
11961252 .mad_mix_insts,
11971253 .xnack,
......@@ -1201,9 +1257,6 @@ pub const cpu = struct {
12011257 .name = "hainan",
12021258 .llvm_name = "hainan",
12031259 .features = featureSet(&[_]Feature{
1204 .code_object_v3,
1205 .ldsbankcount32,
1206 .no_xnack_support,
12071260 .southern_islands,
12081261 }),
12091262 };
......@@ -1211,11 +1264,9 @@ pub const cpu = struct {
12111264 .name = "hawaii",
12121265 .llvm_name = "hawaii",
12131266 .features = featureSet(&[_]Feature{
1214 .code_object_v3,
12151267 .fast_fmaf,
12161268 .half_rate_64_ops,
12171269 .ldsbankcount32,
1218 .no_xnack_support,
12191270 .sea_islands,
12201271 }),
12211272 };
......@@ -1223,9 +1274,7 @@ pub const cpu = struct {
12231274 .name = "iceland",
12241275 .llvm_name = "iceland",
12251276 .features = featureSet(&[_]Feature{
1226 .code_object_v3,
12271277 .ldsbankcount32,
1228 .no_xnack_support,
12291278 .sgpr_init_bug,
12301279 .unpacked_d16_vmem,
12311280 .volcanic_islands,
......@@ -1235,9 +1284,7 @@ pub const cpu = struct {
12351284 .name = "kabini",
12361285 .llvm_name = "kabini",
12371286 .features = featureSet(&[_]Feature{
1238 .code_object_v3,
12391287 .ldsbankcount16,
1240 .no_xnack_support,
12411288 .sea_islands,
12421289 }),
12431290 };
......@@ -1245,9 +1292,7 @@ pub const cpu = struct {
12451292 .name = "kaveri",
12461293 .llvm_name = "kaveri",
12471294 .features = featureSet(&[_]Feature{
1248 .code_object_v3,
12491295 .ldsbankcount32,
1250 .no_xnack_support,
12511296 .sea_islands,
12521297 }),
12531298 };
......@@ -1255,9 +1300,7 @@ pub const cpu = struct {
12551300 .name = "mullins",
12561301 .llvm_name = "mullins",
12571302 .features = featureSet(&[_]Feature{
1258 .code_object_v3,
12591303 .ldsbankcount16,
1260 .no_xnack_support,
12611304 .sea_islands,
12621305 }),
12631306 };
......@@ -1265,9 +1308,6 @@ pub const cpu = struct {
12651308 .name = "oland",
12661309 .llvm_name = "oland",
12671310 .features = featureSet(&[_]Feature{
1268 .code_object_v3,
1269 .ldsbankcount32,
1270 .no_xnack_support,
12711311 .southern_islands,
12721312 }),
12731313 };
......@@ -1275,9 +1315,6 @@ pub const cpu = struct {
12751315 .name = "pitcairn",
12761316 .llvm_name = "pitcairn",
12771317 .features = featureSet(&[_]Feature{
1278 .code_object_v3,
1279 .ldsbankcount32,
1280 .no_xnack_support,
12811318 .southern_islands,
12821319 }),
12831320 };
......@@ -1285,9 +1322,7 @@ pub const cpu = struct {
12851322 .name = "polaris10",
12861323 .llvm_name = "polaris10",
12871324 .features = featureSet(&[_]Feature{
1288 .code_object_v3,
12891325 .ldsbankcount32,
1290 .no_xnack_support,
12911326 .unpacked_d16_vmem,
12921327 .volcanic_islands,
12931328 }),
......@@ -1296,9 +1331,7 @@ pub const cpu = struct {
12961331 .name = "polaris11",
12971332 .llvm_name = "polaris11",
12981333 .features = featureSet(&[_]Feature{
1299 .code_object_v3,
13001334 .ldsbankcount32,
1301 .no_xnack_support,
13021335 .unpacked_d16_vmem,
13031336 .volcanic_islands,
13041337 }),
......@@ -1307,21 +1340,19 @@ pub const cpu = struct {
13071340 .name = "stoney",
13081341 .llvm_name = "stoney",
13091342 .features = featureSet(&[_]Feature{
1310 .code_object_v3,
1343 .image_gather4_d16_bug,
1344 .image_store_d16_bug,
13111345 .ldsbankcount16,
13121346 .volcanic_islands,
1313 .xnack,
1347 .xnack_support,
13141348 }),
13151349 };
13161350 pub const tahiti = CpuModel{
13171351 .name = "tahiti",
13181352 .llvm_name = "tahiti",
13191353 .features = featureSet(&[_]Feature{
1320 .code_object_v3,
13211354 .fast_fmaf,
13221355 .half_rate_64_ops,
1323 .ldsbankcount32,
1324 .no_xnack_support,
13251356 .southern_islands,
13261357 }),
13271358 };
......@@ -1329,9 +1360,17 @@ pub const cpu = struct {
13291360 .name = "tonga",
13301361 .llvm_name = "tonga",
13311362 .features = featureSet(&[_]Feature{
1332 .code_object_v3,
13331363 .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,
13351374 .sgpr_init_bug,
13361375 .unpacked_d16_vmem,
13371376 .volcanic_islands,
......@@ -1341,9 +1380,6 @@ pub const cpu = struct {
13411380 .name = "verde",
13421381 .llvm_name = "verde",
13431382 .features = featureSet(&[_]Feature{
1344 .code_object_v3,
1345 .ldsbankcount32,
1346 .no_xnack_support,
13471383 .southern_islands,
13481384 }),
13491385 };
lib/std/target/arm.zig+240-262
......@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const CpuModel = std.Target.Cpu.Model;
......@@ -53,6 +50,8 @@ pub const Feature = enum {
5350 fullfp16,
5451 fuse_aes,
5552 fuse_literals,
53 harden_sls_blr,
54 harden_sls_retbr,
5655 has_v4t,
5756 has_v5t,
5857 has_v5te,
......@@ -62,6 +61,7 @@ pub const Feature = enum {
6261 has_v6t2,
6362 has_v7,
6463 has_v7clrex,
64 has_v8,
6565 has_v8_1a,
6666 has_v8_1m_main,
6767 has_v8_2a,
......@@ -69,7 +69,7 @@ pub const Feature = enum {
6969 has_v8_4a,
7070 has_v8_5a,
7171 has_v8_6a,
72 has_v8,
72 has_v8_7a,
7373 has_v8m,
7474 has_v8m_main,
7575 hwdiv,
......@@ -85,10 +85,10 @@ pub const Feature = enum {
8585 mp,
8686 muxed_units,
8787 mve,
88 mve_fp,
8988 mve1beat,
9089 mve2beat,
9190 mve4beat,
91 mve_fp,
9292 nacl_trap,
9393 neon,
9494 neon_fpmovs,
......@@ -148,10 +148,6 @@ pub const Feature = enum {
148148 v7r,
149149 v7s,
150150 v7ve,
151 v8a,
152 v8m,
153 v8m_main,
154 v8r,
155151 v8_1a,
156152 v8_1m_main,
157153 v8_2a,
......@@ -159,6 +155,11 @@ pub const Feature = enum {
159155 v8_4a,
160156 v8_5a,
161157 v8_6a,
158 v8_7a,
159 v8a,
160 v8m,
161 v8m_main,
162 v8r,
162163 vfp2,
163164 vfp2sp,
164165 vfp3,
......@@ -238,7 +239,7 @@ pub const all_features = blk: {
238239 .llvm_name = "cde",
239240 .description = "Support CDE instructions",
240241 .dependencies = featureSet(&[_]Feature{
241 .v8m_main,
242 .has_v8m_main,
242243 }),
243244 };
244245 result[@enumToInt(Feature.cdecp0)] = .{
......@@ -312,7 +313,6 @@ pub const all_features = blk: {
312313 .description = "Enable support for Cryptography extensions",
313314 .dependencies = featureSet(&[_]Feature{
314315 .aes,
315 .neon,
316316 .sha2,
317317 }),
318318 };
......@@ -419,7 +419,6 @@ pub const all_features = blk: {
419419 .description = "Enable ARMv8 FP with only 16 d-registers",
420420 .dependencies = featureSet(&[_]Feature{
421421 .fp_armv8d16sp,
422 .fp64,
423422 .vfp4d16,
424423 }),
425424 };
......@@ -434,7 +433,6 @@ pub const all_features = blk: {
434433 .llvm_name = "fp-armv8sp",
435434 .description = "Enable ARMv8 FP with no double precision",
436435 .dependencies = featureSet(&[_]Feature{
437 .d32,
438436 .fp_armv8d16sp,
439437 .vfp4sp,
440438 }),
......@@ -481,6 +479,16 @@ pub const all_features = blk: {
481479 .description = "CPU fuses literal generation operations",
482480 .dependencies = featureSet(&[_]Feature{}),
483481 };
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 };
484492 result[@enumToInt(Feature.has_v4t)] = .{
485493 .llvm_name = "v4t",
486494 .description = "Support ARM v4T instructions",
......@@ -525,18 +533,18 @@ pub const all_features = blk: {
525533 .llvm_name = "v6t2",
526534 .description = "Support ARM v6t2 instructions",
527535 .dependencies = featureSet(&[_]Feature{
528 .thumb2,
529536 .has_v6k,
530537 .has_v8m,
538 .thumb2,
531539 }),
532540 };
533541 result[@enumToInt(Feature.has_v7)] = .{
534542 .llvm_name = "v7",
535543 .description = "Support ARM v7 instructions",
536544 .dependencies = featureSet(&[_]Feature{
537 .perfmon,
538545 .has_v6t2,
539546 .has_v7clrex,
547 .perfmon,
540548 }),
541549 };
542550 result[@enumToInt(Feature.has_v7clrex)] = .{
......@@ -592,8 +600,8 @@ pub const all_features = blk: {
592600 .llvm_name = "v8.5a",
593601 .description = "Support ARM v8.5a instructions",
594602 .dependencies = featureSet(&[_]Feature{
595 .sb,
596603 .has_v8_4a,
604 .sb,
597605 }),
598606 };
599607 result[@enumToInt(Feature.has_v8_6a)] = .{
......@@ -601,8 +609,15 @@ pub const all_features = blk: {
601609 .description = "Support ARM v8.6a instructions",
602610 .dependencies = featureSet(&[_]Feature{
603611 .bf16,
604 .i8mm,
605612 .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,
606621 }),
607622 };
608623 result[@enumToInt(Feature.has_v8m)] = .{
......@@ -640,14 +655,14 @@ pub const all_features = blk: {
640655 .llvm_name = "iwmmxt",
641656 .description = "ARMv5te architecture",
642657 .dependencies = featureSet(&[_]Feature{
643 .has_v5te,
658 .v5te,
644659 }),
645660 };
646661 result[@enumToInt(Feature.iwmmxt2)] = .{
647662 .llvm_name = "iwmmxt2",
648663 .description = "ARMv5te architecture",
649664 .dependencies = featureSet(&[_]Feature{
650 .has_v5te,
665 .v5te,
651666 }),
652667 };
653668 result[@enumToInt(Feature.lob)] = .{
......@@ -695,15 +710,6 @@ pub const all_features = blk: {
695710 .has_v8_1m_main,
696711 }),
697712 };
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 };
707713 result[@enumToInt(Feature.mve1beat)] = .{
708714 .llvm_name = "mve1beat",
709715 .description = "Model MVE instructions as a 1 beat per tick architecture",
......@@ -719,6 +725,14 @@ pub const all_features = blk: {
719725 .description = "Model MVE instructions as a 4 beats per tick architecture",
720726 .dependencies = featureSet(&[_]Feature{}),
721727 };
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 };
722736 result[@enumToInt(Feature.nacl_trap)] = .{
723737 .llvm_name = "nacl-trap",
724738 .description = "NaCl trap",
......@@ -944,32 +958,32 @@ pub const all_features = blk: {
944958 .llvm_name = "armv4t",
945959 .description = "ARMv4t architecture",
946960 .dependencies = featureSet(&[_]Feature{
947 .strict_align,
948961 .has_v4t,
962 .strict_align,
949963 }),
950964 };
951965 result[@enumToInt(Feature.v5t)] = .{
952966 .llvm_name = "armv5t",
953967 .description = "ARMv5t architecture",
954968 .dependencies = featureSet(&[_]Feature{
955 .strict_align,
956969 .has_v5t,
970 .strict_align,
957971 }),
958972 };
959973 result[@enumToInt(Feature.v5te)] = .{
960974 .llvm_name = "armv5te",
961975 .description = "ARMv5te architecture",
962976 .dependencies = featureSet(&[_]Feature{
963 .strict_align,
964977 .has_v5te,
978 .strict_align,
965979 }),
966980 };
967981 result[@enumToInt(Feature.v5tej)] = .{
968982 .llvm_name = "armv5tej",
969983 .description = "ARMv5tej architecture",
970984 .dependencies = featureSet(&[_]Feature{
971 .strict_align,
972985 .has_v5te,
986 .strict_align,
973987 }),
974988 };
975989 result[@enumToInt(Feature.v6)] = .{
......@@ -980,18 +994,6 @@ pub const all_features = blk: {
980994 .has_v6,
981995 }),
982996 };
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 };
995997 result[@enumToInt(Feature.v6j)] = .{
996998 .llvm_name = "armv6j",
997999 .description = "ARMv7a architecture",
......@@ -1010,8 +1012,20 @@ pub const all_features = blk: {
10101012 .llvm_name = "armv6kz",
10111013 .description = "ARMv6kz architecture",
10121014 .dependencies = featureSet(&[_]Feature{
1013 .trustzone,
10141015 .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,
10151029 }),
10161030 };
10171031 result[@enumToInt(Feature.v6sm)] = .{
......@@ -1019,11 +1033,11 @@ pub const all_features = blk: {
10191033 .description = "ARMv6sm architecture",
10201034 .dependencies = featureSet(&[_]Feature{
10211035 .db,
1036 .has_v6m,
10221037 .mclass,
10231038 .noarm,
10241039 .strict_align,
10251040 .thumb_mode,
1026 .has_v6m,
10271041 }),
10281042 };
10291043 result[@enumToInt(Feature.v6t2)] = .{
......@@ -1041,53 +1055,51 @@ pub const all_features = blk: {
10411055 .aclass,
10421056 .db,
10431057 .dsp,
1044 .neon,
10451058 .has_v7,
1059 .neon,
10461060 }),
10471061 };
1048 result[@enumToInt(Feature.v7m)] = .{
1049 .llvm_name = "armv7-m",
1050 .description = "ARMv7m architecture",
1062 result[@enumToInt(Feature.v7em)] = .{
1063 .llvm_name = "armv7e-m",
1064 .description = "ARMv7em architecture",
10511065 .dependencies = featureSet(&[_]Feature{
10521066 .db,
1067 .dsp,
1068 .has_v7,
10531069 .hwdiv,
10541070 .mclass,
10551071 .noarm,
10561072 .thumb_mode,
1057 .thumb2,
1058 .has_v7,
10591073 }),
10601074 };
1061 result[@enumToInt(Feature.v7r)] = .{
1062 .llvm_name = "armv7-r",
1063 .description = "ARMv7r architecture",
1075 result[@enumToInt(Feature.v7k)] = .{
1076 .llvm_name = "armv7k",
1077 .description = "ARMv7a architecture",
10641078 .dependencies = featureSet(&[_]Feature{
1065 .db,
1066 .dsp,
1067 .hwdiv,
1068 .rclass,
1069 .has_v7,
1079 .v7a,
10701080 }),
10711081 };
1072 result[@enumToInt(Feature.v7em)] = .{
1073 .llvm_name = "armv7e-m",
1074 .description = "ARMv7em architecture",
1082 result[@enumToInt(Feature.v7m)] = .{
1083 .llvm_name = "armv7-m",
1084 .description = "ARMv7m architecture",
10751085 .dependencies = featureSet(&[_]Feature{
10761086 .db,
1077 .dsp,
1087 .has_v7,
10781088 .hwdiv,
10791089 .mclass,
10801090 .noarm,
10811091 .thumb_mode,
1082 .thumb2,
1083 .has_v7,
10841092 }),
10851093 };
1086 result[@enumToInt(Feature.v7k)] = .{
1087 .llvm_name = "armv7k",
1088 .description = "ARMv7a architecture",
1094 result[@enumToInt(Feature.v7r)] = .{
1095 .llvm_name = "armv7-r",
1096 .description = "ARMv7r architecture",
10891097 .dependencies = featureSet(&[_]Feature{
1090 .v7a,
1098 .db,
1099 .dsp,
1100 .has_v7,
1101 .hwdiv,
1102 .rclass,
10911103 }),
10921104 };
10931105 result[@enumToInt(Feature.v7s)] = .{
......@@ -1104,73 +1116,10 @@ pub const all_features = blk: {
11041116 .aclass,
11051117 .db,
11061118 .dsp,
1107 .mp,
1108 .neon,
1109 .trustzone,
11101119 .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,
11241120 .mp,
11251121 .neon,
11261122 .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,
11741123 .virtualization,
11751124 }),
11761125 };
......@@ -1184,10 +1133,9 @@ pub const all_features = blk: {
11841133 .db,
11851134 .dsp,
11861135 .fp_armv8,
1136 .has_v8_1a,
11871137 .mp,
1188 .neon,
11891138 .trustzone,
1190 .has_v8_1a,
11911139 .virtualization,
11921140 }),
11931141 };
......@@ -1198,13 +1146,13 @@ pub const all_features = blk: {
11981146 .@"8msecext",
11991147 .acquire_release,
12001148 .db,
1149 .has_v8_1m_main,
12011150 .hwdiv,
12021151 .lob,
12031152 .mclass,
12041153 .noarm,
12051154 .ras,
12061155 .thumb_mode,
1207 .has_v8_1m_main,
12081156 }),
12091157 };
12101158 result[@enumToInt(Feature.v8_2a)] = .{
......@@ -1217,11 +1165,10 @@ pub const all_features = blk: {
12171165 .db,
12181166 .dsp,
12191167 .fp_armv8,
1168 .has_v8_2a,
12201169 .mp,
1221 .neon,
12221170 .ras,
12231171 .trustzone,
1224 .has_v8_2a,
12251172 .virtualization,
12261173 }),
12271174 };
......@@ -1235,11 +1182,10 @@ pub const all_features = blk: {
12351182 .db,
12361183 .dsp,
12371184 .fp_armv8,
1185 .has_v8_3a,
12381186 .mp,
1239 .neon,
12401187 .ras,
12411188 .trustzone,
1242 .has_v8_3a,
12431189 .virtualization,
12441190 }),
12451191 };
......@@ -1251,14 +1197,12 @@ pub const all_features = blk: {
12511197 .crc,
12521198 .crypto,
12531199 .db,
1254 .dotprod,
12551200 .dsp,
12561201 .fp_armv8,
1202 .has_v8_4a,
12571203 .mp,
1258 .neon,
12591204 .ras,
12601205 .trustzone,
1261 .has_v8_4a,
12621206 .virtualization,
12631207 }),
12641208 };
......@@ -1270,14 +1214,12 @@ pub const all_features = blk: {
12701214 .crc,
12711215 .crypto,
12721216 .db,
1273 .dotprod,
12741217 .dsp,
12751218 .fp_armv8,
1219 .has_v8_5a,
12761220 .mp,
1277 .neon,
12781221 .ras,
12791222 .trustzone,
1280 .has_v8_5a,
12811223 .virtualization,
12821224 }),
12831225 };
......@@ -1289,14 +1231,91 @@ pub const all_features = blk: {
12891231 .crc,
12901232 .crypto,
12911233 .db,
1292 .dotprod,
12931234 .dsp,
12941235 .fp_armv8,
1236 .has_v8_6a,
12951237 .mp,
1296 .neon,
12971238 .ras,
12981239 .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,
13001319 .virtualization,
13011320 }),
13021321 };
......@@ -1327,7 +1346,6 @@ pub const all_features = blk: {
13271346 .llvm_name = "vfp3d16",
13281347 .description = "Enable VFP3 instructions with only 16 d-registers",
13291348 .dependencies = featureSet(&[_]Feature{
1330 .fp64,
13311349 .vfp2,
13321350 .vfp3d16sp,
13331351 }),
......@@ -1351,7 +1369,6 @@ pub const all_features = blk: {
13511369 .llvm_name = "vfp4",
13521370 .description = "Enable VFP4 instructions",
13531371 .dependencies = featureSet(&[_]Feature{
1354 .fp16,
13551372 .vfp3,
13561373 .vfp4d16,
13571374 .vfp4sp,
......@@ -1361,8 +1378,6 @@ pub const all_features = blk: {
13611378 .llvm_name = "vfp4d16",
13621379 .description = "Enable VFP4 instructions with only 16 d-registers",
13631380 .dependencies = featureSet(&[_]Feature{
1364 .fp16,
1365 .fp64,
13661381 .vfp3d16,
13671382 .vfp4d16sp,
13681383 }),
......@@ -1379,8 +1394,6 @@ pub const all_features = blk: {
13791394 .llvm_name = "vfp4sp",
13801395 .description = "Enable VFP4 instructions with no double precision",
13811396 .dependencies = featureSet(&[_]Feature{
1382 .d32,
1383 .fp16,
13841397 .vfp3sp,
13851398 .vfp4d16sp,
13861399 }),
......@@ -1417,7 +1430,7 @@ pub const all_features = blk: {
14171430 .llvm_name = "xscale",
14181431 .description = "ARMv5te architecture",
14191432 .dependencies = featureSet(&[_]Feature{
1420 .has_v5te,
1433 .v5te,
14211434 }),
14221435 };
14231436 result[@enumToInt(Feature.zcz)] = .{
......@@ -1480,8 +1493,8 @@ pub const cpu = struct {
14801493 .name = "arm1136jf_s",
14811494 .llvm_name = "arm1136jf-s",
14821495 .features = featureSet(&[_]Feature{
1483 .v6,
14841496 .slowfpvmlx,
1497 .v6,
14851498 .vfp2,
14861499 }),
14871500 };
......@@ -1496,8 +1509,8 @@ pub const cpu = struct {
14961509 .name = "arm1156t2f_s",
14971510 .llvm_name = "arm1156t2f-s",
14981511 .features = featureSet(&[_]Feature{
1499 .v6t2,
15001512 .slowfpvmlx,
1513 .v6t2,
15011514 .vfp2,
15021515 }),
15031516 };
......@@ -1519,8 +1532,8 @@ pub const cpu = struct {
15191532 .name = "arm1176jzf_s",
15201533 .llvm_name = "arm1176jzf-s",
15211534 .features = featureSet(&[_]Feature{
1522 .v6kz,
15231535 .slowfpvmlx,
1536 .v6kz,
15241537 .vfp2,
15251538 }),
15261539 };
......@@ -1654,11 +1667,11 @@ pub const cpu = struct {
16541667 .name = "cortex_a12",
16551668 .llvm_name = "cortex-a12",
16561669 .features = featureSet(&[_]Feature{
1657 .v7a,
16581670 .avoid_partial_cpsr,
16591671 .mp,
16601672 .ret_addr_stack,
16611673 .trustzone,
1674 .v7a,
16621675 .vfp4,
16631676 .virtualization,
16641677 .vmlx_forwarding,
......@@ -1668,14 +1681,13 @@ pub const cpu = struct {
16681681 .name = "cortex_a15",
16691682 .llvm_name = "cortex-a15",
16701683 .features = featureSet(&[_]Feature{
1671 .v7a,
16721684 .avoid_partial_cpsr,
1673 .dont_widen_vmovs,
16741685 .mp,
16751686 .muxed_units,
16761687 .ret_addr_stack,
16771688 .splat_vfp_neon,
16781689 .trustzone,
1690 .v7a,
16791691 .vfp4,
16801692 .virtualization,
16811693 .vldn_align,
......@@ -1685,11 +1697,11 @@ pub const cpu = struct {
16851697 .name = "cortex_a17",
16861698 .llvm_name = "cortex-a17",
16871699 .features = featureSet(&[_]Feature{
1688 .v7a,
16891700 .avoid_partial_cpsr,
16901701 .mp,
16911702 .ret_addr_stack,
16921703 .trustzone,
1704 .v7a,
16931705 .vfp4,
16941706 .virtualization,
16951707 .vmlx_forwarding,
......@@ -1699,10 +1711,6 @@ pub const cpu = struct {
16991711 .name = "cortex_a32",
17001712 .llvm_name = "cortex-a32",
17011713 .features = featureSet(&[_]Feature{
1702 .crc,
1703 .crypto,
1704 .hwdiv,
1705 .hwdiv_arm,
17061714 .v8a,
17071715 }),
17081716 };
......@@ -1710,10 +1718,6 @@ pub const cpu = struct {
17101718 .name = "cortex_a35",
17111719 .llvm_name = "cortex-a35",
17121720 .features = featureSet(&[_]Feature{
1713 .crc,
1714 .crypto,
1715 .hwdiv,
1716 .hwdiv_arm,
17171721 .v8a,
17181722 }),
17191723 };
......@@ -1721,13 +1725,13 @@ pub const cpu = struct {
17211725 .name = "cortex_a5",
17221726 .llvm_name = "cortex-a5",
17231727 .features = featureSet(&[_]Feature{
1724 .v7a,
17251728 .mp,
17261729 .ret_addr_stack,
17271730 .slow_fp_brcc,
17281731 .slowfpvfmx,
17291732 .slowfpvmlx,
17301733 .trustzone,
1734 .v7a,
17311735 .vfp4,
17321736 .vmlx_forwarding,
17331737 }),
......@@ -1736,49 +1740,39 @@ pub const cpu = struct {
17361740 .name = "cortex_a53",
17371741 .llvm_name = "cortex-a53",
17381742 .features = featureSet(&[_]Feature{
1739 .v8a,
1740 .crc,
1741 .crypto,
17421743 .fpao,
1743 .hwdiv,
1744 .hwdiv_arm,
1744 .v8a,
17451745 }),
17461746 };
17471747 pub const cortex_a55 = CpuModel{
17481748 .name = "cortex_a55",
17491749 .llvm_name = "cortex-a55",
17501750 .features = featureSet(&[_]Feature{
1751 .v8_2a,
17521751 .dotprod,
1753 .hwdiv,
1754 .hwdiv_arm,
1752 .v8_2a,
17551753 }),
17561754 };
17571755 pub const cortex_a57 = CpuModel{
17581756 .name = "cortex_a57",
17591757 .llvm_name = "cortex-a57",
17601758 .features = featureSet(&[_]Feature{
1761 .v8a,
17621759 .avoid_partial_cpsr,
17631760 .cheap_predicable_cpsr,
1764 .crc,
1765 .crypto,
17661761 .fpao,
1767 .hwdiv,
1768 .hwdiv_arm,
1762 .v8a,
17691763 }),
17701764 };
17711765 pub const cortex_a7 = CpuModel{
17721766 .name = "cortex_a7",
17731767 .llvm_name = "cortex-a7",
17741768 .features = featureSet(&[_]Feature{
1775 .v7a,
17761769 .mp,
17771770 .ret_addr_stack,
17781771 .slow_fp_brcc,
17791772 .slowfpvfmx,
17801773 .slowfpvmlx,
17811774 .trustzone,
1775 .v7a,
17821776 .vfp4,
17831777 .virtualization,
17841778 .vmlx_forwarding,
......@@ -1790,10 +1784,6 @@ pub const cpu = struct {
17901784 .llvm_name = "cortex-a72",
17911785 .features = featureSet(&[_]Feature{
17921786 .v8a,
1793 .crc,
1794 .crypto,
1795 .hwdiv,
1796 .hwdiv_arm,
17971787 }),
17981788 };
17991789 pub const cortex_a73 = CpuModel{
......@@ -1801,20 +1791,14 @@ pub const cpu = struct {
18011791 .llvm_name = "cortex-a73",
18021792 .features = featureSet(&[_]Feature{
18031793 .v8a,
1804 .crc,
1805 .crypto,
1806 .hwdiv,
1807 .hwdiv_arm,
18081794 }),
18091795 };
18101796 pub const cortex_a75 = CpuModel{
18111797 .name = "cortex_a75",
18121798 .llvm_name = "cortex-a75",
18131799 .features = featureSet(&[_]Feature{
1814 .v8_2a,
18151800 .dotprod,
1816 .hwdiv,
1817 .hwdiv_arm,
1801 .v8_2a,
18181802 }),
18191803 };
18201804 pub const cortex_a76 = CpuModel{
......@@ -1822,13 +1806,9 @@ pub const cpu = struct {
18221806 .llvm_name = "cortex-a76",
18231807 .features = featureSet(&[_]Feature{
18241808 .a76,
1825 .v8_2a,
1826 .crc,
1827 .crypto,
18281809 .dotprod,
18291810 .fullfp16,
1830 .hwdiv,
1831 .hwdiv_arm,
1811 .v8_2a,
18321812 }),
18331813 };
18341814 pub const cortex_a76ae = CpuModel{
......@@ -1836,52 +1816,49 @@ pub const cpu = struct {
18361816 .llvm_name = "cortex-a76ae",
18371817 .features = featureSet(&[_]Feature{
18381818 .a76,
1839 .v8_2a,
1840 .crc,
1841 .crypto,
18421819 .dotprod,
18431820 .fullfp16,
1844 .hwdiv,
1845 .hwdiv_arm,
1821 .v8_2a,
18461822 }),
18471823 };
18481824 pub const cortex_a77 = CpuModel{
18491825 .name = "cortex_a77",
18501826 .llvm_name = "cortex-a77",
18511827 .features = featureSet(&[_]Feature{
1852 .v8_2a,
1853 .crc,
1854 .crypto,
18551828 .dotprod,
18561829 .fullfp16,
1857 .hwdiv,
1858 .hwdiv_arm,
1830 .v8_2a,
18591831 }),
18601832 };
18611833 pub const cortex_a78 = CpuModel{
18621834 .name = "cortex_a78",
18631835 .llvm_name = "cortex-a78",
18641836 .features = featureSet(&[_]Feature{
1837 .dotprod,
1838 .fullfp16,
18651839 .v8_2a,
1866 .crc,
1867 .crypto,
1840 }),
1841 };
1842 pub const cortex_a78c = CpuModel{
1843 .name = "cortex_a78c",
1844 .llvm_name = "cortex-a78c",
1845 .features = featureSet(&[_]Feature{
18681846 .dotprod,
18691847 .fullfp16,
1870 .hwdiv,
1871 .hwdiv_arm,
1848 .v8_2a,
18721849 }),
18731850 };
18741851 pub const cortex_a8 = CpuModel{
18751852 .name = "cortex_a8",
18761853 .llvm_name = "cortex-a8",
18771854 .features = featureSet(&[_]Feature{
1878 .v7a,
18791855 .nonpipelined_vfp,
18801856 .ret_addr_stack,
18811857 .slow_fp_brcc,
18821858 .slowfpvfmx,
18831859 .slowfpvmlx,
18841860 .trustzone,
1861 .v7a,
18851862 .vmlx_forwarding,
18861863 .vmlx_hazards,
18871864 }),
......@@ -1890,7 +1867,6 @@ pub const cpu = struct {
18901867 .name = "cortex_a9",
18911868 .llvm_name = "cortex-a9",
18921869 .features = featureSet(&[_]Feature{
1893 .v7a,
18941870 .avoid_partial_cpsr,
18951871 .expand_fp_mlx,
18961872 .fp16,
......@@ -1900,6 +1876,7 @@ pub const cpu = struct {
19001876 .prefer_vmovsr,
19011877 .ret_addr_stack,
19021878 .trustzone,
1879 .v7a,
19031880 .vldn_align,
19041881 .vmlx_forwarding,
19051882 .vmlx_hazards,
......@@ -1930,26 +1907,25 @@ pub const cpu = struct {
19301907 .name = "cortex_m23",
19311908 .llvm_name = "cortex-m23",
19321909 .features = featureSet(&[_]Feature{
1933 .v8m,
19341910 .no_movt,
1911 .v8m,
19351912 }),
19361913 };
19371914 pub const cortex_m3 = CpuModel{
19381915 .name = "cortex_m3",
19391916 .llvm_name = "cortex-m3",
19401917 .features = featureSet(&[_]Feature{
1941 .v7m,
19421918 .loop_align,
19431919 .m3,
19441920 .no_branch_predictor,
19451921 .use_misched,
1922 .v7m,
19461923 }),
19471924 };
19481925 pub const cortex_m33 = CpuModel{
19491926 .name = "cortex_m33",
19501927 .llvm_name = "cortex-m33",
19511928 .features = featureSet(&[_]Feature{
1952 .v8m_main,
19531929 .dsp,
19541930 .fp_armv8d16sp,
19551931 .loop_align,
......@@ -1957,13 +1933,13 @@ pub const cpu = struct {
19571933 .slowfpvfmx,
19581934 .slowfpvmlx,
19591935 .use_misched,
1936 .v8m_main,
19601937 }),
19611938 };
19621939 pub const cortex_m35p = CpuModel{
19631940 .name = "cortex_m35p",
19641941 .llvm_name = "cortex-m35p",
19651942 .features = featureSet(&[_]Feature{
1966 .v8m_main,
19671943 .dsp,
19681944 .fp_armv8d16sp,
19691945 .loop_align,
......@@ -1971,18 +1947,19 @@ pub const cpu = struct {
19711947 .slowfpvfmx,
19721948 .slowfpvmlx,
19731949 .use_misched,
1950 .v8m_main,
19741951 }),
19751952 };
19761953 pub const cortex_m4 = CpuModel{
19771954 .name = "cortex_m4",
19781955 .llvm_name = "cortex-m4",
19791956 .features = featureSet(&[_]Feature{
1980 .v7em,
19811957 .loop_align,
19821958 .no_branch_predictor,
19831959 .slowfpvfmx,
19841960 .slowfpvmlx,
19851961 .use_misched,
1962 .v7em,
19861963 .vfp4d16sp,
19871964 }),
19881965 };
......@@ -1990,45 +1967,45 @@ pub const cpu = struct {
19901967 .name = "cortex_m55",
19911968 .llvm_name = "cortex-m55",
19921969 .features = featureSet(&[_]Feature{
1993 .v8_1m_main,
1994 .dsp,
19951970 .fp_armv8d16,
19961971 .loop_align,
19971972 .mve_fp,
19981973 .no_branch_predictor,
19991974 .slowfpvmlx,
20001975 .use_misched,
1976 .v8_1m_main,
20011977 }),
20021978 };
20031979 pub const cortex_m7 = CpuModel{
20041980 .name = "cortex_m7",
20051981 .llvm_name = "cortex-m7",
20061982 .features = featureSet(&[_]Feature{
2007 .v7em,
20081983 .fp_armv8d16,
1984 .use_misched,
1985 .v7em,
20091986 }),
20101987 };
20111988 pub const cortex_r4 = CpuModel{
20121989 .name = "cortex_r4",
20131990 .llvm_name = "cortex-r4",
20141991 .features = featureSet(&[_]Feature{
2015 .v7r,
20161992 .avoid_partial_cpsr,
20171993 .r4,
20181994 .ret_addr_stack,
1995 .v7r,
20191996 }),
20201997 };
20211998 pub const cortex_r4f = CpuModel{
20221999 .name = "cortex_r4f",
20232000 .llvm_name = "cortex-r4f",
20242001 .features = featureSet(&[_]Feature{
2025 .v7r,
20262002 .avoid_partial_cpsr,
20272003 .r4,
20282004 .ret_addr_stack,
20292005 .slow_fp_brcc,
20302006 .slowfpvfmx,
20312007 .slowfpvmlx,
2008 .v7r,
20322009 .vfp3d16,
20332010 }),
20342011 };
......@@ -2036,13 +2013,13 @@ pub const cpu = struct {
20362013 .name = "cortex_r5",
20372014 .llvm_name = "cortex-r5",
20382015 .features = featureSet(&[_]Feature{
2039 .v7r,
20402016 .avoid_partial_cpsr,
20412017 .hwdiv_arm,
20422018 .ret_addr_stack,
20432019 .slow_fp_brcc,
20442020 .slowfpvfmx,
20452021 .slowfpvmlx,
2022 .v7r,
20462023 .vfp3d16,
20472024 }),
20482025 };
......@@ -2050,16 +2027,15 @@ pub const cpu = struct {
20502027 .name = "cortex_r52",
20512028 .llvm_name = "cortex-r52",
20522029 .features = featureSet(&[_]Feature{
2053 .v8r,
20542030 .fpao,
20552031 .use_misched,
2032 .v8r,
20562033 }),
20572034 };
20582035 pub const cortex_r7 = CpuModel{
20592036 .name = "cortex_r7",
20602037 .llvm_name = "cortex-r7",
20612038 .features = featureSet(&[_]Feature{
2062 .v7r,
20632039 .avoid_partial_cpsr,
20642040 .fp16,
20652041 .hwdiv_arm,
......@@ -2068,6 +2044,7 @@ pub const cpu = struct {
20682044 .slow_fp_brcc,
20692045 .slowfpvfmx,
20702046 .slowfpvmlx,
2047 .v7r,
20712048 .vfp3d16,
20722049 }),
20732050 };
......@@ -2075,7 +2052,6 @@ pub const cpu = struct {
20752052 .name = "cortex_r8",
20762053 .llvm_name = "cortex-r8",
20772054 .features = featureSet(&[_]Feature{
2078 .v7r,
20792055 .avoid_partial_cpsr,
20802056 .fp16,
20812057 .hwdiv_arm,
......@@ -2084,6 +2060,7 @@ pub const cpu = struct {
20842060 .slow_fp_brcc,
20852061 .slowfpvfmx,
20862062 .slowfpvmlx,
2063 .v7r,
20872064 .vfp3d16,
20882065 }),
20892066 };
......@@ -2091,34 +2068,25 @@ pub const cpu = struct {
20912068 .name = "cortex_x1",
20922069 .llvm_name = "cortex-x1",
20932070 .features = featureSet(&[_]Feature{
2094 .v8_2a,
2095 .crc,
2096 .crypto,
20972071 .dotprod,
20982072 .fullfp16,
2099 .hwdiv,
2100 .hwdiv_arm,
2073 .v8_2a,
21012074 }),
21022075 };
21032076 pub const cyclone = CpuModel{
21042077 .name = "cyclone",
21052078 .llvm_name = "cyclone",
21062079 .features = featureSet(&[_]Feature{
2107 .v8a,
21082080 .avoid_movs_shop,
21092081 .avoid_partial_cpsr,
2110 .crypto,
21112082 .disable_postra_scheduler,
2112 .hwdiv,
2113 .hwdiv_arm,
2114 .mp,
21152083 .neonfp,
21162084 .ret_addr_stack,
21172085 .slowfpvfmx,
21182086 .slowfpvmlx,
21192087 .swift,
21202088 .use_misched,
2121 .vfp4,
2089 .v8a,
21222090 .zcz,
21232091 }),
21242092 };
......@@ -2133,34 +2101,34 @@ pub const cpu = struct {
21332101 .name = "exynos_m1",
21342102 .llvm_name = null,
21352103 .features = featureSet(&[_]Feature{
2136 .v8a,
21372104 .exynos,
2105 .v8a,
21382106 }),
21392107 };
21402108 pub const exynos_m2 = CpuModel{
21412109 .name = "exynos_m2",
21422110 .llvm_name = null,
21432111 .features = featureSet(&[_]Feature{
2144 .v8a,
21452112 .exynos,
2113 .v8a,
21462114 }),
21472115 };
21482116 pub const exynos_m3 = CpuModel{
21492117 .name = "exynos_m3",
21502118 .llvm_name = "exynos-m3",
21512119 .features = featureSet(&[_]Feature{
2152 .v8_2a,
21532120 .exynos,
2121 .v8a,
21542122 }),
21552123 };
21562124 pub const exynos_m4 = CpuModel{
21572125 .name = "exynos_m4",
21582126 .llvm_name = "exynos-m4",
21592127 .features = featureSet(&[_]Feature{
2160 .v8_2a,
21612128 .dotprod,
21622129 .exynos,
21632130 .fullfp16,
2131 .v8_2a,
21642132 }),
21652133 };
21662134 pub const exynos_m5 = CpuModel{
......@@ -2190,7 +2158,6 @@ pub const cpu = struct {
21902158 .llvm_name = "krait",
21912159 .features = featureSet(&[_]Feature{
21922160 .avoid_partial_cpsr,
2193 .fp16,
21942161 .hwdiv,
21952162 .hwdiv_arm,
21962163 .muxed_units,
......@@ -2205,10 +2172,6 @@ pub const cpu = struct {
22052172 .name = "kryo",
22062173 .llvm_name = "kryo",
22072174 .features = featureSet(&[_]Feature{
2208 .crc,
2209 .crypto,
2210 .hwdiv,
2211 .hwdiv_arm,
22122175 .v8a,
22132176 }),
22142177 };
......@@ -2216,8 +2179,8 @@ pub const cpu = struct {
22162179 .name = "mpcore",
22172180 .llvm_name = "mpcore",
22182181 .features = featureSet(&[_]Feature{
2219 .v6k,
22202182 .slowfpvmlx,
2183 .v6k,
22212184 .vfp2,
22222185 }),
22232186 };
......@@ -2232,12 +2195,27 @@ pub const cpu = struct {
22322195 .name = "neoverse_n1",
22332196 .llvm_name = "neoverse-n1",
22342197 .features = featureSet(&[_]Feature{
2235 .v8_2a,
2236 .crc,
2237 .crypto,
22382198 .dotprod,
2239 .hwdiv,
2240 .hwdiv_arm,
2199 .v8_2a,
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,
22412219 }),
22422220 };
22432221 pub const sc000 = CpuModel{
......@@ -2251,10 +2229,10 @@ pub const cpu = struct {
22512229 .name = "sc300",
22522230 .llvm_name = "sc300",
22532231 .features = featureSet(&[_]Feature{
2254 .v7m,
22552232 .m3,
22562233 .no_branch_predictor,
22572234 .use_misched,
2235 .v7m,
22582236 }),
22592237 };
22602238 pub const strongarm = CpuModel{
......@@ -2289,7 +2267,6 @@ pub const cpu = struct {
22892267 .name = "swift",
22902268 .llvm_name = "swift",
22912269 .features = featureSet(&[_]Feature{
2292 .v7a,
22932270 .avoid_movs_shop,
22942271 .avoid_partial_cpsr,
22952272 .disable_postra_scheduler,
......@@ -2308,6 +2285,7 @@ pub const cpu = struct {
23082285 .slowfpvmlx,
23092286 .swift,
23102287 .use_misched,
2288 .v7a,
23112289 .vfp4,
23122290 .vmlx_hazards,
23132291 .wide_stride_vfp,
lib/std/target/avr.zig+64-11
......@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const CpuModel = std.Target.Cpu.Model;
......@@ -163,7 +160,6 @@ pub const all_features = blk: {
163160 .dependencies = featureSet(&[_]Feature{
164161 .avr0,
165162 .@"break",
166 .memmappedregs,
167163 .sram,
168164 .tinyencoding,
169165 }),
......@@ -802,6 +798,13 @@ pub const cpu = struct {
802798 .avr5,
803799 }),
804800 };
801 pub const atmega168pb = CpuModel{
802 .name = "atmega168pb",
803 .llvm_name = "atmega168pb",
804 .features = featureSet(&[_]Feature{
805 .avr5,
806 }),
807 };
805808 pub const atmega169 = CpuModel{
806809 .name = "atmega169",
807810 .llvm_name = "atmega169",
......@@ -949,6 +952,13 @@ pub const cpu = struct {
949952 .avr5,
950953 }),
951954 };
955 pub const atmega324pb = CpuModel{
956 .name = "atmega324pb",
957 .llvm_name = "atmega324pb",
958 .features = featureSet(&[_]Feature{
959 .avr5,
960 }),
961 };
952962 pub const atmega325 = CpuModel{
953963 .name = "atmega325",
954964 .llvm_name = "atmega325",
......@@ -1019,6 +1029,13 @@ pub const cpu = struct {
10191029 .avr5,
10201030 }),
10211031 };
1032 pub const atmega328pb = CpuModel{
1033 .name = "atmega328pb",
1034 .llvm_name = "atmega328pb",
1035 .features = featureSet(&[_]Feature{
1036 .avr5,
1037 }),
1038 };
10221039 pub const atmega329 = CpuModel{
10231040 .name = "atmega329",
10241041 .llvm_name = "atmega329",
......@@ -1166,6 +1183,13 @@ pub const cpu = struct {
11661183 .avr4,
11671184 }),
11681185 };
1186 pub const atmega48pb = CpuModel{
1187 .name = "atmega48pb",
1188 .llvm_name = "atmega48pb",
1189 .features = featureSet(&[_]Feature{
1190 .avr4,
1191 }),
1192 };
11691193 pub const atmega64 = CpuModel{
11701194 .name = "atmega64",
11711195 .llvm_name = "atmega64",
......@@ -1338,7 +1362,11 @@ pub const cpu = struct {
13381362 .name = "atmega8",
13391363 .llvm_name = "atmega8",
13401364 .features = featureSet(&[_]Feature{
1341 .avr4,
1365 .avr2,
1366 .lpmx,
1367 .movw,
1368 .mul,
1369 .spm,
13421370 }),
13431371 };
13441372 pub const atmega8515 = CpuModel{
......@@ -1391,11 +1419,22 @@ pub const cpu = struct {
13911419 .avr4,
13921420 }),
13931421 };
1422 pub const atmega88pb = CpuModel{
1423 .name = "atmega88pb",
1424 .llvm_name = "atmega88pb",
1425 .features = featureSet(&[_]Feature{
1426 .avr4,
1427 }),
1428 };
13941429 pub const atmega8a = CpuModel{
13951430 .name = "atmega8a",
13961431 .llvm_name = "atmega8a",
13971432 .features = featureSet(&[_]Feature{
1398 .avr4,
1433 .avr2,
1434 .lpmx,
1435 .movw,
1436 .mul,
1437 .spm,
13991438 }),
14001439 };
14011440 pub const atmega8hva = CpuModel{
......@@ -1595,6 +1634,13 @@ pub const cpu = struct {
15951634 .avr25,
15961635 }),
15971636 };
1637 pub const attiny441 = CpuModel{
1638 .name = "attiny441",
1639 .llvm_name = "attiny441",
1640 .features = featureSet(&[_]Feature{
1641 .avr25,
1642 }),
1643 };
15981644 pub const attiny44a = CpuModel{
15991645 .name = "attiny44a",
16001646 .llvm_name = "attiny44a",
......@@ -1651,6 +1697,13 @@ pub const cpu = struct {
16511697 .avr25,
16521698 }),
16531699 };
1700 pub const attiny841 = CpuModel{
1701 .name = "attiny841",
1702 .llvm_name = "attiny841",
1703 .features = featureSet(&[_]Feature{
1704 .avr25,
1705 }),
1706 };
16541707 pub const attiny84a = CpuModel{
16551708 .name = "attiny84a",
16561709 .llvm_name = "attiny84a",
......@@ -1802,7 +1855,7 @@ pub const cpu = struct {
18021855 .name = "atxmega16e5",
18031856 .llvm_name = "atxmega16e5",
18041857 .features = featureSet(&[_]Feature{
1805 .xmega,
1858 .xmegau,
18061859 }),
18071860 };
18081861 pub const atxmega192a3 = CpuModel{
......@@ -1907,7 +1960,7 @@ pub const cpu = struct {
19071960 .name = "atxmega32e5",
19081961 .llvm_name = "atxmega32e5",
19091962 .features = featureSet(&[_]Feature{
1910 .xmega,
1963 .xmegau,
19111964 }),
19121965 };
19131966 pub const atxmega32x1 = CpuModel{
......@@ -2005,7 +2058,7 @@ pub const cpu = struct {
20052058 .name = "atxmega8e5",
20062059 .llvm_name = "atxmega8e5",
20072060 .features = featureSet(&[_]Feature{
2008 .xmega,
2061 .xmegau,
20092062 }),
20102063 };
20112064 pub const avr1 = CpuModel{
lib/std/target/bpf.zig+2-5
......@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const CpuModel = std.Target.Cpu.Model;
lib/std/target/hexagon.zig+2-23
......@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const CpuModel = std.Target.Cpu.Model;
......@@ -92,7 +89,6 @@ pub const all_features = blk: {
9289 .llvm_name = "hvxv62",
9390 .description = "Hexagon HVX instructions",
9491 .dependencies = featureSet(&[_]Feature{
95 .hvx,
9692 .hvxv60,
9793 }),
9894 };
......@@ -100,8 +96,6 @@ pub const all_features = blk: {
10096 .llvm_name = "hvxv65",
10197 .description = "Hexagon HVX instructions",
10298 .dependencies = featureSet(&[_]Feature{
103 .hvx,
104 .hvxv60,
10599 .hvxv62,
106100 }),
107101 };
......@@ -109,9 +103,6 @@ pub const all_features = blk: {
109103 .llvm_name = "hvxv66",
110104 .description = "Hexagon HVX instructions",
111105 .dependencies = featureSet(&[_]Feature{
112 .hvx,
113 .hvxv60,
114 .hvxv62,
115106 .hvxv65,
116107 .zreg,
117108 }),
......@@ -120,9 +111,6 @@ pub const all_features = blk: {
120111 .llvm_name = "hvxv67",
121112 .description = "Hexagon HVX instructions",
122113 .dependencies = featureSet(&[_]Feature{
123 .hvxv60,
124 .hvxv62,
125 .hvxv65,
126114 .hvxv66,
127115 }),
128116 };
......@@ -248,7 +236,6 @@ pub const cpu = struct {
248236 .memops,
249237 .nvj,
250238 .nvs,
251 .packets,
252239 .prev65,
253240 .small_data,
254241 .v5,
......@@ -265,7 +252,6 @@ pub const cpu = struct {
265252 .memops,
266253 .nvj,
267254 .nvs,
268 .packets,
269255 .prev65,
270256 .small_data,
271257 .v5,
......@@ -280,7 +266,6 @@ pub const cpu = struct {
280266 .memops,
281267 .nvj,
282268 .nvs,
283 .packets,
284269 .prev65,
285270 .small_data,
286271 .v5,
......@@ -296,7 +281,6 @@ pub const cpu = struct {
296281 .memops,
297282 .nvj,
298283 .nvs,
299 .packets,
300284 .prev65,
301285 .small_data,
302286 .v5,
......@@ -313,7 +297,6 @@ pub const cpu = struct {
313297 .memops,
314298 .nvj,
315299 .nvs,
316 .packets,
317300 .prev65,
318301 .small_data,
319302 .v5,
......@@ -332,7 +315,6 @@ pub const cpu = struct {
332315 .memops,
333316 .nvj,
334317 .nvs,
335 .packets,
336318 .small_data,
337319 .v5,
338320 .v55,
......@@ -351,7 +333,6 @@ pub const cpu = struct {
351333 .memops,
352334 .nvj,
353335 .nvs,
354 .packets,
355336 .small_data,
356337 .v5,
357338 .v55,
......@@ -371,7 +352,6 @@ pub const cpu = struct {
371352 .memops,
372353 .nvj,
373354 .nvs,
374 .packets,
375355 .small_data,
376356 .v5,
377357 .v55,
......@@ -391,7 +371,6 @@ pub const cpu = struct {
391371 .mem_noshuf,
392372 .memops,
393373 .nvs,
394 .packets,
395374 .small_data,
396375 .tinycore,
397376 .v5,
lib/std/target/mips.zig+2-11
......@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const CpuModel = std.Target.Cpu.Model;
......@@ -108,7 +105,6 @@ pub const all_features = blk: {
108105 .llvm_name = "dspr3",
109106 .description = "Mips DSP-R3 ASE",
110107 .dependencies = featureSet(&[_]Feature{
111 .dsp,
112108 .dspr2,
113109 }),
114110 };
......@@ -301,10 +297,8 @@ pub const all_features = blk: {
301297 .llvm_name = "mips64r6",
302298 .description = "Mips64r6 ISA Support [experimental]",
303299 .dependencies = featureSet(&[_]Feature{
304 .abs2008,
305300 .mips32r6,
306301 .mips64r5,
307 .nan2008,
308302 }),
309303 };
310304 result[@enumToInt(Feature.msa)] = .{
......@@ -515,16 +509,13 @@ pub const cpu = struct {
515509 .llvm_name = "octeon",
516510 .features = featureSet(&[_]Feature{
517511 .cnmips,
518 .mips64r2,
519512 }),
520513 };
521514 pub const @"octeon+" = CpuModel{
522515 .name = "octeon+",
523516 .llvm_name = "octeon+",
524517 .features = featureSet(&[_]Feature{
525 .cnmips,
526518 .cnmipsp,
527 .mips64r2,
528519 }),
529520 };
530521 pub const p5600 = CpuModel{
lib/std/target/msp430.zig+2-5
......@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const CpuModel = std.Target.Cpu.Model;
lib/std/target/nvptx.zig+2-5
......@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const CpuModel = std.Target.Cpu.Model;
lib/std/target/powerpc.zig+98-123
......@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const CpuModel = std.Target.Cpu.Model;
......@@ -10,6 +7,7 @@ const CpuModel = std.Target.Cpu.Model;
107pub const Feature = enum {
118 @"64bit",
129 @"64bitregs",
10 aix,
1311 allow_unaligned_fp_access,
1412 altivec,
1513 booke,
......@@ -19,6 +17,7 @@ pub const Feature = enum {
1917 crypto,
2018 direct_move,
2119 e500,
20 efpu2,
2221 extdiv,
2322 fcpsgn,
2423 float128,
......@@ -32,6 +31,7 @@ pub const Feature = enum {
3231 fsqrt,
3332 fuse_addi_load,
3433 fuse_addis_load,
34 fuse_store,
3535 fusion,
3636 hard_float,
3737 htm,
......@@ -44,7 +44,10 @@ pub const Feature = enum {
4444 lfiwax,
4545 longcall,
4646 mfocrf,
47 mma,
48 modern_aix_as,
4749 msync,
50 paired_vector_memops,
4851 partword_atomics,
4952 pcrelative_memops,
5053 popcntd,
......@@ -53,13 +56,12 @@ pub const Feature = enum {
5356 power8_vector,
5457 power9_altivec,
5558 power9_vector,
56 ppc_postra_sched,
57 ppc_prera_sched,
5859 ppc4xx,
5960 ppc6xx,
61 ppc_postra_sched,
62 ppc_prera_sched,
6063 predictable_select_expensive,
6164 prefix_instrs,
62 qpx,
6365 recipprec,
6466 secure_plt,
6567 slow_popcntd,
......@@ -86,6 +88,11 @@ pub const all_features = blk: {
8688 .description = "Enable 64-bit registers usage for ppc32 [beta]",
8789 .dependencies = featureSet(&[_]Feature{}),
8890 };
91 result[@enumToInt(Feature.aix)] = .{
92 .llvm_name = "aix",
93 .description = "AIX OS",
94 .dependencies = featureSet(&[_]Feature{}),
95 };
8996 result[@enumToInt(Feature.allow_unaligned_fp_access)] = .{
9097 .llvm_name = "allow-unaligned-fp-access",
9198 .description = "CPU does not trap on unaligned FP access",
......@@ -139,6 +146,13 @@ pub const all_features = blk: {
139146 .description = "Enable E500/E500mc instructions",
140147 .dependencies = featureSet(&[_]Feature{}),
141148 };
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 };
142156 result[@enumToInt(Feature.extdiv)] = .{
143157 .llvm_name = "extdiv",
144158 .description = "Enable extended divide instructions",
......@@ -228,6 +242,13 @@ pub const all_features = blk: {
228242 .fusion,
229243 }),
230244 };
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 };
231252 result[@enumToInt(Feature.fusion)] = .{
232253 .llvm_name = "fusion",
233254 .description = "Target supports instruction fusion",
......@@ -292,6 +313,20 @@ pub const all_features = blk: {
292313 .description = "Enable the MFOCRF instruction",
293314 .dependencies = featureSet(&[_]Feature{}),
294315 };
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 };
295330 result[@enumToInt(Feature.msync)] = .{
296331 .llvm_name = "msync",
297332 .description = "Has only the msync instruction instead of sync",
......@@ -299,6 +334,13 @@ pub const all_features = blk: {
299334 .booke,
300335 }),
301336 };
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 };
302344 result[@enumToInt(Feature.partword_atomics)] = .{
303345 .llvm_name = "partword-atomics",
304346 .description = "Enable l[bh]arx and st[bh]cx.",
......@@ -308,7 +350,7 @@ pub const all_features = blk: {
308350 .llvm_name = "pcrelative-memops",
309351 .description = "Enable PC relative Memory Ops",
310352 .dependencies = featureSet(&[_]Feature{
311 .isa_v30_instructions,
353 .prefix_instrs,
312354 }),
313355 };
314356 result[@enumToInt(Feature.popcntd)] = .{
......@@ -351,21 +393,10 @@ pub const all_features = blk: {
351393 .llvm_name = "power9-vector",
352394 .description = "Enable POWER9 vector instructions",
353395 .dependencies = featureSet(&[_]Feature{
354 .isa_v30_instructions,
355396 .power8_vector,
356397 .power9_altivec,
357398 }),
358399 };
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 };
369400 result[@enumToInt(Feature.ppc4xx)] = .{
370401 .llvm_name = "ppc4xx",
371402 .description = "Enable PPC 4xx instructions",
......@@ -376,6 +407,16 @@ pub const all_features = blk: {
376407 .description = "Enable PPC 6xx instructions",
377408 .dependencies = featureSet(&[_]Feature{}),
378409 };
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 };
379420 result[@enumToInt(Feature.predictable_select_expensive)] = .{
380421 .llvm_name = "predictable-select-expensive",
381422 .description = "Prefer likely predicted branches over selects",
......@@ -385,18 +426,10 @@ pub const all_features = blk: {
385426 .llvm_name = "prefix-instrs",
386427 .description = "Enable prefixed instructions",
387428 .dependencies = featureSet(&[_]Feature{
388 .isa_v30_instructions,
389429 .power8_vector,
390430 .power9_altivec,
391431 }),
392432 };
393 result[@enumToInt(Feature.qpx)] = .{
394 .llvm_name = "qpx",
395 .description = "Enable QPX instructions",
396 .dependencies = featureSet(&[_]Feature{
397 .fpu,
398 }),
399 };
400433 result[@enumToInt(Feature.recipprec)] = .{
401434 .llvm_name = "recipprec",
402435 .description = "Assume higher precision reciprocal estimates",
......@@ -452,94 +485,90 @@ pub const all_features = blk: {
452485};
453486
454487pub const cpu = struct {
455 pub const @"ppc440" = CpuModel{
456 .name = "ppc440",
488 pub const @"440" = CpuModel{
489 .name = "440",
457490 .llvm_name = "440",
458491 .features = featureSet(&[_]Feature{
459 .booke,
460492 .fres,
461493 .frsqrte,
462 .icbt,
463494 .isel,
464495 .msync,
465496 }),
466497 };
467 pub const @"ppc450" = CpuModel{
468 .name = "ppc450",
498 pub const @"450" = CpuModel{
499 .name = "450",
469500 .llvm_name = "450",
470501 .features = featureSet(&[_]Feature{
471 .booke,
472502 .fres,
473503 .frsqrte,
474 .icbt,
475504 .isel,
476505 .msync,
477506 }),
478507 };
479 pub const @"ppc601" = CpuModel{
480 .name = "ppc601",
508 pub const @"601" = CpuModel{
509 .name = "601",
481510 .llvm_name = "601",
482511 .features = featureSet(&[_]Feature{
483512 .fpu,
484513 }),
485514 };
486 pub const @"ppc602" = CpuModel{
487 .name = "ppc602",
515 pub const @"602" = CpuModel{
516 .name = "602",
488517 .llvm_name = "602",
489518 .features = featureSet(&[_]Feature{
490519 .fpu,
491520 }),
492521 };
493 pub const @"ppc603" = CpuModel{
494 .name = "ppc603",
522 pub const @"603" = CpuModel{
523 .name = "603",
495524 .llvm_name = "603",
496525 .features = featureSet(&[_]Feature{
497526 .fres,
498527 .frsqrte,
499528 }),
500529 };
501 pub const @"ppc603e" = CpuModel{
502 .name = "ppc603e",
530 pub const @"603e" = CpuModel{
531 .name = "603e",
503532 .llvm_name = "603e",
504533 .features = featureSet(&[_]Feature{
505534 .fres,
506535 .frsqrte,
507536 }),
508537 };
509 pub const @"ppc603ev" = CpuModel{
510 .name = "ppc603ev",
538 pub const @"603ev" = CpuModel{
539 .name = "603ev",
511540 .llvm_name = "603ev",
512541 .features = featureSet(&[_]Feature{
513542 .fres,
514543 .frsqrte,
515544 }),
516545 };
517 pub const @"ppc604" = CpuModel{
518 .name = "ppc604",
546 pub const @"604" = CpuModel{
547 .name = "604",
519548 .llvm_name = "604",
520549 .features = featureSet(&[_]Feature{
521550 .fres,
522551 .frsqrte,
523552 }),
524553 };
525 pub const @"ppc604e" = CpuModel{
526 .name = "ppc604e",
554 pub const @"604e" = CpuModel{
555 .name = "604e",
527556 .llvm_name = "604e",
528557 .features = featureSet(&[_]Feature{
529558 .fres,
530559 .frsqrte,
531560 }),
532561 };
533 pub const @"ppc620" = CpuModel{
534 .name = "ppc620",
562 pub const @"620" = CpuModel{
563 .name = "620",
535564 .llvm_name = "620",
536565 .features = featureSet(&[_]Feature{
537566 .fres,
538567 .frsqrte,
539568 }),
540569 };
541 pub const @"ppc7400" = CpuModel{
542 .name = "ppc7400",
570 pub const @"7400" = CpuModel{
571 .name = "7400",
543572 .llvm_name = "7400",
544573 .features = featureSet(&[_]Feature{
545574 .altivec,
......@@ -547,8 +576,8 @@ pub const cpu = struct {
547576 .frsqrte,
548577 }),
549578 };
550 pub const @"ppc7450" = CpuModel{
551 .name = "ppc7450",
579 pub const @"7450" = CpuModel{
580 .name = "7450",
552581 .llvm_name = "7450",
553582 .features = featureSet(&[_]Feature{
554583 .altivec,
......@@ -556,16 +585,16 @@ pub const cpu = struct {
556585 .frsqrte,
557586 }),
558587 };
559 pub const @"ppc750" = CpuModel{
560 .name = "ppc750",
588 pub const @"750" = CpuModel{
589 .name = "750",
561590 .llvm_name = "750",
562591 .features = featureSet(&[_]Feature{
563592 .fres,
564593 .frsqrte,
565594 }),
566595 };
567 pub const @"ppc970" = CpuModel{
568 .name = "ppc970",
596 pub const @"970" = CpuModel{
597 .name = "970",
569598 .llvm_name = "970",
570599 .features = featureSet(&[_]Feature{
571600 .@"64bit",
......@@ -592,7 +621,6 @@ pub const cpu = struct {
592621 .frsqrte,
593622 .frsqrtes,
594623 .fsqrt,
595 .icbt,
596624 .isel,
597625 .ldbrx,
598626 .lfiwax,
......@@ -602,38 +630,10 @@ pub const cpu = struct {
602630 .stfiwx,
603631 }),
604632 };
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 };
631633 pub const e500 = CpuModel{
632634 .name = "e500",
633635 .llvm_name = "e500",
634636 .features = featureSet(&[_]Feature{
635 .booke,
636 .icbt,
637637 .isel,
638638 .msync,
639639 .spe,
......@@ -644,7 +644,6 @@ pub const cpu = struct {
644644 .llvm_name = "e500mc",
645645 .features = featureSet(&[_]Feature{
646646 .booke,
647 .icbt,
648647 .isel,
649648 .stfiwx,
650649 }),
......@@ -655,7 +654,6 @@ pub const cpu = struct {
655654 .features = featureSet(&[_]Feature{
656655 .@"64bit",
657656 .booke,
658 .icbt,
659657 .isel,
660658 .mfocrf,
661659 .stfiwx,
......@@ -667,7 +665,6 @@ pub const cpu = struct {
667665 .features = featureSet(&[_]Feature{
668666 .@"64bit",
669667 .allow_unaligned_fp_access,
670 .altivec,
671668 .bpermd,
672669 .cmpb,
673670 .crypto,
......@@ -681,28 +678,24 @@ pub const cpu = struct {
681678 .frsqrte,
682679 .frsqrtes,
683680 .fsqrt,
681 .fuse_store,
684682 .htm,
685683 .icbt,
686 .isa_v30_instructions,
687 .isa_v31_instructions,
688684 .isel,
689685 .ldbrx,
690686 .lfiwax,
691687 .mfocrf,
688 .mma,
692689 .partword_atomics,
693690 .pcrelative_memops,
694691 .popcntd,
695692 .power10_vector,
696 .power8_altivec,
697 .power8_vector,
698 .power9_altivec,
699 .power9_vector,
693 .ppc_postra_sched,
694 .ppc_prera_sched,
700695 .predictable_select_expensive,
701 .prefix_instrs,
702696 .recipprec,
703697 .stfiwx,
704698 .two_const_nr,
705 .vsx,
706699 }),
707700 };
708701 pub const g3 = CpuModel{
......@@ -760,7 +753,7 @@ pub const cpu = struct {
760753 };
761754 pub const ppc32 = CpuModel{
762755 .name = "ppc32",
763 .llvm_name = "ppc",
756 .llvm_name = "ppc32",
764757 .features = featureSet(&[_]Feature{
765758 .hard_float,
766759 }),
......@@ -784,7 +777,6 @@ pub const cpu = struct {
784777 .features = featureSet(&[_]Feature{
785778 .@"64bit",
786779 .allow_unaligned_fp_access,
787 .altivec,
788780 .bpermd,
789781 .cmpb,
790782 .crypto,
......@@ -808,13 +800,11 @@ pub const cpu = struct {
808800 .mfocrf,
809801 .partword_atomics,
810802 .popcntd,
811 .power8_altivec,
812803 .power8_vector,
813804 .predictable_select_expensive,
814805 .recipprec,
815806 .stfiwx,
816807 .two_const_nr,
817 .vsx,
818808 }),
819809 };
820810 pub const pwr10 = CpuModel{
......@@ -823,7 +813,6 @@ pub const cpu = struct {
823813 .features = featureSet(&[_]Feature{
824814 .@"64bit",
825815 .allow_unaligned_fp_access,
826 .altivec,
827816 .bpermd,
828817 .cmpb,
829818 .crypto,
......@@ -837,28 +826,24 @@ pub const cpu = struct {
837826 .frsqrte,
838827 .frsqrtes,
839828 .fsqrt,
829 .fuse_store,
840830 .htm,
841831 .icbt,
842 .isa_v30_instructions,
843 .isa_v31_instructions,
844832 .isel,
845833 .ldbrx,
846834 .lfiwax,
847835 .mfocrf,
836 .mma,
848837 .partword_atomics,
849838 .pcrelative_memops,
850839 .popcntd,
851840 .power10_vector,
852 .power8_altivec,
853 .power8_vector,
854 .power9_altivec,
855 .power9_vector,
841 .ppc_postra_sched,
842 .ppc_prera_sched,
856843 .predictable_select_expensive,
857 .prefix_instrs,
858844 .recipprec,
859845 .stfiwx,
860846 .two_const_nr,
861 .vsx,
862847 }),
863848 };
864849 pub const pwr3 = CpuModel{
......@@ -963,7 +948,6 @@ pub const cpu = struct {
963948 .features = featureSet(&[_]Feature{
964949 .@"64bit",
965950 .allow_unaligned_fp_access,
966 .altivec,
967951 .bpermd,
968952 .cmpb,
969953 .extdiv,
......@@ -992,7 +976,6 @@ pub const cpu = struct {
992976 .features = featureSet(&[_]Feature{
993977 .@"64bit",
994978 .allow_unaligned_fp_access,
995 .altivec,
996979 .bpermd,
997980 .cmpb,
998981 .crypto,
......@@ -1016,13 +999,11 @@ pub const cpu = struct {
1016999 .mfocrf,
10171000 .partword_atomics,
10181001 .popcntd,
1019 .power8_altivec,
10201002 .power8_vector,
10211003 .predictable_select_expensive,
10221004 .recipprec,
10231005 .stfiwx,
10241006 .two_const_nr,
1025 .vsx,
10261007 }),
10271008 };
10281009 pub const pwr9 = CpuModel{
......@@ -1031,7 +1012,6 @@ pub const cpu = struct {
10311012 .features = featureSet(&[_]Feature{
10321013 .@"64bit",
10331014 .allow_unaligned_fp_access,
1034 .altivec,
10351015 .bpermd,
10361016 .cmpb,
10371017 .crypto,
......@@ -1047,16 +1027,12 @@ pub const cpu = struct {
10471027 .fsqrt,
10481028 .htm,
10491029 .icbt,
1050 .isa_v30_instructions,
10511030 .isel,
10521031 .ldbrx,
10531032 .lfiwax,
10541033 .mfocrf,
10551034 .partword_atomics,
10561035 .popcntd,
1057 .power8_altivec,
1058 .power8_vector,
1059 .power9_altivec,
10601036 .power9_vector,
10611037 .ppc_postra_sched,
10621038 .ppc_prera_sched,
......@@ -1065,7 +1041,6 @@ pub const cpu = struct {
10651041 .stfiwx,
10661042 .two_const_nr,
10671043 .vectors_use_two_units,
1068 .vsx,
10691044 }),
10701045 };
10711046};
lib/std/target/riscv.zig+67-11
......@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const CpuModel = std.Target.Cpu.Model;
......@@ -15,6 +12,7 @@ pub const Feature = enum {
1512 e,
1613 experimental_b,
1714 experimental_v,
15 experimental_zba,
1816 experimental_zbb,
1917 experimental_zbc,
2018 experimental_zbe,
......@@ -25,6 +23,9 @@ pub const Feature = enum {
2523 experimental_zbr,
2624 experimental_zbs,
2725 experimental_zbt,
26 experimental_zfh,
27 experimental_zvamo,
28 experimental_zvlsseg,
2829 f,
2930 m,
3031 no_rvc_hints,
......@@ -100,6 +101,7 @@ pub const all_features = blk: {
100101 .llvm_name = "experimental-b",
101102 .description = "'B' (Bit Manipulation Instructions)",
102103 .dependencies = featureSet(&[_]Feature{
104 .experimental_zba,
103105 .experimental_zbb,
104106 .experimental_zbc,
105107 .experimental_zbe,
......@@ -114,9 +116,12 @@ pub const all_features = blk: {
114116 result[@enumToInt(Feature.experimental_v)] = .{
115117 .llvm_name = "experimental-v",
116118 .description = "'V' (Vector Instructions)",
117 .dependencies = featureSet(&[_]Feature{
118 .f,
119 }),
119 .dependencies = featureSet(&[_]Feature{}),
120 };
121 result[@enumToInt(Feature.experimental_zba)] = .{
122 .llvm_name = "experimental-zba",
123 .description = "'Zba' (Address calculation 'B' Instructions)",
124 .dependencies = featureSet(&[_]Feature{}),
120125 };
121126 result[@enumToInt(Feature.experimental_zbb)] = .{
122127 .llvm_name = "experimental-zbb",
......@@ -168,6 +173,27 @@ pub const all_features = blk: {
168173 .description = "'Zbt' (Ternary 'B' Instructions)",
169174 .dependencies = featureSet(&[_]Feature{}),
170175 };
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 };
171197 result[@enumToInt(Feature.f)] = .{
172198 .llvm_name = "f",
173199 .description = "'F' (Single-Precision Floating-Point)",
......@@ -364,7 +390,6 @@ pub const cpu = struct {
364390 .a,
365391 .c,
366392 .d,
367 .f,
368393 .m,
369394 }),
370395 };
......@@ -376,7 +401,6 @@ pub const cpu = struct {
376401 .a,
377402 .c,
378403 .d,
379 .f,
380404 .m,
381405 }),
382406 };
......@@ -404,6 +428,18 @@ pub const cpu = struct {
404428 .@"64bit",
405429 }),
406430 };
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 };
407443 pub const sifive_e31 = CpuModel{
408444 .name = "sifive_e31",
409445 .llvm_name = "sifive-e31",
......@@ -413,6 +449,16 @@ pub const cpu = struct {
413449 .m,
414450 }),
415451 };
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 };
416462 pub const sifive_u54 = CpuModel{
417463 .name = "sifive_u54",
418464 .llvm_name = "sifive-u54",
......@@ -421,7 +467,17 @@ pub const cpu = struct {
421467 .a,
422468 .c,
423469 .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,
425481 .m,
426482 }),
427483 };
lib/std/target/sparc.zig+7-5
......@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const CpuModel = std.Target.Cpu.Model;
......@@ -160,6 +157,11 @@ pub const cpu = struct {
160157 .llvm_name = "f934",
161158 .features = featureSet(&[_]Feature{}),
162159 };
160 pub const generic = CpuModel{
161 .name = "generic",
162 .llvm_name = "generic",
163 .features = featureSet(&[_]Feature{}),
164 };
163165 pub const gr712rc = CpuModel{
164166 .name = "gr712rc",
165167 .llvm_name = "gr712rc",
lib/std/target/systemz.zig+2-5
......@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const 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// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const CpuModel = std.Target.Cpu.Model;
lib/std/target/x86.zig+470-320
......@@ -1,13 +1,12 @@
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2015-2021 Zig Contributors
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.
1//! This file is auto-generated by tools/update_cpu_features.zig.
2
63const std = @import("../std.zig");
74const CpuFeature = std.Target.Cpu.Feature;
85const CpuModel = std.Target.Cpu.Model;
96
107pub const Feature = enum {
8 @"16bit_mode",
9 @"32bit_mode",
1110 @"3dnow",
1211 @"3dnowa",
1312 @"64bit",
......@@ -33,6 +32,7 @@ pub const Feature = enum {
3332 avx512vnni,
3433 avx512vp2intersect,
3534 avx512vpopcntdq,
35 avxvnni,
3636 bmi,
3737 bmi2,
3838 branchfusion,
......@@ -64,11 +64,14 @@ pub const Feature = enum {
6464 fma,
6565 fma4,
6666 fsgsbase,
67 fsrm,
6768 fxsr,
6869 gfni,
70 hreset,
6971 idivl_to_divb,
7072 idivq_to_divl,
7173 invpcid,
74 kl,
7275 lea_sp,
7376 lea_uses_ag,
7477 lvi_cfi,
......@@ -76,12 +79,10 @@ pub const Feature = enum {
7679 lwp,
7780 lzcnt,
7881 macrofusion,
79 merge_to_threeway_branch,
8082 mmx,
8183 movbe,
8284 movdir64b,
8385 movdiri,
84 mpx,
8586 mwaitx,
8687 nopl,
8788 pad_short_functions,
......@@ -120,15 +121,16 @@ pub const Feature = enum {
120121 slow_unaligned_mem_32,
121122 soft_float,
122123 sse,
123 sse_unaligned_mem,
124124 sse2,
125125 sse3,
126126 sse4_1,
127127 sse4_2,
128128 sse4a,
129 sse_unaligned_mem,
129130 ssse3,
130131 tbm,
131132 tsxldtrk,
133 uintr,
132134 use_aa,
133135 use_glm_div_sqrt_costs,
134136 vaes,
......@@ -136,6 +138,7 @@ pub const Feature = enum {
136138 vzeroupper,
137139 waitpkg,
138140 wbnoinvd,
141 widekl,
139142 x87,
140143 xop,
141144 xsave,
......@@ -150,6 +153,16 @@ pub const all_features = blk: {
150153 const len = @typeInfo(Feature).Enum.fields.len;
151154 std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
152155 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 };
153166 result[@enumToInt(Feature.@"3dnow")] = .{
154167 .llvm_name = "3dnow",
155168 .description = "Enable 3DNow! instructions",
......@@ -321,6 +334,13 @@ pub const all_features = blk: {
321334 .avx512f,
322335 }),
323336 };
337 result[@enumToInt(Feature.avxvnni)] = .{
338 .llvm_name = "avxvnni",
339 .description = "Support AVX_VNNI encoding",
340 .dependencies = featureSet(&[_]Feature{
341 .avx2,
342 }),
343 };
324344 result[@enumToInt(Feature.bmi)] = .{
325345 .llvm_name = "bmi",
326346 .description = "Support BMI instructions",
......@@ -485,6 +505,11 @@ pub const all_features = blk: {
485505 .description = "Support FS/GS Base instructions",
486506 .dependencies = featureSet(&[_]Feature{}),
487507 };
508 result[@enumToInt(Feature.fsrm)] = .{
509 .llvm_name = "fsrm",
510 .description = "REP MOVSB of short lengths is faster",
511 .dependencies = featureSet(&[_]Feature{}),
512 };
488513 result[@enumToInt(Feature.fxsr)] = .{
489514 .llvm_name = "fxsr",
490515 .description = "Support fxsave/fxrestore instructions",
......@@ -497,6 +522,11 @@ pub const all_features = blk: {
497522 .sse2,
498523 }),
499524 };
525 result[@enumToInt(Feature.hreset)] = .{
526 .llvm_name = "hreset",
527 .description = "Has hreset instruction",
528 .dependencies = featureSet(&[_]Feature{}),
529 };
500530 result[@enumToInt(Feature.idivl_to_divb)] = .{
501531 .llvm_name = "idivl-to-divb",
502532 .description = "Use 8-bit divide for positive values less than 256",
......@@ -512,6 +542,13 @@ pub const all_features = blk: {
512542 .description = "Invalidate Process-Context Identifier",
513543 .dependencies = featureSet(&[_]Feature{}),
514544 };
545 result[@enumToInt(Feature.kl)] = .{
546 .llvm_name = "kl",
547 .description = "Support Key Locker kl Instructions",
548 .dependencies = featureSet(&[_]Feature{
549 .sse2,
550 }),
551 };
515552 result[@enumToInt(Feature.lea_sp)] = .{
516553 .llvm_name = "lea-sp",
517554 .description = "Use LEA for adjusting the stack pointer",
......@@ -547,11 +584,6 @@ pub const all_features = blk: {
547584 .description = "Various instructions can be fused with conditional branches",
548585 .dependencies = featureSet(&[_]Feature{}),
549586 };
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 };
555587 result[@enumToInt(Feature.mmx)] = .{
556588 .llvm_name = "mmx",
557589 .description = "Enable MMX instructions",
......@@ -572,11 +604,6 @@ pub const all_features = blk: {
572604 .description = "Support movdiri instruction",
573605 .dependencies = featureSet(&[_]Feature{}),
574606 };
575 result[@enumToInt(Feature.mpx)] = .{
576 .llvm_name = "mpx",
577 .description = "Deprecated. Support MPX instructions",
578 .dependencies = featureSet(&[_]Feature{}),
579 };
580607 result[@enumToInt(Feature.mwaitx)] = .{
581608 .llvm_name = "mwaitx",
582609 .description = "Enable MONITORX/MWAITX timer functionality",
......@@ -691,7 +718,7 @@ pub const all_features = blk: {
691718 };
692719 result[@enumToInt(Feature.sahf)] = .{
693720 .llvm_name = "sahf",
694 .description = "Support LAHF and SAHF instructions",
721 .description = "Support LAHF and SAHF instructions in 64-bit mode",
695722 .dependencies = featureSet(&[_]Feature{}),
696723 };
697724 result[@enumToInt(Feature.serialize)] = .{
......@@ -778,11 +805,6 @@ pub const all_features = blk: {
778805 .description = "Enable SSE instructions",
779806 .dependencies = featureSet(&[_]Feature{}),
780807 };
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 };
786808 result[@enumToInt(Feature.sse2)] = .{
787809 .llvm_name = "sse2",
788810 .description = "Enable SSE2 instructions",
......@@ -818,6 +840,11 @@ pub const all_features = blk: {
818840 .sse3,
819841 }),
820842 };
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 };
821848 result[@enumToInt(Feature.ssse3)] = .{
822849 .llvm_name = "ssse3",
823850 .description = "Enable SSSE3 instructions",
......@@ -835,6 +862,11 @@ pub const all_features = blk: {
835862 .description = "Support TSXLDTRK instructions",
836863 .dependencies = featureSet(&[_]Feature{}),
837864 };
865 result[@enumToInt(Feature.uintr)] = .{
866 .llvm_name = "uintr",
867 .description = "Has UINTR Instructions",
868 .dependencies = featureSet(&[_]Feature{}),
869 };
838870 result[@enumToInt(Feature.use_aa)] = .{
839871 .llvm_name = "use-aa",
840872 .description = "Use alias analysis during codegen",
......@@ -876,6 +908,13 @@ pub const all_features = blk: {
876908 .description = "Write Back No Invalidate",
877909 .dependencies = featureSet(&[_]Feature{}),
878910 };
911 result[@enumToInt(Feature.widekl)] = .{
912 .llvm_name = "widekl",
913 .description = "Support Key Locker wide Instructions",
914 .dependencies = featureSet(&[_]Feature{
915 .kl,
916 }),
917 };
879918 result[@enumToInt(Feature.x87)] = .{
880919 .llvm_name = "x87",
881920 .description = "Enable X87 float instructions",
......@@ -923,6 +962,97 @@ pub const all_features = blk: {
923962};
924963
925964pub 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 };
9261056 pub const amdfam10 = CpuModel{
9271057 .name = "amdfam10",
9281058 .llvm_name = "amdfam10",
......@@ -931,7 +1061,6 @@ pub const cpu = struct {
9311061 .@"64bit",
9321062 .cmov,
9331063 .cx16,
934 .cx8,
9351064 .fast_scalar_shift_masks,
9361065 .fxsr,
9371066 .lzcnt,
......@@ -959,43 +1088,45 @@ pub const cpu = struct {
9591088 .x87,
9601089 }),
9611090 };
962 pub const athlon_4 = CpuModel{
963 .name = "athlon_4",
964 .llvm_name = "athlon-4",
1091 pub const athlon64 = CpuModel{
1092 .name = "athlon64",
1093 .llvm_name = "athlon64",
9651094 .features = featureSet(&[_]Feature{
9661095 .@"3dnowa",
1096 .@"64bit",
9671097 .cmov,
9681098 .cx8,
1099 .fast_scalar_shift_masks,
9691100 .fxsr,
9701101 .nopl,
9711102 .slow_shld,
9721103 .slow_unaligned_mem_16,
973 .sse,
1104 .sse2,
9741105 .vzeroupper,
9751106 .x87,
9761107 }),
9771108 };
978 pub const athlon_fx = CpuModel{
979 .name = "athlon_fx",
980 .llvm_name = "athlon-fx",
1109 pub const athlon64_sse3 = CpuModel{
1110 .name = "athlon64_sse3",
1111 .llvm_name = "athlon64-sse3",
9811112 .features = featureSet(&[_]Feature{
9821113 .@"3dnowa",
9831114 .@"64bit",
9841115 .cmov,
985 .cx8,
1116 .cx16,
9861117 .fast_scalar_shift_masks,
9871118 .fxsr,
9881119 .nopl,
9891120 .slow_shld,
9901121 .slow_unaligned_mem_16,
991 .sse2,
1122 .sse3,
9921123 .vzeroupper,
9931124 .x87,
9941125 }),
9951126 };
996 pub const athlon_mp = CpuModel{
997 .name = "athlon_mp",
998 .llvm_name = "athlon-mp",
1127 pub const athlon_4 = CpuModel{
1128 .name = "athlon_4",
1129 .llvm_name = "athlon-4",
9991130 .features = featureSet(&[_]Feature{
10001131 .@"3dnowa",
10011132 .cmov,
......@@ -1009,23 +1140,27 @@ pub const cpu = struct {
10091140 .x87,
10101141 }),
10111142 };
1012 pub const athlon_tbird = CpuModel{
1013 .name = "athlon_tbird",
1014 .llvm_name = "athlon-tbird",
1143 pub const athlon_fx = CpuModel{
1144 .name = "athlon_fx",
1145 .llvm_name = "athlon-fx",
10151146 .features = featureSet(&[_]Feature{
10161147 .@"3dnowa",
1148 .@"64bit",
10171149 .cmov,
10181150 .cx8,
1151 .fast_scalar_shift_masks,
1152 .fxsr,
10191153 .nopl,
10201154 .slow_shld,
10211155 .slow_unaligned_mem_16,
1156 .sse2,
10221157 .vzeroupper,
10231158 .x87,
10241159 }),
10251160 };
1026 pub const athlon_xp = CpuModel{
1027 .name = "athlon_xp",
1028 .llvm_name = "athlon-xp",
1161 pub const athlon_mp = CpuModel{
1162 .name = "athlon_mp",
1163 .llvm_name = "athlon-mp",
10291164 .features = featureSet(&[_]Feature{
10301165 .@"3dnowa",
10311166 .cmov,
......@@ -1039,39 +1174,32 @@ pub const cpu = struct {
10391174 .x87,
10401175 }),
10411176 };
1042 pub const athlon64 = CpuModel{
1043 .name = "athlon64",
1044 .llvm_name = "athlon64",
1177 pub const athlon_tbird = CpuModel{
1178 .name = "athlon_tbird",
1179 .llvm_name = "athlon-tbird",
10451180 .features = featureSet(&[_]Feature{
10461181 .@"3dnowa",
1047 .@"64bit",
10481182 .cmov,
10491183 .cx8,
1050 .fast_scalar_shift_masks,
1051 .fxsr,
10521184 .nopl,
10531185 .slow_shld,
10541186 .slow_unaligned_mem_16,
1055 .sse2,
10561187 .vzeroupper,
10571188 .x87,
10581189 }),
10591190 };
1060 pub const athlon64_sse3 = CpuModel{
1061 .name = "athlon64_sse3",
1062 .llvm_name = "athlon64-sse3",
1191 pub const athlon_xp = CpuModel{
1192 .name = "athlon_xp",
1193 .llvm_name = "athlon-xp",
10631194 .features = featureSet(&[_]Feature{
10641195 .@"3dnowa",
1065 .@"64bit",
10661196 .cmov,
1067 .cx16,
10681197 .cx8,
1069 .fast_scalar_shift_masks,
10701198 .fxsr,
10711199 .nopl,
10721200 .slow_shld,
10731201 .slow_unaligned_mem_16,
1074 .sse3,
1202 .sse,
10751203 .vzeroupper,
10761204 .x87,
10771205 }),
......@@ -1083,7 +1211,6 @@ pub const cpu = struct {
10831211 .@"64bit",
10841212 .cmov,
10851213 .cx16,
1086 .cx8,
10871214 .fxsr,
10881215 .idivl_to_divb,
10891216 .idivq_to_divl,
......@@ -1109,7 +1236,6 @@ pub const cpu = struct {
11091236 .@"64bit",
11101237 .cmov,
11111238 .cx16,
1112 .cx8,
11131239 .fast_scalar_shift_masks,
11141240 .fxsr,
11151241 .lzcnt,
......@@ -1132,7 +1258,6 @@ pub const cpu = struct {
11321258 .branchfusion,
11331259 .cmov,
11341260 .cx16,
1135 .cx8,
11361261 .fast_11bytenop,
11371262 .fast_scalar_shift_masks,
11381263 .fxsr,
......@@ -1161,7 +1286,6 @@ pub const cpu = struct {
11611286 .branchfusion,
11621287 .cmov,
11631288 .cx16,
1164 .cx8,
11651289 .f16c,
11661290 .fast_11bytenop,
11671291 .fast_bextr,
......@@ -1194,7 +1318,6 @@ pub const cpu = struct {
11941318 .branchfusion,
11951319 .cmov,
11961320 .cx16,
1197 .cx8,
11981321 .f16c,
11991322 .fast_11bytenop,
12001323 .fast_bextr,
......@@ -1215,7 +1338,6 @@ pub const cpu = struct {
12151338 .vzeroupper,
12161339 .x87,
12171340 .xop,
1218 .xsave,
12191341 .xsaveopt,
12201342 }),
12211343 };
......@@ -1231,7 +1353,6 @@ pub const cpu = struct {
12311353 .branchfusion,
12321354 .cmov,
12331355 .cx16,
1234 .cx8,
12351356 .f16c,
12361357 .fast_11bytenop,
12371358 .fast_bextr,
......@@ -1255,7 +1376,6 @@ pub const cpu = struct {
12551376 .vzeroupper,
12561377 .x87,
12571378 .xop,
1258 .xsave,
12591379 .xsaveopt,
12601380 }),
12611381 };
......@@ -1266,7 +1386,6 @@ pub const cpu = struct {
12661386 .@"64bit",
12671387 .cmov,
12681388 .cx16,
1269 .cx8,
12701389 .fxsr,
12711390 .idivl_to_divb,
12721391 .idivq_to_divl,
......@@ -1290,13 +1409,11 @@ pub const cpu = struct {
12901409 .features = featureSet(&[_]Feature{
12911410 .@"64bit",
12921411 .adx,
1293 .avx,
12941412 .avx2,
12951413 .bmi,
12961414 .bmi2,
12971415 .cmov,
12981416 .cx16,
1299 .cx8,
13001417 .ermsb,
13011418 .f16c,
13021419 .false_deps_lzcnt_tzcnt,
......@@ -1312,7 +1429,6 @@ pub const cpu = struct {
13121429 .invpcid,
13131430 .lzcnt,
13141431 .macrofusion,
1315 .merge_to_threeway_branch,
13161432 .mmx,
13171433 .movbe,
13181434 .nopl,
......@@ -1323,10 +1439,8 @@ pub const cpu = struct {
13231439 .rdseed,
13241440 .sahf,
13251441 .slow_3ops_lea,
1326 .sse4_2,
13271442 .vzeroupper,
13281443 .x87,
1329 .xsave,
13301444 .xsaveopt,
13311445 }),
13321446 };
......@@ -1337,7 +1451,6 @@ pub const cpu = struct {
13371451 .@"64bit",
13381452 .cmov,
13391453 .cx16,
1340 .cx8,
13411454 .fast_15bytenop,
13421455 .fast_scalar_shift_masks,
13431456 .fast_vector_shift_masks,
......@@ -1361,11 +1474,9 @@ pub const cpu = struct {
13611474 .features = featureSet(&[_]Feature{
13621475 .@"64bit",
13631476 .aes,
1364 .avx,
13651477 .bmi,
13661478 .cmov,
13671479 .cx16,
1368 .cx8,
13691480 .f16c,
13701481 .fast_15bytenop,
13711482 .fast_bextr,
......@@ -1384,9 +1495,7 @@ pub const cpu = struct {
13841495 .sahf,
13851496 .slow_shld,
13861497 .sse4a,
1387 .ssse3,
13881498 .x87,
1389 .xsave,
13901499 .xsaveopt,
13911500 }),
13921501 };
......@@ -1421,12 +1530,8 @@ pub const cpu = struct {
14211530 .@"64bit",
14221531 .adx,
14231532 .aes,
1424 .avx,
1425 .avx2,
1426 .avx512bw,
14271533 .avx512cd,
14281534 .avx512dq,
1429 .avx512f,
14301535 .avx512ifma,
14311536 .avx512vbmi,
14321537 .avx512vl,
......@@ -1435,23 +1540,19 @@ pub const cpu = struct {
14351540 .clflushopt,
14361541 .cmov,
14371542 .cx16,
1438 .cx8,
14391543 .ermsb,
1440 .f16c,
14411544 .fast_15bytenop,
14421545 .fast_gather,
14431546 .fast_scalar_fsqrt,
14441547 .fast_shld_rotate,
14451548 .fast_variable_shuffle,
14461549 .fast_vector_fsqrt,
1447 .fma,
14481550 .fsgsbase,
14491551 .fxsr,
14501552 .idivq_to_divl,
14511553 .invpcid,
14521554 .lzcnt,
14531555 .macrofusion,
1454 .merge_to_threeway_branch,
14551556 .mmx,
14561557 .movbe,
14571558 .nopl,
......@@ -1466,10 +1567,8 @@ pub const cpu = struct {
14661567 .sgx,
14671568 .sha,
14681569 .slow_3ops_lea,
1469 .sse4_2,
14701570 .vzeroupper,
14711571 .x87,
1472 .xsave,
14731572 .xsavec,
14741573 .xsaveopt,
14751574 .xsaves,
......@@ -1482,12 +1581,9 @@ pub const cpu = struct {
14821581 .@"64bit",
14831582 .adx,
14841583 .aes,
1485 .avx,
1486 .avx2,
14871584 .avx512bw,
14881585 .avx512cd,
14891586 .avx512dq,
1490 .avx512f,
14911587 .avx512vl,
14921588 .avx512vnni,
14931589 .bmi,
......@@ -1496,9 +1592,7 @@ pub const cpu = struct {
14961592 .clwb,
14971593 .cmov,
14981594 .cx16,
1499 .cx8,
15001595 .ermsb,
1501 .f16c,
15021596 .false_deps_popcnt,
15031597 .fast_15bytenop,
15041598 .fast_gather,
......@@ -1506,14 +1600,12 @@ pub const cpu = struct {
15061600 .fast_shld_rotate,
15071601 .fast_variable_shuffle,
15081602 .fast_vector_fsqrt,
1509 .fma,
15101603 .fsgsbase,
15111604 .fxsr,
15121605 .idivq_to_divl,
15131606 .invpcid,
15141607 .lzcnt,
15151608 .macrofusion,
1516 .merge_to_threeway_branch,
15171609 .mmx,
15181610 .movbe,
15191611 .nopl,
......@@ -1526,10 +1618,8 @@ pub const cpu = struct {
15261618 .rdseed,
15271619 .sahf,
15281620 .slow_3ops_lea,
1529 .sse4_2,
15301621 .vzeroupper,
15311622 .x87,
1532 .xsave,
15331623 .xsavec,
15341624 .xsaveopt,
15351625 .xsaves,
......@@ -1542,13 +1632,9 @@ pub const cpu = struct {
15421632 .@"64bit",
15431633 .adx,
15441634 .aes,
1545 .avx,
1546 .avx2,
15471635 .avx512bf16,
1548 .avx512bw,
15491636 .avx512cd,
15501637 .avx512dq,
1551 .avx512f,
15521638 .avx512vl,
15531639 .avx512vnni,
15541640 .bmi,
......@@ -1557,9 +1643,7 @@ pub const cpu = struct {
15571643 .clwb,
15581644 .cmov,
15591645 .cx16,
1560 .cx8,
15611646 .ermsb,
1562 .f16c,
15631647 .false_deps_popcnt,
15641648 .fast_15bytenop,
15651649 .fast_gather,
......@@ -1567,14 +1651,12 @@ pub const cpu = struct {
15671651 .fast_shld_rotate,
15681652 .fast_variable_shuffle,
15691653 .fast_vector_fsqrt,
1570 .fma,
15711654 .fsgsbase,
15721655 .fxsr,
15731656 .idivq_to_divl,
15741657 .invpcid,
15751658 .lzcnt,
15761659 .macrofusion,
1577 .merge_to_threeway_branch,
15781660 .mmx,
15791661 .movbe,
15801662 .nopl,
......@@ -1587,47 +1669,29 @@ pub const cpu = struct {
15871669 .rdseed,
15881670 .sahf,
15891671 .slow_3ops_lea,
1590 .sse4_2,
15911672 .vzeroupper,
15921673 .x87,
1593 .xsave,
15941674 .xsavec,
15951675 .xsaveopt,
15961676 .xsaves,
15971677 }),
15981678 };
1599 pub const core_avx_i = CpuModel{
1600 .name = "core_avx_i",
1601 .llvm_name = "core-avx-i",
1679 pub const core2 = CpuModel{
1680 .name = "core2",
1681 .llvm_name = "core2",
16021682 .features = featureSet(&[_]Feature{
16031683 .@"64bit",
1604 .avx,
16051684 .cmov,
16061685 .cx16,
1607 .cx8,
1608 .f16c,
1609 .false_deps_popcnt,
1610 .fast_15bytenop,
1611 .fast_scalar_fsqrt,
1612 .fast_shld_rotate,
1613 .fsgsbase,
16141686 .fxsr,
1615 .idivq_to_divl,
16161687 .macrofusion,
1617 .merge_to_threeway_branch,
16181688 .mmx,
16191689 .nopl,
1620 .pclmul,
1621 .popcnt,
1622 .rdrnd,
16231690 .sahf,
1624 .slow_3ops_lea,
1625 .slow_unaligned_mem_32,
1626 .sse4_2,
1691 .slow_unaligned_mem_16,
1692 .ssse3,
16271693 .vzeroupper,
16281694 .x87,
1629 .xsave,
1630 .xsaveopt,
16311695 }),
16321696 };
16331697 pub const core_avx2 = CpuModel{
......@@ -1635,13 +1699,11 @@ pub const cpu = struct {
16351699 .llvm_name = "core-avx2",
16361700 .features = featureSet(&[_]Feature{
16371701 .@"64bit",
1638 .avx,
16391702 .avx2,
16401703 .bmi,
16411704 .bmi2,
16421705 .cmov,
16431706 .cx16,
1644 .cx8,
16451707 .ermsb,
16461708 .f16c,
16471709 .false_deps_lzcnt_tzcnt,
......@@ -1657,7 +1719,6 @@ pub const cpu = struct {
16571719 .invpcid,
16581720 .lzcnt,
16591721 .macrofusion,
1660 .merge_to_threeway_branch,
16611722 .mmx,
16621723 .movbe,
16631724 .nopl,
......@@ -1666,30 +1727,38 @@ pub const cpu = struct {
16661727 .rdrnd,
16671728 .sahf,
16681729 .slow_3ops_lea,
1669 .sse4_2,
16701730 .vzeroupper,
16711731 .x87,
1672 .xsave,
16731732 .xsaveopt,
16741733 }),
16751734 };
1676 pub const core2 = CpuModel{
1677 .name = "core2",
1678 .llvm_name = "core2",
1735 pub const core_avx_i = CpuModel{
1736 .name = "core_avx_i",
1737 .llvm_name = "core-avx-i",
16791738 .features = featureSet(&[_]Feature{
16801739 .@"64bit",
16811740 .cmov,
16821741 .cx16,
1683 .cx8,
1742 .f16c,
1743 .false_deps_popcnt,
1744 .fast_15bytenop,
1745 .fast_scalar_fsqrt,
1746 .fast_shld_rotate,
1747 .fsgsbase,
16841748 .fxsr,
1749 .idivq_to_divl,
16851750 .macrofusion,
16861751 .mmx,
16871752 .nopl,
1753 .pclmul,
1754 .popcnt,
1755 .rdrnd,
16881756 .sahf,
1689 .slow_unaligned_mem_16,
1690 .ssse3,
1757 .slow_3ops_lea,
1758 .slow_unaligned_mem_32,
16911759 .vzeroupper,
16921760 .x87,
1761 .xsaveopt,
16931762 }),
16941763 };
16951764 pub const corei7 = CpuModel{
......@@ -1699,7 +1768,6 @@ pub const cpu = struct {
16991768 .@"64bit",
17001769 .cmov,
17011770 .cx16,
1702 .cx8,
17031771 .fxsr,
17041772 .macrofusion,
17051773 .mmx,
......@@ -1719,7 +1787,6 @@ pub const cpu = struct {
17191787 .avx,
17201788 .cmov,
17211789 .cx16,
1722 .cx8,
17231790 .false_deps_popcnt,
17241791 .fast_15bytenop,
17251792 .fast_scalar_fsqrt,
......@@ -1727,7 +1794,6 @@ pub const cpu = struct {
17271794 .fxsr,
17281795 .idivq_to_divl,
17291796 .macrofusion,
1730 .merge_to_threeway_branch,
17311797 .mmx,
17321798 .nopl,
17331799 .pclmul,
......@@ -1735,10 +1801,8 @@ pub const cpu = struct {
17351801 .sahf,
17361802 .slow_3ops_lea,
17371803 .slow_unaligned_mem_32,
1738 .sse4_2,
17391804 .vzeroupper,
17401805 .x87,
1741 .xsave,
17421806 .xsaveopt,
17431807 }),
17441808 };
......@@ -1746,8 +1810,12 @@ pub const cpu = struct {
17461810 .name = "generic",
17471811 .llvm_name = "generic",
17481812 .features = featureSet(&[_]Feature{
1813 .@"64bit",
17491814 .cx8,
1750 .slow_unaligned_mem_16,
1815 .idivq_to_divl,
1816 .macrofusion,
1817 .slow_3ops_lea,
1818 .slow_incdec,
17511819 .vzeroupper,
17521820 .x87,
17531821 }),
......@@ -1772,7 +1840,6 @@ pub const cpu = struct {
17721840 .clflushopt,
17731841 .cmov,
17741842 .cx16,
1775 .cx8,
17761843 .false_deps_popcnt,
17771844 .fsgsbase,
17781845 .fxsr,
......@@ -1790,11 +1857,9 @@ pub const cpu = struct {
17901857 .slow_lea,
17911858 .slow_two_mem_ops,
17921859 .sse4_2,
1793 .ssse3,
17941860 .use_glm_div_sqrt_costs,
17951861 .vzeroupper,
17961862 .x87,
1797 .xsave,
17981863 .xsavec,
17991864 .xsaveopt,
18001865 .xsaves,
......@@ -1809,7 +1874,6 @@ pub const cpu = struct {
18091874 .clflushopt,
18101875 .cmov,
18111876 .cx16,
1812 .cx8,
18131877 .fsgsbase,
18141878 .fxsr,
18151879 .mmx,
......@@ -1829,11 +1893,9 @@ pub const cpu = struct {
18291893 .slow_lea,
18301894 .slow_two_mem_ops,
18311895 .sse4_2,
1832 .ssse3,
18331896 .use_glm_div_sqrt_costs,
18341897 .vzeroupper,
18351898 .x87,
1836 .xsave,
18371899 .xsavec,
18381900 .xsaveopt,
18391901 .xsaves,
......@@ -1844,13 +1906,11 @@ pub const cpu = struct {
18441906 .llvm_name = "haswell",
18451907 .features = featureSet(&[_]Feature{
18461908 .@"64bit",
1847 .avx,
18481909 .avx2,
18491910 .bmi,
18501911 .bmi2,
18511912 .cmov,
18521913 .cx16,
1853 .cx8,
18541914 .ermsb,
18551915 .f16c,
18561916 .false_deps_lzcnt_tzcnt,
......@@ -1866,7 +1926,6 @@ pub const cpu = struct {
18661926 .invpcid,
18671927 .lzcnt,
18681928 .macrofusion,
1869 .merge_to_threeway_branch,
18701929 .mmx,
18711930 .movbe,
18721931 .nopl,
......@@ -1875,66 +1934,20 @@ pub const cpu = struct {
18751934 .rdrnd,
18761935 .sahf,
18771936 .slow_3ops_lea,
1878 .sse4_2,
18791937 .vzeroupper,
18801938 .x87,
1881 .xsave,
18821939 .xsaveopt,
18831940 }),
18841941 };
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 };
19241942 pub const icelake_client = CpuModel{
19251943 .name = "icelake_client",
19261944 .llvm_name = "icelake-client",
19271945 .features = featureSet(&[_]Feature{
19281946 .@"64bit",
19291947 .adx,
1930 .aes,
1931 .avx,
1932 .avx2,
19331948 .avx512bitalg,
1934 .avx512bw,
19351949 .avx512cd,
19361950 .avx512dq,
1937 .avx512f,
19381951 .avx512ifma,
19391952 .avx512vbmi,
19401953 .avx512vbmi2,
......@@ -1947,28 +1960,24 @@ pub const cpu = struct {
19471960 .clwb,
19481961 .cmov,
19491962 .cx16,
1950 .cx8,
19511963 .ermsb,
1952 .f16c,
19531964 .fast_15bytenop,
19541965 .fast_gather,
19551966 .fast_scalar_fsqrt,
19561967 .fast_shld_rotate,
19571968 .fast_variable_shuffle,
19581969 .fast_vector_fsqrt,
1959 .fma,
19601970 .fsgsbase,
1971 .fsrm,
19611972 .fxsr,
19621973 .gfni,
19631974 .idivq_to_divl,
19641975 .invpcid,
19651976 .lzcnt,
19661977 .macrofusion,
1967 .merge_to_threeway_branch,
19681978 .mmx,
19691979 .movbe,
19701980 .nopl,
1971 .pclmul,
19721981 .pku,
19731982 .popcnt,
19741983 .prefer_256_bit,
......@@ -1980,12 +1989,10 @@ pub const cpu = struct {
19801989 .sgx,
19811990 .sha,
19821991 .slow_3ops_lea,
1983 .sse4_2,
19841992 .vaes,
19851993 .vpclmulqdq,
19861994 .vzeroupper,
19871995 .x87,
1988 .xsave,
19891996 .xsavec,
19901997 .xsaveopt,
19911998 .xsaves,
......@@ -1997,14 +2004,9 @@ pub const cpu = struct {
19972004 .features = featureSet(&[_]Feature{
19982005 .@"64bit",
19992006 .adx,
2000 .aes,
2001 .avx,
2002 .avx2,
20032007 .avx512bitalg,
2004 .avx512bw,
20052008 .avx512cd,
20062009 .avx512dq,
2007 .avx512f,
20082010 .avx512ifma,
20092011 .avx512vbmi,
20102012 .avx512vbmi2,
......@@ -2017,28 +2019,24 @@ pub const cpu = struct {
20172019 .clwb,
20182020 .cmov,
20192021 .cx16,
2020 .cx8,
20212022 .ermsb,
2022 .f16c,
20232023 .fast_15bytenop,
20242024 .fast_gather,
20252025 .fast_scalar_fsqrt,
20262026 .fast_shld_rotate,
20272027 .fast_variable_shuffle,
20282028 .fast_vector_fsqrt,
2029 .fma,
20302029 .fsgsbase,
2030 .fsrm,
20312031 .fxsr,
20322032 .gfni,
20332033 .idivq_to_divl,
20342034 .invpcid,
20352035 .lzcnt,
20362036 .macrofusion,
2037 .merge_to_threeway_branch,
20382037 .mmx,
20392038 .movbe,
20402039 .nopl,
2041 .pclmul,
20422040 .pconfig,
20432041 .pku,
20442042 .popcnt,
......@@ -2051,13 +2049,11 @@ pub const cpu = struct {
20512049 .sgx,
20522050 .sha,
20532051 .slow_3ops_lea,
2054 .sse4_2,
20552052 .vaes,
20562053 .vpclmulqdq,
20572054 .vzeroupper,
20582055 .wbnoinvd,
20592056 .x87,
2060 .xsave,
20612057 .xsavec,
20622058 .xsaveopt,
20632059 .xsaves,
......@@ -2068,10 +2064,8 @@ pub const cpu = struct {
20682064 .llvm_name = "ivybridge",
20692065 .features = featureSet(&[_]Feature{
20702066 .@"64bit",
2071 .avx,
20722067 .cmov,
20732068 .cx16,
2074 .cx8,
20752069 .f16c,
20762070 .false_deps_popcnt,
20772071 .fast_15bytenop,
......@@ -2081,7 +2075,6 @@ pub const cpu = struct {
20812075 .fxsr,
20822076 .idivq_to_divl,
20832077 .macrofusion,
2084 .merge_to_threeway_branch,
20852078 .mmx,
20862079 .nopl,
20872080 .pclmul,
......@@ -2090,10 +2083,8 @@ pub const cpu = struct {
20902083 .sahf,
20912084 .slow_3ops_lea,
20922085 .slow_unaligned_mem_32,
2093 .sse4_2,
20942086 .vzeroupper,
20952087 .x87,
2096 .xsave,
20972088 .xsaveopt,
20982089 }),
20992090 };
......@@ -2156,7 +2147,6 @@ pub const cpu = struct {
21562147 .@"64bit",
21572148 .cmov,
21582149 .cx16,
2159 .cx8,
21602150 .fast_scalar_shift_masks,
21612151 .fxsr,
21622152 .nopl,
......@@ -2176,16 +2166,12 @@ pub const cpu = struct {
21762166 .aes,
21772167 .avx512cd,
21782168 .avx512er,
2179 .avx512f,
21802169 .avx512pf,
21812170 .bmi,
21822171 .bmi2,
21832172 .cmov,
21842173 .cx16,
2185 .cx8,
2186 .f16c,
21872174 .fast_gather,
2188 .fma,
21892175 .fsgsbase,
21902176 .fxsr,
21912177 .idivq_to_divl,
......@@ -2206,7 +2192,6 @@ pub const cpu = struct {
22062192 .slow_pmaddwd,
22072193 .slow_two_mem_ops,
22082194 .x87,
2209 .xsave,
22102195 .xsaveopt,
22112196 }),
22122197 };
......@@ -2219,17 +2204,13 @@ pub const cpu = struct {
22192204 .aes,
22202205 .avx512cd,
22212206 .avx512er,
2222 .avx512f,
22232207 .avx512pf,
22242208 .avx512vpopcntdq,
22252209 .bmi,
22262210 .bmi2,
22272211 .cmov,
22282212 .cx16,
2229 .cx8,
2230 .f16c,
22312213 .fast_gather,
2232 .fma,
22332214 .fsgsbase,
22342215 .fxsr,
22352216 .idivq_to_divl,
......@@ -2250,7 +2231,6 @@ pub const cpu = struct {
22502231 .slow_pmaddwd,
22512232 .slow_two_mem_ops,
22522233 .x87,
2253 .xsave,
22542234 .xsaveopt,
22552235 }),
22562236 };
......@@ -2258,6 +2238,8 @@ pub const cpu = struct {
22582238 .name = "lakemont",
22592239 .llvm_name = "lakemont",
22602240 .features = featureSet(&[_]Feature{
2241 .cx8,
2242 .slow_unaligned_mem_16,
22612243 .vzeroupper,
22622244 }),
22632245 };
......@@ -2268,7 +2250,6 @@ pub const cpu = struct {
22682250 .@"64bit",
22692251 .cmov,
22702252 .cx16,
2271 .cx8,
22722253 .fxsr,
22732254 .macrofusion,
22742255 .mmx,
......@@ -2287,7 +2268,6 @@ pub const cpu = struct {
22872268 .@"64bit",
22882269 .cmov,
22892270 .cx16,
2290 .cx8,
22912271 .fxsr,
22922272 .mmx,
22932273 .nopl,
......@@ -2323,7 +2303,6 @@ pub const cpu = struct {
23232303 .@"64bit",
23242304 .cmov,
23252305 .cx16,
2326 .cx8,
23272306 .fast_scalar_shift_masks,
23282307 .fxsr,
23292308 .nopl,
......@@ -2341,7 +2320,6 @@ pub const cpu = struct {
23412320 .@"64bit",
23422321 .cmov,
23432322 .cx16,
2344 .cx8,
23452323 .fxsr,
23462324 .macrofusion,
23472325 .mmx,
......@@ -2363,32 +2341,6 @@ pub const cpu = struct {
23632341 .x87,
23642342 }),
23652343 };
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 };
23922344 pub const pentium2 = CpuModel{
23932345 .name = "pentium2",
23942346 .llvm_name = "pentium2",
......@@ -2463,6 +2415,32 @@ pub const cpu = struct {
24632415 .x87,
24642416 }),
24652417 };
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 };
24662444 pub const pentiumpro = CpuModel{
24672445 .name = "pentiumpro",
24682446 .llvm_name = "pentiumpro",
......@@ -2498,7 +2476,6 @@ pub const cpu = struct {
24982476 .avx,
24992477 .cmov,
25002478 .cx16,
2501 .cx8,
25022479 .false_deps_popcnt,
25032480 .fast_15bytenop,
25042481 .fast_scalar_fsqrt,
......@@ -2506,7 +2483,6 @@ pub const cpu = struct {
25062483 .fxsr,
25072484 .idivq_to_divl,
25082485 .macrofusion,
2509 .merge_to_threeway_branch,
25102486 .mmx,
25112487 .nopl,
25122488 .pclmul,
......@@ -2514,13 +2490,87 @@ pub const cpu = struct {
25142490 .sahf,
25152491 .slow_3ops_lea,
25162492 .slow_unaligned_mem_32,
2517 .sse4_2,
25182493 .vzeroupper,
25192494 .x87,
2520 .xsave,
25212495 .xsaveopt,
25222496 }),
25232497 };
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 };
25242574 pub const silvermont = CpuModel{
25252575 .name = "silvermont",
25262576 .llvm_name = "silvermont",
......@@ -2528,7 +2578,6 @@ pub const cpu = struct {
25282578 .@"64bit",
25292579 .cmov,
25302580 .cx16,
2531 .cx8,
25322581 .false_deps_popcnt,
25332582 .fast_7bytenop,
25342583 .fxsr,
......@@ -2546,7 +2595,6 @@ pub const cpu = struct {
25462595 .slow_pmulld,
25472596 .slow_two_mem_ops,
25482597 .sse4_2,
2549 .ssse3,
25502598 .vzeroupper,
25512599 .x87,
25522600 }),
......@@ -2558,12 +2606,9 @@ pub const cpu = struct {
25582606 .@"64bit",
25592607 .adx,
25602608 .aes,
2561 .avx,
2562 .avx2,
25632609 .avx512bw,
25642610 .avx512cd,
25652611 .avx512dq,
2566 .avx512f,
25672612 .avx512vl,
25682613 .bmi,
25692614 .bmi2,
......@@ -2571,9 +2616,7 @@ pub const cpu = struct {
25712616 .clwb,
25722617 .cmov,
25732618 .cx16,
2574 .cx8,
25752619 .ermsb,
2576 .f16c,
25772620 .false_deps_popcnt,
25782621 .fast_15bytenop,
25792622 .fast_gather,
......@@ -2581,14 +2624,12 @@ pub const cpu = struct {
25812624 .fast_shld_rotate,
25822625 .fast_variable_shuffle,
25832626 .fast_vector_fsqrt,
2584 .fma,
25852627 .fsgsbase,
25862628 .fxsr,
25872629 .idivq_to_divl,
25882630 .invpcid,
25892631 .lzcnt,
25902632 .macrofusion,
2591 .merge_to_threeway_branch,
25922633 .mmx,
25932634 .movbe,
25942635 .nopl,
......@@ -2601,10 +2642,8 @@ pub const cpu = struct {
26012642 .rdseed,
26022643 .sahf,
26032644 .slow_3ops_lea,
2604 .sse4_2,
26052645 .vzeroupper,
26062646 .x87,
2607 .xsave,
26082647 .xsavec,
26092648 .xsaveopt,
26102649 .xsaves,
......@@ -2617,14 +2656,12 @@ pub const cpu = struct {
26172656 .@"64bit",
26182657 .adx,
26192658 .aes,
2620 .avx,
26212659 .avx2,
26222660 .bmi,
26232661 .bmi2,
26242662 .clflushopt,
26252663 .cmov,
26262664 .cx16,
2627 .cx8,
26282665 .ermsb,
26292666 .f16c,
26302667 .false_deps_popcnt,
......@@ -2641,7 +2678,6 @@ pub const cpu = struct {
26412678 .invpcid,
26422679 .lzcnt,
26432680 .macrofusion,
2644 .merge_to_threeway_branch,
26452681 .mmx,
26462682 .movbe,
26472683 .nopl,
......@@ -2653,10 +2689,8 @@ pub const cpu = struct {
26532689 .sahf,
26542690 .sgx,
26552691 .slow_3ops_lea,
2656 .sse4_2,
26572692 .vzeroupper,
26582693 .x87,
2659 .xsave,
26602694 .xsavec,
26612695 .xsaveopt,
26622696 .xsaves,
......@@ -2669,12 +2703,9 @@ pub const cpu = struct {
26692703 .@"64bit",
26702704 .adx,
26712705 .aes,
2672 .avx,
2673 .avx2,
26742706 .avx512bw,
26752707 .avx512cd,
26762708 .avx512dq,
2677 .avx512f,
26782709 .avx512vl,
26792710 .bmi,
26802711 .bmi2,
......@@ -2682,9 +2713,7 @@ pub const cpu = struct {
26822713 .clwb,
26832714 .cmov,
26842715 .cx16,
2685 .cx8,
26862716 .ermsb,
2687 .f16c,
26882717 .false_deps_popcnt,
26892718 .fast_15bytenop,
26902719 .fast_gather,
......@@ -2692,14 +2721,12 @@ pub const cpu = struct {
26922721 .fast_shld_rotate,
26932722 .fast_variable_shuffle,
26942723 .fast_vector_fsqrt,
2695 .fma,
26962724 .fsgsbase,
26972725 .fxsr,
26982726 .idivq_to_divl,
26992727 .invpcid,
27002728 .lzcnt,
27012729 .macrofusion,
2702 .merge_to_threeway_branch,
27032730 .mmx,
27042731 .movbe,
27052732 .nopl,
......@@ -2712,10 +2739,8 @@ pub const cpu = struct {
27122739 .rdseed,
27132740 .sahf,
27142741 .slow_3ops_lea,
2715 .sse4_2,
27162742 .vzeroupper,
27172743 .x87,
2718 .xsave,
27192744 .xsavec,
27202745 .xsaveopt,
27212746 .xsaves,
......@@ -2728,7 +2753,6 @@ pub const cpu = struct {
27282753 .@"64bit",
27292754 .cmov,
27302755 .cx16,
2731 .cx8,
27322756 .false_deps_popcnt,
27332757 .fast_7bytenop,
27342758 .fxsr,
......@@ -2746,7 +2770,6 @@ pub const cpu = struct {
27462770 .slow_pmulld,
27472771 .slow_two_mem_ops,
27482772 .sse4_2,
2749 .ssse3,
27502773 .vzeroupper,
27512774 .x87,
27522775 }),
......@@ -2757,14 +2780,9 @@ pub const cpu = struct {
27572780 .features = featureSet(&[_]Feature{
27582781 .@"64bit",
27592782 .adx,
2760 .aes,
2761 .avx,
2762 .avx2,
27632783 .avx512bitalg,
2764 .avx512bw,
27652784 .avx512cd,
27662785 .avx512dq,
2767 .avx512f,
27682786 .avx512ifma,
27692787 .avx512vbmi,
27702788 .avx512vbmi2,
......@@ -2778,30 +2796,26 @@ pub const cpu = struct {
27782796 .clwb,
27792797 .cmov,
27802798 .cx16,
2781 .cx8,
27822799 .ermsb,
2783 .f16c,
27842800 .fast_15bytenop,
27852801 .fast_gather,
27862802 .fast_scalar_fsqrt,
27872803 .fast_shld_rotate,
27882804 .fast_variable_shuffle,
27892805 .fast_vector_fsqrt,
2790 .fma,
27912806 .fsgsbase,
2807 .fsrm,
27922808 .fxsr,
27932809 .gfni,
27942810 .idivq_to_divl,
27952811 .invpcid,
27962812 .lzcnt,
27972813 .macrofusion,
2798 .merge_to_threeway_branch,
27992814 .mmx,
28002815 .movbe,
28012816 .movdir64b,
28022817 .movdiri,
28032818 .nopl,
2804 .pclmul,
28052819 .pku,
28062820 .popcnt,
28072821 .prefer_256_bit,
......@@ -2814,12 +2828,10 @@ pub const cpu = struct {
28142828 .sha,
28152829 .shstk,
28162830 .slow_3ops_lea,
2817 .sse4_2,
28182831 .vaes,
28192832 .vpclmulqdq,
28202833 .vzeroupper,
28212834 .x87,
2822 .xsave,
28232835 .xsavec,
28242836 .xsaveopt,
28252837 .xsaves,
......@@ -2835,7 +2847,6 @@ pub const cpu = struct {
28352847 .clwb,
28362848 .cmov,
28372849 .cx16,
2838 .cx8,
28392850 .fsgsbase,
28402851 .fxsr,
28412852 .gfni,
......@@ -2856,11 +2867,9 @@ pub const cpu = struct {
28562867 .slow_lea,
28572868 .slow_two_mem_ops,
28582869 .sse4_2,
2859 .ssse3,
28602870 .use_glm_div_sqrt_costs,
28612871 .vzeroupper,
28622872 .x87,
2863 .xsave,
28642873 .xsavec,
28652874 .xsaveopt,
28662875 .xsaves,
......@@ -2873,7 +2882,6 @@ pub const cpu = struct {
28732882 .@"64bit",
28742883 .cmov,
28752884 .cx16,
2876 .cx8,
28772885 .fxsr,
28782886 .macrofusion,
28792887 .mmx,
......@@ -2886,21 +2894,21 @@ pub const cpu = struct {
28862894 .x87,
28872895 }),
28882896 };
2889 pub const winchip_c6 = CpuModel{
2890 .name = "winchip_c6",
2891 .llvm_name = "winchip-c6",
2897 pub const winchip2 = CpuModel{
2898 .name = "winchip2",
2899 .llvm_name = "winchip2",
28922900 .features = featureSet(&[_]Feature{
2893 .mmx,
2901 .@"3dnow",
28942902 .slow_unaligned_mem_16,
28952903 .vzeroupper,
28962904 .x87,
28972905 }),
28982906 };
2899 pub const winchip2 = CpuModel{
2900 .name = "winchip2",
2901 .llvm_name = "winchip2",
2907 pub const winchip_c6 = CpuModel{
2908 .name = "winchip_c6",
2909 .llvm_name = "winchip-c6",
29022910 .features = featureSet(&[_]Feature{
2903 .@"3dnow",
2911 .mmx,
29042912 .slow_unaligned_mem_16,
29052913 .vzeroupper,
29062914 .x87,
......@@ -2925,6 +2933,100 @@ pub const cpu = struct {
29252933 .x87,
29262934 }),
29272935 };
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 };
29283030 pub const yonah = CpuModel{
29293031 .name = "yonah",
29303032 .llvm_name = "yonah",
......@@ -2979,7 +3081,6 @@ pub const cpu = struct {
29793081 .sse4a,
29803082 .vzeroupper,
29813083 .x87,
2982 .xsave,
29833084 .xsavec,
29843085 .xsaveopt,
29853086 .xsaves,
......@@ -3027,7 +3128,56 @@ pub const cpu = struct {
30273128 .vzeroupper,
30283129 .wbnoinvd,
30293130 .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,
30313181 .xsavec,
30323182 .xsaveopt,
30333183 .xsaves,
lib/std/zig/cross_target.zig+2-2
......@@ -111,11 +111,11 @@ pub const CrossTarget = struct {
111111 .kfreebsd,
112112 .lv2,
113113 .solaris,
114 .zos,
114115 .haiku,
115116 .minix,
116117 .rtems,
117118 .nacl,
118 .cnk,
119119 .aix,
120120 .cuda,
121121 .nvcl,
......@@ -714,11 +714,11 @@ pub const CrossTarget = struct {
714714 .kfreebsd,
715715 .lv2,
716716 .solaris,
717 .zos,
717718 .haiku,
718719 .minix,
719720 .rtems,
720721 .nacl,
721 .cnk,
722722 .aix,
723723 .cuda,
724724 .nvcl,
lib/std/zig/system.zig+27-5
......@@ -326,11 +326,33 @@ pub const NativeTargetInfo = struct {
326326 cpu_detection_unimplemented = true;
327327 break :backup_cpu_detection Target.Cpu.baseline(cpu_arch);
328328 };
329 cross_target.updateCpuFeatures(&cpu.features);
330
331 var target = try detectAbiAndDynamicLinker(allocator, cpu, os, cross_target);
332 target.cpu_detection_unimplemented = cpu_detection_unimplemented;
333 return target;
329 var result = try detectAbiAndDynamicLinker(allocator, cpu, os, cross_target);
330 // For x86, we need to populate some CPU feature flags depending on architecture
331 // and mode:
332 // * 16bit_mode => if the abi is code16
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;
334356 }
335357
336358 /// 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 {
311311 }
312312 return;
313313 },
314 25 => {
315 cpu.model = &Target.x86.cpu.znver3;
316 return;
317 },
314318 else => {
315319 return;
316320 },
src/Compilation.zig+2-5
......@@ -2345,6 +2345,7 @@ pub fn addCCArgs(
23452345 }
23462346 try argv.append("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS");
23472347 try argv.append("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS");
2348 try argv.append("-D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS");
23482349 }
23492350
23502351 const llvm_triple = try @import("codegen/llvm.zig").targetTriple(arena, target);
......@@ -2927,11 +2928,7 @@ pub fn generateBuiltinZigSource(comp: *Compilation, allocator: *Allocator) ![]u8
29272928 const index = @intCast(std.Target.Cpu.Feature.Set.Index, index_usize);
29282929 const is_enabled = target.cpu.features.isEnabled(index);
29292930 if (is_enabled) {
2930 // TODO some kind of "zig identifier escape" function rather than
2931 // unconditionally using @"" syntax
2932 try buffer.appendSlice(" .@\"");
2933 try buffer.appendSlice(feature.name);
2934 try buffer.appendSlice("\",\n");
2931 try buffer.writer().print(" .{},\n", .{std.zig.fmtId(feature.name)});
29352932 }
29362933 }
29372934
src/clang.zig+11-4
......@@ -424,7 +424,7 @@ pub const Expr = opaque {
424424 extern fn ZigClangExpr_getBeginLoc(*const Expr) SourceLocation;
425425
426426 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;
428428};
429429
430430pub const FieldDecl = opaque {
......@@ -1341,6 +1341,8 @@ pub const CK = extern enum {
13411341 IntegralCast,
13421342 IntegralToBoolean,
13431343 IntegralToFloating,
1344 FloatingToFixedPoint,
1345 FixedPointToFloating,
13441346 FixedPointCast,
13451347 FixedPointToIntegral,
13461348 IntegralToFixedPoint,
......@@ -1447,6 +1449,7 @@ pub const DeclKind = extern enum {
14471449 MSGuid,
14481450 OMPDeclareMapper,
14491451 OMPDeclareReduction,
1452 TemplateParamObject,
14501453 UnresolvedUsingValue,
14511454 OMPAllocate,
14521455 OMPRequires,
......@@ -1557,6 +1560,8 @@ pub const BuiltinTypeKind = extern enum {
15571560 SveFloat64x4,
15581561 SveBFloat16x4,
15591562 SveBool,
1563 VectorQuad,
1564 VectorPair,
15601565 Void,
15611566 Bool,
15621567 Char_U,
......@@ -1710,9 +1715,11 @@ pub const PreprocessedEntity_EntityKind = extern enum {
17101715 InclusionDirectiveKind,
17111716};
17121717
1713pub const Expr_ConstExprUsage = extern enum {
1714 EvaluateForCodeGen,
1715 EvaluateForMangling,
1718pub const Expr_ConstantExprKind = extern enum {
1719 Normal,
1720 NonClassTemplateArgument,
1721 ClassTemplateArgument,
1722 ImmediateInvocation,
17161723};
17171724
17181725pub const UnaryExprOrTypeTrait_Kind = extern enum {
src/clang_options_data.zig+181-78
......@@ -15,7 +15,7 @@ flagpd1("CC"),
1515flagpd1("EB"),
1616flagpd1("EL"),
1717flagpd1("Eonly"),
18flagpd1("fAAPCSBitfieldLoad"),
18flagpd1("faapcs-bitfield-load"),
1919flagpd1("H"),
2020.{
2121 .name = "<input>",
......@@ -1027,14 +1027,6 @@ flagpsl("MT"),
10271027 .pd2 = false,
10281028 .psl = true,
10291029},
1030.{
1031 .name = "Zd",
1032 .syntax = .flag,
1033 .zig_equivalent = .other,
1034 .pd1 = true,
1035 .pd2 = false,
1036 .psl = true,
1037},
10381030.{
10391031 .name = "Ze",
10401032 .syntax = .flag,
......@@ -2073,49 +2065,7 @@ flagpd1("analyzer-viz-egraph-graphviz"),
20732065flagpd1("analyzer-werror"),
20742066flagpd1("fslp-vectorize-aggressive"),
20752067flagpd1("fno-slp-vectorize-aggressive"),
2076flagpd1("fno-record-gcc-switches"),
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"),
2068flagpd1("shared-libasan"),
21192069.{
21202070 .name = "Gs",
21212071 .syntax = .flag,
......@@ -2196,7 +2146,6 @@ flagpd1("fno-ident"),
21962146 .pd2 = false,
21972147 .psl = true,
21982148},
2199flagpd1("fcuda-rdc"),
22002149.{
22012150 .name = "Os",
22022151 .syntax = .flag,
......@@ -2237,9 +2186,52 @@ flagpd1("fcuda-rdc"),
22372186 .pd2 = false,
22382187 .psl = true,
22392188},
2240flagpd1("fno-cuda-rdc"),
2241flagpd1("shared-libasan"),
22422189flagpd1("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"),
22432235.{
22442236 .name = "ansi",
22452237 .syntax = .flag,
......@@ -2251,11 +2243,8 @@ flagpd1("frecord-gcc-switches"),
22512243sepd1("arch"),
22522244flagpd1("arch_errors_fatal"),
22532245sepd1("arch_only"),
2254flagpd1("arcmt-check"),
2255flagpd1("arcmt-migrate"),
22562246flagpd1("arcmt-migrate-emit-errors"),
22572247sepd1("arcmt-migrate-report-output"),
2258flagpd1("arcmt-modify"),
22592248flagpd1("ast-dump"),
22602249flagpd1("ast-dump-all"),
22612250flagpd1("ast-dump-decl-types"),
......@@ -2458,6 +2447,7 @@ flagpd1("emit-pch"),
24582447},
24592448flagpd1("enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang"),
24602449sepd1("error-on-deserialized-decl"),
2450sepd1("exception-model"),
24612451sepd1("exported_symbols_list"),
24622452.{
24632453 .name = "fPIC",
......@@ -2475,7 +2465,8 @@ sepd1("exported_symbols_list"),
24752465 .pd2 = false,
24762466 .psl = false,
24772467},
2478flagpd1("fno-access-control"),
2468flagpd1("faapcs-bitfield-width"),
2469flagpd1("faccess-control"),
24792470flagpd1("faddrsig"),
24802471flagpd1("faggressive-function-elimination"),
24812472flagpd1("falign-commons"),
......@@ -2488,6 +2479,7 @@ flagpd1("fall-intrinsics"),
24882479flagpd1("fallow-editor-placeholders"),
24892480flagpd1("fallow-half-arguments-and-returns"),
24902481flagpd1("fallow-pch-with-compiler-errors"),
2482flagpd1("fallow-pcm-with-compiler-errors"),
24912483flagpd1("fallow-unsupported"),
24922484flagpd1("faltivec"),
24932485flagpd1("fkeep-inline-functions"),
......@@ -2497,6 +2489,7 @@ flagpd1("fapple-link-rtlib"),
24972489flagpd1("fapple-pragma-pack"),
24982490flagpd1("fapplication-extension"),
24992491flagpd1("fapply-global-visibility-to-externs"),
2492flagpd1("fapprox-func"),
25002493flagpd1("fasm"),
25012494flagpd1("fasm-blocks"),
25022495flagpd1("fassociative-math"),
......@@ -2597,6 +2590,7 @@ flagpd1("fdiagnostics-show-note-include-stack"),
25972590flagpd1("fdiagnostics-show-option"),
25982591flagpd1("fdiagnostics-show-template-tree"),
25992592flagpd1("fdigraphs"),
2593flagpd1("fdirect-access-external-data"),
26002594flagpd1("fdisable-module-hash"),
26012595flagpd1("fdiscard-value-names"),
26022596flagpd1("fdollar-ok"),
......@@ -2617,14 +2611,13 @@ flagpd1("feliminate-unused-debug-types"),
26172611flagpd1("fembed-bitcode"),
26182612flagpd1("fembed-bitcode-marker"),
26192613flagpd1("femit-all-decls"),
2620flagpd1("femit-coverage-data"),
2621flagpd1("femit-coverage-notes"),
26222614flagpd1("femulated-tls"),
26232615flagpd1("fenable-matrix"),
26242616flagpd1("fencode-extended-block-signature"),
26252617sepd1("ferror-limit"),
26262618flagpd1("fescaping-block-tail-calls"),
26272619flagpd1("fexceptions"),
2620flagpd1("fexperimental-debug-variable-locations"),
26282621flagpd1("fexperimental-isel"),
26292622flagpd1("fexperimental-new-constant-interpreter"),
26302623flagpd1("fexperimental-new-pass-manager"),
......@@ -2638,6 +2631,7 @@ flagpd1("ffast-math"),
26382631flagpd1("ffat-lto-objects"),
26392632flagpd1("fcheck-new"),
26402633flagpd1("ffine-grained-bitfield-accesses"),
2634flagpd1("ffinite-loops"),
26412635flagpd1("ffinite-math-only"),
26422636flagpd1("finline-limit"),
26432637flagpd1("ffixed-form"),
......@@ -2698,7 +2692,10 @@ flagpd1("fgnu-inline-asm"),
26982692flagpd1("fgnu-keywords"),
26992693flagpd1("fgnu-runtime"),
27002694flagpd1("fgpu-allow-device-init"),
2695flagpd1("fgpu-defer-diag"),
2696flagpd1("fgpu-exclude-wrong-side-overloads"),
27012697flagpd1("fgpu-rdc"),
2698flagpd1("fhalf-no-semantic-interposition"),
27022699flagpd1("fheinous-gnu-extensions"),
27032700flagpd1("fhip-dump-offload-linker-script"),
27042701flagpd1("fhip-new-launch-api"),
......@@ -2738,6 +2735,7 @@ flagpd1("fjump-tables"),
27382735flagpd1("fkeep-static-consts"),
27392736flagpd1("flat_namespace"),
27402737flagpd1("flax-vector-conversions"),
2738flagpd1("flegacy-pass-manager"),
27412739flagpd1("flimit-debug-info"),
27422740.{
27432741 .name = "flto",
......@@ -2752,6 +2750,7 @@ flagpd1("flto-visibility-public-std"),
27522750sepd1("fmacro-backtrace-limit"),
27532751flagpd1("fmath-errno"),
27542752flagpd1("fmax-identifier-length"),
2753flagpd1("fmemory-profile"),
27552754flagpd1("fmerge-all-constants"),
27562755flagpd1("fmerge-constants"),
27572756flagpd1("fmerge-functions"),
......@@ -2804,7 +2803,8 @@ flagpd1("fnext-runtime"),
28042803 .pd2 = false,
28052804 .psl = false,
28062805},
2807flagpd1("fno-no-access-control"),
2806flagpd1("fno-aapcs-bitfield-width"),
2807flagpd1("fno-access-control"),
28082808flagpd1("fno-addrsig"),
28092809flagpd1("fno-aggressive-function-elimination"),
28102810flagpd1("fno-align-commons"),
......@@ -2882,6 +2882,7 @@ flagpd1("fno-diagnostics-show-note-include-stack"),
28822882flagpd1("fno-diagnostics-show-option"),
28832883flagpd1("fno-diagnostics-use-presumed-location"),
28842884flagpd1("fno-digraphs"),
2885flagpd1("fno-direct-access-external-data"),
28852886flagpd1("fno-discard-value-names"),
28862887flagpd1("fno-dllexport-inlines"),
28872888flagpd1("fno-dollar-ok"),
......@@ -2908,6 +2909,7 @@ flagpd1("fno-fast-math"),
29082909flagpd1("fno-fat-lto-objects"),
29092910flagpd1("fno-check-new"),
29102911flagpd1("fno-fine-grained-bitfield-accesses"),
2912flagpd1("fno-finite-loops"),
29112913flagpd1("fno-finite-math-only"),
29122914flagpd1("fno-inline-limit"),
29132915flagpd1("fno-fixed-form"),
......@@ -2932,6 +2934,8 @@ flagpd1("fno-gnu89-inline"),
29322934flagpd1("fno-gnu-inline-asm"),
29332935flagpd1("fno-gnu-keywords"),
29342936flagpd1("fno-gpu-allow-device-init"),
2937flagpd1("fno-gpu-defer-diag"),
2938flagpd1("fno-gpu-exclude-wrong-side-overloads"),
29352939flagpd1("fno-gpu-rdc"),
29362940flagpd1("fno-hip-new-launch-api"),
29372941flagpd1("fno-honor-infinities"),
......@@ -2955,6 +2959,7 @@ flagpd1("fno-ivopts"),
29552959flagpd1("fno-jump-tables"),
29562960flagpd1("fno-keep-static-consts"),
29572961flagpd1("fno-lax-vector-conversions"),
2962flagpd1("fno-legacy-pass-manager"),
29582963flagpd1("fno-limit-debug-info"),
29592964.{
29602965 .name = "fno-lto",
......@@ -2969,6 +2974,7 @@ flagpd1("fno-math-builtin"),
29692974flagpd1("fno-math-errno"),
29702975flagpd1("fno-max-identifier-length"),
29712976flagpd1("fno-max-type-align"),
2977flagpd1("fno-memory-profile"),
29722978flagpd1("fno-merge-all-constants"),
29732979flagpd1("fno-merge-constants"),
29742980flagpd1("fno-module-file-deps"),
......@@ -3018,6 +3024,7 @@ flagpd1("fno-permissive"),
30183024flagpd1("fno-pic"),
30193025flagpd1("fno-pie"),
30203026flagpd1("fno-plt"),
3027flagpd1("fno-prebuilt-implicit-modules"),
30213028flagpd1("fno-prefetch-loop-arrays"),
30223029flagpd1("fno-preserve-as-comments"),
30233030flagpd1("fno-printf"),
......@@ -3034,6 +3041,7 @@ flagpd1("fno-profile-sample-use"),
30343041flagpd1("fno-profile-use"),
30353042flagpd1("fno-profile-values"),
30363043flagpd1("fno-protect-parens"),
3044flagpd1("fno-pseudo-probe-for-profiling"),
30373045flagpd1("fno-range-check"),
30383046flagpd1("fno-real-4-real-10"),
30393047flagpd1("fno-real-4-real-16"),
......@@ -3104,6 +3112,7 @@ flagpd1("fno-spec-constr-count"),
31043112flagpd1("fno-spell-checking"),
31053113flagpd1("fno-split-dwarf-inlining"),
31063114flagpd1("fno-split-lto-unit"),
3115flagpd1("fno-split-machine-functions"),
31073116flagpd1("fno-stack-arrays"),
31083117flagpd1("fno-stack-check"),
31093118flagpd1("fno-stack-clash-protection"),
......@@ -3154,6 +3163,8 @@ flagpd1("fno-vect-cost-model"),
31543163flagpd1("fno-vectorize"),
31553164flagpd1("fno-verbose-asm"),
31563165flagpd1("fno-virtual-function-elimination"),
3166flagpd1("fno-visibility-from-dllstorageclass"),
3167flagpd1("fno-visibility-inlines-hidden-static-local-var"),
31573168flagpd1("fno-wchar"),
31583169flagpd1("fno-web"),
31593170flagpd1("fno-whole-file"),
......@@ -3161,6 +3172,7 @@ flagpd1("fno-whole-program"),
31613172flagpd1("fno-whole-program-vtables"),
31623173flagpd1("fno-working-directory"),
31633174flagpd1("fno-wrapv"),
3175flagpd1("fno-xl-pragma-pack"),
31643176flagpd1("fno-xray-always-emit-customevents"),
31653177flagpd1("fno-xray-always-emit-typedevents"),
31663178flagpd1("fno-xray-function-index"),
......@@ -3212,6 +3224,7 @@ flagpd1("fpack-struct"),
32123224flagpd1("fpadding-on-unsigned-fixed-point"),
32133225flagpd1("fparse-all-comments"),
32143226flagpd1("fpascal-strings"),
3227flagpd1("fpass-by-value-is-noalias"),
32153228flagpd1("fpcc-struct-return"),
32163229flagpd1("fpch-codegen"),
32173230flagpd1("fpch-debuginfo"),
......@@ -3223,6 +3236,7 @@ flagpd1("fpermissive"),
32233236flagpd1("fpic"),
32243237flagpd1("fpie"),
32253238flagpd1("fplt"),
3239flagpd1("fprebuilt-implicit-modules"),
32263240flagpd1("fprefetch-loop-arrays"),
32273241flagpd1("fpreserve-as-comments"),
32283242flagpd1("fpreserve-vec3-type"),
......@@ -3241,6 +3255,7 @@ flagpd1("fprofile-sample-use"),
32413255flagpd1("fprofile-use"),
32423256flagpd1("fprofile-values"),
32433257flagpd1("fprotect-parens"),
3258flagpd1("fpseudo-probe-for-profiling"),
32443259.{
32453260 .name = "framework",
32463261 .syntax = .separate,
......@@ -3340,6 +3355,7 @@ flagpd1("fspell-checking"),
33403355sepd1("fspell-checking-limit"),
33413356flagpd1("fsplit-dwarf-inlining"),
33423357flagpd1("fsplit-lto-unit"),
3358flagpd1("fsplit-machine-functions"),
33433359flagpd1("fsplit-stack"),
33443360flagpd1("fstack-arrays"),
33453361flagpd1("fstack-check"),
......@@ -3395,6 +3411,7 @@ flagpd1("funsigned-bitfields"),
33953411flagpd1("funsigned-char"),
33963412flagpd1("funswitch-loops"),
33973413flagpd1("funwind-tables"),
3414flagpd1("fuse-ctor-homing"),
33983415flagpd1("fuse-cxa-atexit"),
33993416flagpd1("fuse-init-array"),
34003417flagpd1("fuse-line-directives"),
......@@ -3407,8 +3424,10 @@ flagpd1("fvectorize"),
34073424flagpd1("fverbose-asm"),
34083425flagpd1("fvirtual-function-elimination"),
34093426sepd1("fvisibility"),
3427flagpd1("fvisibility-from-dllstorageclass"),
34103428flagpd1("fvisibility-global-new-delete-hidden"),
34113429flagpd1("fvisibility-inlines-hidden"),
3430flagpd1("fvisibility-inlines-hidden-static-local-var"),
34123431flagpd1("fvisibility-ms-compat"),
34133432flagpd1("fwasm-exceptions"),
34143433flagpd1("fweb"),
......@@ -3417,6 +3436,7 @@ flagpd1("fwhole-program"),
34173436flagpd1("fwhole-program-vtables"),
34183437flagpd1("fwrapv"),
34193438flagpd1("fwritable-strings"),
3439flagpd1("fxl-pragma-pack"),
34203440flagpd1("fxray-always-emit-customevents"),
34213441flagpd1("fxray-always-emit-typedevents"),
34223442flagpd1("fxray-function-index"),
......@@ -3449,6 +3469,8 @@ flagpd1("gcodeview"),
34493469flagpd1("gcodeview-ghash"),
34503470flagpd1("gcolumn-info"),
34513471flagpd1("gdwarf"),
3472flagpd1("gdwarf32"),
3473flagpd1("gdwarf64"),
34523474flagpd1("gdwarf-2"),
34533475flagpd1("gdwarf-3"),
34543476flagpd1("gdwarf-4"),
......@@ -3484,6 +3506,7 @@ flagpd1("gno-gnu-pubnames"),
34843506flagpd1("gno-inline-line-tables"),
34853507flagpd1("gno-pubnames"),
34863508flagpd1("gno-record-command-line"),
3509flagpd1("gno-split-dwarf"),
34873510flagpd1("gno-strict-dwarf"),
34883511.{
34893512 .name = "gpu-use-aux-triple-only",
......@@ -3538,6 +3561,8 @@ flagpd1("m64"),
35383561flagpd1("m80387"),
35393562flagpd1("mseses"),
35403563flagpd1("mabi=ieeelongdouble"),
3564flagpd1("mabi=vec-default"),
3565flagpd1("mabi=vec-extabi"),
35413566flagpd1("mabicalls"),
35423567flagpd1("madx"),
35433568flagpd1("maes"),
......@@ -3568,6 +3593,7 @@ flagpd1("mavx512vl"),
35683593flagpd1("mavx512vnni"),
35693594flagpd1("mavx512vp2intersect"),
35703595flagpd1("mavx512vpopcntdq"),
3596flagpd1("mavxvnni"),
35713597flagpd1("mbackchain"),
35723598flagpd1("mbig-endian"),
35733599flagpd1("mbmi"),
......@@ -3600,6 +3626,7 @@ flagpd1("mdouble-float"),
36003626flagpd1("mdsp"),
36013627flagpd1("mdspr2"),
36023628sepd1("meabi"),
3629flagpd1("mefpu2"),
36033630flagpd1("membedded-data"),
36043631flagpd1("menable-experimental-extensions"),
36053632flagpd1("menable-no-infs"),
......@@ -3633,10 +3660,12 @@ flagpd1("mglobal-merge"),
36333660flagpd1("mgpopt"),
36343661flagpd1("mhard-float"),
36353662flagpd1("mhvx"),
3663flagpd1("mhreset"),
36363664flagpd1("mhtm"),
36373665flagpd1("miamcu"),
36383666flagpd1("mieee-fp"),
36393667flagpd1("mieee-rnd-near"),
3668flagpd1("mignore-xcoff-visibility"),
36403669flagpd1("migrate"),
36413670flagpd1("no-finalize-removal"),
36423671flagpd1("no-ns-alloc-error"),
......@@ -3663,6 +3692,7 @@ flagpd1("mips64r5"),
36633692flagpd1("mips64r6"),
36643693flagpd1("misel"),
36653694flagpd1("mkernel"),
3695flagpd1("mkl"),
36663696flagpd1("mldc1-sdc1"),
36673697sepd1("mlimit-float-precision"),
36683698sepd1("mlink-bitcode-file"),
......@@ -3681,10 +3711,12 @@ flagpd1("mlvi-hardening"),
36813711flagpd1("mlwp"),
36823712flagpd1("mlzcnt"),
36833713flagpd1("mmadd4"),
3714flagpd1("mmark-bti-property"),
36843715flagpd1("mmemops"),
36853716flagpd1("mmfcrf"),
36863717flagpd1("mmfocrf"),
36873718flagpd1("mmicromips"),
3719flagpd1("mmma"),
36883720flagpd1("mmmx"),
36893721flagpd1("mmovbe"),
36903722flagpd1("mmovdir64b"),
......@@ -3724,6 +3756,7 @@ flagpd1("mno-avx512vl"),
37243756flagpd1("mno-avx512vnni"),
37253757flagpd1("mno-avx512vp2intersect"),
37263758flagpd1("mno-avx512vpopcntdq"),
3759flagpd1("mno-avxvnni"),
37273760flagpd1("mno-backchain"),
37283761flagpd1("mno-bmi"),
37293762flagpd1("mno-bmi2"),
......@@ -3762,6 +3795,7 @@ flagpd1("mno-ginv"),
37623795flagpd1("mno-global-merge"),
37633796flagpd1("mno-gpopt"),
37643797flagpd1("mno-hvx"),
3798flagpd1("mno-hreset"),
37653799flagpd1("mno-htm"),
37663800flagpd1("mno-iamcu"),
37673801flagpd1("mno-implicit-float"),
......@@ -3770,6 +3804,7 @@ flagpd1("mno-inline-all-stringops"),
37703804flagpd1("mno-invariant-function-descriptors"),
37713805flagpd1("mno-invpcid"),
37723806flagpd1("mno-isel"),
3807flagpd1("mno-kl"),
37733808flagpd1("mno-ldc1-sdc1"),
37743809flagpd1("mno-local-sdata"),
37753810flagpd1("mno-long-calls"),
......@@ -3784,6 +3819,7 @@ flagpd1("mno-mfcrf"),
37843819flagpd1("mno-mfocrf"),
37853820flagpd1("mno-micromips"),
37863821flagpd1("mno-mips16"),
3822flagpd1("mno-mma"),
37873823flagpd1("mno-mmx"),
37883824flagpd1("mno-movbe"),
37893825flagpd1("mno-movdir64b"),
......@@ -3803,6 +3839,7 @@ flagpd1("mno-nvs"),
38033839flagpd1("mno-odd-spreg"),
38043840flagpd1("mno-omit-leaf-frame-pointer"),
38053841flagpd1("mno-outline"),
3842flagpd1("mno-outline-atomics"),
38063843flagpd1("mno-packed-stack"),
38073844flagpd1("mno-packets"),
38083845flagpd1("mno-pascal-strings"),
......@@ -3820,7 +3857,6 @@ flagpd1("mno-prefetchwt1"),
38203857flagpd1("mno-prfchw"),
38213858flagpd1("mno-ptwrite"),
38223859flagpd1("mno-pure-code"),
3823flagpd1("mno-qpx"),
38243860flagpd1("mno-rdpid"),
38253861flagpd1("mno-rdrnd"),
38263862flagpd1("mno-rdseed"),
......@@ -3853,7 +3889,6 @@ flagpd1("mno-simd128"),
38533889flagpd1("mno-soft-float"),
38543890flagpd1("mno-spe"),
38553891flagpd1("mno-speculative-load-hardening"),
3856flagpd1("mno-sram-ecc"),
38573892flagpd1("mno-sse"),
38583893flagpd1("mno-sse2"),
38593894flagpd1("mno-sse3"),
......@@ -3869,8 +3904,10 @@ flagpd1("mno-tbm"),
38693904flagpd1("mno-thumb"),
38703905flagpd1("mno-tls-direct-seg-refs"),
38713906flagpd1("mno-tsxldtrk"),
3907flagpd1("mno-uintr"),
38723908flagpd1("mno-unaligned-access"),
38733909flagpd1("mno-unimplemented-simd128"),
3910flagpd1("mno-unsafe-fp-atomics"),
38743911flagpd1("mno-vaes"),
38753912flagpd1("mno-virt"),
38763913flagpd1("mno-vpclmulqdq"),
......@@ -3881,9 +3918,9 @@ flagpd1("mno-waitpkg"),
38813918flagpd1("mno-warn-nonportable-cfstrings"),
38823919flagpd1("mno-wavefrontsize64"),
38833920flagpd1("mno-wbnoinvd"),
3921flagpd1("mno-widekl"),
38843922flagpd1("mno-x87"),
38853923flagpd1("mno-xgot"),
3886flagpd1("mno-xnack"),
38873924flagpd1("mno-xop"),
38883925flagpd1("mno-xsave"),
38893926flagpd1("mno-xsavec"),
......@@ -3894,6 +3931,7 @@ flagpd1("mnocrc"),
38943931flagpd1("mno-direct-move"),
38953932flagpd1("mnontrapping-fptoint"),
38963933flagpd1("mnop-mcount"),
3934flagpd1("mno-paired-vector-memops"),
38973935flagpd1("mno-crypto"),
38983936flagpd1("mnvj"),
38993937flagpd1("mnvs"),
......@@ -3903,8 +3941,10 @@ flagpd1("module-file-deps"),
39033941flagpd1("module-file-info"),
39043942flagpd1("momit-leaf-frame-pointer"),
39053943flagpd1("moutline"),
3944flagpd1("moutline-atomics"),
39063945flagpd1("mpacked-stack"),
39073946flagpd1("mpackets"),
3947flagpd1("mpaired-vector-memops"),
39083948flagpd1("mpascal-strings"),
39093949flagpd1("mpclmul"),
39103950flagpd1("mpconfig"),
......@@ -3922,7 +3962,6 @@ flagpd1("mprfchw"),
39223962flagpd1("mptwrite"),
39233963flagpd1("mpure-code"),
39243964flagpd1("mqdsp6-compat"),
3925flagpd1("mqpx"),
39263965flagpd1("mrdpid"),
39273966flagpd1("mrdrnd"),
39283967flagpd1("mrdseed"),
......@@ -3965,13 +4004,13 @@ flagpd1("msgx"),
39654004flagpd1("msha"),
39664005flagpd1("mshstk"),
39674006flagpd1("msign-ext"),
4007flagpd1("msim"),
39684008flagpd1("msimd128"),
39694009flagpd1("msingle-float"),
39704010sepd1("msmall-data-limit"),
39714011flagpd1("msoft-float"),
39724012flagpd1("mspe"),
39734013flagpd1("mspeculative-load-hardening"),
3974flagpd1("msram-ecc"),
39754014flagpd1("msse"),
39764015flagpd1("msse2"),
39774016flagpd1("msse3"),
......@@ -3995,11 +4034,13 @@ sepd1("mtp"),
39954034flagpd1("mtsxldtrk"),
39964035flagpd1("mtune=?"),
39974036flagpd1("muclibc"),
4037flagpd1("muintr"),
39984038flagpd1("multi_module"),
39994039sepd1("multiply_defined"),
40004040sepd1("multiply_defined_unused"),
40014041flagpd1("munaligned-access"),
40024042flagpd1("munimplemented-simd128"),
4043flagpd1("munsafe-fp-atomics"),
40034044flagpd1("munwind-tables"),
40044045flagpd1("mv5"),
40054046flagpd1("mv55"),
......@@ -4019,10 +4060,10 @@ flagpd1("mwaitpkg"),
40194060flagpd1("mwarn-nonportable-cfstrings"),
40204061flagpd1("mwavefrontsize64"),
40214062flagpd1("mwbnoinvd"),
4063flagpd1("mwidekl"),
40224064flagpd1("mx32"),
40234065flagpd1("mx87"),
40244066flagpd1("mxgot"),
4025flagpd1("mxnack"),
40264067flagpd1("mxop"),
40274068flagpd1("mxsave"),
40284069flagpd1("mxsavec"),
......@@ -4462,7 +4503,7 @@ sepd1("target-feature"),
44624503},
44634504sepd1("target-linker-version"),
44644505flagpd1("templight-dump"),
4465flagpd1("test-coverage"),
4506flagpd1("test-io"),
44664507flagpd1("time"),
44674508.{
44684509 .name = "traditional",
......@@ -4490,6 +4531,7 @@ flagpd1("time"),
44904531},
44914532flagpd1("trim-egraph"),
44924533sepd1("triple"),
4534sepd1("tune-cpu"),
44934535flagpd1("twolevel_namespace"),
44944536flagpd1("twolevel_namespace_hints"),
44954537sepd1("umbrella"),
......@@ -4541,6 +4583,7 @@ flagpd1("whyload"),
45414583},
45424584joinpd1("fsanitize-undefined-strip-path-components="),
45434585joinpd1("fopenmp-cuda-teams-reduction-recs-num="),
4586joinpd1("fvisibility-externs-nodllstorageclass="),
45444587joinpd1("analyzer-config-compatibility-mode="),
45454588joinpd1("ftrivial-auto-var-init-stop-after="),
45464589joinpd1("fpatchable-function-entry-offset="),
......@@ -4549,7 +4592,11 @@ joinpd1("fsanitize-address-field-padding="),
45494592joinpd1("fdiagnostics-hotness-threshold="),
45504593joinpd1("fsanitize-memory-track-origins="),
45514594joinpd1("mwatchos-simulator-version-min="),
4595joinpd1("fvisibility-externs-dllimport="),
4596joinpd1("fvisibility-nodllstorageclass="),
4597joinpd1("fxray-selected-function-group="),
45524598joinpd1("mappletvsimulator-version-min="),
4599joinpd1("mstack-protector-guard-offset="),
45534600joinpd1("fsanitize-coverage-whitelist="),
45544601joinpd1("fsanitize-coverage-blacklist="),
45554602joinpd1("fobjc-nonfragile-abi-version="),
......@@ -4582,7 +4629,16 @@ joinpd1("fopenmp-cuda-blocks-per-sm="),
45824629joinpd1("fsanitize-system-blacklist="),
45834630jspd1("fxray-instruction-threshold"),
45844631joinpd1("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},
45854640joinpd1("mios-simulator-version-min="),
4641joinpd1("mstack-protector-guard-reg="),
45864642.{
45874643 .name = "include-with-prefix-after=",
45884644 .syntax = .joined,
......@@ -4655,14 +4711,6 @@ joinpd1("fsanitize-hwaddress-abi="),
46554711joinpd1("ftime-trace-granularity="),
46564712jspd1("fxray-always-instrument="),
46574713jspd1("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},
46664714.{
46674715 .name = "no-system-header-prefix=",
46684716 .syntax = .joined,
......@@ -4693,6 +4741,7 @@ jspd1("fxray-never-instrument="),
46934741jspd1("interface-stub-version="),
46944742joinpd1("malign-branch-boundary="),
46954743joinpd1("mappletvos-version-min="),
4744joinpd1("mstack-protector-guard="),
46964745joinpd1("Wnonportable-cfstrings"),
46974746joinpd1("fbasic-block-sections="),
46984747joinpd1("fdefault-calling-conv="),
......@@ -4712,6 +4761,8 @@ joinpd1("foperator-arrow-depth="),
47124761joinpd1("fprebuilt-module-path="),
47134762joinpd1("fprofile-filter-files="),
47144763joinpd1("fspell-checking-limit="),
4764joinpd1("fvisibility-dllexport="),
4765joinpd1("fxray-function-groups="),
47154766joinpd1("miphoneos-version-min="),
47164767joinpd1("msmall-data-threshold="),
47174768joinpd1("Wlarge-by-value-copy="),
......@@ -4730,7 +4781,7 @@ joinpd1("fmodules-prune-after="),
47304781 .psl = false,
47314782},
47324783jspd1("iframeworkwithsysroot"),
4733joinpd1("mamdgpu-debugger-abi="),
4784joinpd1("mcode-object-version="),
47344785joinpd1("mpad-max-prefix-size="),
47354786joinpd1("mprefer-vector-width="),
47364787joinpd1("msign-return-address="),
......@@ -4774,6 +4825,7 @@ joinpd1("fmax-stack-var-size="),
47744825joinpd1("fmodules-cache-path="),
47754826joinpd1("fmodules-embed-file="),
47764827joinpd1("fprofile-instrument="),
4828joinpd1("fprofile-prefix-map="),
47774829joinpd1("fprofile-sample-use="),
47784830joinpd1("fsanitize-blacklist="),
47794831joinpd1("mmacosx-version-min="),
......@@ -4802,6 +4854,14 @@ joinpd1("fprofile-instr-use="),
48024854 .psl = false,
48034855},
48044856joinpd1("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},
48054865joinpd1("mbranch-protection="),
48064866joinpd1("mmacos-version-min="),
48074867joinpd1("pch-through-header="),
......@@ -4838,6 +4898,7 @@ joinpd1("target-sdk-version="),
48384898 .pd2 = true,
48394899 .psl = false,
48404900},
4901joinpd1("fbinutils-version="),
48414902joinpd1("fclang-abi-compat="),
48424903joinpd1("fcompile-resource="),
48434904joinpd1("fdebug-prefix-map="),
......@@ -4855,6 +4916,7 @@ joinpd1("fmacro-prefix-map="),
48554916},
48564917joinpd1("fobjc-abi-version="),
48574918joinpd1("foutput-class-dir="),
4919joinpd1("fproc-stat-report="),
48584920joinpd1("fprofile-generate="),
48594921joinpd1("frewrite-map-file="),
48604922.{
......@@ -4888,10 +4950,12 @@ joinpd1("fconstexpr-steps="),
48884950joinpd1("ffile-prefix-map="),
48894951joinpd1("fmodule-map-file="),
48904952joinpd1("fobjc-arc-cxxlib="),
4953joinpd1("fproc-stat-report"),
48914954jspd1("iwithprefixbefore"),
48924955joinpd1("malign-functions="),
48934956joinpd1("mios-version-min="),
48944957joinpd1("mstack-alignment="),
4958joinpd1("msve-vector-bits="),
48954959.{
48964960 .name = "no-cuda-gpu-arch=",
48974961 .syntax = .joined,
......@@ -4912,9 +4976,11 @@ joinpd1("analyzer-output="),
49124976},
49134977joinpd1("debug-info-kind="),
49144978joinpd1("debugger-tuning="),
4979joinpd1("exception-model="),
49154980joinpd1("fcf-runtime-abi="),
49164981joinpd1("finit-character="),
49174982joinpd1("fmax-type-align="),
4983joinpd1("fmemory-profile="),
49184984joinpd1("fmessage-length="),
49194985.{
49204986 .name = "fopenmp-targets=",
......@@ -4925,6 +4991,7 @@ joinpd1("fmessage-length="),
49254991 .psl = false,
49264992},
49274993joinpd1("fopenmp-version="),
4994joinpd1("fprofile-update="),
49284995joinpd1("fshow-overloads="),
49294996joinpd1("ftemplate-depth-"),
49304997joinpd1("ftemplate-depth="),
......@@ -5074,6 +5141,7 @@ joinpd1("finit-integer="),
50745141joinpd1("finit-logical="),
50755142joinpd1("finline-limit="),
50765143joinpd1("fobjc-runtime="),
5144joinpd1("fprofile-list="),
50775145.{
50785146 .name = "gcc-toolchain=",
50795147 .syntax = .joined,
......@@ -5111,6 +5179,7 @@ joinpd1("Wlarger-than="),
51115179 .pd2 = true,
51125180 .psl = false,
51135181},
5182joinpd1("arcmt-action="),
51145183joinpd1("ast-dump-all="),
51155184.{
51165185 .name = "autocomplete=",
......@@ -5141,6 +5210,7 @@ joinpd1("fpass-plugin="),
51415210joinpd1("fprofile-dir="),
51425211joinpd1("fprofile-use="),
51435212joinpd1("frandom-seed="),
5213joinpd1("ftime-report="),
51445214joinpd1("gsplit-dwarf="),
51455215jspd1("isystem-after"),
51465216joinpd1("malign-jumps="),
......@@ -5300,6 +5370,14 @@ jspd1("sub_library"),
53005370 .pd2 = false,
53015371 .psl = true,
53025372},
5373.{
5374 .name = "vctoolsdir",
5375 .syntax = .joined_or_separate,
5376 .zig_equivalent = .other,
5377 .pd1 = true,
5378 .pd2 = false,
5379 .psl = true,
5380},
53035381.{
53045382 .name = "classpath=",
53055383 .syntax = .joined,
......@@ -5429,11 +5507,20 @@ jspd1("undefined"),
54295507 .pd2 = true,
54305508 .psl = false,
54315509},
5510jspd1("dsym-dir"),
54325511joinpd1("fopenmp="),
54335512joinpd1("fplugin="),
54345513joinpd1("fuse-ld="),
54355514joinpd1("fveclib="),
54365515jspd1("isysroot"),
5516.{
5517 .name = "ld-path=",
5518 .syntax = .joined,
5519 .zig_equivalent = .other,
5520 .pd1 = false,
5521 .pd2 = true,
5522 .psl = false,
5523},
54375524joinpd1("mcmodel="),
54385525joinpd1("mconsole"),
54395526joinpd1("mdouble="),
......@@ -5658,6 +5745,14 @@ jspd1("Ttext"),
56585745 .pd2 = false,
56595746 .psl = true,
56605747},
5748.{
5749 .name = "tune:",
5750 .syntax = .joined,
5751 .zig_equivalent = .other,
5752 .pd1 = true,
5753 .pd2 = false,
5754 .psl = true,
5755},
56615756.{
56625757 .name = "warn-",
56635758 .syntax = .joined,
......@@ -5743,6 +5838,14 @@ joinpd1("mtp="),
57435838 .pd2 = false,
57445839 .psl = false,
57455840},
5841.{
5842 .name = "Fe:",
5843 .syntax = .joined,
5844 .zig_equivalent = .other,
5845 .pd1 = true,
5846 .pd2 = false,
5847 .psl = true,
5848},
57465849.{
57475850 .name = "RTC",
57485851 .syntax = .joined,
src/codegen/llvm.zig+4-1
......@@ -28,6 +28,7 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![:0]u8 {
2828 .avr => "avr",
2929 .bpfel => "bpfel",
3030 .bpfeb => "bpfeb",
31 .csky => "csky",
3132 .hexagon => "hexagon",
3233 .mips => "mips",
3334 .mipsel => "mipsel",
......@@ -35,6 +36,7 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![:0]u8 {
3536 .mips64el => "mips64el",
3637 .msp430 => "msp430",
3738 .powerpc => "powerpc",
39 .powerpcle => "powerpcle",
3840 .powerpc64 => "powerpc64",
3941 .powerpc64le => "powerpc64le",
4042 .r600 => "r600",
......@@ -91,11 +93,11 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![:0]u8 {
9193 .openbsd => "openbsd",
9294 .solaris => "solaris",
9395 .windows => "windows",
96 .zos => "zos",
9497 .haiku => "haiku",
9598 .minix => "minix",
9699 .rtems => "rtems",
97100 .nacl => "nacl",
98 .cnk => "cnk",
99101 .aix => "aix",
100102 .cuda => "cuda",
101103 .nvcl => "nvcl",
......@@ -126,6 +128,7 @@ pub fn targetTriple(allocator: *Allocator, target: std.Target) ![:0]u8 {
126128 .gnueabi => "gnueabi",
127129 .gnueabihf => "gnueabihf",
128130 .gnux32 => "gnux32",
131 .gnuilp32 => "gnuilp32",
129132 .code16 => "code16",
130133 .eabi => "eabi",
131134 .eabihf => "eabihf",
src/codegen/llvm/bindings.zig+91-88
......@@ -508,6 +508,7 @@ pub const ObjectFormatType = extern enum(c_int) {
508508 Unknown,
509509 COFF,
510510 ELF,
511 GOFF,
511512 MachO,
512513 Wasm,
513514 XCOFF,
......@@ -528,97 +529,99 @@ extern fn ZigLLVMWriteArchive(
528529) bool;
529530
530531pub const OSType = extern enum(c_int) {
531 UnknownOS = 0,
532 Ananas = 1,
533 CloudABI = 2,
534 Darwin = 3,
535 DragonFly = 4,
536 FreeBSD = 5,
537 Fuchsia = 6,
538 IOS = 7,
539 KFreeBSD = 8,
540 Linux = 9,
541 Lv2 = 10,
542 MacOSX = 11,
543 NetBSD = 12,
544 OpenBSD = 13,
545 Solaris = 14,
546 Win32 = 15,
547 Haiku = 16,
548 Minix = 17,
549 RTEMS = 18,
550 NaCl = 19,
551 CNK = 20,
552 AIX = 21,
553 CUDA = 22,
554 NVCL = 23,
555 AMDHSA = 24,
556 PS4 = 25,
557 ELFIAMCU = 26,
558 TvOS = 27,
559 WatchOS = 28,
560 Mesa3D = 29,
561 Contiki = 30,
562 AMDPAL = 31,
563 HermitCore = 32,
564 Hurd = 33,
565 WASI = 34,
566 Emscripten = 35,
532 UnknownOS,
533 Ananas,
534 CloudABI,
535 Darwin,
536 DragonFly,
537 FreeBSD,
538 Fuchsia,
539 IOS,
540 KFreeBSD,
541 Linux,
542 Lv2,
543 MacOSX,
544 NetBSD,
545 OpenBSD,
546 Solaris,
547 Win32,
548 ZOS,
549 Haiku,
550 Minix,
551 RTEMS,
552 NaCl,
553 AIX,
554 CUDA,
555 NVCL,
556 AMDHSA,
557 PS4,
558 ELFIAMCU,
559 TvOS,
560 WatchOS,
561 Mesa3D,
562 Contiki,
563 AMDPAL,
564 HermitCore,
565 Hurd,
566 WASI,
567 Emscripten,
567568};
568569
569570pub const ArchType = extern enum(c_int) {
570 UnknownArch = 0,
571 arm = 1,
572 armeb = 2,
573 aarch64 = 3,
574 aarch64_be = 4,
575 aarch64_32 = 5,
576 arc = 6,
577 avr = 7,
578 bpfel = 8,
579 bpfeb = 9,
580 hexagon = 10,
581 mips = 11,
582 mipsel = 12,
583 mips64 = 13,
584 mips64el = 14,
585 msp430 = 15,
586 ppc = 16,
587 ppc64 = 17,
588 ppc64le = 18,
589 r600 = 19,
590 amdgcn = 20,
591 riscv32 = 21,
592 riscv64 = 22,
593 sparc = 23,
594 sparcv9 = 24,
595 sparcel = 25,
596 systemz = 26,
597 tce = 27,
598 tcele = 28,
599 thumb = 29,
600 thumbeb = 30,
601 x86 = 31,
602 x86_64 = 32,
603 xcore = 33,
604 nvptx = 34,
605 nvptx64 = 35,
606 le32 = 36,
607 le64 = 37,
608 amdil = 38,
609 amdil64 = 39,
610 hsail = 40,
611 hsail64 = 41,
612 spir = 42,
613 spir64 = 43,
614 kalimba = 44,
615 shave = 45,
616 lanai = 46,
617 wasm32 = 47,
618 wasm64 = 48,
619 renderscript32 = 49,
620 renderscript64 = 50,
621 ve = 51,
571 UnknownArch,
572 arm,
573 armeb,
574 aarch64,
575 aarch64_be,
576 aarch64_32,
577 arc,
578 avr,
579 bpfel,
580 bpfeb,
581 csky,
582 hexagon,
583 mips,
584 mipsel,
585 mips64,
586 mips64el,
587 msp430,
588 ppc,
589 ppcle,
590 ppc64,
591 ppc64le,
592 r600,
593 amdgcn,
594 riscv32,
595 riscv64,
596 sparc,
597 sparcv9,
598 sparcel,
599 systemz,
600 tce,
601 tcele,
602 thumb,
603 thumbeb,
604 x86,
605 x86_64,
606 xcore,
607 nvptx,
608 nvptx64,
609 le32,
610 le64,
611 amdil,
612 amdil64,
613 hsail,
614 hsail64,
615 spir,
616 spir64,
617 kalimba,
618 shave,
619 lanai,
620 wasm32,
621 wasm64,
622 renderscript32,
623 renderscript64,
624 ve,
622625};
623626
624627pub const ParseCommandLineOptions = ZigLLVMParseCommandLineOptions;
src/glibc.zig+18-18
......@@ -820,26 +820,26 @@ pub fn buildSharedObjects(comp: *Compilation) !void {
820820 // .globl _Exit_2_2_5
821821 // .type _Exit_2_2_5, %function;
822822 // .symver _Exit_2_2_5, _Exit@@GLIBC_2.2.5
823 // .hidden _Exit_2_2_5
824823 // _Exit_2_2_5:
825824 const ver_index = ver_list.versions[ver_i];
826825 const ver = metadata.all_versions[ver_index];
827826 const sym_name = libc_fn.name;
828827 // 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;
830 const at_sign_str = "@@"[0 .. @boolToInt(want_two_ats) + @as(usize, 1)];
831
828 const want_default = chosen_def_ver_index != 255 and ver_index == chosen_def_ver_index;
829 const at_sign_str: []const u8 = if (want_default) "@@" else "@";
832830 if (ver.patch == 0) {
833 const sym_plus_ver = try std.fmt.allocPrint(
834 arena,
835 "{s}_{d}_{d}",
836 .{ sym_name, ver.major, ver.minor },
837 );
831 const sym_plus_ver = if (want_default)
832 sym_name
833 else
834 try std.fmt.allocPrint(
835 arena,
836 "{s}_GLIBC_{d}_{d}",
837 .{ sym_name, ver.major, ver.minor },
838 );
838839 try zig_body.writer().print(
839840 \\.globl {s}
840841 \\.type {s}, %function;
841842 \\.symver {s}, {s}{s}GLIBC_{d}.{d}
842 \\.hidden {s}
843843 \\{s}:
844844 \\
845845 , .{
......@@ -851,19 +851,20 @@ pub fn buildSharedObjects(comp: *Compilation) !void {
851851 ver.major,
852852 ver.minor,
853853 sym_plus_ver,
854 sym_plus_ver,
855854 });
856855 } else {
857 const sym_plus_ver = try std.fmt.allocPrint(
858 arena,
859 "{s}_{d}_{d}_{d}",
860 .{ sym_name, ver.major, ver.minor, ver.patch },
861 );
856 const sym_plus_ver = if (want_default)
857 sym_name
858 else
859 try std.fmt.allocPrint(
860 arena,
861 "{s}_GLIBC_{d}_{d}_{d}",
862 .{ sym_name, ver.major, ver.minor, ver.patch },
863 );
862864 try zig_body.writer().print(
863865 \\.globl {s}
864866 \\.type {s}, %function;
865867 \\.symver {s}, {s}{s}GLIBC_{d}.{d}.{d}
866 \\.hidden {s}
867868 \\{s}:
868869 \\
869870 , .{
......@@ -876,7 +877,6 @@ pub fn buildSharedObjects(comp: *Compilation) !void {
876877 ver.minor,
877878 ver.patch,
878879 sym_plus_ver,
879 sym_plus_ver,
880880 });
881881 }
882882 }
src/libcxx.zig+2
......@@ -49,6 +49,7 @@ const libcxx_files = [_][]const u8{
4949 "src/future.cpp",
5050 "src/hash.cpp",
5151 "src/ios.cpp",
52 "src/ios.instantiations.cpp",
5253 "src/iostream.cpp",
5354 "src/locale.cpp",
5455 "src/memory.cpp",
......@@ -127,6 +128,7 @@ pub fn buildLibCXX(comp: *Compilation) !void {
127128 try cflags.append("-DLIBCXX_BUILDING_LIBCXXABI");
128129 try cflags.append("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS");
129130 try cflags.append("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS");
131 try cflags.append("-D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS");
130132
131133 if (target.abi.isMusl()) {
132134 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) {
537537 if (fn->body_node != nullptr) {
538538 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 &&
541541 g->build_mode != BuildModeSmallRelease &&
542 !fn->def_scope->safety_off;
543 if (want_fn_safety) {
544 if (g->link_libc) {
545 addLLVMFnAttr(llvm_fn, "sspstrong");
546 addLLVMFnAttrStr(llvm_fn, "stack-protector-buffer-size", "4");
547 }
542 g->link_libc;
543 if (want_ssp_attrs) {
544 addLLVMFnAttr(llvm_fn, "sspstrong");
545 addLLVMFnAttrStr(llvm_fn, "stack-protector-buffer-size", "4");
548546 }
549547 if (g->have_stack_probing && !fn->def_scope->safety_off) {
550548 addLLVMFnAttrStr(llvm_fn, "probe-stack", "__zig_probe_stack");
......@@ -598,7 +596,7 @@ static LLVMValueRef make_fn_llvm_value(CodeGen *g, ZigFn *fn) {
598596 } else if (want_first_arg_sret(g, &fn_type->data.fn.fn_type_id)) {
599597 // Sret pointers must not be address 0
600598 addLLVMArgAttr(llvm_fn, 0, "nonnull");
601 addLLVMArgAttr(llvm_fn, 0, "sret");
599 ZigLLVMAddSretAttr(llvm_fn, 0, get_llvm_type(g, return_type));
602600 if (cc_want_sret_attr(cc)) {
603601 addLLVMArgAttr(llvm_fn, 0, "noalias");
604602 }
......@@ -1644,35 +1642,16 @@ static const BuildBinOpFunc unsigned_op[3] = { LLVMBuildNUWAdd, LLVMBuildNUWSub,
16441642static LLVMValueRef gen_overflow_op(CodeGen *g, ZigType *operand_type, AddSubMul op,
16451643 LLVMValueRef val1, LLVMValueRef val2)
16461644{
1647 LLVMValueRef overflow_bit;
1648 LLVMValueRef result;
1649
1645 LLVMValueRef fn_val = get_int_overflow_fn(g, operand_type, op);
1646 LLVMValueRef params[] = {
1647 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, "");
16501653 if (operand_type->id == ZigTypeIdVector) {
1651 ZigType *int_type = operand_type->data.vector.elem_type;
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, "");
1654 overflow_bit = ZigLLVMBuildOrReduce(g->builder, overflow_bit);
16761655 }
16771656
16781657 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_
20402019 switch (fn_walk->id) {
20412020 case FnWalkIdAttrs:
20422021 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));
20442023 addLLVMArgAttrInt(llvm_fn, fn_walk->data.attrs.gen_i, "align", get_abi_alignment(g, ty));
20452024 } else if (g->zig_target->arch == ZigLLVM_aarch64 ||
20462025 g->zig_target->arch == ZigLLVM_aarch64_be)
......@@ -4105,12 +4084,6 @@ static void gen_set_stack_pointer(CodeGen *g, LLVMValueRef aligned_end_addr) {
41054084 LLVMBuildCall(g->builder, write_register_fn_val, params, 2, "");
41064085}
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
41144087static void render_async_spills(CodeGen *g) {
41154088 ZigType *fn_type = g->cur_fn->type_entry;
41164089 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
46344607 } else if (!ret_has_bits) {
46354608 return nullptr;
46364609 } else if (first_arg_ret) {
4637 set_call_instr_sret(g, result);
4610 ZigLLVMSetCallSret(result, get_llvm_type(g, src_return_type));
46384611 return result_loc;
46394612 } else if (handle_is_ptr(g, src_return_type)) {
46404613 LLVMValueRef store_instr = LLVMBuildStore(g->builder, result, result_loc);
src/stage1/stage1.h+1-1
......@@ -73,11 +73,11 @@ enum Os {
7373 OsOpenBSD,
7474 OsSolaris,
7575 OsWindows,
76 OsZOS,
7677 OsHaiku,
7778 OsMinix,
7879 OsRTEMS,
7980 OsNaCl, // Native Client
80 OsCNK, // BG/P Compute-Node Kernel
8181 OsAIX,
8282 OsCUDA, // NVIDIA CUDA
8383 OsNVCL, // NVIDIA OpenCL
src/stage1/target.cpp+24-9
......@@ -23,6 +23,7 @@ static const ZigLLVM_ArchType arch_list[] = {
2323 ZigLLVM_avr, // AVR: Atmel AVR microcontroller
2424 ZigLLVM_bpfel, // eBPF or extended BPF or 64-bit BPF (little endian)
2525 ZigLLVM_bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian)
26 ZigLLVM_csky, // CSKY: csky
2627 ZigLLVM_hexagon, // Hexagon: hexagon
2728 ZigLLVM_mips, // MIPS: mips, mipsallegrex, mipsr6
2829 ZigLLVM_mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el
......@@ -30,6 +31,7 @@ static const ZigLLVM_ArchType arch_list[] = {
3031 ZigLLVM_mips64el, // MIPS64EL: mips64el, mips64r6el, mipsn32el, mipsn32r6el
3132 ZigLLVM_msp430, // MSP430: msp430
3233 ZigLLVM_ppc, // PPC: powerpc
34 ZigLLVM_ppcle, // PPCLE: powerpc (little endian)
3335 ZigLLVM_ppc64, // PPC64: powerpc64, ppu
3436 ZigLLVM_ppc64le, // PPC64LE: powerpc64le
3537 ZigLLVM_r600, // R600: AMD GPUs HD2XXX - HD6XXX
......@@ -71,8 +73,6 @@ static const ZigLLVM_VendorType vendor_list[] = {
7173 ZigLLVM_Apple,
7274 ZigLLVM_PC,
7375 ZigLLVM_SCEI,
74 ZigLLVM_BGP,
75 ZigLLVM_BGQ,
7676 ZigLLVM_Freescale,
7777 ZigLLVM_IBM,
7878 ZigLLVM_ImaginationTechnologies,
......@@ -101,11 +101,11 @@ static const Os os_list[] = {
101101 OsOpenBSD,
102102 OsSolaris,
103103 OsWindows,
104 OsZOS,
104105 OsHaiku,
105106 OsMinix,
106107 OsRTEMS,
107108 OsNaCl, // Native Client
108 OsCNK, // BG/P Compute-Node Kernel
109109 OsAIX,
110110 OsCUDA, // NVIDIA CUDA
111111 OsNVCL, // NVIDIA OpenCL
......@@ -135,6 +135,7 @@ static const ZigLLVM_EnvironmentType abi_list[] = {
135135 ZigLLVM_GNUEABI,
136136 ZigLLVM_GNUEABIHF,
137137 ZigLLVM_GNUX32,
138 ZigLLVM_GNUILP32,
138139 ZigLLVM_CODE16,
139140 ZigLLVM_EABI,
140141 ZigLLVM_EABIHF,
......@@ -155,8 +156,10 @@ static const ZigLLVM_ObjectFormatType oformat_list[] = {
155156 ZigLLVM_UnknownObjectFormat,
156157 ZigLLVM_COFF,
157158 ZigLLVM_ELF,
159 ZigLLVM_GOFF,
158160 ZigLLVM_MachO,
159161 ZigLLVM_Wasm,
162 ZigLLVM_XCOFF,
160163};
161164
162165size_t target_oformat_count(void) {
......@@ -173,6 +176,7 @@ const char *target_oformat_name(ZigLLVM_ObjectFormatType oformat) {
173176 case ZigLLVM_UnknownObjectFormat: return "unknown";
174177 case ZigLLVM_COFF: return "coff";
175178 case ZigLLVM_ELF: return "elf";
179 case ZigLLVM_GOFF: return "goff";
176180 case ZigLLVM_MachO: return "macho";
177181 case ZigLLVM_Wasm: return "wasm";
178182 case ZigLLVM_XCOFF: return "xcoff";
......@@ -240,6 +244,8 @@ ZigLLVM_OSType get_llvm_os_type(Os os_type) {
240244 case OsWindows:
241245 case OsUefi:
242246 return ZigLLVM_Win32;
247 case OsZOS:
248 return ZigLLVM_ZOS;
243249 case OsHaiku:
244250 return ZigLLVM_Haiku;
245251 case OsMinix:
......@@ -248,8 +254,6 @@ ZigLLVM_OSType get_llvm_os_type(Os os_type) {
248254 return ZigLLVM_RTEMS;
249255 case OsNaCl:
250256 return ZigLLVM_NaCl;
251 case OsCNK:
252 return ZigLLVM_CNK;
253257 case OsAIX:
254258 return ZigLLVM_AIX;
255259 case OsCUDA:
......@@ -306,11 +310,11 @@ const char *target_os_name(Os os_type) {
306310 case OsOpenBSD:
307311 case OsSolaris:
308312 case OsWindows:
313 case OsZOS:
309314 case OsHaiku:
310315 case OsMinix:
311316 case OsRTEMS:
312317 case OsNaCl: // Native Client
313 case OsCNK: // BG/P Compute-Node Kernel
314318 case OsAIX:
315319 case OsCUDA: // NVIDIA CUDA
316320 case OsNVCL: // NVIDIA OpenCL
......@@ -485,6 +489,7 @@ uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch) {
485489 case ZigLLVM_mipsel:
486490 case ZigLLVM_nvptx:
487491 case ZigLLVM_ppc:
492 case ZigLLVM_ppcle:
488493 case ZigLLVM_r600:
489494 case ZigLLVM_riscv32:
490495 case ZigLLVM_sparc:
......@@ -504,6 +509,7 @@ uint32_t target_arch_pointer_bit_width(ZigLLVM_ArchType arch) {
504509 case ZigLLVM_wasm32:
505510 case ZigLLVM_renderscript32:
506511 case ZigLLVM_aarch64_32:
512 case ZigLLVM_csky:
507513 return 32;
508514
509515 case ZigLLVM_aarch64:
......@@ -550,6 +556,7 @@ uint32_t target_arch_largest_atomic_bits(ZigLLVM_ArchType arch) {
550556 case ZigLLVM_mipsel:
551557 case ZigLLVM_nvptx:
552558 case ZigLLVM_ppc:
559 case ZigLLVM_ppcle:
553560 case ZigLLVM_r600:
554561 case ZigLLVM_riscv32:
555562 case ZigLLVM_sparc:
......@@ -568,6 +575,7 @@ uint32_t target_arch_largest_atomic_bits(ZigLLVM_ArchType arch) {
568575 case ZigLLVM_shave:
569576 case ZigLLVM_wasm32:
570577 case ZigLLVM_renderscript32:
578 case ZigLLVM_csky:
571579 return 32;
572580
573581 case ZigLLVM_aarch64:
......@@ -707,10 +715,10 @@ uint32_t target_c_type_size_in_bits(const ZigTarget *target, CIntType id) {
707715 case OsKFreeBSD:
708716 case OsLv2:
709717 case OsSolaris:
718 case OsZOS:
710719 case OsMinix:
711720 case OsRTEMS:
712721 case OsNaCl:
713 case OsCNK:
714722 case OsAIX:
715723 case OsCUDA:
716724 case OsNVCL:
......@@ -799,6 +807,7 @@ const char *arch_stack_pointer_register_name(ZigLLVM_ArchType arch) {
799807 case ZigLLVM_riscv64:
800808 case ZigLLVM_mipsel:
801809 case ZigLLVM_ppc:
810 case ZigLLVM_ppcle:
802811 case ZigLLVM_ppc64:
803812 case ZigLLVM_ppc64le:
804813 return "sp";
......@@ -814,6 +823,7 @@ const char *arch_stack_pointer_register_name(ZigLLVM_ArchType arch) {
814823 case ZigLLVM_avr:
815824 case ZigLLVM_bpfeb:
816825 case ZigLLVM_bpfel:
826 case ZigLLVM_csky:
817827 case ZigLLVM_hexagon:
818828 case ZigLLVM_lanai:
819829 case ZigLLVM_hsail:
......@@ -868,6 +878,7 @@ bool target_is_arm(const ZigTarget *target) {
868878 case ZigLLVM_avr:
869879 case ZigLLVM_bpfeb:
870880 case ZigLLVM_bpfel:
881 case ZigLLVM_csky:
871882 case ZigLLVM_hexagon:
872883 case ZigLLVM_lanai:
873884 case ZigLLVM_hsail:
......@@ -901,6 +912,7 @@ bool target_is_arm(const ZigTarget *target) {
901912 case ZigLLVM_wasm64:
902913 case ZigLLVM_xcore:
903914 case ZigLLVM_ppc:
915 case ZigLLVM_ppcle:
904916 case ZigLLVM_ppc64:
905917 case ZigLLVM_ve:
906918 return false;
......@@ -951,11 +963,10 @@ ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) {
951963 case OsCloudABI:
952964 case OsLv2:
953965 case OsSolaris:
954 case OsHaiku:
966 case OsZOS:
955967 case OsMinix:
956968 case OsRTEMS:
957969 case OsNaCl:
958 case OsCNK:
959970 case OsAIX:
960971 case OsCUDA:
961972 case OsNVCL:
......@@ -979,6 +990,7 @@ ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) {
979990 case OsNetBSD:
980991 case OsDragonFly:
981992 case OsHurd:
993 case OsHaiku:
982994 return ZigLLVM_GNU;
983995 case OsUefi:
984996 case OsWindows:
......@@ -1039,6 +1051,8 @@ static const AvailableLibC libcs_available[] = {
10391051 {ZigLLVM_arm, OsLinux, ZigLLVM_MuslEABI},
10401052 {ZigLLVM_arm, OsLinux, ZigLLVM_MuslEABIHF},
10411053 {ZigLLVM_arm, OsWindows, ZigLLVM_GNU},
1054 {ZigLLVM_csky, OsLinux, ZigLLVM_GNUEABI},
1055 {ZigLLVM_csky, OsLinux, ZigLLVM_GNUEABIHF},
10421056 {ZigLLVM_x86, OsLinux, ZigLLVM_GNU},
10431057 {ZigLLVM_x86, OsLinux, ZigLLVM_Musl},
10441058 {ZigLLVM_x86, OsWindows, ZigLLVM_GNU},
......@@ -1094,6 +1108,7 @@ const char *target_libc_generic_name(const ZigTarget *target) {
10941108 case ZigLLVM_GNUEABI:
10951109 case ZigLLVM_GNUEABIHF:
10961110 case ZigLLVM_GNUX32:
1111 case ZigLLVM_GNUILP32:
10971112 return "glibc";
10981113 case ZigLLVM_Musl:
10991114 case ZigLLVM_MuslEABI:
src/stage1/zig0.cpp+2-2
......@@ -94,6 +94,8 @@ static Os get_zig_os_type(ZigLLVM_OSType os_type) {
9494 return OsSolaris;
9595 case ZigLLVM_Win32:
9696 return OsWindows;
97 case ZigLLVM_ZOS:
98 return OsZOS;
9799 case ZigLLVM_Haiku:
98100 return OsHaiku;
99101 case ZigLLVM_Minix:
......@@ -102,8 +104,6 @@ static Os get_zig_os_type(ZigLLVM_OSType os_type) {
102104 return OsRTEMS;
103105 case ZigLLVM_NaCl:
104106 return OsNaCl;
105 case ZigLLVM_CNK:
106 return OsCNK;
107107 case ZigLLVM_AIX:
108108 return OsAIX;
109109 case ZigLLVM_CUDA:
src/target.zig+6-1
......@@ -25,6 +25,8 @@ pub const available_libcs = [_]ArchOsAbi{
2525 .{ .arch = .arm, .os = .linux, .abi = .musleabi },
2626 .{ .arch = .arm, .os = .linux, .abi = .musleabihf },
2727 .{ .arch = .arm, .os = .windows, .abi = .gnu },
28 .{ .arch = .csky, .os = .linux, .abi = .gnueabi },
29 .{ .arch = .csky, .os = .linux, .abi = .gnueabihf },
2830 .{ .arch = .i386, .os = .linux, .abi = .gnu },
2931 .{ .arch = .i386, .os = .linux, .abi = .musl },
3032 .{ .arch = .i386, .os = .windows, .abi = .gnu },
......@@ -71,6 +73,7 @@ pub fn libCGenericName(target: std.Target) [:0]const u8 {
7173 .gnueabi,
7274 .gnueabihf,
7375 .gnux32,
76 .gnuilp32,
7477 => return "glibc",
7578 .musl,
7679 .musleabi,
......@@ -204,11 +207,11 @@ pub fn osToLLVM(os_tag: std.Target.Os.Tag) llvm.OSType {
204207 .netbsd => .NetBSD,
205208 .openbsd => .OpenBSD,
206209 .solaris => .Solaris,
210 .zos => .ZOS,
207211 .haiku => .Haiku,
208212 .minix => .Minix,
209213 .rtems => .RTEMS,
210214 .nacl => .NaCl,
211 .cnk => .CNK,
212215 .aix => .AIX,
213216 .cuda => .CUDA,
214217 .nvcl => .NVCL,
......@@ -238,6 +241,7 @@ pub fn archToLLVM(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {
238241 .avr => .avr,
239242 .bpfel => .bpfel,
240243 .bpfeb => .bpfeb,
244 .csky => .csky,
241245 .hexagon => .hexagon,
242246 .mips => .mips,
243247 .mipsel => .mipsel,
......@@ -245,6 +249,7 @@ pub fn archToLLVM(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {
245249 .mips64el => .mips64el,
246250 .msp430 => .msp430,
247251 .powerpc => .ppc,
252 .powerpcle => .ppcle,
248253 .powerpc64 => .ppc64,
249254 .powerpc64le => .ppc64le,
250255 .r600 => .r600,
src/translate_c.zig+1-1
......@@ -2914,7 +2914,7 @@ fn transSwitchProngStmtInline(
29142914
29152915fn transConstantExpr(c: *Context, scope: *Scope, expr: *const clang.Expr, used: ResultUsed) TransError!Node {
29162916 var result: clang.ExprEvalResult = undefined;
2917 if (!expr.evaluateAsConstantExpr(&result, .EvaluateForCodeGen, c.clang_context))
2917 if (!expr.evaluateAsConstantExpr(&result, .Normal, c.clang_context))
29182918 return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "invalid constant expression", .{});
29192919
29202920 switch (result.Val.getKind()) {
src/type.zig+1-1
......@@ -2695,11 +2695,11 @@ pub const CType = enum {
26952695 .kfreebsd,
26962696 .lv2,
26972697 .solaris,
2698 .zos,
26982699 .haiku,
26992700 .minix,
27002701 .rtems,
27012702 .nacl,
2702 .cnk,
27032703 .aix,
27042704 .cuda,
27052705 .nvcl,
src/zig_clang.cpp+21-7
......@@ -182,6 +182,8 @@ void ZigClang_detect_enum_CK(clang::CastKind x) {
182182 case clang::CK_IntegralToBoolean:
183183 case clang::CK_IntegralToFloating:
184184 case clang::CK_IntegralToPointer:
185 case clang::CK_FloatingToFixedPoint:
186 case clang::CK_FixedPointToFloating:
185187 case clang::CK_LValueBitCast:
186188 case clang::CK_LValueToRValueBitCast:
187189 case clang::CK_LValueToRValue:
......@@ -237,6 +239,8 @@ static_assert((clang::CastKind)ZigClangCK_VectorSplat == clang::CK_VectorSplat,
237239static_assert((clang::CastKind)ZigClangCK_IntegralCast == clang::CK_IntegralCast, "");
238240static_assert((clang::CastKind)ZigClangCK_IntegralToBoolean == clang::CK_IntegralToBoolean, "");
239241static_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, "");
240244static_assert((clang::CastKind)ZigClangCK_FixedPointCast == clang::CK_FixedPointCast, "");
241245static_assert((clang::CastKind)ZigClangCK_FixedPointToIntegral == clang::CK_FixedPointToIntegral, "");
242246static_assert((clang::CastKind)ZigClangCK_IntegralToFixedPoint == clang::CK_IntegralToFixedPoint, "");
......@@ -928,6 +932,7 @@ void ZigClang_detect_enum_DeclKind(clang::Decl::Kind x) {
928932 case clang::Decl::MSGuid:
929933 case clang::Decl::OMPDeclareMapper:
930934 case clang::Decl::OMPDeclareReduction:
935 case clang::Decl::TemplateParamObject:
931936 case clang::Decl::UnresolvedUsingValue:
932937 case clang::Decl::OMPAllocate:
933938 case clang::Decl::OMPRequires:
......@@ -1013,6 +1018,7 @@ static_assert((clang::Decl::Kind)ZigClangDeclIndirectField == clang::Decl::Indir
10131018static_assert((clang::Decl::Kind)ZigClangDeclMSGuid == clang::Decl::MSGuid, "");
10141019static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareMapper == clang::Decl::OMPDeclareMapper, "");
10151020static_assert((clang::Decl::Kind)ZigClangDeclOMPDeclareReduction == clang::Decl::OMPDeclareReduction, "");
1021static_assert((clang::Decl::Kind)ZigClangDeclTemplateParamObject == clang::Decl::TemplateParamObject, "");
10161022static_assert((clang::Decl::Kind)ZigClangDeclUnresolvedUsingValue == clang::Decl::UnresolvedUsingValue, "");
10171023static_assert((clang::Decl::Kind)ZigClangDeclOMPRequires == clang::Decl::OMPRequires, "");
10181024static_assert((clang::Decl::Kind)ZigClangDeclOMPThreadPrivate == clang::Decl::OMPThreadPrivate, "");
......@@ -1122,6 +1128,8 @@ void ZigClang_detect_enum_BuiltinTypeKind(clang::BuiltinType::Kind x) {
11221128 case clang::BuiltinType::SveFloat64x4:
11231129 case clang::BuiltinType::SveBFloat16x4:
11241130 case clang::BuiltinType::SveBool:
1131 case clang::BuiltinType::VectorQuad:
1132 case clang::BuiltinType::VectorPair:
11251133 case clang::BuiltinType::Void:
11261134 case clang::BuiltinType::Bool:
11271135 case clang::BuiltinType::Char_U:
......@@ -1295,6 +1303,8 @@ static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat32x4 == clang
12951303static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveFloat64x4 == clang::BuiltinType::SveFloat64x4, "");
12961304static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeSveBFloat16x4 == clang::BuiltinType::SveBFloat16x4, "");
12971305static_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, "");
12981308static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeVoid == clang::BuiltinType::Void, "");
12991309static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeBool == clang::BuiltinType::Bool, "");
13001310static_assert((clang::BuiltinType::Kind)ZigClangBuiltinTypeChar_U == clang::BuiltinType::Char_U, "");
......@@ -1517,15 +1527,19 @@ static_assert((clang::PreprocessedEntity::EntityKind)ZigClangPreprocessedEntity_
15171527static_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) {
15211531 switch (x) {
1522 case clang::Expr::EvaluateForCodeGen:
1523 case clang::Expr::EvaluateForMangling:
1532 case clang::Expr::ConstantExprKind::Normal:
1533 case clang::Expr::ConstantExprKind::NonClassTemplateArgument:
1534 case clang::Expr::ConstantExprKind::ClassTemplateArgument:
1535 case clang::Expr::ConstantExprKind::ImmediateInvocation:
15241536 break;
15251537 }
15261538}
1527static_assert((clang::Expr::ConstExprUsage)ZigClangExpr_EvaluateForCodeGen == clang::Expr::EvaluateForCodeGen, "");
1528static_assert((clang::Expr::ConstExprUsage)ZigClangExpr_EvaluateForMangling == clang::Expr::EvaluateForMangling, "");
1539static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ContantExprKind_Normal == clang::Expr::ConstantExprKind::Normal, "");
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
15311545static_assert(sizeof(ZigClangAPValue) == sizeof(clang::APValue), "");
......@@ -2148,12 +2162,12 @@ bool ZigClangExpr_EvaluateAsFloat(const ZigClangExpr *self, ZigClangAPFloat **re
21482162}
21492163
21502164bool ZigClangExpr_EvaluateAsConstantExpr(const ZigClangExpr *self, ZigClangExprEvalResult *result,
2151 ZigClangExpr_ConstExprUsage usage, const struct ZigClangASTContext *ctx)
2165 ZigClangExpr_ConstantExprKind kind, const struct ZigClangASTContext *ctx)
21522166{
21532167 auto casted_self = reinterpret_cast<const clang::Expr *>(self);
21542168 auto casted_ctx = reinterpret_cast<const clang::ASTContext *>(ctx);
21552169 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)) {
21572171 return false;
21582172 }
21592173 *result = bitcast(eval_result);
src/zig_clang.h+11-4
......@@ -541,6 +541,8 @@ enum ZigClangCK {
541541 ZigClangCK_IntegralCast,
542542 ZigClangCK_IntegralToBoolean,
543543 ZigClangCK_IntegralToFloating,
544 ZigClangCK_FloatingToFixedPoint,
545 ZigClangCK_FixedPointToFloating,
544546 ZigClangCK_FixedPointCast,
545547 ZigClangCK_FixedPointToIntegral,
546548 ZigClangCK_IntegralToFixedPoint,
......@@ -647,6 +649,7 @@ enum ZigClangDeclKind {
647649 ZigClangDeclMSGuid,
648650 ZigClangDeclOMPDeclareMapper,
649651 ZigClangDeclOMPDeclareReduction,
652 ZigClangDeclTemplateParamObject,
650653 ZigClangDeclUnresolvedUsingValue,
651654 ZigClangDeclOMPAllocate,
652655 ZigClangDeclOMPRequires,
......@@ -757,6 +760,8 @@ enum ZigClangBuiltinTypeKind {
757760 ZigClangBuiltinTypeSveFloat64x4,
758761 ZigClangBuiltinTypeSveBFloat16x4,
759762 ZigClangBuiltinTypeSveBool,
763 ZigClangBuiltinTypeVectorQuad,
764 ZigClangBuiltinTypeVectorPair,
760765 ZigClangBuiltinTypeVoid,
761766 ZigClangBuiltinTypeBool,
762767 ZigClangBuiltinTypeChar_U,
......@@ -915,9 +920,11 @@ enum ZigClangPreprocessedEntity_EntityKind {
915920 ZigClangPreprocessedEntity_InclusionDirectiveKind,
916921};
917922
918enum ZigClangExpr_ConstExprUsage {
919 ZigClangExpr_EvaluateForCodeGen,
920 ZigClangExpr_EvaluateForMangling,
923enum ZigClangExpr_ConstantExprKind {
924 ZigClangExpr_ContantExprKind_Normal,
925 ZigClangExpr_ContantExprKind_NonClassTemplateArgument,
926 ZigClangExpr_ContantExprKind_ClassTemplateArgument,
927 ZigClangExpr_ContantExprKind_ImmediateInvocation,
921928};
922929
923930enum ZigClangUnaryExprOrTypeTrait_Kind {
......@@ -1084,7 +1091,7 @@ ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsBooleanCondition(const struct ZigClangE
10841091ZIG_EXTERN_C bool ZigClangExpr_EvaluateAsFloat(const struct ZigClangExpr *self,
10851092 ZigClangAPFloat **result, const struct ZigClangASTContext *ctx);
10861093ZIG_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
10891096ZIG_EXTERN_C const ZigClangExpr *ZigClangInitListExpr_getInit(const ZigClangInitListExpr *, unsigned);
10901097ZIG_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) {
251251 if (auto profilerOutput =
252252 Clang->createOutputFile(Path.str(),
253253 /*Binary=*/false,
254 /*RemoveFileOnSignal=*/false, "",
255 /*Extension=*/"json",
254 /*RemoveFileOnSignal=*/false,
256255 /*useTemporary=*/false)) {
257256
258257 llvm::timeTraceProfilerWrite(*profilerOutput);
src/zig_clang_cc1as_main.cpp+14-15
......@@ -221,19 +221,13 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
221221 // Any DebugInfoKind implies GenDwarfForAssembly.
222222 Opts.GenDwarfForAssembly = Args.hasArg(OPT_debug_info_kind_EQ);
223223
224 if (const Arg *A = Args.getLastArg(OPT_compress_debug_sections,
225 OPT_compress_debug_sections_EQ)) {
226 if (A->getOption().getID() == OPT_compress_debug_sections) {
227 // TODO: be more clever about the compression type auto-detection
228 Opts.CompressDebugSections = llvm::DebugCompressionType::GNU;
229 } else {
230 Opts.CompressDebugSections =
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 }
224 if (const Arg *A = Args.getLastArg(OPT_compress_debug_sections_EQ)) {
225 Opts.CompressDebugSections =
226 llvm::StringSwitch<llvm::DebugCompressionType>(A->getValue())
227 .Case("none", llvm::DebugCompressionType::None)
228 .Case("zlib", llvm::DebugCompressionType::Z)
229 .Case("zlib-gnu", llvm::DebugCompressionType::GNU)
230 .Default(llvm::DebugCompressionType::None);
237231 }
238232
239233 Opts.RelaxELFRelocations = Args.hasArg(OPT_mrelax_relocations);
......@@ -434,8 +428,11 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
434428 std::unique_ptr<MCStreamer> Str;
435429
436430 std::unique_ptr<MCInstrInfo> MCII(TheTarget->createMCInstrInfo());
431 assert(MCII && "Unable to create instruction info!");
432
437433 std::unique_ptr<MCSubtargetInfo> STI(
438434 TheTarget->createMCSubtargetInfo(Opts.Triple, Opts.CPU, FS));
435 assert(STI && "Unable to create subtarget info!");
439436
440437 raw_pwrite_stream *Out = FDOS.get();
441438 std::unique_ptr<buffer_ostream> BOS;
......@@ -474,6 +471,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
474471 TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx));
475472 std::unique_ptr<MCAsmBackend> MAB(
476473 TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions));
474 assert(MAB && "Unable to create asm backend!");
475
477476 std::unique_ptr<MCObjectWriter> OW =
478477 DwoOS ? MAB->createDwoObjectWriter(*Out, *DwoOS)
479478 : MAB->createObjectWriter(*Out);
......@@ -526,8 +525,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
526525 Failed = Parser->Run(Opts.NoInitialTextSection);
527526 }
528527
529 // Close Streamer first.
530 // It might have a reference to the output stream.
528 // Parser has a reference to the output stream (Str), so close Parser first.
529 Parser.reset();
531530 Str.reset();
532531 // Close the output stream early.
533532 BOS.reset();
src/zig_clang_driver.cpp+7
......@@ -528,6 +528,13 @@ int ZigClang_main(int argc_, const char **argv_) {
528528 IsCrash = CommandRes < 0 || CommandRes == 70;
529529#ifdef _WIN32
530530 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;
531538#endif
532539 if (IsCrash) {
533540 TheDriver.generateCompilationDiagnostics(*C, *FailingCommand);
src/zig_llvm.cpp+165-105
......@@ -20,6 +20,7 @@
2020#pragma GCC diagnostic ignored "-Winit-list-lifetime"
2121#endif
2222
23#include <llvm/Analysis/AliasAnalysis.h>
2324#include <llvm/Analysis/TargetLibraryInfo.h>
2425#include <llvm/Analysis/TargetTransformInfo.h>
2526#include <llvm/Bitcode/BitcodeWriter.h>
......@@ -30,9 +31,12 @@
3031#include <llvm/IR/Instructions.h>
3132#include <llvm/IR/LegacyPassManager.h>
3233#include <llvm/IR/Module.h>
34#include <llvm/IR/PassManager.h>
3335#include <llvm/IR/Verifier.h>
3436#include <llvm/InitializePasses.h>
3537#include <llvm/MC/SubtargetFeature.h>
38#include <llvm/Passes/PassBuilder.h>
39#include <llvm/Passes/StandardInstrumentations.h>
3640#include <llvm/Object/Archive.h>
3741#include <llvm/Object/ArchiveWriter.h>
3842#include <llvm/Object/COFF.h>
......@@ -54,6 +58,9 @@
5458#include <llvm/Transforms/Instrumentation/ThreadSanitizer.h>
5559#include <llvm/Transforms/Scalar.h>
5660#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
5865#include <lld/Common/Driver.h>
5966
......@@ -91,14 +98,6 @@ char *ZigLLVMGetNativeFeatures(void) {
9198 return strdup((const char *)StringRef(features.getString()).bytes_begin());
9299}
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
102101#ifndef NDEBUG
103102static const bool assertions_on = true;
104103#else
......@@ -153,6 +152,11 @@ LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Tri
153152 }
154153
155154 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
156160 opt.FunctionSections = function_sections;
157161 switch (float_abi) {
158162 case ZigLLVMABITypeDefault:
......@@ -188,14 +192,16 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM
188192 bool is_small, bool time_report, bool tsan, bool lto,
189193 const char *asm_filename, const char *bin_filename, const char *llvm_ir_filename)
190194{
195 // TODO: Maybe we should collect time trace rather than using timer
196 // to get a more hierarchical timeline view
191197 TimePassesIsEnabled = time_report;
192198
193 raw_fd_ostream *dest_asm = nullptr;
194 raw_fd_ostream *dest_bin = nullptr;
199 raw_fd_ostream *dest_asm_ptr = nullptr;
200 raw_fd_ostream *dest_bin_ptr = nullptr;
195201
196202 if (asm_filename) {
197203 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);
199205 if (EC) {
200206 *error_message = strdup((const char *)StringRef(EC.message()).bytes_begin());
201207 return true;
......@@ -203,116 +209,147 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM
203209 }
204210 if (bin_filename) {
205211 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);
207213 if (EC) {
208214 *error_message = strdup((const char *)StringRef(EC.message()).bytes_begin());
209215 return true;
210216 }
211217 }
212218
213 TargetMachine* target_machine = reinterpret_cast<TargetMachine*>(targ_machine_ref);
214 target_machine->setO0WantsFastISel(true);
215
216 Module* module = unwrap(module_ref);
217
218 PassManagerBuilder *PMBuilder = new(std::nothrow) PassManagerBuilder();
219 if (PMBuilder == nullptr) {
220 *error_message = strdup("memory allocation failure");
221 return true;
219 std::unique_ptr<raw_fd_ostream> dest_asm(dest_asm_ptr),
220 dest_bin(dest_bin_ptr);
221
222 TargetMachine &target_machine = *reinterpret_cast<TargetMachine*>(targ_machine_ref);
223 target_machine.setO0WantsFastISel(true);
224
225 Module &module = *unwrap(module_ref);
226
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 });
222278 }
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);
251 PMBuilder->Inliner = createFunctionInliningPass(PMBuilder->OptLevel, PMBuilder->SizeLevel, false);
280 // Passes specific for release build
281 if (!is_debug) {
282 pass_builder.registerPipelineStartEPCallback(
283 [](ModulePassManager &module_pm, OptimizationLevel OL) {
284 module_pm.addPass(
285 createModuleToFunctionPassAdaptor(AddDiscriminatorsPass()));
286 });
252287 }
253288
289 // Thread sanitizer
254290 if (tsan) {
255 PMBuilder->addExtension(PassManagerBuilder::EP_OptimizerLast, addThreadSanitizerPass);
256 PMBuilder->addExtension(PassManagerBuilder::EP_EnabledOnOptLevel0, addThreadSanitizerPass);
291 pass_builder.registerOptimizerLastEPCallback(
292 [](ModulePassManager &module_pm, OptimizationLevel level) {
293 module_pm.addPass(ThreadSanitizerPass());
294 });
257295 }
258296
259 // Set up the per-function pass manager.
260 legacy::FunctionPassManager FPM = legacy::FunctionPassManager(module);
261 auto tliwp = new(std::nothrow) TargetLibraryInfoWrapperPass(tlii);
262 FPM.add(tliwp);
263 FPM.add(createTargetTransformInfoWrapperPass(target_machine->getTargetIRAnalysis()));
264 if (assertions_on) {
265 FPM.add(createVerifierPass());
297 ModulePassManager module_pm;
298 OptimizationLevel opt_level;
299 // Setting up the optimization level
300 if (is_debug)
301 opt_level = OptimizationLevel::O0;
302 else if (is_small)
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);
266314 }
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) {
299 if (LLVMPrintModuleToFile(module_ref, llvm_ir_filename, error_message)) {
300 return true;
301 }
321 if (dest_bin && !lto) {
322 if (target_machine.addPassesToEmitFile(codegen_pm, *dest_bin, nullptr, CGFT_ObjectFile)) {
323 *error_message = strdup("TargetMachine can't emit an object file");
324 return true;
302325 }
303 if (dest_bin && lto) {
304 WriteBitcodeToFile(*module, *dest_bin);
326 }
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;
305331 }
332 }
333
334 // Optimization phase
335 module_pm.run(module, module_am);
306336
307 if (time_report) {
308 TimerGroup::printAll(errs());
337 // Code generation phase
338 codegen_pm.run(module);
339
340 if (llvm_ir_filename) {
341 if (LLVMPrintModuleToFile(module_ref, llvm_ir_filename, error_message)) {
342 return true;
309343 }
344 }
310345
311 // MPM goes out of scope and writes to the out streams
346 if (dest_bin && lto) {
347 WriteBitcodeToFile(module, *dest_bin);
312348 }
313349
314 delete dest_asm;
315 delete dest_bin;
350 if (time_report) {
351 TimerGroup::printAll(errs());
352 }
316353
317354 return false;
318355}
......@@ -614,8 +651,9 @@ void ZigLLVMDisposeDIBuilder(ZigLLVMDIBuilder *dbuilder) {
614651}
615652
616653void ZigLLVMSetCurrentDebugLocation(LLVMBuilderRef builder, int line, int column, ZigLLVMDIScope *scope) {
617 unwrap(builder)->SetCurrentDebugLocation(DebugLoc::get(
618 line, column, reinterpret_cast<DIScope*>(scope)));
654 DIScope* di_scope = 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);
619657}
620658
621659void ZigLLVMClearCurrentDebugLocation(LLVMBuilderRef builder) {
......@@ -776,7 +814,8 @@ LLVMValueRef ZigLLVMInsertDeclare(ZigLLVMDIBuilder *dibuilder, LLVMValueRef stor
776814}
777815
778816ZigLLVMDILocation *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);
780819 return reinterpret_cast<ZigLLVMDILocation*>(debug_loc.get());
781820}
782821
......@@ -796,7 +835,17 @@ void ZigLLVMAddByValAttr(LLVMValueRef fn_ref, unsigned ArgNo, LLVMTypeRef type_v
796835 AttrBuilder attr_builder;
797836 Type *llvm_type = unwrap<Type>(type_val);
798837 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);
800849 func->setAttributes(new_attr_set);
801850}
802851
......@@ -928,6 +977,15 @@ void ZigLLVMSetTailCall(LLVMValueRef Call) {
928977 unwrap<CallInst>(Call)->setTailCallKind(CallInst::TCK_MustTail);
929978}
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
931989void ZigLLVMFunctionSetPrefixData(LLVMValueRef function, LLVMValueRef data) {
932990 unwrap<Function>(function)->setPrefixData(unwrap<Constant>(data));
933991}
......@@ -1194,6 +1252,7 @@ static_assert((Triple::ArchType)ZigLLVM_arc == Triple::arc, "");
11941252static_assert((Triple::ArchType)ZigLLVM_avr == Triple::avr, "");
11951253static_assert((Triple::ArchType)ZigLLVM_bpfel == Triple::bpfel, "");
11961254static_assert((Triple::ArchType)ZigLLVM_bpfeb == Triple::bpfeb, "");
1255static_assert((Triple::ArchType)ZigLLVM_csky == Triple::csky, "");
11971256static_assert((Triple::ArchType)ZigLLVM_hexagon == Triple::hexagon, "");
11981257static_assert((Triple::ArchType)ZigLLVM_mips == Triple::mips, "");
11991258static_assert((Triple::ArchType)ZigLLVM_mipsel == Triple::mipsel, "");
......@@ -1201,6 +1260,7 @@ static_assert((Triple::ArchType)ZigLLVM_mips64 == Triple::mips64, "");
12011260static_assert((Triple::ArchType)ZigLLVM_mips64el == Triple::mips64el, "");
12021261static_assert((Triple::ArchType)ZigLLVM_msp430 == Triple::msp430, "");
12031262static_assert((Triple::ArchType)ZigLLVM_ppc == Triple::ppc, "");
1263static_assert((Triple::ArchType)ZigLLVM_ppcle == Triple::ppcle, "");
12041264static_assert((Triple::ArchType)ZigLLVM_ppc64 == Triple::ppc64, "");
12051265static_assert((Triple::ArchType)ZigLLVM_ppc64le == Triple::ppc64le, "");
12061266static_assert((Triple::ArchType)ZigLLVM_r600 == Triple::r600, "");
......@@ -1242,8 +1302,6 @@ static_assert((Triple::VendorType)ZigLLVM_UnknownVendor == Triple::UnknownVendor
12421302static_assert((Triple::VendorType)ZigLLVM_Apple == Triple::Apple, "");
12431303static_assert((Triple::VendorType)ZigLLVM_PC == Triple::PC, "");
12441304static_assert((Triple::VendorType)ZigLLVM_SCEI == Triple::SCEI, "");
1245static_assert((Triple::VendorType)ZigLLVM_BGP == Triple::BGP, "");
1246static_assert((Triple::VendorType)ZigLLVM_BGQ == Triple::BGQ, "");
12471305static_assert((Triple::VendorType)ZigLLVM_Freescale == Triple::Freescale, "");
12481306static_assert((Triple::VendorType)ZigLLVM_IBM == Triple::IBM, "");
12491307static_assert((Triple::VendorType)ZigLLVM_ImaginationTechnologies == Triple::ImaginationTechnologies, "");
......@@ -1275,11 +1333,11 @@ static_assert((Triple::OSType)ZigLLVM_NetBSD == Triple::NetBSD, "");
12751333static_assert((Triple::OSType)ZigLLVM_OpenBSD == Triple::OpenBSD, "");
12761334static_assert((Triple::OSType)ZigLLVM_Solaris == Triple::Solaris, "");
12771335static_assert((Triple::OSType)ZigLLVM_Win32 == Triple::Win32, "");
1336static_assert((Triple::OSType)ZigLLVM_ZOS == Triple::ZOS, "");
12781337static_assert((Triple::OSType)ZigLLVM_Haiku == Triple::Haiku, "");
12791338static_assert((Triple::OSType)ZigLLVM_Minix == Triple::Minix, "");
12801339static_assert((Triple::OSType)ZigLLVM_RTEMS == Triple::RTEMS, "");
12811340static_assert((Triple::OSType)ZigLLVM_NaCl == Triple::NaCl, "");
1282static_assert((Triple::OSType)ZigLLVM_CNK == Triple::CNK, "");
12831341static_assert((Triple::OSType)ZigLLVM_AIX == Triple::AIX, "");
12841342static_assert((Triple::OSType)ZigLLVM_CUDA == Triple::CUDA, "");
12851343static_assert((Triple::OSType)ZigLLVM_NVCL == Triple::NVCL, "");
......@@ -1304,6 +1362,7 @@ static_assert((Triple::EnvironmentType)ZigLLVM_GNUABI64 == Triple::GNUABI64, "")
13041362static_assert((Triple::EnvironmentType)ZigLLVM_GNUEABI == Triple::GNUEABI, "");
13051363static_assert((Triple::EnvironmentType)ZigLLVM_GNUEABIHF == Triple::GNUEABIHF, "");
13061364static_assert((Triple::EnvironmentType)ZigLLVM_GNUX32 == Triple::GNUX32, "");
1365static_assert((Triple::EnvironmentType)ZigLLVM_GNUILP32 == Triple::GNUILP32, "");
13071366static_assert((Triple::EnvironmentType)ZigLLVM_CODE16 == Triple::CODE16, "");
13081367static_assert((Triple::EnvironmentType)ZigLLVM_EABI == Triple::EABI, "");
13091368static_assert((Triple::EnvironmentType)ZigLLVM_EABIHF == Triple::EABIHF, "");
......@@ -1322,6 +1381,7 @@ static_assert((Triple::EnvironmentType)ZigLLVM_LastEnvironmentType == Triple::La
13221381static_assert((Triple::ObjectFormatType)ZigLLVM_UnknownObjectFormat == Triple::UnknownObjectFormat, "");
13231382static_assert((Triple::ObjectFormatType)ZigLLVM_COFF == Triple::COFF, "");
13241383static_assert((Triple::ObjectFormatType)ZigLLVM_ELF == Triple::ELF, "");
1384static_assert((Triple::ObjectFormatType)ZigLLVM_GOFF == Triple::GOFF, "");
13251385static_assert((Triple::ObjectFormatType)ZigLLVM_MachO == Triple::MachO, "");
13261386static_assert((Triple::ObjectFormatType)ZigLLVM_Wasm == Triple::Wasm, "");
13271387static_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
264264
265265ZIG_EXTERN_C void ZigLLVMSetFastMath(LLVMBuilderRef builder_wrapped, bool on_state);
266266ZIG_EXTERN_C void ZigLLVMSetTailCall(LLVMValueRef Call);
267ZIG_EXTERN_C void ZigLLVMSetCallSret(LLVMValueRef Call, LLVMTypeRef return_type);
267268ZIG_EXTERN_C void ZigLLVMFunctionSetPrefixData(LLVMValueRef fn, LLVMValueRef data);
268269ZIG_EXTERN_C void ZigLLVMFunctionSetCallingConv(LLVMValueRef function, enum ZigLLVM_CallingConv cc);
269270
270271ZIG_EXTERN_C void ZigLLVMAddFunctionAttr(LLVMValueRef fn, const char *attr_name, const char *attr_value);
271272ZIG_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);
272274ZIG_EXTERN_C void ZigLLVMAddFunctionAttrCold(LLVMValueRef fn);
273275
274276ZIG_EXTERN_C void ZigLLVMParseCommandLineOptions(size_t argc, const char *const *argv);
......@@ -288,6 +290,7 @@ enum ZigLLVM_ArchType {
288290 ZigLLVM_avr, // AVR: Atmel AVR microcontroller
289291 ZigLLVM_bpfel, // eBPF or extended BPF or 64-bit BPF (little endian)
290292 ZigLLVM_bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian)
293 ZigLLVM_csky, // CSKY: csky
291294 ZigLLVM_hexagon, // Hexagon: hexagon
292295 ZigLLVM_mips, // MIPS: mips, mipsallegrex, mipsr6
293296 ZigLLVM_mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el
......@@ -295,6 +298,7 @@ enum ZigLLVM_ArchType {
295298 ZigLLVM_mips64el, // MIPS64EL: mips64el, mips64r6el, mipsn32el, mipsn32r6el
296299 ZigLLVM_msp430, // MSP430: msp430
297300 ZigLLVM_ppc, // PPC: powerpc
301 ZigLLVM_ppcle, // PPCLE: powerpc (little endian)
298302 ZigLLVM_ppc64, // PPC64: powerpc64, ppu
299303 ZigLLVM_ppc64le, // PPC64LE: powerpc64le
300304 ZigLLVM_r600, // R600: AMD GPUs HD2XXX - HD6XXX
......@@ -340,8 +344,6 @@ enum ZigLLVM_VendorType {
340344 ZigLLVM_Apple,
341345 ZigLLVM_PC,
342346 ZigLLVM_SCEI,
343 ZigLLVM_BGP,
344 ZigLLVM_BGQ,
345347 ZigLLVM_Freescale,
346348 ZigLLVM_IBM,
347349 ZigLLVM_ImaginationTechnologies,
......@@ -375,11 +377,11 @@ enum ZigLLVM_OSType {
375377 ZigLLVM_OpenBSD,
376378 ZigLLVM_Solaris,
377379 ZigLLVM_Win32,
380 ZigLLVM_ZOS,
378381 ZigLLVM_Haiku,
379382 ZigLLVM_Minix,
380383 ZigLLVM_RTEMS,
381384 ZigLLVM_NaCl, // Native Client
382 ZigLLVM_CNK, // BG/P Compute-Node Kernel
383385 ZigLLVM_AIX,
384386 ZigLLVM_CUDA, // NVIDIA CUDA
385387 ZigLLVM_NVCL, // NVIDIA OpenCL
......@@ -409,6 +411,7 @@ enum ZigLLVM_EnvironmentType {
409411 ZigLLVM_GNUEABI,
410412 ZigLLVM_GNUEABIHF,
411413 ZigLLVM_GNUX32,
414 ZigLLVM_GNUILP32,
412415 ZigLLVM_CODE16,
413416 ZigLLVM_EABI,
414417 ZigLLVM_EABIHF,
......@@ -432,6 +435,7 @@ enum ZigLLVM_ObjectFormatType {
432435
433436 ZigLLVM_COFF,
434437 ZigLLVM_ELF,
438 ZigLLVM_GOFF,
435439 ZigLLVM_MachO,
436440 ZigLLVM_Wasm,
437441 ZigLLVM_XCOFF,
test/stage1/behavior/vector.zig+13
......@@ -510,6 +510,19 @@ test "vector reduce operation" {
510510 const N = @typeInfo(@TypeOf(x)).Array.len;
511511 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
513526 var r = @reduce(op, @as(Vector(N, TX), x));
514527 switch (@typeInfo(TX)) {
515528 .Int, .Bool => expectEqual(expected, r),
test/tests.zig+38-30
......@@ -154,21 +154,25 @@ const test_targets = blk: {
154154 // .link_libc = true,
155155 //},
156156
157 TestTarget{
158 .target = .{
159 .cpu_arch = .mips,
160 .os_tag = .linux,
161 .abi = .none,
162 },
163 },
164 TestTarget{
165 .target = .{
166 .cpu_arch = .mips,
167 .os_tag = .linux,
168 .abi = .musl,
169 },
170 .link_libc = true,
171 },
157 // https://github.com/ziglang/zig/issues/8155
158 //TestTarget{
159 // .target = .{
160 // .cpu_arch = .mips,
161 // .os_tag = .linux,
162 // .abi = .none,
163 // },
164 //},
165
166 // https://github.com/ziglang/zig/issues/8155
167 //TestTarget{
168 // .target = .{
169 // .cpu_arch = .mips,
170 // .os_tag = .linux,
171 // .abi = .musl,
172 // },
173 // .link_libc = true,
174 //},
175
172176 // https://github.com/ziglang/zig/issues/4927
173177 //TestTarget{
174178 // .target = .{
......@@ -179,21 +183,25 @@ const test_targets = blk: {
179183 // .link_libc = true,
180184 //},
181185
182 TestTarget{
183 .target = .{
184 .cpu_arch = .mipsel,
185 .os_tag = .linux,
186 .abi = .none,
187 },
188 },
189 TestTarget{
190 .target = .{
191 .cpu_arch = .mipsel,
192 .os_tag = .linux,
193 .abi = .musl,
194 },
195 .link_libc = true,
196 },
186 // https://github.com/ziglang/zig/issues/8155
187 //TestTarget{
188 // .target = .{
189 // .cpu_arch = .mipsel,
190 // .os_tag = .linux,
191 // .abi = .none,
192 // },
193 //},
194
195 // https://github.com/ziglang/zig/issues/8155
196 //TestTarget{
197 // .target = .{
198 // .cpu_arch = .mipsel,
199 // .os_tag = .linux,
200 // .abi = .musl,
201 // },
202 // .link_libc = true,
203 //},
204
197205 // https://github.com/ziglang/zig/issues/4927
198206 //TestTarget{
199207 // .target = .{
tools/process_headers.zig+10
......@@ -84,6 +84,16 @@ const glibc_targets = [_]LibCTarget{
8484 .arch = MultiArch{ .specific = Arch.arm },
8585 .abi = MultiAbi{ .specific = Abi.gnueabihf },
8686 },
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 },
8797 LibCTarget{
8898 .name = "i686-linux-gnu",
8999 .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}