/* This 12-byte structure is used to improve the accuracy of computation oftranscendentalfunctions. Intendedtobeusedtogetresultsbetterthan8-bytecomputation allows.9-bytewouldprobablybesufficient.
*/ typedefstruct { unsignedlong lsw; unsignedlong midw; unsignedlong msw;
} Xsig;
/* Multiply two fixed-point 32 bit numbers, producing a 32 bit result.
The answer is the ms word of the product. */ /* Some versions of gcc make it difficult to stop eax from being clobbered. Merelyspecifyingthatitisuseddoesn'twork...
*/ staticinlineunsignedlong mul_32_32(constunsignedlong arg1, constunsignedlong arg2)
{ int retval; asmvolatile ("mull %2; movl %%edx,%%eax":"=a" (retval)
:"0"(arg1), "g"(arg2)
:"dx"); return retval;
}
/* Add the 12 byte Xsig x2 to Xsig dest, with no checks for overflow. */ staticinlinevoid add_Xsig_Xsig(Xsig *dest, const Xsig *x2)
{ asmvolatile ("movl %1,%%edi; movl %2,%%esi;\n" "movl (%%esi),%%eax; addl %%eax,(%%edi);\n" "movl 4(%%esi),%%eax; adcl %%eax,4(%%edi);\n" "movl 8(%%esi),%%eax; adcl %%eax,8(%%edi);\n":"=g"
(*dest):"g"(dest), "g"(x2)
:"ax", "si", "di");
}
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.