<html>
<head>
<base href="https://bugzilla.icculus.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Undefined behavior"
href="https://bugzilla.icculus.org/show_bug.cgi?id=6432#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Undefined behavior"
href="https://bugzilla.icculus.org/show_bug.cgi?id=6432">bug 6432</a>
from <span class="vcard"><a class="email" href="mailto:mine@ukr.net" title="Eugene C. <mine@ukr.net>"> <span class="fn">Eugene C.</span></a>
</span></b>
<pre>Here is another jumpless macro that correctly handles overflows (i.e. always
returns 0xFFFFFFFF) for input values in range [33..63]:
#define MASK_32BITS(shift) ( ( ( (1 << (shift)) ) & ~( (((shift) & 0xFFFFFFE0
) >> 5) << shift ) ) - 1 )
Jumpless version that correctly handles 64-bit integers but not
overflows[33..63]:
#define MASK_32BITS(shift) ( ( ( (1 << (shift)) ) & ~( ((shift) & 32) >> 5 ) )
- 1 )</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>