diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2016-08-30 17:52:01 +0200 |
---|---|---|
committer | Yvan Roux <yvan.roux@linaro.org> | 2016-09-07 22:08:30 +0200 |
commit | 76c31abd9a869662ef3ebd38344c30e436fb1101 (patch) | |
tree | ec59bca62e0cce07e5dac83962cd00ff6d7a87dd | |
parent | a445d9192b1c3e37350ac38f5f273f745fb3cbfd (diff) |
gcc/
Backport from trunk r239610.
2016-08-19 Matthew Wahab <matthew.wahab@arm.com>
PR target/77281
* config/arm/arm.c (neon_valid_immediate): Delete declaration.
Use const_vec_duplicate to check for duplicated elements.
Change-Id: I34dade1b83eb550f04384a1b2c5c761f2db85904
-rw-r--r-- | gcc/config/arm/arm.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 19057a894c4..b2ede4df101 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -12413,7 +12413,6 @@ neon_valid_immediate (rtx op, machine_mode mode, int inverse, if (GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT) { rtx el0 = CONST_VECTOR_ELT (op, 0); - const REAL_VALUE_TYPE *r0; if (!vfp3_const_double_rtx (el0) && el0 != CONST0_RTX (GET_MODE (el0))) return -1; @@ -12422,14 +12421,10 @@ neon_valid_immediate (rtx op, machine_mode mode, int inverse, if (GET_MODE_INNER (mode) == HFmode) return -1; - r0 = CONST_DOUBLE_REAL_VALUE (el0); - - for (i = 1; i < n_elts; i++) - { - rtx elt = CONST_VECTOR_ELT (op, i); - if (!real_equal (r0, CONST_DOUBLE_REAL_VALUE (elt))) - return -1; - } + /* All elements in the vector must be the same. Note that 0.0 and -0.0 + are distinct in this context. */ + if (!const_vec_duplicate_p (op)) + return -1; if (modconst) *modconst = CONST_VECTOR_ELT (op, 0); |