Skip to content

Commit

Permalink
Int128 left shift: workaround for #3596 until upstream bug is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed Jul 1, 2013
1 parent dcd3d13 commit 61d0311
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions base/int.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,21 @@ mod(x::Int64, y::Int64) = box(Int64,smod_int(unbox(Int64,x),unbox(Int64,y)))
<<(x::Int16, y::Int32) = box(Int16,shl_int(unbox(Int16,x),unbox(Int32,y)))
<<(x::Int32, y::Int32) = box(Int32,shl_int(unbox(Int32,x),unbox(Int32,y)))
<<(x::Int64, y::Int32) = box(Int64,shl_int(unbox(Int64,x),unbox(Int32,y)))
if Int === Int64
<<(x::Int128, y::Int32) = box(Int128,shl_int(unbox(Int128,x),unbox(Int32,y)))
else
<<(x::Int128, y::Int32) = y==0 ? x : box(Int128,shl_int(unbox(Int128,x),unbox(Int32,y)))
end

<<(x::Uint8, y::Int32) = box(Uint8,shl_int(unbox(Uint8,x),unbox(Int32,y)))
<<(x::Uint16, y::Int32) = box(Uint16,shl_int(unbox(Uint16,x),unbox(Int32,y)))
<<(x::Uint32, y::Int32) = box(Uint32,shl_int(unbox(Int32,x),unbox(Uint32,y)))
<<(x::Uint64, y::Int32) = box(Uint64,shl_int(unbox(Uint64,x),unbox(Int32,y)))
if Int === Int64
<<(x::Uint128, y::Int32) = box(Uint128,shl_int(unbox(Uint128,x),unbox(Int32,y)))
else
<<(x::Uint128, y::Int32) = y==0 ? x : box(Uint128,shl_int(unbox(Uint128,x),unbox(Int32,y)))
end

>>(x::Int8, y::Int32) = box(Int8,ashr_int(unbox(Int8,x),unbox(Int32,y)))
>>(x::Int16, y::Int32) = box(Int16,ashr_int(unbox(Int16,x),unbox(Int32,y)))
Expand Down

0 comments on commit 61d0311

Please sign in to comment.