Commit b617fc71 by Julian Brown Committed by Julian Brown

gcc/

	* config/arm/arm-protos.h (neon_lane_bounds, neon_const_bounds)
	(neon_element_bits): Add prototypes.
	* config/arm/arm.c (bounds_check, neon_lane_bounds)
	(neon_const_bounds, neon_element_bits): New functions.
	* config/arm/neon.md (neon_vget_lane<mode>, neon_vget_lanedi)
	(neon_vget_lanev2di, neon_vset_lane<mode>, neon_vset_lanedi)
	(neon_vset_lanev2di, neon_vdup_lane<mode>, neon_vdup_lanedi)
	(neon_vdup_lanev2di, neon_vcvt_n<mode>, neon_vmul_lane<mode>)
	(neon_vmull_lane<mode>, neon_vqdmull_lane<mode>)
	(neon_vqdmulh_lane<mode>, neon_vmla_lane<mode>)
	(neon_vmlal_lane<mode>, neon_vqdmlal_lane<mode>)
	(neon_vmls_lane<mode>, neon_vmlsl_lane<mode>)
	(neon_vqdmlsl_lane<mode>, neon_vext<mode>, neon_vshr_n<mode>)
	(neon_vshrn_n<mode>, neon_vqshrn_n<mode>, neon_vqshrun_n<mode>)
	(neon_vshl_n<mode>, neon_vshl_n<mode>, neon_vqshl_n<mode>)
	(neon_vqshlu_n<mode>, neon_vshll_n<mode>, neon_vsra_n<mode>)
	(neon_vsri_n<mode>, neon_vsli_n<mode>): Add bounds checks.

From-SVN: r126958
parent 69240fc2
2007-07-26 Julian Brown <julian@codesourcery.com>
* config/arm/arm-protos.h (neon_lane_bounds, neon_const_bounds)
(neon_element_bits): Add prototypes.
* config/arm/arm.c (bounds_check, neon_lane_bounds)
(neon_const_bounds, neon_element_bits): New functions.
* config/arm/neon.md (neon_vget_lane<mode>, neon_vget_lanedi)
(neon_vget_lanev2di, neon_vset_lane<mode>, neon_vset_lanedi)
(neon_vset_lanev2di, neon_vdup_lane<mode>, neon_vdup_lanedi)
(neon_vdup_lanev2di, neon_vcvt_n<mode>, neon_vmul_lane<mode>)
(neon_vmull_lane<mode>, neon_vqdmull_lane<mode>)
(neon_vqdmulh_lane<mode>, neon_vmla_lane<mode>)
(neon_vmlal_lane<mode>, neon_vqdmlal_lane<mode>)
(neon_vmls_lane<mode>, neon_vmlsl_lane<mode>)
(neon_vqdmlsl_lane<mode>, neon_vext<mode>, neon_vshr_n<mode>)
(neon_vshrn_n<mode>, neon_vqshrn_n<mode>, neon_vqshrun_n<mode>)
(neon_vshl_n<mode>, neon_vshl_n<mode>, neon_vqshl_n<mode>)
(neon_vqshlu_n<mode>, neon_vshll_n<mode>, neon_vsra_n<mode>)
(neon_vsri_n<mode>, neon_vsli_n<mode>): Add bounds checks.
2007-07-26 Nathan Froyd <froydnj@codesourcery.com>
* config/vxworks.h (VXWORKS_LINK_SPEC): Fix typo.
......
......@@ -76,6 +76,9 @@ extern char *neon_output_logic_immediate (const char *, rtx *,
extern void neon_pairwise_reduce (rtx, rtx, enum machine_mode,
rtx (*) (rtx, rtx, rtx));
extern void neon_expand_vector_init (rtx, rtx);
extern void neon_lane_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
extern void neon_const_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
extern HOST_WIDE_INT neon_element_bits (enum machine_mode);
extern void neon_reinterpret (rtx, rtx);
extern void neon_emit_pair_result_insn (enum machine_mode,
rtx (*) (rtx, rtx, rtx, rtx),
......
......@@ -6234,6 +6234,49 @@ neon_expand_vector_init (rtx target, rtx vals)
emit_move_insn (target, mem);
}
/* Ensure OPERAND lies between LOW (inclusive) and HIGH (exclusive). Raise
ERR if it doesn't. FIXME: NEON bounds checks occur late in compilation, so
reported source locations are bogus. */
static void
bounds_check (rtx operand, HOST_WIDE_INT low, HOST_WIDE_INT high,
const char *err)
{
HOST_WIDE_INT lane;
gcc_assert (GET_CODE (operand) == CONST_INT);
lane = INTVAL (operand);
if (lane < low || lane >= high)
error (err);
}
/* Bounds-check lanes. */
void
neon_lane_bounds (rtx operand, HOST_WIDE_INT low, HOST_WIDE_INT high)
{
bounds_check (operand, low, high, "lane out of range");
}
/* Bounds-check constants. */
void
neon_const_bounds (rtx operand, HOST_WIDE_INT low, HOST_WIDE_INT high)
{
bounds_check (operand, low, high, "constant out of range");
}
HOST_WIDE_INT
neon_element_bits (enum machine_mode mode)
{
if (mode == DImode)
return GET_MODE_BITSIZE (mode);
else
return GET_MODE_BITSIZE (GET_MODE_INNER (mode));
}
/* Predicates for `match_operand' and `match_operator'. */
......
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