© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
S. SmithRISC-V Assembly Language ProgrammingMaker Innovations Serieshttps://doi.org/10.1007/979-8-8688-0137-2_12

12. Optimizing Code

Stephen Smith1  
(1)
Gibsons, BC, Canada
 

In this chapter, how to make the uppercase routine more efficient is discussed. This includes design patterns for more efficient conditional statements. Optimizing code often involves thinking outside the box and going beyond finding ways to remove one or two instructions in a loop, often involving a major algorithmic change. Then several further common optimization techniques are listed, but first, a trick to simplify the main if statement will be given.

Optimizing the Uppercase Routine ...

Get RISC-V Assembly Language Programming: Unlock the Power of the RISC-V Instruction Set now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.