News:

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

a counter of lines in mmx instructions

Started by ToutEnMasm, March 18, 2009, 09:20:18 AM

Previous topic - Next topic

Antariy

Quote from: sinsi on December 18, 2010, 11:52:46 PM
Win7 pro x64, quad q6600

Tests for correctness - 100 / 100 / 11 lines
expected, first string 5-byte misaligned:

jj2007=         99 / 100 / 11 lines
Lingo=          99 / 100 / 11 lines
Lingo2=         100 / 100 / 11 lines
ToutEnMasm=     100 / 100 / 11 lines
AxCountLines=   100 / 100 / 11 lines

Codesizes:
getlinesJJ =            153
getlines Lingo =        217
getlines Lingo2=        278
CompteurLignes =        238
AxCountLines =          262

Counting lines of \masm32\include\winextra.inc:

getlinesJJ: (jj2007)
3874 kiloLAMPs, 313 kilocycles for 20025 lines, 807877 bytes

getlines (Lingo):
4005 kiloLAMPs, 271 kilocycles for 20025 lines, 807877 bytes

getlines2 (Lingo):
5466 kiloLAMPs, 327 kilocycles for 20025 lines, 807877 bytes

CompteurLignes: (ToutEnMasm)
12880 kiloLAMPs, 834 kilocycles for 20025 lines, 807877 bytes

AxCountLines:
2358 kiloLAMPs, 145 kilocycles for 20025 lines, 807877 bytes

LAMPs = Lean And Mean Points = cycles * sqrt(codesize)


Thank you!

GregL

Intel(R) Core(TM)2 Duo CPU     T5750  @ 2.00GHz

Tests for correctness - 100 / 100 / 11 lines
expected, first string 5-byte misaligned:

jj2007=         99 / 100 / 11 lines
Lingo=          99 / 100 / 11 lines
Lingo2=         100 / 100 / 11 lines
ToutEnMasm=     100 / 100 / 11 lines
AxCountLines=   100 / 100 / 11 lines

Codesizes:
getlinesJJ =            153
getlines Lingo =        217
getlines Lingo2=        278
CompteurLignes =        238
AxCountLines =          262

Counting lines of \masm32\include\winextra.inc:

getlinesJJ: (jj2007)
3989 kiloLAMPs, 322 kilocycles for 20025 lines, 807877 bytes

getlines (Lingo):
4047 kiloLAMPs, 274 kilocycles for 20025 lines, 807877 bytes

getlines2 (Lingo):
5529 kiloLAMPs, 331 kilocycles for 20025 lines, 807877 bytes

CompteurLignes: (ToutEnMasm)
10623 kiloLAMPs, 688 kilocycles for 20025 lines, 807877 bytes

AxCountLines:
2379 kiloLAMPs, 146 kilocycles for 20025 lines, 807877 bytes

LAMPs = Lean And Mean Points = cycles * sqrt(codesize)

frktons

Win7/64 Ultimate/Core Duo 2 -  2.6 Ghz:


Tests for correctness - 100 / 100 / 11 lines
expected, first string 5-byte misaligned:

jj2007=         99 / 100 / 11 lines
Lingo=          99 / 100 / 11 lines
Lingo2=         100 / 100 / 11 lines
ToutEnMasm=     100 / 100 / 11 lines
AxCountLines=   100 / 100 / 11 lines

Codesizes:
getlinesJJ =            153
getlines Lingo =        217
getlines Lingo2=        278
CompteurLignes =        238
AxCountLines =          262

Counting lines of \masm32\include\winextra.inc:

getlinesJJ: (jj2007)
3874 kiloLAMPs, 313 kilocycles for 20025 lines, 807877 bytes

getlines (Lingo):
4006 kiloLAMPs, 271 kilocycles for 20025 lines, 807877 bytes

getlines2 (Lingo):
5449 kiloLAMPs, 326 kilocycles for 20025 lines, 807877 bytes

CompteurLignes: (ToutEnMasm)
12865 kiloLAMPs, 833 kilocycles for 20025 lines, 807877 bytes

AxCountLines:
2358 kiloLAMPs, 145 kilocycles for 20025 lines, 807877 bytes

LAMPs = Lean And Mean Points = cycles * sqrt(codesize)


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

Antariy


oex


getlinesJJ: (jj2007)
12431 kiloLAMPs, 1004 kilocycles for 20025 lines, 807877 bytes

getlines (Lingo):
12121 kiloLAMPs, 822 kilocycles for 20025 lines, 807877 bytes

getlines2 (Lingo):
12332 kiloLAMPs, 739 kilocycles for 20025 lines, 807877 bytes

CompteurLignes: (ToutEnMasm)
15094 kiloLAMPs, 978 kilocycles for 20025 lines, 807877 bytes

AxCountLines:
9739 kiloLAMPs, 601 kilocycles for 20025 lines, 807877 bytes
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

Antariy


lingo

"An old subject,Here is the algo i use in many prog:
pmem = pointer on memory block with lines (13,10 ended and not only 10 )"


ToutEnMasm,
As you see nobody read your post carefully and didn't check  the "Tubeteikin's" code
to catch the fraud: This asian lamer compares apples with oranges coz "his" lame code counts just 1 byte (0dh)
against other's algos which counts MANDATORY 2 bytes (13,10). Hence, "his" code is not for this thread! :naughty:

Antariy

Quote from: lingo on December 19, 2010, 05:21:37 AM
"An old subject,Here is the algo i use in many prog:
pmem = pointer on memory block with lines (13,10 ended and not only 10 )"


ToutEnMasm,
As you see nobody read your post carefully and didn't check  the "Tubeteikin's" code
to catch the fraud: This asian lamer compares apples with oranges coz "his" lame code counts just 1 byte (0dh)
against other's algos which counts MANDATORY 2 bytes (13,10). Hence, "his" code is not for this thread! :naughty:

You are contrary to yourself: "http://www.masm32.com/board/index.php?topic=14438.msg116374#msg116374"
If data specially prepared to be wrong, nothing will prevent this, only big slow checking code. As you like to say: this is fast code without checking. :P
"I don't care because these are just a speed optimized functions "

No, just as usually, you, lingo, is a lamer which tries to "optimize" other's algos. And when your timings is bad, you can insult only, not produce new algo.
Try to beat concept of delayed acumullation which I used in my algo. And try to use your own idea, instead of great speech about your "friends" and usage of theirs algos.

hutch--

If this code is to be universal you must be able to handle more combinations of ASCII 13,10.

MS DOS / Windows  13 10
UNIX 10
MAC 13 (Richedit 2 and later)
OLD DOS 13 13 10 (Extra CR to make the printer work correctly.)
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dedndave

and - don't forget 10,13 - lol
i have seen it plenty of times

Antariy

Quote from: hutch-- on December 19, 2010, 11:34:36 PM
If this code is to be universal you must be able to handle more combinations of ASCII 13,10.

MS DOS / Windows  13 10
UNIX 10
MAC 13 (Richedit 2 and later)
OLD DOS 13 13 10 (Extra CR to make the printer work correctly.)

Yes, Hutch. For my proc you can specify lines delimiter you want to use - 13 or 10, or anything else (for IBM EBCDIC encoding, for example).

Other's code use hard-coded line delimiter, and much less flexible.

lingo

"and - don't forget 10,13 - lol"

He can compare&count just 10 OR 13 OR every other BYTE at the same time but can't compare&count  two different and consecutive bytes like 10 AND 13 OR every other WORD at the same time!

ToutEnMasm

Quote
He can compare&count just 10 OR 13 OR every other BYTE at the same time but can't compare&count  two different and consecutive bytes like 10 AND 13 OR every other WORD at the same time!
??????????????????????????????????????
To make it universal a few changes are needed.
A version for lines breaks of one byte and one for lines breaks of two bytes.
I have some files in old dos (using 13,10) and what hutch call old dos (13,13,10) must be very very old.
With two versions of the proc (line break byte and line break word) there is just to use two constants for each forms of breakline.
WinBreakLine equ 0D0Ah
MaskXmm  equ  0d0d0d0dh
;other types of break lines
XBreakLine equ 0A0Dh
XMaskXmm  equ  0A0A0A0Ah
The same things can be done for line break byte
Finally a parameter can be added to the function with the value of the break line.
That all
Quote
;--------------------------  search in aligned part -------------     
   ;init of various register
   mov eax, 0d0d0d0dh   ; Ascii 10, linefeed
An another way is to make a conversion of the line break in another file.