[ARM] Fix CLZ_DEFINED_VALUE_AT_ZERO for vector modes
authorMichael Collison <michael.collison@linaro.org>
Sun, 2 Nov 2014 18:00:59 +0000 (18:00 +0000)
committerChristophe Lyon <clyon@gcc.gnu.org>
Sun, 2 Nov 2014 18:00:59 +0000 (19:00 +0100)
2014-11-02  Michael Collison  <michael.collison@linaro.org>

* config/arm/arm.h (CLZ_DEFINED_VALUE_AT_ZERO) : Update
to support vector modes.
(CTZ_DEFINED_VALUE_AT_ZERO): Ditto.

From-SVN: r217014

gcc/ChangeLog
gcc/config/arm/arm.h

index 68c15af..9cbebf0 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-02  Michael Collison  <michael.collison@linaro.org>
+
+       * config/arm/arm.h (CLZ_DEFINED_VALUE_AT_ZERO) : Update
+       to support vector modes.
+       (CTZ_DEFINED_VALUE_AT_ZERO): Ditto.
+
 2014-11-01  Andrew MacLeod  <amacleod@redhat,com>
 
        * optabs.h: Flatten insn-codes.h to source files.  Move some prototypes
index cea71b6..17503df 100644 (file)
@@ -2142,9 +2142,10 @@ extern int making_const_table;
    ? 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))
 \f
 #define CC_STATUS_INIT \
   do { cfun->machine->thumb1_cc_insn = NULL_RTX; } while (0)