This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Optimize integer vector concatenate for SSE4


On Wed, May 14, 2008 at 3:10 AM, H.J. Lu <hjl.tools@gmail.com> wrote:


>>  >  2008-05-13  H.J. Lu  <hongjiu.lu@intel.com>
>>  >
>>  >         * config/i386/sse.md (*vec_concatv2sf_sse4_1): New.
>>  >         (*vec_concatv2si_sse4_1): Remove the second alternative.
>>  >         (*vec_concatv2di_rex64_sse4_1): Likewise.
>>  >
>>  >  gcc/testsuite
>>  >
>>  >  2008-05-13  H.J. Lu  <hongjiu.lu@intel.com>
>>  >
>>  >         * gcc.target/i386/sse-set-ps-1.c: New.
>>  >
>>  >
>>  >         * gcc.target/i386/sse4_1-set-ps-1.c: Likewise.
>>  >
>>
>>  Another update. Although insertps takes register source, we prefer unpcklps with
>>  register source since it is shorter.  Also, I changed nonimmediate_operand
>>  to register_operand on register operand.
>>
>
> Another update. I added
>
>  (set_attr "prefix_extra" "1")
>
> to those patterns.

But we should not forget on other alternatives, that are present in
patterns that are shadowed by new pattern. In your case, alternatives,
involving MMX operands won't work.

Attached is the patch that has been committed to SVN. It includes all
your updates, while still provides all alternatives as in shadowed
patterns. I have checked, that we generate insertps/pinsr?
instructions on your testcase when SSE4_1 is in effect.

2008-05-15  Uros Bizjak  <ubizjak@gmail.com>
	    H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/sse.md (*vec_concatv2sf_sse4_1): New insn pattern.
	(*vec_concatv2si_sse4_1): Use vector_move_operand predicate
	for operand 2.  Remove pinsr{q,d} with 0x0 immediate operand from
	insn alternatives.  Add missing alternatives.
	(*vec_concatv2di_rex64_sse4_1): Likewise.
	(*vec_concatv2si_sse2): Use "x" register constraint instead of "Y2".
	(*vec_concatv2di_rex64_sse): Rename from *vec_concatv2di_rex64.
	Require TARGET_SSE.

testsuite/ChangeLog:

2008-05-15  H.J. Lu  <hongjiu.lu@intel.com>

	* gcc.target/i386/sse-set-ps-1.c: New.
	* gcc.target/i386/sse4_1-set-ps-1.c: Likewise.

Patch has been regression tested on i686-pc-linux-gnu, commtted to mainline.

Uros.

Attachment: p.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]