This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[GCC][AArch64][PATHC] Only allow 0s unconditionally for floating point values.
- From: Tamar Christina <tamar dot christina at arm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: nd at arm dot com, james dot greenhalgh at arm dot com, Richard dot Earnshaw at arm dot com, Marcus dot Shawcroft at arm dot com
- Date: Tue, 1 Aug 2017 08:35:06 +0100
- Subject: [GCC][AArch64][PATHC] Only allow 0s unconditionally for floating point values.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tamar dot Christina at arm dot com;
- Nodisclaimer: True
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hi All,
Previously I allowed 0s unconditionally through aarch64_can_const_movi_rtx_p
because we should always be able to use movi with 0 regardless of the mode.
However this was causing issues when a vector contained a 0 element and
another value which was too complex for a movi. In theory this should have
worked but it's failing an integrity check because of the type of the 0 element
being a none floating type.
Moving the exception to only allow floating point 0s restores the previous
behavior of the compiler.
Ok for trunk?
Bootstrapped and regtested on aach64-none-linux-gnu and no issues.
Thanks,
Tamar
gcc/
2017-08-01 Tamar Christina <tamar.christina@arm.com>
* config/aarch64/aarch64.c
(aarch64_can_const_movi_rtx_p): Move 0 check.
--
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 055ebafb8305412e192c77e4177d08c914d5ccee..5a2ad7e9156a6f0389c09470cf1414bff45d8099 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -4787,10 +4787,6 @@ aarch64_can_const_movi_rtx_p (rtx x, machine_mode mode)
if (!TARGET_SIMD)
return false;
- /* We make a general exception for 0. */
- if (aarch64_float_const_zero_rtx_p (x))
- return true;
-
machine_mode vmode, imode;
unsigned HOST_WIDE_INT ival;
@@ -4800,6 +4796,10 @@ aarch64_can_const_movi_rtx_p (rtx x, machine_mode mode)
if (!aarch64_reinterpret_float_as_int (x, &ival))
return false;
+ /* We make a general exception for 0. */
+ if (aarch64_float_const_zero_rtx_p (x))
+ return true;
+
imode = int_mode_for_mode (mode);
}
else if (GET_CODE (x) == CONST_INT