aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/llvm_backend.cpp')
-rw-r--r--src/llvm_backend.cpp36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp
index c31d1f34f..dbc059d5f 100644
--- a/src/llvm_backend.cpp
+++ b/src/llvm_backend.cpp
@@ -5600,37 +5600,11 @@ LLVMValueRef lb_const_f32(lbModule *m, f32 f, Type *type=t_f32) {
lbValue lb_emit_min(lbProcedure *p, Type *t, lbValue x, lbValue y) {
x = lb_emit_conv(p, x, t);
y = lb_emit_conv(p, y, t);
-
- if (is_type_float(t)) {
- i64 sz = 8*type_size_of(t);
- auto args = array_make<lbValue>(permanent_allocator(), 2);
- args[0] = x;
- args[1] = y;
- switch (sz) {
- case 16: return lb_emit_runtime_call(p, "min_f16", args);
- case 32: return lb_emit_runtime_call(p, "min_f32", args);
- case 64: return lb_emit_runtime_call(p, "min_f64", args);
- }
- GB_PANIC("Unknown float type");
- }
return lb_emit_select(p, lb_emit_comp(p, Token_Lt, x, y), x, y);
}
lbValue lb_emit_max(lbProcedure *p, Type *t, lbValue x, lbValue y) {
x = lb_emit_conv(p, x, t);
y = lb_emit_conv(p, y, t);
-
- if (is_type_float(t)) {
- i64 sz = 8*type_size_of(t);
- auto args = array_make<lbValue>(permanent_allocator(), 2);
- args[0] = x;
- args[1] = y;
- switch (sz) {
- case 16: return lb_emit_runtime_call(p, "max_f16", args);
- case 32: return lb_emit_runtime_call(p, "max_f32", args);
- case 64: return lb_emit_runtime_call(p, "max_f64", args);
- }
- GB_PANIC("Unknown float type");
- }
return lb_emit_select(p, lb_emit_comp(p, Token_Gt, x, y), x, y);
}
@@ -9307,16 +9281,6 @@ lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValue const &tv,
case 128: return lb_emit_runtime_call(p, "abs_complex128", args);
}
GB_PANIC("Unknown complex type");
- } else if (is_type_float(t)) {
- i64 sz = 8*type_size_of(t);
- auto args = array_make<lbValue>(permanent_allocator(), 1);
- args[0] = x;
- switch (sz) {
- case 16: return lb_emit_runtime_call(p, "abs_f16", args);
- case 32: return lb_emit_runtime_call(p, "abs_f32", args);
- case 64: return lb_emit_runtime_call(p, "abs_f64", args);
- }
- GB_PANIC("Unknown float type");
}
lbValue zero = lb_const_nil(p->module, t);
lbValue cond = lb_emit_comp(p, Token_Lt, x, zero);