Skip to content

Implement sin, cos, tan and sincos for Math #806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 49 commits into from
Sep 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
7d29970
improve pio2_large_quot
MaxGraey Aug 31, 2019
30c2cbd
update (wip)
MaxGraey Aug 31, 2019
cffc7f8
update (wip)
MaxGraey Aug 31, 2019
5a78d81
update (wip)
MaxGraey Aug 31, 2019
5abaac3
implement sin and cos
MaxGraey Aug 31, 2019
7f2db3b
fixes (wip)
MaxGraey Aug 31, 2019
07755d3
more fixes (wip)
MaxGraey Aug 31, 2019
1666d13
pass all tests for sin and cos
MaxGraey Aug 31, 2019
4c0d45e
add Math.tan (wip)
MaxGraey Sep 1, 2019
ef1f85f
optimize table access
MaxGraey Sep 1, 2019
f240065
minor opt
MaxGraey Sep 1, 2019
e2199ce
fix Math.tan
MaxGraey Sep 1, 2019
3127012
Rebuild rest tests
MaxGraey Sep 1, 2019
053fde9
minor optimization for tan
MaxGraey Sep 1, 2019
25978e5
fix
MaxGraey Sep 1, 2019
8fb375a
more fixes and tests
MaxGraey Sep 1, 2019
06a9de1
Fix & cleanup
MaxGraey Sep 1, 2019
c09dfbd
add fast paths for rempio2
MaxGraey Sep 1, 2019
860ea18
minor refactoring
MaxGraey Sep 1, 2019
b1b8d7c
more specific tests
MaxGraey Sep 2, 2019
376bc1f
cleanup
MaxGraey Sep 2, 2019
5f02e57
optimize atan2 switches
MaxGraey Sep 2, 2019
87ed501
rebuild tests
MaxGraey Sep 2, 2019
a6f6354
Add Math.sincos
MaxGraey Sep 2, 2019
fc621c6
add special sanity tests for sincos
MaxGraey Sep 2, 2019
43653f3
cleanup
MaxGraey Sep 3, 2019
e174d15
Add tests from v8
MaxGraey Sep 3, 2019
406f62a
fix missing cast in Math.log
MaxGraey Sep 4, 2019
d37fe9c
rebuild mandelbrot test
MaxGraey Sep 4, 2019
3bb8c97
move comments
MaxGraey Sep 4, 2019
fc43dc2
use only one global var for __umuldi
MaxGraey Sep 6, 2019
95dd037
remove underscores for umuldi and res128_hi
MaxGraey Sep 6, 2019
d5e6a29
revuild std/array
MaxGraey Sep 6, 2019
36af9e0
minor improvments for atanh/atanhf
MaxGraey Sep 6, 2019
b0bdca4
avoid switches in sincos
MaxGraey Sep 6, 2019
f1d5b24
even more simpler sincos
MaxGraey Sep 6, 2019
a86ce52
ucomment accidentaly comment tests for split in std/string
MaxGraey Sep 7, 2019
79a7712
add ucb tests for sin and tan
MaxGraey Sep 7, 2019
27ea883
ucb for cos
MaxGraey Sep 7, 2019
ff597e2
Merge branch 'master' into math-sincos
MaxGraey Sep 8, 2019
e6b6e85
rebuild tests
MaxGraey Sep 8, 2019
d684bd1
use ASC_SHRINK_LEVEL in rempio2
MaxGraey Sep 8, 2019
0e77d41
make all hexadecimals in uppercase
MaxGraey Sep 8, 2019
dbf1450
opt pio2f_large_quot
MaxGraey Sep 8, 2019
bcfb4f9
Merge branch 'master' into math-sincos
MaxGraey Sep 10, 2019
225bbf5
rebuild tests
MaxGraey Sep 10, 2019
7e71d8c
Merge branch 'master' into math-sincos
MaxGraey Sep 10, 2019
5df18b7
rebuild tests
MaxGraey Sep 10, 2019
d98aa2d
Merge branch 'master' into math-sincos
MaxGraey Sep 10, 2019
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
587 changes: 486 additions & 101 deletions std/assembly/math.ts

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions tests/compiler/mandelbrot.optimized.wat
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,16 @@
i32.sub
local.get $5
i32.add
local.tee $1
f64.convert_i32_s
local.tee $0
f64.const 1.9082149292705877e-10
f64.mul
f64.add
local.get $4
f64.sub
local.get $3
f64.add
local.get $1
f64.convert_i32_s
local.get $0
f64.const 0.6931471803691238
f64.mul
f64.add
Expand Down
5 changes: 2 additions & 3 deletions tests/compiler/mandelbrot.untouched.wat
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
(local $9 f64)
(local $10 f64)
(local $11 f64)
(local $12 i32)
(local $12 f64)
local.get $0
i64.reinterpret_f64
local.set $1
Expand Down Expand Up @@ -197,14 +197,14 @@
f64.add
local.set $11
local.get $3
f64.convert_i32_s
local.set $12
local.get $6
local.get $5
local.get $11
f64.add
f64.mul
local.get $12
f64.convert_i32_s
f64.const 1.9082149292705877e-10
f64.mul
f64.add
Expand All @@ -213,7 +213,6 @@
local.get $4
f64.add
local.get $12
f64.convert_i32_s
f64.const 0.6931471803691238
f64.mul
f64.add
Expand Down
4 changes: 2 additions & 2 deletions tests/compiler/std/array.optimized.wat
Original file line number Diff line number Diff line change
Expand Up @@ -4188,7 +4188,7 @@
if
i32.const 0
i32.const 3160
i32.const 1041
i32.const 1369
i32.const 4
call $~lib/builtins/abort
unreachable
Expand Down Expand Up @@ -5724,7 +5724,7 @@
if
i32.const 3936
i32.const 3160
i32.const 1048
i32.const 1376
i32.const 24
call $~lib/builtins/abort
unreachable
Expand Down
4 changes: 2 additions & 2 deletions tests/compiler/std/array.untouched.wat
Original file line number Diff line number Diff line change
Expand Up @@ -6574,7 +6574,7 @@
if
i32.const 0
i32.const 3160
i32.const 1041
i32.const 1369
i32.const 4
call $~lib/builtins/abort
unreachable
Expand Down Expand Up @@ -8865,7 +8865,7 @@
if
i32.const 3936
i32.const 3160
i32.const 1048
i32.const 1376
i32.const 24
call $~lib/builtins/abort
unreachable
Expand Down
Loading