Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/module/os/linux/spl/spl-generic.c
Show First 20 Lines • Show All 278 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Implementation of 64-bit signed division for 32-bit machines. | * Implementation of 64-bit signed division for 32-bit machines. | ||||
*/ | */ | ||||
int64_t | int64_t | ||||
__divdi3(int64_t u, int64_t v) | __divdi3(int64_t u, int64_t v) | ||||
{ | { | ||||
int64_t q, t; | int64_t q, t; | ||||
// cppcheck-suppress shiftTooManyBitsSigned | |||||
q = __udivdi3(abs64(u), abs64(v)); | q = __udivdi3(abs64(u), abs64(v)); | ||||
// cppcheck-suppress shiftTooManyBitsSigned | |||||
t = (u ^ v) >> 63; // If u, v have different | t = (u ^ v) >> 63; // If u, v have different | ||||
return ((q ^ t) - t); // signs, negate q. | return ((q ^ t) - t); // signs, negate q. | ||||
} | } | ||||
EXPORT_SYMBOL(__divdi3); | EXPORT_SYMBOL(__divdi3); | ||||
/* | /* | ||||
* Implementation of 64-bit unsigned modulo for 32-bit machines. | * Implementation of 64-bit unsigned modulo for 32-bit machines. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 546 Lines • Show Last 20 Lines |