mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-03 02:10:24 +01:00
llvmpipe: In the abcense of a min/max intrinsic, use the comparison intrinsics.
This commit is contained in:
parent
b995af25d0
commit
45fb66ab7b
3 changed files with 7 additions and 11 deletions
|
|
@ -52,6 +52,7 @@
|
|||
#include "lp_bld_type.h"
|
||||
#include "lp_bld_const.h"
|
||||
#include "lp_bld_intr.h"
|
||||
#include "lp_bld_logic.h"
|
||||
#include "lp_bld_arit.h"
|
||||
|
||||
|
||||
|
|
@ -98,11 +99,8 @@ lp_build_min_simple(struct lp_build_context *bld,
|
|||
if(intrinsic)
|
||||
return lp_build_intrinsic_binary(bld->builder, intrinsic, lp_build_vec_type(bld->type), a, b);
|
||||
|
||||
if(type.floating)
|
||||
cond = LLVMBuildFCmp(bld->builder, LLVMRealULT, a, b, "");
|
||||
else
|
||||
cond = LLVMBuildICmp(bld->builder, type.sign ? LLVMIntSLT : LLVMIntULT, a, b, "");
|
||||
return LLVMBuildSelect(bld->builder, cond, a, b, "");
|
||||
cond = lp_build_cmp(bld, PIPE_FUNC_LESS, a, b);
|
||||
return lp_build_select(bld, cond, a, b);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -149,11 +147,8 @@ lp_build_max_simple(struct lp_build_context *bld,
|
|||
if(intrinsic)
|
||||
return lp_build_intrinsic_binary(bld->builder, intrinsic, lp_build_vec_type(bld->type), a, b);
|
||||
|
||||
if(type.floating)
|
||||
cond = LLVMBuildFCmp(bld->builder, LLVMRealULT, a, b, "");
|
||||
else
|
||||
cond = LLVMBuildICmp(bld->builder, type.sign ? LLVMIntSLT : LLVMIntULT, a, b, "");
|
||||
return LLVMBuildSelect(bld->builder, cond, b, a, "");
|
||||
cond = lp_build_cmp(bld, PIPE_FUNC_GREATER, a, b);
|
||||
return lp_build_select(bld, cond, a, b);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "pipe/p_defines.h"
|
||||
#include "lp_bld_type.h"
|
||||
#include "lp_bld_const.h"
|
||||
#include "lp_bld_intr.h"
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@
|
|||
|
||||
#include <llvm-c/Core.h>
|
||||
|
||||
#include "pipe/p_defines.h" /* For PIPE_FUNC_xxx */
|
||||
|
||||
|
||||
union lp_type type;
|
||||
struct lp_build_context;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue