summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_arit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
index 3291ec40af5..08aec799a33 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
@@ -386,6 +386,10 @@ lp_build_add(struct lp_build_context *bld,
return lp_build_intrinsic_binary(builder, intrinsic, lp_build_vec_type(bld->gallivm, bld->type), a, b);
}
+ /* TODO: handle signed case */
+ if(type.norm && !type.floating && !type.fixed && !type.sign)
+ a = lp_build_min_simple(bld, a, lp_build_comp(bld, b));
+
if(LLVMIsConstant(a) && LLVMIsConstant(b))
if (type.floating)
res = LLVMConstFAdd(a, b);
@@ -663,6 +667,10 @@ lp_build_sub(struct lp_build_context *bld,
return lp_build_intrinsic_binary(builder, intrinsic, lp_build_vec_type(bld->gallivm, bld->type), a, b);
}
+ /* TODO: handle signed case */
+ if(type.norm && !type.floating && !type.fixed && !type.sign)
+ a = lp_build_max_simple(bld, a, b);
+
if(LLVMIsConstant(a) && LLVMIsConstant(b))
if (type.floating)
res = LLVMConstFSub(a, b);