I am optimizing some hotspots in my application and compilation is done using gcc-arm.
Now, is there any chance that the following statements result in different assembler code:
static const pixel_t roundedwhite = 4294572537U;
return (packed >= roundedwhite) ? purewhite : packed;
// OR
const pixel_t roundedwhite = 4294572537U;
return (packed >= roundedwhite) ? purewhite : packed;
// OR
return (packed >= 4294572537U) ? purewhite : packed;
Is there any chance that my ARM compiler might produce the unwanted code for the first case or should this get optimized anyway?
I assume that it’s pretty the same, but, unfortunately, I am not that sure in what gcc-arm does compared to ordinary gcc and I can’t access the disassembly listing.
Thank you very much.
Call gcc with the
-Sflag and take a look at the assembly:I would it out try myself to include in the answer, but I don’t have an ARM compiler handy.