aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-03-26 14:31:28 +0000
committergingerBill <bill@gingerbill.org>2024-03-26 14:31:28 +0000
commitdf526549e215e9d2ccda3f4eddcf8014c9ba8ebd (patch)
treef08b81c72660d06bb04cf7ca2fdc82b2e49b4ef9 /src
parent1009182f7b35e38e0fba375ad830fc609a7be831 (diff)
Fix `min`/`max` for wasm
Diffstat (limited to 'src')
-rw-r--r--src/llvm_backend_utility.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/llvm_backend_utility.cpp b/src/llvm_backend_utility.cpp
index fb61c41c3..865c3f1ec 100644
--- a/src/llvm_backend_utility.cpp
+++ b/src/llvm_backend_utility.cpp
@@ -124,7 +124,7 @@ gb_internal lbValue lb_emit_select(lbProcedure *p, lbValue cond, lbValue x, lbVa
gb_internal 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);
- bool use_llvm_intrinsic = is_type_float(t) || (is_type_simd_vector(t) && is_type_float(base_array_type(t)));
+ bool use_llvm_intrinsic = !is_arch_wasm() && (is_type_float(t) || (is_type_simd_vector(t) && is_type_float(base_array_type(t))));
if (use_llvm_intrinsic) {
LLVMValueRef args[2] = {x.value, y.value};
LLVMTypeRef types[1] = {lb_type(p->module, t)};
@@ -140,7 +140,7 @@ gb_internal lbValue lb_emit_min(lbProcedure *p, Type *t, lbValue x, lbValue y) {
gb_internal 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);
- bool use_llvm_intrinsic = is_type_float(t) || (is_type_simd_vector(t) && is_type_float(base_array_type(t)));
+ bool use_llvm_intrinsic = !is_arch_wasm() && (is_type_float(t) || (is_type_simd_vector(t) && is_type_float(base_array_type(t))));
if (use_llvm_intrinsic) {
LLVMValueRef args[2] = {x.value, y.value};
LLVMTypeRef types[1] = {lb_type(p->module, t)};