aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorKong Lingling <lingling.kong@intel.com>2023-05-17 17:20:37 +0800
committerHongyu Wang <hongyu.wang@intel.com>2023-12-07 09:31:14 +0800
commit7463df5c2a454aeaec786848fd8a4551e79b71a9 (patch)
tree7974122bb50915b67329cff37e3424f5be862bf7 /gcc/expr.cc
parentc778241dbdb509baee6ddb193a465dc3794c1a05 (diff)
downloadgcc-7463df5c2a454aeaec786848fd8a4551e79b71a9.zip
gcc-7463df5c2a454aeaec786848fd8a4551e79b71a9.tar.gz
gcc-7463df5c2a454aeaec786848fd8a4551e79b71a9.tar.bz2
[APX NDD] Support APX NDD for and insn
For NDD form AND insn, there are three splitter fixes after extending legacy patterns. 1. APX NDD does not support high QImode registers like ah, bh, ch, dh, so for some optimization splitters that generates highpart zero_extract for QImode need to be prohibited under NDD pattern. 2. Legacy AND insn will use r/qm/L constraint, and a post-reload splitter will transform it into zero_extend move. But for NDD form AND, the splitter is not strict enough as the splitter assum such AND will have the const_int operand matching the constraint "L", then NDD form AND allows const_int with any QI values. Restrict the splitter condition to match "L" constraint that strictly matches zero-extend sematic. 3. Legacy AND insn will adopt r/0/Z constraint, a splitter will try to optimize such form into strict_lowpart QImode AND when 7th bit is not set. But the splitter will wronly convert non-zext form of NDD and with memory src, then the strict_lowpart transform matches alternative 1 of *<code><mode>_slp_1 and generates *movstrict<mode>_1 so the zext sematic was omitted. This could cause highpart of dest not cleared and generates wrong code. Disable the splitter when NDD adopted and operands[0] and operands[1] are not equal. gcc/ChangeLog: * config/i386/i386.md (and<mode>3): Add NDD alternatives and adjust output template. (*anddi_1): Likewise. (*and<mode>_1): Likewise. (*andqi_1): Likewise. (*andsi_1_zext): Likewise. (*anddi_2): Likewise. (*andsi_2_zext): Likewise. (*andqi_2_maybe_si): Likewise. (*and<mode>_2): Likewise. (*and<dwi>3_doubleword): Add NDD alternative, adopt '&' to NDD dest and emit move for optimized case if operands[0] not equal to operands[1]. (define_split for QI highpart AND): Prohibit splitter to split NDD form AND insn to <any_logic:code>qi_ext<mode>_3. (define_split for QI strict_lowpart optimization): Prohibit splitter to split NDD form AND insn to *<code><mode>3_1_slp. (define_split for zero_extend and optimization): Prohibit splitter to split NDD form AND insn to zero_extend insn. gcc/testsuite/ChangeLog: * gcc.target/i386/apx-ndd.c: Add and test.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions