File tree 1 file changed +14
-11
lines changed
1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -13,28 +13,31 @@ __dtoull:
13
13
jr z, .zero_or_one
14
14
bit 7, b
15
15
push af
16
- res 7, b
16
+ ; res 7, b ; not needed since this bit is shifted out later on
17
17
push hl
18
18
; -((Float64_mant_bits + Float64_bias) << 4)
19
- ld hl, $FFC010 ; -16368 ; -$3FF0
19
+ ; ld hl, $FFC010 ; -16368 ; -$3FF0
20
20
21
- ; clears the exponent field without touching the mantissa
22
- ; sets the LSB of the exponent since x is normalized
23
- ld a, c
24
- or a, l ; or a, $10
25
- and a, $1F
26
-
27
- add hl, bc
21
+ ; extract the exponent
22
+ ld h, b
23
+ ld l, c
28
24
; HL <<= 4
29
25
add hl, hl
30
26
add hl, hl
31
27
add hl, hl
32
28
add hl, hl
29
+ ; inc hl
33
30
31
+ ; clears the exponent field without touching the mantissa
32
+ ; sets the LSB of the exponent since x is normalized
33
+ ld a, c
34
+ or a, $10
35
+ and a, $1F
34
36
ld c, a
35
37
ld b, 0
36
- ld a, h
37
- sub a, 52 + 1 ; float64 mantissa bits
38
+
39
+ ld a, h ; expon
40
+ sub a, 52 + 1 - 1 ; float64 mantissa bits + CPL trick - inc HL
38
41
jr c, .shift_right
39
42
; shift_left
40
43
; expon >= 52 or [52, 63]
You can’t perform that action at this time.
0 commit comments