Skip to content

Commit

Permalink
replace branch in bit shift operators, helps #18135
Browse files Browse the repository at this point in the history
(cherry picked from commit e02692f)
ref #18149
  • Loading branch information
JeffBezanson authored and tkelman committed Aug 20, 2016
1 parent 09f7005 commit 1fb052e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/int.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ trailing_ones(x::Integer) = trailing_zeros(~x)
# note: this early during bootstrap, `>=` is not yet available
# note: we only define Int shift counts here; the generic case is handled later
>>(x::BitInteger, y::Int) =
0 <= y ? x >> unsigned(y) : x << unsigned(-y)
select_value(0 <= y, x >> unsigned(y), x << unsigned(-y))
<<(x::BitInteger, y::Int) =
0 <= y ? x << unsigned(y) : x >> unsigned(-y)
select_value(0 <= y, x << unsigned(y), x >> unsigned(-y))
>>>(x::BitInteger, y::Int) =
0 <= y ? x >>> unsigned(y) : x << unsigned(-y)
select_value(0 <= y, x >>> unsigned(y), x << unsigned(-y))

## integer conversions ##

Expand Down

0 comments on commit 1fb052e

Please sign in to comment.