You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But the sign computation is incorrect here. The result should be the following: left upper bits of sign and then bits lower bits of value. But m1 is shifted left by left bits in the current implementation, so we will use bits bits of the sign. It's an error.
The proper sign computation should be
const INT64 sign = (wide < 0) ? (m1 << bits) : 0;
As an example, you can consider the following case that I met:
value is 0xffea2e4, bits is 28.
The expected result is 0xfffffffffffea2e4: 64 - 28 = 36 upper bits of the sign and then 28 bits of the value.
The actual result of the current implementation is 0xfffffff00ffea2e4 , that is obviously wrong.
The text was updated successfully, but these errors were encountered:
Currently,
detour_sign_extend
has the following implementation:But the
sign
computation is incorrect here. The result should be the following:left
upper bits ofsign
and thenbits
lower bits ofvalue
. Butm1
is shifted left byleft
bits in the current implementation, so we will usebits
bits of thesign
. It's an error.The proper
sign
computation should beAs an example, you can consider the following case that I met:
value
is0xffea2e4
,bits
is 28.0xfffffffffffea2e4
:64 - 28 = 36
upper bits of thesign
and then28
bits of thevalue
.0xfffffff00ffea2e4
, that is obviously wrong.The text was updated successfully, but these errors were encountered: