@@ -4803,8 +4803,8 @@
rtx cmp_result = gen_reg_rtx (<MODE>mode);
rtx not_result = gen_reg_rtx (<MODE>mode);
- emit_insn (gen_vcmpnez<VSX_EXTRACT_WIDTH> (cmp_result, operands[1],
- operands[2]));
+ emit_insn (gen_vcmpne<VSX_EXTRACT_WIDTH> (cmp_result, operands[1],
+ operands[2]));
emit_insn (gen_one_cmpl<mode>2 (not_result, cmp_result));
sh = GET_MODE_SIZE (GET_MODE_INNER (<MODE>mode)) / 2;
@@ -103,6 +103,31 @@ int main() {
The element index in natural element order is returned for the
first match or the number of elements if there is no match. */
/* char */
+ char_src1 = (vector signed char) { 0x40, 0, 0x40, 0x40,
+ 0x40, 0x40, 0x40, 0x40,
On Fri, 2020-05-01 at 09:42 -0700, Carl Love wrote:
> GCC maintainers:
>
> The following patch fixes PR94833, vec_first_match_index does not
> function as described in its description.
>
> The builtin does not handle vector elements which are zero
> correctly.
> The following patch fixes the issue and adds additional test cases to
> verify the vec_first_match_index builtin and related builtins work
> correctly with zero elements.
>
> The patch has been compiled and tested on
>
> powerpc64le-unknown-linux-gnu (Power 9 LE)
>
> with no regression errors.
>
> Please let me know if the patch is acceptable for mainline and for
> backporting as needed.
>
> Thanks.
>
> Carl Love
> --------------------------------------------------------------
>