Skip to content

nios2: handle unimplemented multiply/divide instructions #2034

@zephyrbot

Description

@zephyrbot

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)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions