This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ARM] Fix CLZ_DEFINED_VALUE_AT_ZERO for vector modes



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

--
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-08 13:56:19.509841175 -0700
@@ -2138,8 +2138,10 @@ extern int making_const_table;
    : 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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]