Description
Is your feature request related to a problem? Please describe.
Endianess or other programming related issues that require bytes swaps produce hard to read code and worse ghidra doesn't pick up type information all of the time for the swapped output.
Almost all ISA would have this as an instruction, ghidra has varying implementations.
Describe the solution you'd like
SLEIGH built in pcode for swap. Most likely this would be swap for 16, 32, and 64 (would this be 3 pcodeop or 1 where it picks up size?)
Ideally would see in the decompiler and implementing SLEIGH could be this string or just swap<N >
maybe.
out = __builtin_bswap16(in);
out = __builtin_bswap32(in);
out = __builtin_bswap64(in);
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
There have been comments in other issues and pull requests about coming features to easily extend pcodeops, don't know if this would be more common so makes sense to be in SLEIGH or if this sort of feature is easily solved with the approach being discussed elsewhere.