Code Monkey home page Code Monkey logo

Comments (4)

leo60228 avatar leo60228 commented on August 16, 2024 2

I haven't looked at the soft-float library that is shipped with the C SDK, but I do not want to embed a C floating point library into our HAL. End-users can choose to do that if they like, but we are not going to impose that on everyone.

The floating point library is in ROM. The C SDK just has some assembly stubs to make use of it.

from rp-hal.

leo60228 avatar leo60228 commented on August 16, 2024

I'm not 100% sure, but I believe that this is an issue for https://compiler-rt.llvm.org/ and not this project.

from rp-hal.

9names avatar 9names commented on August 16, 2024

I think supporting the hardware divider is a good goal that deserves a tracking issue.
I've created a tracking issue for that at #35 if you would like to implement this.

As far as the other questions / thoughts go, I have some opinions.

I haven't looked at the soft-float library that is shipped with the C SDK, but I do not want to embed a C floating point library into our HAL. End-users can choose to do that if they like, but we are not going to impose that on everyone.

As for the hardware divider: As a user, I would not expect our implementation to override operator div(/) and operator mod(%) for i32/u32 (it would need to be part of the core lib to do this)
Neither do I think it likely that it would be implemented as part of LLVM-RT or Rust core lib.
Both of these projects target standard CPU features; this is a separate hardware peripheral that's specific to one processor family, requires use of target specific spinlock peripherals for multi-processor safety, and could be placed at another memory address on another pi microcontroller, etc.

In a C/C++ embedded it's fairly common for the vendor to ship toolchain with a custom version of libc.
For Rust, people are used to calling cargo or rustup and not having to deal with the typical one-toolchain-per-product-family that often only gets a single release.
I don't think the benefit of ease-of-use of div/mod with operator / and operator % is worth this cost, especially when embedded users will likely have to deal with function-style variations on arithmetic anyway ( for checked_div, saturating_add, etc).

from rp-hal.

9names avatar 9names commented on August 16, 2024

Closing this out as we now have basic support for the hardware divider

from rp-hal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.