aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorKong Lingling <lingling.kong@intel.com>2023-01-18 17:52:52 +0800
committerHongyu Wang <hongyu.wang@intel.com>2023-12-07 09:31:13 +0800
commit592dc08e0509bab1dc786db1699f197e5f0fdcea (patch)
tree0ea6c92c7b19915d093ab662eb983e1d09790624 /gcc/expr.cc
parentd564198f960a2f5994dde3f6b83d7a62021e49c3 (diff)
downloadgcc-592dc08e0509bab1dc786db1699f197e5f0fdcea.zip
gcc-592dc08e0509bab1dc786db1699f197e5f0fdcea.tar.gz
gcc-592dc08e0509bab1dc786db1699f197e5f0fdcea.tar.bz2
[APX NDD] Support APX NDD for adc insns
Legacy adc patterns are commonly adopted to TImode add, when extending TImode add to NDD version, operands[0] and operands[1] can be different, so extra move should be emitted if those patterns have optimization when adding const0_rtx. For TImode insn, there could be register overlapping between operands[0] and operands[1] as x86 allocates TImode register sequentially like rax:rdi, rdi:rdx. After postreload split for TImode, write to 1st highpart rdi will be overrided by the 2nd lowpart rdi if 2nd lowpart rdi have different src as input, then the write to 1st highpart rdi will missed and cause miscompliation. In addition, when input operands contain memory, the address register may also overlaps with dest register if it is marked dead after one of highpart/lowpart operation was done. So the earlyclobber modifier '&' should be added to NDD dest to avoid overlapping between dest and src operands. NDD instructions will automatically zero-extend dest register to 64bit, so for zext patterns it can adopt all NDD form that have memory src input. gcc/ChangeLog: * config/i386/i386.md (*add<dwi>3_doubleword): Add ndd alternatives, adopt '&' to ndd dest and move operands[1] to operands[0] when they are not equal. (*add<dwi>3_doubleword_cc_overflow_1): Likewise. (*addv<dwi>4_doubleword): Likewise. (*addv<dwi>4_doubleword_1): Likewise. (*add<dwi>3_doubleword_zext): Likewise. (addv<mode>4_overflow_1): Add ndd alternatives. (*addv<mode>4_overflow_2): Likewise. (@add<mode>3_carry): Likewise. (*add<mode>3_carry_0): Likewise. (*addsi3_carry_zext): Likewise. (addcarry<mode>): Likewise. (addcarry<mode>_0): Likewise. (*addcarry<mode>_1): Likewise. (*add<mode>3_eq): Likewise. (*add<mode>3_ne): Likewise. (*addsi3_carry_zext_0): Likewise, and use nonimmediate_operand for operands[1] to accept memory input for NDD alternative. gcc/testsuite/ChangeLog: * gcc.target/i386/apx-ndd-adc.c: New test.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions