Skip to content

Commit cd028d9

Browse files
committed
[crt] Fix __ftoll ABI and left shift amount
1 parent 052551d commit cd028d9

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/crt/ftoll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ long long _ftoll_c(float x)
1212
const long long result = mantissa >> (bias + FLT_MANT_DIG - 1 - exponent);
1313
return parts.sign ? -result : result;
1414
}
15-
const long long result = (long long)mantissa << (exponent - bias);
15+
const long long result = (long long)mantissa << (exponent - (bias + FLT_MANT_DIG - 1));
1616
return parts.sign ? -result : result;
1717
}

src/crt/ftoll.src

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ __ftoll:
66
__ftoull:
77
__dtoll:
88
__dtoull:
9-
ld e, a
109
ld d, a
11-
push iy, de, bc
10+
push iy, de, hl
1211
call __ftoll_c
1312
pop af, af, iy
1413
ret

0 commit comments

Comments
 (0)