Browse Source
* winch(arm64): float_copysign Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com> * Add doc comments Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com> --------- Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>pull/8559/head
Edoardo Vacchi
6 months ago
committed by
GitHub
8 changed files with 286 additions and 3 deletions
@ -0,0 +1,32 @@ |
|||
;;! target = "aarch64" |
|||
;;! test = "winch" |
|||
|
|||
(module |
|||
(func (result f32) |
|||
(f32.const -1.1) |
|||
(f32.const 2.2) |
|||
(f32.copysign) |
|||
) |
|||
) |
|||
;; wasm[0]::function[0]: |
|||
;; stp x29, x30, [sp, #-0x10]! |
|||
;; mov x29, sp |
|||
;; mov x28, sp |
|||
;; mov x9, x0 |
|||
;; sub sp, sp, #0x10 |
|||
;; mov x28, sp |
|||
;; stur x0, [x28, #8] |
|||
;; stur x1, [x28] |
|||
;; mov w16, #0xcccd |
|||
;; movk w16, #0x400c, lsl #16 |
|||
;; fmov s0, w16 |
|||
;; mov w16, #0xcccd |
|||
;; movk w16, #0xbf8c, lsl #16 |
|||
;; fmov s1, w16 |
|||
;; ushr v0.2s, v0.2s, #0x1f |
|||
;; sli v1.2s, v0.2s, #0x1f |
|||
;; fmov s0, s1 |
|||
;; add sp, sp, #0x10 |
|||
;; mov x28, sp |
|||
;; ldp x29, x30, [sp], #0x10 |
|||
;; ret |
@ -0,0 +1,47 @@ |
|||
;;! target = "aarch64" |
|||
;;! test = "winch" |
|||
|
|||
(module |
|||
(func (result f32) |
|||
(local $foo f32) |
|||
(local $bar f32) |
|||
|
|||
(f32.const -1.1) |
|||
(local.set $foo) |
|||
|
|||
(f32.const 2.2) |
|||
(local.set $bar) |
|||
|
|||
(local.get $foo) |
|||
(local.get $bar) |
|||
f32.copysign |
|||
) |
|||
) |
|||
;; wasm[0]::function[0]: |
|||
;; stp x29, x30, [sp, #-0x10]! |
|||
;; mov x29, sp |
|||
;; mov x28, sp |
|||
;; mov x9, x0 |
|||
;; sub sp, sp, #0x18 |
|||
;; mov x28, sp |
|||
;; stur x0, [x28, #0x10] |
|||
;; stur x1, [x28, #8] |
|||
;; mov x16, #0 |
|||
;; stur x16, [x28] |
|||
;; mov w16, #0xcccd |
|||
;; movk w16, #0xbf8c, lsl #16 |
|||
;; fmov s0, w16 |
|||
;; stur w0, [x28, #4] |
|||
;; mov w16, #0xcccd |
|||
;; movk w16, #0x400c, lsl #16 |
|||
;; fmov s0, w16 |
|||
;; stur w0, [x28] |
|||
;; ldur w0, [x28] |
|||
;; ldur w1, [x28, #4] |
|||
;; ushr v0.2s, v0.2s, #0x1f |
|||
;; sli v1.2s, v0.2s, #0x1f |
|||
;; fmov s0, s1 |
|||
;; add sp, sp, #0x18 |
|||
;; mov x28, sp |
|||
;; ldp x29, x30, [sp], #0x10 |
|||
;; ret |
@ -0,0 +1,30 @@ |
|||
;;! target = "aarch64" |
|||
;;! test = "winch" |
|||
|
|||
(module |
|||
(func (param f32) (param f32) (result f32) |
|||
(local.get 0) |
|||
(local.get 1) |
|||
(f32.copysign) |
|||
) |
|||
) |
|||
;; wasm[0]::function[0]: |
|||
;; stp x29, x30, [sp, #-0x10]! |
|||
;; mov x29, sp |
|||
;; mov x28, sp |
|||
;; mov x9, x0 |
|||
;; sub sp, sp, #0x18 |
|||
;; 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] |
|||
;; ushr v0.2s, v0.2s, #0x1f |
|||
;; sli v1.2s, v0.2s, #0x1f |
|||
;; fmov s0, s1 |
|||
;; add sp, sp, #0x18 |
|||
;; mov x28, sp |
|||
;; ldp x29, x30, [sp], #0x10 |
|||
;; ret |
@ -0,0 +1,36 @@ |
|||
;;! target = "aarch64" |
|||
;;! test = "winch" |
|||
|
|||
(module |
|||
(func (result f64) |
|||
(f64.const -1.1) |
|||
(f64.const 2.2) |
|||
(f64.copysign) |
|||
) |
|||
) |
|||
;; wasm[0]::function[0]: |
|||
;; stp x29, x30, [sp, #-0x10]! |
|||
;; mov x29, sp |
|||
;; mov x28, sp |
|||
;; mov x9, x0 |
|||
;; sub sp, sp, #0x10 |
|||
;; mov x28, sp |
|||
;; stur x0, [x28, #8] |
|||
;; stur x1, [x28] |
|||
;; mov x16, #0x999a |
|||
;; movk x16, #0x9999, lsl #16 |
|||
;; movk x16, #0x9999, lsl #32 |
|||
;; movk x16, #0x4001, lsl #48 |
|||
;; fmov d0, x16 |
|||
;; mov x16, #0x999a |
|||
;; movk x16, #0x9999, lsl #16 |
|||
;; movk x16, #0x9999, lsl #32 |
|||
;; movk x16, #0xbff1, lsl #48 |
|||
;; fmov d1, x16 |
|||
;; ushr d0, d0, #0x3f |
|||
;; sli d1, d0, #0x3f |
|||
;; fmov d0, d1 |
|||
;; add sp, sp, #0x10 |
|||
;; mov x28, sp |
|||
;; ldp x29, x30, [sp], #0x10 |
|||
;; ret |
@ -0,0 +1,52 @@ |
|||
;;! target = "aarch64" |
|||
;;! test = "winch" |
|||
|
|||
(module |
|||
(func (result f64) |
|||
(local $foo f64) |
|||
(local $bar f64) |
|||
|
|||
(f64.const -1.1) |
|||
(local.set $foo) |
|||
|
|||
(f64.const 2.2) |
|||
(local.set $bar) |
|||
|
|||
(local.get $foo) |
|||
(local.get $bar) |
|||
f64.copysign |
|||
) |
|||
) |
|||
;; wasm[0]::function[0]: |
|||
;; stp x29, x30, [sp, #-0x10]! |
|||
;; mov x29, sp |
|||
;; mov x28, sp |
|||
;; mov x9, x0 |
|||
;; sub sp, sp, #0x20 |
|||
;; mov x28, sp |
|||
;; stur x0, [x28, #0x18] |
|||
;; stur x1, [x28, #0x10] |
|||
;; mov x16, #0 |
|||
;; stur x16, [x28, #8] |
|||
;; stur x16, [x28] |
|||
;; mov x16, #0x999a |
|||
;; movk x16, #0x9999, lsl #16 |
|||
;; movk x16, #0x9999, lsl #32 |
|||
;; movk x16, #0xbff1, lsl #48 |
|||
;; fmov d0, x16 |
|||
;; stur x0, [x28, #8] |
|||
;; mov x16, #0x999a |
|||
;; movk x16, #0x9999, lsl #16 |
|||
;; movk x16, #0x9999, lsl #32 |
|||
;; movk x16, #0x4001, lsl #48 |
|||
;; fmov d0, x16 |
|||
;; stur x0, [x28] |
|||
;; ldur x0, [x28] |
|||
;; ldur x1, [x28, #8] |
|||
;; ushr d0, d0, #0x3f |
|||
;; sli d1, d0, #0x3f |
|||
;; fmov d0, d1 |
|||
;; add sp, sp, #0x20 |
|||
;; mov x28, sp |
|||
;; ldp x29, x30, [sp], #0x10 |
|||
;; ret |
@ -0,0 +1,30 @@ |
|||
;;! target = "aarch64" |
|||
;;! test = "winch" |
|||
|
|||
(module |
|||
(func (param f64) (param f64) (result f64) |
|||
(local.get 0) |
|||
(local.get 1) |
|||
(f64.copysign) |
|||
) |
|||
) |
|||
;; wasm[0]::function[0]: |
|||
;; stp x29, x30, [sp, #-0x10]! |
|||
;; mov x29, sp |
|||
;; mov x28, sp |
|||
;; mov x9, x0 |
|||
;; sub sp, sp, #0x20 |
|||
;; mov x28, sp |
|||
;; stur x0, [x28, #0x18] |
|||
;; stur x1, [x28, #0x10] |
|||
;; stur x0, [x28, #8] |
|||
;; stur x1, [x28] |
|||
;; ldur x0, [x28] |
|||
;; ldur x1, [x28, #8] |
|||
;; ushr d0, d0, #0x3f |
|||
;; sli d1, d0, #0x3f |
|||
;; fmov d0, d1 |
|||
;; add sp, sp, #0x20 |
|||
;; mov x28, sp |
|||
;; ldp x29, x30, [sp], #0x10 |
|||
;; ret |
Loading…
Reference in new issue