diff options
author | Brian Paul <[email protected]> | 2009-12-14 15:24:31 -0700 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-12-16 15:06:16 +0000 |
commit | 43d6c81ae2b3cb263f803bb9881c0823c1ed7dda (patch) | |
tree | 4cbf4e03a58f199a371b73b8707c2042ffb355e6 | |
parent | 2ddee2cfbcef59128b2a251d5391ddc2b4aea4bb (diff) |
llvmpipe: fix broken lp_build_abs()
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_bld_arit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_arit.c b/src/gallium/drivers/llvmpipe/lp_bld_arit.c index 847c2a34b1f..eea6b5d6a5c 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_arit.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_arit.c @@ -629,7 +629,8 @@ lp_build_abs(struct lp_build_context *bld, if(type.floating) { /* Mask out the sign bit */ 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 = LLVMBuildAnd(bld->builder, a, mask, ""); a = LLVMBuildBitCast(bld->builder, a, vec_type, ""); |