I'm working with an XScale ARM processor (armv5te architecture). I have a GCC cross compiler.
I'm trying to store the output of an SMULL instruction into a 'long long' using inline assembly and the STRD instruction. However, I can't seem to get it right. SMULL places two 32-bit parts into separate registers (high and low). How do I get these values into my 'long long' data type? I tried using the STRD instruction with a pointer to the 64-bit datatype, but I get correct results only at optimization levels 1 and 3.
So I have two questions:
- How do I tell the compiler with inline assembly that I am going to be changing the value that's pointed by an input operand? My input operand is a pointer to the 64-bit datatype, but GCC seems to do whatever it wants with the actual value. In inline assembly I can specify the operand constraints, but in this case I want to inform the compiler about the referenced value, and not only the actual operand (pointer).
- In general, how do people concatenate the high and low words of 64-bit results to create a 'long long' type? I know I can use shifts and addition, but that is just ridiculous...
I can post my current code if necessary.
Thanks!