News:

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

This is too slow

Started by frktons, November 18, 2010, 03:10:21 AM

Previous topic - Next topic

jj2007

There is also the qword algo by drizz here.

frktons

Quote from: hutch-- on November 20, 2010, 12:31:35 AM
Frank,

The trick is to have your testbed so it uses standard MASM algorithms so you don't have to adapt them. Align each algo if its not aligned itself, if you ned to show the size in bytes (I don't personally care) then use a label either end do the arithmetic at assembly time.

These algo and a number of others are for the masm32 library so they must be presented in that form.

The code is not prepared for the test I'm doing. If I test an array of 16 unsigned dword, the timings are
related to perform that task. This is the reason I have to adapt the code. Moreover the task is to convert from
unsigned dword to ASCII string with thousand separator.
If a routine doesn't do that, but only a partial task, I need to fill the gap if I want to use it in the testbed.

It is a good exercise for me, I have to admit, but sometime I'm just too tired, as I'm now, and I'm going to sleep.

Maybe after the week-end I can undertake this new task. But it would be better if the code were not
posted, but inserted into the testbed. It has its own structure, not difficult to grasp, and info how to use it.

The size is calculated at assemble time through the labels inside which the code should be inserted.

There is no need to adapt or rewrite code, if you start with the template I have inserted into the zip.
Apparently not many have read anything about the use of it, or the task to do in this test.

Thanks anyway for your contribution.

Quote from: jj2007 on November 20, 2010, 12:40:02 AM
There is also the qword algo by drizz here.

Thanks Jochen  :U


Frank


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

clive

┌─────────────────────────────────────────────────────────────[20-Nov-2010 at 05:36 GMT]─┐
│OS  : Microsoft Windows 7 Home Premium Edition, 64-bit (build 7600)                     │
│CPU : AMD Athlon(tm) II X2 215 Processor with 2 logical core(s) with SSE3               │
├──────────────────────────────────┬─────────┬──────────┬──────────┬──────────┬──────────┤
│        Algorithm notes           │Proc Size│ Test # 1 │ Test # 2 │ Test # 3 │ Test # 4 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│01 ustrv$ + GetNumberFormat       │    95   │   53,977 │   43,026 │   41,538 │   41,453 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│02 udw2str + GetNumberFormat      │    65   │   42,022 │   41,842 │   41,732 │   50,379 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│03 wsprintf + GetNumberFormat     │    73   │   59,343 │   66,041 │   48,354 │   56,633 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│04 Clive - IDIV and Stack         │   120   │   13,839 │   11,373 │   13,800 │   13,972 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│05 Clive - reciprocal IMUL        │   157   │    3,371 │    5,327 │    6,293 │    6,316 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│06 Hutch ustr$ + format algo      │   159   │   12,321 │    6,406 │   12,503 │   11,744 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
It could be a random act of randomness. Those happen a lot as well.

frktons

Clive, your algo has been adopted into the testbed to format the numbers  :U

The attached release also should correct the problems with partial copy of clipboard
due to incompatibilities between MASM 10 that I use, and older versions before MASM 9.

Try this and let me know.

IMPORTANT if you use a machine that is not SSE2 capable, in the main prog: TestBed.asm
set the flag: SSE2 to OFF, otherwise you won't see the screens.

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

Antariy

It works. Results are copied with original EXE and with ML8 recompilation.

frktons

Quote from: Antariy on November 21, 2010, 09:57:25 PM
It works. Results are copied with original EXE and with ML8 recompilation.


I put a mov BYTE PTR [esi], al
instead of mov [esi], al because I already experienced this problem
with other PROCs, when compiling with MASM older than ver. 9.

So it should work from MASM 6.15 up in this fashion.  :P
Mind is like a parachute. You know what to do in order to use it :-)

Antariy

Quote from: frktons on November 21, 2010, 10:04:04 PM
I put a mov DWORD PTR [esi], al
instead of mov [esi], al because I already experienced this problem
with other PROCs, when compiling with MASM older than ver. 9.

So it should work from MASM 6.15 up in this fashion.  :P

I have some doubts about that :P

frktons

Quote from: Antariy on November 21, 2010, 10:08:45 PM
Quote from: frktons on November 21, 2010, 10:04:04 PM
I put a mov DWORD PTR [esi], al
instead of mov [esi], al because I already experienced this problem
with other PROCs, when compiling with MASM older than ver. 9.

So it should work from MASM 6.15 up in this fashion.  :P

I have some doubts about that :P


Why? Oh sure it should be Byte PTR

The program is correct, I wrote rubbish here.  :P
Mind is like a parachute. You know what to do in order to use it :-)

dedndave

with MOV [ESI],AL - the assembler knows the size is a byte
if you MOV [ESI],0 - the assember does not know, so you need MOV BYTE PTR [ESI],0
it is the same for all versions of masm   :8)

frktons

Quote from: dedndave on November 21, 2010, 10:12:14 PM
with AL, the assembler knows the size is a byte
if you MOV [ESI],0 - the assember does not know, so you need MOV BYTE PTR [ESI],0

This happens with MASM from 8 below, from 9 upwards it doesn't.  :P

Try this new version with your pc and tell me if the clipboard copy  is still incomplete.
Mind is like a parachute. You know what to do in order to use it :-)

Antariy

Quote from: frktons on November 21, 2010, 10:09:17 PM
Quote from: Antariy on November 21, 2010, 10:08:45 PM
Quote from: frktons on November 21, 2010, 10:04:04 PM
I put a mov DWORD PTR [esi], al
instead of mov [esi], al because I already experienced this problem
with other PROCs, when compiling with MASM older than ver. 9.

So it should work from MASM 6.15 up in this fashion.  :P

I have some doubts about that :P


Why? Oh sure it should be Byte PTR

The program is correct, I wrote rubbish here.  :P


:lol :P

dedndave

i am sitting with dad - to give mom a break   :P
so, i am not on the same machine
i hate this keyboard - lol
in fact, i hate this computer

Antariy

Quote from: frktons on November 21, 2010, 10:13:12 PM
Quote from: dedndave on November 21, 2010, 10:12:14 PM
with AL, the assembler knows the size is a byte
if you MOV [ESI],0 - the assember does not know, so you need MOV BYTE PTR [ESI],0

This happens with MASM from 8 below, from 9 upwards it doesn't.  :P

Try this new version with your pc and tell me if the clipboard copy  is still incomplete.

Frank, Dave is right with an immediate - in any case you should specify datasize when you move immediate to memory. Assembler don't know which "0" is you write - byte/word/dword sized.

frktons

This rel 1.51 should be able to run on old and new machines, provided that the user set the SSE2 flag
to the correct state. ON = machine SSE2 capable, OFF = machine SSE2 not capable  :lol

Well I guess I was moving al to [esi] and it didn't work with older MASM versions.

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

frktons

Quote from: dedndave on November 21, 2010, 10:16:00 PM
i am sitting with dad - to give mom a break   :P
so, i am not on the same machine
i hate this keyboard - lol

Well, when you can, obviously.  :U
Mind is like a parachute. You know what to do in order to use it :-)