Convert SSE intrinsics to readable C/C++ code? -
i've inherited highly optimized (sse4), uncommented c code. there tools or utilities convert sse intrinsics more readable code or pseudocode? readability understand code better before digging in , making changes.
i not know of such tool.
but not anyway. if sse code optimized well, hard part not decoding intrinsics. hard part following tricks improve locality , eliminate intra-iteration data dependencies (stripmining, polyhedral loop transformations, etc.)
i can give suggestion going forward, however: have well-commented scalar version of same routine written in simplest possible way. "reference code" should care readability , correctness, not speed... should have plenty of assertions. have test suite can exercise both scalar version , optimized variant(s).
whether implementing routine first time, or updating existing routine, start reference code , test suite. not in order.
this approach more expensive front, much cheaper in long run.
Comments
Post a Comment