staticinline __attribute_const__ __u16 __arch_swab16(__u16 x)
{ /* Given that 'short' values are signed (i.e., can be negative), *wecannotassumethattheupper16-bitsoftheregisterare *zero.Wearecarefultomaskvaluesaftershifting.
*/
/* There exists an anomaly between xt-gcc and xt-xcc. xt-gcc *insertsanextuiinstructionafterputtingthisfunctioninline *toensurethatitusesonlytheleast-significant16bitsof *theresult.xt-xccdoesn'tuseanextui,butassumesthe *__asm__macrofollowsconventionthattheupper16bitsofan *'unsignedshort'resultarestillzero.Thismacrodoesn't *followconvention;indeed,itleavesgarbageintheupport16 *bitsoftheregister.
*Declaringthetemporaryvariables'res'and'tmp'tobe32-bit *typeswhilethereturntypeofthefunctionisa16-bittype *forcesbothcompilerstoinsertexactlyoneextuiinstruction
* (or equivalent) to mask off the upper 16 bits. */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.