Commit Graph
69 Commits
Author SHA1 Message Date
Huang QiandGitHub cb7ac8fee3 nuttx: Mock socket APIs if NET is disabled (#1896) 2023-01-18 09:16:13 +08:00
Huang QiandGitHub a1786428e6 nuttx: Remove fdopendir (#1895)
The newer version of nuttx has implemented fdopendir, and the compiler
reports multiple definitions of it.
2023-01-17 11:16:01 +08:00
Huang QiandGitHub f818f4c43f Simplify fcmp intrinsic logic for AOT/XIP (#1881) 2023-01-12 12:05:53 +08:00
Huang QiandGitHub d5aa354d41 Return result directly if float cmp is called in AOT XIP (#1851) 2022-12-30 16:45:39 +08:00
Huang QiandGitHub d309091706 Register missing symbols for f32 to 64 bit integer conversion (#1850) 2022-12-30 15:21:25 +08:00
Huang QiandGitHub d1fe589d43 Fix fmin/fmax in AOT XIP intrinsics (#1848) 2022-12-29 18:48:55 +08:00
Huang QiandGitHub 41eb938a95 Fix equal check in AOT XIP float cmp intrinsic (#1847) 2022-12-29 18:11:05 +08:00
Huang QiandGitHub 6c7ca90229 Use float version library routine for XIP aot_intrinsic_xxx APIs (#1846) 2022-12-29 16:49:27 +08:00
Huang QiandGitHub b5f8a2bd08 Add missing soft float intrinsics for risc-v AOT (#1845) 2022-12-29 16:00:33 +08:00
Huang QiandGitHub 5d006ad263 Reuse build llvm libraries for spec test on nuttx (#1838)
Fix daily CI break on NuttX.
2022-12-26 14:22:15 +08:00
Huang QiandGitHub d827315122 Enable XIP in CI daily test (#1793) 2022-12-13 11:32:35 +08:00
Huang QiandGitHub ef4e795dba Implement i32.div_s (#1792) 2022-12-13 10:48:51 +08:00
Huang QiandGitHub f6bef1e604 Implement i32.rem_s and i32.rem_u intrinsic (#1789) 2022-12-08 09:38:20 +08:00
Huang QiandGitHub 371310fdee Dump more info when spec test fails with XIP mode (#1779) 2022-12-05 10:00:50 +08:00
Huang QiandGitHub a29344ae6c Enable spec test on nuttx and daily run it (#1763)
- Spec test needs about 15 min
- Skip some test cases that cannot pass now, most of which are FP relative
  (due to potential bugs in NuttX's libc)
2022-12-02 12:39:46 +08:00
Huang QiandGitHub 9c5e1cb600 wamr-test-suites: Add support for ARM/RISCV by QEMU (#1704)
Enhance wamr-test-suites to add QEMU and Firmware options:
`./test_wamr.sh -Q <qemu> -F <firmware>`
2022-11-28 10:45:32 +08:00
Huang QiandGitHub 93d3d09aa1 Clear some warnings and enable -Werror for NuttX (#1756) 2022-11-28 09:44:33 +08:00
Huang QiandGitHub 0456043d8d Fix missing intrinsics for risc-v which were reported by spec test (#1750) 2022-11-25 09:20:38 +08:00
Huang QiandGitHub 4e5ba6f6ef Fix issue of thumb relocation R_ARM_THM_MOVT_ABS (#1723) 2022-11-19 19:36:02 +08:00
Huang QiandGitHub b5efadf205 nuttx: Enable ref types by Kconfig (#1711) 2022-11-17 11:56:59 +08:00
Huang QiandGitHub 4b0660cf24 Fix missing float cmp for XIP (#1699) 2022-11-14 11:58:38 +08:00
Huang QiandGitHub 810007857b wamr-test-suites: Update runtest.py to support python3 (#1684)
Update runtest.py of wamr-test-suites to support both python2 and python3
2022-11-07 14:16:10 +08:00
Huang QiandGitHub 4b6e4e1732 Correct the arch name for armv7a on NuttX (#1678) 2022-11-03 21:54:05 +08:00
Huang QiandGitHub c8cacbd883 Add LLVM_BUILD_OP_OR_INTRINSIC to avoid code dup (#1672) 2022-11-03 11:48:48 +08:00
Huang QiandGitHub 94cecbe4cb Fix XIP issues of fp to int cast and int rem/div (#1654) 2022-11-01 20:29:07 +08:00
Huang QiandGitHub 4a1e522c53 Move indirect mode optimization to the last of LLVM pipelines (#1627)
The general optimizations may create some intrinsic function calls
like llvm.memset, so we move indirect mode optimization after them
to remove these function calls at last.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-10-24 10:20:05 +08:00
Huang QiandGitHub 73809efb5d Fix XIP issue caused by rem_s on RISC-V (#1619) 2022-10-19 16:46:26 +08:00
Huang QiandGitHub 86d3f30600 Implement R_ARM_THM_MOVT_[ABS|REPL] for thumb (#1615) 2022-10-19 06:08:51 +08:00
Huang QiandGitHub d7c2e9a6ea Fix NuttX CI break by install missing dependencies (#1532) 2022-09-29 12:31:56 +08:00
Huang QiandGitHub bbea005db6 Make libc-builtin buffered printf be a common feature (#1483)
Add macros to control whether to use the libc-builtin buffered printf
and the buffer size.
2022-09-15 15:09:01 +08:00
Huang QiandGitHub 8fcc556e50 ci: Cover more configurations & targets on NuttX (#1448)
Enable building iwasm on Nuttx for target:
* x86
* cortex-m0
* cortex-m4
* cortex-m7
* rv32imac
* rv64imac
* rv64gc
2022-09-05 12:12:32 +08:00
Huang QiandGitHub 531a011700 Move WASM_ENABLE_SPEC_TEST to correct place (#1447)
Fix compilation warning:
```
wamr/product-mini/platforms/nuttx/../posix/main.c:622:5: warning: "WASM_ENABLE_SPEC_TEST" is not defined, evaluates to 0 [-Wundef]
  622 | #if WASM_ENABLE_SPEC_TEST != 0
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-09-03 08:18:45 +08:00
Huang QiandGitHub c56fd8bd5b Introduce basic CI for nuttx (#1444) 2022-09-02 11:07:59 +08:00
Huang QiandGitHub c64186b704 Fix potential warning of printf in main.c of posix and windows (#1440) 2022-09-01 14:11:00 +08:00
Huang QiandGitHub 77c516ac80 Add a new API to get free memory in memory pool (#1430) 2022-08-31 16:39:25 +08:00
Huang QiandGitHub 2178787664 Implement i64.div and i64.rem intrinsics (#1375) 2022-08-12 11:09:06 +08:00
Huang QiandGitHub 88cf1e36c1 Support custom stack guard size (#1368)
Add a new option WAMR_BUILD_STACK_GUARD_SIZE to set the custom
stack guard size. For most RTOS systems, we use the native stack base
address as the check boundary which may be not safe as POSIX based
systems (like Linux).
2022-08-12 10:17:11 +08:00
Huang QiandGitHub 2ee01657a6 Add semaphore support for NuttX (#1367) 2022-08-09 19:35:16 +08:00
Huang QiandGitHub f3f8d684b3 Implement POSIX semaphore support for linux platform (#1345)
Implement POSIX semaphore support for linux platform
2022-08-08 19:59:46 +08:00
Huang QiandGitHub 0065743075 Correct DPFPU and FPU handling for NuttX (#1027)
Since DPFPU depends on FPU, if FPU is enabled we will never enter DPFPU
branch since `ifeq (${CONFIG_ARCH_FPU}, y)` is always true.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-03-08 13:31:38 +08:00
Huang QiandGitHub 44d75cec3c Ignore .cache used by clangd (#1018)
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>

> And another question, I got many warnings while compiling wamr by clang like:
> 
> ```
> [10/67] Building C object CMakeFiles/vmlib.dir/home/huang/Work/wasm-micro-runtime/core/iwasm/common/wasm_exec_env.c.o
> In file included from /home/huang/Work/wasm-micro-runtime/core/iwasm/common/wasm_exec_env.c:6:
> In file included from /home/huang/Work/wasm-micro-runtime/core/iwasm/common/wasm_exec_env.h:11:
> /home/huang/Work/wasm-micro-runtime/core/iwasm/common/../interpreter/wasm.h:573:53: warning: unused parameter 'type_count' [-Wunused-parameter]
> wasm_get_smallest_type_idx(WASMType **types, uint32 type_count,
>                                                     ^
> 1 warning generated.
> [15/67] Building C object CMakeFiles/vmlib.dir/home/huang/Work/wasm-micro-runtime/core/iwasm/common/wasm_application.c.o
> In file included from /home/huang/Work/wasm-micro-runtime/core/iwasm/common/wasm_application.c:8:
> In file included from /home/huang/Work/wasm-micro-runtime/core/iwasm/common/../interpreter/wasm_runtime.h:9:
> /home/huang/Work/wasm-micro-runtime/core/iwasm/interpreter/wasm.h:573:53: warning: unused parameter 'type_count' [-Wunused-parameter]
> wasm_get_smallest_type_idx(WASMType **types, uint32 type_count,
>                                                     ^
> 1 warning generated.
> ```
> 
> It can be fixed simply by -Wno-unused-parameter, but should we fix it by `UNUSED(xxx)` manually ?

It would be great to fix these warnings, but it really takes efforts.
2022-02-23 11:21:14 +08:00
Huang QiandGitHub c2d041ce94 Improve riscv target option compatibility for NuttX (#987)
Improve riscv target option compatibility for NuttX

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: I100793e0f00e7e4929e295c4bb1ef1ec21d83fe9
2022-01-28 09:13:41 +08:00
Huang QiandGitHub 2c743dbd51 Add log info for heap and stack like wasm loader in aot loader (#968)
Add log info for heap and stack like wasm loader in aot loader

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: I349848d75f1a26cde29217c14cfb6e779c976a8b
2022-01-19 08:55:59 +08:00
Huang QiandGitHub e0511fe822 Correct stack base calculation on Mac and NuttX (#963)
The return address of pthread_get_stackaddr_np() in MacOS and NuttX
may be the base address or the end (boundary) address of the native stack,
if it is the end address, we get the base address according to it and the
stack size, so as to get the actual stack boundary address correctly.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-01-17 20:45:55 +08:00
Huang QiandGitHub 9d2576d8e0 Wrap data width according to atomic opcode specified (#936)
Wrap data width according to atomic opcode specified

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-01-06 11:43:34 +08:00
Huang QiandGitHub 9169eff8bb Remove hardcoded stack size in thread_manager.c (#931)
Remove hardcoded stack size in thread_manager.c

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-01-05 13:16:25 +08:00
Huang QiandGitHub 4cc4625a2b Cleanup output format warnings (#904)
Use `PRIxxx` related macros to format the output strings so as to clear
compile warnings, e.g. PRIu32, PRId32, PRIX32, PRIX64 and so on.
And add the related macro definitions in platform_common.h if they
are not defined, as some compilers might not support them.
2021-12-20 15:51:36 +08:00
Huang QiandGitHub a41c1ad85c Don't use constant float table on arm and riscv (#903)
Don't use constant float table on arm and riscv as LLVM doesn't generate
.LPCI/.rodata like relocations on them, the float/double constants are encoded
into instructions directly, so no need to lookup them from constant table.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-12-20 11:10:52 +08:00
Huang QiandGitHub 915b26b0ec Remove hardcoded stack size while creating pthread (#881)
Use original module instance's default_wasm_stack_size instead,
which is the stack size used to instantiate it.
2021-12-10 15:11:45 +08:00
Huang QiandGitHub 208cafc776 Add new E_TYPE_XIP to indicate XIP mode (#874)
Emit e_type = E_TYPE_XIP in target info section to indicate that it is
an XIP file, and replace related checks in aot loader.
2021-12-08 18:43:08 +08:00
Huang QiandGitHub c8fe1004aa Don't throw exception while module_malloc failed (#860)
Don't throw exception when module_malloc memory failed:
- Exception will terminate the wasm app, it's not necessary since app can
  check the result of dynamic allocation and do some cleanup or fallback
  operation on failure instead of 'crash' directly.
- In acquire_wait_info, call hasn_map_find only when the address isn't NULL,
  or there are many senseless error logs
2021-12-03 17:00:18 +08:00
Huang QiandGitHub 8d1c56bda4 Implement atomic and memset/memmove/memcpy intrinsic for riscv (#841)
- Lower aotmic instruction to non-atomic form on some platforms
- Lower memset/memmove/memcpy for XIP
- Disable rtti in cmake
2021-11-30 17:10:14 +08:00
Huang QiandGitHub 0af7522e3e Fix fail to get builtin functions in indirect call (XIP) mode (#829)
Fix fail to get builtin functions in indirect call (XIP) mode, e.g.
function aot_alloc_frame, aot_memory_init, aot_table_init and so on.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-11-11 14:14:21 +08:00
Huang QiandGitHub 3fa91df754 Simplify some string size calculation when emitting AOT file (#813)
Simplify some string size calculation when emitting AOT file

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-11-01 20:03:13 +08:00
Huang QiandGitHub 51a00a4c2b Disable source debugging by default (#804)
For cmake based project, there are default values in .cmake,
but for other build system, may these symbols were not defined in their
build system and warnings (XXX is not defined) were generated while building.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-10-26 18:52:30 +08:00
Huang QiandGitHub a121e45a1e Simplify build setup for zephyr (#789)
Zephyr can apply board specific .conf and .overlay automatically,
move .conf to boards to make it easy to support different board without
addition command parameters.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-10-15 20:15:17 +08:00
Huang Qi b31804b64e Apply aot intrinsics to riscv
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: If1e813f5f8ead2c0d9b640f8ea4e87e2155db534
2021-09-09 07:59:12 +00:00
Huang QiandGitHub 3953f819bc Use builtin intrinsic for float/integer conversion (#719) 2021-09-02 18:19:19 +08:00
Huang QiandGitHub cef7d35be1 Implement float and integer conversion intrinsics (#718) 2021-09-02 16:39:53 +08:00
Huang QiandGitHub bb0e4503cb Move type definition of IntCond and FloatCond to aot.h (#713) 2021-09-02 12:49:01 +08:00
Huang QiandGitHub 1687b7be32 Add missing symbols from libgcc for thumb platform (#712)
Add missing aot relocation symbols from libgcc for thumb platform

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-09-01 18:26:03 +08:00
Huang QiandGitHub 5d2882f05f Make aot intrinsic flags readable (#711)
Make aot intrinsic flags easier to read and understand

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-09-01 18:24:16 +08:00
Huang QiandGitHub 6ef74778c7 Correct confusing usage of intirnsic check (#707) 2021-08-27 19:03:18 +08:00
Huang QiandGitHub 6a7fd3e688 Make sp 8 byte aligned in invokeNative on ARM (#697)
Make sp 8 byte aligned in invokeNative assembly on ARM.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-08-18 10:21:38 +08:00
Huang QiandGitHub 8fd89bd415 Implement clock() wrapper for built-in libc (#691) 2021-08-07 21:21:25 +08:00
Huang QiandGitHub 62fb3c9a89 Unify product-mini main.c implementation for POSIX compatible system (#675)
Unify product-mini main.c implementation for POSIX compatible system: create a shared main.c under platforms/posix/main.c, and in other POSIX platforms' main.c, just keep a line "#include ../posix/main.c".

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-07-29 14:38:25 +08:00
Huang QiandGitHub 586752735b Enable to build wamrc with custom llvm and fix some compile warnings (#672)
Enable to build wamrc with custom llvm, enable to auto detect processor on apple silicon, and fix some compile warnings.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-07-26 09:29:19 +08:00
Huang QiandGitHub 04e7afe55d Update documents (#669)
Update CI rules to improve CI build speed, update document about arch support and update document of wamrc help.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-07-22 13:52:48 +08:00
e4023c8e02 Implement AOT support for RISCV (#649)
Enable RISCV AOT support, the supported ABIs are LP64 and LP64D for riscv64, ILP32 and ILP32D for riscv32.
For wamrc:
    use --target=riscv64/riscv32 to specify the target arch of output AOT file,
    use --target-abi=lp64d/lp64/ilp32d/ilp32 to specify the target ABI,
    if --target-abi isn't specified, by default lp64d is used for riscv64, and ilp32d is used for riscv32.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Co-authored-by: wenyongh <wenyong.huang@intel.com>
2021-07-22 11:16:47 +08:00