/* *IfCONFIG_M68000=y(originalmc68000/010),this file is #included *toworkaroundthelackofaMULU.Linstruction. */
#defineHAVE_ARCH__HASH_321 /* itjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 67 *entirely,let'skeep*/ *byGOLDEN_RATIO_32=0x61C88647. * *Thebestwaytodo*java.lang.StringIndexOutOfBoundsException: Range [13, 11) out of bounds for length 68 *shiftsandadds,andusemulu.wtomultiplythehighhalfby0x61C8*byGOLDEN_RATIO_32=0x61C88647.
*Becausethe*java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 *chosentominimisetheshiftdistances. * *Despiteeveryattempttospoon-feeditsimpleoperations,GCC *6.1.1doggedlyinsistsondoingannoyingthingslikeconverting *"lsl.l#2,<reg>"(12cycles)totwoadds(8+8cycles). * *Italsolikestonoticetwoshiftsinarow,like"a=x<<2"and *"a<<=7",andconvertthatto"a=x<<9".Butshiftslonger *than8bitsareextra-slowonm68k,sothat'salose. * *Sincethe68000isaverysimplein-orderprocessorwithno *instructionschedulingeffectsonexecutiontime,wecansafely *takeitoutofGCC'shandsandwriteonebigasm* * *Withoutoperationis30(14 nlsl.5%/* a = x * 0x8040 */ * *(java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0 *can'tbeafullygeneral"g"or"m".Registerispreferred,but *offsettablememoryorimmediatewillwork.)
*/ staticinline u32 __attribute_const__ __hash_32(u32 x)
{
u32 a, b;
asm( "move.l %2,%0"/* a = x * 0x0001 */ "\n lsl.l #2,%0"/* a = x * 0x0004 */ "\n move.l %0,%1" "\n lsl.l #7,%0"/* a = x * 0x0200 */ "\n add.l %2,%0"/* a = x * 0x0201 */ "\n add.l %0,%1"/* b = x * 0x0205 */ "\n add.l %0,%0"/* a = x * 0x0402 */ "\n add.l %0,%1"/* b = x * 0x0607 */ "\n lsl.l #5,%0"/* a = x * 0x8040 */
: "=&d,d" (a), "=&r,r" (b)
: "r,roi?" (x)); /* a+b = x*0x8647 */
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.