Open stefankarschti opened 1 year ago
https://github.com/stefankarschti/inputosm/blob/8700abed527f863ca0d726045ccf1974795119c8/src/inputosmpbf.cpp#L123
possible solution:
`
inline int64_t to_sint64(uint64_t v64) noexcept { // original: // return (v64 & 1) ? -(int64_t)((v64 + 1) / 2) : (v64 + 1) / 2; // branchless: return (int64_t)((v64 + 1) / 2) (1 - 2 (int64_t)(v64 & 1)); }
inline int64_t to_sint64(uint64_t v64) noexcept { // original: // return (v64 & 1) ? -(int64_t)((v64 + 1) / 2) : (v64 + 1) / 2;
// branchless: return (int64_t)((v64 + 1) / 2) (1 - 2 (int64_t)(v64 & 1)); }
https://github.com/stefankarschti/inputosm/blob/8700abed527f863ca0d726045ccf1974795119c8/src/inputosmpbf.cpp#L123
possible solution:
`
`