vm: formatting of sign_mask.

db4
John Benediktsson 2014-06-02 07:54:01 -07:00
parent c2c6225955
commit fd1dc5ce01
1 changed files with 3 additions and 1 deletions

View File

@ -44,7 +44,9 @@ void factor_vm::primitive_fixnum_divmod() {
* If we're shifting right by n bits, we won't overflow as long as none of the * If we're shifting right by n bits, we won't overflow as long as none of the
* high WORD_SIZE-TAG_BITS-n bits are set. * high WORD_SIZE-TAG_BITS-n bits are set.
*/ */
inline fixnum factor_vm::sign_mask(fixnum x) { return x >> (WORD_SIZE - 1); } inline fixnum factor_vm::sign_mask(fixnum x) {
return x >> (WORD_SIZE - 1);
}
inline fixnum factor_vm::branchless_max(fixnum x, fixnum y) { inline fixnum factor_vm::branchless_max(fixnum x, fixnum y) {
return (x - ((x - y) & sign_mask(x - y))); return (x - ((x - y) & sign_mask(x - y)));