Skip to content

Commit

Permalink
Add Wasm proposal status printing functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
lum1n0us committed Dec 26, 2024
1 parent 39afa12 commit 067f1b9
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
37 changes: 37 additions & 0 deletions product-mini/platforms/common/wasm_proposal.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2023 Amazon.com Inc. or its affiliates. All rights reserved.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*/

#include <stdio.h>

void
wasm_proposal_print_status(void)
{
printf("Phase4 Wasm Proposals Status:\n");
printf(" Always-on:\n");
printf(" - Extended Constant Expressions\n");
printf(" - Multi-value\n");
printf(" - Non-trapping float-to-int conversions\n");
printf(" - Sign-extension operators\n");
printf(" - WebAssembly C and C++ API\n");
printf(" Configurable:\n");
printf(" - Bulk Memory Operation: %u\n", WASM_ENABLE_BULK_MEMORY);
printf(" - Fixed-Width SIMD: %u\n", WASM_ENABLE_SIMD);
printf(" - Garbage Collection: %u\n", WASM_ENABLE_GC);
printf(" - Legacy Exception Handling: %u\n", WASM_ENABLE_EXCE_HANDLING);
printf(" - Memory64: %u\n", WASM_ENABLE_MEMORY64);
printf(" - Multiple Memory: %u\n", WASM_ENABLE_MULTI_MEMORY);
printf(" - Reference Types: %u\n", WASM_ENABLE_REF_TYPES);
printf(" - Reference-Typed Strings: %u\n", WASM_ENABLE_REF_TYPES);
printf(" - Tail Call: %u\n", WASM_ENABLE_TAIL_CALL);
printf(" - Threads: %u\n", WASM_ENABLE_SHARED_MEMORY);
printf(" - Typed Function References: %u\n", WASM_ENABLE_GC);
printf(" Unsupported:\n");
printf(" - Branch Hinting\n");
printf(" - Custom Annotation Syntax in the Text Format\n");
printf(" - Exception handling\n");
printf(" - Import/Export of Mutable Globals\n");
printf(" - JS String Builtins\n");
printf(" - Relaxed SIMD\n");
}
12 changes: 12 additions & 0 deletions product-mini/platforms/common/wasm_proposal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (C) 2023 Amazon.com Inc. or its affiliates. All rights reserved.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*/

#ifndef _WASM_PROPOSAL_H_
#define _WASM_PROPOSAL_H_

void
wasm_proposal_print_status(void);

#endif /* _WASM_PROPOSAL_H_ */
4 changes: 4 additions & 0 deletions product-mini/platforms/posix/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "../common/libc_wasi.c"
#endif

#include "../common/wasm_proposal.c"

#if BH_HAS_DLFCN
#include <dlfcn.h>
#endif
Expand Down Expand Up @@ -798,6 +800,8 @@ main(int argc, char *argv[])
wasm_runtime_get_version(&major, &minor, &patch);
printf("iwasm %" PRIu32 ".%" PRIu32 ".%" PRIu32 "\n", major, minor,
patch);
printf("\n");
wasm_proposal_print_status();
return 0;
}
else {
Expand Down

0 comments on commit 067f1b9

Please sign in to comment.