VirtualBox

Ignore:
Timestamp:
Nov 16, 2015 10:49:31 PM (9 years ago)
Author:
vboxsync
Message:

iprt/asm-watcom-x86-32.h: Initial pragma aux implementation for 32-bit Watcom C/C++ code.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asm-watcom-x86-32.h

    r58708 r58709  
    11/** @file
    2  * IPRT - Assembly Functions, x86 16-bit Watcom C/C++ pragma aux.
     2 * IPRT - Assembly Functions, x86 32-bit Watcom C/C++ pragma aux.
    33 */
    44
     
    2727# error "Don't include this header directly."
    2828#endif
    29 #ifndef ___iprt_asm_watcom_x86_16_h
    30 #define ___iprt_asm_watcom_x86_16_h
    31 
    32 #if !RT_FAR_DATA
    33 # error "Only works with far data pointers!"
     29#ifndef ___iprt_asm_watcom_x86_32_h
     30#define ___iprt_asm_watcom_x86_32_h
     31
     32#ifndef __FLAT__
     33# error "Only works with flat pointers! (-mf)"
    3434#endif
    3535
     
    4444    "nop" \
    4545    parm [] \
    46     modify exact [ax bx cx dx es ds];
     46    modify exact [eax ebx ecx edx es ds fs gs];
    4747#else
    4848# pragma aux ASMCompilerBarrier = \
     
    6060
    6161#pragma aux ASMAtomicXchgU8 = \
    62     "xchg es:[bx], al" \
    63     parm [es bx] [al] \
     62    "xchg [ecx], al" \
     63    parm [ecx] [al] \
    6464    value [al] \
    6565    modify exact [al];
    6666
    6767#pragma aux ASMAtomicXchgU16 = \
    68     "xchg es:[bx], ax" \
    69     parm [es bx] [ax] \
     68    "xchg [ecx], ax" \
     69    parm [ecx] [ax] \
    7070    value [ax] \
    7171    modify exact [ax];
    7272
    7373#pragma aux ASMAtomicXchgU32 = \
    74     "shl  ecx, 16" \
    75     "mov  cx, ax" \
    76     "xchg es:[bx], ecx" \
    77     "mov  eax, ecx" \
    78     "shr  ecx, 16" \
    79     parm [es bx] [ax cx] \
    80     value [ax cx] \
    81     modify exact [ax cx];
     74    "xchg [ecx], eax" \
     75    parm [ecx] [eax] \
     76    value [eax] \
     77    modify exact [eax];
    8278
    8379#pragma aux ASMAtomicXchgU64 = \
    8480    ".586" \
    85     "shl eax, 16" \
    86     "mov ax, bx" /* eax = high dword */ \
    87     "shl ecx, 16" \
    88     "mov cx, dx" /* ecx = low dword */ \
    89     "mov ebx, ecx" /* ebx = low */ \
    90     "mov ecx, eax" /* ecx = high */ \
    9181    "try_again:" \
    92     "lock cmpxchg8b es:[si]" \
     82    "lock cmpxchg8b [esi]" \
    9383    "jnz try_again" \
    94     "xchg eax, edx" \
    95     "mov  ebx, eax" \
    96     "shr  eax, 16" \
    97     "mov  ecx, edx" \
    98     "shr  ecx, 16" \
    99     parm [es si] [dx cx bx ax] \
    100     value [dx cx bx ax] \
    101     modify exact [dx cx bx ax];
     84    parm [esi] [ebx ecx] \
     85    value [eax edx] \
     86    modify exact [edx ecx ebx eax];
    10287
    10388#pragma aux ASMAtomicCmpXchgU8 = \
    10489    ".486" \
    105     "lock cmpxchg es:[bx], cl" \
    106     "setz al" \
    107     parm [es bx] [cl] [al] \
     90    "lock cmpxchg [edx], cl" \
     91    "setz al" \
     92    parm [edx] [cl] [al] \
    10893    value [al] \
    10994    modify exact [al];
     
    11196#pragma aux ASMAtomicCmpXchgU16 = \
    11297    ".486" \
    113     "lock cmpxchg es:[bx], cx" \
    114     "setz al" \
    115     parm [es bx] [cx] [ax] \
     98    "lock cmpxchg [edx], cx" \
     99    "setz al" \
     100    parm [edx] [cx] [ax] \
    116101    value [al] \
    117102    modify exact [ax];
     
    119104#pragma aux ASMAtomicCmpXchgU32 = \
    120105    ".486" \
    121     "shl ecx, 16" \
    122     "mov cx, dx" \
    123     "shl eax, 16" \
    124     "mov ax, di" \
    125     "rol eax, 16" \
    126     "lock cmpxchg es:[bx], ecx" \
    127     "setz al" \
    128     parm [es bx] [cx dx] [ax di] \
    129     value [al] \
    130     modify exact [ax cx];
    131 
    132 /* ASMAtomicCmpXchgU64: External assembly implementation, too few registers for parameters.  */
    133 /* ASMAtomicCmpXchgExU32: External assembly implementation, too few registers for parameters.  */
    134 /* ASMAtomicCmpXchgExU64: External assembly implementation, too few registers for parameters.  */
     106    "lock cmpxchg [edx], ecx" \
     107    "setz al" \
     108    parm [edx] [ecx] [eax] \
     109    value [al] \
     110    modify exact [eax];
     111
     112#pragma aux ASMAtomicCmpXchgU64 = \
     113    ".586" \
     114    "lock cmpxchg8b [edi]" \
     115    "setz al" \
     116    parm [edi] [ebx ecx] [eax edx] \
     117    value [al] \
     118    modify exact [eax edx];
     119
     120#pragma aux ASMAtomicCmpXchgExU32 = \
     121    ".586" \
     122    "lock cmpxchg [edx], ecx" \
     123    "mov [edi], eax" \
     124    "setz al" \
     125    parm [edx] [ecx] [eax] [edi] \
     126    value [al] \
     127    modify exact [eax];
     128
     129#pragma aux ASMAtomicCmpXchgExU64 = \
     130    ".586" \
     131    "lock cmpxchg8b [edi]" \
     132    "mov [esi], eax" \
     133    "mov [esi + 4], edx" \
     134    "setz al" \
     135    parm [edi] [ebx ecx] [eax edx] [esi] \
     136    value [al] \
     137    modify exact [eax edx];
    135138
    136139#pragma aux ASMSerializeInstruction = \
     
    139142    "cpuid" \
    140143    parm [] \
    141     modify exact [ax bx cx dx];
     144    modify exact [eax ebx ecx edx];
    142145
    143146#pragma aux ASMAtomicReadU64 = \
    144147    ".586" \
    145148    "xor eax, eax" \
    146     "xor edx, edx" \
    147     "xor ebx, ebx" \
    148     "xor ecx, ecx" \
    149     "lock cmpxchg8b es:[si]" \
    150     "xchg eax, edx" \
    151     "mov  ebx, eax" \
    152     "shr  eax, 16" \
    153     "mov  ecx, edx" \
    154     "shr  ecx, 16" \
    155     parm [es si] [dx cx bx ax] \
    156     value [dx cx bx ax] \
    157     modify exact [dx cx bx ax];
     149    "mov edx, eax" \
     150    "mov ebx, eax" \
     151    "mov ecx, eax" \
     152    "lock cmpxchg8b [edi]" \
     153    parm [edi] \
     154    value [eax edx] \
     155    modify exact [eax ebx ecx edx];
    158156
    159157#pragma aux ASMAtomicUoReadU64 = \
    160158    ".586" \
    161159    "xor eax, eax" \
    162     "xor edx, edx" \
    163     "xor ebx, ebx" \
    164     "xor ecx, ecx" \
    165     "lock cmpxchg8b es:[si]" \
    166     "xchg eax, edx" \
    167     "mov  ebx, eax" \
    168     "shr  eax, 16" \
    169     "mov  ecx, edx" \
    170     "shr  ecx, 16" \
    171     parm [es si] [dx cx bx ax] \
    172     value [dx cx bx ax] \
    173     modify exact [dx cx bx ax];
     160    "mov edx, eax" \
     161    "mov ebx, eax" \
     162    "mov ecx, eax" \
     163    "lock cmpxchg8b [edi]" \
     164    parm [edi] \
     165    value [eax edx] \
     166    modify exact [eax ebx ecx edx];
    174167
    175168#pragma aux ASMAtomicAddU16 = \
    176169    ".486" \
    177     "lock xadd es:[bx], ax" \
    178     parm [es bx] [ax] \
     170    "lock xadd [ecx], ax" \
     171    parm [ecx] [ax] \
    179172    value [ax] \
    180173    modify exact [ax];
     
    182175#pragma aux ASMAtomicAddU32 = \
    183176    ".486" \
    184     "shl edx, 16" \
    185     "mov dx, ax" \
    186     "lock xadd es:[bx], edx" \
    187     "mov ax, dx" \
    188     "shr edx, 16" \
    189     parm [es bx] [ax dx] \
    190     value [ax dx] \
    191     modify exact [ax dx];
     177    "lock xadd [ecx], eax" \
     178    parm [ecx] [eax] \
     179    value [eax] \
     180    modify exact [eax];
    192181
    193182#pragma aux ASMAtomicIncU16 = \
    194183    ".486" \
    195184    "mov ax, 1" \
    196     "lock xadd es:[bx], ax" \
     185    "lock xadd [ecx], ax" \
    197186    "inc ax" \
    198     parm [es bx] \
     187    parm [ecx] \
    199188    value [ax] \
    200189    modify exact [ax];
     
    202191#pragma aux ASMAtomicIncU32 = \
    203192    ".486" \
    204     "mov edx, 1" \
    205     "lock xadd es:[bx], edx" \
    206     "inc edx" \
    207     "mov ax, dx" \
    208     "shr edx, 16" \
    209     parm [es bx] \
    210     value [ax dx] \
    211     modify exact [ax dx];
     193    "mov eax, 1" \
     194    "lock xadd [ecx], eax" \
     195    "inc eax" \
     196    parm [ecx] \
     197    value [eax] \
     198    modify exact [eax];
    212199
    213200/* ASMAtomicIncU64: Should be done by C inline or in external file. */
     
    216203    ".486" \
    217204    "mov ax, 0ffffh" \
    218     "lock xadd es:[bx], ax" \
     205    "lock xadd [ecx], ax" \
    219206    "dec ax" \
    220     parm [es bx] \
     207    parm [ecx] \
    221208    value [ax] \
    222209    modify exact [ax];
     
    224211#pragma aux ASMAtomicDecU32 = \
    225212    ".486" \
    226     "mov edx, 0ffffffffh" \
    227     "lock xadd es:[bx], edx" \
    228     "dec edx" \
    229     "mov ax, dx" \
    230     "shr edx, 16" \
    231     parm [es bx] \
    232     value [ax dx] \
    233     modify exact [ax dx];
     213    "mov eax, 0ffffffffh" \
     214    "lock xadd [ecx], eax" \
     215    "dec eax" \
     216    parm [ecx] \
     217    value [eax] \
     218    modify exact [eax];
    234219
    235220/* ASMAtomicDecU64: Should be done by C inline or in external file. */
    236221
    237222#pragma aux ASMAtomicOrU32 = \
    238     "shl edx, 16" \
    239     "mov dx, ax" \
    240     "lock or es:[bx], edx" \
    241     parm [es bx] [ax dx] \
    242     modify exact [dx];
     223    "lock or [ecx], eax" \
     224    parm [ecx] [eax] \
     225    modify exact [];
    243226
    244227/* ASMAtomicOrU64: Should be done by C inline or in external file. */
    245228
    246229#pragma aux ASMAtomicAndU32 = \
    247     "shl edx, 16" \
    248     "mov dx, ax" \
    249     "lock and es:[bx], edx" \
    250     parm [es bx] [ax dx] \
    251     modify exact [dx];
     230    "lock and [ecx], eax" \
     231    parm [ecx] [eax] \
     232    modify exact [];
    252233
    253234/* ASMAtomicAndU64: Should be done by C inline or in external file. */
    254235
    255236#pragma aux ASMAtomicUoOrU32 = \
    256     "shl edx, 16" \
    257     "mov dx, ax" \
    258     "or es:[bx], edx" \
    259     parm [es bx] [ax dx] \
    260     modify exact [dx];
     237    "or [ecx], eax" \
     238    parm [ecx] [eax] \
     239    modify exact [];
    261240
    262241/* ASMAtomicUoOrU64: Should be done by C inline or in external file. */
    263242
    264243#pragma aux ASMAtomicUoAndU32 = \
    265     "shl edx, 16" \
    266     "mov dx, ax" \
    267     "and es:[bx], edx" \
    268     parm [es bx] [ax dx] \
    269     modify exact [dx];
     244    "and [ecx], eax" \
     245    parm [ecx] [eax] \
     246    modify exact [];
    270247
    271248/* ASMAtomicUoAndU64: Should be done by C inline or in external file. */
     
    273250#pragma aux ASMAtomicUoIncU32 = \
    274251    ".486" \
    275     "mov edx, 1" \
    276     "xadd es:[bx], edx" \
    277     "inc edx" \
    278     "mov ax, dx" \
    279     "shr edx, 16" \
    280     parm [es bx] \
    281     value [ax dx] \
    282     modify exact [ax dx];
     252    "xadd [ecx], eax" \
     253    "inc eax" \
     254    parm [ecx] \
     255    value [eax] \
     256    modify exact [eax];
    283257
    284258#pragma aux ASMAtomicUoDecU32 = \
    285259    ".486" \
    286     "mov edx, 0ffffffffh" \
    287     "xadd es:[bx], edx" \
    288     "dec edx" \
    289     "mov ax, dx" \
    290     "shr edx, 16" \
    291     parm [es bx] \
    292     value [ax dx] \
    293     modify exact [ax dx];
     260    "mov eax, 0ffffffffh" \
     261    "xadd [ecx], eax" \
     262    "dec eax" \
     263    parm [ecx] \
     264    value [eax] \
     265    modify exact [eax];
    294266
    295267#pragma aux ASMMemZeroPage = \
     
    297269    "xor eax, eax" \
    298270    "rep stosd"  \
    299     parm [es di] \
    300     modify exact [ax cx di];
     271    parm [edi] \
     272    modify exact [eax ecx edi];
    301273
    302274#pragma aux ASMMemZero32 = \
    303     "and ecx, 0ffffh" /* probably not necessary, lazy bird should check... */ \
    304275    "shr ecx, 2" \
    305276    "xor eax, eax" \
    306277    "rep stosd"  \
    307     parm [es di] [cx] \
    308     modify exact [ax cx di];
     278    parm [edi] [ecx] \
     279    modify exact [eax ecx edi];
    309280
    310281#pragma aux ASMMemZero32 = \
    311     "and ecx, 0ffffh" /* probably not necessary, lazy bird should check... */ \
    312282    "shr ecx, 2" \
    313     "shr eax, 16" \
    314     "mov ax, dx" \
    315     "rol eax, 16" \
    316283    "rep stosd"  \
    317     parm [es di] [cx] [ax dx]\
    318     modify exact [ax cx di];
     284    parm [edi] [ecx] [eax]\
     285    modify exact [ecx edi];
    319286
    320287#pragma aux ASMProbeReadByte = \
    321     "mov al, es:[bx]" \
    322     parm [es bx] \
     288    "mov al, [ecx]" \
     289    parm [ecx] \
    323290    value [al] \
    324291    modify exact [al];
    325292
    326293#pragma aux ASMBitSet = \
    327     "shl edx, 16" \
    328     "mov dx, ax" \
    329     "bts es:[bx], edx" \
    330     parm [es bx] [ax dx] \
    331     modify exact [dx];
     294    "bts [ecx], eax" \
     295    parm [ecx] [eax] \
     296    modify exact [];
    332297
    333298#pragma aux ASMAtomicBitSet = \
    334     "shl edx, 16" \
    335     "mov dx, ax" \
    336     "lock bts es:[bx], edx" \
    337     parm [es bx] [ax dx] \
    338     modify exact [dx];
     299    "lock bts [ecx], eax" \
     300    parm [ecx] [eax] \
     301    modify exact [];
    339302
    340303#pragma aux ASMBitClear = \
    341     "shl edx, 16" \
    342     "mov dx, ax" \
    343     "btr es:[bx], edx" \
    344     parm [es bx] [ax dx] \
    345     modify exact [dx];
     304    "btr [ecx], eax" \
     305    parm [ecx] [eax] \
     306    modify exact [];
    346307
    347308#pragma aux ASMAtomicBitClear = \
    348     "shl edx, 16" \
    349     "mov dx, ax" \
    350     "lock btr es:[bx], edx" \
    351     parm [es bx] [ax dx] \
    352     modify exact [dx];
     309    "lock btr [ecx], eax" \
     310    parm [ecx] [eax] \
     311    modify exact [];
    353312
    354313#pragma aux ASMBitToggle = \
    355     "shl edx, 16" \
    356     "mov dx, ax" \
    357     "btc es:[bx], edx" \
    358     parm [es bx] [ax dx] \
    359     modify exact [dx];
     314    "btc [ecx], eax" \
     315    parm [ecx] [eax] \
     316    modify exact [];
    360317
    361318#pragma aux ASMAtomicBitToggle = \
    362     "shl edx, 16" \
    363     "mov dx, ax" \
    364     "lock btc es:[bx], edx" \
    365     parm [es bx] [ax dx] \
    366     modify exact [dx];
    367 ///
    368 ///
     319    "lock btc [ecx], eax" \
     320    parm [ecx] [eax] \
     321    modify exact [];
     322
     323
    369324#pragma aux ASMBitTestAndSet = \
    370     "shl edx, 16" \
    371     "mov dx, ax" \
    372     "bts es:[bx], edx" \
    373     "setc al" \
    374     parm [es bx] [ax dx] \
    375     value [al] \
    376     modify exact [ax dx];
     325    "bts [ecx], eax" \
     326    "setc al" \
     327    parm [ecx] [eax] \
     328    value [al] \
     329    modify exact [eax];
    377330
    378331#pragma aux ASMAtomicBitTestAndSet = \
    379     "shl edx, 16" \
    380     "mov dx, ax" \
    381     "lock bts es:[bx], edx" \
    382     "setc al" \
    383     parm [es bx] [ax dx] \
    384     value [al] \
    385     modify exact [ax dx];
     332    "lock bts [ecx], eax" \
     333    "setc al" \
     334    parm [ecx] [eax] \
     335    value [al] \
     336    modify exact [eax];
    386337
    387338#pragma aux ASMBitTestAndClear = \
    388     "shl edx, 16" \
    389     "mov dx, ax" \
    390     "btr es:[bx], edx" \
    391     "setc al" \
    392     parm [es bx] [ax dx] \
    393     value [al] \
    394     modify exact [ax dx];
     339    "btr [ecx], eax" \
     340    "setc al" \
     341    parm [ecx] [eax] \
     342    value [al] \
     343    modify exact [eax];
    395344
    396345#pragma aux ASMAtomicBitTestAndClear = \
    397     "shl edx, 16" \
    398     "mov dx, ax" \
    399     "lock btr es:[bx], edx" \
    400     "setc al" \
    401     parm [es bx] [ax dx] \
    402     value [al] \
    403     modify exact [ax dx];
     346    "lock btr [ecx], eax" \
     347    "setc al" \
     348    parm [ecx] [eax] \
     349    value [al] \
     350    modify exact [eax];
    404351
    405352#pragma aux ASMBitTestAndToggle = \
    406     "shl edx, 16" \
    407     "mov dx, ax" \
    408     "btc es:[bx], edx" \
    409     "setc al" \
    410     parm [es bx] [ax dx] \
    411     value [al] \
    412     modify exact [ax dx];
     353    "btc [ecx], eax" \
     354    "setc al" \
     355    parm [ecx] [eax] \
     356    value [al] \
     357    modify exact [eax];
    413358
    414359#pragma aux ASMAtomicBitTestAndToggle = \
    415     "shl edx, 16" \
    416     "mov dx, ax" \
    417     "lock btc es:[bx], edx" \
    418     "setc al" \
    419     parm [es bx] [ax dx] \
    420     value [al] \
    421     modify exact [ax dx];
     360    "lock btc [ecx], eax" \
     361    "setc al" \
     362    parm [ecx] [eax] \
     363    value [al] \
     364    modify exact [eax];
    422365
    423366/** @todo this is way to much inline assembly, better off in an external function. */
    424367#pragma aux ASMBitFirstClear = \
    425     "mov bx, di" /* save start of bitmap for later */ \
    426     "shl ecx, 16" \
    427     "mov cx, ax" /* ecx = cBits */ \
     368    "mov edx, edi" /* save start of bitmap for later */ \
    428369    "add ecx, 31" \
    429370    "shr ecx, 5" /* cDWord = RT_ALIGN_32(cBits, 32) / 32; */  \
    430371    "mov eax, 0ffffffffh" \
    431     "mov edx, eax" /* default return value */ \
    432372    "repe scasd" \
    433373    "je done" \
    434     "sub di, 4" /* rewind di */ \
    435     "xor eax, es:[di]" /* load inverted bits */ \
    436     "sub di, bx" /* calc byte offset */ \
    437     "movzx edi, di" \
     374    "lea edi, [edi - 4]" /* rewind edi */ \
     375    "xor eax, [edi]" /* load inverted bits */ \
     376    "sub edi, edx" /* calc byte offset */ \
    438377    "shl edi, 3" /* convert byte to bit offset */ \
    439     "bsf edx, eax" \
    440     "add edx, edi" \
     378    "mov edx, eax" \
     379    "bsf eax, edx" \
     380    "add eax, edi" \
    441381    "done:" \
    442     "mov eax, edx" \
    443     "shr edx, 16" \
    444     parm [es di] [ax cx] \
    445     value [ax dx] \
    446     modify exact [ax bx cx dx di];
     382    parm [edi] [ecx] \
     383    value [eax] \
     384    modify exact [eax ecx edx edi];
    447385
    448386/* ASMBitNextClear: Too much work, do when needed. */
     
    450388/** @todo this is way to much inline assembly, better off in an external function. */
    451389#pragma aux ASMBitFirstSet = \
    452     "mov bx, di" /* save start of bitmap for later */ \
    453     "shl ecx, 16" \
    454     "mov cx, ax" /* ecx = cBits */ \
     390    "mov edx, edi" /* save start of bitmap for later */ \
    455391    "add ecx, 31" \
    456392    "shr ecx, 5" /* cDWord = RT_ALIGN_32(cBits, 32) / 32; */  \
    457     "xor eax, eax" \
    458     "mov edx, 0ffffffffh" /* default return value */ \
     393    "mov eax, 0ffffffffh" \
    459394    "repe scasd" \
    460395    "je done" \
    461     "sub di, 4" /* rewind di */ \
    462     "mov eax, es:[di]" /* reload previous dword */ \
    463     "sub di, bx" /* calc byte offset */ \
    464     "movzx edi, di" \
     396    "lea edi, [edi - 4]" /* rewind edi */ \
     397    "mov eax, [edi]" /* reload previous dword */ \
     398    "sub edi, edx" /* calc byte offset */ \
    465399    "shl edi, 3" /* convert byte to bit offset */ \
    466     "bsf edx, eax" /* find first set bit in dword */ \
    467     "add edx, edi" /* calc final bit number */ \
     400    "mov edx, eax" \
     401    "bsf eax, edx" \
     402    "add eax, edi" \
    468403    "done:" \
    469     "mov eax, edx" \
    470     "shr edx, 16" \
    471     parm [es di] [ax cx] \
    472     value [ax dx] \
    473     modify exact [ax bx cx dx di];
     404    parm [edi] [ecx] \
     405    value [eax] \
     406    modify exact [eax ecx edx edi];
    474407
    475408/* ASMBitNextSet: Too much work, do when needed. */
    476409
    477410#pragma aux ASMBitFirstSetU32 = \
    478     "shl edx, 16" \
    479     "mov dx, ax" \
    480     "bsf eax, edx" \
     411    "bsf eax, eax" \
    481412    "jz  not_found" \
    482     "inc ax" \
     413    "inc eax" \
    483414    "jmp done" \
    484415    "not_found:" \
    485     "xor ax, ax" \
     416    "xor eax, eax" \
    486417    "done:" \
    487     parm [ax dx] nomemory \
    488     value [ax] \
    489     modify exact [ax dx] nomemory;
     418    parm [eax] nomemory \
     419    value [eax] \
     420    modify exact [eax] nomemory;
    490421
    491422#pragma aux ASMBitLastSetU32 = \
    492     "shl edx, 16" \
    493     "mov dx, ax" \
    494     "bsr eax, edx" \
     423    "bsr eax, eax" \
    495424    "jz  not_found" \
    496     "inc ax" \
     425    "inc eax" \
    497426    "jmp done" \
    498427    "not_found:" \
    499     "xor ax, ax" \
     428    "xor eax, eax" \
    500429    "done:" \
    501     parm [ax dx] nomemory \
    502     value [ax] \
    503     modify exact [ax dx] nomemory;
     430    parm [eax] nomemory \
     431    value [eax] \
     432    modify exact [eax] nomemory;
    504433
    505434#pragma aux ASMByteSwapU16 = \
     
    510439
    511440#pragma aux ASMByteSwapU32 = \
    512     "xchg ax, dx" \
    513     parm [ax dx] nomemory \
    514     value [ax dx] \
    515     modify exact [ax dx] nomemory;
     441    "bswap eax" \
     442    parm [eax] nomemory \
     443    value [eax] \
     444    modify exact [eax] nomemory;
    516445
    517446#pragma aux ASMRotateLeftU32 = \
    518     "shl    edx, 16" \
    519     "mov    dx, ax" \
    520     "rol    edx, cl" \
    521     "mov    eax, edx" \
    522     "shr    edx, 16" \
    523     parm [ax dx] [cx] nomemory \
    524     value [ax dx] \
    525     modify exact [ax dx] nomemory;
     447    "rol    eax, cl" \
     448    parm [eax] [ecx] nomemory \
     449    value [eax] \
     450    modify exact [eax] nomemory;
    526451
    527452#pragma aux ASMRotateRightU32 = \
    528     "shl    edx, 16" \
    529     "mov    dx, ax" \
    530     "ror    edx, cl" \
    531     "mov    eax, edx" \
    532     "shr    edx, 16" \
    533     parm [ax dx] [cx] nomemory \
    534     value [ax dx] \
    535     modify exact [ax dx] nomemory;
     453    "ror    eax, cl" \
     454    parm [eax] [ecx] nomemory \
     455    value [eax] \
     456    modify exact [eax] nomemory;
    536457
    537458#endif
     459
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette