Skip to content

Commit 5e01e4a

Browse files
committed
Merge branch 'main' into baseline-uses-rival-machine
2 parents b55d32d + 26336b4 commit 5e01e4a

File tree

8 files changed

+223
-104
lines changed

8 files changed

+223
-104
lines changed

eval/compile.rkt

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,37 +35,37 @@
3535

3636
[(list 'if c y f) (list ival-if c y f)]
3737

38-
[(list 'neg x) (list ival-neg x)]
39-
[(list 'acos x) (list ival-acos x)]
40-
[(list 'acosh x) (list ival-acosh x)]
41-
[(list 'asin x) (list ival-asin x)]
42-
[(list 'asinh x) (list ival-asinh x)]
43-
[(list 'atan x) (list ival-atan x)]
44-
[(list 'atanh x) (list ival-atanh x)]
45-
[(list 'cbrt x) (list ival-cbrt x)]
38+
[(list 'neg x) (list ival-neg! (alloc-outreg!) x)]
39+
[(list 'acos x) (list ival-acos! (alloc-outreg!) x)]
40+
[(list 'acosh x) (list ival-acosh! (alloc-outreg!) x)]
41+
[(list 'asin x) (list ival-asin! (alloc-outreg!) x)]
42+
[(list 'asinh x) (list ival-asinh! (alloc-outreg!) x)]
43+
[(list 'atan x) (list ival-atan! (alloc-outreg!) x)]
44+
[(list 'atanh x) (list ival-atanh! (alloc-outreg!) x)]
45+
[(list 'cbrt x) (list ival-cbrt! (alloc-outreg!) x)]
4646
[(list 'ceil x) (list ival-ceil x)]
4747
[(list 'cos x) (list ival-cos x)]
48-
[(list 'cosh x) (list ival-cosh x)]
49-
[(list 'erf x) (list ival-erf x)]
50-
[(list 'erfc x) (list ival-erfc x)]
51-
[(list 'exp x) (list ival-exp x)]
52-
[(list 'exp2 x) (list ival-exp2 x)]
53-
[(list 'expm1 x) (list ival-expm1 x)]
48+
[(list 'cosh x) (list ival-cosh! (alloc-outreg!) x)]
49+
[(list 'erf x) (list ival-erf! (alloc-outreg!) x)]
50+
[(list 'erfc x) (list ival-erfc! (alloc-outreg!) x)]
51+
[(list 'exp x) (list ival-exp! (alloc-outreg!) x)]
52+
[(list 'exp2 x) (list ival-exp2! (alloc-outreg!) x)]
53+
[(list 'expm1 x) (list ival-expm1! (alloc-outreg!) x)]
5454
[(list 'fabs x) (list ival-fabs x)]
5555
[(list 'floor x) (list ival-floor x)]
5656
[(list 'lgamma x) (list ival-lgamma x)]
57-
[(list 'log x) (list ival-log x)]
58-
[(list 'log10 x) (list ival-log10 x)]
59-
[(list 'log1p x) (list ival-log1p x)]
60-
[(list 'log2 x) (list ival-log2 x)]
57+
[(list 'log x) (list ival-log! (alloc-outreg!) x)]
58+
[(list 'log10 x) (list ival-log10! (alloc-outreg!) x)]
59+
[(list 'log1p x) (list ival-log1p! (alloc-outreg!) x)]
60+
[(list 'log2 x) (list ival-log2! (alloc-outreg!) x)]
6161
[(list 'logb x) (list ival-logb x)]
62-
[(list 'rint x) (list ival-rint x)]
62+
[(list 'rint x) (list ival-rint! (alloc-outreg!) x)]
6363
[(list 'round x) (list ival-round x)]
6464
[(list 'sin x) (list ival-sin x)]
65-
[(list 'sinh x) (list ival-sinh x)]
66-
[(list 'sqrt x) (list ival-sqrt x)]
65+
[(list 'sinh x) (list ival-sinh! (alloc-outreg!) x)]
66+
[(list 'sqrt x) (list ival-sqrt! (alloc-outreg!) x)]
6767
[(list 'tan x) (list ival-tan x)]
68-
[(list 'tanh x) (list ival-tanh x)]
68+
[(list 'tanh x) (list ival-tanh! (alloc-outreg!) x)]
6969
[(list 'tgamma x) (list ival-tgamma x)]
7070
[(list 'trunc x) (list ival-trunc x)]
7171

eval/main.rkt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,14 @@
7474
(execution instruction number precision time memory iter))
7575
(set-rival-machine-profile-ptr! machine 0))]))
7676

77-
(define (ival-real x)
78-
(ival x))
79-
8077
; Assumes that hint (if provided) is correct for the given pt
8178
(define (rival-apply machine pt [hint #f])
8279
; Load arguments
83-
(rival-machine-load machine (vector-map ival-real pt))
80+
(define ival-pt
81+
(for/vector #:length (vector-length pt)
82+
([x (in-vector pt)])
83+
(ival x)))
84+
(rival-machine-load machine ival-pt)
8485
(let loop ([iter 0])
8586
(define-values (good? done? bad? stuck? fvec)
8687
(parameterize ([*sampling-iteration* iter]

mpfr.rkt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,12 @@
230230
bfnan?
231231
bfinfinite?
232232
bfnegative?
233+
bfrational?
233234
bfeven?
234235
bfodd?
235236
bfcopy
236237
bfstep
238+
bigfloat->flonum
237239
bigfloats-between
238240
bfprev
239241
bfnext

ops/all.rkt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,33 @@
2222
ival-sub
2323
ival-sub!
2424
ival-neg
25+
ival-neg!
2526
ival-mult
2627
ival-mult!
2728
ival-div
2829
ival-div!
2930
ival-fma
3031
ival-fabs
3132
ival-sqrt
33+
ival-sqrt!
3234
ival-cbrt
35+
ival-cbrt!
3336
ival-hypot
3437
ival-hypot!
3538
ival-exp
39+
ival-exp!
3640
ival-exp2
41+
ival-exp2!
3742
ival-expm1
43+
ival-expm1!
3844
ival-log
45+
ival-log!
3946
ival-log2
47+
ival-log2!
4048
ival-log10
49+
ival-log10!
4150
ival-log1p
51+
ival-log1p!
4252
ival-logb
4353
ival-pow
4454
ival-pow2
@@ -49,22 +59,34 @@
4959
ival-sinu
5060
ival-tanu
5161
ival-asin
62+
ival-asin!
5263
ival-acos
64+
ival-acos!
5365
ival-atan
66+
ival-atan!
5467
ival-atan2
5568
ival-sinh
69+
ival-sinh!
5670
ival-cosh
71+
ival-cosh!
5772
ival-tanh
73+
ival-tanh!
5874
ival-asinh
75+
ival-asinh!
5976
ival-acosh
77+
ival-acosh!
6078
ival-atanh
79+
ival-atanh!
6180
ival-erf
81+
ival-erf!
6282
ival-erfc
83+
ival-erfc!
6384
ival-lgamma
6485
ival-tgamma
6586
ival-fmod
6687
ival-remainder
6788
ival-rint
89+
ival-rint!
6890
ival-round
6991
ival-ceil
7092
ival-floor

0 commit comments

Comments
 (0)