2015-12-28 01:23 AM
Hi.
I would like to rotate lower and upper half-word of a 32-bit variable as in next example: var = 0x12345678; --> I would like to get 0x56781234; How could I do this as fast as possible (time is critical)? I saw that there are some ASM instructions for that, but I don't know how to implement this in Keil in a .c file somewhere in between of a normal C code. Any suggestions? Have a nice holidays.2015-12-30 03:38 AM
Search for ''__ror intrinsic'' on the arm.com site. I haven't tried using intrinsics myself, (normally I write an assembly routine if things are critical). I'm sure there is some C statement that will optimise to a ROR instruction - you could try various C statements and check the listing.
2015-12-30 04:19 AM