public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Collison <michael.collison@linaro.org>
To: Tejas Belagod <tejas.belagod@arm.com>,
	 "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [ARM] Fix CLZ_DEFINED_VALUE_AT_ZERO for vector modes
Date: Wed, 22 Oct 2014 21:53:00 -0000	[thread overview]
Message-ID: <54482653.5060805@linaro.org> (raw)
In-Reply-To: <54363F8A.8020501@arm.com>

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


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


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

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

  parent reply	other threads:[~2014-10-22 21:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-09  7:05 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54482653.5060805@linaro.org \
    --to=michael.collison@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tejas.belagod@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).