openrisc / or1k-glibc

glibc port for or1k
GNU General Public License v2.0
3 stars 7 forks source link

Add floating point support #6

Closed stffrdhrn closed 4 years ago

stffrdhrn commented 4 years ago

The original port did not have floating point support. Add both nofpu and fpu support.

The FPU support is determined by the GCC builtin macro __or1k_hard_float__, which is enabled when we compile with -mhard-float

stffrdhrn commented 4 years ago

Floating point support is basically working with the current PR.

< shorne@lianli ~/work/gnu-toolchain/build-glibc > cut -d: -f1 math/subdir-tests.sum | sort | uniq -c
    229 FAIL
   2120 PASS
      3 UNSUPPORTED

This is an improvement from previous results where we had:

1308 FAIL: math
stffrdhrn commented 4 years ago

Current errors look like:

math/test-float-csin.out

testing float (without inline functions)
Failure: Real part of: csin (0x8p-152 + 0xb.4p+4 i): Exception "Overflow" not set
Failure: Real part of: csin_upward (0x8p-152 + 0xb.4p+4 i): Exception "Overflow" not set

Test suite completed:
  532 test cases plus 528 tests for exception flags and
    528 tests for errno executed.
  2 errors occurred.

math/test-float-csinh.out

testing float (without inline functions)
Failure: Real part of: csinh (0xb.4p+4 + 0x8p-152 i): Exception "Overflow" not set
Failure: Real part of: csinh_upward (0xb.4p+4 + 0x8p-152 i): Exception "Overflow" not set

Test suite completed:
  532 test cases plus 528 tests for exception flags and
    528 tests for errno executed.
  2 errors occurred.

math/test-float-double-add.out

testing float (argument double)
Failure: add_double (-0x4p-1024, 0x4p-128): Exception "Underflow" set
Failure: add_double (-0x4p-128, 0x4p-1024): Exception "Underflow" set
Failure: add_double (0x4p-1024, -0x4p-128): Exception "Underflow" set
Failure: add_double (0x4p-128, -0x4p-1024): Exception "Underflow" set
Failure: add_double (-0x4p-128, 0x8p-972): Exception "Underflow" set
Failure: add_double (-0x8p-972, 0x4p-128): Exception "Underflow" set
Failure: add_double (0x4p-128, -0x8p-972): Exception "Underflow" set
Failure: add_double (0x8p-972, -0x4p-128): Exception "Underflow" set
Failure: add_downward_double (-0x4p-128, 0x4p-1024): Exception "Underflow" set
Failure: add_downward_double (0x4p-1024, -0x4p-128): Exception "Underflow" set
Failure: add_downward_double (-0x4p-128, 0x8p-972): Exception "Underflow" set
Failure: add_downward_double (0x8p-972, -0x4p-128): Exception "Underflow" set
Failure: add_upward_double (-0x4p-1024, 0x4p-128): Exception "Underflow" set
Failure: add_upward_double (0x4p-128, -0x4p-1024): Exception "Underflow" set
Failure: add_upward_double (-0x8p-972, 0x4p-128): Exception "Underflow" set
Failure: add_upward_double (0x4p-128, -0x8p-972): Exception "Underflow" set

Test suite completed:
  1472 test cases plus 1468 tests for exception flags and
    1468 tests for errno executed.
  16 errors occurred.
stffrdhrn commented 4 years ago

This is merged to the or1k-port branch there are still some bugs but will work on those in a new bug fixing branch.