Skip to content

Commit

Permalink
Remove LLVM update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sdogruyol committed Jan 4, 2018
1 parent 6780faf commit dce67b5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 36 deletions.
13 changes: 6 additions & 7 deletions src/math/libm.cr
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
{% end %}

lib LibM
# ## To be uncommented once LLVM is updated
# LLVM binary operations
# fun div_i32 = "llvm.sdiv"(value1 : Int32, value2 : Int32) : Int32
# fun div_f32 = "llvm.fdiv"(value1 : Float32, value2 : Float32) : Float32
# fun div_f64 = "llvm.fdiv"(value1 : Float64, value2 : Float64) : Float64
# fun rem_i32 = "llvm.srem"(value1 : Int32, value2 : Int32) : Int32
# fun rem_f32 = "llvm.frem"(value1 : Float32, value2 : Float32) : Float32
# fun rem_f64 = "llvm.frem"(value1 : Float64, value2 : Float64) : Float64
fun div_i32 = "llvm.sdiv"(value1 : Int32, value2 : Int32) : Int32
fun div_f32 = "llvm.fdiv"(value1 : Float32, value2 : Float32) : Float32
fun div_f64 = "llvm.fdiv"(value1 : Float64, value2 : Float64) : Float64
fun rem_i32 = "llvm.srem"(value1 : Int32, value2 : Int32) : Int32
fun rem_f32 = "llvm.frem"(value1 : Float32, value2 : Float32) : Float32
fun rem_f64 = "llvm.frem"(value1 : Float64, value2 : Float64) : Float64

# LLVM standard C library intrinsics
fun ceil_f32 = "llvm.ceil.f32"(value : Float32) : Float32
Expand Down
56 changes: 27 additions & 29 deletions src/math/math.cr
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,21 @@ module Math
end
{% end %}

# ## To be uncommented once LLVM is updated
# def div(value1 : Int32, value2 : Int32)
# LibM.div_i32(value1, value2)
# end
#
# def div(value1 : Float32, value2 : Float32)
# LibM.div_f32(value1, value2)
# end
#
# def div(value1 : Float64, value2 : Float64)
# LibM.div_f64(value1, value2)
# end
#
# def div(value1, value2)
# LibM.div(value1, value2)
# end
def div(value1 : Int32, value2 : Int32)
LibM.div_i32(value1, value2)
end

def div(value1 : Float32, value2 : Float32)
LibM.div_f32(value1, value2)
end

def div(value1 : Float64, value2 : Float64)
LibM.div_f64(value1, value2)
end

def div(value1, value2)
LibM.div(value1, value2)
end

# Returns the logarithm of *numeric* to the base *base*.
def log(numeric, base)
Expand Down Expand Up @@ -157,22 +156,21 @@ module Math
value1 <= value2 ? value1 : value2
end

# ## To be uncommented once LLVM is updated
# def rem(value1 : Int32, value2 : Int32)
# LibM.rem_i32(value1, value2)
# end
def rem(value1 : Int32, value2 : Int32)
LibM.rem_i32(value1, value2)
end

# def rem(value1 : Float32, value2 : Float32)
# LibM.rem_f32(value1, value2)
# end
def rem(value1 : Float32, value2 : Float32)
LibM.rem_f32(value1, value2)
end

# def rem(value1 : Float64, value2 : Float64)
# LibM.rem_f64(value1, value2)
# end
def rem(value1 : Float64, value2 : Float64)
LibM.rem_f64(value1, value2)
end

# def rem(value1, value2)
# LibM.rem(value1, value2)
# end
def rem(value1, value2)
LibM.rem(value1, value2)
end

{% for name in %w(besselj bessely) %}
# Calculates {{name.id}} with parameters *value1* and *value2*.
Expand Down

0 comments on commit dce67b5

Please sign in to comment.