On 13/08/2022 18:47, Maarten Brock wrote:
To the compiler a call to memcpy is just a call to any unknown function.
Probably it knows about your eeprom_log_fifo_push() implementation not
using a DIV and thus that the ISR is free of any DIV. But when the
memcpy is in it cannot make that *assumption* about it and thus keeps
the workaround.

Ah, I guess that explains things. Yes, SDCC would have no visibility into the code of __memcpy() at compile time, because it's part of the pre-compiled standard library, so it can't know what instructions are used within. I suppose the safest way is indeed to assume it might contain a DIV/DIVW instruction.

Shame, such calls to __memcpy() - where SDCC uses it 'behind the scenes' for copying structs - are invisible to the average developer, so one might not even realise they're getting the penalty of the overhead of the DIV workaround in their ISRs for no real reason.

But then if you're that concerned about performance, you would be looking at the output assembly anyway, and discover it - like I was. :)

Regards,
Basil Hussain


_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to