|
8 | 8 | "runtime/libm.rkt" ; libm wrapper |
9 | 9 | "../utils/float.rkt" ; for shift/unshift |
10 | 10 | "../syntax/platform.rkt") |
| 11 | +(provide platform) |
11 | 12 |
|
12 | 13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; EMPTY PLATFORM ;;;;;;;;;;;;;;;;;;;;;;;; |
13 | 14 |
|
|
22 | 23 |
|
23 | 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; representation ;;;;;;;;;;;;;;;;;;;;;;;; |
24 | 25 |
|
25 | | -(define bool |
26 | | - (make-representation #:name 'bool |
27 | | - #:type 'bool |
28 | | - #:repr? boolean? |
29 | | - #:bf->repr identity |
30 | | - #:repr->bf identity |
31 | | - #:ordinal->repr (λ (x) (= x 0)) |
32 | | - #:repr->ordinal (λ (x) (if x 1 0)) |
33 | | - #:total-bits 1 |
34 | | - #:special-value? (const #f))) |
| 26 | +(define bool <bool>) |
35 | 27 |
|
36 | 28 | (platform-register-representation! platform #:repr bool #:cost boolean-move-cost) |
37 | 29 |
|
|
59 | 51 |
|
60 | 52 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; representation ;;;;;;;;;;;;;;;;;;;;;;;; |
61 | 53 |
|
62 | | -(define binary32 |
63 | | - (make-representation #:name 'binary32 |
64 | | - #:type 'real |
65 | | - #:repr? flonum? |
66 | | - #:bf->repr bigfloat->float32 |
67 | | - #:repr->bf bf |
68 | | - #:ordinal->repr (shift 31 ordinal->float32) |
69 | | - #:repr->ordinal (unshift 31 float32->ordinal) |
70 | | - #:total-bits 32 |
71 | | - #:special-value? nan?)) |
| 54 | +(define binary32 <binary32>) |
72 | 55 |
|
73 | 56 | (platform-register-representation! platform #:repr binary32 #:cost 32bit-move-cost) |
74 | 57 |
|
|
166 | 149 |
|
167 | 150 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; representation ;;;;;;;;;;;;;;;;;;;;;;;; |
168 | 151 |
|
169 | | -(define binary64 |
170 | | - (make-representation #:name 'binary64 |
171 | | - #:type 'real |
172 | | - #:repr? flonum? |
173 | | - #:bf->repr bigfloat->flonum |
174 | | - #:repr->bf bf |
175 | | - #:ordinal->repr (shift 63 ordinal->flonum) |
176 | | - #:repr->ordinal (unshift 63 flonum->ordinal) |
177 | | - #:total-bits 64 |
178 | | - #:special-value? nan?)) |
| 152 | +(define binary64 <binary64>) |
179 | 153 |
|
180 | 154 | (platform-register-representation! platform #:repr binary64 #:cost 64bit-move-cost) |
181 | 155 |
|
|
0 commit comments