Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
929ff46
1. WASM: Support declaring and exporting memory
ubaidsk Feb 9, 2023
e46b457
WASM: Make memory max_no_of_pages condition clearer
ubaidsk Feb 9, 2023
0063666
WASM: WASI: Support printing integers and floats
ubaidsk Feb 9, 2023
1039bb7
WASI: Support WASI in JSGlue and integration_tests/CMakeLists.txt
ubaidsk Feb 9, 2023
3f50060
WASMDecoder: Support memory section
ubaidsk Feb 7, 2023
778c8d8
WAT: WASI: Support escaping characters in data segments
ubaidsk Feb 9, 2023
65afdc7
WASM_X64: Initial support towards WASI
ubaidsk Feb 7, 2023
9f157a3
WASM_X64: Support required I64/F64 instructions
ubaidsk Feb 9, 2023
53481d2
WASM_X64: Support i64 as var_type in local get, set
ubaidsk Feb 9, 2023
aa57b96
WASM_X64: Fix indexing in exports and call_label()
ubaidsk Feb 9, 2023
d17a5c4
WASM_X64: Fix segmentation faults
ubaidsk Feb 9, 2023
464620e
WASM_X64: Fix memory access for call to fd_write()
ubaidsk Feb 9, 2023
82d6765
WASM_X64: Rename master_string to base_memory
ubaidsk Feb 9, 2023
ffb77fe
WASM: Optimize instructions, add locals comments
ubaidsk Feb 9, 2023
f753dcb
WASM_X64: Minor improvements
ubaidsk Feb 9, 2023
7b9e68c
WASM_X64: Fix floating-point exception (core dumped) error
ubaidsk Feb 9, 2023
84b6d8a
TEST: Add and Enable tests for array and print
ubaidsk Feb 9, 2023
a1ebae8
WASM_X64: Refactor: Replace magic number with NO_OF_IMPORTS
ubaidsk Feb 9, 2023
295602a
Refactor: Remove unused commented code
ubaidsk Feb 9, 2023
87df57c
TEST: WASM: Update reference tests
ubaidsk Feb 9, 2023
328a844
WASM_X86: Add improvements to make it similar to WASM_X64
ubaidsk Feb 10, 2023
86242e5
WASM_X86,X64: Replace CodeGenError() with AssemblerError()
ubaidsk Feb 10, 2023
9d2751a
WASM_X86: Implement support for WASI
ubaidsk Feb 10, 2023
a26a71f
CTEST: X86: Fix failing test due to missing 'string_neg' symbol
ubaidsk Feb 10, 2023
84782a3
TEST: Slightly modify test to support it in wasm_x86
ubaidsk Feb 10, 2023
46a0788
X86: Fix missing 'string_neg' symbol
ubaidsk Feb 10, 2023
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
5 changes: 4 additions & 1 deletion integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ macro(RUN)
message(STATUS "${WASM_EXEC_RUNTIME} version: ${WASM_EXEC_VERSION}")
set(WASM_EXEC_FLAGS "--experimental-wasm-bigint")
endif()

set(WASM_EXEC_FLAGS ${WASM_EXEC_FLAGS} "--experimental-wasi-unstable-preview1")
add_test(${name} ${WASM_EXEC_RUNTIME} ${WASM_EXEC_FLAGS} ${CMAKE_CURRENT_BINARY_DIR}/${name}.js)
if (RUN_LABELS)
set_tests_properties(${name} PROPERTIES LABELS "${RUN_LABELS}")
Expand All @@ -212,6 +212,8 @@ RUN(NAME variable_decl_01 LABELS cpython llvm c)
RUN(NAME variable_decl_02 LABELS cpython llvm c)
RUN(NAME array_expr_01 LABELS cpython llvm)
RUN(NAME array_expr_02 LABELS cpython llvm)
RUN(NAME array_01 LABELS cpython llvm wasm)
RUN(NAME array_02 LABELS cpython wasm)
RUN(NAME bindc_01 LABELS cpython llvm c)
RUN(NAME bindc_02 LABELS cpython llvm c)
RUN(NAME bindc_04 LABELS llvm c)
Expand All @@ -226,6 +228,7 @@ RUN(NAME exit_02c FAIL LABELS cpython llvm c)
RUN(NAME print_01 LABELS cpython llvm c wasm) # wasm not yet supports sep and end keywords
RUN(NAME print_03 LABELS x86 c wasm wasm_x86 wasm_x64) # simple test case specifically for x86, wasm_x86 and wasm_x64
RUN(NAME print_04 LABELS cpython llvm c)
RUN(NAME print_05 LABELS cpython llvm wasm wasm_x64)
RUN(NAME print_float LABELS cpython llvm wasm wasm_x64)
RUN(NAME print_list_tuple LABELS cpython c) # TODO: llvm doesn't completely support printing list

Expand Down
17 changes: 17 additions & 0 deletions integration_tests/array_01.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from ltypes import i32
from numpy import empty

def main0():
Nx: i32 = 600; Ny: i32 = 450
arr: i32[450, 600] = empty([Ny, Nx])
i: i32
j: i32
for i in range(Ny):
for j in range(Nx):
arr[i, j] = i * j

for i in range(Ny):
for j in range(Nx):
print(i, j, int(arr[i, j]))

main0()
23 changes: 23 additions & 0 deletions integration_tests/array_02.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from ltypes import i32
from numpy import empty

def main0():
Nx: i32 = 60; Ny: i32 = 45; Nz: i32 = 20
arr: i32[45, 60, 20] = empty([Ny, Nx, Nz])
i: i32
j: i32
k: i32
for i in range(Ny):
for j in range(Nx):
for k in range(Nz):
arr[i, j, k] = i * j + k
if k & 1:
arr[i, j, k] = -arr[i, j, k]


for i in range(Ny):
for j in range(Nx):
for k in range(Nz):
print(i, j, k, int(arr[i, j, k]))

main0()
3 changes: 2 additions & 1 deletion integration_tests/print_03.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ def Main0():
x = (2+3)* (-5)
y: i32 = 100
z: i32 = 2147483647
w: i32 = -2147483648
# w: i32 = -2147483648 # ultimately we should support printing this
w: i32 = -2147483647
print(x)
print(y)
print(z)
Expand Down
16 changes: 16 additions & 0 deletions integration_tests/print_05.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
def main0():
print("hi", "1234", "jldakfjs!jdlkasf#9u843*)(")
print("abcdefgh1234")
print(-1234)
print(6579352, -123, "hi", 45897, "bye", 0, -1, 1, -10, 10, "done.")
print("hello")
print(2, -2, 10, -10, 1000, -10000)

print(3.14)
print(-1000.100)
print(-1000.001)
print("abcdefgh1234")
print(0, 0.0, "abcd", -0, "efghijk", -0.0, "1^3", -1.0, "pqrswxyz", 1.0, "mno", 2.0, "p", -5.1, -5, "zz")
print("pi =", 3.14)

main0()
Loading