Segher, Bill: I committed this patch to mainline and backported to GCC 9.
I have looked at GCC 8. The functional issue is there, i.e. the vcmpnez is used instead of vcmpne. However the test case builtins-8-p9-runnable.c does not exist in GCC 8. The patch consists of the functional fix: --- a/gcc/config/rs6000/vsx.md +++ b/gcc/config/rs6000/vsx.md @@ -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; So, I am a bit unsure how to proceed. I think we need the functional change. But without applying the test cases fixes I don't feel that I am really backporting the patch as approved for backporting. I think we could reference the mainline commit, as we always do when backporting, but then note the test case fix was not included since the testcase does not exist. Would that be OK? Please let me know how you would like me to handle this issue. Carl Love On Thu, 2020-05-14 at 11:53 -0500, Segher Boessenkool wrote: > Hi! > > On Wed, May 13, 2020 at 10:14:24AM -0700, Carl Love wrote: > > 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 elements that are zero. > > 2020-04-30 Carl Love <c...@us.ibm.com> > > > > PR target/94833 > > * config/rs6000/vsx.md (define_expand): Fix instruction > > generation for > > first_match_index_<mode>. > > * testsuite/gcc.target/powerpc/builtins-8-p9-runnable.c (main): > > Add > > additional test cases with zero vector elements. > > Okay for trunk and all backports needed after a while. Thanks! > > > Segher