Skip to content

Commit 63df2cf

Browse files
Update std atomic check and simd compatibility check for arc compiler (#3716)
1 parent b845e2e commit 63df2cf

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

core/iwasm/compilation/aot_llvm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3121,7 +3121,8 @@ aot_create_comp_context(const AOTCompData *comp_data, aot_comp_option_t option)
31213121
#endif
31223122

31233123
if (option->enable_simd && strcmp(comp_ctx->target_arch, "x86_64") != 0
3124-
&& strncmp(comp_ctx->target_arch, "aarch64", 7) != 0) {
3124+
&& strncmp(comp_ctx->target_arch, "aarch64", 7) != 0
3125+
&& strcmp(comp_ctx->target_arch, "arc") != 0) {
31253126
/* Disable simd if it isn't supported by target arch */
31263127
option->enable_simd = false;
31273128
}

core/iwasm/compilation/aot_llvm_extra.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ aot_check_simd_compatibility(const char *arch_c_str, const char *cpu_c_str)
176176
else if (targetArch == llvm::Triple::aarch64) {
177177
return subTargetInfo->checkFeatures("+neon");
178178
}
179+
else if (targetArch == llvm::Triple::arc) {
180+
return true;
181+
}
179182
else {
180183
return false;
181184
}

core/shared/platform/include/platform_api_extension.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ os_thread_exit(void *retval);
104104
#endif
105105

106106
/* Clang's __GNUC_PREREQ macro has a different meaning than GCC one,
107-
so we have to handle this case specially */
108-
#if defined(__clang__)
107+
so we have to handle this case specially(except the CCAC compiler
108+
provided by MetaWare, which doesn't support atomic operations) */
109+
#if defined(__clang__) && !defined(__CCAC__)
109110
/* Clang provides stdatomic.h since 3.6.0
110111
See https://releases.llvm.org/3.6.0/tools/clang/docs/ReleaseNotes.html */
111112
#if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 6)

0 commit comments

Comments
 (0)