Skip to content

Commit

Permalink
Winch aarch64 memory load & store (#9092)
Browse files Browse the repository at this point in the history
* winch aarch64 wasm load

* winch aarch64 wasm store

* winch aarch64 fix float tests

* winch aarch64 load tests & load_ptr

* winch aarch64 store tests

* winch aarch64 split ldr into uload & sload
  • Loading branch information
vulc41n authored Aug 13, 2024
1 parent ccf8e40 commit f7bcb46
Show file tree
Hide file tree
Showing 76 changed files with 555 additions and 257 deletions.
4 changes: 2 additions & 2 deletions tests/disas/winch/aarch64/f32_abs/f32_abs_param.wat
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
;; mov x28, sp
;; stur x0, [x28, #0x10]
;; stur x1, [x28, #8]
;; stur w0, [x28, #4]
;; ldur w0, [x28, #4]
;; stur s0, [x28, #4]
;; ldur s0, [x28, #4]
;; fabs s0, s0
;; add sp, sp, #0x18
;; mov x28, sp
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_add/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
;; mov w16, #0xcccd
;; movk w16, #0x3f8c, lsl #16
;; fmov s0, w16
;; stur w0, [x28, #4]
;; stur s0, [x28, #4]
;; mov w16, #0xcccd
;; movk w16, #0x400c, lsl #16
;; fmov s0, w16
;; stur w0, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fadd s1, s1, s0
;; fmov s0, s1
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_add/params.wat
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
;; mov x28, sp
;; stur x0, [x28, #0x10]
;; stur x1, [x28, #8]
;; stur w0, [x28, #4]
;; stur w1, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28, #4]
;; stur s1, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fadd s1, s1, s0
;; fmov s0, s1
;; add sp, sp, #0x18
Expand Down
4 changes: 2 additions & 2 deletions tests/disas/winch/aarch64/f32_ceil/f32_ceil_param.wat
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
;; mov x28, sp
;; stur x0, [x28, #0x10]
;; stur x1, [x28, #8]
;; stur w0, [x28, #4]
;; ldur w0, [x28, #4]
;; stur s0, [x28, #4]
;; ldur s0, [x28, #4]
;; frintp s0, s0
;; add sp, sp, #0x18
;; mov x28, sp
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_copysign/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
;; mov w16, #0xcccd
;; movk w16, #0xbf8c, lsl #16
;; fmov s0, w16
;; stur w0, [x28, #4]
;; stur s0, [x28, #4]
;; mov w16, #0xcccd
;; movk w16, #0x400c, lsl #16
;; fmov s0, w16
;; stur w0, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; ushr v0.2s, v0.2s, #0x1f
;; sli v1.2s, v0.2s, #0x1f
;; fmov s0, s1
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_copysign/params.wat
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
;; mov x28, sp
;; stur x0, [x28, #0x10]
;; stur x1, [x28, #8]
;; stur w0, [x28, #4]
;; stur w1, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28, #4]
;; stur s1, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; ushr v0.2s, v0.2s, #0x1f
;; sli v1.2s, v0.2s, #0x1f
;; fmov s0, s1
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_div/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
;; mov w16, #0xcccd
;; movk w16, #0x3f8c, lsl #16
;; fmov s0, w16
;; stur w0, [x28, #4]
;; stur s0, [x28, #4]
;; mov w16, #0xcccd
;; movk w16, #0x400c, lsl #16
;; fmov s0, w16
;; stur w0, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fdiv s1, s1, s0
;; fmov s0, s1
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_div/params.wat
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
;; mov x28, sp
;; stur x0, [x28, #0x10]
;; stur x1, [x28, #8]
;; stur w0, [x28, #4]
;; stur w1, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28, #4]
;; stur s1, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fdiv s1, s1, s0
;; fmov s0, s1
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_eq/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
;; stur x16, [x28]
;; mov x16, #0x40000000
;; fmov s0, w16
;; stur w0, [x28, #4]
;; stur s0, [x28, #4]
;; mov x16, #0x40400000
;; fmov s0, w16
;; stur w0, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fcmp s0, s1
;; cset x0, eq
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_eq/params.wat
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
;; mov x28, sp
;; stur x0, [x28, #0x10]
;; stur x1, [x28, #8]
;; stur w0, [x28, #4]
;; stur w1, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28, #4]
;; stur s1, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fcmp s0, s1
;; cset x0, eq
;; add sp, sp, #0x18
Expand Down
4 changes: 2 additions & 2 deletions tests/disas/winch/aarch64/f32_floor/f32_floor_param.wat
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
;; mov x28, sp
;; stur x0, [x28, #0x10]
;; stur x1, [x28, #8]
;; stur w0, [x28, #4]
;; ldur w0, [x28, #4]
;; stur s0, [x28, #4]
;; ldur s0, [x28, #4]
;; frintm s0, s0
;; add sp, sp, #0x18
;; mov x28, sp
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_ge/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
;; stur x16, [x28]
;; mov x16, #0xc0000000
;; fmov s0, w16
;; stur w0, [x28, #4]
;; stur s0, [x28, #4]
;; mov x16, #0xc0400000
;; fmov s0, w16
;; stur w0, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fcmp s0, s1
;; cset x0, ge
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_ge/params.wat
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
;; mov x28, sp
;; stur x0, [x28, #0x10]
;; stur x1, [x28, #8]
;; stur w0, [x28, #4]
;; stur w1, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28, #4]
;; stur s1, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fcmp s0, s1
;; cset x0, ge
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_gt/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
;; stur x16, [x28]
;; mov x16, #0xc0000000
;; fmov s0, w16
;; stur w0, [x28, #4]
;; stur s0, [x28, #4]
;; mov x16, #0xc0400000
;; fmov s0, w16
;; stur w0, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fcmp s0, s1
;; cset x0, gt
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_gt/params.wat
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
;; mov x28, sp
;; stur x0, [x28, #0x10]
;; stur x1, [x28, #8]
;; stur w0, [x28, #4]
;; stur w1, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28, #4]
;; stur s1, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fcmp s0, s1
;; cset x0, gt
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_le/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
;; stur x16, [x28]
;; mov x16, #0xc0000000
;; fmov s0, w16
;; stur w0, [x28, #4]
;; stur s0, [x28, #4]
;; mov x16, #0xc0400000
;; fmov s0, w16
;; stur w0, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fcmp s0, s1
;; cset x0, ls
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_le/params.wat
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
;; mov x28, sp
;; stur x0, [x28, #0x10]
;; stur x1, [x28, #8]
;; stur w0, [x28, #4]
;; stur w1, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28, #4]
;; stur s1, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fcmp s0, s1
;; cset x0, ls
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_lt/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
;; stur x16, [x28]
;; mov x16, #0xc0000000
;; fmov s0, w16
;; stur w0, [x28, #4]
;; stur s0, [x28, #4]
;; mov x16, #0xc0400000
;; fmov s0, w16
;; stur w0, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fcmp s0, s1
;; cset x0, mi
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_lt/params.wat
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
;; mov x28, sp
;; stur x0, [x28, #0x10]
;; stur x1, [x28, #8]
;; stur w0, [x28, #4]
;; stur w1, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28, #4]
;; stur s1, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fcmp s0, s1
;; cset x0, mi
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_max/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
;; mov w16, #0xcccd
;; movk w16, #0x3f8c, lsl #16
;; fmov s0, w16
;; stur w0, [x28, #4]
;; stur s0, [x28, #4]
;; mov w16, #0xcccd
;; movk w16, #0x400c, lsl #16
;; fmov s0, w16
;; stur w0, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fmax s1, s1, s0
;; fmov s0, s1
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_max/params.wat
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
;; mov x28, sp
;; stur x0, [x28, #0x10]
;; stur x1, [x28, #8]
;; stur w0, [x28, #4]
;; stur w1, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28, #4]
;; stur s1, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fmax s1, s1, s0
;; fmov s0, s1
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_min/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
;; mov w16, #0xcccd
;; movk w16, #0x3f8c, lsl #16
;; fmov s0, w16
;; stur w0, [x28, #4]
;; stur s0, [x28, #4]
;; mov w16, #0xcccd
;; movk w16, #0x400c, lsl #16
;; fmov s0, w16
;; stur w0, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fmin s1, s1, s0
;; fmov s0, s1
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_min/params.wat
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
;; mov x28, sp
;; stur x0, [x28, #0x10]
;; stur x1, [x28, #8]
;; stur w0, [x28, #4]
;; stur w1, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28, #4]
;; stur s1, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fmin s1, s1, s0
;; fmov s0, s1
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_mul/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
;; mov w16, #0xcccd
;; movk w16, #0x3f8c, lsl #16
;; fmov s0, w16
;; stur w0, [x28, #4]
;; stur s0, [x28, #4]
;; mov w16, #0xcccd
;; movk w16, #0x400c, lsl #16
;; fmov s0, w16
;; stur w0, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fmul s1, s1, s0
;; fmov s0, s1
;; add sp, sp, #0x18
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/winch/aarch64/f32_mul/params.wat
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
;; mov x28, sp
;; stur x0, [x28, #0x10]
;; stur x1, [x28, #8]
;; stur w0, [x28, #4]
;; stur w1, [x28]
;; ldur w0, [x28]
;; ldur w1, [x28, #4]
;; stur s0, [x28, #4]
;; stur s1, [x28]
;; ldur s0, [x28]
;; ldur s1, [x28, #4]
;; fmul s1, s1, s0
;; fmov s0, s1
;; add sp, sp, #0x18
Expand Down
Loading

0 comments on commit f7bcb46

Please sign in to comment.