mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-16 06:30:29 +01:00
gallivm: Use lp_build_div instead of lp_build_mul + lp_build_rcp.
Single divide, so let lp_build_div decide how to implement this. This will save a multiplication in architectures which don't have a RCP intrinsic.
This commit is contained in:
parent
f8533482f4
commit
10ce6779e8
1 changed files with 1 additions and 2 deletions
|
|
@ -1219,8 +1219,7 @@ lp_build_cube_ima(struct lp_build_context *coord_bld, LLVMValueRef coord)
|
|||
/* ima = -0.5 / abs(coord); */
|
||||
LLVMValueRef negHalf = lp_build_const_vec(coord_bld->type, -0.5);
|
||||
LLVMValueRef absCoord = lp_build_abs(coord_bld, coord);
|
||||
LLVMValueRef ima = lp_build_mul(coord_bld, negHalf,
|
||||
lp_build_rcp(coord_bld, absCoord));
|
||||
LLVMValueRef ima = lp_build_div(coord_bld, negHalf, absCoord);
|
||||
return ima;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue