Is "rev" provided through PropGCC?
DavidZemon
Posts: 2,973
The Propeller has a couple pretty cool instructions with no equivalent in C. Specifically, I'm looking for the rev instruction. Is that provided through PropGCC? If not, could it be? I know I can use it via inline assembly, but that's quite verbose for a single instruction.
Comments
Pretty much any Propeller instruction which doesn't have an "obvious" way to write it in C (the lock, wait, etc. instructions, for example) will have a __builtin_propeller_xxx function, where xxx is the PASM opcode (all lower case).
The <propeller.h> include file has nice macro wrappers for many of these, but that's optional.
Eric
Andy
Edit. Okay Eric was a bit faster - but only a bit..
I thought I saw something like that but couldn't find it. Thanks!
Andy, thanks to you too :P
--Edit--
Or maybe it does, but not when used with CMM?
I'm not sure about PropGCC 1.0, but later versions (like alpha v1_9_0) compile: to in both LMM and CMM mode.
I have seen cases where andn is not used inside loops, though -- unfortunately the loop optimization code sometimes hoists the "~y" part out of the loop, and ends up using more registers as a result.