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

nios2: handle unimplemented multiply/divide instructions #2034

Closed
zephyrbot opened this issue Jun 23, 2016 · 2 comments
Closed

nios2: handle unimplemented multiply/divide instructions #2034

zephyrbot opened this issue Jun 23, 2016 · 2 comments
Assignees
Labels
area: Kernel Enhancement Changes/Updates/Additions to existing features priority: high High impact/importance bug
Milestone

Comments

@zephyrbot
Copy link
Collaborator

zephyrbot commented Jun 23, 2016

Reported by Andrew Boie:

Nios II CPUs may not implement the "mul", "div", or "mulx" families of instructions, if these are encountered the CPU will generate an exception. Modify the kernel so that this kind of math can still be done in an optimal way.

Two choices on the table:

  1. Somehow pull in system.h definitions into the Make environment (there are defines indicating which, if any, of the math instructions are unimplemented), and conditionally set appropriate CFLAGS so that GCC knows to use integer library routines instead of emitting unimplemented instructions.
  2. Enable all the math instructions in GCC and pull in alt_exception_muldiv.S from the Altera HAL to handle this stuff at runtime.

My inclination is for #1 but checking with Altera for a recommendation.

(Imported from Jira ZEP-489)

@zephyrbot
Copy link
Collaborator Author

by Andrew Boie:

Test case:
https://gerrit.zephyrproject.org/r/#/c/2726/

Runtime implementation, pulled from Altera HAL, not tested on HW
https://gerrit.zephyrproject.org/r/#/c/2721/

Waiting on advice from Altera on whether to do this at build or runtime before proceeding further.

@zephyrbot
Copy link
Collaborator Author

by Andrew Boie:

Altera recommends doing at build time if CPU config is known then. So I'll take that approach.

@zephyrbot zephyrbot added priority: high High impact/importance bug area: Kernel Enhancement Changes/Updates/Additions to existing features labels Sep 23, 2017
@zephyrbot zephyrbot added this to the v1.5.0 milestone Sep 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel Enhancement Changes/Updates/Additions to existing features priority: high High impact/importance bug
Projects
None yet
Development

No branches or pull requests

2 participants