Hi!
1-Май-2005 14:46 [EMAIL PROTECTED] (Michael Devore) wrote to
[email protected]:
MD> If you're really bored, code up a C-based MMX/SSE/SSE2 detection and
MD> ASM-based generally (all supporting processors) optimized memory move for
MD> both MMX and SSE2 which can be put in HIMEM and EMM386 for XMS copy, EMS
MD> copy, and INT 15h, function 87h. All three functions potentially move
MD> kilobytes of information and can be called often enough for it to make a
MD> difference.
I fear, I can't do this, because:
- I not known neither with protected mode nor with extended instuction sets
(MMX, SSE, etc);
- I not known with himem/emm386 underwears, where mentioned code should be
placed;
- making "sized" (small) code is much easier, than "timed" (fast) code,
because timed code requires much more knows (of CPU internal architecture)
and profilings (on many different platforms).
About last issue: different tricks (like copying from top to bottom) may
give different gain (up to negative) on different platorms/contexts, because
most of them depends on instructions pairing, cache size/architecture, etc.
About MMX: it not neccesarily may give any gain. For example, author of
TESTMEM, gives no useful effect for memory testing (ie. it less loaded
because slower transfer). Anyway, it quotes his procedures for reading and
writing, including MMX code:
______________O\_/_________________________________\_/O______________
Write_All_RAM:
mov ds:[edi],eax
mov ds:[edi+4],eax
mov ds:[edi+8],ebx
mov ds:[edi+12],ebx
mov ds:[edi+16],edx
mov ds:[edi+20],edx
mov ds:[edi+24],ebp
mov ds:[edi+28],ebp
add edi,32
add eax,esi
add ebx,esi
add edx,esi
add ebp,esi
cmp edi,ecx
jb Write_All_RAM
_____________________________________________________________________
O/~\ /~\O
______________O\_/_________________________________\_/O______________
MMX_read:
movq mm0,qword ptr ds:[di]
movq mm1,qword ptr ds:[di+8]
movq mm2,qword ptr ds:[di+16]
movq mm3,qword ptr ds:[di+24]
add edi,32
cmp edi,ecx
jb MMX_read
_____________________________________________________________________
O/~\ /~\O
______________O\_/_________________________________\_/O______________
Compare_RAM:
cmp eax,ds:[EDI]
jne Bad_1_Word
cmp eax,ds:[EDI+4]
jne Bad_2_Word
cmp ebx,ds:[EDI+8]
jne Bad_3_Word
cmp ebx,ds:[EDI+12]
jne Bad_4_Word
cmp edx,ds:[EDI+16]
jne Bad_5_Word
cmp edx,ds:[EDI+20]
jne Bad_6_Word
cmp ebp,ds:[EDI+24]
jne Bad_7_Word
cmp ebp,ds:[EDI+28]
jne Bad_8_Word
Next_Compare: add edi,32
add eax,esi
add ebx,esi
add edx,esi
add ebp,esi
cmp edi,ecx
jb Compare_RAM
_____________________________________________________________________
O/~\ /~\O
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel