Thanks Peter. 

I have sent another patch with updated commit message.

- xiangyu

> On 28 Jan, 2015, at 10:54 pm, Peter Maydell <[email protected]> wrote:
> 
> On 28 January 2015 at 14:51, Xiangyu Hu <[email protected] 
> <mailto:[email protected]>> wrote:
>> The difference between FMULX and FMUL is that FMULX will return 2.0f when 
>> one operator is
>> FPInfinity and the other one is FPZero, whilst FMUL will return a Default 
>> NaN. Without
>> this patch, the emulation would result in inconsistency.
>> 
>> Signed-off-by: Xiangyu Hu <[email protected]>
>> ---
>> target-arm/helper-a64.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>> 
>> diff --git a/target-arm/helper-a64.c b/target-arm/helper-a64.c
>> index 81066ca..ebd9247 100644
>> --- a/target-arm/helper-a64.c
>> +++ b/target-arm/helper-a64.c
>> @@ -135,6 +135,9 @@ float32 HELPER(vfp_mulxs)(float32 a, float32 b, void 
>> *fpstp)
>> {
>>     float_status *fpst = fpstp;
>> 
>> +    a = float32_squash_input_denormal(a, fpst);
>> +    b = float32_squash_input_denormal(b, fpst);
>> +
>>     if ((float32_is_zero(a) && float32_is_infinity(b)) ||
>>         (float32_is_infinity(a) && float32_is_zero(b))) {
>>         /* 2.0 with the sign bit set to sign(A) XOR sign(B) */
>> @@ -148,6 +151,9 @@ float64 HELPER(vfp_mulxd)(float64 a, float64 b, void 
>> *fpstp)
>> {
>>     float_status *fpst = fpstp;
>> 
>> +    a = float64_squash_input_denormal(a, fpst);
>> +    b = float64_squash_input_denormal(b, fpst);
>> +
>>     if ((float64_is_zero(a) && float64_is_infinity(b)) ||
>>         (float64_is_infinity(a) && float64_is_zero(b))) {
>>         /* 2.0 with the sign bit set to sign(A) XOR sign(B) */
> 
> I think this code change is correct but the commit message doesn't
> do a very good job of describing what the change is or why it is
> needed... (in particular the difference between FMULX and FMUL is
> completely irrelevant to the need for this fix, but it is pretty
> much the only thing the commit message talks about).
> 
> thanks
> -- PMM

Reply via email to