diff mbox

[ARM] Remove unused vtrn, vzip, vuzp NEON builtins

Message ID 5368E59B.3050302@arm.com
State New
Headers show

Commit Message

Kyrylo Tkachov May 6, 2014, 1:37 p.m. UTC
Hi all,

This patch removes the NEON builtin functions for vtrn, vzip, vuzp and their 
associated wiring and machine descriptions. The builtins were initially used to 
implement the corresponding intrinsics in arm_neon.h but those have since been 
reimplemented using the more generic __builtin_shuffle. This allows us to clean 
up the NEON builtin initialisation code somewhat.

Tested arm-none-eabi on qemu. Made sure that the recently added tests in 
simd.exp for vzip, vuzp etc. pass.

Ok for trunk?

Thanks,
Kyrill

2014-05-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * config/arm/arm.c (neon_itype): Remove NEON_RESULTPAIR.
     (arm_init_neon_builtins): Remove handling of NEON_RESULTPAIR.
     Remove associated type declarations and initialisations.
     (arm_expand_neon_builtin): Likewise.
     (neon_emit_pair_result_insn): Delete.
     * config/arm/arm_neon_builtins (vtrn, vzip, vuzp): Delete.
     * config/arm/neon.md (neon_vtrn<mode>): Delete.
     (neon_vzip<mode>): Likewise.
     (neon_vuzp<mode>): Likewise.

Comments

Kyrylo Tkachov May 13, 2014, 12:56 p.m. UTC | #1
Ping.

Thanks,
Kyrill

On 06/05/14 14:37, Kyrill Tkachov wrote:
> Hi all,
>
> This patch removes the NEON builtin functions for vtrn, vzip, vuzp and their
> associated wiring and machine descriptions. The builtins were initially used to
> implement the corresponding intrinsics in arm_neon.h but those have since been
> reimplemented using the more generic __builtin_shuffle. This allows us to clean
> up the NEON builtin initialisation code somewhat.
>
> Tested arm-none-eabi on qemu. Made sure that the recently added tests in
> simd.exp for vzip, vuzp etc. pass.
>
> Ok for trunk?
>
> Thanks,
> Kyrill
>
> 2014-05-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>       * config/arm/arm.c (neon_itype): Remove NEON_RESULTPAIR.
>       (arm_init_neon_builtins): Remove handling of NEON_RESULTPAIR.
>       Remove associated type declarations and initialisations.
>       (arm_expand_neon_builtin): Likewise.
>       (neon_emit_pair_result_insn): Delete.
>       * config/arm/arm_neon_builtins (vtrn, vzip, vuzp): Delete.
>       * config/arm/neon.md (neon_vtrn<mode>): Delete.
>       (neon_vzip<mode>): Likewise.
>       (neon_vuzp<mode>): Likewise.
Ramana Radhakrishnan May 13, 2014, 12:57 p.m. UTC | #2
On 05/06/14 14:37, Kyrill Tkachov wrote:
> Hi all,
>
> This patch removes the NEON builtin functions for vtrn, vzip, vuzp and their
> associated wiring and machine descriptions. The builtins were initially used to
> implement the corresponding intrinsics in arm_neon.h but those have since been
> reimplemented using the more generic __builtin_shuffle. This allows us to clean
> up the NEON builtin initialisation code somewhat.
>
> Tested arm-none-eabi on qemu. Made sure that the recently added tests in
> simd.exp for vzip, vuzp etc. pass.
>
> Ok for trunk?

Yes this is OK and thanks for the cleanup.

Sorry about the late review.

Ramana

>
> Thanks,
> Kyrill
>
> 2014-05-06  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>       * config/arm/arm.c (neon_itype): Remove NEON_RESULTPAIR.
>       (arm_init_neon_builtins): Remove handling of NEON_RESULTPAIR.
>       Remove associated type declarations and initialisations.
>       (arm_expand_neon_builtin): Likewise.
>       (neon_emit_pair_result_insn): Delete.
>       * config/arm/arm_neon_builtins (vtrn, vzip, vuzp): Delete.
>       * config/arm/neon.md (neon_vtrn<mode>): Delete.
>       (neon_vzip<mode>): Likewise.
>       (neon_vuzp<mode>): Likewise.
>
diff mbox

Patch

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 4bada64..44d0bd6 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -23098,7 +23098,6 @@  typedef enum {
   NEON_FLOAT_NARROW,
   NEON_FIXCONV,
   NEON_SELECT,
-  NEON_RESULTPAIR,
   NEON_REINTERP,
   NEON_VTBL,
   NEON_VTBX,
@@ -23563,27 +23562,6 @@  arm_init_neon_builtins (void)
   tree intCI_type_node;
   tree intXI_type_node;
 
-  tree V8QI_pointer_node;
-  tree V4HI_pointer_node;
-  tree V2SI_pointer_node;
-  tree V2SF_pointer_node;
-  tree V16QI_pointer_node;
-  tree V8HI_pointer_node;
-  tree V4SI_pointer_node;
-  tree V4SF_pointer_node;
-  tree V2DI_pointer_node;
-
-  tree void_ftype_pv8qi_v8qi_v8qi;
-  tree void_ftype_pv4hi_v4hi_v4hi;
-  tree void_ftype_pv2si_v2si_v2si;
-  tree void_ftype_pv2sf_v2sf_v2sf;
-  tree void_ftype_pdi_di_di;
-  tree void_ftype_pv16qi_v16qi_v16qi;
-  tree void_ftype_pv8hi_v8hi_v8hi;
-  tree void_ftype_pv4si_v4si_v4si;
-  tree void_ftype_pv4sf_v4sf_v4sf;
-  tree void_ftype_pv2di_v2di_v2di;
-
   tree reinterp_ftype_dreg[NUM_DREG_TYPES][NUM_DREG_TYPES];
   tree reinterp_ftype_qreg[NUM_QREG_TYPES][NUM_QREG_TYPES];
   tree dreg_types[NUM_DREG_TYPES], qreg_types[NUM_QREG_TYPES];
@@ -23709,49 +23687,6 @@  arm_init_neon_builtins (void)
   (*lang_hooks.types.register_builtin_type) (intXI_type_node,
 					     "__builtin_neon_xi");
 
-  /* Pointers to vector types.  */
-  V8QI_pointer_node = build_pointer_type (V8QI_type_node);
-  V4HI_pointer_node = build_pointer_type (V4HI_type_node);
-  V2SI_pointer_node = build_pointer_type (V2SI_type_node);
-  V2SF_pointer_node = build_pointer_type (V2SF_type_node);
-  V16QI_pointer_node = build_pointer_type (V16QI_type_node);
-  V8HI_pointer_node = build_pointer_type (V8HI_type_node);
-  V4SI_pointer_node = build_pointer_type (V4SI_type_node);
-  V4SF_pointer_node = build_pointer_type (V4SF_type_node);
-  V2DI_pointer_node = build_pointer_type (V2DI_type_node);
-
-  /* Operations which return results as pairs.  */
-  void_ftype_pv8qi_v8qi_v8qi =
-    build_function_type_list (void_type_node, V8QI_pointer_node, V8QI_type_node,
-  			      V8QI_type_node, NULL);
-  void_ftype_pv4hi_v4hi_v4hi =
-    build_function_type_list (void_type_node, V4HI_pointer_node, V4HI_type_node,
-  			      V4HI_type_node, NULL);
-  void_ftype_pv2si_v2si_v2si =
-    build_function_type_list (void_type_node, V2SI_pointer_node, V2SI_type_node,
-  			      V2SI_type_node, NULL);
-  void_ftype_pv2sf_v2sf_v2sf =
-    build_function_type_list (void_type_node, V2SF_pointer_node, V2SF_type_node,
-  			      V2SF_type_node, NULL);
-  void_ftype_pdi_di_di =
-    build_function_type_list (void_type_node, intDI_pointer_node,
-			      neon_intDI_type_node, neon_intDI_type_node, NULL);
-  void_ftype_pv16qi_v16qi_v16qi =
-    build_function_type_list (void_type_node, V16QI_pointer_node,
-			      V16QI_type_node, V16QI_type_node, NULL);
-  void_ftype_pv8hi_v8hi_v8hi =
-    build_function_type_list (void_type_node, V8HI_pointer_node, V8HI_type_node,
-  			      V8HI_type_node, NULL);
-  void_ftype_pv4si_v4si_v4si =
-    build_function_type_list (void_type_node, V4SI_pointer_node, V4SI_type_node,
-  			      V4SI_type_node, NULL);
-  void_ftype_pv4sf_v4sf_v4sf =
-    build_function_type_list (void_type_node, V4SF_pointer_node, V4SF_type_node,
-  			      V4SF_type_node, NULL);
-  void_ftype_pv2di_v2di_v2di =
-    build_function_type_list (void_type_node, V2DI_pointer_node, V2DI_type_node,
-			      V2DI_type_node, NULL);
-
   if (TARGET_CRYPTO && TARGET_HARD_FLOAT)
   {
     tree V4USI_type_node =
@@ -24043,25 +23978,6 @@  arm_init_neon_builtins (void)
 	  }
 	  break;
 
-	case NEON_RESULTPAIR:
-	  {
-	    switch (insn_data[d->code].operand[1].mode)
-	      {
-	      case V8QImode: ftype = void_ftype_pv8qi_v8qi_v8qi; break;
-	      case V4HImode: ftype = void_ftype_pv4hi_v4hi_v4hi; break;
-	      case V2SImode: ftype = void_ftype_pv2si_v2si_v2si; break;
-	      case V2SFmode: ftype = void_ftype_pv2sf_v2sf_v2sf; break;
-	      case DImode: ftype = void_ftype_pdi_di_di; break;
-	      case V16QImode: ftype = void_ftype_pv16qi_v16qi_v16qi; break;
-	      case V8HImode: ftype = void_ftype_pv8hi_v8hi_v8hi; break;
-	      case V4SImode: ftype = void_ftype_pv4si_v4si_v4si; break;
-	      case V4SFmode: ftype = void_ftype_pv4sf_v4sf_v4sf; break;
-	      case V2DImode: ftype = void_ftype_pv2di_v2di_v2di; break;
-	      default: gcc_unreachable ();
-	      }
-	  }
-	  break;
-
 	case NEON_REINTERP:
 	  {
 	    /* We iterate over NUM_DREG_TYPES doubleword types,
@@ -25304,11 +25220,6 @@  arm_expand_neon_builtin (int fcode, tree exp, rtx target)
       return arm_expand_neon_args (target, icode, 1, type_mode, exp, fcode,
         NEON_ARG_COPY_TO_REG, NEON_ARG_COPY_TO_REG, NEON_ARG_STOP);
 
-    case NEON_RESULTPAIR:
-      return arm_expand_neon_args (target, icode, 0, type_mode, exp, fcode,
-        NEON_ARG_COPY_TO_REG, NEON_ARG_COPY_TO_REG, NEON_ARG_COPY_TO_REG,
-        NEON_ARG_STOP);
-
     case NEON_LANEMUL:
     case NEON_LANEMULL:
     case NEON_LANEMULH:
@@ -25370,24 +25281,6 @@  neon_reinterpret (rtx dest, rtx src)
   emit_move_insn (dest, gen_lowpart (GET_MODE (dest), src));
 }
 
-/* Emit code to place a Neon pair result in memory locations (with equal
-   registers).  */
-void
-neon_emit_pair_result_insn (enum machine_mode mode,
-			    rtx (*intfn) (rtx, rtx, rtx, rtx), rtx destaddr,
-                            rtx op1, rtx op2)
-{
-  rtx mem = gen_rtx_MEM (mode, destaddr);
-  rtx tmp1 = gen_reg_rtx (mode);
-  rtx tmp2 = gen_reg_rtx (mode);
-
-  emit_insn (intfn (tmp1, op1, op2, tmp2));
-
-  emit_move_insn (mem, tmp1);
-  mem = adjust_address (mem, mode, GET_MODE_SIZE (mode));
-  emit_move_insn (mem, tmp2);
-}
-
 /* Set up OPERANDS for a register copy from SRC to DEST, taking care
    not to early-clobber SRC registers in the process.
 
diff --git a/gcc/config/arm/arm_neon_builtins.def b/gcc/config/arm/arm_neon_builtins.def
index a00951a..782ecd2 100644
--- a/gcc/config/arm/arm_neon_builtins.def
+++ b/gcc/config/arm/arm_neon_builtins.def
@@ -149,9 +149,6 @@  VAR1 (VTBX, vtbx1, v8qi),
 VAR1 (VTBX, vtbx2, v8qi),
 VAR1 (VTBX, vtbx3, v8qi),
 VAR1 (VTBX, vtbx4, v8qi),
-VAR8 (RESULTPAIR, vtrn, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
-VAR8 (RESULTPAIR, vzip, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
-VAR8 (RESULTPAIR, vuzp, v8qi, v4hi, v2si, v2sf, v16qi, v8hi, v4si, v4sf),
 VAR5 (REINTERP, vreinterpretv8qi, v8qi, v4hi, v2si, v2sf, di),
 VAR5 (REINTERP, vreinterpretv4hi, v8qi, v4hi, v2si, v2sf, di),
 VAR5 (REINTERP, vreinterpretv2si, v8qi, v4hi, v2si, v2sf, di),
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index 88fd0f7..27068d7 100644
--- a/gcc/config/arm/neon.md
+++ b/gcc/config/arm/neon.md
@@ -4140,17 +4140,6 @@ 
   [(set_attr "type" "neon_permute<q>")]
 )
 
-(define_expand "neon_vtrn<mode>"
-  [(match_operand:SI 0 "s_register_operand" "r")
-   (match_operand:VDQW 1 "s_register_operand" "w")
-   (match_operand:VDQW 2 "s_register_operand" "w")]
-  "TARGET_NEON"
-{
-  neon_emit_pair_result_insn (<MODE>mode, gen_neon_vtrn<mode>_internal,
-			      operands[0], operands[1], operands[2]);
-  DONE;
-})
-
 (define_expand "neon_vzip<mode>_internal"
   [(parallel
     [(set (match_operand:VDQW 0 "s_register_operand" "")
@@ -4177,17 +4166,6 @@ 
   [(set_attr "type" "neon_zip<q>")]
 )
 
-(define_expand "neon_vzip<mode>"
-  [(match_operand:SI 0 "s_register_operand" "r")
-   (match_operand:VDQW 1 "s_register_operand" "w")
-   (match_operand:VDQW 2 "s_register_operand" "w")]
-  "TARGET_NEON"
-{
-  neon_emit_pair_result_insn (<MODE>mode, gen_neon_vzip<mode>_internal,
-			      operands[0], operands[1], operands[2]);
-  DONE;
-})
-
 (define_expand "neon_vuzp<mode>_internal"
   [(parallel
     [(set (match_operand:VDQW 0 "s_register_operand" "")
@@ -4214,17 +4192,6 @@ 
   [(set_attr "type" "neon_zip<q>")]
 )
 
-(define_expand "neon_vuzp<mode>"
-  [(match_operand:SI 0 "s_register_operand" "r")
-   (match_operand:VDQW 1 "s_register_operand" "w")
-   (match_operand:VDQW 2 "s_register_operand" "w")]
-  "TARGET_NEON"
-{
-  neon_emit_pair_result_insn (<MODE>mode, gen_neon_vuzp<mode>_internal,
-			      operands[0], operands[1], operands[2]);
-  DONE;
-})
-
 (define_expand "neon_vreinterpretv8qi<mode>"
   [(match_operand:V8QI 0 "s_register_operand" "")
    (match_operand:VDX 1 "s_register_operand" "")]