From fd846fbe77243e2fdb6691c1bb1d7542a919f26d Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Thu, 12 Apr 2012 10:28:15 -0700 Subject: [PATCH] Fix bug in __gather_base_offsets_32. In short, we weren't correctly zeroing the compile-time constant portion of the offsets for lanes that aren't executing. (!) Fixes issue #235. --- builtins/util.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtins/util.m4 b/builtins/util.m4 index 26cbfafb..501f2e47 100644 --- a/builtins/util.m4 +++ b/builtins/util.m4 @@ -2880,11 +2880,11 @@ define <$1 x $2> @__gather_base_offsets32_$2(i8 * %ptr, <$1 x i32> %offsets, i32 %newDelta = load <$1 x i32> * %deltaPtr %ret0 = call <$1 x $2> @__gather_elt32_$2(i8 * %ptr, <$1 x i32> %newOffsets, - i32 %offset_scale, <$1 x i32> %offset_delta, + i32 %offset_scale, <$1 x i32> %newDelta, <$1 x $2> undef, i32 0) forloop(lane, 1, eval($1-1), `patsubst(patsubst(`%retLANE = call <$1 x $2> @__gather_elt32_$2(i8 * %ptr, - <$1 x i32> %newOffsets, i32 %offset_scale, <$1 x i32> %offset_delta, + <$1 x i32> %newOffsets, i32 %offset_scale, <$1 x i32> %newDelta, <$1 x $2> %retPREV, i32 LANE) ', `LANE', lane), `PREV', eval(lane-1))') ret <$1 x $2> %ret`'eval($1-1)