Skip to content

s390x floating point conversion functions broken

Host environment

  • Operating system: Ubuntu 20.04.4 LTS
  • OS/kernel version: Linux qemu01 5.4.0-104-generic #118-Ubuntu SMP Wed Mar 2 19:02:13 UTC 2022 s390x s390x s390x GNU/Linux
  • Architecture: s390x (although likely backend independent)
  • QEMU flavor: qemu-s390x
  • QEMU version: v7.0.0-rc4
  • QEMU command line:
    ./tests/tcg/s390x-linux-user/float_convs > ../../tests/tcg/s390x/float_convs.ref
    ./qemu-s390x ./tests/tcg/s390x-linux-user/float_convs > ./tests/tcg/s390x-linux-user/float_convs.out
    diff -y tests/tcg/s390x-linux-user/float_convs.out ../../tests/tcg/s390x/float_convs.ref

Emulated/Virtualized environment

  • Operating system: static binary (check-tcg)
  • OS/kernel version:
  • Architecture: s390x

Description of problem

While collecting additional reference files for float_convs (and float_convd) I noticed that the s390x handling of some cases is broken. See diff for details:

 diff -y tests/tcg/s390x-linux-user/float_convs.out ../../tests/tcg/s390x/float_convs.ref
### Rounding to nearest                                         ### Rounding to nearest                                                                                      
from single: f32(-nan:0xffa00000)                               from single: f32(-nan:0xffa00000)                            
  to double: f64(-nan:0x00fffc000000000000) (INVALID)             to double: f64(-nan:0x00fffc000000000000) (INVALID)        
   to int32: -2147483648 (INVALID)                            |    to int32: -2147483648 (INEXACT INVALID)                                                                   
   to int64: -9223372036854775808 (INVALID)                   |    to int64: -9223372036854775808 (INEXACT INVALID)                                                          
  to uint32: 0 (INVALID)                                      |   to uint32: 0 (INEXACT INVALID)                                                                             
  to uint64: 0 (INVALID)                                      |   to uint64: 0 (INEXACT INVALID)                                                                             
from single: f32(-nan:0xffc00000)                               from single: f32(-nan:0xffc00000)                                                                            
  to double: f64(-nan:0x00fff8000000000000) (OK)                  to double: f64(-nan:0x00fff8000000000000) (OK)                                                             
   to int32: -2147483648 (INVALID)                            |    to int32: -2147483648 (INEXACT INVALID)                                                                   
   to int64: -9223372036854775808 (INVALID)                   |    to int64: -9223372036854775808 (INEXACT INVALID)                                                          
  to uint32: 0 (INVALID)                                      |   to uint32: 0 (INEXACT INVALID)                                                                             
  to uint64: 0 (INVALID)                                      |   to uint64: 0 (INEXACT INVALID)                                                                             
from single: f32(-inf:0xff800000)                               from single: f32(-inf:0xff800000)                            
  to double: f64(-inf:0x00fff0000000000000) (OK)                  to double: f64(-inf:0x00fff0000000000000) (OK)             
   to int32: -2147483648 (INVALID)                            |    to int32: -2147483648 (INEXACT INVALID)                   
   to int64: -9223372036854775808 (INVALID)                   |    to int64: -9223372036854775808 (INEXACT INVALID)          
  to uint32: 0 (INVALID)                                      |   to uint32: 0 (INEXACT INVALID)                             
  to uint64: 0 (INVALID)                                      |   to uint64: 0 (INEXACT INVALID)                                                                             
from single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff)     from single: f32(-0x1.fffffe00000000000000p+127:0xff7fffff)
  to double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe     to double: f64(-0x1.fffffe00000000000000p+127:0x00c7efffffe
   to int32: -2147483648 (INVALID)                            |    to int32: -2147483648 (INEXACT INVALID)
   to int64: -9223372036854775808 (INVALID)                   |    to int64: -9223372036854775808 (INEXACT INVALID)
  to uint32: 0 (INVALID)                                      |   to uint32: 0 (INEXACT INVALID)
  to uint64: 0 (INVALID)                                      |   to uint64: 0 (INEXACT INVALID)
from single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59)     from single: f32(-0x1.1874b200000000000000p+103:0xf30c3a59)
  to double: f64(-0x1.1874b200000000000000p+103:0x00c661874b2     to double: f64(-0x1.1874b200000000000000p+103:0x00c661874b2
   to int32: -2147483648 (INVALID)                            |    to int32: -2147483648 (INEXACT INVALID)
   to int64: -9223372036854775808 (INVALID)                   |    to int64: -9223372036854775808 (INEXACT INVALID)
  to uint32: 0 (INVALID)                                      |   to uint32: 0 (INEXACT INVALID)
  to uint64: 0 (INVALID)                                      |   to uint64: 0 (INEXACT INVALID)
from single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)      from single: f32(-0x1.c0bab600000000000000p+99:0xf1605d5b)
  to double: f64(-0x1.c0bab600000000000000p+99:0x00c62c0bab60     to double: f64(-0x1.c0bab600000000000000p+99:0x00c62c0bab60
   to int32: -2147483648 (INVALID)                            |    to int32: -2147483648 (INEXACT INVALID)
   to int64: -9223372036854775808 (INVALID)                   |    to int64: -9223372036854775808 (INEXACT INVALID)
  to uint32: 0 (INVALID)                                      |   to uint32: 0 (INEXACT INVALID)
  to uint64: 0 (INVALID)                                      |   to uint64: 0 (INEXACT INVALID)
  ...
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information