Commit aff3ce41 by H.J. Lu Committed by H.J. Lu

Call simplify_gen_subreg to simplify subreg of vec_merge

Simplify
	(subreg (vec_merge (X)
			   (vector)
			   (const_int ((1 << N) | M)))
		(N * sizeof (outermode)))
to
	(subreg (X) (N * sizeof (outermode)))

	* simplify-rtx.c (simplify_subreg): Call simplify_gen_subreg
	to simplify subreg of vec_merge.

From-SVN: r265267
parent 200045a9
2018-10-18 H.J. Lu <hongjiu.lu@intel.com>
* simplify-rtx.c (simplify_subreg): Call simplify_gen_subreg
to simplify subreg of vec_merge.
2018-10-18 Richard Biener <rguenther@suse.de>
* config/i386/i386.c: Fix costing of vector FMA.
......@@ -6601,20 +6601,21 @@ simplify_subreg (machine_mode outermode, rtx op,
return NULL_RTX;
}
/* Return X for
(subreg (vec_merge (vec_duplicate X)
/* Simplify
(subreg (vec_merge (X)
(vector)
(const_int ((1 << N) | M)))
(N * sizeof (X)))
(N * sizeof (outermode)))
to
(subreg (X) (N * sizeof (outermode)))
*/
unsigned int idx;
if (constant_multiple_p (byte, GET_MODE_SIZE (outermode), &idx)
&& GET_CODE (op) == VEC_MERGE
&& GET_CODE (XEXP (op, 0)) == VEC_DUPLICATE
&& GET_MODE (XEXP (XEXP (op, 0), 0)) == outermode
&& GET_MODE_INNER (innermode) == outermode
&& CONST_INT_P (XEXP (op, 2))
&& (UINTVAL (XEXP (op, 2)) & (HOST_WIDE_INT_1U << idx)) != 0)
return XEXP (XEXP (op, 0), 0);
return simplify_gen_subreg (outermode, XEXP (op, 0), innermode, byte);
/* A SUBREG resulting from a zero extension may fold to zero if
it extracts higher bits that the ZERO_EXTEND's source bits. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment