[Bug target/114783] [14 Regression] Equality compares of vector builtins spill one operand to the stack

2024-04-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114783

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Jakub Jelinek  ---
Fixed.

[Bug target/114783] [14 Regression] Equality compares of vector builtins spill one operand to the stack

2024-04-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114783

--- Comment #4 from GCC Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:c23db3ebb65ba357155be85ef56d037403eaee36

commit r14-10047-gc23db3ebb65ba357155be85ef56d037403eaee36
Author: Jakub Jelinek 
Date:   Sat Apr 20 00:13:49 2024 +0200

i386: Fix up *avx2_eq3 constraints [PR114783]

The r14-4456 change (part of APX EGPR support) seems to have mistakenly
changed in the
@@ -16831,7 +16831,7 @@ (define_insn "*avx2_eq3"
   [(set (match_operand:VI_256 0 "register_operand" "=x")
(eq:VI_256
  (match_operand:VI_256 1 "nonimmediate_operand" "%x")
- (match_operand:VI_256 2 "nonimmediate_operand" "xm")))]
+ (match_operand:VI_256 2 "nonimmediate_operand" "jm")))]
   "TARGET_AVX2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
   "vpcmpeq\t{%2, %1, %0|%0, %1, %2}"
   [(set_attr "type" "ssecmp")
hunk the xm constraint to jm, while in many other spots it changed
correctly
xm to xjm.  The instruction doesn't require the last operand to be in
memory, it can handle 3 256-bit registers just fine, just it is a VEX only
encoded instruction and so can't allow APX EGPR regs in the memory operand.

The following patch fixes it, so that we don't force one of the == operands
into memory all the time.

2024-04-20  Jakub Jelinek  

PR target/114783
* config/i386/sse.md (*avx2_eq3): Change last operand's
constraint from "jm" to "xjm".

* gcc.target/i386/avx2-pr114783.c: New test.

[Bug target/114783] [14 Regression] Equality compares of vector builtins spill one operand to the stack

2024-04-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114783

--- Comment #3 from Jakub Jelinek  ---
Created attachment 57991
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57991=edit
gcc14-pr114783.patch

Full untested patch.

[Bug target/114783] [14 Regression] Equality compares of vector builtins spill one operand to the stack

2024-04-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114783

Jakub Jelinek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Status|NEW |ASSIGNED

[Bug target/114783] [14 Regression] Equality compares of vector builtins spill one operand to the stack

2024-04-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114783

--- Comment #2 from Jakub Jelinek  ---
@@ -16831,7 +16882,7 @@ (define_insn "*avx2_eq3"
   [(set (match_operand:VI_256 0 "register_operand" "=x")
(eq:VI_256
  (match_operand:VI_256 1 "nonimmediate_operand" "%x")
- (match_operand:VI_256 2 "nonimmediate_operand" "xm")))]
+ (match_operand:VI_256 2 "nonimmediate_operand" "jm")))]
   "TARGET_AVX2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
   "vpcmpeq\t{%2, %1, %0|%0, %1, %2}"
   [(set_attr "type" "ssecmp")

That looks like it was supposed to be xjm.

[Bug target/114783] [14 Regression] Equality compares of vector builtins spill one operand to the stack

2024-04-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114783

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2024-04-19
 CC||jakub at gcc dot gnu.org
   Target Milestone|--- |14.0
 Ever confirmed|0   |1
   Priority|P3  |P1

--- Comment #1 from Jakub Jelinek  ---
Started with r14-4459-gd77ee4a7f7a80596d91b53c06946ac215614e6c4 or so
( r14-4453-gccdc0f0fcf6f240d5c4f059e6f38547a0cca9723 still emitted the 13 code,
and
I don't have the revisions in between in the seed, maybe they failed to
build?).