News for hackers. Stuff that matters.
Re:Rules to avoid common extended inline assembly mistakes by mystified5016 on Sunday December 22, 2024 @12:29PM (#42487770)
Sometimes you genuinely know better than the compiler. Not often, but sometimes.

I'm an embedded developer and recently for work I had to do inline assembly. The function was there or four lines of C, two nested for loops. The runtime cost of the C is 200-300 cycles.

I rewrote the function in assembly using features particular to my CPU and brought the runtime cost to 90 cycles with no loops.

In this application, the 60% runtime reduction was worth the week it took to engineer.

There are no comments on this comment yet.