Software > Applications and Porting
[DEV] Is there any tool to detect the logic that might be impacted by endianess?
tle:
In light of the emergence of AI-assistant toolings, I am wondering if anyone has recommendation of any model/tooling that could help developers identify quickly logics in the codebase that might be impacted with endianess? I am looking into the source code of DOOM 3 BFG and slowly going through to see if it could be ported to PPC64 Big Endian but darn it is so much time-consuming, there must be a better way I assume
TimKelly:
Vector registers are endian. The most common use of vector code is through intrinsics, which should handle endian issues.
What is your development environment? What error messages do you get when you simply try to compile the code?
ClassicHasClass:
Generally anything that deals in a quantity and then starts addressing pieces of it (like a uint32_t that the code then starts accessing parts of with uint16_t or uint8_t, for example) will be sensitive to endianness, but there are other ways to make endian-dependent code, of course. But those are the most obvious sorts of "code smells."
tle:
--- Quote from: TimKelly on September 07, 2025, 05:39:34 am ---Vector registers are endian. The most common use of vector code is through intrinsics, which should handle endian issues.
What is your development environment? What error messages do you get when you simply try to compile the code?
--- End quote ---
Most of the time I would not get any error but likely run into unexpected behaviour when running the game or apps.
TimKelly:
--- Quote from: tle on September 17, 2025, 11:12:01 am ---
Most of the time I would not get any error but likely run into unexpected behaviour when running the game or apps.
--- End quote ---
Your verbs are unclear - "would not" and "likely run into" are future tense, as in, you are projecting what might occur. Are you saying the entire code base compiled but has odd behavior when running in Big-endian mode?
If you can compile the source code, run it in Little-endian mode and see if the same unexpected behaviors are present.
Navigation
[0] Message Index
[#] Next page
Go to full version