> -----Original Message-----
> From: Tamar Christina <tamar.christ...@arm.com>
> Sent: 10 December 2020 17:00
> To: gcc-patches@gcc.gnu.org
> Cc: nd <n...@arm.com>; Ramana Radhakrishnan
> <ramana.radhakrish...@arm.com>; Richard Earnshaw
> <richard.earns...@arm.com>; ni...@redhat.com; Kyrylo Tkachov
> <kyrylo.tkac...@arm.com>
> Subject: [PATCH]Arm: Add NEON and MVE RTL patterns for Complex Addition,
> Multiply and FMA. Fix mve types Fix mve patterns
> 
> Hi All,
> 
> This adds implementation for the optabs for complex additions.  With this
> the
> following C code:
> 
>   void f90 (float complex a[restrict N], float complex b[restrict N],
>           float complex c[restrict N])
>   {
>     for (int i=0; i < N; i++)
>       c[i] = a[i] + (b[i] * I);
>   }
> 
> generates
> 
>   f90:
>         add     r3, r2, #1600
>   .L2:
>         vld1.32 {q8}, [r0]!
>         vld1.32 {q9}, [r1]!
>         vcadd.f32       q8, q8, q9, #90
>         vst1.32 {q8}, [r2]!
>         cmp     r3, r2
>         bne     .L2
>         bx      lr
> 
> 
> instead of
> 
>   f90:
>         add     r3, r2, #1600
>   .L2:
>         vld2.32 {d24-d27}, [r0]!
>         vld2.32 {d20-d23}, [r1]!
>         vsub.f32      q8, q12, q11
>         vadd.f32      q9, q13, q10
>         vst2.32 {d16-d19}, [r2]!
>         cmp     r3, r2
>         bne     .L2
>         bx      lr
> 
> Bootstrapped Regtested on arm-none-linux-gnueabihf and no issues.
> Codegen tested for -march=armv8.1-m.main+mve.fp -mfloat-abi=hard -
> mfpu=auto
> and no issues.
> 
> Matching tests for these are in the mid-end patches.
> Note that The mid-end patches are still being respun and I may need to
> change the order of some parameters but no other change is expected and
> would like to decrease the size of future patches.  As such..
> 
> Ok for master?

Ok.
Thanks,
Kyrill

> 
> Thanks,
> Tamar
> 
> Tamar
> 
> gcc/ChangeLog:
> 
>       * config/arm/arm_mve.h (__arm_vcaddq_rot90_u8,
> __arm_vcaddq_rot270_u8,
>       , __arm_vcaddq_rot90_s8, __arm_vcaddq_rot270_s8,
>       __arm_vcaddq_rot90_u16, __arm_vcaddq_rot270_u16,
> __arm_vcaddq_rot90_s16,
>       __arm_vcaddq_rot270_s16, __arm_vcaddq_rot90_u32,
>       __arm_vcaddq_rot270_u32, __arm_vcaddq_rot90_s32,
>       __arm_vcaddq_rot270_s32, __arm_vcmulq_rot90_f16,
>       __arm_vcmulq_rot270_f16, __arm_vcmulq_rot180_f16,
>       __arm_vcmulq_f16, __arm_vcaddq_rot90_f16,
> __arm_vcaddq_rot270_f16,
>       __arm_vcmulq_rot90_f32, __arm_vcmulq_rot270_f32,
>       __arm_vcmulq_rot180_f32, __arm_vcmulq_f32,
> __arm_vcaddq_rot90_f32,
>       __arm_vcaddq_rot270_f32, __arm_vcmlaq_f16,
> __arm_vcmlaq_rot180_f16,
>       __arm_vcmlaq_rot270_f16, __arm_vcmlaq_rot90_f16,
> __arm_vcmlaq_f32,
>       __arm_vcmlaq_rot180_f32, __arm_vcmlaq_rot270_f32,
>       __arm_vcmlaq_rot90_f32): Update builtin calls.
>       * config/arm/arm_mve_builtins.def (vcaddq_rot90_u,
> vcaddq_rot270_u,
>       vcaddq_rot90_s, vcaddq_rot270_s, vcaddq_rot90_f,
> vcaddq_rot270_f,
>       vcmulq_f, vcmulq_rot90_f, vcmulq_rot180_f, vcmulq_rot270_f,
>       vcmlaq_f, vcmlaq_rot90_f, vcmlaq_rot180_f, vcmlaq_rot270_f):
> Removed.
>       (vcaddq_rot90, vcaddq_rot270, vcmulq, vcmulq_rot90,
> vcmulq_rot180,
>       vcmulq_rot270, vcmlaq, vcmlaq_rot90, vcmlaq_rot180,
> vcmlaq_rot270):
>       New.
>       * config/arm/constraints.md (Dz): Include MVE.
>       * config/arm/iterators.md (mve_rotsplit1, mve_rotsplit2): New.
>       (rot): Add UNSPEC_VCMLS, UNSPEC_VCMUL and
> UNSPEC_VCMUL180.
>       (rot_op, rotsplit1, rotsplit2, fcmac1, VCMLA_OP, VCMUL_OP): New.
>       * config/arm/mve.md (VCADDQ_ROT270_S, VCADDQ_ROT90_S,
> VCADDQ_ROT270_U,
>       VCADDQ_ROT90_U, VCADDQ_ROT270_F, VCADDQ_ROT90_F,
> VCMULQ_F,
>       VCMULQ_ROT180_F, VCMULQ_ROT270_F, VCMULQ_ROT90_F,
> VCMLAQ_F,
>       VCMLAQ_ROT180_F, VCMLAQ_ROT90_F, VCMLAQ_ROT270_F,
> VCADDQ_ROT270_S,
>       VCADDQ_ROT270, VCADDQ_ROT90): Removed.
>       (mve_rot, VCMUL): New.
>       (mve_vcaddq_rot270_<supf><mode,
> mve_vcaddq_rot90_<supf><mode>,
>       mve_vcaddq_rot270_f<mode>, mve_vcaddq_rot90_f<mode>,
> mve_vcmulq_f<mode,
>       mve_vcmulq_rot180_f<mode>, mve_vcmulq_rot270_f<mode>,
>       mve_vcmulq_rot90_f<mode>, mve_vcmlaq_f<mode>,
> mve_vcmlaq_rot180_f<mode>,
>       mve_vcmlaq_rot270_f<mode>, mve_vcmlaq_rot90_f<mode>):
> Removed.
>       (mve_vcmlaq<mve_rot><mode>, mve_vcmulq<mve_rot><mode>,
>       mve_vcaddq<mve_rot><mode>, cadd<rot><mode>3,
> mve_vcaddq<mve_rot><mode>):
>       New.
>       (cmul<rot_op><mode>3): Exclude MVE types.
>       * config/arm/unspecs.md (UNSPEC_VCMUL90, UNSPEC_VCMUL270):
> New.
>       * config/arm/vec-common.md (cadd<rot><mode>3,
> cmul<rot_op><mode>3,
>       arm_vcmla<rot><mode>, cml<fcmac1><rot_op><mode>4): New.
>       * config/arm/unspecs.md (UNSPEC_VCMUL, UNSPEC_VCMUL180,
> UNSPEC_VCMLS,
>       UNSPEC_VCMLS180): New.
> 
> --

Reply via email to