mirror of
git://repo.or.cz/tinycc.git
synced 2026-06-17 15:44:18 +08:00
arm double to (unsigned) long long conversion
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86_64-win32 (push) Has been cancelled
build and test / test-i386-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86_64-win32 (push) Has been cancelled
build and test / test-i386-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled
Bug found with openssl test suite.
This commit is contained in:
parent
f8eb5f4ab8
commit
199e135142
@ -177,7 +177,7 @@ void __aeabi_ ## name(double_unsigned_struct val) \
|
|||||||
ret.high = 0; \
|
ret.high = 0; \
|
||||||
ret.low = 1 << exp; \
|
ret.low = 1 << exp; \
|
||||||
if (exp > DOUBLE_FRAC_BITS - 32) { \
|
if (exp > DOUBLE_FRAC_BITS - 32) { \
|
||||||
high_shift = exp - DOUBLE_FRAC_BITS - 32; \
|
high_shift = exp - (DOUBLE_FRAC_BITS - 32); \
|
||||||
ret.low |= val.high << high_shift; \
|
ret.low |= val.high << high_shift; \
|
||||||
ret.low |= val.low >> (32 - high_shift); \
|
ret.low |= val.low >> (32 - high_shift); \
|
||||||
} else \
|
} else \
|
||||||
|
|||||||
@ -14,9 +14,11 @@ conv (union u *p)
|
|||||||
int main (void)
|
int main (void)
|
||||||
{
|
{
|
||||||
union u v;
|
union u v;
|
||||||
|
double d = 1234567890.0;
|
||||||
|
|
||||||
v.ld = 42;
|
v.ld = 42;
|
||||||
conv (&v);
|
conv (&v);
|
||||||
printf ("%lu\n", v.ul);
|
printf ("%lu\n", v.ul);
|
||||||
|
printf ("%llu\n", (unsigned long long)d);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +1,2 @@
|
|||||||
42
|
42
|
||||||
|
1234567890
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user