ULP RISCV SPI Simulation Using Bit-banging

MicroController
Posts: 2046
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ULP RISCV SPI Simulation Using Bit-banging

Postby MicroController » Wed Feb 26, 2025 11:12 pm

RandomInternetGuy wrote:
Wed Feb 26, 2025 7:56 am
- you can see why it might be timid[1] that end isn't changing as it's actually pointing to approximately itself.
No. With end (and ptr) being local variables they're not even supposed to be in RAM, much less somewhere near the (global) array they point to (i.o.w.: a local variable which address is never taken needs no consideration w.r.t. aliasing); besides, end is defined as const so the compiler has every right to assume that end will not change. Plus, if it couldn't prove that end won't change, the compiler would not be able to 'optimize' the loop back into an indexed for loop because it could not determine the number of iterations in advance.

Who is online

Users browsing this forum: No registered users and 23 guests