From 6326924de70c12d2b11cab6d1bf7f14733c1d462 Mon Sep 17 00:00:00 2001 From: Jean-Luc Duprat Date: Fri, 18 Jan 2013 11:19:54 -0800 Subject: [PATCH] Fixes to the implementations of any() and none() in the stdlib. These make sure that inactive vector lanes do not interfere with the results --- stdlib.ispc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib.ispc b/stdlib.ispc index 81ebac70..4e06f5da 100644 --- a/stdlib.ispc +++ b/stdlib.ispc @@ -340,9 +340,9 @@ static inline uniform bool any(bool v) { // We only care about whether "any" is true for the active program instances, // so we have to make v with the current program mask. #ifdef ISPC_TARGET_GENERIC - return __any(v | !__mask); + return __any(v & __mask); #else - return __any(__sext_varying_bool(v) | !__mask); + return __any(__sext_varying_bool(v) & __mask); #endif } @@ -364,9 +364,9 @@ static inline uniform bool none(bool v) { // so we're only looking at the current lanes #ifdef ISPC_TARGET_GENERIC - return __none(v | !__mask); + return __none(v & __mask); #else - return __none(__sext_varying_bool(v) | !__mask); + return __none(__sext_varying_bool(v) & __mask); #endif }