ruduino icon indicating copy to clipboard operation
ruduino copied to clipboard

Come up with some way to instruct LLVM that all PORT/DDR registers are zeroed at startup

Open dylanmckay opened this issue 8 years ago • 3 comments

At the top of main, we should be able to assume that all PORT/DDR registers are zeroed.

This should let LLVM optimise RMW OR/AND/NOT instructions into a simple assignment.

dylanmckay avatar Aug 30 '17 03:08 dylanmckay

Maybe a macro that expands to something like

llvm::assume(PORTB::read() == 0);
...

We could tell all users to insert this into the top of main.

dylanmckay avatar Aug 30 '17 03:08 dylanmckay

all PORT/DDR registers are zeroed.

And that's true on soft restarts too?

shepmaster avatar Aug 30 '17 13:08 shepmaster

Perhaps there could be a compiler flag to insert that, too.

Restioson avatar Aug 30 '17 13:08 Restioson