Skip to content

Commit 4b54fc0

Browse files
authored
Merge branch 'main' into inbelic/spirv-audit-result
2 parents 7b922d7 + f85be26 commit 4b54fc0

File tree

119 files changed

+4047
-828
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+4047
-828
lines changed

clang/include/clang/Serialization/ASTWriter.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -548,20 +548,18 @@ class ASTWriter : public ASTDeserializationListener,
548548
void WriteSubStmt(Stmt *S);
549549

550550
void WriteBlockInfoBlock();
551-
void WriteControlBlock(Preprocessor &PP, ASTContext &Context,
552-
StringRef isysroot);
551+
void WriteControlBlock(Preprocessor &PP, StringRef isysroot);
553552

554553
/// Write out the signature and diagnostic options, and return the signature.
555-
void writeUnhashedControlBlock(Preprocessor &PP, ASTContext &Context);
554+
void writeUnhashedControlBlock(Preprocessor &PP);
556555
ASTFileSignature backpatchSignature();
557556

558557
/// Calculate hash of the pcm content.
559558
std::pair<ASTFileSignature, ASTFileSignature> createSignature() const;
560559
ASTFileSignature createSignatureForNamedModule() const;
561560

562561
void WriteInputFiles(SourceManager &SourceMgr, HeaderSearchOptions &HSOpts);
563-
void WriteSourceManagerBlock(SourceManager &SourceMgr,
564-
const Preprocessor &PP);
562+
void WriteSourceManagerBlock(SourceManager &SourceMgr);
565563
void WritePreprocessor(const Preprocessor &PP, bool IsModule);
566564
void WriteHeaderSearch(const HeaderSearch &HS);
567565
void WritePreprocessorDetail(PreprocessingRecord &PPRec,

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,8 +1269,7 @@ ASTFileSignature ASTWriter::backpatchSignature() {
12691269
return Signature;
12701270
}
12711271

1272-
void ASTWriter::writeUnhashedControlBlock(Preprocessor &PP,
1273-
ASTContext &Context) {
1272+
void ASTWriter::writeUnhashedControlBlock(Preprocessor &PP) {
12741273
using namespace llvm;
12751274

12761275
// Flush first to prepare the PCM hash (signature).
@@ -1323,7 +1322,7 @@ void ASTWriter::writeUnhashedControlBlock(Preprocessor &PP,
13231322
const auto &HSOpts = PP.getHeaderSearchInfo().getHeaderSearchOpts();
13241323

13251324
// Diagnostic options.
1326-
const auto &Diags = Context.getDiagnostics();
1325+
const auto &Diags = PP.getDiagnostics();
13271326
const DiagnosticOptions &DiagOpts = Diags.getDiagnosticOptions();
13281327
if (!HSOpts.ModulesSkipDiagnosticOptions) {
13291328
#define DIAGOPT(Name, Bits, Default) Record.push_back(DiagOpts.Name);
@@ -1403,10 +1402,12 @@ void ASTWriter::writeUnhashedControlBlock(Preprocessor &PP,
14031402
}
14041403

14051404
/// Write the control block.
1406-
void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,
1407-
StringRef isysroot) {
1405+
void ASTWriter::WriteControlBlock(Preprocessor &PP, StringRef isysroot) {
14081406
using namespace llvm;
14091407

1408+
SourceManager &SourceMgr = PP.getSourceManager();
1409+
FileManager &FileMgr = PP.getFileManager();
1410+
14101411
Stream.EnterSubblock(CONTROL_BLOCK_ID, 5);
14111412
RecordData Record;
14121413

@@ -1454,14 +1455,12 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,
14541455
SmallString<128> BaseDir;
14551456
if (PP.getHeaderSearchInfo().getHeaderSearchOpts().ModuleFileHomeIsCwd) {
14561457
// Use the current working directory as the base path for all inputs.
1457-
auto CWD =
1458-
Context.getSourceManager().getFileManager().getOptionalDirectoryRef(
1459-
".");
1458+
auto CWD = FileMgr.getOptionalDirectoryRef(".");
14601459
BaseDir.assign(CWD->getName());
14611460
} else {
14621461
BaseDir.assign(WritingModule->Directory->getName());
14631462
}
1464-
cleanPathForOutput(Context.getSourceManager().getFileManager(), BaseDir);
1463+
cleanPathForOutput(FileMgr, BaseDir);
14651464

14661465
// If the home of the module is the current working directory, then we
14671466
// want to pick up the cwd of the build process loading the module, not
@@ -1554,7 +1553,7 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,
15541553

15551554
// Language options.
15561555
Record.clear();
1557-
const LangOptions &LangOpts = Context.getLangOpts();
1556+
const LangOptions &LangOpts = PP.getLangOpts();
15581557
#define LANGOPT(Name, Bits, Default, Description) \
15591558
Record.push_back(LangOpts.Name);
15601559
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
@@ -1591,7 +1590,7 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,
15911590

15921591
// Target options.
15931592
Record.clear();
1594-
const TargetInfo &Target = Context.getTargetInfo();
1593+
const TargetInfo &Target = PP.getTargetInfo();
15951594
const TargetOptions &TargetOpts = Target.getTargetOpts();
15961595
AddString(TargetOpts.Triple, Record);
15971596
AddString(TargetOpts.CPU, Record);
@@ -1609,8 +1608,7 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,
16091608

16101609
// File system options.
16111610
Record.clear();
1612-
const FileSystemOptions &FSOpts =
1613-
Context.getSourceManager().getFileManager().getFileSystemOpts();
1611+
const FileSystemOptions &FSOpts = FileMgr.getFileSystemOpts();
16141612
AddString(FSOpts.WorkingDir, Record);
16151613
Stream.EmitRecord(FILE_SYSTEM_OPTIONS, Record);
16161614

@@ -1675,8 +1673,8 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,
16751673
Stream.ExitBlock();
16761674

16771675
// Original file name and file ID
1678-
SourceManager &SM = Context.getSourceManager();
1679-
if (auto MainFile = SM.getFileEntryRefForID(SM.getMainFileID())) {
1676+
if (auto MainFile =
1677+
SourceMgr.getFileEntryRefForID(SourceMgr.getMainFileID())) {
16801678
auto FileAbbrev = std::make_shared<BitCodeAbbrev>();
16811679
FileAbbrev->Add(BitCodeAbbrevOp(ORIGINAL_FILE));
16821680
FileAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // File ID
@@ -1685,16 +1683,15 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,
16851683

16861684
Record.clear();
16871685
Record.push_back(ORIGINAL_FILE);
1688-
AddFileID(SM.getMainFileID(), Record);
1686+
AddFileID(SourceMgr.getMainFileID(), Record);
16891687
EmitRecordWithPath(FileAbbrevCode, Record, MainFile->getName());
16901688
}
16911689

16921690
Record.clear();
1693-
AddFileID(SM.getMainFileID(), Record);
1691+
AddFileID(SourceMgr.getMainFileID(), Record);
16941692
Stream.EmitRecord(ORIGINAL_FILE_ID, Record);
16951693

1696-
WriteInputFiles(Context.SourceMgr,
1697-
PP.getHeaderSearchInfo().getHeaderSearchOpts());
1694+
WriteInputFiles(SourceMgr, PP.getHeaderSearchInfo().getHeaderSearchOpts());
16981695
Stream.ExitBlock();
16991696
}
17001697

@@ -2234,8 +2231,7 @@ static void emitBlob(llvm::BitstreamWriter &Stream, StringRef Blob,
22342231
/// entries for files that we actually need. In the common case (no
22352232
/// errors), we probably won't have to create file entries for any of
22362233
/// the files in the AST.
2237-
void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
2238-
const Preprocessor &PP) {
2234+
void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr) {
22392235
RecordData Record;
22402236

22412237
// Enter the source manager block.
@@ -2323,8 +2319,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
23232319
// We add one to the size so that we capture the trailing NULL
23242320
// that is required by llvm::MemoryBuffer::getMemBuffer (on
23252321
// the reader side).
2326-
std::optional<llvm::MemoryBufferRef> Buffer =
2327-
Content->getBufferOrNone(PP.getDiagnostics(), PP.getFileManager());
2322+
std::optional<llvm::MemoryBufferRef> Buffer = Content->getBufferOrNone(
2323+
SourceMgr.getDiagnostics(), SourceMgr.getFileManager());
23282324
StringRef Name = Buffer ? Buffer->getBufferIdentifier() : "";
23292325
Stream.EmitRecordWithBlob(SLocBufferAbbrv, Record,
23302326
StringRef(Name.data(), Name.size() + 1));
@@ -2334,8 +2330,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
23342330
if (EmitBlob) {
23352331
// Include the implicit terminating null character in the on-disk buffer
23362332
// if we're writing it uncompressed.
2337-
std::optional<llvm::MemoryBufferRef> Buffer =
2338-
Content->getBufferOrNone(PP.getDiagnostics(), PP.getFileManager());
2333+
std::optional<llvm::MemoryBufferRef> Buffer = Content->getBufferOrNone(
2334+
SourceMgr.getDiagnostics(), SourceMgr.getFileManager());
23392335
if (!Buffer)
23402336
Buffer = llvm::MemoryBufferRef("<<<INVALID BUFFER>>>", "");
23412337
StringRef Blob(Buffer->getBufferStart(), Buffer->getBufferSize() + 1);
@@ -5371,7 +5367,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
53715367
// SourceLocations or FileIDs depends on it.
53725368
computeNonAffectingInputFiles();
53735369

5374-
writeUnhashedControlBlock(PP, Context);
5370+
writeUnhashedControlBlock(PP);
53755371

53765372
// Don't reuse type ID and Identifier ID from readers for C++ standard named
53775373
// modules since we want to support no-transitive-change model for named
@@ -5433,7 +5429,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
54335429
PrepareWritingSpecialDecls(SemaRef);
54345430

54355431
// Write the control block
5436-
WriteControlBlock(PP, Context, isysroot);
5432+
WriteControlBlock(PP, isysroot);
54375433

54385434
// Write the remaining AST contents.
54395435
Stream.FlushToWord();
@@ -5526,7 +5522,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
55265522
WriteDeclAndTypes(Context);
55275523

55285524
WriteFileDeclIDsMap();
5529-
WriteSourceManagerBlock(Context.getSourceManager(), PP);
5525+
WriteSourceManagerBlock(PP.getSourceManager());
55305526
WriteComments();
55315527
WritePreprocessor(PP, isModule);
55325528
WriteHeaderSearch(PP.getHeaderSearchInfo());

compiler-rt/cmake/Modules/AddCompilerRT.cmake

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -680,15 +680,17 @@ macro(add_custom_libcxx name prefix)
680680

681681
ExternalProject_Add(${name}
682682
DEPENDS ${name}-clobber ${LIBCXX_DEPS}
683-
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name}
683+
PREFIX ${prefix}
684684
SOURCE_DIR ${LLVM_MAIN_SRC_DIR}/../runtimes
685-
BINARY_DIR ${prefix}
685+
BINARY_DIR ${prefix}/build
686686
CMAKE_ARGS ${CMAKE_PASSTHROUGH_VARIABLES}
687687
${compiler_args}
688688
${verbose}
689689
-DCMAKE_C_FLAGS=${LIBCXX_C_FLAGS}
690690
-DCMAKE_CXX_FLAGS=${LIBCXX_CXX_FLAGS}
691691
-DCMAKE_BUILD_TYPE=Release
692+
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
693+
-DCMAKE_INSTALL_MESSAGE=LAZY
692694
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY
693695
-DLLVM_ENABLE_RUNTIMES=libcxx|libcxxabi
694696
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF
@@ -701,16 +703,17 @@ macro(add_custom_libcxx name prefix)
701703
-DLIBCXX_INCLUDE_BENCHMARKS=OFF
702704
-DLIBCXX_INCLUDE_TESTS=OFF
703705
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON
706+
-DLLVM_INCLUDE_TESTS=OFF
707+
-DLLVM_INCLUDE_DOCS=OFF
704708
${LIBCXX_CMAKE_ARGS}
705-
INSTALL_COMMAND ""
706-
STEP_TARGETS configure build
709+
STEP_TARGETS configure build install
707710
BUILD_ALWAYS 1
708711
USES_TERMINAL_CONFIGURE 1
709712
USES_TERMINAL_BUILD 1
710713
USES_TERMINAL_INSTALL 1
711714
LIST_SEPARATOR |
712715
EXCLUDE_FROM_ALL TRUE
713-
BUILD_BYPRODUCTS "${prefix}/lib/libc++.a" "${prefix}/lib/libc++abi.a"
716+
INSTALL_BYPRODUCTS "${prefix}/lib/libc++.a" "${prefix}/lib/libc++abi.a"
714717
)
715718

716719
if (CMAKE_GENERATOR MATCHES "Make")

compiler-rt/lib/fuzzer/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ if(OS_NAME MATCHES "Android|Linux|Fuchsia" AND
166166
-DLIBCXX_ABI_NAMESPACE=__Fuzzer
167167
-DLIBCXX_ENABLE_EXCEPTIONS=OFF)
168168
target_compile_options(RTfuzzer.${arch} PRIVATE -isystem ${LIBCXX_${arch}_PREFIX}/include/c++/v1)
169-
add_dependencies(RTfuzzer.${arch} libcxx_fuzzer_${arch}-build)
169+
add_dependencies(RTfuzzer.${arch} libcxx_fuzzer_${arch}-install)
170170
target_compile_options(RTfuzzer_main.${arch} PRIVATE -isystem ${LIBCXX_${arch}_PREFIX}/include/c++/v1)
171-
add_dependencies(RTfuzzer_main.${arch} libcxx_fuzzer_${arch}-build)
171+
add_dependencies(RTfuzzer_main.${arch} libcxx_fuzzer_${arch}-install)
172172
target_compile_options(RTfuzzer_interceptors.${arch} PRIVATE -isystem ${LIBCXX_${arch}_PREFIX}/include/c++/v1)
173-
add_dependencies(RTfuzzer_interceptors.${arch} libcxx_fuzzer_${arch}-build)
173+
add_dependencies(RTfuzzer_interceptors.${arch} libcxx_fuzzer_${arch}-install)
174174
partially_link_libcxx(fuzzer_no_main ${LIBCXX_${arch}_PREFIX} ${arch})
175175
partially_link_libcxx(fuzzer_interceptors ${LIBCXX_${arch}_PREFIX} ${arch})
176176
partially_link_libcxx(fuzzer ${LIBCXX_${arch}_PREFIX} ${arch})

compiler-rt/lib/fuzzer/tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ if(COMPILER_RT_DEFAULT_TARGET_ARCH IN_LIST FUZZER_SUPPORTED_ARCH)
6464
COMPILER_RT_LIBCXX_PATH AND
6565
COMPILER_RT_LIBCXXABI_PATH)
6666
file(GLOB libfuzzer_headers ../*.h)
67-
set(LIBFUZZER_TEST_RUNTIME_DEPS libcxx_fuzzer_${arch}-build ${libfuzzer_headers})
67+
set(LIBFUZZER_TEST_RUNTIME_DEPS libcxx_fuzzer_${arch}-install ${libfuzzer_headers})
6868
set(LIBFUZZER_TEST_RUNTIME_CFLAGS -isystem ${LIBCXX_${arch}_PREFIX}/include/c++/v1)
6969
set(LIBFUZZER_TEST_RUNTIME_LINK_FLAGS ${LIBCXX_${arch}_PREFIX}/lib/libc++.a)
7070
endif()

compiler-rt/lib/msan/tests/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ macro(msan_compile obj_list source arch kind cflags)
6969
sanitizer_test_compile(
7070
${obj_list} ${source} ${arch}
7171
KIND ${kind}
72-
COMPILE_DEPS ${MSAN_UNITTEST_HEADERS} libcxx_msan_${arch}-build
72+
COMPILE_DEPS ${MSAN_UNITTEST_HEADERS} libcxx_msan_${arch}-install
7373
DEPS msan
7474
CFLAGS -isystem ${MSAN_LIBCXX_DIR}/../include/c++/v1
7575
${MSAN_UNITTEST_INSTRUMENTED_CFLAGS} ${cflags}
@@ -117,10 +117,10 @@ macro(add_msan_tests_for_arch arch kind cflags)
117117
DEPS ${MSAN_INST_LOADABLE_OBJECTS})
118118

119119
set(MSAN_TEST_OBJECTS ${MSAN_INST_TEST_OBJECTS} ${MSAN_INST_GTEST})
120-
set(MSAN_TEST_DEPS ${MSAN_TEST_OBJECTS} libcxx_msan_${arch}-build
120+
set(MSAN_TEST_DEPS ${MSAN_TEST_OBJECTS} libcxx_msan_${arch}-install
121121
${MSAN_LOADABLE_SO}
122-
"${MSAN_LIBCXX_DIR}/libc++.a" "${MSAN_LIBCXX_DIR}/libc++abi.a")
123-
list(APPEND MSAN_TEST_DEPS msan libcxx_msan_${arch}-build)
122+
"${MSAN_LIBCXX_DIR}/libc++.a" "${MSAN_LIBCXX_DIR}/libc++abi.a")
123+
list(APPEND MSAN_TEST_DEPS msan libcxx_msan_${arch}-install)
124124
get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS)
125125
add_compiler_rt_test(MsanUnitTests "Msan-${arch}${kind}-Test" ${arch}
126126
OBJECTS ${MSAN_TEST_OBJECTS} "${MSAN_LIBCXX_DIR}/libc++.a" "${MSAN_LIBCXX_DIR}/libc++abi.a"

compiler-rt/lib/tsan/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if(COMPILER_RT_LIBCXX_PATH AND
3131
DEPS ${TSAN_RUNTIME_LIBRARIES}
3232
CFLAGS ${TARGET_CFLAGS} -fsanitize=thread
3333
USE_TOOLCHAIN)
34-
list(APPEND libcxx_tsan_deps libcxx_tsan_${arch}-build)
34+
list(APPEND libcxx_tsan_deps libcxx_tsan_${arch}-install)
3535
endforeach()
3636

3737
add_custom_target(libcxx_tsan DEPENDS ${libcxx_tsan_deps})

flang/lib/Semantics/check-declarations.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,9 @@ void CheckHelper::CheckObjectEntity(
928928
details.cudaDataAttr().value_or(common::CUDADataAttr::Device) !=
929929
common::CUDADataAttr::Device &&
930930
details.cudaDataAttr().value_or(common::CUDADataAttr::Device) !=
931-
common::CUDADataAttr::Managed) {
931+
common::CUDADataAttr::Managed &&
932+
details.cudaDataAttr().value_or(common::CUDADataAttr::Device) !=
933+
common::CUDADataAttr::Shared) {
932934
Warn(common::UsageWarning::CUDAUsage,
933935
"Dummy argument '%s' may not have ATTRIBUTES(%s) in a device subprogram"_warn_en_US,
934936
symbol.name(),

flang/test/Semantics/cuf03.cuf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@ module m
5555
real, unified :: um
5656

5757
contains
58-
attributes(device) subroutine devsubr(n,da)
58+
attributes(device) subroutine devsubr(n,da,rs)
5959
integer, intent(in) :: n
6060
real, device :: da(*) ! ok
6161
real, managed :: ma(n) ! ok
6262
!WARNING: Pointer 'dp' may not be associated in a device subprogram
6363
real, device, pointer :: dp
6464
real, constant :: rc ! ok
65+
real, shared :: rs ! ok
6566
!ERROR: Object 'u' with ATTRIBUTES(UNIFIED) must be declared in a host subprogram
6667
real, unified :: u
6768
end subroutine
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#ifndef __CLC_CLC_AS_TYPE_H__
2+
#define __CLC_CLC_AS_TYPE_H__
3+
4+
#define __clc_as_char(x) __builtin_astype(x, char)
5+
#define __clc_as_uchar(x) __builtin_astype(x, uchar)
6+
#define __clc_as_short(x) __builtin_astype(x, short)
7+
#define __clc_as_ushort(x) __builtin_astype(x, ushort)
8+
#define __clc_as_int(x) __builtin_astype(x, int)
9+
#define __clc_as_uint(x) __builtin_astype(x, uint)
10+
#define __clc_as_long(x) __builtin_astype(x, long)
11+
#define __clc_as_ulong(x) __builtin_astype(x, ulong)
12+
#define __clc_as_float(x) __builtin_astype(x, float)
13+
14+
#define __clc_as_char2(x) __builtin_astype(x, char2)
15+
#define __clc_as_uchar2(x) __builtin_astype(x, uchar2)
16+
#define __clc_as_short2(x) __builtin_astype(x, short2)
17+
#define __clc_as_ushort2(x) __builtin_astype(x, ushort2)
18+
#define __clc_as_int2(x) __builtin_astype(x, int2)
19+
#define __clc_as_uint2(x) __builtin_astype(x, uint2)
20+
#define __clc_as_long2(x) __builtin_astype(x, long2)
21+
#define __clc_as_ulong2(x) __builtin_astype(x, ulong2)
22+
#define __clc_as_float2(x) __builtin_astype(x, float2)
23+
24+
#define __clc_as_char3(x) __builtin_astype(x, char3)
25+
#define __clc_as_uchar3(x) __builtin_astype(x, uchar3)
26+
#define __clc_as_short3(x) __builtin_astype(x, short3)
27+
#define __clc_as_ushort3(x) __builtin_astype(x, ushort3)
28+
#define __clc_as_int3(x) __builtin_astype(x, int3)
29+
#define __clc_as_uint3(x) __builtin_astype(x, uint3)
30+
#define __clc_as_long3(x) __builtin_astype(x, long3)
31+
#define __clc_as_ulong3(x) __builtin_astype(x, ulong3)
32+
#define __clc_as_float3(x) __builtin_astype(x, float3)
33+
34+
#define __clc_as_char4(x) __builtin_astype(x, char4)
35+
#define __clc_as_uchar4(x) __builtin_astype(x, uchar4)
36+
#define __clc_as_short4(x) __builtin_astype(x, short4)
37+
#define __clc_as_ushort4(x) __builtin_astype(x, ushort4)
38+
#define __clc_as_int4(x) __builtin_astype(x, int4)
39+
#define __clc_as_uint4(x) __builtin_astype(x, uint4)
40+
#define __clc_as_long4(x) __builtin_astype(x, long4)
41+
#define __clc_as_ulong4(x) __builtin_astype(x, ulong4)
42+
#define __clc_as_float4(x) __builtin_astype(x, float4)
43+
44+
#define __clc_as_char8(x) __builtin_astype(x, char8)
45+
#define __clc_as_uchar8(x) __builtin_astype(x, uchar8)
46+
#define __clc_as_short8(x) __builtin_astype(x, short8)
47+
#define __clc_as_ushort8(x) __builtin_astype(x, ushort8)
48+
#define __clc_as_int8(x) __builtin_astype(x, int8)
49+
#define __clc_as_uint8(x) __builtin_astype(x, uint8)
50+
#define __clc_as_long8(x) __builtin_astype(x, long8)
51+
#define __clc_as_ulong8(x) __builtin_astype(x, ulong8)
52+
#define __clc_as_float8(x) __builtin_astype(x, float8)
53+
54+
#define __clc_as_char16(x) __builtin_astype(x, char16)
55+
#define __clc_as_uchar16(x) __builtin_astype(x, uchar16)
56+
#define __clc_as_short16(x) __builtin_astype(x, short16)
57+
#define __clc_as_ushort16(x) __builtin_astype(x, ushort16)
58+
#define __clc_as_int16(x) __builtin_astype(x, int16)
59+
#define __clc_as_uint16(x) __builtin_astype(x, uint16)
60+
#define __clc_as_long16(x) __builtin_astype(x, long16)
61+
#define __clc_as_ulong16(x) __builtin_astype(x, ulong16)
62+
#define __clc_as_float16(x) __builtin_astype(x, float16)
63+
64+
#ifdef cl_khr_fp64
65+
#define __clc_as_double(x) __builtin_astype(x, double)
66+
#define __clc_as_double2(x) __builtin_astype(x, double2)
67+
#define __clc_as_double3(x) __builtin_astype(x, double3)
68+
#define __clc_as_double4(x) __builtin_astype(x, double4)
69+
#define __clc_as_double8(x) __builtin_astype(x, double8)
70+
#define __clc_as_double16(x) __builtin_astype(x, double16)
71+
#endif
72+
73+
#ifdef cl_khr_fp16
74+
#define __clc_as_half(x) __builtin_astype(x, half)
75+
#define __clc_as_half2(x) __builtin_astype(x, half2)
76+
#define __clc_as_half3(x) __builtin_astype(x, half3)
77+
#define __clc_as_half4(x) __builtin_astype(x, half4)
78+
#define __clc_as_half8(x) __builtin_astype(x, half8)
79+
#define __clc_as_half16(x) __builtin_astype(x, half16)
80+
#endif
81+
82+
#endif // __CLC_CLC_AS_TYPE_H__

0 commit comments

Comments
 (0)