llvmpipe: fix broken lp_build_abs()
This commit is contained in:
parent
b06b3a4925
commit
6e2a93739e
|
@ -591,7 +591,8 @@ lp_build_abs(struct lp_build_context *bld,
|
||||||
if(type.floating) {
|
if(type.floating) {
|
||||||
/* Mask out the sign bit */
|
/* Mask out the sign bit */
|
||||||
LLVMTypeRef int_vec_type = lp_build_int_vec_type(type);
|
LLVMTypeRef int_vec_type = lp_build_int_vec_type(type);
|
||||||
LLVMValueRef mask = lp_build_int_const_scalar(type, ((unsigned long long)1 << type.width) - 1);
|
unsigned long absMask = ~(1 << (type.width - 1));
|
||||||
|
LLVMValueRef mask = lp_build_int_const_scalar(type, ((unsigned long long) absMask));
|
||||||
a = LLVMBuildBitCast(bld->builder, a, int_vec_type, "");
|
a = LLVMBuildBitCast(bld->builder, a, int_vec_type, "");
|
||||||
a = LLVMBuildAnd(bld->builder, a, mask, "");
|
a = LLVMBuildAnd(bld->builder, a, mask, "");
|
||||||
a = LLVMBuildBitCast(bld->builder, a, vec_type, "");
|
a = LLVMBuildBitCast(bld->builder, a, vec_type, "");
|
||||||
|
|
Loading…
Reference in New Issue