captbaritone / eel-wasm

Compile Nullsoft's EEL code to Web Assembly
https://eel.capt.dev
48 stars 4 forks source link

How about native WebAssembly Math!!?? #57

Closed pouyakary closed 2 years ago

pouyakary commented 2 years ago

These past few days I was tasked with making a new programming language and I it needed to be really fast. so you can read my mind here. One thing I instantly realized was the lack of native math in the WebAssembly which is a huge bottleneck. So as you do it here by providing external JS Math Lib, it can work but it still needs to call JS.

I was thinking... And then did something... I created a very simple rust program:

fn main() {
    let x: f64 = 2.0;
    println!("{}", x.sin());
}

And compiled it to WebAssembly with all the code cleanup flags. Then I used the wasm2wat from the wabt and searched for the beautiful f64 sin. Here it is!

        (global $RUST_SIN_GLOBAL (mut i32) (i32.const 1048576))

        (func $scalbn (param f64 i32) (result f64)
            block  ;; label = @1
            block  ;; label = @2
                local.get 1
                i32.const 1024
                i32.lt_s
                br_if 0 (;@2;)
                local.get 0
                f64.const 0x1p+1023 (;=8.98847e+307;)
                f64.mul
                local.set 0
                block  ;; label = @3
                local.get 1
                i32.const 2047
                i32.ge_s
                br_if 0 (;@3;)
                local.get 1
                i32.const -1023
                i32.add
                local.set 1
                br 2 (;@1;)
                end
                local.get 0
                f64.const 0x1p+1023 (;=8.98847e+307;)
                f64.mul
                local.set 0
                local.get 1
                i32.const 3069
                local.get 1
                i32.const 3069
                i32.lt_s
                select
                i32.const -2046
                i32.add
                local.set 1
                br 1 (;@1;)
            end
            local.get 1
            i32.const -1023
            i32.gt_s
            br_if 0 (;@1;)
            local.get 0
            f64.const 0x1p-969 (;=2.00417e-292;)
            f64.mul
            local.set 0
            block  ;; label = @2
                local.get 1
                i32.const -1992
                i32.le_s
                br_if 0 (;@2;)
                local.get 1
                i32.const 969
                i32.add
                local.set 1
                br 1 (;@1;)
            end
            local.get 0
            f64.const 0x1p-969 (;=2.00417e-292;)
            f64.mul
            local.set 0
            local.get 1
            i32.const -2960
            local.get 1
            i32.const -2960
            i32.gt_s
            select
            i32.const 1938
            i32.add
            local.set 1
            end
            local.get 0
            local.get 1
            i32.const 1023
            i32.add
            i64.extend_i32_u
            i64.const 52
            i64.shl
            f64.reinterpret_i64
            f64.mul)

        (func $__rem_pio2 (param f64 i32) (result i32)
            (local i32 i64 i32 i32 f64 f64 f64 i32 f64)
            global.get 0
            i32.const 48
            i32.sub
            local.tee 2
            global.set $RUST_SIN_GLOBAL
            block  ;; label = @1
            block  ;; label = @2
                block  ;; label = @3
                block  ;; label = @4
                    local.get 0
                    i64.reinterpret_f64
                    local.tee 3
                    i64.const 32
                    i64.shr_u
                    i32.wrap_i64
                    local.tee 4
                    i32.const 2147483647
                    i32.and
                    local.tee 5
                    i32.const 1074752122
                    i32.gt_u
                    br_if 0 (;@4;)
                    local.get 4
                    i32.const 1048575
                    i32.and
                    i32.const 598523
                    i32.eq
                    br_if 1 (;@3;)
                    block  ;; label = @5
                    local.get 5
                    i32.const 1073928572
                    i32.gt_u
                    br_if 0 (;@5;)
                    block  ;; label = @6
                        local.get 3
                        i64.const 0
                        i64.lt_s
                        br_if 0 (;@6;)
                        local.get 1
                        local.get 0
                        f64.const -0x1.921fb544p+0 (;=-1.5708;)
                        f64.add
                        local.tee 0
                        f64.const -0x1.0b4611a626331p-34 (;=-6.0771e-11;)
                        f64.add
                        local.tee 6
                        f64.store
                        local.get 1
                        local.get 0
                        local.get 6
                        f64.sub
                        f64.const -0x1.0b4611a626331p-34 (;=-6.0771e-11;)
                        f64.add
                        f64.store offset=8
                        i32.const 1
                        local.set 4
                        br 5 (;@1;)
                    end
                    local.get 1
                    local.get 0
                    f64.const 0x1.921fb544p+0 (;=1.5708;)
                    f64.add
                    local.tee 0
                    f64.const 0x1.0b4611a626331p-34 (;=6.0771e-11;)
                    f64.add
                    local.tee 6
                    f64.store
                    local.get 1
                    local.get 0
                    local.get 6
                    f64.sub
                    f64.const 0x1.0b4611a626331p-34 (;=6.0771e-11;)
                    f64.add
                    f64.store offset=8
                    i32.const -1
                    local.set 4
                    br 4 (;@1;)
                    end
                    block  ;; label = @5
                    local.get 3
                    i64.const 0
                    i64.lt_s
                    br_if 0 (;@5;)
                    local.get 1
                    local.get 0
                    f64.const -0x1.921fb544p+1 (;=-3.14159;)
                    f64.add
                    local.tee 0
                    f64.const -0x1.0b4611a626331p-33 (;=-1.21542e-10;)
                    f64.add
                    local.tee 6
                    f64.store
                    local.get 1
                    local.get 0
                    local.get 6
                    f64.sub
                    f64.const -0x1.0b4611a626331p-33 (;=-1.21542e-10;)
                    f64.add
                    f64.store offset=8
                    i32.const 2
                    local.set 4
                    br 4 (;@1;)
                    end
                    local.get 1
                    local.get 0
                    f64.const 0x1.921fb544p+1 (;=3.14159;)
                    f64.add
                    local.tee 0
                    f64.const 0x1.0b4611a626331p-33 (;=1.21542e-10;)
                    f64.add
                    local.tee 6
                    f64.store
                    local.get 1
                    local.get 0
                    local.get 6
                    f64.sub
                    f64.const 0x1.0b4611a626331p-33 (;=1.21542e-10;)
                    f64.add
                    f64.store offset=8
                    i32.const -2
                    local.set 4
                    br 3 (;@1;)
                end
                block  ;; label = @4
                    local.get 5
                    i32.const 1075594811
                    i32.gt_u
                    br_if 0 (;@4;)
                    block  ;; label = @5
                    local.get 5
                    i32.const 1075183036
                    i32.gt_u
                    br_if 0 (;@5;)
                    local.get 5
                    i32.const 1074977148
                    i32.eq
                    br_if 2 (;@3;)
                    block  ;; label = @6
                        local.get 3
                        i64.const 0
                        i64.lt_s
                        br_if 0 (;@6;)
                        local.get 1
                        local.get 0
                        f64.const -0x1.2d97c7f3p+2 (;=-4.71239;)
                        f64.add
                        local.tee 0
                        f64.const -0x1.90e91a79394cap-33 (;=-1.82313e-10;)
                        f64.add
                        local.tee 6
                        f64.store
                        local.get 1
                        local.get 0
                        local.get 6
                        f64.sub
                        f64.const -0x1.90e91a79394cap-33 (;=-1.82313e-10;)
                        f64.add
                        f64.store offset=8
                        i32.const 3
                        local.set 4
                        br 5 (;@1;)
                    end
                    local.get 1
                    local.get 0
                    f64.const 0x1.2d97c7f3p+2 (;=4.71239;)
                    f64.add
                    local.tee 0
                    f64.const 0x1.90e91a79394cap-33 (;=1.82313e-10;)
                    f64.add
                    local.tee 6
                    f64.store
                    local.get 1
                    local.get 0
                    local.get 6
                    f64.sub
                    f64.const 0x1.90e91a79394cap-33 (;=1.82313e-10;)
                    f64.add
                    f64.store offset=8
                    i32.const -3
                    local.set 4
                    br 4 (;@1;)
                    end
                    local.get 5
                    i32.const 1075388923
                    i32.eq
                    br_if 1 (;@3;)
                    block  ;; label = @5
                    local.get 3
                    i64.const 0
                    i64.lt_s
                    br_if 0 (;@5;)
                    local.get 1
                    local.get 0
                    f64.const -0x1.921fb544p+2 (;=-6.28319;)
                    f64.add
                    local.tee 0
                    f64.const -0x1.0b4611a626331p-32 (;=-2.43084e-10;)
                    f64.add
                    local.tee 6
                    f64.store
                    local.get 1
                    local.get 0
                    local.get 6
                    f64.sub
                    f64.const -0x1.0b4611a626331p-32 (;=-2.43084e-10;)
                    f64.add
                    f64.store offset=8
                    i32.const 4
                    local.set 4
                    br 4 (;@1;)
                    end
                    local.get 1
                    local.get 0
                    f64.const 0x1.921fb544p+2 (;=6.28319;)
                    f64.add
                    local.tee 0
                    f64.const 0x1.0b4611a626331p-32 (;=2.43084e-10;)
                    f64.add
                    local.tee 6
                    f64.store
                    local.get 1
                    local.get 0
                    local.get 6
                    f64.sub
                    f64.const 0x1.0b4611a626331p-32 (;=2.43084e-10;)
                    f64.add
                    f64.store offset=8
                    i32.const -4
                    local.set 4
                    br 3 (;@1;)
                end
                local.get 5
                i32.const 1094263290
                i32.gt_u
                br_if 1 (;@2;)
                end
                local.get 1
                local.get 0
                local.get 0
                f64.const 0x1.45f306dc9c883p-1 (;=0.63662;)
                f64.mul
                f64.const 0x1.8p+52 (;=6.7554e+15;)
                f64.add
                f64.const -0x1.8p+52 (;=-6.7554e+15;)
                f64.add
                local.tee 6
                f64.const -0x1.921fb544p+0 (;=-1.5708;)
                f64.mul
                f64.add
                local.tee 7
                local.get 6
                f64.const 0x1.0b4611a626331p-34 (;=6.0771e-11;)
                f64.mul
                local.tee 8
                f64.sub
                local.tee 0
                f64.store
                local.get 5
                i32.const 20
                i32.shr_u
                local.tee 9
                local.get 0
                i64.reinterpret_f64
                i64.const 52
                i64.shr_u
                i32.wrap_i64
                i32.const 2047
                i32.and
                i32.sub
                i32.const 17
                i32.lt_s
                local.set 5
                block  ;; label = @3
                block  ;; label = @4
                    local.get 6
                    f64.abs
                    f64.const 0x1p+31 (;=2.14748e+09;)
                    f64.lt
                    i32.eqz
                    br_if 0 (;@4;)
                    local.get 6
                    i32.trunc_f64_s
                    local.set 4
                    br 1 (;@3;)
                end
                i32.const -2147483648
                local.set 4
                end
                block  ;; label = @3
                local.get 5
                br_if 0 (;@3;)
                local.get 1
                local.get 7
                local.get 6
                f64.const 0x1.0b4611a6p-34 (;=6.0771e-11;)
                f64.mul
                local.tee 0
                f64.sub
                local.tee 10
                local.get 6
                f64.const 0x1.3198a2e037073p-69 (;=2.02227e-21;)
                f64.mul
                local.get 7
                local.get 10
                f64.sub
                local.get 0
                f64.sub
                f64.sub
                local.tee 8
                f64.sub
                local.tee 0
                f64.store
                block  ;; label = @4
                    local.get 9
                    local.get 0
                    i64.reinterpret_f64
                    i64.const 52
                    i64.shr_u
                    i32.wrap_i64
                    i32.const 2047
                    i32.and
                    i32.sub
                    i32.const 50
                    i32.ge_s
                    br_if 0 (;@4;)
                    local.get 10
                    local.set 7
                    br 1 (;@3;)
                end
                local.get 1
                local.get 10
                local.get 6
                f64.const 0x1.3198a2ep-69 (;=2.02227e-21;)
                f64.mul
                local.tee 0
                f64.sub
                local.tee 7
                local.get 6
                f64.const 0x1.b839a252049c1p-104 (;=8.47843e-32;)
                f64.mul
                local.get 10
                local.get 7
                f64.sub
                local.get 0
                f64.sub
                f64.sub
                local.tee 8
                f64.sub
                local.tee 0
                f64.store
                end
                local.get 1
                local.get 7
                local.get 0
                f64.sub
                local.get 8
                f64.sub
                f64.store offset=8
                br 1 (;@1;)
            end
            block  ;; label = @2
                local.get 5
                i32.const 2146435072
                i32.lt_u
                br_if 0 (;@2;)
                local.get 1
                local.get 0
                local.get 0
                f64.sub
                local.tee 0
                f64.store
                local.get 1
                local.get 0
                f64.store offset=8
                i32.const 0
                local.set 4
                br 1 (;@1;)
            end
            block  ;; label = @2
                block  ;; label = @3
                local.get 3
                i64.const 4503599627370495
                i64.and
                i64.const 4710765210229538816
                i64.or
                f64.reinterpret_i64
                local.tee 0
                f64.abs
                f64.const 0x1p+31 (;=2.14748e+09;)
                f64.lt
                i32.eqz
                br_if 0 (;@3;)
                local.get 0
                i32.trunc_f64_s
                local.set 4
                br 1 (;@2;)
                end
                i32.const -2147483648
                local.set 4
            end
            local.get 2
            local.get 4
            f64.convert_i32_s
            local.tee 6
            f64.store offset=16
            block  ;; label = @2
                block  ;; label = @3
                local.get 0
                local.get 6
                f64.sub
                f64.const 0x1p+24 (;=1.67772e+07;)
                f64.mul
                local.tee 0
                f64.abs
                f64.const 0x1p+31 (;=2.14748e+09;)
                f64.lt
                i32.eqz
                br_if 0 (;@3;)
                local.get 0
                i32.trunc_f64_s
                local.set 4
                br 1 (;@2;)
                end
                i32.const -2147483648
                local.set 4
            end
            local.get 2
            local.get 4
            f64.convert_i32_s
            local.tee 6
            f64.store offset=24
            local.get 2
            local.get 0
            local.get 6
            f64.sub
            f64.const 0x1p+24 (;=1.67772e+07;)
            f64.mul
            local.tee 0
            f64.store offset=32
            block  ;; label = @2
                block  ;; label = @3
                local.get 0
                f64.const 0x0p+0 (;=0;)
                f64.eq
                br_if 0 (;@3;)
                i32.const 2
                local.set 9
                br 1 (;@2;)
                end
                local.get 2
                i32.const 16
                i32.add
                i32.const 8
                i32.or
                local.set 4
                i32.const 2
                local.set 9
                loop  ;; label = @3
                local.get 9
                i32.const -1
                i32.add
                local.set 9
                local.get 4
                f64.load
                local.set 0
                local.get 4
                i32.const -8
                i32.add
                local.set 4
                local.get 0
                f64.const 0x0p+0 (;=0;)
                f64.eq
                br_if 0 (;@3;)
                end
            end
            local.get 2
            i32.const 16
            i32.add
            local.get 2
            local.get 5
            i32.const 20
            i32.shr_u
            i32.const -1046
            i32.add
            local.get 9
            i32.const 1
            i32.add
            i32.const 1
            call $__rem_pio2_large
            local.set 4
            local.get 2
            f64.load
            local.set 0
            block  ;; label = @2
                local.get 3
                i64.const -1
                i64.gt_s
                br_if 0 (;@2;)
                local.get 1
                local.get 0
                f64.neg
                f64.store
                local.get 1
                local.get 2
                f64.load offset=8
                f64.neg
                f64.store offset=8
                i32.const 0
                local.get 4
                i32.sub
                local.set 4
                br 1 (;@1;)
            end
            local.get 1
            local.get 0
            f64.store
            local.get 1
            local.get 2
            i64.load offset=8
            i64.store offset=8
            end
            local.get 2
            i32.const 48
            i32.add
            global.set $RUST_SIN_GLOBAL
            local.get 4)

        (func $__cos (param f64 f64) (result f64)
            (local f64 f64 f64)
            f64.const 0x1p+0 (;=1;)
            local.get 0
            local.get 0
            f64.mul
            local.tee 2
            f64.const 0x1p-1 (;=0.5;)
            f64.mul
            local.tee 3
            f64.sub
            local.tee 4
            f64.const 0x1p+0 (;=1;)
            local.get 4
            f64.sub
            local.get 3
            f64.sub
            local.get 2
            local.get 2
            local.get 2
            local.get 2
            f64.const 0x1.a01a019cb159p-16 (;=2.48016e-05;)
            f64.mul
            f64.const -0x1.6c16c16c15177p-10 (;=-0.00138889;)
            f64.add
            f64.mul
            f64.const 0x1.555555555554cp-5 (;=0.0416667;)
            f64.add
            f64.mul
            local.get 2
            local.get 2
            f64.mul
            local.tee 3
            local.get 3
            f64.mul
            local.get 2
            local.get 2
            f64.const -0x1.8fae9be8838d4p-37 (;=-1.13596e-11;)
            f64.mul
            f64.const 0x1.1ee9ebdb4b1c4p-29 (;=2.08757e-09;)
            f64.add
            f64.mul
            f64.const -0x1.27e4f809c52adp-22 (;=-2.75573e-07;)
            f64.add
            f64.mul
            f64.add
            f64.mul
            local.get 0
            local.get 1
            f64.mul
            f64.sub
            f64.add
            f64.add)

        (func $__rem_pio2_large (param i32 i32 i32 i32 i32) (result i32)
            (local i32 i32 i32 i32 i32 i32 i32 i32 f64 i32 i32 i32 i32 i32 i32 i32 i32 i32 f64 i32 i32 f64 f64)
            global.get $RUST_SIN_GLOBAL
            i32.const 560
            i32.sub
            local.tee 5
            global.set 0
            i32.const 0
            local.set 6
            local.get 2
            i32.const -3
            i32.add
            i32.const 24
            i32.div_s
            local.tee 7
            i32.const 0
            local.get 7
            i32.const 0
            i32.gt_s
            select
            local.tee 8
            i32.const -24
            i32.mul
            local.get 2
            i32.add
            local.set 9
            block  ;; label = @1
            local.get 4
            i32.const 2
            i32.shl
            i32.const 1065472
            i32.add
            i32.load
            local.tee 10
            local.get 3
            i32.const -1
            i32.add
            local.tee 2
            i32.add
            i32.const 0
            i32.lt_s
            br_if 0 (;@1;)
            local.get 10
            local.get 3
            i32.add
            local.set 11
            local.get 8
            local.get 2
            i32.sub
            local.set 2
            local.get 8
            local.get 3
            i32.sub
            i32.const 2
            i32.shl
            i32.const 1065492
            i32.add
            local.set 12
            local.get 5
            i32.const 320
            i32.add
            local.set 7
            loop  ;; label = @2
                block  ;; label = @3
                block  ;; label = @4
                    local.get 2
                    i32.const 0
                    i32.ge_s
                    br_if 0 (;@4;)
                    f64.const 0x0p+0 (;=0;)
                    local.set 13
                    br 1 (;@3;)
                end
                local.get 12
                i32.load
                f64.convert_i32_s
                local.set 13
                end
                local.get 7
                local.get 13
                f64.store
                local.get 7
                i32.const 8
                i32.add
                local.set 7
                local.get 12
                i32.const 4
                i32.add
                local.set 12
                local.get 2
                i32.const 1
                i32.add
                local.set 2
                local.get 11
                i32.const -1
                i32.add
                local.tee 11
                br_if 0 (;@2;)
            end
            end
            local.get 9
            i32.const -24
            i32.add
            local.set 14
            local.get 10
            i32.const 0
            local.get 10
            i32.const 0
            i32.gt_s
            select
            local.set 15
            local.get 3
            i32.const 3
            i32.shl
            local.get 5
            i32.const 320
            i32.add
            i32.add
            i32.const -8
            i32.add
            local.set 11
            local.get 3
            i32.const 1
            i32.lt_s
            local.set 16
            loop  ;; label = @1
            f64.const 0x0p+0 (;=0;)
            local.set 13
            block  ;; label = @2
                local.get 16
                br_if 0 (;@2;)
                local.get 0
                local.set 2
                local.get 3
                local.set 12
                local.get 11
                local.set 7
                loop  ;; label = @3
                local.get 13
                local.get 2
                f64.load
                local.get 7
                f64.load
                f64.mul
                f64.add
                local.set 13
                local.get 2
                i32.const 8
                i32.add
                local.set 2
                local.get 7
                i32.const -8
                i32.add
                local.set 7
                local.get 12
                i32.const -1
                i32.add
                local.tee 12
                br_if 0 (;@3;)
                end
            end
            local.get 5
            local.get 6
            i32.const 3
            i32.shl
            i32.add
            local.get 13
            f64.store
            local.get 11
            i32.const 8
            i32.add
            local.set 11
            local.get 6
            local.get 15
            i32.eq
            local.set 2
            local.get 6
            i32.const 1
            i32.add
            local.set 6
            local.get 2
            i32.eqz
            br_if 0 (;@1;)
            end
            i32.const 47
            local.get 9
            i32.sub
            local.set 17
            i32.const 48
            local.get 9
            i32.sub
            local.set 18
            local.get 10
            i32.const 2
            i32.shl
            local.get 5
            i32.const 480
            i32.add
            i32.add
            i32.const -4
            i32.add
            local.set 19
            local.get 5
            i32.const 480
            i32.add
            i32.const -4
            i32.add
            local.set 20
            local.get 5
            i32.const -8
            i32.add
            local.set 21
            local.get 9
            i32.const -25
            i32.add
            local.set 22
            local.get 10
            local.set 6
            block  ;; label = @1
            loop  ;; label = @2
                local.get 5
                local.get 6
                i32.const 3
                i32.shl
                local.tee 2
                i32.add
                f64.load
                local.set 13
                block  ;; label = @3
                local.get 6
                i32.const 1
                i32.lt_s
                local.tee 15
                br_if 0 (;@3;)
                local.get 21
                local.get 2
                i32.add
                local.set 2
                local.get 5
                i32.const 480
                i32.add
                local.set 7
                local.get 6
                local.set 12
                loop  ;; label = @4
                    block  ;; label = @5
                    block  ;; label = @6
                        local.get 13
                        f64.const 0x1p-24 (;=5.96046e-08;)
                        f64.mul
                        local.tee 23
                        f64.abs
                        f64.const 0x1p+31 (;=2.14748e+09;)
                        f64.lt
                        i32.eqz
                        br_if 0 (;@6;)
                        local.get 23
                        i32.trunc_f64_s
                        local.set 11
                        br 1 (;@5;)
                    end
                    i32.const -2147483648
                    local.set 11
                    end
                    block  ;; label = @5
                    block  ;; label = @6
                        local.get 13
                        local.get 11
                        f64.convert_i32_s
                        local.tee 23
                        f64.const -0x1p+24 (;=-1.67772e+07;)
                        f64.mul
                        f64.add
                        local.tee 13
                        f64.abs
                        f64.const 0x1p+31 (;=2.14748e+09;)
                        f64.lt
                        i32.eqz
                        br_if 0 (;@6;)
                        local.get 13
                        i32.trunc_f64_s
                        local.set 11
                        br 1 (;@5;)
                    end
                    i32.const -2147483648
                    local.set 11
                    end
                    local.get 7
                    local.get 11
                    i32.store
                    local.get 7
                    i32.const 4
                    i32.add
                    local.set 7
                    local.get 2
                    f64.load
                    local.get 23
                    f64.add
                    local.set 13
                    local.get 2
                    i32.const -8
                    i32.add
                    local.set 2
                    local.get 12
                    i32.const -1
                    i32.add
                    local.tee 12
                    br_if 0 (;@4;)
                end
                end
                block  ;; label = @3
                block  ;; label = @4
                    local.get 13
                    local.get 14
                    call $scalbn
                    local.tee 13
                    local.get 13
                    f64.const 0x1p-3 (;=0.125;)
                    f64.mul
                    f64.floor
                    f64.const -0x1p+3 (;=-8;)
                    f64.mul
                    f64.add
                    local.tee 13
                    f64.abs
                    f64.const 0x1p+31 (;=2.14748e+09;)
                    f64.lt
                    i32.eqz
                    br_if 0 (;@4;)
                    local.get 13
                    i32.trunc_f64_s
                    local.set 16
                    br 1 (;@3;)
                end
                i32.const -2147483648
                local.set 16
                end
                local.get 13
                local.get 16
                f64.convert_i32_s
                f64.sub
                local.set 13
                block  ;; label = @3
                block  ;; label = @4
                    block  ;; label = @5
                    block  ;; label = @6
                        block  ;; label = @7
                        local.get 14
                        i32.const 1
                        i32.lt_s
                        local.tee 24
                        br_if 0 (;@7;)
                        local.get 6
                        i32.const 2
                        i32.shl
                        local.get 5
                        i32.const 480
                        i32.add
                        i32.add
                        i32.const -4
                        i32.add
                        local.tee 2
                        local.get 2
                        i32.load
                        local.tee 2
                        local.get 2
                        local.get 18
                        i32.shr_s
                        local.tee 2
                        local.get 18
                        i32.shl
                        i32.sub
                        local.tee 7
                        i32.store
                        local.get 7
                        local.get 17
                        i32.shr_s
                        local.set 25
                        local.get 2
                        local.get 16
                        i32.add
                        local.set 16
                        br 1 (;@6;)
                        end
                        local.get 14
                        br_if 1 (;@5;)
                        local.get 6
                        i32.const 2
                        i32.shl
                        local.get 5
                        i32.const 480
                        i32.add
                        i32.add
                        i32.const -4
                        i32.add
                        i32.load
                        i32.const 23
                        i32.shr_s
                        local.set 25
                    end
                    local.get 25
                    i32.const 1
                    i32.lt_s
                    br_if 2 (;@3;)
                    br 1 (;@4;)
                    end
                    i32.const 2
                    local.set 25
                    local.get 13
                    f64.const 0x1p-1 (;=0.5;)
                    f64.ge
                    i32.const 1
                    i32.xor
                    i32.eqz
                    br_if 0 (;@4;)
                    i32.const 0
                    local.set 25
                    br 1 (;@3;)
                end
                block  ;; label = @4
                    block  ;; label = @5
                    local.get 15
                    i32.eqz
                    br_if 0 (;@5;)
                    i32.const 0
                    local.set 11
                    br 1 (;@4;)
                    end
                    i32.const 0
                    local.set 11
                    local.get 5
                    i32.const 480
                    i32.add
                    local.set 2
                    local.get 6
                    local.set 15
                    loop  ;; label = @5
                    local.get 2
                    i32.load
                    local.set 7
                    i32.const 16777215
                    local.set 12
                    block  ;; label = @6
                        block  ;; label = @7
                        local.get 11
                        br_if 0 (;@7;)
                        i32.const 16777216
                        local.set 12
                        local.get 7
                        br_if 0 (;@7;)
                        i32.const 0
                        local.set 11
                        br 1 (;@6;)
                        end
                        local.get 2
                        local.get 12
                        local.get 7
                        i32.sub
                        i32.store
                        i32.const 1
                        local.set 11
                    end
                    local.get 2
                    i32.const 4
                    i32.add
                    local.set 2
                    local.get 15
                    i32.const -1
                    i32.add
                    local.tee 15
                    br_if 0 (;@5;)
                    end
                end
                block  ;; label = @4
                    local.get 24
                    br_if 0 (;@4;)
                    block  ;; label = @5
                    block  ;; label = @6
                        local.get 22
                        br_table 0 (;@6;) 1 (;@5;) 2 (;@4;)
                    end
                    local.get 6
                    i32.const 2
                    i32.shl
                    local.get 5
                    i32.const 480
                    i32.add
                    i32.add
                    i32.const -4
                    i32.add
                    local.tee 2
                    local.get 2
                    i32.load
                    i32.const 8388607
                    i32.and
                    i32.store
                    br 1 (;@4;)
                    end
                    local.get 6
                    i32.const 2
                    i32.shl
                    local.get 5
                    i32.const 480
                    i32.add
                    i32.add
                    i32.const -4
                    i32.add
                    local.tee 2
                    local.get 2
                    i32.load
                    i32.const 4194303
                    i32.and
                    i32.store
                end
                local.get 16
                i32.const 1
                i32.add
                local.set 16
                local.get 25
                i32.const 2
                i32.ne
                br_if 0 (;@3;)
                f64.const 0x1p+0 (;=1;)
                local.get 13
                f64.sub
                local.set 13
                i32.const 2
                local.set 25
                local.get 11
                i32.eqz
                br_if 0 (;@3;)
                local.get 13
                f64.const 0x1p+0 (;=1;)
                local.get 14
                call $scalbn
                f64.sub
                local.set 13
                end
                block  ;; label = @3
                local.get 13
                f64.const 0x0p+0 (;=0;)
                f64.ne
                br_if 0 (;@3;)
                block  ;; label = @4
                    local.get 6
                    local.get 10
                    i32.le_s
                    br_if 0 (;@4;)
                    local.get 20
                    local.get 6
                    i32.const 2
                    i32.shl
                    i32.add
                    local.set 2
                    i32.const 0
                    local.set 7
                    local.get 6
                    local.set 12
                    loop  ;; label = @5
                    local.get 2
                    i32.load
                    local.get 7
                    i32.or
                    local.set 7
                    local.get 2
                    i32.const -4
                    i32.add
                    local.set 2
                    local.get 12
                    i32.const -1
                    i32.add
                    local.tee 12
                    local.get 10
                    i32.gt_s
                    br_if 0 (;@5;)
                    end
                    local.get 7
                    i32.eqz
                    br_if 0 (;@4;)
                    local.get 5
                    i32.const 480
                    i32.add
                    local.get 6
                    i32.const 2
                    i32.shl
                    i32.add
                    i32.const -4
                    i32.add
                    local.set 2
                    local.get 14
                    local.set 9
                    loop  ;; label = @5
                    local.get 6
                    i32.const -1
                    i32.add
                    local.set 6
                    local.get 9
                    i32.const -24
                    i32.add
                    local.set 9
                    local.get 2
                    i32.load
                    local.set 7
                    local.get 2
                    i32.const -4
                    i32.add
                    local.set 2
                    local.get 7
                    i32.eqz
                    br_if 0 (;@5;)
                    br 4 (;@1;)
                    end
                end
                local.get 19
                local.set 2
                local.get 6
                local.set 11
                loop  ;; label = @4
                    local.get 11
                    i32.const 1
                    i32.add
                    local.set 11
                    local.get 2
                    i32.load
                    local.set 7
                    local.get 2
                    i32.const -4
                    i32.add
                    local.set 2
                    local.get 7
                    i32.eqz
                    br_if 0 (;@4;)
                end
                local.get 5
                i32.const 320
                i32.add
                local.get 3
                local.get 6
                i32.add
                i32.const 3
                i32.shl
                i32.add
                local.set 15
                loop  ;; label = @4
                    local.get 5
                    i32.const 320
                    i32.add
                    local.get 6
                    local.get 3
                    i32.add
                    i32.const 3
                    i32.shl
                    i32.add
                    local.get 6
                    i32.const 1
                    i32.add
                    local.tee 6
                    local.get 8
                    i32.add
                    i32.const 2
                    i32.shl
                    i32.const 1065488
                    i32.add
                    i32.load
                    f64.convert_i32_s
                    f64.store
                    f64.const 0x0p+0 (;=0;)
                    local.set 13
                    block  ;; label = @5
                    local.get 3
                    i32.const 1
                    i32.lt_s
                    br_if 0 (;@5;)
                    local.get 0
                    local.set 2
                    local.get 15
                    local.set 7
                    local.get 3
                    local.set 12
                    loop  ;; label = @6
                        local.get 13
                        local.get 2
                        f64.load
                        local.get 7
                        f64.load
                        f64.mul
                        f64.add
                        local.set 13
                        local.get 2
                        i32.const 8
                        i32.add
                        local.set 2
                        local.get 7
                        i32.const -8
                        i32.add
                        local.set 7
                        local.get 12
                        i32.const -1
                        i32.add
                        local.tee 12
                        br_if 0 (;@6;)
                    end
                    end
                    local.get 5
                    local.get 6
                    i32.const 3
                    i32.shl
                    i32.add
                    local.get 13
                    f64.store
                    local.get 15
                    i32.const 8
                    i32.add
                    local.set 15
                    local.get 6
                    local.get 11
                    i32.lt_s
                    br_if 0 (;@4;)
                end
                local.get 11
                local.set 6
                br 1 (;@2;)
                end
            end
            block  ;; label = @2
                block  ;; label = @3
                local.get 13
                i32.const 0
                local.get 14
                i32.sub
                call $scalbn
                local.tee 13
                f64.const 0x1p+24 (;=1.67772e+07;)
                f64.ge
                i32.const 1
                i32.xor
                br_if 0 (;@3;)
                local.get 6
                i32.const 2
                i32.shl
                local.set 7
                block  ;; label = @4
                    block  ;; label = @5
                    local.get 13
                    f64.const 0x1p-24 (;=5.96046e-08;)
                    f64.mul
                    local.tee 23
                    f64.abs
                    f64.const 0x1p+31 (;=2.14748e+09;)
                    f64.lt
                    i32.eqz
                    br_if 0 (;@5;)
                    local.get 23
                    i32.trunc_f64_s
                    local.set 2
                    br 1 (;@4;)
                    end
                    i32.const -2147483648
                    local.set 2
                end
                local.get 5
                i32.const 480
                i32.add
                local.get 7
                i32.add
                local.set 7
                block  ;; label = @4
                    block  ;; label = @5
                    local.get 13
                    local.get 2
                    f64.convert_i32_s
                    f64.const -0x1p+24 (;=-1.67772e+07;)
                    f64.mul
                    f64.add
                    local.tee 13
                    f64.abs
                    f64.const 0x1p+31 (;=2.14748e+09;)
                    f64.lt
                    i32.eqz
                    br_if 0 (;@5;)
                    local.get 13
                    i32.trunc_f64_s
                    local.set 12
                    br 1 (;@4;)
                    end
                    i32.const -2147483648
                    local.set 12
                end
                local.get 7
                local.get 12
                i32.store
                local.get 6
                i32.const 1
                i32.add
                local.set 6
                br 1 (;@2;)
                end
                block  ;; label = @3
                block  ;; label = @4
                    local.get 13
                    f64.abs
                    f64.const 0x1p+31 (;=2.14748e+09;)
                    f64.lt
                    i32.eqz
                    br_if 0 (;@4;)
                    local.get 13
                    i32.trunc_f64_s
                    local.set 2
                    br 1 (;@3;)
                end
                i32.const -2147483648
                local.set 2
                end
                local.get 14
                local.set 9
            end
            local.get 5
            i32.const 480
            i32.add
            local.get 6
            i32.const 2
            i32.shl
            i32.add
            local.get 2
            i32.store
            end
            block  ;; label = @1
            local.get 6
            i32.const 0
            i32.lt_s
            br_if 0 (;@1;)
            local.get 6
            i32.const 1
            i32.add
            local.set 12
            local.get 5
            i32.const 480
            i32.add
            local.get 6
            i32.const 2
            i32.shl
            i32.add
            local.set 2
            local.get 5
            local.get 6
            i32.const 3
            i32.shl
            i32.add
            local.set 7
            f64.const 0x1p+0 (;=1;)
            local.get 9
            call $scalbn
            local.set 13
            loop  ;; label = @2
                local.get 7
                local.get 13
                local.get 2
                i32.load
                f64.convert_i32_s
                f64.mul
                f64.store
                local.get 2
                i32.const -4
                i32.add
                local.set 2
                local.get 7
                i32.const -8
                i32.add
                local.set 7
                local.get 13
                f64.const 0x1p-24 (;=5.96046e-08;)
                f64.mul
                local.set 13
                local.get 12
                i32.const -1
                i32.add
                local.tee 12
                i32.const 0
                i32.gt_s
                br_if 0 (;@2;)
            end
            i32.const 0
            local.set 11
            local.get 6
            i32.const 0
            i32.lt_s
            br_if 0 (;@1;)
            local.get 10
            i32.const 0
            local.get 10
            i32.const 0
            i32.gt_s
            select
            local.set 15
            local.get 5
            local.get 6
            i32.const 3
            i32.shl
            i32.add
            local.set 12
            local.get 6
            local.set 3
            loop  ;; label = @2
                local.get 6
                local.get 3
                i32.sub
                local.set 8
                local.get 15
                local.get 11
                local.get 15
                local.get 11
                i32.lt_u
                select
                i32.const 1
                i32.add
                local.set 7
                f64.const 0x0p+0 (;=0;)
                local.set 13
                i32.const 0
                local.set 2
                loop  ;; label = @3
                local.get 13
                local.get 2
                i32.const 1068256
                i32.add
                f64.load
                local.get 12
                local.get 2
                i32.add
                f64.load
                f64.mul
                f64.add
                local.set 13
                local.get 2
                i32.const 8
                i32.add
                local.set 2
                local.get 7
                i32.const -1
                i32.add
                local.tee 7
                br_if 0 (;@3;)
                end
                local.get 5
                i32.const 160
                i32.add
                local.get 8
                i32.const 3
                i32.shl
                i32.add
                local.get 13
                f64.store
                local.get 12
                i32.const -8
                i32.add
                local.set 12
                local.get 3
                i32.const -1
                i32.add
                local.set 3
                local.get 11
                local.get 6
                i32.ne
                local.set 2
                local.get 11
                i32.const 1
                i32.add
                local.set 11
                local.get 2
                br_if 0 (;@2;)
            end
            end
            block  ;; label = @1
            block  ;; label = @2
                block  ;; label = @3
                block  ;; label = @4
                    block  ;; label = @5
                    local.get 4
                    br_table 1 (;@4;) 2 (;@3;) 2 (;@3;) 0 (;@5;) 4 (;@1;)
                    end
                    f64.const 0x0p+0 (;=0;)
                    local.set 26
                    block  ;; label = @5
                    local.get 6
                    i32.const 1
                    i32.lt_s
                    br_if 0 (;@5;)
                    local.get 6
                    i32.const 1
                    i32.add
                    local.set 7
                    local.get 5
                    i32.const 160
                    i32.add
                    local.get 6
                    i32.const 3
                    i32.shl
                    i32.add
                    local.tee 12
                    i32.const -8
                    i32.add
                    local.set 2
                    local.get 12
                    f64.load
                    local.set 13
                    loop  ;; label = @6
                        local.get 2
                        local.get 2
                        f64.load
                        local.tee 27
                        local.get 13
                        f64.add
                        local.tee 23
                        f64.store
                        local.get 2
                        i32.const 8
                        i32.add
                        local.get 13
                        local.get 27
                        local.get 23
                        f64.sub
                        f64.add
                        f64.store
                        local.get 2
                        i32.const -8
                        i32.add
                        local.set 2
                        local.get 23
                        local.set 13
                        local.get 7
                        i32.const -1
                        i32.add
                        local.tee 7
                        i32.const 1
                        i32.gt_s
                        br_if 0 (;@6;)
                    end
                    local.get 6
                    i32.const 2
                    i32.lt_s
                    br_if 0 (;@5;)
                    local.get 6
                    i32.const 1
                    i32.add
                    local.set 7
                    local.get 5
                    i32.const 160
                    i32.add
                    local.get 6
                    i32.const 3
                    i32.shl
                    i32.add
                    local.tee 12
                    i32.const -8
                    i32.add
                    local.set 2
                    local.get 12
                    f64.load
                    local.set 13
                    loop  ;; label = @6
                        local.get 2
                        local.get 2
                        f64.load
                        local.tee 27
                        local.get 13
                        f64.add
                        local.tee 23
                        f64.store
                        local.get 2
                        i32.const 8
                        i32.add
                        local.get 13
                        local.get 27
                        local.get 23
                        f64.sub
                        f64.add
                        f64.store
                        local.get 2
                        i32.const -8
                        i32.add
                        local.set 2
                        local.get 23
                        local.set 13
                        local.get 7
                        i32.const -1
                        i32.add
                        local.tee 7
                        i32.const 2
                        i32.gt_s
                        br_if 0 (;@6;)
                    end
                    local.get 6
                    i32.const 2
                    i32.lt_s
                    br_if 0 (;@5;)
                    local.get 6
                    i32.const 1
                    i32.add
                    local.set 7
                    local.get 5
                    i32.const 160
                    i32.add
                    local.get 6
                    i32.const 3
                    i32.shl
                    i32.add
                    local.set 2
                    f64.const 0x0p+0 (;=0;)
                    local.set 26
                    loop  ;; label = @6
                        local.get 26
                        local.get 2
                        f64.load
                        f64.add
                        local.set 26
                        local.get 2
                        i32.const -8
                        i32.add
                        local.set 2
                        local.get 7
                        i32.const -1
                        i32.add
                        local.tee 7
                        i32.const 2
                        i32.gt_s
                        br_if 0 (;@6;)
                    end
                    end
                    local.get 5
                    f64.load offset=160
                    local.set 13
                    local.get 25
                    br_if 2 (;@2;)
                    local.get 1
                    local.get 13
                    f64.store
                    local.get 1
                    local.get 26
                    f64.store offset=16
                    local.get 1
                    local.get 5
                    i64.load offset=168
                    i64.store offset=8
                    br 3 (;@1;)
                end
                block  ;; label = @4
                    block  ;; label = @5
                    local.get 6
                    i32.const 0
                    i32.ge_s
                    br_if 0 (;@5;)
                    f64.const 0x0p+0 (;=0;)
                    local.set 13
                    br 1 (;@4;)
                    end
                    local.get 6
                    i32.const 1
                    i32.add
                    local.set 7
                    local.get 5
                    i32.const 160
                    i32.add
                    local.get 6
                    i32.const 3
                    i32.shl
                    i32.add
                    local.set 2
                    f64.const 0x0p+0 (;=0;)
                    local.set 13
                    loop  ;; label = @5
                    local.get 13
                    local.get 2
                    f64.load
                    f64.add
                    local.set 13
                    local.get 2
                    i32.const -8
                    i32.add
                    local.set 2
                    local.get 7
                    i32.const -1
                    i32.add
                    local.tee 7
                    i32.const 0
                    i32.gt_s
                    br_if 0 (;@5;)
                    end
                end
                local.get 1
                local.get 13
                f64.neg
                local.get 13
                local.get 25
                select
                f64.store
                br 2 (;@1;)
                end
                block  ;; label = @3
                block  ;; label = @4
                    local.get 6
                    i32.const 0
                    i32.ge_s
                    br_if 0 (;@4;)
                    f64.const 0x0p+0 (;=0;)
                    local.set 13
                    br 1 (;@3;)
                end
                local.get 6
                i32.const 1
                i32.add
                local.set 7
                local.get 5
                i32.const 160
                i32.add
                local.get 6
                i32.const 3
                i32.shl
                i32.add
                local.set 2
                f64.const 0x0p+0 (;=0;)
                local.set 13
                loop  ;; label = @4
                    local.get 13
                    local.get 2
                    f64.load
                    f64.add
                    local.set 13
                    local.get 2
                    i32.const -8
                    i32.add
                    local.set 2
                    local.get 7
                    i32.const -1
                    i32.add
                    local.tee 7
                    i32.const 0
                    i32.gt_s
                    br_if 0 (;@4;)
                end
                end
                local.get 1
                local.get 13
                f64.neg
                local.get 13
                local.get 25
                select
                f64.store
                local.get 5
                f64.load offset=160
                local.get 13
                f64.sub
                local.set 13
                block  ;; label = @3
                local.get 6
                i32.const 1
                i32.lt_s
                br_if 0 (;@3;)
                local.get 5
                i32.const 160
                i32.add
                i32.const 8
                i32.or
                local.set 2
                loop  ;; label = @4
                    local.get 13
                    local.get 2
                    f64.load
                    f64.add
                    local.set 13
                    local.get 2
                    i32.const 8
                    i32.add
                    local.set 2
                    local.get 6
                    i32.const -1
                    i32.add
                    local.tee 6
                    br_if 0 (;@4;)
                end
                end
                local.get 1
                local.get 13
                f64.neg
                local.get 13
                local.get 25
                select
                f64.store offset=8
                br 1 (;@1;)
            end
            local.get 1
            local.get 13
            f64.neg
            f64.store
            local.get 1
            local.get 26
            f64.neg
            f64.store offset=16
            local.get 1
            local.get 5
            f64.load offset=168
            f64.neg
            f64.store offset=8
            end
            local.get 5
            i32.const 560
            i32.add
            global.set $RUST_SIN_GLOBAL
            local.get 16
            i32.const 7
            i32.and)

        (func $__sin (param f64 f64 i32) (result f64)
            (local f64 f64 f64)
            local.get 0
            local.get 0
            f64.mul
            local.tee 3
            local.get 3
            local.get 3
            f64.mul
            f64.mul
            local.get 3
            f64.const 0x1.5d93a5acfd57cp-33 (;=1.58969e-10;)
            f64.mul
            f64.const -0x1.ae5e68a2b9cebp-26 (;=-2.50508e-08;)
            f64.add
            f64.mul
            local.get 3
            local.get 3
            f64.const 0x1.71de357b1fe7dp-19 (;=2.75573e-06;)
            f64.mul
            f64.const -0x1.a01a019c161d5p-13 (;=-0.000198413;)
            f64.add
            f64.mul
            f64.const 0x1.111111110f8a6p-7 (;=0.00833333;)
            f64.add
            f64.add
            local.set 4
            local.get 3
            local.get 0
            f64.mul
            local.set 5
            block  ;; label = @1
            local.get 2
            br_if 0 (;@1;)
            local.get 5
            local.get 3
            local.get 4
            f64.mul
            f64.const -0x1.5555555555549p-3 (;=-0.166667;)
            f64.add
            f64.mul
            local.get 0
            f64.add
            return
            end
            local.get 0
            local.get 3
            local.get 1
            f64.const 0x1p-1 (;=0.5;)
            f64.mul
            local.get 5
            local.get 4
            f64.mul
            f64.sub
            f64.mul
            local.get 1
            f64.sub
            local.get 5
            f64.const 0x1.5555555555549p-3 (;=0.166667;)
            f64.mul
            f64.add
            f64.sub
        )

        (func $sin (param f64) (result f64)
            (local i32 i32)
            global.get $RUST_SIN_GLOBAL
            i32.const 16
            i32.sub
            local.tee 1
            global.set 0
            block  ;; label = @1
            block  ;; label = @2
                local.get 0
                i64.reinterpret_f64
                i64.const 32
                i64.shr_u
                i32.wrap_i64
                i32.const 2147483647
                i32.and
                local.tee 2
                i32.const 1072243195
                i32.gt_u
                br_if 0 (;@2;)
                local.get 2
                i32.const 1045430272
                i32.lt_u
                br_if 1 (;@1;)
                local.get 0
                f64.const 0x0p+0 (;=0;)
                i32.const 0
                call $__sin
                local.set 0
                br 1 (;@1;)
            end
            block  ;; label = @2
                local.get 2
                i32.const 2146435072
                i32.lt_u
                br_if 0 (;@2;)
                local.get 0
                local.get 0
                f64.sub
                local.set 0
                br 1 (;@1;)
            end
            block  ;; label = @2
                block  ;; label = @3
                block  ;; label = @4
                    block  ;; label = @5
                    local.get 0
                    local.get 1
                    call $__rem_pio2
                    i32.const 3
                    i32.and
                    br_table 0 (;@5;) 1 (;@4;) 2 (;@3;) 3 (;@2;)
                    end
                    local.get 1
                    f64.load
                    local.get 1
                    f64.load offset=8
                    i32.const 1
                    call $__sin
                    local.set 0
                    br 3 (;@1;)
                end
                local.get 1
                f64.load
                local.get 1
                f64.load offset=8
                call $__cos
                local.set 0
                br 2 (;@1;)
                end
                local.get 1
                f64.load
                local.get 1
                f64.load offset=8
                i32.const 1
                call $__sin
                f64.neg
                local.set 0
                br 1 (;@1;)
            end
            local.get 1
            f64.load
            local.get 1
            f64.load offset=8
            call $__cos
            f64.neg
            local.set 0
            end
            local.get 1
            i32.const 16
            i32.add
            global.set $RUST_SIN_GLOBAL
            local.get 0
        )

I wish I had the slightest idea how it does it, but who cares it is the Rust math library compiled by the LLVM how better that this can we implement a sin? Question is how can we put this into our compile architectures? If that be answered, then I guess we can one by one replace JS math tools in our compilers. And I guess EEL-Wasm can have so much boost from this

pouyakary commented 2 years ago

In the other hand I don't know if that is worth the shot of it but you know...

captbaritone commented 2 years ago

Hey! It's a good idea, and it technically feasible, but might be a little difficult to actually do. Basically we would need to rewrite all the code you pasted in the style of the functions defined in this file. There may be some mechanisms to simplify or semi-automate this process, but it will probably require some non-trivial work.

Additionally, it will somewhat increase the size of the compiler itself (which must be downloaded by each user). Probably this is worth it if we can get a meaningful performance improvement.

However, the performance win may not be as obvious as it would seem. It's true the calling out to JavaScript incurs some overhead, but the JavaScript implementation of sin/cos/etc might be faster than their Wasm equivalent (since wasm is slower than native code).

So, I think the next step would be to do a performance benchmark to measure how much faster a pure Wasm version is.

If you're interested, that would mean, writing a Rust module that computes the sin/cos/etc of a large number of values (say, 5,000) and we can compile that to Wasm and measure how fast/slow it is. We can then compare that to the current version of eel-wasm which uses the JS sin/cos/etc functions.

If the result is that the pure Wasm version is much faster, we can explore various methods to try to embed the Wasm implementations in the compiler.

Thanks for opening the issue! It sounds interesting.

pouyakary commented 2 years ago

That actually is a good idea... I'll do that :)