summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorJose Fonseca <[email protected]>2016-04-04 00:05:33 +0100
committerJose Fonseca <[email protected]>2016-06-10 13:47:35 +0100
commit320d1191c61a0a82444605c12e5c4b2ee0b241eb (patch)
tree3d230eb992c8160e289aec139935cb7629ce2468 /src/gallium/drivers
parent9e8edfa19034ae69139ef10b88f958b4f58d57ea (diff)
gallivm: Use llvm.fmuladd.*.
Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_interp.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_interp.c b/src/gallium/drivers/llvmpipe/lp_bld_interp.c
index ceac86abe1d..8e4f029fc81 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_interp.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_interp.c
@@ -307,10 +307,8 @@ attribs_update_simple(struct lp_build_interp_soa_context *bld,
/*
* a = a0 + (x * dadx + y * dady)
*/
- dadx = LLVMBuildFMul(builder, dadx, pixoffx, "");
- dady = LLVMBuildFMul(builder, dady, pixoffy, "");
- a = LLVMBuildFAdd(builder, a, dadx, "");
- a = LLVMBuildFAdd(builder, a, dady, "");
+ a = lp_build_fmuladd(builder, dadx, pixoffx, a);
+ a = lp_build_fmuladd(builder, dady, pixoffy, a);
if (interp == LP_INTERP_PERSPECTIVE) {
if (oow == NULL) {
@@ -437,13 +435,10 @@ coeffs_init(struct lp_build_interp_soa_context *bld,
*/
if (interp != LP_INTERP_CONSTANT &&
interp != LP_INTERP_FACING) {
- LLVMValueRef axaos, ayaos;
- axaos = LLVMBuildFMul(builder, lp_build_broadcast_scalar(setup_bld, bld->x),
- dadxaos, "");
- ayaos = LLVMBuildFMul(builder, lp_build_broadcast_scalar(setup_bld, bld->y),
- dadyaos, "");
- a0aos = LLVMBuildFAdd(builder, a0aos, ayaos, "");
- a0aos = LLVMBuildFAdd(builder, a0aos, axaos, "");
+ LLVMValueRef x = lp_build_broadcast_scalar(setup_bld, bld->x);
+ LLVMValueRef y = lp_build_broadcast_scalar(setup_bld, bld->y);
+ a0aos = lp_build_fmuladd(builder, x, dadxaos, a0aos);
+ a0aos = lp_build_fmuladd(builder, y, dadyaos, a0aos);
}
/*