Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/SPIR.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ class LLVM_LIBRARY_VISIBILITY SPIRV64AMDGCNTargetInfo final
HasLegalHalfType = true;
HasFloat16 = true;
HalfArgsAndReturns = true;

MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
}

bool hasBFloat16Type() const override { return true; }
Expand Down
4 changes: 4 additions & 0 deletions libc/cmake/modules/LLVMLibCArchitectures.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ function(get_arch_and_system_from_triple triple arch_var sys_var)
set(target_arch "riscv32")
elseif(target_arch MATCHES "^riscv64")
set(target_arch "riscv64")
elseif(target_arch MATCHES "^spirv64")
set(target_arch "spirv64")
elseif(target_arch MATCHES "^amdgcn")
set(target_arch "amdgpu")
elseif(target_arch MATCHES "^nvptx64")
Expand Down Expand Up @@ -160,6 +162,8 @@ elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "riscv32")
set(LIBC_TARGET_ARCHITECTURE "riscv")
elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "amdgpu")
set(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU TRUE)
elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "spirv64")
set(LIBC_TARGET_ARCHITECTURE_IS_SPIRV64 TRUE)
elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "nvptx")
set(LIBC_TARGET_ARCHITECTURE_IS_NVPTX TRUE)
else()
Expand Down
37 changes: 37 additions & 0 deletions libc/config/gpu/spirv64/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"errno": {
"LIBC_CONF_ERRNO_MODE": {
"value": "LIBC_ERRNO_MODE_SHARED"
}
},
"printf": {
"LIBC_CONF_PRINTF_DISABLE_FLOAT": {
"value": true
},
"LIBC_CONF_PRINTF_DISABLE_INDEX_MODE": {
"value": true
},
"LIBC_CONF_PRINTF_DISABLE_WRITE_INT": {
"value": true
},
"LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE": {
"value": false
},
"LIBC_CONF_PRINTF_DISABLE_STRERROR": {
"value": true
}
},
"scanf": {
"LIBC_CONF_SCANF_DISABLE_FLOAT": {
"value": true
},
"LIBC_CONF_SCANF_DISABLE_INDEX_MODE": {
"value": true
}
},
"math": {
"LIBC_CONF_MATH_OPTIMIZATIONS": {
"value": "(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES | LIBC_MATH_NO_ERRNO | LIBC_MATH_NO_EXCEPT)"
}
}
}
Loading
Loading