Compare commits
77
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0d03d9c8d | ||
|
|
3950da7999 | ||
|
|
7008d2abdd | ||
|
|
27558c42bb | ||
|
|
673e26e290 | ||
|
|
44bd0aad01 | ||
|
|
6d39039b4a | ||
|
|
0294589f16 | ||
|
|
8962c6d511 | ||
|
|
a76a19041f | ||
|
|
9a8fa94905 | ||
|
|
9bac6cc411 | ||
|
|
b307a106f7 | ||
|
|
0da704eabe | ||
|
|
e7fc3d205d | ||
|
|
a12deb2056 | ||
|
|
43a6b1308b | ||
|
|
a3abdf7c04 | ||
|
|
ef8b9e0031 | ||
|
|
b7ad802cc2 | ||
|
|
11563a0f48 | ||
|
|
3d5529b694 | ||
|
|
caa2deb546 | ||
|
|
66ea5a9be4 | ||
|
|
89ee28351a | ||
|
|
8a75946c73 | ||
|
|
f86a4afdc5 | ||
|
|
3fb14b3000 | ||
|
|
db148c0573 | ||
|
|
6cef832329 | ||
|
|
242fe22419 | ||
|
|
224c89182a | ||
|
|
a6e02cc249 | ||
|
|
d50ebb5de9 | ||
|
|
7162a4908a | ||
|
|
1320f703e4 | ||
|
|
54c6f189b1 | ||
|
|
6ae55b3281 | ||
|
|
2924c1c948 | ||
|
|
0c577f2f69 | ||
|
|
5a4de2d46a | ||
|
|
3aa7a85574 | ||
|
|
5617672ee6 | ||
|
|
f6e8a2125d | ||
|
|
31cbf6c11a | ||
|
|
f37716dc82 | ||
|
|
d13c21f6f3 | ||
|
|
a4d1403722 | ||
|
|
bf6a017720 | ||
|
|
76562bb8ee | ||
|
|
57fd9f277a | ||
|
|
eaa263be44 | ||
|
|
38925292b7 | ||
|
|
e8f258ba1d | ||
|
|
b98634f226 | ||
|
|
140e0059e8 | ||
|
|
da7cd9411b | ||
|
|
b0616778f3 | ||
|
|
f4b37f9763 | ||
|
|
5e475b75c8 | ||
|
|
3e6d8fcce5 | ||
|
|
ad464fc1b1 | ||
|
|
4dd0cb7590 | ||
|
|
3a29d23a56 | ||
|
|
437f06d21b | ||
|
|
a30f47e27f | ||
|
|
e5c1a118d7 | ||
|
|
db95591645 | ||
|
|
3be685dbc9 | ||
|
|
b0143adeed | ||
|
|
222e3d578a | ||
|
|
71ef2f31a1 | ||
|
|
4da9c53931 | ||
|
|
08f43173c0 | ||
|
|
9fc0a05c3b | ||
|
|
9c40d26002 | ||
|
|
260f1227bc |
+7
-3
@@ -1,5 +1,3 @@
|
||||
Language: Cpp
|
||||
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: AlwaysBreak
|
||||
AlignConsecutiveAssignments: false
|
||||
@@ -37,7 +35,7 @@ ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DerivePointerAlignment: false
|
||||
FixNamespaceComments: true
|
||||
IncludeBlocks: Preserve
|
||||
IncludeBlocks: Preserve
|
||||
IndentCaseLabels: false
|
||||
IndentPPDirectives: AfterHash
|
||||
IndentWidth: 4
|
||||
@@ -76,3 +74,9 @@ SpacesInSquareBrackets: false
|
||||
Standard: c++17
|
||||
TabWidth: 4
|
||||
UseTab: Always
|
||||
---
|
||||
Language: Cpp
|
||||
---
|
||||
Language: Java
|
||||
#BasedOnStyle: Google
|
||||
#BreakAfterJavaFieldAnnotations: true
|
||||
|
||||
@@ -3,6 +3,7 @@ build-*
|
||||
/distr/
|
||||
/deps/
|
||||
|
||||
/bin/app/data/cxx
|
||||
/bin/app/data/java/lib/
|
||||
/bin/app/data/projects/ignored/
|
||||
/bin/app/data/python/
|
||||
|
||||
+14
@@ -9,4 +9,18 @@ install:
|
||||
script:
|
||||
- COMMIT_HASH=$(git rev-parse HEAD)
|
||||
- docker run --name builder coatisoftware/local ${COMMIT_HASH}
|
||||
- docker cp builder:/home/builder/Sourcetrail/release $TRAVIS_BUILD_DIR/release
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: b+fTcE73+5nkYufBNzGdxnwbx4a2BQr7iy28wdcr+8NrCxgq4mhmuZd+R3JzE7mt3ehEfUbUkXPLwefEcTFkqxXN6WdBjJYTa2JxAHkBuYiSG9X7voNCOU3SWaucY77FTdt5MlWKVOEzoKNT+tbBuLlWKNyPnFLE0JArc9w4DfvCbHos9ikTtiT1suE+OiIgt28SjD6MD4mIDmEHcKkZs1SfNxz8zhkJBp7y0iJOFPaZHZ9wE2DMox5h26ks13NMYP9mkYgZDTMppabuR8KtjGTJB7NSY3Uoj+6AYdGr5hfpzMIzLjfstagfBzLWpnuz29XwUhYR02MTRiJS6h8wXoO5twxWEKIeUT7xEjSZzdirynrErMDThz90vli0gaoZyIhU01sS9lOUozkdQJEg9Wosxs/586bShHOqhvhrfeCv2Z/7u9ftnpm7U+GaFxk3j1ZPHnSt6XcLz2wDcYIjKgsc8dvmMxYTJYLkXENU5XTkKXKfMHfweiZPWBUBjjMpcZWEyw8NQ/IsegMhXlptLsxr5N5A54KipnJK36b52vryIUzzQd4uM/pcWn5j2Il/KagM5U/kRhQDCxAozQ1Ub0HWqM+4WdCxzAg1FEUly7Y68FIVeeD19P7TAPRBGeljmr3vEdJHnr2z20dubWyhOlZ7NfTcd1drWthpN9ZvvT4=
|
||||
file_glob: true
|
||||
file:
|
||||
- "$TRAVIS_BUILD_DIR/release/Sourcetrail*.tar.gz"
|
||||
- "$TRAVIS_BUILD_DIR/release/Sourcetrail*.AppImage"
|
||||
overwrite: true
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
repo: CoatiSoftware/Sourcetrail
|
||||
|
||||
@@ -6,5 +6,6 @@ Eberhard Gräther (@egraether) <egraether@coati.io>
|
||||
Malte Langkabel (@mlangkabel) <mlangkabel@coati.io>
|
||||
Manuel Dobusch
|
||||
Viktoria Pfausler
|
||||
Louis St-Amour (@LouisStAmour) <LouisStAmour@gmail.com>
|
||||
|
||||
Note: (@user) means a github user name.
|
||||
|
||||
@@ -1,5 +1,54 @@
|
||||
### Changelog
|
||||
|
||||
#### 2020.2.37 (Beta)
|
||||
released 2020-06-08
|
||||
|
||||
* C/C++: Improved help message for source file extensions in project settings ([#1039](https://github.com/CoatiSoftware/Sourcetrail/issues/1039))
|
||||
* Python: Updated to SourcetrailPythonIndexer v1.db25.p4 - Record override edges ([#1037](https://github.com/CoatiSoftware/Sourcetrail/issues/1037))
|
||||
* Linux: Migrated Linux '.tar.gz' package creation from CPack to linuxdeployqt ([#1034](https://github.com/CoatiSoftware/Sourcetrail/issues/1034))
|
||||
* UI: Save last filepicker location ([#802](https://github.com/CoatiSoftware/Sourcetrail/issues/802))
|
||||
* C/C++: Updated to LLVM/Clang 10.0.0 ([#965](https://github.com/CoatiSoftware/Sourcetrail/issues/965))
|
||||
* Java: Updated macOS Java Path detector and docs to current JDK file structure ([#1031](https://github.com/CoatiSoftware/Sourcetrail/issues/1031))
|
||||
* Improved performance of excluded files and directories filtering ([#1030](https://github.com/CoatiSoftware/Sourcetrail/issues/1030))
|
||||
* Fix corrupted display of non-ascii characters in about window ([#1013](https://github.com/CoatiSoftware/Sourcetrail/issues/1013))
|
||||
* C/C++: Copy Clang compiler headers from Clang build dir via CMake ([#993](https://github.com/CoatiSoftware/Sourcetrail/issues/993))
|
||||
* Improved error logging if exception occurred while loading project ([#1004](https://github.com/CoatiSoftware/Sourcetrail/issues/1004))
|
||||
* Graph: Add context menu action 'copy to clipboard' ([#999](https://github.com/CoatiSoftware/Sourcetrail/issues/999))
|
||||
* C/C++: Extend Compiler Flags help message ([#974](https://github.com/CoatiSoftware/Sourcetrail/issues/974))
|
||||
* macOS: Create .dmg release package using HFS+ filesystem to be mountable on older macOS versions ([#619](https://github.com/CoatiSoftware/Sourcetrail/issues/619))
|
||||
* Python: Respect "super()" in post processing ([#964](https://github.com/CoatiSoftware/Sourcetrail/issues/964))
|
||||
* Less restrictions for FilePath::isValid check on project location ([#959](https://github.com/CoatiSoftware/Sourcetrail/issues/959))
|
||||
* Refactored recent projects menu ([#956](https://github.com/CoatiSoftware/Sourcetrail/issues/956))
|
||||
* macOs: Updated Info.plist missing values and removed deprecated keys
|
||||
* Python: Respect class qualifier in method call for post processing ([#951](https://github.com/CoatiSoftware/Sourcetrail/issues/951))
|
||||
|
||||
#### 2020.1.117
|
||||
released 2020-03-31
|
||||
|
||||
* C/C++: Fixed multiple main declarations not shown as separate symbols when declaring file has same name ([#950](https://github.com/CoatiSoftware/Sourcetrail/issues/950))
|
||||
* Linux: Provide AppImage package based on linuxdeployqt (issue [#279](https://github.com/CoatiSoftware/Sourcetrail/issues/279)) ([#945](https://github.com/CoatiSoftware/Sourcetrail/issues/945))
|
||||
* Make content of help dialogs selectable (issue [#805](https://github.com/CoatiSoftware/Sourcetrail/issues/935))
|
||||
* Added keyboard controls to move and activate focus in graph and code views using WASD/HJKL/Arrows + Enter/E ([#935](https://github.com/CoatiSoftware/Sourcetrail/issues/935)) (issues [#486](https://github.com/CoatiSoftware/Sourcetrail/issues/486), [#327](https://github.com/CoatiSoftware/Sourcetrail/issues/327), [#214](https://github.com/CoatiSoftware/Sourcetrail/issues/214), [#210](https://github.com/CoatiSoftware/Sourcetrail/issues/210))
|
||||
* Fixed a crash in shared memory use ([#912](https://github.com/CoatiSoftware/Sourcetrail/issues/912))
|
||||
* Discard non-existing paths in automatic path detection ([#930](https://github.com/CoatiSoftware/Sourcetrail/issues/930))
|
||||
* Python: Update python indexer to use jedi 0.16.0 ([#929](https://github.com/CoatiSoftware/Sourcetrail/issues/929))
|
||||
* Fixed frequent deadlock after loading project from Start Screen (issue [#924](https://github.com/CoatiSoftware/Sourcetrail/issues/924))
|
||||
* C/C++: Updated LLVM/Clang config headers to release 9.0.0 ([#922](https://github.com/CoatiSoftware/Sourcetrail/issues/922))
|
||||
* Fix crash in update check on premature Qt object deletion ([#920](https://github.com/CoatiSoftware/Sourcetrail/issues/920))
|
||||
* C/C++: Fixed an indexer crash ([#911](https://github.com/CoatiSoftware/Sourcetrail/issues/911))
|
||||
* Code: fixed font size not changed in single file view (issue [#916](https://github.com/CoatiSoftware/Sourcetrail/issues/916))
|
||||
* Mark required contents with asterisk in Source Group setup (issue [#723](https://github.com/CoatiSoftware/Sourcetrail/issues/723)) ([#914](https://github.com/CoatiSoftware/Sourcetrail/issues/914))
|
||||
* Removed multiple dialog steps in Source Group setup (issue [#723](https://github.com/CoatiSoftware/Sourcetrail/issues/723)) ([#913](https://github.com/CoatiSoftware/Sourcetrail/issues/913))
|
||||
* Handled non-writeable project location (issue [#735](https://github.com/CoatiSoftware/Sourcetrail/issues/735)) ([#906](https://github.com/CoatiSoftware/Sourcetrail/issues/906))
|
||||
* Fixed error help dialog not showing up during indexing (issue [#740](https://github.com/CoatiSoftware/Sourcetrail/issues/740)) ([#904](https://github.com/CoatiSoftware/Sourcetrail/issues/904))
|
||||
* Allow changing the log file path in preferences (issue [#156](https://github.com/CoatiSoftware/Sourcetrail/issues/156)) ([#900](https://github.com/CoatiSoftware/Sourcetrail/issues/900))
|
||||
* Fix crash when project directory contains non-latin character (issue [#899](https://github.com/CoatiSoftware/Sourcetrail/issues/899)) ([#901](https://github.com/CoatiSoftware/Sourcetrail/issues/901))
|
||||
* Graph: Fixed endless recursion on cyclic inheritance edges
|
||||
* Add 'close tabs to the right' context menu action to tab bar (issue [#822](https://github.com/CoatiSoftware/Sourcetrail/issues/822)) ([#875](https://github.com/CoatiSoftware/Sourcetrail/issues/875))
|
||||
* C/C++: Record calls to cxx destructor on delete keyword (issue [#829](https://github.com/CoatiSoftware/Sourcetrail/issues/829)) ([#863](https://github.com/CoatiSoftware/Sourcetrail/issues/863))
|
||||
* Retry pre-filling mandatory empty path settings on startup ([#864](https://github.com/CoatiSoftware/Sourcetrail/issues/864))
|
||||
* Improved handling of unloadable source group ([#862](https://github.com/CoatiSoftware/Sourcetrail/issues/862))
|
||||
|
||||
#### 2019.4.102
|
||||
released 2019-12-20
|
||||
|
||||
|
||||
+88
-32
@@ -7,6 +7,7 @@ set(BUILD_CXX_LANGUAGE_PACKAGE OFF CACHE BOOL "Add C and C++ support to the Sour
|
||||
set(BUILD_JAVA_LANGUAGE_PACKAGE OFF CACHE BOOL "Add Java support to the Sourcetrail indexer.")
|
||||
set(BUILD_PYTHON_LANGUAGE_PACKAGE OFF CACHE BOOL "Add Python support to the Sourcetrail indexer.")
|
||||
set(DOCKER_BUILD OFF CACHE BOOL "Build runs in Docker")
|
||||
set(TREAT_WARNINGS_AS_ERRORS ON CACHE BOOL "Treat compiler warnings as errors")
|
||||
|
||||
#set (CMAKE_VERBOSE_MAKEFILE ON)
|
||||
|
||||
@@ -71,8 +72,9 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
|
||||
|
||||
# Settings ---------------------------------------------------------------------
|
||||
@@ -88,6 +90,31 @@ if (DOCKER_BUILD)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
|
||||
endif()
|
||||
|
||||
if (TREAT_WARNINGS_AS_ERRORS)
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
# Visual Studio 2017 version 15.9 <= Version <= Visual Studio 2019 Version 16.4
|
||||
if ((MSVC_VERSION GREATER_EQUAL 1916) AND (MSVC_VERSION LESS_EQUAL 1924))
|
||||
# Warning 4003: not enough actual parameters for macro 'identifier'
|
||||
# Warning 4250: 'class1' inherits 'class2::member' via dominance
|
||||
set(WARNINGS_LIST "/wd4003 /wd4250")
|
||||
set(CMAKE_CXX_WARNINGS_FLAGS "/experimental:external /external:anglebrackets /external:W0 /WX")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_WARNINGS_FLAGS} ${WARNINGS_LIST}")
|
||||
|
||||
# Treat linker warnings as errors
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /WX")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /WX")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /WX")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /WX")
|
||||
|
||||
message(STATUS "'Treat warnings as errors' policy is enabled")
|
||||
else()
|
||||
message(STATUS "'Treat warnings as errors' policy is disabled")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "'Treat warnings as errors' policy is disabled")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# For debugging the release build on linux
|
||||
#if (UNIX AND "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||
#add_definitions(-fno-omit-frame-pointer)
|
||||
@@ -104,6 +131,31 @@ if (BUILD_CXX_LANGUAGE_PACKAGE)
|
||||
message(STATUS "Found LLVM ${LLVM_VERSION}")
|
||||
endif()
|
||||
|
||||
if (UNIX)
|
||||
set(LLVM_CONFIGURATION_TYPES ".")
|
||||
endif()
|
||||
|
||||
set (CLANG_COMPILER_HEADER_SEARCH_PATH "")
|
||||
foreach(LLVM_CONFIGURATION_TYPE ${LLVM_CONFIGURATION_TYPES})
|
||||
if (CLANG_COMPILER_HEADER_SEARCH_PATH STREQUAL "")
|
||||
set (CLANG_COMPILER_HEADER_SEARCH_PATH "${LLVM_BINARY_DIR}/${LLVM_CONFIGURATION_TYPE}/lib/clang/${LLVM_VERSION}/include")
|
||||
message (STATUS "Trying to find Clang compiler headers in '${LLVM_CONFIGURATION_TYPE}' build config in directory '${CLANG_COMPILER_HEADER_SEARCH_PATH}'.")
|
||||
if (EXISTS ${CLANG_COMPILER_HEADER_SEARCH_PATH})
|
||||
message (STATUS "Found headers for '${LLVM_CONFIGURATION_TYPE}' build config.")
|
||||
file(GLOB_RECURSE CLANG_COMPILER_HEADER_PATHS RELATIVE "${CLANG_COMPILER_HEADER_SEARCH_PATH}" "${CLANG_COMPILER_HEADER_SEARCH_PATH}/*")
|
||||
foreach(CLANG_COMPILER_HEADER_PATH ${CLANG_COMPILER_HEADER_PATHS})
|
||||
configure_file("${CLANG_COMPILER_HEADER_SEARCH_PATH}/${CLANG_COMPILER_HEADER_PATH}" "${CMAKE_SOURCE_DIR}/bin/app/data/cxx/include/${CLANG_COMPILER_HEADER_PATH}" COPYONLY)
|
||||
endforeach()
|
||||
else ()
|
||||
set (CLANG_COMPILER_HEADER_SEARCH_PATH "")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach()
|
||||
|
||||
if (CLANG_COMPILER_HEADER_SEARCH_PATH STREQUAL "")
|
||||
message(FATAL_ERROR "Unable to copy Clang compiler headers from clang build dir.")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
@@ -281,6 +333,9 @@ configure_file(
|
||||
|
||||
if (BUILD_CXX_LANGUAGE_PACKAGE)
|
||||
|
||||
set(CAPTURED_CMAKE_CXX_STANDARD ${CMAKE_CXX_STANDARD})
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
|
||||
add_library(${LIB_CXX_PROJECT_NAME} ${LIB_CXX_FILES})
|
||||
|
||||
create_source_groups(${LIB_CXX_FILES})
|
||||
@@ -340,9 +395,11 @@ if (BUILD_CXX_LANGUAGE_PACKAGE)
|
||||
target_link_libraries(${LIB_CXX_PROJECT_NAME} ${LIB_UTILITY_PROJECT_NAME} ${CLANG_LIBRARIES} ${REQ_LLVM_LIBS})
|
||||
|
||||
if (WIN32)
|
||||
target_compile_definitions(${LIB_CXX_PROJECT_NAME} PRIVATE _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS) # Due to Clang
|
||||
target_link_libraries(${LIB_CXX_PROJECT_NAME} version)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD ${CAPTURED_CMAKE_CXX_STANDARD})
|
||||
else()
|
||||
|
||||
message(STATUS "Building the Cxx indexer will be skipped. You can enable building this target by setting 'BUILD_CXX_LANGUAGE_PACKAGE' to 'ON'.")
|
||||
@@ -490,6 +547,11 @@ configure_file(
|
||||
)
|
||||
|
||||
#configure the versioning file
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/cmake/version.txt.in
|
||||
${CMAKE_BINARY_DIR}/version.txt
|
||||
)
|
||||
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/cmake/productVersion.h.in
|
||||
${CMAKE_BINARY_DIR}/src/lib_gui/productVersion.h
|
||||
@@ -597,18 +659,13 @@ if (WIN32)
|
||||
# generate pdb for release build
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
|
||||
|
||||
set_property(
|
||||
TARGET ${APP_PROJECT_NAME}
|
||||
PROPERTY VS_DEBUGGER_WORKING_DIRECTORY
|
||||
"${CMAKE_SOURCE_DIR}/bin/app")
|
||||
|
||||
string(REGEX REPLACE "/" "\\\\" BACKSLASHED_CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR})
|
||||
string(REGEX REPLACE "/" "\\\\" BACKSLASHED_CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR})
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${APP_PROJECT_NAME}
|
||||
POST_BUILD
|
||||
COMMAND rmdir "${BACKSLASHED_CMAKE_BINARY_DIR}\\Debug\\app\\data" & mklink /d /j "${BACKSLASHED_CMAKE_BINARY_DIR}\\Debug\\app\\data" "${BACKSLASHED_CMAKE_SOURCE_DIR}\\bin\\app\\data"
|
||||
COMMAND rmdir "${BACKSLASHED_CMAKE_BINARY_DIR}\\Debug\\app\\user" & mklink /d /j "${BACKSLASHED_CMAKE_BINARY_DIR}\\Debug\\app\\user" "${BACKSLASHED_CMAKE_SOURCE_DIR}\\bin\\app\\user"
|
||||
COMMAND rmdir "${BACKSLASHED_CMAKE_BINARY_DIR}\\Release\\app\\data" & mklink /d /j "${BACKSLASHED_CMAKE_BINARY_DIR}\\Release\\app\\data" "${BACKSLASHED_CMAKE_SOURCE_DIR}\\bin\\app\\data"
|
||||
COMMAND rmdir "${BACKSLASHED_CMAKE_BINARY_DIR}\\Release\\app\\user" & mklink /d /j "${BACKSLASHED_CMAKE_BINARY_DIR}\\Release\\app\\user" "${BACKSLASHED_CMAKE_SOURCE_DIR}\\bin\\app\\user"
|
||||
COMMENT "create symbolic links for data"
|
||||
)
|
||||
else ()
|
||||
add_executable(${APP_PROJECT_NAME} ${APP_FILES})
|
||||
endif ()
|
||||
@@ -753,37 +810,36 @@ set_property(
|
||||
if (WIN32)
|
||||
set_target_properties(${TEST_PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/bigobj")
|
||||
set_property(
|
||||
TARGET ${TEST_PROJECT_NAME}
|
||||
PROPERTY VS_DEBUGGER_WORKING_DIRECTORY
|
||||
TARGET ${TEST_PROJECT_NAME}
|
||||
PROPERTY VS_DEBUGGER_WORKING_DIRECTORY
|
||||
"${CMAKE_SOURCE_DIR}/bin/test")
|
||||
endif ()
|
||||
|
||||
|
||||
|
||||
# symlinks for data
|
||||
message(STATUS "create symlink: "
|
||||
"${CMAKE_SOURCE_DIR}/bin/app/data -> "
|
||||
"${CMAKE_BINARY_DIR}/app/data"
|
||||
)
|
||||
|
||||
if (UNIX)
|
||||
# symlinks for data
|
||||
message(STATUS "create symlink: "
|
||||
"${CMAKE_SOURCE_DIR}/bin/app/data ->"
|
||||
"${CMAKE_BINARY_DIR}/app/data")
|
||||
execute_process(
|
||||
COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" "${CMAKE_BINARY_DIR}/app"
|
||||
COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" "${CMAKE_BINARY_DIR}/test"
|
||||
)
|
||||
)
|
||||
execute_process(
|
||||
COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" "${CMAKE_SOURCE_DIR}/bin/app/data" "${CMAKE_BINARY_DIR}/app/data"
|
||||
COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" "${CMAKE_SOURCE_DIR}/bin/app/user" "${CMAKE_BINARY_DIR}/app/user"
|
||||
COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" "${CMAKE_SOURCE_DIR}/bin/test/data" "${CMAKE_BINARY_DIR}/test/data"
|
||||
)
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
# Create different sized icons
|
||||
message(STATUS "create icons")
|
||||
execute_process(
|
||||
COMMAND "${CMAKE_SOURCE_DIR}/setup/Linux/createIcons.sh" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}"
|
||||
)
|
||||
|
||||
# Linux package
|
||||
include(cmake/linux_package.cmake)
|
||||
endif ()
|
||||
)
|
||||
elseif(WIN32)
|
||||
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
|
||||
if (EXISTS "${BACKSLASHED_CMAKE_BINARY_DIR}\\${OUTPUTCONFIG}")
|
||||
execute_process(
|
||||
COMMAND "cmd.exe" "/k" "rmdir" "${BACKSLASHED_CMAKE_BINARY_DIR}\\${OUTPUTCONFIG}\\app\\data" & "mklink" "/d" "/j" "${BACKSLASHED_CMAKE_BINARY_DIR}\\${OUTPUTCONFIG}\\app\\data" "${BACKSLASHED_CMAKE_SOURCE_DIR}\\bin\\app\\data" & exit
|
||||
COMMAND "cmd.exe" "/k" "rmdir" "${BACKSLASHED_CMAKE_BINARY_DIR}\\${OUTPUTCONFIG}\\app\\user" & "mklink" "/d" "/j" "${BACKSLASHED_CMAKE_BINARY_DIR}\\${OUTPUTCONFIG}\\app\\user" "${BACKSLASHED_CMAKE_SOURCE_DIR}\\bin\\app\\user" & exit
|
||||
COMMAND "cmd.exe" "/k" "rmdir" "${BACKSLASHED_CMAKE_BINARY_DIR}\\${OUTPUTCONFIG}\\test\\data" & "mklink" "/d" "/j" "${BACKSLASHED_CMAKE_BINARY_DIR}\\${OUTPUTCONFIG}\\test\\data" "${BACKSLASHED_CMAKE_SOURCE_DIR}\\bin\\test\\data" & exit
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
endif ()
|
||||
|
||||
@@ -60,7 +60,7 @@ If you want to support a certain feature request or you have the same bug that a
|
||||
|
||||
## How to Contribute
|
||||
|
||||
* Please read and follow the steps in [CONTRIBUTING.md](CONTRIBUTING.md) file.
|
||||
* Please read and follow the steps in [CONTRIBUTING.md](CONTRIBUTING.md) file.
|
||||
* You may want to look out for issues labeled [good first issue](https://github.com/CoatiSoftware/Sourcetrail/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) to find some initial tasks to tackle.
|
||||
* If you are looking for more information about Sourcetrail software development, please refer to our [wiki](https://github.com/CoatiSoftware/Sourcetrail/wiki).
|
||||
|
||||
@@ -68,161 +68,168 @@ If you want to support a certain feature request or you have the same bug that a
|
||||
|
||||
Building Sourcetrail requires several dependencies to be in place on your machine. However, our CMake based setup allows to disable indexing support for specific languages which reduces the number of dependencies to a minimum.
|
||||
|
||||
## Building the bare minimum
|
||||
## Building the Base Application
|
||||
|
||||
### Required Tools
|
||||
|
||||
#### Git
|
||||
* __CMake v3.12 (required for Windows, Linux and MacOS)__
|
||||
* __Reason__: Used to generate a build configuration for your build system
|
||||
* __Download__: https://cmake.org/download
|
||||
|
||||
This is required for generating the Sourcetrail version number. Get it from: https://git-scm.com/download.
|
||||
* __Git (required for Windows, Linux and MacOS)__
|
||||
* __Reason__: Used for version control and to automatically generate the Sourcetrail version number from commits and tags
|
||||
* __Download__: https://git-scm.com/download
|
||||
* __Remarks__: Make sure `git` is added to your `PATH` environment variable before running CMake
|
||||
|
||||
Make sure `git` is available in added to your `PATH` environment variable.
|
||||
* __Visual Studio (required for Windows)__
|
||||
* __Reason__: Used for building Sourcetrail
|
||||
* __Download__: https://visualstudio.microsoft.com/downloads/
|
||||
|
||||
#### CMake v3.12
|
||||
|
||||
This is used for generating a build configuration. Get it from: https://cmake.org/download/
|
||||
|
||||
### Additional tools for Windows
|
||||
|
||||
#### Visual Studio
|
||||
|
||||
### Additional tools for Unix
|
||||
|
||||
#### ccache
|
||||
|
||||
This is optionally used to speed up rebuilds if found in `PATH`.
|
||||
* __ccache (optional for Linux and MacOS)__
|
||||
* __Reason__: Used to speed up rebuilds if found in `PATH`
|
||||
* __Download__: https://ccache.dev/download.html
|
||||
|
||||
### Required dependencies
|
||||
|
||||
#### Boost 1.67
|
||||
For the __msvc__ compiler pre-built binaries can be downloaded from [sourceforge.net/projects/boost/files/boost-binaries](https://sourceforge.net/projects/boost/files/boost-binaries/)
|
||||
* __Boost 1.67__
|
||||
* __Reason__: Used for file system access and interprocess communication
|
||||
* __Prebuilt Download for Windows__: https://sourceforge.net/projects/boost/files/boost-binaries/
|
||||
* __Building for Unix__:
|
||||
```
|
||||
$ ./bootstrap.sh --with-libraries=filesystem,program_options,system,date_time
|
||||
$ ./b2 --link=static --variant=release --threading=multi --runtime-link=static --cxxflags=-fPIC
|
||||
```
|
||||
|
||||
For building on Unix:
|
||||
```
|
||||
$ ./bootstrap.sh --with-libraries=filesystem,program_options,system,date_time
|
||||
$ ./b2 --link=static --variant=release --threading=multi --runtime-link=static --cxxflags=-fPIC
|
||||
```
|
||||
|
||||
#### Qt 5.12
|
||||
|
||||
__Note__: still causes style issues on Windows, resort to Qt 5.10
|
||||
|
||||
For the __msvc__ compiler pre-built binaries can be downloaded from [download.qt.io/official_releases/qt](http://download.qt.io/official_releases/qt/)
|
||||
* __Qt 5.12.3__
|
||||
* __Reason__: Used for rendering the GUI and for starting additional (indexer) processes.
|
||||
* __Prebuilt Download__: http://download.qt.io/official_releases/qt/
|
||||
|
||||
### Building
|
||||
|
||||
#### For Windows / Visual Studio
|
||||
```
|
||||
$ cd Sourcetrail
|
||||
$ mkdir -p build/win64
|
||||
$ cd build/win64
|
||||
$ cmake -G "Visual Studio 15 2017 Win64" -DBOOST_ROOT=<path/to/boost_1_68_0> -DQt5_DIR=<path/to/Qt/version/platform/compiler/lib/cmake/Qt5> ../..
|
||||
```
|
||||
If you are using the gui, we recommend that you activate advanced mode. Also you may be required to add some of the defines via the "Add Entry" button.
|
||||
#### On Windows
|
||||
* To set up your build environment run:
|
||||
```
|
||||
$ git clone https://github.com/CoatiSoftware/Sourcetrail.git
|
||||
$ cd Sourcetrail
|
||||
$ mkdir -p build/win64
|
||||
$ cd build/win64
|
||||
$ cmake -G "Visual Studio 15 2017 Win64" -DBOOST_ROOT=<path/to/boost_1_68_0> -DQt5_DIR=<path/to/Qt/version/platform/compiler/lib/cmake/Qt5> ../..
|
||||
```
|
||||
_Hint: If you are using the CMake GUI, we recommend that you activate advanced mode. Also you may be required to add some of the defines via the "Add Entry" button._
|
||||
|
||||
After generating the build configuration, just open the Sourcetrail.sln file that was generated by CMake and build the Sourcetrail project.
|
||||
* After generating the build configuration, just open the Sourcetrail.sln file that was generated by CMake and build the Sourcetrail project.
|
||||
|
||||
#### For Unix
|
||||
#### On Unix
|
||||
|
||||
```
|
||||
$ cd Sourcetrail
|
||||
$ mkdir -p build/Release
|
||||
$ cd build/Release
|
||||
$ cmake -DCMAKE_BUILD_TYPE="Release" -DBOOST_ROOT=<path/to/boost_1_68_0> -DQt5_DIR=<path/to/Qt/version/platform/compiler/lib/cmake/Qt5> ../..
|
||||
$ make Sourcetrail
|
||||
```
|
||||
* To set up your build environment run:
|
||||
```
|
||||
$ cd Sourcetrail
|
||||
$ mkdir -p build/Release
|
||||
$ cd build/Release
|
||||
$ cmake -DCMAKE_BUILD_TYPE="Release" -DBOOST_ROOT=<path/to/boost_1_68_0> -DQt5_DIR=<path/to/Qt/version/platform/compiler/lib/cmake/Qt5> ../..
|
||||
```
|
||||
* Now start the build with:
|
||||
```
|
||||
$ make Sourcetrail
|
||||
```
|
||||
|
||||
### Running
|
||||
|
||||
Run Sourcetrail from within the build directory. During execution Sourcetrail needs resources from `bin/app/data` and `bin/app/user`. Cmake creates symlinks to these directories within the build directory.
|
||||
* Run Sourcetrail from within the build directory. During execution Sourcetrail needs resources from `bin/app/data` and `bin/app/user`. CMake creates symlinks within the build directory that make these directories accessible.
|
||||
|
||||
|
||||
## Enable C/C++ Language Support
|
||||
|
||||
### Required dependencies
|
||||
|
||||
#### LLVM/Clang 9.0.0
|
||||
|
||||
##### Windows
|
||||
For the __msvc__ compiler, follow [these steps](https://clang.llvm.org/get_started.html) to build the project. Make sure to check out the correct tag and to run the cmake command exactly as described.
|
||||
|
||||
##### Unix
|
||||
For Unix, follow this [installation guide](http://clang.llvm.org/docs/LibASTMatchersTutorial.html)
|
||||
|
||||
Build with `-DLLVM_ENABLE_RTTI=ON`.
|
||||
* __LLVM/Clang 10.0.0__
|
||||
* __Reason__: Used for running the preprocessor on the indexedes source code, building and traversing an Abstract Syntax Tree and generating error messages.
|
||||
* __Building__: Make sure to check out the correct tag: `git checkout llvmorg-10.0.0`
|
||||
* __Building for Windows__: Follow [these steps](https://clang.llvm.org/get_started.html) to build the project. Run the cmake command exactly as described.
|
||||
* __Building for Unix__: Follow this [installation guide](http://clang.llvm.org/docs/LibASTMatchersTutorial.html) to build the project. Make sure to build with `-DLLVM_ENABLE_RTTI=ON`.
|
||||
|
||||
### Building
|
||||
|
||||
Run CMake with these additional options:
|
||||
```
|
||||
-DClang_DIR=<path/to/llvm_build/lib/cmake/clang>
|
||||
-DBUILD_CXX_LANGUAGE_PACKAGE=ON
|
||||
```
|
||||
* Run CMake with these additional options:
|
||||
```
|
||||
-DClang_DIR=<path/to/llvm_build>/lib/cmake/clang
|
||||
-DBUILD_CXX_LANGUAGE_PACKAGE=ON
|
||||
```
|
||||
* Build Sourcetrail as described [above](#building).
|
||||
|
||||
## Enable Java Language Support
|
||||
|
||||
### Required dependencies
|
||||
|
||||
#### JDK 1.8
|
||||
* __JDK 1.8__
|
||||
* __Reason__: Used to build the Java indexer and make it callable from the C++ code via JNI.
|
||||
* __Remarks__: Make sure that `<jdk_root>/bin` is available in your `PATH` environmen variable and that the `JAVA_HOME` environment variable is set:
|
||||
```
|
||||
JAVA_HOME=<path/to/Java>/jdk1.x.x_xxx
|
||||
```
|
||||
|
||||
Install JDK and make sure the `JAVA_HOME` environment variable is set:
|
||||
```
|
||||
JAVA_HOME=.../Java/jdk1.x.x_xxx
|
||||
```
|
||||
|
||||
Also make sure `<jdk_root>/bin` is available in your `PATH` environmen variable.
|
||||
|
||||
#### Maven
|
||||
Install Maven and make sure both `M2_HOME` and `MAVEN_HOME` environment variables are set:
|
||||
```
|
||||
M2_HOME=.../apache-maven-x.x.x
|
||||
MAVEN_HOME=.../apache-maven-x.x.x
|
||||
```
|
||||
|
||||
Also make sure `.../apache-maven-x.x.x/bin` is available in your `PATH` environmen variable.
|
||||
* __Maven__
|
||||
* __REASON__: Used within Sourcetrail's automated tests.
|
||||
* __Remarks__: Make sure `.../apache-maven-x.x.x/bin` is available in your `PATH` environmen variable and that both `M2_HOME` and `MAVEN_HOME` environment variables are set:
|
||||
```
|
||||
M2_HOME=.../apache-maven-x.x.x
|
||||
MAVEN_HOME=.../apache-maven-x.x.x
|
||||
```
|
||||
|
||||
### Building
|
||||
|
||||
Run CMake with these additional options:
|
||||
```
|
||||
-DBUILD_JAVA_LANGUAGE_PACKAGE=ON
|
||||
```
|
||||
* Run CMake with these additional options:
|
||||
```
|
||||
-DBUILD_JAVA_LANGUAGE_PACKAGE=ON
|
||||
```
|
||||
* Build Sourcetrail as described [above](#building).
|
||||
|
||||
## Enable Python Language Support
|
||||
|
||||
### Required dependencies
|
||||
### Required Tools
|
||||
|
||||
#### WinRAR (for Windows only)
|
||||
* __WinRAR (required for Windows)__
|
||||
* __REASON__: Used to extract the prebuilt SourcetrailPythonIndexer which is downloaded automatically during build execution.
|
||||
|
||||
### Building
|
||||
|
||||
Run CMake with these additional options:
|
||||
```
|
||||
-DBUILD_PYTHON_LANGUAGE_PACKAGE=ON
|
||||
```
|
||||
* Run CMake with these additional options:
|
||||
```
|
||||
-DBUILD_PYTHON_LANGUAGE_PACKAGE=ON
|
||||
```
|
||||
* Build Sourcetrail as described [above](#building).
|
||||
|
||||
## Packaging
|
||||
|
||||
## Creating the deployment Package
|
||||
|
||||
### Windows
|
||||
|
||||
#### Required Tools
|
||||
|
||||
##### Visual Studio
|
||||
* __Visual Studio (required for Windows)__
|
||||
* __Reason__: Used for building the Sourcetrail Windows installer.
|
||||
* __Remarks__: Make sure to install the `.Net desktop development` workload.
|
||||
* __Download__: https://visualstudio.microsoft.com/downloads/
|
||||
|
||||
##### Wix 3.11
|
||||
* __Wix 3.11__
|
||||
* __Reason__: Used to build the `sourcetrail.msi` Windows installer.
|
||||
* __Remarks__: Make sure to add `<path/to>/WiX Toolset v3.11/bin` to your `PATH` environment variable.
|
||||
* __Download__: https://wixtoolset.org/releases/
|
||||
|
||||
##### Wix extension for Visual Studio
|
||||
* __Wix extension for Visual Studio__
|
||||
* __Reason__: Used to run Wix from the Visual Studio build environment.
|
||||
* __Download__: https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2017Extension
|
||||
|
||||
##### WinRAR
|
||||
* __JRE__
|
||||
* __Reason__: Used for indexing the java sample project that ships with the package.
|
||||
|
||||
Make sure to append these directories to your `PATH` environment variable:
|
||||
* VisualStudio/Common7/Tools
|
||||
* VisualStudio/Common7/IDE
|
||||
* .../Microsoft SDKs/Windows/v7.1A/Bin (for uuidgen in deploy script)
|
||||
* .../WiX Toolset v3.11/bin
|
||||
* .../WinRAR
|
||||
* __WinRAR__
|
||||
* __Reason__: Used for creating the final zip files for the installer and the portable package.
|
||||
* __Remarks__: Make sure to add `<path/to>/WinRAR` to your `PATH` environment variable.
|
||||
|
||||
Run `./script/deploy_windows.sh` script which will generate 32bit/64bit builds and packages these into a portable `.zip` file and a Wix-based Windows installer, each.
|
||||
#### Building
|
||||
|
||||
* Run `./script/deploy_windows.sh` from your Developer Command Prompt for Visual Studio. The script which will generate a 64bit build and packages it into a portable `.zip` file and a Wix-based Windows installer, each.
|
||||
|
||||
### macOS
|
||||
|
||||
@@ -230,7 +237,7 @@ After building, run the `bundle_install.sh` script within the build directory wh
|
||||
|
||||
### Linux
|
||||
|
||||
Run `./script/buildonly.sh package`
|
||||
Run `./setup/Linux/createPackages.sh` from the main directory, which creates both a `.tar.gz` and a `.AppImage` package in the main directory. Packaging depends on [linuxdeployqt](https://github.com/probonopd/linuxdeployqt).
|
||||
|
||||
|
||||
# How to Run the Tests
|
||||
|
||||
+18
-8
@@ -4,16 +4,15 @@ Sponsors [via Patreon](https://www.patreon.com/sourcetrail).
|
||||
|
||||
## Legendary Coatis
|
||||
|
||||
* David Manouchehri
|
||||
* Manik Singhal
|
||||
* Akinobu Fujii
|
||||
* Mario van Beek
|
||||
* Timothee Besset
|
||||
|
||||
## Super Coatis
|
||||
|
||||
* Alexis Jeandet
|
||||
* Edward Gibbs
|
||||
* Jonathan Nemo
|
||||
* Anthony Marchini
|
||||
* Konstantin Kirenko
|
||||
* Louis St-Amour
|
||||
* Mario Lioni
|
||||
* Simon Pintarelli
|
||||
@@ -23,23 +22,34 @@ Sponsors [via Patreon](https://www.patreon.com/sourcetrail).
|
||||
* Alex B
|
||||
* Andreas
|
||||
* Anton
|
||||
* Daniel Nissenbaum
|
||||
* Bicakci, Inc.
|
||||
* BJ
|
||||
* Frederic Simonis
|
||||
* Friedrich Hunstock
|
||||
* Graydon Hoare
|
||||
* IndustrialRobot
|
||||
* Jason Stevens
|
||||
* Jeffrey Hofer
|
||||
* John Borland
|
||||
* kale
|
||||
* MangerDesPates
|
||||
* Matěj Týč
|
||||
* Matt Alexander
|
||||
* Nakul Dhotre
|
||||
* Nathan
|
||||
* Nathan Loofbourrow
|
||||
* Nils Moehrle
|
||||
* Rui Pires
|
||||
* Sam Tuke
|
||||
* Ryo Koyama
|
||||
* Simon
|
||||
* Sneakyferret
|
||||
* Stephan Roslen
|
||||
* Thorsten Dahlheimer
|
||||
* Tomi Joki-Korpela
|
||||
* Tony Hong
|
||||
* Traxes
|
||||
* Werner de Groot
|
||||
* Yacob Cohen-Arazi
|
||||
* Yang, Wenbo
|
||||
* 勇男 金子
|
||||
* 郝晨煜
|
||||
|
||||
_Note: This file will be updated at the beginning of each month._
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</source_paths>
|
||||
|
||||
<exclude_paths>
|
||||
<exclude_path><!-- STRING: path to file or directory to exclude from analysis --></source_path>
|
||||
<exclude_path><!-- STRING: path to file or directory to exclude from analysis --></exclude_path>
|
||||
</exclude_paths>
|
||||
|
||||
<source_extensions>
|
||||
|
||||
@@ -234,7 +234,7 @@
|
||||
<include></include>
|
||||
<macro_use></macro_use>
|
||||
|
||||
<aggregation></aggregation>
|
||||
<bundled_edges></bundled_edges>
|
||||
</edge>
|
||||
</graph>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<window>
|
||||
<background>#494949</background>
|
||||
<separator>#CCCCCC</separator>
|
||||
<focus>#9BF51D</focus>
|
||||
<scrollbar>
|
||||
<background>transparent</background>
|
||||
<handle>#80999999</handle>
|
||||
@@ -106,7 +107,6 @@
|
||||
|
||||
<file>
|
||||
<background>#AAAAAA</background>
|
||||
<hover>#999999</hover>
|
||||
|
||||
<title>
|
||||
<text>black</text>
|
||||
@@ -130,7 +130,6 @@
|
||||
<title>
|
||||
<text>#A0A0A0</text>
|
||||
<background>transparent</background>
|
||||
<hover>#2F2F2F</hover>
|
||||
</title>
|
||||
|
||||
<line_number>
|
||||
@@ -255,7 +254,7 @@
|
||||
<type>
|
||||
<border>
|
||||
<normal>#20FFFFFF</normal>
|
||||
<focus>#FFFFFF</focus>
|
||||
<highlight>#FFFFFF</highlight>
|
||||
</border>
|
||||
<text>
|
||||
<normal>#FFFFFF</normal>
|
||||
@@ -292,11 +291,11 @@
|
||||
<function>
|
||||
<fill>
|
||||
<normal>#FFCC3B</normal>
|
||||
<focus>#FFD05A</focus>
|
||||
<highlight>#FFD05A</highlight>
|
||||
</fill>
|
||||
<border>
|
||||
<normal>transparent</normal>
|
||||
<focus>#FFFFFF</focus>
|
||||
<highlight>#FFFFFF</highlight>
|
||||
</border>
|
||||
<hatching>
|
||||
<normal>#FFE8A6</normal>
|
||||
@@ -309,11 +308,11 @@
|
||||
<global_variable>
|
||||
<fill>
|
||||
<normal>#2FC2D6</normal>
|
||||
<focus>#38D3E8</focus>
|
||||
<highlight>#38D3E8</highlight>
|
||||
</fill>
|
||||
<border>
|
||||
<normal>transparent</normal>
|
||||
<focus>#FFFFFF</focus>
|
||||
<highlight>#FFFFFF</highlight>
|
||||
</border>
|
||||
<hatching>
|
||||
<normal>#96DAE3</normal>
|
||||
@@ -335,7 +334,7 @@
|
||||
</fill>
|
||||
<border>
|
||||
<normal>#80FFFFFF</normal>
|
||||
<focus>#FFFFFF</focus>
|
||||
<highlight>#FFFFFF</highlight>
|
||||
</border>
|
||||
<text>
|
||||
<normal>#FFFFFF</normal>
|
||||
@@ -357,11 +356,11 @@
|
||||
<file>
|
||||
<fill>
|
||||
<normal>#4E82F6</normal>
|
||||
<focus>#6793F6</focus>
|
||||
<highlight>#6793F6</highlight>
|
||||
</fill>
|
||||
<border>
|
||||
<normal>#20FFFFFF</normal>
|
||||
<focus>#FFFFFF</focus>
|
||||
<highlight>#FFFFFF</highlight>
|
||||
</border>
|
||||
<text>
|
||||
<normal>#FFFFFF</normal>
|
||||
@@ -382,8 +381,14 @@
|
||||
|
||||
<access>
|
||||
<fill>
|
||||
<normal>#CCCCCC</normal>
|
||||
<normal>#494949</normal>
|
||||
</fill>
|
||||
<text>
|
||||
<normal>#FFFFFF</normal>
|
||||
</text>
|
||||
<icon>
|
||||
<normal>#FFFFFF</normal>
|
||||
</icon>
|
||||
</access>
|
||||
<bundle>
|
||||
<fill>
|
||||
@@ -391,7 +396,7 @@
|
||||
</fill>
|
||||
<border>
|
||||
<normal>#80FFFFFF</normal>
|
||||
<focus>#FFFFFF</focus>
|
||||
<highlight>#FFFFFF</highlight>
|
||||
</border>
|
||||
<text>
|
||||
<normal>#FFFFFF</normal>
|
||||
@@ -451,7 +456,7 @@
|
||||
</text>
|
||||
<border>
|
||||
<normal>#4E82F6</normal>
|
||||
<focus>#6793F6</focus>
|
||||
<highlight>#6793F6</highlight>
|
||||
</border>
|
||||
</file>
|
||||
<namespace>
|
||||
@@ -463,7 +468,7 @@
|
||||
</text>
|
||||
<border>
|
||||
<normal>#873E3E</normal>
|
||||
<focus>#944444</focus>
|
||||
<highlight>#944444</highlight>
|
||||
</border>
|
||||
</namespace>
|
||||
<inheritance>
|
||||
@@ -477,55 +482,24 @@
|
||||
</group>
|
||||
</node>
|
||||
<edge>
|
||||
<default>
|
||||
<normal>#797979</normal>
|
||||
</default>
|
||||
<default>#797979</default>
|
||||
<type_use>#797979</type_use>
|
||||
<inheritance>#797979</inheritance>
|
||||
|
||||
<type_use>
|
||||
<like>default</like>
|
||||
</type_use>
|
||||
<use>#00A0B6</use>
|
||||
<call>#DEA400</call>
|
||||
<call_trail_focus>#FFFFFF</call_trail_focus>
|
||||
<override>#BA5ECC</override>
|
||||
|
||||
<inheritance>
|
||||
<like>default</like>
|
||||
</inheritance>
|
||||
<type_argument>#D93D5F</type_argument>
|
||||
<template_specialization>#D93D5F</template_specialization>
|
||||
|
||||
<override>
|
||||
<normal>#BA5ECC</normal>
|
||||
</override>
|
||||
<include>#4E82F6</include>
|
||||
<import>#4E82F6</import>
|
||||
<macro_use>#4E82F6</macro_use>
|
||||
<annotation_use>#4E82F6</annotation_use>
|
||||
|
||||
<call>
|
||||
<normal>#DEA400</normal>
|
||||
<trail_focus>#FFFFFF</trail_focus>
|
||||
</call>
|
||||
|
||||
<use>
|
||||
<normal>#00A0B6</normal>
|
||||
</use>
|
||||
|
||||
<type_argument>
|
||||
<normal>#D93D5F</normal>
|
||||
</type_argument>
|
||||
<template_specialization>
|
||||
<like>type_argument</like>
|
||||
</template_specialization>
|
||||
|
||||
<include>
|
||||
<normal>#4E82F6</normal>
|
||||
</include>
|
||||
<import>
|
||||
<like>include</like>
|
||||
</import>
|
||||
<macro_use>
|
||||
<like>include</like>
|
||||
</macro_use>
|
||||
<annotation_use>
|
||||
<like>include</like>
|
||||
</annotation_use>
|
||||
|
||||
<aggregation>
|
||||
<normal>#666666</normal>
|
||||
<focus>#6D6D6D</focus>
|
||||
</aggregation>
|
||||
<bundled_edges>#666666</bundled_edges>
|
||||
</edge>
|
||||
</graph>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<window>
|
||||
<background>white</background>
|
||||
<separator>#A2A2A2</separator>
|
||||
<focus>#FF5900</focus>
|
||||
<scrollbar>
|
||||
<background>transparent</background>
|
||||
<handle>#80999999</handle>
|
||||
@@ -106,7 +107,6 @@
|
||||
|
||||
<file>
|
||||
<background>#D8D8D8</background>
|
||||
<hover>#E0E0E0</hover>
|
||||
|
||||
<title>
|
||||
<text>black</text>
|
||||
@@ -130,7 +130,6 @@
|
||||
<title>
|
||||
<text>#909090</text>
|
||||
<background>transparent</background>
|
||||
<hover>#F5F5F5</hover>
|
||||
</title>
|
||||
|
||||
<line_number>
|
||||
@@ -253,7 +252,7 @@
|
||||
<type>
|
||||
<border>
|
||||
<normal>#203C3C3C</normal>
|
||||
<focus>#3C3C3C</focus>
|
||||
<highlight>#3C3C3C</highlight>
|
||||
</border>
|
||||
</type>
|
||||
<built_in_type>
|
||||
@@ -284,11 +283,11 @@
|
||||
<function>
|
||||
<fill>
|
||||
<normal>#F4D07D</normal>
|
||||
<focus>#F4BC3D</focus>
|
||||
<highlight>#F4BC3D</highlight>
|
||||
</fill>
|
||||
<border>
|
||||
<normal>transparent</normal>
|
||||
<focus>#3C3C3C</focus>
|
||||
<highlight>#3C3C3C</highlight>
|
||||
</border>
|
||||
<hatching>
|
||||
<normal>#FFEDC4</normal>
|
||||
@@ -301,11 +300,11 @@
|
||||
<global_variable>
|
||||
<fill>
|
||||
<normal>#81C1E3</normal>
|
||||
<focus>#72B3D6</focus>
|
||||
<highlight>#72B3D6</highlight>
|
||||
</fill>
|
||||
<border>
|
||||
<normal>transparent</normal>
|
||||
<focus>#3C3C3C</focus>
|
||||
<highlight>#3C3C3C</highlight>
|
||||
</border>
|
||||
<hatching>
|
||||
<normal>#BBDDED</normal>
|
||||
@@ -327,7 +326,7 @@
|
||||
</fill>
|
||||
<border>
|
||||
<normal>#3D3D3D</normal>
|
||||
<focus>black</focus>
|
||||
<highlight>black</highlight>
|
||||
</border>
|
||||
<icon>
|
||||
<normal>#3D3D3D</normal>
|
||||
@@ -346,11 +345,11 @@
|
||||
<file>
|
||||
<fill>
|
||||
<normal>#BEE0AF</normal>
|
||||
<focus>#A6D492</focus>
|
||||
<highlight>#A6D492</highlight>
|
||||
</fill>
|
||||
<border>
|
||||
<normal>#203C3C3C</normal>
|
||||
<focus>#3C3C3C</focus>
|
||||
<highlight>#3C3C3C</highlight>
|
||||
</border>
|
||||
<hatching>
|
||||
<normal>#D7F7C8</normal>
|
||||
@@ -374,7 +373,7 @@
|
||||
</fill>
|
||||
<border>
|
||||
<normal>#803C3C3C</normal>
|
||||
<focus>#3C3C3C</focus>
|
||||
<highlight>#3C3C3C</highlight>
|
||||
</border>
|
||||
</bundle>
|
||||
<count_number>
|
||||
@@ -425,7 +424,7 @@
|
||||
</text>
|
||||
<border>
|
||||
<normal>#BEE0AF</normal>
|
||||
<focus>#A6D492</focus>
|
||||
<highlight>#A6D492</highlight>
|
||||
</border>
|
||||
</file>
|
||||
<namespace>
|
||||
@@ -437,7 +436,7 @@
|
||||
</text>
|
||||
<border>
|
||||
<normal>#EFC5C5</normal>
|
||||
<focus>#EFB3B3</focus>
|
||||
<highlight>#EFB3B3</highlight>
|
||||
</border>
|
||||
</namespace>
|
||||
<inheritance>
|
||||
@@ -451,55 +450,24 @@
|
||||
</group>
|
||||
</node>
|
||||
<edge>
|
||||
<default>
|
||||
<normal>#878787</normal>
|
||||
</default>
|
||||
<default>#878787</default>
|
||||
<type_use>#878787</type_use>
|
||||
<inheritance>#878787</inheritance>
|
||||
|
||||
<type_use>
|
||||
<like>default</like>
|
||||
</type_use>
|
||||
<use>#4B9FC4</use>
|
||||
<call>#F4BC3D</call>
|
||||
<call_trail_focus>#F56B3D</call_trail_focus>
|
||||
<override>#A37ACC</override>
|
||||
|
||||
<inheritance>
|
||||
<like>default</like>
|
||||
</inheritance>
|
||||
<type_argument>#CF6B7C</type_argument>
|
||||
<template_specialization>#CF6B7C</template_specialization>
|
||||
|
||||
<override>
|
||||
<normal>#A37ACC</normal>
|
||||
</override>
|
||||
<include>#719660</include>
|
||||
<import>#719660</import>
|
||||
<macro_use>#719660</macro_use>
|
||||
<annotation_use>#719660</annotation_use>
|
||||
|
||||
<call>
|
||||
<normal>#F4BC3D</normal>
|
||||
<trail_focus>#F56B3D</trail_focus>
|
||||
</call>
|
||||
|
||||
<use>
|
||||
<normal>#4B9FC4</normal>
|
||||
</use>
|
||||
|
||||
<type_argument>
|
||||
<like>#CF6B7C</like>
|
||||
</type_argument>
|
||||
<template_specialization>
|
||||
<like>type_argument</like>
|
||||
</template_specialization>
|
||||
|
||||
<include>
|
||||
<normal>#719660</normal>
|
||||
</include>
|
||||
<import>
|
||||
<like>include</like>
|
||||
</import>
|
||||
<macro_use>
|
||||
<like>include</like>
|
||||
</macro_use>
|
||||
<annotation_use>
|
||||
<like>include</like>
|
||||
</annotation_use>
|
||||
|
||||
<aggregation>
|
||||
<normal>#CCC</normal>
|
||||
<focus>#BBB</focus>
|
||||
</aggregation>
|
||||
<bundled_edges>#CCC</bundled_edges>
|
||||
</edge>
|
||||
</graph>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<window>
|
||||
<background>#272728</background>
|
||||
<separator>#CCC</separator>
|
||||
<focus>#FFFF4D</focus>
|
||||
<scrollbar>
|
||||
<background>transparent</background>
|
||||
<handle>#80999999</handle>
|
||||
@@ -106,7 +107,6 @@
|
||||
|
||||
<file>
|
||||
<background>#5C5C5C</background>
|
||||
<hover>#6C6C6C</hover>
|
||||
|
||||
<title>
|
||||
<text>#F7F7F7</text>
|
||||
@@ -130,7 +130,6 @@
|
||||
<title>
|
||||
<text>#A0A0A0</text>
|
||||
<background>transparent</background>
|
||||
<hover>#2F2F2F</hover>
|
||||
</title>
|
||||
|
||||
<line_number>
|
||||
@@ -256,7 +255,7 @@
|
||||
<type>
|
||||
<border>
|
||||
<normal>#20C3C3C3</normal>
|
||||
<focus>#C3C3C3</focus>
|
||||
<highlight>#C3C3C3</highlight>
|
||||
</border>
|
||||
</type>
|
||||
<built_in_type>
|
||||
@@ -287,11 +286,11 @@
|
||||
<function>
|
||||
<fill>
|
||||
<normal>#7A681F</normal>
|
||||
<focus>#9C8528</focus>
|
||||
<highlight>#9C8528</highlight>
|
||||
</fill>
|
||||
<border>
|
||||
<normal>transparent</normal>
|
||||
<focus>#C3C3C3</focus>
|
||||
<highlight>#C3C3C3</highlight>
|
||||
</border>
|
||||
<hatching>
|
||||
<normal>#544815</normal>
|
||||
@@ -304,11 +303,11 @@
|
||||
<global_variable>
|
||||
<fill>
|
||||
<normal>#21516B</normal>
|
||||
<focus>#2A6484</focus>
|
||||
<highlight>#2A6484</highlight>
|
||||
</fill>
|
||||
<border>
|
||||
<normal>transparent</normal>
|
||||
<focus>#C3C3C3</focus>
|
||||
<highlight>#C3C3C3</highlight>
|
||||
</border>
|
||||
<hatching>
|
||||
<normal>#17384A</normal>
|
||||
@@ -330,7 +329,7 @@
|
||||
</fill>
|
||||
<border>
|
||||
<normal>#80C3C3C3</normal>
|
||||
<focus>#C3C3C3</focus>
|
||||
<highlight>#C3C3C3</highlight>
|
||||
</border>
|
||||
<icon>
|
||||
<normal>#C3C3C3</normal>
|
||||
@@ -349,11 +348,11 @@
|
||||
<file>
|
||||
<fill>
|
||||
<normal>#1B564E</normal>
|
||||
<focus>#21695F</focus>
|
||||
<highlight>#21695F</highlight>
|
||||
</fill>
|
||||
<border>
|
||||
<normal>#20C3C3C3</normal>
|
||||
<focus>#C3C3C3</focus>
|
||||
<highlight>#C3C3C3</highlight>
|
||||
</border>
|
||||
<hatching>
|
||||
<normal>#123B35</normal>
|
||||
@@ -377,7 +376,7 @@
|
||||
</fill>
|
||||
<border>
|
||||
<normal>#80C3C3C3</normal>
|
||||
<focus>#C3C3C3</focus>
|
||||
<highlight>#C3C3C3</highlight>
|
||||
</border>
|
||||
</bundle>
|
||||
<count_number>
|
||||
@@ -428,7 +427,7 @@
|
||||
</text>
|
||||
<border>
|
||||
<normal>#1B564E</normal>
|
||||
<focus>#1E6158</focus>
|
||||
<highlight>#1E6158</highlight>
|
||||
</border>
|
||||
</file>
|
||||
<namespace>
|
||||
@@ -440,7 +439,7 @@
|
||||
</text>
|
||||
<border>
|
||||
<normal>#78282D</normal>
|
||||
<focus>#872D33</focus>
|
||||
<highlight>#872D33</highlight>
|
||||
</border>
|
||||
</namespace>
|
||||
<inheritance>
|
||||
@@ -454,55 +453,24 @@
|
||||
</group>
|
||||
</node>
|
||||
<edge>
|
||||
<default>
|
||||
<normal>#797979</normal>
|
||||
</default>
|
||||
<default>#797979</default>
|
||||
<type_use>#797979</type_use>
|
||||
<inheritance>#797979</inheritance>
|
||||
|
||||
<type_use>
|
||||
<like>default</like>
|
||||
</type_use>
|
||||
<use>#2D6A8C</use>
|
||||
<call>#9C8528</call>
|
||||
<call_trail_focus>#F7F7F7</call_trail_focus>
|
||||
<override>#8A5A94</override>
|
||||
|
||||
<inheritance>
|
||||
<like>default</like>
|
||||
</inheritance>
|
||||
<type_argument>#C14057</type_argument>
|
||||
<template_specialization>#C14057</template_specialization>
|
||||
|
||||
<override>
|
||||
<normal>#8A5A94</normal>
|
||||
</override>
|
||||
<include>#247368</include>
|
||||
<import>#247368</import>
|
||||
<macro_use>#247368</macro_use>
|
||||
<annotation_use>#247368</annotation_use>
|
||||
|
||||
<call>
|
||||
<normal>#9C8528</normal>
|
||||
<trail_focus>#F7F7F7</trail_focus>
|
||||
</call>
|
||||
|
||||
<use>
|
||||
<normal>#2D6A8C</normal>
|
||||
</use>
|
||||
|
||||
<type_argument>
|
||||
<normal>#C14057</normal>
|
||||
</type_argument>
|
||||
<template_specialization>
|
||||
<like>type_argument</like>
|
||||
</template_specialization>
|
||||
|
||||
<include>
|
||||
<normal>#247368</normal>
|
||||
</include>
|
||||
<import>
|
||||
<like>include</like>
|
||||
</import>
|
||||
<macro_use>
|
||||
<like>include</like>
|
||||
</macro_use>
|
||||
<annotation_use>
|
||||
<like>include</like>
|
||||
</annotation_use>
|
||||
|
||||
<aggregation>
|
||||
<normal>#4D4D4D</normal>
|
||||
<focus>#6D6D6D</focus>
|
||||
</aggregation>
|
||||
<bundled_edges>#4D4D4D</bundled_edges>
|
||||
</edge>
|
||||
</graph>
|
||||
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
/*===---- cuda_builtin_vars.h - CUDA built-in variables ---------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __CUDA_BUILTIN_VARS_H
|
||||
#define __CUDA_BUILTIN_VARS_H
|
||||
|
||||
// Forward declares from vector_types.h.
|
||||
struct uint3;
|
||||
struct dim3;
|
||||
|
||||
// The file implements built-in CUDA variables using __declspec(property).
|
||||
// https://msdn.microsoft.com/en-us/library/yhfk0thd.aspx
|
||||
// All read accesses of built-in variable fields get converted into calls to a
|
||||
// getter function which in turn calls the appropriate builtin to fetch the
|
||||
// value.
|
||||
//
|
||||
// Example:
|
||||
// int x = threadIdx.x;
|
||||
// IR output:
|
||||
// %0 = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() #3
|
||||
// PTX output:
|
||||
// mov.u32 %r2, %tid.x;
|
||||
|
||||
#define __CUDA_DEVICE_BUILTIN(FIELD, INTRINSIC) \
|
||||
__declspec(property(get = __fetch_builtin_##FIELD)) unsigned int FIELD; \
|
||||
static inline __attribute__((always_inline)) \
|
||||
__attribute__((device)) unsigned int __fetch_builtin_##FIELD(void) { \
|
||||
return INTRINSIC; \
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#define __DELETE =delete
|
||||
#else
|
||||
#define __DELETE
|
||||
#endif
|
||||
|
||||
// Make sure nobody can create instances of the special variable types. nvcc
|
||||
// also disallows taking address of special variables, so we disable address-of
|
||||
// operator as well.
|
||||
#define __CUDA_DISALLOW_BUILTINVAR_ACCESS(TypeName) \
|
||||
__attribute__((device)) TypeName() __DELETE; \
|
||||
__attribute__((device)) TypeName(const TypeName &) __DELETE; \
|
||||
__attribute__((device)) void operator=(const TypeName &) const __DELETE; \
|
||||
__attribute__((device)) TypeName *operator&() const __DELETE
|
||||
|
||||
struct __cuda_builtin_threadIdx_t {
|
||||
__CUDA_DEVICE_BUILTIN(x,__nvvm_read_ptx_sreg_tid_x());
|
||||
__CUDA_DEVICE_BUILTIN(y,__nvvm_read_ptx_sreg_tid_y());
|
||||
__CUDA_DEVICE_BUILTIN(z,__nvvm_read_ptx_sreg_tid_z());
|
||||
// threadIdx should be convertible to uint3 (in fact in nvcc, it *is* a
|
||||
// uint3). This function is defined after we pull in vector_types.h.
|
||||
__attribute__((device)) operator uint3() const;
|
||||
private:
|
||||
__CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_threadIdx_t);
|
||||
};
|
||||
|
||||
struct __cuda_builtin_blockIdx_t {
|
||||
__CUDA_DEVICE_BUILTIN(x,__nvvm_read_ptx_sreg_ctaid_x());
|
||||
__CUDA_DEVICE_BUILTIN(y,__nvvm_read_ptx_sreg_ctaid_y());
|
||||
__CUDA_DEVICE_BUILTIN(z,__nvvm_read_ptx_sreg_ctaid_z());
|
||||
// blockIdx should be convertible to uint3 (in fact in nvcc, it *is* a
|
||||
// uint3). This function is defined after we pull in vector_types.h.
|
||||
__attribute__((device)) operator uint3() const;
|
||||
private:
|
||||
__CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_blockIdx_t);
|
||||
};
|
||||
|
||||
struct __cuda_builtin_blockDim_t {
|
||||
__CUDA_DEVICE_BUILTIN(x,__nvvm_read_ptx_sreg_ntid_x());
|
||||
__CUDA_DEVICE_BUILTIN(y,__nvvm_read_ptx_sreg_ntid_y());
|
||||
__CUDA_DEVICE_BUILTIN(z,__nvvm_read_ptx_sreg_ntid_z());
|
||||
// blockDim should be convertible to dim3 (in fact in nvcc, it *is* a
|
||||
// dim3). This function is defined after we pull in vector_types.h.
|
||||
__attribute__((device)) operator dim3() const;
|
||||
private:
|
||||
__CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_blockDim_t);
|
||||
};
|
||||
|
||||
struct __cuda_builtin_gridDim_t {
|
||||
__CUDA_DEVICE_BUILTIN(x,__nvvm_read_ptx_sreg_nctaid_x());
|
||||
__CUDA_DEVICE_BUILTIN(y,__nvvm_read_ptx_sreg_nctaid_y());
|
||||
__CUDA_DEVICE_BUILTIN(z,__nvvm_read_ptx_sreg_nctaid_z());
|
||||
// gridDim should be convertible to dim3 (in fact in nvcc, it *is* a
|
||||
// dim3). This function is defined after we pull in vector_types.h.
|
||||
__attribute__((device)) operator dim3() const;
|
||||
private:
|
||||
__CUDA_DISALLOW_BUILTINVAR_ACCESS(__cuda_builtin_gridDim_t);
|
||||
};
|
||||
|
||||
#define __CUDA_BUILTIN_VAR \
|
||||
extern const __attribute__((device)) __attribute__((weak))
|
||||
__CUDA_BUILTIN_VAR __cuda_builtin_threadIdx_t threadIdx;
|
||||
__CUDA_BUILTIN_VAR __cuda_builtin_blockIdx_t blockIdx;
|
||||
__CUDA_BUILTIN_VAR __cuda_builtin_blockDim_t blockDim;
|
||||
__CUDA_BUILTIN_VAR __cuda_builtin_gridDim_t gridDim;
|
||||
|
||||
// warpSize should translate to read of %WARP_SZ but there's currently no
|
||||
// builtin to do so. According to PTX v4.2 docs 'to date, all target
|
||||
// architectures have a WARP_SZ value of 32'.
|
||||
__attribute__((device)) const int warpSize = 32;
|
||||
|
||||
#undef __CUDA_DEVICE_BUILTIN
|
||||
#undef __CUDA_BUILTIN_VAR
|
||||
#undef __CUDA_DISALLOW_BUILTINVAR_ACCESS
|
||||
|
||||
#endif /* __CUDA_BUILTIN_VARS_H */
|
||||
@@ -1,472 +0,0 @@
|
||||
/*===---- __clang_cuda_cmath.h - Device-side CUDA cmath support ------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __CLANG_CUDA_CMATH_H__
|
||||
#define __CLANG_CUDA_CMATH_H__
|
||||
#ifndef __CUDA__
|
||||
#error "This file is for CUDA compilation only."
|
||||
#endif
|
||||
|
||||
#include <limits>
|
||||
|
||||
// CUDA lets us use various std math functions on the device side. This file
|
||||
// works in concert with __clang_cuda_math_forward_declares.h to make this work.
|
||||
//
|
||||
// Specifically, the forward-declares header declares __device__ overloads for
|
||||
// these functions in the global namespace, then pulls them into namespace std
|
||||
// with 'using' statements. Then this file implements those functions, after
|
||||
// their implementations have been pulled in.
|
||||
//
|
||||
// It's important that we declare the functions in the global namespace and pull
|
||||
// them into namespace std with using statements, as opposed to simply declaring
|
||||
// these functions in namespace std, because our device functions need to
|
||||
// overload the standard library functions, which may be declared in the global
|
||||
// namespace or in std, depending on the degree of conformance of the stdlib
|
||||
// implementation. Declaring in the global namespace and pulling into namespace
|
||||
// std covers all of the known knowns.
|
||||
|
||||
#define __DEVICE__ static __device__ __inline__ __attribute__((always_inline))
|
||||
|
||||
__DEVICE__ long long abs(long long __n) { return ::llabs(__n); }
|
||||
__DEVICE__ long abs(long __n) { return ::labs(__n); }
|
||||
__DEVICE__ float abs(float __x) { return ::fabsf(__x); }
|
||||
__DEVICE__ double abs(double __x) { return ::fabs(__x); }
|
||||
__DEVICE__ float acos(float __x) { return ::acosf(__x); }
|
||||
__DEVICE__ float asin(float __x) { return ::asinf(__x); }
|
||||
__DEVICE__ float atan(float __x) { return ::atanf(__x); }
|
||||
__DEVICE__ float atan2(float __x, float __y) { return ::atan2f(__x, __y); }
|
||||
__DEVICE__ float ceil(float __x) { return ::ceilf(__x); }
|
||||
__DEVICE__ float cos(float __x) { return ::cosf(__x); }
|
||||
__DEVICE__ float cosh(float __x) { return ::coshf(__x); }
|
||||
__DEVICE__ float exp(float __x) { return ::expf(__x); }
|
||||
__DEVICE__ float fabs(float __x) { return ::fabsf(__x); }
|
||||
__DEVICE__ float floor(float __x) { return ::floorf(__x); }
|
||||
__DEVICE__ float fmod(float __x, float __y) { return ::fmodf(__x, __y); }
|
||||
__DEVICE__ int fpclassify(float __x) {
|
||||
return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL,
|
||||
FP_ZERO, __x);
|
||||
}
|
||||
__DEVICE__ int fpclassify(double __x) {
|
||||
return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL,
|
||||
FP_ZERO, __x);
|
||||
}
|
||||
__DEVICE__ float frexp(float __arg, int *__exp) {
|
||||
return ::frexpf(__arg, __exp);
|
||||
}
|
||||
|
||||
// For inscrutable reasons, the CUDA headers define these functions for us on
|
||||
// Windows.
|
||||
#ifndef _MSC_VER
|
||||
__DEVICE__ bool isinf(float __x) { return ::__isinff(__x); }
|
||||
__DEVICE__ bool isinf(double __x) { return ::__isinf(__x); }
|
||||
__DEVICE__ bool isfinite(float __x) { return ::__finitef(__x); }
|
||||
// For inscrutable reasons, __finite(), the double-precision version of
|
||||
// __finitef, does not exist when compiling for MacOS. __isfinited is available
|
||||
// everywhere and is just as good.
|
||||
__DEVICE__ bool isfinite(double __x) { return ::__isfinited(__x); }
|
||||
__DEVICE__ bool isnan(float __x) { return ::__isnanf(__x); }
|
||||
__DEVICE__ bool isnan(double __x) { return ::__isnan(__x); }
|
||||
#endif
|
||||
|
||||
__DEVICE__ bool isgreater(float __x, float __y) {
|
||||
return __builtin_isgreater(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool isgreater(double __x, double __y) {
|
||||
return __builtin_isgreater(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool isgreaterequal(float __x, float __y) {
|
||||
return __builtin_isgreaterequal(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool isgreaterequal(double __x, double __y) {
|
||||
return __builtin_isgreaterequal(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool isless(float __x, float __y) {
|
||||
return __builtin_isless(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool isless(double __x, double __y) {
|
||||
return __builtin_isless(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool islessequal(float __x, float __y) {
|
||||
return __builtin_islessequal(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool islessequal(double __x, double __y) {
|
||||
return __builtin_islessequal(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool islessgreater(float __x, float __y) {
|
||||
return __builtin_islessgreater(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool islessgreater(double __x, double __y) {
|
||||
return __builtin_islessgreater(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool isnormal(float __x) { return __builtin_isnormal(__x); }
|
||||
__DEVICE__ bool isnormal(double __x) { return __builtin_isnormal(__x); }
|
||||
__DEVICE__ bool isunordered(float __x, float __y) {
|
||||
return __builtin_isunordered(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool isunordered(double __x, double __y) {
|
||||
return __builtin_isunordered(__x, __y);
|
||||
}
|
||||
__DEVICE__ float ldexp(float __arg, int __exp) {
|
||||
return ::ldexpf(__arg, __exp);
|
||||
}
|
||||
__DEVICE__ float log(float __x) { return ::logf(__x); }
|
||||
__DEVICE__ float log10(float __x) { return ::log10f(__x); }
|
||||
__DEVICE__ float modf(float __x, float *__iptr) { return ::modff(__x, __iptr); }
|
||||
__DEVICE__ float pow(float __base, float __exp) {
|
||||
return ::powf(__base, __exp);
|
||||
}
|
||||
__DEVICE__ float pow(float __base, int __iexp) {
|
||||
return ::powif(__base, __iexp);
|
||||
}
|
||||
__DEVICE__ double pow(double __base, int __iexp) {
|
||||
return ::powi(__base, __iexp);
|
||||
}
|
||||
__DEVICE__ bool signbit(float __x) { return ::__signbitf(__x); }
|
||||
__DEVICE__ bool signbit(double __x) { return ::__signbitd(__x); }
|
||||
__DEVICE__ float sin(float __x) { return ::sinf(__x); }
|
||||
__DEVICE__ float sinh(float __x) { return ::sinhf(__x); }
|
||||
__DEVICE__ float sqrt(float __x) { return ::sqrtf(__x); }
|
||||
__DEVICE__ float tan(float __x) { return ::tanf(__x); }
|
||||
__DEVICE__ float tanh(float __x) { return ::tanhf(__x); }
|
||||
|
||||
// Notably missing above is nexttoward. We omit it because
|
||||
// libdevice doesn't provide an implementation, and we don't want to be in the
|
||||
// business of implementing tricky libm functions in this header.
|
||||
|
||||
// Now we've defined everything we promised we'd define in
|
||||
// __clang_cuda_math_forward_declares.h. We need to do two additional things to
|
||||
// fix up our math functions.
|
||||
//
|
||||
// 1) Define __device__ overloads for e.g. sin(int). The CUDA headers define
|
||||
// only sin(float) and sin(double), which means that e.g. sin(0) is
|
||||
// ambiguous.
|
||||
//
|
||||
// 2) Pull the __device__ overloads of "foobarf" math functions into namespace
|
||||
// std. These are defined in the CUDA headers in the global namespace,
|
||||
// independent of everything else we've done here.
|
||||
|
||||
// We can't use std::enable_if, because we want to be pre-C++11 compatible. But
|
||||
// we go ahead and unconditionally define functions that are only available when
|
||||
// compiling for C++11 to match the behavior of the CUDA headers.
|
||||
template<bool __B, class __T = void>
|
||||
struct __clang_cuda_enable_if {};
|
||||
|
||||
template <class __T> struct __clang_cuda_enable_if<true, __T> {
|
||||
typedef __T type;
|
||||
};
|
||||
|
||||
// Defines an overload of __fn that accepts one integral argument, calls
|
||||
// __fn((double)x), and returns __retty.
|
||||
#define __CUDA_CLANG_FN_INTEGER_OVERLOAD_1(__retty, __fn) \
|
||||
template <typename __T> \
|
||||
__DEVICE__ \
|
||||
typename __clang_cuda_enable_if<std::numeric_limits<__T>::is_integer, \
|
||||
__retty>::type \
|
||||
__fn(__T __x) { \
|
||||
return ::__fn((double)__x); \
|
||||
}
|
||||
|
||||
// Defines an overload of __fn that accepts one two arithmetic arguments, calls
|
||||
// __fn((double)x, (double)y), and returns a double.
|
||||
//
|
||||
// Note this is different from OVERLOAD_1, which generates an overload that
|
||||
// accepts only *integral* arguments.
|
||||
#define __CUDA_CLANG_FN_INTEGER_OVERLOAD_2(__retty, __fn) \
|
||||
template <typename __T1, typename __T2> \
|
||||
__DEVICE__ typename __clang_cuda_enable_if< \
|
||||
std::numeric_limits<__T1>::is_specialized && \
|
||||
std::numeric_limits<__T2>::is_specialized, \
|
||||
__retty>::type \
|
||||
__fn(__T1 __x, __T2 __y) { \
|
||||
return __fn((double)__x, (double)__y); \
|
||||
}
|
||||
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, acos)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, acosh)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, asin)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, asinh)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, atan)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(double, atan2);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, atanh)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, cbrt)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, ceil)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(double, copysign);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, cos)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, cosh)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, erf)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, erfc)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, exp)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, exp2)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, expm1)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, fabs)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(double, fdim);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, floor)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(double, fmax);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(double, fmin);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(double, fmod);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(int, fpclassify)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(double, hypot);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(int, ilogb)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(bool, isfinite)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(bool, isgreater);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(bool, isgreaterequal);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(bool, isinf);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(bool, isless);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(bool, islessequal);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(bool, islessgreater);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(bool, isnan);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(bool, isnormal)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(bool, isunordered);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, lgamma)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, log)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, log10)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, log1p)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, log2)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, logb)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(long long, llrint)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(long long, llround)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(long, lrint)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(long, lround)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, nearbyint);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(double, nextafter);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(double, pow);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_2(double, remainder);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, rint);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, round);
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(bool, signbit)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, sin)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, sinh)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, sqrt)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, tan)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, tanh)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, tgamma)
|
||||
__CUDA_CLANG_FN_INTEGER_OVERLOAD_1(double, trunc);
|
||||
|
||||
#undef __CUDA_CLANG_FN_INTEGER_OVERLOAD_1
|
||||
#undef __CUDA_CLANG_FN_INTEGER_OVERLOAD_2
|
||||
|
||||
// Overloads for functions that don't match the patterns expected by
|
||||
// __CUDA_CLANG_FN_INTEGER_OVERLOAD_{1,2}.
|
||||
template <typename __T1, typename __T2, typename __T3>
|
||||
__DEVICE__ typename __clang_cuda_enable_if<
|
||||
std::numeric_limits<__T1>::is_specialized &&
|
||||
std::numeric_limits<__T2>::is_specialized &&
|
||||
std::numeric_limits<__T3>::is_specialized,
|
||||
double>::type
|
||||
fma(__T1 __x, __T2 __y, __T3 __z) {
|
||||
return std::fma((double)__x, (double)__y, (double)__z);
|
||||
}
|
||||
|
||||
template <typename __T>
|
||||
__DEVICE__ typename __clang_cuda_enable_if<std::numeric_limits<__T>::is_integer,
|
||||
double>::type
|
||||
frexp(__T __x, int *__exp) {
|
||||
return std::frexp((double)__x, __exp);
|
||||
}
|
||||
|
||||
template <typename __T>
|
||||
__DEVICE__ typename __clang_cuda_enable_if<std::numeric_limits<__T>::is_integer,
|
||||
double>::type
|
||||
ldexp(__T __x, int __exp) {
|
||||
return std::ldexp((double)__x, __exp);
|
||||
}
|
||||
|
||||
template <typename __T1, typename __T2>
|
||||
__DEVICE__ typename __clang_cuda_enable_if<
|
||||
std::numeric_limits<__T1>::is_specialized &&
|
||||
std::numeric_limits<__T2>::is_specialized,
|
||||
double>::type
|
||||
remquo(__T1 __x, __T2 __y, int *__quo) {
|
||||
return std::remquo((double)__x, (double)__y, __quo);
|
||||
}
|
||||
|
||||
template <typename __T>
|
||||
__DEVICE__ typename __clang_cuda_enable_if<std::numeric_limits<__T>::is_integer,
|
||||
double>::type
|
||||
scalbln(__T __x, long __exp) {
|
||||
return std::scalbln((double)__x, __exp);
|
||||
}
|
||||
|
||||
template <typename __T>
|
||||
__DEVICE__ typename __clang_cuda_enable_if<std::numeric_limits<__T>::is_integer,
|
||||
double>::type
|
||||
scalbn(__T __x, int __exp) {
|
||||
return std::scalbn((double)__x, __exp);
|
||||
}
|
||||
|
||||
// We need to define these overloads in exactly the namespace our standard
|
||||
// library uses (including the right inline namespace), otherwise they won't be
|
||||
// picked up by other functions in the standard library (e.g. functions in
|
||||
// <complex>). Thus the ugliness below.
|
||||
#ifdef _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
#else
|
||||
namespace std {
|
||||
#ifdef _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Pull the new overloads we defined above into namespace std.
|
||||
using ::acos;
|
||||
using ::acosh;
|
||||
using ::asin;
|
||||
using ::asinh;
|
||||
using ::atan;
|
||||
using ::atan2;
|
||||
using ::atanh;
|
||||
using ::cbrt;
|
||||
using ::ceil;
|
||||
using ::copysign;
|
||||
using ::cos;
|
||||
using ::cosh;
|
||||
using ::erf;
|
||||
using ::erfc;
|
||||
using ::exp;
|
||||
using ::exp2;
|
||||
using ::expm1;
|
||||
using ::fabs;
|
||||
using ::fdim;
|
||||
using ::floor;
|
||||
using ::fma;
|
||||
using ::fmax;
|
||||
using ::fmin;
|
||||
using ::fmod;
|
||||
using ::fpclassify;
|
||||
using ::frexp;
|
||||
using ::hypot;
|
||||
using ::ilogb;
|
||||
using ::isfinite;
|
||||
using ::isgreater;
|
||||
using ::isgreaterequal;
|
||||
using ::isless;
|
||||
using ::islessequal;
|
||||
using ::islessgreater;
|
||||
using ::isnormal;
|
||||
using ::isunordered;
|
||||
using ::ldexp;
|
||||
using ::lgamma;
|
||||
using ::llrint;
|
||||
using ::llround;
|
||||
using ::log;
|
||||
using ::log10;
|
||||
using ::log1p;
|
||||
using ::log2;
|
||||
using ::logb;
|
||||
using ::lrint;
|
||||
using ::lround;
|
||||
using ::nearbyint;
|
||||
using ::nextafter;
|
||||
using ::pow;
|
||||
using ::remainder;
|
||||
using ::remquo;
|
||||
using ::rint;
|
||||
using ::round;
|
||||
using ::scalbln;
|
||||
using ::scalbn;
|
||||
using ::signbit;
|
||||
using ::sin;
|
||||
using ::sinh;
|
||||
using ::sqrt;
|
||||
using ::tan;
|
||||
using ::tanh;
|
||||
using ::tgamma;
|
||||
using ::trunc;
|
||||
|
||||
// Well this is fun: We need to pull these symbols in for libc++, but we can't
|
||||
// pull them in with libstdc++, because its ::isinf and ::isnan are different
|
||||
// than its std::isinf and std::isnan.
|
||||
#ifndef __GLIBCXX__
|
||||
using ::isinf;
|
||||
using ::isnan;
|
||||
#endif
|
||||
|
||||
// Finally, pull the "foobarf" functions that CUDA defines in its headers into
|
||||
// namespace std.
|
||||
using ::acosf;
|
||||
using ::acoshf;
|
||||
using ::asinf;
|
||||
using ::asinhf;
|
||||
using ::atan2f;
|
||||
using ::atanf;
|
||||
using ::atanhf;
|
||||
using ::cbrtf;
|
||||
using ::ceilf;
|
||||
using ::copysignf;
|
||||
using ::cosf;
|
||||
using ::coshf;
|
||||
using ::erfcf;
|
||||
using ::erff;
|
||||
using ::exp2f;
|
||||
using ::expf;
|
||||
using ::expm1f;
|
||||
using ::fabsf;
|
||||
using ::fdimf;
|
||||
using ::floorf;
|
||||
using ::fmaf;
|
||||
using ::fmaxf;
|
||||
using ::fminf;
|
||||
using ::fmodf;
|
||||
using ::frexpf;
|
||||
using ::hypotf;
|
||||
using ::ilogbf;
|
||||
using ::ldexpf;
|
||||
using ::lgammaf;
|
||||
using ::llrintf;
|
||||
using ::llroundf;
|
||||
using ::log10f;
|
||||
using ::log1pf;
|
||||
using ::log2f;
|
||||
using ::logbf;
|
||||
using ::logf;
|
||||
using ::lrintf;
|
||||
using ::lroundf;
|
||||
using ::modff;
|
||||
using ::nearbyintf;
|
||||
using ::nextafterf;
|
||||
using ::powf;
|
||||
using ::remainderf;
|
||||
using ::remquof;
|
||||
using ::rintf;
|
||||
using ::roundf;
|
||||
using ::scalblnf;
|
||||
using ::scalbnf;
|
||||
using ::sinf;
|
||||
using ::sinhf;
|
||||
using ::sqrtf;
|
||||
using ::tanf;
|
||||
using ::tanhf;
|
||||
using ::tgammaf;
|
||||
using ::truncf;
|
||||
|
||||
#ifdef _LIBCPP_END_NAMESPACE_STD
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
#else
|
||||
#ifdef _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
_GLIBCXX_END_NAMESPACE_VERSION
|
||||
#endif
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#undef __DEVICE__
|
||||
|
||||
#endif
|
||||
@@ -1,203 +0,0 @@
|
||||
/*===-- __clang_cuda_complex_builtins - CUDA impls of runtime complex fns ---===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __CLANG_CUDA_COMPLEX_BUILTINS
|
||||
#define __CLANG_CUDA_COMPLEX_BUILTINS
|
||||
|
||||
// This header defines __muldc3, __mulsc3, __divdc3, and __divsc3. These are
|
||||
// libgcc functions that clang assumes are available when compiling c99 complex
|
||||
// operations. (These implementations come from libc++, and have been modified
|
||||
// to work with CUDA.)
|
||||
|
||||
extern "C" inline __device__ double _Complex __muldc3(double __a, double __b,
|
||||
double __c, double __d) {
|
||||
double __ac = __a * __c;
|
||||
double __bd = __b * __d;
|
||||
double __ad = __a * __d;
|
||||
double __bc = __b * __c;
|
||||
double _Complex z;
|
||||
__real__(z) = __ac - __bd;
|
||||
__imag__(z) = __ad + __bc;
|
||||
if (std::isnan(__real__(z)) && std::isnan(__imag__(z))) {
|
||||
int __recalc = 0;
|
||||
if (std::isinf(__a) || std::isinf(__b)) {
|
||||
__a = std::copysign(std::isinf(__a) ? 1 : 0, __a);
|
||||
__b = std::copysign(std::isinf(__b) ? 1 : 0, __b);
|
||||
if (std::isnan(__c))
|
||||
__c = std::copysign(0, __c);
|
||||
if (std::isnan(__d))
|
||||
__d = std::copysign(0, __d);
|
||||
__recalc = 1;
|
||||
}
|
||||
if (std::isinf(__c) || std::isinf(__d)) {
|
||||
__c = std::copysign(std::isinf(__c) ? 1 : 0, __c);
|
||||
__d = std::copysign(std::isinf(__d) ? 1 : 0, __d);
|
||||
if (std::isnan(__a))
|
||||
__a = std::copysign(0, __a);
|
||||
if (std::isnan(__b))
|
||||
__b = std::copysign(0, __b);
|
||||
__recalc = 1;
|
||||
}
|
||||
if (!__recalc && (std::isinf(__ac) || std::isinf(__bd) ||
|
||||
std::isinf(__ad) || std::isinf(__bc))) {
|
||||
if (std::isnan(__a))
|
||||
__a = std::copysign(0, __a);
|
||||
if (std::isnan(__b))
|
||||
__b = std::copysign(0, __b);
|
||||
if (std::isnan(__c))
|
||||
__c = std::copysign(0, __c);
|
||||
if (std::isnan(__d))
|
||||
__d = std::copysign(0, __d);
|
||||
__recalc = 1;
|
||||
}
|
||||
if (__recalc) {
|
||||
// Can't use std::numeric_limits<double>::infinity() -- that doesn't have
|
||||
// a device overload (and isn't constexpr before C++11, naturally).
|
||||
__real__(z) = __builtin_huge_valf() * (__a * __c - __b * __d);
|
||||
__imag__(z) = __builtin_huge_valf() * (__a * __d + __b * __c);
|
||||
}
|
||||
}
|
||||
return z;
|
||||
}
|
||||
|
||||
extern "C" inline __device__ float _Complex __mulsc3(float __a, float __b,
|
||||
float __c, float __d) {
|
||||
float __ac = __a * __c;
|
||||
float __bd = __b * __d;
|
||||
float __ad = __a * __d;
|
||||
float __bc = __b * __c;
|
||||
float _Complex z;
|
||||
__real__(z) = __ac - __bd;
|
||||
__imag__(z) = __ad + __bc;
|
||||
if (std::isnan(__real__(z)) && std::isnan(__imag__(z))) {
|
||||
int __recalc = 0;
|
||||
if (std::isinf(__a) || std::isinf(__b)) {
|
||||
__a = std::copysign(std::isinf(__a) ? 1 : 0, __a);
|
||||
__b = std::copysign(std::isinf(__b) ? 1 : 0, __b);
|
||||
if (std::isnan(__c))
|
||||
__c = std::copysign(0, __c);
|
||||
if (std::isnan(__d))
|
||||
__d = std::copysign(0, __d);
|
||||
__recalc = 1;
|
||||
}
|
||||
if (std::isinf(__c) || std::isinf(__d)) {
|
||||
__c = std::copysign(std::isinf(__c) ? 1 : 0, __c);
|
||||
__d = std::copysign(std::isinf(__d) ? 1 : 0, __d);
|
||||
if (std::isnan(__a))
|
||||
__a = std::copysign(0, __a);
|
||||
if (std::isnan(__b))
|
||||
__b = std::copysign(0, __b);
|
||||
__recalc = 1;
|
||||
}
|
||||
if (!__recalc && (std::isinf(__ac) || std::isinf(__bd) ||
|
||||
std::isinf(__ad) || std::isinf(__bc))) {
|
||||
if (std::isnan(__a))
|
||||
__a = std::copysign(0, __a);
|
||||
if (std::isnan(__b))
|
||||
__b = std::copysign(0, __b);
|
||||
if (std::isnan(__c))
|
||||
__c = std::copysign(0, __c);
|
||||
if (std::isnan(__d))
|
||||
__d = std::copysign(0, __d);
|
||||
__recalc = 1;
|
||||
}
|
||||
if (__recalc) {
|
||||
__real__(z) = __builtin_huge_valf() * (__a * __c - __b * __d);
|
||||
__imag__(z) = __builtin_huge_valf() * (__a * __d + __b * __c);
|
||||
}
|
||||
}
|
||||
return z;
|
||||
}
|
||||
|
||||
extern "C" inline __device__ double _Complex __divdc3(double __a, double __b,
|
||||
double __c, double __d) {
|
||||
int __ilogbw = 0;
|
||||
// Can't use std::max, because that's defined in <algorithm>, and we don't
|
||||
// want to pull that in for every compile. The CUDA headers define
|
||||
// ::max(float, float) and ::max(double, double), which is sufficient for us.
|
||||
double __logbw = std::logb(max(std::abs(__c), std::abs(__d)));
|
||||
if (std::isfinite(__logbw)) {
|
||||
__ilogbw = (int)__logbw;
|
||||
__c = std::scalbn(__c, -__ilogbw);
|
||||
__d = std::scalbn(__d, -__ilogbw);
|
||||
}
|
||||
double __denom = __c * __c + __d * __d;
|
||||
double _Complex z;
|
||||
__real__(z) = std::scalbn((__a * __c + __b * __d) / __denom, -__ilogbw);
|
||||
__imag__(z) = std::scalbn((__b * __c - __a * __d) / __denom, -__ilogbw);
|
||||
if (std::isnan(__real__(z)) && std::isnan(__imag__(z))) {
|
||||
if ((__denom == 0.0) && (!std::isnan(__a) || !std::isnan(__b))) {
|
||||
__real__(z) = std::copysign(__builtin_huge_valf(), __c) * __a;
|
||||
__imag__(z) = std::copysign(__builtin_huge_valf(), __c) * __b;
|
||||
} else if ((std::isinf(__a) || std::isinf(__b)) && std::isfinite(__c) &&
|
||||
std::isfinite(__d)) {
|
||||
__a = std::copysign(std::isinf(__a) ? 1.0 : 0.0, __a);
|
||||
__b = std::copysign(std::isinf(__b) ? 1.0 : 0.0, __b);
|
||||
__real__(z) = __builtin_huge_valf() * (__a * __c + __b * __d);
|
||||
__imag__(z) = __builtin_huge_valf() * (__b * __c - __a * __d);
|
||||
} else if (std::isinf(__logbw) && __logbw > 0.0 && std::isfinite(__a) &&
|
||||
std::isfinite(__b)) {
|
||||
__c = std::copysign(std::isinf(__c) ? 1.0 : 0.0, __c);
|
||||
__d = std::copysign(std::isinf(__d) ? 1.0 : 0.0, __d);
|
||||
__real__(z) = 0.0 * (__a * __c + __b * __d);
|
||||
__imag__(z) = 0.0 * (__b * __c - __a * __d);
|
||||
}
|
||||
}
|
||||
return z;
|
||||
}
|
||||
|
||||
extern "C" inline __device__ float _Complex __divsc3(float __a, float __b,
|
||||
float __c, float __d) {
|
||||
int __ilogbw = 0;
|
||||
float __logbw = std::logb(max(std::abs(__c), std::abs(__d)));
|
||||
if (std::isfinite(__logbw)) {
|
||||
__ilogbw = (int)__logbw;
|
||||
__c = std::scalbn(__c, -__ilogbw);
|
||||
__d = std::scalbn(__d, -__ilogbw);
|
||||
}
|
||||
float __denom = __c * __c + __d * __d;
|
||||
float _Complex z;
|
||||
__real__(z) = std::scalbn((__a * __c + __b * __d) / __denom, -__ilogbw);
|
||||
__imag__(z) = std::scalbn((__b * __c - __a * __d) / __denom, -__ilogbw);
|
||||
if (std::isnan(__real__(z)) && std::isnan(__imag__(z))) {
|
||||
if ((__denom == 0) && (!std::isnan(__a) || !std::isnan(__b))) {
|
||||
__real__(z) = std::copysign(__builtin_huge_valf(), __c) * __a;
|
||||
__imag__(z) = std::copysign(__builtin_huge_valf(), __c) * __b;
|
||||
} else if ((std::isinf(__a) || std::isinf(__b)) && std::isfinite(__c) &&
|
||||
std::isfinite(__d)) {
|
||||
__a = std::copysign(std::isinf(__a) ? 1 : 0, __a);
|
||||
__b = std::copysign(std::isinf(__b) ? 1 : 0, __b);
|
||||
__real__(z) = __builtin_huge_valf() * (__a * __c + __b * __d);
|
||||
__imag__(z) = __builtin_huge_valf() * (__b * __c - __a * __d);
|
||||
} else if (std::isinf(__logbw) && __logbw > 0 && std::isfinite(__a) &&
|
||||
std::isfinite(__b)) {
|
||||
__c = std::copysign(std::isinf(__c) ? 1 : 0, __c);
|
||||
__d = std::copysign(std::isinf(__d) ? 1 : 0, __d);
|
||||
__real__(z) = 0 * (__a * __c + __b * __d);
|
||||
__imag__(z) = 0 * (__b * __c - __a * __d);
|
||||
}
|
||||
}
|
||||
return z;
|
||||
}
|
||||
|
||||
#endif // __CLANG_CUDA_COMPLEX_BUILTINS
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,492 +0,0 @@
|
||||
/*===--- __clang_cuda_intrinsics.h - Device-side CUDA intrinsic wrappers ---===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __CLANG_CUDA_INTRINSICS_H__
|
||||
#define __CLANG_CUDA_INTRINSICS_H__
|
||||
#ifndef __CUDA__
|
||||
#error "This file is for CUDA compilation only."
|
||||
#endif
|
||||
|
||||
// sm_30 intrinsics: __shfl_{up,down,xor}.
|
||||
|
||||
#define __SM_30_INTRINSICS_H__
|
||||
#define __SM_30_INTRINSICS_HPP__
|
||||
|
||||
#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 300
|
||||
|
||||
#pragma push_macro("__MAKE_SHUFFLES")
|
||||
#define __MAKE_SHUFFLES(__FnName, __IntIntrinsic, __FloatIntrinsic, __Mask, \
|
||||
__Type) \
|
||||
inline __device__ int __FnName(int __val, __Type __offset, \
|
||||
int __width = warpSize) { \
|
||||
return __IntIntrinsic(__val, __offset, \
|
||||
((warpSize - __width) << 8) | (__Mask)); \
|
||||
} \
|
||||
inline __device__ float __FnName(float __val, __Type __offset, \
|
||||
int __width = warpSize) { \
|
||||
return __FloatIntrinsic(__val, __offset, \
|
||||
((warpSize - __width) << 8) | (__Mask)); \
|
||||
} \
|
||||
inline __device__ unsigned int __FnName(unsigned int __val, __Type __offset, \
|
||||
int __width = warpSize) { \
|
||||
return static_cast<unsigned int>( \
|
||||
::__FnName(static_cast<int>(__val), __offset, __width)); \
|
||||
} \
|
||||
inline __device__ long long __FnName(long long __val, __Type __offset, \
|
||||
int __width = warpSize) { \
|
||||
struct __Bits { \
|
||||
int __a, __b; \
|
||||
}; \
|
||||
_Static_assert(sizeof(__val) == sizeof(__Bits)); \
|
||||
_Static_assert(sizeof(__Bits) == 2 * sizeof(int)); \
|
||||
__Bits __tmp; \
|
||||
memcpy(&__val, &__tmp, sizeof(__val)); \
|
||||
__tmp.__a = ::__FnName(__tmp.__a, __offset, __width); \
|
||||
__tmp.__b = ::__FnName(__tmp.__b, __offset, __width); \
|
||||
long long __ret; \
|
||||
memcpy(&__ret, &__tmp, sizeof(__tmp)); \
|
||||
return __ret; \
|
||||
} \
|
||||
inline __device__ long __FnName(long __val, __Type __offset, \
|
||||
int __width = warpSize) { \
|
||||
_Static_assert(sizeof(long) == sizeof(long long) || \
|
||||
sizeof(long) == sizeof(int)); \
|
||||
if (sizeof(long) == sizeof(long long)) { \
|
||||
return static_cast<long>( \
|
||||
::__FnName(static_cast<long long>(__val), __offset, __width)); \
|
||||
} else if (sizeof(long) == sizeof(int)) { \
|
||||
return static_cast<long>( \
|
||||
::__FnName(static_cast<int>(__val), __offset, __width)); \
|
||||
} \
|
||||
} \
|
||||
inline __device__ unsigned long __FnName( \
|
||||
unsigned long __val, __Type __offset, int __width = warpSize) { \
|
||||
return static_cast<unsigned long>( \
|
||||
::__FnName(static_cast<long>(__val), __offset, __width)); \
|
||||
} \
|
||||
inline __device__ unsigned long long __FnName( \
|
||||
unsigned long long __val, __Type __offset, int __width = warpSize) { \
|
||||
return static_cast<unsigned long long>(::__FnName( \
|
||||
static_cast<unsigned long long>(__val), __offset, __width)); \
|
||||
} \
|
||||
inline __device__ double __FnName(double __val, __Type __offset, \
|
||||
int __width = warpSize) { \
|
||||
long long __tmp; \
|
||||
_Static_assert(sizeof(__tmp) == sizeof(__val)); \
|
||||
memcpy(&__tmp, &__val, sizeof(__val)); \
|
||||
__tmp = ::__FnName(__tmp, __offset, __width); \
|
||||
double __ret; \
|
||||
memcpy(&__ret, &__tmp, sizeof(__ret)); \
|
||||
return __ret; \
|
||||
}
|
||||
|
||||
__MAKE_SHUFFLES(__shfl, __nvvm_shfl_idx_i32, __nvvm_shfl_idx_f32, 0x1f, int);
|
||||
// We use 0 rather than 31 as our mask, because shfl.up applies to lanes >=
|
||||
// maxLane.
|
||||
__MAKE_SHUFFLES(__shfl_up, __nvvm_shfl_up_i32, __nvvm_shfl_up_f32, 0,
|
||||
unsigned int);
|
||||
__MAKE_SHUFFLES(__shfl_down, __nvvm_shfl_down_i32, __nvvm_shfl_down_f32, 0x1f,
|
||||
unsigned int);
|
||||
__MAKE_SHUFFLES(__shfl_xor, __nvvm_shfl_bfly_i32, __nvvm_shfl_bfly_f32, 0x1f,
|
||||
int);
|
||||
#pragma pop_macro("__MAKE_SHUFFLES")
|
||||
|
||||
#endif // !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 300
|
||||
|
||||
#if CUDA_VERSION >= 9000
|
||||
#if (!defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 300)
|
||||
// __shfl_sync_* variants available in CUDA-9
|
||||
#pragma push_macro("__MAKE_SYNC_SHUFFLES")
|
||||
#define __MAKE_SYNC_SHUFFLES(__FnName, __IntIntrinsic, __FloatIntrinsic, \
|
||||
__Mask, __Type) \
|
||||
inline __device__ int __FnName(unsigned int __mask, int __val, \
|
||||
__Type __offset, int __width = warpSize) { \
|
||||
return __IntIntrinsic(__mask, __val, __offset, \
|
||||
((warpSize - __width) << 8) | (__Mask)); \
|
||||
} \
|
||||
inline __device__ float __FnName(unsigned int __mask, float __val, \
|
||||
__Type __offset, int __width = warpSize) { \
|
||||
return __FloatIntrinsic(__mask, __val, __offset, \
|
||||
((warpSize - __width) << 8) | (__Mask)); \
|
||||
} \
|
||||
inline __device__ unsigned int __FnName(unsigned int __mask, \
|
||||
unsigned int __val, __Type __offset, \
|
||||
int __width = warpSize) { \
|
||||
return static_cast<unsigned int>( \
|
||||
::__FnName(__mask, static_cast<int>(__val), __offset, __width)); \
|
||||
} \
|
||||
inline __device__ long long __FnName(unsigned int __mask, long long __val, \
|
||||
__Type __offset, \
|
||||
int __width = warpSize) { \
|
||||
struct __Bits { \
|
||||
int __a, __b; \
|
||||
}; \
|
||||
_Static_assert(sizeof(__val) == sizeof(__Bits)); \
|
||||
_Static_assert(sizeof(__Bits) == 2 * sizeof(int)); \
|
||||
__Bits __tmp; \
|
||||
memcpy(&__val, &__tmp, sizeof(__val)); \
|
||||
__tmp.__a = ::__FnName(__mask, __tmp.__a, __offset, __width); \
|
||||
__tmp.__b = ::__FnName(__mask, __tmp.__b, __offset, __width); \
|
||||
long long __ret; \
|
||||
memcpy(&__ret, &__tmp, sizeof(__tmp)); \
|
||||
return __ret; \
|
||||
} \
|
||||
inline __device__ unsigned long long __FnName( \
|
||||
unsigned int __mask, unsigned long long __val, __Type __offset, \
|
||||
int __width = warpSize) { \
|
||||
return static_cast<unsigned long long>(::__FnName( \
|
||||
__mask, static_cast<unsigned long long>(__val), __offset, __width)); \
|
||||
} \
|
||||
inline __device__ long __FnName(unsigned int __mask, long __val, \
|
||||
__Type __offset, int __width = warpSize) { \
|
||||
_Static_assert(sizeof(long) == sizeof(long long) || \
|
||||
sizeof(long) == sizeof(int)); \
|
||||
if (sizeof(long) == sizeof(long long)) { \
|
||||
return static_cast<long>(::__FnName( \
|
||||
__mask, static_cast<long long>(__val), __offset, __width)); \
|
||||
} else if (sizeof(long) == sizeof(int)) { \
|
||||
return static_cast<long>( \
|
||||
::__FnName(__mask, static_cast<int>(__val), __offset, __width)); \
|
||||
} \
|
||||
} \
|
||||
inline __device__ unsigned long __FnName( \
|
||||
unsigned int __mask, unsigned long __val, __Type __offset, \
|
||||
int __width = warpSize) { \
|
||||
return static_cast<unsigned long>( \
|
||||
::__FnName(__mask, static_cast<long>(__val), __offset, __width)); \
|
||||
} \
|
||||
inline __device__ double __FnName(unsigned int __mask, double __val, \
|
||||
__Type __offset, int __width = warpSize) { \
|
||||
long long __tmp; \
|
||||
_Static_assert(sizeof(__tmp) == sizeof(__val)); \
|
||||
memcpy(&__tmp, &__val, sizeof(__val)); \
|
||||
__tmp = ::__FnName(__mask, __tmp, __offset, __width); \
|
||||
double __ret; \
|
||||
memcpy(&__ret, &__tmp, sizeof(__ret)); \
|
||||
return __ret; \
|
||||
}
|
||||
__MAKE_SYNC_SHUFFLES(__shfl_sync, __nvvm_shfl_sync_idx_i32,
|
||||
__nvvm_shfl_sync_idx_f32, 0x1f, int);
|
||||
// We use 0 rather than 31 as our mask, because shfl.up applies to lanes >=
|
||||
// maxLane.
|
||||
__MAKE_SYNC_SHUFFLES(__shfl_up_sync, __nvvm_shfl_sync_up_i32,
|
||||
__nvvm_shfl_sync_up_f32, 0, unsigned int);
|
||||
__MAKE_SYNC_SHUFFLES(__shfl_down_sync, __nvvm_shfl_sync_down_i32,
|
||||
__nvvm_shfl_sync_down_f32, 0x1f, unsigned int);
|
||||
__MAKE_SYNC_SHUFFLES(__shfl_xor_sync, __nvvm_shfl_sync_bfly_i32,
|
||||
__nvvm_shfl_sync_bfly_f32, 0x1f, int);
|
||||
#pragma pop_macro("__MAKE_SYNC_SHUFFLES")
|
||||
|
||||
inline __device__ void __syncwarp(unsigned int mask = 0xffffffff) {
|
||||
return __nvvm_bar_warp_sync(mask);
|
||||
}
|
||||
|
||||
inline __device__ void __barrier_sync(unsigned int id) {
|
||||
__nvvm_barrier_sync(id);
|
||||
}
|
||||
|
||||
inline __device__ void __barrier_sync_count(unsigned int id,
|
||||
unsigned int count) {
|
||||
__nvvm_barrier_sync_cnt(id, count);
|
||||
}
|
||||
|
||||
inline __device__ int __all_sync(unsigned int mask, int pred) {
|
||||
return __nvvm_vote_all_sync(mask, pred);
|
||||
}
|
||||
|
||||
inline __device__ int __any_sync(unsigned int mask, int pred) {
|
||||
return __nvvm_vote_any_sync(mask, pred);
|
||||
}
|
||||
|
||||
inline __device__ int __uni_sync(unsigned int mask, int pred) {
|
||||
return __nvvm_vote_uni_sync(mask, pred);
|
||||
}
|
||||
|
||||
inline __device__ unsigned int __ballot_sync(unsigned int mask, int pred) {
|
||||
return __nvvm_vote_ballot_sync(mask, pred);
|
||||
}
|
||||
|
||||
inline __device__ unsigned int __activemask() { return __nvvm_vote_ballot(1); }
|
||||
|
||||
inline __device__ unsigned int __fns(unsigned mask, unsigned base, int offset) {
|
||||
return __nvvm_fns(mask, base, offset);
|
||||
}
|
||||
|
||||
#endif // !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 300
|
||||
|
||||
// Define __match* builtins CUDA-9 headers expect to see.
|
||||
#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 700
|
||||
inline __device__ unsigned int __match32_any_sync(unsigned int mask,
|
||||
unsigned int value) {
|
||||
return __nvvm_match_any_sync_i32(mask, value);
|
||||
}
|
||||
|
||||
inline __device__ unsigned long long
|
||||
__match64_any_sync(unsigned int mask, unsigned long long value) {
|
||||
return __nvvm_match_any_sync_i64(mask, value);
|
||||
}
|
||||
|
||||
inline __device__ unsigned int
|
||||
__match32_all_sync(unsigned int mask, unsigned int value, int *pred) {
|
||||
return __nvvm_match_all_sync_i32p(mask, value, pred);
|
||||
}
|
||||
|
||||
inline __device__ unsigned long long
|
||||
__match64_all_sync(unsigned int mask, unsigned long long value, int *pred) {
|
||||
return __nvvm_match_all_sync_i64p(mask, value, pred);
|
||||
}
|
||||
#include "crt/sm_70_rt.hpp"
|
||||
|
||||
#endif // !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 700
|
||||
#endif // __CUDA_VERSION >= 9000
|
||||
|
||||
// sm_32 intrinsics: __ldg and __funnelshift_{l,lc,r,rc}.
|
||||
|
||||
// Prevent the vanilla sm_32 intrinsics header from being included.
|
||||
#define __SM_32_INTRINSICS_H__
|
||||
#define __SM_32_INTRINSICS_HPP__
|
||||
|
||||
#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 320
|
||||
|
||||
inline __device__ char __ldg(const char *ptr) { return __nvvm_ldg_c(ptr); }
|
||||
inline __device__ short __ldg(const short *ptr) { return __nvvm_ldg_s(ptr); }
|
||||
inline __device__ int __ldg(const int *ptr) { return __nvvm_ldg_i(ptr); }
|
||||
inline __device__ long __ldg(const long *ptr) { return __nvvm_ldg_l(ptr); }
|
||||
inline __device__ long long __ldg(const long long *ptr) {
|
||||
return __nvvm_ldg_ll(ptr);
|
||||
}
|
||||
inline __device__ unsigned char __ldg(const unsigned char *ptr) {
|
||||
return __nvvm_ldg_uc(ptr);
|
||||
}
|
||||
inline __device__ signed char __ldg(const signed char *ptr) {
|
||||
return __nvvm_ldg_uc((const unsigned char *)ptr);
|
||||
}
|
||||
inline __device__ unsigned short __ldg(const unsigned short *ptr) {
|
||||
return __nvvm_ldg_us(ptr);
|
||||
}
|
||||
inline __device__ unsigned int __ldg(const unsigned int *ptr) {
|
||||
return __nvvm_ldg_ui(ptr);
|
||||
}
|
||||
inline __device__ unsigned long __ldg(const unsigned long *ptr) {
|
||||
return __nvvm_ldg_ul(ptr);
|
||||
}
|
||||
inline __device__ unsigned long long __ldg(const unsigned long long *ptr) {
|
||||
return __nvvm_ldg_ull(ptr);
|
||||
}
|
||||
inline __device__ float __ldg(const float *ptr) { return __nvvm_ldg_f(ptr); }
|
||||
inline __device__ double __ldg(const double *ptr) { return __nvvm_ldg_d(ptr); }
|
||||
|
||||
inline __device__ char2 __ldg(const char2 *ptr) {
|
||||
typedef char c2 __attribute__((ext_vector_type(2)));
|
||||
// We can assume that ptr is aligned at least to char2's alignment, but the
|
||||
// load will assume that ptr is aligned to char2's alignment. This is only
|
||||
// safe if alignof(c2) <= alignof(char2).
|
||||
c2 rv = __nvvm_ldg_c2(reinterpret_cast<const c2 *>(ptr));
|
||||
char2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ char4 __ldg(const char4 *ptr) {
|
||||
typedef char c4 __attribute__((ext_vector_type(4)));
|
||||
c4 rv = __nvvm_ldg_c4(reinterpret_cast<const c4 *>(ptr));
|
||||
char4 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
ret.z = rv[2];
|
||||
ret.w = rv[3];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ short2 __ldg(const short2 *ptr) {
|
||||
typedef short s2 __attribute__((ext_vector_type(2)));
|
||||
s2 rv = __nvvm_ldg_s2(reinterpret_cast<const s2 *>(ptr));
|
||||
short2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ short4 __ldg(const short4 *ptr) {
|
||||
typedef short s4 __attribute__((ext_vector_type(4)));
|
||||
s4 rv = __nvvm_ldg_s4(reinterpret_cast<const s4 *>(ptr));
|
||||
short4 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
ret.z = rv[2];
|
||||
ret.w = rv[3];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ int2 __ldg(const int2 *ptr) {
|
||||
typedef int i2 __attribute__((ext_vector_type(2)));
|
||||
i2 rv = __nvvm_ldg_i2(reinterpret_cast<const i2 *>(ptr));
|
||||
int2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ int4 __ldg(const int4 *ptr) {
|
||||
typedef int i4 __attribute__((ext_vector_type(4)));
|
||||
i4 rv = __nvvm_ldg_i4(reinterpret_cast<const i4 *>(ptr));
|
||||
int4 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
ret.z = rv[2];
|
||||
ret.w = rv[3];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ longlong2 __ldg(const longlong2 *ptr) {
|
||||
typedef long long ll2 __attribute__((ext_vector_type(2)));
|
||||
ll2 rv = __nvvm_ldg_ll2(reinterpret_cast<const ll2 *>(ptr));
|
||||
longlong2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline __device__ uchar2 __ldg(const uchar2 *ptr) {
|
||||
typedef unsigned char uc2 __attribute__((ext_vector_type(2)));
|
||||
uc2 rv = __nvvm_ldg_uc2(reinterpret_cast<const uc2 *>(ptr));
|
||||
uchar2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ uchar4 __ldg(const uchar4 *ptr) {
|
||||
typedef unsigned char uc4 __attribute__((ext_vector_type(4)));
|
||||
uc4 rv = __nvvm_ldg_uc4(reinterpret_cast<const uc4 *>(ptr));
|
||||
uchar4 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
ret.z = rv[2];
|
||||
ret.w = rv[3];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ ushort2 __ldg(const ushort2 *ptr) {
|
||||
typedef unsigned short us2 __attribute__((ext_vector_type(2)));
|
||||
us2 rv = __nvvm_ldg_us2(reinterpret_cast<const us2 *>(ptr));
|
||||
ushort2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ ushort4 __ldg(const ushort4 *ptr) {
|
||||
typedef unsigned short us4 __attribute__((ext_vector_type(4)));
|
||||
us4 rv = __nvvm_ldg_us4(reinterpret_cast<const us4 *>(ptr));
|
||||
ushort4 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
ret.z = rv[2];
|
||||
ret.w = rv[3];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ uint2 __ldg(const uint2 *ptr) {
|
||||
typedef unsigned int ui2 __attribute__((ext_vector_type(2)));
|
||||
ui2 rv = __nvvm_ldg_ui2(reinterpret_cast<const ui2 *>(ptr));
|
||||
uint2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ uint4 __ldg(const uint4 *ptr) {
|
||||
typedef unsigned int ui4 __attribute__((ext_vector_type(4)));
|
||||
ui4 rv = __nvvm_ldg_ui4(reinterpret_cast<const ui4 *>(ptr));
|
||||
uint4 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
ret.z = rv[2];
|
||||
ret.w = rv[3];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ ulonglong2 __ldg(const ulonglong2 *ptr) {
|
||||
typedef unsigned long long ull2 __attribute__((ext_vector_type(2)));
|
||||
ull2 rv = __nvvm_ldg_ull2(reinterpret_cast<const ull2 *>(ptr));
|
||||
ulonglong2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline __device__ float2 __ldg(const float2 *ptr) {
|
||||
typedef float f2 __attribute__((ext_vector_type(2)));
|
||||
f2 rv = __nvvm_ldg_f2(reinterpret_cast<const f2 *>(ptr));
|
||||
float2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ float4 __ldg(const float4 *ptr) {
|
||||
typedef float f4 __attribute__((ext_vector_type(4)));
|
||||
f4 rv = __nvvm_ldg_f4(reinterpret_cast<const f4 *>(ptr));
|
||||
float4 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
ret.z = rv[2];
|
||||
ret.w = rv[3];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ double2 __ldg(const double2 *ptr) {
|
||||
typedef double d2 __attribute__((ext_vector_type(2)));
|
||||
d2 rv = __nvvm_ldg_d2(reinterpret_cast<const d2 *>(ptr));
|
||||
double2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
|
||||
// TODO: Implement these as intrinsics, so the backend can work its magic on
|
||||
// these. Alternatively, we could implement these as plain C and try to get
|
||||
// llvm to recognize the relevant patterns.
|
||||
inline __device__ unsigned __funnelshift_l(unsigned low32, unsigned high32,
|
||||
unsigned shiftWidth) {
|
||||
unsigned result;
|
||||
asm("shf.l.wrap.b32 %0, %1, %2, %3;"
|
||||
: "=r"(result)
|
||||
: "r"(low32), "r"(high32), "r"(shiftWidth));
|
||||
return result;
|
||||
}
|
||||
inline __device__ unsigned __funnelshift_lc(unsigned low32, unsigned high32,
|
||||
unsigned shiftWidth) {
|
||||
unsigned result;
|
||||
asm("shf.l.clamp.b32 %0, %1, %2, %3;"
|
||||
: "=r"(result)
|
||||
: "r"(low32), "r"(high32), "r"(shiftWidth));
|
||||
return result;
|
||||
}
|
||||
inline __device__ unsigned __funnelshift_r(unsigned low32, unsigned high32,
|
||||
unsigned shiftWidth) {
|
||||
unsigned result;
|
||||
asm("shf.r.wrap.b32 %0, %1, %2, %3;"
|
||||
: "=r"(result)
|
||||
: "r"(low32), "r"(high32), "r"(shiftWidth));
|
||||
return result;
|
||||
}
|
||||
inline __device__ unsigned __funnelshift_rc(unsigned low32, unsigned high32,
|
||||
unsigned shiftWidth) {
|
||||
unsigned ret;
|
||||
asm("shf.r.clamp.b32 %0, %1, %2, %3;"
|
||||
: "=r"(ret)
|
||||
: "r"(low32), "r"(high32), "r"(shiftWidth));
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif // !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 320
|
||||
|
||||
#endif // defined(__CLANG_CUDA_INTRINSICS_H__)
|
||||
@@ -1,466 +0,0 @@
|
||||
/*===-- __clang_cuda_libdevice_declares.h - decls for libdevice functions --===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __CLANG_CUDA_LIBDEVICE_DECLARES_H__
|
||||
#define __CLANG_CUDA_LIBDEVICE_DECLARES_H__
|
||||
|
||||
extern "C" {
|
||||
|
||||
__device__ int __nv_abs(int __a);
|
||||
__device__ double __nv_acos(double __a);
|
||||
__device__ float __nv_acosf(float __a);
|
||||
__device__ double __nv_acosh(double __a);
|
||||
__device__ float __nv_acoshf(float __a);
|
||||
__device__ double __nv_asin(double __a);
|
||||
__device__ float __nv_asinf(float __a);
|
||||
__device__ double __nv_asinh(double __a);
|
||||
__device__ float __nv_asinhf(float __a);
|
||||
__device__ double __nv_atan2(double __a, double __b);
|
||||
__device__ float __nv_atan2f(float __a, float __b);
|
||||
__device__ double __nv_atan(double __a);
|
||||
__device__ float __nv_atanf(float __a);
|
||||
__device__ double __nv_atanh(double __a);
|
||||
__device__ float __nv_atanhf(float __a);
|
||||
__device__ int __nv_brev(int __a);
|
||||
__device__ long long __nv_brevll(long long __a);
|
||||
__device__ int __nv_byte_perm(int __a, int __b, int __c);
|
||||
__device__ double __nv_cbrt(double __a);
|
||||
__device__ float __nv_cbrtf(float __a);
|
||||
__device__ double __nv_ceil(double __a);
|
||||
__device__ float __nv_ceilf(float __a);
|
||||
__device__ int __nv_clz(int __a);
|
||||
__device__ int __nv_clzll(long long __a);
|
||||
__device__ double __nv_copysign(double __a, double __b);
|
||||
__device__ float __nv_copysignf(float __a, float __b);
|
||||
__device__ double __nv_cos(double __a);
|
||||
__device__ float __nv_cosf(float __a);
|
||||
__device__ double __nv_cosh(double __a);
|
||||
__device__ float __nv_coshf(float __a);
|
||||
__device__ double __nv_cospi(double __a);
|
||||
__device__ float __nv_cospif(float __a);
|
||||
__device__ double __nv_cyl_bessel_i0(double __a);
|
||||
__device__ float __nv_cyl_bessel_i0f(float __a);
|
||||
__device__ double __nv_cyl_bessel_i1(double __a);
|
||||
__device__ float __nv_cyl_bessel_i1f(float __a);
|
||||
__device__ double __nv_dadd_rd(double __a, double __b);
|
||||
__device__ double __nv_dadd_rn(double __a, double __b);
|
||||
__device__ double __nv_dadd_ru(double __a, double __b);
|
||||
__device__ double __nv_dadd_rz(double __a, double __b);
|
||||
__device__ double __nv_ddiv_rd(double __a, double __b);
|
||||
__device__ double __nv_ddiv_rn(double __a, double __b);
|
||||
__device__ double __nv_ddiv_ru(double __a, double __b);
|
||||
__device__ double __nv_ddiv_rz(double __a, double __b);
|
||||
__device__ double __nv_dmul_rd(double __a, double __b);
|
||||
__device__ double __nv_dmul_rn(double __a, double __b);
|
||||
__device__ double __nv_dmul_ru(double __a, double __b);
|
||||
__device__ double __nv_dmul_rz(double __a, double __b);
|
||||
__device__ float __nv_double2float_rd(double __a);
|
||||
__device__ float __nv_double2float_rn(double __a);
|
||||
__device__ float __nv_double2float_ru(double __a);
|
||||
__device__ float __nv_double2float_rz(double __a);
|
||||
__device__ int __nv_double2hiint(double __a);
|
||||
__device__ int __nv_double2int_rd(double __a);
|
||||
__device__ int __nv_double2int_rn(double __a);
|
||||
__device__ int __nv_double2int_ru(double __a);
|
||||
__device__ int __nv_double2int_rz(double __a);
|
||||
__device__ long long __nv_double2ll_rd(double __a);
|
||||
__device__ long long __nv_double2ll_rn(double __a);
|
||||
__device__ long long __nv_double2ll_ru(double __a);
|
||||
__device__ long long __nv_double2ll_rz(double __a);
|
||||
__device__ int __nv_double2loint(double __a);
|
||||
__device__ unsigned int __nv_double2uint_rd(double __a);
|
||||
__device__ unsigned int __nv_double2uint_rn(double __a);
|
||||
__device__ unsigned int __nv_double2uint_ru(double __a);
|
||||
__device__ unsigned int __nv_double2uint_rz(double __a);
|
||||
__device__ unsigned long long __nv_double2ull_rd(double __a);
|
||||
__device__ unsigned long long __nv_double2ull_rn(double __a);
|
||||
__device__ unsigned long long __nv_double2ull_ru(double __a);
|
||||
__device__ unsigned long long __nv_double2ull_rz(double __a);
|
||||
__device__ unsigned long long __nv_double_as_longlong(double __a);
|
||||
__device__ double __nv_drcp_rd(double __a);
|
||||
__device__ double __nv_drcp_rn(double __a);
|
||||
__device__ double __nv_drcp_ru(double __a);
|
||||
__device__ double __nv_drcp_rz(double __a);
|
||||
__device__ double __nv_dsqrt_rd(double __a);
|
||||
__device__ double __nv_dsqrt_rn(double __a);
|
||||
__device__ double __nv_dsqrt_ru(double __a);
|
||||
__device__ double __nv_dsqrt_rz(double __a);
|
||||
__device__ double __nv_dsub_rd(double __a, double __b);
|
||||
__device__ double __nv_dsub_rn(double __a, double __b);
|
||||
__device__ double __nv_dsub_ru(double __a, double __b);
|
||||
__device__ double __nv_dsub_rz(double __a, double __b);
|
||||
__device__ double __nv_erfc(double __a);
|
||||
__device__ float __nv_erfcf(float __a);
|
||||
__device__ double __nv_erfcinv(double __a);
|
||||
__device__ float __nv_erfcinvf(float __a);
|
||||
__device__ double __nv_erfcx(double __a);
|
||||
__device__ float __nv_erfcxf(float __a);
|
||||
__device__ double __nv_erf(double __a);
|
||||
__device__ float __nv_erff(float __a);
|
||||
__device__ double __nv_erfinv(double __a);
|
||||
__device__ float __nv_erfinvf(float __a);
|
||||
__device__ double __nv_exp10(double __a);
|
||||
__device__ float __nv_exp10f(float __a);
|
||||
__device__ double __nv_exp2(double __a);
|
||||
__device__ float __nv_exp2f(float __a);
|
||||
__device__ double __nv_exp(double __a);
|
||||
__device__ float __nv_expf(float __a);
|
||||
__device__ double __nv_expm1(double __a);
|
||||
__device__ float __nv_expm1f(float __a);
|
||||
__device__ double __nv_fabs(double __a);
|
||||
__device__ float __nv_fabsf(float __a);
|
||||
__device__ float __nv_fadd_rd(float __a, float __b);
|
||||
__device__ float __nv_fadd_rn(float __a, float __b);
|
||||
__device__ float __nv_fadd_ru(float __a, float __b);
|
||||
__device__ float __nv_fadd_rz(float __a, float __b);
|
||||
__device__ float __nv_fast_cosf(float __a);
|
||||
__device__ float __nv_fast_exp10f(float __a);
|
||||
__device__ float __nv_fast_expf(float __a);
|
||||
__device__ float __nv_fast_fdividef(float __a, float __b);
|
||||
__device__ float __nv_fast_log10f(float __a);
|
||||
__device__ float __nv_fast_log2f(float __a);
|
||||
__device__ float __nv_fast_logf(float __a);
|
||||
__device__ float __nv_fast_powf(float __a, float __b);
|
||||
__device__ void __nv_fast_sincosf(float __a, float *__sptr, float *__cptr);
|
||||
__device__ float __nv_fast_sinf(float __a);
|
||||
__device__ float __nv_fast_tanf(float __a);
|
||||
__device__ double __nv_fdim(double __a, double __b);
|
||||
__device__ float __nv_fdimf(float __a, float __b);
|
||||
__device__ float __nv_fdiv_rd(float __a, float __b);
|
||||
__device__ float __nv_fdiv_rn(float __a, float __b);
|
||||
__device__ float __nv_fdiv_ru(float __a, float __b);
|
||||
__device__ float __nv_fdiv_rz(float __a, float __b);
|
||||
__device__ int __nv_ffs(int __a);
|
||||
__device__ int __nv_ffsll(long long __a);
|
||||
__device__ int __nv_finitef(float __a);
|
||||
__device__ unsigned short __nv_float2half_rn(float __a);
|
||||
__device__ int __nv_float2int_rd(float __a);
|
||||
__device__ int __nv_float2int_rn(float __a);
|
||||
__device__ int __nv_float2int_ru(float __a);
|
||||
__device__ int __nv_float2int_rz(float __a);
|
||||
__device__ long long __nv_float2ll_rd(float __a);
|
||||
__device__ long long __nv_float2ll_rn(float __a);
|
||||
__device__ long long __nv_float2ll_ru(float __a);
|
||||
__device__ long long __nv_float2ll_rz(float __a);
|
||||
__device__ unsigned int __nv_float2uint_rd(float __a);
|
||||
__device__ unsigned int __nv_float2uint_rn(float __a);
|
||||
__device__ unsigned int __nv_float2uint_ru(float __a);
|
||||
__device__ unsigned int __nv_float2uint_rz(float __a);
|
||||
__device__ unsigned long long __nv_float2ull_rd(float __a);
|
||||
__device__ unsigned long long __nv_float2ull_rn(float __a);
|
||||
__device__ unsigned long long __nv_float2ull_ru(float __a);
|
||||
__device__ unsigned long long __nv_float2ull_rz(float __a);
|
||||
__device__ int __nv_float_as_int(float __a);
|
||||
__device__ unsigned int __nv_float_as_uint(float __a);
|
||||
__device__ double __nv_floor(double __a);
|
||||
__device__ float __nv_floorf(float __a);
|
||||
__device__ double __nv_fma(double __a, double __b, double __c);
|
||||
__device__ float __nv_fmaf(float __a, float __b, float __c);
|
||||
__device__ float __nv_fmaf_ieee_rd(float __a, float __b, float __c);
|
||||
__device__ float __nv_fmaf_ieee_rn(float __a, float __b, float __c);
|
||||
__device__ float __nv_fmaf_ieee_ru(float __a, float __b, float __c);
|
||||
__device__ float __nv_fmaf_ieee_rz(float __a, float __b, float __c);
|
||||
__device__ float __nv_fmaf_rd(float __a, float __b, float __c);
|
||||
__device__ float __nv_fmaf_rn(float __a, float __b, float __c);
|
||||
__device__ float __nv_fmaf_ru(float __a, float __b, float __c);
|
||||
__device__ float __nv_fmaf_rz(float __a, float __b, float __c);
|
||||
__device__ double __nv_fma_rd(double __a, double __b, double __c);
|
||||
__device__ double __nv_fma_rn(double __a, double __b, double __c);
|
||||
__device__ double __nv_fma_ru(double __a, double __b, double __c);
|
||||
__device__ double __nv_fma_rz(double __a, double __b, double __c);
|
||||
__device__ double __nv_fmax(double __a, double __b);
|
||||
__device__ float __nv_fmaxf(float __a, float __b);
|
||||
__device__ double __nv_fmin(double __a, double __b);
|
||||
__device__ float __nv_fminf(float __a, float __b);
|
||||
__device__ double __nv_fmod(double __a, double __b);
|
||||
__device__ float __nv_fmodf(float __a, float __b);
|
||||
__device__ float __nv_fmul_rd(float __a, float __b);
|
||||
__device__ float __nv_fmul_rn(float __a, float __b);
|
||||
__device__ float __nv_fmul_ru(float __a, float __b);
|
||||
__device__ float __nv_fmul_rz(float __a, float __b);
|
||||
__device__ float __nv_frcp_rd(float __a);
|
||||
__device__ float __nv_frcp_rn(float __a);
|
||||
__device__ float __nv_frcp_ru(float __a);
|
||||
__device__ float __nv_frcp_rz(float __a);
|
||||
__device__ double __nv_frexp(double __a, int *__b);
|
||||
__device__ float __nv_frexpf(float __a, int *__b);
|
||||
__device__ float __nv_frsqrt_rn(float __a);
|
||||
__device__ float __nv_fsqrt_rd(float __a);
|
||||
__device__ float __nv_fsqrt_rn(float __a);
|
||||
__device__ float __nv_fsqrt_ru(float __a);
|
||||
__device__ float __nv_fsqrt_rz(float __a);
|
||||
__device__ float __nv_fsub_rd(float __a, float __b);
|
||||
__device__ float __nv_fsub_rn(float __a, float __b);
|
||||
__device__ float __nv_fsub_ru(float __a, float __b);
|
||||
__device__ float __nv_fsub_rz(float __a, float __b);
|
||||
__device__ int __nv_hadd(int __a, int __b);
|
||||
__device__ float __nv_half2float(unsigned short __h);
|
||||
__device__ double __nv_hiloint2double(int __a, int __b);
|
||||
__device__ double __nv_hypot(double __a, double __b);
|
||||
__device__ float __nv_hypotf(float __a, float __b);
|
||||
__device__ int __nv_ilogb(double __a);
|
||||
__device__ int __nv_ilogbf(float __a);
|
||||
__device__ double __nv_int2double_rn(int __a);
|
||||
__device__ float __nv_int2float_rd(int __a);
|
||||
__device__ float __nv_int2float_rn(int __a);
|
||||
__device__ float __nv_int2float_ru(int __a);
|
||||
__device__ float __nv_int2float_rz(int __a);
|
||||
__device__ float __nv_int_as_float(int __a);
|
||||
__device__ int __nv_isfinited(double __a);
|
||||
__device__ int __nv_isinfd(double __a);
|
||||
__device__ int __nv_isinff(float __a);
|
||||
__device__ int __nv_isnand(double __a);
|
||||
__device__ int __nv_isnanf(float __a);
|
||||
__device__ double __nv_j0(double __a);
|
||||
__device__ float __nv_j0f(float __a);
|
||||
__device__ double __nv_j1(double __a);
|
||||
__device__ float __nv_j1f(float __a);
|
||||
__device__ float __nv_jnf(int __a, float __b);
|
||||
__device__ double __nv_jn(int __a, double __b);
|
||||
__device__ double __nv_ldexp(double __a, int __b);
|
||||
__device__ float __nv_ldexpf(float __a, int __b);
|
||||
__device__ double __nv_lgamma(double __a);
|
||||
__device__ float __nv_lgammaf(float __a);
|
||||
__device__ double __nv_ll2double_rd(long long __a);
|
||||
__device__ double __nv_ll2double_rn(long long __a);
|
||||
__device__ double __nv_ll2double_ru(long long __a);
|
||||
__device__ double __nv_ll2double_rz(long long __a);
|
||||
__device__ float __nv_ll2float_rd(long long __a);
|
||||
__device__ float __nv_ll2float_rn(long long __a);
|
||||
__device__ float __nv_ll2float_ru(long long __a);
|
||||
__device__ float __nv_ll2float_rz(long long __a);
|
||||
__device__ long long __nv_llabs(long long __a);
|
||||
__device__ long long __nv_llmax(long long __a, long long __b);
|
||||
__device__ long long __nv_llmin(long long __a, long long __b);
|
||||
__device__ long long __nv_llrint(double __a);
|
||||
__device__ long long __nv_llrintf(float __a);
|
||||
__device__ long long __nv_llround(double __a);
|
||||
__device__ long long __nv_llroundf(float __a);
|
||||
__device__ double __nv_log10(double __a);
|
||||
__device__ float __nv_log10f(float __a);
|
||||
__device__ double __nv_log1p(double __a);
|
||||
__device__ float __nv_log1pf(float __a);
|
||||
__device__ double __nv_log2(double __a);
|
||||
__device__ float __nv_log2f(float __a);
|
||||
__device__ double __nv_logb(double __a);
|
||||
__device__ float __nv_logbf(float __a);
|
||||
__device__ double __nv_log(double __a);
|
||||
__device__ float __nv_logf(float __a);
|
||||
__device__ double __nv_longlong_as_double(long long __a);
|
||||
__device__ int __nv_max(int __a, int __b);
|
||||
__device__ int __nv_min(int __a, int __b);
|
||||
__device__ double __nv_modf(double __a, double *__b);
|
||||
__device__ float __nv_modff(float __a, float *__b);
|
||||
__device__ int __nv_mul24(int __a, int __b);
|
||||
__device__ long long __nv_mul64hi(long long __a, long long __b);
|
||||
__device__ int __nv_mulhi(int __a, int __b);
|
||||
__device__ double __nv_nan(const signed char *__a);
|
||||
__device__ float __nv_nanf(const signed char *__a);
|
||||
__device__ double __nv_nearbyint(double __a);
|
||||
__device__ float __nv_nearbyintf(float __a);
|
||||
__device__ double __nv_nextafter(double __a, double __b);
|
||||
__device__ float __nv_nextafterf(float __a, float __b);
|
||||
__device__ double __nv_norm3d(double __a, double __b, double __c);
|
||||
__device__ float __nv_norm3df(float __a, float __b, float __c);
|
||||
__device__ double __nv_norm4d(double __a, double __b, double __c, double __d);
|
||||
__device__ float __nv_norm4df(float __a, float __b, float __c, float __d);
|
||||
__device__ double __nv_normcdf(double __a);
|
||||
__device__ float __nv_normcdff(float __a);
|
||||
__device__ double __nv_normcdfinv(double __a);
|
||||
__device__ float __nv_normcdfinvf(float __a);
|
||||
__device__ float __nv_normf(int __a, const float *__b);
|
||||
__device__ double __nv_norm(int __a, const double *__b);
|
||||
__device__ int __nv_popc(int __a);
|
||||
__device__ int __nv_popcll(long long __a);
|
||||
__device__ double __nv_pow(double __a, double __b);
|
||||
__device__ float __nv_powf(float __a, float __b);
|
||||
__device__ double __nv_powi(double __a, int __b);
|
||||
__device__ float __nv_powif(float __a, int __b);
|
||||
__device__ double __nv_rcbrt(double __a);
|
||||
__device__ float __nv_rcbrtf(float __a);
|
||||
__device__ double __nv_rcp64h(double __a);
|
||||
__device__ double __nv_remainder(double __a, double __b);
|
||||
__device__ float __nv_remainderf(float __a, float __b);
|
||||
__device__ double __nv_remquo(double __a, double __b, int *__c);
|
||||
__device__ float __nv_remquof(float __a, float __b, int *__c);
|
||||
__device__ int __nv_rhadd(int __a, int __b);
|
||||
__device__ double __nv_rhypot(double __a, double __b);
|
||||
__device__ float __nv_rhypotf(float __a, float __b);
|
||||
__device__ double __nv_rint(double __a);
|
||||
__device__ float __nv_rintf(float __a);
|
||||
__device__ double __nv_rnorm3d(double __a, double __b, double __c);
|
||||
__device__ float __nv_rnorm3df(float __a, float __b, float __c);
|
||||
__device__ double __nv_rnorm4d(double __a, double __b, double __c, double __d);
|
||||
__device__ float __nv_rnorm4df(float __a, float __b, float __c, float __d);
|
||||
__device__ float __nv_rnormf(int __a, const float *__b);
|
||||
__device__ double __nv_rnorm(int __a, const double *__b);
|
||||
__device__ double __nv_round(double __a);
|
||||
__device__ float __nv_roundf(float __a);
|
||||
__device__ double __nv_rsqrt(double __a);
|
||||
__device__ float __nv_rsqrtf(float __a);
|
||||
__device__ int __nv_sad(int __a, int __b, int __c);
|
||||
__device__ float __nv_saturatef(float __a);
|
||||
__device__ double __nv_scalbn(double __a, int __b);
|
||||
__device__ float __nv_scalbnf(float __a, int __b);
|
||||
__device__ int __nv_signbitd(double __a);
|
||||
__device__ int __nv_signbitf(float __a);
|
||||
__device__ void __nv_sincos(double __a, double *__b, double *__c);
|
||||
__device__ void __nv_sincosf(float __a, float *__b, float *__c);
|
||||
__device__ void __nv_sincospi(double __a, double *__b, double *__c);
|
||||
__device__ void __nv_sincospif(float __a, float *__b, float *__c);
|
||||
__device__ double __nv_sin(double __a);
|
||||
__device__ float __nv_sinf(float __a);
|
||||
__device__ double __nv_sinh(double __a);
|
||||
__device__ float __nv_sinhf(float __a);
|
||||
__device__ double __nv_sinpi(double __a);
|
||||
__device__ float __nv_sinpif(float __a);
|
||||
__device__ double __nv_sqrt(double __a);
|
||||
__device__ float __nv_sqrtf(float __a);
|
||||
__device__ double __nv_tan(double __a);
|
||||
__device__ float __nv_tanf(float __a);
|
||||
__device__ double __nv_tanh(double __a);
|
||||
__device__ float __nv_tanhf(float __a);
|
||||
__device__ double __nv_tgamma(double __a);
|
||||
__device__ float __nv_tgammaf(float __a);
|
||||
__device__ double __nv_trunc(double __a);
|
||||
__device__ float __nv_truncf(float __a);
|
||||
__device__ int __nv_uhadd(unsigned int __a, unsigned int __b);
|
||||
__device__ double __nv_uint2double_rn(unsigned int __i);
|
||||
__device__ float __nv_uint2float_rd(unsigned int __a);
|
||||
__device__ float __nv_uint2float_rn(unsigned int __a);
|
||||
__device__ float __nv_uint2float_ru(unsigned int __a);
|
||||
__device__ float __nv_uint2float_rz(unsigned int __a);
|
||||
__device__ float __nv_uint_as_float(unsigned int __a);
|
||||
__device__ double __nv_ull2double_rd(unsigned long long __a);
|
||||
__device__ double __nv_ull2double_rn(unsigned long long __a);
|
||||
__device__ double __nv_ull2double_ru(unsigned long long __a);
|
||||
__device__ double __nv_ull2double_rz(unsigned long long __a);
|
||||
__device__ float __nv_ull2float_rd(unsigned long long __a);
|
||||
__device__ float __nv_ull2float_rn(unsigned long long __a);
|
||||
__device__ float __nv_ull2float_ru(unsigned long long __a);
|
||||
__device__ float __nv_ull2float_rz(unsigned long long __a);
|
||||
__device__ unsigned long long __nv_ullmax(unsigned long long __a,
|
||||
unsigned long long __b);
|
||||
__device__ unsigned long long __nv_ullmin(unsigned long long __a,
|
||||
unsigned long long __b);
|
||||
__device__ unsigned int __nv_umax(unsigned int __a, unsigned int __b);
|
||||
__device__ unsigned int __nv_umin(unsigned int __a, unsigned int __b);
|
||||
__device__ unsigned int __nv_umul24(unsigned int __a, unsigned int __b);
|
||||
__device__ unsigned long long __nv_umul64hi(unsigned long long __a,
|
||||
unsigned long long __b);
|
||||
__device__ unsigned int __nv_umulhi(unsigned int __a, unsigned int __b);
|
||||
__device__ unsigned int __nv_urhadd(unsigned int __a, unsigned int __b);
|
||||
__device__ unsigned int __nv_usad(unsigned int __a, unsigned int __b,
|
||||
unsigned int __c);
|
||||
#if CUDA_VERSION >= 9000 && CUDA_VERSION < 9020
|
||||
__device__ int __nv_vabs2(int __a);
|
||||
__device__ int __nv_vabs4(int __a);
|
||||
__device__ int __nv_vabsdiffs2(int __a, int __b);
|
||||
__device__ int __nv_vabsdiffs4(int __a, int __b);
|
||||
__device__ int __nv_vabsdiffu2(int __a, int __b);
|
||||
__device__ int __nv_vabsdiffu4(int __a, int __b);
|
||||
__device__ int __nv_vabsss2(int __a);
|
||||
__device__ int __nv_vabsss4(int __a);
|
||||
__device__ int __nv_vadd2(int __a, int __b);
|
||||
__device__ int __nv_vadd4(int __a, int __b);
|
||||
__device__ int __nv_vaddss2(int __a, int __b);
|
||||
__device__ int __nv_vaddss4(int __a, int __b);
|
||||
__device__ int __nv_vaddus2(int __a, int __b);
|
||||
__device__ int __nv_vaddus4(int __a, int __b);
|
||||
__device__ int __nv_vavgs2(int __a, int __b);
|
||||
__device__ int __nv_vavgs4(int __a, int __b);
|
||||
__device__ int __nv_vavgu2(int __a, int __b);
|
||||
__device__ int __nv_vavgu4(int __a, int __b);
|
||||
__device__ int __nv_vcmpeq2(int __a, int __b);
|
||||
__device__ int __nv_vcmpeq4(int __a, int __b);
|
||||
__device__ int __nv_vcmpges2(int __a, int __b);
|
||||
__device__ int __nv_vcmpges4(int __a, int __b);
|
||||
__device__ int __nv_vcmpgeu2(int __a, int __b);
|
||||
__device__ int __nv_vcmpgeu4(int __a, int __b);
|
||||
__device__ int __nv_vcmpgts2(int __a, int __b);
|
||||
__device__ int __nv_vcmpgts4(int __a, int __b);
|
||||
__device__ int __nv_vcmpgtu2(int __a, int __b);
|
||||
__device__ int __nv_vcmpgtu4(int __a, int __b);
|
||||
__device__ int __nv_vcmples2(int __a, int __b);
|
||||
__device__ int __nv_vcmples4(int __a, int __b);
|
||||
__device__ int __nv_vcmpleu2(int __a, int __b);
|
||||
__device__ int __nv_vcmpleu4(int __a, int __b);
|
||||
__device__ int __nv_vcmplts2(int __a, int __b);
|
||||
__device__ int __nv_vcmplts4(int __a, int __b);
|
||||
__device__ int __nv_vcmpltu2(int __a, int __b);
|
||||
__device__ int __nv_vcmpltu4(int __a, int __b);
|
||||
__device__ int __nv_vcmpne2(int __a, int __b);
|
||||
__device__ int __nv_vcmpne4(int __a, int __b);
|
||||
__device__ int __nv_vhaddu2(int __a, int __b);
|
||||
__device__ int __nv_vhaddu4(int __a, int __b);
|
||||
__device__ int __nv_vmaxs2(int __a, int __b);
|
||||
__device__ int __nv_vmaxs4(int __a, int __b);
|
||||
__device__ int __nv_vmaxu2(int __a, int __b);
|
||||
__device__ int __nv_vmaxu4(int __a, int __b);
|
||||
__device__ int __nv_vmins2(int __a, int __b);
|
||||
__device__ int __nv_vmins4(int __a, int __b);
|
||||
__device__ int __nv_vminu2(int __a, int __b);
|
||||
__device__ int __nv_vminu4(int __a, int __b);
|
||||
__device__ int __nv_vneg2(int __a);
|
||||
__device__ int __nv_vneg4(int __a);
|
||||
__device__ int __nv_vnegss2(int __a);
|
||||
__device__ int __nv_vnegss4(int __a);
|
||||
__device__ int __nv_vsads2(int __a, int __b);
|
||||
__device__ int __nv_vsads4(int __a, int __b);
|
||||
__device__ int __nv_vsadu2(int __a, int __b);
|
||||
__device__ int __nv_vsadu4(int __a, int __b);
|
||||
__device__ int __nv_vseteq2(int __a, int __b);
|
||||
__device__ int __nv_vseteq4(int __a, int __b);
|
||||
__device__ int __nv_vsetges2(int __a, int __b);
|
||||
__device__ int __nv_vsetges4(int __a, int __b);
|
||||
__device__ int __nv_vsetgeu2(int __a, int __b);
|
||||
__device__ int __nv_vsetgeu4(int __a, int __b);
|
||||
__device__ int __nv_vsetgts2(int __a, int __b);
|
||||
__device__ int __nv_vsetgts4(int __a, int __b);
|
||||
__device__ int __nv_vsetgtu2(int __a, int __b);
|
||||
__device__ int __nv_vsetgtu4(int __a, int __b);
|
||||
__device__ int __nv_vsetles2(int __a, int __b);
|
||||
__device__ int __nv_vsetles4(int __a, int __b);
|
||||
__device__ int __nv_vsetleu2(int __a, int __b);
|
||||
__device__ int __nv_vsetleu4(int __a, int __b);
|
||||
__device__ int __nv_vsetlts2(int __a, int __b);
|
||||
__device__ int __nv_vsetlts4(int __a, int __b);
|
||||
__device__ int __nv_vsetltu2(int __a, int __b);
|
||||
__device__ int __nv_vsetltu4(int __a, int __b);
|
||||
__device__ int __nv_vsetne2(int __a, int __b);
|
||||
__device__ int __nv_vsetne4(int __a, int __b);
|
||||
__device__ int __nv_vsub2(int __a, int __b);
|
||||
__device__ int __nv_vsub4(int __a, int __b);
|
||||
__device__ int __nv_vsubss2(int __a, int __b);
|
||||
__device__ int __nv_vsubss4(int __a, int __b);
|
||||
__device__ int __nv_vsubus2(int __a, int __b);
|
||||
__device__ int __nv_vsubus4(int __a, int __b);
|
||||
#endif // CUDA_VERSION
|
||||
__device__ double __nv_y0(double __a);
|
||||
__device__ float __nv_y0f(float __a);
|
||||
__device__ double __nv_y1(double __a);
|
||||
__device__ float __nv_y1f(float __a);
|
||||
__device__ float __nv_ynf(int __a, float __b);
|
||||
__device__ double __nv_yn(int __a, double __b);
|
||||
} // extern "C"
|
||||
#endif // __CLANG_CUDA_LIBDEVICE_DECLARES_H__
|
||||
@@ -1,286 +0,0 @@
|
||||
/*===- __clang_math_forward_declares.h - Prototypes of __device__ math fns --===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __CLANG__CUDA_MATH_FORWARD_DECLARES_H__
|
||||
#define __CLANG__CUDA_MATH_FORWARD_DECLARES_H__
|
||||
#ifndef __CUDA__
|
||||
#error "This file is for CUDA compilation only."
|
||||
#endif
|
||||
|
||||
// This file forward-declares of some math functions we (or the CUDA headers)
|
||||
// will define later. We need to do this, and do it before cmath is included,
|
||||
// because the standard library may have constexpr math functions. In the
|
||||
// absence of a prior __device__ decl, those constexpr functions may become
|
||||
// implicitly host+device. host+device functions can't be overloaded, so that
|
||||
// would preclude the use of our own __device__ overloads for these functions.
|
||||
|
||||
#pragma push_macro("__DEVICE__")
|
||||
#define __DEVICE__ \
|
||||
static __inline__ __attribute__((always_inline)) __attribute__((device))
|
||||
|
||||
__DEVICE__ double abs(double);
|
||||
__DEVICE__ float abs(float);
|
||||
__DEVICE__ int abs(int);
|
||||
__DEVICE__ long abs(long);
|
||||
__DEVICE__ long long abs(long long);
|
||||
__DEVICE__ double acos(double);
|
||||
__DEVICE__ float acos(float);
|
||||
__DEVICE__ double acosh(double);
|
||||
__DEVICE__ float acosh(float);
|
||||
__DEVICE__ double asin(double);
|
||||
__DEVICE__ float asin(float);
|
||||
__DEVICE__ double asinh(double);
|
||||
__DEVICE__ float asinh(float);
|
||||
__DEVICE__ double atan2(double, double);
|
||||
__DEVICE__ float atan2(float, float);
|
||||
__DEVICE__ double atan(double);
|
||||
__DEVICE__ float atan(float);
|
||||
__DEVICE__ double atanh(double);
|
||||
__DEVICE__ float atanh(float);
|
||||
__DEVICE__ double cbrt(double);
|
||||
__DEVICE__ float cbrt(float);
|
||||
__DEVICE__ double ceil(double);
|
||||
__DEVICE__ float ceil(float);
|
||||
__DEVICE__ double copysign(double, double);
|
||||
__DEVICE__ float copysign(float, float);
|
||||
__DEVICE__ double cos(double);
|
||||
__DEVICE__ float cos(float);
|
||||
__DEVICE__ double cosh(double);
|
||||
__DEVICE__ float cosh(float);
|
||||
__DEVICE__ double erfc(double);
|
||||
__DEVICE__ float erfc(float);
|
||||
__DEVICE__ double erf(double);
|
||||
__DEVICE__ float erf(float);
|
||||
__DEVICE__ double exp2(double);
|
||||
__DEVICE__ float exp2(float);
|
||||
__DEVICE__ double exp(double);
|
||||
__DEVICE__ float exp(float);
|
||||
__DEVICE__ double expm1(double);
|
||||
__DEVICE__ float expm1(float);
|
||||
__DEVICE__ double fabs(double);
|
||||
__DEVICE__ float fabs(float);
|
||||
__DEVICE__ double fdim(double, double);
|
||||
__DEVICE__ float fdim(float, float);
|
||||
__DEVICE__ double floor(double);
|
||||
__DEVICE__ float floor(float);
|
||||
__DEVICE__ double fma(double, double, double);
|
||||
__DEVICE__ float fma(float, float, float);
|
||||
__DEVICE__ double fmax(double, double);
|
||||
__DEVICE__ float fmax(float, float);
|
||||
__DEVICE__ double fmin(double, double);
|
||||
__DEVICE__ float fmin(float, float);
|
||||
__DEVICE__ double fmod(double, double);
|
||||
__DEVICE__ float fmod(float, float);
|
||||
__DEVICE__ int fpclassify(double);
|
||||
__DEVICE__ int fpclassify(float);
|
||||
__DEVICE__ double frexp(double, int *);
|
||||
__DEVICE__ float frexp(float, int *);
|
||||
__DEVICE__ double hypot(double, double);
|
||||
__DEVICE__ float hypot(float, float);
|
||||
__DEVICE__ int ilogb(double);
|
||||
__DEVICE__ int ilogb(float);
|
||||
__DEVICE__ bool isfinite(double);
|
||||
__DEVICE__ bool isfinite(float);
|
||||
__DEVICE__ bool isgreater(double, double);
|
||||
__DEVICE__ bool isgreaterequal(double, double);
|
||||
__DEVICE__ bool isgreaterequal(float, float);
|
||||
__DEVICE__ bool isgreater(float, float);
|
||||
__DEVICE__ bool isinf(double);
|
||||
__DEVICE__ bool isinf(float);
|
||||
__DEVICE__ bool isless(double, double);
|
||||
__DEVICE__ bool islessequal(double, double);
|
||||
__DEVICE__ bool islessequal(float, float);
|
||||
__DEVICE__ bool isless(float, float);
|
||||
__DEVICE__ bool islessgreater(double, double);
|
||||
__DEVICE__ bool islessgreater(float, float);
|
||||
__DEVICE__ bool isnan(double);
|
||||
__DEVICE__ bool isnan(float);
|
||||
__DEVICE__ bool isnormal(double);
|
||||
__DEVICE__ bool isnormal(float);
|
||||
__DEVICE__ bool isunordered(double, double);
|
||||
__DEVICE__ bool isunordered(float, float);
|
||||
__DEVICE__ long labs(long);
|
||||
__DEVICE__ double ldexp(double, int);
|
||||
__DEVICE__ float ldexp(float, int);
|
||||
__DEVICE__ double lgamma(double);
|
||||
__DEVICE__ float lgamma(float);
|
||||
__DEVICE__ long long llabs(long long);
|
||||
__DEVICE__ long long llrint(double);
|
||||
__DEVICE__ long long llrint(float);
|
||||
__DEVICE__ double log10(double);
|
||||
__DEVICE__ float log10(float);
|
||||
__DEVICE__ double log1p(double);
|
||||
__DEVICE__ float log1p(float);
|
||||
__DEVICE__ double log2(double);
|
||||
__DEVICE__ float log2(float);
|
||||
__DEVICE__ double logb(double);
|
||||
__DEVICE__ float logb(float);
|
||||
__DEVICE__ double log(double);
|
||||
__DEVICE__ float log(float);
|
||||
__DEVICE__ long lrint(double);
|
||||
__DEVICE__ long lrint(float);
|
||||
__DEVICE__ long lround(double);
|
||||
__DEVICE__ long lround(float);
|
||||
__DEVICE__ long long llround(float); // No llround(double).
|
||||
__DEVICE__ double modf(double, double *);
|
||||
__DEVICE__ float modf(float, float *);
|
||||
__DEVICE__ double nan(const char *);
|
||||
__DEVICE__ float nanf(const char *);
|
||||
__DEVICE__ double nearbyint(double);
|
||||
__DEVICE__ float nearbyint(float);
|
||||
__DEVICE__ double nextafter(double, double);
|
||||
__DEVICE__ float nextafter(float, float);
|
||||
__DEVICE__ double pow(double, double);
|
||||
__DEVICE__ double pow(double, int);
|
||||
__DEVICE__ float pow(float, float);
|
||||
__DEVICE__ float pow(float, int);
|
||||
__DEVICE__ double remainder(double, double);
|
||||
__DEVICE__ float remainder(float, float);
|
||||
__DEVICE__ double remquo(double, double, int *);
|
||||
__DEVICE__ float remquo(float, float, int *);
|
||||
__DEVICE__ double rint(double);
|
||||
__DEVICE__ float rint(float);
|
||||
__DEVICE__ double round(double);
|
||||
__DEVICE__ float round(float);
|
||||
__DEVICE__ double scalbln(double, long);
|
||||
__DEVICE__ float scalbln(float, long);
|
||||
__DEVICE__ double scalbn(double, int);
|
||||
__DEVICE__ float scalbn(float, int);
|
||||
__DEVICE__ bool signbit(double);
|
||||
__DEVICE__ bool signbit(float);
|
||||
__DEVICE__ double sin(double);
|
||||
__DEVICE__ float sin(float);
|
||||
__DEVICE__ double sinh(double);
|
||||
__DEVICE__ float sinh(float);
|
||||
__DEVICE__ double sqrt(double);
|
||||
__DEVICE__ float sqrt(float);
|
||||
__DEVICE__ double tan(double);
|
||||
__DEVICE__ float tan(float);
|
||||
__DEVICE__ double tanh(double);
|
||||
__DEVICE__ float tanh(float);
|
||||
__DEVICE__ double tgamma(double);
|
||||
__DEVICE__ float tgamma(float);
|
||||
__DEVICE__ double trunc(double);
|
||||
__DEVICE__ float trunc(float);
|
||||
|
||||
// Notably missing above is nexttoward, which we don't define on
|
||||
// the device side because libdevice doesn't give us an implementation, and we
|
||||
// don't want to be in the business of writing one ourselves.
|
||||
|
||||
// We need to define these overloads in exactly the namespace our standard
|
||||
// library uses (including the right inline namespace), otherwise they won't be
|
||||
// picked up by other functions in the standard library (e.g. functions in
|
||||
// <complex>). Thus the ugliness below.
|
||||
#ifdef _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
#else
|
||||
namespace std {
|
||||
#ifdef _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
#endif
|
||||
#endif
|
||||
|
||||
using ::abs;
|
||||
using ::acos;
|
||||
using ::acosh;
|
||||
using ::asin;
|
||||
using ::asinh;
|
||||
using ::atan;
|
||||
using ::atan2;
|
||||
using ::atanh;
|
||||
using ::cbrt;
|
||||
using ::ceil;
|
||||
using ::copysign;
|
||||
using ::cos;
|
||||
using ::cosh;
|
||||
using ::erf;
|
||||
using ::erfc;
|
||||
using ::exp;
|
||||
using ::exp2;
|
||||
using ::expm1;
|
||||
using ::fabs;
|
||||
using ::fdim;
|
||||
using ::floor;
|
||||
using ::fma;
|
||||
using ::fmax;
|
||||
using ::fmin;
|
||||
using ::fmod;
|
||||
using ::fpclassify;
|
||||
using ::frexp;
|
||||
using ::hypot;
|
||||
using ::ilogb;
|
||||
using ::isfinite;
|
||||
using ::isgreater;
|
||||
using ::isgreaterequal;
|
||||
using ::isinf;
|
||||
using ::isless;
|
||||
using ::islessequal;
|
||||
using ::islessgreater;
|
||||
using ::isnan;
|
||||
using ::isnormal;
|
||||
using ::isunordered;
|
||||
using ::labs;
|
||||
using ::ldexp;
|
||||
using ::lgamma;
|
||||
using ::llabs;
|
||||
using ::llrint;
|
||||
using ::log;
|
||||
using ::log10;
|
||||
using ::log1p;
|
||||
using ::log2;
|
||||
using ::logb;
|
||||
using ::lrint;
|
||||
using ::lround;
|
||||
using ::llround;
|
||||
using ::modf;
|
||||
using ::nan;
|
||||
using ::nanf;
|
||||
using ::nearbyint;
|
||||
using ::nextafter;
|
||||
using ::pow;
|
||||
using ::remainder;
|
||||
using ::remquo;
|
||||
using ::rint;
|
||||
using ::round;
|
||||
using ::scalbln;
|
||||
using ::scalbn;
|
||||
using ::signbit;
|
||||
using ::sin;
|
||||
using ::sinh;
|
||||
using ::sqrt;
|
||||
using ::tan;
|
||||
using ::tanh;
|
||||
using ::tgamma;
|
||||
using ::trunc;
|
||||
|
||||
#ifdef _LIBCPP_END_NAMESPACE_STD
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
#else
|
||||
#ifdef _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
_GLIBCXX_END_NAMESPACE_VERSION
|
||||
#endif
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#pragma pop_macro("__DEVICE__")
|
||||
|
||||
#endif
|
||||
@@ -1,430 +0,0 @@
|
||||
/*===---- __clang_cuda_runtime_wrapper.h - CUDA runtime support -------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
/*
|
||||
* WARNING: This header is intended to be directly -include'd by
|
||||
* the compiler and is not supposed to be included by users.
|
||||
*
|
||||
* CUDA headers are implemented in a way that currently makes it
|
||||
* impossible for user code to #include directly when compiling with
|
||||
* Clang. They present different view of CUDA-supplied functions
|
||||
* depending on where in NVCC's compilation pipeline the headers are
|
||||
* included. Neither of these modes provides function definitions with
|
||||
* correct attributes, so we use preprocessor to force the headers
|
||||
* into a form that Clang can use.
|
||||
*
|
||||
* Similarly to NVCC which -include's cuda_runtime.h, Clang -include's
|
||||
* this file during every CUDA compilation.
|
||||
*/
|
||||
|
||||
#ifndef __CLANG_CUDA_RUNTIME_WRAPPER_H__
|
||||
#define __CLANG_CUDA_RUNTIME_WRAPPER_H__
|
||||
|
||||
#if defined(__CUDA__) && defined(__clang__)
|
||||
|
||||
// Include some forward declares that must come before cmath.
|
||||
#include <__clang_cuda_math_forward_declares.h>
|
||||
|
||||
// Include some standard headers to avoid CUDA headers including them
|
||||
// while some required macros (like __THROW) are in a weird state.
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include <stdlib.h>
|
||||
|
||||
// Preserve common macros that will be changed below by us or by CUDA
|
||||
// headers.
|
||||
#pragma push_macro("__THROW")
|
||||
#pragma push_macro("__CUDA_ARCH__")
|
||||
|
||||
// WARNING: Preprocessor hacks below are based on specific details of
|
||||
// CUDA-7.x headers and are not expected to work with any other
|
||||
// version of CUDA headers.
|
||||
#include "cuda.h"
|
||||
#if !defined(CUDA_VERSION)
|
||||
#error "cuda.h did not define CUDA_VERSION"
|
||||
#elif CUDA_VERSION < 7000 || CUDA_VERSION > 10000
|
||||
#error "Unsupported CUDA version!"
|
||||
#endif
|
||||
|
||||
#pragma push_macro("__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__")
|
||||
#if CUDA_VERSION >= 10000
|
||||
#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__
|
||||
#endif
|
||||
|
||||
// Make largest subset of device functions available during host
|
||||
// compilation -- SM_35 for the time being.
|
||||
#ifndef __CUDA_ARCH__
|
||||
#define __CUDA_ARCH__ 350
|
||||
#endif
|
||||
|
||||
#include "__clang_cuda_builtin_vars.h"
|
||||
|
||||
// No need for device_launch_parameters.h as __clang_cuda_builtin_vars.h above
|
||||
// has taken care of builtin variables declared in the file.
|
||||
#define __DEVICE_LAUNCH_PARAMETERS_H__
|
||||
|
||||
// {math,device}_functions.h only have declarations of the
|
||||
// functions. We don't need them as we're going to pull in their
|
||||
// definitions from .hpp files.
|
||||
#define __DEVICE_FUNCTIONS_H__
|
||||
#define __MATH_FUNCTIONS_H__
|
||||
#define __COMMON_FUNCTIONS_H__
|
||||
// device_functions_decls is replaced by __clang_cuda_device_functions.h
|
||||
// included below.
|
||||
#define __DEVICE_FUNCTIONS_DECLS_H__
|
||||
|
||||
#undef __CUDACC__
|
||||
#if CUDA_VERSION < 9000
|
||||
#define __CUDABE__
|
||||
#else
|
||||
#define __CUDA_LIBDEVICE__
|
||||
#endif
|
||||
// Disables definitions of device-side runtime support stubs in
|
||||
// cuda_device_runtime_api.h
|
||||
#include "driver_types.h"
|
||||
#include "host_config.h"
|
||||
#include "host_defines.h"
|
||||
|
||||
// Temporarily replace "nv_weak" with weak, so __attribute__((nv_weak)) in
|
||||
// cuda_device_runtime_api.h ends up being __attribute__((weak)) which is the
|
||||
// functional equivalent of what we need.
|
||||
#pragma push_macro("nv_weak")
|
||||
#define nv_weak weak
|
||||
#undef __CUDABE__
|
||||
#undef __CUDA_LIBDEVICE__
|
||||
#define __CUDACC__
|
||||
#include "cuda_runtime.h"
|
||||
|
||||
#pragma pop_macro("nv_weak")
|
||||
#undef __CUDACC__
|
||||
#define __CUDABE__
|
||||
|
||||
// CUDA headers use __nvvm_memcpy and __nvvm_memset which Clang does
|
||||
// not have at the moment. Emulate them with a builtin memcpy/memset.
|
||||
#define __nvvm_memcpy(s, d, n, a) __builtin_memcpy(s, d, n)
|
||||
#define __nvvm_memset(d, c, n, a) __builtin_memset(d, c, n)
|
||||
|
||||
#if CUDA_VERSION < 9000
|
||||
#include "crt/device_runtime.h"
|
||||
#endif
|
||||
#include "crt/host_runtime.h"
|
||||
// device_runtime.h defines __cxa_* macros that will conflict with
|
||||
// cxxabi.h.
|
||||
// FIXME: redefine these as __device__ functions.
|
||||
#undef __cxa_vec_ctor
|
||||
#undef __cxa_vec_cctor
|
||||
#undef __cxa_vec_dtor
|
||||
#undef __cxa_vec_new
|
||||
#undef __cxa_vec_new2
|
||||
#undef __cxa_vec_new3
|
||||
#undef __cxa_vec_delete2
|
||||
#undef __cxa_vec_delete
|
||||
#undef __cxa_vec_delete3
|
||||
#undef __cxa_pure_virtual
|
||||
|
||||
// math_functions.hpp expects this host function be defined on MacOS, but it
|
||||
// ends up not being there because of the games we play here. Just define it
|
||||
// ourselves; it's simple enough.
|
||||
#ifdef __APPLE__
|
||||
inline __host__ double __signbitd(double x) {
|
||||
return std::signbit(x);
|
||||
}
|
||||
#endif
|
||||
|
||||
// CUDA 9.1 no longer provides declarations for libdevice functions, so we need
|
||||
// to provide our own.
|
||||
#include <__clang_cuda_libdevice_declares.h>
|
||||
|
||||
// Wrappers for many device-side standard library functions became compiler
|
||||
// builtins in CUDA-9 and have been removed from the CUDA headers. Clang now
|
||||
// provides its own implementation of the wrappers.
|
||||
#if CUDA_VERSION >= 9000
|
||||
#include <__clang_cuda_device_functions.h>
|
||||
#endif
|
||||
|
||||
// __THROW is redefined to be empty by device_functions_decls.h in CUDA. Clang's
|
||||
// counterpart does not do it, so we need to make it empty here to keep
|
||||
// following CUDA includes happy.
|
||||
#undef __THROW
|
||||
#define __THROW
|
||||
|
||||
// CUDA 8.0.41 relies on __USE_FAST_MATH__ and __CUDA_PREC_DIV's values.
|
||||
// Previous versions used to check whether they are defined or not.
|
||||
// CU_DEVICE_INVALID macro is only defined in 8.0.41, so we use it
|
||||
// here to detect the switch.
|
||||
|
||||
#if defined(CU_DEVICE_INVALID)
|
||||
#if !defined(__USE_FAST_MATH__)
|
||||
#define __USE_FAST_MATH__ 0
|
||||
#endif
|
||||
|
||||
#if !defined(__CUDA_PREC_DIV)
|
||||
#define __CUDA_PREC_DIV 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Temporarily poison __host__ macro to ensure it's not used by any of
|
||||
// the headers we're about to include.
|
||||
#pragma push_macro("__host__")
|
||||
#define __host__ UNEXPECTED_HOST_ATTRIBUTE
|
||||
|
||||
// device_functions.hpp and math_functions*.hpp use 'static
|
||||
// __forceinline__' (with no __device__) for definitions of device
|
||||
// functions. Temporarily redefine __forceinline__ to include
|
||||
// __device__.
|
||||
#pragma push_macro("__forceinline__")
|
||||
#define __forceinline__ __device__ __inline__ __attribute__((always_inline))
|
||||
#if CUDA_VERSION < 9000
|
||||
#include "device_functions.hpp"
|
||||
#endif
|
||||
|
||||
// math_function.hpp uses the __USE_FAST_MATH__ macro to determine whether we
|
||||
// get the slow-but-accurate or fast-but-inaccurate versions of functions like
|
||||
// sin and exp. This is controlled in clang by -fcuda-approx-transcendentals.
|
||||
//
|
||||
// device_functions.hpp uses __USE_FAST_MATH__ for a different purpose (fast vs.
|
||||
// slow divides), so we need to scope our define carefully here.
|
||||
#pragma push_macro("__USE_FAST_MATH__")
|
||||
#if defined(__CLANG_CUDA_APPROX_TRANSCENDENTALS__)
|
||||
#define __USE_FAST_MATH__ 1
|
||||
#endif
|
||||
|
||||
#if CUDA_VERSION >= 9000
|
||||
// CUDA-9.2 needs host-side memcpy for some host functions in
|
||||
// device_functions.hpp
|
||||
#if CUDA_VERSION >= 9020
|
||||
#include <string.h>
|
||||
#endif
|
||||
#include "crt/math_functions.hpp"
|
||||
#else
|
||||
#include "math_functions.hpp"
|
||||
#endif
|
||||
|
||||
#pragma pop_macro("__USE_FAST_MATH__")
|
||||
|
||||
#if CUDA_VERSION < 9000
|
||||
#include "math_functions_dbl_ptx3.hpp"
|
||||
#endif
|
||||
#pragma pop_macro("__forceinline__")
|
||||
|
||||
// Pull in host-only functions that are only available when neither
|
||||
// __CUDACC__ nor __CUDABE__ are defined.
|
||||
#undef __MATH_FUNCTIONS_HPP__
|
||||
#undef __CUDABE__
|
||||
#if CUDA_VERSION < 9000
|
||||
#include "math_functions.hpp"
|
||||
#endif
|
||||
// Alas, additional overloads for these functions are hard to get to.
|
||||
// Considering that we only need these overloads for a few functions,
|
||||
// we can provide them here.
|
||||
static inline float rsqrt(float __a) { return rsqrtf(__a); }
|
||||
static inline float rcbrt(float __a) { return rcbrtf(__a); }
|
||||
static inline float sinpi(float __a) { return sinpif(__a); }
|
||||
static inline float cospi(float __a) { return cospif(__a); }
|
||||
static inline void sincospi(float __a, float *__b, float *__c) {
|
||||
return sincospif(__a, __b, __c);
|
||||
}
|
||||
static inline float erfcinv(float __a) { return erfcinvf(__a); }
|
||||
static inline float normcdfinv(float __a) { return normcdfinvf(__a); }
|
||||
static inline float normcdf(float __a) { return normcdff(__a); }
|
||||
static inline float erfcx(float __a) { return erfcxf(__a); }
|
||||
|
||||
#if CUDA_VERSION < 9000
|
||||
// For some reason single-argument variant is not always declared by
|
||||
// CUDA headers. Alas, device_functions.hpp included below needs it.
|
||||
static inline __device__ void __brkpt(int __c) { __brkpt(); }
|
||||
#endif
|
||||
|
||||
// Now include *.hpp with definitions of various GPU functions. Alas,
|
||||
// a lot of thins get declared/defined with __host__ attribute which
|
||||
// we don't want and we have to define it out. We also have to include
|
||||
// {device,math}_functions.hpp again in order to extract the other
|
||||
// branch of #if/else inside.
|
||||
#define __host__
|
||||
#undef __CUDABE__
|
||||
#define __CUDACC__
|
||||
#if CUDA_VERSION >= 9000
|
||||
// Some atomic functions became compiler builtins in CUDA-9 , so we need their
|
||||
// declarations.
|
||||
#include "device_atomic_functions.h"
|
||||
#endif
|
||||
#undef __DEVICE_FUNCTIONS_HPP__
|
||||
#include "device_atomic_functions.hpp"
|
||||
#if CUDA_VERSION >= 9000
|
||||
#include "crt/device_functions.hpp"
|
||||
#include "crt/device_double_functions.hpp"
|
||||
#else
|
||||
#include "device_functions.hpp"
|
||||
#define __CUDABE__
|
||||
#include "device_double_functions.h"
|
||||
#undef __CUDABE__
|
||||
#endif
|
||||
#include "sm_20_atomic_functions.hpp"
|
||||
#include "sm_20_intrinsics.hpp"
|
||||
#include "sm_32_atomic_functions.hpp"
|
||||
|
||||
// Don't include sm_30_intrinsics.h and sm_32_intrinsics.h. These define the
|
||||
// __shfl and __ldg intrinsics using inline (volatile) asm, but we want to
|
||||
// define them using builtins so that the optimizer can reason about and across
|
||||
// these instructions. In particular, using intrinsics for ldg gets us the
|
||||
// [addr+imm] addressing mode, which, although it doesn't actually exist in the
|
||||
// hardware, seems to generate faster machine code because ptxas can more easily
|
||||
// reason about our code.
|
||||
|
||||
#if CUDA_VERSION >= 8000
|
||||
#pragma push_macro("__CUDA_ARCH__")
|
||||
#undef __CUDA_ARCH__
|
||||
#include "sm_60_atomic_functions.hpp"
|
||||
#include "sm_61_intrinsics.hpp"
|
||||
#pragma pop_macro("__CUDA_ARCH__")
|
||||
#endif
|
||||
|
||||
#undef __MATH_FUNCTIONS_HPP__
|
||||
|
||||
// math_functions.hpp defines ::signbit as a __host__ __device__ function. This
|
||||
// conflicts with libstdc++'s constexpr ::signbit, so we have to rename
|
||||
// math_function.hpp's ::signbit. It's guarded by #undef signbit, but that's
|
||||
// conditional on __GNUC__. :)
|
||||
#pragma push_macro("signbit")
|
||||
#pragma push_macro("__GNUC__")
|
||||
#undef __GNUC__
|
||||
#define signbit __ignored_cuda_signbit
|
||||
|
||||
// CUDA-9 omits device-side definitions of some math functions if it sees
|
||||
// include guard from math.h wrapper from libstdc++. We have to undo the header
|
||||
// guard temporarily to get the definitions we need.
|
||||
#pragma push_macro("_GLIBCXX_MATH_H")
|
||||
#pragma push_macro("_LIBCPP_VERSION")
|
||||
#if CUDA_VERSION >= 9000
|
||||
#undef _GLIBCXX_MATH_H
|
||||
// We also need to undo another guard that checks for libc++ 3.8+
|
||||
#ifdef _LIBCPP_VERSION
|
||||
#define _LIBCPP_VERSION 3700
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CUDA_VERSION >= 9000
|
||||
#include "crt/math_functions.hpp"
|
||||
#else
|
||||
#include "math_functions.hpp"
|
||||
#endif
|
||||
#pragma pop_macro("_GLIBCXX_MATH_H")
|
||||
#pragma pop_macro("_LIBCPP_VERSION")
|
||||
#pragma pop_macro("__GNUC__")
|
||||
#pragma pop_macro("signbit")
|
||||
|
||||
#pragma pop_macro("__host__")
|
||||
|
||||
#include "texture_indirect_functions.h"
|
||||
|
||||
// Restore state of __CUDA_ARCH__ and __THROW we had on entry.
|
||||
#pragma pop_macro("__CUDA_ARCH__")
|
||||
#pragma pop_macro("__THROW")
|
||||
|
||||
// Set up compiler macros expected to be seen during compilation.
|
||||
#undef __CUDABE__
|
||||
#define __CUDACC__
|
||||
|
||||
extern "C" {
|
||||
// Device-side CUDA system calls.
|
||||
// http://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability/index.html#system-calls
|
||||
// We need these declarations and wrappers for device-side
|
||||
// malloc/free/printf calls to work without relying on
|
||||
// -fcuda-disable-target-call-checks option.
|
||||
__device__ int vprintf(const char *, const char *);
|
||||
__device__ void free(void *) __attribute((nothrow));
|
||||
__device__ void *malloc(size_t) __attribute((nothrow)) __attribute__((malloc));
|
||||
__device__ void __assertfail(const char *__message, const char *__file,
|
||||
unsigned __line, const char *__function,
|
||||
size_t __charSize) __attribute__((noreturn));
|
||||
|
||||
// In order for standard assert() macro on linux to work we need to
|
||||
// provide device-side __assert_fail()
|
||||
__device__ static inline void __assert_fail(const char *__message,
|
||||
const char *__file, unsigned __line,
|
||||
const char *__function) {
|
||||
__assertfail(__message, __file, __line, __function, sizeof(char));
|
||||
}
|
||||
|
||||
// Clang will convert printf into vprintf, but we still need
|
||||
// device-side declaration for it.
|
||||
__device__ int printf(const char *, ...);
|
||||
} // extern "C"
|
||||
|
||||
// We also need device-side std::malloc and std::free.
|
||||
namespace std {
|
||||
__device__ static inline void free(void *__ptr) { ::free(__ptr); }
|
||||
__device__ static inline void *malloc(size_t __size) {
|
||||
return ::malloc(__size);
|
||||
}
|
||||
} // namespace std
|
||||
|
||||
// Out-of-line implementations from __clang_cuda_builtin_vars.h. These need to
|
||||
// come after we've pulled in the definition of uint3 and dim3.
|
||||
|
||||
__device__ inline __cuda_builtin_threadIdx_t::operator uint3() const {
|
||||
uint3 ret;
|
||||
ret.x = x;
|
||||
ret.y = y;
|
||||
ret.z = z;
|
||||
return ret;
|
||||
}
|
||||
|
||||
__device__ inline __cuda_builtin_blockIdx_t::operator uint3() const {
|
||||
uint3 ret;
|
||||
ret.x = x;
|
||||
ret.y = y;
|
||||
ret.z = z;
|
||||
return ret;
|
||||
}
|
||||
|
||||
__device__ inline __cuda_builtin_blockDim_t::operator dim3() const {
|
||||
return dim3(x, y, z);
|
||||
}
|
||||
|
||||
__device__ inline __cuda_builtin_gridDim_t::operator dim3() const {
|
||||
return dim3(x, y, z);
|
||||
}
|
||||
|
||||
#include <__clang_cuda_cmath.h>
|
||||
#include <__clang_cuda_intrinsics.h>
|
||||
#include <__clang_cuda_complex_builtins.h>
|
||||
|
||||
// curand_mtgp32_kernel helpfully redeclares blockDim and threadIdx in host
|
||||
// mode, giving them their "proper" types of dim3 and uint3. This is
|
||||
// incompatible with the types we give in __clang_cuda_builtin_vars.h. As as
|
||||
// hack, force-include the header (nvcc doesn't include it by default) but
|
||||
// redefine dim3 and uint3 to our builtin types. (Thankfully dim3 and uint3 are
|
||||
// only used here for the redeclarations of blockDim and threadIdx.)
|
||||
#pragma push_macro("dim3")
|
||||
#pragma push_macro("uint3")
|
||||
#define dim3 __cuda_builtin_blockDim_t
|
||||
#define uint3 __cuda_builtin_threadIdx_t
|
||||
#include "curand_mtgp32_kernel.h"
|
||||
#pragma pop_macro("dim3")
|
||||
#pragma pop_macro("uint3")
|
||||
#pragma pop_macro("__USE_FAST_MATH__")
|
||||
#pragma pop_macro("__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__")
|
||||
|
||||
#endif // __CUDA__
|
||||
#endif // __CLANG_CUDA_RUNTIME_WRAPPER_H__
|
||||
@@ -1,43 +0,0 @@
|
||||
/*===---- __stddef_max_align_t.h - Definition of max_align_t for modules ---===
|
||||
*
|
||||
* Copyright (c) 2014 Chandler Carruth
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __CLANG_MAX_ALIGN_T_DEFINED
|
||||
#define __CLANG_MAX_ALIGN_T_DEFINED
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
typedef double max_align_t;
|
||||
#elif defined(__APPLE__)
|
||||
typedef long double max_align_t;
|
||||
#else
|
||||
// Define 'max_align_t' to match the GCC definition.
|
||||
typedef struct {
|
||||
long long __clang_max_align_nonce1
|
||||
__attribute__((__aligned__(__alignof__(long long))));
|
||||
long double __clang_max_align_nonce2
|
||||
__attribute__((__aligned__(__alignof__(long double))));
|
||||
} max_align_t;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,154 +0,0 @@
|
||||
/*===---- __wmmintrin_aes.h - AES intrinsics -------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __WMMINTRIN_H
|
||||
#error "Never use <__wmmintrin_aes.h> directly; include <wmmintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __WMMINTRIN_AES_H
|
||||
#define __WMMINTRIN_AES_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("aes"), __min_vector_width__(128)))
|
||||
|
||||
/// Performs a single round of AES encryption using the Equivalent
|
||||
/// Inverse Cipher, transforming the state value from the first source
|
||||
/// operand using a 128-bit round key value contained in the second source
|
||||
/// operand, and writes the result to the destination.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VAESENC </c> instruction.
|
||||
///
|
||||
/// \param __V
|
||||
/// A 128-bit integer vector containing the state value.
|
||||
/// \param __R
|
||||
/// A 128-bit integer vector containing the round key value.
|
||||
/// \returns A 128-bit integer vector containing the encrypted value.
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_aesenc_si128(__m128i __V, __m128i __R)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_aesenc128((__v2di)__V, (__v2di)__R);
|
||||
}
|
||||
|
||||
/// Performs the final round of AES encryption using the Equivalent
|
||||
/// Inverse Cipher, transforming the state value from the first source
|
||||
/// operand using a 128-bit round key value contained in the second source
|
||||
/// operand, and writes the result to the destination.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VAESENCLAST </c> instruction.
|
||||
///
|
||||
/// \param __V
|
||||
/// A 128-bit integer vector containing the state value.
|
||||
/// \param __R
|
||||
/// A 128-bit integer vector containing the round key value.
|
||||
/// \returns A 128-bit integer vector containing the encrypted value.
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_aesenclast_si128(__m128i __V, __m128i __R)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_aesenclast128((__v2di)__V, (__v2di)__R);
|
||||
}
|
||||
|
||||
/// Performs a single round of AES decryption using the Equivalent
|
||||
/// Inverse Cipher, transforming the state value from the first source
|
||||
/// operand using a 128-bit round key value contained in the second source
|
||||
/// operand, and writes the result to the destination.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VAESDEC </c> instruction.
|
||||
///
|
||||
/// \param __V
|
||||
/// A 128-bit integer vector containing the state value.
|
||||
/// \param __R
|
||||
/// A 128-bit integer vector containing the round key value.
|
||||
/// \returns A 128-bit integer vector containing the decrypted value.
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_aesdec_si128(__m128i __V, __m128i __R)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_aesdec128((__v2di)__V, (__v2di)__R);
|
||||
}
|
||||
|
||||
/// Performs the final round of AES decryption using the Equivalent
|
||||
/// Inverse Cipher, transforming the state value from the first source
|
||||
/// operand using a 128-bit round key value contained in the second source
|
||||
/// operand, and writes the result to the destination.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VAESDECLAST </c> instruction.
|
||||
///
|
||||
/// \param __V
|
||||
/// A 128-bit integer vector containing the state value.
|
||||
/// \param __R
|
||||
/// A 128-bit integer vector containing the round key value.
|
||||
/// \returns A 128-bit integer vector containing the decrypted value.
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_aesdeclast_si128(__m128i __V, __m128i __R)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_aesdeclast128((__v2di)__V, (__v2di)__R);
|
||||
}
|
||||
|
||||
/// Applies the AES InvMixColumns() transformation to an expanded key
|
||||
/// contained in the source operand, and writes the result to the
|
||||
/// destination.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VAESIMC </c> instruction.
|
||||
///
|
||||
/// \param __V
|
||||
/// A 128-bit integer vector containing the expanded key.
|
||||
/// \returns A 128-bit integer vector containing the transformed value.
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_aesimc_si128(__m128i __V)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_aesimc128((__v2di)__V);
|
||||
}
|
||||
|
||||
/// Generates a round key for AES encryption, operating on 128-bit data
|
||||
/// specified in the first source operand and using an 8-bit round constant
|
||||
/// specified by the second source operand, and writes the result to the
|
||||
/// destination.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// \code
|
||||
/// __m128i _mm_aeskeygenassist_si128(__m128i C, const int R);
|
||||
/// \endcode
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> AESKEYGENASSIST </c> instruction.
|
||||
///
|
||||
/// \param C
|
||||
/// A 128-bit integer vector that is used to generate the AES encryption key.
|
||||
/// \param R
|
||||
/// An 8-bit round constant used to generate the AES encryption key.
|
||||
/// \returns A 128-bit round key for AES encryption.
|
||||
#define _mm_aeskeygenassist_si128(C, R) \
|
||||
(__m128i)__builtin_ia32_aeskeygenassist128((__v2di)(__m128i)(C), (int)(R))
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __WMMINTRIN_AES_H */
|
||||
@@ -1,62 +0,0 @@
|
||||
/*===---- __wmmintrin_pclmul.h - PCMUL intrinsics ---------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __WMMINTRIN_H
|
||||
#error "Never use <__wmmintrin_pclmul.h> directly; include <wmmintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __WMMINTRIN_PCLMUL_H
|
||||
#define __WMMINTRIN_PCLMUL_H
|
||||
|
||||
/// Multiplies two 64-bit integer values, which are selected from source
|
||||
/// operands using the immediate-value operand. The multiplication is a
|
||||
/// carry-less multiplication, and the 128-bit integer product is stored in
|
||||
/// the destination.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// \code
|
||||
/// __m128i _mm_clmulepi64_si128(__m128i __X, __m128i __Y, const int __I);
|
||||
/// \endcode
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VPCLMULQDQ </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// A 128-bit vector of [2 x i64] containing one of the source operands.
|
||||
/// \param __Y
|
||||
/// A 128-bit vector of [2 x i64] containing one of the source operands.
|
||||
/// \param __I
|
||||
/// An immediate value specifying which 64-bit values to select from the
|
||||
/// operands. Bit 0 is used to select a value from operand \a __X, and bit
|
||||
/// 4 is used to select a value from operand \a __Y: \n
|
||||
/// Bit[0]=0 indicates that bits[63:0] of operand \a __X are used. \n
|
||||
/// Bit[0]=1 indicates that bits[127:64] of operand \a __X are used. \n
|
||||
/// Bit[4]=0 indicates that bits[63:0] of operand \a __Y are used. \n
|
||||
/// Bit[4]=1 indicates that bits[127:64] of operand \a __Y are used.
|
||||
/// \returns The 128-bit integer vector containing the result of the carry-less
|
||||
/// multiplication of the selected 64-bit values.
|
||||
#define _mm_clmulepi64_si128(X, Y, I) \
|
||||
((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \
|
||||
(__v2di)(__m128i)(Y), (char)(I)))
|
||||
|
||||
#endif /* __WMMINTRIN_PCLMUL_H */
|
||||
@@ -1,86 +0,0 @@
|
||||
/*===---- adxintrin.h - ADX intrinsics -------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <adxintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __ADXINTRIN_H
|
||||
#define __ADXINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
|
||||
|
||||
/* Intrinsics that are available only if __ADX__ defined */
|
||||
static __inline unsigned char __attribute__((__always_inline__, __nodebug__, __target__("adx")))
|
||||
_addcarryx_u32(unsigned char __cf, unsigned int __x, unsigned int __y,
|
||||
unsigned int *__p)
|
||||
{
|
||||
return __builtin_ia32_addcarryx_u32(__cf, __x, __y, __p);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline unsigned char __attribute__((__always_inline__, __nodebug__, __target__("adx")))
|
||||
_addcarryx_u64(unsigned char __cf, unsigned long long __x,
|
||||
unsigned long long __y, unsigned long long *__p)
|
||||
{
|
||||
return __builtin_ia32_addcarryx_u64(__cf, __x, __y, __p);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Intrinsics that are also available if __ADX__ undefined */
|
||||
static __inline unsigned char __DEFAULT_FN_ATTRS
|
||||
_addcarry_u32(unsigned char __cf, unsigned int __x, unsigned int __y,
|
||||
unsigned int *__p)
|
||||
{
|
||||
return __builtin_ia32_addcarryx_u32(__cf, __x, __y, __p);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline unsigned char __DEFAULT_FN_ATTRS
|
||||
_addcarry_u64(unsigned char __cf, unsigned long long __x,
|
||||
unsigned long long __y, unsigned long long *__p)
|
||||
{
|
||||
return __builtin_ia32_addcarryx_u64(__cf, __x, __y, __p);
|
||||
}
|
||||
#endif
|
||||
|
||||
static __inline unsigned char __DEFAULT_FN_ATTRS
|
||||
_subborrow_u32(unsigned char __cf, unsigned int __x, unsigned int __y,
|
||||
unsigned int *__p)
|
||||
{
|
||||
return __builtin_ia32_subborrow_u32(__cf, __x, __y, __p);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline unsigned char __DEFAULT_FN_ATTRS
|
||||
_subborrow_u64(unsigned char __cf, unsigned long long __x,
|
||||
unsigned long long __y, unsigned long long *__p)
|
||||
{
|
||||
return __builtin_ia32_subborrow_u64(__cf, __x, __y, __p);
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __ADXINTRIN_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,193 +0,0 @@
|
||||
/*===---- ammintrin.h - SSE4a intrinsics -----------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __AMMINTRIN_H
|
||||
#define __AMMINTRIN_H
|
||||
|
||||
#include <pmmintrin.h>
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse4a"), __min_vector_width__(128)))
|
||||
|
||||
/// Extracts the specified bits from the lower 64 bits of the 128-bit
|
||||
/// integer vector operand at the index \a idx and of the length \a len.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// \code
|
||||
/// __m128i _mm_extracti_si64(__m128i x, const int len, const int idx);
|
||||
/// \endcode
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> EXTRQ </c> instruction.
|
||||
///
|
||||
/// \param x
|
||||
/// The value from which bits are extracted.
|
||||
/// \param len
|
||||
/// Bits [5:0] specify the length; the other bits are ignored. If bits [5:0]
|
||||
/// are zero, the length is interpreted as 64.
|
||||
/// \param idx
|
||||
/// Bits [5:0] specify the index of the least significant bit; the other
|
||||
/// bits are ignored. If the sum of the index and length is greater than 64,
|
||||
/// the result is undefined. If the length and index are both zero, bits
|
||||
/// [63:0] of parameter \a x are extracted. If the length is zero but the
|
||||
/// index is non-zero, the result is undefined.
|
||||
/// \returns A 128-bit integer vector whose lower 64 bits contain the bits
|
||||
/// extracted from the source operand.
|
||||
#define _mm_extracti_si64(x, len, idx) \
|
||||
((__m128i)__builtin_ia32_extrqi((__v2di)(__m128i)(x), \
|
||||
(char)(len), (char)(idx)))
|
||||
|
||||
/// Extracts the specified bits from the lower 64 bits of the 128-bit
|
||||
/// integer vector operand at the index and of the length specified by
|
||||
/// \a __y.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> EXTRQ </c> instruction.
|
||||
///
|
||||
/// \param __x
|
||||
/// The value from which bits are extracted.
|
||||
/// \param __y
|
||||
/// Specifies the index of the least significant bit at [13:8] and the
|
||||
/// length at [5:0]; all other bits are ignored. If bits [5:0] are zero, the
|
||||
/// length is interpreted as 64. If the sum of the index and length is
|
||||
/// greater than 64, the result is undefined. If the length and index are
|
||||
/// both zero, bits [63:0] of parameter \a __x are extracted. If the length
|
||||
/// is zero but the index is non-zero, the result is undefined.
|
||||
/// \returns A 128-bit vector whose lower 64 bits contain the bits extracted
|
||||
/// from the source operand.
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_extract_si64(__m128i __x, __m128i __y)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_extrq((__v2di)__x, (__v16qi)__y);
|
||||
}
|
||||
|
||||
/// Inserts bits of a specified length from the source integer vector
|
||||
/// \a y into the lower 64 bits of the destination integer vector \a x at
|
||||
/// the index \a idx and of the length \a len.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// \code
|
||||
/// __m128i _mm_inserti_si64(__m128i x, __m128i y, const int len,
|
||||
/// const int idx);
|
||||
/// \endcode
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> INSERTQ </c> instruction.
|
||||
///
|
||||
/// \param x
|
||||
/// The destination operand where bits will be inserted. The inserted bits
|
||||
/// are defined by the length \a len and by the index \a idx specifying the
|
||||
/// least significant bit.
|
||||
/// \param y
|
||||
/// The source operand containing the bits to be extracted. The extracted
|
||||
/// bits are the least significant bits of operand \a y of length \a len.
|
||||
/// \param len
|
||||
/// Bits [5:0] specify the length; the other bits are ignored. If bits [5:0]
|
||||
/// are zero, the length is interpreted as 64.
|
||||
/// \param idx
|
||||
/// Bits [5:0] specify the index of the least significant bit; the other
|
||||
/// bits are ignored. If the sum of the index and length is greater than 64,
|
||||
/// the result is undefined. If the length and index are both zero, bits
|
||||
/// [63:0] of parameter \a y are inserted into parameter \a x. If the length
|
||||
/// is zero but the index is non-zero, the result is undefined.
|
||||
/// \returns A 128-bit integer vector containing the original lower 64-bits of
|
||||
/// destination operand \a x with the specified bitfields replaced by the
|
||||
/// lower bits of source operand \a y. The upper 64 bits of the return value
|
||||
/// are undefined.
|
||||
#define _mm_inserti_si64(x, y, len, idx) \
|
||||
((__m128i)__builtin_ia32_insertqi((__v2di)(__m128i)(x), \
|
||||
(__v2di)(__m128i)(y), \
|
||||
(char)(len), (char)(idx)))
|
||||
|
||||
/// Inserts bits of a specified length from the source integer vector
|
||||
/// \a __y into the lower 64 bits of the destination integer vector \a __x
|
||||
/// at the index and of the length specified by \a __y.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> INSERTQ </c> instruction.
|
||||
///
|
||||
/// \param __x
|
||||
/// The destination operand where bits will be inserted. The inserted bits
|
||||
/// are defined by the length and by the index of the least significant bit
|
||||
/// specified by operand \a __y.
|
||||
/// \param __y
|
||||
/// The source operand containing the bits to be extracted. The extracted
|
||||
/// bits are the least significant bits of operand \a __y with length
|
||||
/// specified by bits [69:64]. These are inserted into the destination at the
|
||||
/// index specified by bits [77:72]; all other bits are ignored. If bits
|
||||
/// [69:64] are zero, the length is interpreted as 64. If the sum of the
|
||||
/// index and length is greater than 64, the result is undefined. If the
|
||||
/// length and index are both zero, bits [63:0] of parameter \a __y are
|
||||
/// inserted into parameter \a __x. If the length is zero but the index is
|
||||
/// non-zero, the result is undefined.
|
||||
/// \returns A 128-bit integer vector containing the original lower 64-bits of
|
||||
/// destination operand \a __x with the specified bitfields replaced by the
|
||||
/// lower bits of source operand \a __y. The upper 64 bits of the return
|
||||
/// value are undefined.
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_insert_si64(__m128i __x, __m128i __y)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_insertq((__v2di)__x, (__v2di)__y);
|
||||
}
|
||||
|
||||
/// Stores a 64-bit double-precision value in a 64-bit memory location.
|
||||
/// To minimize caching, the data is flagged as non-temporal (unlikely to be
|
||||
/// used again soon).
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> MOVNTSD </c> instruction.
|
||||
///
|
||||
/// \param __p
|
||||
/// The 64-bit memory location used to store the register value.
|
||||
/// \param __a
|
||||
/// The 64-bit double-precision floating-point register value to be stored.
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_mm_stream_sd(double *__p, __m128d __a)
|
||||
{
|
||||
__builtin_ia32_movntsd(__p, (__v2df)__a);
|
||||
}
|
||||
|
||||
/// Stores a 32-bit single-precision floating-point value in a 32-bit
|
||||
/// memory location. To minimize caching, the data is flagged as
|
||||
/// non-temporal (unlikely to be used again soon).
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> MOVNTSS </c> instruction.
|
||||
///
|
||||
/// \param __p
|
||||
/// The 32-bit memory location used to store the register value.
|
||||
/// \param __a
|
||||
/// The 32-bit single-precision floating-point register value to be stored.
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_mm_stream_ss(float *__p, __m128 __a)
|
||||
{
|
||||
__builtin_ia32_movntss(__p, (__v4sf)__a);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __AMMINTRIN_H */
|
||||
@@ -1,49 +0,0 @@
|
||||
/*===---- arm64intr.h - ARM64 Windows intrinsics -------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
/* Only include this if we're compiling for the windows platform. */
|
||||
#ifndef _MSC_VER
|
||||
#include_next <arm64intr.h>
|
||||
#else
|
||||
|
||||
#ifndef __ARM64INTR_H
|
||||
#define __ARM64INTR_H
|
||||
|
||||
typedef enum
|
||||
{
|
||||
_ARM64_BARRIER_SY = 0xF,
|
||||
_ARM64_BARRIER_ST = 0xE,
|
||||
_ARM64_BARRIER_LD = 0xD,
|
||||
_ARM64_BARRIER_ISH = 0xB,
|
||||
_ARM64_BARRIER_ISHST = 0xA,
|
||||
_ARM64_BARRIER_ISHLD = 0x9,
|
||||
_ARM64_BARRIER_NSH = 0x7,
|
||||
_ARM64_BARRIER_NSHST = 0x6,
|
||||
_ARM64_BARRIER_NSHLD = 0x5,
|
||||
_ARM64_BARRIER_OSH = 0x3,
|
||||
_ARM64_BARRIER_OSHST = 0x2,
|
||||
_ARM64_BARRIER_OSHLD = 0x1
|
||||
} _ARM64INTR_BARRIER_TYPE;
|
||||
|
||||
#endif /* __ARM64INTR_H */
|
||||
#endif /* _MSC_VER */
|
||||
@@ -1,626 +0,0 @@
|
||||
/*===---- arm_acle.h - ARM Non-Neon intrinsics -----------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __ARM_ACLE_H
|
||||
#define __ARM_ACLE_H
|
||||
|
||||
#ifndef __ARM_ACLE
|
||||
#error "ACLE intrinsics support not enabled."
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* 8 SYNCHRONIZATION, BARRIER AND HINT INTRINSICS */
|
||||
/* 8.3 Memory barriers */
|
||||
#if !defined(_MSC_VER)
|
||||
#define __dmb(i) __builtin_arm_dmb(i)
|
||||
#define __dsb(i) __builtin_arm_dsb(i)
|
||||
#define __isb(i) __builtin_arm_isb(i)
|
||||
#endif
|
||||
|
||||
/* 8.4 Hints */
|
||||
|
||||
#if !defined(_MSC_VER)
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__)) __wfi(void) {
|
||||
__builtin_arm_wfi();
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__)) __wfe(void) {
|
||||
__builtin_arm_wfe();
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__)) __sev(void) {
|
||||
__builtin_arm_sev();
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__)) __sevl(void) {
|
||||
__builtin_arm_sevl();
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__)) __yield(void) {
|
||||
__builtin_arm_yield();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if __ARM_32BIT_STATE
|
||||
#define __dbg(t) __builtin_arm_dbg(t)
|
||||
#endif
|
||||
|
||||
/* 8.5 Swap */
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__swp(uint32_t __x, volatile uint32_t *__p) {
|
||||
uint32_t v;
|
||||
do
|
||||
v = __builtin_arm_ldrex(__p);
|
||||
while (__builtin_arm_strex(__x, __p));
|
||||
return v;
|
||||
}
|
||||
|
||||
/* 8.6 Memory prefetch intrinsics */
|
||||
/* 8.6.1 Data prefetch */
|
||||
#define __pld(addr) __pldx(0, 0, 0, addr)
|
||||
|
||||
#if __ARM_32BIT_STATE
|
||||
#define __pldx(access_kind, cache_level, retention_policy, addr) \
|
||||
__builtin_arm_prefetch(addr, access_kind, 1)
|
||||
#else
|
||||
#define __pldx(access_kind, cache_level, retention_policy, addr) \
|
||||
__builtin_arm_prefetch(addr, access_kind, cache_level, retention_policy, 1)
|
||||
#endif
|
||||
|
||||
/* 8.6.2 Instruction prefetch */
|
||||
#define __pli(addr) __plix(0, 0, addr)
|
||||
|
||||
#if __ARM_32BIT_STATE
|
||||
#define __plix(cache_level, retention_policy, addr) \
|
||||
__builtin_arm_prefetch(addr, 0, 0)
|
||||
#else
|
||||
#define __plix(cache_level, retention_policy, addr) \
|
||||
__builtin_arm_prefetch(addr, 0, cache_level, retention_policy, 0)
|
||||
#endif
|
||||
|
||||
/* 8.7 NOP */
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__)) __nop(void) {
|
||||
__builtin_arm_nop();
|
||||
}
|
||||
|
||||
/* 9 DATA-PROCESSING INTRINSICS */
|
||||
/* 9.2 Miscellaneous data-processing intrinsics */
|
||||
/* ROR */
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__ror(uint32_t __x, uint32_t __y) {
|
||||
__y %= 32;
|
||||
if (__y == 0)
|
||||
return __x;
|
||||
return (__x >> __y) | (__x << (32 - __y));
|
||||
}
|
||||
|
||||
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
|
||||
__rorll(uint64_t __x, uint32_t __y) {
|
||||
__y %= 64;
|
||||
if (__y == 0)
|
||||
return __x;
|
||||
return (__x >> __y) | (__x << (64 - __y));
|
||||
}
|
||||
|
||||
static __inline__ unsigned long __attribute__((__always_inline__, __nodebug__))
|
||||
__rorl(unsigned long __x, uint32_t __y) {
|
||||
#if __SIZEOF_LONG__ == 4
|
||||
return __ror(__x, __y);
|
||||
#else
|
||||
return __rorll(__x, __y);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* CLZ */
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__clz(uint32_t __t) {
|
||||
return __builtin_clz(__t);
|
||||
}
|
||||
|
||||
static __inline__ unsigned long __attribute__((__always_inline__, __nodebug__))
|
||||
__clzl(unsigned long __t) {
|
||||
return __builtin_clzl(__t);
|
||||
}
|
||||
|
||||
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
|
||||
__clzll(uint64_t __t) {
|
||||
return __builtin_clzll(__t);
|
||||
}
|
||||
|
||||
/* REV */
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__rev(uint32_t __t) {
|
||||
return __builtin_bswap32(__t);
|
||||
}
|
||||
|
||||
static __inline__ unsigned long __attribute__((__always_inline__, __nodebug__))
|
||||
__revl(unsigned long __t) {
|
||||
#if __SIZEOF_LONG__ == 4
|
||||
return __builtin_bswap32(__t);
|
||||
#else
|
||||
return __builtin_bswap64(__t);
|
||||
#endif
|
||||
}
|
||||
|
||||
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
|
||||
__revll(uint64_t __t) {
|
||||
return __builtin_bswap64(__t);
|
||||
}
|
||||
|
||||
/* REV16 */
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__rev16(uint32_t __t) {
|
||||
return __ror(__rev(__t), 16);
|
||||
}
|
||||
|
||||
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
|
||||
__rev16ll(uint64_t __t) {
|
||||
return (((uint64_t)__rev16(__t >> 32)) << 32) | __rev16(__t);
|
||||
}
|
||||
|
||||
static __inline__ unsigned long __attribute__((__always_inline__, __nodebug__))
|
||||
__rev16l(unsigned long __t) {
|
||||
#if __SIZEOF_LONG__ == 4
|
||||
return __rev16(__t);
|
||||
#else
|
||||
return __rev16ll(__t);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* REVSH */
|
||||
static __inline__ int16_t __attribute__((__always_inline__, __nodebug__))
|
||||
__revsh(int16_t __t) {
|
||||
return __builtin_bswap16(__t);
|
||||
}
|
||||
|
||||
/* RBIT */
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__rbit(uint32_t __t) {
|
||||
return __builtin_arm_rbit(__t);
|
||||
}
|
||||
|
||||
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
|
||||
__rbitll(uint64_t __t) {
|
||||
#if __ARM_32BIT_STATE
|
||||
return (((uint64_t)__builtin_arm_rbit(__t)) << 32) |
|
||||
__builtin_arm_rbit(__t >> 32);
|
||||
#else
|
||||
return __builtin_arm_rbit64(__t);
|
||||
#endif
|
||||
}
|
||||
|
||||
static __inline__ unsigned long __attribute__((__always_inline__, __nodebug__))
|
||||
__rbitl(unsigned long __t) {
|
||||
#if __SIZEOF_LONG__ == 4
|
||||
return __rbit(__t);
|
||||
#else
|
||||
return __rbitll(__t);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* 9.3 16-bit multiplications
|
||||
*/
|
||||
#if __ARM_FEATURE_DSP
|
||||
static __inline__ int32_t __attribute__((__always_inline__,__nodebug__))
|
||||
__smulbb(int32_t __a, int32_t __b) {
|
||||
return __builtin_arm_smulbb(__a, __b);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__,__nodebug__))
|
||||
__smulbt(int32_t __a, int32_t __b) {
|
||||
return __builtin_arm_smulbt(__a, __b);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__,__nodebug__))
|
||||
__smultb(int32_t __a, int32_t __b) {
|
||||
return __builtin_arm_smultb(__a, __b);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__,__nodebug__))
|
||||
__smultt(int32_t __a, int32_t __b) {
|
||||
return __builtin_arm_smultt(__a, __b);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__,__nodebug__))
|
||||
__smulwb(int32_t __a, int32_t __b) {
|
||||
return __builtin_arm_smulwb(__a, __b);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__,__nodebug__))
|
||||
__smulwt(int32_t __a, int32_t __b) {
|
||||
return __builtin_arm_smulwt(__a, __b);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 9.4 Saturating intrinsics
|
||||
*
|
||||
* FIXME: Change guard to their corrosponding __ARM_FEATURE flag when Q flag
|
||||
* intrinsics are implemented and the flag is enabled.
|
||||
*/
|
||||
/* 9.4.1 Width-specified saturation intrinsics */
|
||||
#if __ARM_FEATURE_SAT
|
||||
#define __ssat(x, y) __builtin_arm_ssat(x, y)
|
||||
#define __usat(x, y) __builtin_arm_usat(x, y)
|
||||
#endif
|
||||
|
||||
/* 9.4.2 Saturating addition and subtraction intrinsics */
|
||||
#if __ARM_FEATURE_DSP
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__qadd(int32_t __t, int32_t __v) {
|
||||
return __builtin_arm_qadd(__t, __v);
|
||||
}
|
||||
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__qsub(int32_t __t, int32_t __v) {
|
||||
return __builtin_arm_qsub(__t, __v);
|
||||
}
|
||||
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__qdbl(int32_t __t) {
|
||||
return __builtin_arm_qadd(__t, __t);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 9.4.3 Accumultating multiplications */
|
||||
#if __ARM_FEATURE_DSP
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smlabb(int32_t __a, int32_t __b, int32_t __c) {
|
||||
return __builtin_arm_smlabb(__a, __b, __c);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smlabt(int32_t __a, int32_t __b, int32_t __c) {
|
||||
return __builtin_arm_smlabt(__a, __b, __c);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smlatb(int32_t __a, int32_t __b, int32_t __c) {
|
||||
return __builtin_arm_smlatb(__a, __b, __c);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smlatt(int32_t __a, int32_t __b, int32_t __c) {
|
||||
return __builtin_arm_smlatt(__a, __b, __c);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smlawb(int32_t __a, int32_t __b, int32_t __c) {
|
||||
return __builtin_arm_smlawb(__a, __b, __c);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smlawt(int32_t __a, int32_t __b, int32_t __c) {
|
||||
return __builtin_arm_smlawt(__a, __b, __c);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* 9.5.4 Parallel 16-bit saturation */
|
||||
#if __ARM_FEATURE_SIMD32
|
||||
#define __ssat16(x, y) __builtin_arm_ssat16(x, y)
|
||||
#define __usat16(x, y) __builtin_arm_usat16(x, y)
|
||||
#endif
|
||||
|
||||
/* 9.5.5 Packing and unpacking */
|
||||
#if __ARM_FEATURE_SIMD32
|
||||
typedef int32_t int8x4_t;
|
||||
typedef int32_t int16x2_t;
|
||||
typedef uint32_t uint8x4_t;
|
||||
typedef uint32_t uint16x2_t;
|
||||
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__sxtab16(int16x2_t __a, int8x4_t __b) {
|
||||
return __builtin_arm_sxtab16(__a, __b);
|
||||
}
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__sxtb16(int8x4_t __a) {
|
||||
return __builtin_arm_sxtb16(__a);
|
||||
}
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uxtab16(int16x2_t __a, int8x4_t __b) {
|
||||
return __builtin_arm_uxtab16(__a, __b);
|
||||
}
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uxtb16(int8x4_t __a) {
|
||||
return __builtin_arm_uxtb16(__a);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 9.5.6 Parallel selection */
|
||||
#if __ARM_FEATURE_SIMD32
|
||||
static __inline__ uint8x4_t __attribute__((__always_inline__, __nodebug__))
|
||||
__sel(uint8x4_t __a, uint8x4_t __b) {
|
||||
return __builtin_arm_sel(__a, __b);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 9.5.7 Parallel 8-bit addition and subtraction */
|
||||
#if __ARM_FEATURE_SIMD32
|
||||
static __inline__ int8x4_t __attribute__((__always_inline__, __nodebug__))
|
||||
__qadd8(int8x4_t __a, int8x4_t __b) {
|
||||
return __builtin_arm_qadd8(__a, __b);
|
||||
}
|
||||
static __inline__ int8x4_t __attribute__((__always_inline__, __nodebug__))
|
||||
__qsub8(int8x4_t __a, int8x4_t __b) {
|
||||
return __builtin_arm_qsub8(__a, __b);
|
||||
}
|
||||
static __inline__ int8x4_t __attribute__((__always_inline__, __nodebug__))
|
||||
__sadd8(int8x4_t __a, int8x4_t __b) {
|
||||
return __builtin_arm_sadd8(__a, __b);
|
||||
}
|
||||
static __inline__ int8x4_t __attribute__((__always_inline__, __nodebug__))
|
||||
__shadd8(int8x4_t __a, int8x4_t __b) {
|
||||
return __builtin_arm_shadd8(__a, __b);
|
||||
}
|
||||
static __inline__ int8x4_t __attribute__((__always_inline__, __nodebug__))
|
||||
__shsub8(int8x4_t __a, int8x4_t __b) {
|
||||
return __builtin_arm_shsub8(__a, __b);
|
||||
}
|
||||
static __inline__ int8x4_t __attribute__((__always_inline__, __nodebug__))
|
||||
__ssub8(int8x4_t __a, int8x4_t __b) {
|
||||
return __builtin_arm_ssub8(__a, __b);
|
||||
}
|
||||
static __inline__ uint8x4_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uadd8(uint8x4_t __a, uint8x4_t __b) {
|
||||
return __builtin_arm_uadd8(__a, __b);
|
||||
}
|
||||
static __inline__ uint8x4_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uhadd8(uint8x4_t __a, uint8x4_t __b) {
|
||||
return __builtin_arm_uhadd8(__a, __b);
|
||||
}
|
||||
static __inline__ uint8x4_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uhsub8(uint8x4_t __a, uint8x4_t __b) {
|
||||
return __builtin_arm_uhsub8(__a, __b);
|
||||
}
|
||||
static __inline__ uint8x4_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uqadd8(uint8x4_t __a, uint8x4_t __b) {
|
||||
return __builtin_arm_uqadd8(__a, __b);
|
||||
}
|
||||
static __inline__ uint8x4_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uqsub8(uint8x4_t __a, uint8x4_t __b) {
|
||||
return __builtin_arm_uqsub8(__a, __b);
|
||||
}
|
||||
static __inline__ uint8x4_t __attribute__((__always_inline__, __nodebug__))
|
||||
__usub8(uint8x4_t __a, uint8x4_t __b) {
|
||||
return __builtin_arm_usub8(__a, __b);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 9.5.8 Sum of 8-bit absolute differences */
|
||||
#if __ARM_FEATURE_SIMD32
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__usad8(uint8x4_t __a, uint8x4_t __b) {
|
||||
return __builtin_arm_usad8(__a, __b);
|
||||
}
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__usada8(uint8x4_t __a, uint8x4_t __b, uint32_t __c) {
|
||||
return __builtin_arm_usada8(__a, __b, __c);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 9.5.9 Parallel 16-bit addition and subtraction */
|
||||
#if __ARM_FEATURE_SIMD32
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__qadd16(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_qadd16(__a, __b);
|
||||
}
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__qasx(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_qasx(__a, __b);
|
||||
}
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__qsax(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_qsax(__a, __b);
|
||||
}
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__qsub16(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_qsub16(__a, __b);
|
||||
}
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__sadd16(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_sadd16(__a, __b);
|
||||
}
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__sasx(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_sasx(__a, __b);
|
||||
}
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__shadd16(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_shadd16(__a, __b);
|
||||
}
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__shasx(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_shasx(__a, __b);
|
||||
}
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__shsax(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_shsax(__a, __b);
|
||||
}
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__shsub16(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_shsub16(__a, __b);
|
||||
}
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__ssax(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_ssax(__a, __b);
|
||||
}
|
||||
static __inline__ int16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__ssub16(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_ssub16(__a, __b);
|
||||
}
|
||||
static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uadd16(uint16x2_t __a, uint16x2_t __b) {
|
||||
return __builtin_arm_uadd16(__a, __b);
|
||||
}
|
||||
static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uasx(uint16x2_t __a, uint16x2_t __b) {
|
||||
return __builtin_arm_uasx(__a, __b);
|
||||
}
|
||||
static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uhadd16(uint16x2_t __a, uint16x2_t __b) {
|
||||
return __builtin_arm_uhadd16(__a, __b);
|
||||
}
|
||||
static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uhasx(uint16x2_t __a, uint16x2_t __b) {
|
||||
return __builtin_arm_uhasx(__a, __b);
|
||||
}
|
||||
static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uhsax(uint16x2_t __a, uint16x2_t __b) {
|
||||
return __builtin_arm_uhsax(__a, __b);
|
||||
}
|
||||
static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uhsub16(uint16x2_t __a, uint16x2_t __b) {
|
||||
return __builtin_arm_uhsub16(__a, __b);
|
||||
}
|
||||
static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uqadd16(uint16x2_t __a, uint16x2_t __b) {
|
||||
return __builtin_arm_uqadd16(__a, __b);
|
||||
}
|
||||
static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uqasx(uint16x2_t __a, uint16x2_t __b) {
|
||||
return __builtin_arm_uqasx(__a, __b);
|
||||
}
|
||||
static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uqsax(uint16x2_t __a, uint16x2_t __b) {
|
||||
return __builtin_arm_uqsax(__a, __b);
|
||||
}
|
||||
static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__uqsub16(uint16x2_t __a, uint16x2_t __b) {
|
||||
return __builtin_arm_uqsub16(__a, __b);
|
||||
}
|
||||
static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__usax(uint16x2_t __a, uint16x2_t __b) {
|
||||
return __builtin_arm_usax(__a, __b);
|
||||
}
|
||||
static __inline__ uint16x2_t __attribute__((__always_inline__, __nodebug__))
|
||||
__usub16(uint16x2_t __a, uint16x2_t __b) {
|
||||
return __builtin_arm_usub16(__a, __b);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 9.5.10 Parallel 16-bit multiplications */
|
||||
#if __ARM_FEATURE_SIMD32
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smlad(int16x2_t __a, int16x2_t __b, int32_t __c) {
|
||||
return __builtin_arm_smlad(__a, __b, __c);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smladx(int16x2_t __a, int16x2_t __b, int32_t __c) {
|
||||
return __builtin_arm_smladx(__a, __b, __c);
|
||||
}
|
||||
static __inline__ int64_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smlald(int16x2_t __a, int16x2_t __b, int64_t __c) {
|
||||
return __builtin_arm_smlald(__a, __b, __c);
|
||||
}
|
||||
static __inline__ int64_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smlaldx(int16x2_t __a, int16x2_t __b, int64_t __c) {
|
||||
return __builtin_arm_smlaldx(__a, __b, __c);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smlsd(int16x2_t __a, int16x2_t __b, int32_t __c) {
|
||||
return __builtin_arm_smlsd(__a, __b, __c);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smlsdx(int16x2_t __a, int16x2_t __b, int32_t __c) {
|
||||
return __builtin_arm_smlsdx(__a, __b, __c);
|
||||
}
|
||||
static __inline__ int64_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smlsld(int16x2_t __a, int16x2_t __b, int64_t __c) {
|
||||
return __builtin_arm_smlsld(__a, __b, __c);
|
||||
}
|
||||
static __inline__ int64_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smlsldx(int16x2_t __a, int16x2_t __b, int64_t __c) {
|
||||
return __builtin_arm_smlsldx(__a, __b, __c);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smuad(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_smuad(__a, __b);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smuadx(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_smuadx(__a, __b);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smusd(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_smusd(__a, __b);
|
||||
}
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__smusdx(int16x2_t __a, int16x2_t __b) {
|
||||
return __builtin_arm_smusdx(__a, __b);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 9.7 CRC32 intrinsics */
|
||||
#if __ARM_FEATURE_CRC32
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32b(uint32_t __a, uint8_t __b) {
|
||||
return __builtin_arm_crc32b(__a, __b);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32h(uint32_t __a, uint16_t __b) {
|
||||
return __builtin_arm_crc32h(__a, __b);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32w(uint32_t __a, uint32_t __b) {
|
||||
return __builtin_arm_crc32w(__a, __b);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32d(uint32_t __a, uint64_t __b) {
|
||||
return __builtin_arm_crc32d(__a, __b);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32cb(uint32_t __a, uint8_t __b) {
|
||||
return __builtin_arm_crc32cb(__a, __b);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32ch(uint32_t __a, uint16_t __b) {
|
||||
return __builtin_arm_crc32ch(__a, __b);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32cw(uint32_t __a, uint32_t __b) {
|
||||
return __builtin_arm_crc32cw(__a, __b);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32cd(uint32_t __a, uint64_t __b) {
|
||||
return __builtin_arm_crc32cd(__a, __b);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 10.1 Special register intrinsics */
|
||||
#define __arm_rsr(sysreg) __builtin_arm_rsr(sysreg)
|
||||
#define __arm_rsr64(sysreg) __builtin_arm_rsr64(sysreg)
|
||||
#define __arm_rsrp(sysreg) __builtin_arm_rsrp(sysreg)
|
||||
#define __arm_wsr(sysreg, v) __builtin_arm_wsr(sysreg, v)
|
||||
#define __arm_wsr64(sysreg, v) __builtin_arm_wsr64(sysreg, v)
|
||||
#define __arm_wsrp(sysreg, v) __builtin_arm_wsrp(sysreg, v)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ARM_ACLE_H */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,45 +0,0 @@
|
||||
/*===---- armintr.h - ARM Windows intrinsics -------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
/* Only include this if we're compiling for the windows platform. */
|
||||
#ifndef _MSC_VER
|
||||
#include_next <armintr.h>
|
||||
#else
|
||||
|
||||
#ifndef __ARMINTR_H
|
||||
#define __ARMINTR_H
|
||||
|
||||
typedef enum
|
||||
{
|
||||
_ARM_BARRIER_SY = 0xF,
|
||||
_ARM_BARRIER_ST = 0xE,
|
||||
_ARM_BARRIER_ISH = 0xB,
|
||||
_ARM_BARRIER_ISHST = 0xA,
|
||||
_ARM_BARRIER_NSH = 0x7,
|
||||
_ARM_BARRIER_NSHST = 0x6,
|
||||
_ARM_BARRIER_OSH = 0x3,
|
||||
_ARM_BARRIER_OSHST = 0x2
|
||||
} _ARMINTR_BARRIER_TYPE;
|
||||
|
||||
#endif /* __ARMINTR_H */
|
||||
#endif /* _MSC_VER */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,97 +0,0 @@
|
||||
/*===------------- avx512bitalgintrin.h - BITALG intrinsics ------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512bitalgintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __AVX512BITALGINTRIN_H
|
||||
#define __AVX512BITALGINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512bitalg"), __min_vector_width__(512)))
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_popcnt_epi16(__m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpopcntw_512((__v32hi) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_popcnt_epi16(__m512i __A, __mmask32 __U, __m512i __B)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_selectw_512((__mmask32) __U,
|
||||
(__v32hi) _mm512_popcnt_epi16(__B),
|
||||
(__v32hi) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_popcnt_epi16(__mmask32 __U, __m512i __B)
|
||||
{
|
||||
return _mm512_mask_popcnt_epi16((__m512i) _mm512_setzero_si512(),
|
||||
__U,
|
||||
__B);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_popcnt_epi8(__m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpopcntb_512((__v64qi) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_popcnt_epi8(__m512i __A, __mmask64 __U, __m512i __B)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_selectb_512((__mmask64) __U,
|
||||
(__v64qi) _mm512_popcnt_epi8(__B),
|
||||
(__v64qi) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_popcnt_epi8(__mmask64 __U, __m512i __B)
|
||||
{
|
||||
return _mm512_mask_popcnt_epi8((__m512i) _mm512_setzero_si512(),
|
||||
__U,
|
||||
__B);
|
||||
}
|
||||
|
||||
static __inline__ __mmask64 __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_bitshuffle_epi64_mask(__mmask64 __U, __m512i __A, __m512i __B)
|
||||
{
|
||||
return (__mmask64) __builtin_ia32_vpshufbitqmb512_mask((__v64qi) __A,
|
||||
(__v64qi) __B,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __mmask64 __DEFAULT_FN_ATTRS
|
||||
_mm512_bitshuffle_epi64_mask(__m512i __A, __m512i __B)
|
||||
{
|
||||
return _mm512_mask_bitshuffle_epi64_mask((__mmask64) -1,
|
||||
__A,
|
||||
__B);
|
||||
}
|
||||
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,141 +0,0 @@
|
||||
/*===------------- avx512cdintrin.h - AVX512CD intrinsics ------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512cdintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __AVX512CDINTRIN_H
|
||||
#define __AVX512CDINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512cd"), __min_vector_width__(512)))
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_conflict_epi64 (__m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A,
|
||||
(__v8di) _mm512_setzero_si512 (),
|
||||
(__mmask8) -1);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_conflict_epi64 (__m512i __W, __mmask8 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A,
|
||||
(__v8di) __W,
|
||||
(__mmask8) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_conflict_epi64 (__mmask8 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A,
|
||||
(__v8di) _mm512_setzero_si512 (),
|
||||
(__mmask8) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_conflict_epi32 (__m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A,
|
||||
(__v16si) _mm512_setzero_si512 (),
|
||||
(__mmask16) -1);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_conflict_epi32 (__m512i __W, __mmask16 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A,
|
||||
(__v16si) __W,
|
||||
(__mmask16) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_conflict_epi32 (__mmask16 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A,
|
||||
(__v16si) _mm512_setzero_si512 (),
|
||||
(__mmask16) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_lzcnt_epi32 (__m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vplzcntd_512 ((__v16si) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_lzcnt_epi32 (__m512i __W, __mmask16 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
|
||||
(__v16si)_mm512_lzcnt_epi32(__A),
|
||||
(__v16si)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_lzcnt_epi32 (__mmask16 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U,
|
||||
(__v16si)_mm512_lzcnt_epi32(__A),
|
||||
(__v16si)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_lzcnt_epi64 (__m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vplzcntq_512 ((__v8di) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_lzcnt_epi64 (__m512i __W, __mmask8 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
|
||||
(__v8di)_mm512_lzcnt_epi64(__A),
|
||||
(__v8di)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_lzcnt_epi64 (__mmask8 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U,
|
||||
(__v8di)_mm512_lzcnt_epi64(__A),
|
||||
(__v8di)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_broadcastmb_epi64 (__mmask8 __A)
|
||||
{
|
||||
return (__m512i) _mm512_set1_epi64((long long) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_broadcastmw_epi32 (__mmask16 __A)
|
||||
{
|
||||
return (__m512i) _mm512_set1_epi32((int) __A);
|
||||
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,285 +0,0 @@
|
||||
/*===---- avx512erintrin.h - AVX512ER intrinsics ---------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512erintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __AVX512ERINTRIN_H
|
||||
#define __AVX512ERINTRIN_H
|
||||
|
||||
/* exp2a23 */
|
||||
#define _mm512_exp2a23_round_pd(A, R) \
|
||||
(__m512d)__builtin_ia32_exp2pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)_mm512_setzero_pd(), \
|
||||
(__mmask8)-1, (int)(R))
|
||||
|
||||
#define _mm512_mask_exp2a23_round_pd(S, M, A, R) \
|
||||
(__m512d)__builtin_ia32_exp2pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)(__m512d)(S), (__mmask8)(M), \
|
||||
(int)(R))
|
||||
|
||||
#define _mm512_maskz_exp2a23_round_pd(M, A, R) \
|
||||
(__m512d)__builtin_ia32_exp2pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)_mm512_setzero_pd(), \
|
||||
(__mmask8)(M), (int)(R))
|
||||
|
||||
#define _mm512_exp2a23_pd(A) \
|
||||
_mm512_exp2a23_round_pd((A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_mask_exp2a23_pd(S, M, A) \
|
||||
_mm512_mask_exp2a23_round_pd((S), (M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_maskz_exp2a23_pd(M, A) \
|
||||
_mm512_maskz_exp2a23_round_pd((M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_exp2a23_round_ps(A, R) \
|
||||
(__m512)__builtin_ia32_exp2ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)_mm512_setzero_ps(), \
|
||||
(__mmask16)-1, (int)(R))
|
||||
|
||||
#define _mm512_mask_exp2a23_round_ps(S, M, A, R) \
|
||||
(__m512)__builtin_ia32_exp2ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)(__m512)(S), (__mmask16)(M), \
|
||||
(int)(R))
|
||||
|
||||
#define _mm512_maskz_exp2a23_round_ps(M, A, R) \
|
||||
(__m512)__builtin_ia32_exp2ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)_mm512_setzero_ps(), \
|
||||
(__mmask16)(M), (int)(R))
|
||||
|
||||
#define _mm512_exp2a23_ps(A) \
|
||||
_mm512_exp2a23_round_ps((A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_mask_exp2a23_ps(S, M, A) \
|
||||
_mm512_mask_exp2a23_round_ps((S), (M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_maskz_exp2a23_ps(M, A) \
|
||||
_mm512_maskz_exp2a23_round_ps((M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
/* rsqrt28 */
|
||||
#define _mm512_rsqrt28_round_pd(A, R) \
|
||||
(__m512d)__builtin_ia32_rsqrt28pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)_mm512_setzero_pd(), \
|
||||
(__mmask8)-1, (int)(R))
|
||||
|
||||
#define _mm512_mask_rsqrt28_round_pd(S, M, A, R) \
|
||||
(__m512d)__builtin_ia32_rsqrt28pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)(__m512d)(S), (__mmask8)(M), \
|
||||
(int)(R))
|
||||
|
||||
#define _mm512_maskz_rsqrt28_round_pd(M, A, R) \
|
||||
(__m512d)__builtin_ia32_rsqrt28pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)_mm512_setzero_pd(), \
|
||||
(__mmask8)(M), (int)(R))
|
||||
|
||||
#define _mm512_rsqrt28_pd(A) \
|
||||
_mm512_rsqrt28_round_pd((A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_mask_rsqrt28_pd(S, M, A) \
|
||||
_mm512_mask_rsqrt28_round_pd((S), (M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_maskz_rsqrt28_pd(M, A) \
|
||||
_mm512_maskz_rsqrt28_round_pd((M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_rsqrt28_round_ps(A, R) \
|
||||
(__m512)__builtin_ia32_rsqrt28ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)_mm512_setzero_ps(), \
|
||||
(__mmask16)-1, (int)(R))
|
||||
|
||||
#define _mm512_mask_rsqrt28_round_ps(S, M, A, R) \
|
||||
(__m512)__builtin_ia32_rsqrt28ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)(__m512)(S), (__mmask16)(M), \
|
||||
(int)(R))
|
||||
|
||||
#define _mm512_maskz_rsqrt28_round_ps(M, A, R) \
|
||||
(__m512)__builtin_ia32_rsqrt28ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)_mm512_setzero_ps(), \
|
||||
(__mmask16)(M), (int)(R))
|
||||
|
||||
#define _mm512_rsqrt28_ps(A) \
|
||||
_mm512_rsqrt28_round_ps((A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_mask_rsqrt28_ps(S, M, A) \
|
||||
_mm512_mask_rsqrt28_round_ps((S), (M), A, _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_maskz_rsqrt28_ps(M, A) \
|
||||
_mm512_maskz_rsqrt28_round_ps((M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_rsqrt28_round_ss(A, B, R) \
|
||||
(__m128)__builtin_ia32_rsqrt28ss_round_mask((__v4sf)(__m128)(A), \
|
||||
(__v4sf)(__m128)(B), \
|
||||
(__v4sf)_mm_setzero_ps(), \
|
||||
(__mmask8)-1, (int)(R))
|
||||
|
||||
#define _mm_mask_rsqrt28_round_ss(S, M, A, B, R) \
|
||||
(__m128)__builtin_ia32_rsqrt28ss_round_mask((__v4sf)(__m128)(A), \
|
||||
(__v4sf)(__m128)(B), \
|
||||
(__v4sf)(__m128)(S), \
|
||||
(__mmask8)(M), (int)(R))
|
||||
|
||||
#define _mm_maskz_rsqrt28_round_ss(M, A, B, R) \
|
||||
(__m128)__builtin_ia32_rsqrt28ss_round_mask((__v4sf)(__m128)(A), \
|
||||
(__v4sf)(__m128)(B), \
|
||||
(__v4sf)_mm_setzero_ps(), \
|
||||
(__mmask8)(M), (int)(R))
|
||||
|
||||
#define _mm_rsqrt28_ss(A, B) \
|
||||
_mm_rsqrt28_round_ss((A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_mask_rsqrt28_ss(S, M, A, B) \
|
||||
_mm_mask_rsqrt28_round_ss((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_maskz_rsqrt28_ss(M, A, B) \
|
||||
_mm_maskz_rsqrt28_round_ss((M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_rsqrt28_round_sd(A, B, R) \
|
||||
(__m128d)__builtin_ia32_rsqrt28sd_round_mask((__v2df)(__m128d)(A), \
|
||||
(__v2df)(__m128d)(B), \
|
||||
(__v2df)_mm_setzero_pd(), \
|
||||
(__mmask8)-1, (int)(R))
|
||||
|
||||
#define _mm_mask_rsqrt28_round_sd(S, M, A, B, R) \
|
||||
(__m128d)__builtin_ia32_rsqrt28sd_round_mask((__v2df)(__m128d)(A), \
|
||||
(__v2df)(__m128d)(B), \
|
||||
(__v2df)(__m128d)(S), \
|
||||
(__mmask8)(M), (int)(R))
|
||||
|
||||
#define _mm_maskz_rsqrt28_round_sd(M, A, B, R) \
|
||||
(__m128d)__builtin_ia32_rsqrt28sd_round_mask((__v2df)(__m128d)(A), \
|
||||
(__v2df)(__m128d)(B), \
|
||||
(__v2df)_mm_setzero_pd(), \
|
||||
(__mmask8)(M), (int)(R))
|
||||
|
||||
#define _mm_rsqrt28_sd(A, B) \
|
||||
_mm_rsqrt28_round_sd((A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_mask_rsqrt28_sd(S, M, A, B) \
|
||||
_mm_mask_rsqrt28_round_sd((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_maskz_rsqrt28_sd(M, A, B) \
|
||||
_mm_maskz_rsqrt28_round_sd((M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
/* rcp28 */
|
||||
#define _mm512_rcp28_round_pd(A, R) \
|
||||
(__m512d)__builtin_ia32_rcp28pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)_mm512_setzero_pd(), \
|
||||
(__mmask8)-1, (int)(R))
|
||||
|
||||
#define _mm512_mask_rcp28_round_pd(S, M, A, R) \
|
||||
(__m512d)__builtin_ia32_rcp28pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)(__m512d)(S), (__mmask8)(M), \
|
||||
(int)(R))
|
||||
|
||||
#define _mm512_maskz_rcp28_round_pd(M, A, R) \
|
||||
(__m512d)__builtin_ia32_rcp28pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)_mm512_setzero_pd(), \
|
||||
(__mmask8)(M), (int)(R))
|
||||
|
||||
#define _mm512_rcp28_pd(A) \
|
||||
_mm512_rcp28_round_pd((A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_mask_rcp28_pd(S, M, A) \
|
||||
_mm512_mask_rcp28_round_pd((S), (M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_maskz_rcp28_pd(M, A) \
|
||||
_mm512_maskz_rcp28_round_pd((M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_rcp28_round_ps(A, R) \
|
||||
(__m512)__builtin_ia32_rcp28ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)_mm512_setzero_ps(), \
|
||||
(__mmask16)-1, (int)(R))
|
||||
|
||||
#define _mm512_mask_rcp28_round_ps(S, M, A, R) \
|
||||
(__m512)__builtin_ia32_rcp28ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)(__m512)(S), (__mmask16)(M), \
|
||||
(int)(R))
|
||||
|
||||
#define _mm512_maskz_rcp28_round_ps(M, A, R) \
|
||||
(__m512)__builtin_ia32_rcp28ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)_mm512_setzero_ps(), \
|
||||
(__mmask16)(M), (int)(R))
|
||||
|
||||
#define _mm512_rcp28_ps(A) \
|
||||
_mm512_rcp28_round_ps((A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_mask_rcp28_ps(S, M, A) \
|
||||
_mm512_mask_rcp28_round_ps((S), (M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_maskz_rcp28_ps(M, A) \
|
||||
_mm512_maskz_rcp28_round_ps((M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_rcp28_round_ss(A, B, R) \
|
||||
(__m128)__builtin_ia32_rcp28ss_round_mask((__v4sf)(__m128)(A), \
|
||||
(__v4sf)(__m128)(B), \
|
||||
(__v4sf)_mm_setzero_ps(), \
|
||||
(__mmask8)-1, (int)(R))
|
||||
|
||||
#define _mm_mask_rcp28_round_ss(S, M, A, B, R) \
|
||||
(__m128)__builtin_ia32_rcp28ss_round_mask((__v4sf)(__m128)(A), \
|
||||
(__v4sf)(__m128)(B), \
|
||||
(__v4sf)(__m128)(S), \
|
||||
(__mmask8)(M), (int)(R))
|
||||
|
||||
#define _mm_maskz_rcp28_round_ss(M, A, B, R) \
|
||||
(__m128)__builtin_ia32_rcp28ss_round_mask((__v4sf)(__m128)(A), \
|
||||
(__v4sf)(__m128)(B), \
|
||||
(__v4sf)_mm_setzero_ps(), \
|
||||
(__mmask8)(M), (int)(R))
|
||||
|
||||
#define _mm_rcp28_ss(A, B) \
|
||||
_mm_rcp28_round_ss((A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_mask_rcp28_ss(S, M, A, B) \
|
||||
_mm_mask_rcp28_round_ss((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_maskz_rcp28_ss(M, A, B) \
|
||||
_mm_maskz_rcp28_round_ss((M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_rcp28_round_sd(A, B, R) \
|
||||
(__m128d)__builtin_ia32_rcp28sd_round_mask((__v2df)(__m128d)(A), \
|
||||
(__v2df)(__m128d)(B), \
|
||||
(__v2df)_mm_setzero_pd(), \
|
||||
(__mmask8)-1, (int)(R))
|
||||
|
||||
#define _mm_mask_rcp28_round_sd(S, M, A, B, R) \
|
||||
(__m128d)__builtin_ia32_rcp28sd_round_mask((__v2df)(__m128d)(A), \
|
||||
(__v2df)(__m128d)(B), \
|
||||
(__v2df)(__m128d)(S), \
|
||||
(__mmask8)(M), (int)(R))
|
||||
|
||||
#define _mm_maskz_rcp28_round_sd(M, A, B, R) \
|
||||
(__m128d)__builtin_ia32_rcp28sd_round_mask((__v2df)(__m128d)(A), \
|
||||
(__v2df)(__m128d)(B), \
|
||||
(__v2df)_mm_setzero_pd(), \
|
||||
(__mmask8)(M), (int)(R))
|
||||
|
||||
#define _mm_rcp28_sd(A, B) \
|
||||
_mm_rcp28_round_sd((A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_mask_rcp28_sd(S, M, A, B) \
|
||||
_mm_mask_rcp28_round_sd((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_maskz_rcp28_sd(M, A, B) \
|
||||
_mm_maskz_rcp28_round_sd((M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#endif /* __AVX512ERINTRIN_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,82 +0,0 @@
|
||||
/*===------------- avx512ifmaintrin.h - IFMA intrinsics ------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512ifmaintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __IFMAINTRIN_H
|
||||
#define __IFMAINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512ifma"), __min_vector_width__(512)))
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_madd52hi_epu64 (__m512i __X, __m512i __Y, __m512i __Z)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_vpmadd52huq512((__v8di) __X, (__v8di) __Y,
|
||||
(__v8di) __Z);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_madd52hi_epu64 (__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectq_512(__M,
|
||||
(__v8di)_mm512_madd52hi_epu64(__W, __X, __Y),
|
||||
(__v8di)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_madd52hi_epu64 (__mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectq_512(__M,
|
||||
(__v8di)_mm512_madd52hi_epu64(__X, __Y, __Z),
|
||||
(__v8di)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_madd52lo_epu64 (__m512i __X, __m512i __Y, __m512i __Z)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_vpmadd52luq512((__v8di) __X, (__v8di) __Y,
|
||||
(__v8di) __Z);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_madd52lo_epu64 (__m512i __W, __mmask8 __M, __m512i __X, __m512i __Y)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectq_512(__M,
|
||||
(__v8di)_mm512_madd52lo_epu64(__W, __X, __Y),
|
||||
(__v8di)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_madd52lo_epu64 (__mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectq_512(__M,
|
||||
(__v8di)_mm512_madd52lo_epu64(__X, __Y, __Z),
|
||||
(__v8di)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
@@ -1,133 +0,0 @@
|
||||
/*===------------- avx512ifmavlintrin.h - IFMA intrinsics ------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512ifmavlintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __IFMAVLINTRIN_H
|
||||
#define __IFMAVLINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512ifma,avx512vl"), __min_vector_width__(128)))
|
||||
#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("avx512ifma,avx512vl"), __min_vector_width__(256)))
|
||||
|
||||
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_madd52hi_epu64 (__m128i __X, __m128i __Y, __m128i __Z)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_vpmadd52huq128((__v2di) __X, (__v2di) __Y,
|
||||
(__v2di) __Z);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_madd52hi_epu64 (__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectq_128(__M,
|
||||
(__v2di)_mm_madd52hi_epu64(__W, __X, __Y),
|
||||
(__v2di)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_madd52hi_epu64 (__mmask8 __M, __m128i __X, __m128i __Y, __m128i __Z)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectq_128(__M,
|
||||
(__v2di)_mm_madd52hi_epu64(__X, __Y, __Z),
|
||||
(__v2di)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_madd52hi_epu64 (__m256i __X, __m256i __Y, __m256i __Z)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_vpmadd52huq256((__v4di)__X, (__v4di)__Y,
|
||||
(__v4di)__Z);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_madd52hi_epu64 (__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectq_256(__M,
|
||||
(__v4di)_mm256_madd52hi_epu64(__W, __X, __Y),
|
||||
(__v4di)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_madd52hi_epu64 (__mmask8 __M, __m256i __X, __m256i __Y, __m256i __Z)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectq_256(__M,
|
||||
(__v4di)_mm256_madd52hi_epu64(__X, __Y, __Z),
|
||||
(__v4di)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_madd52lo_epu64 (__m128i __X, __m128i __Y, __m128i __Z)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_vpmadd52luq128((__v2di)__X, (__v2di)__Y,
|
||||
(__v2di)__Z);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_madd52lo_epu64 (__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectq_128(__M,
|
||||
(__v2di)_mm_madd52lo_epu64(__W, __X, __Y),
|
||||
(__v2di)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_madd52lo_epu64 (__mmask8 __M, __m128i __X, __m128i __Y, __m128i __Z)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectq_128(__M,
|
||||
(__v2di)_mm_madd52lo_epu64(__X, __Y, __Z),
|
||||
(__v2di)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_madd52lo_epu64 (__m256i __X, __m256i __Y, __m256i __Z)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_vpmadd52luq256((__v4di)__X, (__v4di)__Y,
|
||||
(__v4di)__Z);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_madd52lo_epu64 (__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectq_256(__M,
|
||||
(__v4di)_mm256_madd52lo_epu64(__W, __X, __Y),
|
||||
(__v4di)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_madd52lo_epu64 (__mmask8 __M, __m256i __X, __m256i __Y, __m256i __Z)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectq_256(__M,
|
||||
(__v4di)_mm256_madd52lo_epu64(__X, __Y, __Z),
|
||||
(__v4di)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS128
|
||||
#undef __DEFAULT_FN_ATTRS256
|
||||
|
||||
#endif
|
||||
@@ -1,111 +0,0 @@
|
||||
/*===------------- avx512pfintrin.h - PF intrinsics ------------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512pfintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __AVX512PFINTRIN_H
|
||||
#define __AVX512PFINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512pf")))
|
||||
|
||||
#define _mm512_mask_prefetch_i32gather_pd(index, mask, addr, scale, hint) \
|
||||
__builtin_ia32_gatherpfdpd((__mmask8)(mask), (__v8si)(__m256i)(index), \
|
||||
(void const *)(addr), (int)(scale), \
|
||||
(int)(hint))
|
||||
|
||||
#define _mm512_prefetch_i32gather_pd(index, addr, scale, hint) \
|
||||
__builtin_ia32_gatherpfdpd((__mmask8) -1, (__v8si)(__m256i)(index), \
|
||||
(void const *)(addr), (int)(scale), \
|
||||
(int)(hint))
|
||||
|
||||
#define _mm512_mask_prefetch_i32gather_ps(index, mask, addr, scale, hint) \
|
||||
__builtin_ia32_gatherpfdps((__mmask16)(mask), \
|
||||
(__v16si)(__m512i)(index), (void const *)(addr), \
|
||||
(int)(scale), (int)(hint))
|
||||
|
||||
#define _mm512_prefetch_i32gather_ps(index, addr, scale, hint) \
|
||||
__builtin_ia32_gatherpfdps((__mmask16) -1, \
|
||||
(__v16si)(__m512i)(index), (void const *)(addr), \
|
||||
(int)(scale), (int)(hint))
|
||||
|
||||
#define _mm512_mask_prefetch_i64gather_pd(index, mask, addr, scale, hint) \
|
||||
__builtin_ia32_gatherpfqpd((__mmask8)(mask), (__v8di)(__m512i)(index), \
|
||||
(void const *)(addr), (int)(scale), \
|
||||
(int)(hint))
|
||||
|
||||
#define _mm512_prefetch_i64gather_pd(index, addr, scale, hint) \
|
||||
__builtin_ia32_gatherpfqpd((__mmask8) -1, (__v8di)(__m512i)(index), \
|
||||
(void const *)(addr), (int)(scale), \
|
||||
(int)(hint))
|
||||
|
||||
#define _mm512_mask_prefetch_i64gather_ps(index, mask, addr, scale, hint) \
|
||||
__builtin_ia32_gatherpfqps((__mmask8)(mask), (__v8di)(__m512i)(index), \
|
||||
(void const *)(addr), (int)(scale), (int)(hint))
|
||||
|
||||
#define _mm512_prefetch_i64gather_ps(index, addr, scale, hint) \
|
||||
__builtin_ia32_gatherpfqps((__mmask8) -1, (__v8di)(__m512i)(index), \
|
||||
(void const *)(addr), (int)(scale), (int)(hint))
|
||||
|
||||
#define _mm512_prefetch_i32scatter_pd(addr, index, scale, hint) \
|
||||
__builtin_ia32_scatterpfdpd((__mmask8)-1, (__v8si)(__m256i)(index), \
|
||||
(void *)(addr), (int)(scale), \
|
||||
(int)(hint))
|
||||
|
||||
#define _mm512_mask_prefetch_i32scatter_pd(addr, mask, index, scale, hint) \
|
||||
__builtin_ia32_scatterpfdpd((__mmask8)(mask), (__v8si)(__m256i)(index), \
|
||||
(void *)(addr), (int)(scale), \
|
||||
(int)(hint))
|
||||
|
||||
#define _mm512_prefetch_i32scatter_ps(addr, index, scale, hint) \
|
||||
__builtin_ia32_scatterpfdps((__mmask16)-1, (__v16si)(__m512i)(index), \
|
||||
(void *)(addr), (int)(scale), (int)(hint))
|
||||
|
||||
#define _mm512_mask_prefetch_i32scatter_ps(addr, mask, index, scale, hint) \
|
||||
__builtin_ia32_scatterpfdps((__mmask16)(mask), \
|
||||
(__v16si)(__m512i)(index), (void *)(addr), \
|
||||
(int)(scale), (int)(hint))
|
||||
|
||||
#define _mm512_prefetch_i64scatter_pd(addr, index, scale, hint) \
|
||||
__builtin_ia32_scatterpfqpd((__mmask8)-1, (__v8di)(__m512i)(index), \
|
||||
(void *)(addr), (int)(scale), \
|
||||
(int)(hint))
|
||||
|
||||
#define _mm512_mask_prefetch_i64scatter_pd(addr, mask, index, scale, hint) \
|
||||
__builtin_ia32_scatterpfqpd((__mmask8)(mask), (__v8di)(__m512i)(index), \
|
||||
(void *)(addr), (int)(scale), \
|
||||
(int)(hint))
|
||||
|
||||
#define _mm512_prefetch_i64scatter_ps(addr, index, scale, hint) \
|
||||
__builtin_ia32_scatterpfqps((__mmask8)-1, (__v8di)(__m512i)(index), \
|
||||
(void *)(addr), (int)(scale), (int)(hint))
|
||||
|
||||
#define _mm512_mask_prefetch_i64scatter_ps(addr, mask, index, scale, hint) \
|
||||
__builtin_ia32_scatterpfqps((__mmask8)(mask), (__v8di)(__m512i)(index), \
|
||||
(void *)(addr), (int)(scale), (int)(hint))
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
@@ -1,371 +0,0 @@
|
||||
/*===------------- avx512vbmi2intrin.h - VBMI2 intrinsics ------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512vbmi2intrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __AVX512VBMI2INTRIN_H
|
||||
#define __AVX512VBMI2INTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi2"), __min_vector_width__(512)))
|
||||
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_compress_epi16(__m512i __S, __mmask32 __U, __m512i __D)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_compresshi512_mask ((__v32hi) __D,
|
||||
(__v32hi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_compress_epi16(__mmask32 __U, __m512i __D)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_compresshi512_mask ((__v32hi) __D,
|
||||
(__v32hi) _mm512_setzero_si512(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_compress_epi8(__m512i __S, __mmask64 __U, __m512i __D)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_compressqi512_mask ((__v64qi) __D,
|
||||
(__v64qi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_compress_epi8(__mmask64 __U, __m512i __D)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_compressqi512_mask ((__v64qi) __D,
|
||||
(__v64qi) _mm512_setzero_si512(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_compressstoreu_epi16(void *__P, __mmask32 __U, __m512i __D)
|
||||
{
|
||||
__builtin_ia32_compressstorehi512_mask ((__v32hi *) __P, (__v32hi) __D,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_compressstoreu_epi8(void *__P, __mmask64 __U, __m512i __D)
|
||||
{
|
||||
__builtin_ia32_compressstoreqi512_mask ((__v64qi *) __P, (__v64qi) __D,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_expand_epi16(__m512i __S, __mmask32 __U, __m512i __D)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_expandhi512_mask ((__v32hi) __D,
|
||||
(__v32hi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_expand_epi16(__mmask32 __U, __m512i __D)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_expandhi512_mask ((__v32hi) __D,
|
||||
(__v32hi) _mm512_setzero_si512(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_expand_epi8(__m512i __S, __mmask64 __U, __m512i __D)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_expandqi512_mask ((__v64qi) __D,
|
||||
(__v64qi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_expand_epi8(__mmask64 __U, __m512i __D)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_expandqi512_mask ((__v64qi) __D,
|
||||
(__v64qi) _mm512_setzero_si512(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_expandloadu_epi16(__m512i __S, __mmask32 __U, void const *__P)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_expandloadhi512_mask ((const __v32hi *)__P,
|
||||
(__v32hi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_expandloadu_epi16(__mmask32 __U, void const *__P)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_expandloadhi512_mask ((const __v32hi *)__P,
|
||||
(__v32hi) _mm512_setzero_si512(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_expandloadu_epi8(__m512i __S, __mmask64 __U, void const *__P)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_expandloadqi512_mask ((const __v64qi *)__P,
|
||||
(__v64qi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_expandloadu_epi8(__mmask64 __U, void const *__P)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_expandloadqi512_mask ((const __v64qi *)__P,
|
||||
(__v64qi) _mm512_setzero_si512(),
|
||||
__U);
|
||||
}
|
||||
|
||||
#define _mm512_shldi_epi64(A, B, I) \
|
||||
(__m512i)__builtin_ia32_vpshldq512((__v8di)(__m512i)(A), \
|
||||
(__v8di)(__m512i)(B), (int)(I))
|
||||
|
||||
#define _mm512_mask_shldi_epi64(S, U, A, B, I) \
|
||||
(__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
|
||||
(__v8di)_mm512_shldi_epi64((A), (B), (I)), \
|
||||
(__v8di)(__m512i)(S))
|
||||
|
||||
#define _mm512_maskz_shldi_epi64(U, A, B, I) \
|
||||
(__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
|
||||
(__v8di)_mm512_shldi_epi64((A), (B), (I)), \
|
||||
(__v8di)_mm512_setzero_si512())
|
||||
|
||||
#define _mm512_shldi_epi32(A, B, I) \
|
||||
(__m512i)__builtin_ia32_vpshldd512((__v16si)(__m512i)(A), \
|
||||
(__v16si)(__m512i)(B), (int)(I))
|
||||
|
||||
#define _mm512_mask_shldi_epi32(S, U, A, B, I) \
|
||||
(__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
|
||||
(__v16si)_mm512_shldi_epi32((A), (B), (I)), \
|
||||
(__v16si)(__m512i)(S))
|
||||
|
||||
#define _mm512_maskz_shldi_epi32(U, A, B, I) \
|
||||
(__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
|
||||
(__v16si)_mm512_shldi_epi32((A), (B), (I)), \
|
||||
(__v16si)_mm512_setzero_si512())
|
||||
|
||||
#define _mm512_shldi_epi16(A, B, I) \
|
||||
(__m512i)__builtin_ia32_vpshldw512((__v32hi)(__m512i)(A), \
|
||||
(__v32hi)(__m512i)(B), (int)(I))
|
||||
|
||||
#define _mm512_mask_shldi_epi16(S, U, A, B, I) \
|
||||
(__m512i)__builtin_ia32_selectw_512((__mmask32)(U), \
|
||||
(__v32hi)_mm512_shldi_epi16((A), (B), (I)), \
|
||||
(__v32hi)(__m512i)(S))
|
||||
|
||||
#define _mm512_maskz_shldi_epi16(U, A, B, I) \
|
||||
(__m512i)__builtin_ia32_selectw_512((__mmask32)(U), \
|
||||
(__v32hi)_mm512_shldi_epi16((A), (B), (I)), \
|
||||
(__v32hi)_mm512_setzero_si512())
|
||||
|
||||
#define _mm512_shrdi_epi64(A, B, I) \
|
||||
(__m512i)__builtin_ia32_vpshrdq512((__v8di)(__m512i)(A), \
|
||||
(__v8di)(__m512i)(B), (int)(I))
|
||||
|
||||
#define _mm512_mask_shrdi_epi64(S, U, A, B, I) \
|
||||
(__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
|
||||
(__v8di)_mm512_shrdi_epi64((A), (B), (I)), \
|
||||
(__v8di)(__m512i)(S))
|
||||
|
||||
#define _mm512_maskz_shrdi_epi64(U, A, B, I) \
|
||||
(__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
|
||||
(__v8di)_mm512_shrdi_epi64((A), (B), (I)), \
|
||||
(__v8di)_mm512_setzero_si512())
|
||||
|
||||
#define _mm512_shrdi_epi32(A, B, I) \
|
||||
(__m512i)__builtin_ia32_vpshrdd512((__v16si)(__m512i)(A), \
|
||||
(__v16si)(__m512i)(B), (int)(I))
|
||||
|
||||
#define _mm512_mask_shrdi_epi32(S, U, A, B, I) \
|
||||
(__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
|
||||
(__v16si)_mm512_shrdi_epi32((A), (B), (I)), \
|
||||
(__v16si)(__m512i)(S))
|
||||
|
||||
#define _mm512_maskz_shrdi_epi32(U, A, B, I) \
|
||||
(__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
|
||||
(__v16si)_mm512_shrdi_epi32((A), (B), (I)), \
|
||||
(__v16si)_mm512_setzero_si512())
|
||||
|
||||
#define _mm512_shrdi_epi16(A, B, I) \
|
||||
(__m512i)__builtin_ia32_vpshrdw512((__v32hi)(__m512i)(A), \
|
||||
(__v32hi)(__m512i)(B), (int)(I))
|
||||
|
||||
#define _mm512_mask_shrdi_epi16(S, U, A, B, I) \
|
||||
(__m512i)__builtin_ia32_selectw_512((__mmask32)(U), \
|
||||
(__v32hi)_mm512_shrdi_epi16((A), (B), (I)), \
|
||||
(__v32hi)(__m512i)(S))
|
||||
|
||||
#define _mm512_maskz_shrdi_epi16(U, A, B, I) \
|
||||
(__m512i)__builtin_ia32_selectw_512((__mmask32)(U), \
|
||||
(__v32hi)_mm512_shrdi_epi16((A), (B), (I)), \
|
||||
(__v32hi)_mm512_setzero_si512())
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_shldv_epi64(__m512i __A, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_vpshldvq512((__v8di)__A, (__v8di)__B,
|
||||
(__v8di)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_shldv_epi64(__m512i __A, __mmask8 __U, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectq_512(__U,
|
||||
(__v8di)_mm512_shldv_epi64(__A, __B, __C),
|
||||
(__v8di)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_shldv_epi64(__mmask8 __U, __m512i __A, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectq_512(__U,
|
||||
(__v8di)_mm512_shldv_epi64(__A, __B, __C),
|
||||
(__v8di)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_shldv_epi32(__m512i __A, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_vpshldvd512((__v16si)__A, (__v16si)__B,
|
||||
(__v16si)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_shldv_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectd_512(__U,
|
||||
(__v16si)_mm512_shldv_epi32(__A, __B, __C),
|
||||
(__v16si)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_shldv_epi32(__mmask16 __U, __m512i __A, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectd_512(__U,
|
||||
(__v16si)_mm512_shldv_epi32(__A, __B, __C),
|
||||
(__v16si)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_shldv_epi16(__m512i __A, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_vpshldvw512((__v32hi)__A, (__v32hi)__B,
|
||||
(__v32hi)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_shldv_epi16(__m512i __A, __mmask32 __U, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectw_512(__U,
|
||||
(__v32hi)_mm512_shldv_epi16(__A, __B, __C),
|
||||
(__v32hi)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_shldv_epi16(__mmask32 __U, __m512i __A, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectw_512(__U,
|
||||
(__v32hi)_mm512_shldv_epi16(__A, __B, __C),
|
||||
(__v32hi)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_shrdv_epi64(__m512i __A, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_vpshrdvq512((__v8di)__A, (__v8di)__B,
|
||||
(__v8di)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_shrdv_epi64(__m512i __A, __mmask8 __U, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectq_512(__U,
|
||||
(__v8di)_mm512_shrdv_epi64(__A, __B, __C),
|
||||
(__v8di)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_shrdv_epi64(__mmask8 __U, __m512i __A, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectq_512(__U,
|
||||
(__v8di)_mm512_shrdv_epi64(__A, __B, __C),
|
||||
(__v8di)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_shrdv_epi32(__m512i __A, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_vpshrdvd512((__v16si)__A, (__v16si)__B,
|
||||
(__v16si)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_shrdv_epi32(__m512i __A, __mmask16 __U, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_selectd_512(__U,
|
||||
(__v16si)_mm512_shrdv_epi32(__A, __B, __C),
|
||||
(__v16si)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_shrdv_epi32(__mmask16 __U, __m512i __A, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_selectd_512(__U,
|
||||
(__v16si)_mm512_shrdv_epi32(__A, __B, __C),
|
||||
(__v16si)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_shrdv_epi16(__m512i __A, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_vpshrdvw512((__v32hi)__A, (__v32hi)__B,
|
||||
(__v32hi)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_shrdv_epi16(__m512i __A, __mmask32 __U, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectw_512(__U,
|
||||
(__v32hi)_mm512_shrdv_epi16(__A, __B, __C),
|
||||
(__v32hi)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_shrdv_epi16(__mmask32 __U, __m512i __A, __m512i __B, __m512i __C)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectw_512(__U,
|
||||
(__v32hi)_mm512_shrdv_epi16(__A, __B, __C),
|
||||
(__v32hi)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
/*===------------- avx512vbmiintrin.h - VBMI intrinsics ------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512vbmiintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __VBMIINTRIN_H
|
||||
#define __VBMIINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi"), __min_vector_width__(512)))
|
||||
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_permutex2var_epi8(__m512i __A, __m512i __I, __m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_vpermi2varqi512((__v64qi)__A, (__v64qi)__I,
|
||||
(__v64qi) __B);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_permutex2var_epi8(__m512i __A, __mmask64 __U, __m512i __I,
|
||||
__m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectb_512(__U,
|
||||
(__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),
|
||||
(__v64qi)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask2_permutex2var_epi8(__m512i __A, __m512i __I, __mmask64 __U,
|
||||
__m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectb_512(__U,
|
||||
(__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),
|
||||
(__v64qi)__I);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_permutex2var_epi8(__mmask64 __U, __m512i __A, __m512i __I,
|
||||
__m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectb_512(__U,
|
||||
(__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),
|
||||
(__v64qi)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_permutexvar_epi8 (__m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_permvarqi512((__v64qi) __B, (__v64qi) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_permutexvar_epi8 (__mmask64 __M, __m512i __A,
|
||||
__m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
|
||||
(__v64qi)_mm512_permutexvar_epi8(__A, __B),
|
||||
(__v64qi)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_permutexvar_epi8 (__m512i __W, __mmask64 __M, __m512i __A,
|
||||
__m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
|
||||
(__v64qi)_mm512_permutexvar_epi8(__A, __B),
|
||||
(__v64qi)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_multishift_epi64_epi8(__m512i __X, __m512i __Y)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_vpmultishiftqb512((__v64qi)__X, (__v64qi) __Y);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_multishift_epi64_epi8(__m512i __W, __mmask64 __M, __m512i __X,
|
||||
__m512i __Y)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
|
||||
(__v64qi)_mm512_multishift_epi64_epi8(__X, __Y),
|
||||
(__v64qi)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_multishift_epi64_epi8(__mmask64 __M, __m512i __X, __m512i __Y)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
|
||||
(__v64qi)_mm512_multishift_epi64_epi8(__X, __Y),
|
||||
(__v64qi)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
@@ -1,202 +0,0 @@
|
||||
/*===------------- avx512vbmivlintrin.h - VBMI intrinsics ------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512vbmivlintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __VBMIVLINTRIN_H
|
||||
#define __VBMIVLINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi,avx512vl"), __min_vector_width__(128)))
|
||||
#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi,avx512vl"), __min_vector_width__(256)))
|
||||
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_permutex2var_epi8(__m128i __A, __m128i __I, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_vpermi2varqi128((__v16qi)__A,
|
||||
(__v16qi)__I,
|
||||
(__v16qi)__B);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_permutex2var_epi8(__m128i __A, __mmask16 __U, __m128i __I,
|
||||
__m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectb_128(__U,
|
||||
(__v16qi)_mm_permutex2var_epi8(__A, __I, __B),
|
||||
(__v16qi)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask2_permutex2var_epi8(__m128i __A, __m128i __I, __mmask16 __U,
|
||||
__m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectb_128(__U,
|
||||
(__v16qi)_mm_permutex2var_epi8(__A, __I, __B),
|
||||
(__v16qi)__I);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_permutex2var_epi8(__mmask16 __U, __m128i __A, __m128i __I,
|
||||
__m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectb_128(__U,
|
||||
(__v16qi)_mm_permutex2var_epi8(__A, __I, __B),
|
||||
(__v16qi)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_permutex2var_epi8(__m256i __A, __m256i __I, __m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_vpermi2varqi256((__v32qi)__A, (__v32qi)__I,
|
||||
(__v32qi)__B);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_permutex2var_epi8(__m256i __A, __mmask32 __U, __m256i __I,
|
||||
__m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectb_256(__U,
|
||||
(__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),
|
||||
(__v32qi)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask2_permutex2var_epi8(__m256i __A, __m256i __I, __mmask32 __U,
|
||||
__m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectb_256(__U,
|
||||
(__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),
|
||||
(__v32qi)__I);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_permutex2var_epi8(__mmask32 __U, __m256i __A, __m256i __I,
|
||||
__m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectb_256(__U,
|
||||
(__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),
|
||||
(__v32qi)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_permutexvar_epi8 (__m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_permvarqi128((__v16qi)__B, (__v16qi)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_permutexvar_epi8 (__mmask16 __M, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
|
||||
(__v16qi)_mm_permutexvar_epi8(__A, __B),
|
||||
(__v16qi)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_permutexvar_epi8 (__m128i __W, __mmask16 __M, __m128i __A,
|
||||
__m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
|
||||
(__v16qi)_mm_permutexvar_epi8(__A, __B),
|
||||
(__v16qi)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_permutexvar_epi8 (__m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_permvarqi256((__v32qi) __B, (__v32qi) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_permutexvar_epi8 (__mmask32 __M, __m256i __A,
|
||||
__m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
|
||||
(__v32qi)_mm256_permutexvar_epi8(__A, __B),
|
||||
(__v32qi)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_permutexvar_epi8 (__m256i __W, __mmask32 __M, __m256i __A,
|
||||
__m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
|
||||
(__v32qi)_mm256_permutexvar_epi8(__A, __B),
|
||||
(__v32qi)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_multishift_epi64_epi8(__m128i __X, __m128i __Y)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_vpmultishiftqb128((__v16qi)__X, (__v16qi)__Y);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_multishift_epi64_epi8(__m128i __W, __mmask16 __M, __m128i __X,
|
||||
__m128i __Y)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
|
||||
(__v16qi)_mm_multishift_epi64_epi8(__X, __Y),
|
||||
(__v16qi)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_multishift_epi64_epi8(__mmask16 __M, __m128i __X, __m128i __Y)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
|
||||
(__v16qi)_mm_multishift_epi64_epi8(__X, __Y),
|
||||
(__v16qi)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_multishift_epi64_epi8(__m256i __X, __m256i __Y)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_vpmultishiftqb256((__v32qi)__X, (__v32qi)__Y);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_multishift_epi64_epi8(__m256i __W, __mmask32 __M, __m256i __X,
|
||||
__m256i __Y)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
|
||||
(__v32qi)_mm256_multishift_epi64_epi8(__X, __Y),
|
||||
(__v32qi)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_multishift_epi64_epi8(__mmask32 __M, __m256i __X, __m256i __Y)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
|
||||
(__v32qi)_mm256_multishift_epi64_epi8(__X, __Y),
|
||||
(__v32qi)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS128
|
||||
#undef __DEFAULT_FN_ATTRS256
|
||||
|
||||
#endif
|
||||
@@ -1,159 +0,0 @@
|
||||
/*===---- avx512vlbitalgintrin.h - BITALG intrinsics -----------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512vlbitalgintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __AVX512VLBITALGINTRIN_H
|
||||
#define __AVX512VLBITALGINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512bitalg"), __min_vector_width__(128)))
|
||||
#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512bitalg"), __min_vector_width__(256)))
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_popcnt_epi16(__m256i __A)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_vpopcntw_256((__v16hi) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_popcnt_epi16(__m256i __A, __mmask16 __U, __m256i __B)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_selectw_256((__mmask16) __U,
|
||||
(__v16hi) _mm256_popcnt_epi16(__B),
|
||||
(__v16hi) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_popcnt_epi16(__mmask16 __U, __m256i __B)
|
||||
{
|
||||
return _mm256_mask_popcnt_epi16((__m256i) _mm256_setzero_si256(),
|
||||
__U,
|
||||
__B);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_popcnt_epi16(__m128i __A)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_vpopcntw_128((__v8hi) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_popcnt_epi16(__m128i __A, __mmask8 __U, __m128i __B)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_selectw_128((__mmask8) __U,
|
||||
(__v8hi) _mm_popcnt_epi16(__B),
|
||||
(__v8hi) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_popcnt_epi16(__mmask8 __U, __m128i __B)
|
||||
{
|
||||
return _mm_mask_popcnt_epi16((__m128i) _mm_setzero_si128(),
|
||||
__U,
|
||||
__B);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_popcnt_epi8(__m256i __A)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_vpopcntb_256((__v32qi) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_popcnt_epi8(__m256i __A, __mmask32 __U, __m256i __B)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_selectb_256((__mmask32) __U,
|
||||
(__v32qi) _mm256_popcnt_epi8(__B),
|
||||
(__v32qi) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_popcnt_epi8(__mmask32 __U, __m256i __B)
|
||||
{
|
||||
return _mm256_mask_popcnt_epi8((__m256i) _mm256_setzero_si256(),
|
||||
__U,
|
||||
__B);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_popcnt_epi8(__m128i __A)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_vpopcntb_128((__v16qi) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_popcnt_epi8(__m128i __A, __mmask16 __U, __m128i __B)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_selectb_128((__mmask16) __U,
|
||||
(__v16qi) _mm_popcnt_epi8(__B),
|
||||
(__v16qi) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_popcnt_epi8(__mmask16 __U, __m128i __B)
|
||||
{
|
||||
return _mm_mask_popcnt_epi8((__m128i) _mm_setzero_si128(),
|
||||
__U,
|
||||
__B);
|
||||
}
|
||||
|
||||
static __inline__ __mmask32 __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_bitshuffle_epi64_mask(__mmask32 __U, __m256i __A, __m256i __B)
|
||||
{
|
||||
return (__mmask32) __builtin_ia32_vpshufbitqmb256_mask((__v32qi) __A,
|
||||
(__v32qi) __B,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __mmask32 __DEFAULT_FN_ATTRS256
|
||||
_mm256_bitshuffle_epi64_mask(__m256i __A, __m256i __B)
|
||||
{
|
||||
return _mm256_mask_bitshuffle_epi64_mask((__mmask32) -1,
|
||||
__A,
|
||||
__B);
|
||||
}
|
||||
|
||||
static __inline__ __mmask16 __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_bitshuffle_epi64_mask(__mmask16 __U, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__mmask16) __builtin_ia32_vpshufbitqmb128_mask((__v16qi) __A,
|
||||
(__v16qi) __B,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __mmask16 __DEFAULT_FN_ATTRS128
|
||||
_mm_bitshuffle_epi64_mask(__m128i __A, __m128i __B)
|
||||
{
|
||||
return _mm_mask_bitshuffle_epi64_mask((__mmask16) -1,
|
||||
__A,
|
||||
__B);
|
||||
}
|
||||
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS128
|
||||
#undef __DEFAULT_FN_ATTRS256
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,249 +0,0 @@
|
||||
/*===---- avx512vlcdintrin.h - AVX512VL and AVX512CD intrinsics ------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512vlcdintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __AVX512VLCDINTRIN_H
|
||||
#define __AVX512VLCDINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512cd"), __min_vector_width__(128)))
|
||||
#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512cd"), __min_vector_width__(256)))
|
||||
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_broadcastmb_epi64 (__mmask8 __A)
|
||||
{
|
||||
return (__m128i) _mm_set1_epi64x((long long) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_broadcastmb_epi64 (__mmask8 __A)
|
||||
{
|
||||
return (__m256i) _mm256_set1_epi64x((long long)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_broadcastmw_epi32 (__mmask16 __A)
|
||||
{
|
||||
return (__m128i) _mm_set1_epi32((int)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_broadcastmw_epi32 (__mmask16 __A)
|
||||
{
|
||||
return (__m256i) _mm256_set1_epi32((int)__A);
|
||||
}
|
||||
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_conflict_epi64 (__m128i __A)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A,
|
||||
(__v2di) _mm_undefined_si128 (),
|
||||
(__mmask8) -1);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_conflict_epi64 (__m128i __W, __mmask8 __U, __m128i __A)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A,
|
||||
(__v2di) __W,
|
||||
(__mmask8) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_conflict_epi64 (__mmask8 __U, __m128i __A)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A,
|
||||
(__v2di)
|
||||
_mm_setzero_si128 (),
|
||||
(__mmask8) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_conflict_epi64 (__m256i __A)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A,
|
||||
(__v4di) _mm256_undefined_si256 (),
|
||||
(__mmask8) -1);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_conflict_epi64 (__m256i __W, __mmask8 __U, __m256i __A)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A,
|
||||
(__v4di) __W,
|
||||
(__mmask8) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_conflict_epi64 (__mmask8 __U, __m256i __A)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A,
|
||||
(__v4di) _mm256_setzero_si256 (),
|
||||
(__mmask8) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_conflict_epi32 (__m128i __A)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A,
|
||||
(__v4si) _mm_undefined_si128 (),
|
||||
(__mmask8) -1);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_conflict_epi32 (__m128i __W, __mmask8 __U, __m128i __A)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A,
|
||||
(__v4si) __W,
|
||||
(__mmask8) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_conflict_epi32 (__mmask8 __U, __m128i __A)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A,
|
||||
(__v4si) _mm_setzero_si128 (),
|
||||
(__mmask8) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_conflict_epi32 (__m256i __A)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A,
|
||||
(__v8si) _mm256_undefined_si256 (),
|
||||
(__mmask8) -1);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_conflict_epi32 (__m256i __W, __mmask8 __U, __m256i __A)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A,
|
||||
(__v8si) __W,
|
||||
(__mmask8) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_conflict_epi32 (__mmask8 __U, __m256i __A)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A,
|
||||
(__v8si)
|
||||
_mm256_setzero_si256 (),
|
||||
(__mmask8) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_lzcnt_epi32 (__m128i __A)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_vplzcntd_128 ((__v4si) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_lzcnt_epi32 (__m128i __W, __mmask8 __U, __m128i __A)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
|
||||
(__v4si)_mm_lzcnt_epi32(__A),
|
||||
(__v4si)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_lzcnt_epi32 (__mmask8 __U, __m128i __A)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
|
||||
(__v4si)_mm_lzcnt_epi32(__A),
|
||||
(__v4si)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_lzcnt_epi32 (__m256i __A)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_vplzcntd_256 ((__v8si) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_lzcnt_epi32 (__m256i __W, __mmask8 __U, __m256i __A)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
|
||||
(__v8si)_mm256_lzcnt_epi32(__A),
|
||||
(__v8si)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_lzcnt_epi32 (__mmask8 __U, __m256i __A)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
|
||||
(__v8si)_mm256_lzcnt_epi32(__A),
|
||||
(__v8si)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_lzcnt_epi64 (__m128i __A)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_vplzcntq_128 ((__v2di) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_lzcnt_epi64 (__m128i __W, __mmask8 __U, __m128i __A)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
|
||||
(__v2di)_mm_lzcnt_epi64(__A),
|
||||
(__v2di)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_lzcnt_epi64 (__mmask8 __U, __m128i __A)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
|
||||
(__v2di)_mm_lzcnt_epi64(__A),
|
||||
(__v2di)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_lzcnt_epi64 (__m256i __A)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_vplzcntq_256 ((__v4di) __A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_lzcnt_epi64 (__m256i __W, __mmask8 __U, __m256i __A)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
|
||||
(__v4di)_mm256_lzcnt_epi64(__A),
|
||||
(__v4di)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_lzcnt_epi64 (__mmask8 __U, __m256i __A)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
|
||||
(__v4di)_mm256_lzcnt_epi64(__A),
|
||||
(__v4di)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS128
|
||||
#undef __DEFAULT_FN_ATTRS256
|
||||
|
||||
#endif /* __AVX512VLCDINTRIN_H */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,703 +0,0 @@
|
||||
/*===------------- avx512vlvbmi2intrin.h - VBMI2 intrinsics -----------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512vlvbmi2intrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __AVX512VLVBMI2INTRIN_H
|
||||
#define __AVX512VLVBMI2INTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512vbmi2"), __min_vector_width__(128)))
|
||||
#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512vbmi2"), __min_vector_width__(256)))
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_compress_epi16(__m128i __S, __mmask8 __U, __m128i __D)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_compresshi128_mask ((__v8hi) __D,
|
||||
(__v8hi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_compress_epi16(__mmask8 __U, __m128i __D)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_compresshi128_mask ((__v8hi) __D,
|
||||
(__v8hi) _mm_setzero_si128(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_compress_epi8(__m128i __S, __mmask16 __U, __m128i __D)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_compressqi128_mask ((__v16qi) __D,
|
||||
(__v16qi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_compress_epi8(__mmask16 __U, __m128i __D)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_compressqi128_mask ((__v16qi) __D,
|
||||
(__v16qi) _mm_setzero_si128(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_compressstoreu_epi16(void *__P, __mmask8 __U, __m128i __D)
|
||||
{
|
||||
__builtin_ia32_compressstorehi128_mask ((__v8hi *) __P, (__v8hi) __D,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_compressstoreu_epi8(void *__P, __mmask16 __U, __m128i __D)
|
||||
{
|
||||
__builtin_ia32_compressstoreqi128_mask ((__v16qi *) __P, (__v16qi) __D,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_expand_epi16(__m128i __S, __mmask8 __U, __m128i __D)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_expandhi128_mask ((__v8hi) __D,
|
||||
(__v8hi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_expand_epi16(__mmask8 __U, __m128i __D)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_expandhi128_mask ((__v8hi) __D,
|
||||
(__v8hi) _mm_setzero_si128(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_expand_epi8(__m128i __S, __mmask16 __U, __m128i __D)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_expandqi128_mask ((__v16qi) __D,
|
||||
(__v16qi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_expand_epi8(__mmask16 __U, __m128i __D)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_expandqi128_mask ((__v16qi) __D,
|
||||
(__v16qi) _mm_setzero_si128(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_expandloadu_epi16(__m128i __S, __mmask8 __U, void const *__P)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_expandloadhi128_mask ((const __v8hi *)__P,
|
||||
(__v8hi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_expandloadu_epi16(__mmask8 __U, void const *__P)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_expandloadhi128_mask ((const __v8hi *)__P,
|
||||
(__v8hi) _mm_setzero_si128(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_expandloadu_epi8(__m128i __S, __mmask16 __U, void const *__P)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_expandloadqi128_mask ((const __v16qi *)__P,
|
||||
(__v16qi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_expandloadu_epi8(__mmask16 __U, void const *__P)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_expandloadqi128_mask ((const __v16qi *)__P,
|
||||
(__v16qi) _mm_setzero_si128(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_compress_epi16(__m256i __S, __mmask16 __U, __m256i __D)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_compresshi256_mask ((__v16hi) __D,
|
||||
(__v16hi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_compress_epi16(__mmask16 __U, __m256i __D)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_compresshi256_mask ((__v16hi) __D,
|
||||
(__v16hi) _mm256_setzero_si256(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_compress_epi8(__m256i __S, __mmask32 __U, __m256i __D)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_compressqi256_mask ((__v32qi) __D,
|
||||
(__v32qi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_compress_epi8(__mmask32 __U, __m256i __D)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_compressqi256_mask ((__v32qi) __D,
|
||||
(__v32qi) _mm256_setzero_si256(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_compressstoreu_epi16(void *__P, __mmask16 __U, __m256i __D)
|
||||
{
|
||||
__builtin_ia32_compressstorehi256_mask ((__v16hi *) __P, (__v16hi) __D,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_compressstoreu_epi8(void *__P, __mmask32 __U, __m256i __D)
|
||||
{
|
||||
__builtin_ia32_compressstoreqi256_mask ((__v32qi *) __P, (__v32qi) __D,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_expand_epi16(__m256i __S, __mmask16 __U, __m256i __D)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_expandhi256_mask ((__v16hi) __D,
|
||||
(__v16hi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_expand_epi16(__mmask16 __U, __m256i __D)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_expandhi256_mask ((__v16hi) __D,
|
||||
(__v16hi) _mm256_setzero_si256(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_expand_epi8(__m256i __S, __mmask32 __U, __m256i __D)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_expandqi256_mask ((__v32qi) __D,
|
||||
(__v32qi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_expand_epi8(__mmask32 __U, __m256i __D)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_expandqi256_mask ((__v32qi) __D,
|
||||
(__v32qi) _mm256_setzero_si256(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_expandloadu_epi16(__m256i __S, __mmask16 __U, void const *__P)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_expandloadhi256_mask ((const __v16hi *)__P,
|
||||
(__v16hi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_expandloadu_epi16(__mmask16 __U, void const *__P)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_expandloadhi256_mask ((const __v16hi *)__P,
|
||||
(__v16hi) _mm256_setzero_si256(),
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_expandloadu_epi8(__m256i __S, __mmask32 __U, void const *__P)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_expandloadqi256_mask ((const __v32qi *)__P,
|
||||
(__v32qi) __S,
|
||||
__U);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_expandloadu_epi8(__mmask32 __U, void const *__P)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_expandloadqi256_mask ((const __v32qi *)__P,
|
||||
(__v32qi) _mm256_setzero_si256(),
|
||||
__U);
|
||||
}
|
||||
|
||||
#define _mm256_shldi_epi64(A, B, I) \
|
||||
(__m256i)__builtin_ia32_vpshldq256((__v4di)(__m256i)(A), \
|
||||
(__v4di)(__m256i)(B), (int)(I))
|
||||
|
||||
#define _mm256_mask_shldi_epi64(S, U, A, B, I) \
|
||||
(__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \
|
||||
(__v4di)_mm256_shldi_epi64((A), (B), (I)), \
|
||||
(__v4di)(__m256i)(S))
|
||||
|
||||
#define _mm256_maskz_shldi_epi64(U, A, B, I) \
|
||||
(__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \
|
||||
(__v4di)_mm256_shldi_epi64((A), (B), (I)), \
|
||||
(__v4di)_mm256_setzero_si256())
|
||||
|
||||
#define _mm_shldi_epi64(A, B, I) \
|
||||
(__m128i)__builtin_ia32_vpshldq128((__v2di)(__m128i)(A), \
|
||||
(__v2di)(__m128i)(B), (int)(I))
|
||||
|
||||
#define _mm_mask_shldi_epi64(S, U, A, B, I) \
|
||||
(__m128i)__builtin_ia32_selectq_128((__mmask8)(U), \
|
||||
(__v2di)_mm_shldi_epi64((A), (B), (I)), \
|
||||
(__v2di)(__m128i)(S))
|
||||
|
||||
#define _mm_maskz_shldi_epi64(U, A, B, I) \
|
||||
(__m128i)__builtin_ia32_selectq_128((__mmask8)(U), \
|
||||
(__v2di)_mm_shldi_epi64((A), (B), (I)), \
|
||||
(__v2di)_mm_setzero_si128())
|
||||
|
||||
#define _mm256_shldi_epi32(A, B, I) \
|
||||
(__m256i)__builtin_ia32_vpshldd256((__v8si)(__m256i)(A), \
|
||||
(__v8si)(__m256i)(B), (int)(I))
|
||||
|
||||
#define _mm256_mask_shldi_epi32(S, U, A, B, I) \
|
||||
(__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \
|
||||
(__v8si)_mm256_shldi_epi32((A), (B), (I)), \
|
||||
(__v8si)(__m256i)(S))
|
||||
|
||||
#define _mm256_maskz_shldi_epi32(U, A, B, I) \
|
||||
(__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \
|
||||
(__v8si)_mm256_shldi_epi32((A), (B), (I)), \
|
||||
(__v8si)_mm256_setzero_si256())
|
||||
|
||||
#define _mm_shldi_epi32(A, B, I) \
|
||||
(__m128i)__builtin_ia32_vpshldd128((__v4si)(__m128i)(A), \
|
||||
(__v4si)(__m128i)(B), (int)(I))
|
||||
|
||||
#define _mm_mask_shldi_epi32(S, U, A, B, I) \
|
||||
(__m128i)__builtin_ia32_selectd_128((__mmask8)(U), \
|
||||
(__v4si)_mm_shldi_epi32((A), (B), (I)), \
|
||||
(__v4si)(__m128i)(S))
|
||||
|
||||
#define _mm_maskz_shldi_epi32(U, A, B, I) \
|
||||
(__m128i)__builtin_ia32_selectd_128((__mmask8)(U), \
|
||||
(__v4si)_mm_shldi_epi32((A), (B), (I)), \
|
||||
(__v4si)_mm_setzero_si128())
|
||||
|
||||
#define _mm256_shldi_epi16(A, B, I) \
|
||||
(__m256i)__builtin_ia32_vpshldw256((__v16hi)(__m256i)(A), \
|
||||
(__v16hi)(__m256i)(B), (int)(I))
|
||||
|
||||
#define _mm256_mask_shldi_epi16(S, U, A, B, I) \
|
||||
(__m256i)__builtin_ia32_selectw_256((__mmask16)(U), \
|
||||
(__v16hi)_mm256_shldi_epi16((A), (B), (I)), \
|
||||
(__v16hi)(__m256i)(S))
|
||||
|
||||
#define _mm256_maskz_shldi_epi16(U, A, B, I) \
|
||||
(__m256i)__builtin_ia32_selectw_256((__mmask16)(U), \
|
||||
(__v16hi)_mm256_shldi_epi16((A), (B), (I)), \
|
||||
(__v16hi)_mm256_setzero_si256())
|
||||
|
||||
#define _mm_shldi_epi16(A, B, I) \
|
||||
(__m128i)__builtin_ia32_vpshldw128((__v8hi)(__m128i)(A), \
|
||||
(__v8hi)(__m128i)(B), (int)(I))
|
||||
|
||||
#define _mm_mask_shldi_epi16(S, U, A, B, I) \
|
||||
(__m128i)__builtin_ia32_selectw_128((__mmask8)(U), \
|
||||
(__v8hi)_mm_shldi_epi16((A), (B), (I)), \
|
||||
(__v8hi)(__m128i)(S))
|
||||
|
||||
#define _mm_maskz_shldi_epi16(U, A, B, I) \
|
||||
(__m128i)__builtin_ia32_selectw_128((__mmask8)(U), \
|
||||
(__v8hi)_mm_shldi_epi16((A), (B), (I)), \
|
||||
(__v8hi)_mm_setzero_si128())
|
||||
|
||||
#define _mm256_shrdi_epi64(A, B, I) \
|
||||
(__m256i)__builtin_ia32_vpshrdq256((__v4di)(__m256i)(A), \
|
||||
(__v4di)(__m256i)(B), (int)(I))
|
||||
|
||||
#define _mm256_mask_shrdi_epi64(S, U, A, B, I) \
|
||||
(__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \
|
||||
(__v4di)_mm256_shrdi_epi64((A), (B), (I)), \
|
||||
(__v4di)(__m256i)(S))
|
||||
|
||||
#define _mm256_maskz_shrdi_epi64(U, A, B, I) \
|
||||
(__m256i)__builtin_ia32_selectq_256((__mmask8)(U), \
|
||||
(__v4di)_mm256_shrdi_epi64((A), (B), (I)), \
|
||||
(__v4di)_mm256_setzero_si256())
|
||||
|
||||
#define _mm_shrdi_epi64(A, B, I) \
|
||||
(__m128i)__builtin_ia32_vpshrdq128((__v2di)(__m128i)(A), \
|
||||
(__v2di)(__m128i)(B), (int)(I))
|
||||
|
||||
#define _mm_mask_shrdi_epi64(S, U, A, B, I) \
|
||||
(__m128i)__builtin_ia32_selectq_128((__mmask8)(U), \
|
||||
(__v2di)_mm_shrdi_epi64((A), (B), (I)), \
|
||||
(__v2di)(__m128i)(S))
|
||||
|
||||
#define _mm_maskz_shrdi_epi64(U, A, B, I) \
|
||||
(__m128i)__builtin_ia32_selectq_128((__mmask8)(U), \
|
||||
(__v2di)_mm_shrdi_epi64((A), (B), (I)), \
|
||||
(__v2di)_mm_setzero_si128())
|
||||
|
||||
#define _mm256_shrdi_epi32(A, B, I) \
|
||||
(__m256i)__builtin_ia32_vpshrdd256((__v8si)(__m256i)(A), \
|
||||
(__v8si)(__m256i)(B), (int)(I))
|
||||
|
||||
#define _mm256_mask_shrdi_epi32(S, U, A, B, I) \
|
||||
(__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \
|
||||
(__v8si)_mm256_shrdi_epi32((A), (B), (I)), \
|
||||
(__v8si)(__m256i)(S))
|
||||
|
||||
#define _mm256_maskz_shrdi_epi32(U, A, B, I) \
|
||||
(__m256i)__builtin_ia32_selectd_256((__mmask8)(U), \
|
||||
(__v8si)_mm256_shrdi_epi32((A), (B), (I)), \
|
||||
(__v8si)_mm256_setzero_si256())
|
||||
|
||||
#define _mm_shrdi_epi32(A, B, I) \
|
||||
(__m128i)__builtin_ia32_vpshrdd128((__v4si)(__m128i)(A), \
|
||||
(__v4si)(__m128i)(B), (int)(I))
|
||||
|
||||
#define _mm_mask_shrdi_epi32(S, U, A, B, I) \
|
||||
(__m128i)__builtin_ia32_selectd_128((__mmask8)(U), \
|
||||
(__v4si)_mm_shrdi_epi32((A), (B), (I)), \
|
||||
(__v4si)(__m128i)(S))
|
||||
|
||||
#define _mm_maskz_shrdi_epi32(U, A, B, I) \
|
||||
(__m128i)__builtin_ia32_selectd_128((__mmask8)(U), \
|
||||
(__v4si)_mm_shrdi_epi32((A), (B), (I)), \
|
||||
(__v4si)_mm_setzero_si128())
|
||||
|
||||
#define _mm256_shrdi_epi16(A, B, I) \
|
||||
(__m256i)__builtin_ia32_vpshrdw256((__v16hi)(__m256i)(A), \
|
||||
(__v16hi)(__m256i)(B), (int)(I))
|
||||
|
||||
#define _mm256_mask_shrdi_epi16(S, U, A, B, I) \
|
||||
(__m256i)__builtin_ia32_selectw_256((__mmask16)(U), \
|
||||
(__v16hi)_mm256_shrdi_epi16((A), (B), (I)), \
|
||||
(__v16hi)(__m256i)(S))
|
||||
|
||||
#define _mm256_maskz_shrdi_epi16(U, A, B, I) \
|
||||
(__m256i)__builtin_ia32_selectw_256((__mmask16)(U), \
|
||||
(__v16hi)_mm256_shrdi_epi16((A), (B), (I)), \
|
||||
(__v16hi)_mm256_setzero_si256())
|
||||
|
||||
#define _mm_shrdi_epi16(A, B, I) \
|
||||
(__m128i)__builtin_ia32_vpshrdw128((__v8hi)(__m128i)(A), \
|
||||
(__v8hi)(__m128i)(B), (int)(I))
|
||||
|
||||
#define _mm_mask_shrdi_epi16(S, U, A, B, I) \
|
||||
(__m128i)__builtin_ia32_selectw_128((__mmask8)(U), \
|
||||
(__v8hi)_mm_shrdi_epi16((A), (B), (I)), \
|
||||
(__v8hi)(__m128i)(S))
|
||||
|
||||
#define _mm_maskz_shrdi_epi16(U, A, B, I) \
|
||||
(__m128i)__builtin_ia32_selectw_128((__mmask8)(U), \
|
||||
(__v8hi)_mm_shrdi_epi16((A), (B), (I)), \
|
||||
(__v8hi)_mm_setzero_si128())
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_shldv_epi64(__m256i __A, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_vpshldvq256((__v4di)__A, (__v4di)__B,
|
||||
(__v4di)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_shldv_epi64(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectq_256(__U,
|
||||
(__v4di)_mm256_shldv_epi64(__A, __B, __C),
|
||||
(__v4di)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_shldv_epi64(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectq_256(__U,
|
||||
(__v4di)_mm256_shldv_epi64(__A, __B, __C),
|
||||
(__v4di)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_shldv_epi64(__m128i __A, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_vpshldvq128((__v2di)__A, (__v2di)__B,
|
||||
(__v2di)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_shldv_epi64(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectq_128(__U,
|
||||
(__v2di)_mm_shldv_epi64(__A, __B, __C),
|
||||
(__v2di)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_shldv_epi64(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectq_128(__U,
|
||||
(__v2di)_mm_shldv_epi64(__A, __B, __C),
|
||||
(__v2di)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_shldv_epi32(__m256i __A, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_vpshldvd256((__v8si)__A, (__v8si)__B,
|
||||
(__v8si)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_shldv_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectd_256(__U,
|
||||
(__v8si)_mm256_shldv_epi32(__A, __B, __C),
|
||||
(__v8si)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_shldv_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectd_256(__U,
|
||||
(__v8si)_mm256_shldv_epi32(__A, __B, __C),
|
||||
(__v8si)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_shldv_epi32(__m128i __A, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_vpshldvd128((__v4si)__A, (__v4si)__B,
|
||||
(__v4si)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_shldv_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectd_128(__U,
|
||||
(__v4si)_mm_shldv_epi32(__A, __B, __C),
|
||||
(__v4si)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_shldv_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectd_128(__U,
|
||||
(__v4si)_mm_shldv_epi32(__A, __B, __C),
|
||||
(__v4si)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_shldv_epi16(__m256i __A, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_vpshldvw256((__v16hi)__A, (__v16hi)__B,
|
||||
(__v16hi)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_shldv_epi16(__m256i __A, __mmask16 __U, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectw_256(__U,
|
||||
(__v16hi)_mm256_shldv_epi16(__A, __B, __C),
|
||||
(__v16hi)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_shldv_epi16(__mmask16 __U, __m256i __A, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectw_256(__U,
|
||||
(__v16hi)_mm256_shldv_epi16(__A, __B, __C),
|
||||
(__v16hi)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_shldv_epi16(__m128i __A, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_vpshldvw128((__v8hi)__A, (__v8hi)__B,
|
||||
(__v8hi)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_shldv_epi16(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectw_128(__U,
|
||||
(__v8hi)_mm_shldv_epi16(__A, __B, __C),
|
||||
(__v8hi)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_shldv_epi16(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectw_128(__U,
|
||||
(__v8hi)_mm_shldv_epi16(__A, __B, __C),
|
||||
(__v8hi)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_shrdv_epi64(__m256i __A, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_vpshrdvq256((__v4di)__A, (__v4di)__B,
|
||||
(__v4di)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_shrdv_epi64(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectq_256(__U,
|
||||
(__v4di)_mm256_shrdv_epi64(__A, __B, __C),
|
||||
(__v4di)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_shrdv_epi64(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectq_256(__U,
|
||||
(__v4di)_mm256_shrdv_epi64(__A, __B, __C),
|
||||
(__v4di)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_shrdv_epi64(__m128i __A, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_vpshrdvq128((__v2di)__A, (__v2di)__B,
|
||||
(__v2di)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_shrdv_epi64(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectq_128(__U,
|
||||
(__v2di)_mm_shrdv_epi64(__A, __B, __C),
|
||||
(__v2di)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_shrdv_epi64(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectq_128(__U,
|
||||
(__v2di)_mm_shrdv_epi64(__A, __B, __C),
|
||||
(__v2di)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_shrdv_epi32(__m256i __A, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_vpshrdvd256((__v8si)__A, (__v8si)__B,
|
||||
(__v8si)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_shrdv_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectd_256(__U,
|
||||
(__v8si)_mm256_shrdv_epi32(__A, __B, __C),
|
||||
(__v8si)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_shrdv_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectd_256(__U,
|
||||
(__v8si)_mm256_shrdv_epi32(__A, __B, __C),
|
||||
(__v8si)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_shrdv_epi32(__m128i __A, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_vpshrdvd128((__v4si)__A, (__v4si)__B,
|
||||
(__v4si)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_shrdv_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectd_128(__U,
|
||||
(__v4si)_mm_shrdv_epi32(__A, __B, __C),
|
||||
(__v4si)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_shrdv_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectd_128(__U,
|
||||
(__v4si)_mm_shrdv_epi32(__A, __B, __C),
|
||||
(__v4si)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_shrdv_epi16(__m256i __A, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_vpshrdvw256((__v16hi)__A, (__v16hi)__B,
|
||||
(__v16hi)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_shrdv_epi16(__m256i __A, __mmask16 __U, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectw_256(__U,
|
||||
(__v16hi)_mm256_shrdv_epi16(__A, __B, __C),
|
||||
(__v16hi)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_shrdv_epi16(__mmask16 __U, __m256i __A, __m256i __B, __m256i __C)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectw_256(__U,
|
||||
(__v16hi)_mm256_shrdv_epi16(__A, __B, __C),
|
||||
(__v16hi)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_shrdv_epi16(__m128i __A, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_vpshrdvw128((__v8hi)__A, (__v8hi)__B,
|
||||
(__v8hi)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_shrdv_epi16(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectw_128(__U,
|
||||
(__v8hi)_mm_shrdv_epi16(__A, __B, __C),
|
||||
(__v8hi)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_shrdv_epi16(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectw_128(__U,
|
||||
(__v8hi)_mm_shrdv_epi16(__A, __B, __C),
|
||||
(__v8hi)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS128
|
||||
#undef __DEFAULT_FN_ATTRS256
|
||||
|
||||
#endif
|
||||
@@ -1,223 +0,0 @@
|
||||
/*===------------- avx512vlvnniintrin.h - VNNI intrinsics ------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512vlvnniintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __AVX512VLVNNIINTRIN_H
|
||||
#define __AVX512VLVNNIINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512vnni"), __min_vector_width__(128)))
|
||||
#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512vnni"), __min_vector_width__(256)))
|
||||
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_dpbusd_epi32(__m256i __S, __m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_vpdpbusd256((__v8si)__S, (__v8si)__A,
|
||||
(__v8si)__B);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_dpbusd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectd_256(__U,
|
||||
(__v8si)_mm256_dpbusd_epi32(__S, __A, __B),
|
||||
(__v8si)__S);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_dpbusd_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectd_256(__U,
|
||||
(__v8si)_mm256_dpbusd_epi32(__S, __A, __B),
|
||||
(__v8si)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_dpbusds_epi32(__m256i __S, __m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_vpdpbusds256((__v8si)__S, (__v8si)__A,
|
||||
(__v8si)__B);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_dpbusds_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectd_256(__U,
|
||||
(__v8si)_mm256_dpbusds_epi32(__S, __A, __B),
|
||||
(__v8si)__S);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_dpbusds_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectd_256(__U,
|
||||
(__v8si)_mm256_dpbusds_epi32(__S, __A, __B),
|
||||
(__v8si)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_dpwssd_epi32(__m256i __S, __m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_vpdpwssd256((__v8si)__S, (__v8si)__A,
|
||||
(__v8si)__B);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_dpwssd_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectd_256(__U,
|
||||
(__v8si)_mm256_dpwssd_epi32(__S, __A, __B),
|
||||
(__v8si)__S);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_dpwssd_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectd_256(__U,
|
||||
(__v8si)_mm256_dpwssd_epi32(__S, __A, __B),
|
||||
(__v8si)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_dpwssds_epi32(__m256i __S, __m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_vpdpwssds256((__v8si)__S, (__v8si)__A,
|
||||
(__v8si)__B);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_dpwssds_epi32(__m256i __S, __mmask8 __U, __m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectd_256(__U,
|
||||
(__v8si)_mm256_dpwssds_epi32(__S, __A, __B),
|
||||
(__v8si)__S);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_dpwssds_epi32(__mmask8 __U, __m256i __S, __m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i)__builtin_ia32_selectd_256(__U,
|
||||
(__v8si)_mm256_dpwssds_epi32(__S, __A, __B),
|
||||
(__v8si)_mm256_setzero_si256());
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_dpbusd_epi32(__m128i __S, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_vpdpbusd128((__v4si)__S, (__v4si)__A,
|
||||
(__v4si)__B);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_dpbusd_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectd_128(__U,
|
||||
(__v4si)_mm_dpbusd_epi32(__S, __A, __B),
|
||||
(__v4si)__S);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_dpbusd_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectd_128(__U,
|
||||
(__v4si)_mm_dpbusd_epi32(__S, __A, __B),
|
||||
(__v4si)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_dpbusds_epi32(__m128i __S, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_vpdpbusds128((__v4si)__S, (__v4si)__A,
|
||||
(__v4si)__B);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_dpbusds_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectd_128(__U,
|
||||
(__v4si)_mm_dpbusds_epi32(__S, __A, __B),
|
||||
(__v4si)__S);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_dpbusds_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectd_128(__U,
|
||||
(__v4si)_mm_dpbusds_epi32(__S, __A, __B),
|
||||
(__v4si)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_dpwssd_epi32(__m128i __S, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_vpdpwssd128((__v4si)__S, (__v4si)__A,
|
||||
(__v4si)__B);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_dpwssd_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectd_128(__U,
|
||||
(__v4si)_mm_dpwssd_epi32(__S, __A, __B),
|
||||
(__v4si)__S);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_dpwssd_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectd_128(__U,
|
||||
(__v4si)_mm_dpwssd_epi32(__S, __A, __B),
|
||||
(__v4si)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_dpwssds_epi32(__m128i __S, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_vpdpwssds128((__v4si)__S, (__v4si)__A,
|
||||
(__v4si)__B);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_dpwssds_epi32(__m128i __S, __mmask8 __U, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectd_128(__U,
|
||||
(__v4si)_mm_dpwssds_epi32(__S, __A, __B),
|
||||
(__v4si)__S);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_dpwssds_epi32(__mmask8 __U, __m128i __S, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_selectd_128(__U,
|
||||
(__v4si)_mm_dpwssds_epi32(__S, __A, __B),
|
||||
(__v4si)_mm_setzero_si128());
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS128
|
||||
#undef __DEFAULT_FN_ATTRS256
|
||||
|
||||
#endif
|
||||
@@ -1,129 +0,0 @@
|
||||
/*===------------- avx512vnniintrin.h - VNNI intrinsics ------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512vnniintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __AVX512VNNIINTRIN_H
|
||||
#define __AVX512VNNIINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vnni"), __min_vector_width__(512)))
|
||||
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_dpbusd_epi32(__m512i __S, __m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_vpdpbusd512((__v16si)__S, (__v16si)__A,
|
||||
(__v16si)__B);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_dpbusd_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectd_512(__U,
|
||||
(__v16si)_mm512_dpbusd_epi32(__S, __A, __B),
|
||||
(__v16si)__S);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_dpbusd_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectd_512(__U,
|
||||
(__v16si)_mm512_dpbusd_epi32(__S, __A, __B),
|
||||
(__v16si)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_dpbusds_epi32(__m512i __S, __m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_vpdpbusds512((__v16si)__S, (__v16si)__A,
|
||||
(__v16si)__B);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_dpbusds_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectd_512(__U,
|
||||
(__v16si)_mm512_dpbusds_epi32(__S, __A, __B),
|
||||
(__v16si)__S);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_dpbusds_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectd_512(__U,
|
||||
(__v16si)_mm512_dpbusds_epi32(__S, __A, __B),
|
||||
(__v16si)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_dpwssd_epi32(__m512i __S, __m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_vpdpwssd512((__v16si)__S, (__v16si)__A,
|
||||
(__v16si)__B);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_dpwssd_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectd_512(__U,
|
||||
(__v16si)_mm512_dpwssd_epi32(__S, __A, __B),
|
||||
(__v16si)__S);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_dpwssd_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectd_512(__U,
|
||||
(__v16si)_mm512_dpwssd_epi32(__S, __A, __B),
|
||||
(__v16si)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_dpwssds_epi32(__m512i __S, __m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_vpdpwssds512((__v16si)__S, (__v16si)__A,
|
||||
(__v16si)__B);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_dpwssds_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectd_512(__U,
|
||||
(__v16si)_mm512_dpwssds_epi32(__S, __A, __B),
|
||||
(__v16si)__S);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_dpwssds_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i)__builtin_ia32_selectd_512(__U,
|
||||
(__v16si)_mm512_dpwssds_epi32(__S, __A, __B),
|
||||
(__v16si)_mm512_setzero_si512());
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
@@ -1,68 +0,0 @@
|
||||
/*===----- avx512vpopcntdqintrin.h - AVX512VPOPCNTDQ intrinsics-------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error \
|
||||
"Never use <avx512vpopcntdqintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __AVX512VPOPCNTDQINTRIN_H
|
||||
#define __AVX512VPOPCNTDQINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS \
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("avx512vpopcntdq"), __min_vector_width__(512)))
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_popcnt_epi64(__m512i __A) {
|
||||
return (__m512i)__builtin_ia32_vpopcntq_512((__v8di)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_popcnt_epi64(__m512i __W, __mmask8 __U, __m512i __A) {
|
||||
return (__m512i)__builtin_ia32_selectq_512(
|
||||
(__mmask8)__U, (__v8di)_mm512_popcnt_epi64(__A), (__v8di)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_popcnt_epi64(__mmask8 __U, __m512i __A) {
|
||||
return _mm512_mask_popcnt_epi64((__m512i)_mm512_setzero_si512(), __U, __A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_popcnt_epi32(__m512i __A) {
|
||||
return (__m512i)__builtin_ia32_vpopcntd_512((__v16si)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_popcnt_epi32(__m512i __W, __mmask16 __U, __m512i __A) {
|
||||
return (__m512i)__builtin_ia32_selectd_512(
|
||||
(__mmask16)__U, (__v16si)_mm512_popcnt_epi32(__A), (__v16si)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_popcnt_epi32(__mmask16 __U, __m512i __A) {
|
||||
return _mm512_mask_popcnt_epi32((__m512i)_mm512_setzero_si512(), __U, __A);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
@@ -1,105 +0,0 @@
|
||||
/*===---- avx512vpopcntdqintrin.h - AVX512VPOPCNTDQ intrinsics -------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error \
|
||||
"Never use <avx512vpopcntdqvlintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __AVX512VPOPCNTDQVLINTRIN_H
|
||||
#define __AVX512VPOPCNTDQVLINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS128 \
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("avx512vpopcntdq,avx512vl"), __min_vector_width__(128)))
|
||||
#define __DEFAULT_FN_ATTRS256 \
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("avx512vpopcntdq,avx512vl"), __min_vector_width__(256)))
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_popcnt_epi64(__m128i __A) {
|
||||
return (__m128i)__builtin_ia32_vpopcntq_128((__v2di)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_popcnt_epi64(__m128i __W, __mmask8 __U, __m128i __A) {
|
||||
return (__m128i)__builtin_ia32_selectq_128(
|
||||
(__mmask8)__U, (__v2di)_mm_popcnt_epi64(__A), (__v2di)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_popcnt_epi64(__mmask8 __U, __m128i __A) {
|
||||
return _mm_mask_popcnt_epi64((__m128i)_mm_setzero_si128(), __U, __A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_popcnt_epi32(__m128i __A) {
|
||||
return (__m128i)__builtin_ia32_vpopcntd_128((__v4si)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_mask_popcnt_epi32(__m128i __W, __mmask8 __U, __m128i __A) {
|
||||
return (__m128i)__builtin_ia32_selectd_128(
|
||||
(__mmask8)__U, (__v4si)_mm_popcnt_epi32(__A), (__v4si)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS128
|
||||
_mm_maskz_popcnt_epi32(__mmask8 __U, __m128i __A) {
|
||||
return _mm_mask_popcnt_epi32((__m128i)_mm_setzero_si128(), __U, __A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_popcnt_epi64(__m256i __A) {
|
||||
return (__m256i)__builtin_ia32_vpopcntq_256((__v4di)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_popcnt_epi64(__m256i __W, __mmask8 __U, __m256i __A) {
|
||||
return (__m256i)__builtin_ia32_selectq_256(
|
||||
(__mmask8)__U, (__v4di)_mm256_popcnt_epi64(__A), (__v4di)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_popcnt_epi64(__mmask8 __U, __m256i __A) {
|
||||
return _mm256_mask_popcnt_epi64((__m256i)_mm256_setzero_si256(), __U, __A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_popcnt_epi32(__m256i __A) {
|
||||
return (__m256i)__builtin_ia32_vpopcntd_256((__v8si)__A);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_mask_popcnt_epi32(__m256i __W, __mmask8 __U, __m256i __A) {
|
||||
return (__m256i)__builtin_ia32_selectd_256(
|
||||
(__mmask8)__U, (__v8si)_mm256_popcnt_epi32(__A), (__v8si)__W);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS256
|
||||
_mm256_maskz_popcnt_epi32(__mmask8 __U, __m256i __A) {
|
||||
return _mm256_mask_popcnt_epi32((__m256i)_mm256_setzero_si256(), __U, __A);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS128
|
||||
#undef __DEFAULT_FN_ATTRS256
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,95 +0,0 @@
|
||||
/*===---- bmi2intrin.h - BMI2 intrinsics -----------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
|
||||
#error "Never use <bmi2intrin.h> directly; include <x86intrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __BMI2INTRIN_H
|
||||
#define __BMI2INTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("bmi2")))
|
||||
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS
|
||||
_bzhi_u32(unsigned int __X, unsigned int __Y)
|
||||
{
|
||||
return __builtin_ia32_bzhi_si(__X, __Y);
|
||||
}
|
||||
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS
|
||||
_pdep_u32(unsigned int __X, unsigned int __Y)
|
||||
{
|
||||
return __builtin_ia32_pdep_si(__X, __Y);
|
||||
}
|
||||
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS
|
||||
_pext_u32(unsigned int __X, unsigned int __Y)
|
||||
{
|
||||
return __builtin_ia32_pext_si(__X, __Y);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
|
||||
_bzhi_u64(unsigned long long __X, unsigned long long __Y)
|
||||
{
|
||||
return __builtin_ia32_bzhi_di(__X, __Y);
|
||||
}
|
||||
|
||||
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
|
||||
_pdep_u64(unsigned long long __X, unsigned long long __Y)
|
||||
{
|
||||
return __builtin_ia32_pdep_di(__X, __Y);
|
||||
}
|
||||
|
||||
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
|
||||
_pext_u64(unsigned long long __X, unsigned long long __Y)
|
||||
{
|
||||
return __builtin_ia32_pext_di(__X, __Y);
|
||||
}
|
||||
|
||||
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
|
||||
_mulx_u64 (unsigned long long __X, unsigned long long __Y,
|
||||
unsigned long long *__P)
|
||||
{
|
||||
unsigned __int128 __res = (unsigned __int128) __X * __Y;
|
||||
*__P = (unsigned long long) (__res >> 64);
|
||||
return (unsigned long long) __res;
|
||||
}
|
||||
|
||||
#else /* !__x86_64__ */
|
||||
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS
|
||||
_mulx_u32 (unsigned int __X, unsigned int __Y, unsigned int *__P)
|
||||
{
|
||||
unsigned long long __res = (unsigned long long) __X * __Y;
|
||||
*__P = (unsigned int) (__res >> 32);
|
||||
return (unsigned int) __res;
|
||||
}
|
||||
|
||||
#endif /* !__x86_64__ */
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __BMI2INTRIN_H */
|
||||
@@ -1,386 +0,0 @@
|
||||
/*===---- bmiintrin.h - BMI intrinsics -------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
|
||||
#error "Never use <bmiintrin.h> directly; include <x86intrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __BMIINTRIN_H
|
||||
#define __BMIINTRIN_H
|
||||
|
||||
#define _tzcnt_u16(a) (__tzcnt_u16((a)))
|
||||
|
||||
#define _andn_u32(a, b) (__andn_u32((a), (b)))
|
||||
|
||||
/* _bextr_u32 != __bextr_u32 */
|
||||
#define _blsi_u32(a) (__blsi_u32((a)))
|
||||
|
||||
#define _blsmsk_u32(a) (__blsmsk_u32((a)))
|
||||
|
||||
#define _blsr_u32(a) (__blsr_u32((a)))
|
||||
|
||||
#define _tzcnt_u32(a) (__tzcnt_u32((a)))
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("bmi")))
|
||||
|
||||
/* Allow using the tzcnt intrinsics even for non-BMI targets. Since the TZCNT
|
||||
instruction behaves as BSF on non-BMI targets, there is code that expects
|
||||
to use it as a potentially faster version of BSF. */
|
||||
#define __RELAXED_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
|
||||
|
||||
/// Counts the number of trailing zero bits in the operand.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> TZCNT </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 16-bit integer whose trailing zeros are to be counted.
|
||||
/// \returns An unsigned 16-bit integer containing the number of trailing zero
|
||||
/// bits in the operand.
|
||||
static __inline__ unsigned short __RELAXED_FN_ATTRS
|
||||
__tzcnt_u16(unsigned short __X)
|
||||
{
|
||||
return __builtin_ia32_tzcnt_u16(__X);
|
||||
}
|
||||
|
||||
/// Performs a bitwise AND of the second operand with the one's
|
||||
/// complement of the first operand.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> ANDN </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned integer containing one of the operands.
|
||||
/// \param __Y
|
||||
/// An unsigned integer containing one of the operands.
|
||||
/// \returns An unsigned integer containing the bitwise AND of the second
|
||||
/// operand with the one's complement of the first operand.
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS
|
||||
__andn_u32(unsigned int __X, unsigned int __Y)
|
||||
{
|
||||
return ~__X & __Y;
|
||||
}
|
||||
|
||||
/* AMD-specified, double-leading-underscore version of BEXTR */
|
||||
/// Extracts the specified bits from the first operand and returns them
|
||||
/// in the least significant bits of the result.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> BEXTR </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned integer whose bits are to be extracted.
|
||||
/// \param __Y
|
||||
/// An unsigned integer used to specify which bits are extracted. Bits [7:0]
|
||||
/// specify the index of the least significant bit. Bits [15:8] specify the
|
||||
/// number of bits to be extracted.
|
||||
/// \returns An unsigned integer whose least significant bits contain the
|
||||
/// extracted bits.
|
||||
/// \see _bextr_u32
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS
|
||||
__bextr_u32(unsigned int __X, unsigned int __Y)
|
||||
{
|
||||
return __builtin_ia32_bextr_u32(__X, __Y);
|
||||
}
|
||||
|
||||
/* Intel-specified, single-leading-underscore version of BEXTR */
|
||||
/// Extracts the specified bits from the first operand and returns them
|
||||
/// in the least significant bits of the result.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> BEXTR </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned integer whose bits are to be extracted.
|
||||
/// \param __Y
|
||||
/// An unsigned integer used to specify the index of the least significant
|
||||
/// bit for the bits to be extracted. Bits [7:0] specify the index.
|
||||
/// \param __Z
|
||||
/// An unsigned integer used to specify the number of bits to be extracted.
|
||||
/// Bits [7:0] specify the number of bits.
|
||||
/// \returns An unsigned integer whose least significant bits contain the
|
||||
/// extracted bits.
|
||||
/// \see __bextr_u32
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS
|
||||
_bextr_u32(unsigned int __X, unsigned int __Y, unsigned int __Z)
|
||||
{
|
||||
return __builtin_ia32_bextr_u32 (__X, ((__Y & 0xff) | ((__Z & 0xff) << 8)));
|
||||
}
|
||||
|
||||
/// Clears all bits in the source except for the least significant bit
|
||||
/// containing a value of 1 and returns the result.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> BLSI </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned integer whose bits are to be cleared.
|
||||
/// \returns An unsigned integer containing the result of clearing the bits from
|
||||
/// the source operand.
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS
|
||||
__blsi_u32(unsigned int __X)
|
||||
{
|
||||
return __X & -__X;
|
||||
}
|
||||
|
||||
/// Creates a mask whose bits are set to 1, using bit 0 up to and
|
||||
/// including the least significant bit that is set to 1 in the source
|
||||
/// operand and returns the result.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> BLSMSK </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned integer used to create the mask.
|
||||
/// \returns An unsigned integer containing the newly created mask.
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS
|
||||
__blsmsk_u32(unsigned int __X)
|
||||
{
|
||||
return __X ^ (__X - 1);
|
||||
}
|
||||
|
||||
/// Clears the least significant bit that is set to 1 in the source
|
||||
/// operand and returns the result.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> BLSR </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned integer containing the operand to be cleared.
|
||||
/// \returns An unsigned integer containing the result of clearing the source
|
||||
/// operand.
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS
|
||||
__blsr_u32(unsigned int __X)
|
||||
{
|
||||
return __X & (__X - 1);
|
||||
}
|
||||
|
||||
/// Counts the number of trailing zero bits in the operand.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> TZCNT </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 32-bit integer whose trailing zeros are to be counted.
|
||||
/// \returns An unsigned 32-bit integer containing the number of trailing zero
|
||||
/// bits in the operand.
|
||||
static __inline__ unsigned int __RELAXED_FN_ATTRS
|
||||
__tzcnt_u32(unsigned int __X)
|
||||
{
|
||||
return __builtin_ia32_tzcnt_u32(__X);
|
||||
}
|
||||
|
||||
/// Counts the number of trailing zero bits in the operand.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> TZCNT </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 32-bit integer whose trailing zeros are to be counted.
|
||||
/// \returns An 32-bit integer containing the number of trailing zero bits in
|
||||
/// the operand.
|
||||
static __inline__ int __RELAXED_FN_ATTRS
|
||||
_mm_tzcnt_32(unsigned int __X)
|
||||
{
|
||||
return __builtin_ia32_tzcnt_u32(__X);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
#define _andn_u64(a, b) (__andn_u64((a), (b)))
|
||||
|
||||
/* _bextr_u64 != __bextr_u64 */
|
||||
#define _blsi_u64(a) (__blsi_u64((a)))
|
||||
|
||||
#define _blsmsk_u64(a) (__blsmsk_u64((a)))
|
||||
|
||||
#define _blsr_u64(a) (__blsr_u64((a)))
|
||||
|
||||
#define _tzcnt_u64(a) (__tzcnt_u64((a)))
|
||||
|
||||
/// Performs a bitwise AND of the second operand with the one's
|
||||
/// complement of the first operand.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> ANDN </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 64-bit integer containing one of the operands.
|
||||
/// \param __Y
|
||||
/// An unsigned 64-bit integer containing one of the operands.
|
||||
/// \returns An unsigned 64-bit integer containing the bitwise AND of the second
|
||||
/// operand with the one's complement of the first operand.
|
||||
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
|
||||
__andn_u64 (unsigned long long __X, unsigned long long __Y)
|
||||
{
|
||||
return ~__X & __Y;
|
||||
}
|
||||
|
||||
/* AMD-specified, double-leading-underscore version of BEXTR */
|
||||
/// Extracts the specified bits from the first operand and returns them
|
||||
/// in the least significant bits of the result.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> BEXTR </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 64-bit integer whose bits are to be extracted.
|
||||
/// \param __Y
|
||||
/// An unsigned 64-bit integer used to specify which bits are extracted. Bits
|
||||
/// [7:0] specify the index of the least significant bit. Bits [15:8] specify
|
||||
/// the number of bits to be extracted.
|
||||
/// \returns An unsigned 64-bit integer whose least significant bits contain the
|
||||
/// extracted bits.
|
||||
/// \see _bextr_u64
|
||||
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
|
||||
__bextr_u64(unsigned long long __X, unsigned long long __Y)
|
||||
{
|
||||
return __builtin_ia32_bextr_u64(__X, __Y);
|
||||
}
|
||||
|
||||
/* Intel-specified, single-leading-underscore version of BEXTR */
|
||||
/// Extracts the specified bits from the first operand and returns them
|
||||
/// in the least significant bits of the result.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> BEXTR </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 64-bit integer whose bits are to be extracted.
|
||||
/// \param __Y
|
||||
/// An unsigned integer used to specify the index of the least significant
|
||||
/// bit for the bits to be extracted. Bits [7:0] specify the index.
|
||||
/// \param __Z
|
||||
/// An unsigned integer used to specify the number of bits to be extracted.
|
||||
/// Bits [7:0] specify the number of bits.
|
||||
/// \returns An unsigned 64-bit integer whose least significant bits contain the
|
||||
/// extracted bits.
|
||||
/// \see __bextr_u64
|
||||
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
|
||||
_bextr_u64(unsigned long long __X, unsigned int __Y, unsigned int __Z)
|
||||
{
|
||||
return __builtin_ia32_bextr_u64 (__X, ((__Y & 0xff) | ((__Z & 0xff) << 8)));
|
||||
}
|
||||
|
||||
/// Clears all bits in the source except for the least significant bit
|
||||
/// containing a value of 1 and returns the result.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> BLSI </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 64-bit integer whose bits are to be cleared.
|
||||
/// \returns An unsigned 64-bit integer containing the result of clearing the
|
||||
/// bits from the source operand.
|
||||
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
|
||||
__blsi_u64(unsigned long long __X)
|
||||
{
|
||||
return __X & -__X;
|
||||
}
|
||||
|
||||
/// Creates a mask whose bits are set to 1, using bit 0 up to and
|
||||
/// including the least significant bit that is set to 1 in the source
|
||||
/// operand and returns the result.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> BLSMSK </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 64-bit integer used to create the mask.
|
||||
/// \returns An unsigned 64-bit integer containing the newly created mask.
|
||||
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
|
||||
__blsmsk_u64(unsigned long long __X)
|
||||
{
|
||||
return __X ^ (__X - 1);
|
||||
}
|
||||
|
||||
/// Clears the least significant bit that is set to 1 in the source
|
||||
/// operand and returns the result.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> BLSR </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 64-bit integer containing the operand to be cleared.
|
||||
/// \returns An unsigned 64-bit integer containing the result of clearing the
|
||||
/// source operand.
|
||||
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
|
||||
__blsr_u64(unsigned long long __X)
|
||||
{
|
||||
return __X & (__X - 1);
|
||||
}
|
||||
|
||||
/// Counts the number of trailing zero bits in the operand.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> TZCNT </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 64-bit integer whose trailing zeros are to be counted.
|
||||
/// \returns An unsigned 64-bit integer containing the number of trailing zero
|
||||
/// bits in the operand.
|
||||
static __inline__ unsigned long long __RELAXED_FN_ATTRS
|
||||
__tzcnt_u64(unsigned long long __X)
|
||||
{
|
||||
return __builtin_ia32_tzcnt_u64(__X);
|
||||
}
|
||||
|
||||
/// Counts the number of trailing zero bits in the operand.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> TZCNT </c> instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 64-bit integer whose trailing zeros are to be counted.
|
||||
/// \returns An 64-bit integer containing the number of trailing zero bits in
|
||||
/// the operand.
|
||||
static __inline__ long long __RELAXED_FN_ATTRS
|
||||
_mm_tzcnt_64(unsigned long long __X)
|
||||
{
|
||||
return __builtin_ia32_tzcnt_u64(__X);
|
||||
}
|
||||
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
#undef __RELAXED_FN_ATTRS
|
||||
|
||||
#endif /* __BMIINTRIN_H */
|
||||
@@ -1,113 +0,0 @@
|
||||
/*===---- cetintrin.h - CET intrinsic --------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <cetintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __CETINTRIN_H
|
||||
#define __CETINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS \
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("shstk")))
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS _incsspd(int __a) {
|
||||
__builtin_ia32_incsspd(__a);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline__ void __DEFAULT_FN_ATTRS _incsspq(unsigned long long __a) {
|
||||
__builtin_ia32_incsspq(__a);
|
||||
}
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline__ void __DEFAULT_FN_ATTRS _inc_ssp(unsigned int __a) {
|
||||
__builtin_ia32_incsspq(__a);
|
||||
}
|
||||
#else /* __x86_64__ */
|
||||
static __inline__ void __DEFAULT_FN_ATTRS _inc_ssp(unsigned int __a) {
|
||||
__builtin_ia32_incsspd((int)__a);
|
||||
}
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS _rdsspd(unsigned int __a) {
|
||||
return __builtin_ia32_rdsspd(__a);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline__ unsigned long long __DEFAULT_FN_ATTRS _rdsspq(unsigned long long __a) {
|
||||
return __builtin_ia32_rdsspq(__a);
|
||||
}
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline__ unsigned long long __DEFAULT_FN_ATTRS _get_ssp(void) {
|
||||
return __builtin_ia32_rdsspq(0);
|
||||
}
|
||||
#else /* __x86_64__ */
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS _get_ssp(void) {
|
||||
return __builtin_ia32_rdsspd(0);
|
||||
}
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS _saveprevssp() {
|
||||
__builtin_ia32_saveprevssp();
|
||||
}
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS _rstorssp(void * __p) {
|
||||
__builtin_ia32_rstorssp(__p);
|
||||
}
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS _wrssd(unsigned int __a, void * __p) {
|
||||
__builtin_ia32_wrssd(__a, __p);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline__ void __DEFAULT_FN_ATTRS _wrssq(unsigned long long __a, void * __p) {
|
||||
__builtin_ia32_wrssq(__a, __p);
|
||||
}
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS _wrussd(unsigned int __a, void * __p) {
|
||||
__builtin_ia32_wrussd(__a, __p);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline__ void __DEFAULT_FN_ATTRS _wrussq(unsigned long long __a, void * __p) {
|
||||
__builtin_ia32_wrussq(__a, __p);
|
||||
}
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS _setssbsy() {
|
||||
__builtin_ia32_setssbsy();
|
||||
}
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS _clrssbsy(void * __p) {
|
||||
__builtin_ia32_clrssbsy(__p);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __CETINTRIN_H */
|
||||
@@ -1,42 +0,0 @@
|
||||
/*===---- cldemoteintrin.h - CLDEMOTE intrinsic ----------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
|
||||
#error "Never use <cldemoteintrin.h> directly; include <x86intrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __CLDEMOTEINTRIN_H
|
||||
#define __CLDEMOTEINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS \
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("cldemote")))
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_cldemote(const void * __P) {
|
||||
__builtin_ia32_cldemote(__P);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
@@ -1,41 +0,0 @@
|
||||
/*===---- clflushoptintrin.h - CLFLUSHOPT intrinsic ------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <clflushoptintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __CLFLUSHOPTINTRIN_H
|
||||
#define __CLFLUSHOPTINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("clflushopt")))
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_mm_clflushopt(void const * __m) {
|
||||
__builtin_ia32_clflushopt(__m);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
@@ -1,52 +0,0 @@
|
||||
/*===---- clwbintrin.h - CLWB intrinsic ------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <clwbintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __CLWBINTRIN_H
|
||||
#define __CLWBINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("clwb")))
|
||||
|
||||
/// Writes back to memory the cache line (if modified) that contains the
|
||||
/// linear address specified in \a __p from any level of the cache hierarchy in
|
||||
/// the cache coherence domain
|
||||
///
|
||||
/// \headerfile <immintrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> CLWB </c> instruction.
|
||||
///
|
||||
/// \param __p
|
||||
/// A pointer to the memory location used to identify the cache line to be
|
||||
/// written back.
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_mm_clwb(void const *__p) {
|
||||
__builtin_ia32_clwb(__p);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
@@ -1,50 +0,0 @@
|
||||
/*===----------------------- clzerointrin.h - CLZERO ----------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
|
||||
#error "Never use <clzerointrin.h> directly; include <x86intrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __CLZEROINTRIN_H
|
||||
#define __CLZEROINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS \
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("clzero")))
|
||||
|
||||
/// Loads the cache line address and zero's out the cacheline
|
||||
///
|
||||
/// \headerfile <clzerointrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> CLZERO </c> instruction.
|
||||
///
|
||||
/// \param __line
|
||||
/// A pointer to a cacheline which needs to be zeroed out.
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_mm_clzero (void * __line)
|
||||
{
|
||||
__builtin_ia32_clzero ((void *)__line);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __CLZEROINTRIN_H */
|
||||
@@ -1,312 +0,0 @@
|
||||
/*===---- cpuid.h - X86 cpu model detection --------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if !(__x86_64__ || __i386__)
|
||||
#error this header is for x86 only
|
||||
#endif
|
||||
|
||||
/* Responses identification request with %eax 0 */
|
||||
/* AMD: "AuthenticAMD" */
|
||||
#define signature_AMD_ebx 0x68747541
|
||||
#define signature_AMD_edx 0x69746e65
|
||||
#define signature_AMD_ecx 0x444d4163
|
||||
/* CENTAUR: "CentaurHauls" */
|
||||
#define signature_CENTAUR_ebx 0x746e6543
|
||||
#define signature_CENTAUR_edx 0x48727561
|
||||
#define signature_CENTAUR_ecx 0x736c7561
|
||||
/* CYRIX: "CyrixInstead" */
|
||||
#define signature_CYRIX_ebx 0x69727943
|
||||
#define signature_CYRIX_edx 0x736e4978
|
||||
#define signature_CYRIX_ecx 0x64616574
|
||||
/* INTEL: "GenuineIntel" */
|
||||
#define signature_INTEL_ebx 0x756e6547
|
||||
#define signature_INTEL_edx 0x49656e69
|
||||
#define signature_INTEL_ecx 0x6c65746e
|
||||
/* TM1: "TransmetaCPU" */
|
||||
#define signature_TM1_ebx 0x6e617254
|
||||
#define signature_TM1_edx 0x74656d73
|
||||
#define signature_TM1_ecx 0x55504361
|
||||
/* TM2: "GenuineTMx86" */
|
||||
#define signature_TM2_ebx 0x756e6547
|
||||
#define signature_TM2_edx 0x54656e69
|
||||
#define signature_TM2_ecx 0x3638784d
|
||||
/* NSC: "Geode by NSC" */
|
||||
#define signature_NSC_ebx 0x646f6547
|
||||
#define signature_NSC_edx 0x43534e20
|
||||
#define signature_NSC_ecx 0x79622065
|
||||
/* NEXGEN: "NexGenDriven" */
|
||||
#define signature_NEXGEN_ebx 0x4778654e
|
||||
#define signature_NEXGEN_edx 0x72446e65
|
||||
#define signature_NEXGEN_ecx 0x6e657669
|
||||
/* RISE: "RiseRiseRise" */
|
||||
#define signature_RISE_ebx 0x65736952
|
||||
#define signature_RISE_edx 0x65736952
|
||||
#define signature_RISE_ecx 0x65736952
|
||||
/* SIS: "SiS SiS SiS " */
|
||||
#define signature_SIS_ebx 0x20536953
|
||||
#define signature_SIS_edx 0x20536953
|
||||
#define signature_SIS_ecx 0x20536953
|
||||
/* UMC: "UMC UMC UMC " */
|
||||
#define signature_UMC_ebx 0x20434d55
|
||||
#define signature_UMC_edx 0x20434d55
|
||||
#define signature_UMC_ecx 0x20434d55
|
||||
/* VIA: "VIA VIA VIA " */
|
||||
#define signature_VIA_ebx 0x20414956
|
||||
#define signature_VIA_edx 0x20414956
|
||||
#define signature_VIA_ecx 0x20414956
|
||||
/* VORTEX: "Vortex86 SoC" */
|
||||
#define signature_VORTEX_ebx 0x74726f56
|
||||
#define signature_VORTEX_edx 0x36387865
|
||||
#define signature_VORTEX_ecx 0x436f5320
|
||||
|
||||
/* Features in %ecx for leaf 1 */
|
||||
#define bit_SSE3 0x00000001
|
||||
#define bit_PCLMULQDQ 0x00000002
|
||||
#define bit_PCLMUL bit_PCLMULQDQ /* for gcc compat */
|
||||
#define bit_DTES64 0x00000004
|
||||
#define bit_MONITOR 0x00000008
|
||||
#define bit_DSCPL 0x00000010
|
||||
#define bit_VMX 0x00000020
|
||||
#define bit_SMX 0x00000040
|
||||
#define bit_EIST 0x00000080
|
||||
#define bit_TM2 0x00000100
|
||||
#define bit_SSSE3 0x00000200
|
||||
#define bit_CNXTID 0x00000400
|
||||
#define bit_FMA 0x00001000
|
||||
#define bit_CMPXCHG16B 0x00002000
|
||||
#define bit_xTPR 0x00004000
|
||||
#define bit_PDCM 0x00008000
|
||||
#define bit_PCID 0x00020000
|
||||
#define bit_DCA 0x00040000
|
||||
#define bit_SSE41 0x00080000
|
||||
#define bit_SSE4_1 bit_SSE41 /* for gcc compat */
|
||||
#define bit_SSE42 0x00100000
|
||||
#define bit_SSE4_2 bit_SSE42 /* for gcc compat */
|
||||
#define bit_x2APIC 0x00200000
|
||||
#define bit_MOVBE 0x00400000
|
||||
#define bit_POPCNT 0x00800000
|
||||
#define bit_TSCDeadline 0x01000000
|
||||
#define bit_AESNI 0x02000000
|
||||
#define bit_AES bit_AESNI /* for gcc compat */
|
||||
#define bit_XSAVE 0x04000000
|
||||
#define bit_OSXSAVE 0x08000000
|
||||
#define bit_AVX 0x10000000
|
||||
#define bit_F16C 0x20000000
|
||||
#define bit_RDRND 0x40000000
|
||||
|
||||
/* Features in %edx for leaf 1 */
|
||||
#define bit_FPU 0x00000001
|
||||
#define bit_VME 0x00000002
|
||||
#define bit_DE 0x00000004
|
||||
#define bit_PSE 0x00000008
|
||||
#define bit_TSC 0x00000010
|
||||
#define bit_MSR 0x00000020
|
||||
#define bit_PAE 0x00000040
|
||||
#define bit_MCE 0x00000080
|
||||
#define bit_CX8 0x00000100
|
||||
#define bit_CMPXCHG8B bit_CX8 /* for gcc compat */
|
||||
#define bit_APIC 0x00000200
|
||||
#define bit_SEP 0x00000800
|
||||
#define bit_MTRR 0x00001000
|
||||
#define bit_PGE 0x00002000
|
||||
#define bit_MCA 0x00004000
|
||||
#define bit_CMOV 0x00008000
|
||||
#define bit_PAT 0x00010000
|
||||
#define bit_PSE36 0x00020000
|
||||
#define bit_PSN 0x00040000
|
||||
#define bit_CLFSH 0x00080000
|
||||
#define bit_DS 0x00200000
|
||||
#define bit_ACPI 0x00400000
|
||||
#define bit_MMX 0x00800000
|
||||
#define bit_FXSR 0x01000000
|
||||
#define bit_FXSAVE bit_FXSR /* for gcc compat */
|
||||
#define bit_SSE 0x02000000
|
||||
#define bit_SSE2 0x04000000
|
||||
#define bit_SS 0x08000000
|
||||
#define bit_HTT 0x10000000
|
||||
#define bit_TM 0x20000000
|
||||
#define bit_PBE 0x80000000
|
||||
|
||||
/* Features in %ebx for leaf 7 sub-leaf 0 */
|
||||
#define bit_FSGSBASE 0x00000001
|
||||
#define bit_SGX 0x00000004
|
||||
#define bit_BMI 0x00000008
|
||||
#define bit_HLE 0x00000010
|
||||
#define bit_AVX2 0x00000020
|
||||
#define bit_SMEP 0x00000080
|
||||
#define bit_BMI2 0x00000100
|
||||
#define bit_ENH_MOVSB 0x00000200
|
||||
#define bit_INVPCID 0x00000400
|
||||
#define bit_RTM 0x00000800
|
||||
#define bit_MPX 0x00004000
|
||||
#define bit_AVX512F 0x00010000
|
||||
#define bit_AVX512DQ 0x00020000
|
||||
#define bit_RDSEED 0x00040000
|
||||
#define bit_ADX 0x00080000
|
||||
#define bit_AVX512IFMA 0x00200000
|
||||
#define bit_CLFLUSHOPT 0x00800000
|
||||
#define bit_CLWB 0x01000000
|
||||
#define bit_AVX512PF 0x04000000
|
||||
#define bit_AVX512ER 0x08000000
|
||||
#define bit_AVX512CD 0x10000000
|
||||
#define bit_SHA 0x20000000
|
||||
#define bit_AVX512BW 0x40000000
|
||||
#define bit_AVX512VL 0x80000000
|
||||
|
||||
/* Features in %ecx for leaf 7 sub-leaf 0 */
|
||||
#define bit_PREFTCHWT1 0x00000001
|
||||
#define bit_AVX512VBMI 0x00000002
|
||||
#define bit_PKU 0x00000004
|
||||
#define bit_OSPKE 0x00000010
|
||||
#define bit_WAITPKG 0x00000020
|
||||
#define bit_AVX512VBMI2 0x00000040
|
||||
#define bit_SHSTK 0x00000080
|
||||
#define bit_GFNI 0x00000100
|
||||
#define bit_VAES 0x00000200
|
||||
#define bit_VPCLMULQDQ 0x00000400
|
||||
#define bit_AVX512VNNI 0x00000800
|
||||
#define bit_AVX512BITALG 0x00001000
|
||||
#define bit_AVX512VPOPCNTDQ 0x00004000
|
||||
#define bit_RDPID 0x00400000
|
||||
#define bit_CLDEMOTE 0x02000000
|
||||
#define bit_MOVDIRI 0x08000000
|
||||
#define bit_MOVDIR64B 0x10000000
|
||||
|
||||
/* Features in %edx for leaf 7 sub-leaf 0 */
|
||||
#define bit_AVX5124VNNIW 0x00000004
|
||||
#define bit_AVX5124FMAPS 0x00000008
|
||||
#define bit_PCONFIG 0x00040000
|
||||
#define bit_IBT 0x00100000
|
||||
|
||||
/* Features in %eax for leaf 13 sub-leaf 1 */
|
||||
#define bit_XSAVEOPT 0x00000001
|
||||
#define bit_XSAVEC 0x00000002
|
||||
#define bit_XSAVES 0x00000008
|
||||
|
||||
/* Features in %eax for leaf 0x14 sub-leaf 0 */
|
||||
#define bit_PTWRITE 0x00000010
|
||||
|
||||
/* Features in %ecx for leaf 0x80000001 */
|
||||
#define bit_LAHF_LM 0x00000001
|
||||
#define bit_ABM 0x00000020
|
||||
#define bit_LZCNT bit_ABM /* for gcc compat */
|
||||
#define bit_SSE4a 0x00000040
|
||||
#define bit_PRFCHW 0x00000100
|
||||
#define bit_XOP 0x00000800
|
||||
#define bit_LWP 0x00008000
|
||||
#define bit_FMA4 0x00010000
|
||||
#define bit_TBM 0x00200000
|
||||
#define bit_MWAITX 0x20000000
|
||||
|
||||
/* Features in %edx for leaf 0x80000001 */
|
||||
#define bit_MMXEXT 0x00400000
|
||||
#define bit_LM 0x20000000
|
||||
#define bit_3DNOWP 0x40000000
|
||||
#define bit_3DNOW 0x80000000
|
||||
|
||||
/* Features in %ebx for leaf 0x80000008 */
|
||||
#define bit_CLZERO 0x00000001
|
||||
#define bit_WBNOINVD 0x00000200
|
||||
|
||||
|
||||
#if __i386__
|
||||
#define __cpuid(__leaf, __eax, __ebx, __ecx, __edx) \
|
||||
__asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \
|
||||
: "0"(__leaf))
|
||||
|
||||
#define __cpuid_count(__leaf, __count, __eax, __ebx, __ecx, __edx) \
|
||||
__asm("cpuid" : "=a"(__eax), "=b" (__ebx), "=c"(__ecx), "=d"(__edx) \
|
||||
: "0"(__leaf), "2"(__count))
|
||||
#else
|
||||
/* x86-64 uses %rbx as the base register, so preserve it. */
|
||||
#define __cpuid(__leaf, __eax, __ebx, __ecx, __edx) \
|
||||
__asm(" xchgq %%rbx,%q1\n" \
|
||||
" cpuid\n" \
|
||||
" xchgq %%rbx,%q1" \
|
||||
: "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx) \
|
||||
: "0"(__leaf))
|
||||
|
||||
#define __cpuid_count(__leaf, __count, __eax, __ebx, __ecx, __edx) \
|
||||
__asm(" xchgq %%rbx,%q1\n" \
|
||||
" cpuid\n" \
|
||||
" xchgq %%rbx,%q1" \
|
||||
: "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx) \
|
||||
: "0"(__leaf), "2"(__count))
|
||||
#endif
|
||||
|
||||
static __inline int __get_cpuid_max (unsigned int __leaf, unsigned int *__sig)
|
||||
{
|
||||
unsigned int __eax, __ebx, __ecx, __edx;
|
||||
#if __i386__
|
||||
int __cpuid_supported;
|
||||
|
||||
__asm(" pushfl\n"
|
||||
" popl %%eax\n"
|
||||
" movl %%eax,%%ecx\n"
|
||||
" xorl $0x00200000,%%eax\n"
|
||||
" pushl %%eax\n"
|
||||
" popfl\n"
|
||||
" pushfl\n"
|
||||
" popl %%eax\n"
|
||||
" movl $0,%0\n"
|
||||
" cmpl %%eax,%%ecx\n"
|
||||
" je 1f\n"
|
||||
" movl $1,%0\n"
|
||||
"1:"
|
||||
: "=r" (__cpuid_supported) : : "eax", "ecx");
|
||||
if (!__cpuid_supported)
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
__cpuid(__leaf, __eax, __ebx, __ecx, __edx);
|
||||
if (__sig)
|
||||
*__sig = __ebx;
|
||||
return __eax;
|
||||
}
|
||||
|
||||
static __inline int __get_cpuid (unsigned int __leaf, unsigned int *__eax,
|
||||
unsigned int *__ebx, unsigned int *__ecx,
|
||||
unsigned int *__edx)
|
||||
{
|
||||
unsigned int __max_leaf = __get_cpuid_max(__leaf & 0x80000000, 0);
|
||||
|
||||
if (__max_leaf == 0 || __max_leaf < __leaf)
|
||||
return 0;
|
||||
|
||||
__cpuid(__leaf, *__eax, *__ebx, *__ecx, *__edx);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static __inline int __get_cpuid_count (unsigned int __leaf,
|
||||
unsigned int __subleaf,
|
||||
unsigned int *__eax, unsigned int *__ebx,
|
||||
unsigned int *__ecx, unsigned int *__edx)
|
||||
{
|
||||
unsigned int __max_leaf = __get_cpuid_max(__leaf & 0x80000000, 0);
|
||||
|
||||
if (__max_leaf == 0 || __max_leaf < __leaf)
|
||||
return 0;
|
||||
|
||||
__cpuid_count(__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx);
|
||||
return 1;
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
/*===---- complex - CUDA wrapper for <algorithm> ----------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __CLANG_CUDA_WRAPPERS_ALGORITHM
|
||||
#define __CLANG_CUDA_WRAPPERS_ALGORITHM
|
||||
|
||||
// This header defines __device__ overloads of std::min/max.
|
||||
//
|
||||
// Ideally we'd declare these functions only if we're <= C++11. In C++14,
|
||||
// these functions are constexpr, and so are implicitly __host__ __device__.
|
||||
//
|
||||
// However, the compiler being in C++14 mode does not imply that the standard
|
||||
// library supports C++14. There is no macro we can test to check that the
|
||||
// stdlib has constexpr std::min/max. Thus we have to unconditionally define
|
||||
// our device overloads.
|
||||
//
|
||||
// A host+device function cannot be overloaded, and a constexpr function
|
||||
// implicitly become host device if there's no explicitly host or device
|
||||
// overload preceding it. So the simple thing to do would be to declare our
|
||||
// device min/max overloads, and then #include_next <algorithm>. This way our
|
||||
// device overloads would come first, and so if we have a C++14 stdlib, its
|
||||
// min/max won't become host+device and conflict with our device overloads.
|
||||
//
|
||||
// But that also doesn't work. libstdc++ is evil and declares std::min/max in
|
||||
// an internal header that is included *before* <algorithm>. Thus by the time
|
||||
// we're inside of this file, std::min/max may already have been declared, and
|
||||
// thus we can't prevent them from becoming host+device if they're constexpr.
|
||||
//
|
||||
// Therefore we perpetrate the following hack: We mark our __device__ overloads
|
||||
// with __attribute__((enable_if(true, ""))). This causes the signature of the
|
||||
// function to change without changing anything else about it. (Except that
|
||||
// overload resolution will prefer it over the __host__ __device__ version
|
||||
// rather than considering them equally good).
|
||||
|
||||
#include_next <algorithm>
|
||||
|
||||
// We need to define these overloads in exactly the namespace our standard
|
||||
// library uses (including the right inline namespace), otherwise they won't be
|
||||
// picked up by other functions in the standard library (e.g. functions in
|
||||
// <complex>). Thus the ugliness below.
|
||||
#ifdef _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
#else
|
||||
namespace std {
|
||||
#ifdef _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#pragma push_macro("_CPP14_CONSTEXPR")
|
||||
#if __cplusplus >= 201402L
|
||||
#define _CPP14_CONSTEXPR constexpr
|
||||
#else
|
||||
#define _CPP14_CONSTEXPR
|
||||
#endif
|
||||
|
||||
template <class __T, class __Cmp>
|
||||
__attribute__((enable_if(true, "")))
|
||||
inline _CPP14_CONSTEXPR __host__ __device__ const __T &
|
||||
max(const __T &__a, const __T &__b, __Cmp __cmp) {
|
||||
return __cmp(__a, __b) ? __b : __a;
|
||||
}
|
||||
|
||||
template <class __T>
|
||||
__attribute__((enable_if(true, "")))
|
||||
inline _CPP14_CONSTEXPR __host__ __device__ const __T &
|
||||
max(const __T &__a, const __T &__b) {
|
||||
return __a < __b ? __b : __a;
|
||||
}
|
||||
|
||||
template <class __T, class __Cmp>
|
||||
__attribute__((enable_if(true, "")))
|
||||
inline _CPP14_CONSTEXPR __host__ __device__ const __T &
|
||||
min(const __T &__a, const __T &__b, __Cmp __cmp) {
|
||||
return __cmp(__b, __a) ? __b : __a;
|
||||
}
|
||||
|
||||
template <class __T>
|
||||
__attribute__((enable_if(true, "")))
|
||||
inline _CPP14_CONSTEXPR __host__ __device__ const __T &
|
||||
min(const __T &__a, const __T &__b) {
|
||||
return __a < __b ? __a : __b;
|
||||
}
|
||||
|
||||
#pragma pop_macro("_CPP14_CONSTEXPR")
|
||||
|
||||
#ifdef _LIBCPP_END_NAMESPACE_STD
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
#else
|
||||
#ifdef _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
_GLIBCXX_END_NAMESPACE_VERSION
|
||||
#endif
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#endif // __CLANG_CUDA_WRAPPERS_ALGORITHM
|
||||
@@ -1,82 +0,0 @@
|
||||
/*===---- complex - CUDA wrapper for <complex> ------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __CLANG_CUDA_WRAPPERS_COMPLEX
|
||||
#define __CLANG_CUDA_WRAPPERS_COMPLEX
|
||||
|
||||
// Wrapper around <complex> that forces its functions to be __host__
|
||||
// __device__.
|
||||
|
||||
// First, include host-only headers we think are likely to be included by
|
||||
// <complex>, so that the pragma below only applies to <complex> itself.
|
||||
#if __cplusplus >= 201103L
|
||||
#include <type_traits>
|
||||
#endif
|
||||
#include <stdexcept>
|
||||
#include <cmath>
|
||||
#include <sstream>
|
||||
|
||||
// Next, include our <algorithm> wrapper, to ensure that device overloads of
|
||||
// std::min/max are available.
|
||||
#include <algorithm>
|
||||
|
||||
#pragma clang force_cuda_host_device begin
|
||||
|
||||
// When compiling for device, ask libstdc++ to use its own implements of
|
||||
// complex functions, rather than calling builtins (which resolve to library
|
||||
// functions that don't exist when compiling CUDA device code).
|
||||
//
|
||||
// This is a little dicey, because it causes libstdc++ to define a different
|
||||
// set of overloads on host and device.
|
||||
//
|
||||
// // Present only when compiling for host.
|
||||
// __host__ __device__ void complex<float> sin(const complex<float>& x) {
|
||||
// return __builtin_csinf(x);
|
||||
// }
|
||||
//
|
||||
// // Present when compiling for host and for device.
|
||||
// template <typename T>
|
||||
// void __host__ __device__ complex<T> sin(const complex<T>& x) {
|
||||
// return complex<T>(sin(x.real()) * cosh(x.imag()),
|
||||
// cos(x.real()), sinh(x.imag()));
|
||||
// }
|
||||
//
|
||||
// This is safe because when compiling for device, all function calls in
|
||||
// __host__ code to sin() will still resolve to *something*, even if they don't
|
||||
// resolve to the same function as they resolve to when compiling for host. We
|
||||
// don't care that they don't resolve to the right function because we won't
|
||||
// codegen this host code when compiling for device.
|
||||
|
||||
#pragma push_macro("_GLIBCXX_USE_C99_COMPLEX")
|
||||
#pragma push_macro("_GLIBCXX_USE_C99_COMPLEX_TR1")
|
||||
#define _GLIBCXX_USE_C99_COMPLEX 0
|
||||
#define _GLIBCXX_USE_C99_COMPLEX_TR1 0
|
||||
|
||||
#include_next <complex>
|
||||
|
||||
#pragma pop_macro("_GLIBCXX_USE_C99_COMPLEX_TR1")
|
||||
#pragma pop_macro("_GLIBCXX_USE_C99_COMPLEX")
|
||||
|
||||
#pragma clang force_cuda_host_device end
|
||||
|
||||
#endif // include guard
|
||||
@@ -1,98 +0,0 @@
|
||||
/*===---- complex - CUDA wrapper for <new> ------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __CLANG_CUDA_WRAPPERS_NEW
|
||||
#define __CLANG_CUDA_WRAPPERS_NEW
|
||||
|
||||
#include_next <new>
|
||||
|
||||
#pragma push_macro("CUDA_NOEXCEPT")
|
||||
#if __cplusplus >= 201103L
|
||||
#define CUDA_NOEXCEPT noexcept
|
||||
#else
|
||||
#define CUDA_NOEXCEPT
|
||||
#endif
|
||||
|
||||
// Device overrides for non-placement new and delete.
|
||||
__device__ inline void *operator new(__SIZE_TYPE__ size) {
|
||||
if (size == 0) {
|
||||
size = 1;
|
||||
}
|
||||
return ::malloc(size);
|
||||
}
|
||||
__device__ inline void *operator new(__SIZE_TYPE__ size,
|
||||
const std::nothrow_t &) CUDA_NOEXCEPT {
|
||||
return ::operator new(size);
|
||||
}
|
||||
|
||||
__device__ inline void *operator new[](__SIZE_TYPE__ size) {
|
||||
return ::operator new(size);
|
||||
}
|
||||
__device__ inline void *operator new[](__SIZE_TYPE__ size,
|
||||
const std::nothrow_t &) {
|
||||
return ::operator new(size);
|
||||
}
|
||||
|
||||
__device__ inline void operator delete(void* ptr) CUDA_NOEXCEPT {
|
||||
if (ptr) {
|
||||
::free(ptr);
|
||||
}
|
||||
}
|
||||
__device__ inline void operator delete(void *ptr,
|
||||
const std::nothrow_t &) CUDA_NOEXCEPT {
|
||||
::operator delete(ptr);
|
||||
}
|
||||
|
||||
__device__ inline void operator delete[](void* ptr) CUDA_NOEXCEPT {
|
||||
::operator delete(ptr);
|
||||
}
|
||||
__device__ inline void operator delete[](void *ptr,
|
||||
const std::nothrow_t &) CUDA_NOEXCEPT {
|
||||
::operator delete(ptr);
|
||||
}
|
||||
|
||||
// Sized delete, C++14 only.
|
||||
#if __cplusplus >= 201402L
|
||||
__device__ inline void operator delete(void *ptr,
|
||||
__SIZE_TYPE__ size) CUDA_NOEXCEPT {
|
||||
::operator delete(ptr);
|
||||
}
|
||||
__device__ inline void operator delete[](void *ptr,
|
||||
__SIZE_TYPE__ size) CUDA_NOEXCEPT {
|
||||
::operator delete(ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Device overrides for placement new and delete.
|
||||
__device__ inline void *operator new(__SIZE_TYPE__, void *__ptr) CUDA_NOEXCEPT {
|
||||
return __ptr;
|
||||
}
|
||||
__device__ inline void *operator new[](__SIZE_TYPE__, void *__ptr) CUDA_NOEXCEPT {
|
||||
return __ptr;
|
||||
}
|
||||
__device__ inline void operator delete(void *, void *) CUDA_NOEXCEPT {}
|
||||
__device__ inline void operator delete[](void *, void *) CUDA_NOEXCEPT {}
|
||||
|
||||
#pragma pop_macro("CUDA_NOEXCEPT")
|
||||
|
||||
#endif // include guard
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,176 +0,0 @@
|
||||
/*===---- f16cintrin.h - F16C intrinsics -----------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if !defined __IMMINTRIN_H
|
||||
#error "Never use <f16cintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __F16CINTRIN_H
|
||||
#define __F16CINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS128 \
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("f16c"), __min_vector_width__(128)))
|
||||
#define __DEFAULT_FN_ATTRS256 \
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("f16c"), __min_vector_width__(256)))
|
||||
|
||||
/* NOTE: Intel documents the 128-bit versions of these as being in emmintrin.h,
|
||||
* but that's because icc can emulate these without f16c using a library call.
|
||||
* Since we don't do that let's leave these in f16cintrin.h.
|
||||
*/
|
||||
|
||||
/// Converts a 16-bit half-precision float value into a 32-bit float
|
||||
/// value.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VCVTPH2PS </c> instruction.
|
||||
///
|
||||
/// \param __a
|
||||
/// A 16-bit half-precision float value.
|
||||
/// \returns The converted 32-bit float value.
|
||||
static __inline float __DEFAULT_FN_ATTRS128
|
||||
_cvtsh_ss(unsigned short __a)
|
||||
{
|
||||
__v8hi v = {(short)__a, 0, 0, 0, 0, 0, 0, 0};
|
||||
__v4sf r = __builtin_ia32_vcvtph2ps(v);
|
||||
return r[0];
|
||||
}
|
||||
|
||||
/// Converts a 32-bit single-precision float value to a 16-bit
|
||||
/// half-precision float value.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// \code
|
||||
/// unsigned short _cvtss_sh(float a, const int imm);
|
||||
/// \endcode
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VCVTPS2PH </c> instruction.
|
||||
///
|
||||
/// \param a
|
||||
/// A 32-bit single-precision float value to be converted to a 16-bit
|
||||
/// half-precision float value.
|
||||
/// \param imm
|
||||
/// An immediate value controlling rounding using bits [2:0]: \n
|
||||
/// 000: Nearest \n
|
||||
/// 001: Down \n
|
||||
/// 010: Up \n
|
||||
/// 011: Truncate \n
|
||||
/// 1XX: Use MXCSR.RC for rounding
|
||||
/// \returns The converted 16-bit half-precision float value.
|
||||
#define _cvtss_sh(a, imm) \
|
||||
(unsigned short)(((__v8hi)__builtin_ia32_vcvtps2ph((__v4sf){a, 0, 0, 0}, \
|
||||
(imm)))[0])
|
||||
|
||||
/// Converts a 128-bit vector containing 32-bit float values into a
|
||||
/// 128-bit vector containing 16-bit half-precision float values.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// \code
|
||||
/// __m128i _mm_cvtps_ph(__m128 a, const int imm);
|
||||
/// \endcode
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VCVTPS2PH </c> instruction.
|
||||
///
|
||||
/// \param a
|
||||
/// A 128-bit vector containing 32-bit float values.
|
||||
/// \param imm
|
||||
/// An immediate value controlling rounding using bits [2:0]: \n
|
||||
/// 000: Nearest \n
|
||||
/// 001: Down \n
|
||||
/// 010: Up \n
|
||||
/// 011: Truncate \n
|
||||
/// 1XX: Use MXCSR.RC for rounding
|
||||
/// \returns A 128-bit vector containing converted 16-bit half-precision float
|
||||
/// values. The lower 64 bits are used to store the converted 16-bit
|
||||
/// half-precision floating-point values.
|
||||
#define _mm_cvtps_ph(a, imm) \
|
||||
(__m128i)__builtin_ia32_vcvtps2ph((__v4sf)(__m128)(a), (imm))
|
||||
|
||||
/// Converts a 128-bit vector containing 16-bit half-precision float
|
||||
/// values into a 128-bit vector containing 32-bit float values.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VCVTPH2PS </c> instruction.
|
||||
///
|
||||
/// \param __a
|
||||
/// A 128-bit vector containing 16-bit half-precision float values. The lower
|
||||
/// 64 bits are used in the conversion.
|
||||
/// \returns A 128-bit vector of [4 x float] containing converted float values.
|
||||
static __inline __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_cvtph_ps(__m128i __a)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vcvtph2ps((__v8hi)__a);
|
||||
}
|
||||
|
||||
/// Converts a 256-bit vector of [8 x float] into a 128-bit vector
|
||||
/// containing 16-bit half-precision float values.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// \code
|
||||
/// __m128i _mm256_cvtps_ph(__m256 a, const int imm);
|
||||
/// \endcode
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VCVTPS2PH </c> instruction.
|
||||
///
|
||||
/// \param a
|
||||
/// A 256-bit vector containing 32-bit single-precision float values to be
|
||||
/// converted to 16-bit half-precision float values.
|
||||
/// \param imm
|
||||
/// An immediate value controlling rounding using bits [2:0]: \n
|
||||
/// 000: Nearest \n
|
||||
/// 001: Down \n
|
||||
/// 010: Up \n
|
||||
/// 011: Truncate \n
|
||||
/// 1XX: Use MXCSR.RC for rounding
|
||||
/// \returns A 128-bit vector containing the converted 16-bit half-precision
|
||||
/// float values.
|
||||
#define _mm256_cvtps_ph(a, imm) \
|
||||
(__m128i)__builtin_ia32_vcvtps2ph256((__v8sf)(__m256)(a), (imm))
|
||||
|
||||
/// Converts a 128-bit vector containing 16-bit half-precision float
|
||||
/// values into a 256-bit vector of [8 x float].
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VCVTPH2PS </c> instruction.
|
||||
///
|
||||
/// \param __a
|
||||
/// A 128-bit vector containing 16-bit half-precision float values to be
|
||||
/// converted to 32-bit single-precision float values.
|
||||
/// \returns A vector of [8 x float] containing the converted 32-bit
|
||||
/// single-precision float values.
|
||||
static __inline __m256 __DEFAULT_FN_ATTRS256
|
||||
_mm256_cvtph_ps(__m128i __a)
|
||||
{
|
||||
return (__m256)__builtin_ia32_vcvtph2ps256((__v8hi)__a);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS128
|
||||
#undef __DEFAULT_FN_ATTRS256
|
||||
|
||||
#endif /* __F16CINTRIN_H */
|
||||
@@ -1,166 +0,0 @@
|
||||
/*===---- float.h - Characteristics of floating point types ----------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __CLANG_FLOAT_H
|
||||
#define __CLANG_FLOAT_H
|
||||
|
||||
/* If we're on MinGW, fall back to the system's float.h, which might have
|
||||
* additional definitions provided for Windows.
|
||||
* For more details see http://msdn.microsoft.com/en-us/library/y0ybw9fy.aspx
|
||||
*
|
||||
* Also fall back on Darwin to allow additional definitions and
|
||||
* implementation-defined values.
|
||||
*/
|
||||
#if (defined(__APPLE__) || (defined(__MINGW32__) || defined(_MSC_VER))) && \
|
||||
__STDC_HOSTED__ && __has_include_next(<float.h>)
|
||||
|
||||
/* Prior to Apple's 10.7 SDK, float.h SDK header used to apply an extra level
|
||||
* of #include_next<float.h> to keep Metrowerks compilers happy. Avoid this
|
||||
* extra indirection.
|
||||
*/
|
||||
#ifdef __APPLE__
|
||||
#define _FLOAT_H_
|
||||
#endif
|
||||
|
||||
# include_next <float.h>
|
||||
|
||||
/* Undefine anything that we'll be redefining below. */
|
||||
# undef FLT_EVAL_METHOD
|
||||
# undef FLT_ROUNDS
|
||||
# undef FLT_RADIX
|
||||
# undef FLT_MANT_DIG
|
||||
# undef DBL_MANT_DIG
|
||||
# undef LDBL_MANT_DIG
|
||||
# if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__)
|
||||
# undef DECIMAL_DIG
|
||||
# endif
|
||||
# undef FLT_DIG
|
||||
# undef DBL_DIG
|
||||
# undef LDBL_DIG
|
||||
# undef FLT_MIN_EXP
|
||||
# undef DBL_MIN_EXP
|
||||
# undef LDBL_MIN_EXP
|
||||
# undef FLT_MIN_10_EXP
|
||||
# undef DBL_MIN_10_EXP
|
||||
# undef LDBL_MIN_10_EXP
|
||||
# undef FLT_MAX_EXP
|
||||
# undef DBL_MAX_EXP
|
||||
# undef LDBL_MAX_EXP
|
||||
# undef FLT_MAX_10_EXP
|
||||
# undef DBL_MAX_10_EXP
|
||||
# undef LDBL_MAX_10_EXP
|
||||
# undef FLT_MAX
|
||||
# undef DBL_MAX
|
||||
# undef LDBL_MAX
|
||||
# undef FLT_EPSILON
|
||||
# undef DBL_EPSILON
|
||||
# undef LDBL_EPSILON
|
||||
# undef FLT_MIN
|
||||
# undef DBL_MIN
|
||||
# undef LDBL_MIN
|
||||
# if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__)
|
||||
# undef FLT_TRUE_MIN
|
||||
# undef DBL_TRUE_MIN
|
||||
# undef LDBL_TRUE_MIN
|
||||
# undef FLT_DECIMAL_DIG
|
||||
# undef DBL_DECIMAL_DIG
|
||||
# undef LDBL_DECIMAL_DIG
|
||||
# undef FLT_HAS_SUBNORM
|
||||
# undef DBL_HAS_SUBNORM
|
||||
# undef LDBL_HAS_SUBNORM
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Characteristics of floating point types, C99 5.2.4.2.2 */
|
||||
|
||||
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
|
||||
#define FLT_ROUNDS (__builtin_flt_rounds())
|
||||
#define FLT_RADIX __FLT_RADIX__
|
||||
|
||||
#define FLT_MANT_DIG __FLT_MANT_DIG__
|
||||
#define DBL_MANT_DIG __DBL_MANT_DIG__
|
||||
#define LDBL_MANT_DIG __LDBL_MANT_DIG__
|
||||
|
||||
#if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__)
|
||||
# define DECIMAL_DIG __DECIMAL_DIG__
|
||||
#endif
|
||||
|
||||
#define FLT_DIG __FLT_DIG__
|
||||
#define DBL_DIG __DBL_DIG__
|
||||
#define LDBL_DIG __LDBL_DIG__
|
||||
|
||||
#define FLT_MIN_EXP __FLT_MIN_EXP__
|
||||
#define DBL_MIN_EXP __DBL_MIN_EXP__
|
||||
#define LDBL_MIN_EXP __LDBL_MIN_EXP__
|
||||
|
||||
#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
|
||||
#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
|
||||
#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
|
||||
|
||||
#define FLT_MAX_EXP __FLT_MAX_EXP__
|
||||
#define DBL_MAX_EXP __DBL_MAX_EXP__
|
||||
#define LDBL_MAX_EXP __LDBL_MAX_EXP__
|
||||
|
||||
#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
|
||||
#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
|
||||
#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
|
||||
|
||||
#define FLT_MAX __FLT_MAX__
|
||||
#define DBL_MAX __DBL_MAX__
|
||||
#define LDBL_MAX __LDBL_MAX__
|
||||
|
||||
#define FLT_EPSILON __FLT_EPSILON__
|
||||
#define DBL_EPSILON __DBL_EPSILON__
|
||||
#define LDBL_EPSILON __LDBL_EPSILON__
|
||||
|
||||
#define FLT_MIN __FLT_MIN__
|
||||
#define DBL_MIN __DBL_MIN__
|
||||
#define LDBL_MIN __LDBL_MIN__
|
||||
|
||||
#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__)
|
||||
# define FLT_TRUE_MIN __FLT_DENORM_MIN__
|
||||
# define DBL_TRUE_MIN __DBL_DENORM_MIN__
|
||||
# define LDBL_TRUE_MIN __LDBL_DENORM_MIN__
|
||||
# define FLT_DECIMAL_DIG __FLT_DECIMAL_DIG__
|
||||
# define DBL_DECIMAL_DIG __DBL_DECIMAL_DIG__
|
||||
# define LDBL_DECIMAL_DIG __LDBL_DECIMAL_DIG__
|
||||
# define FLT_HAS_SUBNORM __FLT_HAS_DENORM__
|
||||
# define DBL_HAS_SUBNORM __DBL_HAS_DENORM__
|
||||
# define LDBL_HAS_SUBNORM __LDBL_HAS_DENORM__
|
||||
#endif
|
||||
|
||||
#ifdef __STDC_WANT_IEC_60559_TYPES_EXT__
|
||||
# define FLT16_MANT_DIG __FLT16_MANT_DIG__
|
||||
# define FLT16_DECIMAL_DIG __FLT16_DECIMAL_DIG__
|
||||
# define FLT16_DIG __FLT16_DIG__
|
||||
# define FLT16_MIN_EXP __FLT16_MIN_EXP__
|
||||
# define FLT16_MIN_10_EXP __FLT16_MIN_10_EXP__
|
||||
# define FLT16_MAX_EXP __FLT16_MAX_EXP__
|
||||
# define FLT16_MAX_10_EXP __FLT16_MAX_10_EXP__
|
||||
# define FLT16_MAX __FLT16_MAX__
|
||||
# define FLT16_EPSILON __FLT16_EPSILON__
|
||||
# define FLT16_MIN __FLT16_MIN__
|
||||
# define FLT16_TRUE_MIN __FLT16_TRUE_MIN__
|
||||
#endif /* __STDC_WANT_IEC_60559_TYPES_EXT__ */
|
||||
|
||||
#endif /* __CLANG_FLOAT_H */
|
||||
@@ -1,232 +0,0 @@
|
||||
/*===---- fma4intrin.h - FMA4 intrinsics -----------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __X86INTRIN_H
|
||||
#error "Never use <fma4intrin.h> directly; include <x86intrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __FMA4INTRIN_H
|
||||
#define __FMA4INTRIN_H
|
||||
|
||||
#include <pmmintrin.h>
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("fma4"), __min_vector_width__(128)))
|
||||
#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("fma4"), __min_vector_width__(256)))
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_macc_ps(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_macc_pd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, (__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_macc_ss(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddss((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_macc_sd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddsd((__v2df)__A, (__v2df)__B, (__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_msub_ps(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_msub_pd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, -(__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_msub_ss(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddss((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_msub_sd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddsd((__v2df)__A, (__v2df)__B, -(__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_nmacc_ps(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_nmacc_pd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, (__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_nmacc_ss(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddss(-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_nmacc_sd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddsd(-(__v2df)__A, (__v2df)__B, (__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_nmsub_ps(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_nmsub_pd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, -(__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_nmsub_ss(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddss(-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_nmsub_sd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddsd(-(__v2df)__A, (__v2df)__B, -(__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_maddsub_ps(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddsubps((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_maddsub_pd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddsubpd((__v2df)__A, (__v2df)__B, (__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_msubadd_ps(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddsubps((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_msubadd_pd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddsubpd((__v2df)__A, (__v2df)__B, -(__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256 __DEFAULT_FN_ATTRS256
|
||||
_mm256_macc_ps(__m256 __A, __m256 __B, __m256 __C)
|
||||
{
|
||||
return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, (__v8sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256d __DEFAULT_FN_ATTRS256
|
||||
_mm256_macc_pd(__m256d __A, __m256d __B, __m256d __C)
|
||||
{
|
||||
return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, (__v4df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256 __DEFAULT_FN_ATTRS256
|
||||
_mm256_msub_ps(__m256 __A, __m256 __B, __m256 __C)
|
||||
{
|
||||
return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256d __DEFAULT_FN_ATTRS256
|
||||
_mm256_msub_pd(__m256d __A, __m256d __B, __m256d __C)
|
||||
{
|
||||
return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, -(__v4df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256 __DEFAULT_FN_ATTRS256
|
||||
_mm256_nmacc_ps(__m256 __A, __m256 __B, __m256 __C)
|
||||
{
|
||||
return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, (__v8sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256d __DEFAULT_FN_ATTRS256
|
||||
_mm256_nmacc_pd(__m256d __A, __m256d __B, __m256d __C)
|
||||
{
|
||||
return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, (__v4df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256 __DEFAULT_FN_ATTRS256
|
||||
_mm256_nmsub_ps(__m256 __A, __m256 __B, __m256 __C)
|
||||
{
|
||||
return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, -(__v8sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256d __DEFAULT_FN_ATTRS256
|
||||
_mm256_nmsub_pd(__m256d __A, __m256d __B, __m256d __C)
|
||||
{
|
||||
return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, -(__v4df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256 __DEFAULT_FN_ATTRS256
|
||||
_mm256_maddsub_ps(__m256 __A, __m256 __B, __m256 __C)
|
||||
{
|
||||
return (__m256)__builtin_ia32_vfmaddsubps256((__v8sf)__A, (__v8sf)__B, (__v8sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256d __DEFAULT_FN_ATTRS256
|
||||
_mm256_maddsub_pd(__m256d __A, __m256d __B, __m256d __C)
|
||||
{
|
||||
return (__m256d)__builtin_ia32_vfmaddsubpd256((__v4df)__A, (__v4df)__B, (__v4df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256 __DEFAULT_FN_ATTRS256
|
||||
_mm256_msubadd_ps(__m256 __A, __m256 __B, __m256 __C)
|
||||
{
|
||||
return (__m256)__builtin_ia32_vfmaddsubps256((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256d __DEFAULT_FN_ATTRS256
|
||||
_mm256_msubadd_pd(__m256d __A, __m256d __B, __m256d __C)
|
||||
{
|
||||
return (__m256d)__builtin_ia32_vfmaddsubpd256((__v4df)__A, (__v4df)__B, -(__v4df)__C);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS128
|
||||
#undef __DEFAULT_FN_ATTRS256
|
||||
|
||||
#endif /* __FMA4INTRIN_H */
|
||||
@@ -1,230 +0,0 @@
|
||||
/*===---- fmaintrin.h - FMA intrinsics -------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <fmaintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __FMAINTRIN_H
|
||||
#define __FMAINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("fma"), __min_vector_width__(128)))
|
||||
#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("fma"), __min_vector_width__(256)))
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_fmadd_ps(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_fmadd_pd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, (__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_fmadd_ss(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddss3((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_fmadd_sd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddsd3((__v2df)__A, (__v2df)__B, (__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_fmsub_ps(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddps((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_fmsub_pd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddpd((__v2df)__A, (__v2df)__B, -(__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_fmsub_ss(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddss3((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_fmsub_sd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddsd3((__v2df)__A, (__v2df)__B, -(__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_fnmadd_ps(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_fnmadd_pd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, (__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_fnmadd_ss(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddss3((__v4sf)__A, -(__v4sf)__B, (__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_fnmadd_sd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddsd3((__v2df)__A, -(__v2df)__B, (__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_fnmsub_ps(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddps(-(__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_fnmsub_pd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddpd(-(__v2df)__A, (__v2df)__B, -(__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_fnmsub_ss(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddss3((__v4sf)__A, -(__v4sf)__B, -(__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_fnmsub_sd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddsd3((__v2df)__A, -(__v2df)__B, -(__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_fmaddsub_ps(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddsubps((__v4sf)__A, (__v4sf)__B, (__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_fmaddsub_pd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddsubpd((__v2df)__A, (__v2df)__B, (__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_fmsubadd_ps(__m128 __A, __m128 __B, __m128 __C)
|
||||
{
|
||||
return (__m128)__builtin_ia32_vfmaddsubps((__v4sf)__A, (__v4sf)__B, -(__v4sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS128
|
||||
_mm_fmsubadd_pd(__m128d __A, __m128d __B, __m128d __C)
|
||||
{
|
||||
return (__m128d)__builtin_ia32_vfmaddsubpd((__v2df)__A, (__v2df)__B, -(__v2df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256 __DEFAULT_FN_ATTRS256
|
||||
_mm256_fmadd_ps(__m256 __A, __m256 __B, __m256 __C)
|
||||
{
|
||||
return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, (__v8sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256d __DEFAULT_FN_ATTRS256
|
||||
_mm256_fmadd_pd(__m256d __A, __m256d __B, __m256d __C)
|
||||
{
|
||||
return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, (__v4df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256 __DEFAULT_FN_ATTRS256
|
||||
_mm256_fmsub_ps(__m256 __A, __m256 __B, __m256 __C)
|
||||
{
|
||||
return (__m256)__builtin_ia32_vfmaddps256((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256d __DEFAULT_FN_ATTRS256
|
||||
_mm256_fmsub_pd(__m256d __A, __m256d __B, __m256d __C)
|
||||
{
|
||||
return (__m256d)__builtin_ia32_vfmaddpd256((__v4df)__A, (__v4df)__B, -(__v4df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256 __DEFAULT_FN_ATTRS256
|
||||
_mm256_fnmadd_ps(__m256 __A, __m256 __B, __m256 __C)
|
||||
{
|
||||
return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, (__v8sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256d __DEFAULT_FN_ATTRS256
|
||||
_mm256_fnmadd_pd(__m256d __A, __m256d __B, __m256d __C)
|
||||
{
|
||||
return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, (__v4df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256 __DEFAULT_FN_ATTRS256
|
||||
_mm256_fnmsub_ps(__m256 __A, __m256 __B, __m256 __C)
|
||||
{
|
||||
return (__m256)__builtin_ia32_vfmaddps256(-(__v8sf)__A, (__v8sf)__B, -(__v8sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256d __DEFAULT_FN_ATTRS256
|
||||
_mm256_fnmsub_pd(__m256d __A, __m256d __B, __m256d __C)
|
||||
{
|
||||
return (__m256d)__builtin_ia32_vfmaddpd256(-(__v4df)__A, (__v4df)__B, -(__v4df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256 __DEFAULT_FN_ATTRS256
|
||||
_mm256_fmaddsub_ps(__m256 __A, __m256 __B, __m256 __C)
|
||||
{
|
||||
return (__m256)__builtin_ia32_vfmaddsubps256((__v8sf)__A, (__v8sf)__B, (__v8sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256d __DEFAULT_FN_ATTRS256
|
||||
_mm256_fmaddsub_pd(__m256d __A, __m256d __B, __m256d __C)
|
||||
{
|
||||
return (__m256d)__builtin_ia32_vfmaddsubpd256((__v4df)__A, (__v4df)__B, (__v4df)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256 __DEFAULT_FN_ATTRS256
|
||||
_mm256_fmsubadd_ps(__m256 __A, __m256 __B, __m256 __C)
|
||||
{
|
||||
return (__m256)__builtin_ia32_vfmaddsubps256((__v8sf)__A, (__v8sf)__B, -(__v8sf)__C);
|
||||
}
|
||||
|
||||
static __inline__ __m256d __DEFAULT_FN_ATTRS256
|
||||
_mm256_fmsubadd_pd(__m256d __A, __m256d __B, __m256d __C)
|
||||
{
|
||||
return (__m256d)__builtin_ia32_vfmaddsubpd256((__v4df)__A, (__v4df)__B, -(__v4df)__C);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS128
|
||||
#undef __DEFAULT_FN_ATTRS256
|
||||
|
||||
#endif /* __FMAINTRIN_H */
|
||||
@@ -1,105 +0,0 @@
|
||||
/*===---- fxsrintrin.h - FXSR intrinsic ------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <fxsrintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __FXSRINTRIN_H
|
||||
#define __FXSRINTRIN_H
|
||||
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("fxsr")))
|
||||
|
||||
/// Saves the XMM, MMX, MXCSR and x87 FPU registers into a 512-byte
|
||||
/// memory region pointed to by the input parameter \a __p.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> FXSAVE </c> instruction.
|
||||
///
|
||||
/// \param __p
|
||||
/// A pointer to a 512-byte memory region. The beginning of this memory
|
||||
/// region should be aligned on a 16-byte boundary.
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_fxsave(void *__p)
|
||||
{
|
||||
__builtin_ia32_fxsave(__p);
|
||||
}
|
||||
|
||||
/// Restores the XMM, MMX, MXCSR and x87 FPU registers from the 512-byte
|
||||
/// memory region pointed to by the input parameter \a __p. The contents of
|
||||
/// this memory region should have been written to by a previous \c _fxsave
|
||||
/// or \c _fxsave64 intrinsic.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> FXRSTOR </c> instruction.
|
||||
///
|
||||
/// \param __p
|
||||
/// A pointer to a 512-byte memory region. The beginning of this memory
|
||||
/// region should be aligned on a 16-byte boundary.
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_fxrstor(void *__p)
|
||||
{
|
||||
__builtin_ia32_fxrstor(__p);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
/// Saves the XMM, MMX, MXCSR and x87 FPU registers into a 512-byte
|
||||
/// memory region pointed to by the input parameter \a __p.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> FXSAVE64 </c> instruction.
|
||||
///
|
||||
/// \param __p
|
||||
/// A pointer to a 512-byte memory region. The beginning of this memory
|
||||
/// region should be aligned on a 16-byte boundary.
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_fxsave64(void *__p)
|
||||
{
|
||||
__builtin_ia32_fxsave64(__p);
|
||||
}
|
||||
|
||||
/// Restores the XMM, MMX, MXCSR and x87 FPU registers from the 512-byte
|
||||
/// memory region pointed to by the input parameter \a __p. The contents of
|
||||
/// this memory region should have been written to by a previous \c _fxsave
|
||||
/// or \c _fxsave64 intrinsic.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> FXRSTOR64 </c> instruction.
|
||||
///
|
||||
/// \param __p
|
||||
/// A pointer to a 512-byte memory region. The beginning of this memory
|
||||
/// region should be aligned on a 16-byte boundary.
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_fxrstor64(void *__p)
|
||||
{
|
||||
__builtin_ia32_fxrstor64(__p);
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
@@ -1,208 +0,0 @@
|
||||
/*===----------------- gfniintrin.h - GFNI intrinsics ----------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <gfniintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __GFNIINTRIN_H
|
||||
#define __GFNIINTRIN_H
|
||||
|
||||
|
||||
#define _mm_gf2p8affineinv_epi64_epi8(A, B, I) \
|
||||
(__m128i)__builtin_ia32_vgf2p8affineinvqb_v16qi((__v16qi)(__m128i)(A), \
|
||||
(__v16qi)(__m128i)(B), \
|
||||
(char)(I))
|
||||
|
||||
#define _mm_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) \
|
||||
(__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \
|
||||
(__v16qi)_mm_gf2p8affineinv_epi64_epi8(A, B, I), \
|
||||
(__v16qi)(__m128i)(S))
|
||||
|
||||
|
||||
#define _mm_maskz_gf2p8affineinv_epi64_epi8(U, A, B, I) \
|
||||
(__m128i)_mm_mask_gf2p8affineinv_epi64_epi8((__m128i)_mm_setzero_si128(), \
|
||||
U, A, B, I)
|
||||
|
||||
|
||||
#define _mm256_gf2p8affineinv_epi64_epi8(A, B, I) \
|
||||
(__m256i)__builtin_ia32_vgf2p8affineinvqb_v32qi((__v32qi)(__m256i)(A), \
|
||||
(__v32qi)(__m256i)(B), \
|
||||
(char)(I))
|
||||
|
||||
#define _mm256_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) \
|
||||
(__m256i)__builtin_ia32_selectb_256((__mmask32)(U), \
|
||||
(__v32qi)_mm256_gf2p8affineinv_epi64_epi8(A, B, I), \
|
||||
(__v32qi)(__m256i)(S))
|
||||
|
||||
#define _mm256_maskz_gf2p8affineinv_epi64_epi8(U, A, B, I) \
|
||||
(__m256i)_mm256_mask_gf2p8affineinv_epi64_epi8((__m256i)_mm256_setzero_si256(), \
|
||||
U, A, B, I)
|
||||
|
||||
|
||||
#define _mm512_gf2p8affineinv_epi64_epi8(A, B, I) \
|
||||
(__m512i)__builtin_ia32_vgf2p8affineinvqb_v64qi((__v64qi)(__m512i)(A), \
|
||||
(__v64qi)(__m512i)(B), \
|
||||
(char)(I))
|
||||
|
||||
#define _mm512_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) \
|
||||
(__m512i)__builtin_ia32_selectb_512((__mmask64)(U), \
|
||||
(__v64qi)_mm512_gf2p8affineinv_epi64_epi8(A, B, I), \
|
||||
(__v64qi)(__m512i)(S))
|
||||
|
||||
#define _mm512_maskz_gf2p8affineinv_epi64_epi8(U, A, B, I) \
|
||||
(__m512i)_mm512_mask_gf2p8affineinv_epi64_epi8((__m512i)_mm512_setzero_si512(), \
|
||||
U, A, B, I)
|
||||
|
||||
#define _mm_gf2p8affine_epi64_epi8(A, B, I) \
|
||||
(__m128i)__builtin_ia32_vgf2p8affineqb_v16qi((__v16qi)(__m128i)(A), \
|
||||
(__v16qi)(__m128i)(B), \
|
||||
(char)(I))
|
||||
|
||||
#define _mm_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) \
|
||||
(__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \
|
||||
(__v16qi)_mm_gf2p8affine_epi64_epi8(A, B, I), \
|
||||
(__v16qi)(__m128i)(S))
|
||||
|
||||
|
||||
#define _mm_maskz_gf2p8affine_epi64_epi8(U, A, B, I) \
|
||||
(__m128i)_mm_mask_gf2p8affine_epi64_epi8((__m128i)_mm_setzero_si128(), \
|
||||
U, A, B, I)
|
||||
|
||||
|
||||
#define _mm256_gf2p8affine_epi64_epi8(A, B, I) \
|
||||
(__m256i)__builtin_ia32_vgf2p8affineqb_v32qi((__v32qi)(__m256i)(A), \
|
||||
(__v32qi)(__m256i)(B), \
|
||||
(char)(I))
|
||||
|
||||
#define _mm256_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) \
|
||||
(__m256i)__builtin_ia32_selectb_256((__mmask32)(U), \
|
||||
(__v32qi)_mm256_gf2p8affine_epi64_epi8(A, B, I), \
|
||||
(__v32qi)(__m256i)(S))
|
||||
|
||||
#define _mm256_maskz_gf2p8affine_epi64_epi8(U, A, B, I) \
|
||||
(__m256i)_mm256_mask_gf2p8affine_epi64_epi8((__m256i)_mm256_setzero_si256(), \
|
||||
U, A, B, I)
|
||||
|
||||
|
||||
#define _mm512_gf2p8affine_epi64_epi8(A, B, I) \
|
||||
(__m512i)__builtin_ia32_vgf2p8affineqb_v64qi((__v64qi)(__m512i)(A), \
|
||||
(__v64qi)(__m512i)(B), \
|
||||
(char)(I))
|
||||
|
||||
#define _mm512_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) \
|
||||
(__m512i)__builtin_ia32_selectb_512((__mmask64)(U), \
|
||||
(__v64qi)_mm512_gf2p8affine_epi64_epi8(A, B, I), \
|
||||
(__v64qi)(__m512i)(S))
|
||||
|
||||
#define _mm512_maskz_gf2p8affine_epi64_epi8(U, A, B, I) \
|
||||
(__m512i)_mm512_mask_gf2p8affine_epi64_epi8((__m512i)_mm512_setzero_si512(), \
|
||||
U, A, B, I)
|
||||
|
||||
/* Default attributes for simple form (no masking). */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("gfni"), __min_vector_width__(128)))
|
||||
|
||||
/* Default attributes for YMM unmasked form. */
|
||||
#define __DEFAULT_FN_ATTRS_Y __attribute__((__always_inline__, __nodebug__, __target__("avx,gfni"), __min_vector_width__(256)))
|
||||
|
||||
/* Default attributes for ZMM forms. */
|
||||
#define __DEFAULT_FN_ATTRS_Z __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,gfni"), __min_vector_width__(512)))
|
||||
|
||||
/* Default attributes for VLX forms. */
|
||||
#define __DEFAULT_FN_ATTRS_VL128 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,avx512vl,gfni"), __min_vector_width__(128)))
|
||||
#define __DEFAULT_FN_ATTRS_VL256 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,avx512vl,gfni"), __min_vector_width__(256)))
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_gf2p8mul_epi8(__m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_vgf2p8mulb_v16qi((__v16qi) __A,
|
||||
(__v16qi) __B);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS_VL128
|
||||
_mm_mask_gf2p8mul_epi8(__m128i __S, __mmask16 __U, __m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i) __builtin_ia32_selectb_128(__U,
|
||||
(__v16qi) _mm_gf2p8mul_epi8(__A, __B),
|
||||
(__v16qi) __S);
|
||||
}
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS_VL128
|
||||
_mm_maskz_gf2p8mul_epi8(__mmask16 __U, __m128i __A, __m128i __B)
|
||||
{
|
||||
return _mm_mask_gf2p8mul_epi8((__m128i)_mm_setzero_si128(),
|
||||
__U, __A, __B);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS_Y
|
||||
_mm256_gf2p8mul_epi8(__m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_vgf2p8mulb_v32qi((__v32qi) __A,
|
||||
(__v32qi) __B);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS_VL256
|
||||
_mm256_mask_gf2p8mul_epi8(__m256i __S, __mmask32 __U, __m256i __A, __m256i __B)
|
||||
{
|
||||
return (__m256i) __builtin_ia32_selectb_256(__U,
|
||||
(__v32qi) _mm256_gf2p8mul_epi8(__A, __B),
|
||||
(__v32qi) __S);
|
||||
}
|
||||
|
||||
static __inline__ __m256i __DEFAULT_FN_ATTRS_VL256
|
||||
_mm256_maskz_gf2p8mul_epi8(__mmask32 __U, __m256i __A, __m256i __B)
|
||||
{
|
||||
return _mm256_mask_gf2p8mul_epi8((__m256i)_mm256_setzero_si256(),
|
||||
__U, __A, __B);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS_Z
|
||||
_mm512_gf2p8mul_epi8(__m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vgf2p8mulb_v64qi((__v64qi) __A,
|
||||
(__v64qi) __B);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS_Z
|
||||
_mm512_mask_gf2p8mul_epi8(__m512i __S, __mmask64 __U, __m512i __A, __m512i __B)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_selectb_512(__U,
|
||||
(__v64qi) _mm512_gf2p8mul_epi8(__A, __B),
|
||||
(__v64qi) __S);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS_Z
|
||||
_mm512_maskz_gf2p8mul_epi8(__mmask64 __U, __m512i __A, __m512i __B)
|
||||
{
|
||||
return _mm512_mask_gf2p8mul_epi8((__m512i)_mm512_setzero_si512(),
|
||||
__U, __A, __B);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
#undef __DEFAULT_FN_ATTRS_Y
|
||||
#undef __DEFAULT_FN_ATTRS_Z
|
||||
#undef __DEFAULT_FN_ATTRS_VL128
|
||||
#undef __DEFAULT_FN_ATTRS_VL256
|
||||
|
||||
#endif /* __GFNIINTRIN_H */
|
||||
|
||||
@@ -1,226 +0,0 @@
|
||||
/*===---- htmintrin.h - Standard header for PowerPC HTM ---------------===*\
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
\*===----------------------------------------------------------------------===*/
|
||||
|
||||
#ifndef __HTMINTRIN_H
|
||||
#define __HTMINTRIN_H
|
||||
|
||||
#ifndef __HTM__
|
||||
#error "HTM instruction set not enabled"
|
||||
#endif
|
||||
|
||||
#ifdef __powerpc__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef uint64_t texasr_t;
|
||||
typedef uint32_t texasru_t;
|
||||
typedef uint32_t texasrl_t;
|
||||
typedef uintptr_t tfiar_t;
|
||||
typedef uintptr_t tfhar_t;
|
||||
|
||||
#define _HTM_STATE(CR0) ((CR0 >> 1) & 0x3)
|
||||
#define _HTM_NONTRANSACTIONAL 0x0
|
||||
#define _HTM_SUSPENDED 0x1
|
||||
#define _HTM_TRANSACTIONAL 0x2
|
||||
|
||||
#define _TEXASR_EXTRACT_BITS(TEXASR,BITNUM,SIZE) \
|
||||
(((TEXASR) >> (63-(BITNUM))) & ((1<<(SIZE))-1))
|
||||
#define _TEXASRU_EXTRACT_BITS(TEXASR,BITNUM,SIZE) \
|
||||
(((TEXASR) >> (31-(BITNUM))) & ((1<<(SIZE))-1))
|
||||
|
||||
#define _TEXASR_FAILURE_CODE(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 7, 8)
|
||||
#define _TEXASRU_FAILURE_CODE(TEXASRU) \
|
||||
_TEXASRU_EXTRACT_BITS(TEXASRU, 7, 8)
|
||||
|
||||
#define _TEXASR_FAILURE_PERSISTENT(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 7, 1)
|
||||
#define _TEXASRU_FAILURE_PERSISTENT(TEXASRU) \
|
||||
_TEXASRU_EXTRACT_BITS(TEXASRU, 7, 1)
|
||||
|
||||
#define _TEXASR_DISALLOWED(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 8, 1)
|
||||
#define _TEXASRU_DISALLOWED(TEXASRU) \
|
||||
_TEXASRU_EXTRACT_BITS(TEXASRU, 8, 1)
|
||||
|
||||
#define _TEXASR_NESTING_OVERFLOW(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 9, 1)
|
||||
#define _TEXASRU_NESTING_OVERFLOW(TEXASRU) \
|
||||
_TEXASRU_EXTRACT_BITS(TEXASRU, 9, 1)
|
||||
|
||||
#define _TEXASR_FOOTPRINT_OVERFLOW(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 10, 1)
|
||||
#define _TEXASRU_FOOTPRINT_OVERFLOW(TEXASRU) \
|
||||
_TEXASRU_EXTRACT_BITS(TEXASRU, 10, 1)
|
||||
|
||||
#define _TEXASR_SELF_INDUCED_CONFLICT(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 11, 1)
|
||||
#define _TEXASRU_SELF_INDUCED_CONFLICT(TEXASRU) \
|
||||
_TEXASRU_EXTRACT_BITS(TEXASRU, 11, 1)
|
||||
|
||||
#define _TEXASR_NON_TRANSACTIONAL_CONFLICT(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 12, 1)
|
||||
#define _TEXASRU_NON_TRANSACTIONAL_CONFLICT(TEXASRU) \
|
||||
_TEXASRU_EXTRACT_BITS(TEXASRU, 12, 1)
|
||||
|
||||
#define _TEXASR_TRANSACTION_CONFLICT(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 13, 1)
|
||||
#define _TEXASRU_TRANSACTION_CONFLICT(TEXASRU) \
|
||||
_TEXASRU_EXTRACT_BITS(TEXASRU, 13, 1)
|
||||
|
||||
#define _TEXASR_TRANSLATION_INVALIDATION_CONFLICT(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 14, 1)
|
||||
#define _TEXASRU_TRANSLATION_INVALIDATION_CONFLICT(TEXASRU) \
|
||||
_TEXASRU_EXTRACT_BITS(TEXASRU, 14, 1)
|
||||
|
||||
#define _TEXASR_IMPLEMENTAION_SPECIFIC(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 15, 1)
|
||||
#define _TEXASRU_IMPLEMENTAION_SPECIFIC(TEXASRU) \
|
||||
_TEXASRU_EXTRACT_BITS(TEXASRU, 15, 1)
|
||||
|
||||
#define _TEXASR_INSTRUCTION_FETCH_CONFLICT(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 16, 1)
|
||||
#define _TEXASRU_INSTRUCTION_FETCH_CONFLICT(TEXASRU) \
|
||||
_TEXASRU_EXTRACT_BITS(TEXASRU, 16, 1)
|
||||
|
||||
#define _TEXASR_ABORT(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 31, 1)
|
||||
#define _TEXASRU_ABORT(TEXASRU) \
|
||||
_TEXASRU_EXTRACT_BITS(TEXASRU, 31, 1)
|
||||
|
||||
|
||||
#define _TEXASR_SUSPENDED(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 32, 1)
|
||||
|
||||
#define _TEXASR_PRIVILEGE(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 35, 2)
|
||||
|
||||
#define _TEXASR_FAILURE_SUMMARY(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 36, 1)
|
||||
|
||||
#define _TEXASR_TFIAR_EXACT(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 37, 1)
|
||||
|
||||
#define _TEXASR_ROT(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 38, 1)
|
||||
|
||||
#define _TEXASR_TRANSACTION_LEVEL(TEXASR) \
|
||||
_TEXASR_EXTRACT_BITS(TEXASR, 63, 12)
|
||||
|
||||
#endif /* __powerpc */
|
||||
|
||||
#ifdef __s390__
|
||||
|
||||
/* Condition codes generated by tbegin */
|
||||
#define _HTM_TBEGIN_STARTED 0
|
||||
#define _HTM_TBEGIN_INDETERMINATE 1
|
||||
#define _HTM_TBEGIN_TRANSIENT 2
|
||||
#define _HTM_TBEGIN_PERSISTENT 3
|
||||
|
||||
/* The abort codes below this threshold are reserved for machine use. */
|
||||
#define _HTM_FIRST_USER_ABORT_CODE 256
|
||||
|
||||
/* The transaction diagnostic block is it is defined in the Principles
|
||||
of Operation chapter 5-91. */
|
||||
|
||||
struct __htm_tdb {
|
||||
unsigned char format; /* 0 */
|
||||
unsigned char flags;
|
||||
unsigned char reserved1[4];
|
||||
unsigned short nesting_depth;
|
||||
unsigned long long abort_code; /* 8 */
|
||||
unsigned long long conflict_token; /* 16 */
|
||||
unsigned long long atia; /* 24 */
|
||||
unsigned char eaid; /* 32 */
|
||||
unsigned char dxc;
|
||||
unsigned char reserved2[2];
|
||||
unsigned int program_int_id;
|
||||
unsigned long long exception_id; /* 40 */
|
||||
unsigned long long bea; /* 48 */
|
||||
unsigned char reserved3[72]; /* 56 */
|
||||
unsigned long long gprs[16]; /* 128 */
|
||||
} __attribute__((__packed__, __aligned__ (8)));
|
||||
|
||||
|
||||
/* Helper intrinsics to retry tbegin in case of transient failure. */
|
||||
|
||||
static __inline int __attribute__((__always_inline__, __nodebug__))
|
||||
__builtin_tbegin_retry_null (int __retry)
|
||||
{
|
||||
int cc, i = 0;
|
||||
|
||||
while ((cc = __builtin_tbegin(0)) == _HTM_TBEGIN_TRANSIENT
|
||||
&& i++ < __retry)
|
||||
__builtin_tx_assist(i);
|
||||
|
||||
return cc;
|
||||
}
|
||||
|
||||
static __inline int __attribute__((__always_inline__, __nodebug__))
|
||||
__builtin_tbegin_retry_tdb (void *__tdb, int __retry)
|
||||
{
|
||||
int cc, i = 0;
|
||||
|
||||
while ((cc = __builtin_tbegin(__tdb)) == _HTM_TBEGIN_TRANSIENT
|
||||
&& i++ < __retry)
|
||||
__builtin_tx_assist(i);
|
||||
|
||||
return cc;
|
||||
}
|
||||
|
||||
#define __builtin_tbegin_retry(tdb, retry) \
|
||||
(__builtin_constant_p(tdb == 0) && tdb == 0 ? \
|
||||
__builtin_tbegin_retry_null(retry) : \
|
||||
__builtin_tbegin_retry_tdb(tdb, retry))
|
||||
|
||||
static __inline int __attribute__((__always_inline__, __nodebug__))
|
||||
__builtin_tbegin_retry_nofloat_null (int __retry)
|
||||
{
|
||||
int cc, i = 0;
|
||||
|
||||
while ((cc = __builtin_tbegin_nofloat(0)) == _HTM_TBEGIN_TRANSIENT
|
||||
&& i++ < __retry)
|
||||
__builtin_tx_assist(i);
|
||||
|
||||
return cc;
|
||||
}
|
||||
|
||||
static __inline int __attribute__((__always_inline__, __nodebug__))
|
||||
__builtin_tbegin_retry_nofloat_tdb (void *__tdb, int __retry)
|
||||
{
|
||||
int cc, i = 0;
|
||||
|
||||
while ((cc = __builtin_tbegin_nofloat(__tdb)) == _HTM_TBEGIN_TRANSIENT
|
||||
&& i++ < __retry)
|
||||
__builtin_tx_assist(i);
|
||||
|
||||
return cc;
|
||||
}
|
||||
|
||||
#define __builtin_tbegin_retry_nofloat(tdb, retry) \
|
||||
(__builtin_constant_p(tdb == 0) && tdb == 0 ? \
|
||||
__builtin_tbegin_retry_nofloat_null(retry) : \
|
||||
__builtin_tbegin_retry_nofloat_tdb(tdb, retry))
|
||||
|
||||
#endif /* __s390__ */
|
||||
|
||||
#endif /* __HTMINTRIN_H */
|
||||
@@ -1,359 +0,0 @@
|
||||
/*===---- htmxlintrin.h - XL compiler HTM execution intrinsics-------------===*\
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
\*===----------------------------------------------------------------------===*/
|
||||
|
||||
#ifndef __HTMXLINTRIN_H
|
||||
#define __HTMXLINTRIN_H
|
||||
|
||||
#ifndef __HTM__
|
||||
#error "HTM instruction set not enabled"
|
||||
#endif
|
||||
|
||||
#include <htmintrin.h>
|
||||
|
||||
#ifdef __powerpc__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define _TEXASR_PTR(TM_BUF) ((texasr_t *)((char *)(TM_BUF) + 0))
|
||||
#define _TEXASRU_PTR(TM_BUF) ((texasru_t *)((char *)(TM_BUF) + 0))
|
||||
#define _TEXASRL_PTR(TM_BUF) ((texasrl_t *)((char *)(TM_BUF) + 4))
|
||||
#define _TFIAR_PTR(TM_BUF) ((tfiar_t *)((char *)(TM_BUF) + 8))
|
||||
|
||||
typedef char TM_buff_type[16];
|
||||
|
||||
/* This macro can be used to determine whether a transaction was successfully
|
||||
started from the __TM_begin() and __TM_simple_begin() intrinsic functions
|
||||
below. */
|
||||
#define _HTM_TBEGIN_STARTED 1
|
||||
|
||||
extern __inline long
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_simple_begin (void)
|
||||
{
|
||||
if (__builtin_expect (__builtin_tbegin (0), 1))
|
||||
return _HTM_TBEGIN_STARTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern __inline long
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_begin (void* const __TM_buff)
|
||||
{
|
||||
*_TEXASRL_PTR (__TM_buff) = 0;
|
||||
if (__builtin_expect (__builtin_tbegin (0), 1))
|
||||
return _HTM_TBEGIN_STARTED;
|
||||
#ifdef __powerpc64__
|
||||
*_TEXASR_PTR (__TM_buff) = __builtin_get_texasr ();
|
||||
#else
|
||||
*_TEXASRU_PTR (__TM_buff) = __builtin_get_texasru ();
|
||||
*_TEXASRL_PTR (__TM_buff) = __builtin_get_texasr ();
|
||||
#endif
|
||||
*_TFIAR_PTR (__TM_buff) = __builtin_get_tfiar ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern __inline long
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_end (void)
|
||||
{
|
||||
if (__builtin_expect (__builtin_tend (0), 1))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern __inline void
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_abort (void)
|
||||
{
|
||||
__builtin_tabort (0);
|
||||
}
|
||||
|
||||
extern __inline void
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_named_abort (unsigned char const __code)
|
||||
{
|
||||
__builtin_tabort (__code);
|
||||
}
|
||||
|
||||
extern __inline void
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_resume (void)
|
||||
{
|
||||
__builtin_tresume ();
|
||||
}
|
||||
|
||||
extern __inline void
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_suspend (void)
|
||||
{
|
||||
__builtin_tsuspend ();
|
||||
}
|
||||
|
||||
extern __inline long
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_is_user_abort (void* const __TM_buff)
|
||||
{
|
||||
texasru_t texasru = *_TEXASRU_PTR (__TM_buff);
|
||||
return _TEXASRU_ABORT (texasru);
|
||||
}
|
||||
|
||||
extern __inline long
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_is_named_user_abort (void* const __TM_buff, unsigned char *__code)
|
||||
{
|
||||
texasru_t texasru = *_TEXASRU_PTR (__TM_buff);
|
||||
|
||||
*__code = _TEXASRU_FAILURE_CODE (texasru);
|
||||
return _TEXASRU_ABORT (texasru);
|
||||
}
|
||||
|
||||
extern __inline long
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_is_illegal (void* const __TM_buff)
|
||||
{
|
||||
texasru_t texasru = *_TEXASRU_PTR (__TM_buff);
|
||||
return _TEXASRU_DISALLOWED (texasru);
|
||||
}
|
||||
|
||||
extern __inline long
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_is_footprint_exceeded (void* const __TM_buff)
|
||||
{
|
||||
texasru_t texasru = *_TEXASRU_PTR (__TM_buff);
|
||||
return _TEXASRU_FOOTPRINT_OVERFLOW (texasru);
|
||||
}
|
||||
|
||||
extern __inline long
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_nesting_depth (void* const __TM_buff)
|
||||
{
|
||||
texasrl_t texasrl;
|
||||
|
||||
if (_HTM_STATE (__builtin_ttest ()) == _HTM_NONTRANSACTIONAL)
|
||||
{
|
||||
texasrl = *_TEXASRL_PTR (__TM_buff);
|
||||
if (!_TEXASR_FAILURE_SUMMARY (texasrl))
|
||||
texasrl = 0;
|
||||
}
|
||||
else
|
||||
texasrl = (texasrl_t) __builtin_get_texasr ();
|
||||
|
||||
return _TEXASR_TRANSACTION_LEVEL (texasrl);
|
||||
}
|
||||
|
||||
extern __inline long
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_is_nested_too_deep(void* const __TM_buff)
|
||||
{
|
||||
texasru_t texasru = *_TEXASRU_PTR (__TM_buff);
|
||||
return _TEXASRU_NESTING_OVERFLOW (texasru);
|
||||
}
|
||||
|
||||
extern __inline long
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_is_conflict(void* const __TM_buff)
|
||||
{
|
||||
texasru_t texasru = *_TEXASRU_PTR (__TM_buff);
|
||||
/* Return TEXASR bits 11 (Self-Induced Conflict) through
|
||||
14 (Translation Invalidation Conflict). */
|
||||
return (_TEXASRU_EXTRACT_BITS (texasru, 14, 4)) ? 1 : 0;
|
||||
}
|
||||
|
||||
extern __inline long
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_is_failure_persistent(void* const __TM_buff)
|
||||
{
|
||||
texasru_t texasru = *_TEXASRU_PTR (__TM_buff);
|
||||
return _TEXASRU_FAILURE_PERSISTENT (texasru);
|
||||
}
|
||||
|
||||
extern __inline long
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_failure_address(void* const __TM_buff)
|
||||
{
|
||||
return *_TFIAR_PTR (__TM_buff);
|
||||
}
|
||||
|
||||
extern __inline long long
|
||||
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
|
||||
__TM_failure_code(void* const __TM_buff)
|
||||
{
|
||||
return *_TEXASR_PTR (__TM_buff);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __powerpc__ */
|
||||
|
||||
#ifdef __s390__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* These intrinsics are being made available for compatibility with
|
||||
the IBM XL compiler. For documentation please see the "z/OS XL
|
||||
C/C++ Programming Guide" publicly available on the web. */
|
||||
|
||||
static __inline long __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_simple_begin ()
|
||||
{
|
||||
return __builtin_tbegin_nofloat (0);
|
||||
}
|
||||
|
||||
static __inline long __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_begin (void* const __tdb)
|
||||
{
|
||||
return __builtin_tbegin_nofloat (__tdb);
|
||||
}
|
||||
|
||||
static __inline long __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_end ()
|
||||
{
|
||||
return __builtin_tend ();
|
||||
}
|
||||
|
||||
static __inline void __attribute__((__always_inline__))
|
||||
__TM_abort ()
|
||||
{
|
||||
return __builtin_tabort (_HTM_FIRST_USER_ABORT_CODE);
|
||||
}
|
||||
|
||||
static __inline void __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_named_abort (unsigned char const __code)
|
||||
{
|
||||
return __builtin_tabort ((int)_HTM_FIRST_USER_ABORT_CODE + __code);
|
||||
}
|
||||
|
||||
static __inline void __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_non_transactional_store (void* const __addr, long long const __value)
|
||||
{
|
||||
__builtin_non_tx_store ((uint64_t*)__addr, (uint64_t)__value);
|
||||
}
|
||||
|
||||
static __inline long __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_nesting_depth (void* const __tdb_ptr)
|
||||
{
|
||||
int depth = __builtin_tx_nesting_depth ();
|
||||
struct __htm_tdb *tdb = (struct __htm_tdb*)__tdb_ptr;
|
||||
|
||||
if (depth != 0)
|
||||
return depth;
|
||||
|
||||
if (tdb->format != 1)
|
||||
return 0;
|
||||
return tdb->nesting_depth;
|
||||
}
|
||||
|
||||
/* Transaction failure diagnostics */
|
||||
|
||||
static __inline long __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_is_user_abort (void* const __tdb_ptr)
|
||||
{
|
||||
struct __htm_tdb *tdb = (struct __htm_tdb*)__tdb_ptr;
|
||||
|
||||
if (tdb->format != 1)
|
||||
return 0;
|
||||
|
||||
return !!(tdb->abort_code >= _HTM_FIRST_USER_ABORT_CODE);
|
||||
}
|
||||
|
||||
static __inline long __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_is_named_user_abort (void* const __tdb_ptr, unsigned char* __code)
|
||||
{
|
||||
struct __htm_tdb *tdb = (struct __htm_tdb*)__tdb_ptr;
|
||||
|
||||
if (tdb->format != 1)
|
||||
return 0;
|
||||
|
||||
if (tdb->abort_code >= _HTM_FIRST_USER_ABORT_CODE)
|
||||
{
|
||||
*__code = tdb->abort_code - _HTM_FIRST_USER_ABORT_CODE;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __inline long __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_is_illegal (void* const __tdb_ptr)
|
||||
{
|
||||
struct __htm_tdb *tdb = (struct __htm_tdb*)__tdb_ptr;
|
||||
|
||||
return (tdb->format == 1
|
||||
&& (tdb->abort_code == 4 /* unfiltered program interruption */
|
||||
|| tdb->abort_code == 11 /* restricted instruction */));
|
||||
}
|
||||
|
||||
static __inline long __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_is_footprint_exceeded (void* const __tdb_ptr)
|
||||
{
|
||||
struct __htm_tdb *tdb = (struct __htm_tdb*)__tdb_ptr;
|
||||
|
||||
return (tdb->format == 1
|
||||
&& (tdb->abort_code == 7 /* fetch overflow */
|
||||
|| tdb->abort_code == 8 /* store overflow */));
|
||||
}
|
||||
|
||||
static __inline long __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_is_nested_too_deep (void* const __tdb_ptr)
|
||||
{
|
||||
struct __htm_tdb *tdb = (struct __htm_tdb*)__tdb_ptr;
|
||||
|
||||
return tdb->format == 1 && tdb->abort_code == 13; /* depth exceeded */
|
||||
}
|
||||
|
||||
static __inline long __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_is_conflict (void* const __tdb_ptr)
|
||||
{
|
||||
struct __htm_tdb *tdb = (struct __htm_tdb*)__tdb_ptr;
|
||||
|
||||
return (tdb->format == 1
|
||||
&& (tdb->abort_code == 9 /* fetch conflict */
|
||||
|| tdb->abort_code == 10 /* store conflict */));
|
||||
}
|
||||
|
||||
static __inline long __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_is_failure_persistent (long const __result)
|
||||
{
|
||||
return __result == _HTM_TBEGIN_PERSISTENT;
|
||||
}
|
||||
|
||||
static __inline long __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_failure_address (void* const __tdb_ptr)
|
||||
{
|
||||
struct __htm_tdb *tdb = (struct __htm_tdb*)__tdb_ptr;
|
||||
return tdb->atia;
|
||||
}
|
||||
|
||||
static __inline long __attribute__((__always_inline__, __nodebug__))
|
||||
__TM_failure_code (void* const __tdb_ptr)
|
||||
{
|
||||
struct __htm_tdb *tdb = (struct __htm_tdb*)__tdb_ptr;
|
||||
|
||||
return tdb->abort_code;
|
||||
}
|
||||
|
||||
#endif /* __s390__ */
|
||||
|
||||
#endif /* __HTMXLINTRIN_H */
|
||||
@@ -1,78 +0,0 @@
|
||||
/* ===-------- ia32intrin.h ---------------------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __X86INTRIN_H
|
||||
#error "Never use <ia32intrin.h> directly; include <x86intrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __IA32INTRIN_H
|
||||
#define __IA32INTRIN_H
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))
|
||||
__readeflags(void)
|
||||
{
|
||||
return __builtin_ia32_readeflags_u64();
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
||||
__writeeflags(unsigned long long __f)
|
||||
{
|
||||
__builtin_ia32_writeeflags_u64(__f);
|
||||
}
|
||||
|
||||
#else /* !__x86_64__ */
|
||||
static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__))
|
||||
__readeflags(void)
|
||||
{
|
||||
return __builtin_ia32_readeflags_u32();
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
||||
__writeeflags(unsigned int __f)
|
||||
{
|
||||
__builtin_ia32_writeeflags_u32(__f);
|
||||
}
|
||||
#endif /* !__x86_64__ */
|
||||
|
||||
static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))
|
||||
__rdpmc(int __A) {
|
||||
return __builtin_ia32_rdpmc(__A);
|
||||
}
|
||||
|
||||
/* __rdtscp */
|
||||
static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))
|
||||
__rdtscp(unsigned int *__A) {
|
||||
return __builtin_ia32_rdtscp(__A);
|
||||
}
|
||||
|
||||
#define _rdtsc() __rdtsc()
|
||||
|
||||
#define _rdpmc(A) __rdpmc(A)
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
||||
_wbinvd(void) {
|
||||
__builtin_ia32_wbinvd();
|
||||
}
|
||||
|
||||
#endif /* __IA32INTRIN_H */
|
||||
@@ -1,526 +0,0 @@
|
||||
/*===---- immintrin.h - Intel intrinsics -----------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __IMMINTRIN_H
|
||||
#define __IMMINTRIN_H
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__MMX__)
|
||||
#include <mmintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE__)
|
||||
#include <xmmintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE2__)
|
||||
#include <emmintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE3__)
|
||||
#include <pmmintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSSE3__)
|
||||
#include <tmmintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || \
|
||||
(defined(__SSE4_2__) || defined(__SSE4_1__))
|
||||
#include <smmintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || \
|
||||
(defined(__AES__) || defined(__PCLMUL__))
|
||||
#include <wmmintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLFLUSHOPT__)
|
||||
#include <clflushoptintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLWB__)
|
||||
#include <clwbintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX__)
|
||||
#include <avxintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX2__)
|
||||
#include <avx2intrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__F16C__)
|
||||
#include <f16cintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__VPCLMULQDQ__)
|
||||
#include <vpclmulqdqintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI__)
|
||||
#include <bmiintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI2__)
|
||||
#include <bmi2intrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__LZCNT__)
|
||||
#include <lzcntintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__POPCNT__)
|
||||
#include <popcntintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__FMA__)
|
||||
#include <fmaintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512F__)
|
||||
#include <avx512fintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VL__)
|
||||
#include <avx512vlintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512BW__)
|
||||
#include <avx512bwintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512BITALG__)
|
||||
#include <avx512bitalgintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512CD__)
|
||||
#include <avx512cdintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VPOPCNTDQ__)
|
||||
#include <avx512vpopcntdqintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || \
|
||||
(defined(__AVX512VL__) && defined(__AVX512VPOPCNTDQ__))
|
||||
#include <avx512vpopcntdqvlintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VNNI__)
|
||||
#include <avx512vnniintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || \
|
||||
(defined(__AVX512VL__) && defined(__AVX512VNNI__))
|
||||
#include <avx512vlvnniintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512DQ__)
|
||||
#include <avx512dqintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || \
|
||||
(defined(__AVX512VL__) && defined(__AVX512BITALG__))
|
||||
#include <avx512vlbitalgintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || \
|
||||
(defined(__AVX512VL__) && defined(__AVX512BW__))
|
||||
#include <avx512vlbwintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || \
|
||||
(defined(__AVX512VL__) && defined(__AVX512CD__))
|
||||
#include <avx512vlcdintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || \
|
||||
(defined(__AVX512VL__) && defined(__AVX512DQ__))
|
||||
#include <avx512vldqintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512ER__)
|
||||
#include <avx512erintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512IFMA__)
|
||||
#include <avx512ifmaintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || \
|
||||
(defined(__AVX512IFMA__) && defined(__AVX512VL__))
|
||||
#include <avx512ifmavlintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VBMI__)
|
||||
#include <avx512vbmiintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || \
|
||||
(defined(__AVX512VBMI__) && defined(__AVX512VL__))
|
||||
#include <avx512vbmivlintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VBMI2__)
|
||||
#include <avx512vbmi2intrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || \
|
||||
(defined(__AVX512VBMI2__) && defined(__AVX512VL__))
|
||||
#include <avx512vlvbmi2intrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512PF__)
|
||||
#include <avx512pfintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__PKU__)
|
||||
#include <pkuintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__VAES__)
|
||||
#include <vaesintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__GFNI__)
|
||||
#include <gfniintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__RDPID__)
|
||||
/// Returns the value of the IA32_TSC_AUX MSR (0xc0000103).
|
||||
///
|
||||
/// \headerfile <immintrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> RDPID </c> instruction.
|
||||
static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("rdpid")))
|
||||
_rdpid_u32(void) {
|
||||
return __builtin_ia32_rdpid();
|
||||
}
|
||||
#endif // __RDPID__
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__RDRND__)
|
||||
static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))
|
||||
_rdrand16_step(unsigned short *__p)
|
||||
{
|
||||
return __builtin_ia32_rdrand16_step(__p);
|
||||
}
|
||||
|
||||
static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))
|
||||
_rdrand32_step(unsigned int *__p)
|
||||
{
|
||||
return __builtin_ia32_rdrand32_step(__p);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))
|
||||
_rdrand64_step(unsigned long long *__p)
|
||||
{
|
||||
return __builtin_ia32_rdrand64_step(__p);
|
||||
}
|
||||
#endif
|
||||
#endif /* __RDRND__ */
|
||||
|
||||
/* __bit_scan_forward */
|
||||
static __inline__ int __attribute__((__always_inline__, __nodebug__))
|
||||
_bit_scan_forward(int __A) {
|
||||
return __builtin_ctz(__A);
|
||||
}
|
||||
|
||||
/* __bit_scan_reverse */
|
||||
static __inline__ int __attribute__((__always_inline__, __nodebug__))
|
||||
_bit_scan_reverse(int __A) {
|
||||
return 31 - __builtin_clz(__A);
|
||||
}
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__FSGSBASE__)
|
||||
#ifdef __x86_64__
|
||||
static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
|
||||
_readfsbase_u32(void)
|
||||
{
|
||||
return __builtin_ia32_rdfsbase32();
|
||||
}
|
||||
|
||||
static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
|
||||
_readfsbase_u64(void)
|
||||
{
|
||||
return __builtin_ia32_rdfsbase64();
|
||||
}
|
||||
|
||||
static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
|
||||
_readgsbase_u32(void)
|
||||
{
|
||||
return __builtin_ia32_rdgsbase32();
|
||||
}
|
||||
|
||||
static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
|
||||
_readgsbase_u64(void)
|
||||
{
|
||||
return __builtin_ia32_rdgsbase64();
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
|
||||
_writefsbase_u32(unsigned int __V)
|
||||
{
|
||||
__builtin_ia32_wrfsbase32(__V);
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
|
||||
_writefsbase_u64(unsigned long long __V)
|
||||
{
|
||||
__builtin_ia32_wrfsbase64(__V);
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
|
||||
_writegsbase_u32(unsigned int __V)
|
||||
{
|
||||
__builtin_ia32_wrgsbase32(__V);
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
|
||||
_writegsbase_u64(unsigned long long __V)
|
||||
{
|
||||
__builtin_ia32_wrgsbase64(__V);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* __FSGSBASE__ */
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__MOVBE__)
|
||||
|
||||
/* The structs used below are to force the load/store to be unaligned. This
|
||||
* is accomplished with the __packed__ attribute. The __may_alias__ prevents
|
||||
* tbaa metadata from being generated based on the struct and the type of the
|
||||
* field inside of it.
|
||||
*/
|
||||
|
||||
static __inline__ short __attribute__((__always_inline__, __nodebug__, __target__("movbe")))
|
||||
_loadbe_i16(void const * __P) {
|
||||
struct __loadu_i16 {
|
||||
short __v;
|
||||
} __attribute__((__packed__, __may_alias__));
|
||||
return __builtin_bswap16(((struct __loadu_i16*)__P)->__v);
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("movbe")))
|
||||
_storebe_i16(void * __P, short __D) {
|
||||
struct __storeu_i16 {
|
||||
short __v;
|
||||
} __attribute__((__packed__, __may_alias__));
|
||||
((struct __storeu_i16*)__P)->__v = __builtin_bswap16(__D);
|
||||
}
|
||||
|
||||
static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("movbe")))
|
||||
_loadbe_i32(void const * __P) {
|
||||
struct __loadu_i32 {
|
||||
int __v;
|
||||
} __attribute__((__packed__, __may_alias__));
|
||||
return __builtin_bswap32(((struct __loadu_i32*)__P)->__v);
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("movbe")))
|
||||
_storebe_i32(void * __P, int __D) {
|
||||
struct __storeu_i32 {
|
||||
int __v;
|
||||
} __attribute__((__packed__, __may_alias__));
|
||||
((struct __storeu_i32*)__P)->__v = __builtin_bswap32(__D);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline__ long long __attribute__((__always_inline__, __nodebug__, __target__("movbe")))
|
||||
_loadbe_i64(void const * __P) {
|
||||
struct __loadu_i64 {
|
||||
long long __v;
|
||||
} __attribute__((__packed__, __may_alias__));
|
||||
return __builtin_bswap64(((struct __loadu_i64*)__P)->__v);
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("movbe")))
|
||||
_storebe_i64(void * __P, long long __D) {
|
||||
struct __storeu_i64 {
|
||||
long long __v;
|
||||
} __attribute__((__packed__, __may_alias__));
|
||||
((struct __storeu_i64*)__P)->__v = __builtin_bswap64(__D);
|
||||
}
|
||||
#endif
|
||||
#endif /* __MOVBE */
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__RTM__)
|
||||
#include <rtmintrin.h>
|
||||
#include <xtestintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SHA__)
|
||||
#include <shaintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__FXSR__)
|
||||
#include <fxsrintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVE__)
|
||||
#include <xsaveintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVEOPT__)
|
||||
#include <xsaveoptintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVEC__)
|
||||
#include <xsavecintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVES__)
|
||||
#include <xsavesintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SHSTK__)
|
||||
#include <cetintrin.h>
|
||||
#endif
|
||||
|
||||
/* Some intrinsics inside adxintrin.h are available only on processors with ADX,
|
||||
* whereas others are also available at all times. */
|
||||
#include <adxintrin.h>
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__RDSEED__)
|
||||
#include <rdseedintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__WBNOINVD__)
|
||||
#include <wbnoinvdintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLDEMOTE__)
|
||||
#include <cldemoteintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__WAITPKG__)
|
||||
#include <waitpkgintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || \
|
||||
defined(__MOVDIRI__) || defined(__MOVDIR64B__)
|
||||
#include <movdirintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__PCONFIG__)
|
||||
#include <pconfigintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SGX__)
|
||||
#include <sgxintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__PTWRITE__)
|
||||
#include <ptwriteintrin.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__INVPCID__)
|
||||
#include <invpcidintrin.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* Define the default attributes for these intrinsics */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* Interlocked Exchange HLE
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
static __inline__ long __DEFAULT_FN_ATTRS
|
||||
_InterlockedExchange_HLEAcquire(long volatile *_Target, long _Value) {
|
||||
__asm__ __volatile__(".byte 0xf2 ; lock ; xchg %0, %1"
|
||||
: "+r" (_Value), "+m" (*_Target) :: "memory");
|
||||
return _Value;
|
||||
}
|
||||
static __inline__ long __DEFAULT_FN_ATTRS
|
||||
_InterlockedExchange_HLERelease(long volatile *_Target, long _Value) {
|
||||
__asm__ __volatile__(".byte 0xf3 ; lock ; xchg %0, %1"
|
||||
: "+r" (_Value), "+m" (*_Target) :: "memory");
|
||||
return _Value;
|
||||
}
|
||||
#endif
|
||||
#if defined(__x86_64__)
|
||||
static __inline__ __int64 __DEFAULT_FN_ATTRS
|
||||
_InterlockedExchange64_HLEAcquire(__int64 volatile *_Target, __int64 _Value) {
|
||||
__asm__ __volatile__(".byte 0xf2 ; lock ; xchg %0, %1"
|
||||
: "+r" (_Value), "+m" (*_Target) :: "memory");
|
||||
return _Value;
|
||||
}
|
||||
static __inline__ __int64 __DEFAULT_FN_ATTRS
|
||||
_InterlockedExchange64_HLERelease(__int64 volatile *_Target, __int64 _Value) {
|
||||
__asm__ __volatile__(".byte 0xf3 ; lock ; xchg %0, %1"
|
||||
: "+r" (_Value), "+m" (*_Target) :: "memory");
|
||||
return _Value;
|
||||
}
|
||||
#endif
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* Interlocked Compare Exchange HLE
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
static __inline__ long __DEFAULT_FN_ATTRS
|
||||
_InterlockedCompareExchange_HLEAcquire(long volatile *_Destination,
|
||||
long _Exchange, long _Comparand) {
|
||||
__asm__ __volatile__(".byte 0xf2 ; lock ; cmpxchg %2, %1"
|
||||
: "+a" (_Comparand), "+m" (*_Destination)
|
||||
: "r" (_Exchange) : "memory");
|
||||
return _Comparand;
|
||||
}
|
||||
static __inline__ long __DEFAULT_FN_ATTRS
|
||||
_InterlockedCompareExchange_HLERelease(long volatile *_Destination,
|
||||
long _Exchange, long _Comparand) {
|
||||
__asm__ __volatile__(".byte 0xf3 ; lock ; cmpxchg %2, %1"
|
||||
: "+a" (_Comparand), "+m" (*_Destination)
|
||||
: "r" (_Exchange) : "memory");
|
||||
return _Comparand;
|
||||
}
|
||||
#endif
|
||||
#if defined(__x86_64__)
|
||||
static __inline__ __int64 __DEFAULT_FN_ATTRS
|
||||
_InterlockedCompareExchange64_HLEAcquire(__int64 volatile *_Destination,
|
||||
__int64 _Exchange, __int64 _Comparand) {
|
||||
__asm__ __volatile__(".byte 0xf2 ; lock ; cmpxchg %2, %1"
|
||||
: "+a" (_Comparand), "+m" (*_Destination)
|
||||
: "r" (_Exchange) : "memory");
|
||||
return _Comparand;
|
||||
}
|
||||
static __inline__ __int64 __DEFAULT_FN_ATTRS
|
||||
_InterlockedCompareExchange64_HLERelease(__int64 volatile *_Destination,
|
||||
__int64 _Exchange, __int64 _Comparand) {
|
||||
__asm__ __volatile__(".byte 0xf3 ; lock ; cmpxchg %2, %1"
|
||||
: "+a" (_Comparand), "+m" (*_Destination)
|
||||
: "r" (_Exchange) : "memory");
|
||||
return _Comparand;
|
||||
}
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
#endif /* __IMMINTRIN_H */
|
||||
@@ -1,619 +0,0 @@
|
||||
/* ===-------- intrin.h ---------------------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
/* Only include this if we're compiling for the windows platform. */
|
||||
#ifndef _MSC_VER
|
||||
#include_next <intrin.h>
|
||||
#else
|
||||
|
||||
#ifndef __INTRIN_H
|
||||
#define __INTRIN_H
|
||||
|
||||
/* First include the standard intrinsics. */
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
#include <x86intrin.h>
|
||||
#endif
|
||||
|
||||
#if defined(__arm__)
|
||||
#include <armintr.h>
|
||||
#endif
|
||||
|
||||
#if defined(__aarch64__)
|
||||
#include <arm64intr.h>
|
||||
#endif
|
||||
|
||||
/* For the definition of jmp_buf. */
|
||||
#if __STDC_HOSTED__
|
||||
#include <setjmp.h>
|
||||
#endif
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(__MMX__)
|
||||
/* And the random ones that aren't in those files. */
|
||||
__m64 _m_from_float(float);
|
||||
float _m_to_float(__m64);
|
||||
#endif
|
||||
|
||||
/* Other assorted instruction intrinsics. */
|
||||
void __addfsbyte(unsigned long, unsigned char);
|
||||
void __addfsdword(unsigned long, unsigned long);
|
||||
void __addfsword(unsigned long, unsigned short);
|
||||
void __code_seg(const char *);
|
||||
static __inline__
|
||||
void __cpuid(int[4], int);
|
||||
static __inline__
|
||||
void __cpuidex(int[4], int, int);
|
||||
static __inline__
|
||||
__int64 __emul(int, int);
|
||||
static __inline__
|
||||
unsigned __int64 __emulu(unsigned int, unsigned int);
|
||||
unsigned int __getcallerseflags(void);
|
||||
static __inline__
|
||||
void __halt(void);
|
||||
unsigned char __inbyte(unsigned short);
|
||||
void __inbytestring(unsigned short, unsigned char *, unsigned long);
|
||||
void __incfsbyte(unsigned long);
|
||||
void __incfsdword(unsigned long);
|
||||
void __incfsword(unsigned long);
|
||||
unsigned long __indword(unsigned short);
|
||||
void __indwordstring(unsigned short, unsigned long *, unsigned long);
|
||||
void __int2c(void);
|
||||
void __invlpg(void *);
|
||||
unsigned short __inword(unsigned short);
|
||||
void __inwordstring(unsigned short, unsigned short *, unsigned long);
|
||||
void __lidt(void *);
|
||||
unsigned __int64 __ll_lshift(unsigned __int64, int);
|
||||
__int64 __ll_rshift(__int64, int);
|
||||
static __inline__
|
||||
void __movsb(unsigned char *, unsigned char const *, size_t);
|
||||
static __inline__
|
||||
void __movsd(unsigned long *, unsigned long const *, size_t);
|
||||
static __inline__
|
||||
void __movsw(unsigned short *, unsigned short const *, size_t);
|
||||
static __inline__
|
||||
void __nop(void);
|
||||
void __nvreg_restore_fence(void);
|
||||
void __nvreg_save_fence(void);
|
||||
void __outbyte(unsigned short, unsigned char);
|
||||
void __outbytestring(unsigned short, unsigned char *, unsigned long);
|
||||
void __outdword(unsigned short, unsigned long);
|
||||
void __outdwordstring(unsigned short, unsigned long *, unsigned long);
|
||||
void __outword(unsigned short, unsigned short);
|
||||
void __outwordstring(unsigned short, unsigned short *, unsigned long);
|
||||
unsigned long __readcr0(void);
|
||||
unsigned long __readcr2(void);
|
||||
static __inline__
|
||||
unsigned long __readcr3(void);
|
||||
unsigned long __readcr4(void);
|
||||
unsigned long __readcr8(void);
|
||||
unsigned int __readdr(unsigned int);
|
||||
#ifdef __i386__
|
||||
static __inline__
|
||||
unsigned char __readfsbyte(unsigned long);
|
||||
static __inline__
|
||||
unsigned __int64 __readfsqword(unsigned long);
|
||||
static __inline__
|
||||
unsigned short __readfsword(unsigned long);
|
||||
#endif
|
||||
static __inline__
|
||||
unsigned __int64 __readmsr(unsigned long);
|
||||
unsigned __int64 __readpmc(unsigned long);
|
||||
unsigned long __segmentlimit(unsigned long);
|
||||
void __sidt(void *);
|
||||
static __inline__
|
||||
void __stosb(unsigned char *, unsigned char, size_t);
|
||||
static __inline__
|
||||
void __stosd(unsigned long *, unsigned long, size_t);
|
||||
static __inline__
|
||||
void __stosw(unsigned short *, unsigned short, size_t);
|
||||
void __svm_clgi(void);
|
||||
void __svm_invlpga(void *, int);
|
||||
void __svm_skinit(int);
|
||||
void __svm_stgi(void);
|
||||
void __svm_vmload(size_t);
|
||||
void __svm_vmrun(size_t);
|
||||
void __svm_vmsave(size_t);
|
||||
void __ud2(void);
|
||||
unsigned __int64 __ull_rshift(unsigned __int64, int);
|
||||
void __vmx_off(void);
|
||||
void __vmx_vmptrst(unsigned __int64 *);
|
||||
void __wbinvd(void);
|
||||
void __writecr0(unsigned int);
|
||||
static __inline__
|
||||
void __writecr3(unsigned int);
|
||||
void __writecr4(unsigned int);
|
||||
void __writecr8(unsigned int);
|
||||
void __writedr(unsigned int, unsigned int);
|
||||
void __writefsbyte(unsigned long, unsigned char);
|
||||
void __writefsdword(unsigned long, unsigned long);
|
||||
void __writefsqword(unsigned long, unsigned __int64);
|
||||
void __writefsword(unsigned long, unsigned short);
|
||||
void __writemsr(unsigned long, unsigned __int64);
|
||||
static __inline__
|
||||
void *_AddressOfReturnAddress(void);
|
||||
static __inline__
|
||||
unsigned char _BitScanForward(unsigned long *_Index, unsigned long _Mask);
|
||||
static __inline__
|
||||
unsigned char _BitScanReverse(unsigned long *_Index, unsigned long _Mask);
|
||||
unsigned char _bittest(long const *, long);
|
||||
unsigned char _bittestandcomplement(long *, long);
|
||||
unsigned char _bittestandreset(long *, long);
|
||||
unsigned char _bittestandset(long *, long);
|
||||
void __cdecl _disable(void);
|
||||
void __cdecl _enable(void);
|
||||
long _InterlockedAddLargeStatistic(__int64 volatile *_Addend, long _Value);
|
||||
unsigned char _interlockedbittestandreset(long volatile *, long);
|
||||
unsigned char _interlockedbittestandset(long volatile *, long);
|
||||
void *_InterlockedCompareExchangePointer_HLEAcquire(void *volatile *, void *,
|
||||
void *);
|
||||
void *_InterlockedCompareExchangePointer_HLERelease(void *volatile *, void *,
|
||||
void *);
|
||||
long _InterlockedExchangeAdd_HLEAcquire(long volatile *, long);
|
||||
long _InterlockedExchangeAdd_HLERelease(long volatile *, long);
|
||||
__int64 _InterlockedExchangeAdd64_HLEAcquire(__int64 volatile *, __int64);
|
||||
__int64 _InterlockedExchangeAdd64_HLERelease(__int64 volatile *, __int64);
|
||||
void __cdecl _invpcid(unsigned int, void *);
|
||||
static __inline__ void
|
||||
__attribute__((__deprecated__("use other intrinsics or C++11 atomics instead")))
|
||||
_ReadBarrier(void);
|
||||
static __inline__ void
|
||||
__attribute__((__deprecated__("use other intrinsics or C++11 atomics instead")))
|
||||
_ReadWriteBarrier(void);
|
||||
unsigned int _rorx_u32(unsigned int, const unsigned int);
|
||||
int _sarx_i32(int, unsigned int);
|
||||
#if __STDC_HOSTED__
|
||||
int __cdecl _setjmp(jmp_buf);
|
||||
#endif
|
||||
unsigned int _shlx_u32(unsigned int, unsigned int);
|
||||
unsigned int _shrx_u32(unsigned int, unsigned int);
|
||||
void _Store_HLERelease(long volatile *, long);
|
||||
void _Store64_HLERelease(__int64 volatile *, __int64);
|
||||
void _StorePointer_HLERelease(void *volatile *, void *);
|
||||
static __inline__ void
|
||||
__attribute__((__deprecated__("use other intrinsics or C++11 atomics instead")))
|
||||
_WriteBarrier(void);
|
||||
unsigned __int32 xbegin(void);
|
||||
void _xend(void);
|
||||
static __inline__
|
||||
#define _XCR_XFEATURE_ENABLED_MASK 0
|
||||
unsigned __int64 __cdecl _xgetbv(unsigned int);
|
||||
void __cdecl _xsetbv(unsigned int, unsigned __int64);
|
||||
|
||||
/* These additional intrinsics are turned on in x64/amd64/x86_64 mode. */
|
||||
#ifdef __x86_64__
|
||||
void __addgsbyte(unsigned long, unsigned char);
|
||||
void __addgsdword(unsigned long, unsigned long);
|
||||
void __addgsqword(unsigned long, unsigned __int64);
|
||||
void __addgsword(unsigned long, unsigned short);
|
||||
static __inline__
|
||||
void __faststorefence(void);
|
||||
void __incgsbyte(unsigned long);
|
||||
void __incgsdword(unsigned long);
|
||||
void __incgsqword(unsigned long);
|
||||
void __incgsword(unsigned long);
|
||||
static __inline__
|
||||
void __movsq(unsigned long long *, unsigned long long const *, size_t);
|
||||
static __inline__
|
||||
unsigned char __readgsbyte(unsigned long);
|
||||
static __inline__
|
||||
unsigned long __readgsdword(unsigned long);
|
||||
static __inline__
|
||||
unsigned __int64 __readgsqword(unsigned long);
|
||||
unsigned short __readgsword(unsigned long);
|
||||
unsigned __int64 __shiftleft128(unsigned __int64 _LowPart,
|
||||
unsigned __int64 _HighPart,
|
||||
unsigned char _Shift);
|
||||
unsigned __int64 __shiftright128(unsigned __int64 _LowPart,
|
||||
unsigned __int64 _HighPart,
|
||||
unsigned char _Shift);
|
||||
static __inline__
|
||||
void __stosq(unsigned __int64 *, unsigned __int64, size_t);
|
||||
unsigned char __vmx_on(unsigned __int64 *);
|
||||
unsigned char __vmx_vmclear(unsigned __int64 *);
|
||||
unsigned char __vmx_vmlaunch(void);
|
||||
unsigned char __vmx_vmptrld(unsigned __int64 *);
|
||||
unsigned char __vmx_vmread(size_t, size_t *);
|
||||
unsigned char __vmx_vmresume(void);
|
||||
unsigned char __vmx_vmwrite(size_t, size_t);
|
||||
void __writegsbyte(unsigned long, unsigned char);
|
||||
void __writegsdword(unsigned long, unsigned long);
|
||||
void __writegsqword(unsigned long, unsigned __int64);
|
||||
void __writegsword(unsigned long, unsigned short);
|
||||
unsigned char _bittest64(__int64 const *, __int64);
|
||||
unsigned char _bittestandcomplement64(__int64 *, __int64);
|
||||
unsigned char _bittestandreset64(__int64 *, __int64);
|
||||
unsigned char _bittestandset64(__int64 *, __int64);
|
||||
long _InterlockedAnd_np(long volatile *_Value, long _Mask);
|
||||
short _InterlockedAnd16_np(short volatile *_Value, short _Mask);
|
||||
__int64 _InterlockedAnd64_np(__int64 volatile *_Value, __int64 _Mask);
|
||||
char _InterlockedAnd8_np(char volatile *_Value, char _Mask);
|
||||
unsigned char _interlockedbittestandreset64(__int64 volatile *, __int64);
|
||||
unsigned char _interlockedbittestandset64(__int64 volatile *, __int64);
|
||||
long _InterlockedCompareExchange_np(long volatile *_Destination, long _Exchange,
|
||||
long _Comparand);
|
||||
unsigned char _InterlockedCompareExchange128(__int64 volatile *_Destination,
|
||||
__int64 _ExchangeHigh,
|
||||
__int64 _ExchangeLow,
|
||||
__int64 *_CompareandResult);
|
||||
unsigned char _InterlockedCompareExchange128_np(__int64 volatile *_Destination,
|
||||
__int64 _ExchangeHigh,
|
||||
__int64 _ExchangeLow,
|
||||
__int64 *_ComparandResult);
|
||||
short _InterlockedCompareExchange16_np(short volatile *_Destination,
|
||||
short _Exchange, short _Comparand);
|
||||
__int64 _InterlockedCompareExchange64_np(__int64 volatile *_Destination,
|
||||
__int64 _Exchange, __int64 _Comparand);
|
||||
void *_InterlockedCompareExchangePointer_np(void *volatile *_Destination,
|
||||
void *_Exchange, void *_Comparand);
|
||||
long _InterlockedOr_np(long volatile *_Value, long _Mask);
|
||||
short _InterlockedOr16_np(short volatile *_Value, short _Mask);
|
||||
__int64 _InterlockedOr64_np(__int64 volatile *_Value, __int64 _Mask);
|
||||
char _InterlockedOr8_np(char volatile *_Value, char _Mask);
|
||||
long _InterlockedXor_np(long volatile *_Value, long _Mask);
|
||||
short _InterlockedXor16_np(short volatile *_Value, short _Mask);
|
||||
__int64 _InterlockedXor64_np(__int64 volatile *_Value, __int64 _Mask);
|
||||
char _InterlockedXor8_np(char volatile *_Value, char _Mask);
|
||||
unsigned __int64 _rorx_u64(unsigned __int64, const unsigned int);
|
||||
__int64 _sarx_i64(__int64, unsigned int);
|
||||
unsigned __int64 _shlx_u64(unsigned __int64, unsigned int);
|
||||
unsigned __int64 _shrx_u64(unsigned __int64, unsigned int);
|
||||
static __inline__
|
||||
__int64 __mulh(__int64, __int64);
|
||||
static __inline__
|
||||
unsigned __int64 __umulh(unsigned __int64, unsigned __int64);
|
||||
static __inline__
|
||||
__int64 _mul128(__int64, __int64, __int64*);
|
||||
static __inline__
|
||||
unsigned __int64 _umul128(unsigned __int64,
|
||||
unsigned __int64,
|
||||
unsigned __int64*);
|
||||
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
|
||||
|
||||
static __inline__
|
||||
unsigned char _BitScanForward64(unsigned long *_Index, unsigned __int64 _Mask);
|
||||
static __inline__
|
||||
unsigned char _BitScanReverse64(unsigned long *_Index, unsigned __int64 _Mask);
|
||||
|
||||
static __inline__
|
||||
__int64 _InterlockedDecrement64(__int64 volatile *_Addend);
|
||||
static __inline__
|
||||
__int64 _InterlockedExchange64(__int64 volatile *_Target, __int64 _Value);
|
||||
static __inline__
|
||||
__int64 _InterlockedExchangeAdd64(__int64 volatile *_Addend, __int64 _Value);
|
||||
static __inline__
|
||||
__int64 _InterlockedExchangeSub64(__int64 volatile *_Subend, __int64 _Value);
|
||||
static __inline__
|
||||
__int64 _InterlockedIncrement64(__int64 volatile *_Addend);
|
||||
static __inline__
|
||||
__int64 _InterlockedOr64(__int64 volatile *_Value, __int64 _Mask);
|
||||
static __inline__
|
||||
__int64 _InterlockedXor64(__int64 volatile *_Value, __int64 _Mask);
|
||||
static __inline__
|
||||
__int64 _InterlockedAnd64(__int64 volatile *_Value, __int64 _Mask);
|
||||
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* Interlocked Exchange Add
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
char _InterlockedExchangeAdd8_acq(char volatile *_Addend, char _Value);
|
||||
char _InterlockedExchangeAdd8_nf(char volatile *_Addend, char _Value);
|
||||
char _InterlockedExchangeAdd8_rel(char volatile *_Addend, char _Value);
|
||||
short _InterlockedExchangeAdd16_acq(short volatile *_Addend, short _Value);
|
||||
short _InterlockedExchangeAdd16_nf(short volatile *_Addend, short _Value);
|
||||
short _InterlockedExchangeAdd16_rel(short volatile *_Addend, short _Value);
|
||||
long _InterlockedExchangeAdd_acq(long volatile *_Addend, long _Value);
|
||||
long _InterlockedExchangeAdd_nf(long volatile *_Addend, long _Value);
|
||||
long _InterlockedExchangeAdd_rel(long volatile *_Addend, long _Value);
|
||||
__int64 _InterlockedExchangeAdd64_acq(__int64 volatile *_Addend, __int64 _Value);
|
||||
__int64 _InterlockedExchangeAdd64_nf(__int64 volatile *_Addend, __int64 _Value);
|
||||
__int64 _InterlockedExchangeAdd64_rel(__int64 volatile *_Addend, __int64 _Value);
|
||||
#endif
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* Interlocked Increment
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
short _InterlockedIncrement16_acq(short volatile *_Value);
|
||||
short _InterlockedIncrement16_nf(short volatile *_Value);
|
||||
short _InterlockedIncrement16_rel(short volatile *_Value);
|
||||
long _InterlockedIncrement_acq(long volatile *_Value);
|
||||
long _InterlockedIncrement_nf(long volatile *_Value);
|
||||
long _InterlockedIncrement_rel(long volatile *_Value);
|
||||
__int64 _InterlockedIncrement64_acq(__int64 volatile *_Value);
|
||||
__int64 _InterlockedIncrement64_nf(__int64 volatile *_Value);
|
||||
__int64 _InterlockedIncrement64_rel(__int64 volatile *_Value);
|
||||
#endif
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* Interlocked Decrement
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
short _InterlockedDecrement16_acq(short volatile *_Value);
|
||||
short _InterlockedDecrement16_nf(short volatile *_Value);
|
||||
short _InterlockedDecrement16_rel(short volatile *_Value);
|
||||
long _InterlockedDecrement_acq(long volatile *_Value);
|
||||
long _InterlockedDecrement_nf(long volatile *_Value);
|
||||
long _InterlockedDecrement_rel(long volatile *_Value);
|
||||
__int64 _InterlockedDecrement64_acq(__int64 volatile *_Value);
|
||||
__int64 _InterlockedDecrement64_nf(__int64 volatile *_Value);
|
||||
__int64 _InterlockedDecrement64_rel(__int64 volatile *_Value);
|
||||
#endif
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* Interlocked And
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
char _InterlockedAnd8_acq(char volatile *_Value, char _Mask);
|
||||
char _InterlockedAnd8_nf(char volatile *_Value, char _Mask);
|
||||
char _InterlockedAnd8_rel(char volatile *_Value, char _Mask);
|
||||
short _InterlockedAnd16_acq(short volatile *_Value, short _Mask);
|
||||
short _InterlockedAnd16_nf(short volatile *_Value, short _Mask);
|
||||
short _InterlockedAnd16_rel(short volatile *_Value, short _Mask);
|
||||
long _InterlockedAnd_acq(long volatile *_Value, long _Mask);
|
||||
long _InterlockedAnd_nf(long volatile *_Value, long _Mask);
|
||||
long _InterlockedAnd_rel(long volatile *_Value, long _Mask);
|
||||
__int64 _InterlockedAnd64_acq(__int64 volatile *_Value, __int64 _Mask);
|
||||
__int64 _InterlockedAnd64_nf(__int64 volatile *_Value, __int64 _Mask);
|
||||
__int64 _InterlockedAnd64_rel(__int64 volatile *_Value, __int64 _Mask);
|
||||
#endif
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* Bit Counting and Testing
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
unsigned char _interlockedbittestandset_acq(long volatile *_BitBase,
|
||||
long _BitPos);
|
||||
unsigned char _interlockedbittestandset_nf(long volatile *_BitBase,
|
||||
long _BitPos);
|
||||
unsigned char _interlockedbittestandset_rel(long volatile *_BitBase,
|
||||
long _BitPos);
|
||||
unsigned char _interlockedbittestandreset_acq(long volatile *_BitBase,
|
||||
long _BitPos);
|
||||
unsigned char _interlockedbittestandreset_nf(long volatile *_BitBase,
|
||||
long _BitPos);
|
||||
unsigned char _interlockedbittestandreset_rel(long volatile *_BitBase,
|
||||
long _BitPos);
|
||||
#endif
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* Interlocked Or
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
char _InterlockedOr8_acq(char volatile *_Value, char _Mask);
|
||||
char _InterlockedOr8_nf(char volatile *_Value, char _Mask);
|
||||
char _InterlockedOr8_rel(char volatile *_Value, char _Mask);
|
||||
short _InterlockedOr16_acq(short volatile *_Value, short _Mask);
|
||||
short _InterlockedOr16_nf(short volatile *_Value, short _Mask);
|
||||
short _InterlockedOr16_rel(short volatile *_Value, short _Mask);
|
||||
long _InterlockedOr_acq(long volatile *_Value, long _Mask);
|
||||
long _InterlockedOr_nf(long volatile *_Value, long _Mask);
|
||||
long _InterlockedOr_rel(long volatile *_Value, long _Mask);
|
||||
__int64 _InterlockedOr64_acq(__int64 volatile *_Value, __int64 _Mask);
|
||||
__int64 _InterlockedOr64_nf(__int64 volatile *_Value, __int64 _Mask);
|
||||
__int64 _InterlockedOr64_rel(__int64 volatile *_Value, __int64 _Mask);
|
||||
#endif
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* Interlocked Xor
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
char _InterlockedXor8_acq(char volatile *_Value, char _Mask);
|
||||
char _InterlockedXor8_nf(char volatile *_Value, char _Mask);
|
||||
char _InterlockedXor8_rel(char volatile *_Value, char _Mask);
|
||||
short _InterlockedXor16_acq(short volatile *_Value, short _Mask);
|
||||
short _InterlockedXor16_nf(short volatile *_Value, short _Mask);
|
||||
short _InterlockedXor16_rel(short volatile *_Value, short _Mask);
|
||||
long _InterlockedXor_acq(long volatile *_Value, long _Mask);
|
||||
long _InterlockedXor_nf(long volatile *_Value, long _Mask);
|
||||
long _InterlockedXor_rel(long volatile *_Value, long _Mask);
|
||||
__int64 _InterlockedXor64_acq(__int64 volatile *_Value, __int64 _Mask);
|
||||
__int64 _InterlockedXor64_nf(__int64 volatile *_Value, __int64 _Mask);
|
||||
__int64 _InterlockedXor64_rel(__int64 volatile *_Value, __int64 _Mask);
|
||||
#endif
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* Interlocked Exchange
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
char _InterlockedExchange8_acq(char volatile *_Target, char _Value);
|
||||
char _InterlockedExchange8_nf(char volatile *_Target, char _Value);
|
||||
char _InterlockedExchange8_rel(char volatile *_Target, char _Value);
|
||||
short _InterlockedExchange16_acq(short volatile *_Target, short _Value);
|
||||
short _InterlockedExchange16_nf(short volatile *_Target, short _Value);
|
||||
short _InterlockedExchange16_rel(short volatile *_Target, short _Value);
|
||||
long _InterlockedExchange_acq(long volatile *_Target, long _Value);
|
||||
long _InterlockedExchange_nf(long volatile *_Target, long _Value);
|
||||
long _InterlockedExchange_rel(long volatile *_Target, long _Value);
|
||||
__int64 _InterlockedExchange64_acq(__int64 volatile *_Target, __int64 _Value);
|
||||
__int64 _InterlockedExchange64_nf(__int64 volatile *_Target, __int64 _Value);
|
||||
__int64 _InterlockedExchange64_rel(__int64 volatile *_Target, __int64 _Value);
|
||||
#endif
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* Interlocked Compare Exchange
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
char _InterlockedCompareExchange8_acq(char volatile *_Destination,
|
||||
char _Exchange, char _Comparand);
|
||||
char _InterlockedCompareExchange8_nf(char volatile *_Destination,
|
||||
char _Exchange, char _Comparand);
|
||||
char _InterlockedCompareExchange8_rel(char volatile *_Destination,
|
||||
char _Exchange, char _Comparand);
|
||||
short _InterlockedCompareExchange16_acq(short volatile *_Destination,
|
||||
short _Exchange, short _Comparand);
|
||||
short _InterlockedCompareExchange16_nf(short volatile *_Destination,
|
||||
short _Exchange, short _Comparand);
|
||||
short _InterlockedCompareExchange16_rel(short volatile *_Destination,
|
||||
short _Exchange, short _Comparand);
|
||||
long _InterlockedCompareExchange_acq(long volatile *_Destination,
|
||||
long _Exchange, long _Comparand);
|
||||
long _InterlockedCompareExchange_nf(long volatile *_Destination,
|
||||
long _Exchange, long _Comparand);
|
||||
long _InterlockedCompareExchange_rel(long volatile *_Destination,
|
||||
long _Exchange, long _Comparand);
|
||||
__int64 _InterlockedCompareExchange64_acq(__int64 volatile *_Destination,
|
||||
__int64 _Exchange, __int64 _Comparand);
|
||||
__int64 _InterlockedCompareExchange64_nf(__int64 volatile *_Destination,
|
||||
__int64 _Exchange, __int64 _Comparand);
|
||||
__int64 _InterlockedCompareExchange64_rel(__int64 volatile *_Destination,
|
||||
__int64 _Exchange, __int64 _Comparand);
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* movs, stos
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
__movsb(unsigned char *__dst, unsigned char const *__src, size_t __n) {
|
||||
__asm__ __volatile__("rep movsb" : "+D"(__dst), "+S"(__src), "+c"(__n)
|
||||
: : "memory");
|
||||
}
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
__movsd(unsigned long *__dst, unsigned long const *__src, size_t __n) {
|
||||
__asm__ __volatile__("rep movsl" : "+D"(__dst), "+S"(__src), "+c"(__n)
|
||||
: : "memory");
|
||||
}
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
__movsw(unsigned short *__dst, unsigned short const *__src, size_t __n) {
|
||||
__asm__ __volatile__("rep movsw" : "+D"(__dst), "+S"(__src), "+c"(__n)
|
||||
: : "memory");
|
||||
}
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
__stosd(unsigned long *__dst, unsigned long __x, size_t __n) {
|
||||
__asm__ __volatile__("rep stosl" : "+D"(__dst), "+c"(__n) : "a"(__x)
|
||||
: "memory");
|
||||
}
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
__stosw(unsigned short *__dst, unsigned short __x, size_t __n) {
|
||||
__asm__ __volatile__("rep stosw" : "+D"(__dst), "+c"(__n) : "a"(__x)
|
||||
: "memory");
|
||||
}
|
||||
#endif
|
||||
#ifdef __x86_64__
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
__movsq(unsigned long long *__dst, unsigned long long const *__src, size_t __n) {
|
||||
__asm__ __volatile__("rep movsq" : "+D"(__dst), "+S"(__src), "+c"(__n)
|
||||
: : "memory");
|
||||
}
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
__stosq(unsigned __int64 *__dst, unsigned __int64 __x, size_t __n) {
|
||||
__asm__ __volatile__("rep stosq" : "+D"(__dst), "+c"(__n) : "a"(__x)
|
||||
: "memory");
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* Misc
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
__cpuid(int __info[4], int __level) {
|
||||
__asm__ ("cpuid" : "=a"(__info[0]), "=b" (__info[1]), "=c"(__info[2]), "=d"(__info[3])
|
||||
: "a"(__level), "c"(0));
|
||||
}
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
__cpuidex(int __info[4], int __level, int __ecx) {
|
||||
__asm__ ("cpuid" : "=a"(__info[0]), "=b" (__info[1]), "=c"(__info[2]), "=d"(__info[3])
|
||||
: "a"(__level), "c"(__ecx));
|
||||
}
|
||||
static __inline__ unsigned __int64 __cdecl __DEFAULT_FN_ATTRS
|
||||
_xgetbv(unsigned int __xcr_no) {
|
||||
unsigned int __eax, __edx;
|
||||
__asm__ ("xgetbv" : "=a" (__eax), "=d" (__edx) : "c" (__xcr_no));
|
||||
return ((unsigned __int64)__edx << 32) | __eax;
|
||||
}
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
__halt(void) {
|
||||
__asm__ volatile ("hlt");
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
__nop(void) {
|
||||
__asm__ volatile ("nop");
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* MS AArch64 specific
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__aarch64__)
|
||||
unsigned __int64 __getReg(int);
|
||||
long _InterlockedAdd(long volatile *Addend, long Value);
|
||||
__int64 _ReadStatusReg(int);
|
||||
void _WriteStatusReg(int, __int64);
|
||||
|
||||
static inline unsigned short _byteswap_ushort (unsigned short val) {
|
||||
return __builtin_bswap16(val);
|
||||
}
|
||||
static inline unsigned long _byteswap_ulong (unsigned long val) {
|
||||
return __builtin_bswap32(val);
|
||||
}
|
||||
static inline unsigned __int64 _byteswap_uint64 (unsigned __int64 val) {
|
||||
return __builtin_bswap64(val);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------*\
|
||||
|* Privileged intrinsics
|
||||
\*----------------------------------------------------------------------------*/
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
static __inline__ unsigned __int64 __DEFAULT_FN_ATTRS
|
||||
__readmsr(unsigned long __register) {
|
||||
// Loads the contents of a 64-bit model specific register (MSR) specified in
|
||||
// the ECX register into registers EDX:EAX. The EDX register is loaded with
|
||||
// the high-order 32 bits of the MSR and the EAX register is loaded with the
|
||||
// low-order 32 bits. If less than 64 bits are implemented in the MSR being
|
||||
// read, the values returned to EDX:EAX in unimplemented bit locations are
|
||||
// undefined.
|
||||
unsigned long __edx;
|
||||
unsigned long __eax;
|
||||
__asm__ ("rdmsr" : "=d"(__edx), "=a"(__eax) : "c"(__register));
|
||||
return (((unsigned __int64)__edx) << 32) | (unsigned __int64)__eax;
|
||||
}
|
||||
|
||||
static __inline__ unsigned long __DEFAULT_FN_ATTRS
|
||||
__readcr3(void) {
|
||||
unsigned long __cr3_val;
|
||||
__asm__ __volatile__ ("mov %%cr3, %0" : "=q"(__cr3_val) : : "memory");
|
||||
return __cr3_val;
|
||||
}
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
__writecr3(unsigned int __cr3_val) {
|
||||
__asm__ ("mov %0, %%cr3" : : "q"(__cr3_val) : "memory");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __INTRIN_H */
|
||||
#endif /* _MSC_VER */
|
||||
@@ -1,106 +0,0 @@
|
||||
/*===---- inttypes.h - Standard header for integer printf macros ----------===*\
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
\*===----------------------------------------------------------------------===*/
|
||||
|
||||
#ifndef __CLANG_INTTYPES_H
|
||||
#define __CLANG_INTTYPES_H
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1800
|
||||
#error MSVC does not have inttypes.h prior to Visual Studio 2013
|
||||
#endif
|
||||
|
||||
#include_next <inttypes.h>
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
/* MSVC headers define int32_t as int, but PRIx32 as "lx" instead of "x".
|
||||
* This triggers format warnings, so fix it up here. */
|
||||
#undef PRId32
|
||||
#undef PRIdLEAST32
|
||||
#undef PRIdFAST32
|
||||
#undef PRIi32
|
||||
#undef PRIiLEAST32
|
||||
#undef PRIiFAST32
|
||||
#undef PRIo32
|
||||
#undef PRIoLEAST32
|
||||
#undef PRIoFAST32
|
||||
#undef PRIu32
|
||||
#undef PRIuLEAST32
|
||||
#undef PRIuFAST32
|
||||
#undef PRIx32
|
||||
#undef PRIxLEAST32
|
||||
#undef PRIxFAST32
|
||||
#undef PRIX32
|
||||
#undef PRIXLEAST32
|
||||
#undef PRIXFAST32
|
||||
|
||||
#undef SCNd32
|
||||
#undef SCNdLEAST32
|
||||
#undef SCNdFAST32
|
||||
#undef SCNi32
|
||||
#undef SCNiLEAST32
|
||||
#undef SCNiFAST32
|
||||
#undef SCNo32
|
||||
#undef SCNoLEAST32
|
||||
#undef SCNoFAST32
|
||||
#undef SCNu32
|
||||
#undef SCNuLEAST32
|
||||
#undef SCNuFAST32
|
||||
#undef SCNx32
|
||||
#undef SCNxLEAST32
|
||||
#undef SCNxFAST32
|
||||
|
||||
#define PRId32 "d"
|
||||
#define PRIdLEAST32 "d"
|
||||
#define PRIdFAST32 "d"
|
||||
#define PRIi32 "i"
|
||||
#define PRIiLEAST32 "i"
|
||||
#define PRIiFAST32 "i"
|
||||
#define PRIo32 "o"
|
||||
#define PRIoLEAST32 "o"
|
||||
#define PRIoFAST32 "o"
|
||||
#define PRIu32 "u"
|
||||
#define PRIuLEAST32 "u"
|
||||
#define PRIuFAST32 "u"
|
||||
#define PRIx32 "x"
|
||||
#define PRIxLEAST32 "x"
|
||||
#define PRIxFAST32 "x"
|
||||
#define PRIX32 "X"
|
||||
#define PRIXLEAST32 "X"
|
||||
#define PRIXFAST32 "X"
|
||||
|
||||
#define SCNd32 "d"
|
||||
#define SCNdLEAST32 "d"
|
||||
#define SCNdFAST32 "d"
|
||||
#define SCNi32 "i"
|
||||
#define SCNiLEAST32 "i"
|
||||
#define SCNiFAST32 "i"
|
||||
#define SCNo32 "o"
|
||||
#define SCNoLEAST32 "o"
|
||||
#define SCNoFAST32 "o"
|
||||
#define SCNu32 "u"
|
||||
#define SCNuLEAST32 "u"
|
||||
#define SCNuFAST32 "u"
|
||||
#define SCNx32 "x"
|
||||
#define SCNxLEAST32 "x"
|
||||
#define SCNxFAST32 "x"
|
||||
#endif
|
||||
|
||||
#endif /* __CLANG_INTTYPES_H */
|
||||
@@ -1,37 +0,0 @@
|
||||
/*===------------- invpcidintrin.h - INVPCID intrinsic ---------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <invpcidintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __INVPCIDINTRIN_H
|
||||
#define __INVPCIDINTRIN_H
|
||||
|
||||
static __inline__ void
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("invpcid")))
|
||||
_invpcid(unsigned int __type, void *__descriptor) {
|
||||
__builtin_ia32_invpcid(__type, __descriptor);
|
||||
}
|
||||
|
||||
#endif /* __INVPCIDINTRIN_H */
|
||||
@@ -1,43 +0,0 @@
|
||||
/*===---- iso646.h - Standard header for alternate spellings of operators---===
|
||||
*
|
||||
* Copyright (c) 2008 Eli Friedman
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __ISO646_H
|
||||
#define __ISO646_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define and &&
|
||||
#define and_eq &=
|
||||
#define bitand &
|
||||
#define bitor |
|
||||
#define compl ~
|
||||
#define not !
|
||||
#define not_eq !=
|
||||
#define or ||
|
||||
#define or_eq |=
|
||||
#define xor ^
|
||||
#define xor_eq ^=
|
||||
#endif
|
||||
|
||||
#endif /* __ISO646_H */
|
||||
@@ -1,118 +0,0 @@
|
||||
/*===---- limits.h - Standard header for integer sizes --------------------===*\
|
||||
*
|
||||
* Copyright (c) 2009 Chris Lattner
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
\*===----------------------------------------------------------------------===*/
|
||||
|
||||
#ifndef __CLANG_LIMITS_H
|
||||
#define __CLANG_LIMITS_H
|
||||
|
||||
/* The system's limits.h may, in turn, try to #include_next GCC's limits.h.
|
||||
Avert this #include_next madness. */
|
||||
#if defined __GNUC__ && !defined _GCC_LIMITS_H_
|
||||
#define _GCC_LIMITS_H_
|
||||
#endif
|
||||
|
||||
/* System headers include a number of constants from POSIX in <limits.h>.
|
||||
Include it if we're hosted. */
|
||||
#if __STDC_HOSTED__ && __has_include_next(<limits.h>)
|
||||
#include_next <limits.h>
|
||||
#endif
|
||||
|
||||
/* Many system headers try to "help us out" by defining these. No really, we
|
||||
know how big each datatype is. */
|
||||
#undef SCHAR_MIN
|
||||
#undef SCHAR_MAX
|
||||
#undef UCHAR_MAX
|
||||
#undef SHRT_MIN
|
||||
#undef SHRT_MAX
|
||||
#undef USHRT_MAX
|
||||
#undef INT_MIN
|
||||
#undef INT_MAX
|
||||
#undef UINT_MAX
|
||||
#undef LONG_MIN
|
||||
#undef LONG_MAX
|
||||
#undef ULONG_MAX
|
||||
|
||||
#undef CHAR_BIT
|
||||
#undef CHAR_MIN
|
||||
#undef CHAR_MAX
|
||||
|
||||
/* C90/99 5.2.4.2.1 */
|
||||
#define SCHAR_MAX __SCHAR_MAX__
|
||||
#define SHRT_MAX __SHRT_MAX__
|
||||
#define INT_MAX __INT_MAX__
|
||||
#define LONG_MAX __LONG_MAX__
|
||||
|
||||
#define SCHAR_MIN (-__SCHAR_MAX__-1)
|
||||
#define SHRT_MIN (-__SHRT_MAX__ -1)
|
||||
#define INT_MIN (-__INT_MAX__ -1)
|
||||
#define LONG_MIN (-__LONG_MAX__ -1L)
|
||||
|
||||
#define UCHAR_MAX (__SCHAR_MAX__*2 +1)
|
||||
#define USHRT_MAX (__SHRT_MAX__ *2 +1)
|
||||
#define UINT_MAX (__INT_MAX__ *2U +1U)
|
||||
#define ULONG_MAX (__LONG_MAX__ *2UL+1UL)
|
||||
|
||||
#ifndef MB_LEN_MAX
|
||||
#define MB_LEN_MAX 1
|
||||
#endif
|
||||
|
||||
#define CHAR_BIT __CHAR_BIT__
|
||||
|
||||
#ifdef __CHAR_UNSIGNED__ /* -funsigned-char */
|
||||
#define CHAR_MIN 0
|
||||
#define CHAR_MAX UCHAR_MAX
|
||||
#else
|
||||
#define CHAR_MIN SCHAR_MIN
|
||||
#define CHAR_MAX __SCHAR_MAX__
|
||||
#endif
|
||||
|
||||
/* C99 5.2.4.2.1: Added long long.
|
||||
C++11 18.3.3.2: same contents as the Standard C Library header <limits.h>.
|
||||
*/
|
||||
#if __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L
|
||||
|
||||
#undef LLONG_MIN
|
||||
#undef LLONG_MAX
|
||||
#undef ULLONG_MAX
|
||||
|
||||
#define LLONG_MAX __LONG_LONG_MAX__
|
||||
#define LLONG_MIN (-__LONG_LONG_MAX__-1LL)
|
||||
#define ULLONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL)
|
||||
#endif
|
||||
|
||||
/* LONG_LONG_MIN/LONG_LONG_MAX/ULONG_LONG_MAX are a GNU extension. It's too bad
|
||||
that we don't have something like #pragma poison that could be used to
|
||||
deprecate a macro - the code should just use LLONG_MAX and friends.
|
||||
*/
|
||||
#if defined(__GNU_LIBRARY__) ? defined(__USE_GNU) : !defined(__STRICT_ANSI__)
|
||||
|
||||
#undef LONG_LONG_MIN
|
||||
#undef LONG_LONG_MAX
|
||||
#undef ULONG_LONG_MAX
|
||||
|
||||
#define LONG_LONG_MAX __LONG_LONG_MAX__
|
||||
#define LONG_LONG_MIN (-__LONG_LONG_MAX__-1LL)
|
||||
#define ULONG_LONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL)
|
||||
#endif
|
||||
|
||||
#endif /* __CLANG_LIMITS_H */
|
||||
@@ -1,150 +0,0 @@
|
||||
/*===---- lwpintrin.h - LWP intrinsics -------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __X86INTRIN_H
|
||||
#error "Never use <lwpintrin.h> directly; include <x86intrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __LWPINTRIN_H
|
||||
#define __LWPINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("lwp")))
|
||||
|
||||
/// Parses the LWPCB at the specified address and enables
|
||||
/// profiling if valid.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> LLWPCB </c> instruction.
|
||||
///
|
||||
/// \param __addr
|
||||
/// Address to the new Lightweight Profiling Control Block (LWPCB). If the
|
||||
/// LWPCB is valid, writes the address into the LWP_CBADDR MSR and enables
|
||||
/// Lightweight Profiling.
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
__llwpcb (void *__addr)
|
||||
{
|
||||
__builtin_ia32_llwpcb(__addr);
|
||||
}
|
||||
|
||||
/// Flushes the LWP state to memory and returns the address of the LWPCB.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> SLWPCB </c> instruction.
|
||||
///
|
||||
/// \return
|
||||
/// Address to the current Lightweight Profiling Control Block (LWPCB).
|
||||
/// If LWP is not currently enabled, returns NULL.
|
||||
static __inline__ void* __DEFAULT_FN_ATTRS
|
||||
__slwpcb (void)
|
||||
{
|
||||
return __builtin_ia32_slwpcb();
|
||||
}
|
||||
|
||||
/// Inserts programmed event record into the LWP event ring buffer
|
||||
/// and advances the ring buffer pointer.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> LWPINS </c> instruction.
|
||||
///
|
||||
/// \param DATA2
|
||||
/// A 32-bit value is zero-extended and inserted into the 64-bit Data2 field.
|
||||
/// \param DATA1
|
||||
/// A 32-bit value is inserted into the 32-bit Data1 field.
|
||||
/// \param FLAGS
|
||||
/// A 32-bit immediate value is inserted into the 32-bit Flags field.
|
||||
/// \returns If the ring buffer is full and LWP is running in Synchronized Mode,
|
||||
/// the event record overwrites the last record in the buffer, the MissedEvents
|
||||
/// counter in the LWPCB is incremented, the head pointer is not advanced, and
|
||||
/// 1 is returned. Otherwise 0 is returned.
|
||||
#define __lwpins32(DATA2, DATA1, FLAGS) \
|
||||
(__builtin_ia32_lwpins32((unsigned int) (DATA2), (unsigned int) (DATA1), \
|
||||
(unsigned int) (FLAGS)))
|
||||
|
||||
/// Decrements the LWP programmed value sample event counter. If the result is
|
||||
/// negative, inserts an event record into the LWP event ring buffer in memory
|
||||
/// and advances the ring buffer pointer.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> LWPVAL </c> instruction.
|
||||
///
|
||||
/// \param DATA2
|
||||
/// A 32-bit value is zero-extended and inserted into the 64-bit Data2 field.
|
||||
/// \param DATA1
|
||||
/// A 32-bit value is inserted into the 32-bit Data1 field.
|
||||
/// \param FLAGS
|
||||
/// A 32-bit immediate value is inserted into the 32-bit Flags field.
|
||||
#define __lwpval32(DATA2, DATA1, FLAGS) \
|
||||
(__builtin_ia32_lwpval32((unsigned int) (DATA2), (unsigned int) (DATA1), \
|
||||
(unsigned int) (FLAGS)))
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
/// Inserts programmed event record into the LWP event ring buffer
|
||||
/// and advances the ring buffer pointer.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> LWPINS </c> instruction.
|
||||
///
|
||||
/// \param DATA2
|
||||
/// A 64-bit value is inserted into the 64-bit Data2 field.
|
||||
/// \param DATA1
|
||||
/// A 32-bit value is inserted into the 32-bit Data1 field.
|
||||
/// \param FLAGS
|
||||
/// A 32-bit immediate value is inserted into the 32-bit Flags field.
|
||||
/// \returns If the ring buffer is full and LWP is running in Synchronized Mode,
|
||||
/// the event record overwrites the last record in the buffer, the MissedEvents
|
||||
/// counter in the LWPCB is incremented, the head pointer is not advanced, and
|
||||
/// 1 is returned. Otherwise 0 is returned.
|
||||
#define __lwpins64(DATA2, DATA1, FLAGS) \
|
||||
(__builtin_ia32_lwpins64((unsigned long long) (DATA2), (unsigned int) (DATA1), \
|
||||
(unsigned int) (FLAGS)))
|
||||
|
||||
/// Decrements the LWP programmed value sample event counter. If the result is
|
||||
/// negative, inserts an event record into the LWP event ring buffer in memory
|
||||
/// and advances the ring buffer pointer.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> LWPVAL </c> instruction.
|
||||
///
|
||||
/// \param DATA2
|
||||
/// A 64-bit value is and inserted into the 64-bit Data2 field.
|
||||
/// \param DATA1
|
||||
/// A 32-bit value is inserted into the 32-bit Data1 field.
|
||||
/// \param FLAGS
|
||||
/// A 32-bit immediate value is inserted into the 32-bit Flags field.
|
||||
#define __lwpval64(DATA2, DATA1, FLAGS) \
|
||||
(__builtin_ia32_lwpval64((unsigned long long) (DATA2), (unsigned int) (DATA1), \
|
||||
(unsigned int) (FLAGS)))
|
||||
|
||||
#endif
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __LWPINTRIN_H */
|
||||
@@ -1,118 +0,0 @@
|
||||
/*===---- lzcntintrin.h - LZCNT intrinsics ---------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
|
||||
#error "Never use <lzcntintrin.h> directly; include <x86intrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __LZCNTINTRIN_H
|
||||
#define __LZCNTINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("lzcnt")))
|
||||
|
||||
#ifndef _MSC_VER
|
||||
/// Counts the number of leading zero bits in the operand.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c LZCNT instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 16-bit integer whose leading zeros are to be counted.
|
||||
/// \returns An unsigned 16-bit integer containing the number of leading zero
|
||||
/// bits in the operand.
|
||||
#define __lzcnt16(X) __builtin_ia32_lzcnt_u16((unsigned short)(X))
|
||||
#endif // _MSC_VER
|
||||
|
||||
/// Counts the number of leading zero bits in the operand.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c LZCNT instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 32-bit integer whose leading zeros are to be counted.
|
||||
/// \returns An unsigned 32-bit integer containing the number of leading zero
|
||||
/// bits in the operand.
|
||||
/// \see _lzcnt_u32
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS
|
||||
__lzcnt32(unsigned int __X)
|
||||
{
|
||||
return __builtin_ia32_lzcnt_u32(__X);
|
||||
}
|
||||
|
||||
/// Counts the number of leading zero bits in the operand.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c LZCNT instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 32-bit integer whose leading zeros are to be counted.
|
||||
/// \returns An unsigned 32-bit integer containing the number of leading zero
|
||||
/// bits in the operand.
|
||||
/// \see __lzcnt32
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS
|
||||
_lzcnt_u32(unsigned int __X)
|
||||
{
|
||||
return __builtin_ia32_lzcnt_u32(__X);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
#ifndef _MSC_VER
|
||||
/// Counts the number of leading zero bits in the operand.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c LZCNT instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 64-bit integer whose leading zeros are to be counted.
|
||||
/// \returns An unsigned 64-bit integer containing the number of leading zero
|
||||
/// bits in the operand.
|
||||
/// \see _lzcnt_u64
|
||||
#define __lzcnt64(X) __builtin_ia32_lzcnt_u64((unsigned long long)(X))
|
||||
#endif // _MSC_VER
|
||||
|
||||
/// Counts the number of leading zero bits in the operand.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c LZCNT instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// An unsigned 64-bit integer whose leading zeros are to be counted.
|
||||
/// \returns An unsigned 64-bit integer containing the number of leading zero
|
||||
/// bits in the operand.
|
||||
/// \see __lzcnt64
|
||||
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
|
||||
_lzcnt_u64(unsigned long long __X)
|
||||
{
|
||||
return __builtin_ia32_lzcnt_u64(__X);
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __LZCNTINTRIN_H */
|
||||
@@ -1,171 +0,0 @@
|
||||
/*===---- mm3dnow.h - 3DNow! intrinsics ------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef _MM3DNOW_H_INCLUDED
|
||||
#define _MM3DNOW_H_INCLUDED
|
||||
|
||||
#include <mmintrin.h>
|
||||
#include <prfchwintrin.h>
|
||||
|
||||
typedef float __v2sf __attribute__((__vector_size__(8)));
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("3dnow"), __min_vector_width__(64)))
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("3dnow")))
|
||||
_m_femms(void) {
|
||||
__builtin_ia32_femms();
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pavgusb(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pavgusb((__v8qi)__m1, (__v8qi)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pf2id(__m64 __m) {
|
||||
return (__m64)__builtin_ia32_pf2id((__v2sf)__m);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfacc(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfacc((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfadd(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfadd((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfcmpeq(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfcmpeq((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfcmpge(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfcmpge((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfcmpgt(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfcmpgt((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfmax(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfmax((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfmin(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfmin((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfmul(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfmul((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfrcp(__m64 __m) {
|
||||
return (__m64)__builtin_ia32_pfrcp((__v2sf)__m);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfrcpit1(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfrcpit1((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfrcpit2(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfrcpit2((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfrsqrt(__m64 __m) {
|
||||
return (__m64)__builtin_ia32_pfrsqrt((__v2sf)__m);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfrsqrtit1(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfrsqit1((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfsub(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfsub((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfsubr(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfsubr((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pi2fd(__m64 __m) {
|
||||
return (__m64)__builtin_ia32_pi2fd((__v2si)__m);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pmulhrw(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pmulhrw((__v4hi)__m1, (__v4hi)__m2);
|
||||
}
|
||||
|
||||
/* Handle the 3dnowa instructions here. */
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("3dnowa"), __min_vector_width__(64)))
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pf2iw(__m64 __m) {
|
||||
return (__m64)__builtin_ia32_pf2iw((__v2sf)__m);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfnacc(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfnacc((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pfpnacc(__m64 __m1, __m64 __m2) {
|
||||
return (__m64)__builtin_ia32_pfpnacc((__v2sf)__m1, (__v2sf)__m2);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pi2fw(__m64 __m) {
|
||||
return (__m64)__builtin_ia32_pi2fw((__v2si)__m);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pswapdsf(__m64 __m) {
|
||||
return (__m64)__builtin_ia32_pswapdsf((__v2sf)__m);
|
||||
}
|
||||
|
||||
static __inline__ __m64 __DEFAULT_FN_ATTRS
|
||||
_m_pswapdsi(__m64 __m) {
|
||||
return (__m64)__builtin_ia32_pswapdsi((__v2si)__m);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
@@ -1,75 +0,0 @@
|
||||
/*===---- mm_malloc.h - Allocating and Freeing Aligned Memory Blocks -------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __MM_MALLOC_H
|
||||
#define __MM_MALLOC_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <malloc.h>
|
||||
#else
|
||||
#ifndef __cplusplus
|
||||
extern int posix_memalign(void **__memptr, size_t __alignment, size_t __size);
|
||||
#else
|
||||
// Some systems (e.g. those with GNU libc) declare posix_memalign with an
|
||||
// exception specifier. Via an "egregious workaround" in
|
||||
// Sema::CheckEquivalentExceptionSpec, Clang accepts the following as a valid
|
||||
// redeclaration of glibc's declaration.
|
||||
extern "C" int posix_memalign(void **__memptr, size_t __alignment, size_t __size);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !(defined(_WIN32) && defined(_mm_malloc))
|
||||
static __inline__ void *__attribute__((__always_inline__, __nodebug__,
|
||||
__malloc__))
|
||||
_mm_malloc(size_t __size, size_t __align)
|
||||
{
|
||||
if (__align == 1) {
|
||||
return malloc(__size);
|
||||
}
|
||||
|
||||
if (!(__align & (__align - 1)) && __align < sizeof(void *))
|
||||
__align = sizeof(void *);
|
||||
|
||||
void *__mallocedMemory;
|
||||
#if defined(__MINGW32__)
|
||||
__mallocedMemory = __mingw_aligned_malloc(__size, __align);
|
||||
#elif defined(_WIN32)
|
||||
__mallocedMemory = _aligned_malloc(__size, __align);
|
||||
#else
|
||||
if (posix_memalign(&__mallocedMemory, __align, __size))
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
return __mallocedMemory;
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
||||
_mm_free(void *__p)
|
||||
{
|
||||
free(__p);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __MM_MALLOC_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,171 +0,0 @@
|
||||
/*===---- module.modulemap - intrinsics module map -------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
module _Builtin_intrinsics [system] [extern_c] {
|
||||
explicit module altivec {
|
||||
requires altivec
|
||||
header "altivec.h"
|
||||
}
|
||||
|
||||
explicit module arm {
|
||||
requires arm
|
||||
|
||||
explicit module acle {
|
||||
header "arm_acle.h"
|
||||
export *
|
||||
}
|
||||
|
||||
explicit module neon {
|
||||
requires neon
|
||||
header "arm_neon.h"
|
||||
header "arm_fp16.h"
|
||||
export *
|
||||
}
|
||||
}
|
||||
|
||||
explicit module intel {
|
||||
requires x86
|
||||
export *
|
||||
|
||||
header "immintrin.h"
|
||||
textual header "f16cintrin.h"
|
||||
textual header "avxintrin.h"
|
||||
textual header "avx2intrin.h"
|
||||
textual header "avx512fintrin.h"
|
||||
textual header "avx512erintrin.h"
|
||||
textual header "fmaintrin.h"
|
||||
|
||||
header "x86intrin.h"
|
||||
textual header "bmiintrin.h"
|
||||
textual header "bmi2intrin.h"
|
||||
textual header "lzcntintrin.h"
|
||||
textual header "xopintrin.h"
|
||||
textual header "fma4intrin.h"
|
||||
textual header "mwaitxintrin.h"
|
||||
textual header "clzerointrin.h"
|
||||
textual header "wbnoinvdintrin.h"
|
||||
textual header "cldemoteintrin.h"
|
||||
textual header "waitpkgintrin.h"
|
||||
textual header "movdirintrin.h"
|
||||
textual header "pconfigintrin.h"
|
||||
textual header "sgxintrin.h"
|
||||
textual header "ptwriteintrin.h"
|
||||
textual header "invpcidintrin.h"
|
||||
|
||||
textual header "__wmmintrin_aes.h"
|
||||
textual header "__wmmintrin_pclmul.h"
|
||||
|
||||
explicit module mm_malloc {
|
||||
requires !freestanding
|
||||
header "mm_malloc.h"
|
||||
export * // note: for <stdlib.h> dependency
|
||||
}
|
||||
|
||||
explicit module cpuid {
|
||||
requires gnuinlineasm
|
||||
header "cpuid.h"
|
||||
}
|
||||
|
||||
explicit module mmx {
|
||||
header "mmintrin.h"
|
||||
}
|
||||
|
||||
explicit module sse {
|
||||
export mm_malloc
|
||||
export mmx
|
||||
export sse2 // note: for hackish <emmintrin.h> dependency
|
||||
header "xmmintrin.h"
|
||||
}
|
||||
|
||||
explicit module sse2 {
|
||||
export sse
|
||||
header "emmintrin.h"
|
||||
}
|
||||
|
||||
explicit module sse3 {
|
||||
export sse2
|
||||
header "pmmintrin.h"
|
||||
}
|
||||
|
||||
explicit module ssse3 {
|
||||
export sse3
|
||||
header "tmmintrin.h"
|
||||
}
|
||||
|
||||
explicit module sse4_1 {
|
||||
export ssse3
|
||||
header "smmintrin.h"
|
||||
}
|
||||
|
||||
explicit module sse4_2 {
|
||||
export sse4_1
|
||||
header "nmmintrin.h"
|
||||
}
|
||||
|
||||
explicit module sse4a {
|
||||
export sse3
|
||||
header "ammintrin.h"
|
||||
}
|
||||
|
||||
explicit module popcnt {
|
||||
header "popcntintrin.h"
|
||||
}
|
||||
|
||||
explicit module mm3dnow {
|
||||
header "mm3dnow.h"
|
||||
}
|
||||
|
||||
explicit module aes_pclmul {
|
||||
header "wmmintrin.h"
|
||||
export aes
|
||||
export pclmul
|
||||
}
|
||||
}
|
||||
|
||||
explicit module systemz {
|
||||
requires systemz
|
||||
export *
|
||||
|
||||
header "s390intrin.h"
|
||||
|
||||
explicit module htm {
|
||||
requires htm
|
||||
header "htmintrin.h"
|
||||
header "htmxlintrin.h"
|
||||
}
|
||||
|
||||
explicit module zvector {
|
||||
requires zvector, vx
|
||||
header "vecintrin.h"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module _Builtin_stddef_max_align_t [system] [extern_c] {
|
||||
header "__stddef_max_align_t.h"
|
||||
}
|
||||
|
||||
module opencl_c {
|
||||
requires opencl
|
||||
header "opencl-c.h"
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/*===------------------------- movdirintrin.h ------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
|
||||
#error "Never use <movdirintrin.h> directly; include <x86intrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef _MOVDIRINTRIN_H
|
||||
#define _MOVDIRINTRIN_H
|
||||
|
||||
/* Move doubleword as direct store */
|
||||
static __inline__ void
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("movdiri")))
|
||||
_directstoreu_u32 (void *__dst, unsigned int __value)
|
||||
{
|
||||
__builtin_ia32_directstore_u32((unsigned int *)__dst, (unsigned int)__value);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
/* Move quadword as direct store */
|
||||
static __inline__ void
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("movdiri")))
|
||||
_directstoreu_u64 (void *__dst, unsigned long __value)
|
||||
{
|
||||
__builtin_ia32_directstore_u64((unsigned long *)__dst, __value);
|
||||
}
|
||||
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
/*
|
||||
* movdir64b - Move 64 bytes as direct store.
|
||||
* The destination must be 64 byte aligned, and the store is atomic.
|
||||
* The source address has no alignment requirement, and the load from
|
||||
* the source address is not atomic.
|
||||
*/
|
||||
static __inline__ void
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("movdir64b")))
|
||||
_movdir64b (void *__dst __attribute__((align_value(64))), const void *__src)
|
||||
{
|
||||
__builtin_ia32_movdir64b(__dst, __src);
|
||||
}
|
||||
|
||||
#endif /* _MOVDIRINTRIN_H */
|
||||
@@ -1,583 +0,0 @@
|
||||
/*===---- msa.h - MIPS MSA intrinsics --------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef _MSA_H
|
||||
#define _MSA_H 1
|
||||
|
||||
#if defined(__mips_msa)
|
||||
typedef signed char v16i8 __attribute__((vector_size(16), aligned(16)));
|
||||
typedef signed char v16i8_b __attribute__((vector_size(16), aligned(1)));
|
||||
typedef unsigned char v16u8 __attribute__((vector_size(16), aligned(16)));
|
||||
typedef unsigned char v16u8_b __attribute__((vector_size(16), aligned(1)));
|
||||
typedef short v8i16 __attribute__((vector_size(16), aligned(16)));
|
||||
typedef short v8i16_h __attribute__((vector_size(16), aligned(2)));
|
||||
typedef unsigned short v8u16 __attribute__((vector_size(16), aligned(16)));
|
||||
typedef unsigned short v8u16_h __attribute__((vector_size(16), aligned(2)));
|
||||
typedef int v4i32 __attribute__((vector_size(16), aligned(16)));
|
||||
typedef int v4i32_w __attribute__((vector_size(16), aligned(4)));
|
||||
typedef unsigned int v4u32 __attribute__((vector_size(16), aligned(16)));
|
||||
typedef unsigned int v4u32_w __attribute__((vector_size(16), aligned(4)));
|
||||
typedef long long v2i64 __attribute__((vector_size(16), aligned(16)));
|
||||
typedef long long v2i64_d __attribute__((vector_size(16), aligned(8)));
|
||||
typedef unsigned long long v2u64 __attribute__((vector_size(16), aligned(16)));
|
||||
typedef unsigned long long v2u64_d __attribute__((vector_size(16), aligned(8)));
|
||||
typedef float v4f32 __attribute__((vector_size(16), aligned(16)));
|
||||
typedef float v4f32_w __attribute__((vector_size(16), aligned(4)));
|
||||
typedef double v2f64 __attribute__ ((vector_size(16), aligned(16)));
|
||||
typedef double v2f64_d __attribute__ ((vector_size(16), aligned(8)));
|
||||
|
||||
#define __msa_sll_b __builtin_msa_sll_b
|
||||
#define __msa_sll_h __builtin_msa_sll_h
|
||||
#define __msa_sll_w __builtin_msa_sll_w
|
||||
#define __msa_sll_d __builtin_msa_sll_d
|
||||
#define __msa_slli_b __builtin_msa_slli_b
|
||||
#define __msa_slli_h __builtin_msa_slli_h
|
||||
#define __msa_slli_w __builtin_msa_slli_w
|
||||
#define __msa_slli_d __builtin_msa_slli_d
|
||||
#define __msa_sra_b __builtin_msa_sra_b
|
||||
#define __msa_sra_h __builtin_msa_sra_h
|
||||
#define __msa_sra_w __builtin_msa_sra_w
|
||||
#define __msa_sra_d __builtin_msa_sra_d
|
||||
#define __msa_srai_b __builtin_msa_srai_b
|
||||
#define __msa_srai_h __builtin_msa_srai_h
|
||||
#define __msa_srai_w __builtin_msa_srai_w
|
||||
#define __msa_srai_d __builtin_msa_srai_d
|
||||
#define __msa_srar_b __builtin_msa_srar_b
|
||||
#define __msa_srar_h __builtin_msa_srar_h
|
||||
#define __msa_srar_w __builtin_msa_srar_w
|
||||
#define __msa_srar_d __builtin_msa_srar_d
|
||||
#define __msa_srari_b __builtin_msa_srari_b
|
||||
#define __msa_srari_h __builtin_msa_srari_h
|
||||
#define __msa_srari_w __builtin_msa_srari_w
|
||||
#define __msa_srari_d __builtin_msa_srari_d
|
||||
#define __msa_srl_b __builtin_msa_srl_b
|
||||
#define __msa_srl_h __builtin_msa_srl_h
|
||||
#define __msa_srl_w __builtin_msa_srl_w
|
||||
#define __msa_srl_d __builtin_msa_srl_d
|
||||
#define __msa_srli_b __builtin_msa_srli_b
|
||||
#define __msa_srli_h __builtin_msa_srli_h
|
||||
#define __msa_srli_w __builtin_msa_srli_w
|
||||
#define __msa_srli_d __builtin_msa_srli_d
|
||||
#define __msa_srlr_b __builtin_msa_srlr_b
|
||||
#define __msa_srlr_h __builtin_msa_srlr_h
|
||||
#define __msa_srlr_w __builtin_msa_srlr_w
|
||||
#define __msa_srlr_d __builtin_msa_srlr_d
|
||||
#define __msa_srlri_b __builtin_msa_srlri_b
|
||||
#define __msa_srlri_h __builtin_msa_srlri_h
|
||||
#define __msa_srlri_w __builtin_msa_srlri_w
|
||||
#define __msa_srlri_d __builtin_msa_srlri_d
|
||||
#define __msa_bclr_b __builtin_msa_bclr_b
|
||||
#define __msa_bclr_h __builtin_msa_bclr_h
|
||||
#define __msa_bclr_w __builtin_msa_bclr_w
|
||||
#define __msa_bclr_d __builtin_msa_bclr_d
|
||||
#define __msa_bclri_b __builtin_msa_bclri_b
|
||||
#define __msa_bclri_h __builtin_msa_bclri_h
|
||||
#define __msa_bclri_w __builtin_msa_bclri_w
|
||||
#define __msa_bclri_d __builtin_msa_bclri_d
|
||||
#define __msa_bset_b __builtin_msa_bset_b
|
||||
#define __msa_bset_h __builtin_msa_bset_h
|
||||
#define __msa_bset_w __builtin_msa_bset_w
|
||||
#define __msa_bset_d __builtin_msa_bset_d
|
||||
#define __msa_bseti_b __builtin_msa_bseti_b
|
||||
#define __msa_bseti_h __builtin_msa_bseti_h
|
||||
#define __msa_bseti_w __builtin_msa_bseti_w
|
||||
#define __msa_bseti_d __builtin_msa_bseti_d
|
||||
#define __msa_bneg_b __builtin_msa_bneg_b
|
||||
#define __msa_bneg_h __builtin_msa_bneg_h
|
||||
#define __msa_bneg_w __builtin_msa_bneg_w
|
||||
#define __msa_bneg_d __builtin_msa_bneg_d
|
||||
#define __msa_bnegi_b __builtin_msa_bnegi_b
|
||||
#define __msa_bnegi_h __builtin_msa_bnegi_h
|
||||
#define __msa_bnegi_w __builtin_msa_bnegi_w
|
||||
#define __msa_bnegi_d __builtin_msa_bnegi_d
|
||||
#define __msa_binsl_b __builtin_msa_binsl_b
|
||||
#define __msa_binsl_h __builtin_msa_binsl_h
|
||||
#define __msa_binsl_w __builtin_msa_binsl_w
|
||||
#define __msa_binsl_d __builtin_msa_binsl_d
|
||||
#define __msa_binsli_b __builtin_msa_binsli_b
|
||||
#define __msa_binsli_h __builtin_msa_binsli_h
|
||||
#define __msa_binsli_w __builtin_msa_binsli_w
|
||||
#define __msa_binsli_d __builtin_msa_binsli_d
|
||||
#define __msa_binsr_b __builtin_msa_binsr_b
|
||||
#define __msa_binsr_h __builtin_msa_binsr_h
|
||||
#define __msa_binsr_w __builtin_msa_binsr_w
|
||||
#define __msa_binsr_d __builtin_msa_binsr_d
|
||||
#define __msa_binsri_b __builtin_msa_binsri_b
|
||||
#define __msa_binsri_h __builtin_msa_binsri_h
|
||||
#define __msa_binsri_w __builtin_msa_binsri_w
|
||||
#define __msa_binsri_d __builtin_msa_binsri_d
|
||||
#define __msa_addv_b __builtin_msa_addv_b
|
||||
#define __msa_addv_h __builtin_msa_addv_h
|
||||
#define __msa_addv_w __builtin_msa_addv_w
|
||||
#define __msa_addv_d __builtin_msa_addv_d
|
||||
#define __msa_addvi_b __builtin_msa_addvi_b
|
||||
#define __msa_addvi_h __builtin_msa_addvi_h
|
||||
#define __msa_addvi_w __builtin_msa_addvi_w
|
||||
#define __msa_addvi_d __builtin_msa_addvi_d
|
||||
#define __msa_subv_b __builtin_msa_subv_b
|
||||
#define __msa_subv_h __builtin_msa_subv_h
|
||||
#define __msa_subv_w __builtin_msa_subv_w
|
||||
#define __msa_subv_d __builtin_msa_subv_d
|
||||
#define __msa_subvi_b __builtin_msa_subvi_b
|
||||
#define __msa_subvi_h __builtin_msa_subvi_h
|
||||
#define __msa_subvi_w __builtin_msa_subvi_w
|
||||
#define __msa_subvi_d __builtin_msa_subvi_d
|
||||
#define __msa_max_s_b __builtin_msa_max_s_b
|
||||
#define __msa_max_s_h __builtin_msa_max_s_h
|
||||
#define __msa_max_s_w __builtin_msa_max_s_w
|
||||
#define __msa_max_s_d __builtin_msa_max_s_d
|
||||
#define __msa_maxi_s_b __builtin_msa_maxi_s_b
|
||||
#define __msa_maxi_s_h __builtin_msa_maxi_s_h
|
||||
#define __msa_maxi_s_w __builtin_msa_maxi_s_w
|
||||
#define __msa_maxi_s_d __builtin_msa_maxi_s_d
|
||||
#define __msa_max_u_b __builtin_msa_max_u_b
|
||||
#define __msa_max_u_h __builtin_msa_max_u_h
|
||||
#define __msa_max_u_w __builtin_msa_max_u_w
|
||||
#define __msa_max_u_d __builtin_msa_max_u_d
|
||||
#define __msa_maxi_u_b __builtin_msa_maxi_u_b
|
||||
#define __msa_maxi_u_h __builtin_msa_maxi_u_h
|
||||
#define __msa_maxi_u_w __builtin_msa_maxi_u_w
|
||||
#define __msa_maxi_u_d __builtin_msa_maxi_u_d
|
||||
#define __msa_min_s_b __builtin_msa_min_s_b
|
||||
#define __msa_min_s_h __builtin_msa_min_s_h
|
||||
#define __msa_min_s_w __builtin_msa_min_s_w
|
||||
#define __msa_min_s_d __builtin_msa_min_s_d
|
||||
#define __msa_mini_s_b __builtin_msa_mini_s_b
|
||||
#define __msa_mini_s_h __builtin_msa_mini_s_h
|
||||
#define __msa_mini_s_w __builtin_msa_mini_s_w
|
||||
#define __msa_mini_s_d __builtin_msa_mini_s_d
|
||||
#define __msa_min_u_b __builtin_msa_min_u_b
|
||||
#define __msa_min_u_h __builtin_msa_min_u_h
|
||||
#define __msa_min_u_w __builtin_msa_min_u_w
|
||||
#define __msa_min_u_d __builtin_msa_min_u_d
|
||||
#define __msa_mini_u_b __builtin_msa_mini_u_b
|
||||
#define __msa_mini_u_h __builtin_msa_mini_u_h
|
||||
#define __msa_mini_u_w __builtin_msa_mini_u_w
|
||||
#define __msa_mini_u_d __builtin_msa_mini_u_d
|
||||
#define __msa_max_a_b __builtin_msa_max_a_b
|
||||
#define __msa_max_a_h __builtin_msa_max_a_h
|
||||
#define __msa_max_a_w __builtin_msa_max_a_w
|
||||
#define __msa_max_a_d __builtin_msa_max_a_d
|
||||
#define __msa_min_a_b __builtin_msa_min_a_b
|
||||
#define __msa_min_a_h __builtin_msa_min_a_h
|
||||
#define __msa_min_a_w __builtin_msa_min_a_w
|
||||
#define __msa_min_a_d __builtin_msa_min_a_d
|
||||
#define __msa_ceq_b __builtin_msa_ceq_b
|
||||
#define __msa_ceq_h __builtin_msa_ceq_h
|
||||
#define __msa_ceq_w __builtin_msa_ceq_w
|
||||
#define __msa_ceq_d __builtin_msa_ceq_d
|
||||
#define __msa_ceqi_b __builtin_msa_ceqi_b
|
||||
#define __msa_ceqi_h __builtin_msa_ceqi_h
|
||||
#define __msa_ceqi_w __builtin_msa_ceqi_w
|
||||
#define __msa_ceqi_d __builtin_msa_ceqi_d
|
||||
#define __msa_clt_s_b __builtin_msa_clt_s_b
|
||||
#define __msa_clt_s_h __builtin_msa_clt_s_h
|
||||
#define __msa_clt_s_w __builtin_msa_clt_s_w
|
||||
#define __msa_clt_s_d __builtin_msa_clt_s_d
|
||||
#define __msa_clti_s_b __builtin_msa_clti_s_b
|
||||
#define __msa_clti_s_h __builtin_msa_clti_s_h
|
||||
#define __msa_clti_s_w __builtin_msa_clti_s_w
|
||||
#define __msa_clti_s_d __builtin_msa_clti_s_d
|
||||
#define __msa_clt_u_b __builtin_msa_clt_u_b
|
||||
#define __msa_clt_u_h __builtin_msa_clt_u_h
|
||||
#define __msa_clt_u_w __builtin_msa_clt_u_w
|
||||
#define __msa_clt_u_d __builtin_msa_clt_u_d
|
||||
#define __msa_clti_u_b __builtin_msa_clti_u_b
|
||||
#define __msa_clti_u_h __builtin_msa_clti_u_h
|
||||
#define __msa_clti_u_w __builtin_msa_clti_u_w
|
||||
#define __msa_clti_u_d __builtin_msa_clti_u_d
|
||||
#define __msa_cle_s_b __builtin_msa_cle_s_b
|
||||
#define __msa_cle_s_h __builtin_msa_cle_s_h
|
||||
#define __msa_cle_s_w __builtin_msa_cle_s_w
|
||||
#define __msa_cle_s_d __builtin_msa_cle_s_d
|
||||
#define __msa_clei_s_b __builtin_msa_clei_s_b
|
||||
#define __msa_clei_s_h __builtin_msa_clei_s_h
|
||||
#define __msa_clei_s_w __builtin_msa_clei_s_w
|
||||
#define __msa_clei_s_d __builtin_msa_clei_s_d
|
||||
#define __msa_cle_u_b __builtin_msa_cle_u_b
|
||||
#define __msa_cle_u_h __builtin_msa_cle_u_h
|
||||
#define __msa_cle_u_w __builtin_msa_cle_u_w
|
||||
#define __msa_cle_u_d __builtin_msa_cle_u_d
|
||||
#define __msa_clei_u_b __builtin_msa_clei_u_b
|
||||
#define __msa_clei_u_h __builtin_msa_clei_u_h
|
||||
#define __msa_clei_u_w __builtin_msa_clei_u_w
|
||||
#define __msa_clei_u_d __builtin_msa_clei_u_d
|
||||
#define __msa_ld_b __builtin_msa_ld_b
|
||||
#define __msa_ld_h __builtin_msa_ld_h
|
||||
#define __msa_ld_w __builtin_msa_ld_w
|
||||
#define __msa_ld_d __builtin_msa_ld_d
|
||||
#define __msa_st_b __builtin_msa_st_b
|
||||
#define __msa_st_h __builtin_msa_st_h
|
||||
#define __msa_st_w __builtin_msa_st_w
|
||||
#define __msa_st_d __builtin_msa_st_d
|
||||
#define __msa_sat_s_b __builtin_msa_sat_s_b
|
||||
#define __msa_sat_s_h __builtin_msa_sat_s_h
|
||||
#define __msa_sat_s_w __builtin_msa_sat_s_w
|
||||
#define __msa_sat_s_d __builtin_msa_sat_s_d
|
||||
#define __msa_sat_u_b __builtin_msa_sat_u_b
|
||||
#define __msa_sat_u_h __builtin_msa_sat_u_h
|
||||
#define __msa_sat_u_w __builtin_msa_sat_u_w
|
||||
#define __msa_sat_u_d __builtin_msa_sat_u_d
|
||||
#define __msa_add_a_b __builtin_msa_add_a_b
|
||||
#define __msa_add_a_h __builtin_msa_add_a_h
|
||||
#define __msa_add_a_w __builtin_msa_add_a_w
|
||||
#define __msa_add_a_d __builtin_msa_add_a_d
|
||||
#define __msa_adds_a_b __builtin_msa_adds_a_b
|
||||
#define __msa_adds_a_h __builtin_msa_adds_a_h
|
||||
#define __msa_adds_a_w __builtin_msa_adds_a_w
|
||||
#define __msa_adds_a_d __builtin_msa_adds_a_d
|
||||
#define __msa_adds_s_b __builtin_msa_adds_s_b
|
||||
#define __msa_adds_s_h __builtin_msa_adds_s_h
|
||||
#define __msa_adds_s_w __builtin_msa_adds_s_w
|
||||
#define __msa_adds_s_d __builtin_msa_adds_s_d
|
||||
#define __msa_adds_u_b __builtin_msa_adds_u_b
|
||||
#define __msa_adds_u_h __builtin_msa_adds_u_h
|
||||
#define __msa_adds_u_w __builtin_msa_adds_u_w
|
||||
#define __msa_adds_u_d __builtin_msa_adds_u_d
|
||||
#define __msa_ave_s_b __builtin_msa_ave_s_b
|
||||
#define __msa_ave_s_h __builtin_msa_ave_s_h
|
||||
#define __msa_ave_s_w __builtin_msa_ave_s_w
|
||||
#define __msa_ave_s_d __builtin_msa_ave_s_d
|
||||
#define __msa_ave_u_b __builtin_msa_ave_u_b
|
||||
#define __msa_ave_u_h __builtin_msa_ave_u_h
|
||||
#define __msa_ave_u_w __builtin_msa_ave_u_w
|
||||
#define __msa_ave_u_d __builtin_msa_ave_u_d
|
||||
#define __msa_aver_s_b __builtin_msa_aver_s_b
|
||||
#define __msa_aver_s_h __builtin_msa_aver_s_h
|
||||
#define __msa_aver_s_w __builtin_msa_aver_s_w
|
||||
#define __msa_aver_s_d __builtin_msa_aver_s_d
|
||||
#define __msa_aver_u_b __builtin_msa_aver_u_b
|
||||
#define __msa_aver_u_h __builtin_msa_aver_u_h
|
||||
#define __msa_aver_u_w __builtin_msa_aver_u_w
|
||||
#define __msa_aver_u_d __builtin_msa_aver_u_d
|
||||
#define __msa_subs_s_b __builtin_msa_subs_s_b
|
||||
#define __msa_subs_s_h __builtin_msa_subs_s_h
|
||||
#define __msa_subs_s_w __builtin_msa_subs_s_w
|
||||
#define __msa_subs_s_d __builtin_msa_subs_s_d
|
||||
#define __msa_subs_u_b __builtin_msa_subs_u_b
|
||||
#define __msa_subs_u_h __builtin_msa_subs_u_h
|
||||
#define __msa_subs_u_w __builtin_msa_subs_u_w
|
||||
#define __msa_subs_u_d __builtin_msa_subs_u_d
|
||||
#define __msa_subsuu_s_b __builtin_msa_subsuu_s_b
|
||||
#define __msa_subsuu_s_h __builtin_msa_subsuu_s_h
|
||||
#define __msa_subsuu_s_w __builtin_msa_subsuu_s_w
|
||||
#define __msa_subsuu_s_d __builtin_msa_subsuu_s_d
|
||||
#define __msa_subsus_u_b __builtin_msa_subsus_u_b
|
||||
#define __msa_subsus_u_h __builtin_msa_subsus_u_h
|
||||
#define __msa_subsus_u_w __builtin_msa_subsus_u_w
|
||||
#define __msa_subsus_u_d __builtin_msa_subsus_u_d
|
||||
#define __msa_asub_s_b __builtin_msa_asub_s_b
|
||||
#define __msa_asub_s_h __builtin_msa_asub_s_h
|
||||
#define __msa_asub_s_w __builtin_msa_asub_s_w
|
||||
#define __msa_asub_s_d __builtin_msa_asub_s_d
|
||||
#define __msa_asub_u_b __builtin_msa_asub_u_b
|
||||
#define __msa_asub_u_h __builtin_msa_asub_u_h
|
||||
#define __msa_asub_u_w __builtin_msa_asub_u_w
|
||||
#define __msa_asub_u_d __builtin_msa_asub_u_d
|
||||
#define __msa_mulv_b __builtin_msa_mulv_b
|
||||
#define __msa_mulv_h __builtin_msa_mulv_h
|
||||
#define __msa_mulv_w __builtin_msa_mulv_w
|
||||
#define __msa_mulv_d __builtin_msa_mulv_d
|
||||
#define __msa_maddv_b __builtin_msa_maddv_b
|
||||
#define __msa_maddv_h __builtin_msa_maddv_h
|
||||
#define __msa_maddv_w __builtin_msa_maddv_w
|
||||
#define __msa_maddv_d __builtin_msa_maddv_d
|
||||
#define __msa_msubv_b __builtin_msa_msubv_b
|
||||
#define __msa_msubv_h __builtin_msa_msubv_h
|
||||
#define __msa_msubv_w __builtin_msa_msubv_w
|
||||
#define __msa_msubv_d __builtin_msa_msubv_d
|
||||
#define __msa_div_s_b __builtin_msa_div_s_b
|
||||
#define __msa_div_s_h __builtin_msa_div_s_h
|
||||
#define __msa_div_s_w __builtin_msa_div_s_w
|
||||
#define __msa_div_s_d __builtin_msa_div_s_d
|
||||
#define __msa_div_u_b __builtin_msa_div_u_b
|
||||
#define __msa_div_u_h __builtin_msa_div_u_h
|
||||
#define __msa_div_u_w __builtin_msa_div_u_w
|
||||
#define __msa_div_u_d __builtin_msa_div_u_d
|
||||
#define __msa_hadd_s_h __builtin_msa_hadd_s_h
|
||||
#define __msa_hadd_s_w __builtin_msa_hadd_s_w
|
||||
#define __msa_hadd_s_d __builtin_msa_hadd_s_d
|
||||
#define __msa_hadd_u_h __builtin_msa_hadd_u_h
|
||||
#define __msa_hadd_u_w __builtin_msa_hadd_u_w
|
||||
#define __msa_hadd_u_d __builtin_msa_hadd_u_d
|
||||
#define __msa_hsub_s_h __builtin_msa_hsub_s_h
|
||||
#define __msa_hsub_s_w __builtin_msa_hsub_s_w
|
||||
#define __msa_hsub_s_d __builtin_msa_hsub_s_d
|
||||
#define __msa_hsub_u_h __builtin_msa_hsub_u_h
|
||||
#define __msa_hsub_u_w __builtin_msa_hsub_u_w
|
||||
#define __msa_hsub_u_d __builtin_msa_hsub_u_d
|
||||
#define __msa_mod_s_b __builtin_msa_mod_s_b
|
||||
#define __msa_mod_s_h __builtin_msa_mod_s_h
|
||||
#define __msa_mod_s_w __builtin_msa_mod_s_w
|
||||
#define __msa_mod_s_d __builtin_msa_mod_s_d
|
||||
#define __msa_mod_u_b __builtin_msa_mod_u_b
|
||||
#define __msa_mod_u_h __builtin_msa_mod_u_h
|
||||
#define __msa_mod_u_w __builtin_msa_mod_u_w
|
||||
#define __msa_mod_u_d __builtin_msa_mod_u_d
|
||||
#define __msa_dotp_s_h __builtin_msa_dotp_s_h
|
||||
#define __msa_dotp_s_w __builtin_msa_dotp_s_w
|
||||
#define __msa_dotp_s_d __builtin_msa_dotp_s_d
|
||||
#define __msa_dotp_u_h __builtin_msa_dotp_u_h
|
||||
#define __msa_dotp_u_w __builtin_msa_dotp_u_w
|
||||
#define __msa_dotp_u_d __builtin_msa_dotp_u_d
|
||||
#define __msa_dpadd_s_h __builtin_msa_dpadd_s_h
|
||||
#define __msa_dpadd_s_w __builtin_msa_dpadd_s_w
|
||||
#define __msa_dpadd_s_d __builtin_msa_dpadd_s_d
|
||||
#define __msa_dpadd_u_h __builtin_msa_dpadd_u_h
|
||||
#define __msa_dpadd_u_w __builtin_msa_dpadd_u_w
|
||||
#define __msa_dpadd_u_d __builtin_msa_dpadd_u_d
|
||||
#define __msa_dpsub_s_h __builtin_msa_dpsub_s_h
|
||||
#define __msa_dpsub_s_w __builtin_msa_dpsub_s_w
|
||||
#define __msa_dpsub_s_d __builtin_msa_dpsub_s_d
|
||||
#define __msa_dpsub_u_h __builtin_msa_dpsub_u_h
|
||||
#define __msa_dpsub_u_w __builtin_msa_dpsub_u_w
|
||||
#define __msa_dpsub_u_d __builtin_msa_dpsub_u_d
|
||||
#define __msa_sld_b __builtin_msa_sld_b
|
||||
#define __msa_sld_h __builtin_msa_sld_h
|
||||
#define __msa_sld_w __builtin_msa_sld_w
|
||||
#define __msa_sld_d __builtin_msa_sld_d
|
||||
#define __msa_sldi_b __builtin_msa_sldi_b
|
||||
#define __msa_sldi_h __builtin_msa_sldi_h
|
||||
#define __msa_sldi_w __builtin_msa_sldi_w
|
||||
#define __msa_sldi_d __builtin_msa_sldi_d
|
||||
#define __msa_splat_b __builtin_msa_splat_b
|
||||
#define __msa_splat_h __builtin_msa_splat_h
|
||||
#define __msa_splat_w __builtin_msa_splat_w
|
||||
#define __msa_splat_d __builtin_msa_splat_d
|
||||
#define __msa_splati_b __builtin_msa_splati_b
|
||||
#define __msa_splati_h __builtin_msa_splati_h
|
||||
#define __msa_splati_w __builtin_msa_splati_w
|
||||
#define __msa_splati_d __builtin_msa_splati_d
|
||||
#define __msa_pckev_b __builtin_msa_pckev_b
|
||||
#define __msa_pckev_h __builtin_msa_pckev_h
|
||||
#define __msa_pckev_w __builtin_msa_pckev_w
|
||||
#define __msa_pckev_d __builtin_msa_pckev_d
|
||||
#define __msa_pckod_b __builtin_msa_pckod_b
|
||||
#define __msa_pckod_h __builtin_msa_pckod_h
|
||||
#define __msa_pckod_w __builtin_msa_pckod_w
|
||||
#define __msa_pckod_d __builtin_msa_pckod_d
|
||||
#define __msa_ilvl_b __builtin_msa_ilvl_b
|
||||
#define __msa_ilvl_h __builtin_msa_ilvl_h
|
||||
#define __msa_ilvl_w __builtin_msa_ilvl_w
|
||||
#define __msa_ilvl_d __builtin_msa_ilvl_d
|
||||
#define __msa_ilvr_b __builtin_msa_ilvr_b
|
||||
#define __msa_ilvr_h __builtin_msa_ilvr_h
|
||||
#define __msa_ilvr_w __builtin_msa_ilvr_w
|
||||
#define __msa_ilvr_d __builtin_msa_ilvr_d
|
||||
#define __msa_ilvev_b __builtin_msa_ilvev_b
|
||||
#define __msa_ilvev_h __builtin_msa_ilvev_h
|
||||
#define __msa_ilvev_w __builtin_msa_ilvev_w
|
||||
#define __msa_ilvev_d __builtin_msa_ilvev_d
|
||||
#define __msa_ilvod_b __builtin_msa_ilvod_b
|
||||
#define __msa_ilvod_h __builtin_msa_ilvod_h
|
||||
#define __msa_ilvod_w __builtin_msa_ilvod_w
|
||||
#define __msa_ilvod_d __builtin_msa_ilvod_d
|
||||
#define __msa_vshf_b __builtin_msa_vshf_b
|
||||
#define __msa_vshf_h __builtin_msa_vshf_h
|
||||
#define __msa_vshf_w __builtin_msa_vshf_w
|
||||
#define __msa_vshf_d __builtin_msa_vshf_d
|
||||
#define __msa_and_v __builtin_msa_and_v
|
||||
#define __msa_andi_b __builtin_msa_andi_b
|
||||
#define __msa_or_v __builtin_msa_or_v
|
||||
#define __msa_ori_b __builtin_msa_ori_b
|
||||
#define __msa_nor_v __builtin_msa_nor_v
|
||||
#define __msa_nori_b __builtin_msa_nori_b
|
||||
#define __msa_xor_v __builtin_msa_xor_v
|
||||
#define __msa_xori_b __builtin_msa_xori_b
|
||||
#define __msa_bmnz_v __builtin_msa_bmnz_v
|
||||
#define __msa_bmnzi_b __builtin_msa_bmnzi_b
|
||||
#define __msa_bmz_v __builtin_msa_bmz_v
|
||||
#define __msa_bmzi_b __builtin_msa_bmzi_b
|
||||
#define __msa_bsel_v __builtin_msa_bsel_v
|
||||
#define __msa_bseli_b __builtin_msa_bseli_b
|
||||
#define __msa_shf_b __builtin_msa_shf_b
|
||||
#define __msa_shf_h __builtin_msa_shf_h
|
||||
#define __msa_shf_w __builtin_msa_shf_w
|
||||
#define __msa_test_bnz_v __builtin_msa_bnz_v
|
||||
#define __msa_test_bz_v __builtin_msa_bz_v
|
||||
#define __msa_fill_b __builtin_msa_fill_b
|
||||
#define __msa_fill_h __builtin_msa_fill_h
|
||||
#define __msa_fill_w __builtin_msa_fill_w
|
||||
#define __msa_fill_d __builtin_msa_fill_d
|
||||
#define __msa_pcnt_b __builtin_msa_pcnt_b
|
||||
#define __msa_pcnt_h __builtin_msa_pcnt_h
|
||||
#define __msa_pcnt_w __builtin_msa_pcnt_w
|
||||
#define __msa_pcnt_d __builtin_msa_pcnt_d
|
||||
#define __msa_nloc_b __builtin_msa_nloc_b
|
||||
#define __msa_nloc_h __builtin_msa_nloc_h
|
||||
#define __msa_nloc_w __builtin_msa_nloc_w
|
||||
#define __msa_nloc_d __builtin_msa_nloc_d
|
||||
#define __msa_nlzc_b __builtin_msa_nlzc_b
|
||||
#define __msa_nlzc_h __builtin_msa_nlzc_h
|
||||
#define __msa_nlzc_w __builtin_msa_nlzc_w
|
||||
#define __msa_nlzc_d __builtin_msa_nlzc_d
|
||||
#define __msa_copy_s_b __builtin_msa_copy_s_b
|
||||
#define __msa_copy_s_h __builtin_msa_copy_s_h
|
||||
#define __msa_copy_s_w __builtin_msa_copy_s_w
|
||||
#define __msa_copy_s_d __builtin_msa_copy_s_d
|
||||
#define __msa_copy_u_b __builtin_msa_copy_u_b
|
||||
#define __msa_copy_u_h __builtin_msa_copy_u_h
|
||||
#define __msa_copy_u_w __builtin_msa_copy_u_w
|
||||
#define __msa_copy_u_d __builtin_msa_copy_u_d
|
||||
#define __msa_insert_b __builtin_msa_insert_b
|
||||
#define __msa_insert_h __builtin_msa_insert_h
|
||||
#define __msa_insert_w __builtin_msa_insert_w
|
||||
#define __msa_insert_d __builtin_msa_insert_d
|
||||
#define __msa_insve_b __builtin_msa_insve_b
|
||||
#define __msa_insve_h __builtin_msa_insve_h
|
||||
#define __msa_insve_w __builtin_msa_insve_w
|
||||
#define __msa_insve_d __builtin_msa_insve_d
|
||||
#define __msa_test_bnz_b __builtin_msa_bnz_b
|
||||
#define __msa_test_bnz_h __builtin_msa_bnz_h
|
||||
#define __msa_test_bnz_w __builtin_msa_bnz_w
|
||||
#define __msa_test_bnz_d __builtin_msa_bnz_d
|
||||
#define __msa_test_bz_b __builtin_msa_bz_b
|
||||
#define __msa_test_bz_h __builtin_msa_bz_h
|
||||
#define __msa_test_bz_w __builtin_msa_bz_w
|
||||
#define __msa_test_bz_d __builtin_msa_bz_d
|
||||
#define __msa_ldi_b __builtin_msa_ldi_b
|
||||
#define __msa_ldi_h __builtin_msa_ldi_h
|
||||
#define __msa_ldi_w __builtin_msa_ldi_w
|
||||
#define __msa_ldi_d __builtin_msa_ldi_d
|
||||
#define __msa_fcaf_w __builtin_msa_fcaf_w
|
||||
#define __msa_fcaf_d __builtin_msa_fcaf_d
|
||||
#define __msa_fcor_w __builtin_msa_fcor_w
|
||||
#define __msa_fcor_d __builtin_msa_fcor_d
|
||||
#define __msa_fcun_w __builtin_msa_fcun_w
|
||||
#define __msa_fcun_d __builtin_msa_fcun_d
|
||||
#define __msa_fcune_w __builtin_msa_fcune_w
|
||||
#define __msa_fcune_d __builtin_msa_fcune_d
|
||||
#define __msa_fcueq_w __builtin_msa_fcueq_w
|
||||
#define __msa_fcueq_d __builtin_msa_fcueq_d
|
||||
#define __msa_fceq_w __builtin_msa_fceq_w
|
||||
#define __msa_fceq_d __builtin_msa_fceq_d
|
||||
#define __msa_fcne_w __builtin_msa_fcne_w
|
||||
#define __msa_fcne_d __builtin_msa_fcne_d
|
||||
#define __msa_fclt_w __builtin_msa_fclt_w
|
||||
#define __msa_fclt_d __builtin_msa_fclt_d
|
||||
#define __msa_fcult_w __builtin_msa_fcult_w
|
||||
#define __msa_fcult_d __builtin_msa_fcult_d
|
||||
#define __msa_fcle_w __builtin_msa_fcle_w
|
||||
#define __msa_fcle_d __builtin_msa_fcle_d
|
||||
#define __msa_fcule_w __builtin_msa_fcule_w
|
||||
#define __msa_fcule_d __builtin_msa_fcule_d
|
||||
#define __msa_fsaf_w __builtin_msa_fsaf_w
|
||||
#define __msa_fsaf_d __builtin_msa_fsaf_d
|
||||
#define __msa_fsor_w __builtin_msa_fsor_w
|
||||
#define __msa_fsor_d __builtin_msa_fsor_d
|
||||
#define __msa_fsun_w __builtin_msa_fsun_w
|
||||
#define __msa_fsun_d __builtin_msa_fsun_d
|
||||
#define __msa_fsune_w __builtin_msa_fsune_w
|
||||
#define __msa_fsune_d __builtin_msa_fsune_d
|
||||
#define __msa_fsueq_w __builtin_msa_fsueq_w
|
||||
#define __msa_fsueq_d __builtin_msa_fsueq_d
|
||||
#define __msa_fseq_w __builtin_msa_fseq_w
|
||||
#define __msa_fseq_d __builtin_msa_fseq_d
|
||||
#define __msa_fsne_w __builtin_msa_fsne_w
|
||||
#define __msa_fsne_d __builtin_msa_fsne_d
|
||||
#define __msa_fslt_w __builtin_msa_fslt_w
|
||||
#define __msa_fslt_d __builtin_msa_fslt_d
|
||||
#define __msa_fsult_w __builtin_msa_fsult_w
|
||||
#define __msa_fsult_d __builtin_msa_fsult_d
|
||||
#define __msa_fsle_w __builtin_msa_fsle_w
|
||||
#define __msa_fsle_d __builtin_msa_fsle_d
|
||||
#define __msa_fsule_w __builtin_msa_fsule_w
|
||||
#define __msa_fsule_d __builtin_msa_fsule_d
|
||||
#define __msa_fadd_w __builtin_msa_fadd_w
|
||||
#define __msa_fadd_d __builtin_msa_fadd_d
|
||||
#define __msa_fsub_w __builtin_msa_fsub_w
|
||||
#define __msa_fsub_d __builtin_msa_fsub_d
|
||||
#define __msa_fmul_w __builtin_msa_fmul_w
|
||||
#define __msa_fmul_d __builtin_msa_fmul_d
|
||||
#define __msa_fdiv_w __builtin_msa_fdiv_w
|
||||
#define __msa_fdiv_d __builtin_msa_fdiv_d
|
||||
#define __msa_fmadd_w __builtin_msa_fmadd_w
|
||||
#define __msa_fmadd_d __builtin_msa_fmadd_d
|
||||
#define __msa_fmsub_w __builtin_msa_fmsub_w
|
||||
#define __msa_fmsub_d __builtin_msa_fmsub_d
|
||||
#define __msa_fexp2_w __builtin_msa_fexp2_w
|
||||
#define __msa_fexp2_d __builtin_msa_fexp2_d
|
||||
#define __msa_fexdo_h __builtin_msa_fexdo_h
|
||||
#define __msa_fexdo_w __builtin_msa_fexdo_w
|
||||
#define __msa_ftq_h __builtin_msa_ftq_h
|
||||
#define __msa_ftq_w __builtin_msa_ftq_w
|
||||
#define __msa_fmin_w __builtin_msa_fmin_w
|
||||
#define __msa_fmin_d __builtin_msa_fmin_d
|
||||
#define __msa_fmin_a_w __builtin_msa_fmin_a_w
|
||||
#define __msa_fmin_a_d __builtin_msa_fmin_a_d
|
||||
#define __msa_fmax_w __builtin_msa_fmax_w
|
||||
#define __msa_fmax_d __builtin_msa_fmax_d
|
||||
#define __msa_fmax_a_w __builtin_msa_fmax_a_w
|
||||
#define __msa_fmax_a_d __builtin_msa_fmax_a_d
|
||||
#define __msa_mul_q_h __builtin_msa_mul_q_h
|
||||
#define __msa_mul_q_w __builtin_msa_mul_q_w
|
||||
#define __msa_mulr_q_h __builtin_msa_mulr_q_h
|
||||
#define __msa_mulr_q_w __builtin_msa_mulr_q_w
|
||||
#define __msa_madd_q_h __builtin_msa_madd_q_h
|
||||
#define __msa_madd_q_w __builtin_msa_madd_q_w
|
||||
#define __msa_maddr_q_h __builtin_msa_maddr_q_h
|
||||
#define __msa_maddr_q_w __builtin_msa_maddr_q_w
|
||||
#define __msa_msub_q_h __builtin_msa_msub_q_h
|
||||
#define __msa_msub_q_w __builtin_msa_msub_q_w
|
||||
#define __msa_msubr_q_h __builtin_msa_msubr_q_h
|
||||
#define __msa_msubr_q_w __builtin_msa_msubr_q_w
|
||||
#define __msa_fclass_w __builtin_msa_fclass_w
|
||||
#define __msa_fclass_d __builtin_msa_fclass_d
|
||||
#define __msa_fsqrt_w __builtin_msa_fsqrt_w
|
||||
#define __msa_fsqrt_d __builtin_msa_fsqrt_d
|
||||
#define __msa_frcp_w __builtin_msa_frcp_w
|
||||
#define __msa_frcp_d __builtin_msa_frcp_d
|
||||
#define __msa_frint_w __builtin_msa_frint_w
|
||||
#define __msa_frint_d __builtin_msa_frint_d
|
||||
#define __msa_frsqrt_w __builtin_msa_frsqrt_w
|
||||
#define __msa_frsqrt_d __builtin_msa_frsqrt_d
|
||||
#define __msa_flog2_w __builtin_msa_flog2_w
|
||||
#define __msa_flog2_d __builtin_msa_flog2_d
|
||||
#define __msa_fexupl_w __builtin_msa_fexupl_w
|
||||
#define __msa_fexupl_d __builtin_msa_fexupl_d
|
||||
#define __msa_fexupr_w __builtin_msa_fexupr_w
|
||||
#define __msa_fexupr_d __builtin_msa_fexupr_d
|
||||
#define __msa_ffql_w __builtin_msa_ffql_w
|
||||
#define __msa_ffql_d __builtin_msa_ffql_d
|
||||
#define __msa_ffqr_w __builtin_msa_ffqr_w
|
||||
#define __msa_ffqr_d __builtin_msa_ffqr_d
|
||||
#define __msa_ftint_s_w __builtin_msa_ftint_s_w
|
||||
#define __msa_ftint_s_d __builtin_msa_ftint_s_d
|
||||
#define __msa_ftint_u_w __builtin_msa_ftint_u_w
|
||||
#define __msa_ftint_u_d __builtin_msa_ftint_u_d
|
||||
#define __msa_ftrunc_s_w __builtin_msa_ftrunc_s_w
|
||||
#define __msa_ftrunc_s_d __builtin_msa_ftrunc_s_d
|
||||
#define __msa_ftrunc_u_w __builtin_msa_ftrunc_u_w
|
||||
#define __msa_ftrunc_u_d __builtin_msa_ftrunc_u_d
|
||||
#define __msa_ffint_s_w __builtin_msa_ffint_s_w
|
||||
#define __msa_ffint_s_d __builtin_msa_ffint_s_d
|
||||
#define __msa_ffint_u_w __builtin_msa_ffint_u_w
|
||||
#define __msa_ffint_u_d __builtin_msa_ffint_u_d
|
||||
#define __msa_cfcmsa __builtin_msa_cfcmsa
|
||||
#define __msa_move_v __builtin_msa_move_v
|
||||
#define __msa_cast_to_vector_float __builtin_msa_cast_to_vector_float
|
||||
#define __msa_cast_to_vector_double __builtin_msa_cast_to_vector_double
|
||||
#define __msa_cast_to_scalar_float __builtin_msa_cast_to_scalar_float
|
||||
#define __msa_cast_to_scalar_double __builtin_msa_cast_to_scalar_double
|
||||
#endif /* defined(__mips_msa) */
|
||||
#endif /* _MSA_H */
|
||||
@@ -1,47 +0,0 @@
|
||||
/*===---- mwaitxintrin.h - MONITORX/MWAITX intrinsics ----------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __X86INTRIN_H
|
||||
#error "Never use <mwaitxintrin.h> directly; include <x86intrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __MWAITXINTRIN_H
|
||||
#define __MWAITXINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("mwaitx")))
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_mm_monitorx(void const * __p, unsigned __extensions, unsigned __hints)
|
||||
{
|
||||
__builtin_ia32_monitorx((void *)__p, __extensions, __hints);
|
||||
}
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_mm_mwaitx(unsigned __extensions, unsigned __hints, unsigned __clock)
|
||||
{
|
||||
__builtin_ia32_mwaitx(__extensions, __hints, __clock);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __MWAITXINTRIN_H */
|
||||
@@ -1,30 +0,0 @@
|
||||
/*===---- nmmintrin.h - SSE4 intrinsics ------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __NMMINTRIN_H
|
||||
#define __NMMINTRIN_H
|
||||
|
||||
/* To match expectations of gcc we put the sse4.2 definitions into smmintrin.h,
|
||||
just include it now then. */
|
||||
#include <smmintrin.h>
|
||||
#endif /* __NMMINTRIN_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,50 +0,0 @@
|
||||
/*===---- pconfigintrin.h - X86 platform configuration ---------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
|
||||
#error "Never use <pconfigintrin.h> directly; include <x86intrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __PCONFIGINTRIN_H
|
||||
#define __PCONFIGINTRIN_H
|
||||
|
||||
#define __PCONFIG_KEY_PROGRAM 0x00000001
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS \
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("pconfig")))
|
||||
|
||||
static __inline unsigned int __DEFAULT_FN_ATTRS
|
||||
_pconfig_u32(unsigned int __leaf, __SIZE_TYPE__ __d[])
|
||||
{
|
||||
unsigned int __result;
|
||||
__asm__ ("pconfig"
|
||||
: "=a" (__result), "=b" (__d[0]), "=c" (__d[1]), "=d" (__d[2])
|
||||
: "a" (__leaf), "b" (__d[0]), "c" (__d[1]), "d" (__d[2])
|
||||
: "cc");
|
||||
return __result;
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
@@ -1,48 +0,0 @@
|
||||
/*===---- pkuintrin.h - PKU intrinsics -------------------------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <pkuintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __PKUINTRIN_H
|
||||
#define __PKUINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("pku")))
|
||||
|
||||
static __inline__ unsigned int __DEFAULT_FN_ATTRS
|
||||
_rdpkru_u32(void)
|
||||
{
|
||||
return __builtin_ia32_rdpkru();
|
||||
}
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_wrpkru(unsigned int __val)
|
||||
{
|
||||
__builtin_ia32_wrpkru(__val);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
||||
@@ -1,304 +0,0 @@
|
||||
/*===---- pmmintrin.h - SSE3 intrinsics ------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __PMMINTRIN_H
|
||||
#define __PMMINTRIN_H
|
||||
|
||||
#include <emmintrin.h>
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS \
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("sse3"), __min_vector_width__(128)))
|
||||
|
||||
/// Loads data from an unaligned memory location to elements in a 128-bit
|
||||
/// vector.
|
||||
///
|
||||
/// If the address of the data is not 16-byte aligned, the instruction may
|
||||
/// read two adjacent aligned blocks of memory to retrieve the requested
|
||||
/// data.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VLDDQU </c> instruction.
|
||||
///
|
||||
/// \param __p
|
||||
/// A pointer to a 128-bit integer vector containing integer values.
|
||||
/// \returns A 128-bit vector containing the moved values.
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_lddqu_si128(__m128i const *__p)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_lddqu((char const *)__p);
|
||||
}
|
||||
|
||||
/// Adds the even-indexed values and subtracts the odd-indexed values of
|
||||
/// two 128-bit vectors of [4 x float].
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VADDSUBPS </c> instruction.
|
||||
///
|
||||
/// \param __a
|
||||
/// A 128-bit vector of [4 x float] containing the left source operand.
|
||||
/// \param __b
|
||||
/// A 128-bit vector of [4 x float] containing the right source operand.
|
||||
/// \returns A 128-bit vector of [4 x float] containing the alternating sums and
|
||||
/// differences of both operands.
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS
|
||||
_mm_addsub_ps(__m128 __a, __m128 __b)
|
||||
{
|
||||
return __builtin_ia32_addsubps((__v4sf)__a, (__v4sf)__b);
|
||||
}
|
||||
|
||||
/// Horizontally adds the adjacent pairs of values contained in two
|
||||
/// 128-bit vectors of [4 x float].
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VHADDPS </c> instruction.
|
||||
///
|
||||
/// \param __a
|
||||
/// A 128-bit vector of [4 x float] containing one of the source operands.
|
||||
/// The horizontal sums of the values are stored in the lower bits of the
|
||||
/// destination.
|
||||
/// \param __b
|
||||
/// A 128-bit vector of [4 x float] containing one of the source operands.
|
||||
/// The horizontal sums of the values are stored in the upper bits of the
|
||||
/// destination.
|
||||
/// \returns A 128-bit vector of [4 x float] containing the horizontal sums of
|
||||
/// both operands.
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS
|
||||
_mm_hadd_ps(__m128 __a, __m128 __b)
|
||||
{
|
||||
return __builtin_ia32_haddps((__v4sf)__a, (__v4sf)__b);
|
||||
}
|
||||
|
||||
/// Horizontally subtracts the adjacent pairs of values contained in two
|
||||
/// 128-bit vectors of [4 x float].
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VHSUBPS </c> instruction.
|
||||
///
|
||||
/// \param __a
|
||||
/// A 128-bit vector of [4 x float] containing one of the source operands.
|
||||
/// The horizontal differences between the values are stored in the lower
|
||||
/// bits of the destination.
|
||||
/// \param __b
|
||||
/// A 128-bit vector of [4 x float] containing one of the source operands.
|
||||
/// The horizontal differences between the values are stored in the upper
|
||||
/// bits of the destination.
|
||||
/// \returns A 128-bit vector of [4 x float] containing the horizontal
|
||||
/// differences of both operands.
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS
|
||||
_mm_hsub_ps(__m128 __a, __m128 __b)
|
||||
{
|
||||
return __builtin_ia32_hsubps((__v4sf)__a, (__v4sf)__b);
|
||||
}
|
||||
|
||||
/// Moves and duplicates odd-indexed values from a 128-bit vector
|
||||
/// of [4 x float] to float values stored in a 128-bit vector of
|
||||
/// [4 x float].
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VMOVSHDUP </c> instruction.
|
||||
///
|
||||
/// \param __a
|
||||
/// A 128-bit vector of [4 x float]. \n
|
||||
/// Bits [127:96] of the source are written to bits [127:96] and [95:64] of
|
||||
/// the destination. \n
|
||||
/// Bits [63:32] of the source are written to bits [63:32] and [31:0] of the
|
||||
/// destination.
|
||||
/// \returns A 128-bit vector of [4 x float] containing the moved and duplicated
|
||||
/// values.
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS
|
||||
_mm_movehdup_ps(__m128 __a)
|
||||
{
|
||||
return __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 1, 1, 3, 3);
|
||||
}
|
||||
|
||||
/// Duplicates even-indexed values from a 128-bit vector of
|
||||
/// [4 x float] to float values stored in a 128-bit vector of [4 x float].
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VMOVSLDUP </c> instruction.
|
||||
///
|
||||
/// \param __a
|
||||
/// A 128-bit vector of [4 x float] \n
|
||||
/// Bits [95:64] of the source are written to bits [127:96] and [95:64] of
|
||||
/// the destination. \n
|
||||
/// Bits [31:0] of the source are written to bits [63:32] and [31:0] of the
|
||||
/// destination.
|
||||
/// \returns A 128-bit vector of [4 x float] containing the moved and duplicated
|
||||
/// values.
|
||||
static __inline__ __m128 __DEFAULT_FN_ATTRS
|
||||
_mm_moveldup_ps(__m128 __a)
|
||||
{
|
||||
return __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 0, 0, 2, 2);
|
||||
}
|
||||
|
||||
/// Adds the even-indexed values and subtracts the odd-indexed values of
|
||||
/// two 128-bit vectors of [2 x double].
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VADDSUBPD </c> instruction.
|
||||
///
|
||||
/// \param __a
|
||||
/// A 128-bit vector of [2 x double] containing the left source operand.
|
||||
/// \param __b
|
||||
/// A 128-bit vector of [2 x double] containing the right source operand.
|
||||
/// \returns A 128-bit vector of [2 x double] containing the alternating sums
|
||||
/// and differences of both operands.
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS
|
||||
_mm_addsub_pd(__m128d __a, __m128d __b)
|
||||
{
|
||||
return __builtin_ia32_addsubpd((__v2df)__a, (__v2df)__b);
|
||||
}
|
||||
|
||||
/// Horizontally adds the pairs of values contained in two 128-bit
|
||||
/// vectors of [2 x double].
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VHADDPD </c> instruction.
|
||||
///
|
||||
/// \param __a
|
||||
/// A 128-bit vector of [2 x double] containing one of the source operands.
|
||||
/// The horizontal sum of the values is stored in the lower bits of the
|
||||
/// destination.
|
||||
/// \param __b
|
||||
/// A 128-bit vector of [2 x double] containing one of the source operands.
|
||||
/// The horizontal sum of the values is stored in the upper bits of the
|
||||
/// destination.
|
||||
/// \returns A 128-bit vector of [2 x double] containing the horizontal sums of
|
||||
/// both operands.
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS
|
||||
_mm_hadd_pd(__m128d __a, __m128d __b)
|
||||
{
|
||||
return __builtin_ia32_haddpd((__v2df)__a, (__v2df)__b);
|
||||
}
|
||||
|
||||
/// Horizontally subtracts the pairs of values contained in two 128-bit
|
||||
/// vectors of [2 x double].
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VHSUBPD </c> instruction.
|
||||
///
|
||||
/// \param __a
|
||||
/// A 128-bit vector of [2 x double] containing one of the source operands.
|
||||
/// The horizontal difference of the values is stored in the lower bits of
|
||||
/// the destination.
|
||||
/// \param __b
|
||||
/// A 128-bit vector of [2 x double] containing one of the source operands.
|
||||
/// The horizontal difference of the values is stored in the upper bits of
|
||||
/// the destination.
|
||||
/// \returns A 128-bit vector of [2 x double] containing the horizontal
|
||||
/// differences of both operands.
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS
|
||||
_mm_hsub_pd(__m128d __a, __m128d __b)
|
||||
{
|
||||
return __builtin_ia32_hsubpd((__v2df)__a, (__v2df)__b);
|
||||
}
|
||||
|
||||
/// Moves and duplicates one double-precision value to double-precision
|
||||
/// values stored in a 128-bit vector of [2 x double].
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// \code
|
||||
/// __m128d _mm_loaddup_pd(double const *dp);
|
||||
/// \endcode
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VMOVDDUP </c> instruction.
|
||||
///
|
||||
/// \param dp
|
||||
/// A pointer to a double-precision value to be moved and duplicated.
|
||||
/// \returns A 128-bit vector of [2 x double] containing the moved and
|
||||
/// duplicated values.
|
||||
#define _mm_loaddup_pd(dp) _mm_load1_pd(dp)
|
||||
|
||||
/// Moves and duplicates the double-precision value in the lower bits of
|
||||
/// a 128-bit vector of [2 x double] to double-precision values stored in a
|
||||
/// 128-bit vector of [2 x double].
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> VMOVDDUP </c> instruction.
|
||||
///
|
||||
/// \param __a
|
||||
/// A 128-bit vector of [2 x double]. Bits [63:0] are written to bits
|
||||
/// [127:64] and [63:0] of the destination.
|
||||
/// \returns A 128-bit vector of [2 x double] containing the moved and
|
||||
/// duplicated values.
|
||||
static __inline__ __m128d __DEFAULT_FN_ATTRS
|
||||
_mm_movedup_pd(__m128d __a)
|
||||
{
|
||||
return __builtin_shufflevector((__v2df)__a, (__v2df)__a, 0, 0);
|
||||
}
|
||||
|
||||
/// Establishes a linear address memory range to be monitored and puts
|
||||
/// the processor in the monitor event pending state. Data stored in the
|
||||
/// monitored address range causes the processor to exit the pending state.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> MONITOR </c> instruction.
|
||||
///
|
||||
/// \param __p
|
||||
/// The memory range to be monitored. The size of the range is determined by
|
||||
/// CPUID function 0000_0005h.
|
||||
/// \param __extensions
|
||||
/// Optional extensions for the monitoring state.
|
||||
/// \param __hints
|
||||
/// Optional hints for the monitoring state.
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_mm_monitor(void const *__p, unsigned __extensions, unsigned __hints)
|
||||
{
|
||||
__builtin_ia32_monitor((void *)__p, __extensions, __hints);
|
||||
}
|
||||
|
||||
/// Used with the MONITOR instruction to wait while the processor is in
|
||||
/// the monitor event pending state. Data stored in the monitored address
|
||||
/// range causes the processor to exit the pending state.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> MWAIT </c> instruction.
|
||||
///
|
||||
/// \param __extensions
|
||||
/// Optional extensions for the monitoring state, which may vary by
|
||||
/// processor.
|
||||
/// \param __hints
|
||||
/// Optional hints for the monitoring state, which may vary by processor.
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_mm_mwait(unsigned __extensions, unsigned __hints)
|
||||
{
|
||||
__builtin_ia32_mwait(__extensions, __hints);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __PMMINTRIN_H */
|
||||
@@ -1,98 +0,0 @@
|
||||
/*===---- popcntintrin.h - POPCNT intrinsics -------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __POPCNTINTRIN_H
|
||||
#define __POPCNTINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("popcnt")))
|
||||
|
||||
/// Counts the number of bits in the source operand having a value of 1.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> POPCNT </c> instruction.
|
||||
///
|
||||
/// \param __A
|
||||
/// An unsigned 32-bit integer operand.
|
||||
/// \returns A 32-bit integer containing the number of bits with value 1 in the
|
||||
/// source operand.
|
||||
static __inline__ int __DEFAULT_FN_ATTRS
|
||||
_mm_popcnt_u32(unsigned int __A)
|
||||
{
|
||||
return __builtin_popcount(__A);
|
||||
}
|
||||
|
||||
/// Counts the number of bits in the source operand having a value of 1.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> POPCNT </c> instruction.
|
||||
///
|
||||
/// \param __A
|
||||
/// A signed 32-bit integer operand.
|
||||
/// \returns A 32-bit integer containing the number of bits with value 1 in the
|
||||
/// source operand.
|
||||
static __inline__ int __DEFAULT_FN_ATTRS
|
||||
_popcnt32(int __A)
|
||||
{
|
||||
return __builtin_popcount(__A);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
/// Counts the number of bits in the source operand having a value of 1.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> POPCNT </c> instruction.
|
||||
///
|
||||
/// \param __A
|
||||
/// An unsigned 64-bit integer operand.
|
||||
/// \returns A 64-bit integer containing the number of bits with value 1 in the
|
||||
/// source operand.
|
||||
static __inline__ long long __DEFAULT_FN_ATTRS
|
||||
_mm_popcnt_u64(unsigned long long __A)
|
||||
{
|
||||
return __builtin_popcountll(__A);
|
||||
}
|
||||
|
||||
/// Counts the number of bits in the source operand having a value of 1.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the <c> POPCNT </c> instruction.
|
||||
///
|
||||
/// \param __A
|
||||
/// A signed 64-bit integer operand.
|
||||
/// \returns A 64-bit integer containing the number of bits with value 1 in the
|
||||
/// source operand.
|
||||
static __inline__ long long __DEFAULT_FN_ATTRS
|
||||
_popcnt64(long long __A)
|
||||
{
|
||||
return __builtin_popcountll(__A);
|
||||
}
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __POPCNTINTRIN_H */
|
||||
@@ -1,69 +0,0 @@
|
||||
/*===---- prfchwintrin.h - PREFETCHW intrinsic -----------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if !defined(__X86INTRIN_H) && !defined(_MM3DNOW_H_INCLUDED)
|
||||
#error "Never use <prfchwintrin.h> directly; include <x86intrin.h> or <mm3dnow.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __PRFCHWINTRIN_H
|
||||
#define __PRFCHWINTRIN_H
|
||||
|
||||
/// Loads a memory sequence containing the specified memory address into
|
||||
/// all data cache levels. The cache-coherency state is set to exclusive.
|
||||
/// Data can be read from and written to the cache line without additional
|
||||
/// delay.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c PREFETCHT0 instruction.
|
||||
///
|
||||
/// \param __P
|
||||
/// A pointer specifying the memory address to be prefetched.
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
||||
_m_prefetch(void *__P)
|
||||
{
|
||||
__builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
|
||||
}
|
||||
|
||||
/// Loads a memory sequence containing the specified memory address into
|
||||
/// the L1 data cache and sets the cache-coherency to modified. This
|
||||
/// provides a hint to the processor that the cache line will be modified.
|
||||
/// It is intended for use when the cache line will be written to shortly
|
||||
/// after the prefetch is performed.
|
||||
///
|
||||
/// Note that the effect of this intrinsic is dependent on the processor
|
||||
/// implementation.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c PREFETCHW instruction.
|
||||
///
|
||||
/// \param __P
|
||||
/// A pointer specifying the memory address to be prefetched.
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
||||
_m_prefetchw(void *__P)
|
||||
{
|
||||
__builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */);
|
||||
}
|
||||
|
||||
#endif /* __PRFCHWINTRIN_H */
|
||||
@@ -1,51 +0,0 @@
|
||||
/*===------------ ptwriteintrin.h - PTWRITE intrinsic --------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
|
||||
#error "Never use <ptwriteintrin.h> directly; include <x86intrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __PTWRITEINTRIN_H
|
||||
#define __PTWRITEINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS \
|
||||
__attribute__((__always_inline__, __nodebug__, __target__("ptwrite")))
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_ptwrite32(unsigned int __value) {
|
||||
__builtin_ia32_ptwrite32(__value);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_ptwrite64(unsigned long long __value) {
|
||||
__builtin_ia32_ptwrite64(__value);
|
||||
}
|
||||
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __PTWRITEINTRIN_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user