diff mbox series

[RFC,2/2] tests/tcg/mips64el: Run float tests

Message ID 20211226001931.3809249-3-f4bug@amsat.org
State New
Headers show
Series tests/tcg/mips64el: Run float tests | expand

Commit Message

Philippe Mathieu-Daudé Dec. 26, 2021, 12:19 a.m. UTC
Unfortunately this fails:

  $ make run-tcg-tests-mips64el-linux-user
  ...
  Files float_convs.out and tests/tcg/mips64el/float_convs.ref differ
  --- float_convs.out     2021-12-26 01:03:48.585973637 +0100
  +++ tests/tcg/mips64el/float_convs.ref   2021-12-26 00:29:35.804465340 +0100
  @@ -1,40 +1,40 @@
   ### Rounding to nearest
  -from single: f32(nan:0xffffffff)
  -  to double: f64(nan:0x007ff7ffffffffffff) (INVALID)
  -   to int32: 2147483647 (INVALID)
  -   to int64: 9223372036854775807 (INVALID)
  -  to uint32: 2147483647 (INVALID)
  -  to uint64: 9223372036854775807 (INVALID)
  make[2]: *** [tests/tcg/multiarch/Makefile.target:32: run-float_convs] Error 1

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 tests/tcg/mips64el/Makefile.target | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 tests/tcg/mips64el/Makefile.target

Comments

Jiaxun Yang Dec. 26, 2021, 2:25 a.m. UTC | #1
在2021年12月26日十二月 上午12:19,Philippe Mathieu-Daudé写道:
> Unfortunately this fails:
>
>   $ make run-tcg-tests-mips64el-linux-user
>   ...
>   Files float_convs.out and tests/tcg/mips64el/float_convs.ref differ
>   --- float_convs.out     2021-12-26 01:03:48.585973637 +0100
>   +++ tests/tcg/mips64el/float_convs.ref   2021-12-26 00:29:35.804465340 +0100
>   @@ -1,40 +1,40 @@
>    ### Rounding to nearest
>   -from single: f32(nan:0xffffffff)
>   -  to double: f64(nan:0x007ff7ffffffffffff) (INVALID)
>   -   to int32: 2147483647 (INVALID)
>   -   to int64: 9223372036854775807 (INVALID)
>   -  to uint32: 2147483647 (INVALID)
>   -  to uint64: 9223372036854775807 (INVALID)
>   make[2]: *** [tests/tcg/multiarch/Makefile.target:32: run-float_convs] Error 1
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/tcg/mips64el/Makefile.target | 2 ++
>  1 file changed, 2 insertions(+)
>  create mode 100644 tests/tcg/mips64el/Makefile.target
>
> diff --git a/tests/tcg/mips64el/Makefile.target 
> b/tests/tcg/mips64el/Makefile.target
> new file mode 100644
> index 00000000000..dcb1e9d72ac
> --- /dev/null
> +++ b/tests/tcg/mips64el/Makefile.target
> @@ -0,0 +1,2 @@
> +float_%: CFLAGS+=-march=loongson3a
> +float_%: QEMU_OPTS+=-cpu Loongson-3A4000

Hmm, -march=loongson3a assumed legacy NaN while our -cpu Loongson-3A4000 assumed IEEE 754-2008 style NaN.

I guess switch to Loongson-3A1000 can help?

Thanks.

> -- 
> 2.33.1
Philippe Mathieu-Daudé Dec. 26, 2021, 10:50 a.m. UTC | #2
On 12/26/21 03:25, Jiaxun Yang wrote:
> 在2021年12月26日十二月 上午12:19,Philippe Mathieu-Daudé写道:
>> Unfortunately this fails:
>>
>>   $ make run-tcg-tests-mips64el-linux-user
>>   ...
>>   Files float_convs.out and tests/tcg/mips64el/float_convs.ref differ
>>   --- float_convs.out     2021-12-26 01:03:48.585973637 +0100
>>   +++ tests/tcg/mips64el/float_convs.ref   2021-12-26 00:29:35.804465340 +0100
>>   @@ -1,40 +1,40 @@
>>    ### Rounding to nearest
>>   -from single: f32(nan:0xffffffff)
>>   -  to double: f64(nan:0x007ff7ffffffffffff) (INVALID)
>>   -   to int32: 2147483647 (INVALID)
>>   -   to int64: 9223372036854775807 (INVALID)
>>   -  to uint32: 2147483647 (INVALID)
>>   -  to uint64: 9223372036854775807 (INVALID)
>>   make[2]: *** [tests/tcg/multiarch/Makefile.target:32: run-float_convs] Error 1
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  tests/tcg/mips64el/Makefile.target | 2 ++
>>  1 file changed, 2 insertions(+)
>>  create mode 100644 tests/tcg/mips64el/Makefile.target
>>
>> diff --git a/tests/tcg/mips64el/Makefile.target 
>> b/tests/tcg/mips64el/Makefile.target
>> new file mode 100644
>> index 00000000000..dcb1e9d72ac
>> --- /dev/null
>> +++ b/tests/tcg/mips64el/Makefile.target
>> @@ -0,0 +1,2 @@
>> +float_%: CFLAGS+=-march=loongson3a
>> +float_%: QEMU_OPTS+=-cpu Loongson-3A4000
> 
> Hmm, -march=loongson3a assumed legacy NaN while our -cpu Loongson-3A4000 assumed IEEE 754-2008 style NaN.
> 
> I guess switch to Loongson-3A1000 can help?

Nop, exactly the same error.

Also, float_madds fails as:

Files float_madds.out and tests/tcg/mips64el/float_madds.ref differ
--- float_madds.out     2021-12-26 11:49:06.018532269 +0100
+++ tests/tcg/mips64el/float_madds.ref   2021-12-26 01:16:02.269497182 +0100
@@ -1,16 +1,16 @@
 ### Rounding to nearest
-op : f32(nan:0xffffffff) * f32(nan:0xffbfffff) + f32(-inf:0xff800000)
-res: f32(nan:0x7fbfffff) flags=INVALID (0/0)
-op : f32(nan:0xffbfffff) * f32(-inf:0xff800000) + f32(nan:0xffffffff)
-res: f32(nan:0x7fbfffff) flags=INVALID (0/1)
-op : f32(-inf:0xff800000) * f32(nan:0xffffffff) + f32(nan:0xffbfffff)
-res: f32(nan:0x7fbfffff) flags=INVALID (0/2)
make[2]: *** [tests/tcg/multiarch/Makefile.target:30: run-float_madds]
Error 1
Alex Bennée Jan. 4, 2022, 10:59 a.m. UTC | #3
Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> On 12/26/21 03:25, Jiaxun Yang wrote:
>> 在2021年12月26日十二月 上午12:19,Philippe Mathieu-Daudé写道:
>>> Unfortunately this fails:
>>>
>>>   $ make run-tcg-tests-mips64el-linux-user
>>>   ...
>>>   Files float_convs.out and tests/tcg/mips64el/float_convs.ref differ
>>>   --- float_convs.out     2021-12-26 01:03:48.585973637 +0100
>>>   +++ tests/tcg/mips64el/float_convs.ref   2021-12-26 00:29:35.804465340 +0100
>>>   @@ -1,40 +1,40 @@
>>>    ### Rounding to nearest
>>>   -from single: f32(nan:0xffffffff)
>>>   -  to double: f64(nan:0x007ff7ffffffffffff) (INVALID)
>>>   -   to int32: 2147483647 (INVALID)
>>>   -   to int64: 9223372036854775807 (INVALID)
>>>   -  to uint32: 2147483647 (INVALID)
>>>   -  to uint64: 9223372036854775807 (INVALID)
>>>   make[2]: *** [tests/tcg/multiarch/Makefile.target:32: run-float_convs] Error 1
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>> ---
>>>  tests/tcg/mips64el/Makefile.target | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>  create mode 100644 tests/tcg/mips64el/Makefile.target
>>>
>>> diff --git a/tests/tcg/mips64el/Makefile.target 
>>> b/tests/tcg/mips64el/Makefile.target
>>> new file mode 100644
>>> index 00000000000..dcb1e9d72ac
>>> --- /dev/null
>>> +++ b/tests/tcg/mips64el/Makefile.target
>>> @@ -0,0 +1,2 @@
>>> +float_%: CFLAGS+=-march=loongson3a
>>> +float_%: QEMU_OPTS+=-cpu Loongson-3A4000
>> 
>> Hmm, -march=loongson3a assumed legacy NaN while our -cpu Loongson-3A4000 assumed IEEE 754-2008 style NaN.
>> 
>> I guess switch to Loongson-3A1000 can help?
>
> Nop, exactly the same error.
>
> Also, float_madds fails as:
>
> Files float_madds.out and tests/tcg/mips64el/float_madds.ref differ
> --- float_madds.out     2021-12-26 11:49:06.018532269 +0100
> +++ tests/tcg/mips64el/float_madds.ref   2021-12-26 01:16:02.269497182 +0100
> @@ -1,16 +1,16 @@
>  ### Rounding to nearest
> -op : f32(nan:0xffffffff) * f32(nan:0xffbfffff) + f32(-inf:0xff800000)
> -res: f32(nan:0x7fbfffff) flags=INVALID (0/0)
> -op : f32(nan:0xffbfffff) * f32(-inf:0xff800000) + f32(nan:0xffffffff)
> -res: f32(nan:0x7fbfffff) flags=INVALID (0/1)
> -op : f32(-inf:0xff800000) * f32(nan:0xffffffff) + f32(nan:0xffbfffff)
> -res: f32(nan:0x7fbfffff) flags=INVALID (0/2)
> make[2]: *** [tests/tcg/multiarch/Makefile.target:30: run-float_madds]
> Error 1

That looks like the test just stops (rather than differs slightly) -
which is weird because I would expect that to fail before attempting to
compare to the reference.
diff mbox series

Patch

diff --git a/tests/tcg/mips64el/Makefile.target b/tests/tcg/mips64el/Makefile.target
new file mode 100644
index 00000000000..dcb1e9d72ac
--- /dev/null
+++ b/tests/tcg/mips64el/Makefile.target
@@ -0,0 +1,2 @@ 
+float_%: CFLAGS+=-march=loongson3a
+float_%: QEMU_OPTS+=-cpu Loongson-3A4000