Skip to content

Commit

Permalink
Update Wasm source
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Feb 10, 2025
1 parent 8483533 commit d0f7475
Showing 1 changed file with 71 additions and 71 deletions.
142 changes: 71 additions & 71 deletions wasm.wat
Original file line number Diff line number Diff line change
Expand Up @@ -7,206 +7,206 @@
(export "get_high" (func $get_high))
(global $high (mut i32) (i32.const 0))
(func $get_high (result i32)
(get_global $high)
(global.get $high)
)
(func $mul (param $xl i32) (param $xh i32) (param $yl i32) (param $yh i32) (result i32)
(local $result i64)
(set_local $result
(local.set $result
(i64.mul
(i64.or
(i64.extend_u/i32
(get_local $xl)
(i64.extend_i32_u
(local.get $xl)
)
(i64.shl
(i64.extend_u/i32
(get_local $xh)
(i64.extend_i32_u
(local.get $xh)
)
(i64.const 32)
)
)
(i64.or
(i64.extend_u/i32
(get_local $yl)
(i64.extend_i32_u
(local.get $yl)
)
(i64.shl
(i64.extend_u/i32
(get_local $yh)
(i64.extend_i32_u
(local.get $yh)
)
(i64.const 32)
)
)
)
)
(set_global $high
(i32.wrap/i64
(global.set $high
(i32.wrap_i64
(i64.shr_s
(get_local $result)
(local.get $result)
(i64.const 32)
)
)
)
(i32.wrap/i64
(get_local $result)
(i32.wrap_i64
(local.get $result)
)
)
(func $div_s (param $xl i32) (param $xh i32) (param $yl i32) (param $yh i32) (result i32)
(local $result i64)
(set_local $result
(local.set $result
(i64.div_s
(i64.or
(i64.extend_u/i32
(get_local $xl)
(i64.extend_i32_u
(local.get $xl)
)
(i64.shl
(i64.extend_u/i32
(get_local $xh)
(i64.extend_i32_u
(local.get $xh)
)
(i64.const 32)
)
)
(i64.or
(i64.extend_u/i32
(get_local $yl)
(i64.extend_i32_u
(local.get $yl)
)
(i64.shl
(i64.extend_u/i32
(get_local $yh)
(i64.extend_i32_u
(local.get $yh)
)
(i64.const 32)
)
)
)
)
(set_global $high
(i32.wrap/i64
(global.set $high
(i32.wrap_i64
(i64.shr_s
(get_local $result)
(local.get $result)
(i64.const 32)
)
)
)
(i32.wrap/i64
(get_local $result)
(i32.wrap_i64
(local.get $result)
)
)
(func $div_u (param $xl i32) (param $xh i32) (param $yl i32) (param $yh i32) (result i32)
(local $result i64)
(set_local $result
(local.set $result
(i64.div_u
(i64.or
(i64.extend_u/i32
(get_local $xl)
(i64.extend_i32_u
(local.get $xl)
)
(i64.shl
(i64.extend_u/i32
(get_local $xh)
(i64.extend_i32_u
(local.get $xh)
)
(i64.const 32)
)
)
(i64.or
(i64.extend_u/i32
(get_local $yl)
(i64.extend_i32_u
(local.get $yl)
)
(i64.shl
(i64.extend_u/i32
(get_local $yh)
(i64.extend_i32_u
(local.get $yh)
)
(i64.const 32)
)
)
)
)
(set_global $high
(i32.wrap/i64
(global.set $high
(i32.wrap_i64
(i64.shr_s
(get_local $result)
(local.get $result)
(i64.const 32)
)
)
)
(i32.wrap/i64
(get_local $result)
(i32.wrap_i64
(local.get $result)
)
)
(func $rem_s (param $xl i32) (param $xh i32) (param $yl i32) (param $yh i32) (result i32)
(local $result i64)
(set_local $result
(local.set $result
(i64.rem_s
(i64.or
(i64.extend_u/i32
(get_local $xl)
(i64.extend_i32_u
(local.get $xl)
)
(i64.shl
(i64.extend_u/i32
(get_local $xh)
(i64.extend_i32_u
(local.get $xh)
)
(i64.const 32)
)
)
(i64.or
(i64.extend_u/i32
(get_local $yl)
(i64.extend_i32_u
(local.get $yl)
)
(i64.shl
(i64.extend_u/i32
(get_local $yh)
(i64.extend_i32_u
(local.get $yh)
)
(i64.const 32)
)
)
)
)
(set_global $high
(i32.wrap/i64
(global.set $high
(i32.wrap_i64
(i64.shr_s
(get_local $result)
(local.get $result)
(i64.const 32)
)
)
)
(i32.wrap/i64
(get_local $result)
(i32.wrap_i64
(local.get $result)
)
)
(func $rem_u (param $xl i32) (param $xh i32) (param $yl i32) (param $yh i32) (result i32)
(local $result i64)
(set_local $result
(local.set $result
(i64.rem_u
(i64.or
(i64.extend_u/i32
(get_local $xl)
(i64.extend_i32_u
(local.get $xl)
)
(i64.shl
(i64.extend_u/i32
(get_local $xh)
(i64.extend_i32_u
(local.get $xh)
)
(i64.const 32)
)
)
(i64.or
(i64.extend_u/i32
(get_local $yl)
(i64.extend_i32_u
(local.get $yl)
)
(i64.shl
(i64.extend_u/i32
(get_local $yh)
(i64.extend_i32_u
(local.get $yh)
)
(i64.const 32)
)
)
)
)
(set_global $high
(i32.wrap/i64
(global.set $high
(i32.wrap_i64
(i64.shr_s
(get_local $result)
(local.get $result)
(i64.const 32)
)
)
)
(i32.wrap/i64
(get_local $result)
(i32.wrap_i64
(local.get $result)
)
)
)
Expand Down

0 comments on commit d0f7475

Please sign in to comment.