On 03/24/2017 05:39 PM, William Westfield wrote: > Why does it need to be a “single instruction” for the compiler to > create inline code for the shift (two instruction: "clrc; rrc", > right) instead of pulling in (apparently) a library that includes > code for every possible shift count and size? >
It doesn't have to be, it is just a hint at what happened. I did notice that the compiler produced the clrc; rrc pair when shifting a device register value on a FR5969. I had expected the rrux instruction (with optional repeat count) but the code size is the same. At least for single shifts. Oh, another thing to try to reduce the final code size is to pass the option "--gc-sections" to the linker. This enables garbage collection on unused code. I just enabled it on a FR5969 project and it reduced the code size from 23071 bytes to 19812. -- David W. Schultz http://home.earthlink.net/~david.schultz "Life without stock is barely worth living..." - Anthony Bourdain ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users