aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorKong Lingling <lingling.kong@intel.com>2022-12-14 10:10:19 +0800
committerHongyu Wang <hongyu.wang@intel.com>2023-12-07 09:31:13 +0800
commite21b2caf6da7efbc87e7140e5472538c2349721c (patch)
treea119ec1bc5cbc8b3ff5cfe387e32ede0874053f4 /gcc/expr.cc
parent08b7462d3ad8e5acd941b7c777c5b26b4064d686 (diff)
downloadgcc-e21b2caf6da7efbc87e7140e5472538c2349721c.zip
gcc-e21b2caf6da7efbc87e7140e5472538c2349721c.tar.gz
gcc-e21b2caf6da7efbc87e7140e5472538c2349721c.tar.bz2
[APX NDD] Support Intel APX NDD for legacy add insn
APX NDD provides an extra destination register operand for several gpr related legacy insns, so a new alternative can be adopted to operand1 with "r" constraint. This first patch supports NDD for add instruction, and keeps to use lea when all operands are registers since lea have shorter encoding. For add operations containing mem NDD will be adopted to save an extra move. In legacy x86 binary operation expand it will force operands[0] and operands[1] to be the same so add a helper function to allow NDD form pattern that operands[0] and operands[1] can be different. gcc/ChangeLog: * config/i386/i386-expand.cc (ix86_fixup_binary_operands): Add new use_ndd flag to check whether ndd can be used for this binop and adjust operand emit. (ix86_binary_operator_ok): Likewise. (ix86_expand_binary_operator): Likewise, and void postreload expand generate lea pattern when use_ndd is explicit parsed. * config/i386/i386-options.cc (ix86_option_override_internal): Prohibit apx subfeatures when not in 64bit mode. * config/i386/i386-protos.h (ix86_binary_operator_ok): Add use_ndd flag. (ix86_fixup_binary_operand): Likewise. (ix86_expand_binary_operand): Likewise. * config/i386/i386.md (*add<mode>_1): Extend with new alternatives to support NDD, and adjust output template. (*addhi_1): Likewise. (*addqi_1): Likewise. gcc/testsuite/ChangeLog: * gcc.target/i386/apx-ndd.c: New test.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions