]> git.ipfire.org Git - thirdparty/gcc.git/commit
i386: Do not use explicit operands for MOVS instructions [PR120019]
authorUros Bizjak <ubizjak@gmail.com>
Mon, 5 May 2025 11:59:43 +0000 (13:59 +0200)
committerUros Bizjak <ubizjak@gmail.com>
Mon, 5 May 2025 18:36:29 +0000 (20:36 +0200)
commitc182f4d14d65b3e012ad65b5014d86352fabc86f
tree56f5a01a496de636be4cb3397d1bc76c3ddb7566
parentbb83283e5c5c55eab7493a58c5e415aa56f5940c
i386: Do not use explicit operands for MOVS instructions [PR120019]

Some assemblers do not support MOVS instructions with explicit operands.
Emit instruction with implicit operands, but prefix the instruction with a
segment override prefix if the memory operand refers to ADDR_SPACE_SEG_FS
or ADDR_SPACE_SEG_GS named address space.

PR target/120019

gcc/ChangeLog:

* config/i386/i386.cc (ix86_print_operand): Handle 'v' operand
modifier to emit segment override prefix.
* config/i386/i386.md (*strmovdi_rex_1): Use %v operand modifier
to emit segment override prefix.
(*strmovsi_1): Ditto.
(*strmovhi_1): Ditto.
(*strmovqi_1): Ditto.
(*rep_movdi_rex64): Ditto.
(*rep_movsi): Ditto.
(*rep_movqi): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr111657-1.c (dg-do): Change to "assemble".
(dg-options): Remove -masm=att and add -save-temps.
(dg-final): Update scan-assembler and scan-assembler-not strings.

Co-authored-by: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc/config/i386/i386.cc
gcc/config/i386/i386.md
gcc/testsuite/gcc.target/i386/pr111657-1.c