Skip to content

Commit 9bfe486

Browse files
authored
[libc] Initial support for parsing SPIR-V for GPU libc (#128570)
Summary: Some day we'd like to support this, add some initial support for parsing the triple so it will at least attempt to build.
1 parent 1e85e5a commit 9bfe486

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libc/cmake/modules/LLVMLibCArchitectures.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ function(get_arch_and_system_from_triple triple arch_var sys_var)
5353
set(target_arch "amdgpu")
5454
elseif(target_arch MATCHES "^nvptx64")
5555
set(target_arch "nvptx")
56+
elseif(target_arch MATCHES "^spirv64")
57+
set(target_arch "spirv64")
5658
else()
5759
return()
5860
endif()
@@ -162,6 +164,8 @@ elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "amdgpu")
162164
set(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU TRUE)
163165
elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "nvptx")
164166
set(LIBC_TARGET_ARCHITECTURE_IS_NVPTX TRUE)
167+
elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "spirv64")
168+
set(LIBC_TARGET_ARCHITECTURE_IS_SPIRV TRUE)
165169
else()
166170
message(FATAL_ERROR
167171
"Unsupported libc target architecture ${LIBC_TARGET_ARCHITECTURE}")

0 commit comments

Comments
 (0)