I would normally use a mask, but in this case I decided to use an equivalent notation more for the sake of readablity. In the full fragment:
if (isEax) {
result = (Timer << 32) >> 32;
}
else {
result = (Timer) >> 32;
}
It looks much more clear what intention of this code was - that we are splitting the Timer value on two chunks, 32 bits each. It is like:
if (isEax) {
result = (Timer << DELIM) >> DELIM;
}
else {
result = (Timer) >> DELIM;
}
I don't think it makes much sense to refactor it for using a mask, the performance gain will be minor to none, while the meaning of the code will become less obvious.
I would normally use a mask, but in this case I decided to use an equivalent notation more for the sake of readablity. In the full fragment:
It looks much more clear what intention of this code was - that we are splitting the
Timer
value on two chunks, 32 bits each. It is like:I don't think it makes much sense to refactor it for using a mask, the performance gain will be minor to none, while the meaning of the code will become less obvious.