public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [ARM] Fix CLZ_DEFINED_VALUE_AT_ZERO for vector modes
@ 2014-10-09  7:05 Michael Collison
  2014-10-09  7:11 ` Andrew Pinski
  2014-10-09  7:55 ` Tejas Belagod
  0 siblings, 2 replies; 12+ messages in thread
From: Michael Collison @ 2014-10-09  7:05 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]


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


[-- Attachment #2: arm.h.patch --]
[-- Type: text/x-patch, Size: 683 bytes --]

--- ../../../../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))
 \f
 #define CC_STATUS_INIT \
   do { cfun->machine->thumb1_cc_insn = NULL_RTX; } while (0)

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-11-13 13:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-09  7:05 [ARM] Fix CLZ_DEFINED_VALUE_AT_ZERO for vector modes Michael Collison
2014-10-09  7:11 ` Andrew Pinski
2014-10-09  7:26   ` Michael Collison
2014-10-09  7:55 ` Tejas Belagod
2014-10-09  7:56   ` Michael Collison
2014-10-22 21:53   ` Michael Collison
2014-10-31 18:44     ` Ramana Radhakrishnan
2014-11-12  3:51       ` Yangfei (Felix)
2014-11-12 12:43         ` Christophe Lyon
2014-11-12 13:11         ` Christophe Lyon
2014-11-12 13:48           ` Ramana Radhakrishnan
2014-11-13 13:54             ` Christophe Lyon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).