retdec
retdec copied to clipboard
Detect idiom: packing a 64-bit int from 2 32-bit ints
NumericT<64> int32From2Int16(NumericT<32> lo, NumericT<32> hi){
return lo | (hi << 32);
}
The same as in #1019 - an input sample to reproduce would help.
Is this some kind of compiler idiom?
IDK. May be generated (for unaligned access) and may be not. But it is surely widely used when coded manually.
Do you have some input on where it occurs?
It is a basic block for higher-level idioms. It is they that occur.
What do we produce at the moment?
Sometimes bit operations, sometimes integer arithmetics with the same effect.
What do you suggest we should produce? (Do I guess right that you propose a function call?)
Yeah. Add an (possibly inline) function and use it every time the idiom occurs.