From 1fb052e34e004e4251a67e7005176c2d31aeac0d Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Fri, 19 Aug 2016 14:26:07 -0400 Subject: [PATCH] replace branch in bit shift operators, helps #18135 (cherry picked from commit e02692f7720b000783f225692e9520376ce06fe5) ref #18149 --- base/int.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/int.jl b/base/int.jl index 79cfb0ddafb0b..6b244499f4b0b 100644 --- a/base/int.jl +++ b/base/int.jl @@ -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 ##