On Tue, Dec 5, 2023 at 3:29 AM Hongyu Wang <hongyu.w...@intel.com> wrote: > > From: Kong Lingling <lingling.k...@intel.com> > > gcc/ChangeLog: > > * config/i386/i386.md: (addsi_1_zext): Add new alternatives for > NDD and adjust output templates. > (*add<mode>_2): Likewise. > (*addsi_2_zext): Likewise. > (*add<mode>_3): Likewise. > (*addsi_3_zext): Likewise. > (*adddi_4): Likewise. > (*add<mode>_4): Likewise. > (*add<mode>_5): Likewise. > (*addv<mode>4): Likewise. > (*addv<mode>4_1): Likewise. > (*add<mode>3_cconly_overflow_1): Likewise. > (*add<mode>3_cc_overflow_1): Likewise. > (*addsi3_zext_cc_overflow_1): Likewise. > (*add<mode>3_cconly_overflow_2): Likewise. > (*add<mode>3_cc_overflow_2): Likewise. > (*addsi3_zext_cc_overflow_2): Likewise. > > gcc/testsuite/ChangeLog: > > * gcc.target/i386/apx-ndd.c: Add more test. > --- > gcc/config/i386/i386.md | 310 +++++++++++++++--------- > gcc/testsuite/gcc.target/i386/apx-ndd.c | 53 ++-- > 2 files changed, 232 insertions(+), 131 deletions(-) > > diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md > index cb227d19f40..2a73f6dcaec 100644 > --- a/gcc/config/i386/i386.md > +++ b/gcc/config/i386/i386.md > @@ -6476,13 +6476,15 @@ (define_insn "*add<mode>_1" > ;; patterns constructed from addsi_1 to match. > > (define_insn "addsi_1_zext" > - [(set (match_operand:DI 0 "register_operand" "=r,r,r") > + [(set (match_operand:DI 0 "register_operand" "=r,r,r,r,r") > (zero_extend:DI > - (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,r,r") > - (match_operand:SI 2 "x86_64_general_operand" > "rBMe,0,le")))) > + (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,r,r,r,rm") > + (match_operand:SI 2 "x86_64_general_operand" > "rBMe,0,le,rBMe,re")))) > (clobber (reg:CC FLAGS_REG))] > - "TARGET_64BIT && ix86_binary_operator_ok (PLUS, SImode, operands)" > + "TARGET_64BIT && ix86_binary_operator_ok (PLUS, SImode, operands, > + TARGET_APX_NDD)" > { > + bool use_ndd = (which_alternative == 3 || which_alternative == 4);
Can get_attr_isa (insn) == ISA_APX_NDD be used instead? Uros.