3 ms·
Yeah, and I like I mentioned in the earlier comment, omitting the frame pointer reduces code size by 10% on RISC-V targets, which is huge when dealing with embe
by xobs 3y ago
Yeah, and I like I mentioned in the earlier comment, omitting the frame pointer reduces code size by 10% on RISC-V targets, which is huge when dealing with embedded flash: https://github.com/tock/tock/pull/1660 https://github.com/tock/tock/pull/1660
- fulafel 3y agoThis says the penalty is 10% on risc-v vs 2-3% on arm - anyone have background for why it's so?
- Someone 3y agoThere can only be two answers: - ARM frame pointer handling is more compact (relative to the non-frame pointer code) than that on RISC-V. - ARM code does less frame pointer handling. The first might be true because ARM has the stmdb instruction which (https://developer.arm.com/documentation/ddi0406/b/Application-Level-Architecture/Instruction-Details/Alphabetical-list-of-instructions/STMDB---STMFD https://developer.arm.com/documentation/ddi0406/b/Applicatio...) stores multiple registers to consecutive memory locations using an address from a base register. The consecutive memory locations end just below this address, and the address of the first of those locations can optionally be written back to the base register. So, code can save registers on the stack _and_ decrease the stack pointer in a single instruction. The second might be true because, of the compilers/compiler settings used for those measurements the ARM one did more aggressive function inlining.