]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix unrecognizable insn due to illegal immediate_operand (const_int 255) of QImode.
authorliuhongt <hongtao.liu@intel.com>
Mon, 28 Nov 2022 01:59:47 +0000 (09:59 +0800)
committerliuhongt <hongtao.liu@intel.com>
Thu, 1 Dec 2022 03:32:48 +0000 (11:32 +0800)
commitb7306f02da33695bec90f153f6725a51d7c0ac71
treee89df4e616cf04faa2aefcf8f484162071030670
parenta802c4b9ffeeeaddc28ea50e567caed00c90b625
Fix unrecognizable insn due to illegal immediate_operand (const_int 255) of QImode.

For __builtin_ia32_vec_set_v16qi (a, -1, 2) with
!flag_signed_char. it's transformed to
__builtin_ia32_vec_set_v16qi (_4, 255, 2) in the gimple,
and expanded to (const_int 255) in the rtl. But for immediate_operand,
it expects (const_int 255) to be signed extended to
(const_int -1). The mismatch caused an unrecognizable insn error.

The patch converts (const_int 255) to (const_int -1) in the backend
expander.

gcc/ChangeLog:

PR target/107863
* config/i386/i386-expand.cc (ix86_expand_vec_set_builtin):
Convert op1 to target mode whenever mode mismatch.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr107863.c: New test.
gcc/config/i386/i386-expand.cc
gcc/testsuite/gcc.target/i386/pr107863.c [new file with mode: 0644]