[PATCH][ARM] Optimize copysign/copysignf for soft-float using BFI

Christophe Lyon christophe.lyon@linaro.org
Mon Dec 1 15:34:00 GMT 2014


On 27 November 2014 at 11:35, Ramana Radhakrishnan
<ramana.gcc@googlemail.com> wrote:
> On Wed, Oct 29, 2014 at 10:20 AM, Jiong Wang <jiong.wang@arm.com> wrote:
>> On 26/08/14 13:36, Richard Earnshaw wrote:
>>
>>> On 29/07/14 15:49, Jiong Wang wrote:
>>>>
>>>> test done
>>>> ===
>>>> no regression on the full toolchain test on arm-none-eabi.
>>>>
>>>>
>>>> ok to install?
>>>
>>> Hmm, I think this is wrong for DF mode.  The principle the patch works
>>> on is by tying the output to the value containing the sign bit, and then
>>> copying the rest of the other value into that value.  However, for DF
>>> mode it only copies 31 of the 63 bits needed; the least significant 32
>>> bits of the mantissa are not copied over.
>>>
>>> R.
>>
>>
>> updated the patch. fixed the DF mode bug.
>>
>> no regression on arm-none-eabi multi-lib test.
>>
>> ok to trunk?
>>
>> gcc/
>>   * config/arm/arm.md (copysignsf3): New define_expand for SImode.
>
> New pattern.
>
>>   (copysigndf3): New define_expand for DImode.
>
> Likewise.
>
> Ok for trunk if no regressions.

I can see the new test fail at link time, when GCC is configured to
default to 'hf' (e.g. --target arm-none-linux-gnueabihf), because the
dg-skip-if directive is not accurate enough.

Additionally, you require arm_thumb2_ok, but do not force -mthumb in
dg-options. Do you really need it?

>
> Sorry about the slow review.
>
> Ramana
>
>
>>
>> gcc/testsuite/
>>   * gcc.target/arm/copysign_softfloat_1.c: New copysign/copysignf testcase
>> for soft-float.



More information about the Gcc-patches mailing list