Discussion:
[ARM] Fix CLZ_DEFINED_VALUE_AT_ZERO for vector modes
Michael Collison
2014-10-09 07:05:33 UTC
Permalink
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 <***@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
***@linaro.org
Andrew Pinski
2014-10-09 07:11:02 UTC
Permalink
On Thu, Oct 9, 2014 at 12:05 AM, Michael Collison
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.
Do you have a testcase? I almost think you should have a testcase
which causes the constant folding. Though I don't think there is
constant folding of the vector clz/ctz happening.

Thanks,
Andrew
Tested on arm-linux-gnueabihf, arm-linux-gnueabi.
* 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
2014-10-09 07:26:24 UTC
Permalink
Yes this problem was found with Christophe's neon intrinsic tests which
are awaiting approval. The problem was found by passing a value of zero
to the vclz vector intrinsic.
Post by Andrew Pinski
On Thu, Oct 9, 2014 at 12:05 AM, Michael Collison
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.
Do you have a testcase? I almost think you should have a testcase
which causes the constant folding. Though I don't think there is
constant folding of the vector clz/ctz happening.
Thanks,
Andrew
Tested on arm-linux-gnueabihf, arm-linux-gnueabi.
* 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 Toolchain Working Group
***@linaro.org
Tejas Belagod
2014-10-09 07:55:54 UTC
Permalink
Post by Michael Collison
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.
* 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
2014-10-09 07:56:27 UTC
Permalink
Tejas,

You are correct. I will update the comment.
Post by Tejas Belagod
Post by Michael Collison
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.
* 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.
Loading...