[M3commit] CVS Update: cm3
Jay Krell
jkrell at elego.de
Fri Feb 12 11:45:54 CET 2010
CVSROOT: /usr/cvs
Changes by: jkrell at birch. 10/02/12 11:45:54
Modified files:
cm3/m3-sys/m3back/src/: Codex86.m3 M3x86.m3
Log message:
fix compare_exchange by hand-building the modrm part of the instruction
Still, it would be better if compare_exchange took a Var parameter
in the function call instead of on the stack.
Witness the code:
0000018E: 8D3538000000 LEA ESI gv.2[_MM_Main]+56
00000194: 8D3D98000000 LEA EDI gv.2[_MM_Main]+152
0000019A: 8BC7 MOV EAX EDI
0000019C: 8B1D9C000000 MOV EBX gv.2[_MM_Main]+156
000001A2: F00FB133 LOCK CMPXCHG ESI EBX
should really be more like:
00000194: 8D3D98000000 MOV EAX gv.2[_MM_Main]+152
0000019C: 8B1D9C000000 MOV EBX gv.2[_MM_Main]+156
000001A2: F00FB133 LOCK CMPXCHG gv.2[_MM_Main]+56 EBX
which should be easy to achieve if compare_exchange took
its parameters in the function call instead of on the stack.
3 instructions instead of 5!
More information about the M3commit
mailing list