Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work on build with support for SP or DP floating point #748

Merged
merged 1 commit into from
Jun 16, 2018

Conversation

josesimoes
Copy link
Member

@josesimoes josesimoes commented Jun 15, 2018

Description

  • Add CMake option DP_FLOATINGPOINT to enable DP support (default it SP)
  • Add new Math functions: Abs, Max and Min
  • Rework Math classes declaration
  • Rework implementation to add support for new overloaded Math methods with float and double parameters
  • Update declaration of mscorlib native assembly to match managed one
  • Clean up native double header with unused defines for Renesas compiler

Motivation and Context

How Has This Been Tested?

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Signed-off-by: José Simões jose.simoes@eclo.solutions

@nfbot
Copy link
Member

nfbot commented Jun 15, 2018

Hi @josesimoes,

I'm nanoFramework bot.
Thank you for your contribution!

A human will be reviewing it shortly. 😉

- Add CMake option DP_FLOATINGPOINT to enable DP support (default it SP)
- Add new Math functions: Abs, Max and Min
- Rework Math classes declaration
- Rework implementation to add support for new overloaded Math methods with float and double parameters
- Update declaration of mscorlib native assembly to match managed one
- Clean up native double header with unused defines for Renesas compiler

** HACK REQUIRED FOR ESP32 in Math::Truncate **

Signed-off-by: José Simões <jose.simoes@eclo.solutions>
float Math::Truncate( float d, float& integralValue )
{
integralValue = 0;
float retVal = modf(d, (double*)&integralValue);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AdrianSoundy I had to force a cast here to (double*) otherwise the build fails...
Does this means that ESP32 can use the single-precision library? Or is it something that could be missing in the compiler switches?

BTW, is the compiler set to use the FPU?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant can't use the sp lib...

@josesimoes josesimoes merged commit 7e43ca3 into nanoframework:develop Jun 16, 2018
@josesimoes josesimoes deleted the work-sp-dp-math branch June 16, 2018 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants