VirtualBox

Ignore:
Timestamp:
Jan 31, 2016 11:54:20 AM (9 years ago)
Author:
vboxsync
Message:

iprt/asm.h: Experimented with alternative serializating instructions (ASMSerializeInstruction), cpuid(0) is very reasonable compared to iret (rdtscp would be preferable).

File:
1 edited

Legend:

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

    r59480 r59527  
    150150/* ASMAtomicCmpXchgExU64: External assembly implementation, too few registers for parameters.  */
    151151
    152 #undef      ASMSerializeInstruction
    153 #if 1
    154 # pragma aux ASMSerializeInstruction = \
     152#undef      ASMSerializeInstructionCpuId
     153#pragma aux ASMSerializeInstructionCpuId = \
     154    ".586" \
     155    "xor eax, eax" \
     156    "cpuid" \
     157    parm [] \
     158    modify exact [ax bx cx dx];
     159
     160#undef ASMSerializeInstructionIRet
     161#pragma aux ASMSerializeInstructionIRet = \
    155162    "pushf" \
    156163    "push cs" \
     
    158165    "jmp  done" \
    159166    "foo:" \
    160     "iret" /* serializing */ \
     167    "iret" \
    161168    "done:" \
    162169    parm [] \
    163     modify exact [ax];
    164 #else
    165 # pragma aux ASMSerializeInstruction = \
    166     ".586" \
    167     "xor eax, eax" \
    168     "cpuid" \
     170    modify exact [];
     171
     172#undef      ASMSerializeInstructionRdTscp
     173#pragma aux ASMSerializeInstructionRdTscp = \
     174    0x0f 0x01 0xf9 \
    169175    parm [] \
    170     modify exact [ax bx cx dx];
    171 #endif
     176    modify exact [ax dx cx];
    172177
    173178#undef      ASMAtomicReadU64
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