From ff608eef712f1ae64334d66b59d2a05b0bed534d Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Sun, 14 Aug 2011 07:11:45 +0100 Subject: [PATCH] Change reduce_equal to return false if no instances are executing --- builtins.m4 | 2 +- docs/ispc.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builtins.m4 b/builtins.m4 index 862a94e0..7764f0c6 100644 --- a/builtins.m4 +++ b/builtins.m4 @@ -1420,7 +1420,7 @@ domixed: br i1 %alloff, label %doalloff, label %actuallymixed doalloff: - ret i1 undef ;; should we return an actual value here? + ret i1 false ;; this seems safest actuallymixed: ; First, figure out which lane is the first active one diff --git a/docs/ispc.txt b/docs/ispc.txt index 8621cba3..543e6c99 100644 --- a/docs/ispc.txt +++ b/docs/ispc.txt @@ -1850,8 +1850,8 @@ There are also variants of these functions that return the value as a reference uniform unsigned int64 sameval) uniform bool reduce_equal(double, reference uniform double sameval) -The value returned by the ``reduce_equal()`` function is undefined if -it is called when none of the program instances are running. +If called when none of the program instances are running, +``reduce_equal()`` will return ``false``. There are also a number of functions to compute "scan"s of values across the program instances. For example, the ``exclusive_scan_and()`` function