This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ARM] Fix CLZ_DEFINED_VALUE_AT_ZERO for vector modes
- From: Michael Collison <michael dot collison at linaro dot org>
- To: Tejas Belagod <tejas dot belagod at arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 22 Oct 2014 14:49:07 -0700
- Subject: Re: [ARM] Fix CLZ_DEFINED_VALUE_AT_ZERO for vector modes
- Authentication-results: sourceware.org; auth=none
- References: <543633BD dot 9030004 at linaro dot org> <54363F8A dot 8020501 at arm dot com>
Patch that removes extraneous comment attached.
The CLZ_DEFINED_VALUE_AT_ZERO macro is hard coded to return 32. For the
vector intrinsic vclz this is incorrect and should return the value
eight. The CTZ_DEFINED_VALUE_AT_ZERO has the same issue.
Tested on arm-linux-gnueabihf, arm-linux-gnueabi.
2014-10-08 Michael Collison <michael.collison@linaro.com>
* config/arm/arm.h (CLZ_DEFINED_VALUE_AT_ZERO) : Update
to support vector modes
(CTZ_DEFINED_VALUE_AT_ZERO): Ditto
On 10/09/2014 12:55 AM, Tejas Belagod wrote:
On 09/10/14 08:05, Michael Collison wrote:
The CLZ_DEFINED_VALUE_AT_ZERO macro is harded to return 32. For the
vector intrinsic vclz this is incorrect and should return the value
eight. The CTZ_DEFINED_VALUE_AT_ZERO has the same issue.
Tested on arm-linux-gnueabihf, arm-linux-gnueabi.
2014-10-08 Michael Collison <michael.collison@linaro.com>
* config/arm/arm.h (CLZ_DEFINED_VALUE_AT_ZERO) : Update
to support vector modes
(CTZ_DEFINED_VALUE_AT_ZERO): Ditto
Update comment?
/* The arm5 clz instruction returns 32. */
Thanks,
Tejas.
--
Michael Collison
Linaro Toolchain Working Group
michael.collison@linaro.org
--- ../../../../linaro-gcc4_9_git/gcc/config/arm/arm.h 2014-10-08 13:49:01.109819957 -0700
+++ ./arm.h 2014-10-22 14:41:10.767130430 -0700
@@ -2137,9 +2137,10 @@
? reverse_condition_maybe_unordered (code) \
: reverse_condition (code))
-/* The arm5 clz instruction returns 32. */
-#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) ((VALUE) = 32, 1)
-#define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) ((VALUE) = 32, 1)
+#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \
+ ((VALUE) = GET_MODE_UNIT_BITSIZE (MODE))
+#define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \
+ ((VALUE) = GET_MODE_UNIT_BITSIZE (MODE))
#define CC_STATUS_INIT \
do { cfun->machine->thumb1_cc_insn = NULL_RTX; } while (0)