Some additional ix86_rtx_costs clean-ups: NEG, AND, andn and pandn.
authorRoger Sayle <roger@nextmovesoftware.com>
Mon, 23 May 2022 07:47:42 +0000 (08:47 +0100)
committerRoger Sayle <roger@nextmovesoftware.com>
Mon, 23 May 2022 07:47:42 +0000 (08:47 +0100)
commit7707d7fddf7d6858399c8a47b139dc4708c5d7d9
treea426ea691f3525546d8b5bd081ddeca1b59ad1d7
parent075fb873c264a030f56793cb162c9fdecbdd1773
Some additional ix86_rtx_costs clean-ups: NEG, AND, andn and pandn.

Double-word NOT requires two operations, but double-word NEG requires
three operations.  Using SSE, vector NOT requires a pxor with -1, but
AND of NOT is cheap thanks to the existence of pandn.  There's also some
legacy (aka incorrect) logic explicitly testing for DImode [independently
of TARGET_64BIT] in determining the cost of logic operations that's not
required.

2022-05-23  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
* config/i386/i386.cc (ix86_rtx_costs) <case AND>: Split from
XOR/IOR case.  Account for two instructions for double-word
operations.  In case of vector pandn, account for single
instruction.  Likewise for integer andn with TARGET_BMI.
<case NOT>: Vector NOT requires more than 1 instruction (pxor).
<case NEG>: Double-word negation requires 3 instructions.
gcc/config/i386/i386.cc