Skip to content

Commit

Permalink
Handle Int128 32-bit fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett committed Feb 8, 2016
1 parent 5f90724 commit e462f12
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions base/int.jl
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,19 @@ if WORD_SIZE == 32
Int128(mod(BigInt(x),BigInt(y)))
end

<<( x::Int128, y::Int) = y == 0 ? x : box(Int128,shl_int(unbox(Int128,x),unbox(Int,y)))
<<( x::UInt128, y::Int) = y == 0 ? x : box(UInt128,shl_int(unbox(UInt128,x),unbox(Int,y)))
>>( x::Int128, y::Int) = y == 0 ? x : box(Int128,ashr_int(unbox(Int128,x),unbox(Int,y)))
>>( x::UInt128, y::Int) = y == 0 ? x : box(UInt128,lshr_int(unbox(UInt128,x),unbox(Int,y)))
>>>(x::Int128, y::Int) = y == 0 ? x : box(Int128,lshr_int(unbox(Int128,x),unbox(Int,y)))
>>>(x::UInt128, y::Int) = y == 0 ? x : box(UInt128,lshr_int(unbox(UInt128,x),unbox(Int,y)))
<<( x::Int128, y::UInt) = y == 0 ? x : box(Int128,shl_int(unbox(Int128,x),unbox(Int,y)))
<<( x::UInt128, y::UInt) = y == 0 ? x : box(UInt128,shl_int(unbox(UInt128,x),unbox(Int,y)))
>>( x::Int128, y::UInt) = y == 0 ? x : box(Int128,ashr_int(unbox(Int128,x),unbox(Int,y)))
>>( x::UInt128, y::UInt) = y == 0 ? x : box(UInt128,lshr_int(unbox(UInt128,x),unbox(Int,y)))
>>>(x::Int128, y::UInt) = y == 0 ? x : box(Int128,lshr_int(unbox(Int128,x),unbox(Int,y)))
>>>(x::UInt128, y::UInt) = y == 0 ? x : box(UInt128,lshr_int(unbox(UInt128,x),unbox(Int,y)))

<<( x::Int128, y::Int) = x << UInt(y)
<<( x::UInt128, y::Int) = x << UInt(y)
>>( x::Int128, y::Int) = x >> UInt(y)
>>( x::UInt128, y::Int) = x >> UInt(y)
>>>(x::Int128, y::Int) = x >>> UInt(y)
>>>(x::UInt128, y::Int) = x >>> UInt(y)
else
*{T<:Union{Int128,UInt128}}(x::T, y::T) = box(T,mul_int(unbox(T,x),unbox(T,y)))

Expand Down

0 comments on commit e462f12

Please sign in to comment.