[x86 SSE PATCH] Some additional ternlog refinements.

Hongtao Liu crazylht@gmail.com
Fri Jun 28 01:10:52 GMT 2024


On Thu, Jun 27, 2024 at 4:29 PM Roger Sayle <roger@nextmovesoftware.com> wrote:
>
>
> This patch is another round of refinements to fine tune the new ternlog
> infrastructure in i386's sse.md.  This patch tweaks ix86_ternlog_idx
> to allow multiple MEM/CONST_VECTOR/VEC_DUPLICATE operands prior to
> splitting (before reload), when force_register is called on all but
> one of these operands.  Conceptually during the dynamic programming,
> registers fill the args slots in the order 0, 1, 2, and mem-like
> operands fill the slots in the order 2, 0, 1 [preferring the memory
> operand to come last].
>
> This patch allows us to remove some of the legacy ternlog patterns
> in sse.md without regressions [which is left to the next and final
> patch in this series].  An indication that these patterns are no
> longer required is shown by the necessary testsuite tweaks below,
> where the output assembler for the legacy instructions used hexadecimal,
> but with the new ternlog infrastructure now consistently use decimal.
>
> This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
> and make -k check, both with and without --target_board=unix{-m32}
> with no new failures.  Ok for mainline?
LGTM.
>
>
> 2024-06-27  Roger Sayle  <roger@nextmovesoftware.com>
>
> gcc/ChangeLog
>         * config/i386/i386-expand.cc (ix86_ternlog_idx) <case
> VEC_DUPLICATE>:
>         Add a "goto do_mem_operand" as this need not match memory_operand.
>         <case CONST_VECTOR>: Only args[2] may be volatile memory operand.
>         Allow MEM/VEC_DUPLICATE/CONST_VECTOR as args[0] and args[1].
>
> gcc/testsuite/ChangeLog
>         * gcc.target/i386/avx512f-andn-di-zmm-2.c: Match decimal instead
>         of hexadecimal immediate operand to ternlog.
>         * gcc.target/i386/avx512f-andn-si-zmm-2.c: Likewise.
>         * gcc.target/i386/avx512f-orn-si-zmm-1.c: Likewise.
>         * gcc.target/i386/avx512f-orn-si-zmm-2.c: Likewise.
>         * gcc.target/i386/pr100711-3.c: Likewise.
>         * gcc.target/i386/pr100711-4.c: Likewise.
>         * gcc.target/i386/pr100711-5.c: Likewise.
>
>
> Thanks in advance,
> Roger
> --
>


-- 
BR,
Hongtao


More information about the Gcc-patches mailing list