News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

A New Testbed for MASM32 Forum

Started by frktons, September 21, 2010, 05:25:26 PM

Previous topic - Next topic

frktons

Quote from: dedndave on November 24, 2010, 02:52:00 AM
:U

┌─────────────────────────────────────────────────────────────[24-Nov-2010 at 02:51 GMT]─┐
│OS  : Microsoft Windows XP Professional Service Pack 2 (build 2600)                     │
│CPU : Intel(R) Pentium(R) 4 CPU 3.00GHz with 2 logical core(s) with SSE3                │
├──────────────────────────────────┬─────────┬──────────┬──────────┬──────────┬──────────┤
│        Algorithm notes           │Proc Size│ Test # 1 │ Test # 2 │ Test # 3 │ Test # 4 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│01 Alex / MMX                     │ 55      │ 14,096   │ 14,641   │ 14,524   │ 14,501   │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│02 Frank / SSE2                   │ 45      │ 8,432    │ 8,768    │ 8,637    │ 8,278    │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤



Back Home  :P

Well, some minor adjustement and it'll be perfect.

The numbers are not right aligned as they should be. The update of Help, Info and ReadMe.txt will
come ASAP.

The correct alignment:


├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│04 Clive - IDIV and Stack         │   120   │    2.977 │    3.015 │    2.960 │    2.999 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│05 Clive - reciprocal IMUL        │   157   │    2.015 │    1.996 │    1.987 │    2.003 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│06 Hutch ustr$ + format algo      │   159   │    5.686 │    5.793 │    5.724 │    5.789 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤


This is my test, with [C] key:


┌─────────────────────────────────────────────────────────────[27-Nov-2010 at 17:56 GMT]─┐
│OS  : Microsoft Windows 7 Ultimate Edition, 64-bit (build 7600)                         │
│CPU : Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz with 2 logical core(s) with SSSE3           │
├──────────────────────────────────┬─────────┬──────────┬──────────┬──────────┬──────────┤
│        Algorithm notes           │Proc Size│ Test # 1 │ Test # 2 │ Test # 3 │ Test # 4 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│01 Alex / MMX                     │ 55      │ 5.605    │ 5.926    │ 5.600    │ 5.652    │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│02 Frank / SSE2                   │ 45      │ 4.567    │ 4.535    │ 4.557    │ 4.554    │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤

Mind is like a parachute. You know what to do in order to use it :-)

dedndave

welcome home, Frank
Alex added his manager   :U

Antariy

Quote from: frktons on November 27, 2010, 05:08:34 PM
The numbers are not right aligned as they should be. The update of Help, Info and ReadMe.txt will
come ASAP.

This is on-fast-hand solution for the "properly aligned" numbers: :P

Frank, find in testbed.asm:

    @@displaytiming:
    add edi,11
    INVOKE DisplayAt, edi, esi, ecx,eax


change to


    @@displaytiming:
    add edi,11
    push edi
    neg edi
    lea edi,[edi+eax-8]
    neg edi
    INVOKE DisplayAt, edi, esi, ecx,eax
    pop edi


and find this:


    add esp,12
   
    invoke DisplayAt,37,esi,offset AlgoTicksStr,eax
   
    ; print the tests


change to this:


    add esp,12
   
    lea ecx,[eax-7-37]
    neg ecx
               
    invoke DisplayAt,ecx,esi,offset AlgoTicksStr,eax
   
    ; print the tests


Use comments as reference points for search.

And you will have:


┌─────────────────────────────────────────────────────────────[28-Nov-2010 at 00:45 GMT]─┐
│OS  : Microsoft Windows XP Professional Service Pack 2 (build 2600)                     │
│CPU : Intel(R) Celeron(R) CPU 2.13GHz with 1 logical core(s) with SSE3                  │
├──────────────────────────────────┬─────────┬──────────┬──────────┬──────────┬──────────┤
│        Algorithm notes           │Proc Size│ Test # 1 │ Test # 2 │ Test # 3 │ Test # 4 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│01 Alex / MMX                     │      55 │   10 727 │   10 857 │   10 843 │   10 871 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│02 Frank / SSE2                   │      45 │    8 408 │    8 344 │    8 467 │    8 194 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤


:lol



Alex

frktons

Yes Alex, I'll have to change those lines in order to have aligned numbers.  :U

I was too tired yesterday, but I'll do it ASAP.  :bg

OK here it is:

┌─────────────────────────────────────────────────────────────[28-Nov-2010 at 09:03 GMT]─┐
│OS  : Microsoft Windows 7 Ultimate Edition, 64-bit (build 7600)                         │
│CPU : Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz with 2 logical core(s) with SSSE3           │
├──────────────────────────────────┬─────────┬──────────┬──────────┬──────────┬──────────┤
│        Algorithm notes           │Proc Size│ Test # 1 │ Test # 2 │ Test # 3 │ Test # 4 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│01 Alex / MMX                     │      55 │    5.361 │    5.345 │    5.344 │    5.352 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│02 Frank / SSE2                   │      45 │    4.419 │    4.417 │    4.418 │    4.416 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤


A little bit better, but the code size should stay 2 cols before and be right aligned as well...
Let's see where to change it...


    ; print the code size; <--------------------- from here it is a bit Cyrillic ASM
    xor ebp,ebp
   
    mov eax,[AlgosSizeTable+ebx*4-4]
    push eax
    neg eax
    sbb eax,eax
    and eax,2
    add AlgoRow,eax
    push offset fmtu
    push offset AlgoTicksStr
    call wsprintf;  <------ NOOOOOOOOOOOOOOOOO, you did it again. :-)
                    ;  we have a dozen conversion algo from bin to ASCII, no need
                    ;  to use this C function.
     
    add esp,12
   
    lea ecx,[eax-7-37];  <-----------------------  What about these "Magic Numbers"?
    neg ecx
               
    invoke DisplayAt,ecx,esi,offset AlgoTicksStr,eax


Probably it is better to talk about "How to change the cols" to display code size,
and how to right align it.  :bg


Frank
Mind is like a parachute. You know what to do in order to use it :-)

Antariy

Quote from: frktons on November 28, 2010, 08:50:48 AM
   1] call wsprintf;  <------ NOOOOOOOOOOOOOOOOO, you did it again. :-)
                    ;  we have a dozen conversion algo from bin to ASCII, no need
                    ;  to use this C function.
     
   
    2] lea ecx,[eax-7-37];  <-----------------------  What about these "Magic Numbers"?
    neg ecx

Probably it is better to talk about "How to change the cols" to display code size,
and how to right align it.  :bg

1] I like independency.
2] 37 is Y position of codesize printing. 7 - width of filed for print. EAX - size of string for printing. Since EAX is positive, but needed to substract it, used negative values for coordinates, and negatiation of result after calculation.

Antariy

Frank, find this:

    ; if you like "strange fancy methods", you can put zero instead of "1"
    ; here :P
    if 1
   
    add esp,8


and change "if 1" to "if 0". That would be more interesting  :lol

frktons

#291
Quote from: Antariy on November 28, 2010, 11:32:17 AM
Quote from: frktons on November 28, 2010, 08:50:48 AM
   1] call wsprintf;  <------ NOOOOOOOOOOOOOOOOO, you did it again. :-)
                    ;  we have a dozen conversion algo from bin to ASCII, no need
                    ;  to use this C function.
     
   
    2] lea ecx,[eax-7-37];  <-----------------------  What about these "Magic Numbers"?
    neg ecx

Probably it is better to talk about "How to change the cols" to display code size,
and how to right align it.  :bg

1] I like independency.
2] 37 is Y position of codesize printing. 7 - width of filed for print. EAX - size of string for printing. Since EAX is positive, but needed to substract it, used negative values for coordinates, and negatiation of result after calculation.


1) OK  :U You have to write your own language. The total independency from somebody else's code.  :lol
2) Good  :U, starting position should be 35 then. What about its right alignment?

It should look like this:

┬─────────┬
│Proc Size│
┼─────────┼
│    95   │
┼─────────┼
│    65   │
┼─────────┼
│    73   │
┼─────────┼
│   120   │
┼─────────┼
│   157   │
┼─────────┼
│   159   │
┼─────────┼


Will it look like this?

Quote from: Antariy on November 28, 2010, 11:43:23 AM
Frank, find this:

    ; if you like "strange fancy methods", you can put zero instead of "1"
    ; here :P
    if 1
   
    add esp,8


and change "if 1" to "if 0". That would be more interesting  :lol


I did it, but I did not notice any difference...  ::)


Frank
Mind is like a parachute. You know what to do in order to use it :-)

Antariy

Quote from: frktons on November 28, 2010, 03:48:09 PM
Quote from: Antariy on November 28, 2010, 11:43:23 AM
Frank, find this:

    ; if you like "strange fancy methods", you can put zero instead of "1"
    ; here :P
    if 1
   
    add esp,8


and change "if 1" to "if 0". That would be more interesting  :lol


I did it, but I did not notice any difference...  ::)

Differences is not seen. That saves ~7 bytes and clock or two :P And that's based on decision that wsprintf is wrapper to wvsprintf, so pointer to the output buffer on the stack was not changed.

frktons

Quote from: Antariy on November 28, 2010, 11:29:28 PM
Differences is not seen. That saves ~7 bytes and clock or two :P And that's based on decision that wsprintf is wrapper to wvsprintf,
so pointer to the output buffer on the stack was not changed.

We consume 200-300 cycles more with wsprintf, but we save 1 cycle using a stack pointer.  :lol  :lol  :eek  :lol  :lol
Mind is like a parachute. You know what to do in order to use it :-)

Antariy

Quote from: frktons on November 28, 2010, 11:35:39 PM
Quote from: Antariy on November 28, 2010, 11:29:28 PM
Differences is not seen. That saves ~7 bytes and clock or two :P And that's based on decision that wsprintf is wrapper to wvsprintf,
so pointer to the output buffer on the stack was not changed.

We consume 200-300 cycles more with wsprintf, but we save 1 cycle using a stack pointer.  :lol  :lol  :eek  :lol  :lol

Frank, when you do output to console, you do IPC to the CSRSS. That would cost millions of the cycles (or hundred of thousands)... Talking about making small not heavily looped code faster in context when you do this inside/or with heavy APIs - slightly strange.

In short, even if you will replace all regular (not strongly looped) code in testbed with 10 times faster, you will not notice even millisecond of speed-up :P

But 7 bytes of size decreasing is very big amount of data, where can be putted some new advertisement  :green2

frktons

Quote from: Antariy on November 28, 2010, 11:44:04 PM
Frank, when you do output to console, you do IPC to the CSRSS. That would cost millions of the cycles (or hundred of thousands)... Talking about making small not heavily looped code faster in context when you do this inside/or with heavy APIs - slightly strange.

In short, even if you will replace all regular (not strongly looped) code in testbed with 10 times faster, you will not notice even millisecond of speed-up :P

But 7 bytes of size decreasing is very big amount of data, where can be putted some new advertisement  :green2

We cannot do anything about Win API that we have to call anyway to get a display, or read a file, or anything OS related.
But if we save 7 bytes we can have more advertisement.... Oh my God, what am I saying?  :dazzled:

Alex, can you post the results of three or more tests of algos that have a code size bigger than 100 bytes?
You can use the six algos of 1.51 release I posted above.

You have created  a very strange version, using my 1.30 version instead of latest 1.51 version, making it impossible
for me to track all the changes I made from 1.30 to 1.51.

I cannot replace again all the code updated from 1.30 onwards. You should do it from now on.  :lol
Mind is like a parachute. You know what to do in order to use it :-)

Antariy

Quote from: frktons on November 28, 2010, 11:58:40 PM
1] We cannot do anything about Win API that we have to call anyway to get a display, or read a file, or anything OS related.
2] But if we save 7 bytes we can have more advertisement.... Oh my God, what am I saying?  :dazzled:

3] Alex, can you post the results of three or more tests of algos that have a code size bigger than 100 bytes?
You can use the six algos of 1.51 release I posted above.

4] You have created  a very strange version, using my 1.30 version instead of latest 1.51 version, making it impossible
for me to track all the changes I made from 1.30 to 1.51.

5] I cannot replace again all the code updated from 1.30 onwards. You should do it from now on.  :lol

1] That is reason why you should prefer smaller code in that situations :P
2]  :lol
3]

┌─────────────────────────────────────────────────────────────[29-Nov-2010 at 00:09 GMT]─┐
│OS  : Microsoft Windows XP Professional Service Pack 2 (build 2600)                     │
│CPU : Intel(R) Celeron(R) CPU 2.13GHz with 1 logical core(s) with SSE3                  │
├──────────────────────────────────┬─────────┬──────────┬──────────┬──────────┬──────────┤
│        Algorithm notes           │Proc Size│ Test # 1 │ Test # 2 │ Test # 3 │ Test # 4 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│01 Alex / MMX                     │    55   │   10 778 │   10 782 │   10 733 │   10 888 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│02 Frank / SSE2                   │    45   │    8 698 │    8 453 │    8 433 │    8 513 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│03 Here can be your advertisement │   999   │          │          │          │          │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤


4] No, I used 1.51 You should see more accurately :P I just strip "Description of the test" from main source file.
5] No, due to (4]) :P

frktons

So, in your opinion this:


┌─────────────────────────────────────────────────────────────[29-Nov-2010 at 00:11 GMT]─┐
│OS  : Microsoft Windows 7 Ultimate Edition, 64-bit (build 7600)                         │
│CPU : Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz with 2 logical core(s) with SSSE3           │
├──────────────────────────────────┬─────────┬──────────┬──────────┬──────────┬──────────┤
│        Algorithm notes           │Proc Size│ Test # 1 │ Test # 2 │ Test # 3 │ Test # 4 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│01 ustrv$ + GetNumberFormat       │    95   │   44.249 │   44.105 │   44.029 │   44.111 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│02 udw2str + GetNumberFormat      │    65   │   43.924 │   43.896 │   43.832 │   43.951 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│03 wsprintf + GetNumberFormat     │    73   │   50.304 │   50.285 │   50.279 │   50.330 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│04 Clive - IDIV and Stack         │   120   │    3.039 │    2.933 │    2.983 │    2.965 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│05 Clive - reciprocal IMUL        │   157   │    2.033 │    2.046 │    1.929 │    2.029 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│06 Hutch ustr$ + format algo      │   159   │    5.630 │    5.667 │    5.675 │    5.681 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤


is the same as this:



┌─────────────────────────────────────────────────────────────[29-Nov-2010 at 00:11 GMT]─┐
│OS  : Microsoft Windows 7 Ultimate Edition, 64-bit (build 7600)                         │
│CPU : Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz with 2 logical core(s) with SSSE3           │
├──────────────────────────────────┬─────────┬──────────┬──────────┬──────────┬──────────┤
│        Algorithm notes           │Proc Size│ Test # 1 │ Test # 2 │ Test # 3 │ Test # 4 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│01 Alex / MMX                     │    55   │    5.807 │    5.361 │    5.371 │    5.392 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│02 Frank / SSE2                   │    45   │    4.434 │    4.432 │    4.431 │    4.553 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤


Well, I need to learn more ASM then, I was guessing it was an old version.  ::)
Mind is like a parachute. You know what to do in order to use it :-)

Antariy

Quote from: frktons on November 29, 2010, 12:12:56 AM

So, in your opinion this:

is the same as this:

Well, I need to learn more ASM then, I was guessing it was an old version.  ::)

Core of the testbed is 1.51. All *TESTBED'S* algos is from 1.51. I'm only make my own files for my Manager. And have no desire to insert each algo to the test, so I used old Algo1.inc and Algo2.inc files in the new testbed :green2 Backward compatibility  :P

frktons

Quote from: Antariy on November 29, 2010, 12:28:01 AM
Core of the testbed is 1.51. All *TESTBED'S* algos is from 1.51. I'm only make my own files for my Manager. And have no desire to insert each algo to the test, so I used old Algo1.inc and Algo2.inc files in the new testbed :green2 Backward compatibility  :P

Very good.

Let's see how many users will use it, and after that I'll add any update or improvement I'll see fit.
:P
Mind is like a parachute. You know what to do in order to use it :-)