Vendor import of llvm trunk r351319 (just before the release_80 branch
point): https://llvm.org/svn/llvm-project/llvm/trunk@351319
This commit is contained in:
parent
b7eb8e35e4
commit
d8e91e4626
4
.gitignore
vendored
4
.gitignore
vendored
@ -41,6 +41,10 @@ cscope.out
|
||||
autoconf/aclocal.m4
|
||||
autoconf/autom4te.cache
|
||||
/compile_commands.json
|
||||
# Visual Studio built-in CMake configuration
|
||||
/CMakeSettings.json
|
||||
# CLion project configuration
|
||||
/.idea
|
||||
|
||||
#==============================================================================#
|
||||
# Directories to ignore (do not add trailing '/'s, they skip symlinks).
|
||||
|
127
CMakeLists.txt
127
CMakeLists.txt
@ -2,28 +2,17 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.4.3)
|
||||
|
||||
cmake_policy(SET CMP0022 NEW)
|
||||
|
||||
cmake_policy(SET CMP0048 NEW)
|
||||
|
||||
# CMake 3.1 and higher include generator expressions of the form
|
||||
# $<TARGETLIB:obj> in the SOURCES property. These need to be
|
||||
# stripped everywhere that access the SOURCES property, so we just
|
||||
# defer to the OLD behavior of not including generator expressions
|
||||
# in the output for now.
|
||||
cmake_policy(SET CMP0051 OLD)
|
||||
|
||||
cmake_policy(SET CMP0056 NEW)
|
||||
|
||||
cmake_policy(SET CMP0057 NEW)
|
||||
|
||||
if(POLICY CMP0068)
|
||||
cmake_policy(SET CMP0068 NEW)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0075)
|
||||
cmake_policy(SET CMP0075 NEW)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED LLVM_VERSION_MAJOR)
|
||||
set(LLVM_VERSION_MAJOR 7)
|
||||
set(LLVM_VERSION_MAJOR 8)
|
||||
endif()
|
||||
if(NOT DEFINED LLVM_VERSION_MINOR)
|
||||
set(LLVM_VERSION_MINOR 0)
|
||||
@ -115,7 +104,7 @@ endif()
|
||||
# LLVM_EXTERNAL_${project}_SOURCE_DIR using LLVM_ALL_PROJECTS
|
||||
# This allows an easy way of setting up a build directory for llvm and another
|
||||
# one for llvm+clang+... using the same sources.
|
||||
set(LLVM_ALL_PROJECTS "clang;libcxx;libcxxabi;lldb;compiler-rt;lld;polly;debuginfo-tests")
|
||||
set(LLVM_ALL_PROJECTS "clang;libcxx;libcxxabi;libunwind;lldb;compiler-rt;lld;polly;debuginfo-tests")
|
||||
set(LLVM_ENABLE_PROJECTS "" CACHE STRING
|
||||
"Semicolon-separated list of projects to build (${LLVM_ALL_PROJECTS}), or \"all\".")
|
||||
if( LLVM_ENABLE_PROJECTS STREQUAL "all" )
|
||||
@ -198,6 +187,11 @@ option(LLVM_INSTALL_UTILS "Include utility binaries in the 'install' target." OF
|
||||
|
||||
option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
|
||||
|
||||
# Unfortunatly Clang is too eager to search directories for module maps, which can cause the
|
||||
# installed version of the maps to be found when building LLVM from source. Therefore we turn off
|
||||
# the installation by default. See llvm.org/PR31905.
|
||||
option(LLVM_INSTALL_MODULEMAPS "Install the modulemap files in the 'install' target." OFF)
|
||||
|
||||
option(LLVM_USE_FOLDERS "Enable solution folders in Visual Studio. Disable for Express versions." ON)
|
||||
if ( LLVM_USE_FOLDERS )
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
@ -244,29 +238,11 @@ include(CPack)
|
||||
# versions).
|
||||
if( CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE )
|
||||
message(FATAL_ERROR "In-source builds are not allowed.
|
||||
CMake would overwrite the makefiles distributed with LLVM.
|
||||
Please create a directory and run cmake from there, passing the path
|
||||
to this source directory as the last argument.
|
||||
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
|
||||
Please delete them.")
|
||||
endif()
|
||||
if( NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
|
||||
file(GLOB_RECURSE
|
||||
tablegenned_files_on_include_dir
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/llvm/*.gen")
|
||||
file(GLOB_RECURSE
|
||||
tablegenned_files_on_lib_dir
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/Target/*.inc")
|
||||
if( tablegenned_files_on_include_dir OR tablegenned_files_on_lib_dir)
|
||||
message(FATAL_ERROR "Apparently there is a previous in-source build,
|
||||
probably as the result of running `configure' and `make' on
|
||||
${CMAKE_CURRENT_SOURCE_DIR}.
|
||||
This may cause problems. The suspicious files are:
|
||||
${tablegenned_files_on_lib_dir}
|
||||
${tablegenned_files_on_include_dir}
|
||||
Please clean the source directory.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
|
||||
|
||||
@ -320,6 +296,7 @@ set(LLVM_ALL_TARGETS
|
||||
PowerPC
|
||||
Sparc
|
||||
SystemZ
|
||||
WebAssembly
|
||||
X86
|
||||
XCore
|
||||
)
|
||||
@ -346,6 +323,8 @@ if(LLVM_ENABLE_CRASH_OVERRIDES)
|
||||
set(ENABLE_CRASH_OVERRIDES 1)
|
||||
endif()
|
||||
|
||||
option(LLVM_ENABLE_CRASH_DUMPS "Turn on memory dumps on crashes. Currently only implemented on Windows." OFF)
|
||||
|
||||
option(LLVM_ENABLE_FFI "Use libffi to call external functions from the interpreter" OFF)
|
||||
set(FFI_LIBRARY_DIR "" CACHE PATH "Additional directory, where CMake should search for libffi.so")
|
||||
set(FFI_INCLUDE_DIR "" CACHE PATH "Additional directory, where CMake should search for ffi.h or ffi/ffi.h")
|
||||
@ -425,8 +404,8 @@ option(LLVM_USE_OPROFILE
|
||||
option(LLVM_EXTERNALIZE_DEBUGINFO
|
||||
"Generate dSYM files and strip executables and libraries (Darwin Only)" OFF)
|
||||
|
||||
option(LLVM_CODESIGNING_IDENTITY
|
||||
"Sign executables and dylibs with the given identity (Darwin Only)" OFF)
|
||||
set(LLVM_CODESIGNING_IDENTITY "" CACHE STRING
|
||||
"Sign executables and dylibs with the given identity or skip if empty (Darwin Only)")
|
||||
|
||||
# If enabled, verify we are on a platform that supports oprofile.
|
||||
if( LLVM_USE_OPROFILE )
|
||||
@ -524,6 +503,10 @@ option(LLVM_BUILD_TESTS
|
||||
option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON)
|
||||
option(LLVM_INCLUDE_GO_TESTS "Include the Go bindings tests in test build targets." ON)
|
||||
|
||||
option(LLVM_BUILD_BENCHMARKS "Add LLVM benchmark targets to the list of default
|
||||
targets. If OFF, benchmarks still could be built using Benchmarks target." OFF)
|
||||
option(LLVM_INCLUDE_BENCHMARKS "Generate benchmark targets. If OFF, benchmarks can't be built." ON)
|
||||
|
||||
option (LLVM_BUILD_DOCS "Build the llvm documentation." OFF)
|
||||
option (LLVM_INCLUDE_DOCS "Generate build targets for llvm documentation." ON)
|
||||
option (LLVM_ENABLE_DOXYGEN "Use doxygen to generate llvm API documentation." OFF)
|
||||
@ -550,15 +533,17 @@ if(NOT DEFINED LLVM_DYLIB_COMPONENTS)
|
||||
"Semicolon-separated list of components to include in libLLVM, or \"all\".")
|
||||
endif()
|
||||
option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" OFF)
|
||||
option(LLVM_BUILD_LLVM_C_DYLIB "Build libllvm-c re-export library (Darwin Only)" OFF)
|
||||
if(MSVC)
|
||||
option(LLVM_BUILD_LLVM_C_DYLIB "Build LLVM-C.dll (Windows only)" OFF)
|
||||
else()
|
||||
option(LLVM_BUILD_LLVM_C_DYLIB "Build libllvm-c re-export library (Darwin only)" OFF)
|
||||
endif()
|
||||
set(LLVM_BUILD_LLVM_DYLIB_default OFF)
|
||||
if(LLVM_LINK_LLVM_DYLIB OR LLVM_BUILD_LLVM_C_DYLIB)
|
||||
if(LLVM_LINK_LLVM_DYLIB OR (LLVM_BUILD_LLVM_C_DYLIB AND NOT MSVC))
|
||||
set(LLVM_BUILD_LLVM_DYLIB_default ON)
|
||||
endif()
|
||||
option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library" ${LLVM_BUILD_LLVM_DYLIB_default})
|
||||
|
||||
option(LLVM_DYLIB_SYMBOL_VERSIONING OFF)
|
||||
|
||||
option(LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization" OFF)
|
||||
if(CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND (LLVM_ENABLE_ASSERTIONS OR CMAKE_CONFIGURATION_TYPES)))
|
||||
set(LLVM_USE_HOST_TOOLS ON)
|
||||
@ -643,7 +628,7 @@ endif()
|
||||
# - We generate the library table used by llvm-config.
|
||||
#
|
||||
# - We generate the dependencies for the CMake fragment, so that we will
|
||||
# automatically reconfigure outselves.
|
||||
# automatically reconfigure ourselves.
|
||||
|
||||
set(LLVMBUILDTOOL "${LLVM_MAIN_SRC_DIR}/utils/llvm-build/llvm-build")
|
||||
set(LLVMCONFIGLIBRARYDEPENDENCIESINC
|
||||
@ -879,7 +864,7 @@ if( LLVM_INCLUDE_UTILS )
|
||||
else()
|
||||
if ( LLVM_INCLUDE_TESTS )
|
||||
message(FATAL_ERROR "Including tests when not building utils will not work.
|
||||
Either set LLVM_INCLUDE_UTILS to On, or set LLVM_INCLDE_TESTS to Off.")
|
||||
Either set LLVM_INCLUDE_UTILS to On, or set LLVM_INCLUDE_TESTS to Off.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -993,22 +978,57 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
||||
PATTERN ".svn" EXCLUDE
|
||||
)
|
||||
|
||||
if (LLVM_INSTALL_MODULEMAPS)
|
||||
install(DIRECTORY include/llvm include/llvm-c
|
||||
DESTINATION include
|
||||
COMPONENT llvm-headers
|
||||
FILES_MATCHING
|
||||
PATTERN "module.modulemap"
|
||||
)
|
||||
install(FILES include/llvm/module.install.modulemap
|
||||
DESTINATION include/llvm
|
||||
COMPONENT llvm-headers
|
||||
RENAME "module.extern.modulemap"
|
||||
)
|
||||
endif(LLVM_INSTALL_MODULEMAPS)
|
||||
|
||||
# Installing the headers needs to depend on generating any public
|
||||
# tablegen'd headers.
|
||||
add_custom_target(llvm-headers DEPENDS intrinsics_gen)
|
||||
set_target_properties(llvm-headers PROPERTIES FOLDER "Misc")
|
||||
|
||||
if (NOT CMAKE_CONFIGURATION_TYPES)
|
||||
if (NOT LLVM_ENABLE_IDE)
|
||||
add_llvm_install_targets(install-llvm-headers
|
||||
DEPENDS llvm-headers
|
||||
COMPONENT llvm-headers)
|
||||
endif()
|
||||
|
||||
# Custom target to install all libraries.
|
||||
add_custom_target(llvm-libraries)
|
||||
set_target_properties(llvm-libraries PROPERTIES FOLDER "Misc")
|
||||
|
||||
if (NOT LLVM_ENABLE_IDE)
|
||||
add_llvm_install_targets(install-llvm-libraries
|
||||
DEPENDS llvm-libraries
|
||||
COMPONENT llvm-libraries)
|
||||
endif()
|
||||
|
||||
get_property(LLVM_LIBS GLOBAL PROPERTY LLVM_LIBS)
|
||||
if(LLVM_LIBS)
|
||||
list(REMOVE_DUPLICATES LLVM_LIBS)
|
||||
foreach(lib ${LLVM_LIBS})
|
||||
add_dependencies(llvm-libraries ${lib})
|
||||
if (NOT LLVM_ENABLE_IDE)
|
||||
add_dependencies(install-llvm-libraries install-${lib})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# This must be at the end of the LLVM root CMakeLists file because it must run
|
||||
# after all targets are created.
|
||||
if(LLVM_DISTRIBUTION_COMPONENTS)
|
||||
if(CMAKE_CONFIGURATION_TYPES)
|
||||
if(LLVM_ENABLE_IDE)
|
||||
message(FATAL_ERROR "LLVM_DISTRIBUTION_COMPONENTS cannot be specified with multi-configuration generators (i.e. Xcode or Visual Studio)")
|
||||
endif()
|
||||
|
||||
@ -1039,6 +1059,21 @@ if(LLVM_DISTRIBUTION_COMPONENTS)
|
||||
endif()
|
||||
|
||||
# This allows us to deploy the Universal CRT DLLs by passing -DCMAKE_INSTALL_UCRT_LIBRARIES=ON to CMake
|
||||
if (MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
||||
if (MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_INSTALL_UCRT_LIBRARIES)
|
||||
include(InstallRequiredSystemLibraries)
|
||||
endif()
|
||||
|
||||
if (LLVM_INCLUDE_BENCHMARKS)
|
||||
# Override benchmark defaults so that when the library itself is updated these
|
||||
# modifications are not lost.
|
||||
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing" FORCE)
|
||||
set(BENCHMARK_ENABLE_EXCEPTIONS OFF CACHE BOOL "Disable benchmark exceptions" FORCE)
|
||||
set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "Don't install benchmark" FORCE)
|
||||
set(BENCHMARK_DOWNLOAD_DEPENDENCIES OFF CACHE BOOL "Don't download dependencies" FORCE)
|
||||
set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Disable Google Test in benchmark" FORCE)
|
||||
# Since LLVM requires C++11 it is safe to assume that std::regex is available.
|
||||
set(HAVE_STD_REGEX ON CACHE BOOL "OK" FORCE)
|
||||
|
||||
add_subdirectory(utils/benchmark)
|
||||
add_subdirectory(benchmarks)
|
||||
endif()
|
||||
|
@ -71,7 +71,7 @@ D: Loop Strength Reduction, Register allocators
|
||||
N: Andrea Di Biagio
|
||||
E: andrea.dibiagio@sony.com
|
||||
E: andrea.dibiagio@gmail.com
|
||||
D: llvm-mca
|
||||
D: MCA, llvm-mca
|
||||
|
||||
N: Duncan P. N. Exon Smith
|
||||
E: dexonsmith@apple.com
|
||||
@ -218,3 +218,11 @@ D: Release management (x.y.0 releases)
|
||||
N: whitequark
|
||||
E: whitequark@whitequark.org
|
||||
D: C API, OCaml bindings
|
||||
|
||||
N: Jake Ehrlich
|
||||
E: jakehehrlich@google.com
|
||||
D: llvm-objcopy (tools/llvm-objcopy)
|
||||
|
||||
N: Martin Storsjö
|
||||
E: martin@martin.st
|
||||
D: MinGW
|
||||
|
16
CREDITS.TXT
16
CREDITS.TXT
@ -492,8 +492,8 @@ D: Thread Local Storage implementation
|
||||
N: Bill Wendling
|
||||
I: wendling
|
||||
E: isanbard@gmail.com
|
||||
D: Release manager, IR Linker, LTO
|
||||
D: Bunches of stuff
|
||||
D: Release manager, IR Linker, LTO.
|
||||
D: Bunches of stuff.
|
||||
|
||||
N: Bob Wilson
|
||||
E: bob.wilson@acm.org
|
||||
@ -502,3 +502,15 @@ D: Advanced SIMD (NEON) support in the ARM backend.
|
||||
N: QingShan Zhang
|
||||
E: qshanz@cn.ibm.com
|
||||
D: PowerPC Backend Developer
|
||||
|
||||
N: Li Jia He
|
||||
E: hljhehlj@cn.ibm.com
|
||||
D: PowerPC Backend Developer
|
||||
|
||||
N: Zixuan Wu
|
||||
E: wuzish@cn.ibm.com
|
||||
D: PowerPC Backend Developer
|
||||
|
||||
N: Kang Zhang
|
||||
E: shkzhang@cn.ibm.com
|
||||
D: PowerPC Backend Developer
|
||||
|
@ -4,7 +4,7 @@ LLVM Release License
|
||||
University of Illinois/NCSA
|
||||
Open Source License
|
||||
|
||||
Copyright (c) 2003-2018 University of Illinois at Urbana-Champaign.
|
||||
Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign.
|
||||
All rights reserved.
|
||||
|
||||
Developed by:
|
||||
|
@ -13,8 +13,8 @@ O: Ubuntu
|
||||
|
||||
N: Sylvestre Ledru
|
||||
E: sylvestre@debian.org
|
||||
T: x86
|
||||
O: Debian
|
||||
T: All supported archs Debian/Ubuntu
|
||||
O: Debian/Ubuntu packages
|
||||
|
||||
N: Nikola Smiljanic
|
||||
E: popizdeh@gmail.com
|
||||
@ -41,7 +41,7 @@ E: hans@chromium.org
|
||||
T: x86
|
||||
O: Windows
|
||||
|
||||
N: Diana Picus
|
||||
E: diana.picus@linaro.org
|
||||
N: Diana Picus, Yvan Roux
|
||||
E: diana.picus@linaro.org, yvan.roux@linaro.org
|
||||
T: ARM, AArch64
|
||||
O: Linux
|
||||
|
4
benchmarks/CMakeLists.txt
Normal file
4
benchmarks/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
set(LLVM_LINK_COMPONENTS
|
||||
Support)
|
||||
|
||||
add_benchmark(DummyYAML DummyYAML.cpp)
|
13
benchmarks/DummyYAML.cpp
Normal file
13
benchmarks/DummyYAML.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
#include "benchmark/benchmark.h"
|
||||
#include "llvm/Support/YAMLTraits.h"
|
||||
|
||||
static void BM_YAMLDummyIsNumeric(benchmark::State& state) {
|
||||
std::string x = "hello";
|
||||
for (auto _ : state) {
|
||||
std::string copy(x);
|
||||
llvm::yaml::isNumeric(copy);
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_YAMLDummyIsNumeric);
|
||||
|
||||
BENCHMARK_MAIN();
|
@ -16,6 +16,8 @@
|
||||
#include "llvm/IR/LegacyPassManager.h"
|
||||
#include "llvm/IR/Module.h"
|
||||
#include "llvm/Transforms/Instrumentation.h"
|
||||
#include "llvm/Transforms/Instrumentation/MemorySanitizer.h"
|
||||
#include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
@ -28,11 +30,11 @@ void LLVMAddAddressSanitizerModulePass(LLVMPassManagerRef PM) {
|
||||
}
|
||||
|
||||
void LLVMAddThreadSanitizerPass(LLVMPassManagerRef PM) {
|
||||
unwrap(PM)->add(createThreadSanitizerPass());
|
||||
unwrap(PM)->add(createThreadSanitizerLegacyPassPass());
|
||||
}
|
||||
|
||||
void LLVMAddMemorySanitizerPass(LLVMPassManagerRef PM) {
|
||||
unwrap(PM)->add(createMemorySanitizerPass());
|
||||
void LLVMAddMemorySanitizerLegacyPassPass(LLVMPassManagerRef PM) {
|
||||
unwrap(PM)->add(createMemorySanitizerLegacyPassPass());
|
||||
}
|
||||
|
||||
void LLVMAddDataFlowSanitizerPass(LLVMPassManagerRef PM,
|
||||
|
@ -27,7 +27,7 @@ extern "C" {
|
||||
void LLVMAddAddressSanitizerFunctionPass(LLVMPassManagerRef PM);
|
||||
void LLVMAddAddressSanitizerModulePass(LLVMPassManagerRef PM);
|
||||
void LLVMAddThreadSanitizerPass(LLVMPassManagerRef PM);
|
||||
void LLVMAddMemorySanitizerPass(LLVMPassManagerRef PM);
|
||||
void LLVMAddMemorySanitizerLegacyPassPass(LLVMPassManagerRef PM);
|
||||
void LLVMAddDataFlowSanitizerPass(LLVMPassManagerRef PM, int ABIListFilesNum,
|
||||
const char **ABIListFiles);
|
||||
|
||||
|
@ -298,7 +298,8 @@ func (d *DIBuilder) CreateBasicType(t DIBasicType) Metadata {
|
||||
name,
|
||||
C.size_t(len(t.Name)),
|
||||
C.uint64_t(t.SizeInBits),
|
||||
C.unsigned(t.Encoding),
|
||||
C.LLVMDWARFTypeEncoding(t.Encoding),
|
||||
C.LLVMDIFlags(0),
|
||||
)
|
||||
return Metadata{C: result}
|
||||
}
|
||||
@ -564,15 +565,19 @@ func (d *DIBuilder) CreateExpression(addr []int64) Metadata {
|
||||
|
||||
// InsertDeclareAtEnd inserts a call to llvm.dbg.declare at the end of the
|
||||
// specified basic block for the given value and associated debug metadata.
|
||||
func (d *DIBuilder) InsertDeclareAtEnd(v Value, diVarInfo, expr Metadata, bb BasicBlock) Value {
|
||||
result := C.LLVMDIBuilderInsertDeclareAtEnd(d.ref, v.C, diVarInfo.C, expr.C, nil, bb.C)
|
||||
func (d *DIBuilder) InsertDeclareAtEnd(v Value, diVarInfo, expr Metadata, l DebugLoc, bb BasicBlock) Value {
|
||||
loc := C.LLVMDIBuilderCreateDebugLocation(
|
||||
d.m.Context().C, C.uint(l.Line), C.uint(l.Col), l.Scope.C, l.InlinedAt.C)
|
||||
result := C.LLVMDIBuilderInsertDeclareAtEnd(d.ref, v.C, diVarInfo.C, expr.C, loc, bb.C)
|
||||
return Value{C: result}
|
||||
}
|
||||
|
||||
// InsertValueAtEnd inserts a call to llvm.dbg.value at the end of the
|
||||
// specified basic block for the given value and associated debug metadata.
|
||||
func (d *DIBuilder) InsertValueAtEnd(v Value, diVarInfo, expr Metadata, bb BasicBlock) Value {
|
||||
result := C.LLVMDIBuilderInsertDbgValueAtEnd(d.ref, v.C, diVarInfo.C, expr.C, nil, bb.C)
|
||||
func (d *DIBuilder) InsertValueAtEnd(v Value, diVarInfo, expr Metadata, l DebugLoc, bb BasicBlock) Value {
|
||||
loc := C.LLVMDIBuilderCreateDebugLocation(
|
||||
d.m.Context().C, C.uint(l.Line), C.uint(l.Col), l.Scope.C, l.InlinedAt.C)
|
||||
result := C.LLVMDIBuilderInsertDbgValueAtEnd(d.ref, v.C, diVarInfo.C, expr.C, loc, bb.C)
|
||||
return Value{C: result}
|
||||
}
|
||||
|
||||
|
@ -74,6 +74,7 @@ type (
|
||||
IntPredicate C.LLVMIntPredicate
|
||||
FloatPredicate C.LLVMRealPredicate
|
||||
LandingPadClause C.LLVMLandingPadClauseTy
|
||||
InlineAsmDialect C.LLVMInlineAsmDialect
|
||||
)
|
||||
|
||||
func (c Context) IsNil() bool { return c.C == nil }
|
||||
@ -211,6 +212,7 @@ const (
|
||||
PointerTypeKind TypeKind = C.LLVMPointerTypeKind
|
||||
VectorTypeKind TypeKind = C.LLVMVectorTypeKind
|
||||
MetadataTypeKind TypeKind = C.LLVMMetadataTypeKind
|
||||
TokenTypeKind TypeKind = C.LLVMTokenTypeKind
|
||||
)
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -314,6 +316,15 @@ const (
|
||||
LandingPadFilter LandingPadClause = C.LLVMLandingPadFilter
|
||||
)
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// llvm.InlineAsmDialect
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
const (
|
||||
InlineAsmDialectATT InlineAsmDialect = C.LLVMInlineAsmDialectATT
|
||||
InlineAsmDialectIntel InlineAsmDialect = C.LLVMInlineAsmDialectIntel
|
||||
)
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// llvm.Context
|
||||
//-------------------------------------------------------------------------
|
||||
@ -655,6 +666,7 @@ func (t Type) VectorSize() int { return int(C.LLVMGetVectorSize(t.C)) }
|
||||
// Operations on other types
|
||||
func (c Context) VoidType() (t Type) { t.C = C.LLVMVoidTypeInContext(c.C); return }
|
||||
func (c Context) LabelType() (t Type) { t.C = C.LLVMLabelTypeInContext(c.C); return }
|
||||
func (c Context) TokenType() (t Type) { t.C = C.LLVMTokenTypeInContext(c.C); return }
|
||||
|
||||
func VoidType() (t Type) { t.C = C.LLVMVoidType(); return }
|
||||
func LabelType() (t Type) { t.C = C.LLVMLabelType(); return }
|
||||
@ -727,7 +739,6 @@ func (v Value) IsAPHINode() (rv Value) { rv.C = C.LLVMIsAPHINode(v.C
|
||||
func (v Value) IsASelectInst() (rv Value) { rv.C = C.LLVMIsASelectInst(v.C); return }
|
||||
func (v Value) IsAShuffleVectorInst() (rv Value) { rv.C = C.LLVMIsAShuffleVectorInst(v.C); return }
|
||||
func (v Value) IsAStoreInst() (rv Value) { rv.C = C.LLVMIsAStoreInst(v.C); return }
|
||||
func (v Value) IsATerminatorInst() (rv Value) { rv.C = C.LLVMIsATerminatorInst(v.C); return }
|
||||
func (v Value) IsABranchInst() (rv Value) { rv.C = C.LLVMIsABranchInst(v.C); return }
|
||||
func (v Value) IsAInvokeInst() (rv Value) { rv.C = C.LLVMIsAInvokeInst(v.C); return }
|
||||
func (v Value) IsAReturnInst() (rv Value) { rv.C = C.LLVMIsAReturnInst(v.C); return }
|
||||
@ -1237,6 +1248,29 @@ func (v Value) IncomingBlock(i int) (bb BasicBlock) {
|
||||
return
|
||||
}
|
||||
|
||||
// Operations on inline assembly
|
||||
func InlineAsm(t Type, asmString, constraints string, hasSideEffects, isAlignStack bool, dialect InlineAsmDialect) (rv Value) {
|
||||
casm := C.CString(asmString)
|
||||
defer C.free(unsafe.Pointer(casm))
|
||||
cconstraints := C.CString(constraints)
|
||||
defer C.free(unsafe.Pointer(cconstraints))
|
||||
rv.C = C.LLVMGetInlineAsm(t.C, casm, C.size_t(len(asmString)), cconstraints, C.size_t(len(constraints)), boolToLLVMBool(hasSideEffects), boolToLLVMBool(isAlignStack), C.LLVMInlineAsmDialect(dialect))
|
||||
return
|
||||
}
|
||||
|
||||
// Operations on aggregates
|
||||
func (v Value) Indices() []uint32 {
|
||||
num := C.LLVMGetNumIndices(v.C)
|
||||
indicesPtr := C.LLVMGetIndices(v.C)
|
||||
// https://github.com/golang/go/wiki/cgo#turning-c-arrays-into-go-slices
|
||||
rawIndices := (*[1 << 30]C.uint)(unsafe.Pointer(indicesPtr))[:num:num]
|
||||
indices := make([]uint32, num)
|
||||
for i := range indices {
|
||||
indices[i] = uint32(rawIndices[i])
|
||||
}
|
||||
return indices
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// llvm.Builder
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -62,6 +62,7 @@ const (
|
||||
const (
|
||||
CodeModelDefault CodeModel = C.LLVMCodeModelDefault
|
||||
CodeModelJITDefault CodeModel = C.LLVMCodeModelJITDefault
|
||||
CodeModelTiny CodeModel = C.LLVMCodeModelTiny
|
||||
CodeModelSmall CodeModel = C.LLVMCodeModelSmall
|
||||
CodeModelKernel CodeModel = C.LLVMCodeModelKernel
|
||||
CodeModelMedium CodeModel = C.LLVMCodeModelMedium
|
||||
|
24
bindings/go/llvm/transforms_coroutines.go
Normal file
24
bindings/go/llvm/transforms_coroutines.go
Normal file
@ -0,0 +1,24 @@
|
||||
//===- transforms_coroutines.go - Bindings for coroutines -----------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines bindings for the coroutines component.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
package llvm
|
||||
|
||||
/*
|
||||
#include "llvm-c/Transforms/Coroutines.h"
|
||||
*/
|
||||
import "C"
|
||||
|
||||
func (pm PassManager) AddCoroEarlyPass() { C.LLVMAddCoroEarlyPass(pm.C) }
|
||||
func (pm PassManager) AddCoroSplitPass() { C.LLVMAddCoroSplitPass(pm.C) }
|
||||
func (pm PassManager) AddCoroElidePass() { C.LLVMAddCoroElidePass(pm.C) }
|
||||
func (pm PassManager) AddCoroCleanupPass() { C.LLVMAddCoroCleanupPass(pm.C) }
|
@ -32,8 +32,8 @@ func (pm PassManager) AddThreadSanitizerPass() {
|
||||
C.LLVMAddThreadSanitizerPass(pm.C)
|
||||
}
|
||||
|
||||
func (pm PassManager) AddMemorySanitizerPass() {
|
||||
C.LLVMAddMemorySanitizerPass(pm.C)
|
||||
func (pm PassManager) AddMemorySanitizerLegacyPassPass() {
|
||||
C.LLVMAddMemorySanitizerLegacyPassPass(pm.C)
|
||||
}
|
||||
|
||||
func (pm PassManager) AddDataFlowSanitizerPass(abilist []string) {
|
||||
|
@ -42,6 +42,7 @@ module TypeKind = struct
|
||||
| Vector
|
||||
| Metadata
|
||||
| X86_mmx
|
||||
| Token
|
||||
end
|
||||
|
||||
module Linkage = struct
|
||||
@ -238,6 +239,12 @@ module Opcode = struct
|
||||
| AtomicRMW
|
||||
| Resume
|
||||
| LandingPad
|
||||
| AddrSpaceCast
|
||||
| CleanupRet
|
||||
| CatchRet
|
||||
| CatchPad
|
||||
| CleanupPad
|
||||
| CatchSwitch
|
||||
end
|
||||
|
||||
module LandingPadClauseTy = struct
|
||||
@ -303,6 +310,7 @@ module ValueKind = struct
|
||||
| ConstantVector
|
||||
| Function
|
||||
| GlobalAlias
|
||||
| GlobalIFunc
|
||||
| GlobalVariable
|
||||
| UndefValue
|
||||
| Instruction of Opcode.t
|
||||
@ -461,6 +469,7 @@ external struct_element_types : lltype -> lltype array
|
||||
= "llvm_struct_element_types"
|
||||
external is_packed : lltype -> bool = "llvm_is_packed"
|
||||
external is_opaque : lltype -> bool = "llvm_is_opaque"
|
||||
external is_literal : lltype -> bool = "llvm_is_literal"
|
||||
|
||||
(*--... Operations on pointer, vector, and array types .....................--*)
|
||||
|
||||
@ -529,6 +538,7 @@ external operand : llvalue -> int -> llvalue = "llvm_operand"
|
||||
external operand_use : llvalue -> int -> lluse = "llvm_operand_use"
|
||||
external set_operand : llvalue -> int -> llvalue -> unit = "llvm_set_operand"
|
||||
external num_operands : llvalue -> int = "llvm_num_operands"
|
||||
external indices : llvalue -> int array = "llvm_indices"
|
||||
|
||||
(*--... Operations on constants of (mostly) any type .......................--*)
|
||||
external is_constant : llvalue -> bool = "llvm_is_constant"
|
||||
@ -1044,9 +1054,12 @@ let remove_enum_call_site_attr f k i =
|
||||
let remove_string_call_site_attr f k i =
|
||||
llvm_remove_string_call_site_attr f k (AttrIndex.to_int i)
|
||||
|
||||
(*--... Operations on call instructions (only) .............................--*)
|
||||
(*--... Operations on call and invoke instructions (only) ..................--*)
|
||||
external num_arg_operands : llvalue -> int = "llvm_num_arg_operands"
|
||||
external is_tail_call : llvalue -> bool = "llvm_is_tail_call"
|
||||
external set_tail_call : bool -> llvalue -> unit = "llvm_set_tail_call"
|
||||
external get_normal_dest : llvalue -> llbasicblock = "LLVMGetNormalDest"
|
||||
external get_unwind_dest : llvalue -> llbasicblock = "LLVMGetUnwindDest"
|
||||
|
||||
(*--... Operations on load/store instructions (only) .......................--*)
|
||||
external is_volatile : llvalue -> bool = "llvm_is_volatile"
|
||||
@ -1175,6 +1188,7 @@ external build_invoke : llvalue -> llvalue array -> llbasicblock ->
|
||||
= "llvm_build_invoke_bc" "llvm_build_invoke_nat"
|
||||
external build_landingpad : lltype -> llvalue -> int -> string -> llbuilder ->
|
||||
llvalue = "llvm_build_landingpad"
|
||||
external is_cleanup : llvalue -> bool = "llvm_is_cleanup"
|
||||
external set_cleanup : llvalue -> bool -> unit = "llvm_set_cleanup"
|
||||
external add_clause : llvalue -> llvalue -> unit = "llvm_add_clause"
|
||||
external build_resume : llvalue -> llbuilder -> llvalue = "llvm_build_resume"
|
||||
|
@ -77,6 +77,7 @@ module TypeKind : sig
|
||||
| Vector
|
||||
| Metadata
|
||||
| X86_mmx
|
||||
| Token
|
||||
end
|
||||
|
||||
(** The linkage of a global value, accessed with {!linkage} and
|
||||
@ -260,6 +261,12 @@ module Opcode : sig
|
||||
| AtomicRMW
|
||||
| Resume
|
||||
| LandingPad
|
||||
| AddrSpaceCast
|
||||
| CleanupRet
|
||||
| CatchRet
|
||||
| CatchPad
|
||||
| CleanupPad
|
||||
| CatchSwitch
|
||||
end
|
||||
|
||||
(** The type of a clause of a [landingpad] instruction.
|
||||
@ -336,6 +343,7 @@ module ValueKind : sig
|
||||
| ConstantVector
|
||||
| Function
|
||||
| GlobalAlias
|
||||
| GlobalIFunc
|
||||
| GlobalVariable
|
||||
| UndefValue
|
||||
| Instruction of Opcode.t
|
||||
@ -657,6 +665,10 @@ val is_packed : lltype -> bool
|
||||
[false] otherwise. See the method [llvm::StructType::isOpaque]. *)
|
||||
val is_opaque : lltype -> bool
|
||||
|
||||
(** [is_literal sty] returns [true] if the structure type [sty] is literal.
|
||||
[false] otherwise. See the method [llvm::StructType::isLiteral]. *)
|
||||
val is_literal : lltype -> bool
|
||||
|
||||
|
||||
(** {7 Operations on pointer, vector, and array types} *)
|
||||
|
||||
@ -802,6 +814,11 @@ val set_operand : llvalue -> int -> llvalue -> unit
|
||||
val num_operands : llvalue -> int
|
||||
|
||||
|
||||
(** [indices i] returns the indices for the ExtractValue or InsertValue
|
||||
instruction [i].
|
||||
See the [llvm::getIndices] methods. *)
|
||||
val indices : llvalue -> int array
|
||||
|
||||
(** {7 Operations on constants of (mostly) any type} *)
|
||||
|
||||
(** [is_constant v] returns [true] if the value [v] is a constant, [false]
|
||||
@ -1824,7 +1841,12 @@ val remove_enum_call_site_attr : llvalue -> llattrkind -> AttrIndex.t -> unit
|
||||
val remove_string_call_site_attr : llvalue -> string -> AttrIndex.t -> unit
|
||||
|
||||
|
||||
(** {7 Operations on call instructions (only)} *)
|
||||
(** {7 Operations on call and invoke instructions (only)} *)
|
||||
|
||||
(** [num_arg_operands ci] returns the number of arguments for the call or
|
||||
invoke instruction [ci]. See the method
|
||||
[llvm::CallInst::getNumArgOperands]. *)
|
||||
val num_arg_operands : llvalue -> int
|
||||
|
||||
(** [is_tail_call ci] is [true] if the call instruction [ci] is flagged as
|
||||
eligible for tail call optimization, [false] otherwise.
|
||||
@ -1836,6 +1858,14 @@ val is_tail_call : llvalue -> bool
|
||||
See the method [llvm::CallInst::setTailCall]. *)
|
||||
val set_tail_call : bool -> llvalue -> unit
|
||||
|
||||
(** [get_normal_dest ii] is the normal destination basic block of an invoke
|
||||
instruction. See the method [llvm::InvokeInst::getNormalDest()]. *)
|
||||
val get_normal_dest : llvalue -> llbasicblock
|
||||
|
||||
(** [get_unwind_dest ii] is the unwind destination basic block of an invoke
|
||||
instruction. See the method [llvm::InvokeInst::getUnwindDest()]. *)
|
||||
val get_unwind_dest : llvalue -> llbasicblock
|
||||
|
||||
|
||||
(** {7 Operations on load/store instructions (only)} *)
|
||||
|
||||
@ -1857,16 +1887,16 @@ val set_volatile : bool -> llvalue -> unit
|
||||
val is_terminator : llvalue -> bool
|
||||
|
||||
(** [successor v i] returns the successor at index [i] for the value [v].
|
||||
See the method [llvm::TerminatorInst::getSuccessor]. *)
|
||||
See the method [llvm::Instruction::getSuccessor]. *)
|
||||
val successor : llvalue -> int -> llbasicblock
|
||||
|
||||
(** [set_successor v i o] sets the successor of the value [v] at the index [i] to
|
||||
the value [o].
|
||||
See the method [llvm::TerminatorInst::setSuccessor]. *)
|
||||
See the method [llvm::Instruction::setSuccessor]. *)
|
||||
val set_successor : llvalue -> int -> llbasicblock -> unit
|
||||
|
||||
(** [num_successors v] returns the number of successors for the value [v].
|
||||
See the method [llvm::TerminatorInst::getNumSuccessors]. *)
|
||||
See the method [llvm::Instruction::getNumSuccessors]. *)
|
||||
val num_successors : llvalue -> int
|
||||
|
||||
(** [successors v] returns the successors of [v]. *)
|
||||
@ -2068,6 +2098,10 @@ val build_invoke : llvalue -> llvalue array -> llbasicblock ->
|
||||
val build_landingpad : lltype -> llvalue -> int -> string -> llbuilder ->
|
||||
llvalue
|
||||
|
||||
(** [is_cleanup lp] returns [true] if [landingpad] instruction lp is a cleanup.
|
||||
See the method [llvm::LandingPadInst::isCleanup]. *)
|
||||
val is_cleanup : llvalue -> bool
|
||||
|
||||
(** [set_cleanup lp] sets the cleanup flag in the [landingpad]instruction.
|
||||
See the method [llvm::LandingPadInst::setCleanup]. *)
|
||||
val set_cleanup : llvalue -> bool -> unit
|
||||
|
@ -483,9 +483,9 @@ CAMLprim value llvm_struct_set_body(LLVMTypeRef Ty,
|
||||
CAMLprim value llvm_struct_name(LLVMTypeRef Ty)
|
||||
{
|
||||
CAMLparam0();
|
||||
CAMLlocal1(result);
|
||||
const char *C = LLVMGetStructName(Ty);
|
||||
if (C) {
|
||||
CAMLlocal1(result);
|
||||
result = caml_alloc_small(1, 0);
|
||||
Store_field(result, 0, caml_copy_string(C));
|
||||
CAMLreturn(result);
|
||||
@ -510,6 +510,11 @@ CAMLprim value llvm_is_opaque(LLVMTypeRef StructTy) {
|
||||
return Val_bool(LLVMIsOpaqueStruct(StructTy));
|
||||
}
|
||||
|
||||
/* lltype -> bool */
|
||||
CAMLprim value llvm_is_literal(LLVMTypeRef StructTy) {
|
||||
return Val_bool(LLVMIsLiteralStruct(StructTy));
|
||||
}
|
||||
|
||||
/*--... Operations on array, pointer, and vector types .....................--*/
|
||||
|
||||
/* lltype -> lltype array */
|
||||
@ -619,6 +624,7 @@ enum ValueKind {
|
||||
ConstantVector,
|
||||
Function,
|
||||
GlobalAlias,
|
||||
GlobalIFunc,
|
||||
GlobalVariable,
|
||||
UndefValue,
|
||||
Instruction
|
||||
@ -630,6 +636,7 @@ enum ValueKind {
|
||||
|
||||
CAMLprim value llvm_classify_value(LLVMValueRef Val) {
|
||||
CAMLparam0();
|
||||
CAMLlocal1(result);
|
||||
if (!Val)
|
||||
CAMLreturn(Val_int(NullValue));
|
||||
if (LLVMIsAConstant(Val)) {
|
||||
@ -646,7 +653,6 @@ CAMLprim value llvm_classify_value(LLVMValueRef Val) {
|
||||
DEFINE_CASE(Val, ConstantVector);
|
||||
}
|
||||
if (LLVMIsAInstruction(Val)) {
|
||||
CAMLlocal1(result);
|
||||
result = caml_alloc_small(1, 0);
|
||||
Store_field(result, 0, Val_int(LLVMGetInstructionOpcode(Val)));
|
||||
CAMLreturn(result);
|
||||
@ -654,6 +660,7 @@ CAMLprim value llvm_classify_value(LLVMValueRef Val) {
|
||||
if (LLVMIsAGlobalValue(Val)) {
|
||||
DEFINE_CASE(Val, Function);
|
||||
DEFINE_CASE(Val, GlobalAlias);
|
||||
DEFINE_CASE(Val, GlobalIFunc);
|
||||
DEFINE_CASE(Val, GlobalVariable);
|
||||
}
|
||||
DEFINE_CASE(Val, Argument);
|
||||
@ -725,6 +732,19 @@ CAMLprim value llvm_num_operands(LLVMValueRef V) {
|
||||
return Val_int(LLVMGetNumOperands(V));
|
||||
}
|
||||
|
||||
/* llvalue -> int array */
|
||||
CAMLprim value llvm_indices(LLVMValueRef Instr) {
|
||||
CAMLparam0();
|
||||
CAMLlocal1(indices);
|
||||
unsigned n = LLVMGetNumIndices(Instr);
|
||||
const unsigned *Indices = LLVMGetIndices(Instr);
|
||||
indices = caml_alloc(n, 0);
|
||||
for (unsigned i = 0; i < n; i++) {
|
||||
Op_val(indices)[i] = Val_int(Indices[i]);
|
||||
}
|
||||
CAMLreturn(indices);
|
||||
}
|
||||
|
||||
/*--... Operations on constants of (mostly) any type .......................--*/
|
||||
|
||||
/* llvalue -> bool */
|
||||
@ -802,12 +822,11 @@ CAMLprim LLVMValueRef llvm_mdnull(LLVMContextRef C) {
|
||||
/* llvalue -> string option */
|
||||
CAMLprim value llvm_get_mdstring(LLVMValueRef V) {
|
||||
CAMLparam0();
|
||||
CAMLlocal2(Option, Str);
|
||||
const char *S;
|
||||
unsigned Len;
|
||||
|
||||
if ((S = LLVMGetMDString(V, &Len))) {
|
||||
CAMLlocal2(Option, Str);
|
||||
|
||||
Str = caml_alloc_string(Len);
|
||||
memcpy(String_val(Str), S, Len);
|
||||
Option = alloc(1,0);
|
||||
@ -1515,7 +1534,7 @@ CAMLprim value llvm_instr_get_opcode(LLVMValueRef Inst) {
|
||||
if (!LLVMIsAInstruction(Inst))
|
||||
failwith("Not an instruction");
|
||||
o = LLVMGetInstructionOpcode(Inst);
|
||||
assert (o <= LLVMLandingPad);
|
||||
assert (o <= LLVMCatchSwitch);
|
||||
return Val_int(o);
|
||||
}
|
||||
|
||||
@ -1597,6 +1616,11 @@ CAMLprim value llvm_remove_string_call_site_attr(LLVMValueRef F, value Kind,
|
||||
|
||||
/*--... Operations on call instructions (only) .............................--*/
|
||||
|
||||
/* llvalue -> int */
|
||||
CAMLprim value llvm_num_arg_operands(LLVMValueRef V) {
|
||||
return Val_int(LLVMGetNumArgOperands(V));
|
||||
}
|
||||
|
||||
/* llvalue -> bool */
|
||||
CAMLprim value llvm_is_tail_call(LLVMValueRef CallInst) {
|
||||
return Val_bool(LLVMIsTailCall(CallInst));
|
||||
@ -1902,6 +1926,11 @@ CAMLprim value llvm_add_clause(LLVMValueRef LandingPadInst, LLVMValueRef ClauseV
|
||||
return Val_unit;
|
||||
}
|
||||
|
||||
/* llvalue -> bool */
|
||||
CAMLprim value llvm_is_cleanup(LLVMValueRef LandingPadInst)
|
||||
{
|
||||
return Val_bool(LLVMIsCleanup(LandingPadInst));
|
||||
}
|
||||
|
||||
/* llvalue -> bool -> unit */
|
||||
CAMLprim value llvm_set_cleanup(LLVMValueRef LandingPadInst, value flag)
|
||||
|
@ -64,6 +64,9 @@ external add_memcpy_opt
|
||||
external add_partially_inline_lib_calls
|
||||
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
|
||||
= "llvm_add_partially_inline_lib_calls"
|
||||
external add_lower_atomic
|
||||
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
|
||||
= "llvm_add_lower_atomic"
|
||||
external add_lower_switch
|
||||
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
|
||||
= "llvm_add_lower_switch"
|
||||
@ -118,3 +121,6 @@ external add_scoped_no_alias_alias_analysis
|
||||
external add_basic_alias_analysis
|
||||
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
|
||||
= "llvm_add_basic_alias_analysis"
|
||||
external add_unify_function_exit_nodes
|
||||
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
|
||||
= "llvm_add_unify_function_exit_nodes"
|
||||
|
@ -107,6 +107,11 @@ external add_partially_inline_lib_calls
|
||||
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
|
||||
= "llvm_add_partially_inline_lib_calls"
|
||||
|
||||
(** See the [llvm::createLowerAtomicPass] function. *)
|
||||
external add_lower_atomic
|
||||
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
|
||||
= "llvm_add_lower_atomic"
|
||||
|
||||
(** See the [llvm::createLowerSwitchPass] function. *)
|
||||
external add_lower_switch
|
||||
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
|
||||
@ -196,3 +201,8 @@ external add_scoped_no_alias_alias_analysis
|
||||
external add_basic_alias_analysis
|
||||
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
|
||||
= "llvm_add_basic_alias_analysis"
|
||||
|
||||
(** See the [llvm::createUnifyFunctionExitNodesPass] function. *)
|
||||
external add_unify_function_exit_nodes
|
||||
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
|
||||
= "llvm_add_unify_function_exit_nodes"
|
||||
|
@ -16,6 +16,7 @@
|
||||
\*===----------------------------------------------------------------------===*/
|
||||
|
||||
#include "llvm-c/Transforms/Scalar.h"
|
||||
#include "llvm-c/Transforms/Utils.h"
|
||||
#include "caml/mlvalues.h"
|
||||
#include "caml/misc.h"
|
||||
|
||||
@ -133,6 +134,12 @@ CAMLprim value llvm_add_partially_inline_lib_calls(LLVMPassManagerRef PM) {
|
||||
return Val_unit;
|
||||
}
|
||||
|
||||
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
|
||||
CAMLprim value llvm_add_lower_atomic(LLVMPassManagerRef PM) {
|
||||
LLVMAddLowerAtomicPass(PM);
|
||||
return Val_unit;
|
||||
}
|
||||
|
||||
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
|
||||
CAMLprim value llvm_add_lower_switch(LLVMPassManagerRef PM) {
|
||||
LLVMAddLowerSwitchPass(PM);
|
||||
@ -241,3 +248,9 @@ CAMLprim value llvm_add_basic_alias_analysis(LLVMPassManagerRef PM) {
|
||||
LLVMAddBasicAliasAnalysisPass(PM);
|
||||
return Val_unit;
|
||||
}
|
||||
|
||||
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
|
||||
CAMLprim value llvm_add_unify_function_exit_nodes(LLVMPassManagerRef PM) {
|
||||
LLVMAddUnifyFunctionExitNodesPass(PM);
|
||||
return Val_unit;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*===-- vectorize_ocaml.c - LLVM OCaml Glue ---------------------*- C++ -*-===*\
|
||||
/*===-- transform_utils_ocaml.c - LLVM OCaml Glue ---------------*- C++ -*-===*\
|
||||
|* *|
|
||||
|* The LLVM Compiler Infrastructure *|
|
||||
|* *|
|
||||
|
@ -6,6 +6,7 @@
|
||||
# License. See LICENSE.TXT for details.
|
||||
#
|
||||
#===------------------------------------------------------------------------===#
|
||||
from __future__ import print_function
|
||||
|
||||
from .common import LLVMObject
|
||||
from .common import c_object_p
|
||||
@ -18,6 +19,8 @@ from ctypes import byref
|
||||
from ctypes import c_char_p
|
||||
from ctypes import c_uint
|
||||
|
||||
import sys
|
||||
|
||||
__all__ = [
|
||||
"lib",
|
||||
"Enums",
|
||||
@ -235,7 +238,7 @@ class Module(LLVMObject):
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
def __next__(self):
|
||||
if not isinstance(self.function, Function):
|
||||
raise StopIteration("")
|
||||
result = self.function
|
||||
@ -244,7 +247,10 @@ class Module(LLVMObject):
|
||||
else:
|
||||
self.function = self.function.next
|
||||
return result
|
||||
|
||||
|
||||
if sys.version_info.major == 2:
|
||||
next = __next__
|
||||
|
||||
def __iter__(self):
|
||||
return Module.__function_iterator(self)
|
||||
|
||||
@ -303,7 +309,7 @@ class Function(Value):
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
def __next__(self):
|
||||
if not isinstance(self.bb, BasicBlock):
|
||||
raise StopIteration("")
|
||||
result = self.bb
|
||||
@ -312,6 +318,9 @@ class Function(Value):
|
||||
else:
|
||||
self.bb = self.bb.next
|
||||
return result
|
||||
|
||||
if sys.version_info.major == 2:
|
||||
next = __next__
|
||||
|
||||
def __iter__(self):
|
||||
return Function.__bb_iterator(self)
|
||||
@ -380,7 +389,7 @@ class BasicBlock(LLVMObject):
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
def __next__(self):
|
||||
if not isinstance(self.inst, Instruction):
|
||||
raise StopIteration("")
|
||||
result = self.inst
|
||||
@ -389,7 +398,10 @@ class BasicBlock(LLVMObject):
|
||||
else:
|
||||
self.inst = self.inst.next
|
||||
return result
|
||||
|
||||
|
||||
if sys.version_info.major == 2:
|
||||
next = __next__
|
||||
|
||||
def __iter__(self):
|
||||
return BasicBlock.__inst_iterator(self)
|
||||
|
||||
@ -605,7 +617,7 @@ def register_enumerations():
|
||||
]
|
||||
for enum_class, enum_spec in enums:
|
||||
for name, value in enum_spec:
|
||||
print name, value
|
||||
print(name, value)
|
||||
enum_class.register(name, value)
|
||||
return enums
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
import os.path
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
|
||||
POSSIBLE_TEST_BINARIES = [
|
||||
'libreadline.so.5',
|
||||
'libreadline.so.6',
|
||||
@ -15,6 +17,9 @@ POSSIBLE_TEST_BINARY_PATHS = [
|
||||
]
|
||||
|
||||
class TestBase(unittest.TestCase):
|
||||
if sys.version_info.major == 2:
|
||||
assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
|
||||
|
||||
def get_test_binary(self):
|
||||
"""Helper to obtain a test binary for object file testing.
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
from __future__ import print_function
|
||||
|
||||
from .base import TestBase
|
||||
from ..core import OpCode
|
||||
from ..core import MemoryBuffer
|
||||
@ -11,5 +13,5 @@ class TestBitReader(TestBase):
|
||||
def test_parse_bitcode(self):
|
||||
source = self.get_test_bc()
|
||||
m = parse_bitcode(MemoryBuffer(filename=source))
|
||||
print m.target
|
||||
print m.datalayout
|
||||
print(m.target)
|
||||
print(m.datalayout)
|
||||
|
@ -1,3 +1,5 @@
|
||||
from __future__ import print_function
|
||||
|
||||
from .base import TestBase
|
||||
from ..core import MemoryBuffer
|
||||
from ..core import PassRegistry
|
||||
@ -127,7 +129,7 @@ class TestCore(TestBase):
|
||||
self.assertEqual(inst.opcode, inst_list[i][1])
|
||||
for op in range(len(inst)):
|
||||
o = inst.get_operand(op)
|
||||
print o.name
|
||||
print(o.name)
|
||||
o.dump()
|
||||
inst.dump()
|
||||
i += 1
|
||||
|
@ -1,3 +1,5 @@
|
||||
from __future__ import print_function
|
||||
|
||||
from .base import TestBase
|
||||
|
||||
from ..disassembler import Disassembler, Option_UseMarkup
|
||||
@ -17,7 +19,7 @@ class TestDisassembler(TestBase):
|
||||
self.assertEqual(s, '\tjcxz\t-127')
|
||||
|
||||
def test_nonexistent_triple(self):
|
||||
with self.assertRaisesRegexp(Exception, "Could not obtain disassembler for triple"):
|
||||
with self.assertRaisesRegex(Exception, "Could not obtain disassembler for triple"):
|
||||
Disassembler("nonexistent-triple-raises")
|
||||
|
||||
def test_get_instructions(self):
|
||||
@ -38,6 +40,6 @@ class TestDisassembler(TestBase):
|
||||
disassembler = Disassembler(triple)
|
||||
disassembler.set_options(Option_UseMarkup)
|
||||
count, s = disassembler.get_instruction(sequence)
|
||||
print s
|
||||
print(s)
|
||||
self.assertEqual(count, 4)
|
||||
self.assertEqual(s, '\tpush\t{<reg:r4>, <reg:lr>}')
|
||||
|
@ -1,3 +1,5 @@
|
||||
from numbers import Integral
|
||||
|
||||
from .base import TestBase
|
||||
from ..object import ObjectFile
|
||||
from ..object import Relocation
|
||||
@ -20,9 +22,9 @@ class TestObjectFile(TestBase):
|
||||
count += 1
|
||||
assert isinstance(section, Section)
|
||||
assert isinstance(section.name, str)
|
||||
assert isinstance(section.size, long)
|
||||
assert isinstance(section.size, Integral)
|
||||
assert isinstance(section.contents, str)
|
||||
assert isinstance(section.address, long)
|
||||
assert isinstance(section.address, Integral)
|
||||
assert len(section.contents) == section.size
|
||||
|
||||
self.assertGreater(count, 0)
|
||||
@ -38,8 +40,8 @@ class TestObjectFile(TestBase):
|
||||
count += 1
|
||||
assert isinstance(symbol, Symbol)
|
||||
assert isinstance(symbol.name, str)
|
||||
assert isinstance(symbol.address, long)
|
||||
assert isinstance(symbol.size, long)
|
||||
assert isinstance(symbol.address, Integral)
|
||||
assert isinstance(symbol.size, Integral)
|
||||
|
||||
self.assertGreater(count, 0)
|
||||
|
||||
@ -60,8 +62,8 @@ class TestObjectFile(TestBase):
|
||||
for section in o.get_sections():
|
||||
for relocation in section.get_relocations():
|
||||
assert isinstance(relocation, Relocation)
|
||||
assert isinstance(relocation.address, long)
|
||||
assert isinstance(relocation.offset, long)
|
||||
assert isinstance(relocation.type_number, long)
|
||||
assert isinstance(relocation.address, Integral)
|
||||
assert isinstance(relocation.offset, Integral)
|
||||
assert isinstance(relocation.type_number, Integral)
|
||||
assert isinstance(relocation.type_name, str)
|
||||
assert isinstance(relocation.value_string, str)
|
||||
|
@ -7,6 +7,7 @@ include(CheckIncludeFile)
|
||||
include(CheckLibraryExists)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckStructHasMember)
|
||||
include(CheckCCompilerFlag)
|
||||
|
||||
include(CheckCompilerVersion)
|
||||
@ -128,7 +129,7 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
|
||||
endif()
|
||||
if(LLVM_ENABLE_TERMINFO)
|
||||
set(HAVE_TERMINFO 0)
|
||||
foreach(library tinfo terminfo curses ncurses ncursesw)
|
||||
foreach(library terminfo tinfo curses ncurses ncursesw)
|
||||
string(TOUPPER ${library} library_suffix)
|
||||
check_library_exists(${library} setupterm "" HAVE_TERMINFO_${library_suffix})
|
||||
if(HAVE_TERMINFO_${library_suffix})
|
||||
@ -248,6 +249,11 @@ if( HAVE_DLFCN_H )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtimespec.tv_nsec
|
||||
"sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC)
|
||||
CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtim.tv_nsec
|
||||
"sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC)
|
||||
|
||||
check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)
|
||||
if( LLVM_USING_GLIBC )
|
||||
add_definitions( -D_GNU_SOURCE )
|
||||
|
@ -73,7 +73,7 @@ function(add_llvm_symbol_exports target_name export_file)
|
||||
VERBATIM
|
||||
COMMENT "Creating export file for ${target_name}")
|
||||
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
|
||||
LINK_FLAGS " -Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
|
||||
LINK_FLAGS " -Wl,-exported_symbols_list,\"${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}\"")
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
|
||||
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
|
||||
LINK_FLAGS " -Wl,-bE:${export_file}")
|
||||
@ -93,10 +93,10 @@ function(add_llvm_symbol_exports target_name export_file)
|
||||
COMMENT "Creating export file for ${target_name}")
|
||||
if (${LLVM_LINKER_IS_SOLARISLD})
|
||||
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
|
||||
LINK_FLAGS " -Wl,-M,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
|
||||
LINK_FLAGS " -Wl,-M,\"${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}\"")
|
||||
else()
|
||||
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
|
||||
LINK_FLAGS " -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
|
||||
LINK_FLAGS " -Wl,--version-script,\"${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}\"")
|
||||
endif()
|
||||
else()
|
||||
set(native_export_file "${target_name}.def")
|
||||
@ -372,12 +372,14 @@ endfunction(set_windows_version_resource_properties)
|
||||
# May specify header files for IDE generators.
|
||||
# SONAME
|
||||
# Should set SONAME link flags and create symlinks
|
||||
# NO_INSTALL_RPATH
|
||||
# Suppress default RPATH settings in shared libraries.
|
||||
# PLUGIN_TOOL
|
||||
# The tool (i.e. cmake target) that this plugin will link against
|
||||
# )
|
||||
function(llvm_add_library name)
|
||||
cmake_parse_arguments(ARG
|
||||
"MODULE;SHARED;STATIC;OBJECT;DISABLE_LLVM_LINK_LLVM_DYLIB;SONAME"
|
||||
"MODULE;SHARED;STATIC;OBJECT;DISABLE_LLVM_LINK_LLVM_DYLIB;SONAME;NO_INSTALL_RPATH"
|
||||
"OUTPUT_NAME;PLUGIN_TOOL"
|
||||
"ADDITIONAL_HEADERS;DEPENDS;LINK_COMPONENTS;LINK_LIBS;OBJLIBS"
|
||||
${ARGN})
|
||||
@ -448,17 +450,19 @@ function(llvm_add_library name)
|
||||
|
||||
if(ARG_MODULE)
|
||||
add_library(${name} MODULE ${ALL_FILES})
|
||||
llvm_setup_rpath(${name})
|
||||
elseif(ARG_SHARED)
|
||||
add_windows_version_resource_file(ALL_FILES ${ALL_FILES})
|
||||
add_library(${name} SHARED ${ALL_FILES})
|
||||
|
||||
llvm_setup_rpath(${name})
|
||||
|
||||
else()
|
||||
add_library(${name} STATIC ${ALL_FILES})
|
||||
endif()
|
||||
|
||||
if(NOT ARG_NO_INSTALL_RPATH)
|
||||
if(ARG_MODULE OR ARG_SHARED)
|
||||
llvm_setup_rpath(${name})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
setup_dependency_debugging(${name} ${LLVM_COMMON_DEPENDS})
|
||||
|
||||
if(DEFINED windows_resource_file)
|
||||
@ -499,7 +503,7 @@ function(llvm_add_library name)
|
||||
set_target_properties(${name}
|
||||
PROPERTIES
|
||||
# Since 4.0.0, the ABI version is indicated by the major version
|
||||
SOVERSION ${LLVM_VERSION_MAJOR}
|
||||
SOVERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}
|
||||
VERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX})
|
||||
endif()
|
||||
endif()
|
||||
@ -612,11 +616,13 @@ endfunction()
|
||||
|
||||
macro(add_llvm_library name)
|
||||
cmake_parse_arguments(ARG
|
||||
"SHARED;BUILDTREE_ONLY"
|
||||
"SHARED;BUILDTREE_ONLY;MODULE"
|
||||
""
|
||||
""
|
||||
${ARGN})
|
||||
if( BUILD_SHARED_LIBS OR ARG_SHARED )
|
||||
if(ARG_MODULE)
|
||||
llvm_add_library(${name} MODULE ${ARG_UNPARSED_ARGUMENTS})
|
||||
elseif( BUILD_SHARED_LIBS OR ARG_SHARED )
|
||||
llvm_add_library(${name} SHARED ${ARG_UNPARSED_ARGUMENTS})
|
||||
else()
|
||||
llvm_add_library(${name} ${ARG_UNPARSED_ARGUMENTS})
|
||||
@ -625,19 +631,23 @@ macro(add_llvm_library name)
|
||||
# Libraries that are meant to only be exposed via the build tree only are
|
||||
# never installed and are only exported as a target in the special build tree
|
||||
# config file.
|
||||
if (NOT ARG_BUILDTREE_ONLY)
|
||||
if (NOT ARG_BUILDTREE_ONLY AND NOT ARG_MODULE)
|
||||
set_property( GLOBAL APPEND PROPERTY LLVM_LIBS ${name} )
|
||||
endif()
|
||||
|
||||
if( EXCLUDE_FROM_ALL )
|
||||
if (ARG_MODULE AND NOT TARGET ${name})
|
||||
# Add empty "phony" target
|
||||
add_custom_target(${name})
|
||||
elseif( EXCLUDE_FROM_ALL )
|
||||
set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||
elseif(ARG_BUILDTREE_ONLY)
|
||||
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
|
||||
else()
|
||||
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO" OR
|
||||
${name} STREQUAL "OptRemarks" OR
|
||||
(LLVM_LINK_LLVM_DYLIB AND ${name} STREQUAL "LLVM"))
|
||||
set(install_dir lib${LLVM_LIBDIR_SUFFIX})
|
||||
if(ARG_SHARED OR BUILD_SHARED_LIBS)
|
||||
if(ARG_MODULE OR ARG_SHARED OR BUILD_SHARED_LIBS)
|
||||
if(WIN32 OR CYGWIN OR MINGW)
|
||||
set(install_type RUNTIME)
|
||||
set(install_dir bin)
|
||||
@ -648,6 +658,10 @@ macro(add_llvm_library name)
|
||||
set(install_type ARCHIVE)
|
||||
endif()
|
||||
|
||||
if (ARG_MODULE)
|
||||
set(install_type LIBRARY)
|
||||
endif()
|
||||
|
||||
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
|
||||
NOT LLVM_DISTRIBUTION_COMPONENTS)
|
||||
set(export_to_llvmexports EXPORT LLVMExports)
|
||||
@ -659,7 +673,7 @@ macro(add_llvm_library name)
|
||||
${install_type} DESTINATION ${install_dir}
|
||||
COMPONENT ${name})
|
||||
|
||||
if (NOT CMAKE_CONFIGURATION_TYPES)
|
||||
if (NOT LLVM_ENABLE_IDE)
|
||||
add_llvm_install_targets(install-${name}
|
||||
DEPENDS ${name}
|
||||
COMPONENT ${name})
|
||||
@ -667,47 +681,20 @@ macro(add_llvm_library name)
|
||||
endif()
|
||||
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
|
||||
endif()
|
||||
set_target_properties(${name} PROPERTIES FOLDER "Libraries")
|
||||
if (ARG_MODULE)
|
||||
set_target_properties(${name} PROPERTIES FOLDER "Loadable modules")
|
||||
else()
|
||||
set_target_properties(${name} PROPERTIES FOLDER "Libraries")
|
||||
endif()
|
||||
endmacro(add_llvm_library name)
|
||||
|
||||
macro(add_llvm_loadable_module name)
|
||||
llvm_add_library(${name} MODULE ${ARGN})
|
||||
if(NOT TARGET ${name})
|
||||
# Add empty "phony" target
|
||||
add_custom_target(${name})
|
||||
else()
|
||||
if( EXCLUDE_FROM_ALL )
|
||||
set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||
else()
|
||||
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
||||
if(WIN32 OR CYGWIN)
|
||||
# DLL platform
|
||||
set(dlldir "bin")
|
||||
else()
|
||||
set(dlldir "lib${LLVM_LIBDIR_SUFFIX}")
|
||||
endif()
|
||||
|
||||
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
|
||||
NOT LLVM_DISTRIBUTION_COMPONENTS)
|
||||
set(export_to_llvmexports EXPORT LLVMExports)
|
||||
set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)
|
||||
endif()
|
||||
|
||||
install(TARGETS ${name}
|
||||
${export_to_llvmexports}
|
||||
LIBRARY DESTINATION ${dlldir}
|
||||
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
|
||||
endif()
|
||||
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_target_properties(${name} PROPERTIES FOLDER "Loadable modules")
|
||||
endmacro(add_llvm_loadable_module name)
|
||||
|
||||
|
||||
macro(add_llvm_executable name)
|
||||
cmake_parse_arguments(ARG "DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO;NO_INSTALL_RPATH" "" "DEPENDS" ${ARGN})
|
||||
cmake_parse_arguments(ARG
|
||||
"DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO;NO_INSTALL_RPATH"
|
||||
"ENTITLEMENTS"
|
||||
"DEPENDS"
|
||||
${ARGN})
|
||||
|
||||
llvm_process_sources( ALL_FILES ${ARG_UNPARSED_ARGUMENTS} )
|
||||
|
||||
list(APPEND LLVM_COMMON_DEPENDS ${ARG_DEPENDS})
|
||||
@ -786,7 +773,7 @@ macro(add_llvm_executable name)
|
||||
target_link_libraries(${name} PRIVATE ${LLVM_PTHREAD_LIB})
|
||||
endif()
|
||||
|
||||
llvm_codesign(${name})
|
||||
llvm_codesign(${name} ENTITLEMENTS ${ARG_ENTITLEMENTS})
|
||||
endmacro(add_llvm_executable name)
|
||||
|
||||
function(export_executable_symbols target)
|
||||
@ -890,7 +877,7 @@ macro(add_llvm_tool name)
|
||||
RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}
|
||||
COMPONENT ${name})
|
||||
|
||||
if (NOT CMAKE_CONFIGURATION_TYPES)
|
||||
if (NOT LLVM_ENABLE_IDE)
|
||||
add_llvm_install_targets(install-${name}
|
||||
DEPENDS ${name}
|
||||
COMPONENT ${name})
|
||||
@ -928,11 +915,14 @@ macro(add_llvm_utility name)
|
||||
install (TARGETS ${name}
|
||||
RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR}
|
||||
COMPONENT ${name})
|
||||
if (NOT CMAKE_CONFIGURATION_TYPES)
|
||||
if (NOT LLVM_ENABLE_IDE)
|
||||
add_llvm_install_targets(install-${name}
|
||||
DEPENDS ${name}
|
||||
COMPONENT ${name})
|
||||
endif()
|
||||
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
|
||||
elseif( LLVM_BUILD_UTILS )
|
||||
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
|
||||
endif()
|
||||
endmacro(add_llvm_utility name)
|
||||
|
||||
@ -972,47 +962,50 @@ endfunction(canonicalize_tool_name)
|
||||
# Custom add_subdirectory wrapper
|
||||
# Takes in a project name (i.e. LLVM), the subdirectory name, and an optional
|
||||
# path if it differs from the name.
|
||||
macro(add_llvm_subdirectory project type name)
|
||||
function(add_llvm_subdirectory project type name)
|
||||
set(add_llvm_external_dir "${ARGN}")
|
||||
if("${add_llvm_external_dir}" STREQUAL "")
|
||||
set(add_llvm_external_dir ${name})
|
||||
endif()
|
||||
canonicalize_tool_name(${name} nameUPPER)
|
||||
set(canonical_full_name ${project}_${type}_${nameUPPER})
|
||||
get_property(already_processed GLOBAL PROPERTY ${canonical_full_name}_PROCESSED)
|
||||
if(already_processed)
|
||||
return()
|
||||
endif()
|
||||
set_property(GLOBAL PROPERTY ${canonical_full_name}_PROCESSED YES)
|
||||
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}/CMakeLists.txt)
|
||||
# Treat it as in-tree subproject.
|
||||
option(${project}_${type}_${nameUPPER}_BUILD
|
||||
option(${canonical_full_name}_BUILD
|
||||
"Whether to build ${name} as part of ${project}" On)
|
||||
mark_as_advanced(${project}_${type}_${name}_BUILD)
|
||||
if(${project}_${type}_${nameUPPER}_BUILD)
|
||||
if(${canonical_full_name}_BUILD)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir} ${add_llvm_external_dir})
|
||||
# Don't process it in add_llvm_implicit_projects().
|
||||
set(${project}_${type}_${nameUPPER}_BUILD OFF)
|
||||
endif()
|
||||
else()
|
||||
set(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR
|
||||
"${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}"
|
||||
CACHE PATH "Path to ${name} source directory")
|
||||
set(${project}_${type}_${nameUPPER}_BUILD_DEFAULT ON)
|
||||
set(${canonical_full_name}_BUILD_DEFAULT ON)
|
||||
if(NOT LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR OR NOT EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR})
|
||||
set(${project}_${type}_${nameUPPER}_BUILD_DEFAULT OFF)
|
||||
set(${canonical_full_name}_BUILD_DEFAULT OFF)
|
||||
endif()
|
||||
if("${LLVM_EXTERNAL_${nameUPPER}_BUILD}" STREQUAL "OFF")
|
||||
set(${project}_${type}_${nameUPPER}_BUILD_DEFAULT OFF)
|
||||
set(${canonical_full_name}_BUILD_DEFAULT OFF)
|
||||
endif()
|
||||
option(${project}_${type}_${nameUPPER}_BUILD
|
||||
option(${canonical_full_name}_BUILD
|
||||
"Whether to build ${name} as part of LLVM"
|
||||
${${project}_${type}_${nameUPPER}_BUILD_DEFAULT})
|
||||
if (${project}_${type}_${nameUPPER}_BUILD)
|
||||
${${canonical_full_name}_BUILD_DEFAULT})
|
||||
if (${canonical_full_name}_BUILD)
|
||||
if(EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR})
|
||||
add_subdirectory(${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR} ${add_llvm_external_dir})
|
||||
elseif(NOT "${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}" STREQUAL "")
|
||||
message(WARNING "Nonexistent directory for ${name}: ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}")
|
||||
endif()
|
||||
# FIXME: It'd be redundant.
|
||||
set(${project}_${type}_${nameUPPER}_BUILD Off)
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
endfunction()
|
||||
|
||||
# Add external project that may want to be built as part of llvm such as Clang,
|
||||
# lld, and Polly. This adds two options. One for the source directory of the
|
||||
@ -1084,7 +1077,7 @@ function(add_unittest test_suite test_name)
|
||||
# Our current version of gtest does not properly recognize C++11 support
|
||||
# with MSVC, so it falls back to tr1 / experimental classes. Since LLVM
|
||||
# itself requires C++11, we can safely force it on unconditionally so that
|
||||
# we don't have to fight with the buggy gtest check.
|
||||
# we don't have to fight with the buggy gtest check.
|
||||
add_definitions(-DGTEST_LANG_CXX11=1)
|
||||
add_definitions(-DGTEST_HAS_TR1_TUPLE=0)
|
||||
|
||||
@ -1120,6 +1113,30 @@ function(add_unittest test_suite test_name)
|
||||
endif ()
|
||||
endfunction()
|
||||
|
||||
# Use for test binaries that call llvm::getInputFileDirectory(). Use of this
|
||||
# is discouraged.
|
||||
function(add_unittest_with_input_files test_suite test_name)
|
||||
set(LLVM_UNITTEST_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
configure_file(
|
||||
${LLVM_MAIN_SRC_DIR}/unittests/unittest.cfg.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/llvm.srcdir.txt)
|
||||
|
||||
add_unittest(${test_suite} ${test_name} ${ARGN})
|
||||
endfunction()
|
||||
|
||||
# Generic support for adding a benchmark.
|
||||
function(add_benchmark benchmark_name)
|
||||
if( NOT LLVM_BUILD_BENCHMARKS )
|
||||
set(EXCLUDE_FROM_ALL ON)
|
||||
endif()
|
||||
|
||||
add_llvm_executable(${benchmark_name} IGNORE_EXTERNALIZE_DEBUGINFO NO_INSTALL_RPATH ${ARGN})
|
||||
set(outdir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
|
||||
set_output_directory(${benchmark_name} BINARY_DIR ${outdir} LIBRARY_DIR ${outdir})
|
||||
set_property(TARGET ${benchmark_name} PROPERTY FOLDER "Utils")
|
||||
target_link_libraries(${benchmark_name} PRIVATE benchmark)
|
||||
endfunction()
|
||||
|
||||
function(llvm_add_go_executable binary pkgpath)
|
||||
cmake_parse_arguments(ARG "ALL" "" "DEPENDS;GOFLAGS" ${ARGN})
|
||||
|
||||
@ -1243,10 +1260,6 @@ function(configure_lit_site_cfg site_in site_out)
|
||||
set(TARGET_TRIPLE "\"+config.target_triple+\"")
|
||||
endif()
|
||||
|
||||
string(CONCAT LIT_SITE_CFG_IN_FOOTER
|
||||
"import lit.llvm\n"
|
||||
"lit.llvm.initialize(lit_config, config)\n")
|
||||
|
||||
configure_file(${site_in} ${site_out} @ONLY)
|
||||
if (EXISTS "${ARG_MAIN_CONFIG}")
|
||||
set(PYTHON_STATEMENT "map_config('${ARG_MAIN_CONFIG}', '${site_out}')")
|
||||
@ -1347,6 +1360,7 @@ function(add_lit_target target comment)
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "${target} does nothing, no tools built.")
|
||||
message(STATUS "${target} does nothing.")
|
||||
endif()
|
||||
|
||||
if (ARG_DEPENDS)
|
||||
add_dependencies(${target} ${ARG_DEPENDS})
|
||||
endif()
|
||||
@ -1378,7 +1392,7 @@ function(add_lit_testsuite target comment)
|
||||
endfunction()
|
||||
|
||||
function(add_lit_testsuites project directory)
|
||||
if (NOT CMAKE_CONFIGURATION_TYPES)
|
||||
if (NOT LLVM_ENABLE_IDE)
|
||||
cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
|
||||
|
||||
# Search recursively for test directories by assuming anything not
|
||||
@ -1437,7 +1451,7 @@ function(llvm_install_library_symlink name dest type)
|
||||
CODE "install_symlink(${full_name} ${full_dest} ${output_dir})"
|
||||
COMPONENT ${component})
|
||||
|
||||
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE)
|
||||
if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE)
|
||||
add_llvm_install_targets(install-${name}
|
||||
DEPENDS ${name} ${dest} install-${dest}
|
||||
COMPONENT ${name})
|
||||
@ -1470,7 +1484,7 @@ function(llvm_install_symlink name dest)
|
||||
CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})"
|
||||
COMPONENT ${component})
|
||||
|
||||
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE)
|
||||
if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE)
|
||||
add_llvm_install_targets(install-${name}
|
||||
DEPENDS ${name} ${dest} install-${dest}
|
||||
COMPONENT ${name})
|
||||
@ -1566,7 +1580,14 @@ function(llvm_externalize_debuginfo name)
|
||||
endif()
|
||||
set(strip_command COMMAND ${CMAKE_STRIP} -Sxl $<TARGET_FILE:${name}>)
|
||||
else()
|
||||
set(strip_command COMMAND ${CMAKE_STRIP} -gx $<TARGET_FILE:${name}>)
|
||||
set(strip_command COMMAND ${CMAKE_STRIP} -g -x $<TARGET_FILE:${name}>)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
|
||||
if(APPLE)
|
||||
set(output_name "$<TARGET_FILE_NAME:${name}>.dSYM")
|
||||
set(output_path "-o=${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR}/${output_name}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -1582,7 +1603,7 @@ function(llvm_externalize_debuginfo name)
|
||||
set(CMAKE_DSYMUTIL xcrun dsymutil)
|
||||
endif()
|
||||
add_custom_command(TARGET ${name} POST_BUILD
|
||||
COMMAND ${CMAKE_DSYMUTIL} $<TARGET_FILE:${name}>
|
||||
COMMAND ${CMAKE_DSYMUTIL} ${output_path} $<TARGET_FILE:${name}>
|
||||
${strip_command}
|
||||
)
|
||||
else()
|
||||
@ -1594,12 +1615,24 @@ function(llvm_externalize_debuginfo name)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Usage: llvm_codesign(name [ENTITLEMENTS file])
|
||||
function(llvm_codesign name)
|
||||
cmake_parse_arguments(ARG "" "ENTITLEMENTS" "" ${ARGN})
|
||||
|
||||
if(NOT LLVM_CODESIGNING_IDENTITY)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
if(CMAKE_GENERATOR STREQUAL "Xcode")
|
||||
set_target_properties(${name} PROPERTIES
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${LLVM_CODESIGNING_IDENTITY}
|
||||
)
|
||||
if(DEFINED ARG_ENTITLEMENTS)
|
||||
set_target_properties(${name} PROPERTIES
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${ARG_ENTITLEMENTS}
|
||||
)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
if(NOT CMAKE_CODESIGN)
|
||||
set(CMAKE_CODESIGN xcrun codesign)
|
||||
endif()
|
||||
@ -1610,12 +1643,16 @@ function(llvm_codesign name)
|
||||
OUTPUT_VARIABLE CMAKE_CODESIGN_ALLOCATE
|
||||
)
|
||||
endif()
|
||||
if(DEFINED ARG_ENTITLEMENTS)
|
||||
set(pass_entitlements --entitlements ${ARG_ENTITLEMENTS})
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${name} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E
|
||||
env CODESIGN_ALLOCATE=${CMAKE_CODESIGN_ALLOCATE}
|
||||
${CMAKE_CODESIGN} -s ${LLVM_CODESIGNING_IDENTITY}
|
||||
$<TARGET_FILE:${name}>
|
||||
${pass_entitlements} $<TARGET_FILE:${name}>
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
@ -132,7 +132,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
||||
PATTERN LLVM-Config.cmake EXCLUDE
|
||||
PATTERN GetHostTriple.cmake EXCLUDE)
|
||||
|
||||
if (NOT CMAKE_CONFIGURATION_TYPES)
|
||||
if (NOT LLVM_ENABLE_IDE)
|
||||
# Add a dummy target so this can be used with LLVM_DISTRIBUTION_COMPONENTS
|
||||
add_custom_target(cmake-exports)
|
||||
add_llvm_install_targets(install-cmake-exports
|
||||
|
@ -4,15 +4,15 @@
|
||||
function( get_host_triple var )
|
||||
if( MSVC )
|
||||
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
||||
set( value "x86_64-pc-win32" )
|
||||
set( value "x86_64-pc-windows-msvc" )
|
||||
else()
|
||||
set( value "i686-pc-win32" )
|
||||
set( value "i686-pc-windows-msvc" )
|
||||
endif()
|
||||
elseif( MINGW AND NOT MSYS )
|
||||
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
||||
set( value "x86_64-w64-mingw32" )
|
||||
set( value "x86_64-w64-windows-gnu" )
|
||||
else()
|
||||
set( value "i686-pc-mingw32" )
|
||||
set( value "i686-pc-windows-gnu" )
|
||||
endif()
|
||||
else( MSVC )
|
||||
set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess)
|
||||
|
@ -11,7 +11,7 @@ include(HandleLLVMStdlib)
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
if(CMAKE_LINKER MATCHES "lld-link.exe" OR (WIN32 AND LLVM_USE_LINKER STREQUAL "lld"))
|
||||
if(CMAKE_LINKER MATCHES "lld-link\.exe" OR (WIN32 AND LLVM_USE_LINKER STREQUAL "lld") OR LLVM_ENABLE_LLD)
|
||||
set(LINKER_IS_LLD_LINK TRUE)
|
||||
else()
|
||||
set(LINKER_IS_LLD_LINK FALSE)
|
||||
@ -23,7 +23,7 @@ string(TOUPPER "${LLVM_ENABLE_LTO}" uppercase_LLVM_ENABLE_LTO)
|
||||
# Ninja Job Pool support
|
||||
# The following only works with the Ninja generator in CMake >= 3.0.
|
||||
set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING
|
||||
"Define the maximum number of concurrent compilation jobs.")
|
||||
"Define the maximum number of concurrent compilation jobs (Ninja only).")
|
||||
if(LLVM_PARALLEL_COMPILE_JOBS)
|
||||
if(NOT CMAKE_MAKE_PROGRAM MATCHES "ninja")
|
||||
message(WARNING "Job pooling is only available with Ninja generators.")
|
||||
@ -34,7 +34,7 @@ if(LLVM_PARALLEL_COMPILE_JOBS)
|
||||
endif()
|
||||
|
||||
set(LLVM_PARALLEL_LINK_JOBS "" CACHE STRING
|
||||
"Define the maximum number of concurrent link jobs.")
|
||||
"Define the maximum number of concurrent link jobs (Ninja only).")
|
||||
if(CMAKE_MAKE_PROGRAM MATCHES "ninja")
|
||||
if(NOT LLVM_PARALLEL_LINK_JOBS AND uppercase_LLVM_ENABLE_LTO STREQUAL "THIN")
|
||||
message(STATUS "ThinLTO provides its own parallel linking - limiting parallel link jobs to 2.")
|
||||
@ -138,7 +138,8 @@ endif()
|
||||
# build might work on ELF but fail on MachO/COFF.
|
||||
if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32 OR CYGWIN OR
|
||||
${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
|
||||
${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") AND
|
||||
${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD" OR
|
||||
${CMAKE_SYSTEM_NAME} MATCHES "DragonFly") AND
|
||||
NOT LLVM_USE_SANITIZER)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
|
||||
endif()
|
||||
@ -149,6 +150,7 @@ endif()
|
||||
# is unloaded.
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,nodelete")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,nodelete")
|
||||
endif()
|
||||
|
||||
|
||||
@ -223,6 +225,10 @@ if(NOT WIN32 AND NOT CYGWIN)
|
||||
append_if(SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG "-fvisibility-inlines-hidden" CMAKE_CXX_FLAGS)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND MINGW)
|
||||
add_definitions( -D_FILE_OFFSET_BITS=64 )
|
||||
endif()
|
||||
|
||||
if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
|
||||
# TODO: support other platforms and toolchains.
|
||||
if( LLVM_BUILD_32_BITS )
|
||||
@ -507,6 +513,10 @@ if (MSVC)
|
||||
# Update 1. Re-evaluate the usefulness of this diagnostic with Update 2.
|
||||
-wd4592 # Suppress ''var': symbol will be dynamically initialized (implementation limitation)
|
||||
-wd4319 # Suppress ''operator' : zero extending 'type' to 'type' of greater size'
|
||||
# C4709 is disabled because of a bug with Visual Studio 2017 as of
|
||||
# v15.8.8. Re-evaluate the usefulness of this diagnostic when the bug
|
||||
# is fixed.
|
||||
-wd4709 # Suppress comma operator within array index expression
|
||||
|
||||
# Ideally, we'd like this warning to be enabled, but MSVC 2013 doesn't
|
||||
# support the 'aligned' attribute in the way that clang sources requires (for
|
||||
@ -575,6 +585,7 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
|
||||
append("-Wno-long-long" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
endif()
|
||||
|
||||
add_flag_if_supported("-Wimplicit-fallthrough" IMPLICIT_FALLTHROUGH_FLAG)
|
||||
add_flag_if_supported("-Wcovered-switch-default" COVERED_SWITCH_DEFAULT_FLAG)
|
||||
append_if(USE_NO_UNINITIALIZED "-Wno-uninitialized" CMAKE_CXX_FLAGS)
|
||||
append_if(USE_NO_MAYBE_UNINITIALIZED "-Wno-maybe-uninitialized" CMAKE_CXX_FLAGS)
|
||||
@ -584,6 +595,10 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
|
||||
check_cxx_compiler_flag("-Wclass-memaccess" CXX_SUPPORTS_CLASS_MEMACCESS_FLAG)
|
||||
append_if(CXX_SUPPORTS_CLASS_MEMACCESS_FLAG "-Wno-class-memaccess" CMAKE_CXX_FLAGS)
|
||||
|
||||
# The LLVM libraries have no stable C++ API, so -Wnoexcept-type is not useful.
|
||||
check_cxx_compiler_flag("-Wnoexcept-type" CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG)
|
||||
append_if(CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG "-Wno-noexcept-type" CMAKE_CXX_FLAGS)
|
||||
|
||||
# Check if -Wnon-virtual-dtor warns even though the class is marked final.
|
||||
# If it does, don't add it. So it won't be added on clang 3.4 and older.
|
||||
# This also catches cases when -Wnon-virtual-dtor isn't supported by
|
||||
@ -863,12 +878,19 @@ else()
|
||||
set(LLVM_ENABLE_PLUGINS ON)
|
||||
endif()
|
||||
|
||||
# By default we should enable LLVM_ENABLE_IDE only for multi-configuration
|
||||
# generators. This option disables optional build system features that make IDEs
|
||||
# less usable.
|
||||
set(LLVM_ENABLE_IDE_default OFF)
|
||||
if (XCODE OR MSVC_IDE OR CMAKE_EXTRA_GENERATOR)
|
||||
if (CMAKE_CONFIGURATION_TYPES)
|
||||
set(LLVM_ENABLE_IDE_default ON)
|
||||
endif()
|
||||
option(LLVM_ENABLE_IDE "Generate targets and process sources for use with an IDE"
|
||||
${LLVM_ENABLE_IDE_default})
|
||||
option(LLVM_ENABLE_IDE
|
||||
"Disable optional build system features that cause problems for IDE generators"
|
||||
${LLVM_ENABLE_IDE_default})
|
||||
if (CMAKE_CONFIGURATION_TYPES AND NOT LLVM_ENABLE_IDE)
|
||||
message(WARNING "Disabling LLVM_ENABLE_IDE on multi-configuration generators is not recommended.")
|
||||
endif()
|
||||
|
||||
function(get_compile_definitions)
|
||||
get_directory_property(top_dir_definitions DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)
|
||||
|
@ -302,7 +302,9 @@ function(llvm_expand_dependencies out_libs)
|
||||
expand_topologically(${lib} "${required_libs}" "${visited_libs}")
|
||||
endforeach()
|
||||
|
||||
list(REVERSE required_libs)
|
||||
if(required_libs)
|
||||
list(REVERSE required_libs)
|
||||
endif()
|
||||
set(${out_libs} ${required_libs} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
set(LLVM_VERSION_MAJOR @LLVM_VERSION_MAJOR@)
|
||||
set(LLVM_VERSION_MINOR @LLVM_VERSION_MINOR@)
|
||||
set(LLVM_VERSION_PATCH @LLVM_VERSION_PATCH@)
|
||||
set(LLVM_VERSION_SUFFIX @LLVM_VERSION_SUFFIX@)
|
||||
set(LLVM_PACKAGE_VERSION @PACKAGE_VERSION@)
|
||||
|
||||
set(LLVM_BUILD_TYPE @CMAKE_BUILD_TYPE@)
|
||||
|
@ -162,8 +162,35 @@ function(llvm_ExternalProject_Add name source_dir)
|
||||
-DCMAKE_OBJDUMP=${CMAKE_OBJDUMP}
|
||||
-DCMAKE_STRIP=${CMAKE_STRIP})
|
||||
set(llvm_config_path ${LLVM_CONFIG_PATH})
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
|
||||
${PACKAGE_VERSION})
|
||||
set(resource_dir "${LLVM_LIBRARY_DIR}/clang/${CLANG_VERSION}")
|
||||
set(flag_types ASM C CXX MODULE_LINKER SHARED_LINKER EXE_LINKER)
|
||||
foreach(type ${flag_types})
|
||||
set(${type}_flag -DCMAKE_${type}_FLAGS=-resource-dir=${resource_dir})
|
||||
endforeach()
|
||||
string(REPLACE ";" "|" flag_string "${flag_types}")
|
||||
foreach(arg ${ARG_CMAKE_ARGS})
|
||||
if(arg MATCHES "^-DCMAKE_(${flag_string})_FLAGS")
|
||||
foreach(type ${flag_types})
|
||||
if(arg MATCHES "^-DCMAKE_${type}_FLAGS")
|
||||
string(REGEX REPLACE "^-DCMAKE_${type}_FLAGS=(.*)$" "\\1" flag_value "${arg}")
|
||||
set(${type}_flag "${${type}_flag} ${flag_value}")
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
list(APPEND cmake_args ${arg})
|
||||
endif()
|
||||
endforeach()
|
||||
foreach(type ${flag_types})
|
||||
list(APPEND cmake_args ${${type}_flag})
|
||||
endforeach()
|
||||
endif()
|
||||
else()
|
||||
set(llvm_config_path "$<TARGET_FILE:llvm-config>")
|
||||
set(cmake_args ${ARG_CMAKE_ARGS})
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(${name}
|
||||
@ -187,7 +214,7 @@ function(llvm_ExternalProject_Add name source_dir)
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=1
|
||||
${ARG_CMAKE_ARGS}
|
||||
${cmake_args}
|
||||
${PASSTHROUGH_VARIABLES}
|
||||
INSTALL_COMMAND ""
|
||||
STEP_TARGETS configure build
|
||||
|
@ -52,16 +52,15 @@ function(llvm_process_sources OUT_VAR)
|
||||
cmake_parse_arguments(ARG "" "" "ADDITIONAL_HEADERS;ADDITIONAL_HEADER_DIRS" ${ARGN})
|
||||
set(sources ${ARG_UNPARSED_ARGUMENTS})
|
||||
llvm_check_source_file_list( ${sources} )
|
||||
if( LLVM_ENABLE_IDE )
|
||||
# This adds .td and .h files to the Visual Studio solution:
|
||||
add_td_sources(sources)
|
||||
find_all_header_files(hdrs "${ARG_ADDITIONAL_HEADER_DIRS}")
|
||||
if (hdrs)
|
||||
set_source_files_properties(${hdrs} PROPERTIES HEADER_FILE_ONLY ON)
|
||||
endif()
|
||||
set_source_files_properties(${ARG_ADDITIONAL_HEADERS} PROPERTIES HEADER_FILE_ONLY ON)
|
||||
list(APPEND sources ${ARG_ADDITIONAL_HEADERS} ${hdrs})
|
||||
|
||||
# This adds .td and .h files to the Visual Studio solution:
|
||||
add_td_sources(sources)
|
||||
find_all_header_files(hdrs "${ARG_ADDITIONAL_HEADER_DIRS}")
|
||||
if (hdrs)
|
||||
set_source_files_properties(${hdrs} PROPERTIES HEADER_FILE_ONLY ON)
|
||||
endif()
|
||||
set_source_files_properties(${ARG_ADDITIONAL_HEADERS} PROPERTIES HEADER_FILE_ONLY ON)
|
||||
list(APPEND sources ${ARG_ADDITIONAL_HEADERS} ${hdrs})
|
||||
|
||||
set( ${OUT_VAR} ${sources} PARENT_SCOPE )
|
||||
endfunction(llvm_process_sources)
|
||||
|
@ -25,7 +25,7 @@ function(tablegen project ofn)
|
||||
file(RELATIVE_PATH ofn_rel
|
||||
${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/${ofn})
|
||||
set(additional_cmdline
|
||||
-o ${ofn_rel}.tmp
|
||||
-o ${ofn_rel}
|
||||
-d ${ofn_rel}.d
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
DEPFILE ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.d
|
||||
@ -36,7 +36,7 @@ function(tablegen project ofn)
|
||||
file(GLOB local_tds "*.td")
|
||||
file(GLOB_RECURSE global_tds "${LLVM_MAIN_INCLUDE_DIR}/llvm/*.td")
|
||||
set(additional_cmdline
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -69,8 +69,7 @@ function(tablegen project ofn)
|
||||
# dependency twice in the result file when
|
||||
# ("${${project}_TABLEGEN_TARGET}" STREQUAL "${${project}_TABLEGEN_EXE}")
|
||||
# but lets us having smaller and cleaner code here.
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
|
||||
# Generate tablegen output in a temporary file.
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
|
||||
COMMAND ${${project}_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${LLVM_TABLEGEN_FLAGS}
|
||||
${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
|
||||
@ -83,20 +82,9 @@ function(tablegen project ofn)
|
||||
${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
|
||||
COMMENT "Building ${ofn}..."
|
||||
)
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
|
||||
# Only update the real output file if there are any differences.
|
||||
# This prevents recompilation of all the files depending on it if there
|
||||
# aren't any.
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${ofn}
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
|
||||
COMMENT "Updating ${ofn}..."
|
||||
)
|
||||
|
||||
# `make clean' must remove all those generated files:
|
||||
set_property(DIRECTORY APPEND
|
||||
PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${ofn}.tmp ${ofn})
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${ofn})
|
||||
|
||||
set(TABLEGEN_OUTPUT ${TABLEGEN_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR}/${ofn} PARENT_SCOPE)
|
||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${ofn} PROPERTIES
|
||||
@ -158,6 +146,12 @@ macro(add_tablegen target project)
|
||||
llvm_ExternalProject_BuildCmd(tblgen_build_cmd ${target}
|
||||
${LLVM_NATIVE_BUILD}
|
||||
CONFIGURATION Release)
|
||||
# Create an artificial dependency between tablegen projects, because they
|
||||
# compile the same dependencies, thus using the same build folders.
|
||||
# FIXME: A proper fix requires sequentially chaining tablegens.
|
||||
if (NOT ${project} STREQUAL LLVM AND TARGET ${project}-tablegen-host)
|
||||
add_dependencies(${project}-tablegen-host LLVM-tablegen-host)
|
||||
endif()
|
||||
add_custom_command(OUTPUT ${${project}_TABLEGEN_EXE}
|
||||
COMMAND ${tblgen_build_cmd}
|
||||
DEPENDS CONFIGURE_LLVM_NATIVE ${target}
|
||||
|
@ -136,11 +136,25 @@ function(generate_winsdk_lib_symlinks winsdk_um_lib_dir output_dir)
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${output_dir}")
|
||||
file(GLOB libraries RELATIVE "${winsdk_um_lib_dir}" "${winsdk_um_lib_dir}/*")
|
||||
foreach(library ${libraries})
|
||||
string(TOLOWER "${library}" symlink_name)
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}"
|
||||
-E create_symlink
|
||||
"${winsdk_um_lib_dir}/${library}"
|
||||
"${output_dir}/${symlink_name}")
|
||||
string(TOLOWER "${library}" all_lowercase_symlink_name)
|
||||
if(NOT library STREQUAL all_lowercase_symlink_name)
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}"
|
||||
-E create_symlink
|
||||
"${winsdk_um_lib_dir}/${library}"
|
||||
"${output_dir}/${all_lowercase_symlink_name}")
|
||||
endif()
|
||||
|
||||
get_filename_component(name_we "${library}" NAME_WE)
|
||||
get_filename_component(ext "${library}" EXT)
|
||||
string(TOLOWER "${ext}" lowercase_ext)
|
||||
set(lowercase_ext_symlink_name "${name_we}${lowercase_ext}")
|
||||
if(NOT library STREQUAL lowercase_ext_symlink_name AND
|
||||
NOT all_lowercase_symlink_name STREQUAL lowercase_ext_symlink_name)
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}"
|
||||
-E create_symlink
|
||||
"${winsdk_um_lib_dir}/${library}"
|
||||
"${output_dir}/${lowercase_ext_symlink_name}")
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
|
1411
docs/AMDGPU/AMDGPUAsmGFX7.rst
Normal file
1411
docs/AMDGPU/AMDGPUAsmGFX7.rst
Normal file
File diff suppressed because it is too large
Load Diff
1846
docs/AMDGPU/AMDGPUAsmGFX8.rst
Normal file
1846
docs/AMDGPU/AMDGPUAsmGFX8.rst
Normal file
File diff suppressed because it is too large
Load Diff
2102
docs/AMDGPU/AMDGPUAsmGFX9.rst
Normal file
2102
docs/AMDGPU/AMDGPUAsmGFX9.rst
Normal file
File diff suppressed because it is too large
Load Diff
24
docs/AMDGPU/gfx7_addr_buf.rst
Normal file
24
docs/AMDGPU/gfx7_addr_buf.rst
Normal file
@ -0,0 +1,24 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_addr_buf:
|
||||
|
||||
vaddr
|
||||
===========================
|
||||
|
||||
This is an optional operand which may specify a 64-bit address, offset and/or index.
|
||||
|
||||
*Size:* 0, 1 or 2 dwords. Size is controlled by modifiers :ref:`addr64<amdgpu_synid_addr64>`, :ref:`offen<amdgpu_synid_offen>` and :ref:`idxen<amdgpu_synid_idxen>`:
|
||||
|
||||
* If only :ref:`addr64<amdgpu_synid_addr64>` is specified, this operand supplies a 64-bit address. Size is 2 dwords.
|
||||
* If only :ref:`idxen<amdgpu_synid_idxen>` is specified, this operand supplies an index. Size is 1 dword.
|
||||
* If only :ref:`offen<amdgpu_synid_offen>` is specified, this operand supplies an offset. Size is 1 dword.
|
||||
* If both :ref:`idxen<amdgpu_synid_idxen>` and :ref:`offen<amdgpu_synid_offen>` are specified, index is in the first register and offset is in the second. Size is 2 dwords.
|
||||
* If none of these modifiers are specified, this operand must be set to :ref:`off<amdgpu_synid_off>`.
|
||||
* All other combinations of these modifiers are illegal.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`, :ref:`off<amdgpu_synid_off>`
|
17
docs/AMDGPU/gfx7_addr_ds.rst
Normal file
17
docs/AMDGPU/gfx7_addr_ds.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_addr_ds:
|
||||
|
||||
vaddr
|
||||
===========================
|
||||
|
||||
An offset from the start of GDS/LDS memory.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
17
docs/AMDGPU/gfx7_addr_flat.rst
Normal file
17
docs/AMDGPU/gfx7_addr_flat.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_addr_flat:
|
||||
|
||||
vaddr
|
||||
===========================
|
||||
|
||||
A 64-bit flat address.
|
||||
|
||||
*Size:* 2 dwords.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
21
docs/AMDGPU/gfx7_addr_mimg.rst
Normal file
21
docs/AMDGPU/gfx7_addr_mimg.rst
Normal file
@ -0,0 +1,21 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_addr_mimg:
|
||||
|
||||
vaddr
|
||||
===========================
|
||||
|
||||
Image address which includes from one to four dimensional coordinates and other data used to locate a position in the image.
|
||||
|
||||
*Size:* 1, 2, 3, 4, 8 or 16 dwords. Actual size depends on opcode and specific image being handled.
|
||||
|
||||
Note 1. Image format and dimensions are encoded in the image resource constant but not in the instruction.
|
||||
|
||||
Note 2. Actually image address size may vary from 1 to 13 dwords, but assembler currently supports a limited range of register sequences.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
30
docs/AMDGPU/gfx7_attr.rst
Normal file
30
docs/AMDGPU/gfx7_attr.rst
Normal file
@ -0,0 +1,30 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_attr:
|
||||
|
||||
attr
|
||||
===========================
|
||||
|
||||
Interpolation attribute and channel:
|
||||
|
||||
============== ===================================
|
||||
Syntax Description
|
||||
============== ===================================
|
||||
attr{0..32}.x Attribute 0..32 with *x* channel.
|
||||
attr{0..32}.y Attribute 0..32 with *y* channel.
|
||||
attr{0..32}.z Attribute 0..32 with *z* channel.
|
||||
attr{0..32}.w Attribute 0..32 with *w* channel.
|
||||
============== ===================================
|
||||
|
||||
Examples:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
v_interp_p1_f32 v1, v0, attr0.x
|
||||
v_interp_p1_f32 v1, v0, attr32.w
|
||||
|
17
docs/AMDGPU/gfx7_base_smem_addr.rst
Normal file
17
docs/AMDGPU/gfx7_base_smem_addr.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_base_smem_addr:
|
||||
|
||||
sbase
|
||||
===========================
|
||||
|
||||
A 64-bit base address for scalar memory operations.
|
||||
|
||||
*Size:* 2 dwords.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`
|
17
docs/AMDGPU/gfx7_base_smem_buf.rst
Normal file
17
docs/AMDGPU/gfx7_base_smem_buf.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_base_smem_buf:
|
||||
|
||||
sbase
|
||||
===========================
|
||||
|
||||
A 128-bit buffer resource constant for scalar memory operations which provides a base address, a size and a stride.
|
||||
|
||||
*Size:* 4 dwords.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`ttmp<amdgpu_synid_ttmp>`
|
14
docs/AMDGPU/gfx7_bimm16.rst
Normal file
14
docs/AMDGPU/gfx7_bimm16.rst
Normal file
@ -0,0 +1,14 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_bimm16:
|
||||
|
||||
imm16
|
||||
===========================
|
||||
|
||||
An :ref:`integer_number<amdgpu_synid_integer_number>`. The value is truncated to 16 bits.
|
||||
|
14
docs/AMDGPU/gfx7_bimm32.rst
Normal file
14
docs/AMDGPU/gfx7_bimm32.rst
Normal file
@ -0,0 +1,14 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_bimm32:
|
||||
|
||||
imm32
|
||||
===========================
|
||||
|
||||
An :ref:`integer_number<amdgpu_synid_integer_number>`. The value is truncated to 32 bits.
|
||||
|
21
docs/AMDGPU/gfx7_data_buf_atomic128.rst
Normal file
21
docs/AMDGPU/gfx7_data_buf_atomic128.rst
Normal file
@ -0,0 +1,21 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_data_buf_atomic128:
|
||||
|
||||
vdata
|
||||
===========================
|
||||
|
||||
Input data for an atomic instruction.
|
||||
|
||||
Optionally may serve as an output data:
|
||||
|
||||
* If :ref:`glc<amdgpu_synid_glc>` is specified, gets the memory value before the operation.
|
||||
|
||||
*Size:* 4 dwords by default. :ref:`tfe<amdgpu_synid_tfe>` adds 1 dword if specified.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
21
docs/AMDGPU/gfx7_data_buf_atomic32.rst
Normal file
21
docs/AMDGPU/gfx7_data_buf_atomic32.rst
Normal file
@ -0,0 +1,21 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_data_buf_atomic32:
|
||||
|
||||
vdata
|
||||
===========================
|
||||
|
||||
Input data for an atomic instruction.
|
||||
|
||||
Optionally may serve as an output data:
|
||||
|
||||
* If :ref:`glc<amdgpu_synid_glc>` is specified, gets the memory value before the operation.
|
||||
|
||||
*Size:* 1 dword by default. :ref:`tfe<amdgpu_synid_tfe>` adds 1 dword if specified.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
21
docs/AMDGPU/gfx7_data_buf_atomic64.rst
Normal file
21
docs/AMDGPU/gfx7_data_buf_atomic64.rst
Normal file
@ -0,0 +1,21 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_data_buf_atomic64:
|
||||
|
||||
vdata
|
||||
===========================
|
||||
|
||||
Input data for an atomic instruction.
|
||||
|
||||
Optionally may serve as an output data:
|
||||
|
||||
* If :ref:`glc<amdgpu_synid_glc>` is specified, gets the memory value before the operation.
|
||||
|
||||
*Size:* 2 dwords by default. :ref:`tfe<amdgpu_synid_tfe>` adds 1 dword if specified.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
27
docs/AMDGPU/gfx7_data_mimg_atomic_cmp.rst
Normal file
27
docs/AMDGPU/gfx7_data_mimg_atomic_cmp.rst
Normal file
@ -0,0 +1,27 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_data_mimg_atomic_cmp:
|
||||
|
||||
vdata
|
||||
===========================
|
||||
|
||||
Input data for an atomic instruction.
|
||||
|
||||
Optionally may serve as an output data:
|
||||
|
||||
* If :ref:`glc<amdgpu_synid_glc>` is specified, gets the memory value before the operation.
|
||||
|
||||
*Size:* depends on :ref:`dmask<amdgpu_synid_dmask>` and :ref:`tfe<amdgpu_synid_tfe>`:
|
||||
|
||||
* :ref:`dmask<amdgpu_synid_dmask>` may specify 2 data elements for 32-bit-per-pixel surfaces or 4 data elements for 64-bit-per-pixel surfaces. Each data element occupies 1 dword.
|
||||
* :ref:`tfe<amdgpu_synid_tfe>` adds 1 dword if specified.
|
||||
|
||||
Note. The surface data format is indicated in the image resource constant but not in the instruction.
|
||||
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
26
docs/AMDGPU/gfx7_data_mimg_atomic_reg.rst
Normal file
26
docs/AMDGPU/gfx7_data_mimg_atomic_reg.rst
Normal file
@ -0,0 +1,26 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_data_mimg_atomic_reg:
|
||||
|
||||
vdata
|
||||
===========================
|
||||
|
||||
Input data for an atomic instruction.
|
||||
|
||||
Optionally may serve as an output data:
|
||||
|
||||
* If :ref:`glc<amdgpu_synid_glc>` is specified, gets the memory value before the operation.
|
||||
|
||||
*Size:* depends on :ref:`dmask<amdgpu_synid_dmask>` and :ref:`tfe<amdgpu_synid_tfe>`:
|
||||
|
||||
* :ref:`dmask<amdgpu_synid_dmask>` may specify 1 data element for 32-bit-per-pixel surfaces or 2 data elements for 64-bit-per-pixel surfaces. Each data element occupies 1 dword.
|
||||
* :ref:`tfe<amdgpu_synid_tfe>` adds 1 dword if specified.
|
||||
|
||||
Note. The surface data format is indicated in the image resource constant but not in the instruction.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
18
docs/AMDGPU/gfx7_data_mimg_store.rst
Normal file
18
docs/AMDGPU/gfx7_data_mimg_store.rst
Normal file
@ -0,0 +1,18 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_data_mimg_store:
|
||||
|
||||
vdata
|
||||
===========================
|
||||
|
||||
Image data to store by an *image_store* instruction.
|
||||
|
||||
*Size:* depends on :ref:`dmask<amdgpu_synid_dmask>` which may specify from 1 to 4 data elements. Each data element occupies 1 dword.
|
||||
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
17
docs/AMDGPU/gfx7_dst_buf_128.rst
Normal file
17
docs/AMDGPU/gfx7_dst_buf_128.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_dst_buf_128:
|
||||
|
||||
vdst
|
||||
===========================
|
||||
|
||||
Instruction output: data read from a memory buffer.
|
||||
|
||||
*Size:* 4 dwords by default. :ref:`tfe<amdgpu_synid_tfe>` adds 1 dword if specified.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
17
docs/AMDGPU/gfx7_dst_buf_64.rst
Normal file
17
docs/AMDGPU/gfx7_dst_buf_64.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_dst_buf_64:
|
||||
|
||||
vdst
|
||||
===========================
|
||||
|
||||
Instruction output: data read from a memory buffer.
|
||||
|
||||
*Size:* 2 dwords by default. :ref:`tfe<amdgpu_synid_tfe>` adds 1 dword if specified.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
17
docs/AMDGPU/gfx7_dst_buf_96.rst
Normal file
17
docs/AMDGPU/gfx7_dst_buf_96.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_dst_buf_96:
|
||||
|
||||
vdst
|
||||
===========================
|
||||
|
||||
Instruction output: data read from a memory buffer.
|
||||
|
||||
*Size:* 3 dwords by default. :ref:`tfe<amdgpu_synid_tfe>` adds 1 dword if specified.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
21
docs/AMDGPU/gfx7_dst_buf_lds.rst
Normal file
21
docs/AMDGPU/gfx7_dst_buf_lds.rst
Normal file
@ -0,0 +1,21 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_dst_buf_lds:
|
||||
|
||||
vdst
|
||||
===========================
|
||||
|
||||
Instruction output: data read from a memory buffer.
|
||||
|
||||
If :ref:`lds<amdgpu_synid_lds>` is specified, this operand is ignored by H/W and data are stored directly into LDS.
|
||||
|
||||
*Size:* 1 dword by default. :ref:`tfe<amdgpu_synid_tfe>` adds 1 dword if specified.
|
||||
|
||||
Note that :ref:`tfe<amdgpu_synid_tfe>` and :ref:`lds<amdgpu_synid_lds>` cannot be used together.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
19
docs/AMDGPU/gfx7_dst_flat_atomic32.rst
Normal file
19
docs/AMDGPU/gfx7_dst_flat_atomic32.rst
Normal file
@ -0,0 +1,19 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_dst_flat_atomic32:
|
||||
|
||||
vdst
|
||||
===========================
|
||||
|
||||
Data returned by a 32-bit atomic flat instruction.
|
||||
|
||||
This is an optional operand. It must be used if and only if :ref:`glc<amdgpu_synid_glc>` is specified.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
19
docs/AMDGPU/gfx7_dst_flat_atomic64.rst
Normal file
19
docs/AMDGPU/gfx7_dst_flat_atomic64.rst
Normal file
@ -0,0 +1,19 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_dst_flat_atomic64:
|
||||
|
||||
vdst
|
||||
===========================
|
||||
|
||||
Data returned by a 64-bit atomic flat instruction.
|
||||
|
||||
This is an optional operand. It must be used if and only if :ref:`glc<amdgpu_synid_glc>` is specified.
|
||||
|
||||
*Size:* 2 dwords.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
17
docs/AMDGPU/gfx7_dst_mimg_gather4.rst
Normal file
17
docs/AMDGPU/gfx7_dst_mimg_gather4.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_dst_mimg_gather4:
|
||||
|
||||
vdst
|
||||
===========================
|
||||
|
||||
Image data to load by an *image_gather4* instruction.
|
||||
|
||||
*Size:* 4 data elements by default. Each data element occupies 1 dword. :ref:`tfe<amdgpu_synid_tfe>` adds one more dword if specified.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
20
docs/AMDGPU/gfx7_dst_mimg_regular.rst
Normal file
20
docs/AMDGPU/gfx7_dst_mimg_regular.rst
Normal file
@ -0,0 +1,20 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_dst_mimg_regular:
|
||||
|
||||
vdst
|
||||
===========================
|
||||
|
||||
Image data to load by an image instruction.
|
||||
|
||||
*Size:* depends on :ref:`dmask<amdgpu_synid_dmask>` and :ref:`tfe<amdgpu_synid_tfe>`:
|
||||
|
||||
* :ref:`dmask<amdgpu_synid_dmask>` may specify from 1 to 4 data elements. Each data element occupies 1 dword.
|
||||
* :ref:`tfe<amdgpu_synid_tfe>` adds 1 dword if specified.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`
|
14
docs/AMDGPU/gfx7_fimm32.rst
Normal file
14
docs/AMDGPU/gfx7_fimm32.rst
Normal file
@ -0,0 +1,14 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_fimm32:
|
||||
|
||||
imm32
|
||||
===========================
|
||||
|
||||
An :ref:`integer_number<amdgpu_synid_integer_number>` or a :ref:`floating-point_number<amdgpu_synid_floating-point_number>`. The value is converted to *f32* as described :ref:`here<amdgpu_synid_lit_conv>`.
|
||||
|
60
docs/AMDGPU/gfx7_hwreg.rst
Normal file
60
docs/AMDGPU/gfx7_hwreg.rst
Normal file
@ -0,0 +1,60 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_hwreg:
|
||||
|
||||
hwreg
|
||||
===========================
|
||||
|
||||
Bits of a hardware register being accessed.
|
||||
|
||||
The bits of this operand have the following meaning:
|
||||
|
||||
============ ===================================
|
||||
Bits Description
|
||||
============ ===================================
|
||||
5:0 Register *id*.
|
||||
10:6 First bit *offset* (0..31).
|
||||
15:11 *Size* in bits (1..32).
|
||||
============ ===================================
|
||||
|
||||
This operand may be specified as a positive 16-bit :ref:`integer_number<amdgpu_synid_integer_number>` or using the syntax described below.
|
||||
|
||||
==================================== ============================================================================
|
||||
Syntax Description
|
||||
==================================== ============================================================================
|
||||
hwreg({0..63}) All bits of a register indicated by its *id*.
|
||||
hwreg(<*name*>) All bits of a register indicated by its *name*.
|
||||
hwreg({0..63}, {0..31}, {1..32}) Register bits indicated by register *id*, first bit *offset* and *size*.
|
||||
hwreg(<*name*>, {0..31}, {1..32}) Register bits indicated by register *name*, first bit *offset* and *size*.
|
||||
==================================== ============================================================================
|
||||
|
||||
Register *id*, *offset* and *size* must be specified as positive :ref:`integer numbers<amdgpu_synid_integer_number>`.
|
||||
|
||||
Defined register *names* include:
|
||||
|
||||
=================== ==========================================
|
||||
Name Description
|
||||
=================== ==========================================
|
||||
HW_REG_MODE Shader writeable mode bits.
|
||||
HW_REG_STATUS Shader read-only status.
|
||||
HW_REG_TRAPSTS Trap status.
|
||||
HW_REG_HW_ID Id of wave, simd, compute unit, etc.
|
||||
HW_REG_GPR_ALLOC Per-wave SGPR and VGPR allocation.
|
||||
HW_REG_LDS_ALLOC Per-wave LDS allocation.
|
||||
HW_REG_IB_STS Counters of outstanding instructions.
|
||||
=================== ==========================================
|
||||
|
||||
Examples:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
s_getreg_b32 s2, 0x6
|
||||
s_getreg_b32 s2, hwreg(15)
|
||||
s_getreg_b32 s2, hwreg(51, 1, 31)
|
||||
s_getreg_b32 s2, hwreg(HW_REG_LDS_ALLOC, 0, 1)
|
||||
|
30
docs/AMDGPU/gfx7_label.rst
Normal file
30
docs/AMDGPU/gfx7_label.rst
Normal file
@ -0,0 +1,30 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_label:
|
||||
|
||||
label
|
||||
===========================
|
||||
|
||||
A branch target which is a 16-bit signed integer treated as a PC-relative dword offset.
|
||||
|
||||
This operand may be specified as:
|
||||
|
||||
* An :ref:`integer_number<amdgpu_synid_integer_number>`. The number is truncated to 16 bits.
|
||||
* An :ref:`absolute_expression<amdgpu_synid_absolute_expression>` which must start with an :ref:`integer_number<amdgpu_synid_integer_number>`. The value of the expression is truncated to 16 bits.
|
||||
* A :ref:`symbol<amdgpu_synid_symbol>` (for example, a label). The value is handled as a 16-bit PC-relative dword offset to be resolved by a linker.
|
||||
|
||||
Examples:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
offset = 30
|
||||
s_branch loop_end
|
||||
s_branch 2 + offset
|
||||
s_branch 32
|
||||
loop_end:
|
||||
|
14
docs/AMDGPU/gfx7_mod.rst
Normal file
14
docs/AMDGPU/gfx7_mod.rst
Normal file
@ -0,0 +1,14 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_mod:
|
||||
|
||||
m
|
||||
===========================
|
||||
|
||||
This operand may be used with floating point operand modifiers :ref:`abs<amdgpu_synid_abs>` and :ref:`neg<amdgpu_synid_neg>`.
|
||||
|
72
docs/AMDGPU/gfx7_msg.rst
Normal file
72
docs/AMDGPU/gfx7_msg.rst
Normal file
@ -0,0 +1,72 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_msg:
|
||||
|
||||
msg
|
||||
===========================
|
||||
|
||||
A 16-bit message code. The bits of this operand have the following meaning:
|
||||
|
||||
============ ======================================================
|
||||
Bits Description
|
||||
============ ======================================================
|
||||
3:0 Message *type*.
|
||||
6:4 Optional *operation*.
|
||||
9:7 Optional *parameters*.
|
||||
15:10 Unused.
|
||||
============ ======================================================
|
||||
|
||||
This operand may be specified as a positive 16-bit :ref:`integer_number<amdgpu_synid_integer_number>` or using the syntax described below:
|
||||
|
||||
======================================== ========================================================================
|
||||
Syntax Description
|
||||
======================================== ========================================================================
|
||||
sendmsg(<*type*>) A message identified by its *type*.
|
||||
sendmsg(<*type*>, <*op*>) A message identified by its *type* and *operation*.
|
||||
sendmsg(<*type*>, <*op*>, <*stream*>) A message identified by its *type* and *operation* with a stream *id*.
|
||||
======================================== ========================================================================
|
||||
|
||||
*Type* may be specified using message *name* or message *id*.
|
||||
|
||||
*Op* may be specified using operation *name* or operation *id*.
|
||||
|
||||
Stream *id* is an integer in the range 0..3.
|
||||
|
||||
Message *id*, operation *id* and stream *id* must be specified as positive :ref:`integer numbers<amdgpu_synid_integer_number>`.
|
||||
|
||||
Each message type supports specific operations:
|
||||
|
||||
================= ========== ============================== ============ ==========
|
||||
Message name Message Id Supported Operations Operation Id Stream Id
|
||||
================= ========== ============================== ============ ==========
|
||||
MSG_INTERRUPT 1 \- \- \-
|
||||
MSG_GS 2 GS_OP_CUT 1 Optional
|
||||
\ GS_OP_EMIT 2 Optional
|
||||
\ GS_OP_EMIT_CUT 3 Optional
|
||||
MSG_GS_DONE 3 GS_OP_NOP 0 \-
|
||||
\ GS_OP_CUT 1 Optional
|
||||
\ GS_OP_EMIT 2 Optional
|
||||
\ GS_OP_EMIT_CUT 3 Optional
|
||||
MSG_SYSMSG 15 SYSMSG_OP_ECC_ERR_INTERRUPT 1 \-
|
||||
\ SYSMSG_OP_REG_RD 2 \-
|
||||
\ SYSMSG_OP_HOST_TRAP_ACK 3 \-
|
||||
\ SYSMSG_OP_TTRACE_PC 4 \-
|
||||
================= ========== ============================== ============ ==========
|
||||
|
||||
Examples:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
s_sendmsg 0x12
|
||||
s_sendmsg sendmsg(MSG_INTERRUPT)
|
||||
s_sendmsg sendmsg(2, GS_OP_CUT)
|
||||
s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT)
|
||||
s_sendmsg sendmsg(MSG_GS, 2)
|
||||
s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_EMIT_CUT, 1)
|
||||
s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_TTRACE_PC)
|
||||
|
17
docs/AMDGPU/gfx7_offset_buf.rst
Normal file
17
docs/AMDGPU/gfx7_offset_buf.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_offset_buf:
|
||||
|
||||
soffset
|
||||
===========================
|
||||
|
||||
An unsigned byte offset.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`m0<amdgpu_synid_m0>`, :ref:`exec<amdgpu_synid_exec>`, :ref:`constant<amdgpu_synid_constant>`
|
21
docs/AMDGPU/gfx7_offset_smem.rst
Normal file
21
docs/AMDGPU/gfx7_offset_smem.rst
Normal file
@ -0,0 +1,21 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_offset_smem:
|
||||
|
||||
soffset
|
||||
===========================
|
||||
|
||||
An unsigned offset added to the base address to get memory address.
|
||||
|
||||
* If offset is specified as a register, it supplies an unsigned byte offset but 2 lsb's are ignored.
|
||||
* If offset is specified as an :ref:`uimm32<amdgpu_synid_uimm32>`, it supplies a 32-bit unsigned byte offset but 2 lsb's are ignored.
|
||||
* If offset is specified as an :ref:`uimm8<amdgpu_synid_uimm8>`, it supplies an 8-bit unsigned dword offset.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`uimm8<amdgpu_synid_uimm8>`, :ref:`uimm32<amdgpu_synid_uimm32>`
|
14
docs/AMDGPU/gfx7_opt.rst
Normal file
14
docs/AMDGPU/gfx7_opt.rst
Normal file
@ -0,0 +1,14 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_opt:
|
||||
|
||||
opt
|
||||
===========================
|
||||
|
||||
This is an optional operand. It must be used if and only if :ref:`glc<amdgpu_synid_glc>` is specified.
|
||||
|
22
docs/AMDGPU/gfx7_param.rst
Normal file
22
docs/AMDGPU/gfx7_param.rst
Normal file
@ -0,0 +1,22 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_param:
|
||||
|
||||
param
|
||||
===========================
|
||||
|
||||
Interpolation parameter to read:
|
||||
|
||||
============ ===================================
|
||||
Syntax Description
|
||||
============ ===================================
|
||||
p0 Parameter *P0*.
|
||||
p10 Parameter *P10*.
|
||||
p20 Parameter *P20*.
|
||||
============ ===================================
|
||||
|
14
docs/AMDGPU/gfx7_ret.rst
Normal file
14
docs/AMDGPU/gfx7_ret.rst
Normal file
@ -0,0 +1,14 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_ret:
|
||||
|
||||
dst
|
||||
===========================
|
||||
|
||||
This is an input operand. It may optionally serve as a destination if :ref:`glc<amdgpu_synid_glc>` is specified.
|
||||
|
17
docs/AMDGPU/gfx7_rsrc_buf.rst
Normal file
17
docs/AMDGPU/gfx7_rsrc_buf.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_rsrc_buf:
|
||||
|
||||
srsrc
|
||||
===========================
|
||||
|
||||
Buffer resource constant which defines the address and characteristics of the buffer in memory.
|
||||
|
||||
*Size:* 4 dwords.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`ttmp<amdgpu_synid_ttmp>`
|
17
docs/AMDGPU/gfx7_rsrc_mimg.rst
Normal file
17
docs/AMDGPU/gfx7_rsrc_mimg.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_rsrc_mimg:
|
||||
|
||||
srsrc
|
||||
===========================
|
||||
|
||||
Image resource constant which defines the location of the image buffer in memory, its dimensions, tiling, and data format.
|
||||
|
||||
*Size:* 8 dwords by default, 4 dwords if :ref:`r128<amdgpu_synid_r128>` is specified.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`ttmp<amdgpu_synid_ttmp>`
|
17
docs/AMDGPU/gfx7_samp_mimg.rst
Normal file
17
docs/AMDGPU/gfx7_samp_mimg.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_samp_mimg:
|
||||
|
||||
ssamp
|
||||
===========================
|
||||
|
||||
Sampler constant used to specify filtering options applied to the image data after it is read.
|
||||
|
||||
*Size:* 4 dwords.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`ttmp<amdgpu_synid_ttmp>`
|
17
docs/AMDGPU/gfx7_sdst128_0.rst
Normal file
17
docs/AMDGPU/gfx7_sdst128_0.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_sdst128_0:
|
||||
|
||||
sdst
|
||||
===========================
|
||||
|
||||
Instruction output.
|
||||
|
||||
*Size:* 4 dwords.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`ttmp<amdgpu_synid_ttmp>`
|
17
docs/AMDGPU/gfx7_sdst256_0.rst
Normal file
17
docs/AMDGPU/gfx7_sdst256_0.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_sdst256_0:
|
||||
|
||||
sdst
|
||||
===========================
|
||||
|
||||
Instruction output.
|
||||
|
||||
*Size:* 8 dwords.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`ttmp<amdgpu_synid_ttmp>`
|
17
docs/AMDGPU/gfx7_sdst32_0.rst
Normal file
17
docs/AMDGPU/gfx7_sdst32_0.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_sdst32_0:
|
||||
|
||||
sdst
|
||||
===========================
|
||||
|
||||
Instruction output.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`
|
17
docs/AMDGPU/gfx7_sdst32_1.rst
Normal file
17
docs/AMDGPU/gfx7_sdst32_1.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_sdst32_1:
|
||||
|
||||
sdst
|
||||
===========================
|
||||
|
||||
Instruction output.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`m0<amdgpu_synid_m0>`, :ref:`exec<amdgpu_synid_exec>`
|
17
docs/AMDGPU/gfx7_sdst32_2.rst
Normal file
17
docs/AMDGPU/gfx7_sdst32_2.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_sdst32_2:
|
||||
|
||||
sdst
|
||||
===========================
|
||||
|
||||
Instruction output.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`trap<amdgpu_synid_trap>`
|
17
docs/AMDGPU/gfx7_sdst512_0.rst
Normal file
17
docs/AMDGPU/gfx7_sdst512_0.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_sdst512_0:
|
||||
|
||||
sdst
|
||||
===========================
|
||||
|
||||
Instruction output.
|
||||
|
||||
*Size:* 16 dwords.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`
|
17
docs/AMDGPU/gfx7_sdst64_0.rst
Normal file
17
docs/AMDGPU/gfx7_sdst64_0.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_sdst64_0:
|
||||
|
||||
sdst
|
||||
===========================
|
||||
|
||||
Instruction output.
|
||||
|
||||
*Size:* 2 dwords.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`
|
17
docs/AMDGPU/gfx7_sdst64_1.rst
Normal file
17
docs/AMDGPU/gfx7_sdst64_1.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_sdst64_1:
|
||||
|
||||
sdst
|
||||
===========================
|
||||
|
||||
Instruction output.
|
||||
|
||||
*Size:* 2 dwords.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`exec<amdgpu_synid_exec>`
|
14
docs/AMDGPU/gfx7_simm16.rst
Normal file
14
docs/AMDGPU/gfx7_simm16.rst
Normal file
@ -0,0 +1,14 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_simm16:
|
||||
|
||||
imm16
|
||||
===========================
|
||||
|
||||
An :ref:`integer_number<amdgpu_synid_integer_number>`. The value is truncated to 16 bits and then sign-extended to 32 bits.
|
||||
|
17
docs/AMDGPU/gfx7_src32_0.rst
Normal file
17
docs/AMDGPU/gfx7_src32_0.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_src32_0:
|
||||
|
||||
src
|
||||
===========================
|
||||
|
||||
Instruction input.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`, :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`m0<amdgpu_synid_m0>`, :ref:`exec<amdgpu_synid_exec>`, :ref:`constant<amdgpu_synid_constant>`, :ref:`literal<amdgpu_synid_literal>`
|
17
docs/AMDGPU/gfx7_src32_1.rst
Normal file
17
docs/AMDGPU/gfx7_src32_1.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_src32_1:
|
||||
|
||||
src
|
||||
===========================
|
||||
|
||||
Instruction input.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`, :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`m0<amdgpu_synid_m0>`, :ref:`exec<amdgpu_synid_exec>`, :ref:`iconst<amdgpu_synid_iconst>`
|
17
docs/AMDGPU/gfx7_src32_2.rst
Normal file
17
docs/AMDGPU/gfx7_src32_2.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_src32_2:
|
||||
|
||||
src
|
||||
===========================
|
||||
|
||||
Instruction input.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`, :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`m0<amdgpu_synid_m0>`, :ref:`exec<amdgpu_synid_exec>`, :ref:`constant<amdgpu_synid_constant>`
|
17
docs/AMDGPU/gfx7_src32_3.rst
Normal file
17
docs/AMDGPU/gfx7_src32_3.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_src32_3:
|
||||
|
||||
src
|
||||
===========================
|
||||
|
||||
Instruction input.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`, :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`m0<amdgpu_synid_m0>`, :ref:`exec<amdgpu_synid_exec>`
|
17
docs/AMDGPU/gfx7_src64_0.rst
Normal file
17
docs/AMDGPU/gfx7_src64_0.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_src64_0:
|
||||
|
||||
src
|
||||
===========================
|
||||
|
||||
Instruction input.
|
||||
|
||||
*Size:* 2 dwords.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`, :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`exec<amdgpu_synid_exec>`, :ref:`constant<amdgpu_synid_constant>`, :ref:`literal<amdgpu_synid_literal>`
|
17
docs/AMDGPU/gfx7_src64_1.rst
Normal file
17
docs/AMDGPU/gfx7_src64_1.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_src64_1:
|
||||
|
||||
src
|
||||
===========================
|
||||
|
||||
Instruction input.
|
||||
|
||||
*Size:* 2 dwords.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`, :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`exec<amdgpu_synid_exec>`, :ref:`constant<amdgpu_synid_constant>`
|
17
docs/AMDGPU/gfx7_src64_2.rst
Normal file
17
docs/AMDGPU/gfx7_src64_2.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_src64_2:
|
||||
|
||||
src
|
||||
===========================
|
||||
|
||||
Instruction input.
|
||||
|
||||
*Size:* 2 dwords.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`, :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`exec<amdgpu_synid_exec>`, :ref:`iconst<amdgpu_synid_iconst>`
|
28
docs/AMDGPU/gfx7_src_exp.rst
Normal file
28
docs/AMDGPU/gfx7_src_exp.rst
Normal file
@ -0,0 +1,28 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_src_exp:
|
||||
|
||||
vsrc
|
||||
===========================
|
||||
|
||||
Data to copy to export buffers. This is an optional operand. Must be specified as :ref:`off<amdgpu_synid_off>` if not used.
|
||||
|
||||
:ref:`compr<amdgpu_synid_compr>` modifier indicates use of compressed (16-bit) data. This limits number of source operands from 4 to 2:
|
||||
|
||||
* src0 and src1 must specify the first register (or :ref:`off<amdgpu_synid_off>`).
|
||||
* src2 and src3 must specify the second register (or :ref:`off<amdgpu_synid_off>`).
|
||||
|
||||
An example:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
exp mrtz v3, v3, off, off compr
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`v<amdgpu_synid_v>`, :ref:`off<amdgpu_synid_off>`
|
17
docs/AMDGPU/gfx7_ssrc32_0.rst
Normal file
17
docs/AMDGPU/gfx7_ssrc32_0.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_ssrc32_0:
|
||||
|
||||
ssrc
|
||||
===========================
|
||||
|
||||
Instruction input.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`m0<amdgpu_synid_m0>`, :ref:`exec<amdgpu_synid_exec>`, :ref:`constant<amdgpu_synid_constant>`, :ref:`literal<amdgpu_synid_literal>`
|
17
docs/AMDGPU/gfx7_ssrc32_1.rst
Normal file
17
docs/AMDGPU/gfx7_ssrc32_1.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_ssrc32_1:
|
||||
|
||||
ssrc
|
||||
===========================
|
||||
|
||||
Instruction input.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`m0<amdgpu_synid_m0>`, :ref:`exec<amdgpu_synid_exec>`
|
17
docs/AMDGPU/gfx7_ssrc32_2.rst
Normal file
17
docs/AMDGPU/gfx7_ssrc32_2.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_ssrc32_2:
|
||||
|
||||
ssrc
|
||||
===========================
|
||||
|
||||
Instruction input.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`
|
17
docs/AMDGPU/gfx7_ssrc32_3.rst
Normal file
17
docs/AMDGPU/gfx7_ssrc32_3.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_ssrc32_3:
|
||||
|
||||
ssrc
|
||||
===========================
|
||||
|
||||
Instruction input.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`m0<amdgpu_synid_m0>`, :ref:`exec<amdgpu_synid_exec>`, :ref:`iconst<amdgpu_synid_iconst>`, :ref:`literal<amdgpu_synid_literal>`
|
17
docs/AMDGPU/gfx7_ssrc32_4.rst
Normal file
17
docs/AMDGPU/gfx7_ssrc32_4.rst
Normal file
@ -0,0 +1,17 @@
|
||||
..
|
||||
**************************************************
|
||||
* *
|
||||
* Automatically generated file, do not edit! *
|
||||
* *
|
||||
**************************************************
|
||||
|
||||
.. _amdgpu_synid7_ssrc32_4:
|
||||
|
||||
ssrc
|
||||
===========================
|
||||
|
||||
Instruction input.
|
||||
|
||||
*Size:* 1 dword.
|
||||
|
||||
*Operands:* :ref:`s<amdgpu_synid_s>`, :ref:`flat_scratch<amdgpu_synid_flat_scratch>`, :ref:`vcc<amdgpu_synid_vcc>`, :ref:`trap<amdgpu_synid_trap>`, :ref:`m0<amdgpu_synid_m0>`, :ref:`iconst<amdgpu_synid_iconst>`
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user