By: Charlie Burnes (charlie.burnes.delete@this.no-spam.com), May 23, 2022 12:46 am
Room: Moderated Discussions
> it's infeasible to distinguish "unaligned and has to be that way" from "unaligned and could maybe be refactored" via tooling.
That’s a good point that I didn’t consider. After thinking about it some more, I don’t think the U at the end of LoadU and StoreU are warts. To me, they are concise documentation that says the programmer knows there will be a performance hit here. Hopefully, the U will be rare. If I see a lot of LoadU or StoreU, it could suggest I need to reconsider the data layout. An tool would only highlight Load and Store without the U at the end, because those are the memory operations where the programmer is expecting the data to be aligned and it isn’t.
That’s a good point that I didn’t consider. After thinking about it some more, I don’t think the U at the end of LoadU and StoreU are warts. To me, they are concise documentation that says the programmer knows there will be a performance hit here. Hopefully, the U will be rare. If I see a lot of LoadU or StoreU, it could suggest I need to reconsider the data layout. An tool would only highlight Load and Store without the U at the end, because those are the memory operations where the programmer is expecting the data to be aligned and it isn’t.