diff mbox series

[1/4] Use CONST_VECTOR_ELT instead of XVECEXP

Message ID 87wp16h90p.fsf@linaro.org
State New
Headers show
Series Use new vector constant encoding for CONST_VECTOR | expand

Commit Message

Richard Sandiford Dec. 28, 2017, 8:50 p.m. UTC
This patch replaces target-independent uses of XVECEXP with uses
of CONST_VECTOR_ELT.  This kind of replacement isn't necessary
for code specific to targets other than AArch64.


2017-12-28  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* simplify-rtx.c (simplify_const_binary_operation): Use
	CONST_VECTOR_ELT instead of XVECEXP.

Comments

Richard Biener Jan. 2, 2018, 2:01 p.m. UTC | #1
On Thu, Dec 28, 2017 at 9:50 PM, Richard Sandiford
<richard.sandiford@linaro.org> wrote:
> This patch replaces target-independent uses of XVECEXP with uses

> of CONST_VECTOR_ELT.  This kind of replacement isn't necessary

> for code specific to targets other than AArch64.


Ok.

>

> 2017-12-28  Richard Sandiford  <richard.sandiford@linaro.org>

>

> gcc/

>         * simplify-rtx.c (simplify_const_binary_operation): Use

>         CONST_VECTOR_ELT instead of XVECEXP.

>

> Index: gcc/simplify-rtx.c

> ===================================================================

> --- gcc/simplify-rtx.c  2017-12-21 18:36:04.778333159 +0000

> +++ gcc/simplify-rtx.c  2017-12-22 13:08:49.287660877 +0000

> @@ -4070,9 +4070,9 @@ simplify_const_binary_operation (enum rt

>           gcc_assert (op0_n_elts + op1_n_elts == n_elts);

>

>           for (i = 0; i < op0_n_elts; ++i)

> -           RTVEC_ELT (v, i) = XVECEXP (op0, 0, i);

> +           RTVEC_ELT (v, i) = CONST_VECTOR_ELT (op0, i);

>           for (i = 0; i < op1_n_elts; ++i)

> -           RTVEC_ELT (v, op0_n_elts+i) = XVECEXP (op1, 0, i);

> +           RTVEC_ELT (v, op0_n_elts+i) = CONST_VECTOR_ELT (op1, i);

>         }

>

>        return gen_rtx_CONST_VECTOR (mode, v);
diff mbox series

Patch

Index: gcc/simplify-rtx.c
===================================================================
--- gcc/simplify-rtx.c	2017-12-21 18:36:04.778333159 +0000
+++ gcc/simplify-rtx.c	2017-12-22 13:08:49.287660877 +0000
@@ -4070,9 +4070,9 @@  simplify_const_binary_operation (enum rt
 	  gcc_assert (op0_n_elts + op1_n_elts == n_elts);
 
 	  for (i = 0; i < op0_n_elts; ++i)
-	    RTVEC_ELT (v, i) = XVECEXP (op0, 0, i);
+	    RTVEC_ELT (v, i) = CONST_VECTOR_ELT (op0, i);
 	  for (i = 0; i < op1_n_elts; ++i)
-	    RTVEC_ELT (v, op0_n_elts+i) = XVECEXP (op1, 0, i);
+	    RTVEC_ELT (v, op0_n_elts+i) = CONST_VECTOR_ELT (op1, i);
 	}
 
       return gen_rtx_CONST_VECTOR (mode, v);