Skip to content

Commit 2dc3fda

Browse files
authored
Merge pull request #1318 from herbie-fp/convert-all-platforms
Convert all platforms to the new `#lang`
2 parents 550c6d8 + 5b97a69 commit 2dc3fda

File tree

8 files changed

+840
-1110
lines changed

8 files changed

+840
-1110
lines changed

infra/softposit.rkt

Lines changed: 143 additions & 122 deletions
Large diffs are not rendered by default.

src/platforms/c-windows.rkt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
(define-representation <bool> #:cost boolean-move-cost)
1616

1717
(define-operations () <bool>
18-
[TRUE #:spec (TRUE) #:impl (const true) #:cost boolean-move-cost]
19-
[FALSE #:spec (FALSE) #:impl (const false) #:cost boolean-move-cost])
18+
[TRUE #:spec (TRUE) #:impl (const true) #:fpcore TRUE #:cost boolean-move-cost]
19+
[FALSE #:spec (FALSE) #:impl (const false) #:fpcore FALSE #:cost boolean-move-cost])
2020

2121
(define-operations ([x <bool>] [y <bool>]) <bool>
2222
[and #:spec (and x y) #:impl (lambda v (andmap values v)) #:cost boolean-move-cost]
@@ -39,10 +39,10 @@
3939

4040
(parameterize ([fpcore-context '(:precision binary32)])
4141
(define-operations () <binary32>
42-
[PI.f32 #:spec (PI) #:impl (const (flsingle pi)) #:cost 32bit-move-cost]
43-
[E.f32 #:spec (E) #:impl (const (flsingle (exp 1))) #:cost 32bit-move-cost]
44-
[INFINITY.f32 #:spec (INFINITY) #:impl (const +inf.0) #:cost 32bit-move-cost]
45-
[NAN.f32 #:spec (NAN) #:impl (const +nan.0) #:cost 32bit-move-cost])
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])
4646

4747
(define-operation (neg.f32 [x <binary32>]) <binary32>
4848
#:spec (neg x) #:impl (compose flsingle -) #:fpcore (- x) #:cost 0.125)
@@ -65,7 +65,7 @@
6565
[asinh.f32 #:spec (asinh x) #:impl (from-libm 'asinhf) #:cost 1.125]
6666
[atan.f32 #:spec (atan x) #:impl (from-libm 'atanf) #:cost 1.100]
6767
[atanh.f32 #:spec (atanh x) #:impl (from-libm 'atanhf) #:cost 0.500]
68-
[cbrt.f32 #:spec (cbrt x) #:impl (from-libm 'cbrtf) #:cost 2.00]
68+
[cbrt.f32 #:spec (cbrt x) #:impl (from-libm 'cbrtf) #:cost 2.000]
6969
[ceil.f32 #:spec (ceil x) #:impl (from-libm 'ceilf) #:cost 0.250]
7070
[erf.f32 #:spec (erf x) #:impl (from-libm 'erff) #:cost 1.125]
7171
[exp.f32 #:spec (exp x) #:impl (from-libm 'expf) #:cost 1.375]
@@ -110,10 +110,10 @@
110110

111111
(parameterize ([fpcore-context '(:precision binary64)])
112112
(define-operations () <binary64>
113-
[PI.f64 #:spec (PI) #:impl (const pi) #:cost 64bit-move-cost]
114-
[E.f64 #:spec (E) #:impl (const (exp 1)) #:cost 64bit-move-cost]
115-
[INFINITY #:spec (INFINITY) #:impl (const +inf.0) #:cost 64bit-move-cost]
116-
[NAN.f64 #:spec (NAN) #:impl (const +nan.0) #:cost 64bit-move-cost])
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])
117117

118118
(define-operation (neg.f64 [x <binary64>]) <binary64>
119119
#:spec (neg x) #:impl - #:fpcore (- x) #:cost 0.125)

src/platforms/c.rkt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
(define-representation <bool> #:cost boolean-move-cost)
1616

1717
(define-operations () <bool>
18-
[TRUE #:spec (TRUE) #:impl (const true) #:cost boolean-move-cost]
19-
[FALSE #:spec (FALSE) #:impl (const false) #:cost boolean-move-cost])
18+
[TRUE #:spec (TRUE) #:impl (const true) #:fpcore TRUE #:cost boolean-move-cost]
19+
[FALSE #:spec (FALSE) #:impl (const false) #:fpcore FALSE #:cost boolean-move-cost])
2020

2121
(define-operations ([x <bool>] [y <bool>]) <bool>
2222
[and #:spec (and x y) #:impl (lambda v (andmap values v)) #:cost boolean-move-cost]
@@ -39,10 +39,10 @@
3939

4040
(parameterize ([fpcore-context '(:precision binary32)])
4141
(define-operations () <binary32>
42-
[PI.f32 #:spec (PI) #:impl (const (flsingle pi)) #:cost 32bit-move-cost]
43-
[E.f32 #:spec (E) #:impl (const (flsingle (exp 1))) #:cost 32bit-move-cost]
44-
[INFINITY.f32 #:spec (INFINITY) #:impl (const +inf.0) #:cost 32bit-move-cost]
45-
[NAN.f32 #:spec (NAN) #:impl (const +nan.0) #:cost 32bit-move-cost])
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])
4646

4747
(define-operation (neg.f32 [x <binary32>]) <binary32>
4848
#:spec (neg x) #:impl (compose flsingle -) #:fpcore (- x) #:cost 0.125)
@@ -66,7 +66,7 @@
6666
[asinh.f32 #:spec (asinh x) #:impl (from-libm 'asinhf) #:cost 1.125]
6767
[atan.f32 #:spec (atan x) #:impl (from-libm 'atanf) #:cost 1.100]
6868
[atanh.f32 #:spec (atanh x) #:impl (from-libm 'atanhf) #:cost 0.500]
69-
[cbrt.f32 #:spec (cbrt x) #:impl (from-libm 'cbrtf) #:cost 2.00]
69+
[cbrt.f32 #:spec (cbrt x) #:impl (from-libm 'cbrtf) #:cost 2.000]
7070
[ceil.f32 #:spec (ceil x) #:impl (from-libm 'ceilf) #:cost 0.250]
7171
[erf.f32 #:spec (erf x) #:impl (from-libm 'erff) #:cost 1.125]
7272
[exp.f32 #:spec (exp x) #:impl (from-libm 'expf) #:cost 1.375]
@@ -119,10 +119,10 @@
119119

120120
(parameterize ([fpcore-context '(:precision binary64)])
121121
(define-operations () <binary64>
122-
[PI.f64 #:spec (PI) #:impl (const pi) #:cost 64bit-move-cost]
123-
[E.f64 #:spec (E) #:impl (const (exp 1)) #:cost 64bit-move-cost]
124-
[INFINITY #:spec (INFINITY) #:impl (const +inf.0) #:cost 64bit-move-cost]
125-
[NAN.f64 #:spec (NAN) #:impl (const +nan.0) #:cost 64bit-move-cost])
122+
[PI.f64 #:spec (PI) #:impl (const pi) #:fpcore PI #:cost 64bit-move-cost]
123+
[E.f64 #:spec (E) #:impl (const (exp 1)) #:fpcore E #:cost 64bit-move-cost]
124+
[INFINITY #:spec (INFINITY) #:impl (const +inf.0) #:fpcore INFINITY #:cost 64bit-move-cost]
125+
[NAN.f64 #:spec (NAN) #:impl (const +nan.0) #:fpcore NAN #:cost 64bit-move-cost])
126126

127127
(define-operation (neg.f64 [x <binary64>]) <binary64>
128128
#:spec (neg x) #:impl - #:fpcore (- x) #:cost 0.125)

0 commit comments

Comments
 (0)