Skip to content

Commit 6df20ff

Browse files
committed
Use fpcore property in windows and math platforms
1 parent 167a917 commit 6df20ff

File tree

2 files changed

+191
-188
lines changed

2 files changed

+191
-188
lines changed

src/platforms/c-windows.rkt

Lines changed: 131 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -37,66 +37,66 @@
3737
[<=.f32 #:spec (<= x y) #:impl <= #:cost 32bit-move-cost]
3838
[>=.f32 #:spec (>= x y) #:impl >= #:cost 32bit-move-cost])
3939

40-
(parameterize ([fpcore-context '(:precision binary32)])
41-
(define-operations () <binary32>
42-
[PI.f32 #:spec (PI) #:impl (const (flsingle pi)) #:fpcore PI #:cost 32bit-move-cost]
43-
[E.f32 #:spec (E) #:impl (const (flsingle (exp 1))) #:fpcore E #:cost 32bit-move-cost]
44-
[INFINITY.f32 #:spec (INFINITY) #:impl (const +inf.0) #:fpcore INFINITY #:cost 32bit-move-cost]
45-
[NAN.f32 #:spec (NAN) #:impl (const +nan.0) #:fpcore NAN #:cost 32bit-move-cost])
46-
47-
(define-operation (neg.f32 [x <binary32>]) <binary32>
48-
#:spec (neg x) #:impl (compose flsingle -) #:fpcore (- x) #:cost 0.125)
49-
50-
(define-operations ([x <binary32>] [y <binary32>]) <binary32>
51-
[+.f32 #:spec (+ x y) #:impl (compose flsingle +) #:cost 0.200]
52-
[-.f32 #:spec (- x y) #:impl (compose flsingle -) #:cost 0.200]
53-
[*.f32 #:spec (* x y) #:impl (compose flsingle *) #:cost 0.250]
54-
[/.f32 #:spec (/ x y) #:impl (compose flsingle /) #:cost 0.350])
55-
56-
(define-operations ([x <binary32>]) <binary32>
57-
[sin.f32 #:spec (sin x) #:impl (from-libm 'sinf) #:cost 4.250]
58-
[cos.f32 #:spec (cos x) #:impl (from-libm 'cosf) #:cost 4.250]
59-
[tan.f32 #:spec (tan x) #:impl (from-libm 'tanf) #:cost 4.750]
60-
[sinh.f32 #:spec (sinh x) #:impl (from-libm 'sinhf) #:cost 1.750]
61-
[cosh.f32 #:spec (cosh x) #:impl (from-libm 'coshf) #:cost 1.250]
62-
[acos.f32 #:spec (acos x) #:impl (from-libm 'acosf) #:cost 0.500]
63-
[acosh.f32 #:spec (acosh x) #:impl (from-libm 'acoshf) #:cost 0.850]
64-
[asin.f32 #:spec (asin x) #:impl (from-libm 'asinf) #:cost 0.500]
65-
[asinh.f32 #:spec (asinh x) #:impl (from-libm 'asinhf) #:cost 1.125]
66-
[atan.f32 #:spec (atan x) #:impl (from-libm 'atanf) #:cost 1.100]
67-
[atanh.f32 #:spec (atanh x) #:impl (from-libm 'atanhf) #:cost 0.500]
68-
[cbrt.f32 #:spec (cbrt x) #:impl (from-libm 'cbrtf) #:cost 2.000]
69-
[ceil.f32 #:spec (ceil x) #:impl (from-libm 'ceilf) #:cost 0.250]
70-
[erf.f32 #:spec (erf x) #:impl (from-libm 'erff) #:cost 1.125]
71-
[exp.f32 #:spec (exp x) #:impl (from-libm 'expf) #:cost 1.375]
72-
[exp2.f32 #:spec (exp2 x) #:impl (from-libm 'exp2f) #:cost 1.175]
73-
[floor.f32 #:spec (floor x) #:impl (from-libm 'floorf) #:cost 0.250]
74-
[lgamma.f32 #:spec (lgamma x) #:impl (from-libm 'lgammaf) #:cost 2.250]
75-
[log.f32 #:spec (log x) #:impl (from-libm 'logf) #:cost 0.750]
76-
[log10.f32 #:spec (log10 x) #:impl (from-libm 'log10f) #:cost 1.175]
77-
[log2.f32 #:spec (log2 x) #:impl (from-libm 'log2f) #:cost 0.875]
78-
[logb.f32 #:spec (logb x) #:impl (from-libm 'logbf) #:cost 0.375]
79-
[rint.f32 #:spec (rint x) #:impl (from-libm 'rintf) #:cost 0.300]
80-
[round.f32 #:spec (round x) #:impl (from-libm 'roundf) #:cost 0.875]
81-
[sqrt.f32 #:spec (sqrt x) #:impl (from-libm 'sqrtf) #:cost 0.250]
82-
[tanh.f32 #:spec (tanh x) #:impl (from-libm 'tanhf) #:cost 1.000]
83-
[tgamma.f32 #:spec (tgamma x) #:impl (from-libm 'tgammaf) #:cost 2.625]
84-
[trunc.f32 #:spec (trunc x) #:impl (from-libm 'truncf) #:cost 0.275])
85-
86-
(define-operations ([x <binary32>] [y <binary32>]) <binary32>
87-
[pow.f32 #:spec (pow x y) #:impl (from-libm 'powf) #:cost 2.000]
88-
[atan2.f32 #:spec (atan2 x y) #:impl (from-libm 'atan2f) #:cost 2.000]
89-
[copysign.f32 #:spec (copysign x y) #:impl (from-libm 'copysignf) #:cost 0.200]
90-
[fdim.f32 #:spec (fdim x y) #:impl (from-libm 'fdimf) #:cost 0.750]
91-
[fmax.f32 #:spec (fmax x y) #:impl (from-libm 'fmaxf) #:cost 0.250]
92-
[fmin.f32 #:spec (fmin x y) #:impl (from-libm 'fminf) #:cost 0.250]
93-
[fmod.f32 #:spec (fmod x y) #:impl (from-libm 'fmodf) #:cost 1.750]
94-
[remainder.f32 #:spec (remainder x y) #:impl (from-libm 'remainderf) #:cost 1.000])
95-
96-
(define-operations ([x <binary32>]) <binary32>
97-
[erfc.f32 #:spec (- 1 (erf x)) #:impl (from-libm 'erfcf) #:fpcore (erfc x) #:cost 0.900]
98-
[expm1.f32 #:spec (- (exp x) 1) #:impl (from-libm 'expm1f) #:fpcore (expm1 x) #:cost 0.900]
99-
[log1p.f32 #:spec (log (+ 1 x)) #:impl (from-libm 'log1pf) #:fpcore (log1p x) #:cost 1.300]))
40+
(define-operations () <binary32> #:fpcore (:precision binary32)
41+
[PI.f32 #:spec (PI) #:impl (const (flsingle pi)) #:fpcore PI #:cost 32bit-move-cost]
42+
[E.f32 #:spec (E) #:impl (const (flsingle (exp 1))) #:fpcore E #:cost 32bit-move-cost]
43+
[INFINITY.f32 #:spec (INFINITY) #:impl (const +inf.0) #:fpcore INFINITY #:cost 32bit-move-cost]
44+
[NAN.f32 #:spec (NAN) #:impl (const +nan.0) #:fpcore NAN #:cost 32bit-move-cost])
45+
46+
(define-operation (neg.f32 [x <binary32>]) <binary32>
47+
#:spec (neg x) #:impl (compose flsingle -)
48+
#:fpcore (! :precision binary32 (- x)) #:cost 0.125)
49+
50+
(define-operations ([x <binary32>] [y <binary32>]) <binary32> #:fpcore (:precision binary32)
51+
[+.f32 #:spec (+ x y) #:impl (compose flsingle +) #:cost 0.200]
52+
[-.f32 #:spec (- x y) #:impl (compose flsingle -) #:cost 0.200]
53+
[*.f32 #:spec (* x y) #:impl (compose flsingle *) #:cost 0.250]
54+
[/.f32 #:spec (/ x y) #:impl (compose flsingle /) #:cost 0.350])
55+
56+
(define-operations ([x <binary32>]) <binary32> #:fpcore (:precision binary32)
57+
[sin.f32 #:spec (sin x) #:impl (from-libm 'sinf) #:cost 4.250]
58+
[cos.f32 #:spec (cos x) #:impl (from-libm 'cosf) #:cost 4.250]
59+
[tan.f32 #:spec (tan x) #:impl (from-libm 'tanf) #:cost 4.750]
60+
[sinh.f32 #:spec (sinh x) #:impl (from-libm 'sinhf) #:cost 1.750]
61+
[cosh.f32 #:spec (cosh x) #:impl (from-libm 'coshf) #:cost 1.250]
62+
[acos.f32 #:spec (acos x) #:impl (from-libm 'acosf) #:cost 0.500]
63+
[acosh.f32 #:spec (acosh x) #:impl (from-libm 'acoshf) #:cost 0.850]
64+
[asin.f32 #:spec (asin x) #:impl (from-libm 'asinf) #:cost 0.500]
65+
[asinh.f32 #:spec (asinh x) #:impl (from-libm 'asinhf) #:cost 1.125]
66+
[atan.f32 #:spec (atan x) #:impl (from-libm 'atanf) #:cost 1.100]
67+
[atanh.f32 #:spec (atanh x) #:impl (from-libm 'atanhf) #:cost 0.500]
68+
[cbrt.f32 #:spec (cbrt x) #:impl (from-libm 'cbrtf) #:cost 2.000]
69+
[ceil.f32 #:spec (ceil x) #:impl (from-libm 'ceilf) #:cost 0.250]
70+
[erf.f32 #:spec (erf x) #:impl (from-libm 'erff) #:cost 1.125]
71+
[exp.f32 #:spec (exp x) #:impl (from-libm 'expf) #:cost 1.375]
72+
[exp2.f32 #:spec (exp2 x) #:impl (from-libm 'exp2f) #:cost 1.175]
73+
[floor.f32 #:spec (floor x) #:impl (from-libm 'floorf) #:cost 0.250]
74+
[lgamma.f32 #:spec (lgamma x) #:impl (from-libm 'lgammaf) #:cost 2.250]
75+
[log.f32 #:spec (log x) #:impl (from-libm 'logf) #:cost 0.750]
76+
[log10.f32 #:spec (log10 x) #:impl (from-libm 'log10f) #:cost 1.175]
77+
[log2.f32 #:spec (log2 x) #:impl (from-libm 'log2f) #:cost 0.875]
78+
[logb.f32 #:spec (logb x) #:impl (from-libm 'logbf) #:cost 0.375]
79+
[rint.f32 #:spec (rint x) #:impl (from-libm 'rintf) #:cost 0.300]
80+
[round.f32 #:spec (round x) #:impl (from-libm 'roundf) #:cost 0.875]
81+
[sqrt.f32 #:spec (sqrt x) #:impl (from-libm 'sqrtf) #:cost 0.250]
82+
[tanh.f32 #:spec (tanh x) #:impl (from-libm 'tanhf) #:cost 1.000]
83+
[tgamma.f32 #:spec (tgamma x) #:impl (from-libm 'tgammaf) #:cost 2.625]
84+
[trunc.f32 #:spec (trunc x) #:impl (from-libm 'truncf) #:cost 0.275])
85+
86+
(define-operations ([x <binary32>] [y <binary32>]) <binary32> #:fpcore (:precision binary32)
87+
[pow.f32 #:spec (pow x y) #:impl (from-libm 'powf) #:cost 2.000]
88+
[atan2.f32 #:spec (atan2 x y) #:impl (from-libm 'atan2f) #:cost 2.000]
89+
[copysign.f32 #:spec (copysign x y) #:impl (from-libm 'copysignf) #:cost 0.200]
90+
[fdim.f32 #:spec (fdim x y) #:impl (from-libm 'fdimf) #:cost 0.750]
91+
[fmax.f32 #:spec (fmax x y) #:impl (from-libm 'fmaxf) #:cost 0.250]
92+
[fmin.f32 #:spec (fmin x y) #:impl (from-libm 'fminf) #:cost 0.250]
93+
[fmod.f32 #:spec (fmod x y) #:impl (from-libm 'fmodf) #:cost 1.750]
94+
[remainder.f32 #:spec (remainder x y) #:impl (from-libm 'remainderf) #:cost 1.000])
95+
96+
(define-operations ([x <binary32>]) <binary32> #:fpcore (:precision binary32)
97+
[erfc.f32 #:spec (- 1 (erf x)) #:impl (from-libm 'erfcf) #:fpcore (erfc x) #:cost 0.900]
98+
[expm1.f32 #:spec (- (exp x) 1) #:impl (from-libm 'expm1f) #:fpcore (expm1 x) #:cost 0.900]
99+
[log1p.f32 #:spec (log (+ 1 x)) #:impl (from-libm 'log1pf) #:fpcore (log1p x) #:cost 1.300])
100100

101101
;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BINARY 64 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
102102

@@ -108,75 +108,77 @@
108108
[*.f64 #:spec (* x y) #:impl * #:cost 0.250]
109109
[/.f64 #:spec (/ x y) #:impl / #:cost 0.350])
110110

111-
(parameterize ([fpcore-context '(:precision binary64)])
112-
(define-operations () <binary64>
113-
[PI.f64 #:spec (PI) #:impl (const pi) #:fpcore PI #:cost 64bit-move-cost]
114-
[E.f64 #:spec (E) #:impl (const (exp 1)) #:fpcore E #:cost 64bit-move-cost]
115-
[INFINITY #:spec (INFINITY) #:impl (const +inf.0) #:fpcore INFINITY #:cost 64bit-move-cost]
116-
[NAN.f64 #:spec (NAN) #:impl (const +nan.0) #:fpcore NAN #:cost 64bit-move-cost])
117-
118-
(define-operation (neg.f64 [x <binary64>]) <binary64>
119-
#:spec (neg x) #:impl - #:fpcore (- x) #:cost 0.125)
120-
121-
(define-operations ([x <binary64>] [y <binary64>]) <bool>
122-
[==.f64 #:spec (== x y) #:impl = #:cost 64bit-move-cost]
123-
[!=.f64 #:spec (!= x y) #:impl (negate =) #:cost 64bit-move-cost]
124-
[<.f64 #:spec (< x y) #:impl < #:cost 64bit-move-cost]
125-
[>.f64 #:spec (> x y) #:impl > #:cost 64bit-move-cost]
126-
[<=.f64 #:spec (<= x y) #:impl <= #:cost 64bit-move-cost]
127-
[>=.f64 #:spec (>= x y) #:impl >= #:cost 64bit-move-cost])
128-
129-
(define-operations ([x <binary64>]) <binary64>
130-
[fabs.f64 #:spec (fabs x) #:impl (from-libm 'fabs) #:cost 0.125]
131-
[sin.f64 #:spec (sin x) #:impl (from-libm 'sin) #:cost 4.200]
132-
[cos.f64 #:spec (cos x) #:impl (from-libm 'cos) #:cost 4.200]
133-
[tan.f64 #:spec (tan x) #:impl (from-libm 'tan) #:cost 4.650]
134-
[sinh.f64 #:spec (sinh x) #:impl (from-libm 'sinh) #:cost 1.750]
135-
[cosh.f64 #:spec (cosh x) #:impl (from-libm 'cosh) #:cost 1.650]
136-
[acos.f64 #:spec (acos x) #:impl (from-libm 'acos) #:cost 0.500]
137-
[acosh.f64 #:spec (acosh x) #:impl (from-libm 'acosh) #:cost 0.850]
138-
[asin.f64 #:spec (asin x) #:impl (from-libm 'asin) #:cost 0.500]
139-
[asinh.f64 #:spec (asinh x) #:impl (from-libm 'asinh) #:cost 1.125]
140-
[atan.f64 #:spec (atan x) #:impl (from-libm 'atan) #:cost 1.100]
141-
[atanh.f64 #:spec (atanh x) #:impl (from-libm 'atanh) #:cost 0.450]
142-
[cbrt.f64 #:spec (cbrt x) #:impl (from-libm 'cbrt) #:cost 2.000]
143-
[ceil.f64 #:spec (ceil x) #:impl (from-libm 'ceil) #:cost 0.250]
144-
[erf.f64 #:spec (erf x) #:impl (from-libm 'erf) #:cost 1.125]
145-
[exp.f64 #:spec (exp x) #:impl (from-libm 'exp) #:cost 1.375]
146-
[exp2.f64 #:spec (exp2 x) #:impl (from-libm 'exp2) #:cost 1.175]
147-
[floor.f64 #:spec (floor x) #:impl (from-libm 'floor) #:cost 0.300]
148-
[lgamma.f64 #:spec (lgamma x) #:impl (from-libm 'lgamma) #:cost 2.250]
149-
[log.f64 #:spec (log x) #:impl (from-libm 'log) #:cost 0.750]
150-
[log10.f64 #:spec (log10 x) #:impl (from-libm 'log10) #:cost 1.175]
151-
[log2.f64 #:spec (log2 x) #:impl (from-libm 'log2) #:cost 0.850]
152-
[logb.f64 #:spec (logb x) #:impl (from-libm 'logb) #:cost 0.350]
153-
[rint.f64 #:spec (rint x) #:impl (from-libm 'rint) #:cost 0.300]
154-
[round.f64 #:spec (round x) #:impl (from-libm 'round) #:cost 0.850]
155-
[sqrt.f64 #:spec (sqrt x) #:impl (from-libm 'sqrt) #:cost 0.250]
156-
[tanh.f64 #:spec (tanh x) #:impl (from-libm 'tanh) #:cost 1.000]
157-
[tgamma.f64 #:spec (tgamma x) #:impl (from-libm 'tgamma) #:cost 2.625]
158-
[trunc.f64 #:spec (trunc x) #:impl (from-libm 'trunc) #:cost 0.250])
159-
160-
(define-operations ([x <binary64>] [y <binary64>]) <binary64>
161-
[pow.f64 #:spec (pow x y) #:impl (from-libm 'pow) #:cost 2.000]
162-
[atan2.f64 #:spec (atan2 x y) #:impl (from-libm 'atan2) #:cost 2.000]
163-
[copysign.f64 #:spec (copysign x y) #:impl (from-libm 'copysign) #:cost 0.200]
164-
[fdim.f64 #:spec (fdim x y) #:impl (from-libm 'fdim) #:cost 0.750]
165-
[fmax.f64 #:spec (fmax x y) #:impl (from-libm 'fmax) #:cost 0.250]
166-
[fmin.f64 #:spec (fmin x y) #:impl (from-libm 'fmin) #:cost 0.250]
167-
[fmod.f64 #:spec (fmod x y) #:impl (from-libm 'fmod) #:cost 1.750]
168-
[remainder.f64 #:spec (remainder x y) #:impl (from-libm 'remainder) #:cost 1.000])
169-
170-
(define-operations ([x <binary64>]) <binary64>
171-
[erfc.f64 #:spec (- 1 (erf x)) #:impl (from-libm 'erfc) #:fpcore (erfc x) #:cost 0.900]
172-
[expm1.f64 #:spec (- (exp x) 1) #:impl (from-libm 'expm1) #:fpcore (expm1 x) #:cost 0.900]
173-
[log1p.f64 #:spec (log (+ 1 x)) #:impl (from-libm 'log1p) #:fpcore (log1p x) #:cost 1.300])
174-
175-
(define-operation (hypot.f64 [x <binary64>] [y <binary64>]) <binary64>
176-
#:spec (sqrt (+ (* x x) (* y y))) #:impl (from-libm 'hypot) #:fpcore (hypot x y) #:cost 1.700)
177-
178-
(define-operation (fma.f64 [x <binary64>] [y <binary64>] [z <binary64>]) <binary64>
179-
#:spec (+ (* x y) z) #:impl (from-libm 'fma) #:fpcore (fma x y z) #:cost 0.375))
111+
(define-operations () <binary64> #:fpcore (:precision binary64)
112+
[PI.f64 #:spec (PI) #:impl (const pi) #:fpcore PI #:cost 64bit-move-cost]
113+
[E.f64 #:spec (E) #:impl (const (exp 1)) #:fpcore E #:cost 64bit-move-cost]
114+
[INFINITY #:spec (INFINITY) #:impl (const +inf.0) #:fpcore INFINITY #:cost 64bit-move-cost]
115+
[NAN.f64 #:spec (NAN) #:impl (const +nan.0) #:fpcore NAN #:cost 64bit-move-cost])
116+
117+
(define-operation (neg.f64 [x <binary64>]) <binary64>
118+
#:spec (neg x) #:impl -
119+
#:fpcore (! :precision binary64 (- x)) #:cost 0.125)
120+
121+
(define-operations ([x <binary64>] [y <binary64>]) <bool>
122+
[==.f64 #:spec (== x y) #:impl = #:cost 64bit-move-cost]
123+
[!=.f64 #:spec (!= x y) #:impl (negate =) #:cost 64bit-move-cost]
124+
[<.f64 #:spec (< x y) #:impl < #:cost 64bit-move-cost]
125+
[>.f64 #:spec (> x y) #:impl > #:cost 64bit-move-cost]
126+
[<=.f64 #:spec (<= x y) #:impl <= #:cost 64bit-move-cost]
127+
[>=.f64 #:spec (>= x y) #:impl >= #:cost 64bit-move-cost])
128+
129+
(define-operations ([x <binary64>]) <binary64> #:fpcore (:precision binary64)
130+
[fabs.f64 #:spec (fabs x) #:impl (from-libm 'fabs) #:cost 0.125]
131+
[sin.f64 #:spec (sin x) #:impl (from-libm 'sin) #:cost 4.200]
132+
[cos.f64 #:spec (cos x) #:impl (from-libm 'cos) #:cost 4.200]
133+
[tan.f64 #:spec (tan x) #:impl (from-libm 'tan) #:cost 4.650]
134+
[sinh.f64 #:spec (sinh x) #:impl (from-libm 'sinh) #:cost 1.750]
135+
[cosh.f64 #:spec (cosh x) #:impl (from-libm 'cosh) #:cost 1.650]
136+
[acos.f64 #:spec (acos x) #:impl (from-libm 'acos) #:cost 0.500]
137+
[acosh.f64 #:spec (acosh x) #:impl (from-libm 'acosh) #:cost 0.850]
138+
[asin.f64 #:spec (asin x) #:impl (from-libm 'asin) #:cost 0.500]
139+
[asinh.f64 #:spec (asinh x) #:impl (from-libm 'asinh) #:cost 1.125]
140+
[atan.f64 #:spec (atan x) #:impl (from-libm 'atan) #:cost 1.100]
141+
[atanh.f64 #:spec (atanh x) #:impl (from-libm 'atanh) #:cost 0.450]
142+
[cbrt.f64 #:spec (cbrt x) #:impl (from-libm 'cbrt) #:cost 2.000]
143+
[ceil.f64 #:spec (ceil x) #:impl (from-libm 'ceil) #:cost 0.250]
144+
[erf.f64 #:spec (erf x) #:impl (from-libm 'erf) #:cost 1.125]
145+
[exp.f64 #:spec (exp x) #:impl (from-libm 'exp) #:cost 1.375]
146+
[exp2.f64 #:spec (exp2 x) #:impl (from-libm 'exp2) #:cost 1.175]
147+
[floor.f64 #:spec (floor x) #:impl (from-libm 'floor) #:cost 0.300]
148+
[lgamma.f64 #:spec (lgamma x) #:impl (from-libm 'lgamma) #:cost 2.250]
149+
[log.f64 #:spec (log x) #:impl (from-libm 'log) #:cost 0.750]
150+
[log10.f64 #:spec (log10 x) #:impl (from-libm 'log10) #:cost 1.175]
151+
[log2.f64 #:spec (log2 x) #:impl (from-libm 'log2) #:cost 0.850]
152+
[logb.f64 #:spec (logb x) #:impl (from-libm 'logb) #:cost 0.350]
153+
[rint.f64 #:spec (rint x) #:impl (from-libm 'rint) #:cost 0.300]
154+
[round.f64 #:spec (round x) #:impl (from-libm 'round) #:cost 0.850]
155+
[sqrt.f64 #:spec (sqrt x) #:impl (from-libm 'sqrt) #:cost 0.250]
156+
[tanh.f64 #:spec (tanh x) #:impl (from-libm 'tanh) #:cost 1.000]
157+
[tgamma.f64 #:spec (tgamma x) #:impl (from-libm 'tgamma) #:cost 2.625]
158+
[trunc.f64 #:spec (trunc x) #:impl (from-libm 'trunc) #:cost 0.250])
159+
160+
(define-operations ([x <binary64>] [y <binary64>]) <binary64> #:fpcore (:precision binary64)
161+
[pow.f64 #:spec (pow x y) #:impl (from-libm 'pow) #:cost 2.000]
162+
[atan2.f64 #:spec (atan2 x y) #:impl (from-libm 'atan2) #:cost 2.000]
163+
[copysign.f64 #:spec (copysign x y) #:impl (from-libm 'copysign) #:cost 0.200]
164+
[fdim.f64 #:spec (fdim x y) #:impl (from-libm 'fdim) #:cost 0.750]
165+
[fmax.f64 #:spec (fmax x y) #:impl (from-libm 'fmax) #:cost 0.250]
166+
[fmin.f64 #:spec (fmin x y) #:impl (from-libm 'fmin) #:cost 0.250]
167+
[fmod.f64 #:spec (fmod x y) #:impl (from-libm 'fmod) #:cost 1.750]
168+
[remainder.f64 #:spec (remainder x y) #:impl (from-libm 'remainder) #:cost 1.000])
169+
170+
(define-operations ([x <binary64>]) <binary64> #:fpcore (:precision binary64)
171+
[erfc.f64 #:spec (- 1 (erf x)) #:impl (from-libm 'erfc) #:fpcore (erfc x) #:cost 0.900]
172+
[expm1.f64 #:spec (- (exp x) 1) #:impl (from-libm 'expm1) #:fpcore (expm1 x) #:cost 0.900]
173+
[log1p.f64 #:spec (log (+ 1 x)) #:impl (from-libm 'log1p) #:fpcore (log1p x) #:cost 1.300])
174+
175+
(define-operation (hypot.f64 [x <binary64>] [y <binary64>]) <binary64>
176+
#:spec (sqrt (+ (* x x) (* y y))) #:impl (from-libm 'hypot)
177+
#:fpcore (! :precision binary64 (hypot x y)) #:cost 1.700)
178+
179+
(define-operation (fma.f64 [x <binary64>] [y <binary64>] [z <binary64>]) <binary64>
180+
#:spec (+ (* x y) z) #:impl (from-libm 'fma)
181+
#:fpcore (! :precision binary64 (fma x y z)) #:cost 0.375)
180182

181183
;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CASTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
182184

0 commit comments

Comments
 (0)