diff options
author | Jose Fonseca <[email protected]> | 2016-04-04 00:05:33 +0100 |
---|---|---|
committer | Jose Fonseca <[email protected]> | 2016-06-10 13:47:35 +0100 |
commit | 320d1191c61a0a82444605c12e5c4b2ee0b241eb (patch) | |
tree | 3d230eb992c8160e289aec139935cb7629ce2468 /src/gallium/auxiliary/draw | |
parent | 9e8edfa19034ae69139ef10b88f958b4f58d57ea (diff) |
gallivm: Use llvm.fmuladd.*.
Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_llvm.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index b098132033a..87951fa165d 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -1123,10 +1123,8 @@ generate_viewport(struct draw_llvm_variant *variant, /* divide by w */ out = LLVMBuildFMul(builder, out, out3, ""); - /* mult by scale */ - out = LLVMBuildFMul(builder, out, scale, ""); - /* add translation */ - out = LLVMBuildFAdd(builder, out, trans, ""); + /* mult by scale, add translation */ + out = lp_build_fmuladd(builder, out, scale, trans); /* store transformed outputs */ LLVMBuildStore(builder, out, outputs[pos][i]); @@ -1303,22 +1301,19 @@ generate_clipmask(struct draw_llvm *llvm, plane_ptr = LLVMBuildGEP(builder, planes_ptr, indices, 3, ""); plane1 = LLVMBuildLoad(builder, plane_ptr, "plane_y"); planes = lp_build_broadcast(gallivm, vs_type_llvm, plane1); - test = LLVMBuildFMul(builder, planes, cv_y, ""); - sum = LLVMBuildFAdd(builder, sum, test, ""); + sum = lp_build_fmuladd(builder, planes, cv_y, sum); indices[2] = lp_build_const_int32(gallivm, 2); plane_ptr = LLVMBuildGEP(builder, planes_ptr, indices, 3, ""); plane1 = LLVMBuildLoad(builder, plane_ptr, "plane_z"); planes = lp_build_broadcast(gallivm, vs_type_llvm, plane1); - test = LLVMBuildFMul(builder, planes, cv_z, ""); - sum = LLVMBuildFAdd(builder, sum, test, ""); + sum = lp_build_fmuladd(builder, planes, cv_z, sum); indices[2] = lp_build_const_int32(gallivm, 3); plane_ptr = LLVMBuildGEP(builder, planes_ptr, indices, 3, ""); plane1 = LLVMBuildLoad(builder, plane_ptr, "plane_w"); planes = lp_build_broadcast(gallivm, vs_type_llvm, plane1); - test = LLVMBuildFMul(builder, planes, cv_w, ""); - sum = LLVMBuildFAdd(builder, sum, test, ""); + sum = lp_build_fmuladd(builder, planes, cv_w, sum); test = lp_build_compare(gallivm, f32_type, PIPE_FUNC_GREATER, zero, sum); temp = lp_build_const_int_vec(gallivm, i32_type, 1LL << plane_idx); |