i386: Adjust emulated integer vector mode shift costs
commit306412a78f56ef3d462d9e5b0cde806b28965c87
authorUros Bizjak <ubizjak@gmail.com>
Mon, 22 May 2023 20:37:14 +0000 (22 22:37 +0200)
committerUros Bizjak <ubizjak@gmail.com>
Mon, 22 May 2023 20:37:47 +0000 (22 22:37 +0200)
treea0327fda241778add554a71e5ce5f265d88b7fae
parent90685c365794e9afabc6cdc7eae7892ba5d2be3d
i386: Adjust emulated integer vector mode shift costs

Returned integer vector mode costs of emulated instructions in
ix86_shift_rotate_cost are wrong and do not reflect generated
instruction sequences.  Rewrite handling of different integer vector
modes and different target ABIs to return real instruction
counts in order to calcuate better costs of various emulated modes.

Also add the cost of a memory read, when the instruction in the
sequence reads memory.

gcc/ChangeLog:

* config/i386/i386.cc (ix86_shift_rotate_cost): Correct
calcuation of integer vector mode costs to reflect generated
instruction sequences of different integer vector modes and
different target ABIs.  Remove "speed" function argument.
(ix86_rtx_costs): Update call for removed function argument.
(ix86_vector_costs::add_stmt_cost): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/i386/sse2-shiftqihi-constant-1.c: Remove XFAILs.
gcc/config/i386/i386.cc
gcc/testsuite/gcc.target/i386/sse2-shiftqihi-constant-1.c