From b8d6dd4eb78a2ca27907a3f09c33c6b85ef6c8a0 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 31 May 2021 20:38:10 +0100 Subject: Fix #1004 --- src/llvm_backend.cpp | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'src/llvm_backend.cpp') 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(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(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(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); -- cgit v1.2.3