]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: Rework vector float comparison in rs6000_emit_vector_compare - p4
authorKewen Lin <linkw@linux.ibm.com>
Fri, 15 Nov 2024 03:46:33 +0000 (03:46 +0000)
committerKewen Lin <linkw@gcc.gnu.org>
Fri, 15 Nov 2024 03:46:33 +0000 (03:46 +0000)
commit2e22882f3ec88f540c2255ddce4fb69ac69911b7
tree2a708a1a16a77bd2a8855e545ec52c09a17fa5f1
parent893ee27356b05e706c79e4551b628fb93645623e
rs6000: Rework vector float comparison in rs6000_emit_vector_compare - p4

All kinds of vector float comparison operators have been
supported in a rtl comparison pattern as vector.md, we can
just emit an rtx comparison insn with the given comparison
operator in function rs6000_emit_vector_compare instead of
checking and handling the reverse condition cases.

This is part 4, it further checks for comparison opeators
LT/UNGE.  In rs6000_emit_vector_compare, for the handling
of LT, it switches to use code GT, swaps operands and try
again, it's exactly the same as what we have in vector.md:

; lt(a,b)   = gt(b,a)

As to UNGE, in rs6000_emit_vector_compare, it uses reversed
code LT and further operates on the result with one_cmpl,
it's also the same as what's in vector.md:

; unge(a,b) = ~lt(a,b)

This patch should not have any functionality change too.

gcc/ChangeLog:

* config/rs6000/rs6000.cc (rs6000_emit_vector_compare_inner): Emit rtx
comparison for operators LT/UNGE of MODE_VECTOR_FLOAT directly.
(rs6000_emit_vector_compare): Move assertion of no MODE_VECTOR_FLOAT to
function beginning.
gcc/config/rs6000/rs6000.cc