]> git.ipfire.org Git - thirdparty/gcc.git/commit
i386: Improve HImode interunit moves
authorUros Bizjak <ubizjak@gmail.com>
Thu, 6 Jan 2022 18:59:49 +0000 (19:59 +0100)
committerUros Bizjak <ubizjak@gmail.com>
Thu, 6 Jan 2022 19:01:34 +0000 (20:01 +0100)
commit0d03db068c89d46bc62ec79395708fd19f09d3d8
tree1c8ed7c226e6b286c3f8ceccc296277459353e97
parent2a60c08e98acaae212840b2d3329b5bd13778581
i386: Improve HImode interunit moves

Currently, the compiler moves HImode values between GPR and XMM registers with:

%vpinsrw\t{$0, %k1, %d0|%d0, %k1, 0}
%vpextrw\t{$0, %1, %k0|%k0, %1, 0}

but it could use slightly faster and shorter:

%vmovd\t{%k1, %0|%0, %k1}
%vmovd\t{%1, %k0|%k0, %1}

2022-01-06  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

* config/i386/i386.c (ix86_output_ssemov) <MODE_DI>:
Add %q modifier for operands in general registers.
<MODE_SI>: Add %q modifier for operands in general registers.
* config/i386/i386.md (*movhi_internal): Change type attribute of
xmm-gpr interunit alternatives 9,10 to ssemov and mode attribute
to SImode for non-avx512fp16 targets.
(*movhf_internal): Ditto for xmm-gpr interunit alternatives 6,8.
* config/i386/mmx.md (*movv2qi_internal):
Ditto for xmm-gpr interunit alternatives 8,9.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr102811-2.c (dg-final):
Update scan-assembler-times directives.
* gcc.target/i386/sse2-float16-2.c (dg-final):
Update scan-assembler directives.
gcc/config/i386/i386.c
gcc/config/i386/i386.md
gcc/config/i386/mmx.md
gcc/testsuite/gcc.target/i386/pr102811-2.c
gcc/testsuite/gcc.target/i386/sse2-float16-2.c